Skip to content

Commit

Permalink
Merge pull request #171556 from ggreif/llvm_14-21.11
Browse files Browse the repository at this point in the history
[21.11] llvmPackages_14: 14.0.0rc1 -> 14.0.1
  • Loading branch information
primeos authored May 6, 2022
2 parents 5656d7f + 745f884 commit ad66740
Show file tree
Hide file tree
Showing 8 changed files with 44 additions and 111 deletions.
1 change: 1 addition & 0 deletions pkgs/development/compilers/llvm/14/clang/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ let
mkdir -p "$out"
cp -r ${monorepoSrc}/cmake "$out"
cp -r ${monorepoSrc}/${pname} "$out"
cp -r ${monorepoSrc}/clang-tools-extra "$out"
'';

sourceRoot = "${src.name}/${pname}";
Expand Down
6 changes: 3 additions & 3 deletions pkgs/development/compilers/llvm/14/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@
}:

let
release_version = "14.0.0";
candidate = "rc1"; # empty or "rcN"
release_version = "14.0.1";
candidate = ""; # empty or "rcN"
dash-candidate = lib.optionalString (candidate != "") "-${candidate}";
rev = ""; # When using a Git commit
rev-version = ""; # When using a Git commit
Expand All @@ -30,7 +30,7 @@ let
owner = "llvm";
repo = "llvm-project";
rev = if rev != "" then rev else "llvmorg-${version}";
sha256 = "sha256-bO13J5bhE4YVGvoaTuzFgf62HYh+Shv6T0u07CFjI9E=";
sha256 = "14wgrjwj02ivlwb1zgidacspkkcfpsqjmgd7r838qmwpk56yxl9f";
};

