Skip to content

Commit ddd5a0c

Browse files
authored
Merge pull request #506 from LLNL/v0.4.1-rc
v0.4.1
2 parents 7ec2cb8 + 300ec10 commit ddd5a0c

14 files changed

+220
-65
lines changed

.gitlab-ci.yml

+6-21
Original file line numberDiff line numberDiff line change
@@ -8,36 +8,21 @@ variables:
88
BUILD_ROOT: ${CI_PROJECT_DIR}
99

1010
stages:
11-
- l_build
12-
- q_allocate_resources
13-
- q_build
14-
- q_release_resources
11+
- allocate
12+
- build
13+
- release
1514

1615
####
1716
# Template
18-
.srun_build_script:
17+
.build_script:
1918
script:
2019
#Use pre-existing allocation if any
21-
- JOBID=$(squeue -h --name=${PROJECT_ALLOC_NAME} --format=%A)
20+
- JOBID=$(if [[ "$SYS_TYPE" == "toss_3_x86_64_ib" ]]; then squeue -h --name=${PROJECT_ALLOC_NAME} --format=%A; fi)
2221
- ASSIGN_ID=$(if [[ -n "${JOBID}" ]]; then echo "--jobid=${JOBID}"; fi)
23-
- EXEC_PREFIX="srun -p pdebug ${ASSIGN_ID} -t 10 -N 1 --mpibind=off"
2422
#BUILD + TEST
2523
- echo -e "section_start:$(date +%s):build_and_test\r\e[0K
2624
Build and test ${CI_PROJECT_NAME}"
27-
- ${EXEC_PREFIX} .gitlab/build_and_test.sh
28-
- echo -e "section_end:$(date +%s):build_and_test\r\e[0K"
29-
artifacts:
30-
reports:
31-
junit: build/junit.xml
32-
33-
34-
.build_blueos_3_ppc64le_ib_p9_script:
35-
script:
36-
- EXEC_PREFIX="lalloc 1 -W 10 -q pdebug"
37-
#BUILD + TEST
38-
- echo -e "section_start:$(date +%s):build_and_test\r\e[0K
39-
Build and test ${CI_PROJECT_NAME}"
40-
- ${EXEC_PREFIX} .gitlab/build_and_test.sh
25+
- ${ALLOC_COMMAND} .gitlab/build_and_test.sh
4126
- echo -e "section_end:$(date +%s):build_and_test\r\e[0K"
4227
artifacts:
4328
reports:

.gitlab/build_lassen.yml

+9-7
Original file line numberDiff line numberDiff line change
@@ -20,33 +20,35 @@
2020
####
2121
# Template
2222
.build_on_lassen:
23-
stage: l_build
24-
extends: [.build_blueos_3_ppc64le_ib_p9_script, .on_lassen]
23+
stage: build
24+
variables:
25+
ALLOC_COMMAND: "lalloc 1 -W 10 -q pdebug"
26+
extends: [.build_script, .on_lassen]
2527
needs: []
2628

2729
####
2830
# Build jobs
29-
clang_upstream_link_with_nvcc (lassen):
31+
lassen-clang_upstream_link_with_nvcc:
3032
variables:
3133
HOST_CONFIG: "clang@upstream_link_with_nvcc.cmake"
3234
extends: [.build_on_lassen, .with_cuda]
3335

34-
clang_upstream_nvcc_c++17 (lassen):
36+
lassen-clang_upstream_nvcc_c++17:
3537
variables:
3638
HOST_CONFIG: "clang@upstream_nvcc_c++17.cmake"
3739
extends: [.build_on_lassen, .with_cuda]
3840

39-
clang_upstream_nvcc_c++17_no_separable (lassen):
41+
lassen-clang_upstream_nvcc_c++17_no_separable:
4042
variables:
4143
HOST_CONFIG: "clang@upstream_nvcc_c++17_no_separable.cmake"
4244
extends: [.build_on_lassen, .with_cuda]
4345

