From f81d15514d466fe5c4a39a094894a2bf9b3b992d Mon Sep 17 00:00:00 2001 From: "Peter B. Robinson" Date: Fri, 28 May 2021 10:51:21 -0700 Subject: [PATCH 01/76] add INTELLLVM support. --- cmake/BLTMacros.cmake | 10 ++++++++-- cmake/SetupCompilerOptions.cmake | 8 ++++++++ 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/cmake/BLTMacros.cmake b/cmake/BLTMacros.cmake index 5fd6be7e3..2a801c605 100644 --- a/cmake/BLTMacros.cmake +++ b/cmake/BLTMacros.cmake @@ -975,6 +975,7 @@ endmacro(blt_add_benchmark) ## CLANG clangFlag (optional) ## HCC hccFlag (optional) ## INTEL intelFlag (optional) +## INTELLLVM intelLLVMFlag (optional) ## XL xlFlag (optional) ## MSVC msvcFlag (optional) ## MSVC_INTEL msvcIntelFlag (optional) @@ -986,7 +987,7 @@ endmacro(blt_add_benchmark) macro(blt_append_custom_compiler_flag) set(options) - set(singleValueArgs FLAGS_VAR DEFAULT GNU CLANG HCC PGI INTEL XL MSVC MSVC_INTEL CRAY) + set(singleValueArgs FLAGS_VAR DEFAULT GNU CLANG HCC PGI INTEL INTELLLVM XL MSVC MSVC_INTEL CRAY) set(multiValueArgs) # Parse the arguments @@ -997,7 +998,7 @@ macro(blt_append_custom_compiler_flag) if(NOT DEFINED arg_FLAGS_VAR) message( FATAL_ERROR "append_custom_compiler_flag macro requires FLAGS_VAR keyword and argument." ) endif() - + # Set the desired flags based on the compiler family # MSVC COMPILER FAMILY applies to C/C++ and Fortran string( TOLOWER ${arg_FLAGS_VAR} lower_flag_var ) @@ -1017,9 +1018,12 @@ macro(blt_append_custom_compiler_flag) elseif( DEFINED arg_PGI AND Fortran_COMPILER_FAMILY_IS_PGI ) set (${arg_FLAGS_VAR} "${${arg_FLAGS_VAR}} ${arg_PGI} " ) elseif( DEFINED arg_GNU AND Fortran_COMPILER_FAMILY_IS_GNU ) + message("appending ${arg_GNU} to ${arg_FLAGS_VAR}") set (${arg_FLAGS_VAR} "${${arg_FLAGS_VAR}} ${arg_GNU} " ) elseif( DEFINED arg_CRAY AND Fortran_COMPILER_FAMILY_IS_CRAY ) set (${arg_FLAGS_VAR} "${${arg_FLAGS_VAR}} ${arg_CRAY} " ) + elseif( DEFINED arg_INTELLLVM AND Fortran_COMPILER_FAMILY_IS_INTELLLVM ) + set (${arg_FLAGS_VAR} "${${arg_FLAGS_VAR}} ${arg_INTELLLVM} " ) elseif( DEFINED arg_DEFAULT ) set (${arg_FLAGS_VAR} "${${arg_FLAGS_VAR}} ${arg_DEFAULT} ") endif() @@ -1032,6 +1036,8 @@ macro(blt_append_custom_compiler_flag) set (${arg_FLAGS_VAR} "${${arg_FLAGS_VAR}} ${arg_XL} " ) elseif( DEFINED arg_INTEL AND C_COMPILER_FAMILY_IS_INTEL ) set (${arg_FLAGS_VAR} "${${arg_FLAGS_VAR}} ${arg_INTEL} " ) + elseif( DEFINED arg_INTELLLVM AND C_COMPILER_FAMILY_IS_INTELLLVM ) + set (${arg_FLAGS_VAR} "${${arg_FLAGS_VAR}} ${arg_INTELLLVM} " ) elseif( DEFINED arg_PGI AND C_COMPILER_FAMILY_IS_PGI ) set (${arg_FLAGS_VAR} "${${arg_FLAGS_VAR}} ${arg_PGI} " ) elseif( DEFINED arg_GNU AND C_COMPILER_FAMILY_IS_GNU ) diff --git a/cmake/SetupCompilerOptions.cmake b/cmake/SetupCompilerOptions.cmake index db38469bd..120ea2f5d 100644 --- a/cmake/SetupCompilerOptions.cmake +++ b/cmake/SetupCompilerOptions.cmake @@ -42,6 +42,10 @@ else() set(C_COMPILER_FAMILY_IS_INTEL 1) message(STATUS "C Compiler family is Intel") + elseif("${CMAKE_CXX_COMPILER_ID}" STREQUAL "IntelLLVM") + set(C_COMPILER_FAMILY_IS_INTELLLVM 1) + message(STATUS "C Compiler family is IntelLLVM") + elseif("${CMAKE_CXX_COMPILER_ID}" STREQUAL "PGI") set(C_COMPILER_FAMILY_IS_PGI 1) message(STATUS "C Compiler family is PGI") @@ -70,6 +74,10 @@ else() set(Fortran_COMPILER_FAMILY_IS_INTEL 1) message(STATUS "Fortran Compiler family is Intel") + elseif("${CMAKE_Fortran_COMPILER_ID}" STREQUAL "IntelLLVM") + set(Fortran_COMPILER_FAMILY_IS_INTELLLVM 1) + message(STATUS "Fortran Compiler family is Intel") + elseif("${CMAKE_Fortran_COMPILER_ID}" STREQUAL "PGI") set(Fortran_COMPILER_FAMILY_IS_PGI 1) message(STATUS "Fortran Compiler family is PGI") From 50b22c51101f15e00f92bc029fd9e7b5d1a3e929 Mon Sep 17 00:00:00 2001 From: Chris White Date: Wed, 4 Aug 2021 15:57:05 -0700 Subject: [PATCH 02/76] add missing file ext --- SetupBLT.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/SetupBLT.cmake b/SetupBLT.cmake index 6402d4dd1..f85a53727 100644 --- a/SetupBLT.cmake +++ b/SetupBLT.cmake @@ -172,7 +172,7 @@ if (NOT BLT_LOADED) # Global variables needed by BLT # ################################ - set(BLT_C_FILE_EXTS ".cpp" ".hpp" ".cxx" ".hxx" ".c" ".h" ".cc" ".hh" ".inl" ".cu" + set(BLT_C_FILE_EXTS ".cpp" ".hpp" ".cxx" ".hxx" ".c" ".h" ".cc" ".hh" ".inl" ".cu" ".cuh" CACHE STRING "List of known file extensions used for C/CXX sources") set(BLT_Fortran_FILE_EXTS ".F" ".f" ".f90" ".F90" CACHE STRING "List of known file extensions used for Fortran sources") From f61dcfe476cd3281140b1d2553daaaf704bd2cce Mon Sep 17 00:00:00 2001 From: Chris White Date: Wed, 4 Aug 2021 15:59:39 -0700 Subject: [PATCH 03/76] release notes --- RELEASE-NOTES.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/RELEASE-NOTES.md b/RELEASE-NOTES.md index 7bb9847bb..fca99db54 100644 --- a/RELEASE-NOTES.md +++ b/RELEASE-NOTES.md @@ -9,6 +9,9 @@ The project release numbers follow [Semantic Versioning](http://semver.org/spec/ ## [Unreleased] - Release date yyyy-mm-dd +### Changed +- `BLT_C_FILE_EXTS` updated to include `.cuh` + ## [Version 0.4.1] - Release date 2021-07-20 ### Added From 02d8e2d855d1d400804ec42c9010f15d06aa0927 Mon Sep 17 00:00:00 2001 From: "Peter B. Robinson" Date: Thu, 12 Aug 2021 13:15:11 -0700 Subject: [PATCH 04/76] address reviewer comments. --- cmake/BLTMacros.cmake | 1 - cmake/SetupCompilerOptions.cmake | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/cmake/BLTMacros.cmake b/cmake/BLTMacros.cmake index 2a801c605..ac2b0eafd 100644 --- a/cmake/BLTMacros.cmake +++ b/cmake/BLTMacros.cmake @@ -1018,7 +1018,6 @@ macro(blt_append_custom_compiler_flag) elseif( DEFINED arg_PGI AND Fortran_COMPILER_FAMILY_IS_PGI ) set (${arg_FLAGS_VAR} "${${arg_FLAGS_VAR}} ${arg_PGI} " ) elseif( DEFINED arg_GNU AND Fortran_COMPILER_FAMILY_IS_GNU ) - message("appending ${arg_GNU} to ${arg_FLAGS_VAR}") set (${arg_FLAGS_VAR} "${${arg_FLAGS_VAR}} ${arg_GNU} " ) elseif( DEFINED arg_CRAY AND Fortran_COMPILER_FAMILY_IS_CRAY ) set (${arg_FLAGS_VAR} "${${arg_FLAGS_VAR}} ${arg_CRAY} " ) diff --git a/cmake/SetupCompilerOptions.cmake b/cmake/SetupCompilerOptions.cmake index 120ea2f5d..f4b03f160 100644 --- a/cmake/SetupCompilerOptions.cmake +++ b/cmake/SetupCompilerOptions.cmake @@ -76,7 +76,7 @@ else() elseif("${CMAKE_Fortran_COMPILER_ID}" STREQUAL "IntelLLVM") set(Fortran_COMPILER_FAMILY_IS_INTELLLVM 1) - message(STATUS "Fortran Compiler family is Intel") + message(STATUS "Fortran Compiler family is IntelLLVM") elseif("${CMAKE_Fortran_COMPILER_ID}" STREQUAL "PGI") set(Fortran_COMPILER_FAMILY_IS_PGI 1) From d7be1be69dfe3eb1106db34a24c36e2b7a5046b8 Mon Sep 17 00:00:00 2001 From: "Peter B. Robinson" Date: Thu, 12 Aug 2021 13:23:23 -0700 Subject: [PATCH 05/76] added release note. --- RELEASE-NOTES.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/RELEASE-NOTES.md b/RELEASE-NOTES.md index fca99db54..e4d3fca29 100644 --- a/RELEASE-NOTES.md +++ b/RELEASE-NOTES.md @@ -9,6 +9,9 @@ The project release numbers follow [Semantic Versioning](http://semver.org/spec/ ## [Unreleased] - Release date yyyy-mm-dd +### Added +- Added support for IntelLLVM compiler family to blt_append_custom_compiler_flag + ### Changed - `BLT_C_FILE_EXTS` updated to include `.cuh` From a88724fbb016e798cf31566471fa400deca74733 Mon Sep 17 00:00:00 2001 From: Chris White Date: Fri, 13 Aug 2021 23:05:39 -0700 Subject: [PATCH 06/76] Fix for updated slurm --- .gitlab/build_quartz.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitlab/build_quartz.yml b/.gitlab/build_quartz.yml index e93d1610e..6c8dd3e74 100644 --- a/.gitlab/build_quartz.yml +++ b/.gitlab/build_quartz.yml @@ -39,7 +39,7 @@ quartz_release: .build_on_quartz: stage: build variables: - ALLOC_COMMAND: "srun -p pdebug -t 30 -N 1 ${ASSIGN_ID}" + ALLOC_COMMAND: "srun -p pdebug -t 30 -N 1 ${ASSIGN_ID} --interactive" extends: [.build_script, .on_quartz] #### From 86fc9604d9487827524b5eaa4430482a6de99af4 Mon Sep 17 00:00:00 2001 From: Chris White Date: Fri, 20 Aug 2021 16:37:33 -0700 Subject: [PATCH 07/76] update docs for INTELLLVM support --- docs/api/utility.rst | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/api/utility.rst b/docs/api/utility.rst index 6d7fd89ab..fb33a4ffc 100644 --- a/docs/api/utility.rst +++ b/docs/api/utility.rst @@ -57,6 +57,7 @@ blt_append_custom_compiler_flag CLANG clangFlag (optional) HCC hccFlag (optional) INTEL intelFlag (optional) + INTELLLVM intelLLVMFlag (optional) XL xlFlag (optional) MSVC msvcFlag (optional) MSVC_INTEL msvcIntelFlag (optional) From ed75c149c389c226ce4c2def2e126c3952d4b1bf Mon Sep 17 00:00:00 2001 From: Chris White Date: Fri, 20 Aug 2021 16:52:16 -0700 Subject: [PATCH 08/76] add ci test for intelllvm --- .gitlab/build_quartz.yml | 5 ++ .../intel-oneapi@2021.3.cmake | 46 +++++++++++++++++++ 2 files changed, 51 insertions(+) create mode 100644 host-configs/llnl/toss_3_x86_64_ib/intel-oneapi@2021.3.cmake diff --git a/.gitlab/build_quartz.yml b/.gitlab/build_quartz.yml index 6c8dd3e74..53a7a2e57 100644 --- a/.gitlab/build_quartz.yml +++ b/.gitlab/build_quartz.yml @@ -59,6 +59,11 @@ quartz-gcc_8_3_1: HOST_CONFIG: "gcc@8.3.1.cmake" extends: [.build_on_quartz] +quartz-inteloneapi_2021_3: + variables: + HOST_CONFIG: "intel-oneapi@2021.3.cmake" + extends: [.build_on_quartz] + quartz-pgi_20_1: variables: HOST_CONFIG: "pgi@20.1.cmake" diff --git a/host-configs/llnl/toss_3_x86_64_ib/intel-oneapi@2021.3.cmake b/host-configs/llnl/toss_3_x86_64_ib/intel-oneapi@2021.3.cmake new file mode 100644 index 000000000..293c0be0c --- /dev/null +++ b/host-configs/llnl/toss_3_x86_64_ib/intel-oneapi@2021.3.cmake @@ -0,0 +1,46 @@ +# Copyright (c) 2017-2021, Lawrence Livermore National Security, LLC and +# other BLT Project Developers. See the top-level LICENSE file for details +# +# SPDX-License-Identifier: (BSD-3-Clause) + +#------------------------------------------------------------------------------ +# Example host-config file for the quartz cluster at LLNL +#------------------------------------------------------------------------------ +# +# This file provides CMake with paths / details for: +# C,C++, & Fortran compilers + MPI +# +#------------------------------------------------------------------------------ + +#------------------------------------------------------------------------------ +# intel-oneapi.2021.3 compilers +#------------------------------------------------------------------------------ + +set(INTELLLVM_VERSION "intel-oneapi.2021.3") +set(INTELLLVM_HOME "/usr/tce/packages/intel/${INTELLLVM_VERSION}") + +# c compiler +set(CMAKE_C_COMPILER "${INTELLLVM_HOME}/bin/icx" CACHE PATH "") + +# cpp compiler +set(CMAKE_CXX_COMPILER "${INTELLLVM_HOME}/bin/icpx" CACHE PATH "") + +# fortran support +set(ENABLE_FORTRAN ON CACHE BOOL "") + +# fortran compiler +set(CMAKE_Fortran_COMPILER "${INTELLLVM_HOME}/bin/ifx" CACHE PATH "") + +#------------------------------------------------------------------------------ +# MPI Support +#------------------------------------------------------------------------------ +set(ENABLE_MPI ON CACHE BOOL "") + +set(MPI_HOME "/usr/tce/packages/mvapich2/mvapich2-2.3.6-${INTELLLVM_VERSION}" CACHE PATH "") + +set(MPI_C_COMPILER "${MPI_HOME}/bin/mpicc" CACHE PATH "") +set(MPI_CXX_COMPILER "${MPI_HOME}/bin/mpicxx" CACHE PATH "") +set(MPI_Fortran_COMPILER "${MPI_HOME}/bin/mpif90" CACHE PATH "") + +set(MPIEXEC "/usr/bin/srun" CACHE PATH "") +set(MPIEXEC_NUMPROC_FLAG "-n" CACHE PATH "") From 37d78af83787b56523882d1d3bac8f59da56da7f Mon Sep 17 00:00:00 2001 From: Tom Scogland Date: Fri, 10 Sep 2021 16:52:43 -0700 Subject: [PATCH 09/76] add the minimum to work with hip in cmake 3.21 The hip support in cmake 3.21 requires that the hip architecture is set for all targets. This sets the default based on the value of the BLT_ROCM_ARCH, which is enough to satisfy it by default for all targets. --- cmake/BLTOptions.cmake | 1 + 1 file changed, 1 insertion(+) diff --git a/cmake/BLTOptions.cmake b/cmake/BLTOptions.cmake index fd9cef252..cacbb1ffd 100644 --- a/cmake/BLTOptions.cmake +++ b/cmake/BLTOptions.cmake @@ -66,6 +66,7 @@ set(BLT_CLANG_HIP_ARCH "gfx906" CACHE STRING "AMDGPU ISA target to use when gene mark_as_advanced(BLT_CLANG_HIP_ARCH) option(ENABLE_HCC "Enable HCC support" OFF) set(BLT_ROCM_ARCH "gfx900" CACHE STRING "gfx architecture to use when generating ROCm code") +set(CMAKE_HIP_ARCHITECTURES "${BLT_ROCM_ARCH}" CACHE STRING "") #------------------------------------------------------------------------------ # Test Options From 25cca449bed87f2b28dc53d721319d17f8a98bbb Mon Sep 17 00:00:00 2001 From: Tom Scogland Date: Fri, 10 Sep 2021 16:55:44 -0700 Subject: [PATCH 10/76] add release-note --- RELEASE-NOTES.md | 1 + 1 file changed, 1 insertion(+) diff --git a/RELEASE-NOTES.md b/RELEASE-NOTES.md index e4d3fca29..16dd47023 100644 --- a/RELEASE-NOTES.md +++ b/RELEASE-NOTES.md @@ -11,6 +11,7 @@ The project release numbers follow [Semantic Versioning](http://semver.org/spec/ ### Added - Added support for IntelLLVM compiler family to blt_append_custom_compiler_flag +- Added support for hip targets configured with cmake 3.21 native hip support ### Changed - `BLT_C_FILE_EXTS` updated to include `.cuh` From 72fa9fe82a99d351704911f8f98077f8467a7966 Mon Sep 17 00:00:00 2001 From: Tom Scogland Date: Mon, 13 Sep 2021 09:41:33 -0700 Subject: [PATCH 11/76] remove unused BLT_ROCM_ARCH, wire in CMAKE_HIP_ARCHITECTURES --- cmake/BLTOptions.cmake | 3 +-- cmake/thirdparty/SetupHIP.cmake | 13 +++++++++++-- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/cmake/BLTOptions.cmake b/cmake/BLTOptions.cmake index cacbb1ffd..eb4590255 100644 --- a/cmake/BLTOptions.cmake +++ b/cmake/BLTOptions.cmake @@ -65,8 +65,7 @@ mark_as_advanced(ENABLE_CLANG_HIP) set(BLT_CLANG_HIP_ARCH "gfx906" CACHE STRING "AMDGPU ISA target to use when generating HIP code with Clang" ) mark_as_advanced(BLT_CLANG_HIP_ARCH) option(ENABLE_HCC "Enable HCC support" OFF) -set(BLT_ROCM_ARCH "gfx900" CACHE STRING "gfx architecture to use when generating ROCm code") -set(CMAKE_HIP_ARCHITECTURES "${BLT_ROCM_ARCH}" CACHE STRING "") +set(CMAKE_HIP_ARCHITECTURES "gfx900" CACHE STRING "gfx architecture to use when generating HIP/ROCm code") #------------------------------------------------------------------------------ # Test Options diff --git a/cmake/thirdparty/SetupHIP.cmake b/cmake/thirdparty/SetupHIP.cmake index cc4c7e8f0..08c5057c4 100644 --- a/cmake/thirdparty/SetupHIP.cmake +++ b/cmake/thirdparty/SetupHIP.cmake @@ -72,7 +72,7 @@ if (ENABLE_CLANG_HIP) if (NOT (${HIP_PLATFORM} STREQUAL "clang")) message(FATAL_ERROR "ENABLE_CLANG_HIP requires HIP_PLATFORM=clang") endif() - set(_hip_compile_flags -x;hip) + set(_hip_compile_flags $(_hip_compile_flags)-x;hip) # Using clang HIP, we need to construct a few CPP defines and compiler flags foreach(_arch ${BLT_CLANG_HIP_ARCH}) string(TOUPPER ${_arch} _UPARCH) @@ -114,7 +114,16 @@ else() # through a hip compiler (hipcc) # This is currently used only as an indicator for blt_add_hip* -- FindHIP/hipcc will handle resolution # of all required HIP-related includes/libraries/flags. - blt_import_library(NAME hip) + # Using clang HIP, we need to construct a few CPP defines and compiler flags + foreach(_arch ${CMAKE_HIP_ARCHITECTURES}) + string(TOUPPER ${_arch} _UPARCH) + string(TOLOWER ${_arch} _lowarch) + list(APPEND _hip_compile_flags "--offload-arch=${_lowarch}") + set(_hip_compile_defines "${HIP_RUNTIME_DEFINES};-D__HIP_ARCH_${_UPARCH}__=1") + endforeach(_arch) + blt_import_library(NAME hip + DEFINES ${_hip_compile_defines} + COMPILE_FLAGS ${_hip_compile_flags}) endif() From dabd7fe3f9343dff8f7f106d124014c3ec3b5c52 Mon Sep 17 00:00:00 2001 From: Tom Scogland Date: Mon, 13 Sep 2021 11:17:19 -0700 Subject: [PATCH 12/76] unify arch flag handling between clang and hipcc --- cmake/thirdparty/SetupHIP.cmake | 36 +++++++++++++++------------------ 1 file changed, 16 insertions(+), 20 deletions(-) diff --git a/cmake/thirdparty/SetupHIP.cmake b/cmake/thirdparty/SetupHIP.cmake index 08c5057c4..c8b71a0de 100644 --- a/cmake/thirdparty/SetupHIP.cmake +++ b/cmake/thirdparty/SetupHIP.cmake @@ -67,26 +67,29 @@ else() endif() set(HIP_RUNTIME_COMPILE_FLAGS "${HIP_RUNTIME_COMPILE_FLAGS};-Wno-unused-parameter") -set(_hip_compile_flags " ") -if (ENABLE_CLANG_HIP) - if (NOT (${HIP_PLATFORM} STREQUAL "clang")) - message(FATAL_ERROR "ENABLE_CLANG_HIP requires HIP_PLATFORM=clang") - endif() - set(_hip_compile_flags $(_hip_compile_flags)-x;hip) +set(_hip_compile_flags "") +if(CMAKE_VERSION VERSION_LESS "3.21") # Using clang HIP, we need to construct a few CPP defines and compiler flags - foreach(_arch ${BLT_CLANG_HIP_ARCH}) + foreach(_arch ${CMAKE_HIP_ARCHITECTURES}) string(TOUPPER ${_arch} _UPARCH) string(TOLOWER ${_arch} _lowarch) list(APPEND _hip_compile_flags "--offload-arch=${_lowarch}") set(_hip_compile_defines "${HIP_RUNTIME_DEFINES};-D__HIP_ARCH_${_UPARCH}__=1") endforeach(_arch) +endif() +if (ENABLE_CLANG_HIP) + if (NOT (${HIP_PLATFORM} STREQUAL "clang")) + message(FATAL_ERROR "ENABLE_CLANG_HIP requires HIP_PLATFORM=clang") + endif() + list(APPEND _hip_compile_flags -x) + list(APPEND _hip_compile_flags hip) # We need to pass rocm path as well, for certain bitcode libraries. # First see if we were given it, then see if it exists in the environment. # If not, don't try to guess but print a warning and hope the compiler knows where it is. if (NOT ROCM_PATH) find_path(ROCM_PATH - bin/rocminfo + hip ENV ROCM_DIR ENV ROCM_PATH ${HIP_ROOT_DIR}/../ @@ -109,18 +112,11 @@ if (ENABLE_CLANG_HIP) DEPENDS_ON ${HIP_RUNTIME_LIBRARIES}) else() -# depend on 'hip', if you need to use hip -# headers, link to hip libs, and need to run your source -# through a hip compiler (hipcc) -# This is currently used only as an indicator for blt_add_hip* -- FindHIP/hipcc will handle resolution -# of all required HIP-related includes/libraries/flags. - # Using clang HIP, we need to construct a few CPP defines and compiler flags - foreach(_arch ${CMAKE_HIP_ARCHITECTURES}) - string(TOUPPER ${_arch} _UPARCH) - string(TOLOWER ${_arch} _lowarch) - list(APPEND _hip_compile_flags "--offload-arch=${_lowarch}") - set(_hip_compile_defines "${HIP_RUNTIME_DEFINES};-D__HIP_ARCH_${_UPARCH}__=1") - endforeach(_arch) + # depend on 'hip', if you need to use hip + # headers, link to hip libs, and need to run your source + # through a hip compiler (hipcc) + # This is currently used only as an indicator for blt_add_hip* -- FindHIP/hipcc will handle resolution + # of all required HIP-related includes/libraries/flags. blt_import_library(NAME hip DEFINES ${_hip_compile_defines} COMPILE_FLAGS ${_hip_compile_flags}) From 141afbca6d84b648799bedaf797962482e2adb63 Mon Sep 17 00:00:00 2001 From: Tom Scogland Date: Mon, 13 Sep 2021 13:41:05 -0700 Subject: [PATCH 13/76] add note about the blt_clang_hip_arch change to release notes --- RELEASE-NOTES.md | 1 + 1 file changed, 1 insertion(+) diff --git a/RELEASE-NOTES.md b/RELEASE-NOTES.md index 16dd47023..a2c6b1ba5 100644 --- a/RELEASE-NOTES.md +++ b/RELEASE-NOTES.md @@ -15,6 +15,7 @@ The project release numbers follow [Semantic Versioning](http://semver.org/spec/ ### Changed - `BLT_C_FILE_EXTS` updated to include `.cuh` +- Fold `BLT_CLANG_HIP_ARCH` into the `CMAKE_HIP_ARCHITECTURES` variable ## [Version 0.4.1] - Release date 2021-07-20 From 27597b054c90a30e49ab2ed8b3819adb1b8c86ec Mon Sep 17 00:00:00 2001 From: Tom Scogland Date: Tue, 14 Sep 2021 10:35:08 -0700 Subject: [PATCH 14/76] actually remove BLT_CLANG_HIP_ARCH variable --- cmake/BLTOptions.cmake | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/cmake/BLTOptions.cmake b/cmake/BLTOptions.cmake index eb4590255..ead5340c6 100644 --- a/cmake/BLTOptions.cmake +++ b/cmake/BLTOptions.cmake @@ -62,9 +62,7 @@ option(ENABLE_HIP "Enable HIP support" OFF) cmake_dependent_option(ENABLE_CLANG_HIP "Enable Clang's native HIP support" OFF "ENABLE_HIP" OFF) mark_as_advanced(ENABLE_CLANG_HIP) -set(BLT_CLANG_HIP_ARCH "gfx906" CACHE STRING "AMDGPU ISA target to use when generating HIP code with Clang" ) -mark_as_advanced(BLT_CLANG_HIP_ARCH) -option(ENABLE_HCC "Enable HCC support" OFF) +option(ENABLE_HCC "Enable HCC support" OFF) set(CMAKE_HIP_ARCHITECTURES "gfx900" CACHE STRING "gfx architecture to use when generating HIP/ROCm code") #------------------------------------------------------------------------------ From 1af395cff4d87e01d9dd2350bf17405683ca2276 Mon Sep 17 00:00:00 2001 From: Tom Scogland Date: Tue, 14 Sep 2021 12:15:40 -0700 Subject: [PATCH 15/76] change how HIP_CLANG_PATH is determined, allow cmakeke to provide it rather than env --- cmake/thirdparty/FindHIP.cmake | 30 +++++++++++++++++++----------- 1 file changed, 19 insertions(+), 11 deletions(-) diff --git a/cmake/thirdparty/FindHIP.cmake b/cmake/thirdparty/FindHIP.cmake index 3bc2235fc..ad2e47493 100644 --- a/cmake/thirdparty/FindHIP.cmake +++ b/cmake/thirdparty/FindHIP.cmake @@ -83,6 +83,23 @@ if(UNIX AND NOT APPLE AND NOT CYGWIN) endif() mark_as_advanced(HIP_HIPCC_EXECUTABLE) + # Find hip clang executable + if(NOT DEFINED HIP_CLANG_PATH) + find_path( + HIP_CLANG_PATH + NAMES clang++ + PATHS + "$ENV{HIP_CLANG_PATH}" + "$ENV{ROCM_PATH}" + "$ENV{HIP_PATH}/../llvm/bin" + "${HIP_ROOT_DIR}/../llvm/bin" + "/opt/rocm/llvm/bin" + PATH_SUFFIXES bin + NO_DEFAULT_PATH + ) + endif() + set(HIP_CLANG_EXECUTABLE "${HIP_CLANG_PATH}/clang++") + # Find HIPCONFIG executable find_program( HIP_HIPCONFIG_EXECUTABLE @@ -211,6 +228,8 @@ set(CMAKE_SHARED_LIBRARY_LINK_DYNAMIC_HIP_FLAGS ${CMAKE_SHARED_LIBRARY_LINK_DYNA set(HIP_CLANG_PARALLEL_BUILD_COMPILE_OPTIONS "") set(HIP_CLANG_PARALLEL_BUILD_LINK_OPTIONS "") + + if("${HIP_COMPILER}" STREQUAL "nvcc") # Set the CMake Flags to use the nvcc Compiler. set(CMAKE_HIP_CREATE_SHARED_LIBRARY "${HIP_HIPCC_CMAKE_LINKER_HELPER} -o ") @@ -643,17 +662,6 @@ macro(HIP_ADD_EXECUTABLE hip_target) endif() set(CMAKE_HIP_LINK_EXECUTABLE "${HIP_HIPCC_CMAKE_LINKER_HELPER} ${HCC_HOME} -o ") elseif("${HIP_COMPILER}" STREQUAL "clang") - if("x${HIP_CLANG_PATH}" STREQUAL "x") - if(DEFINED ENV{HIP_CLANG_PATH}) - set(HIP_CLANG_PATH $ENV{HIP_CLANG_PATH}) - elseif(DEFINED ENV{ROCM_PATH}) - set(HIP_CLANG_PATH "$ENV{ROCM_PATH}/llvm/bin") - elseif(DEFINED ENV{HIP_PATH}) - set(HIP_CLANG_PATH "$ENV{HIP_PATH}/../llvm/bin") - else() - set(HIP_CLANG_PATH "/opt/rocm/llvm/bin") - endif() - endif() set(CMAKE_HIP_LINK_EXECUTABLE "${HIP_HIPCC_CMAKE_LINKER_HELPER} ${HIP_CLANG_PATH} ${HIP_CLANG_PARALLEL_BUILD_LINK_OPTIONS} -o ") else() set(CMAKE_HIP_LINK_EXECUTABLE "${HIP_HIPCC_CMAKE_LINKER_HELPER} -o ") From 8f5de2c1850b477d28b52da9eca0509756e23d12 Mon Sep 17 00:00:00 2001 From: Tom Scogland Date: Tue, 14 Sep 2021 12:16:08 -0700 Subject: [PATCH 16/76] propagate the c++ standard setting to hipcc --- cmake/thirdparty/SetupHIP.cmake | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/cmake/thirdparty/SetupHIP.cmake b/cmake/thirdparty/SetupHIP.cmake index c8b71a0de..2cb83c7dd 100644 --- a/cmake/thirdparty/SetupHIP.cmake +++ b/cmake/thirdparty/SetupHIP.cmake @@ -111,7 +111,8 @@ if (ENABLE_CLANG_HIP) COMPILE_FLAGS ${_hip_compile_flags} DEPENDS_ON ${HIP_RUNTIME_LIBRARIES}) else() - + # hipcc does not receive a standard flag from cmake or from BLT otherwise + set(HIP_HIPCC_FLAGS ${HIP_HIPCC_FLAGS} -std=${BLT_CXX_STD}) # depend on 'hip', if you need to use hip # headers, link to hip libs, and need to run your source # through a hip compiler (hipcc) From 2128efd8c4ca31c8ccf51d3f75299371924b7370 Mon Sep 17 00:00:00 2001 From: Tom Scogland Date: Wed, 15 Sep 2021 20:50:15 -0700 Subject: [PATCH 17/76] fix rocm_path search --- cmake/thirdparty/FindHIP.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmake/thirdparty/FindHIP.cmake b/cmake/thirdparty/FindHIP.cmake index ad2e47493..2f4f13bb5 100644 --- a/cmake/thirdparty/FindHIP.cmake +++ b/cmake/thirdparty/FindHIP.cmake @@ -90,7 +90,7 @@ if(UNIX AND NOT APPLE AND NOT CYGWIN) NAMES clang++ PATHS "$ENV{HIP_CLANG_PATH}" - "$ENV{ROCM_PATH}" + "$ENV{ROCM_PATH}/llvm/bin" "$ENV{HIP_PATH}/../llvm/bin" "${HIP_ROOT_DIR}/../llvm/bin" "/opt/rocm/llvm/bin" From 44a19127f0b6e10292ea0092376fd928bbb9601c Mon Sep 17 00:00:00 2001 From: David Beckingsale Date: Fri, 17 Sep 2021 13:33:11 -0700 Subject: [PATCH 18/76] Don't build executables depending on hip_runtime as HIP (#525) --- cmake/BLTPrivateMacros.cmake | 2 +- tests/smoke/CMakeLists.txt | 9 +++++++ tests/smoke/blt_hip_runtime_c_smoke.c | 34 +++++++++++++++++++++++++++ 3 files changed, 44 insertions(+), 1 deletion(-) create mode 100644 tests/smoke/blt_hip_runtime_c_smoke.c diff --git a/cmake/BLTPrivateMacros.cmake b/cmake/BLTPrivateMacros.cmake index e7680c6d7..04d33ba8a 100644 --- a/cmake/BLTPrivateMacros.cmake +++ b/cmake/BLTPrivateMacros.cmake @@ -728,7 +728,7 @@ macro(blt_add_hip_executable) endif() endforeach() - if (${_depends_on_hip} OR ${_depends_on_hip_runtime}) + if (${_depends_on_hip}) # if hip is in depends_on, flag each file's language as HIP # instead of leaving it up to CMake to decide # Note: we don't do this when depending on just 'hip_runtime' diff --git a/tests/smoke/CMakeLists.txt b/tests/smoke/CMakeLists.txt index 8d3ef0d33..2545ece17 100644 --- a/tests/smoke/CMakeLists.txt +++ b/tests/smoke/CMakeLists.txt @@ -226,6 +226,15 @@ if (ENABLE_HIP) blt_add_test(NAME blt_hip_runtime_smoke COMMAND blt_hip_runtime_smoke) + blt_add_executable(NAME blt_hip_runtime_c_smoke + SOURCES blt_hip_runtime_c_smoke.c + OUTPUT_DIR ${TEST_OUTPUT_DIRECTORY} + DEPENDS_ON hip_runtime + FOLDER blt/tests ) + + blt_add_test(NAME blt_hip_runtime_c_smoke + COMMAND blt_hip_runtime_c_smoke) + if(ENABLE_GTEST) blt_add_executable(NAME blt_hip_gtest_smoke SOURCES blt_hip_gtest_smoke.cpp diff --git a/tests/smoke/blt_hip_runtime_c_smoke.c b/tests/smoke/blt_hip_runtime_c_smoke.c new file mode 100644 index 000000000..d4b34ba4e --- /dev/null +++ b/tests/smoke/blt_hip_runtime_c_smoke.c @@ -0,0 +1,34 @@ +// Copyright (c) 2017-2021, Lawrence Livermore National Security, LLC and +// other BLT Project Developers. See the top-level LICENSE file for details +// +// SPDX-License-Identifier: (BSD-3-Clause) + +//----------------------------------------------------------------------------- +// +// file: blt_hip_runtime_c_smoke.c +// +//----------------------------------------------------------------------------- + +#include "hip/hip_runtime_api.h" + +int main() +{ + int nDevices; + + hipGetDeviceCount(&nDevices); + for (int i = 0; i < nDevices; i++) + { + hipDeviceProp_t prop; + hipGetDeviceProperties(&prop, i); + printf("Device Number: %d\n", i); + printf(" Device name: %s\n", prop.name); + printf(" Memory Clock Rate (KHz): %d\n", + prop.memoryClockRate); + printf(" Memory Bus Width (bits): %d\n", + prop.memoryBusWidth); + printf(" Peak Memory Bandwidth (GB/s): %f\n\n", + 2.0*prop.memoryClockRate*(prop.memoryBusWidth/8)/1.0e6); + } + + return 0; +} From b8043b9c9c0ce20a1462482de5a4e32d9dfd6126 Mon Sep 17 00:00:00 2001 From: David Beckingsale Date: Fri, 17 Sep 2021 13:40:21 -0700 Subject: [PATCH 19/76] Add missing stdio header to blt_hip_runtime_c_smoke --- tests/smoke/blt_hip_runtime_c_smoke.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tests/smoke/blt_hip_runtime_c_smoke.c b/tests/smoke/blt_hip_runtime_c_smoke.c index d4b34ba4e..42cfacd97 100644 --- a/tests/smoke/blt_hip_runtime_c_smoke.c +++ b/tests/smoke/blt_hip_runtime_c_smoke.c @@ -9,6 +9,8 @@ // //----------------------------------------------------------------------------- +#include + #include "hip/hip_runtime_api.h" int main() From 0efa35903951efd73cc1fe05536879ec4ae1c60f Mon Sep 17 00:00:00 2001 From: Alan Dayton Date: Fri, 24 Sep 2021 09:37:18 -0700 Subject: [PATCH 20/76] Fix CMake warning --- thirdparty_builtin/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/thirdparty_builtin/CMakeLists.txt b/thirdparty_builtin/CMakeLists.txt index a222f8d91..5fbb9b79a 100644 --- a/thirdparty_builtin/CMakeLists.txt +++ b/thirdparty_builtin/CMakeLists.txt @@ -144,7 +144,7 @@ if(ENABLE_BENCHMARKS) message(FATAL_ERROR "Google Benchmark cannot be built when BUILD_SHARED_LIBS=ON or on Windows") endif() - set(BENCHMARK_ENABLE_TESTING OFF CACHE "" BOOL) + set(BENCHMARK_ENABLE_TESTING OFF CACHE BOOL "") add_subdirectory(benchmark-1.5.0 ${BLT_BUILD_DIR}/thirdparty_builtin/benchmark-1.5.0) From 59aa52a353f3f05ba67a8952da718584cb890ad1 Mon Sep 17 00:00:00 2001 From: Kenneth Weiss Date: Fri, 15 Oct 2021 16:01:35 -0700 Subject: [PATCH 21/76] Append flag that enables all warnings to beginning of `CMAKE_{C,CXX}_FLAGS` instead of end This makes it easier for users to disable specific warnings using `CMAKE_{C,CXX}_FLAGS` or `BLT_{C,CXX}_FLAGS`. --- cmake/SetupCompilerOptions.cmake | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/cmake/SetupCompilerOptions.cmake b/cmake/SetupCompilerOptions.cmake index dffceaef3..dea52c01b 100644 --- a/cmake/SetupCompilerOptions.cmake +++ b/cmake/SetupCompilerOptions.cmake @@ -402,9 +402,8 @@ set(langFlags "CMAKE_C_FLAGS" "CMAKE_CXX_FLAGS") if (ENABLE_ALL_WARNINGS) message(STATUS "Enabling all compiler warnings on all targets.") - - set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${BLT_ENABLE_ALL_WARNINGS_CXX_FLAG}") - set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${BLT_ENABLE_ALL_WARNINGS_C_FLAG}") + set (CMAKE_CXX_FLAGS "${BLT_ENABLE_ALL_WARNINGS_CXX_FLAG} ${CMAKE_CXX_FLAGS}") + set (CMAKE_C_FLAGS "${BLT_ENABLE_ALL_WARNINGS_C_FLAG} ${CMAKE_C_FLAGS}") endif() if (ENABLE_WARNINGS_AS_ERRORS) From 8728477ec0fb2105c7b55260a2f0bbdad88af05d Mon Sep 17 00:00:00 2001 From: Kenny Weiss Date: Fri, 15 Oct 2021 18:06:47 -0700 Subject: [PATCH 22/76] Update RELEASE_NOTES --- RELEASE-NOTES.md | 1 + 1 file changed, 1 insertion(+) diff --git a/RELEASE-NOTES.md b/RELEASE-NOTES.md index a2c6b1ba5..c84b2d9bc 100644 --- a/RELEASE-NOTES.md +++ b/RELEASE-NOTES.md @@ -16,6 +16,7 @@ The project release numbers follow [Semantic Versioning](http://semver.org/spec/ ### Changed - `BLT_C_FILE_EXTS` updated to include `.cuh` - Fold `BLT_CLANG_HIP_ARCH` into the `CMAKE_HIP_ARCHITECTURES` variable +- When using `ENABLE_ALL_WARNINGS`, append the flag to the beginning of `CMAKE_{C,CXX}_FLAGS` instead of the end ## [Version 0.4.1] - Release date 2021-07-20 From ccf282d30caa7cbbfccbd6fff3239243ab2876df Mon Sep 17 00:00:00 2001 From: Josh Essman Date: Wed, 27 Oct 2021 14:36:38 -0500 Subject: [PATCH 23/76] fix: pin docutils version --- .readthedocs.yml | 11 +++++++++++ docs/requirements.txt | 1 + 2 files changed, 12 insertions(+) create mode 100644 .readthedocs.yml create mode 100644 docs/requirements.txt diff --git a/.readthedocs.yml b/.readthedocs.yml new file mode 100644 index 000000000..b58aad088 --- /dev/null +++ b/.readthedocs.yml @@ -0,0 +1,11 @@ +# .readthedocs.yml +# Read the Docs configuration file +# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details + +# Required +version: 2 + +# Optionally set the version of Python and requirements required to build your docs +python: + install: + - requirements: docs/requirements.txt diff --git a/docs/requirements.txt b/docs/requirements.txt new file mode 100644 index 000000000..93120e66c --- /dev/null +++ b/docs/requirements.txt @@ -0,0 +1 @@ +docutils<0.18 From 4d7449ba7f249c5409d63df0c7389bf152ad1cfe Mon Sep 17 00:00:00 2001 From: Josh Essman Date: Wed, 27 Oct 2021 14:49:02 -0500 Subject: [PATCH 24/76] ci: replace compiler images --- azure-pipelines.yml | 38 +++++++++----------------------------- 1 file changed, 9 insertions(+), 29 deletions(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 5a7bd9a33..b65850d3b 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -9,45 +9,25 @@ variables: strategy: matrix: linux_gcc7: - VM_ImageName: 'ubuntu-16.04' - Compiler_ImageName: 'axom/tpls:gcc-7' + VM_ImageName: 'ubuntu-20.04' + Compiler_ImageName: 'axom/tpls:gcc-8_10-21-21_21h-28m' C_COMPILER: '/usr/bin/gcc' CXX_COMPILER: '/usr/bin/g++' - CMAKE_BIN_DIR: '/home/axom/axom_tpls/gcc-7.3.0/cmake-3.9.6/bin' - MPI_DIR: '/home/axom/axom_tpls/gcc-7.3.0/mpich-3.2.1' - MPI_FLAGS: '-DENABLE_MPI=ON -DMPI_C_COMPILER=$(MPI_DIR)/bin/mpicc -DMPI_CXX_COMPILER=$(MPI_DIR)/bin/mpicxx -DMPIEXEC=$(MPI_DIR)/bin/mpiexec -DMPIEXEC_NUMPROC_FLAG=-n' - CMAKE_FLAGS: '-DCMAKE_C_COMPILER=$(C_COMPILER) -DCMAKE_CXX_COMPILER=$(CXX_COMPILER) -DENABLE_GTEST_DEATH_TESTS=OFF $(MPI_FLAGS) -DENABLE_OPENMP=ON' - TEST_TARGET: 'linux_gcc7' - linux_gcc8: - VM_ImageName: 'ubuntu-16.04' - Compiler_ImageName: 'axom/tpls:gcc-8' - C_COMPILER: '/usr/bin/gcc' - CXX_COMPILER: '/usr/bin/g++' - CMAKE_BIN_DIR: '/home/axom/axom_tpls/gcc-8.1.0/cmake-3.10.1/bin' - MPI_DIR: '/home/axom/axom_tpls/gcc-8.1.0/mpich-3.3.2' + CMAKE_BIN_DIR: '/usr/bin' + MPI_DIR: '/usr' MPI_FLAGS: '-DENABLE_MPI=ON -DMPI_C_COMPILER=$(MPI_DIR)/bin/mpicc -DMPI_CXX_COMPILER=$(MPI_DIR)/bin/mpicxx -DMPIEXEC=$(MPI_DIR)/bin/mpiexec -DMPIEXEC_NUMPROC_FLAG=-n' CMAKE_FLAGS: '-DCMAKE_C_COMPILER=$(C_COMPILER) -DCMAKE_CXX_COMPILER=$(CXX_COMPILER) -DENABLE_GTEST_DEATH_TESTS=OFF $(MPI_FLAGS) -DENABLE_OPENMP=ON' TEST_TARGET: 'linux_gcc8' linux_clang4: - VM_ImageName: 'ubuntu-16.04' - Compiler_ImageName: 'axom/tpls:clang-4' - C_COMPILER: '/usr/bin/clang' - CXX_COMPILER: '/usr/bin/clang++' - CMAKE_BIN_DIR: '/home/axom/axom_tpls/clang-4.0.0/cmake-3.10.1/bin' - MPI_DIR: '/home/axom/axom_tpls/clang-4.0.0/mpich-3.0.4' - MPI_FLAGS: '-DENABLE_MPI=ON -DMPI_C_COMPILER=$(MPI_DIR)/bin/mpicc -DMPI_CXX_COMPILER=$(MPI_DIR)/bin/mpicxx -DMPIEXEC=$(MPI_DIR)/bin/mpiexec -DMPIEXEC_NUMPROC_FLAG=-n' - CMAKE_FLAGS: '-DCMAKE_C_COMPILER=$(C_COMPILER) -DCMAKE_CXX_COMPILER=$(CXX_COMPILER) -DENABLE_GTEST_DEATH_TESTS=OFF $(MPI_FLAGS) -DENABLE_OPENMP=ON' - TEST_TARGET: 'linux_clang4' - linux_clang6: - VM_ImageName: 'ubuntu-16.04' - Compiler_ImageName: 'axom/tpls:clang-6' + VM_ImageName: 'ubuntu-18.04' + Compiler_ImageName: 'axom/tpls:clang-10_10-21-21_21h-28m' C_COMPILER: '/usr/bin/clang' CXX_COMPILER: '/usr/bin/clang++' - CMAKE_BIN_DIR: '/home/axom/axom_tpls/clang-6.0.0/cmake-3.10.1/bin' - MPI_DIR: '/home/axom/axom_tpls/clang-6.0.0/mpich-3.0.4' + CMAKE_BIN_DIR: '/usr/bin' + MPI_DIR: '/usr' MPI_FLAGS: '-DENABLE_MPI=ON -DMPI_C_COMPILER=$(MPI_DIR)/bin/mpicc -DMPI_CXX_COMPILER=$(MPI_DIR)/bin/mpicxx -DMPIEXEC=$(MPI_DIR)/bin/mpiexec -DMPIEXEC_NUMPROC_FLAG=-n' CMAKE_FLAGS: '-DCMAKE_C_COMPILER=$(C_COMPILER) -DCMAKE_CXX_COMPILER=$(CXX_COMPILER) -DENABLE_GTEST_DEATH_TESTS=OFF $(MPI_FLAGS) -DENABLE_OPENMP=ON' - TEST_TARGET: 'linux_clang6' + TEST_TARGET: 'linux_clang10' osx_gcc: VM_ImageName: 'macos-10.14' CMAKE_FLAGS: '' From 2cc41b99c060ed869493dc2b1446deb50a8077a1 Mon Sep 17 00:00:00 2001 From: Josh Essman Date: Wed, 27 Oct 2021 14:49:45 -0500 Subject: [PATCH 25/76] fix: correct new job names --- azure-pipelines.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index b65850d3b..dfc037ad2 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -8,7 +8,7 @@ variables: strategy: matrix: - linux_gcc7: + linux_gcc8: VM_ImageName: 'ubuntu-20.04' Compiler_ImageName: 'axom/tpls:gcc-8_10-21-21_21h-28m' C_COMPILER: '/usr/bin/gcc' @@ -18,7 +18,7 @@ strategy: MPI_FLAGS: '-DENABLE_MPI=ON -DMPI_C_COMPILER=$(MPI_DIR)/bin/mpicc -DMPI_CXX_COMPILER=$(MPI_DIR)/bin/mpicxx -DMPIEXEC=$(MPI_DIR)/bin/mpiexec -DMPIEXEC_NUMPROC_FLAG=-n' CMAKE_FLAGS: '-DCMAKE_C_COMPILER=$(C_COMPILER) -DCMAKE_CXX_COMPILER=$(CXX_COMPILER) -DENABLE_GTEST_DEATH_TESTS=OFF $(MPI_FLAGS) -DENABLE_OPENMP=ON' TEST_TARGET: 'linux_gcc8' - linux_clang4: + linux_clang10: VM_ImageName: 'ubuntu-18.04' Compiler_ImageName: 'axom/tpls:clang-10_10-21-21_21h-28m' C_COMPILER: '/usr/bin/clang' From e8f408d8428146e57ca32aa39aa1ae626047e7f8 Mon Sep 17 00:00:00 2001 From: Kenneth Weiss Date: Thu, 28 Oct 2021 21:32:22 -0700 Subject: [PATCH 26/76] Updates cce_hip host-config --- ....0_clang_hip.cmake => cce@12.0.1_clang_hip.cmake} | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) rename host-configs/llnl/toss_4_x86_64_ib_cray/{cce@12.0.0_clang_hip.cmake => cce@12.0.1_clang_hip.cmake} (85%) diff --git a/host-configs/llnl/toss_4_x86_64_ib_cray/cce@12.0.0_clang_hip.cmake b/host-configs/llnl/toss_4_x86_64_ib_cray/cce@12.0.1_clang_hip.cmake similarity index 85% rename from host-configs/llnl/toss_4_x86_64_ib_cray/cce@12.0.0_clang_hip.cmake rename to host-configs/llnl/toss_4_x86_64_ib_cray/cce@12.0.1_clang_hip.cmake index 3c9f904c5..6c0385a86 100644 --- a/host-configs/llnl/toss_4_x86_64_ib_cray/cce@12.0.0_clang_hip.cmake +++ b/host-configs/llnl/toss_4_x86_64_ib_cray/cce@12.0.1_clang_hip.cmake @@ -15,7 +15,7 @@ # HPE Cray cce@12.0.0 compilers #------------------------------------------------------------------------------ # _blt_tutorial_compiler_config_start -set(CCE_HOME "/usr/tce/packages/cce-tce/cce-12.0.0") +set(CCE_HOME "/usr/tce/packages/cce-tce/cce-12.0.1") set(CMAKE_C_COMPILER "${CCE_HOME}/bin/craycc" CACHE PATH "") set(CMAKE_CXX_COMPILER "${CCE_HOME}/bin/crayCC" CACHE PATH "") @@ -30,7 +30,7 @@ set(CMAKE_Fortran_COMPILER "${CCE_HOME}/bin/crayftn" CACHE PATH "") # _blt_tutorial_mpi_config_start set(ENABLE_MPI ON CACHE BOOL "") -set(MPI_HOME "/usr/tce/packages/cray-mpich-tce/cray-mpich-8.1.5.6-cce-12.0.0/") +set(MPI_HOME "/usr/tce/packages/cray-mpich-tce/cray-mpich-8.1.7-cce-12.0.1/") set(MPI_C_COMPILER "${MPI_HOME}/bin/mpicc" CACHE PATH "") set(MPI_CXX_COMPILER "${MPI_HOME}/bin/mpicxx" CACHE PATH "") @@ -45,11 +45,9 @@ set(MPI_Fortran_COMPILER "${MPI_HOME}/bin/mpif90" CACHE PATH "") set(ENABLE_HIP ON CACHE BOOL "") set(ENABLE_CLANG_HIP ON CACHE BOOL "") -set(ROCM_PATH "/opt/rocm-4.1.0/" CACHE PATH "") -set(HIP_PLATFORM "clang" CACHE STRIING "") - -set(BLT_CLANG_HIP_ARCH "gfx908" CACHE STRING "") - +set(ROCM_PATH "/opt/rocm-4.2.0/" CACHE PATH "") +set(HIP_PLATFORM "clang" CACHE STRING "") +set(CMAKE_HIP_ARCHITECTURES "gfx908" CACHE STRING "gfx architecture to use when generating HIP/ROCm code") # _blt_tutorial_hip_config_end From 2e028657cdf4ee3efe0642afa930abf71406d815 Mon Sep 17 00:00:00 2001 From: Kenneth Weiss Date: Thu, 28 Oct 2021 21:33:13 -0700 Subject: [PATCH 27/76] Prints out info about hip targets in internal blt tests --- tests/internal/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/internal/CMakeLists.txt b/tests/internal/CMakeLists.txt index b090c57c5..164295f75 100644 --- a/tests/internal/CMakeLists.txt +++ b/tests/internal/CMakeLists.txt @@ -255,7 +255,7 @@ endif() message(STATUS "Exercising blt_print_target_properties macro on some targets and non-targets.") message(STATUS "") -foreach(_target gtest example t_example_smoke not-a-target blt_header_only mpi cuda cuda_runtime) +foreach(_target gtest example t_example_smoke not-a-target blt_header_only mpi cuda cuda_runtime hip hip_runtime) blt_print_target_properties(TARGET ${_target}) endforeach() From dff1bab1f87342ace45dee3c8194cf9e0f731a1e Mon Sep 17 00:00:00 2001 From: Kenny Weiss Date: Fri, 29 Oct 2021 14:28:14 -0700 Subject: [PATCH 28/76] Update comment in CCE host-config --- .../llnl/toss_4_x86_64_ib_cray/cce@12.0.1_clang_hip.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/host-configs/llnl/toss_4_x86_64_ib_cray/cce@12.0.1_clang_hip.cmake b/host-configs/llnl/toss_4_x86_64_ib_cray/cce@12.0.1_clang_hip.cmake index 6c0385a86..f9efc3d39 100644 --- a/host-configs/llnl/toss_4_x86_64_ib_cray/cce@12.0.1_clang_hip.cmake +++ b/host-configs/llnl/toss_4_x86_64_ib_cray/cce@12.0.1_clang_hip.cmake @@ -12,7 +12,7 @@ #------------------------------------------------------------------------------ #------------------------------------------------------------------------------ -# HPE Cray cce@12.0.0 compilers +# HPE Cray cce@12.0.1 compilers #------------------------------------------------------------------------------ # _blt_tutorial_compiler_config_start set(CCE_HOME "/usr/tce/packages/cce-tce/cce-12.0.1") From 70ec9220bf98f8e256cf05f089562968e7a63e1c Mon Sep 17 00:00:00 2001 From: Kenneth Weiss Date: Fri, 29 Oct 2021 14:49:14 -0700 Subject: [PATCH 29/76] Adds a host-config for the rocm+hip compiler on LLNL's rznevada cluster --- .../rocm@4.2.0_hip.cmake | 41 +++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 host-configs/llnl/toss_4_x86_64_ib_cray/rocm@4.2.0_hip.cmake diff --git a/host-configs/llnl/toss_4_x86_64_ib_cray/rocm@4.2.0_hip.cmake b/host-configs/llnl/toss_4_x86_64_ib_cray/rocm@4.2.0_hip.cmake new file mode 100644 index 000000000..3b330a46c --- /dev/null +++ b/host-configs/llnl/toss_4_x86_64_ib_cray/rocm@4.2.0_hip.cmake @@ -0,0 +1,41 @@ +# Copyright (c) 2017-2021, Lawrence Livermore National Security, LLC and +# other BLT Project Developers. See the top-level LICENSE file for details +# +# SPDX-License-Identifier: (BSD-3-Clause) + +#------------------------------------------------------------------------------ +# Example host-config file for the rznevada cluster at LLNL +#------------------------------------------------------------------------------ +# This file provides CMake with paths / details for: +# C,C++, & Fortran compilers + MPI & HIP +# using ROCM compilers +#------------------------------------------------------------------------------ + +#------------------------------------------------------------------------------ +# ROCM@4.2.0 compilers +#------------------------------------------------------------------------------ +set(ROCM_HOME "/usr/tce/packages/rocmcc-tce/rocmcc-4.2.0") +set(CMAKE_C_COMPILER "${ROCM_HOME}/bin/amdclang" CACHE PATH "") +set(CMAKE_CXX_COMPILER "${ROCM_HOME}/bin/hipcc" CACHE PATH "") + +# Fortran support +set(CCE_HOME "/usr/tce/packages/cce-tce/cce-12.0.1") +set(ENABLE_FORTRAN ON CACHE BOOL "") +set(CMAKE_Fortran_COMPILER "${CCE_HOME}/bin/crayftn" CACHE PATH "") + +#------------------------------------------------------------------------------ +# MPI Support +#------------------------------------------------------------------------------ +set(ENABLE_MPI ON CACHE BOOL "") + +set(MPI_HOME "/usr/tce/packages/cray-mpich-tce/cray-mpich-8.1.7-rocmcc-4.2.0") +set(MPI_C_COMPILER "${MPI_HOME}/bin/mpicc" CACHE PATH "") +set(MPI_CXX_COMPILER "${MPI_HOME}/bin/mpicxx" CACHE PATH "") +set(MPI_Fortran_COMPILER "${MPI_HOME}/bin/mpif90" CACHE PATH "") + +#------------------------------------------------------------------------------ +# HIP support +#------------------------------------------------------------------------------ +set(ENABLE_HIP ON CACHE BOOL "") +set(ROCM_PATH "/opt/rocm-4.2.0/" CACHE PATH "") +set(CMAKE_CUDA_ARCHITECTURES "gfx908" CACHE STRING "") From c5eeeca1abdc0857747ff983b0a633fc0ef5245c Mon Sep 17 00:00:00 2001 From: Kenneth Weiss Date: Tue, 2 Nov 2021 21:43:44 -0700 Subject: [PATCH 30/76] Fixes a typo in the `blt_add_target_definitions` user docs --- docs/api/target_properties.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/api/target_properties.rst b/docs/api/target_properties.rst index abfeebaf7..50443fabe 100644 --- a/docs/api/target_properties.rst +++ b/docs/api/target_properties.rst @@ -62,11 +62,11 @@ TO SCOPE Defines the scope of the given definitions. Defaults to ``PUBLIC`` and is case insensitive. -FLAGS +TARGET_DEFINITIONS List of definitions flags This macro provides very similar functionality to CMake's native -``add_definitions()`` and ``target_add_defintions()`` commands, but provides +``add_definitions()`` and ``target_add_definitions()`` commands, but provides more fine-grained scoping for the compile definitions on a per target basis. Given a list of definitions, e.g., ``FOO`` and ``BAR``, this macro adds compiler definitions to the compiler command for the given target, i.e., it will pass From 649e2ff3204296c73ba1532f1059aaee199870dc Mon Sep 17 00:00:00 2001 From: Chris White Date: Wed, 3 Nov 2021 17:19:17 -0700 Subject: [PATCH 31/76] add example host-config for intel-oneapi + c++17 on tos3 --- .../intel-oneapi@2021.3-c++17.cmake | 60 +++++++++++++++++++ 1 file changed, 60 insertions(+) create mode 100644 host-configs/llnl/toss_3_x86_64_ib/intel-oneapi@2021.3-c++17.cmake diff --git a/host-configs/llnl/toss_3_x86_64_ib/intel-oneapi@2021.3-c++17.cmake b/host-configs/llnl/toss_3_x86_64_ib/intel-oneapi@2021.3-c++17.cmake new file mode 100644 index 000000000..54fd3fe76 --- /dev/null +++ b/host-configs/llnl/toss_3_x86_64_ib/intel-oneapi@2021.3-c++17.cmake @@ -0,0 +1,60 @@ +# Copyright (c) 2017-2021, Lawrence Livermore National Security, LLC and +# other BLT Project Developers. See the top-level LICENSE file for details +# +# SPDX-License-Identifier: (BSD-3-Clause) + +#------------------------------------------------------------------------------ +# Example host-config file for the quartz cluster at LLNL +#------------------------------------------------------------------------------ +# +# This file provides CMake with paths / details for: +# C,C++, & Fortran compilers + MPI +# +#------------------------------------------------------------------------------ + +#------------------------------------------------------------------------------ +# intel-oneapi.2021.3 compilers +#------------------------------------------------------------------------------ + +set(INTELLLVM_VERSION "intel-oneapi.2021.3") +set(INTELLLVM_HOME "/usr/tce/packages/intel/${INTELLLVM_VERSION}") + +# c compiler +set(CMAKE_C_COMPILER "${INTELLLVM_HOME}/bin/icx" CACHE PATH "") + +# cpp compiler +set(CMAKE_CXX_COMPILER "${INTELLLVM_HOME}/bin/icpx" CACHE PATH "") + +# fortran support +set(ENABLE_FORTRAN ON CACHE BOOL "") + +# fortran compiler +set(CMAKE_Fortran_COMPILER "${INTELLLVM_HOME}/bin/ifx" CACHE PATH "") + +#------------------------------------------------------------------------------ +# Extra flags +#------------------------------------------------------------------------------ + +set(BLT_CXX_STD "c++17") + +# Use non-system default stdlib +set(GCC_VERSION "gcc-9.3.1") +set(GCC_HOME "/usr/tce/packages/gcc/${GCC_VERSION}/rh") + +set(BLT_C_FLAGS "--gcc-toolchain=${GCC_HOME}" CACHE STRING "") +set(BLT_CXX_FLAGS "--gcc-toolchain=${GCC_HOME}" CACHE STRING "") +set(BLT_FORTRAN_FLAGS "-gcc-name=${GCC_HOME}/bin/gcc" CACHE STRING "") + +#------------------------------------------------------------------------------ +# MPI Support +#------------------------------------------------------------------------------ +set(ENABLE_MPI ON CACHE BOOL "") + +set(MPI_HOME "/usr/tce/packages/mvapich2/mvapich2-2.3.6-${INTELLLVM_VERSION}" CACHE PATH "") + +set(MPI_C_COMPILER "${MPI_HOME}/bin/mpicc" CACHE PATH "") +set(MPI_CXX_COMPILER "${MPI_HOME}/bin/mpicxx" CACHE PATH "") +set(MPI_Fortran_COMPILER "${MPI_HOME}/bin/mpif90" CACHE PATH "") + +set(MPIEXEC "/usr/bin/srun" CACHE PATH "") +set(MPIEXEC_NUMPROC_FLAG "-n" CACHE PATH "") From 51b3dfa9808be64c6ea7c5330b841d406374b5e7 Mon Sep 17 00:00:00 2001 From: Chris White Date: Wed, 3 Nov 2021 17:27:31 -0700 Subject: [PATCH 32/76] add comment --- .../llnl/toss_3_x86_64_ib/intel-oneapi@2021.3-c++17.cmake | 1 + 1 file changed, 1 insertion(+) diff --git a/host-configs/llnl/toss_3_x86_64_ib/intel-oneapi@2021.3-c++17.cmake b/host-configs/llnl/toss_3_x86_64_ib/intel-oneapi@2021.3-c++17.cmake index 54fd3fe76..7a386a2b3 100644 --- a/host-configs/llnl/toss_3_x86_64_ib/intel-oneapi@2021.3-c++17.cmake +++ b/host-configs/llnl/toss_3_x86_64_ib/intel-oneapi@2021.3-c++17.cmake @@ -39,6 +39,7 @@ set(BLT_CXX_STD "c++17") # Use non-system default stdlib set(GCC_VERSION "gcc-9.3.1") +# Note: gcc-8.3.1 and above need the "/rh" directory. Below that version do not. set(GCC_HOME "/usr/tce/packages/gcc/${GCC_VERSION}/rh") set(BLT_C_FLAGS "--gcc-toolchain=${GCC_HOME}" CACHE STRING "") From c4eb6a117a11b93d4540056c5afd6c47727cba94 Mon Sep 17 00:00:00 2001 From: "Peter B. Robinson" Date: Fri, 5 Nov 2021 10:47:04 -0700 Subject: [PATCH 33/76] Map Flang Fortran COMPILER_ID to Clang family of compilers. --- cmake/SetupCompilerOptions.cmake | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/cmake/SetupCompilerOptions.cmake b/cmake/SetupCompilerOptions.cmake index dea52c01b..635583b92 100644 --- a/cmake/SetupCompilerOptions.cmake +++ b/cmake/SetupCompilerOptions.cmake @@ -66,6 +66,10 @@ else() set(Fortran_COMPILER_FAMILY_IS_CLANG 1) message(STATUS "Fortran Compiler family is Clang") + elseif("${CMAKE_Fortran_COMPILER_ID}" MATCHES "Flang") # For Flang compilers + set(Fortran_COMPILER_FAMILY_IS_CLANG 1 CACHE BOOL "") + message(STATUS "Fortran Compiler family is Clang") + elseif("${CMAKE_Fortran_COMPILER_ID}" STREQUAL "XL") set(Fortran_COMPILER_FAMILY_IS_XL 1) message(STATUS "Fortran Compiler family is XL") From 3e67d0119bddab296f11301ed6d1923f5bab1d33 Mon Sep 17 00:00:00 2001 From: Geoffrey M Oxberry Date: Fri, 17 Sep 2021 17:04:12 -0700 Subject: [PATCH 34/76] BLTPrivateMacros: match language suffixes by regex This commit changes the language source code extension detection code to match extensions via regular expressions on filenames instead of matching by using the output of `get_filename_component(... ... EXT)` and checking to see if that output is in a list of filename extensions. `get_filename_component(... ... EXT)` will output the string formed from the leftmost period in the filename (ignoring directory prefixes), plus all characters to the right of that period. A challenge with this approach occurs when files are named, e.g., `quadrature_rule.order2.c` because `get_filename_component(... ... EXT)` applied to those files will return, e.g., `.order2.c`, which will not match `.c`. This limitation forces users to add extensions to BLT variables like `BLT_C_FILE_EXTS`. While this approach is tractable if a small number of extensions must be added, for larger numbers of "custom" extensions, this approach becomes cumbersome for users. The approach in this commit instead forms a regex of the form, e.g., for C-like extensions, ``` ^.*(\.cpp|\.hpp|\.cxx|\.cxx|\.hxx|\.c|\.h|\.cc|\.hh|\.inl|\.cu|\.cuh)$ ``` by looping over file extension settings, contatenating the list with pipes, and escaping the period in file extensions appropriately. This regex will match the `.c` part of `quadrature_rule.order2.c` and appropriately identify it as a C-like source file. --- cmake/BLTPrivateMacros.cmake | 77 ++++++++++++++++++++++++++---------- 1 file changed, 56 insertions(+), 21 deletions(-) diff --git a/cmake/BLTPrivateMacros.cmake b/cmake/BLTPrivateMacros.cmake index 04d33ba8a..a7104dcba 100644 --- a/cmake/BLTPrivateMacros.cmake +++ b/cmake/BLTPrivateMacros.cmake @@ -754,6 +754,24 @@ macro(blt_add_hip_executable) endmacro(blt_add_hip_executable) +##----------------------------------------------------------------------------- +## blt_error_if_target_exists( ) +## +## This function converts the list of extensions in +## to a regular expression in that should match +## any file name starting with a string and ending with any one of the +## extensions in . +## +## Note that the argument has to be quoted, so that the +## argument is passed as a string to this function. +## ----------------------------------------------------------------------------- +function(blt_make_regex_from_ext_list ext_list ext_regex) + message(STATUS "ext_list = ${ext_list}") + string(REPLACE ";" "|" joined_ext_list "${ext_list}") + string(REPLACE "." "\\." escaped_joined_list "${joined_ext_list}") + set(${ext_regex} "^.*(${escaped_joined_list})$" PARENT_SCOPE) +endfunction() + ##------------------------------------------------------------------------------ ## blt_split_source_list_by_language( SOURCES ## C_LIST @@ -783,6 +801,22 @@ macro(blt_split_source_list_by_language) message( FATAL_ERROR "Must provide a SOURCES argument to the 'blt_split_source_list_by_language' macro" ) endif() + # Convert extensions lists to regexes + set(BLT_C_FILE_REGEX "") + blt_make_regex_from_ext_list("${BLT_C_FILE_EXTS}" BLT_C_FILE_REGEX) + set(BLT_Fortran_FILE_REGEX "") + blt_make_regex_from_ext_list("${BLT_Fortran_FILE_EXTS}" BLT_Fortran_FILE_REGEX) + set(BLT_Python_FILE_REGEX "") + blt_make_regex_from_ext_list("${BLT_Python_FILE_EXTS}" BLT_Python_FILE_REGEX) + set(BLT_CMAKE_FILE_REGEX "") + blt_make_regex_from_ext_list("${BLT_CMAKE_FILE_EXTS}" BLT_CMAKE_FILE_REGEX) + + # Normalize the case of the regexes + string(TOLOWER "${BLT_C_FILE_REGEX}" BLT_C_FILE_REGEX) + string(TOLOWER "${BLT_Fortran_FILE_REGEX}" BLT_Fortran_FILE_REGEX) + string(TOLOWER "${BLT_Python_FILE_REGEX}" BLT_Python_FILE_REGEX) + string(TOLOWER "${BLT_CMAKE_FILE_REGEX}" BLT_CMAKE_FILE_REGEX) + # Generate source lists based on language foreach(_file ${arg_SOURCES}) # Allow CMake object libraries but disallow generator expressions @@ -798,29 +832,30 @@ macro(blt_split_source_list_by_language) message(FATAL_ERROR "blt_split_source_list_by_language given source file with no extension: ${_file}") endif() - get_filename_component(_name "${_file}" NAME) - - string(TOLOWER "${_ext}" _ext_lower) - - if("${_ext_lower}" IN_LIST BLT_C_FILE_EXTS) - if (DEFINED arg_C_LIST) - list(APPEND ${arg_C_LIST} "${_file}") - endif() - elseif("${_ext_lower}" IN_LIST BLT_Fortran_FILE_EXTS) - if (DEFINED arg_Fortran_LIST) - list(APPEND ${arg_Fortran_LIST} "${_file}") - endif() - elseif("${_ext_lower}" IN_LIST BLT_Python_FILE_EXTS) - if (DEFINED arg_Python_LIST) - list(APPEND ${arg_Python_LIST} "${_file}") - endif() - elseif("${_ext_lower}" IN_LIST BLT_CMAKE_FILE_EXTS OR "${_name}" STREQUAL "CMakeLists.txt") - if (DEFINED arg_CMAKE_LIST) - list(APPEND ${arg_CMAKE_LIST} "${_file}") - endif() + get_filename_component(_name "${_file}" NAME) + + string(TOLOWER "${_file}" _lower_file) + + if("${_lower_file}" MATCHES "${BLT_C_FILE_REGEX}") + if (DEFINED arg_C_LIST) + list(APPEND ${arg_C_LIST} "${_file}") + endif() + elseif("${_lower_file}" MATCHES "${BLT_Fortran_FILE_REGEX}") + if (DEFINED arg_Fortran_LIST) + list(APPEND ${arg_Fortran_LIST} "${_file}") + endif() + elseif("${_lower_file}" MATCHES "${BLT_Python_FILE_EXTS}") + if (DEFINED arg_Python_LIST) + list(APPEND ${arg_Python_LIST} "${_file}") + endif() + elseif("${_lower_file}" MATCHES "${BLT_CMAKE_EXTS}" OR "${_name}" STREQUAL "CMakeLists.txt") + if (DEFINED arg_CMAKE_LIST) + list(APPEND ${arg_CMAKE_LIST} "${_file}") + endif() else() - message(FATAL_ERROR "blt_split_source_list_by_language given source file with unknown file extension. Add the missing extension to the corresponding list (BLT_C_FILE_EXTS, BLT_Fortran_FILE_EXTS, BLT_Python_FILE_EXTS, or BLT_CMAKE_FILE_EXTS).\n Unknown file: ${_file}") + message(FATAL_ERROR "blt_split_source_list_by_language given source file with unknown file extension. Add the missing extension to the corresponding list (BLT_C_FILE_EXTS, BLT_Fortran_FILE_EXTS, BLT_Python_FILE_EXTS, or BLT_CMAKE_FILE_EXTS).\n Unknown file: ${_file}") endif() + endforeach() endmacro(blt_split_source_list_by_language) From a4caddf794f40fe73f9ae9cfe493ad51bb66b087 Mon Sep 17 00:00:00 2001 From: Geoffrey M Oxberry Date: Fri, 17 Sep 2021 17:22:38 -0700 Subject: [PATCH 35/76] SetupBLT: delete uppercase extensions from lists This commit deletes uppercased versions of extensions from the Fortran file extension list because both the previous version of the file extension matching macro (that did not use regexes) and the updated version of that macro (which does use regexes) only match lowercase extensions. --- SetupBLT.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/SetupBLT.cmake b/SetupBLT.cmake index f85a53727..6853b087c 100644 --- a/SetupBLT.cmake +++ b/SetupBLT.cmake @@ -174,7 +174,7 @@ if (NOT BLT_LOADED) ################################ set(BLT_C_FILE_EXTS ".cpp" ".hpp" ".cxx" ".hxx" ".c" ".h" ".cc" ".hh" ".inl" ".cu" ".cuh" CACHE STRING "List of known file extensions used for C/CXX sources") - set(BLT_Fortran_FILE_EXTS ".F" ".f" ".f90" ".F90" + set(BLT_Fortran_FILE_EXTS ".f" ".f90" CACHE STRING "List of known file extensions used for Fortran sources") set(BLT_Python_FILE_EXTS ".py" CACHE STRING "List of known file extensions used for Python sources") From c138f5801c0ed064e8271a70c1bf3aa4a38749c3 Mon Sep 17 00:00:00 2001 From: Geoffrey M Oxberry Date: Fri, 17 Sep 2021 17:42:40 -0700 Subject: [PATCH 36/76] RELEASE-NOTES: add regex file ext match update This commit documents the change in the filename extension-matching implementation to use regular expressions to support better BLT users with projects that use "custom" filename extensions like ".cube.order2.c". --- RELEASE-NOTES.md | 29 +++++++++++++++++++++++++++-- 1 file changed, 27 insertions(+), 2 deletions(-) diff --git a/RELEASE-NOTES.md b/RELEASE-NOTES.md index c84b2d9bc..fed3560fd 100644 --- a/RELEASE-NOTES.md +++ b/RELEASE-NOTES.md @@ -16,7 +16,32 @@ The project release numbers follow [Semantic Versioning](http://semver.org/spec/ ### Changed - `BLT_C_FILE_EXTS` updated to include `.cuh` - Fold `BLT_CLANG_HIP_ARCH` into the `CMAKE_HIP_ARCHITECTURES` variable -- When using `ENABLE_ALL_WARNINGS`, append the flag to the beginning of `CMAKE_{C,CXX}_FLAGS` instead of the end +- When using `ENABLE_ALL_WARNINGS`, append the flag to the beginning of `CMAKE_{C,CXX}_FLAGS` instead + of the end +- Source code filename extensions are now detected using regular + expressions instead of checking whether the output of + `get_filename_component(... ... EXT)` is in a list of filename + extensions for each programming language (e.g., + `BLT_C_FILE_EXTS`). CMake's `get_filename_component(... ... EXT)` + returns from its filename input a string containing the leftmost + period of the filename and all characters to its right (stripping + all directory prefixes, assuming use of a left-to-right-script-based + character set). This behavior causes problems in filename extension + detection with files that have names like `1d.cube.order2.c` because + the `get_filename_component` call will output `.cube.order2.c` + instead of `.c`. + + While users could add extensions like `.cube.order2.c` to BLT + filename extension lists like `BLT_C_FILE_EXTS`, if many such + "custom" extensions exist, adding each such extension could be + cumbersome. Though CMake 3.14 and later support using + `get_filename_component(... ... LAST_EXT)`, earlier versions of + CMake do not, and BLT aims to support CMake 3.8+. Instead, regular + expressions are used to detect that the filename extension of + `1d.cube.order2.c` is `.c`. The regular-expression-based + extension-matching implementation continues to support custom + filename extensions, and should be backward-compatible with earlier + versions of BLT. ## [Version 0.4.1] - Release date 2021-07-20 @@ -86,7 +111,7 @@ The project release numbers follow [Semantic Versioning](http://semver.org/spec/ - ``blt_patch_target`` no longer attempts to set system include directories when a target has no include directories - Header-only libraries now can have dependencies via DEPENDS_ON in ``blt_add_library`` -- Added a workaround for include directories of imported targets on PGI. CMake was +- Added a workaround for include directories of imported targets on PGI. CMake was erroneously marking them as SYSTEM but this is not supported by PGI. - Check added to make sure that if HIP is enabled with fortran, the LINKER LANGUAGE is not changed back to Fortran. From 5c664bcbc26a76b913800d4c0f46b5844f2b6129 Mon Sep 17 00:00:00 2001 From: Geoffrey M Oxberry Date: Fri, 17 Sep 2021 17:47:15 -0700 Subject: [PATCH 37/76] BLTPrivateMacros: fix regex match indentation This commit fixes the indentation of the regex match code added to BLTPrivateMacros.cmake. --- cmake/BLTPrivateMacros.cmake | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/cmake/BLTPrivateMacros.cmake b/cmake/BLTPrivateMacros.cmake index a7104dcba..7042992da 100644 --- a/cmake/BLTPrivateMacros.cmake +++ b/cmake/BLTPrivateMacros.cmake @@ -837,23 +837,23 @@ macro(blt_split_source_list_by_language) string(TOLOWER "${_file}" _lower_file) if("${_lower_file}" MATCHES "${BLT_C_FILE_REGEX}") - if (DEFINED arg_C_LIST) - list(APPEND ${arg_C_LIST} "${_file}") - endif() + if (DEFINED arg_C_LIST) + list(APPEND ${arg_C_LIST} "${_file}") + endif() elseif("${_lower_file}" MATCHES "${BLT_Fortran_FILE_REGEX}") - if (DEFINED arg_Fortran_LIST) - list(APPEND ${arg_Fortran_LIST} "${_file}") - endif() + if (DEFINED arg_Fortran_LIST) + list(APPEND ${arg_Fortran_LIST} "${_file}") + endif() elseif("${_lower_file}" MATCHES "${BLT_Python_FILE_EXTS}") - if (DEFINED arg_Python_LIST) - list(APPEND ${arg_Python_LIST} "${_file}") - endif() + if (DEFINED arg_Python_LIST) + list(APPEND ${arg_Python_LIST} "${_file}") + endif() elseif("${_lower_file}" MATCHES "${BLT_CMAKE_EXTS}" OR "${_name}" STREQUAL "CMakeLists.txt") - if (DEFINED arg_CMAKE_LIST) - list(APPEND ${arg_CMAKE_LIST} "${_file}") - endif() + if (DEFINED arg_CMAKE_LIST) + list(APPEND ${arg_CMAKE_LIST} "${_file}") + endif() else() - message(FATAL_ERROR "blt_split_source_list_by_language given source file with unknown file extension. Add the missing extension to the corresponding list (BLT_C_FILE_EXTS, BLT_Fortran_FILE_EXTS, BLT_Python_FILE_EXTS, or BLT_CMAKE_FILE_EXTS).\n Unknown file: ${_file}") + message(FATAL_ERROR "blt_split_source_list_by_language given source file with unknown file extension. Add the missing extension to the corresponding list (BLT_C_FILE_EXTS, BLT_Fortran_FILE_EXTS, BLT_Python_FILE_EXTS, or BLT_CMAKE_FILE_EXTS).\n Unknown file: ${_file}") endif() endforeach() From 4d20309005d57d8a98fca534e517ff7f993424be Mon Sep 17 00:00:00 2001 From: Geoffrey M Oxberry Date: Fri, 17 Sep 2021 18:00:38 -0700 Subject: [PATCH 38/76] azure-pipelines: add smoke test for style target This commit adds a smoke test for the CMake `style` target; unsure if this approach is a good idea because some tools may return nonzero exit status when formatting files. --- azure-pipelines.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index dfc037ad2..7a7f0fa8f 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -1,6 +1,6 @@ # Copyright (c) 2017-2021, Lawrence Livermore National Security, LLC and # other BLT Project Developers. See the top-level LICENSE file for details -# +# # SPDX-License-Identifier: (BSD-3-Clause) variables: @@ -53,7 +53,8 @@ steps: displayName: 'OSX/Windows CMake' condition: or( eq( variables['Agent.OS'], 'Windows_NT'), eq( variables['Agent.OS'], 'Darwin')) - script: | - cmake --build build --config Release + cmake --build build --config Release + cmake --build build --config Release --target style displayName: 'OSX/Windows Build' condition: or( eq( variables['Agent.OS'], 'Windows_NT'), eq( variables['Agent.OS'], 'Darwin')) - script: | @@ -69,6 +70,7 @@ steps: displayName: 'Linux CMake' - script: | docker run $(DOCKER_FLAGS) make -j2 + docker run $(DOCKER_FLAGS) make style condition: eq( variables['Agent.OS'], 'Linux') displayName: 'Linux Build' - script: | From 9a9549e8e446fbce7b80aa89828a10bc65ec850d Mon Sep 17 00:00:00 2001 From: Geoffrey M Oxberry Date: Fri, 17 Sep 2021 18:19:12 -0700 Subject: [PATCH 39/76] gitlab: add smoke test for style checks This commit adds a smoke test for style checks; note that it just runs the style target but doesn't check to see if the style target has done anything, or whether the target has done the right thing(s). --- .gitlab/build_and_test.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitlab/build_and_test.sh b/.gitlab/build_and_test.sh index cd6130187..c27282623 100755 --- a/.gitlab/build_and_test.sh +++ b/.gitlab/build_and_test.sh @@ -15,6 +15,7 @@ cd $BUILD_DIR cmake -C ../host-configs/llnl/$SYS_TYPE/$HOST_CONFIG ../tests/internal make -j8 +make style ctest -DCTEST_OUTPUT_ON_FAILURE=1 --no-compress-output -T Test -VV xsltproc -o junit.xml ../tests/ctest-to-junit.xsl Testing/*/Test.xml From 46ef8f8668d10ca9216e56b3601107cd1968260c Mon Sep 17 00:00:00 2001 From: Chris White Date: Tue, 9 Nov 2021 16:54:28 -0800 Subject: [PATCH 40/76] convert function to macro to be more consistent with rest of BLT --- cmake/BLTPrivateMacros.cmake | 66 ++++++++++++++++++++++++------------ 1 file changed, 44 insertions(+), 22 deletions(-) diff --git a/cmake/BLTPrivateMacros.cmake b/cmake/BLTPrivateMacros.cmake index 7042992da..57a006a35 100644 --- a/cmake/BLTPrivateMacros.cmake +++ b/cmake/BLTPrivateMacros.cmake @@ -754,23 +754,41 @@ macro(blt_add_hip_executable) endmacro(blt_add_hip_executable) + ##----------------------------------------------------------------------------- -## blt_error_if_target_exists( ) -## -## This function converts the list of extensions in -## to a regular expression in that should match -## any file name starting with a string and ending with any one of the -## extensions in . +## blt_make_regex_from_ext_list( EXTENSIONS [ext1 [ext2 ...]] +## OUTPUT_REGEX ) ## -## Note that the argument has to be quoted, so that the -## argument is passed as a string to this function. +## This function converts the list of extensions in EXTENSIONS and +## fills the variable, given in OUTPUT_REGEX, with a joined, with '|', +## regular expression. This regex should match any file name starting with +## a string and ending with any one of the extensions in EXTENSIONS. ## ----------------------------------------------------------------------------- -function(blt_make_regex_from_ext_list ext_list ext_regex) - message(STATUS "ext_list = ${ext_list}") - string(REPLACE ";" "|" joined_ext_list "${ext_list}") - string(REPLACE "." "\\." escaped_joined_list "${joined_ext_list}") - set(${ext_regex} "^.*(${escaped_joined_list})$" PARENT_SCOPE) -endfunction() +macro(blt_make_regex_from_ext_list) + + set(options) + set(singleValueArgs OUTPUT_REGEX) + set(multiValueArgs EXTENSIONS) + + # Parse the arguments + cmake_parse_arguments(arg "${options}" "${singleValueArgs}" + "${multiValueArgs}" ${ARGN} ) + + # Check arguments + if ( NOT DEFINED arg_EXTENSIONS ) + message( FATAL_ERROR "Must provide a EXTENSIONS argument to the 'blt_make_regex_from_ext_list' macro" ) + endif() + + if ( NOT DEFINED arg_OUTPUT_REGEX ) + message( FATAL_ERROR "Must provide a OUTPUT_REGEX argument to the 'blt_make_regex_from_ext_list' macro" ) + endif() + + list(JOIN arg_EXTENSIONS "|" ${arg_OUTPUT_REGEX}) + string(REPLACE "." "\\." ${arg_OUTPUT_REGEX} "${${arg_OUTPUT_REGEX}}") + + set(${arg_OUTPUT_REGEX} "^.*(${${arg_OUTPUT_REGEX}})$") +endmacro() + ##------------------------------------------------------------------------------ ## blt_split_source_list_by_language( SOURCES @@ -802,14 +820,18 @@ macro(blt_split_source_list_by_language) endif() # Convert extensions lists to regexes - set(BLT_C_FILE_REGEX "") - blt_make_regex_from_ext_list("${BLT_C_FILE_EXTS}" BLT_C_FILE_REGEX) - set(BLT_Fortran_FILE_REGEX "") - blt_make_regex_from_ext_list("${BLT_Fortran_FILE_EXTS}" BLT_Fortran_FILE_REGEX) - set(BLT_Python_FILE_REGEX "") - blt_make_regex_from_ext_list("${BLT_Python_FILE_EXTS}" BLT_Python_FILE_REGEX) - set(BLT_CMAKE_FILE_REGEX "") - blt_make_regex_from_ext_list("${BLT_CMAKE_FILE_EXTS}" BLT_CMAKE_FILE_REGEX) + set(BLT_C_FILE_REGEX) + blt_make_regex_from_ext_list(EXTENSIONS ${BLT_C_FILE_EXTS} + OUTPUT_REGEX BLT_C_FILE_REGEX) + set(BLT_Fortran_FILE_REGEX) + blt_make_regex_from_ext_list(EXTENSIONS ${BLT_Fortran_FILE_EXTS} + OUTPUT_REGEX BLT_Fortran_FILE_REGEX) + set(BLT_Python_FILE_REGEX) + blt_make_regex_from_ext_list(EXTENSIONS ${BLT_Python_FILE_EXTS} + OUTPUT_REGEX BLT_Python_FILE_REGEX) + set(BLT_CMAKE_FILE_REGEX) + blt_make_regex_from_ext_list(EXTENSIONS ${BLT_CMAKE_FILE_EXTS} + OUTPUT_REGEX BLT_CMAKE_FILE_REGEX) # Normalize the case of the regexes string(TOLOWER "${BLT_C_FILE_REGEX}" BLT_C_FILE_REGEX) From 4f3ebe05a96f41ef9714e166d3e12e9fbe67338d Mon Sep 17 00:00:00 2001 From: Chris White Date: Tue, 9 Nov 2021 17:24:11 -0800 Subject: [PATCH 41/76] clarify case-insensitivity in several places and move TOLOWER call into regex creation macro --- SetupBLT.cmake | 7 ++++++- cmake/BLTPrivateMacros.cmake | 24 +++++++++++++----------- 2 files changed, 19 insertions(+), 12 deletions(-) diff --git a/SetupBLT.cmake b/SetupBLT.cmake index 6853b087c..f89143c43 100644 --- a/SetupBLT.cmake +++ b/SetupBLT.cmake @@ -172,13 +172,18 @@ if (NOT BLT_LOADED) # Global variables needed by BLT # ################################ + + # File extension lists used to filter sources based on languages for code checks + # and filtering Fortran sources out of cuda/hip source lists + # Note: this filtering is case-insensitive set(BLT_C_FILE_EXTS ".cpp" ".hpp" ".cxx" ".hxx" ".c" ".h" ".cc" ".hh" ".inl" ".cu" ".cuh" CACHE STRING "List of known file extensions used for C/CXX sources") set(BLT_Fortran_FILE_EXTS ".f" ".f90" CACHE STRING "List of known file extensions used for Fortran sources") set(BLT_Python_FILE_EXTS ".py" CACHE STRING "List of known file extensions used for Python sources") - set(BLT_CMAKE_FILE_EXTS ".cmake" # NOTE: CMakeLists.txt handled elsewhere + # NOTE: CMakeLists.txt handled in `blt_split_source_list_by_language` + set(BLT_CMAKE_FILE_EXTS ".cmake" CACHE STRING "List of known file extensions used for CMake sources") ################################ diff --git a/cmake/BLTPrivateMacros.cmake b/cmake/BLTPrivateMacros.cmake index 57a006a35..95edc4d3c 100644 --- a/cmake/BLTPrivateMacros.cmake +++ b/cmake/BLTPrivateMacros.cmake @@ -763,6 +763,7 @@ endmacro(blt_add_hip_executable) ## fills the variable, given in OUTPUT_REGEX, with a joined, with '|', ## regular expression. This regex should match any file name starting with ## a string and ending with any one of the extensions in EXTENSIONS. +## This also lower cases all extensions because we do not care about file casing. ## ----------------------------------------------------------------------------- macro(blt_make_regex_from_ext_list) @@ -783,10 +784,16 @@ macro(blt_make_regex_from_ext_list) message( FATAL_ERROR "Must provide a OUTPUT_REGEX argument to the 'blt_make_regex_from_ext_list' macro" ) endif() + # Join with 'or', and escape periods list(JOIN arg_EXTENSIONS "|" ${arg_OUTPUT_REGEX}) + # Lower-case because we do case-insensitive checks + string(TOLOWER "${BLT_C_FILE_REGEX}" BLT_C_FILE_REGEX) + # Escape periods before adding string(REPLACE "." "\\." ${arg_OUTPUT_REGEX} "${${arg_OUTPUT_REGEX}}") - + # Regex for by any set of characters followed by any of the given + # file extensions at the end of the string set(${arg_OUTPUT_REGEX} "^.*(${${arg_OUTPUT_REGEX}})$") + endmacro() @@ -799,10 +806,11 @@ endmacro() ## ## Filters source list by file extension into C/C++, Fortran, Python, and ## CMake source lists based on BLT_C_FILE_EXTS, BLT_Fortran_FILE_EXTS, -## and BLT_CMAKE_FILE_EXTS (global BLT variables). Files named -## "CMakeLists.txt" are also filtered here. Files with no extension -## or generator expressions that are not object libraries (of the form -## "$") will throw fatal errors. +## and BLT_CMAKE_FILE_EXTS (global BLT variables). This filtering is +## case-insensitive. Files named "CMakeLists.txt" are also filtered here. +## Files with no extension or generator expressions that are not object +## libraries (of the form "$") will +## throw fatal errors. ## ------------------------------------------------------------------------------ macro(blt_split_source_list_by_language) @@ -833,12 +841,6 @@ macro(blt_split_source_list_by_language) blt_make_regex_from_ext_list(EXTENSIONS ${BLT_CMAKE_FILE_EXTS} OUTPUT_REGEX BLT_CMAKE_FILE_REGEX) - # Normalize the case of the regexes - string(TOLOWER "${BLT_C_FILE_REGEX}" BLT_C_FILE_REGEX) - string(TOLOWER "${BLT_Fortran_FILE_REGEX}" BLT_Fortran_FILE_REGEX) - string(TOLOWER "${BLT_Python_FILE_REGEX}" BLT_Python_FILE_REGEX) - string(TOLOWER "${BLT_CMAKE_FILE_REGEX}" BLT_CMAKE_FILE_REGEX) - # Generate source lists based on language foreach(_file ${arg_SOURCES}) # Allow CMake object libraries but disallow generator expressions From 6ca87b4833ef4e43301f25d944a6a4d9e45d328a Mon Sep 17 00:00:00 2001 From: Chris White Date: Tue, 9 Nov 2021 17:26:06 -0800 Subject: [PATCH 42/76] clarify macro name --- cmake/BLTPrivateMacros.cmake | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/cmake/BLTPrivateMacros.cmake b/cmake/BLTPrivateMacros.cmake index 95edc4d3c..c1ea34b23 100644 --- a/cmake/BLTPrivateMacros.cmake +++ b/cmake/BLTPrivateMacros.cmake @@ -756,8 +756,8 @@ endmacro(blt_add_hip_executable) ##----------------------------------------------------------------------------- -## blt_make_regex_from_ext_list( EXTENSIONS [ext1 [ext2 ...]] -## OUTPUT_REGEX ) +## blt_make_file_ext_regex( EXTENSIONS [ext1 [ext2 ...]] +## OUTPUT_REGEX ) ## ## This function converts the list of extensions in EXTENSIONS and ## fills the variable, given in OUTPUT_REGEX, with a joined, with '|', @@ -765,7 +765,7 @@ endmacro(blt_add_hip_executable) ## a string and ending with any one of the extensions in EXTENSIONS. ## This also lower cases all extensions because we do not care about file casing. ## ----------------------------------------------------------------------------- -macro(blt_make_regex_from_ext_list) +macro(blt_make_file_ext_regex) set(options) set(singleValueArgs OUTPUT_REGEX) @@ -777,11 +777,11 @@ macro(blt_make_regex_from_ext_list) # Check arguments if ( NOT DEFINED arg_EXTENSIONS ) - message( FATAL_ERROR "Must provide a EXTENSIONS argument to the 'blt_make_regex_from_ext_list' macro" ) + message( FATAL_ERROR "Must provide a EXTENSIONS argument to the 'blt_make_file_ext_regex' macro" ) endif() if ( NOT DEFINED arg_OUTPUT_REGEX ) - message( FATAL_ERROR "Must provide a OUTPUT_REGEX argument to the 'blt_make_regex_from_ext_list' macro" ) + message( FATAL_ERROR "Must provide a OUTPUT_REGEX argument to the 'blt_make_file_ext_regex' macro" ) endif() # Join with 'or', and escape periods @@ -794,7 +794,7 @@ macro(blt_make_regex_from_ext_list) # file extensions at the end of the string set(${arg_OUTPUT_REGEX} "^.*(${${arg_OUTPUT_REGEX}})$") -endmacro() +endmacro(blt_make_file_ext_regex) ##------------------------------------------------------------------------------ @@ -829,17 +829,17 @@ macro(blt_split_source_list_by_language) # Convert extensions lists to regexes set(BLT_C_FILE_REGEX) - blt_make_regex_from_ext_list(EXTENSIONS ${BLT_C_FILE_EXTS} - OUTPUT_REGEX BLT_C_FILE_REGEX) + blt_make_file_ext_regex(EXTENSIONS ${BLT_C_FILE_EXTS} + OUTPUT_REGEX BLT_C_FILE_REGEX) set(BLT_Fortran_FILE_REGEX) - blt_make_regex_from_ext_list(EXTENSIONS ${BLT_Fortran_FILE_EXTS} - OUTPUT_REGEX BLT_Fortran_FILE_REGEX) + blt_make_file_ext_regex(EXTENSIONS ${BLT_Fortran_FILE_EXTS} + OUTPUT_REGEX BLT_Fortran_FILE_REGEX) set(BLT_Python_FILE_REGEX) - blt_make_regex_from_ext_list(EXTENSIONS ${BLT_Python_FILE_EXTS} - OUTPUT_REGEX BLT_Python_FILE_REGEX) + blt_make_file_ext_regex(EXTENSIONS ${BLT_Python_FILE_EXTS} + OUTPUT_REGEX BLT_Python_FILE_REGEX) set(BLT_CMAKE_FILE_REGEX) - blt_make_regex_from_ext_list(EXTENSIONS ${BLT_CMAKE_FILE_EXTS} - OUTPUT_REGEX BLT_CMAKE_FILE_REGEX) + blt_make_file_ext_regex(EXTENSIONS ${BLT_CMAKE_FILE_EXTS} + OUTPUT_REGEX BLT_CMAKE_FILE_REGEX) # Generate source lists based on language foreach(_file ${arg_SOURCES}) From 5b15dd520ab03120eef4fc0336e4528132983507 Mon Sep 17 00:00:00 2001 From: Chris White Date: Tue, 9 Nov 2021 17:37:35 -0800 Subject: [PATCH 43/76] simplify relase notes --- RELEASE-NOTES.md | 29 +++++------------------------ 1 file changed, 5 insertions(+), 24 deletions(-) diff --git a/RELEASE-NOTES.md b/RELEASE-NOTES.md index fed3560fd..5e53c5601 100644 --- a/RELEASE-NOTES.md +++ b/RELEASE-NOTES.md @@ -18,30 +18,11 @@ The project release numbers follow [Semantic Versioning](http://semver.org/spec/ - Fold `BLT_CLANG_HIP_ARCH` into the `CMAKE_HIP_ARCHITECTURES` variable - When using `ENABLE_ALL_WARNINGS`, append the flag to the beginning of `CMAKE_{C,CXX}_FLAGS` instead of the end -- Source code filename extensions are now detected using regular - expressions instead of checking whether the output of - `get_filename_component(... ... EXT)` is in a list of filename - extensions for each programming language (e.g., - `BLT_C_FILE_EXTS`). CMake's `get_filename_component(... ... EXT)` - returns from its filename input a string containing the leftmost - period of the filename and all characters to its right (stripping - all directory prefixes, assuming use of a left-to-right-script-based - character set). This behavior causes problems in filename extension - detection with files that have names like `1d.cube.order2.c` because - the `get_filename_component` call will output `.cube.order2.c` - instead of `.c`. - - While users could add extensions like `.cube.order2.c` to BLT - filename extension lists like `BLT_C_FILE_EXTS`, if many such - "custom" extensions exist, adding each such extension could be - cumbersome. Though CMake 3.14 and later support using - `get_filename_component(... ... LAST_EXT)`, earlier versions of - CMake do not, and BLT aims to support CMake 3.8+. Instead, regular - expressions are used to detect that the filename extension of - `1d.cube.order2.c` is `.c`. The regular-expression-based - extension-matching implementation continues to support custom - filename extensions, and should be backward-compatible with earlier - versions of BLT. + +### Fixed +- Source code filename extension filtering now utilize regular expressions to allow + greater user customization and improves handling of file names with multiple + periods, e.g. `1d.cube.order2.c` is considered a `.c` file. ## [Version 0.4.1] - Release date 2021-07-20 From af4901b3b16b748656ab4566585463acec18b38b Mon Sep 17 00:00:00 2001 From: Chris White Date: Tue, 9 Nov 2021 19:05:39 -0800 Subject: [PATCH 44/76] add unit test for blt_split_source_list_by_language --- cmake/BLTPrivateMacros.cmake | 2 +- tests/internal/CMakeLists.txt | 126 ++++++++++++++++++++++++++++++++++ 2 files changed, 127 insertions(+), 1 deletion(-) diff --git a/cmake/BLTPrivateMacros.cmake b/cmake/BLTPrivateMacros.cmake index c1ea34b23..f4781153f 100644 --- a/cmake/BLTPrivateMacros.cmake +++ b/cmake/BLTPrivateMacros.cmake @@ -801,7 +801,7 @@ endmacro(blt_make_file_ext_regex) ## blt_split_source_list_by_language( SOURCES ## C_LIST ## Fortran_LIST -## Python_LIST ) +## Python_LIST ## CMAKE_LIST ) ## ## Filters source list by file extension into C/C++, Fortran, Python, and diff --git a/tests/internal/CMakeLists.txt b/tests/internal/CMakeLists.txt index 164295f75..502feddbb 100644 --- a/tests/internal/CMakeLists.txt +++ b/tests/internal/CMakeLists.txt @@ -269,6 +269,132 @@ if(ENABLE_HIP) add_subdirectory(src/hip_defines_test) endif() +#------------------------------------------------------------------------------ +# Test the splitting of source lists +#------------------------------------------------------------------------------ + +message( +"*****************************************************\n" +"Testing `blt_split_source_list_by_language`...\n" +"*****************************************************") + +# create list of source paths and sorted, correct list of answers +set(original_srcs + src/Example.cpp + src/Example.hpp + multiple.exts.c + quadrature_rule.order2.c + source/.f90/with/extension/in/middle.c + fortran.F + fortran2.f + fortran3.f90 + fortran4.F90 + python.py + some_other.multi.py + CMakeLists.txt + long/path/CMakeLists.txt + macro_file.cmake + ) + +set(correct_c_srcs + src/Example.cpp + src/Example.hpp + multiple.exts.c + quadrature_rule.order2.c + source/.f90/with/extension/in/middle.c + ) + +set(correct_fortran_srcs + fortran.F + fortran2.f + fortran3.f90 + fortran4.F90 + ) + +set(correct_python_srcs + python.py + some_other.multi.py + ) + +set(correct_cmake_srcs + CMakeLists.txt + long/path/CMakeLists.txt + macro_file.cmake + ) + +# Split sources +set(c_srcs) +set(fortran_srcs) +set(python_srcs) +set(cmake_srcs) +blt_split_source_list_by_language( SOURCES ${original_srcs} + C_LIST c_srcs + Fortran_LIST fortran_srcs + Python_LIST python_srcs + CMAKE_LIST cmake_srcs) + +# Macro to see if lists have the same items and errors on non-equality +macro(compare_source_lists) + + set(options) + set(singleValueArgs A_LIST B_LIST) + set(multiValueArgs ) + + # Parse the arguments + cmake_parse_arguments(arg "${options}" "${singleValueArgs}" + "${multiValueArgs}" ${ARGN} ) + + message(STATUS "Comparing lists for equality:\n" + " List A: ${${arg_A_LIST}}\n" + " List B: ${${arg_B_LIST}}") + + set(a_len) + set(b_len) + list(LENGTH ${arg_A_LIST} a_len) + list(LENGTH ${arg_B_LIST} b_len) + if (NOT a_len EQUAL b_len) + message(FATAL_ERROR "Split source test failed. Lists had differing lengths.") + endif() + + set(sorted_a_list ${${arg_A_LIST}}) + set(sorted_b_list ${${arg_B_LIST}}) + list(SORT sorted_a_list) + list(SORT sorted_b_list) + + foreach(i RANGE a_len) + set(a_item) + set(b_item) + list(GET sorted_a_list i a_item) + list(GET sorted_b_list i b_item) + + if(NOT a_item STREQUAL b_item) + message(FATAL_ERROR "Split source test failed. ${a_item} != ${b_item}") + endif() + endforeach() + + # Success if we reached here +endmacro(compare_source_lists) + +message(STATUS "Full mixed source list: ${original_srcs}") + +message(STATUS "Checking C/CXX filtering...") +compare_source_lists(A_LIST c_srcs B_LIST correct_c_srcs) + +message(STATUS "Checking Fortran filtering...") +compare_source_lists(A_LIST fortran_srcs B_LIST correct_fortran_srcs) + +message(STATUS "Checking Python filtering...") +compare_source_lists(A_LIST python_srcs B_LIST correct_python_srcs) + +message(STATUS "Checking CMake filtering...") +compare_source_lists(A_LIST cmake_srcs B_LIST correct_cmake_srcs) + +message( +"*****************************************************\n" +"Tests passed for `blt_split_source_list_by_language`.\n" +"*****************************************************") + + #------------------------------------------------------------------------------ # Format the testing code using ClangFormat #------------------------------------------------------------------------------ From 2c0dc70c8c5219db3d45fb0a99b681d548e719fd Mon Sep 17 00:00:00 2001 From: Chris White Date: Tue, 9 Nov 2021 19:12:48 -0800 Subject: [PATCH 45/76] use value not name.. how did this pass in 3.14 --- tests/internal/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/internal/CMakeLists.txt b/tests/internal/CMakeLists.txt index 502feddbb..ff2ca51b9 100644 --- a/tests/internal/CMakeLists.txt +++ b/tests/internal/CMakeLists.txt @@ -361,7 +361,7 @@ macro(compare_source_lists) list(SORT sorted_a_list) list(SORT sorted_b_list) - foreach(i RANGE a_len) + foreach(i RANGE ${a_len}) set(a_item) set(b_item) list(GET sorted_a_list i a_item) From 94e892a2d046f7cdc0acadaaf3cb41a86598f5f6 Mon Sep 17 00:00:00 2001 From: Chris White Date: Tue, 9 Nov 2021 20:36:00 -0800 Subject: [PATCH 46/76] Update RELEASE-NOTES.md Co-authored-by: Kenny Weiss --- RELEASE-NOTES.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/RELEASE-NOTES.md b/RELEASE-NOTES.md index 5e53c5601..c6de18759 100644 --- a/RELEASE-NOTES.md +++ b/RELEASE-NOTES.md @@ -20,8 +20,8 @@ The project release numbers follow [Semantic Versioning](http://semver.org/spec/ of the end ### Fixed -- Source code filename extension filtering now utilize regular expressions to allow - greater user customization and improves handling of file names with multiple +- Source code filename extension filtering now uses regular expressions to allow + for more user customization and to improve handling of file names with multiple periods, e.g. `1d.cube.order2.c` is considered a `.c` file. ## [Version 0.4.1] - Release date 2021-07-20 From 2825cdc8620ad0d9280ea09ee1ae4bca0b3e377e Mon Sep 17 00:00:00 2001 From: Chris White Date: Tue, 9 Nov 2021 20:48:02 -0800 Subject: [PATCH 47/76] create new unit test directory and move first unit tests to it --- tests/internal/CMakeLists.txt | 129 +----------------------- tests/internal/unit/CMakeLists.txt | 152 +++++++++++++++++++++++++++++ 2 files changed, 154 insertions(+), 127 deletions(-) create mode 100644 tests/internal/unit/CMakeLists.txt diff --git a/tests/internal/CMakeLists.txt b/tests/internal/CMakeLists.txt index ff2ca51b9..ab6b28216 100644 --- a/tests/internal/CMakeLists.txt +++ b/tests/internal/CMakeLists.txt @@ -9,7 +9,7 @@ cmake_minimum_required(VERSION 3.8) -project(blt-example LANGUAGES C CXX) +project(blt-internal-tests LANGUAGES C CXX) #------------------------------------------------------------------------------ # Setup BLT @@ -269,132 +269,7 @@ if(ENABLE_HIP) add_subdirectory(src/hip_defines_test) endif() -#------------------------------------------------------------------------------ -# Test the splitting of source lists -#------------------------------------------------------------------------------ - -message( -"*****************************************************\n" -"Testing `blt_split_source_list_by_language`...\n" -"*****************************************************") - -# create list of source paths and sorted, correct list of answers -set(original_srcs - src/Example.cpp - src/Example.hpp - multiple.exts.c - quadrature_rule.order2.c - source/.f90/with/extension/in/middle.c - fortran.F - fortran2.f - fortran3.f90 - fortran4.F90 - python.py - some_other.multi.py - CMakeLists.txt - long/path/CMakeLists.txt - macro_file.cmake - ) - -set(correct_c_srcs - src/Example.cpp - src/Example.hpp - multiple.exts.c - quadrature_rule.order2.c - source/.f90/with/extension/in/middle.c - ) - -set(correct_fortran_srcs - fortran.F - fortran2.f - fortran3.f90 - fortran4.F90 - ) - -set(correct_python_srcs - python.py - some_other.multi.py - ) - -set(correct_cmake_srcs - CMakeLists.txt - long/path/CMakeLists.txt - macro_file.cmake - ) - -# Split sources -set(c_srcs) -set(fortran_srcs) -set(python_srcs) -set(cmake_srcs) -blt_split_source_list_by_language( SOURCES ${original_srcs} - C_LIST c_srcs - Fortran_LIST fortran_srcs - Python_LIST python_srcs - CMAKE_LIST cmake_srcs) - -# Macro to see if lists have the same items and errors on non-equality -macro(compare_source_lists) - - set(options) - set(singleValueArgs A_LIST B_LIST) - set(multiValueArgs ) - - # Parse the arguments - cmake_parse_arguments(arg "${options}" "${singleValueArgs}" - "${multiValueArgs}" ${ARGN} ) - - message(STATUS "Comparing lists for equality:\n" - " List A: ${${arg_A_LIST}}\n" - " List B: ${${arg_B_LIST}}") - - set(a_len) - set(b_len) - list(LENGTH ${arg_A_LIST} a_len) - list(LENGTH ${arg_B_LIST} b_len) - if (NOT a_len EQUAL b_len) - message(FATAL_ERROR "Split source test failed. Lists had differing lengths.") - endif() - - set(sorted_a_list ${${arg_A_LIST}}) - set(sorted_b_list ${${arg_B_LIST}}) - list(SORT sorted_a_list) - list(SORT sorted_b_list) - - foreach(i RANGE ${a_len}) - set(a_item) - set(b_item) - list(GET sorted_a_list i a_item) - list(GET sorted_b_list i b_item) - - if(NOT a_item STREQUAL b_item) - message(FATAL_ERROR "Split source test failed. ${a_item} != ${b_item}") - endif() - endforeach() - - # Success if we reached here -endmacro(compare_source_lists) - -message(STATUS "Full mixed source list: ${original_srcs}") - -message(STATUS "Checking C/CXX filtering...") -compare_source_lists(A_LIST c_srcs B_LIST correct_c_srcs) - -message(STATUS "Checking Fortran filtering...") -compare_source_lists(A_LIST fortran_srcs B_LIST correct_fortran_srcs) - -message(STATUS "Checking Python filtering...") -compare_source_lists(A_LIST python_srcs B_LIST correct_python_srcs) - -message(STATUS "Checking CMake filtering...") -compare_source_lists(A_LIST cmake_srcs B_LIST correct_cmake_srcs) - -message( -"*****************************************************\n" -"Tests passed for `blt_split_source_list_by_language`.\n" -"*****************************************************") - - +add_subdirectory(unit) #------------------------------------------------------------------------------ # Format the testing code using ClangFormat #------------------------------------------------------------------------------ diff --git a/tests/internal/unit/CMakeLists.txt b/tests/internal/unit/CMakeLists.txt new file mode 100644 index 000000000..6a3626c33 --- /dev/null +++ b/tests/internal/unit/CMakeLists.txt @@ -0,0 +1,152 @@ +# Copyright (c) 2017-2021, Lawrence Livermore National Security, LLC and +# other BLT Project Developers. See the top-level LICENSE file for details +# +# SPDX-License-Identifier: (BSD-3-Clause) + +#------------------------------------------------------------------------------ +# BLT Internal Testing Project +#------------------------------------------------------------------------------ + +cmake_minimum_required(VERSION 3.8) + +project(blt-internal-tests LANGUAGES C CXX) + +#------------------------------------------------------------------------------ +# Setup BLT +#------------------------------------------------------------------------------ +# Set BLT_SOURCE_DIR to default location, if not set by user +if(NOT BLT_SOURCE_DIR) + set(BLT_SOURCE_DIR "${PROJECT_SOURCE_DIR}/../..") +endif() + +if (NOT BLT_CXX_STD) + set(BLT_CXX_STD "c++11" CACHE STRING "") +endif() + +include(${BLT_SOURCE_DIR}/SetupBLT.cmake) + +#------------------------------------------------------------------------------ +# Test blt_split_source_list_by_language +#------------------------------------------------------------------------------ + +message( +"*****************************************************\n" +"Testing `blt_split_source_list_by_language`...\n" +"*****************************************************") + +# create list of source paths and sorted, correct list of answers +set(original_srcs + src/Example.cpp + src/Example.hpp + multiple.exts.c + quadrature_rule.order2.c + source/.f90/with/extension/in/middle.c + fortran.F + fortran2.f + fortran3.f90 + fortran4.F90 + python.py + some_other.multi.py + CMakeLists.txt + long/path/CMakeLists.txt + macro_file.cmake + ) + +set(correct_c_srcs + src/Example.cpp + src/Example.hpp + multiple.exts.c + quadrature_rule.order2.c + source/.f90/with/extension/in/middle.c + ) + +set(correct_fortran_srcs + fortran.F + fortran2.f + fortran3.f90 + fortran4.F90 + ) + +set(correct_python_srcs + python.py + some_other.multi.py + ) + +set(correct_cmake_srcs + CMakeLists.txt + long/path/CMakeLists.txt + macro_file.cmake + ) + +# Split sources +set(c_srcs) +set(fortran_srcs) +set(python_srcs) +set(cmake_srcs) +blt_split_source_list_by_language( SOURCES ${original_srcs} + C_LIST c_srcs + Fortran_LIST fortran_srcs + Python_LIST python_srcs + CMAKE_LIST cmake_srcs) + +# Macro to see if lists have the same items and errors on non-equality +macro(compare_source_lists) + + set(options) + set(singleValueArgs A_LIST B_LIST) + set(multiValueArgs ) + + # Parse the arguments + cmake_parse_arguments(arg "${options}" "${singleValueArgs}" + "${multiValueArgs}" ${ARGN} ) + + message(STATUS "Comparing lists for equality:\n" + " List A: ${${arg_A_LIST}}\n" + " List B: ${${arg_B_LIST}}") + + set(a_len) + set(b_len) + list(LENGTH ${arg_A_LIST} a_len) + list(LENGTH ${arg_B_LIST} b_len) + if (NOT a_len EQUAL b_len) + message(FATAL_ERROR "Split source test failed. Lists had differing lengths.") + endif() + + set(sorted_a_list ${${arg_A_LIST}}) + set(sorted_b_list ${${arg_B_LIST}}) + list(SORT sorted_a_list) + list(SORT sorted_b_list) + + foreach(i RANGE ${a_len}) + set(a_item) + set(b_item) + list(GET sorted_a_list i a_item) + list(GET sorted_b_list i b_item) + + if(NOT a_item STREQUAL b_item) + message(FATAL_ERROR "Split source test failed. ${a_item} != ${b_item}") + endif() + endforeach() + + # Success if we reached here +endmacro(compare_source_lists) + +message(STATUS "Full mixed source list: ${original_srcs}") + +message(STATUS "Checking C/CXX filtering...") +compare_source_lists(A_LIST c_srcs B_LIST correct_c_srcs) + +message(STATUS "Checking Fortran filtering...") +compare_source_lists(A_LIST fortran_srcs B_LIST correct_fortran_srcs) + +message(STATUS "Checking Python filtering...") +compare_source_lists(A_LIST python_srcs B_LIST correct_python_srcs) + +message(STATUS "Checking CMake filtering...") +compare_source_lists(A_LIST cmake_srcs B_LIST correct_cmake_srcs) + +message( +"*****************************************************\n" +"Tests passed for `blt_split_source_list_by_language`.\n" +"*****************************************************") + From 5d1fb737d1cb46e7890450d032594522ae04b5c5 Mon Sep 17 00:00:00 2001 From: Chris White Date: Tue, 9 Nov 2021 21:04:11 -0800 Subject: [PATCH 48/76] add missing host-config --- .gitlab/build_quartz.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.gitlab/build_quartz.yml b/.gitlab/build_quartz.yml index 53a7a2e57..9e2b119a0 100644 --- a/.gitlab/build_quartz.yml +++ b/.gitlab/build_quartz.yml @@ -64,6 +64,11 @@ quartz-inteloneapi_2021_3: HOST_CONFIG: "intel-oneapi@2021.3.cmake" extends: [.build_on_quartz] +quartz-inteloneapi_2021_3_cxx17: + variables: + HOST_CONFIG: "intel-oneapi@2021.3-c++17.cmake" + extends: [.build_on_quartz] + quartz-pgi_20_1: variables: HOST_CONFIG: "pgi@20.1.cmake" From 4d44eecd0012060b519507116217bb293fec1ee4 Mon Sep 17 00:00:00 2001 From: Chris White Date: Tue, 9 Nov 2021 21:05:04 -0800 Subject: [PATCH 49/76] temporarily remove calling build target style since it does nothing atm --- .gitlab/build_and_test.sh | 1 - azure-pipelines.yml | 2 -- 2 files changed, 3 deletions(-) diff --git a/.gitlab/build_and_test.sh b/.gitlab/build_and_test.sh index c27282623..cd6130187 100755 --- a/.gitlab/build_and_test.sh +++ b/.gitlab/build_and_test.sh @@ -15,7 +15,6 @@ cd $BUILD_DIR cmake -C ../host-configs/llnl/$SYS_TYPE/$HOST_CONFIG ../tests/internal make -j8 -make style ctest -DCTEST_OUTPUT_ON_FAILURE=1 --no-compress-output -T Test -VV xsltproc -o junit.xml ../tests/ctest-to-junit.xsl Testing/*/Test.xml diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 7a7f0fa8f..dee679047 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -54,7 +54,6 @@ steps: condition: or( eq( variables['Agent.OS'], 'Windows_NT'), eq( variables['Agent.OS'], 'Darwin')) - script: | cmake --build build --config Release - cmake --build build --config Release --target style displayName: 'OSX/Windows Build' condition: or( eq( variables['Agent.OS'], 'Windows_NT'), eq( variables['Agent.OS'], 'Darwin')) - script: | @@ -70,7 +69,6 @@ steps: displayName: 'Linux CMake' - script: | docker run $(DOCKER_FLAGS) make -j2 - docker run $(DOCKER_FLAGS) make style condition: eq( variables['Agent.OS'], 'Linux') displayName: 'Linux Build' - script: | From c34269f6d323586d4941e9ce51d111770f3b3520 Mon Sep 17 00:00:00 2001 From: Chris White Date: Wed, 10 Nov 2021 08:12:37 -0800 Subject: [PATCH 50/76] unique project name --- tests/internal/unit/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/internal/unit/CMakeLists.txt b/tests/internal/unit/CMakeLists.txt index 6a3626c33..bd4f8b8c6 100644 --- a/tests/internal/unit/CMakeLists.txt +++ b/tests/internal/unit/CMakeLists.txt @@ -9,7 +9,7 @@ cmake_minimum_required(VERSION 3.8) -project(blt-internal-tests LANGUAGES C CXX) +project(blt-unit-tests LANGUAGES C CXX) #------------------------------------------------------------------------------ # Setup BLT From 904d0f33dfda7a89d3b9a327c3629eb319a944c0 Mon Sep 17 00:00:00 2001 From: Kenny Weiss Date: Fri, 12 Nov 2021 15:21:38 -0800 Subject: [PATCH 51/76] Update macOS image to 10.15 --- azure-pipelines.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index dee679047..f834d3d45 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -29,7 +29,7 @@ strategy: CMAKE_FLAGS: '-DCMAKE_C_COMPILER=$(C_COMPILER) -DCMAKE_CXX_COMPILER=$(CXX_COMPILER) -DENABLE_GTEST_DEATH_TESTS=OFF $(MPI_FLAGS) -DENABLE_OPENMP=ON' TEST_TARGET: 'linux_clang10' osx_gcc: - VM_ImageName: 'macos-10.14' + VM_ImageName: 'macos-1015' CMAKE_FLAGS: '' TEST_TARGET: 'osx_gcc' windows: From 9110d703e5611f3318bcf159a9706f0f2cdcc955 Mon Sep 17 00:00:00 2001 From: Chris White Date: Mon, 10 Jan 2022 13:08:02 -0800 Subject: [PATCH 52/76] use service account and define run directory in yaml file --- .gitlab-ci.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 74cad0049..49e26cb26 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -6,6 +6,8 @@ variables: PROJECT_ALLOC_NAME: ${CI_PROJECT_NAME}_ci_${CI_PIPELINE_ID} BUILD_ROOT: ${CI_PROJECT_DIR} + LLNL_SERVICE_USER: atk + CUSTOM_CI_BUILDS_DIR: /usr/workspace/atk/gitlab-runner stages: - allocate From 667158fd2b1627dea5fa96b68938a588f7b05f42 Mon Sep 17 00:00:00 2001 From: David Beckingsale Date: Mon, 10 Jan 2022 16:36:04 -0800 Subject: [PATCH 53/76] Remove FindHIP and use hip-config.cmake instead (#526) Co-authored-by: Chris White Co-authored-by: Josh Essman Co-authored-by: Cyrus Harrison --- RELEASE-NOTES.md | 3 + cmake/BLTMacros.cmake | 43 +- cmake/BLTOptions.cmake | 3 - cmake/BLTPrivateMacros.cmake | 178 ----- cmake/thirdparty/FindHIP.cmake | 705 ------------------ cmake/thirdparty/FindHIP/run_hipcc.cmake | 189 ----- cmake/thirdparty/FindHIP/run_make2cmake.cmake | 55 -- cmake/thirdparty/SetupHIP.cmake | 154 ++-- docs/tutorial/common_hpc_dependencies.rst | 6 +- docs/tutorial/exporting_targets.rst | 6 +- .../cce@12.0.1_clang_hip.cmake | 1 - .../cce@12.0.3_clang_hip.cmake | 44 ++ tests/internal/CMakeLists.txt | 2 +- .../src/hip_defines_test/CMakeLists.txt | 4 +- tests/smoke/CMakeLists.txt | 8 +- 15 files changed, 120 insertions(+), 1281 deletions(-) delete mode 100644 cmake/thirdparty/FindHIP.cmake delete mode 100644 cmake/thirdparty/FindHIP/run_hipcc.cmake delete mode 100644 cmake/thirdparty/FindHIP/run_make2cmake.cmake create mode 100644 host-configs/llnl/toss_4_x86_64_ib_cray/cce@12.0.3_clang_hip.cmake diff --git a/RELEASE-NOTES.md b/RELEASE-NOTES.md index c6de18759..f58ddbd6d 100644 --- a/RELEASE-NOTES.md +++ b/RELEASE-NOTES.md @@ -18,6 +18,9 @@ The project release numbers follow [Semantic Versioning](http://semver.org/spec/ - Fold `BLT_CLANG_HIP_ARCH` into the `CMAKE_HIP_ARCHITECTURES` variable - When using `ENABLE_ALL_WARNINGS`, append the flag to the beginning of `CMAKE_{C,CXX}_FLAGS` instead of the end +- HIP support now uses the `hip-config.cmake` file provided by ROCM. This + modification requires a change to the BLT-provided HIP target names, and they + are now available under the `blt` prefix: `blt::hip` and `blt::hip_runtime`. ### Fixed - Source code filename extension filtering now uses regular expressions to allow diff --git a/cmake/BLTMacros.cmake b/cmake/BLTMacros.cmake index 6b5838286..e755da62e 100644 --- a/cmake/BLTMacros.cmake +++ b/cmake/BLTMacros.cmake @@ -644,22 +644,14 @@ macro(blt_add_library) set(_lib_type "STATIC") endif() - if (ENABLE_HIP AND NOT ENABLE_CLANG_HIP) - blt_add_hip_library(NAME ${arg_NAME} - SOURCES ${arg_SOURCES} - HEADERS ${arg_HEADERS} - DEPENDS_ON ${arg_DEPENDS_ON} - LIBRARY_TYPE ${_lib_type} ) - else() - add_library( ${arg_NAME} ${_lib_type} ${arg_SOURCES} ${arg_HEADERS} ) - - if (ENABLE_CUDA AND NOT ENABLE_CLANG_CUDA) - blt_setup_cuda_target( - NAME ${arg_NAME} - SOURCES ${arg_SOURCES} - DEPENDS_ON ${arg_DEPENDS_ON} - LIBRARY_TYPE ${_lib_type}) - endif() + add_library( ${arg_NAME} ${_lib_type} ${arg_SOURCES} ${arg_HEADERS} ) + + if (ENABLE_CUDA AND NOT ENABLE_CLANG_CUDA) + blt_setup_cuda_target( + NAME ${arg_NAME} + SOURCES ${arg_SOURCES} + DEPENDS_ON ${arg_DEPENDS_ON} + LIBRARY_TYPE ${_lib_type}) endif() else() # @@ -775,20 +767,13 @@ macro(blt_add_executable) message(FATAL_ERROR "blt_add_executable(NAME ${arg_NAME} ...) given with no sources") endif() - if (ENABLE_HIP AND NOT ENABLE_CLANG_HIP) - blt_add_hip_executable(NAME ${arg_NAME} - SOURCES ${arg_SOURCES} - HEADERS ${arg_HEADERS} - DEPENDS_ON ${arg_DEPENDS_ON}) - else() - add_executable( ${arg_NAME} ${arg_SOURCES} ${arg_HEADERS}) + add_executable( ${arg_NAME} ${arg_SOURCES} ${arg_HEADERS}) - if (ENABLE_CUDA AND NOT ENABLE_CLANG_CUDA) - blt_setup_cuda_target( - NAME ${arg_NAME} - SOURCES ${arg_SOURCES} - DEPENDS_ON ${arg_DEPENDS_ON}) - endif() + if (ENABLE_CUDA AND NOT ENABLE_CLANG_CUDA) + blt_setup_cuda_target( + NAME ${arg_NAME} + SOURCES ${arg_SOURCES} + DEPENDS_ON ${arg_DEPENDS_ON}) endif() # CMake wants to load with C++ if any of the libraries are C++. diff --git a/cmake/BLTOptions.cmake b/cmake/BLTOptions.cmake index ead5340c6..667d45d99 100644 --- a/cmake/BLTOptions.cmake +++ b/cmake/BLTOptions.cmake @@ -59,9 +59,6 @@ mark_as_advanced(ENABLE_CLANG_CUDA) set(BLT_CLANG_CUDA_ARCH "sm_30" CACHE STRING "Compute architecture to use when generating CUDA code with Clang") mark_as_advanced(BLT_CLANG_CUDA_ARCH) option(ENABLE_HIP "Enable HIP support" OFF) -cmake_dependent_option(ENABLE_CLANG_HIP "Enable Clang's native HIP support" OFF - "ENABLE_HIP" OFF) -mark_as_advanced(ENABLE_CLANG_HIP) option(ENABLE_HCC "Enable HCC support" OFF) set(CMAKE_HIP_ARCHITECTURES "gfx900" CACHE STRING "gfx architecture to use when generating HIP/ROCm code") diff --git a/cmake/BLTPrivateMacros.cmake b/cmake/BLTPrivateMacros.cmake index f4781153f..44ce0d6bc 100644 --- a/cmake/BLTPrivateMacros.cmake +++ b/cmake/BLTPrivateMacros.cmake @@ -576,184 +576,6 @@ macro(blt_setup_cuda_target) endif() endmacro(blt_setup_cuda_target) -##------------------------------------------------------------------------------ -## blt_cleanup_hip_globals(FROM_TARGET ) -## -## Needed as the SetupHIP macros (specifically, HIP_PREPARE_TARGET_COMMANDS) -## "pollutes" the global HIP_HIPCC_FLAGS with target-specific options. This -## macro removes the target-specific generator expressions from the global flags -## which have already been copied to source-file-specific instances of the -## run_hipcc script. Other global flags in HIP_HIPCC_FLAGS, e.g., those set by -## the user, are left untouched. -##------------------------------------------------------------------------------ -macro(blt_cleanup_hip_globals) - set(options) - set(singleValueArgs FROM_TARGET) - set(multiValueArgs) - - # Parse the arguments - cmake_parse_arguments(arg "${options}" "${singleValueArgs}" - "${multiValueArgs}" ${ARGN} ) - - # Check arguments - if ( NOT DEFINED arg_FROM_TARGET ) - message( FATAL_ERROR "Must provide a FROM_TARGET argument to the 'blt_cleanup_hip_globals' macro") - endif() - - # Remove the compile definitions generator expression - # This must be copied verbatim from HIP_PREPARE_TARGET_COMMANDS, - # which would have just added it to HIP_HIPCC_FLAGS - set(_defines_genexpr "$") - set(_defines_flags_genexpr "$<$:-D$>") - list(REMOVE_ITEM HIP_HIPCC_FLAGS ${_defines_flags_genexpr}) -endmacro(blt_cleanup_hip_globals) - -##------------------------------------------------------------------------------ -## blt_add_hip_library(NAME -## SOURCES [source1 [source2 ...]] -## HEADERS [header1 [header2 ...]] -## DEPENDS_ON [dep1 ...] -## LIBRARY_TYPE -##------------------------------------------------------------------------------ -macro(blt_add_hip_library) - - set(options) - set(singleValueArgs NAME LIBRARY_TYPE) - set(multiValueArgs SOURCES HEADERS DEPENDS_ON) - - # Parse the arguments - cmake_parse_arguments(arg "${options}" "${singleValueArgs}" - "${multiValueArgs}" ${ARGN} ) - - # Check arguments - if ( NOT DEFINED arg_NAME ) - message( FATAL_ERROR "Must provide a NAME argument to the 'blt_add_hip_library' macro") - endif() - - if ( NOT DEFINED arg_SOURCES ) - message( FATAL_ERROR "Must provide SOURCES to the 'blt_add_hip_library' macro") - endif() - - # Determine if hip or hip_runtime are in DEPENDS_ON - list(FIND arg_DEPENDS_ON "hip" _hip_index) - set(_depends_on_hip FALSE) - if(${_hip_index} GREATER -1) - set(_depends_on_hip TRUE) - endif() - list(FIND arg_DEPENDS_ON "hip_runtime" _hip_runtime_index) - set(_depends_on_hip_runtime FALSE) - if(${_hip_runtime_index} GREATER -1) - set(_depends_on_hip_runtime TRUE) - endif() - - if (${_depends_on_hip}) - # if hip is in depends_on, flag each file's language as HIP - # instead of leaving it up to CMake to decide - # Note: we don't do this when depending on just 'hip_runtime' - set(_hip_sources) - set(_non_hip_sources) - blt_split_source_list_by_language(SOURCES ${arg_SOURCES} - C_LIST _hip_sources - Fortran_LIST _non_hip_sources) - - set_source_files_properties( ${_hip_sources} - PROPERTIES - HIP_SOURCE_PROPERTY_FORMAT TRUE) - - hip_add_library( ${arg_NAME} ${arg_SOURCES} ${arg_LIBRARY_TYPE} ) - blt_cleanup_hip_globals(FROM_TARGET ${arg_NAME}) - # Link to the hip_runtime target so it gets pulled in by targets - # depending on this target - target_link_libraries(${arg_NAME} PUBLIC hip_runtime) - else() - add_library( ${arg_NAME} ${arg_LIBRARY_TYPE} ${arg_SOURCES} ${arg_HEADERS} ) - endif() - - if (${_depends_on_hip_runtime} OR ${_depends_on_hip}) - # This will be propagated up to executable targets that depend on this - # library, which will need the HIP linker - set_target_properties( ${arg_NAME} PROPERTIES INTERFACE_BLT_LINKER_LANGUAGE_OVERRIDE HIP) - endif() - -endmacro(blt_add_hip_library) - -##------------------------------------------------------------------------------ -## blt_add_hip_executable(NAME -## SOURCES [source1 [source2 ...]] -## HEADERS [header1 [header2 ...]] -## DEPENDS_ON [dep1 ...] -##------------------------------------------------------------------------------ -macro(blt_add_hip_executable) - - set(options) - set(singleValueArgs NAME) - set(multiValueArgs HEADERS SOURCES DEPENDS_ON) - - # Parse the arguments - cmake_parse_arguments(arg "${options}" "${singleValueArgs}" - "${multiValueArgs}" ${ARGN} ) - - # Check arguments - if ( NOT DEFINED arg_NAME ) - message( FATAL_ERROR "Must provide a NAME argument to the 'blt_add_hip_executable' macro") - endif() - - if ( NOT DEFINED arg_SOURCES ) - message( FATAL_ERROR "Must provide SOURCES to the 'blt_add_hip_executable' macro") - endif() - - # Determine if hip or hip_runtime are in DEPENDS_ON - list(FIND arg_DEPENDS_ON "hip" _hip_index) - set(_depends_on_hip FALSE) - if(${_hip_index} GREATER -1) - set(_depends_on_hip TRUE) - endif() - list(FIND arg_DEPENDS_ON "hip_runtime" _hip_runtime_index) - set(_depends_on_hip_runtime FALSE) - if(${_hip_runtime_index} GREATER -1) - set(_depends_on_hip_runtime TRUE) - endif() - - blt_expand_depends(DEPENDS_ON ${arg_DEPENDS_ON} RESULT _expanded_DEPENDS_ON) - foreach( dependency ${_expanded_DEPENDS_ON} ) - if(TARGET ${dependency}) - get_target_property(_dep_type ${dependency} TYPE) - if(NOT "${_dep_type}" STREQUAL "INTERFACE_LIBRARY") - # Propagate the overridden linker language, if applicable - get_target_property(_blt_link_lang ${dependency} INTERFACE_BLT_LINKER_LANGUAGE_OVERRIDE) - if(_blt_link_lang STREQUAL "HIP") - set(_depends_on_hip_runtime TRUE) - endif() - endif() - endif() - endforeach() - - if (${_depends_on_hip}) - # if hip is in depends_on, flag each file's language as HIP - # instead of leaving it up to CMake to decide - # Note: we don't do this when depending on just 'hip_runtime' - set(_hip_sources) - set(_non_hip_sources) - blt_split_source_list_by_language(SOURCES ${arg_SOURCES} - C_LIST _hip_sources - Fortran_LIST _non_hip_sources) - - set_source_files_properties( ${_hip_sources} - PROPERTIES - HIP_SOURCE_PROPERTY_FORMAT TRUE) - - hip_add_executable( ${arg_NAME} ${arg_SOURCES} ) - blt_cleanup_hip_globals(FROM_TARGET ${arg_NAME}) - else() - add_executable( ${arg_NAME} ${arg_SOURCES} ${arg_HEADERS}) - endif() - - # Save the expanded dependencies to avoid recalculating later - set_target_properties(${arg_NAME} PROPERTIES - BLT_EXPANDED_DEPENDENCIES "${_expanded_DEPENDS_ON}") - -endmacro(blt_add_hip_executable) - ##----------------------------------------------------------------------------- ## blt_make_file_ext_regex( EXTENSIONS [ext1 [ext2 ...]] diff --git a/cmake/thirdparty/FindHIP.cmake b/cmake/thirdparty/FindHIP.cmake deleted file mode 100644 index 2f4f13bb5..000000000 --- a/cmake/thirdparty/FindHIP.cmake +++ /dev/null @@ -1,705 +0,0 @@ -# Copyright (c) 2017-2021, Lawrence Livermore National Security, LLC and -# other BLT Project Developers. See the top-level LICENSE file for details -# -# SPDX-License-Identifier: (BSD-3-Clause) - -############################################################################### -# FindHIP.cmake -############################################################################### -include(CheckCXXCompilerFlag) -############################################################################### -# SET: Variable defaults -############################################################################### -# User defined flags -set(HIP_HIPCC_FLAGS "" CACHE STRING "Semicolon delimited flags for HIPCC") -set(HIP_HCC_FLAGS "" CACHE STRING "Semicolon delimited flags for HCC") -set(HIP_CLANG_FLAGS "" CACHE STRING "Semicolon delimited flags for CLANG") -set(HIP_NVCC_FLAGS "" CACHE STRING "Semicolon delimted flags for NVCC") -mark_as_advanced(HIP_HIPCC_FLAGS HIP_HCC_FLAGS HIP_CLANG_FLAGS HIP_NVCC_FLAGS) - -set(_hip_configuration_types ${CMAKE_CONFIGURATION_TYPES} ${CMAKE_BUILD_TYPE} Debug MinSizeRel Release RelWithDebInfo) -list(REMOVE_DUPLICATES _hip_configuration_types) -foreach(config ${_hip_configuration_types}) - string(TOUPPER ${config} config_upper) - set(HIP_HIPCC_FLAGS_${config_upper} "" CACHE STRING "Semicolon delimited flags for HIPCC") - set(HIP_HCC_FLAGS_${config_upper} "" CACHE STRING "Semicolon delimited flags for HCC") - set(HIP_CLANG_FLAGS_${config_upper} "" CACHE STRING "Semicolon delimited flags for CLANG") - set(HIP_NVCC_FLAGS_${config_upper} "" CACHE STRING "Semicolon delimited flags for NVCC") - mark_as_advanced(HIP_HIPCC_FLAGS_${config_upper} HIP_HCC_FLAGS_${config_upper} HIP_CLANG_FLAGS_${config_upper} HIP_NVCC_FLAGS_${config_upper}) -endforeach() -option(HIP_HOST_COMPILATION_CPP "Host code compilation mode" ON) -option(HIP_VERBOSE_BUILD "Print out the commands run while compiling the HIP source file. With the Makefile generator this defaults to VERBOSE variable specified on the command line, but can be forced on with this option." OFF) -mark_as_advanced(HIP_HOST_COMPILATION_CPP) - -############################################################################### -# FIND: HIP and associated helper binaries -############################################################################### - -get_filename_component(_IMPORT_PREFIX "${CMAKE_CURRENT_LIST_DIR}/../" REALPATH) - -# HIP is supported on Linux only -if(UNIX AND NOT APPLE AND NOT CYGWIN) - # Search for HIP installation - if(NOT HIP_ROOT_DIR) - # Search in user specified path first - find_path( - HIP_ROOT_DIR - NAMES bin/hipconfig - PATHS - "$ENV{ROCM_PATH}/hip" - ENV HIP_PATH - ${_IMPORT_PREFIX} - /opt/rocm/hip - DOC "HIP installed location" - NO_DEFAULT_PATH - ) - if(NOT EXISTS ${HIP_ROOT_DIR}) - if(HIP_FIND_REQUIRED) - message(FATAL_ERROR "Specify HIP_ROOT_DIR") - elseif(NOT HIP_FIND_QUIETLY) - message("HIP_ROOT_DIR not found or specified") - endif() - endif() - # And push it back to the cache - set(HIP_ROOT_DIR ${HIP_ROOT_DIR} CACHE PATH "HIP installed location" FORCE) - endif() - - # Find HIPCC executable - find_program( - HIP_HIPCC_EXECUTABLE - NAMES hipcc - PATHS - "${HIP_ROOT_DIR}" - ENV ROCM_PATH - ENV HIP_PATH - /opt/rocm - /opt/rocm/hip - PATH_SUFFIXES bin - NO_DEFAULT_PATH - ) - if(NOT HIP_HIPCC_EXECUTABLE) - # Now search in default paths - find_program(HIP_HIPCC_EXECUTABLE hipcc) - endif() - mark_as_advanced(HIP_HIPCC_EXECUTABLE) - - # Find hip clang executable - if(NOT DEFINED HIP_CLANG_PATH) - find_path( - HIP_CLANG_PATH - NAMES clang++ - PATHS - "$ENV{HIP_CLANG_PATH}" - "$ENV{ROCM_PATH}/llvm/bin" - "$ENV{HIP_PATH}/../llvm/bin" - "${HIP_ROOT_DIR}/../llvm/bin" - "/opt/rocm/llvm/bin" - PATH_SUFFIXES bin - NO_DEFAULT_PATH - ) - endif() - set(HIP_CLANG_EXECUTABLE "${HIP_CLANG_PATH}/clang++") - - # Find HIPCONFIG executable - find_program( - HIP_HIPCONFIG_EXECUTABLE - NAMES hipconfig - PATHS - "${HIP_ROOT_DIR}" - ENV ROCM_PATH - ENV HIP_PATH - /opt/rocm - /opt/rocm/hip - PATH_SUFFIXES bin - NO_DEFAULT_PATH - ) - if(NOT HIP_HIPCONFIG_EXECUTABLE) - # Now search in default paths - find_program(HIP_HIPCONFIG_EXECUTABLE hipconfig) - endif() - mark_as_advanced(HIP_HIPCONFIG_EXECUTABLE) - - # Find HIPCC_CMAKE_LINKER_HELPER executable - find_program( - HIP_HIPCC_CMAKE_LINKER_HELPER - NAMES hipcc_cmake_linker_helper - PATHS - "${HIP_ROOT_DIR}" - ENV ROCM_PATH - ENV HIP_PATH - /opt/rocm - /opt/rocm/hip - PATH_SUFFIXES bin - NO_DEFAULT_PATH - ) - if(NOT HIP_HIPCC_CMAKE_LINKER_HELPER) - # Now search in default paths - find_program(HIP_HIPCC_CMAKE_LINKER_HELPER hipcc_cmake_linker_helper) - endif() - mark_as_advanced(HIP_HIPCC_CMAKE_LINKER_HELPER) - - if(HIP_HIPCONFIG_EXECUTABLE AND NOT HIP_VERSION) - # Compute the version - execute_process( - COMMAND ${HIP_HIPCONFIG_EXECUTABLE} --version - OUTPUT_VARIABLE _hip_version - ERROR_VARIABLE _hip_error - OUTPUT_STRIP_TRAILING_WHITESPACE - ERROR_STRIP_TRAILING_WHITESPACE - ) - if(NOT _hip_error) - set(HIP_VERSION ${_hip_version} CACHE STRING "Version of HIP as computed from hipcc") - else() - set(HIP_VERSION "0.0.0" CACHE STRING "Version of HIP as computed by FindHIP()") - endif() - mark_as_advanced(HIP_VERSION) - endif() - if(HIP_VERSION) - string(REPLACE "." ";" _hip_version_list "${HIP_VERSION}") - list(GET _hip_version_list 0 HIP_VERSION_MAJOR) - list(GET _hip_version_list 1 HIP_VERSION_MINOR) - list(GET _hip_version_list 2 HIP_VERSION_PATCH) - set(HIP_VERSION_STRING "${HIP_VERSION}") - endif() - - if(HIP_HIPCONFIG_EXECUTABLE AND NOT HIP_PLATFORM) - # Compute the platform - execute_process( - COMMAND ${HIP_HIPCONFIG_EXECUTABLE} --platform - OUTPUT_VARIABLE _hip_platform - OUTPUT_STRIP_TRAILING_WHITESPACE - ) - set(HIP_PLATFORM ${_hip_platform} CACHE STRING "HIP platform as computed by hipconfig") - mark_as_advanced(HIP_PLATFORM) - endif() - - if(HIP_HIPCONFIG_EXECUTABLE AND NOT HIP_COMPILER) - # Compute the compiler - execute_process( - COMMAND ${HIP_HIPCONFIG_EXECUTABLE} --compiler - OUTPUT_VARIABLE _hip_compiler - OUTPUT_STRIP_TRAILING_WHITESPACE - ) - set(HIP_COMPILER ${_hip_compiler} CACHE STRING "HIP compiler as computed by hipconfig") - mark_as_advanced(HIP_COMPILER) - endif() - - if(HIP_HIPCONFIG_EXECUTABLE AND NOT HIP_RUNTIME) - # Compute the runtime - execute_process( - COMMAND ${HIP_HIPCONFIG_EXECUTABLE} --runtime - OUTPUT_VARIABLE _hip_runtime - OUTPUT_STRIP_TRAILING_WHITESPACE - ) - set(HIP_RUNTIME ${_hip_runtime} CACHE STRING "HIP runtime as computed by hipconfig") - mark_as_advanced(HIP_RUNTIME) - endif() -endif() - -include(FindPackageHandleStandardArgs) -find_package_handle_standard_args( - HIP - REQUIRED_VARS - HIP_ROOT_DIR - HIP_HIPCC_EXECUTABLE - HIP_HIPCONFIG_EXECUTABLE - HIP_PLATFORM - HIP_COMPILER - HIP_RUNTIME - VERSION_VAR HIP_VERSION - ) - -############################################################################### -# Set HIP CMAKE Flags -############################################################################### -# Copy the invocation styles from CXX to HIP -set(CMAKE_HIP_ARCHIVE_CREATE ${CMAKE_CXX_ARCHIVE_CREATE}) -set(CMAKE_HIP_ARCHIVE_APPEND ${CMAKE_CXX_ARCHIVE_APPEND}) -set(CMAKE_HIP_ARCHIVE_FINISH ${CMAKE_CXX_ARCHIVE_FINISH}) -set(CMAKE_SHARED_LIBRARY_SONAME_HIP_FLAG ${CMAKE_SHARED_LIBRARY_SONAME_CXX_FLAG}) -set(CMAKE_SHARED_LIBRARY_CREATE_HIP_FLAGS ${CMAKE_SHARED_LIBRARY_CREATE_CXX_FLAGS}) -set(CMAKE_SHARED_LIBRARY_HIP_FLAGS ${CMAKE_SHARED_LIBRARY_CXX_FLAGS}) -#set(CMAKE_SHARED_LIBRARY_LINK_HIP_FLAGS ${CMAKE_SHARED_LIBRARY_LINK_CXX_FLAGS}) -set(CMAKE_SHARED_LIBRARY_RUNTIME_HIP_FLAG ${CMAKE_SHARED_LIBRARY_RUNTIME_CXX_FLAG}) -set(CMAKE_SHARED_LIBRARY_RUNTIME_HIP_FLAG_SEP ${CMAKE_SHARED_LIBRARY_RUNTIME_CXX_FLAG_SEP}) -set(CMAKE_SHARED_LIBRARY_LINK_STATIC_HIP_FLAGS ${CMAKE_SHARED_LIBRARY_LINK_STATIC_CXX_FLAGS}) -set(CMAKE_SHARED_LIBRARY_LINK_DYNAMIC_HIP_FLAGS ${CMAKE_SHARED_LIBRARY_LINK_DYNAMIC_CXX_FLAGS}) - -set(HIP_CLANG_PARALLEL_BUILD_COMPILE_OPTIONS "") -set(HIP_CLANG_PARALLEL_BUILD_LINK_OPTIONS "") - - - -if("${HIP_COMPILER}" STREQUAL "nvcc") - # Set the CMake Flags to use the nvcc Compiler. - set(CMAKE_HIP_CREATE_SHARED_LIBRARY "${HIP_HIPCC_CMAKE_LINKER_HELPER} -o ") - set(CMAKE_HIP_CREATE_SHARED_MODULE "${HIP_HIPCC_CMAKE_LINKER_HELPER} -o -shared" ) - set(CMAKE_HIP_LINK_EXECUTABLE "${HIP_HIPCC_CMAKE_LINKER_HELPER} -o ") -elseif("${HIP_COMPILER}" STREQUAL "hcc") - # Set the CMake Flags to use the hcc Compiler. - set(CMAKE_HIP_CREATE_SHARED_LIBRARY "${HIP_HIPCC_CMAKE_LINKER_HELPER} ${HCC_HOME} -o ") - set(CMAKE_HIP_CREATE_SHARED_MODULE "${HIP_HIPCC_CMAKE_LINKER_HELPER} ${HCC_HOME} -o -shared" ) - set(CMAKE_HIP_LINK_EXECUTABLE "${HIP_HIPCC_CMAKE_LINKER_HELPER} ${HCC_HOME} -o ") -elseif("${HIP_COMPILER}" STREQUAL "clang") - #Number of parallel jobs by default is 1 - if(NOT DEFINED HIP_CLANG_NUM_PARALLEL_JOBS) - set(HIP_CLANG_NUM_PARALLEL_JOBS 1) - endif() - #Add support for parallel build and link - if(${CMAKE_CXX_COMPILER_ID} STREQUAL "Clang") - check_cxx_compiler_flag("-parallel-jobs=1" HIP_CLANG_SUPPORTS_PARALLEL_JOBS) - endif() - if(HIP_CLANG_NUM_PARALLEL_JOBS GREATER 1) - if(${HIP_CLANG_SUPPORTS_PARALLEL_JOBS}) - set(HIP_CLANG_PARALLEL_BUILD_COMPILE_OPTIONS "-Wno-format-nonliteral -parallel-jobs=${HIP_CLANG_NUM_PARALLEL_JOBS}") - set(HIP_CLANG_PARALLEL_BUILD_LINK_OPTIONS "-parallel-jobs=${HIP_CLANG_NUM_PARALLEL_JOBS}") - else() - message("clang compiler doesn't support parallel jobs") - endif() - endif() - - # Set the CMake Flags to use the HIP-Clang Compiler. - set(CMAKE_HIP_CREATE_SHARED_LIBRARY "${HIP_HIPCC_CMAKE_LINKER_HELPER} ${HIP_CLANG_PATH} ${HIP_CLANG_PARALLEL_BUILD_LINK_OPTIONS} -o ") - set(CMAKE_HIP_CREATE_SHARED_MODULE "${HIP_HIPCC_CMAKE_LINKER_HELPER} ${HIP_CLANG_PATH} ${HIP_CLANG_PARALLEL_BUILD_LINK_OPTIONS} -o -shared" ) - set(CMAKE_HIP_LINK_EXECUTABLE "${HIP_HIPCC_CMAKE_LINKER_HELPER} ${HIP_CLANG_PATH} ${HIP_CLANG_PARALLEL_BUILD_LINK_OPTIONS} -o ") - - if("${HIP_RUNTIME}" STREQUAL "rocclr") - if(TARGET host) - message(STATUS "host interface - found") - set(HIP_HOST_INTERFACE host) - endif() - endif() -endif() - -############################################################################### -# MACRO: Locate helper files -############################################################################### -macro(HIP_FIND_HELPER_FILE _name _extension) - set(_hip_full_name "${_name}.${_extension}") - get_filename_component(CMAKE_CURRENT_LIST_DIR "${CMAKE_CURRENT_LIST_FILE}" PATH) - set(HIP_${_name} "${CMAKE_CURRENT_LIST_DIR}/FindHIP/${_hip_full_name}") - if(NOT EXISTS "${HIP_${_name}}") - set(error_message "${_hip_full_name} not found in ${CMAKE_CURRENT_LIST_DIR}/FindHIP") - if(HIP_FIND_REQUIRED) - message(FATAL_ERROR "${error_message}") - else() - if(NOT HIP_FIND_QUIETLY) - message(STATUS "${error_message}") - endif() - endif() - endif() - # Set this variable as internal, so the user isn't bugged with it. - set(HIP_${_name} ${HIP_${_name}} CACHE INTERNAL "Location of ${_full_name}" FORCE) -endmacro() - -############################################################################### -hip_find_helper_file(run_make2cmake cmake) -hip_find_helper_file(run_hipcc cmake) -############################################################################### - -############################################################################### -# MACRO: Reset compiler flags -############################################################################### -macro(HIP_RESET_FLAGS) - unset(HIP_HIPCC_FLAGS) - unset(HIP_HCC_FLAGS) - unset(HIP_CLANG_FLAGS) - unset(HIP_NVCC_FLAGS) - foreach(config ${_hip_configuration_types}) - string(TOUPPER ${config} config_upper) - unset(HIP_HIPCC_FLAGS_${config_upper}) - unset(HIP_HCC_FLAGS_${config_upper}) - unset(HIP_CLANG_FLAGS_${config_upper}) - unset(HIP_NVCC_FLAGS_${config_upper}) - endforeach() -endmacro() - -############################################################################### -# MACRO: Separate the options from the sources -############################################################################### -macro(HIP_GET_SOURCES_AND_OPTIONS _sources _cmake_options _hipcc_options _hcc_options _clang_options _nvcc_options) - set(${_sources}) - set(${_cmake_options}) - set(${_hipcc_options}) - set(${_hcc_options}) - set(${_clang_options}) - set(${_nvcc_options}) - set(_hipcc_found_options FALSE) - set(_hcc_found_options FALSE) - set(_clang_found_options FALSE) - set(_nvcc_found_options FALSE) - foreach(arg ${ARGN}) - if("x${arg}" STREQUAL "xHIPCC_OPTIONS") - set(_hipcc_found_options TRUE) - set(_hcc_found_options FALSE) - set(_clang_found_options FALSE) - set(_nvcc_found_options FALSE) - elseif("x${arg}" STREQUAL "xHCC_OPTIONS") - set(_hipcc_found_options FALSE) - set(_hcc_found_options TRUE) - set(_clang_found_options FALSE) - set(_nvcc_found_options FALSE) - elseif("x${arg}" STREQUAL "xCLANG_OPTIONS") - set(_hipcc_found_options FALSE) - set(_hcc_found_options FALSE) - set(_clang_found_options TRUE) - set(_nvcc_found_options FALSE) - elseif("x${arg}" STREQUAL "xNVCC_OPTIONS") - set(_hipcc_found_options FALSE) - set(_hcc_found_options FALSE) - set(_clang_found_options FALSE) - set(_nvcc_found_options TRUE) - elseif( - "x${arg}" STREQUAL "xEXCLUDE_FROM_ALL" OR - "x${arg}" STREQUAL "xSTATIC" OR - "x${arg}" STREQUAL "xSHARED" OR - "x${arg}" STREQUAL "xMODULE" - ) - list(APPEND ${_cmake_options} ${arg}) - else() - if(_hipcc_found_options) - list(APPEND ${_hipcc_options} ${arg}) - elseif(_hcc_found_options) - list(APPEND ${_hcc_options} ${arg}) - elseif(_clang_found_options) - list(APPEND ${_clang_options} ${arg}) - elseif(_nvcc_found_options) - list(APPEND ${_nvcc_options} ${arg}) - else() - # Assume this is a file - list(APPEND ${_sources} ${arg}) - endif() - endif() - endforeach() -endmacro() - -############################################################################### -# MACRO: Add include directories to pass to the hipcc command -############################################################################### -set(HIP_HIPCC_INCLUDE_ARGS_USER "") -macro(HIP_INCLUDE_DIRECTORIES) - foreach(dir ${ARGN}) - list(APPEND HIP_HIPCC_INCLUDE_ARGS_USER $<$:-I${dir}>) - endforeach() -endmacro() - -############################################################################### -# FUNCTION: Helper to avoid clashes of files with the same basename but different paths -############################################################################### -function(HIP_COMPUTE_BUILD_PATH path build_path) - # Convert to cmake style paths - file(TO_CMAKE_PATH "${path}" bpath) - if(IS_ABSOLUTE "${bpath}") - string(FIND "${bpath}" "${CMAKE_CURRENT_BINARY_DIR}" _binary_dir_pos) - if(_binary_dir_pos EQUAL 0) - file(RELATIVE_PATH bpath "${CMAKE_CURRENT_BINARY_DIR}" "${bpath}") - else() - file(RELATIVE_PATH bpath "${CMAKE_CURRENT_SOURCE_DIR}" "${bpath}") - endif() - endif() - - # Remove leading / - string(REGEX REPLACE "^[/]+" "" bpath "${bpath}") - # Avoid absolute paths by removing ':' - string(REPLACE ":" "_" bpath "${bpath}") - # Avoid relative paths that go up the tree - string(REPLACE "../" "__/" bpath "${bpath}") - # Avoid spaces - string(REPLACE " " "_" bpath "${bpath}") - # Strip off the filename - get_filename_component(bpath "${bpath}" PATH) - - set(${build_path} "${bpath}" PARENT_SCOPE) -endfunction() - -############################################################################### -# MACRO: Parse OPTIONS from ARGN & set variables prefixed by _option_prefix -############################################################################### -macro(HIP_PARSE_HIPCC_OPTIONS _option_prefix) - set(_hip_found_config) - foreach(arg ${ARGN}) - # Determine if we are dealing with a per-configuration flag - foreach(config ${_hip_configuration_types}) - string(TOUPPER ${config} config_upper) - if(arg STREQUAL "${config_upper}") - set(_hip_found_config _${arg}) - # Clear arg to prevent it from being processed anymore - set(arg) - endif() - endforeach() - if(arg) - list(APPEND ${_option_prefix}${_hip_found_config} "${arg}") - endif() - endforeach() -endmacro() - -############################################################################### -# MACRO: Try and include dependency file if it exists -############################################################################### -macro(HIP_INCLUDE_HIPCC_DEPENDENCIES dependency_file) - set(HIP_HIPCC_DEPEND) - set(HIP_HIPCC_DEPEND_REGENERATE FALSE) - - # Create the dependency file if it doesn't exist - if(NOT EXISTS ${dependency_file}) - file(WRITE ${dependency_file} "# Generated by: FindHIP.cmake. Do not edit.\n") - endif() - # Include the dependency file - include(${dependency_file}) - - # Verify the existence of all the included files - if(HIP_HIPCC_DEPEND) - foreach(f ${HIP_HIPCC_DEPEND}) - if(NOT EXISTS ${f}) - # If they aren't there, regenerate the file again - set(HIP_HIPCC_DEPEND_REGENERATE TRUE) - endif() - endforeach() - else() - # No dependencies, so regenerate the file - set(HIP_HIPCC_DEPEND_REGENERATE TRUE) - endif() - - # Regenerate the dependency file if needed - if(HIP_HIPCC_DEPEND_REGENERATE) - set(HIP_HIPCC_DEPEND ${dependency_file}) - file(WRITE ${dependency_file} "# Generated by: FindHIP.cmake. Do not edit.\n") - endif() -endmacro() - -############################################################################### -# MACRO: Prepare cmake commands for the target -############################################################################### -macro(HIP_PREPARE_TARGET_COMMANDS _target _format _generated_files _source_files) - set(_hip_flags "") - string(TOUPPER "${CMAKE_BUILD_TYPE}" _hip_build_configuration) - if(HIP_HOST_COMPILATION_CPP) - set(HIP_C_OR_CXX CXX) - else() - set(HIP_C_OR_CXX C) - endif() - set(generated_extension ${CMAKE_${HIP_C_OR_CXX}_OUTPUT_EXTENSION}) - - # Initialize list of includes with those specified by the user. Append with - # ones specified to cmake directly. - set(HIP_HIPCC_INCLUDE_ARGS ${HIP_HIPCC_INCLUDE_ARGS_USER}) - - # Add the include directories - set(include_directories_generator "$") - list(APPEND HIP_HIPCC_INCLUDE_ARGS "$<$:-I$>") - - get_directory_property(_hip_include_directories INCLUDE_DIRECTORIES) - list(REMOVE_DUPLICATES _hip_include_directories) - if(_hip_include_directories) - foreach(dir ${_hip_include_directories}) - list(APPEND HIP_HIPCC_INCLUDE_ARGS $<$:-I${dir}>) - endforeach() - endif() - - HIP_GET_SOURCES_AND_OPTIONS(_hip_sources _hip_cmake_options _hipcc_options _hcc_options _clang_options _nvcc_options ${ARGN}) - HIP_PARSE_HIPCC_OPTIONS(HIP_HIPCC_FLAGS ${_hipcc_options}) - HIP_PARSE_HIPCC_OPTIONS(HIP_HCC_FLAGS ${_hcc_options}) - HIP_PARSE_HIPCC_OPTIONS(HIP_CLANG_FLAGS ${_clang_options}) - HIP_PARSE_HIPCC_OPTIONS(HIP_NVCC_FLAGS ${_nvcc_options}) - - # Add the compile definitions - set(compile_definition_generator "$") - list(APPEND HIP_HIPCC_FLAGS "$<$:-D$>") - - # Check if we are building shared library. - set(_hip_build_shared_libs FALSE) - list(FIND _hip_cmake_options SHARED _hip_found_SHARED) - list(FIND _hip_cmake_options MODULE _hip_found_MODULE) - if(_hip_found_SHARED GREATER -1 OR _hip_found_MODULE GREATER -1) - set(_hip_build_shared_libs TRUE) - endif() - list(FIND _hip_cmake_options STATIC _hip_found_STATIC) - if(_hip_found_STATIC GREATER -1) - set(_hip_build_shared_libs FALSE) - endif() - - # If we are building a shared library, add extra flags to HIP_HIPCC_FLAGS - if(_hip_build_shared_libs) - list(APPEND HIP_HCC_FLAGS "-fPIC") - list(APPEND HIP_CLANG_FLAGS "-fPIC") - list(APPEND HIP_NVCC_FLAGS "--shared -Xcompiler '-fPIC'") - endif() - - # Set host compiler - set(HIP_HOST_COMPILER "${CMAKE_${HIP_C_OR_CXX}_COMPILER}") - - # Set compiler flags - set(_HIP_HOST_FLAGS "set(CMAKE_HOST_FLAGS ${CMAKE_${HIP_C_OR_CXX}_FLAGS})") - set(_HIP_HIPCC_FLAGS "set(HIP_HIPCC_FLAGS ${HIP_HIPCC_FLAGS})") - set(_HIP_HCC_FLAGS "set(HIP_HCC_FLAGS ${HIP_HCC_FLAGS})") - set(_HIP_CLANG_FLAGS "set(HIP_CLANG_FLAGS ${HIP_CLANG_FLAGS})") - set(_HIP_NVCC_FLAGS "set(HIP_NVCC_FLAGS ${HIP_NVCC_FLAGS})") - foreach(config ${_hip_configuration_types}) - string(TOUPPER ${config} config_upper) - set(_HIP_HOST_FLAGS "${_HIP_HOST_FLAGS}\nset(CMAKE_HOST_FLAGS_${config_upper} ${CMAKE_${HIP_C_OR_CXX}_FLAGS_${config_upper}})") - set(_HIP_HIPCC_FLAGS "${_HIP_HIPCC_FLAGS}\nset(HIP_HIPCC_FLAGS_${config_upper} ${HIP_HIPCC_FLAGS_${config_upper}})") - set(_HIP_HCC_FLAGS "${_HIP_HCC_FLAGS}\nset(HIP_HCC_FLAGS_${config_upper} ${HIP_HCC_FLAGS_${config_upper}})") - set(_HIP_CLANG_FLAGS "${_HIP_CLANG_FLAGS}\nset(HIP_CLANG_FLAGS_${config_upper} ${HIP_CLANG_FLAGS_${config_upper}})") - set(_HIP_NVCC_FLAGS "${_HIP_NVCC_FLAGS}\nset(HIP_NVCC_FLAGS_${config_upper} ${HIP_NVCC_FLAGS_${config_upper}})") - endforeach() - - # Reset the output variable - set(_hip_generated_files "") - set(_hip_source_files "") - - # Iterate over all arguments and create custom commands for all source files - foreach(file ${ARGN}) - # Ignore any file marked as a HEADER_FILE_ONLY - get_source_file_property(_is_header ${file} HEADER_FILE_ONLY) - # Allow per source file overrides of the format. Also allows compiling non .cu files. - get_source_file_property(_hip_source_format ${file} HIP_SOURCE_PROPERTY_FORMAT) - if((${file} MATCHES "\\.cu$" OR _hip_source_format) AND NOT _is_header) - set(host_flag FALSE) - else() - set(host_flag TRUE) - endif() - - if(NOT host_flag) - # Determine output directory - HIP_COMPUTE_BUILD_PATH("${file}" hip_build_path) - set(hip_compile_output_dir "${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/${_target}.dir/${hip_build_path}") - - get_filename_component(basename ${file} NAME) - set(generated_file_path "${hip_compile_output_dir}/${CMAKE_CFG_INTDIR}") - set(generated_file_basename "${_target}_generated_${basename}${generated_extension}") - - # Set file names - set(generated_file "${generated_file_path}/${generated_file_basename}") - set(cmake_dependency_file "${hip_compile_output_dir}/${generated_file_basename}.depend") - set(custom_target_script_pregen "${hip_compile_output_dir}/${generated_file_basename}.cmake.pre-gen") - set(custom_target_script "${hip_compile_output_dir}/${generated_file_basename}.cmake") - - # Set properties for object files - set_source_files_properties("${generated_file}" - PROPERTIES - EXTERNAL_OBJECT true # This is an object file not to be compiled, but only be linked - ) - - # Don't add CMAKE_CURRENT_SOURCE_DIR if the path is already an absolute path - get_filename_component(file_path "${file}" PATH) - if(IS_ABSOLUTE "${file_path}") - set(source_file "${file}") - else() - set(source_file "${CMAKE_CURRENT_SOURCE_DIR}/${file}") - endif() - - # Bring in the dependencies - HIP_INCLUDE_HIPCC_DEPENDENCIES(${cmake_dependency_file}) - - # Configure the build script - configure_file("${HIP_run_hipcc}" "${custom_target_script_pregen}" @ONLY) - file(GENERATE - OUTPUT "${custom_target_script}" - INPUT "${custom_target_script_pregen}" - ) - set(main_dep DEPENDS ${source_file}) - if(CMAKE_GENERATOR MATCHES "Makefiles") - set(verbose_output "$(VERBOSE)") - elseif(HIP_VERBOSE_BUILD) - set(verbose_output ON) - else() - set(verbose_output OFF) - endif() - - # Create up the comment string - file(RELATIVE_PATH generated_file_relative_path "${CMAKE_BINARY_DIR}" "${generated_file}") - set(hip_build_comment_string "Building HIPCC object ${generated_file_relative_path}") - - # Build the generated file and dependency file - add_custom_command( - OUTPUT ${generated_file} - # These output files depend on the source_file and the contents of cmake_dependency_file - ${main_dep} - DEPENDS ${HIP_HIPCC_DEPEND} - DEPENDS ${custom_target_script} - # Make sure the output directory exists before trying to write to it. - COMMAND ${CMAKE_COMMAND} -E make_directory "${generated_file_path}" - COMMAND ${CMAKE_COMMAND} ARGS - -D verbose:BOOL=${verbose_output} - -D build_configuration:STRING=${_hip_build_configuration} - -D "generated_file:STRING=${generated_file}" - -P "${custom_target_script}" - WORKING_DIRECTORY "${hip_compile_output_dir}" - COMMENT "${hip_build_comment_string}" - ) - - # Make sure the build system knows the file is generated - set_source_files_properties(${generated_file} PROPERTIES GENERATED TRUE) - list(APPEND _hip_generated_files ${generated_file}) - list(APPEND _hip_source_files ${file}) - endif() - endforeach() - - # Set the return parameter - set(${_generated_files} ${_hip_generated_files}) - set(${_source_files} ${_hip_source_files}) -endmacro() - -############################################################################### -# HIP_ADD_EXECUTABLE -############################################################################### -macro(HIP_ADD_EXECUTABLE hip_target) - # Separate the sources from the options - HIP_GET_SOURCES_AND_OPTIONS(_sources _cmake_options _hipcc_options _hcc_options _clang_options _nvcc_options ${ARGN}) - HIP_PREPARE_TARGET_COMMANDS(${hip_target} OBJ _generated_files _source_files ${_sources} HIPCC_OPTIONS ${_hipcc_options} HCC_OPTIONS ${_hcc_options} CLANG_OPTIONS ${_clang_options} NVCC_OPTIONS ${_nvcc_options}) - if(_source_files) - list(REMOVE_ITEM _sources ${_source_files}) - endif() - if("${HIP_COMPILER}" STREQUAL "hcc") - if("x${HCC_HOME}" STREQUAL "x") - if (DEFINED ENV{ROCM_PATH}) - set(HCC_HOME "$ENV{ROCM_PATH}/hcc") - elseif(DEFINED ENV{HIP_PATH}) - set(HCC_HOME "$ENV{HIP_PATH}/../hcc") - else() - set(HCC_HOME "/opt/rocm/hcc") - endif() - endif() - set(CMAKE_HIP_LINK_EXECUTABLE "${HIP_HIPCC_CMAKE_LINKER_HELPER} ${HCC_HOME} -o ") - elseif("${HIP_COMPILER}" STREQUAL "clang") - set(CMAKE_HIP_LINK_EXECUTABLE "${HIP_HIPCC_CMAKE_LINKER_HELPER} ${HIP_CLANG_PATH} ${HIP_CLANG_PARALLEL_BUILD_LINK_OPTIONS} -o ") - else() - set(CMAKE_HIP_LINK_EXECUTABLE "${HIP_HIPCC_CMAKE_LINKER_HELPER} -o ") - endif() - if ("${_sources}" STREQUAL "") - add_executable(${hip_target} ${_cmake_options} ${_generated_files} "") - else() - add_executable(${hip_target} ${_cmake_options} ${_generated_files} ${_sources}) - endif() - set_target_properties(${hip_target} PROPERTIES LINKER_LANGUAGE HIP) - # Link with host - if (HIP_HOST_INTERFACE) - # hip rt should be rocclr, compiler should be clang - target_link_libraries(${hip_target} ${HIP_HOST_INTERFACE}) - endif() -endmacro() - -############################################################################### -# HIP_ADD_LIBRARY -############################################################################### -macro(HIP_ADD_LIBRARY hip_target) - # Separate the sources from the options - HIP_GET_SOURCES_AND_OPTIONS(_sources _cmake_options _hipcc_options _hcc_options _clang_options _nvcc_options ${ARGN}) - HIP_PREPARE_TARGET_COMMANDS(${hip_target} OBJ _generated_files _source_files ${_sources} ${_cmake_options} HIPCC_OPTIONS ${_hipcc_options} HCC_OPTIONS ${_hcc_options} CLANG_OPTIONS ${_clang_options} NVCC_OPTIONS ${_nvcc_options}) - if(_source_files) - list(REMOVE_ITEM _sources ${_source_files}) - endif() - if ("${_sources}" STREQUAL "") - add_library(${hip_target} ${_cmake_options} ${_generated_files} "") - else() - add_library(${hip_target} ${_cmake_options} ${_generated_files} ${_sources}) - endif() - set_target_properties(${hip_target} PROPERTIES LINKER_LANGUAGE ${HIP_C_OR_CXX}) - # Link with host - if (HIP_HOST_INTERFACE) - # hip rt should be rocclr, compiler should be clang - target_link_libraries(${hip_target} ${HIP_HOST_INTERFACE}) - endif() -endmacro() - -# vim: ts=4:sw=4:expandtab:smartindent diff --git a/cmake/thirdparty/FindHIP/run_hipcc.cmake b/cmake/thirdparty/FindHIP/run_hipcc.cmake deleted file mode 100644 index 7c3b46c6b..000000000 --- a/cmake/thirdparty/FindHIP/run_hipcc.cmake +++ /dev/null @@ -1,189 +0,0 @@ -# Copyright (c) 2017-2021, Lawrence Livermore National Security, LLC and -# other BLT Project Developers. See the top-level LICENSE file for details -# -# SPDX-License-Identifier: (BSD-3-Clause) - -############################################################################### -# Runs commands using HIPCC -############################################################################### - -############################################################################### -# This file runs the hipcc commands to produce the desired output file -# along with the dependency file needed by CMake to compute dependencies. -# -# Input variables: -# -# verbose:BOOL=<> OFF: Be as quiet as possible (default) -# ON : Describe each step -# build_configuration:STRING=<> Build configuration. Defaults to Debug. -# generated_file:STRING=<> File to generate. Mandatory argument. - -if(NOT build_configuration) - set(build_configuration Debug) -endif() -if(NOT generated_file) - message(FATAL_ERROR "You must specify generated_file on the command line") -endif() - -# Set these up as variables to make reading the generated file easier -set(HIP_HIPCC_EXECUTABLE "@HIP_HIPCC_EXECUTABLE@") # path -set(HIP_HIPCONFIG_EXECUTABLE "@HIP_HIPCONFIG_EXECUTABLE@") #path -set(HIP_HOST_COMPILER "@HIP_HOST_COMPILER@") # path -set(CMAKE_COMMAND "@CMAKE_COMMAND@") # path -set(HIP_run_make2cmake "@HIP_run_make2cmake@") # path -set(HCC_HOME "@HCC_HOME@") #path -set(HIP_CLANG_PATH "@HIP_CLANG_PATH@") #path -set(HIP_CLANG_PARALLEL_BUILD_COMPILE_OPTIONS "@HIP_CLANG_PARALLEL_BUILD_COMPILE_OPTIONS@") - -@HIP_HOST_FLAGS@ -@_HIP_HIPCC_FLAGS@ -@_HIP_HCC_FLAGS@ -@_HIP_CLANG_FLAGS@ -@_HIP_NVCC_FLAGS@ -#Needed to bring the HIP_HIPCC_INCLUDE_ARGS variable in scope -set(HIP_HIPCC_INCLUDE_ARGS @HIP_HIPCC_INCLUDE_ARGS@) # list - -set(cmake_dependency_file "@cmake_dependency_file@") # path -set(source_file "@source_file@") # path -set(host_flag "@host_flag@") # bool - -# Determine compiler and compiler flags -execute_process(COMMAND ${HIP_HIPCONFIG_EXECUTABLE} --platform OUTPUT_VARIABLE HIP_PLATFORM OUTPUT_STRIP_TRAILING_WHITESPACE) -execute_process(COMMAND ${HIP_HIPCONFIG_EXECUTABLE} --compiler OUTPUT_VARIABLE HIP_COMPILER OUTPUT_STRIP_TRAILING_WHITESPACE) -execute_process(COMMAND ${HIP_HIPCONFIG_EXECUTABLE} --runtime OUTPUT_VARIABLE HIP_RUNTIME OUTPUT_STRIP_TRAILING_WHITESPACE) -if(NOT host_flag) - set(__CC ${HIP_HIPCC_EXECUTABLE}) - # ROCm version 4.0 and higher will use amd for the platform, but older - # versions use hcc. Keep both for backwards compatibility. - if("${HIP_PLATFORM}" STREQUAL "hcc" OR "${HIP_PLATFORM}" STREQUAL "amd") - if("${HIP_COMPILER}" STREQUAL "hcc") - if(NOT "x${HCC_HOME}" STREQUAL "x") - set(ENV{HCC_HOME} ${HCC_HOME}) - endif() - set(__CC_FLAGS ${HIP_HIPCC_FLAGS} ${HIP_HCC_FLAGS} ${HIP_HIPCC_FLAGS_${build_configuration}} ${HIP_HCC_FLAGS_${build_configuration}}) - elseif("${HIP_COMPILER}" STREQUAL "clang") - if(NOT "x${HIP_CLANG_PATH}" STREQUAL "x") - set(ENV{HIP_CLANG_PATH} ${HIP_CLANG_PATH}) - endif() - # Temporarily include HIP_HCC_FLAGS for HIP-Clang for PyTorch builds - set(__CC_FLAGS ${HIP_CLANG_PARALLEL_BUILD_COMPILE_OPTIONS} ${HIP_HIPCC_FLAGS} ${HIP_HCC_FLAGS} ${HIP_CLANG_FLAGS} ${HIP_HIPCC_FLAGS_${build_configuration}} ${HIP_HCC_FLAGS_${build_configuration}} ${HIP_CLANG_FLAGS_${build_configuration}}) - endif() - else() - set(__CC_FLAGS ${HIP_HIPCC_FLAGS} ${HIP_NVCC_FLAGS} ${HIP_HIPCC_FLAGS_${build_configuration}} ${HIP_NVCC_FLAGS_${build_configuration}}) - endif() -else() - set(__CC ${HIP_HOST_COMPILER}) - set(__CC_FLAGS ${CMAKE_HOST_FLAGS} ${CMAKE_HOST_FLAGS_${build_configuration}}) -endif() -set(__CC_INCLUDES ${HIP_HIPCC_INCLUDE_ARGS}) - -# hip_execute_process - Executes a command with optional command echo and status message. -# status - Status message to print if verbose is true -# command - COMMAND argument from the usual execute_process argument structure -# ARGN - Remaining arguments are the command with arguments -# HIP_result - Return value from running the command -macro(hip_execute_process status command) - set(_command ${command}) - if(NOT "x${_command}" STREQUAL "xCOMMAND") - message(FATAL_ERROR "Malformed call to hip_execute_process. Missing COMMAND as second argument. (command = ${command})") - endif() - if(verbose) - execute_process(COMMAND "${CMAKE_COMMAND}" -E echo -- ${status}) - # Build command string to print - set(hip_execute_process_string) - foreach(arg ${ARGN}) - # Escape quotes if any - string(REPLACE "\"" "\\\"" arg ${arg}) - # Surround args with spaces with quotes - if(arg MATCHES " ") - list(APPEND hip_execute_process_string "\"${arg}\"") - else() - list(APPEND hip_execute_process_string ${arg}) - endif() - endforeach() - # Echo the command - execute_process(COMMAND ${CMAKE_COMMAND} -E echo ${hip_execute_process_string}) - endif() - # Run the command - execute_process(COMMAND ${ARGN} RESULT_VARIABLE HIP_result) -endmacro() - -# Delete the target file -hip_execute_process( - "Removing ${generated_file}" - COMMAND "${CMAKE_COMMAND}" -E remove "${generated_file}" - ) - -# Generate the dependency file -hip_execute_process( - "Generating dependency file: ${cmake_dependency_file}.pre" - COMMAND "${__CC}" - -M - "${source_file}" - -o "${cmake_dependency_file}.pre" - ${__CC_FLAGS} - ${__CC_INCLUDES} - ) - -if(HIP_result) - message(FATAL_ERROR "Error generating ${generated_file}") -endif() - -# Generate the cmake readable dependency file to a temp file -hip_execute_process( - "Generating temporary cmake readable file: ${cmake_dependency_file}.tmp" - COMMAND "${CMAKE_COMMAND}" - -D "input_file:FILEPATH=${cmake_dependency_file}.pre" - -D "output_file:FILEPATH=${cmake_dependency_file}.tmp" - -D "verbose=${verbose}" - -P "${HIP_run_make2cmake}" - ) - -if(HIP_result) - message(FATAL_ERROR "Error generating ${generated_file}") -endif() - -# Copy the file if it is different -hip_execute_process( - "Copy if different ${cmake_dependency_file}.tmp to ${cmake_dependency_file}" - COMMAND "${CMAKE_COMMAND}" -E copy_if_different "${cmake_dependency_file}.tmp" "${cmake_dependency_file}" - ) - -if(HIP_result) - message(FATAL_ERROR "Error generating ${generated_file}") -endif() - -# Delete the temporary file -hip_execute_process( - "Removing ${cmake_dependency_file}.tmp and ${cmake_dependency_file}.pre" - COMMAND "${CMAKE_COMMAND}" -E remove "${cmake_dependency_file}.tmp" "${cmake_dependency_file}.pre" - ) - -if(HIP_result) - message(FATAL_ERROR "Error generating ${generated_file}") -endif() - -# Generate the output file -hip_execute_process( - "Generating ${generated_file}" - COMMAND "${__CC}" - -c - "${source_file}" - -o "${generated_file}" - ${__CC_FLAGS} - ${__CC_INCLUDES} - ) - -if(HIP_result) - # Make sure that we delete the output file - hip_execute_process( - "Removing ${generated_file}" - COMMAND "${CMAKE_COMMAND}" -E remove "${generated_file}" - ) - message(FATAL_ERROR "Error generating file ${generated_file}") -else() - if(verbose) - message("Generated ${generated_file} successfully.") - endif() -endif() -# vim: ts=4:sw=4:expandtab:smartindent diff --git a/cmake/thirdparty/FindHIP/run_make2cmake.cmake b/cmake/thirdparty/FindHIP/run_make2cmake.cmake deleted file mode 100644 index db23cc33d..000000000 --- a/cmake/thirdparty/FindHIP/run_make2cmake.cmake +++ /dev/null @@ -1,55 +0,0 @@ -# Copyright (c) 2017-2021, Lawrence Livermore National Security, LLC and -# other BLT Project Developers. See the top-level LICENSE file for details -# -# SPDX-License-Identifier: (BSD-3-Clause) - -############################################################################### -# Computes dependencies using HIPCC -############################################################################### - -############################################################################### -# This file converts dependency files generated using hipcc to a format that -# cmake can understand. - -# Input variables: -# -# input_file:STRING=<> Dependency file to parse. Required argument -# output_file:STRING=<> Output file to generate. Required argument - -if(NOT input_file OR NOT output_file) - message(FATAL_ERROR "You must specify input_file and output_file on the command line") -endif() - -file(READ ${input_file} depend_text) - -if (NOT "${depend_text}" STREQUAL "") - string(REPLACE " /" "\n/" depend_text ${depend_text}) - string(REGEX REPLACE "^.*:" "" depend_text ${depend_text}) - string(REGEX REPLACE "[ \\\\]*\n" ";" depend_text ${depend_text}) - - set(dependency_list "") - - foreach(file ${depend_text}) - string(REGEX REPLACE "^ +" "" file ${file}) - if(NOT EXISTS "${file}") - message(WARNING " Removing non-existent dependency file: ${file}") - set(file "") - endif() - - if(NOT IS_DIRECTORY "${file}") - get_filename_component(file_absolute "${file}" ABSOLUTE) - list(APPEND dependency_list "${file_absolute}") - endif() - endforeach() -endif() - -# Remove the duplicate entries and sort them. -list(REMOVE_DUPLICATES dependency_list) -list(SORT dependency_list) - -foreach(file ${dependency_list}) - set(hip_hipcc_depend "${hip_hipcc_depend} \"${file}\"\n") -endforeach() - -file(WRITE ${output_file} "# Generated by: FindHIP.cmake. Do not edit.\nSET(HIP_HIPCC_DEPEND\n ${hip_hipcc_depend})\n\n") -# vim: ts=4:sw=4:expandtab:smartindent diff --git a/cmake/thirdparty/SetupHIP.cmake b/cmake/thirdparty/SetupHIP.cmake index 2cb83c7dd..2513a94fd 100644 --- a/cmake/thirdparty/SetupHIP.cmake +++ b/cmake/thirdparty/SetupHIP.cmake @@ -9,128 +9,62 @@ ################################ # HIP ################################ -set (CMAKE_MODULE_PATH "${BLT_ROOT_DIR}/cmake/thirdparty;${CMAKE_MODULE_PATH}") -find_package(HIP REQUIRED) +find_package(hip REQUIRED) -message(STATUS "HIP version: ${HIP_VERSION_STRING}") +message(STATUS "HIP version: ${hip_VERSION") message(STATUS "HIP platform: ${HIP_PLATFORM}") -set(HIP_RUNTIME_INCLUDE_DIRS "${HIP_ROOT_DIR}/include") -if(${HIP_PLATFORM} STREQUAL "hcc") - set(HIP_RUNTIME_DEFINES "-D__HIP_PLATFORM_HCC__") - find_library(HIP_RUNTIME_LIBRARIES NAMES hip_hcc libhip_hcc - PATHS ${HIP_ROOT_DIR}/lib - NO_DEFAULT_PATH - NO_CMAKE_ENVIRONMENT_PATH - NO_CMAKE_PATH - NO_SYSTEM_ENVIRONMENT_PATH - NO_CMAKE_SYSTEM_PATH) - set(HIP_RUNTIME_LIBRARIES "${HIP_ROOT_DIR}/lib/libhip_hcc.so") -elseif(${HIP_PLATFORM} STREQUAL "clang" OR ${HIP_PLATFORM} STREQUAL "amd") - set(HIP_RUNTIME_DEFINES "-D__HIP_PLATFORM_HCC__;-D__HIP_ROCclr__;-D__HIP_PLATFORM_AMD__") - find_library(HIP_RUNTIME_LIBRARIES NAMES amdhip64 libamdhip64 - PATHS ${HIP_ROOT_DIR}/lib - NO_DEFAULT_PATH - NO_CMAKE_ENVIRONMENT_PATH - NO_CMAKE_PATH - NO_SYSTEM_ENVIRONMENT_PATH - NO_CMAKE_SYSTEM_PATH) -elseif(${HIP_PLATFORM} STREQUAL "nvcc" OR ${HIP_PLATFORM} STREQUAL "nvidia") - set(HIP_RUNTIME_DEFINES "-D__HIP_PLATFORM_NVCC__;-D__HIP_PLATFORM_NVIDIA__") - if (${CMAKE_VERSION} VERSION_LESS "3.17.0") - find_package(CUDA) - find_library(HIP_RUNTIME_LIBRARIES NAMES cudart libcudart - PATHS ${CMAKE_CUDA_IMPLICIT_LINK_DIRECTORIES} - NO_DEFAULT_PATH - NO_CMAKE_ENVIRONMENT_PATH - NO_CMAKE_PATH - NO_SYSTEM_ENVIRONMENT_PATH - NO_CMAKE_SYSTEM_PATH) - set(HIP_RUNTIME_INCLUDE_DIRS "${HIP_RUNTIME_INCLUDE_DIRS};${CUDA_INCLUDE_DIRS}") - else() - find_package(CUDAToolkit) - find_library(HIP_RUNTIME_LIBRARIES NAMES cudart libcudart - PATHS ${CUDAToolkit_LIBRARY_DIR} - NO_DEFAULT_PATH - NO_CMAKE_ENVIRONMENT_PATH - NO_CMAKE_PATH - NO_SYSTEM_ENVIRONMENT_PATH - NO_CMAKE_SYSTEM_PATH) - set(HIP_RUNTIME_INCLUDE_DIRS "${HIP_RUNTIME_INCLUDE_DIRS};${CUDAToolkit_INCLUDE_DIR}") - endif() +if (NOT ROCM_PATH) + find_path(ROCM_PATH + hip + ENV{ROCM_DIR} + ENV{ROCM_PATH} + ${HIP_ROOT_DIR}/../ + ${ROCM_ROOT_DIR} + /opt/rocm) endif() -if ( IS_DIRECTORY "${HIP_ROOT_DIR}/hcc/include" ) # this path only exists on older rocm installs - set(HIP_RUNTIME_INCLUDE_DIRS "${HIP_ROOT_DIR}/include;${HIP_ROOT_DIR}/hcc/include" CACHE STRING "") -else() - set(HIP_RUNTIME_INCLUDE_DIRS "${HIP_ROOT_DIR}/include" CACHE STRING "") -endif() -set(HIP_RUNTIME_COMPILE_FLAGS "${HIP_RUNTIME_COMPILE_FLAGS};-Wno-unused-parameter") +# AMDGPU_TARGETS should be defined in the hip-config.cmake that gets "included" via find_package(hip) +# This file is also what hardcodes the --offload-arch flags we're removing here +if(DEFINED AMDGPU_TARGETS) + # If we haven't selected a particular architecture via CMAKE_HIP_ARCHITECTURES, + # we want to remove the unconditionally added compile/link flags from the hip::device target. + # FIXME: This may cause problems for targets whose HIP_ARCHITECTURES property differs + # from CMAKE_HIP_ARCHITECTURES - this only happens when a user manually modifies + # the property after it is initialized + get_target_property(_hip_compile_options hip::device INTERFACE_COMPILE_OPTIONS) + get_target_property(_hip_link_libs hip::device INTERFACE_LINK_LIBRARIES) -set(_hip_compile_flags "") -if(CMAKE_VERSION VERSION_LESS "3.21") - # Using clang HIP, we need to construct a few CPP defines and compiler flags - foreach(_arch ${CMAKE_HIP_ARCHITECTURES}) - string(TOUPPER ${_arch} _UPARCH) - string(TOLOWER ${_arch} _lowarch) - list(APPEND _hip_compile_flags "--offload-arch=${_lowarch}") - set(_hip_compile_defines "${HIP_RUNTIME_DEFINES};-D__HIP_ARCH_${_UPARCH}__=1") - endforeach(_arch) -endif() -if (ENABLE_CLANG_HIP) - if (NOT (${HIP_PLATFORM} STREQUAL "clang")) - message(FATAL_ERROR "ENABLE_CLANG_HIP requires HIP_PLATFORM=clang") - endif() - list(APPEND _hip_compile_flags -x) - list(APPEND _hip_compile_flags hip) + foreach(_target ${AMDGPU_TARGETS}) + if (NOT "${CMAKE_HIP_ARCHITECTURES}" MATCHES "${_target}") + list(REMOVE_ITEM _hip_compile_options "--offload-arch=${_target}") + list(REMOVE_ITEM _hip_link_libs "--offload-arch=${_target}") + endif() + endforeach() - # We need to pass rocm path as well, for certain bitcode libraries. - # First see if we were given it, then see if it exists in the environment. - # If not, don't try to guess but print a warning and hope the compiler knows where it is. - if (NOT ROCM_PATH) - find_path(ROCM_PATH - hip - ENV ROCM_DIR - ENV ROCM_PATH - ${HIP_ROOT_DIR}/../ - ${ROCM_ROOT_DIR} - /opt/rocm) - endif() + set_property(TARGET hip::device PROPERTY INTERFACE_COMPILE_OPTIONS ${_hip_compile_options}) + set_property(TARGET hip::device PROPERTY INTERFACE_LINK_LIBRARIES ${_hip_link_libs}) - if(DEFINED ROCM_PATH) - list(APPEND _hip_compile_flags "--rocm-path=${ROCM_PATH}") - else() - message(WARN "ROCM_PATH not set or found! This is typically required for Clang HIP Compilation") + if(DEFINED CMAKE_HIP_ARCHITECTURES) + set(AMDGPU_TARGETS "${CMAKE_HIP_ARCHITECTURES}" CACHE STRING "" FORCE) endif() +endif() - message(STATUS "Clang HIP Enabled. Clang flags for HIP compilation: ${_hip_compile_flags}") - message(STATUS "Defines for HIP compilation: ${_hip_compile_defines}") +blt_import_library(NAME blt_hip + COMPILE_FLAGS "--rocm-path=${ROCM_PATH}" + EXPORTABLE ${BLT_EXPORT_THIRDPARTY}) - blt_import_library(NAME hip - DEFINES ${_hip_compile_defines} - COMPILE_FLAGS ${_hip_compile_flags} - DEPENDS_ON ${HIP_RUNTIME_LIBRARIES}) -else() - # hipcc does not receive a standard flag from cmake or from BLT otherwise - set(HIP_HIPCC_FLAGS ${HIP_HIPCC_FLAGS} -std=${BLT_CXX_STD}) - # depend on 'hip', if you need to use hip - # headers, link to hip libs, and need to run your source - # through a hip compiler (hipcc) - # This is currently used only as an indicator for blt_add_hip* -- FindHIP/hipcc will handle resolution - # of all required HIP-related includes/libraries/flags. - blt_import_library(NAME hip - DEFINES ${_hip_compile_defines} - COMPILE_FLAGS ${_hip_compile_flags}) -endif() +# Hard-copy inheritable properties instead of depending on hip::device so that we can export all required +# information in our target blt_hip +blt_inherit_target_info(TO blt_hip FROM hip::device OBJECT FALSE) +add_library(blt::hip ALIAS blt_hip) -# depend on 'hip_runtime', if you only need to use hip -# headers or link to hip libs, but don't need to run your source -# through a hip compiler (hipcc) -blt_import_library(NAME hip_runtime - INCLUDES ${HIP_RUNTIME_INCLUDE_DIRS} - DEFINES ${HIP_RUNTIME_DEFINES} - COMPILE_FLAGS ${HIP_RUNTIME_COMPILE_FLAGS} - DEPENDS_ON ${HIP_RUNTIME_LIBRARIES} +blt_import_library(NAME blt_hip_runtime + INCLUDES ${HIP_INCLUDE_DIRS} TREAT_INCLUDES_AS_SYSTEM ON EXPORTABLE ${BLT_EXPORT_THIRDPARTY}) + +blt_inherit_target_info(TO blt_hip_runtime FROM hip::host OBJECT FALSE) + +add_library(blt::hip_runtime ALIAS blt_hip_runtime) diff --git a/docs/tutorial/common_hpc_dependencies.rst b/docs/tutorial/common_hpc_dependencies.rst index d16ebf8c9..97c54c20d 100644 --- a/docs/tutorial/common_hpc_dependencies.rst +++ b/docs/tutorial/common_hpc_dependencies.rst @@ -16,7 +16,7 @@ As previously mentioned in :ref:`AddingTests`, BLT also provides bundled versions of GoogleTest, GoogleMock, GoogleBenchmark, and FRUIT. Not only are the source for these included, we provide named CMake targets for them as well. -BLT's ``mpi``, ``cuda``, ``cuda_runtime``, ``hip``, ``hip_runtime``,and ``openmp`` targets are +BLT's ``mpi``, ``cuda``, ``cuda_runtime``, ``blt::hip``, ``blt::hip_runtime``,and ``openmp`` targets are all defined via the :ref:`blt_import_library` macro. This creates a true CMake imported target that is inherited properly through the CMake's dependency graph. @@ -177,5 +177,5 @@ BLT also supports AMD's HIP via a mechanism very similar to our CUDA support. **BLT Targets** -* ``hip`` : Adds include directories, hip runtime libraries, and compiles source with hipcc -* ``hip_runtime`` : Adds include directories and hip runtime libraries +* ``blt::hip`` : Adds include directories, hip runtime libraries, and compiles source with hipcc +* ``blt::hip_runtime`` : Adds include directories and hip runtime libraries diff --git a/docs/tutorial/exporting_targets.rst b/docs/tutorial/exporting_targets.rst index 04c358470..4dbb3d058 100644 --- a/docs/tutorial/exporting_targets.rst +++ b/docs/tutorial/exporting_targets.rst @@ -19,7 +19,7 @@ BLT provides several built-in targets for commonly used libraries: ``cuda`` and ``cuda_runtime`` Available when ``ENABLE_CUDA`` is ``ON`` -``hip`` and ``hip_runtime`` +``blt_hip`` and ``blt_hip_runtime`` Available when ``ENABLE_HIP`` is ``ON`` These targets can be made exportable in order to make them available to users of @@ -36,6 +36,10 @@ option to ``ON`` will mark all active targets in the above list as ``EXPORTABLE` marked ``EXPORTABLE`` must be added to the same export set. Failure to add them will result in a CMake error in the exporting project. +.. note:: The recommended usage of the HIP targets is via the ``blt::hip`` and + ``blt::hip_runtime`` aliases. Alias targets cannot be exported, so the + ``blt_hip``/``blt_hip_runtime`` names can be used for this purpose. + Typical usage of the ``BLT_EXPORT_THIRDPARTY`` option is as follows: .. code-block:: cmake diff --git a/host-configs/llnl/toss_4_x86_64_ib_cray/cce@12.0.1_clang_hip.cmake b/host-configs/llnl/toss_4_x86_64_ib_cray/cce@12.0.1_clang_hip.cmake index f9efc3d39..283d7650f 100644 --- a/host-configs/llnl/toss_4_x86_64_ib_cray/cce@12.0.1_clang_hip.cmake +++ b/host-configs/llnl/toss_4_x86_64_ib_cray/cce@12.0.1_clang_hip.cmake @@ -43,7 +43,6 @@ set(MPI_Fortran_COMPILER "${MPI_HOME}/bin/mpif90" CACHE PATH "") #------------------------------------------------------------------------------ # _blt_tutorial_hip_config_start set(ENABLE_HIP ON CACHE BOOL "") -set(ENABLE_CLANG_HIP ON CACHE BOOL "") set(ROCM_PATH "/opt/rocm-4.2.0/" CACHE PATH "") set(HIP_PLATFORM "clang" CACHE STRING "") diff --git a/host-configs/llnl/toss_4_x86_64_ib_cray/cce@12.0.3_clang_hip.cmake b/host-configs/llnl/toss_4_x86_64_ib_cray/cce@12.0.3_clang_hip.cmake new file mode 100644 index 000000000..7d26ee4e0 --- /dev/null +++ b/host-configs/llnl/toss_4_x86_64_ib_cray/cce@12.0.3_clang_hip.cmake @@ -0,0 +1,44 @@ +# Copyright (c) 2017-2021, Lawrence Livermore National Security, LLC and +# other BLT Project Developers. See the top-level LICENSE file for details +# +# SPDX-License-Identifier: (BSD-3-Clause) + +#------------------------------------------------------------------------------ +# Example host-config file for the rzwhamo cluster at LLNL +#------------------------------------------------------------------------------ +# This file provides CMake with paths / details for: +# C,C++, & Fortran compilers + MPI & HIP +# using tce wrappers, rather than HPE Cray PE compiler drivers +#------------------------------------------------------------------------------ + +#------------------------------------------------------------------------------ +# HPE Cray cce@12.0.3 compilers +#------------------------------------------------------------------------------ +set(CCE_HOME "/usr/tce/packages/cce-tce/cce-12.0.3") +set(CMAKE_C_COMPILER "${CCE_HOME}/bin/craycc" CACHE PATH "") +set(CMAKE_CXX_COMPILER "${CCE_HOME}/bin/crayCC" CACHE PATH "") + +# Fortran support +set(ENABLE_FORTRAN ON CACHE BOOL "") +set(CMAKE_Fortran_COMPILER "${CCE_HOME}/bin/crayftn" CACHE PATH "") + +#------------------------------------------------------------------------------ +# MPI Support +#------------------------------------------------------------------------------ +set(ENABLE_MPI ON CACHE BOOL "") + +set(MPI_HOME "/usr/tce/packages/cray-mpich-tce/cray-mpich-8.1.8-cce-12.0.3/") +set(MPI_C_COMPILER "${MPI_HOME}/bin/mpicc" CACHE PATH "") + +set(MPI_CXX_COMPILER "${MPI_HOME}/bin/mpicxx" CACHE PATH "") + +set(MPI_Fortran_COMPILER "${MPI_HOME}/bin/mpif90" CACHE PATH "") + +#------------------------------------------------------------------------------ +# HIP support +#------------------------------------------------------------------------------ +set(ENABLE_HIP ON CACHE BOOL "") + +set(ROCM_PATH "/opt/rocm-4.5.0/" CACHE PATH "") +set(HIP_PLATFORM "clang" CACHE STRING "") +set(CMAKE_HIP_ARCHITECTURES "gfx908" CACHE STRING "gfx architecture to use when generating HIP/ROCm code") diff --git a/tests/internal/CMakeLists.txt b/tests/internal/CMakeLists.txt index ab6b28216..a837a5415 100644 --- a/tests/internal/CMakeLists.txt +++ b/tests/internal/CMakeLists.txt @@ -255,7 +255,7 @@ endif() message(STATUS "Exercising blt_print_target_properties macro on some targets and non-targets.") message(STATUS "") -foreach(_target gtest example t_example_smoke not-a-target blt_header_only mpi cuda cuda_runtime hip hip_runtime) +foreach(_target gtest example t_example_smoke not-a-target blt_header_only mpi cuda cuda_runtime blt::hip blt::hip_runtime) blt_print_target_properties(TARGET ${_target}) endforeach() diff --git a/tests/internal/src/hip_defines_test/CMakeLists.txt b/tests/internal/src/hip_defines_test/CMakeLists.txt index c5f3d5b39..9fa566986 100644 --- a/tests/internal/src/hip_defines_test/CMakeLists.txt +++ b/tests/internal/src/hip_defines_test/CMakeLists.txt @@ -12,12 +12,12 @@ blt_add_executable(NAME blt_hip_defines_test_foo SOURCES foo.cpp DEFINES FOO_ONLY - DEPENDS_ON hip) + DEPENDS_ON blt::hip) blt_add_executable(NAME blt_hip_defines_test_bar SOURCES bar.cpp DEFINES BAR_ONLY - DEPENDS_ON hip) + DEPENDS_ON blt::hip) blt_add_test( NAME blt_test_hip_defines_first COMMAND blt_hip_defines_test_foo diff --git a/tests/smoke/CMakeLists.txt b/tests/smoke/CMakeLists.txt index 2545ece17..b877cd01a 100644 --- a/tests/smoke/CMakeLists.txt +++ b/tests/smoke/CMakeLists.txt @@ -211,7 +211,7 @@ if (ENABLE_HIP) blt_add_executable(NAME blt_hip_smoke SOURCES blt_hip_smoke.cpp OUTPUT_DIR ${TEST_OUTPUT_DIRECTORY} - DEPENDS_ON hip + DEPENDS_ON blt::hip FOLDER blt/tests ) blt_add_test(NAME blt_hip_smoke @@ -220,7 +220,7 @@ if (ENABLE_HIP) blt_add_executable(NAME blt_hip_runtime_smoke SOURCES blt_hip_runtime_smoke.cpp OUTPUT_DIR ${TEST_OUTPUT_DIRECTORY} - DEPENDS_ON hip_runtime + DEPENDS_ON blt::hip_runtime FOLDER blt/tests ) blt_add_test(NAME blt_hip_runtime_smoke @@ -229,7 +229,7 @@ if (ENABLE_HIP) blt_add_executable(NAME blt_hip_runtime_c_smoke SOURCES blt_hip_runtime_c_smoke.c OUTPUT_DIR ${TEST_OUTPUT_DIRECTORY} - DEPENDS_ON hip_runtime + DEPENDS_ON blt::hip_runtime FOLDER blt/tests ) blt_add_test(NAME blt_hip_runtime_c_smoke @@ -239,7 +239,7 @@ if (ENABLE_HIP) blt_add_executable(NAME blt_hip_gtest_smoke SOURCES blt_hip_gtest_smoke.cpp OUTPUT_DIR ${TEST_OUTPUT_DIRECTORY} - DEPENDS_ON gtest hip + DEPENDS_ON gtest blt::hip FOLDER blt/tests ) blt_add_test(NAME blt_hip_gtest_smoke From 84be1f656c901f8a8e55464f46b57373ebfea1ff Mon Sep 17 00:00:00 2001 From: Chris White Date: Mon, 10 Jan 2022 16:56:55 -0800 Subject: [PATCH 54/76] 2022 copyright update --- .gitlab-ci.yml | 2 +- LICENSE | 2 +- SetupBLT.cmake | 2 +- azure-pipelines.yml | 2 +- cmake/BLTGitMacros.cmake | 2 +- cmake/BLTMacros.cmake | 2 +- cmake/BLTOptions.cmake | 2 +- cmake/BLTPrivateMacros.cmake | 2 +- cmake/SetupCodeChecks.cmake | 2 +- cmake/SetupCodeMetrics.cmake | 2 +- cmake/SetupCompilerOptions.cmake | 2 +- cmake/SetupDocs.cmake | 2 +- cmake/WrapAstyle.cmake.in | 2 +- cmake/clang-query-wrapper.py | 2 +- cmake/thirdparty/FindROCm.cmake | 2 +- cmake/thirdparty/SetupCUDA.cmake | 2 +- cmake/thirdparty/SetupHCC.cmake | 2 +- cmake/thirdparty/SetupHIP.cmake | 2 +- cmake/thirdparty/SetupMPI.cmake | 2 +- cmake/thirdparty/SetupOpenMP.cmake | 2 +- cmake/thirdparty/SetupThirdParty.cmake | 2 +- docs/CMakeLists.txt | 2 +- docs/api/code_check.rst | 2 +- docs/api/documentation.rst | 2 +- docs/api/git.rst | 2 +- docs/api/index.rst | 2 +- docs/api/target.rst | 2 +- docs/api/target_properties.rst | 2 +- docs/api/utility.rst | 2 +- docs/conf.py | 4 ++-- docs/developer/index.rst | 2 +- docs/developer/release_process.rst | 2 +- docs/index.rst | 2 +- docs/tutorial/adding_tests.rst | 2 +- docs/tutorial/advanced_topics.rst | 2 +- docs/tutorial/common_hpc_dependencies.rst | 2 +- docs/tutorial/creating_documentation.rst | 2 +- docs/tutorial/creating_targets.rst | 2 +- docs/tutorial/exporting_targets.rst | 2 +- docs/tutorial/getting_started.rst | 2 +- docs/tutorial/host_configs.rst | 2 +- docs/tutorial/importing_targets.rst | 2 +- docs/tutorial/index.rst | 2 +- docs/tutorial/object_libraries.rst | 2 +- docs/tutorial/portable_compiler_flags.rst | 2 +- docs/tutorial/recommendations.rst | 2 +- docs/tutorial/third_party_libraries.rst | 2 +- host-configs/darwin/elcapitan-x86_64/naples-clang@7.3.0.cmake | 2 +- .../clang@upstream_link_with_nvcc.cmake | 2 +- .../blueos_3_ppc64le_ib_p9/clang@upstream_nvcc_c++17.cmake | 2 +- .../clang@upstream_nvcc_c++17_no_separable.cmake | 2 +- .../llnl/blueos_3_ppc64le_ib_p9/clang@upstream_nvcc_xlf.cmake | 2 +- host-configs/llnl/blueos_3_ppc64le_ib_p9/pgi@20.4_nvcc.cmake | 2 +- host-configs/llnl/toss_3_x86_64_ib/clang@4.0.0-libcxx.cmake | 2 +- .../llnl/toss_3_x86_64_ib/clang@6.0.0-static-analysis.cmake | 2 +- host-configs/llnl/toss_3_x86_64_ib/gcc@4.9.3_nvcc.cmake | 2 +- host-configs/llnl/toss_3_x86_64_ib/gcc@8.3.1.cmake | 2 +- host-configs/llnl/toss_3_x86_64_ib/pgi@20.1.cmake | 2 +- .../llnl/toss_4_x86_64_ib_cray/cce@12.0.1_clang_hip.cmake | 2 +- host-configs/llnl/windows/sqa-uno-msvc@15.cmake | 2 +- host-configs/olcf/summit/gcc@6.4.0_nvcc.cmake | 2 +- host-configs/other/hcc.cmake | 2 +- host-configs/other/hip.cmake | 2 +- tests/internal/CMakeLists.txt | 2 +- tests/internal/src/Example.cpp | 2 +- tests/internal/src/Example.hpp | 2 +- tests/internal/src/Example_Exports.h | 2 +- tests/internal/src/HeaderOnly.hpp | 2 +- tests/internal/src/combine_static_library_test/CMakeLists.txt | 2 +- tests/internal/src/combine_static_library_test/Foo1.cpp | 2 +- tests/internal/src/combine_static_library_test/Foo1.hpp | 2 +- tests/internal/src/combine_static_library_test/Foo2.cpp | 2 +- tests/internal/src/combine_static_library_test/Foo2.hpp | 2 +- tests/internal/src/combine_static_library_test/Foo3.cpp | 2 +- tests/internal/src/combine_static_library_test/Foo3.hpp | 2 +- .../blt_combine_static_libraries_shared_smoke.cpp | 2 +- .../blt_combine_static_libraries_static_smoke.cpp | 2 +- tests/internal/src/combine_static_library_test/main.cpp | 2 +- tests/internal/src/hip_defines_test/CMakeLists.txt | 2 +- tests/internal/src/hip_defines_test/bar.cpp | 2 +- tests/internal/src/hip_defines_test/foo.cpp | 2 +- tests/internal/src/object_library_test/CMakeLists.txt | 2 +- tests/internal/src/object_library_test/base_object.cpp | 2 +- tests/internal/src/object_library_test/base_object.hpp | 2 +- .../src/object_library_test/inherited_base/CMakeLists.txt | 2 +- .../src/object_library_test/inherited_base/inherited_base.cpp | 2 +- .../src/object_library_test/inherited_base/inherited_base.hpp | 2 +- tests/internal/src/object_library_test/main.cpp | 2 +- tests/internal/src/object_library_test/object.cpp | 2 +- tests/internal/src/object_library_test/object.hpp | 2 +- tests/internal/src/static_analysis/CMakeLists.txt | 2 +- tests/internal/src/static_analysis/subtle_error_source.cpp | 2 +- tests/internal/src/static_analysis/well_analyzed_source.cpp | 2 +- tests/internal/src/t_example_compile_definitions.cpp | 2 +- tests/internal/src/t_example_smoke.cpp | 2 +- tests/internal/src/t_git_macros_smoke.cpp.in | 2 +- tests/internal/src/t_header_only_smoke.cpp | 2 +- tests/internal/src/test_cmake_format_conformant.cmake | 2 +- tests/internal/src/test_cmake_format_nonconformant.cmake | 2 +- .../src/test_cuda_device_call_from_kernel/CMakeLists.txt | 2 +- .../internal/src/test_cuda_device_call_from_kernel/Child.cpp | 2 +- .../internal/src/test_cuda_device_call_from_kernel/Child.hpp | 2 +- .../src/test_cuda_device_call_from_kernel/CudaTests.cpp | 2 +- .../internal/src/test_cuda_device_call_from_kernel/Parent.cpp | 2 +- .../internal/src/test_cuda_device_call_from_kernel/Parent.hpp | 2 +- tests/internal/src/test_cuda_mpi.cpp | 2 +- tests/smoke/CMakeLists.txt | 2 +- tests/smoke/blt_cuda_gtest_smoke.cpp | 2 +- tests/smoke/blt_cuda_mpi_smoke.cpp | 2 +- tests/smoke/blt_cuda_openmp_smoke.cpp | 2 +- tests/smoke/blt_cuda_runtime_smoke.cpp | 2 +- tests/smoke/blt_cuda_smoke.cpp | 2 +- tests/smoke/blt_cuda_version_smoke.cpp | 2 +- tests/smoke/blt_fruit_mpi_smoke.f90 | 2 +- tests/smoke/blt_fruit_smoke.f90 | 2 +- tests/smoke/blt_gbenchmark_smoke.cpp | 2 +- tests/smoke/blt_gmock_smoke.cpp | 2 +- tests/smoke/blt_gtest_smoke.cpp | 2 +- tests/smoke/blt_hcc_runtime_smoke.cpp | 2 +- tests/smoke/blt_hcc_smoke.cpp | 2 +- tests/smoke/blt_hip_gtest_smoke.cpp | 2 +- tests/smoke/blt_hip_runtime_smoke.cpp | 2 +- tests/smoke/blt_hip_smoke.cpp | 2 +- tests/smoke/blt_mpi_smoke.cpp | 2 +- tests/smoke/blt_openmp_smoke.cpp | 2 +- tests/smoke/fortran_driver.cpp | 2 +- tests/smoke/fortran_mpi_driver.cpp | 2 +- thirdparty_builtin/CMakeLists.txt | 2 +- 128 files changed, 129 insertions(+), 129 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 74cad0049..c921d4772 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,5 +1,5 @@ ############################################################################## -# Copyright (c) 2017-2021, Lawrence Livermore National Security, LLC and BLT +# Copyright (c) 2017-2022, Lawrence Livermore National Security, LLC and BLT # project contributors. See the LICENSE file for details. ############################################################################## diff --git a/LICENSE b/LICENSE index f08c6273a..8e4df6528 100644 --- a/LICENSE +++ b/LICENSE @@ -1,4 +1,4 @@ -Copyright (c) 2017-2021, Lawrence Livermore National Security, LLC. +Copyright (c) 2017-2022, Lawrence Livermore National Security, LLC. All rights reserved. Redistribution and use in source and binary forms, with or without diff --git a/SetupBLT.cmake b/SetupBLT.cmake index f89143c43..fe7539a70 100644 --- a/SetupBLT.cmake +++ b/SetupBLT.cmake @@ -1,4 +1,4 @@ -# Copyright (c) 2017-2021, Lawrence Livermore National Security, LLC and +# Copyright (c) 2017-2022, Lawrence Livermore National Security, LLC and # other BLT Project Developers. See the top-level LICENSE file for details # # SPDX-License-Identifier: (BSD-3-Clause) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index f834d3d45..d32207b48 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -1,4 +1,4 @@ -# Copyright (c) 2017-2021, Lawrence Livermore National Security, LLC and +# Copyright (c) 2017-2022, Lawrence Livermore National Security, LLC and # other BLT Project Developers. See the top-level LICENSE file for details # # SPDX-License-Identifier: (BSD-3-Clause) diff --git a/cmake/BLTGitMacros.cmake b/cmake/BLTGitMacros.cmake index e08a5d432..ce47a35bb 100644 --- a/cmake/BLTGitMacros.cmake +++ b/cmake/BLTGitMacros.cmake @@ -1,4 +1,4 @@ -# Copyright (c) 2017-2021, Lawrence Livermore National Security, LLC and +# Copyright (c) 2017-2022, Lawrence Livermore National Security, LLC and # other BLT Project Developers. See the top-level LICENSE file for details # # SPDX-License-Identifier: (BSD-3-Clause) diff --git a/cmake/BLTMacros.cmake b/cmake/BLTMacros.cmake index e755da62e..6129af79f 100644 --- a/cmake/BLTMacros.cmake +++ b/cmake/BLTMacros.cmake @@ -1,4 +1,4 @@ -# Copyright (c) 2017-2021, Lawrence Livermore National Security, LLC and +# Copyright (c) 2017-2022, Lawrence Livermore National Security, LLC and # other BLT Project Developers. See the top-level LICENSE file for details # # SPDX-License-Identifier: (BSD-3-Clause) diff --git a/cmake/BLTOptions.cmake b/cmake/BLTOptions.cmake index 667d45d99..564c06590 100644 --- a/cmake/BLTOptions.cmake +++ b/cmake/BLTOptions.cmake @@ -1,4 +1,4 @@ -# Copyright (c) 2017-2021, Lawrence Livermore National Security, LLC and +# Copyright (c) 2017-2022, Lawrence Livermore National Security, LLC and # other BLT Project Developers. See the top-level LICENSE file for details # # SPDX-License-Identifier: (BSD-3-Clause) diff --git a/cmake/BLTPrivateMacros.cmake b/cmake/BLTPrivateMacros.cmake index 44ce0d6bc..5c980accd 100644 --- a/cmake/BLTPrivateMacros.cmake +++ b/cmake/BLTPrivateMacros.cmake @@ -1,4 +1,4 @@ -# Copyright (c) 2017-2021, Lawrence Livermore National Security, LLC and +# Copyright (c) 2017-2022, Lawrence Livermore National Security, LLC and # other BLT Project Developers. See the top-level LICENSE file for details # # SPDX-License-Identifier: (BSD-3-Clause) diff --git a/cmake/SetupCodeChecks.cmake b/cmake/SetupCodeChecks.cmake index 9eb09c991..b35159451 100644 --- a/cmake/SetupCodeChecks.cmake +++ b/cmake/SetupCodeChecks.cmake @@ -1,4 +1,4 @@ -# Copyright (c) 2017-2021, Lawrence Livermore National Security, LLC and +# Copyright (c) 2017-2022, Lawrence Livermore National Security, LLC and # other BLT Project Developers. See the top-level LICENSE file for details # # SPDX-License-Identifier: (BSD-3-Clause) diff --git a/cmake/SetupCodeMetrics.cmake b/cmake/SetupCodeMetrics.cmake index 59e6dbb0b..6933d482f 100644 --- a/cmake/SetupCodeMetrics.cmake +++ b/cmake/SetupCodeMetrics.cmake @@ -1,4 +1,4 @@ -# Copyright (c) 2017-2021, Lawrence Livermore National Security, LLC and +# Copyright (c) 2017-2022, Lawrence Livermore National Security, LLC and # other BLT Project Developers. See the top-level LICENSE file for details # # SPDX-License-Identifier: (BSD-3-Clause) diff --git a/cmake/SetupCompilerOptions.cmake b/cmake/SetupCompilerOptions.cmake index 635583b92..5fd3c1652 100644 --- a/cmake/SetupCompilerOptions.cmake +++ b/cmake/SetupCompilerOptions.cmake @@ -1,4 +1,4 @@ -# Copyright (c) 2017-2021, Lawrence Livermore National Security, LLC and +# Copyright (c) 2017-2022, Lawrence Livermore National Security, LLC and # other BLT Project Developers. See the top-level LICENSE file for details # # SPDX-License-Identifier: (BSD-3-Clause) diff --git a/cmake/SetupDocs.cmake b/cmake/SetupDocs.cmake index d1ba9cda1..d0bb46c0e 100644 --- a/cmake/SetupDocs.cmake +++ b/cmake/SetupDocs.cmake @@ -1,4 +1,4 @@ -# Copyright (c) 2017-2021, Lawrence Livermore National Security, LLC and +# Copyright (c) 2017-2022, Lawrence Livermore National Security, LLC and # other BLT Project Developers. See the top-level LICENSE file for details # # SPDX-License-Identifier: (BSD-3-Clause) diff --git a/cmake/WrapAstyle.cmake.in b/cmake/WrapAstyle.cmake.in index dea031e81..673151c19 100644 --- a/cmake/WrapAstyle.cmake.in +++ b/cmake/WrapAstyle.cmake.in @@ -1,4 +1,4 @@ -# Copyright (c) 2017-2021, Lawrence Livermore National Security, LLC and +# Copyright (c) 2017-2022, Lawrence Livermore National Security, LLC and # other BLT Project Developers. See the top-level LICENSE file for details # # SPDX-License-Identifier: (BSD-3-Clause) diff --git a/cmake/clang-query-wrapper.py b/cmake/clang-query-wrapper.py index 74026a6cb..630407e28 100644 --- a/cmake/clang-query-wrapper.py +++ b/cmake/clang-query-wrapper.py @@ -1,4 +1,4 @@ -# Copyright (c) 2017-2021, Lawrence Livermore National Security, LLC and +# Copyright (c) 2017-2022, Lawrence Livermore National Security, LLC and # other BLT Project Developers. See the top-level LICENSE file for details # # SPDX-License-Identifier: (BSD-3-Clause) diff --git a/cmake/thirdparty/FindROCm.cmake b/cmake/thirdparty/FindROCm.cmake index 9c0efe403..2ca58d954 100644 --- a/cmake/thirdparty/FindROCm.cmake +++ b/cmake/thirdparty/FindROCm.cmake @@ -1,4 +1,4 @@ -# Copyright (c) 2017-2021, Lawrence Livermore National Security, LLC and +# Copyright (c) 2017-2022, Lawrence Livermore National Security, LLC and # other BLT Project Developers. See the top-level LICENSE file for details # # SPDX-License-Identifier: (BSD-3-Clause) diff --git a/cmake/thirdparty/SetupCUDA.cmake b/cmake/thirdparty/SetupCUDA.cmake index d78ef37f8..0c11219c8 100644 --- a/cmake/thirdparty/SetupCUDA.cmake +++ b/cmake/thirdparty/SetupCUDA.cmake @@ -1,4 +1,4 @@ -# Copyright (c) 2017-2021, Lawrence Livermore National Security, LLC and +# Copyright (c) 2017-2022, Lawrence Livermore National Security, LLC and # other BLT Project Developers. See the top-level LICENSE file for details # # SPDX-License-Identifier: (BSD-3-Clause) diff --git a/cmake/thirdparty/SetupHCC.cmake b/cmake/thirdparty/SetupHCC.cmake index 9b4367bba..4897bbe64 100644 --- a/cmake/thirdparty/SetupHCC.cmake +++ b/cmake/thirdparty/SetupHCC.cmake @@ -1,4 +1,4 @@ -# Copyright (c) 2017-2021, Lawrence Livermore National Security, LLC and +# Copyright (c) 2017-2022, Lawrence Livermore National Security, LLC and # other BLT Project Developers. See the top-level LICENSE file for details # # SPDX-License-Identifier: (BSD-3-Clause) diff --git a/cmake/thirdparty/SetupHIP.cmake b/cmake/thirdparty/SetupHIP.cmake index 2513a94fd..b41ee7b39 100644 --- a/cmake/thirdparty/SetupHIP.cmake +++ b/cmake/thirdparty/SetupHIP.cmake @@ -1,4 +1,4 @@ -# Copyright (c) 2017-2021, Lawrence Livermore National Security, LLC and +# Copyright (c) 2017-2022, Lawrence Livermore National Security, LLC and # other BLT Project Developers. See the top-level LICENSE file for details # # SPDX-License-Identifier: (BSD-3-Clause) diff --git a/cmake/thirdparty/SetupMPI.cmake b/cmake/thirdparty/SetupMPI.cmake index c04e0b6ef..b808a9fda 100644 --- a/cmake/thirdparty/SetupMPI.cmake +++ b/cmake/thirdparty/SetupMPI.cmake @@ -1,4 +1,4 @@ -# Copyright (c) 2017-2021, Lawrence Livermore National Security, LLC and +# Copyright (c) 2017-2022, Lawrence Livermore National Security, LLC and # other BLT Project Developers. See the top-level LICENSE file for details # # SPDX-License-Identifier: (BSD-3-Clause) diff --git a/cmake/thirdparty/SetupOpenMP.cmake b/cmake/thirdparty/SetupOpenMP.cmake index 0620a8554..a5235c789 100644 --- a/cmake/thirdparty/SetupOpenMP.cmake +++ b/cmake/thirdparty/SetupOpenMP.cmake @@ -1,4 +1,4 @@ -# Copyright (c) 2017-2021, Lawrence Livermore National Security, LLC and +# Copyright (c) 2017-2022, Lawrence Livermore National Security, LLC and # other BLT Project Developers. See the top-level LICENSE file for details # # SPDX-License-Identifier: (BSD-3-Clause) diff --git a/cmake/thirdparty/SetupThirdParty.cmake b/cmake/thirdparty/SetupThirdParty.cmake index 2cf788a20..38c09ab1f 100644 --- a/cmake/thirdparty/SetupThirdParty.cmake +++ b/cmake/thirdparty/SetupThirdParty.cmake @@ -1,4 +1,4 @@ -# Copyright (c) 2017-2021, Lawrence Livermore National Security, LLC and +# Copyright (c) 2017-2022, Lawrence Livermore National Security, LLC and # other BLT Project Developers. See the top-level LICENSE file for details # # SPDX-License-Identifier: (BSD-3-Clause) diff --git a/docs/CMakeLists.txt b/docs/CMakeLists.txt index 92c95d1dc..a2b62332a 100644 --- a/docs/CMakeLists.txt +++ b/docs/CMakeLists.txt @@ -1,4 +1,4 @@ -# Copyright (c) 2017-2021, Lawrence Livermore National Security, LLC and +# Copyright (c) 2017-2022, Lawrence Livermore National Security, LLC and # other BLT Project Developers. See the top-level LICENSE file for details # # SPDX-License-Identifier: (BSD-3-Clause) diff --git a/docs/api/code_check.rst b/docs/api/code_check.rst index b94a8d75a..8e746b0f3 100644 --- a/docs/api/code_check.rst +++ b/docs/api/code_check.rst @@ -1,4 +1,4 @@ -.. # Copyright (c) 2017-2021, Lawrence Livermore National Security, LLC and +.. # Copyright (c) 2017-2022, Lawrence Livermore National Security, LLC and .. # other BLT Project Developers. See the top-level LICENSE file for details .. # .. # SPDX-License-Identifier: (BSD-3-Clause) diff --git a/docs/api/documentation.rst b/docs/api/documentation.rst index ddc115cec..0a607aee9 100644 --- a/docs/api/documentation.rst +++ b/docs/api/documentation.rst @@ -1,4 +1,4 @@ -.. # Copyright (c) 2017-2021, Lawrence Livermore National Security, LLC and +.. # Copyright (c) 2017-2022, Lawrence Livermore National Security, LLC and .. # other BLT Project Developers. See the top-level LICENSE file for details .. # .. # SPDX-License-Identifier: (BSD-3-Clause) diff --git a/docs/api/git.rst b/docs/api/git.rst index f05d8558b..40443a19c 100644 --- a/docs/api/git.rst +++ b/docs/api/git.rst @@ -1,4 +1,4 @@ -.. # Copyright (c) 2017-2021, Lawrence Livermore National Security, LLC and +.. # Copyright (c) 2017-2022, Lawrence Livermore National Security, LLC and .. # other BLT Project Developers. See the top-level LICENSE file for details .. # .. # SPDX-License-Identifier: (BSD-3-Clause) diff --git a/docs/api/index.rst b/docs/api/index.rst index cb31bb6ad..3faa84f5b 100644 --- a/docs/api/index.rst +++ b/docs/api/index.rst @@ -1,4 +1,4 @@ -.. # Copyright (c) 2017-2021, Lawrence Livermore National Security, LLC and +.. # Copyright (c) 2017-2022, Lawrence Livermore National Security, LLC and .. # other BLT Project Developers. See the top-level LICENSE file for details .. # .. # SPDX-License-Identifier: (BSD-3-Clause) diff --git a/docs/api/target.rst b/docs/api/target.rst index ec8b80dca..8acc34556 100644 --- a/docs/api/target.rst +++ b/docs/api/target.rst @@ -1,4 +1,4 @@ -.. # Copyright (c) 2017-2021, Lawrence Livermore National Security, LLC and +.. # Copyright (c) 2017-2022, Lawrence Livermore National Security, LLC and .. # other BLT Project Developers. See the top-level LICENSE file for details .. # .. # SPDX-License-Identifier: (BSD-3-Clause) diff --git a/docs/api/target_properties.rst b/docs/api/target_properties.rst index 50443fabe..70af9464a 100644 --- a/docs/api/target_properties.rst +++ b/docs/api/target_properties.rst @@ -1,4 +1,4 @@ -.. # Copyright (c) 2017-2021, Lawrence Livermore National Security, LLC and +.. # Copyright (c) 2017-2022, Lawrence Livermore National Security, LLC and .. # other BLT Project Developers. See the top-level LICENSE file for details .. # .. # SPDX-License-Identifier: (BSD-3-Clause) diff --git a/docs/api/utility.rst b/docs/api/utility.rst index fb33a4ffc..72b048d4d 100644 --- a/docs/api/utility.rst +++ b/docs/api/utility.rst @@ -1,4 +1,4 @@ -.. # Copyright (c) 2017-2021, Lawrence Livermore National Security, LLC and +.. # Copyright (c) 2017-2022, Lawrence Livermore National Security, LLC and .. # other BLT Project Developers. See the top-level LICENSE file for details .. # .. # SPDX-License-Identifier: (BSD-3-Clause) diff --git a/docs/conf.py b/docs/conf.py index 2eb0f29c6..96ab40c1f 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -1,4 +1,4 @@ -# Copyright (c) 2017-2021, Lawrence Livermore National Security, LLC and +# Copyright (c) 2017-2022, Lawrence Livermore National Security, LLC and # other BLT Project Developers. See the top-level LICENSE file for details # # SPDX-License-Identifier: (BSD-3-Clause) @@ -47,7 +47,7 @@ # General information about the project. project = u'BLT: Build, Link, and Test' -copyright = u'2017-2021, BLT Development Team' +copyright = u'2017-2022, BLT Development Team' # The version info for the project you're documenting, acts as replacement for # |version| and |release|, also used in various other places throughout the diff --git a/docs/developer/index.rst b/docs/developer/index.rst index e144756d7..b668c3ef7 100644 --- a/docs/developer/index.rst +++ b/docs/developer/index.rst @@ -1,4 +1,4 @@ -.. # Copyright (c) 2017-2021, Lawrence Livermore National Security, LLC and +.. # Copyright (c) 2017-2022, Lawrence Livermore National Security, LLC and .. # other BLT Project Developers. See the top-level LICENSE file for details .. # .. # SPDX-License-Identifier: (BSD-3-Clause) diff --git a/docs/developer/release_process.rst b/docs/developer/release_process.rst index 587aea94c..a221c42c0 100644 --- a/docs/developer/release_process.rst +++ b/docs/developer/release_process.rst @@ -1,4 +1,4 @@ -.. # Copyright (c) 2017-2021, Lawrence Livermore National Security, LLC and +.. # Copyright (c) 2017-2022, Lawrence Livermore National Security, LLC and .. # other BLT Project Developers. See the top-level LICENSE file for details .. # .. # SPDX-License-Identifier: (BSD-3-Clause) diff --git a/docs/index.rst b/docs/index.rst index 7fa4c8b48..2bd769631 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -1,4 +1,4 @@ -.. # Copyright (c) 2017-2021, Lawrence Livermore National Security, LLC and +.. # Copyright (c) 2017-2022, Lawrence Livermore National Security, LLC and .. # other BLT Project Developers. See the top-level LICENSE file for details .. # .. # SPDX-License-Identifier: (BSD-3-Clause) diff --git a/docs/tutorial/adding_tests.rst b/docs/tutorial/adding_tests.rst index b46d1d41d..3b0f28b1c 100644 --- a/docs/tutorial/adding_tests.rst +++ b/docs/tutorial/adding_tests.rst @@ -1,4 +1,4 @@ -.. # Copyright (c) 2017-2021, Lawrence Livermore National Security, LLC and +.. # Copyright (c) 2017-2022, Lawrence Livermore National Security, LLC and .. # other BLT Project Developers. See the top-level LICENSE file for details .. # .. # SPDX-License-Identifier: (BSD-3-Clause) diff --git a/docs/tutorial/advanced_topics.rst b/docs/tutorial/advanced_topics.rst index c772b7c31..d623320b4 100644 --- a/docs/tutorial/advanced_topics.rst +++ b/docs/tutorial/advanced_topics.rst @@ -1,4 +1,4 @@ -.. # Copyright (c) 2017-2021, Lawrence Livermore National Security, LLC and +.. # Copyright (c) 2017-2022, Lawrence Livermore National Security, LLC and .. # other BLT Project Developers. See the top-level LICENSE file for details .. # .. # SPDX-License-Identifier: (BSD-3-Clause) diff --git a/docs/tutorial/common_hpc_dependencies.rst b/docs/tutorial/common_hpc_dependencies.rst index 97c54c20d..a49fac15e 100644 --- a/docs/tutorial/common_hpc_dependencies.rst +++ b/docs/tutorial/common_hpc_dependencies.rst @@ -1,4 +1,4 @@ -.. # Copyright (c) 2017-2021, Lawrence Livermore National Security, LLC and +.. # Copyright (c) 2017-2022, Lawrence Livermore National Security, LLC and .. # other BLT Project Developers. See the top-level LICENSE file for details .. # .. # SPDX-License-Identifier: (BSD-3-Clause) diff --git a/docs/tutorial/creating_documentation.rst b/docs/tutorial/creating_documentation.rst index b4f82e5f2..5490dab12 100644 --- a/docs/tutorial/creating_documentation.rst +++ b/docs/tutorial/creating_documentation.rst @@ -1,4 +1,4 @@ -.. # Copyright (c) 2017-2021, Lawrence Livermore National Security, LLC and +.. # Copyright (c) 2017-2022, Lawrence Livermore National Security, LLC and .. # other BLT Project Developers. See the top-level LICENSE file for details .. # .. # SPDX-License-Identifier: (BSD-3-Clause) diff --git a/docs/tutorial/creating_targets.rst b/docs/tutorial/creating_targets.rst index 84d6b43d4..661b66676 100644 --- a/docs/tutorial/creating_targets.rst +++ b/docs/tutorial/creating_targets.rst @@ -1,4 +1,4 @@ -.. # Copyright (c) 2017-2021, Lawrence Livermore National Security, LLC and +.. # Copyright (c) 2017-2022, Lawrence Livermore National Security, LLC and .. # other BLT Project Developers. See the top-level LICENSE file for details .. # .. # SPDX-License-Identifier: (BSD-3-Clause) diff --git a/docs/tutorial/exporting_targets.rst b/docs/tutorial/exporting_targets.rst index 4dbb3d058..9a86c16f2 100644 --- a/docs/tutorial/exporting_targets.rst +++ b/docs/tutorial/exporting_targets.rst @@ -1,4 +1,4 @@ -.. # Copyright (c) 2017-2021, Lawrence Livermore National Security, LLC and +.. # Copyright (c) 2017-2022, Lawrence Livermore National Security, LLC and .. # other BLT Project Developers. See the top-level LICENSE file for details .. # .. # SPDX-License-Identifier: (BSD-3-Clause) diff --git a/docs/tutorial/getting_started.rst b/docs/tutorial/getting_started.rst index 3f4280b98..291d04957 100644 --- a/docs/tutorial/getting_started.rst +++ b/docs/tutorial/getting_started.rst @@ -1,4 +1,4 @@ -.. # Copyright (c) 2017-2021, Lawrence Livermore National Security, LLC and +.. # Copyright (c) 2017-2022, Lawrence Livermore National Security, LLC and .. # other BLT Project Developers. See the top-level LICENSE file for details .. # .. # SPDX-License-Identifier: (BSD-3-Clause) diff --git a/docs/tutorial/host_configs.rst b/docs/tutorial/host_configs.rst index b88b07951..2a92eae10 100644 --- a/docs/tutorial/host_configs.rst +++ b/docs/tutorial/host_configs.rst @@ -1,4 +1,4 @@ -.. # Copyright (c) 2017-2021, Lawrence Livermore National Security, LLC and +.. # Copyright (c) 2017-2022, Lawrence Livermore National Security, LLC and .. # other BLT Project Developers. See the top-level LICENSE file for details .. # .. # SPDX-License-Identifier: (BSD-3-Clause) diff --git a/docs/tutorial/importing_targets.rst b/docs/tutorial/importing_targets.rst index 73ce9c183..609c7b652 100644 --- a/docs/tutorial/importing_targets.rst +++ b/docs/tutorial/importing_targets.rst @@ -1,4 +1,4 @@ -.. # Copyright (c) 2017-2021, Lawrence Livermore National Security, LLC and +.. # Copyright (c) 2017-2022, Lawrence Livermore National Security, LLC and .. # other BLT Project Developers. See the top-level LICENSE file for details .. # .. # SPDX-License-Identifier: (BSD-3-Clause) diff --git a/docs/tutorial/index.rst b/docs/tutorial/index.rst index d4e0e4c3a..c3c549fab 100644 --- a/docs/tutorial/index.rst +++ b/docs/tutorial/index.rst @@ -1,4 +1,4 @@ -.. # Copyright (c) 2017-2021, Lawrence Livermore National Security, LLC and +.. # Copyright (c) 2017-2022, Lawrence Livermore National Security, LLC and .. # other BLT Project Developers. See the top-level LICENSE file for details .. # .. # SPDX-License-Identifier: (BSD-3-Clause) diff --git a/docs/tutorial/object_libraries.rst b/docs/tutorial/object_libraries.rst index dd1bac9be..3da59bc1c 100644 --- a/docs/tutorial/object_libraries.rst +++ b/docs/tutorial/object_libraries.rst @@ -1,4 +1,4 @@ -.. # Copyright (c) 2017-2021, Lawrence Livermore National Security, LLC and +.. # Copyright (c) 2017-2022, Lawrence Livermore National Security, LLC and .. # other BLT Project Developers. See the top-level LICENSE file for details .. # .. # SPDX-License-Identifier: (BSD-3-Clause) diff --git a/docs/tutorial/portable_compiler_flags.rst b/docs/tutorial/portable_compiler_flags.rst index 0cfce2634..5ac671553 100644 --- a/docs/tutorial/portable_compiler_flags.rst +++ b/docs/tutorial/portable_compiler_flags.rst @@ -1,4 +1,4 @@ -.. # Copyright (c) 2017-2021, Lawrence Livermore National Security, LLC and +.. # Copyright (c) 2017-2022, Lawrence Livermore National Security, LLC and .. # other BLT Project Developers. See the top-level LICENSE file for details .. # .. # SPDX-License-Identifier: (BSD-3-Clause) diff --git a/docs/tutorial/recommendations.rst b/docs/tutorial/recommendations.rst index 7e49f58f8..2e0cf6e0e 100644 --- a/docs/tutorial/recommendations.rst +++ b/docs/tutorial/recommendations.rst @@ -1,4 +1,4 @@ -.. # Copyright (c) 2017-2021, Lawrence Livermore National Security, LLC and +.. # Copyright (c) 2017-2022, Lawrence Livermore National Security, LLC and .. # other BLT Project Developers. See the top-level LICENSE file for details .. # .. # SPDX-License-Identifier: (BSD-3-Clause) diff --git a/docs/tutorial/third_party_libraries.rst b/docs/tutorial/third_party_libraries.rst index 761087ffb..2d6a6b2d2 100644 --- a/docs/tutorial/third_party_libraries.rst +++ b/docs/tutorial/third_party_libraries.rst @@ -1,4 +1,4 @@ -.. # Copyright (c) 2017-2021, Lawrence Livermore National Security, LLC and +.. # Copyright (c) 2017-2022, Lawrence Livermore National Security, LLC and .. # other BLT Project Developers. See the top-level LICENSE file for details .. # .. # SPDX-License-Identifier: (BSD-3-Clause) diff --git a/host-configs/darwin/elcapitan-x86_64/naples-clang@7.3.0.cmake b/host-configs/darwin/elcapitan-x86_64/naples-clang@7.3.0.cmake index 61d07a4d1..8049cf7e0 100644 --- a/host-configs/darwin/elcapitan-x86_64/naples-clang@7.3.0.cmake +++ b/host-configs/darwin/elcapitan-x86_64/naples-clang@7.3.0.cmake @@ -1,4 +1,4 @@ -# Copyright (c) 2017-2021, Lawrence Livermore National Security, LLC and +# Copyright (c) 2017-2022, Lawrence Livermore National Security, LLC and # other BLT Project Developers. See the top-level LICENSE file for details # # SPDX-License-Identifier: (BSD-3-Clause) diff --git a/host-configs/llnl/blueos_3_ppc64le_ib_p9/clang@upstream_link_with_nvcc.cmake b/host-configs/llnl/blueos_3_ppc64le_ib_p9/clang@upstream_link_with_nvcc.cmake index 36c6634f6..86f5dc0f3 100644 --- a/host-configs/llnl/blueos_3_ppc64le_ib_p9/clang@upstream_link_with_nvcc.cmake +++ b/host-configs/llnl/blueos_3_ppc64le_ib_p9/clang@upstream_link_with_nvcc.cmake @@ -1,4 +1,4 @@ -# Copyright (c) 2017-2021, Lawrence Livermore National Security, LLC and +# Copyright (c) 2017-2022, Lawrence Livermore National Security, LLC and # other BLT Project Developers. See the top-level LICENSE file for details # # SPDX-License-Identifier: (BSD-3-Clause) diff --git a/host-configs/llnl/blueos_3_ppc64le_ib_p9/clang@upstream_nvcc_c++17.cmake b/host-configs/llnl/blueos_3_ppc64le_ib_p9/clang@upstream_nvcc_c++17.cmake index dd741836d..4627f67f8 100644 --- a/host-configs/llnl/blueos_3_ppc64le_ib_p9/clang@upstream_nvcc_c++17.cmake +++ b/host-configs/llnl/blueos_3_ppc64le_ib_p9/clang@upstream_nvcc_c++17.cmake @@ -1,4 +1,4 @@ -# Copyright (c) 2017-2021, Lawrence Livermore National Security, LLC and +# Copyright (c) 2017-2022, Lawrence Livermore National Security, LLC and # other BLT Project Developers. See the top-level LICENSE file for details # # SPDX-License-Identifier: (BSD-3-Clause) diff --git a/host-configs/llnl/blueos_3_ppc64le_ib_p9/clang@upstream_nvcc_c++17_no_separable.cmake b/host-configs/llnl/blueos_3_ppc64le_ib_p9/clang@upstream_nvcc_c++17_no_separable.cmake index 2907ac1a4..b8f52a254 100644 --- a/host-configs/llnl/blueos_3_ppc64le_ib_p9/clang@upstream_nvcc_c++17_no_separable.cmake +++ b/host-configs/llnl/blueos_3_ppc64le_ib_p9/clang@upstream_nvcc_c++17_no_separable.cmake @@ -1,4 +1,4 @@ -# Copyright (c) 2017-2021, Lawrence Livermore National Security, LLC and +# Copyright (c) 2017-2022, Lawrence Livermore National Security, LLC and # other BLT Project Developers. See the top-level LICENSE file for details # # SPDX-License-Identifier: (BSD-3-Clause) diff --git a/host-configs/llnl/blueos_3_ppc64le_ib_p9/clang@upstream_nvcc_xlf.cmake b/host-configs/llnl/blueos_3_ppc64le_ib_p9/clang@upstream_nvcc_xlf.cmake index a4c8806cc..55234cb47 100644 --- a/host-configs/llnl/blueos_3_ppc64le_ib_p9/clang@upstream_nvcc_xlf.cmake +++ b/host-configs/llnl/blueos_3_ppc64le_ib_p9/clang@upstream_nvcc_xlf.cmake @@ -1,4 +1,4 @@ -# Copyright (c) 2017-2021, Lawrence Livermore National Security, LLC and +# Copyright (c) 2017-2022, Lawrence Livermore National Security, LLC and # other BLT Project Developers. See the top-level LICENSE file for details # # SPDX-License-Identifier: (BSD-3-Clause) diff --git a/host-configs/llnl/blueos_3_ppc64le_ib_p9/pgi@20.4_nvcc.cmake b/host-configs/llnl/blueos_3_ppc64le_ib_p9/pgi@20.4_nvcc.cmake index 1e4d7b741..7820ecb0b 100644 --- a/host-configs/llnl/blueos_3_ppc64le_ib_p9/pgi@20.4_nvcc.cmake +++ b/host-configs/llnl/blueos_3_ppc64le_ib_p9/pgi@20.4_nvcc.cmake @@ -1,4 +1,4 @@ -# Copyright (c) 2017-2021, Lawrence Livermore National Security, LLC and +# Copyright (c) 2017-2022, Lawrence Livermore National Security, LLC and # other BLT Project Developers. See the top-level LICENSE file for details # # SPDX-License-Identifier: (BSD-3-Clause) diff --git a/host-configs/llnl/toss_3_x86_64_ib/clang@4.0.0-libcxx.cmake b/host-configs/llnl/toss_3_x86_64_ib/clang@4.0.0-libcxx.cmake index 0566d9298..51bac1a1a 100644 --- a/host-configs/llnl/toss_3_x86_64_ib/clang@4.0.0-libcxx.cmake +++ b/host-configs/llnl/toss_3_x86_64_ib/clang@4.0.0-libcxx.cmake @@ -1,4 +1,4 @@ -# Copyright (c) 2017-2021, Lawrence Livermore National Security, LLC and +# Copyright (c) 2017-2022, Lawrence Livermore National Security, LLC and # other BLT Project Developers. See the top-level LICENSE file for details # # SPDX-License-Identifier: (BSD-3-Clause) diff --git a/host-configs/llnl/toss_3_x86_64_ib/clang@6.0.0-static-analysis.cmake b/host-configs/llnl/toss_3_x86_64_ib/clang@6.0.0-static-analysis.cmake index 7f1556dfb..d0c2b48eb 100644 --- a/host-configs/llnl/toss_3_x86_64_ib/clang@6.0.0-static-analysis.cmake +++ b/host-configs/llnl/toss_3_x86_64_ib/clang@6.0.0-static-analysis.cmake @@ -1,4 +1,4 @@ -# Copyright (c) 2017-2021, Lawrence Livermore National Security, LLC and +# Copyright (c) 2017-2022, Lawrence Livermore National Security, LLC and # other BLT Project Developers. See the top-level LICENSE file for details # # SPDX-License-Identifier: (BSD-3-Clause) diff --git a/host-configs/llnl/toss_3_x86_64_ib/gcc@4.9.3_nvcc.cmake b/host-configs/llnl/toss_3_x86_64_ib/gcc@4.9.3_nvcc.cmake index b837b547e..c085fc10a 100644 --- a/host-configs/llnl/toss_3_x86_64_ib/gcc@4.9.3_nvcc.cmake +++ b/host-configs/llnl/toss_3_x86_64_ib/gcc@4.9.3_nvcc.cmake @@ -1,4 +1,4 @@ -# Copyright (c) 2017-2021, Lawrence Livermore National Security, LLC and +# Copyright (c) 2017-2022, Lawrence Livermore National Security, LLC and # other BLT Project Developers. See the top-level LICENSE file for details # # SPDX-License-Identifier: (BSD-3-Clause) diff --git a/host-configs/llnl/toss_3_x86_64_ib/gcc@8.3.1.cmake b/host-configs/llnl/toss_3_x86_64_ib/gcc@8.3.1.cmake index d83451926..06c8fbaca 100644 --- a/host-configs/llnl/toss_3_x86_64_ib/gcc@8.3.1.cmake +++ b/host-configs/llnl/toss_3_x86_64_ib/gcc@8.3.1.cmake @@ -1,4 +1,4 @@ -# Copyright (c) 2017-2021, Lawrence Livermore National Security, LLC and +# Copyright (c) 2017-2022, Lawrence Livermore National Security, LLC and # other BLT Project Developers. See the top-level LICENSE file for details # # SPDX-License-Identifier: (BSD-3-Clause) diff --git a/host-configs/llnl/toss_3_x86_64_ib/pgi@20.1.cmake b/host-configs/llnl/toss_3_x86_64_ib/pgi@20.1.cmake index 8b8ed6575..690df7b57 100644 --- a/host-configs/llnl/toss_3_x86_64_ib/pgi@20.1.cmake +++ b/host-configs/llnl/toss_3_x86_64_ib/pgi@20.1.cmake @@ -1,4 +1,4 @@ -# Copyright (c) 2017-2021, Lawrence Livermore National Security, LLC and +# Copyright (c) 2017-2022, Lawrence Livermore National Security, LLC and # other BLT Project Developers. See the top-level LICENSE file for details # # SPDX-License-Identifier: (BSD-3-Clause) diff --git a/host-configs/llnl/toss_4_x86_64_ib_cray/cce@12.0.1_clang_hip.cmake b/host-configs/llnl/toss_4_x86_64_ib_cray/cce@12.0.1_clang_hip.cmake index 283d7650f..1266694a1 100644 --- a/host-configs/llnl/toss_4_x86_64_ib_cray/cce@12.0.1_clang_hip.cmake +++ b/host-configs/llnl/toss_4_x86_64_ib_cray/cce@12.0.1_clang_hip.cmake @@ -1,4 +1,4 @@ -# Copyright (c) 2017-2021, Lawrence Livermore National Security, LLC and +# Copyright (c) 2017-2022, Lawrence Livermore National Security, LLC and # other BLT Project Developers. See the top-level LICENSE file for details # # SPDX-License-Identifier: (BSD-3-Clause) diff --git a/host-configs/llnl/windows/sqa-uno-msvc@15.cmake b/host-configs/llnl/windows/sqa-uno-msvc@15.cmake index 95c84018b..050502875 100644 --- a/host-configs/llnl/windows/sqa-uno-msvc@15.cmake +++ b/host-configs/llnl/windows/sqa-uno-msvc@15.cmake @@ -1,4 +1,4 @@ -# Copyright (c) 2017-2021, Lawrence Livermore National Security, LLC and +# Copyright (c) 2017-2022, Lawrence Livermore National Security, LLC and # other BLT Project Developers. See the top-level LICENSE file for details # # SPDX-License-Identifier: (BSD-3-Clause) diff --git a/host-configs/olcf/summit/gcc@6.4.0_nvcc.cmake b/host-configs/olcf/summit/gcc@6.4.0_nvcc.cmake index b31ede032..4892950c6 100644 --- a/host-configs/olcf/summit/gcc@6.4.0_nvcc.cmake +++ b/host-configs/olcf/summit/gcc@6.4.0_nvcc.cmake @@ -1,4 +1,4 @@ -# Copyright (c) 2017-2021, Lawrence Livermore National Security, LLC and +# Copyright (c) 2017-2022, Lawrence Livermore National Security, LLC and # other BLT Project Developers. See the top-level LICENSE file for details # # SPDX-License-Identifier: (BSD-3-Clause) diff --git a/host-configs/other/hcc.cmake b/host-configs/other/hcc.cmake index 8f3d08de3..c3e2f564d 100644 --- a/host-configs/other/hcc.cmake +++ b/host-configs/other/hcc.cmake @@ -1,4 +1,4 @@ -# Copyright (c) 2017-2021, Lawrence Livermore National Security, LLC and +# Copyright (c) 2017-2022, Lawrence Livermore National Security, LLC and # other BLT Project Developers. See the top-level LICENSE file for details # # SPDX-License-Identifier: (BSD-3-Clause) diff --git a/host-configs/other/hip.cmake b/host-configs/other/hip.cmake index b97dcaaa9..5e09b2eac 100644 --- a/host-configs/other/hip.cmake +++ b/host-configs/other/hip.cmake @@ -1,4 +1,4 @@ -# Copyright (c) 2017-2021, Lawrence Livermore National Security, LLC and +# Copyright (c) 2017-2022, Lawrence Livermore National Security, LLC and # other BLT Project Developers. See the top-level LICENSE file for details # # SPDX-License-Identifier: (BSD-3-Clause) diff --git a/tests/internal/CMakeLists.txt b/tests/internal/CMakeLists.txt index a837a5415..9c85b50a6 100644 --- a/tests/internal/CMakeLists.txt +++ b/tests/internal/CMakeLists.txt @@ -1,4 +1,4 @@ -# Copyright (c) 2017-2021, Lawrence Livermore National Security, LLC and +# Copyright (c) 2017-2022, Lawrence Livermore National Security, LLC and # other BLT Project Developers. See the top-level LICENSE file for details # # SPDX-License-Identifier: (BSD-3-Clause) diff --git a/tests/internal/src/Example.cpp b/tests/internal/src/Example.cpp index 380b3c1b2..d631e4c46 100644 --- a/tests/internal/src/Example.cpp +++ b/tests/internal/src/Example.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2021, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2022, Lawrence Livermore National Security, LLC and // other BLT Project Developers. See the top-level LICENSE file for details // // SPDX-License-Identifier: (BSD-3-Clause) diff --git a/tests/internal/src/Example.hpp b/tests/internal/src/Example.hpp index 6e7841c77..d6b305f8f 100644 --- a/tests/internal/src/Example.hpp +++ b/tests/internal/src/Example.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2021, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2022, Lawrence Livermore National Security, LLC and // other BLT Project Developers. See the top-level LICENSE file for details // // SPDX-License-Identifier: (BSD-3-Clause) diff --git a/tests/internal/src/Example_Exports.h b/tests/internal/src/Example_Exports.h index feb1a62fa..a0d900dfc 100644 --- a/tests/internal/src/Example_Exports.h +++ b/tests/internal/src/Example_Exports.h @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2021, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2022, Lawrence Livermore National Security, LLC and // other BLT Project Developers. See the top-level LICENSE file for details // // SPDX-License-Identifier: (BSD-3-Clause) diff --git a/tests/internal/src/HeaderOnly.hpp b/tests/internal/src/HeaderOnly.hpp index fa42fa1cb..951ee3443 100644 --- a/tests/internal/src/HeaderOnly.hpp +++ b/tests/internal/src/HeaderOnly.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2021, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2022, Lawrence Livermore National Security, LLC and // other BLT Project Developers. See the top-level LICENSE file for details // // SPDX-License-Identifier: (BSD-3-Clause) diff --git a/tests/internal/src/combine_static_library_test/CMakeLists.txt b/tests/internal/src/combine_static_library_test/CMakeLists.txt index 96faabbb5..f0e013a7d 100644 --- a/tests/internal/src/combine_static_library_test/CMakeLists.txt +++ b/tests/internal/src/combine_static_library_test/CMakeLists.txt @@ -1,4 +1,4 @@ -# Copyright (c) 2017-2021, Lawrence Livermore National Security, LLC and +# Copyright (c) 2017-2022, Lawrence Livermore National Security, LLC and # other BLT Project Developers. See the top-level LICENSE file for details # # SPDX-License-Identifier: (BSD-3-Clause) diff --git a/tests/internal/src/combine_static_library_test/Foo1.cpp b/tests/internal/src/combine_static_library_test/Foo1.cpp index 6bc0f3f58..4f7ad14c1 100644 --- a/tests/internal/src/combine_static_library_test/Foo1.cpp +++ b/tests/internal/src/combine_static_library_test/Foo1.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2021, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2022, Lawrence Livermore National Security, LLC and // other BLT Project Developers. See the top-level LICENSE file for details // // SPDX-License-Identifier: (BSD-3-Clause) diff --git a/tests/internal/src/combine_static_library_test/Foo1.hpp b/tests/internal/src/combine_static_library_test/Foo1.hpp index 439c733b5..8af1be68a 100644 --- a/tests/internal/src/combine_static_library_test/Foo1.hpp +++ b/tests/internal/src/combine_static_library_test/Foo1.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2021, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2022, Lawrence Livermore National Security, LLC and // other BLT Project Developers. See the top-level LICENSE file for details // // SPDX-License-Identifier: (BSD-3-Clause) diff --git a/tests/internal/src/combine_static_library_test/Foo2.cpp b/tests/internal/src/combine_static_library_test/Foo2.cpp index 9a8160408..7f72ce6ad 100644 --- a/tests/internal/src/combine_static_library_test/Foo2.cpp +++ b/tests/internal/src/combine_static_library_test/Foo2.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2021, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2022, Lawrence Livermore National Security, LLC and // other BLT Project Developers. See the top-level LICENSE file for details // // SPDX-License-Identifier: (BSD-3-Clause) diff --git a/tests/internal/src/combine_static_library_test/Foo2.hpp b/tests/internal/src/combine_static_library_test/Foo2.hpp index 984d71c80..a8fa9908e 100644 --- a/tests/internal/src/combine_static_library_test/Foo2.hpp +++ b/tests/internal/src/combine_static_library_test/Foo2.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2021, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2022, Lawrence Livermore National Security, LLC and // other BLT Project Developers. See the top-level LICENSE file for details // // SPDX-License-Identifier: (BSD-3-Clause) diff --git a/tests/internal/src/combine_static_library_test/Foo3.cpp b/tests/internal/src/combine_static_library_test/Foo3.cpp index ee5ba3be8..bfba96d0b 100644 --- a/tests/internal/src/combine_static_library_test/Foo3.cpp +++ b/tests/internal/src/combine_static_library_test/Foo3.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2021, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2022, Lawrence Livermore National Security, LLC and // other BLT Project Developers. See the top-level LICENSE file for details // // SPDX-License-Identifier: (BSD-3-Clause) diff --git a/tests/internal/src/combine_static_library_test/Foo3.hpp b/tests/internal/src/combine_static_library_test/Foo3.hpp index 9ebdd48fc..33538b7d2 100644 --- a/tests/internal/src/combine_static_library_test/Foo3.hpp +++ b/tests/internal/src/combine_static_library_test/Foo3.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2021, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2022, Lawrence Livermore National Security, LLC and // other BLT Project Developers. See the top-level LICENSE file for details // // SPDX-License-Identifier: (BSD-3-Clause) diff --git a/tests/internal/src/combine_static_library_test/blt_combine_static_libraries_shared_smoke.cpp b/tests/internal/src/combine_static_library_test/blt_combine_static_libraries_shared_smoke.cpp index 4d3d28c43..279b121a7 100644 --- a/tests/internal/src/combine_static_library_test/blt_combine_static_libraries_shared_smoke.cpp +++ b/tests/internal/src/combine_static_library_test/blt_combine_static_libraries_shared_smoke.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2021, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2022, Lawrence Livermore National Security, LLC and // other BLT Project Developers. See the top-level LICENSE file for details // // SPDX-License-Identifier: (BSD-3-Clause) diff --git a/tests/internal/src/combine_static_library_test/blt_combine_static_libraries_static_smoke.cpp b/tests/internal/src/combine_static_library_test/blt_combine_static_libraries_static_smoke.cpp index 4d3d28c43..279b121a7 100644 --- a/tests/internal/src/combine_static_library_test/blt_combine_static_libraries_static_smoke.cpp +++ b/tests/internal/src/combine_static_library_test/blt_combine_static_libraries_static_smoke.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2021, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2022, Lawrence Livermore National Security, LLC and // other BLT Project Developers. See the top-level LICENSE file for details // // SPDX-License-Identifier: (BSD-3-Clause) diff --git a/tests/internal/src/combine_static_library_test/main.cpp b/tests/internal/src/combine_static_library_test/main.cpp index 0e57cea15..8db985916 100644 --- a/tests/internal/src/combine_static_library_test/main.cpp +++ b/tests/internal/src/combine_static_library_test/main.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2021, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2022, Lawrence Livermore National Security, LLC and // other BLT Project Developers. See the top-level LICENSE file for details // // SPDX-License-Identifier: (BSD-3-Clause) diff --git a/tests/internal/src/hip_defines_test/CMakeLists.txt b/tests/internal/src/hip_defines_test/CMakeLists.txt index 9fa566986..b25a91cd9 100644 --- a/tests/internal/src/hip_defines_test/CMakeLists.txt +++ b/tests/internal/src/hip_defines_test/CMakeLists.txt @@ -1,4 +1,4 @@ -# Copyright (c) 2017-2021, Lawrence Livermore National Security, LLC and +# Copyright (c) 2017-2022, Lawrence Livermore National Security, LLC and # other BLT Project Developers. See the top-level LICENSE file for details # # SPDX-License-Identifier: (BSD-3-Clause) diff --git a/tests/internal/src/hip_defines_test/bar.cpp b/tests/internal/src/hip_defines_test/bar.cpp index 487b91ee3..f7ef18286 100644 --- a/tests/internal/src/hip_defines_test/bar.cpp +++ b/tests/internal/src/hip_defines_test/bar.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2021, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2022, Lawrence Livermore National Security, LLC and // other BLT Project Developers. See the top-level LICENSE file for details // // SPDX-License-Identifier: (BSD-3-Clause) diff --git a/tests/internal/src/hip_defines_test/foo.cpp b/tests/internal/src/hip_defines_test/foo.cpp index 6db75427c..9d78d7f5b 100644 --- a/tests/internal/src/hip_defines_test/foo.cpp +++ b/tests/internal/src/hip_defines_test/foo.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2021, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2022, Lawrence Livermore National Security, LLC and // other BLT Project Developers. See the top-level LICENSE file for details // // SPDX-License-Identifier: (BSD-3-Clause) diff --git a/tests/internal/src/object_library_test/CMakeLists.txt b/tests/internal/src/object_library_test/CMakeLists.txt index a8aa578fb..b5081e21e 100644 --- a/tests/internal/src/object_library_test/CMakeLists.txt +++ b/tests/internal/src/object_library_test/CMakeLists.txt @@ -1,4 +1,4 @@ -# Copyright (c) 2017-2021, Lawrence Livermore National Security, LLC and +# Copyright (c) 2017-2022, Lawrence Livermore National Security, LLC and # other BLT Project Developers. See the top-level LICENSE file for details # # SPDX-License-Identifier: (BSD-3-Clause) diff --git a/tests/internal/src/object_library_test/base_object.cpp b/tests/internal/src/object_library_test/base_object.cpp index bce52e83b..bce908145 100644 --- a/tests/internal/src/object_library_test/base_object.cpp +++ b/tests/internal/src/object_library_test/base_object.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2021, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2022, Lawrence Livermore National Security, LLC and // other BLT Project Developers. See the top-level LICENSE file for details // // SPDX-License-Identifier: (BSD-3-Clause) diff --git a/tests/internal/src/object_library_test/base_object.hpp b/tests/internal/src/object_library_test/base_object.hpp index e3d98d60c..86be1b836 100644 --- a/tests/internal/src/object_library_test/base_object.hpp +++ b/tests/internal/src/object_library_test/base_object.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2021, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2022, Lawrence Livermore National Security, LLC and // other BLT Project Developers. See the top-level LICENSE file for details // // SPDX-License-Identifier: (BSD-3-Clause) diff --git a/tests/internal/src/object_library_test/inherited_base/CMakeLists.txt b/tests/internal/src/object_library_test/inherited_base/CMakeLists.txt index e3b9aed82..198436563 100644 --- a/tests/internal/src/object_library_test/inherited_base/CMakeLists.txt +++ b/tests/internal/src/object_library_test/inherited_base/CMakeLists.txt @@ -1,4 +1,4 @@ -# Copyright (c) 2017-2021, Lawrence Livermore National Security, LLC and +# Copyright (c) 2017-2022, Lawrence Livermore National Security, LLC and # other BLT Project Developers. See the top-level LICENSE file for details # # SPDX-License-Identifier: (BSD-3-Clause) diff --git a/tests/internal/src/object_library_test/inherited_base/inherited_base.cpp b/tests/internal/src/object_library_test/inherited_base/inherited_base.cpp index 116c59cd5..01c19433d 100644 --- a/tests/internal/src/object_library_test/inherited_base/inherited_base.cpp +++ b/tests/internal/src/object_library_test/inherited_base/inherited_base.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2021, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2022, Lawrence Livermore National Security, LLC and // other BLT Project Developers. See the top-level LICENSE file for details // // SPDX-License-Identifier: (BSD-3-Clause) diff --git a/tests/internal/src/object_library_test/inherited_base/inherited_base.hpp b/tests/internal/src/object_library_test/inherited_base/inherited_base.hpp index cd0a06c51..bd47af43a 100644 --- a/tests/internal/src/object_library_test/inherited_base/inherited_base.hpp +++ b/tests/internal/src/object_library_test/inherited_base/inherited_base.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2021, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2022, Lawrence Livermore National Security, LLC and // other BLT Project Developers. See the top-level LICENSE file for details // // SPDX-License-Identifier: (BSD-3-Clause) diff --git a/tests/internal/src/object_library_test/main.cpp b/tests/internal/src/object_library_test/main.cpp index 3e27582a2..f116465a5 100644 --- a/tests/internal/src/object_library_test/main.cpp +++ b/tests/internal/src/object_library_test/main.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2021, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2022, Lawrence Livermore National Security, LLC and // other BLT Project Developers. See the top-level LICENSE file for details // // SPDX-License-Identifier: (BSD-3-Clause) diff --git a/tests/internal/src/object_library_test/object.cpp b/tests/internal/src/object_library_test/object.cpp index 76706da0c..6ffb0ead5 100644 --- a/tests/internal/src/object_library_test/object.cpp +++ b/tests/internal/src/object_library_test/object.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2021, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2022, Lawrence Livermore National Security, LLC and // other BLT Project Developers. See the top-level LICENSE file for details // // SPDX-License-Identifier: (BSD-3-Clause) diff --git a/tests/internal/src/object_library_test/object.hpp b/tests/internal/src/object_library_test/object.hpp index b7aefda2b..f78c672d4 100644 --- a/tests/internal/src/object_library_test/object.hpp +++ b/tests/internal/src/object_library_test/object.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2021, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2022, Lawrence Livermore National Security, LLC and // other BLT Project Developers. See the top-level LICENSE file for details // // SPDX-License-Identifier: (BSD-3-Clause) diff --git a/tests/internal/src/static_analysis/CMakeLists.txt b/tests/internal/src/static_analysis/CMakeLists.txt index 7addf9616..e287e1485 100644 --- a/tests/internal/src/static_analysis/CMakeLists.txt +++ b/tests/internal/src/static_analysis/CMakeLists.txt @@ -1,4 +1,4 @@ -# Copyright (c) 2017-2021, Lawrence Livermore National Security, LLC and +# Copyright (c) 2017-2022, Lawrence Livermore National Security, LLC and # other BLT Project Developers. See the top-level LICENSE file for details # # SPDX-License-Identifier: (BSD-3-Clause) diff --git a/tests/internal/src/static_analysis/subtle_error_source.cpp b/tests/internal/src/static_analysis/subtle_error_source.cpp index 4226cc473..35adeb336 100644 --- a/tests/internal/src/static_analysis/subtle_error_source.cpp +++ b/tests/internal/src/static_analysis/subtle_error_source.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2021, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2022, Lawrence Livermore National Security, LLC and // other BLT Project Developers. See the top-level LICENSE file for details // // SPDX-License-Identifier: (BSD-3-Clause) diff --git a/tests/internal/src/static_analysis/well_analyzed_source.cpp b/tests/internal/src/static_analysis/well_analyzed_source.cpp index 298b9c8c3..5fc9a4cb3 100644 --- a/tests/internal/src/static_analysis/well_analyzed_source.cpp +++ b/tests/internal/src/static_analysis/well_analyzed_source.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2021, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2022, Lawrence Livermore National Security, LLC and // other BLT Project Developers. See the top-level LICENSE file for details // // SPDX-License-Identifier: (BSD-3-Clause) diff --git a/tests/internal/src/t_example_compile_definitions.cpp b/tests/internal/src/t_example_compile_definitions.cpp index 8f0f6fd03..bad6794cd 100644 --- a/tests/internal/src/t_example_compile_definitions.cpp +++ b/tests/internal/src/t_example_compile_definitions.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2021, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2022, Lawrence Livermore National Security, LLC and // other BLT Project Developers. See the top-level LICENSE file for details // // SPDX-License-Identifier: (BSD-3-Clause) diff --git a/tests/internal/src/t_example_smoke.cpp b/tests/internal/src/t_example_smoke.cpp index a4c968646..c5800b916 100644 --- a/tests/internal/src/t_example_smoke.cpp +++ b/tests/internal/src/t_example_smoke.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2021, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2022, Lawrence Livermore National Security, LLC and // other BLT Project Developers. See the top-level LICENSE file for details // // SPDX-License-Identifier: (BSD-3-Clause) diff --git a/tests/internal/src/t_git_macros_smoke.cpp.in b/tests/internal/src/t_git_macros_smoke.cpp.in index 6612c79e5..270878056 100644 --- a/tests/internal/src/t_git_macros_smoke.cpp.in +++ b/tests/internal/src/t_git_macros_smoke.cpp.in @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2021, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2022, Lawrence Livermore National Security, LLC and // other BLT Project Developers. See the top-level LICENSE file for details // // SPDX-License-Identifier: (BSD-3-Clause) diff --git a/tests/internal/src/t_header_only_smoke.cpp b/tests/internal/src/t_header_only_smoke.cpp index 53cf39a23..797b0f69b 100644 --- a/tests/internal/src/t_header_only_smoke.cpp +++ b/tests/internal/src/t_header_only_smoke.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2021, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2022, Lawrence Livermore National Security, LLC and // other BLT Project Developers. See the top-level LICENSE file for details // // SPDX-License-Identifier: (BSD-3-Clause) diff --git a/tests/internal/src/test_cmake_format_conformant.cmake b/tests/internal/src/test_cmake_format_conformant.cmake index 64ae0b1a5..62178c321 100644 --- a/tests/internal/src/test_cmake_format_conformant.cmake +++ b/tests/internal/src/test_cmake_format_conformant.cmake @@ -1,4 +1,4 @@ -# Copyright (c) 2017-2021, Lawrence Livermore National Security, LLC and other +# Copyright (c) 2017-2022, Lawrence Livermore National Security, LLC and other # BLT Project Developers. See the top-level LICENSE file for details # # SPDX-License-Identifier: (BSD-3-Clause) diff --git a/tests/internal/src/test_cmake_format_nonconformant.cmake b/tests/internal/src/test_cmake_format_nonconformant.cmake index 29e86859c..bbb218476 100644 --- a/tests/internal/src/test_cmake_format_nonconformant.cmake +++ b/tests/internal/src/test_cmake_format_nonconformant.cmake @@ -1,4 +1,4 @@ -# Copyright (c) 2017-2021, Lawrence Livermore National Security, LLC and other +# Copyright (c) 2017-2022, Lawrence Livermore National Security, LLC and other # BLT Project Developers. See the top-level LICENSE file for details # # SPDX-License-Identifier: (BSD-3-Clause) diff --git a/tests/internal/src/test_cuda_device_call_from_kernel/CMakeLists.txt b/tests/internal/src/test_cuda_device_call_from_kernel/CMakeLists.txt index 5cd0867e6..059fbaf43 100644 --- a/tests/internal/src/test_cuda_device_call_from_kernel/CMakeLists.txt +++ b/tests/internal/src/test_cuda_device_call_from_kernel/CMakeLists.txt @@ -1,4 +1,4 @@ -# Copyright (c) 2017-2021, Lawrence Livermore National Security, LLC and +# Copyright (c) 2017-2022, Lawrence Livermore National Security, LLC and # other BLT Project Developers. See the top-level LICENSE file for details # # SPDX-License-Identifier: (BSD-3-Clause) diff --git a/tests/internal/src/test_cuda_device_call_from_kernel/Child.cpp b/tests/internal/src/test_cuda_device_call_from_kernel/Child.cpp index c81443afa..93a27d302 100644 --- a/tests/internal/src/test_cuda_device_call_from_kernel/Child.cpp +++ b/tests/internal/src/test_cuda_device_call_from_kernel/Child.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2021, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2022, Lawrence Livermore National Security, LLC and // other BLT Project Developers. See the top-level LICENSE file for details // // SPDX-License-Identifier: (BSD-3-Clause) diff --git a/tests/internal/src/test_cuda_device_call_from_kernel/Child.hpp b/tests/internal/src/test_cuda_device_call_from_kernel/Child.hpp index 00f66f1c4..16e33c2cf 100644 --- a/tests/internal/src/test_cuda_device_call_from_kernel/Child.hpp +++ b/tests/internal/src/test_cuda_device_call_from_kernel/Child.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2021, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2022, Lawrence Livermore National Security, LLC and // other BLT Project Developers. See the top-level LICENSE file for details // // SPDX-License-Identifier: (BSD-3-Clause) diff --git a/tests/internal/src/test_cuda_device_call_from_kernel/CudaTests.cpp b/tests/internal/src/test_cuda_device_call_from_kernel/CudaTests.cpp index 7680a2caf..11d43ac64 100644 --- a/tests/internal/src/test_cuda_device_call_from_kernel/CudaTests.cpp +++ b/tests/internal/src/test_cuda_device_call_from_kernel/CudaTests.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2021, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2022, Lawrence Livermore National Security, LLC and // other BLT Project Developers. See the top-level LICENSE file for details // // SPDX-License-Identifier: (BSD-3-Clause) diff --git a/tests/internal/src/test_cuda_device_call_from_kernel/Parent.cpp b/tests/internal/src/test_cuda_device_call_from_kernel/Parent.cpp index a58532e12..32826f13c 100644 --- a/tests/internal/src/test_cuda_device_call_from_kernel/Parent.cpp +++ b/tests/internal/src/test_cuda_device_call_from_kernel/Parent.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2021, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2022, Lawrence Livermore National Security, LLC and // other BLT Project Developers. See the top-level LICENSE file for details // // SPDX-License-Identifier: (BSD-3-Clause) diff --git a/tests/internal/src/test_cuda_device_call_from_kernel/Parent.hpp b/tests/internal/src/test_cuda_device_call_from_kernel/Parent.hpp index 64ffe23f0..74bff7aa9 100644 --- a/tests/internal/src/test_cuda_device_call_from_kernel/Parent.hpp +++ b/tests/internal/src/test_cuda_device_call_from_kernel/Parent.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2021, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2022, Lawrence Livermore National Security, LLC and // other BLT Project Developers. See the top-level LICENSE file for details // // SPDX-License-Identifier: (BSD-3-Clause) diff --git a/tests/internal/src/test_cuda_mpi.cpp b/tests/internal/src/test_cuda_mpi.cpp index 8e288afe8..a89b5b730 100644 --- a/tests/internal/src/test_cuda_mpi.cpp +++ b/tests/internal/src/test_cuda_mpi.cpp @@ -1,5 +1,5 @@ -// Copyright (c) 2017-2021, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2022, Lawrence Livermore National Security, LLC and // other BLT Project Developers. See the top-level LICENSE file for details // // SPDX-License-Identifier: (BSD-3-Clause) diff --git a/tests/smoke/CMakeLists.txt b/tests/smoke/CMakeLists.txt index b877cd01a..84c857368 100644 --- a/tests/smoke/CMakeLists.txt +++ b/tests/smoke/CMakeLists.txt @@ -1,4 +1,4 @@ -# Copyright (c) 2017-2021, Lawrence Livermore National Security, LLC and +# Copyright (c) 2017-2022, Lawrence Livermore National Security, LLC and # other BLT Project Developers. See the top-level LICENSE file for details # # SPDX-License-Identifier: (BSD-3-Clause) diff --git a/tests/smoke/blt_cuda_gtest_smoke.cpp b/tests/smoke/blt_cuda_gtest_smoke.cpp index 098108e5e..f37c36503 100644 --- a/tests/smoke/blt_cuda_gtest_smoke.cpp +++ b/tests/smoke/blt_cuda_gtest_smoke.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2021, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2022, Lawrence Livermore National Security, LLC and // other BLT Project Developers. See the top-level LICENSE file for details // // SPDX-License-Identifier: (BSD-3-Clause) diff --git a/tests/smoke/blt_cuda_mpi_smoke.cpp b/tests/smoke/blt_cuda_mpi_smoke.cpp index ccccb562e..c3aecd2d3 100644 --- a/tests/smoke/blt_cuda_mpi_smoke.cpp +++ b/tests/smoke/blt_cuda_mpi_smoke.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2021, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2022, Lawrence Livermore National Security, LLC and // other BLT Project Developers. See the top-level LICENSE file for details // // SPDX-License-Identifier: (BSD-3-Clause) diff --git a/tests/smoke/blt_cuda_openmp_smoke.cpp b/tests/smoke/blt_cuda_openmp_smoke.cpp index 2bfd5c2d5..0c6062e66 100644 --- a/tests/smoke/blt_cuda_openmp_smoke.cpp +++ b/tests/smoke/blt_cuda_openmp_smoke.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2021, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2022, Lawrence Livermore National Security, LLC and // other BLT Project Developers. See the top-level LICENSE file for details // // SPDX-License-Identifier: (BSD-3-Clause) diff --git a/tests/smoke/blt_cuda_runtime_smoke.cpp b/tests/smoke/blt_cuda_runtime_smoke.cpp index 9348594f4..dd66748d3 100644 --- a/tests/smoke/blt_cuda_runtime_smoke.cpp +++ b/tests/smoke/blt_cuda_runtime_smoke.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2021, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2022, Lawrence Livermore National Security, LLC and // other BLT Project Developers. See the top-level LICENSE file for details // // SPDX-License-Identifier: (BSD-3-Clause) diff --git a/tests/smoke/blt_cuda_smoke.cpp b/tests/smoke/blt_cuda_smoke.cpp index a3f21c88e..0adba8606 100644 --- a/tests/smoke/blt_cuda_smoke.cpp +++ b/tests/smoke/blt_cuda_smoke.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2021, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2022, Lawrence Livermore National Security, LLC and // other BLT Project Developers. See the top-level LICENSE file for details // // SPDX-License-Identifier: (BSD-3-Clause) diff --git a/tests/smoke/blt_cuda_version_smoke.cpp b/tests/smoke/blt_cuda_version_smoke.cpp index 97c43fa93..49caa8f56 100644 --- a/tests/smoke/blt_cuda_version_smoke.cpp +++ b/tests/smoke/blt_cuda_version_smoke.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2021, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2022, Lawrence Livermore National Security, LLC and // other BLT Project Developers. See the top-level LICENSE file for details // // SPDX-License-Identifier: (BSD-3-Clause) diff --git a/tests/smoke/blt_fruit_mpi_smoke.f90 b/tests/smoke/blt_fruit_mpi_smoke.f90 index 160596205..fc4603094 100644 --- a/tests/smoke/blt_fruit_mpi_smoke.f90 +++ b/tests/smoke/blt_fruit_mpi_smoke.f90 @@ -1,4 +1,4 @@ -! Copyright (c) 2017-2021, Lawrence Livermore National Security, LLC and +! Copyright (c) 2017-2022, Lawrence Livermore National Security, LLC and ! other BLT Project Developers. See the top-level LICENSE file for details ! ! SPDX-License-Identifier: (BSD-3-Clause) diff --git a/tests/smoke/blt_fruit_smoke.f90 b/tests/smoke/blt_fruit_smoke.f90 index 88dad321d..63f0693d2 100644 --- a/tests/smoke/blt_fruit_smoke.f90 +++ b/tests/smoke/blt_fruit_smoke.f90 @@ -1,4 +1,4 @@ -! Copyright (c) 2017-2021, Lawrence Livermore National Security, LLC and +! Copyright (c) 2017-2022, Lawrence Livermore National Security, LLC and ! other BLT Project Developers. See the top-level LICENSE file for details ! ! SPDX-License-Identifier: (BSD-3-Clause) diff --git a/tests/smoke/blt_gbenchmark_smoke.cpp b/tests/smoke/blt_gbenchmark_smoke.cpp index bbc0176a9..a2831c01c 100644 --- a/tests/smoke/blt_gbenchmark_smoke.cpp +++ b/tests/smoke/blt_gbenchmark_smoke.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2021, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2022, Lawrence Livermore National Security, LLC and // other BLT Project Developers. See the top-level LICENSE file for details // // SPDX-License-Identifier: (BSD-3-Clause) diff --git a/tests/smoke/blt_gmock_smoke.cpp b/tests/smoke/blt_gmock_smoke.cpp index d565a1949..99453a0cb 100644 --- a/tests/smoke/blt_gmock_smoke.cpp +++ b/tests/smoke/blt_gmock_smoke.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2021, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2022, Lawrence Livermore National Security, LLC and // other BLT Project Developers. See the top-level LICENSE file for details // // SPDX-License-Identifier: (BSD-3-Clause) diff --git a/tests/smoke/blt_gtest_smoke.cpp b/tests/smoke/blt_gtest_smoke.cpp index 4511d059a..7b8d53667 100644 --- a/tests/smoke/blt_gtest_smoke.cpp +++ b/tests/smoke/blt_gtest_smoke.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2021, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2022, Lawrence Livermore National Security, LLC and // other BLT Project Developers. See the top-level LICENSE file for details // // SPDX-License-Identifier: (BSD-3-Clause) diff --git a/tests/smoke/blt_hcc_runtime_smoke.cpp b/tests/smoke/blt_hcc_runtime_smoke.cpp index b152acea8..f9eea6e1f 100644 --- a/tests/smoke/blt_hcc_runtime_smoke.cpp +++ b/tests/smoke/blt_hcc_runtime_smoke.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2021, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2022, Lawrence Livermore National Security, LLC and // other BLT Project Developers. See the top-level LICENSE file for details // // SPDX-License-Identifier: (BSD-3-Clause) diff --git a/tests/smoke/blt_hcc_smoke.cpp b/tests/smoke/blt_hcc_smoke.cpp index 55bd6abd9..fdae9d013 100644 --- a/tests/smoke/blt_hcc_smoke.cpp +++ b/tests/smoke/blt_hcc_smoke.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2021, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2022, Lawrence Livermore National Security, LLC and // other BLT Project Developers. See the top-level LICENSE file for details // // SPDX-License-Identifier: (BSD-3-Clause) diff --git a/tests/smoke/blt_hip_gtest_smoke.cpp b/tests/smoke/blt_hip_gtest_smoke.cpp index 018935643..d8ccb0435 100644 --- a/tests/smoke/blt_hip_gtest_smoke.cpp +++ b/tests/smoke/blt_hip_gtest_smoke.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2021, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2022, Lawrence Livermore National Security, LLC and // other BLT Project Developers. See the top-level LICENSE file for details // // SPDX-License-Identifier: (BSD-3-Clause) diff --git a/tests/smoke/blt_hip_runtime_smoke.cpp b/tests/smoke/blt_hip_runtime_smoke.cpp index 09af2915f..65a1e771a 100644 --- a/tests/smoke/blt_hip_runtime_smoke.cpp +++ b/tests/smoke/blt_hip_runtime_smoke.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2021, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2022, Lawrence Livermore National Security, LLC and // other BLT Project Developers. See the top-level LICENSE file for details // // SPDX-License-Identifier: (BSD-3-Clause) diff --git a/tests/smoke/blt_hip_smoke.cpp b/tests/smoke/blt_hip_smoke.cpp index 7138476ed..3a0cd7f2c 100644 --- a/tests/smoke/blt_hip_smoke.cpp +++ b/tests/smoke/blt_hip_smoke.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2021, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2022, Lawrence Livermore National Security, LLC and // other BLT Project Developers. See the top-level LICENSE file for details // // SPDX-License-Identifier: (BSD-3-Clause) diff --git a/tests/smoke/blt_mpi_smoke.cpp b/tests/smoke/blt_mpi_smoke.cpp index 79fa2389c..230a79351 100644 --- a/tests/smoke/blt_mpi_smoke.cpp +++ b/tests/smoke/blt_mpi_smoke.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2021, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2022, Lawrence Livermore National Security, LLC and // other BLT Project Developers. See the top-level LICENSE file for details // // SPDX-License-Identifier: (BSD-3-Clause) diff --git a/tests/smoke/blt_openmp_smoke.cpp b/tests/smoke/blt_openmp_smoke.cpp index cd3743853..e2d7ebfae 100644 --- a/tests/smoke/blt_openmp_smoke.cpp +++ b/tests/smoke/blt_openmp_smoke.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2021, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2022, Lawrence Livermore National Security, LLC and // other BLT Project Developers. See the top-level LICENSE file for details // // SPDX-License-Identifier: (BSD-3-Clause) diff --git a/tests/smoke/fortran_driver.cpp b/tests/smoke/fortran_driver.cpp index c2c015738..48b842784 100644 --- a/tests/smoke/fortran_driver.cpp +++ b/tests/smoke/fortran_driver.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2021, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2022, Lawrence Livermore National Security, LLC and // other BLT Project Developers. See the top-level LICENSE file for details // // SPDX-License-Identifier: (BSD-3-Clause) diff --git a/tests/smoke/fortran_mpi_driver.cpp b/tests/smoke/fortran_mpi_driver.cpp index d327d072e..a9b60fcf6 100644 --- a/tests/smoke/fortran_mpi_driver.cpp +++ b/tests/smoke/fortran_mpi_driver.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2021, Lawrence Livermore National Security, LLC and +// Copyright (c) 2017-2022, Lawrence Livermore National Security, LLC and // other BLT Project Developers. See the top-level LICENSE file for details // // SPDX-License-Identifier: (BSD-3-Clause) diff --git a/thirdparty_builtin/CMakeLists.txt b/thirdparty_builtin/CMakeLists.txt index 5fbb9b79a..54aa5b3df 100644 --- a/thirdparty_builtin/CMakeLists.txt +++ b/thirdparty_builtin/CMakeLists.txt @@ -1,4 +1,4 @@ -# Copyright (c) 2017-2021, Lawrence Livermore National Security, LLC and +# Copyright (c) 2017-2022, Lawrence Livermore National Security, LLC and # other BLT Project Developers. See the top-level LICENSE file for details # # SPDX-License-Identifier: (BSD-3-Clause) From 033941d15417c36d897dc7875f98109ddf045e86 Mon Sep 17 00:00:00 2001 From: Brian Han Date: Wed, 12 Jan 2022 16:27:53 -0800 Subject: [PATCH 55/76] Missing bracket --- cmake/thirdparty/SetupHIP.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmake/thirdparty/SetupHIP.cmake b/cmake/thirdparty/SetupHIP.cmake index b41ee7b39..595f5ec3d 100644 --- a/cmake/thirdparty/SetupHIP.cmake +++ b/cmake/thirdparty/SetupHIP.cmake @@ -11,7 +11,7 @@ ################################ find_package(hip REQUIRED) -message(STATUS "HIP version: ${hip_VERSION") +message(STATUS "HIP version: ${hip_VERSION}") message(STATUS "HIP platform: ${HIP_PLATFORM}") if (NOT ROCM_PATH) From d4b28eedcfa96e6055c9832747d8211d6d9279e9 Mon Sep 17 00:00:00 2001 From: Marty McFadden Date: Thu, 20 Jan 2022 11:12:21 -0800 Subject: [PATCH 56/76] Ensure HIP targets are globally visible --- cmake/thirdparty/SetupHIP.cmake | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/cmake/thirdparty/SetupHIP.cmake b/cmake/thirdparty/SetupHIP.cmake index 595f5ec3d..0035ab37b 100644 --- a/cmake/thirdparty/SetupHIP.cmake +++ b/cmake/thirdparty/SetupHIP.cmake @@ -52,7 +52,8 @@ endif() blt_import_library(NAME blt_hip COMPILE_FLAGS "--rocm-path=${ROCM_PATH}" - EXPORTABLE ${BLT_EXPORT_THIRDPARTY}) + EXPORTABLE ${BLT_EXPORT_THIRDPARTY} + GLOBAL On) # Hard-copy inheritable properties instead of depending on hip::device so that we can export all required # information in our target blt_hip @@ -63,7 +64,8 @@ add_library(blt::hip ALIAS blt_hip) blt_import_library(NAME blt_hip_runtime INCLUDES ${HIP_INCLUDE_DIRS} TREAT_INCLUDES_AS_SYSTEM ON - EXPORTABLE ${BLT_EXPORT_THIRDPARTY}) + EXPORTABLE ${BLT_EXPORT_THIRDPARTY} + GLOBAL On) blt_inherit_target_info(TO blt_hip_runtime FROM hip::host OBJECT FALSE) From 0c7faddc1c77c3f854ec2443c8bac3ab937b23fb Mon Sep 17 00:00:00 2001 From: Marty McFadden Date: Thu, 20 Jan 2022 11:56:56 -0800 Subject: [PATCH 57/76] Update cmake/thirdparty/SetupHIP.cmake Co-authored-by: Chris White --- cmake/thirdparty/SetupHIP.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmake/thirdparty/SetupHIP.cmake b/cmake/thirdparty/SetupHIP.cmake index 0035ab37b..ebb3e2761 100644 --- a/cmake/thirdparty/SetupHIP.cmake +++ b/cmake/thirdparty/SetupHIP.cmake @@ -53,7 +53,7 @@ endif() blt_import_library(NAME blt_hip COMPILE_FLAGS "--rocm-path=${ROCM_PATH}" EXPORTABLE ${BLT_EXPORT_THIRDPARTY} - GLOBAL On) + GLOBAL ON) # Hard-copy inheritable properties instead of depending on hip::device so that we can export all required # information in our target blt_hip From 27cfbf7a17bc3f5b84b474ccc819685560a28a1a Mon Sep 17 00:00:00 2001 From: Marty McFadden Date: Thu, 20 Jan 2022 11:57:05 -0800 Subject: [PATCH 58/76] Update cmake/thirdparty/SetupHIP.cmake Co-authored-by: Chris White --- cmake/thirdparty/SetupHIP.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmake/thirdparty/SetupHIP.cmake b/cmake/thirdparty/SetupHIP.cmake index ebb3e2761..e3971c743 100644 --- a/cmake/thirdparty/SetupHIP.cmake +++ b/cmake/thirdparty/SetupHIP.cmake @@ -65,7 +65,7 @@ blt_import_library(NAME blt_hip_runtime INCLUDES ${HIP_INCLUDE_DIRS} TREAT_INCLUDES_AS_SYSTEM ON EXPORTABLE ${BLT_EXPORT_THIRDPARTY} - GLOBAL On) + GLOBAL ON) blt_inherit_target_info(TO blt_hip_runtime FROM hip::host OBJECT FALSE) From 7e45eb61a827833a63e2118c5f4c5c7adc215d0c Mon Sep 17 00:00:00 2001 From: David Beckingsale Date: Thu, 20 Jan 2022 13:25:17 -0800 Subject: [PATCH 59/76] Add initial blt_export_tpl_targets macro --- cmake/BLTMacros.cmake | 39 +++++++++++++++++++++++++++++ docs/api/target.rst | 22 ++++++++++++++++ docs/tutorial/exporting_targets.rst | 21 ++++------------ tests/internal/CMakeLists.txt | 21 ++++++++++++++++ 4 files changed, 87 insertions(+), 16 deletions(-) diff --git a/cmake/BLTMacros.cmake b/cmake/BLTMacros.cmake index 6129af79f..35077c8bc 100644 --- a/cmake/BLTMacros.cmake +++ b/cmake/BLTMacros.cmake @@ -1363,3 +1363,42 @@ macro(blt_print_target_properties) unset(_is_blt_registered_target) unset(_is_cmake_target) endmacro(blt_print_target_properties) + +##------------------------------------------------------------------------------ +## blt_export_tpl_targets(EXPORT NAMESPACE ) +## +## Add targets for BLT's third-party libraries to the given export-set, prefixed +## with the provided namespace. +##------------------------------------------------------------------------------ +macro(blt_export_tpl_targets) + set(options) + set(singleValuedArgs NAMESPACE EXPORT) + set(multiValuedArgs) + + ## parse the arguments to the macro + cmake_parse_arguments(arg + "${options}" "${singleValuedArgs}" "${multiValuedArgs}" ${ARGN}) + + if(NOT DEFINED arg_EXPORT) + message(FATAL_ERROR "EXPORT is a required parameter for the blt_export_tpl_targets macro.") + endif() + + set(_blt_tpl_targets) + blt_list_append(TO _blt_tpl_targets ELEMENTS cuda cuda_runtime IF ENABLE_CUDA) + blt_list_append(TO _blt_tpl_targets ELEMENTS blt_hip blt_hip_runtime IF ENABLE_HIP) + blt_list_append(TO _blt_tpl_targets ELEMENTS openmp IF ENABLE_OPENMP) + blt_list_append(TO _blt_tpl_targets ELEMENTS mpi IF ENABLE_MPI) + + foreach(dep ${_blt_tpl_targets}) + # If the target is EXPORTABLE, add it to the export set + get_target_property(_is_imported ${dep} IMPORTED) + if(NOT ${_is_imported}) + install(TARGETS ${dep} + EXPORT ${arg_EXPORT}) + # Namespace target to avoid conflicts + if (DEFINED arg_NAMESPACE) + set_target_properties(${dep} PROPERTIES EXPORT_NAME ${arg_NAMESPACE}::${dep}) + endif () + endif() + endforeach() +endmacro() \ No newline at end of file diff --git a/docs/api/target.rst b/docs/api/target.rst index 8acc34556..57d43643b 100644 --- a/docs/api/target.rst +++ b/docs/api/target.rst @@ -514,3 +514,25 @@ Internally created variables (NAME = "foo"): | _BLT_FOO_DEFINES Internal variable names are prefixed with ``_`` to avoid collision with input parameters. + +.. _blt_export_tpl_targets: + +blt_export_tpl_targets +~~~~~~~~~~~~~~~~~~~~ + +.. code-block:: cmake + + blt_export_tpl_targets(EXPORT + [NAMESPACE ]) + +Install BLT-provided third-party library targets to the given export set. + +This macro will add all the enabled third-party library targets (e.g. cuda, +blt::hip, mpi, etc.) to the given export set, with the optional namespace. This +allows downstream projects to import and use any targets that depend on BLT +targets, without the downstream project itself requiring the use of BLT. + +.. note:: + It is highly recommended that the NAMESPACE argument is used to ensure that + the targets are given a unique prefix that will reduce the chance of + conflicts. diff --git a/docs/tutorial/exporting_targets.rst b/docs/tutorial/exporting_targets.rst index 9a86c16f2..d03c358c4 100644 --- a/docs/tutorial/exporting_targets.rst +++ b/docs/tutorial/exporting_targets.rst @@ -59,31 +59,20 @@ Typical usage of the ``BLT_EXPORT_THIRDPARTY`` option is as follows: # Add the example_1 target to the example-targets export set install(TARGETS example_1 EXPORT example-targets) - # Add the MPI target to the same export set - this is required + # Add BLT's targets to the same export set - this is required # because the mpi target was marked exportable - install(TARGETS mpi EXPORT example-targets) + blt_export_tpl_targets(EXPORT example-targets) -To avoid collisions with projects that import "example-targets", there are -two options for adjusting the exported name of the ``mpi`` target. +To avoid collisions with projects that import "example-targets", we can provide +a namespace for the ``mpi`` target. The first is to rename only the ``mpi`` target's exported name: .. code-block:: cmake - set_target_properties(mpi PROPERTIES EXPORT_NAME example::mpi) - install(EXPORT example-targets) + blt_export_tpl_targets(EXPORT example-targets NAMESPACE example) With this approach the ``example_1`` target's exported name is unchanged - a project that imports the ``example-targets`` export set will have ``example_1`` and ``example::mpi`` targets made available. The imported ``example_1`` will depend on ``example::mpi``. - -Another approach is to install all targets in the export set behind a namespace: - -.. code-block:: cmake - - install(EXPORT example-targets NAMESPACE example::) - -With this approach all targets in the export set are prefixed, so an importing -project will have ``example::example_1`` and ``example::mpi`` targets made available. -The imported ``example::example_1`` will depend on ``example::mpi``. diff --git a/tests/internal/CMakeLists.txt b/tests/internal/CMakeLists.txt index 9c85b50a6..e69e0792b 100644 --- a/tests/internal/CMakeLists.txt +++ b/tests/internal/CMakeLists.txt @@ -414,5 +414,26 @@ else() COMMAND tests/return_true) endif() +# create example depending on all available TPLs to test export +set(_example_tpl_depends) +blt_list_append(TO _example_tpl_depends ELEMENTS cuda cuda_runtime IF ENABLE_CUDA) +blt_list_append(TO _example_tpl_depends ELEMENTS blt_hip blt_hip_runtime IF ENABLE_HIP) +blt_list_append(TO _example_tpl_depends ELEMENTS openmp IF ENABLE_OPENMP) +blt_list_append(TO _example_tpl_depends ELEMENTS mpi IF ENABLE_MPI) + +blt_add_library( NAME example-with-tpls + SOURCES "src/Example.cpp" + HEADERS "src/Example.hpp" + DEPENDS_ON ${_example_tpl_depends} + ) + +install(TARGETS example-with-tpls EXPORT blt-exports ARCHIVE DESTINATION lib) + +# test blt_export_tpl_targets macro +blt_export_tpl_targets(NAMESPACE blt + EXPORT blt-exports) + +install(EXPORT blt-exports DESTINATION lib/cmake/blt) + # Add tutorials add_subdirectory(../../docs/tutorial/calc_pi calc_pi) From c36fc852c64ebbafd74748472aa151edcdd3bf01 Mon Sep 17 00:00:00 2001 From: David Beckingsale Date: Thu, 20 Jan 2022 13:26:31 -0800 Subject: [PATCH 60/76] Add newline --- cmake/BLTMacros.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmake/BLTMacros.cmake b/cmake/BLTMacros.cmake index 35077c8bc..722e3e439 100644 --- a/cmake/BLTMacros.cmake +++ b/cmake/BLTMacros.cmake @@ -1401,4 +1401,4 @@ macro(blt_export_tpl_targets) endif () endif() endforeach() -endmacro() \ No newline at end of file +endmacro() From ccfc648cc1a4824465f3d70b1711b65ada8b1088 Mon Sep 17 00:00:00 2001 From: David Beckingsale Date: Thu, 20 Jan 2022 13:28:49 -0800 Subject: [PATCH 61/76] Update docs/api/target.rst Co-authored-by: Chris White --- docs/api/target.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/api/target.rst b/docs/api/target.rst index 57d43643b..cb4d57ee6 100644 --- a/docs/api/target.rst +++ b/docs/api/target.rst @@ -527,8 +527,8 @@ blt_export_tpl_targets Install BLT-provided third-party library targets to the given export set. -This macro will add all the enabled third-party library targets (e.g. cuda, -blt::hip, mpi, etc.) to the given export set, with the optional namespace. This +This macro will add all the enabled third-party library targets (e.g. ``cuda``, +``blt::hip``, ``mpi``, etc.) to the given export set, with the optional namespace. This allows downstream projects to import and use any targets that depend on BLT targets, without the downstream project itself requiring the use of BLT. From ef994f8bfc55887240df9f20b1e252b5680d0ad5 Mon Sep 17 00:00:00 2001 From: David Beckingsale Date: Thu, 20 Jan 2022 13:35:38 -0800 Subject: [PATCH 62/76] Fixup docs --- docs/tutorial/exporting_targets.rst | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/docs/tutorial/exporting_targets.rst b/docs/tutorial/exporting_targets.rst index d03c358c4..72cd5b71d 100644 --- a/docs/tutorial/exporting_targets.rst +++ b/docs/tutorial/exporting_targets.rst @@ -64,9 +64,7 @@ Typical usage of the ``BLT_EXPORT_THIRDPARTY`` option is as follows: blt_export_tpl_targets(EXPORT example-targets) To avoid collisions with projects that import "example-targets", we can provide -a namespace for the ``mpi`` target. - -The first is to rename only the ``mpi`` target's exported name: +a namespace for the ``mpi`` target: .. code-block:: cmake From a6d268d092296371a0b9c80eea889eb2de5ac486 Mon Sep 17 00:00:00 2001 From: David Beckingsale Date: Thu, 20 Jan 2022 16:01:27 -0800 Subject: [PATCH 63/76] Explicitly add ROCM_PATH to CMAKE_PREFIX_PATH --- cmake/thirdparty/SetupHIP.cmake | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/cmake/thirdparty/SetupHIP.cmake b/cmake/thirdparty/SetupHIP.cmake index e3971c743..9c1439906 100644 --- a/cmake/thirdparty/SetupHIP.cmake +++ b/cmake/thirdparty/SetupHIP.cmake @@ -9,21 +9,28 @@ ################################ # HIP ################################ -find_package(hip REQUIRED) - -message(STATUS "HIP version: ${hip_VERSION}") -message(STATUS "HIP platform: ${HIP_PLATFORM}") if (NOT ROCM_PATH) find_path(ROCM_PATH hip ENV{ROCM_DIR} ENV{ROCM_PATH} + ENV{HIP_PATH} + ${HIP_PATH}/.. ${HIP_ROOT_DIR}/../ ${ROCM_ROOT_DIR} /opt/rocm) endif() +# Update CMAKE_PREFIX_PATH to make sure all the configs that hip depends on are +# found. +set(CMAKE_PREFIX_PATH "${CMAKE_PREFIX_PATH};${ROCM_PATH}") + +find_package(hip REQUIRED CONFIG PATHS ${HIP_PATH} ${ROCM_PATH}) + +message(STATUS "HIP version: ${hip_VERSION}") +message(STATUS "HIP platform: ${HIP_PLATFORM}") + # AMDGPU_TARGETS should be defined in the hip-config.cmake that gets "included" via find_package(hip) # This file is also what hardcodes the --offload-arch flags we're removing here if(DEFINED AMDGPU_TARGETS) From 3cc4132e52a229e0f6c217b3ad42dc24b18faecd Mon Sep 17 00:00:00 2001 From: David Beckingsale Date: Thu, 20 Jan 2022 16:18:42 -0800 Subject: [PATCH 64/76] Update cmake/thirdparty/SetupHIP.cmake Co-authored-by: Chris White --- cmake/thirdparty/SetupHIP.cmake | 1 + 1 file changed, 1 insertion(+) diff --git a/cmake/thirdparty/SetupHIP.cmake b/cmake/thirdparty/SetupHIP.cmake index 9c1439906..ff406c8a9 100644 --- a/cmake/thirdparty/SetupHIP.cmake +++ b/cmake/thirdparty/SetupHIP.cmake @@ -28,6 +28,7 @@ set(CMAKE_PREFIX_PATH "${CMAKE_PREFIX_PATH};${ROCM_PATH}") find_package(hip REQUIRED CONFIG PATHS ${HIP_PATH} ${ROCM_PATH}) +message(STATUS "ROCM path: ${ROCM_PATH}") message(STATUS "HIP version: ${hip_VERSION}") message(STATUS "HIP platform: ${HIP_PLATFORM}") From 6b8c86e6ae87f2b6fdbdf2b8ab6451d78fd83dad Mon Sep 17 00:00:00 2001 From: David Beckingsale Date: Thu, 20 Jan 2022 17:33:16 -0800 Subject: [PATCH 65/76] Update docs/api/target.rst Co-authored-by: Chris White --- docs/api/target.rst | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/docs/api/target.rst b/docs/api/target.rst index cb4d57ee6..a0b15eca3 100644 --- a/docs/api/target.rst +++ b/docs/api/target.rst @@ -527,6 +527,12 @@ blt_export_tpl_targets Install BLT-provided third-party library targets to the given export set. +EXPORT + CMake export set the targets are being added to + +NAMESPACE + Namespace prefix for each exported target + This macro will add all the enabled third-party library targets (e.g. ``cuda``, ``blt::hip``, ``mpi``, etc.) to the given export set, with the optional namespace. This allows downstream projects to import and use any targets that depend on BLT From a98cf068944791fe5e3c7f751d22166106dc38d0 Mon Sep 17 00:00:00 2001 From: David Beckingsale Date: Thu, 20 Jan 2022 17:36:00 -0800 Subject: [PATCH 66/76] Only set GLOBAL when allowed --- cmake/thirdparty/SetupHIP.cmake | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/cmake/thirdparty/SetupHIP.cmake b/cmake/thirdparty/SetupHIP.cmake index 9c1439906..c87255b9e 100644 --- a/cmake/thirdparty/SetupHIP.cmake +++ b/cmake/thirdparty/SetupHIP.cmake @@ -57,10 +57,12 @@ if(DEFINED AMDGPU_TARGETS) endif() endif() +set(_blt_hip_is_global NOT ${BLT_EXPORT_THIRDPARTY}) + blt_import_library(NAME blt_hip COMPILE_FLAGS "--rocm-path=${ROCM_PATH}" EXPORTABLE ${BLT_EXPORT_THIRDPARTY} - GLOBAL ON) + GLOBAL ${_blt_hip_is_global}) # Hard-copy inheritable properties instead of depending on hip::device so that we can export all required # information in our target blt_hip @@ -72,7 +74,7 @@ blt_import_library(NAME blt_hip_runtime INCLUDES ${HIP_INCLUDE_DIRS} TREAT_INCLUDES_AS_SYSTEM ON EXPORTABLE ${BLT_EXPORT_THIRDPARTY} - GLOBAL ON) + GLOBAL ${_blt_hip_is_global}) blt_inherit_target_info(TO blt_hip_runtime FROM hip::host OBJECT FALSE) From 2171f6ca055b0b4f6e0deeff32fcfa666da72ae4 Mon Sep 17 00:00:00 2001 From: David Beckingsale Date: Thu, 20 Jan 2022 17:36:42 -0800 Subject: [PATCH 67/76] Tidy up file --- cmake/thirdparty/SetupHIP.cmake | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/cmake/thirdparty/SetupHIP.cmake b/cmake/thirdparty/SetupHIP.cmake index 8e164d717..21b223151 100644 --- a/cmake/thirdparty/SetupHIP.cmake +++ b/cmake/thirdparty/SetupHIP.cmake @@ -28,9 +28,8 @@ set(CMAKE_PREFIX_PATH "${CMAKE_PREFIX_PATH};${ROCM_PATH}") find_package(hip REQUIRED CONFIG PATHS ${HIP_PATH} ${ROCM_PATH}) -message(STATUS "ROCM path: ${ROCM_PATH}") +message(STATUS "ROCM path: ${ROCM_PATH}") message(STATUS "HIP version: ${hip_VERSION}") -message(STATUS "HIP platform: ${HIP_PLATFORM}") # AMDGPU_TARGETS should be defined in the hip-config.cmake that gets "included" via find_package(hip) # This file is also what hardcodes the --offload-arch flags we're removing here From e5e3bba954e98311fd1c0ede4f53f0335bfa0157 Mon Sep 17 00:00:00 2001 From: David Beckingsale Date: Fri, 21 Jan 2022 07:41:51 -0800 Subject: [PATCH 68/76] Fix GLOBAL option --- cmake/thirdparty/SetupHIP.cmake | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/cmake/thirdparty/SetupHIP.cmake b/cmake/thirdparty/SetupHIP.cmake index 21b223151..6261febf1 100644 --- a/cmake/thirdparty/SetupHIP.cmake +++ b/cmake/thirdparty/SetupHIP.cmake @@ -57,7 +57,11 @@ if(DEFINED AMDGPU_TARGETS) endif() endif() -set(_blt_hip_is_global NOT ${BLT_EXPORT_THIRDPARTY}) +# hip targets must be global for aliases when created as imported targets +set(_blt_hip_is_global On) +if (${BLT_EXPORT_THIRDPARTY}) + set(_blt_hip_is_global Off) +endif () blt_import_library(NAME blt_hip COMPILE_FLAGS "--rocm-path=${ROCM_PATH}" From cd98fd98bdf0c1eed6db19eec63626e776edd9a9 Mon Sep 17 00:00:00 2001 From: David Beckingsale Date: Fri, 21 Jan 2022 07:42:36 -0800 Subject: [PATCH 69/76] Update docs/tutorial/exporting_targets.rst Co-authored-by: Chris White --- docs/tutorial/exporting_targets.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/tutorial/exporting_targets.rst b/docs/tutorial/exporting_targets.rst index 72cd5b71d..2d84caad9 100644 --- a/docs/tutorial/exporting_targets.rst +++ b/docs/tutorial/exporting_targets.rst @@ -63,7 +63,7 @@ Typical usage of the ``BLT_EXPORT_THIRDPARTY`` option is as follows: # because the mpi target was marked exportable blt_export_tpl_targets(EXPORT example-targets) -To avoid collisions with projects that import "example-targets", we can provide +To avoid collisions with projects that import "example-targets", it is recommended to provide a namespace for the ``mpi`` target: .. code-block:: cmake From f05b930f9bcf081b1b322bbcda57460246d9c373 Mon Sep 17 00:00:00 2001 From: David Beckingsale Date: Fri, 21 Jan 2022 07:55:49 -0800 Subject: [PATCH 70/76] Add CI jobs with BLT_EXPORT_THIRDPARTY=ON --- .gitlab/build_lassen.yml | 5 ++ .gitlab/build_quartz.yml | 5 ++ ...lang@upstream_nvcc_c++14-export-tpls.cmake | 73 +++++++++++++++++++ .../gcc@8.3.1-export-tpls.cmake | 51 +++++++++++++ 4 files changed, 134 insertions(+) create mode 100644 host-configs/llnl/blueos_3_ppc64le_ib_p9/clang@upstream_nvcc_c++14-export-tpls.cmake create mode 100644 host-configs/llnl/toss_3_x86_64_ib/gcc@8.3.1-export-tpls.cmake diff --git a/.gitlab/build_lassen.yml b/.gitlab/build_lassen.yml index 3096cc79a..f4c98271e 100644 --- a/.gitlab/build_lassen.yml +++ b/.gitlab/build_lassen.yml @@ -43,6 +43,11 @@ lassen-clang_upstream_nvcc_c++17_no_separable: HOST_CONFIG: "clang@upstream_nvcc_c++17_no_separable.cmake" extends: [.build_on_lassen, .with_cuda] +lassen-clang_upstream_nvcc_c++14_export_tpls: + variables: + HOST_CONFIG: "clang@upstream_nvcc_c++14-export-tpls.cmake" + extends: [.build_on_lassen, .with_cuda] + lassen-clang_upstream_nvcc_xlf: variables: HOST_CONFIG: "clang@upstream_nvcc_xlf.cmake" diff --git a/.gitlab/build_quartz.yml b/.gitlab/build_quartz.yml index 9e2b119a0..6ba15e031 100644 --- a/.gitlab/build_quartz.yml +++ b/.gitlab/build_quartz.yml @@ -59,6 +59,11 @@ quartz-gcc_8_3_1: HOST_CONFIG: "gcc@8.3.1.cmake" extends: [.build_on_quartz] +quartz-gcc_8_3_1_export_tpls: + variables: + HOST_CONFIG: "gcc@8.3.1-export-tpls.cmake" + extends: [.build_on_quartz] + quartz-inteloneapi_2021_3: variables: HOST_CONFIG: "intel-oneapi@2021.3.cmake" diff --git a/host-configs/llnl/blueos_3_ppc64le_ib_p9/clang@upstream_nvcc_c++14-export-tpls.cmake b/host-configs/llnl/blueos_3_ppc64le_ib_p9/clang@upstream_nvcc_c++14-export-tpls.cmake new file mode 100644 index 000000000..ced4857b0 --- /dev/null +++ b/host-configs/llnl/blueos_3_ppc64le_ib_p9/clang@upstream_nvcc_c++14-export-tpls.cmake @@ -0,0 +1,73 @@ +# Copyright (c) 2017-2022, Lawrence Livermore National Security, LLC and +# other BLT Project Developers. See the top-level LICENSE file for details +# +# SPDX-License-Identifier: (BSD-3-Clause) + +#------------------------------------------------------------------------------ +# Example host-config file for the blue_os cluster at LLNL, specifically Lassen +#------------------------------------------------------------------------------ +# +# This file provides CMake with paths / details for: +# C/C++: Clang with GCC 8.3.1 toolchain +# Cuda +# MPI +# +#------------------------------------------------------------------------------ + +#--------------------------------------- +# Compilers +#--------------------------------------- + +set(_CLANG_VERSION "clang-upstream-2019.08.15") +set(_CLANG_DIR "/usr/tce/packages/clang/${_CLANG_VERSION}") +set(_GCC_DIR "/usr/tce/packages/gcc/gcc-8.3.1") + +set(CMAKE_C_COMPILER "${_CLANG_DIR}/bin/clang" CACHE PATH "") +set(CMAKE_CXX_COMPILER "${_CLANG_DIR}/bin/clang++" CACHE PATH "") + +set(BLT_CXX_STD "c++14" CACHE STRING "") + +set(CMAKE_C_FLAGS "--gcc-toolchain=${_GCC_DIR}" CACHE PATH "") +set(CMAKE_CXX_FLAGS "--gcc-toolchain=${_GCC_DIR}" CACHE PATH "") + +set(BLT_EXE_LINKER_FLAGS " -Wl,-rpath,${_GCC_DIR}/lib" CACHE PATH "Adds a missing libstdc++ rpath") + +#--------------------------------------- +# MPI +#--------------------------------------- +set(ENABLE_MPI ON CACHE BOOL "") + +set(_MPI_BASE_DIR "/usr/tce/packages/spectrum-mpi/spectrum-mpi-rolling-release-${_CLANG_VERSION}") + +set(MPI_C_COMPILER "${_MPI_BASE_DIR}/bin/mpicc" CACHE PATH "") +set(MPI_CXX_COMPILER "${_MPI_BASE_DIR}/bin/mpicxx" CACHE PATH "") + +#------------------------------------------------------------------------------ +# Cuda +#------------------------------------------------------------------------------ + +set(ENABLE_CUDA ON CACHE BOOL "") + +set(CUDA_TOOLKIT_ROOT_DIR "/usr/tce/packages/cuda/cuda-11.0.182" CACHE PATH "") + +set(CMAKE_CUDA_COMPILER "${CUDA_TOOLKIT_ROOT_DIR}/bin/nvcc" CACHE PATH "") +set(CMAKE_CUDA_HOST_COMPILER "${CMAKE_CXX_COMPILER}" CACHE PATH "") + +set(CMAKE_CUDA_ARCHITECTURES "70" CACHE STRING "") +set(_cuda_arch "sm_${CMAKE_CUDA_ARCHITECTURES}") +set(CMAKE_CUDA_FLAGS "-Xcompiler=--gcc-toolchain=${_GCC_DIR} -restrict -arch ${_cuda_arch} -std=c++17 --expt-extended-lambda -G" CACHE STRING "") + +set(CUDA_SEPARABLE_COMPILATION ON CACHE BOOL "" ) + +# nvcc does not like gtest's 'pthreads' flag +set(gtest_disable_pthreads ON CACHE BOOL "") +set(ENABLE_GTEST_DEATH_TESTS OFF CACHE BOOL "") + +# Very specific fix for working around CMake adding implicit link directories returned by the BlueOS +# compilers to link CUDA executables +set(BLT_CMAKE_IMPLICIT_LINK_DIRECTORIES_EXCLUDE "/usr/tce/packages/gcc/gcc-4.9.3/lib64/gcc/powerpc64le-unknown-linux-gnu/4.9.3;/usr/tce/packages/gcc/gcc-4.9.3/lib64" CACHE STRING "") + +#------------------------------------------------------------------------------ +# Enable TPL export +#------------------------------------------------------------------------------ +set(BLT_EXPORT_THIRDPARTY ON CACHE BOOL "") \ No newline at end of file diff --git a/host-configs/llnl/toss_3_x86_64_ib/gcc@8.3.1-export-tpls.cmake b/host-configs/llnl/toss_3_x86_64_ib/gcc@8.3.1-export-tpls.cmake new file mode 100644 index 000000000..a552b738f --- /dev/null +++ b/host-configs/llnl/toss_3_x86_64_ib/gcc@8.3.1-export-tpls.cmake @@ -0,0 +1,51 @@ +# Copyright (c) 2017-2022, Lawrence Livermore National Security, LLC and +# other BLT Project Developers. See the top-level LICENSE file for details +# +# SPDX-License-Identifier: (BSD-3-Clause) + +#------------------------------------------------------------------------------ +# Example host-config file for the quartz cluster at LLNL +#------------------------------------------------------------------------------ +# +# This file provides CMake with paths / details for: +# C,C++, & Fortran compilers + MPI +# +#------------------------------------------------------------------------------ + +#------------------------------------------------------------------------------ +# gcc@8.3.1 compilers +#------------------------------------------------------------------------------ + +set(GCC_VERSION "gcc-8.3.1") +set(GCC_HOME "/usr/tce/packages/gcc/${GCC_VERSION}") + +# c compiler +set(CMAKE_C_COMPILER "${GCC_HOME}/bin/gcc" CACHE PATH "") + +# cpp compiler +set(CMAKE_CXX_COMPILER "${GCC_HOME}/bin/g++" CACHE PATH "") + +# fortran support +set(ENABLE_FORTRAN ON CACHE BOOL "") + +# fortran compiler +set(CMAKE_Fortran_COMPILER "${GCC_HOME}/bin/gfortran" CACHE PATH "") + +#------------------------------------------------------------------------------ +# MPI Support +#------------------------------------------------------------------------------ +set(ENABLE_MPI ON CACHE BOOL "") + +set(MPI_HOME "/usr/tce/packages/mvapich2/mvapich2-2.3-${GCC_VERSION}" CACHE PATH "") + +set(MPI_C_COMPILER "${MPI_HOME}/bin/mpicc" CACHE PATH "") +set(MPI_CXX_COMPILER "${MPI_HOME}/bin/mpicxx" CACHE PATH "") +set(MPI_Fortran_COMPILER "${MPI_HOME}/bin/mpif90" CACHE PATH "") + +set(MPIEXEC "/usr/bin/srun" CACHE PATH "") +set(MPIEXEC_NUMPROC_FLAG "-n" CACHE PATH "") + +#------------------------------------------------------------------------------ +# Enable TPL export +#------------------------------------------------------------------------------ +set(BLT_EXPORT_THIRDPARTY ON CACHE BOOL "") From 40d2a1c495a25959b9aa5b9e31d35300e21ea864 Mon Sep 17 00:00:00 2001 From: David Beckingsale Date: Fri, 21 Jan 2022 15:52:11 -0800 Subject: [PATCH 71/76] Update RELEASE-NOTES.md --- RELEASE-NOTES.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/RELEASE-NOTES.md b/RELEASE-NOTES.md index f58ddbd6d..ba6f85d10 100644 --- a/RELEASE-NOTES.md +++ b/RELEASE-NOTES.md @@ -12,6 +12,8 @@ The project release numbers follow [Semantic Versioning](http://semver.org/spec/ ### Added - Added support for IntelLLVM compiler family to blt_append_custom_compiler_flag - Added support for hip targets configured with cmake 3.21 native hip support +- Added `blt_export_tpl_targets` macro to add BLT-provided third-party library + targets to an export set. ### Changed - `BLT_C_FILE_EXTS` updated to include `.cuh` From b7c04040aa9f4fb1fd2b4cb5dba16c84e89b63a9 Mon Sep 17 00:00:00 2001 From: Chris White Date: Tue, 25 Jan 2022 12:34:13 -0800 Subject: [PATCH 72/76] unify c++ standard string --- .../clang@upstream_nvcc_c++14-export-tpls.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/host-configs/llnl/blueos_3_ppc64le_ib_p9/clang@upstream_nvcc_c++14-export-tpls.cmake b/host-configs/llnl/blueos_3_ppc64le_ib_p9/clang@upstream_nvcc_c++14-export-tpls.cmake index ced4857b0..310b9cbbf 100644 --- a/host-configs/llnl/blueos_3_ppc64le_ib_p9/clang@upstream_nvcc_c++14-export-tpls.cmake +++ b/host-configs/llnl/blueos_3_ppc64le_ib_p9/clang@upstream_nvcc_c++14-export-tpls.cmake @@ -55,7 +55,7 @@ set(CMAKE_CUDA_HOST_COMPILER "${CMAKE_CXX_COMPILER}" CACHE PATH "") set(CMAKE_CUDA_ARCHITECTURES "70" CACHE STRING "") set(_cuda_arch "sm_${CMAKE_CUDA_ARCHITECTURES}") -set(CMAKE_CUDA_FLAGS "-Xcompiler=--gcc-toolchain=${_GCC_DIR} -restrict -arch ${_cuda_arch} -std=c++17 --expt-extended-lambda -G" CACHE STRING "") +set(CMAKE_CUDA_FLAGS "-Xcompiler=--gcc-toolchain=${_GCC_DIR} -restrict -arch ${_cuda_arch} -std=${BLT_CXX_STD} --expt-extended-lambda -G" CACHE STRING "") set(CUDA_SEPARABLE_COMPILATION ON CACHE BOOL "" ) From 1b862e73489ab2e7fb30e8e9da7d46c0e84819f6 Mon Sep 17 00:00:00 2001 From: Chris White Date: Wed, 16 Feb 2022 14:52:33 -0800 Subject: [PATCH 73/76] fix guards on gbenchmark smoke test --- tests/smoke/CMakeLists.txt | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/tests/smoke/CMakeLists.txt b/tests/smoke/CMakeLists.txt index 84c857368..265f06976 100644 --- a/tests/smoke/CMakeLists.txt +++ b/tests/smoke/CMakeLists.txt @@ -40,15 +40,21 @@ endif() ################ # gbenchmark test ################ -if (ENABLE_BENCHMARKS) +if(ENABLE_GBENCHMARKS) blt_add_executable(NAME blt_gbenchmark_smoke SOURCES blt_gbenchmark_smoke.cpp OUTPUT_DIR ${TEST_OUTPUT_DIRECTORY} DEPENDS_ON gbenchmark FOLDER blt/benchmarks ) - blt_add_benchmark( NAME blt_gbenchmark_smoke - COMMAND blt_gbenchmark_smoke "--benchmark_min_time=0.0001") + if(ENABLE_BENCHMARKS) + blt_add_benchmark(NAME blt_gbenchmark_smoke + COMMAND blt_gbenchmark_smoke "--benchmark_min_time=0.0001") + else() + # A user could turn on gbenchmarks but turn off benchmarks + blt_add_test(NAME blt_gbenchmark_smoke + COMMAND blt_gbenchmark_smoke "--benchmark_min_time=0.0001") + endif() endif() From eb536b85db4da3cec7b6fc0df099b9b1d189f394 Mon Sep 17 00:00:00 2001 From: Chris White Date: Wed, 16 Feb 2022 15:10:47 -0800 Subject: [PATCH 74/76] add CI for benchmark and gmock, general cleanup --- azure-pipelines.yml | 38 +++++++++++++++++++++++++++++--------- 1 file changed, 29 insertions(+), 9 deletions(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index d32207b48..293eba47d 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -5,6 +5,8 @@ variables: DOCKER_FLAGS: "--user='root' -v `pwd`:/blt -w /blt/build $(Compiler_ImageName)" + C_COMPILERS: "-DCMAKE_C_COMPILER=$(C_COMPILER) -DCMAKE_CXX_COMPILER=$(CXX_COMPILER)" + MPI_FLAGS: '-DENABLE_MPI=ON -DMPI_C_COMPILER=$(MPI_DIR)/bin/mpicc -DMPI_CXX_COMPILER=$(MPI_DIR)/bin/mpicxx -DMPIEXEC=$(MPI_DIR)/bin/mpiexec -DMPIEXEC_NUMPROC_FLAG=-n' strategy: matrix: @@ -15,9 +17,31 @@ strategy: CXX_COMPILER: '/usr/bin/g++' CMAKE_BIN_DIR: '/usr/bin' MPI_DIR: '/usr' - MPI_FLAGS: '-DENABLE_MPI=ON -DMPI_C_COMPILER=$(MPI_DIR)/bin/mpicc -DMPI_CXX_COMPILER=$(MPI_DIR)/bin/mpicxx -DMPIEXEC=$(MPI_DIR)/bin/mpiexec -DMPIEXEC_NUMPROC_FLAG=-n' - CMAKE_FLAGS: '-DCMAKE_C_COMPILER=$(C_COMPILER) -DCMAKE_CXX_COMPILER=$(CXX_COMPILER) -DENABLE_GTEST_DEATH_TESTS=OFF $(MPI_FLAGS) -DENABLE_OPENMP=ON' - TEST_TARGET: 'linux_gcc8' + CMAKE_FLAGS: '$(C_COMPILERS) $(MPI_FLAGS) -DENABLE_GTEST_DEATH_TESTS=OFF -DENABLE_OPENMP=ON' + linux_gcc11: + VM_ImageName: 'ubuntu-20.04' + Compiler_ImageName: 'axom/tpls:gcc-11_01-27-22_05h-56m' + C_COMPILER: '/usr/bin/gcc' + CXX_COMPILER: '/usr/bin/g++' + CMAKE_BIN_DIR: '/usr/bin' + MPI_DIR: '/usr' + CMAKE_FLAGS: '$(C_COMPILERS) $(MPI_FLAGS) -DENABLE_GTEST_DEATH_TESTS=OFF -DENABLE_OPENMP=ON' + linux_gcc11_benchmarks: + VM_ImageName: 'ubuntu-20.04' + Compiler_ImageName: 'axom/tpls:gcc-11_01-27-22_05h-56m' + C_COMPILER: '/usr/bin/gcc' + CXX_COMPILER: '/usr/bin/g++' + CMAKE_BIN_DIR: '/usr/bin' + MPI_DIR: '/usr' + CMAKE_FLAGS: '$(C_COMPILERS) $(MPI_FLAGS) -DENABLE_GTEST_DEATH_TESTS=OFF -DENABLE_OPENMP=ON -DENABLE_BENCHMARKS=ON' + linux_gcc11_gmock: + VM_ImageName: 'ubuntu-20.04' + Compiler_ImageName: 'axom/tpls:gcc-11_01-27-22_05h-56m' + C_COMPILER: '/usr/bin/gcc' + CXX_COMPILER: '/usr/bin/g++' + CMAKE_BIN_DIR: '/usr/bin' + MPI_DIR: '/usr' + CMAKE_FLAGS: '$(C_COMPILERS) $(MPI_FLAGS) -DENABLE_GTEST_DEATH_TESTS=OFF -DENABLE_OPENMP=ON -DENABLE_GMOCK=ON' linux_clang10: VM_ImageName: 'ubuntu-18.04' Compiler_ImageName: 'axom/tpls:clang-10_10-21-21_21h-28m' @@ -25,17 +49,13 @@ strategy: CXX_COMPILER: '/usr/bin/clang++' CMAKE_BIN_DIR: '/usr/bin' MPI_DIR: '/usr' - MPI_FLAGS: '-DENABLE_MPI=ON -DMPI_C_COMPILER=$(MPI_DIR)/bin/mpicc -DMPI_CXX_COMPILER=$(MPI_DIR)/bin/mpicxx -DMPIEXEC=$(MPI_DIR)/bin/mpiexec -DMPIEXEC_NUMPROC_FLAG=-n' - CMAKE_FLAGS: '-DCMAKE_C_COMPILER=$(C_COMPILER) -DCMAKE_CXX_COMPILER=$(CXX_COMPILER) -DENABLE_GTEST_DEATH_TESTS=OFF $(MPI_FLAGS) -DENABLE_OPENMP=ON' - TEST_TARGET: 'linux_clang10' + CMAKE_FLAGS: '$(C_COMPILERS) $(MPI_FLAGS) -DENABLE_GTEST_DEATH_TESTS=OFF -DENABLE_OPENMP=ON' osx_gcc: VM_ImageName: 'macos-1015' CMAKE_FLAGS: '' - TEST_TARGET: 'osx_gcc' windows: VM_ImageName: 'windows-2019' CMAKE_FLAGS: '' - TEST_TARGET: 'win_vs' pool: vmImage: $(VM_ImageName) @@ -81,5 +101,5 @@ steps: inputs: testResultsFormat: 'cTest' testResultsFiles: 'build/Testing/*/Test.xml' - testRunTitle: '$(TEST_TARGET) Tests' + testRunTitle: '$(Agent.JobName) Tests' failTaskOnFailedTests: true From a638abb192047f4621c619e54c355c75bd79c863 Mon Sep 17 00:00:00 2001 From: Chris White Date: Wed, 16 Feb 2022 15:20:24 -0800 Subject: [PATCH 75/76] add limits header --- .../benchmark-1.5.0/include/benchmark/benchmark.h | 4 ++++ .../patches/gbenchmark-2022_02_16-limits.patch | 15 +++++++++++++++ 2 files changed, 19 insertions(+) create mode 100644 thirdparty_builtin/patches/gbenchmark-2022_02_16-limits.patch diff --git a/thirdparty_builtin/benchmark-1.5.0/include/benchmark/benchmark.h b/thirdparty_builtin/benchmark-1.5.0/include/benchmark/benchmark.h index 6cb96f546..0b1f45148 100644 --- a/thirdparty_builtin/benchmark-1.5.0/include/benchmark/benchmark.h +++ b/thirdparty_builtin/benchmark-1.5.0/include/benchmark/benchmark.h @@ -173,6 +173,10 @@ BENCHMARK(BM_test)->Unit(benchmark::kMillisecond); #include #include #include +// BLT PATCH START +// gcc@11 requires this for std::numeric_limits +#include +// BLT PATCH END #include #include #include diff --git a/thirdparty_builtin/patches/gbenchmark-2022_02_16-limits.patch b/thirdparty_builtin/patches/gbenchmark-2022_02_16-limits.patch new file mode 100644 index 000000000..db97dca06 --- /dev/null +++ b/thirdparty_builtin/patches/gbenchmark-2022_02_16-limits.patch @@ -0,0 +1,15 @@ +diff --git a/thirdparty_builtin/benchmark-1.5.0/include/benchmark/benchmark.h b/thirdparty_builtin/benchmark-1.5.0/include/benchmark/benchmark.h +index 6cb96f5..0b1f451 100644 +--- a/thirdparty_builtin/benchmark-1.5.0/include/benchmark/benchmark.h ++++ b/thirdparty_builtin/benchmark-1.5.0/include/benchmark/benchmark.h +@@ -173,6 +173,10 @@ BENCHMARK(BM_test)->Unit(benchmark::kMillisecond); + #include + #include + #include ++// BLT PATCH START ++// gcc@11 requires this for std::numeric_limits ++#include ++// BLT PATCH END + #include + #include + #include From 49fb804b15d781b3a4ce57e8835e0d6addec715d Mon Sep 17 00:00:00 2001 From: Chris White Date: Mon, 7 Mar 2022 15:22:14 -0800 Subject: [PATCH 76/76] update version number --- RELEASE-NOTES.md | 5 ++++- SetupBLT.cmake | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/RELEASE-NOTES.md b/RELEASE-NOTES.md index ba6f85d10..35edd4614 100644 --- a/RELEASE-NOTES.md +++ b/RELEASE-NOTES.md @@ -9,6 +9,8 @@ The project release numbers follow [Semantic Versioning](http://semver.org/spec/ ## [Unreleased] - Release date yyyy-mm-dd +## [Version 0.5.0] - Release date 2022-03-07 + ### Added - Added support for IntelLLVM compiler family to blt_append_custom_compiler_flag - Added support for hip targets configured with cmake 3.21 native hip support @@ -233,7 +235,8 @@ The project release numbers follow [Semantic Versioning](http://semver.org/spec/ -[Unreleased]: https://github.com/LLNL/blt/compare/v0.4.1...develop +[Unreleased]: https://github.com/LLNL/blt/compare/v0.5.0...develop +[Version 0.5.0]: https://github.com/LLNL/blt/compare/v0.4.1...v0.5.0 [Version 0.4.1]: https://github.com/LLNL/blt/compare/v0.4.0...v0.4.1 [Version 0.4.0]: https://github.com/LLNL/blt/compare/v0.3.6...v0.4.0 [Version 0.3.6]: https://github.com/LLNL/blt/compare/v0.3.5...v0.3.6 diff --git a/SetupBLT.cmake b/SetupBLT.cmake index fe7539a70..2a6db6610 100644 --- a/SetupBLT.cmake +++ b/SetupBLT.cmake @@ -4,7 +4,7 @@ # SPDX-License-Identifier: (BSD-3-Clause) if (NOT BLT_LOADED) - set(BLT_VERSION "0.4.1" CACHE STRING "") + set(BLT_VERSION "0.5.0" CACHE STRING "") mark_as_advanced(BLT_VERSION) message(STATUS "BLT Version: ${BLT_VERSION}")