llvm_meta = {
Expand Down
3 changes: 3 additions & 0 deletions pkgs/development/compilers/llvm/14/llvm/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -209,6 +209,9 @@ in stdenv.mkDerivation (rec {

checkTarget = "check-all";

# For the update script:
passthru.monorepoSrc = monorepoSrc;

requiredSystemFeatures = [ "big-parallel" ];
meta = llvm_meta // {
homepage = "https://llvm.org/";
Expand Down
19 changes: 15 additions & 4 deletions pkgs/development/compilers/llvm/14/openmp/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
, runCommand
, cmake
, llvm
, lit
, clang-unwrapped
, perl
, pkg-config
Expand All @@ -25,16 +26,27 @@ stdenv.mkDerivation rec {

patches = [
./gnu-install-dirs.patch
./fix-find-tool.patch
./run-lit-directly.patch
];

outputs = [ "out" "dev" ];

nativeBuildInputs = [ cmake perl pkg-config clang-unwrapped ];
nativeBuildInputs = [ cmake perl pkg-config lit ];
buildInputs = [ llvm ];

# Unsup:Pass:XFail:Fail
# 26:267:16:8
doCheck = false;
checkTarget = "check-openmp";

preCheck = ''
patchShebangs ../tools/archer/tests/deflake.bash
'';

cmakeFlags = [
"-DLIBOMPTARGET_BUILD_AMDGCN_BCLIB=OFF" # Building the AMDGCN device RTL currently fails
"-DCLANG_TOOL=${clang-unwrapped}/bin/clang"
"-DOPT_TOOL=${llvm}/bin/opt"
"-DLINK_TOOL=${llvm}/bin/llvm-link"
];

meta = llvm_meta // {
Expand All @@ -50,6 +62,5 @@ stdenv.mkDerivation rec {
# "All of the code is dual licensed under the MIT license and the UIUC
# License (a BSD-like license)":
license = with lib.licenses; [ mit ncsa ];
broken = true; # TODO: gnu-install-dirs.patch fails to apply
};
}
54 changes: 0 additions & 54 deletions pkgs/development/compilers/llvm/14/openmp/fix-find-tool.patch

This file was deleted.

52 changes: 4 additions & 48 deletions pkgs/development/compilers/llvm/14/openmp/gnu-install-dirs.patch
Original file line number Diff line number Diff line change
@@ -1,17 +1,7 @@
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 7f11a05f5622..fb90f8f6a49b 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -8,6 +8,8 @@ if (OPENMP_STANDALONE_BUILD OR "${CMAKE_SOURCE_DIR}" STREQUAL "${CMAKE_CURRENT_S
set(OPENMP_STANDALONE_BUILD TRUE)
project(openmp C CXX)

+ include(GNUInstallDirs)
+
# CMAKE_BUILD_TYPE was not set, default to Release.
if (NOT CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE Release)
@@ -19,7 +21,7 @@ if (OPENMP_STANDALONE_BUILD OR "${CMAKE_SOURCE_DIR}" STREQUAL "${CMAKE_CURRENT_S
@@ -24,7 +24,7 @@ if (OPENMP_STANDALONE_BUILD)
set(OPENMP_LIBDIR_SUFFIX "" CACHE STRING
"Suffix of lib installation directory, e.g. 64 => lib64")
# Do not use OPENMP_LIBDIR_SUFFIX directly, use OPENMP_INSTALL_LIBDIR.
Expand All @@ -20,7 +10,7 @@ index 7f11a05f5622..fb90f8f6a49b 100644

# Group test settings.
set(OPENMP_TEST_C_COMPILER ${CMAKE_C_COMPILER} CACHE STRING
@@ -30,7 +32,7 @@ if (OPENMP_STANDALONE_BUILD OR "${CMAKE_SOURCE_DIR}" STREQUAL "${CMAKE_CURRENT_S
@@ -35,7 +35,7 @@ if (OPENMP_STANDALONE_BUILD)
else()
set(OPENMP_ENABLE_WERROR ${LLVM_ENABLE_WERROR})
# If building in tree, we honor the same install suffix LLVM uses.
Expand All @@ -29,10 +19,10 @@ index 7f11a05f5622..fb90f8f6a49b 100644

if (NOT MSVC)
set(OPENMP_TEST_C_COMPILER ${LLVM_RUNTIME_OUTPUT_INTDIR}/clang)
index 0e1ce2afd154..8b3810f83713 100644
diff --git a/libomptarget/plugins/amdgpu/CMakeLists.txt b/libomptarget/plugins/amdgpu/CMakeLists.txt
--- a/libomptarget/plugins/amdgpu/CMakeLists.txt
+++ b/libomptarget/plugins/amdgpu/CMakeLists.txt
@@ -80,7 +80,7 @@ add_library(omptarget.rtl.amdgpu SHARED
@@ -74,7 +74,7 @@ add_library(omptarget.rtl.amdgpu SHARED

# Install plugin under the lib destination folder.
# When we build for debug, OPENMP_LIBDIR_SUFFIX get set to -debug
Expand All @@ -42,7 +32,6 @@ index 0e1ce2afd154..8b3810f83713 100644

if(CMAKE_SYSTEM_NAME MATCHES "FreeBSD")
diff --git a/libomptarget/plugins/ve/CMakeLists.txt b/libomptarget/plugins/ve/CMakeLists.txt
index 16ce0891ca23..db30ee9c769f 100644
--- a/libomptarget/plugins/ve/CMakeLists.txt
+++ b/libomptarget/plugins/ve/CMakeLists.txt
@@ -32,7 +32,7 @@ if(${LIBOMPTARGET_DEP_VEO_FOUND})
Expand All @@ -54,36 +43,3 @@ index 16ce0891ca23..db30ee9c769f 100644

target_link_libraries(
"omptarget.rtl.${tmachine_libname}"
diff --git a/runtime/src/CMakeLists.txt b/runtime/src/CMakeLists.txt
index e4f4e6e1e73f..1164b3b22b0e 100644
--- a/runtime/src/CMakeLists.txt
+++ b/runtime/src/CMakeLists.txt
@@ -346,13 +346,13 @@ add_dependencies(libomp-micro-tests libomp-test-deps)
# We want to install libomp in DESTDIR/CMAKE_INSTALL_PREFIX/lib
# We want to install headers in DESTDIR/CMAKE_INSTALL_PREFIX/include
if(${OPENMP_STANDALONE_BUILD})
- set(LIBOMP_HEADERS_INSTALL_PATH include)
+ set(LIBOMP_HEADERS_INSTALL_PATH "${CMAKE_INSTALL_INCLUDEDIR}")
else()
string(REGEX MATCH "[0-9]+\\.[0-9]+(\\.[0-9]+)?" CLANG_VERSION ${PACKAGE_VERSION})
set(LIBOMP_HEADERS_INSTALL_PATH "${OPENMP_INSTALL_LIBDIR}/clang/${CLANG_VERSION}/include")
endif()
if(WIN32)
- install(TARGETS omp RUNTIME DESTINATION bin)
+ install(TARGETS omp RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})
install(TARGETS ${LIBOMP_IMP_LIB_TARGET} ARCHIVE DESTINATION "${OPENMP_INSTALL_LIBDIR}")
# Create aliases (regular copies) of the library for backwards compatibility
set(LIBOMP_ALIASES "libiomp5md")
diff --git a/tools/multiplex/CMakeLists.txt b/tools/multiplex/CMakeLists.txt
index 64317c112176..4002784da736 100644
--- a/tools/multiplex/CMakeLists.txt
+++ b/tools/multiplex/CMakeLists.txt
@@ -4,7 +4,7 @@ if(LIBOMP_OMPT_SUPPORT)
add_library(ompt-multiplex INTERFACE)
target_include_directories(ompt-multiplex INTERFACE ${CMAKE_CURRENT_SOURCE_DIR})

- install(FILES ompt-multiplex.h DESTINATION include)
+ install(FILES ompt-multiplex.h DESTINATION ${CMAKE_INSTALL_INCLUDEDIR})

add_subdirectory(tests)
endif()
12 changes: 12 additions & 0 deletions pkgs/development/compilers/llvm/14/openmp/run-lit-directly.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
diff --git a/cmake/OpenMPTesting.cmake b/cmake/OpenMPTesting.cmake
--- a/cmake/OpenMPTesting.cmake
+++ b/cmake/OpenMPTesting.cmake
@@ -185,7 +185,7 @@ function(add_openmp_testsuite target comment)
if (${OPENMP_STANDALONE_BUILD})
set(LIT_ARGS ${OPENMP_LIT_ARGS} ${ARG_ARGS})
add_custom_target(${target}
- COMMAND ${PYTHON_EXECUTABLE} ${OPENMP_LLVM_LIT_EXECUTABLE} ${LIT_ARGS} ${ARG_UNPARSED_ARGUMENTS}
+ COMMAND ${OPENMP_LLVM_LIT_EXECUTABLE} ${LIT_ARGS} ${ARG_UNPARSED_ARGUMENTS}
COMMENT ${comment}
DEPENDS ${ARG_DEPENDS}
USES_TERMINAL
8 changes: 6 additions & 2 deletions pkgs/development/compilers/llvm/update.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,11 @@ sed -Ei \

readonly ATTRSET="llvmPackages_$VERSION_MAJOR"

if [ "$VERSION_MAJOR" -ge "13" ]; then
if [ "$VERSION_MAJOR" -ge "14" ]; then
readonly SOURCES=(
"llvm.monorepoSrc"
)
elif [ "$VERSION_MAJOR" -eq "13" ]; then
readonly SOURCES=(
"llvm.src"
)
Expand All @@ -43,7 +47,7 @@ fi
for SOURCE in "${SOURCES[@]}"; do
echo "Updating the hash of $SOURCE:"
declare ATTR="$ATTRSET.$SOURCE"
declare OLD_HASH="$(nix eval -f . $ATTR.outputHash)"
declare OLD_HASH="$(nix --extra-experimental-features nix-command eval -f . $ATTR.outputHash)"
declare NEW_HASH="\"$(nix-prefetch-url -A $ATTR)\""
find "$DIR" -type f -exec sed -i "s/$OLD_HASH/$NEW_HASH/" {} +
done
Expand Down

0 comments on commit ad66740

Please sign in to comment.