44-
clang_upstream_nvcc_xlf (lassen):
46+
lassen-clang_upstream_nvcc_xlf:
4547
variables:
4648
HOST_CONFIG: "clang@upstream_nvcc_xlf.cmake"
4749
extends: [.build_on_lassen, .with_cuda]
4850

49-
pgi_20.4_nvcc (lassen):
51+
lassen-pgi_20.4_nvcc:
5052
variables:
5153
HOST_CONFIG: "[email protected]_nvcc.cmake"
5254
extends: [.build_on_lassen, .with_cuda]

.gitlab/build_quartz.yml

+13-11
Original file line numberDiff line numberDiff line change
@@ -13,51 +13,53 @@
1313

1414
####
1515
# In pre-build phase, allocate a node for builds
16-
allocate_resources_build_quartz:
16+
quartz_allocate:
1717
variables:
1818
GIT_STRATEGY: none
1919
extends: [.on_quartz]
20-
stage: q_allocate_resources
20+
stage: allocate
2121
script:
22-
- salloc -p pdebug -N 1 -c 36 -t 30 --no-shell --job-name=${PROJECT_ALLOC_NAME} --mpibind=off
22+
- salloc -p pdebug -N 1 -t 10 --no-shell --job-name=${PROJECT_ALLOC_NAME} --mpibind=off
2323
needs: []
2424

2525
####
2626
# In post-build phase, deallocate resources
2727
# Note : make sure this is run even on build phase failure
28-
release_resources_build_quartz:
28+
quartz_release:
2929
variables:
3030
GIT_STRATEGY: none
3131
extends: [.on_quartz]
32-
stage: q_release_resources
32+
stage: release
3333
script:
3434
- export JOBID=$(squeue -h --name=${PROJECT_ALLOC_NAME} --format=%A)
3535
- if [[ -n "${JOBID}" ]]; then scancel ${JOBID}; fi
3636

3737
####
3838
# Template
3939
.build_on_quartz:
40-
stage: q_build
41-
extends: [.srun_build_script, .on_quartz]
40+
stage: build
41+
variables:
42+
ALLOC_COMMAND: "srun -p pdebug -t 30 -N 1 ${ASSIGN_ID}"
43+
extends: [.build_script, .on_quartz]
4244

4345
####
4446
# Build jobs
45-
clang_4_0_0_libcxx (quartz):
47+
quartz-clang_4_0_0_libcxx:
4648
variables:
4749
HOST_CONFIG: "[email protected]"
4850
extends: [.build_on_quartz]
4951

50-
clang_6_0_0_static_analysis (quartz):
52+
quartz-clang_6_0_0_static_analysis:
5153
variables:
5254
HOST_CONFIG: "[email protected]"
5355
extends: [.build_on_quartz]
5456

55-
gcc_8_3_1 (quartz):
57+
quartz-gcc_8_3_1:
5658
variables:
5759
HOST_CONFIG: "[email protected]"
5860
extends: [.build_on_quartz]
5961

60-
pgi_20_1 (quartz):
62+
quartz-pgi_20_1:
6163
variables:
6264
HOST_CONFIG: "[email protected]"
6365
extends: [.build_on_quartz]

RELEASE-NOTES.md

+14-2
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,20 @@ The project release numbers follow [Semantic Versioning](http://semver.org/spec/
99

1010
## [Unreleased] - Release date yyyy-mm-dd
1111

12+
## [Version 0.4.1] - Release date 2021-07-20
13+
14+
### Added
15+
- Added compilation of HIP with clang using ``ENABLE_CLANG_HIP`` and ``BLT_CLANG_HIP_ARCH``
16+
17+
### Changed
18+
- XL: Use compiler flag `-std=c++14` instead of `-std=c++1y` when `BLT_CXX_STD` is set to `c++14`
19+
20+
### Fixed
21+
- Simpified the clang-format version regex that was causing hangs on some version strings.
22+
1223
## [Version 0.4.0] - Release date 2021-04-09
1324

14-
## Added
25+
### Added
1526
- Added variable ``BLT_CMAKE_IMPLICIT_LINK_DIRECTORIES_EXCLUDE`` for filtering
1627
link directories implicitly added by CMake. See the following example host-config:
1728
``host-configs/llnl/blueos_3_ppc64le_ib_p9/clang@upstream_nvcc_c++17.cmake``
@@ -202,7 +213,8 @@ The project release numbers follow [Semantic Versioning](http://semver.org/spec/
202213

203214

204215

205-
[Unreleased]: https://github.com/LLNL/blt/compare/v0.4.0...develop
216+
[Unreleased]: https://github.com/LLNL/blt/compare/v0.4.1...develop
217+
[Version 0.4.1]: https://github.com/LLNL/blt/compare/v0.4.0...v0.4.1
206218
[Version 0.4.0]: https://github.com/LLNL/blt/compare/v0.3.6...v0.4.0
207219
[Version 0.3.6]: https://github.com/LLNL/blt/compare/v0.3.5...v0.3.6
208220
[Version 0.3.5]: https://github.com/LLNL/blt/compare/v0.3.0...v0.3.5

SetupBLT.cmake

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
# SPDX-License-Identifier: (BSD-3-Clause)
55

66
if (NOT BLT_LOADED)
7-
set(BLT_VERSION "0.4.0" CACHE STRING "")
7+
set(BLT_VERSION "0.4.1" CACHE STRING "")
88
mark_as_advanced(BLT_VERSION)
99
message(STATUS "BLT Version: ${BLT_VERSION}")
1010

cmake/BLTMacros.cmake

+2-2
Original file line numberDiff line numberDiff line change
@@ -644,7 +644,7 @@ macro(blt_add_library)
644644
set(_lib_type "STATIC")
645645
endif()
646646

647-
if (ENABLE_HIP)
647+
if (ENABLE_HIP AND NOT ENABLE_CLANG_HIP)
648648
blt_add_hip_library(NAME ${arg_NAME}
649649
SOURCES ${arg_SOURCES}
650650
HEADERS ${arg_HEADERS}
@@ -775,7 +775,7 @@ macro(blt_add_executable)
775775
message(FATAL_ERROR "blt_add_executable(NAME ${arg_NAME} ...) given with no sources")
776776
endif()
777777

778-
if (ENABLE_HIP)
778+
if (ENABLE_HIP AND NOT ENABLE_CLANG_HIP)
779779
blt_add_hip_executable(NAME ${arg_NAME}
780780
SOURCES ${arg_SOURCES}
781781
HEADERS ${arg_HEADERS}

cmake/BLTOptions.cmake

+7-1
Original file line numberDiff line numberDiff line change
@@ -53,11 +53,17 @@ option(ENABLE_FORTRAN "Enables Fortran compiler support" ${_fortran_already
5353
option(ENABLE_MPI "Enables MPI support" OFF)
5454
option(ENABLE_OPENMP "Enables OpenMP compiler support" OFF)
5555
option(ENABLE_CUDA "Enable CUDA support" OFF)
56-
option(ENABLE_CLANG_CUDA "Enable Clang's native CUDA support" OFF)
56+
cmake_dependent_option(ENABLE_CLANG_CUDA "Enable Clang's native CUDA support" OFF
57+
"ENABLE_CUDA" OFF)
5758
mark_as_advanced(ENABLE_CLANG_CUDA)
5859
set(BLT_CLANG_CUDA_ARCH "sm_30" CACHE STRING "Compute architecture to use when generating CUDA code with Clang")
5960
mark_as_advanced(BLT_CLANG_CUDA_ARCH)
6061
option(ENABLE_HIP "Enable HIP support" OFF)
62+
cmake_dependent_option(ENABLE_CLANG_HIP "Enable Clang's native HIP support" OFF
63+
"ENABLE_HIP" OFF)
64+
mark_as_advanced(ENABLE_CLANG_HIP)
65+
set(BLT_CLANG_HIP_ARCH "gfx906" CACHE STRING "AMDGPU ISA target to use when generating HIP code with Clang" )
66+
mark_as_advanced(BLT_CLANG_HIP_ARCH)
6167
option(ENABLE_HCC "Enable HCC support" OFF)
6268
set(BLT_ROCM_ARCH "gfx900" CACHE STRING "gfx architecture to use when generating ROCm code")
6369

cmake/SetupCodeChecks.cmake

+2-1
Original file line numberDiff line numberDiff line change
@@ -684,7 +684,8 @@ macro(blt_add_clangformat_target)
684684
OUTPUT_VARIABLE _version_str
685685
OUTPUT_STRIP_TRAILING_WHITESPACE)
686686
# The version number is the last token - can contain non-numeric
687-
string(REGEX MATCH "([0-9a-zA-Z\\-]+(\\.)?)+$" _clangformat_version ${_version_str})
687+
string(REGEX MATCH "([0-9a-zA-Z\\-]+\\.[0-9a-zA-Z\\-]+\\.?[0-9a-zA-Z\\-]?)"
688+
_clangformat_version ${_version_str})
688689
# The user may only specify a part of the version (e.g. just the maj ver)
689690
# so check for substring
690691
string(FIND "${_clangformat_version}" ${BLT_REQUIRED_CLANGFORMAT_VERSION} VERSION_POS)

cmake/SetupCompilerOptions.cmake

+1-1
Original file line numberDiff line numberDiff line change
@@ -268,7 +268,7 @@ if (BLT_CXX_STD)
268268
blt_append_custom_compiler_flag(
269269
FLAGS_VAR CMAKE_CXX_FLAGS
270270
DEFAULT " "
271-
XL "-std=c++1y"
271+
XL "-std=c++14"
272272
PGI "--c++14")
273273
elseif( BLT_CXX_STD STREQUAL c++17)
274274
# Error out on what does not support C++17

cmake/thirdparty/SetupHIP.cmake

+93-8
Original file line numberDiff line numberDiff line change
@@ -15,24 +15,108 @@ find_package(HIP REQUIRED)
1515
message(STATUS "HIP version: ${HIP_VERSION_STRING}")
1616
message(STATUS "HIP platform: ${HIP_PLATFORM}")
1717

18-
if("${HIP_PLATFORM}" STREQUAL "hcc" OR "${HIP_PLATFORM}" STREQUAL "amd")
19-
set(HIP_RUNTIME_DEFINE "__HIP_PLATFORM_HCC__")
20-
elseif("${HIP_PLATFORM}" STREQUAL "nvcc")
21-
set(HIP_RUNTIME_DEFINE "__HIP_PLATFORM_NVCC__")
18+
set(HIP_RUNTIME_INCLUDE_DIRS "${HIP_ROOT_DIR}/include")
19+
if(${HIP_PLATFORM} STREQUAL "hcc")
20+
set(HIP_RUNTIME_DEFINES "-D__HIP_PLATFORM_HCC__")
21+
find_library(HIP_RUNTIME_LIBRARIES NAMES hip_hcc libhip_hcc
22+
PATHS ${HIP_ROOT_DIR}/lib
23+
NO_DEFAULT_PATH
24+
NO_CMAKE_ENVIRONMENT_PATH
25+
NO_CMAKE_PATH
26+
NO_SYSTEM_ENVIRONMENT_PATH
27+
NO_CMAKE_SYSTEM_PATH)
28+
set(HIP_RUNTIME_LIBRARIES "${HIP_ROOT_DIR}/lib/libhip_hcc.so")
29+
elseif(${HIP_PLATFORM} STREQUAL "clang" OR ${HIP_PLATFORM} STREQUAL "amd")
30+
set(HIP_RUNTIME_DEFINES "-D__HIP_PLATFORM_HCC__;-D__HIP_ROCclr__;-D__HIP_PLATFORM_AMD__")
31+
find_library(HIP_RUNTIME_LIBRARIES NAMES amdhip64 libamdhip64
32+
PATHS ${HIP_ROOT_DIR}/lib
33+
NO_DEFAULT_PATH
34+
NO_CMAKE_ENVIRONMENT_PATH
35+
NO_CMAKE_PATH
36+
NO_SYSTEM_ENVIRONMENT_PATH
37+
NO_CMAKE_SYSTEM_PATH)
38+
elseif(${HIP_PLATFORM} STREQUAL "nvcc" OR ${HIP_PLATFORM} STREQUAL "nvidia")
39+
set(HIP_RUNTIME_DEFINES "-D__HIP_PLATFORM_NVCC__;-D__HIP_PLATFORM_NVIDIA__")
40+
if (${CMAKE_VERSION} VERSION_LESS "3.17.0")
41+
find_package(CUDA)
42+
find_library(HIP_RUNTIME_LIBRARIES NAMES cudart libcudart
43+
PATHS ${CMAKE_CUDA_IMPLICIT_LINK_DIRECTORIES}
44+
NO_DEFAULT_PATH
45+
NO_CMAKE_ENVIRONMENT_PATH
46+
NO_CMAKE_PATH
47+
NO_SYSTEM_ENVIRONMENT_PATH
48+
NO_CMAKE_SYSTEM_PATH)
49+
set(HIP_RUNTIME_INCLUDE_DIRS "${HIP_RUNTIME_INCLUDE_DIRS};${CUDA_INCLUDE_DIRS}")
50+
else()
51+
find_package(CUDAToolkit)
52+
find_library(HIP_RUNTIME_LIBRARIES NAMES cudart libcudart
53+
PATHS ${CUDAToolkit_LIBRARY_DIR}
54+
NO_DEFAULT_PATH
55+
NO_CMAKE_ENVIRONMENT_PATH
56+
NO_CMAKE_PATH
57+
NO_SYSTEM_ENVIRONMENT_PATH
58+
NO_CMAKE_SYSTEM_PATH)
59+
set(HIP_RUNTIME_INCLUDE_DIRS "${HIP_RUNTIME_INCLUDE_DIRS};${CUDAToolkit_INCLUDE_DIR}")
60+
endif()
2261
endif()
62+
2363
if ( IS_DIRECTORY "${HIP_ROOT_DIR}/hcc/include" ) # this path only exists on older rocm installs
24-
set(HIP_RUNTIME_INCLUDE_DIRS "${HIP_ROOT_DIR}/include;${HIP_ROOT_DIR}/hcc/include" CACHE STRING "")
64+
set(HIP_RUNTIME_INCLUDE_DIRS "${HIP_ROOT_DIR}/include;${HIP_ROOT_DIR}/hcc/include" CACHE STRING "")
2565
else()
26-
set(HIP_RUNTIME_INCLUDE_DIRS "${HIP_ROOT_DIR}/include" CACHE STRING "")
66+
set(HIP_RUNTIME_INCLUDE_DIRS "${HIP_ROOT_DIR}/include" CACHE STRING "")
2767
endif()
28-
set(HIP_RUNTIME_COMPILE_FLAGS "${HIP_RUNTIME_COMPILE_FLAGS};-D${HIP_RUNTIME_DEFINE};-Wno-unused-parameter")
68+
set(HIP_RUNTIME_COMPILE_FLAGS "${HIP_RUNTIME_COMPILE_FLAGS};-Wno-unused-parameter")
69+
70+
set(_hip_compile_flags " ")
71+
if (ENABLE_CLANG_HIP)
72+
if (NOT (${HIP_PLATFORM} STREQUAL "clang"))
73+
message(FATAL_ERROR "ENABLE_CLANG_HIP requires HIP_PLATFORM=clang")
74+
endif()
75+
set(_hip_compile_flags -x;hip)
76+
# Using clang HIP, we need to construct a few CPP defines and compiler flags
77+
foreach(_arch ${BLT_CLANG_HIP_ARCH})
78+
string(TOUPPER ${_arch} _UPARCH)
79+
string(TOLOWER ${_arch} _lowarch)
80+
list(APPEND _hip_compile_flags "--offload-arch=${_lowarch}")
81+
set(_hip_compile_defines "${HIP_RUNTIME_DEFINES};-D__HIP_ARCH_${_UPARCH}__=1")
82+
endforeach(_arch)
83+
84+
# We need to pass rocm path as well, for certain bitcode libraries.
85+
# First see if we were given it, then see if it exists in the environment.
86+
# If not, don't try to guess but print a warning and hope the compiler knows where it is.
87+
if (NOT ROCM_PATH)
88+
find_path(ROCM_PATH
89+
bin/rocminfo
90+
ENV ROCM_DIR
91+
ENV ROCM_PATH
92+
${HIP_ROOT_DIR}/../
93+
${ROCM_ROOT_DIR}
94+
/opt/rocm)
95+
endif()
96+
97+
if(DEFINED ROCM_PATH)
98+
list(APPEND _hip_compile_flags "--rocm-path=${ROCM_PATH}")
99+
else()
100+
message(WARN "ROCM_PATH not set or found! This is typically required for Clang HIP Compilation")
101+
endif()
102+
103+
message(STATUS "Clang HIP Enabled. Clang flags for HIP compilation: ${_hip_compile_flags}")
104+
message(STATUS "Defines for HIP compilation: ${_hip_compile_defines}")
105+
106+
blt_import_library(NAME hip
107+
DEFINES ${_hip_compile_defines}
108+
COMPILE_FLAGS ${_hip_compile_flags}
109+
DEPENDS_ON ${HIP_RUNTIME_LIBRARIES})
110+
else()
29111

30112
# depend on 'hip', if you need to use hip
31113
# headers, link to hip libs, and need to run your source
32114
# through a hip compiler (hipcc)
33115
# This is currently used only as an indicator for blt_add_hip* -- FindHIP/hipcc will handle resolution
34116
# of all required HIP-related includes/libraries/flags.
35-
blt_import_library(NAME hip)
117+
blt_import_library(NAME hip)
118+
endif()
119+
36120

37121
# depend on 'hip_runtime', if you only need to use hip
38122
# headers or link to hip libs, but don't need to run your source
@@ -41,5 +125,6 @@ blt_import_library(NAME hip_runtime
41125
INCLUDES ${HIP_RUNTIME_INCLUDE_DIRS}
42126
DEFINES ${HIP_RUNTIME_DEFINES}
43127
COMPILE_FLAGS ${HIP_RUNTIME_COMPILE_FLAGS}
128+
DEPENDS_ON ${HIP_RUNTIME_LIBRARIES}
44129
TREAT_INCLUDES_AS_SYSTEM ON
45130
EXPORTABLE ${BLT_EXPORT_THIRDPARTY})

cmake/thirdparty/SetupMPI.cmake

+7-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,13 @@ set(_mpi_includes )
3131
set(_mpi_libraries )
3232
set(_mpi_link_flags )
3333

34-
message(STATUS "Enable FindMPI: ${ENABLE_FIND_MPI}")
34+
35+
if(ENABLE_FIND_MPI)
36+
message(STATUS "FindMPI Enabled (ENABLE_FIND_MPI == ON)")
37+
else()
38+
message(STATUS "FindMPI Disabled (ENABLE_FIND_MPI == OFF) ")
39+
endif()
40+
3541

3642
if (ENABLE_FIND_MPI)
3743
find_package(MPI REQUIRED)

docs/_static/style.css

+1-1
Original file line numberDiff line numberDiff line change
@@ -33,5 +33,5 @@
3333
}
3434

3535
a img.logo {
36-
scale: 75%
36+
transform: scale(.75)
3737
}

0 commit comments

Comments
 (0)