Skip to content

Commit

Permalink
Merge pull request #506 from LLNL/v0.4.1-rc
Browse files Browse the repository at this point in the history
v0.4.1
  • Loading branch information
white238 authored Jul 21, 2021
2 parents 7ec2cb8 + 300ec10 commit ddd5a0c
Show file tree
Hide file tree
Showing 14 changed files with 220 additions and 65 deletions.
27 changes: 6 additions & 21 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,36 +8,21 @@ variables:
BUILD_ROOT: ${CI_PROJECT_DIR}

stages:
- l_build
- q_allocate_resources
- q_build
- q_release_resources
- allocate
- build
- release

####
# Template
.srun_build_script:
.build_script:
script:
#Use pre-existing allocation if any
- JOBID=$(squeue -h --name=${PROJECT_ALLOC_NAME} --format=%A)
- JOBID=$(if [[ "$SYS_TYPE" == "toss_3_x86_64_ib" ]]; then squeue -h --name=${PROJECT_ALLOC_NAME} --format=%A; fi)
- ASSIGN_ID=$(if [[ -n "${JOBID}" ]]; then echo "--jobid=${JOBID}"; fi)
- EXEC_PREFIX="srun -p pdebug ${ASSIGN_ID} -t 10 -N 1 --mpibind=off"
#BUILD + TEST
- echo -e "section_start:$(date +%s):build_and_test\r\e[0K
Build and test ${CI_PROJECT_NAME}"
- ${EXEC_PREFIX} .gitlab/build_and_test.sh
- echo -e "section_end:$(date +%s):build_and_test\r\e[0K"
artifacts:
reports:
junit: build/junit.xml


.build_blueos_3_ppc64le_ib_p9_script:
script:
- EXEC_PREFIX="lalloc 1 -W 10 -q pdebug"
#BUILD + TEST
- echo -e "section_start:$(date +%s):build_and_test\r\e[0K
Build and test ${CI_PROJECT_NAME}"
- ${EXEC_PREFIX} .gitlab/build_and_test.sh
- ${ALLOC_COMMAND} .gitlab/build_and_test.sh
- echo -e "section_end:$(date +%s):build_and_test\r\e[0K"
artifacts:
reports:
Expand Down
16 changes: 9 additions & 7 deletions .gitlab/build_lassen.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,33 +20,35 @@
####
# Template
.build_on_lassen:
stage: l_build
extends: [.build_blueos_3_ppc64le_ib_p9_script, .on_lassen]
stage: build
variables:
ALLOC_COMMAND: "lalloc 1 -W 10 -q pdebug"
extends: [.build_script, .on_lassen]
needs: []

####
# Build jobs
clang_upstream_link_with_nvcc (lassen):
lassen-clang_upstream_link_with_nvcc:
variables:
HOST_CONFIG: "clang@upstream_link_with_nvcc.cmake"
extends: [.build_on_lassen, .with_cuda]

clang_upstream_nvcc_c++17 (lassen):
lassen-clang_upstream_nvcc_c++17:
variables:
HOST_CONFIG: "clang@upstream_nvcc_c++17.cmake"
extends: [.build_on_lassen, .with_cuda]

clang_upstream_nvcc_c++17_no_separable (lassen):
lassen-clang_upstream_nvcc_c++17_no_separable:
variables:
HOST_CONFIG: "clang@upstream_nvcc_c++17_no_separable.cmake"
extends: [.build_on_lassen, .with_cuda]

clang_upstream_nvcc_xlf (lassen):
lassen-clang_upstream_nvcc_xlf:
variables:
HOST_CONFIG: "clang@upstream_nvcc_xlf.cmake"
extends: [.build_on_lassen, .with_cuda]

pgi_20.4_nvcc (lassen):
lassen-pgi_20.4_nvcc:
variables:
HOST_CONFIG: "[email protected]_nvcc.cmake"
extends: [.build_on_lassen, .with_cuda]
24 changes: 13 additions & 11 deletions .gitlab/build_quartz.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,51 +13,53 @@

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

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

####
# Template
.build_on_quartz:
stage: q_build
extends: [.srun_build_script, .on_quartz]
stage: build
variables:
ALLOC_COMMAND: "srun -p pdebug -t 30 -N 1 ${ASSIGN_ID}"
extends: [.build_script, .on_quartz]

####
# Build jobs
clang_4_0_0_libcxx (quartz):
quartz-clang_4_0_0_libcxx:
variables:
HOST_CONFIG: "[email protected]"
extends: [.build_on_quartz]

clang_6_0_0_static_analysis (quartz):
quartz-clang_6_0_0_static_analysis:
variables:
HOST_CONFIG: "[email protected]"
extends: [.build_on_quartz]

gcc_8_3_1 (quartz):
quartz-gcc_8_3_1:
variables:
HOST_CONFIG: "[email protected]"
extends: [.build_on_quartz]

pgi_20_1 (quartz):
quartz-pgi_20_1:
variables:
HOST_CONFIG: "[email protected]"
extends: [.build_on_quartz]
16 changes: 14 additions & 2 deletions RELEASE-NOTES.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,20 @@ The project release numbers follow [Semantic Versioning](http://semver.org/spec/

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

## [Version 0.4.1] - Release date 2021-07-20

### Added
- Added compilation of HIP with clang using ``ENABLE_CLANG_HIP`` and ``BLT_CLANG_HIP_ARCH``

### Changed
- XL: Use compiler flag `-std=c++14` instead of `-std=c++1y` when `BLT_CXX_STD` is set to `c++14`

### Fixed
- Simpified the clang-format version regex that was causing hangs on some version strings.

## [Version 0.4.0] - Release date 2021-04-09

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



[Unreleased]: https://github.com/LLNL/blt/compare/v0.4.0...develop
[Unreleased]: https://github.com/LLNL/blt/compare/v0.4.1...develop
[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
[Version 0.3.5]: https://github.com/LLNL/blt/compare/v0.3.0...v0.3.5
Expand Down
2 changes: 1 addition & 1 deletion SetupBLT.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
# SPDX-License-Identifier: (BSD-3-Clause)

if (NOT BLT_LOADED)
set(BLT_VERSION "0.4.0" CACHE STRING "")
set(BLT_VERSION "0.4.1" CACHE STRING "")
mark_as_advanced(BLT_VERSION)
message(STATUS "BLT Version: ${BLT_VERSION}")

Expand Down
4 changes: 2 additions & 2 deletions cmake/BLTMacros.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -644,7 +644,7 @@ macro(blt_add_library)
set(_lib_type "STATIC")
endif()

if (ENABLE_HIP)
if (ENABLE_HIP AND NOT ENABLE_CLANG_HIP)
blt_add_hip_library(NAME ${arg_NAME}
SOURCES ${arg_SOURCES}
HEADERS ${arg_HEADERS}
Expand Down Expand Up @@ -775,7 +775,7 @@ macro(blt_add_executable)
message(FATAL_ERROR "blt_add_executable(NAME ${arg_NAME} ...) given with no sources")
endif()

if (ENABLE_HIP)
if (ENABLE_HIP AND NOT ENABLE_CLANG_HIP)
blt_add_hip_executable(NAME ${arg_NAME}
SOURCES ${arg_SOURCES}
HEADERS ${arg_HEADERS}
Expand Down
8 changes: 7 additions & 1 deletion cmake/BLTOptions.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -53,11 +53,17 @@ option(ENABLE_FORTRAN "Enables Fortran compiler support" ${_fortran_already
option(ENABLE_MPI "Enables MPI support" OFF)
option(ENABLE_OPENMP "Enables OpenMP compiler support" OFF)
option(ENABLE_CUDA "Enable CUDA support" OFF)
option(ENABLE_CLANG_CUDA "Enable Clang's native CUDA support" OFF)
cmake_dependent_option(ENABLE_CLANG_CUDA "Enable Clang's native CUDA support" OFF
"ENABLE_CUDA" OFF)
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)
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")

Expand Down
3 changes: 2 additions & 1 deletion cmake/SetupCodeChecks.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -684,7 +684,8 @@ macro(blt_add_clangformat_target)
OUTPUT_VARIABLE _version_str
OUTPUT_STRIP_TRAILING_WHITESPACE)
# The version number is the last token - can contain non-numeric
string(REGEX MATCH "([0-9a-zA-Z\\-]+(\\.)?)+$" _clangformat_version ${_version_str})
string(REGEX MATCH "([0-9a-zA-Z\\-]+\\.[0-9a-zA-Z\\-]+\\.?[0-9a-zA-Z\\-]?)"
_clangformat_version ${_version_str})
# The user may only specify a part of the version (e.g. just the maj ver)
# so check for substring
string(FIND "${_clangformat_version}" ${BLT_REQUIRED_CLANGFORMAT_VERSION} VERSION_POS)
Expand Down
2 changes: 1 addition & 1 deletion cmake/SetupCompilerOptions.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,7 @@ if (BLT_CXX_STD)
blt_append_custom_compiler_flag(
FLAGS_VAR CMAKE_CXX_FLAGS
DEFAULT " "
XL "-std=c++1y"
XL "-std=c++14"
PGI "--c++14")
elseif( BLT_CXX_STD STREQUAL c++17)
# Error out on what does not support C++17
Expand Down
101 changes: 93 additions & 8 deletions cmake/thirdparty/SetupHIP.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -15,24 +15,108 @@ find_package(HIP REQUIRED)
message(STATUS "HIP version: ${HIP_VERSION_STRING}")
message(STATUS "HIP platform: ${HIP_PLATFORM}")

if("${HIP_PLATFORM}" STREQUAL "hcc" OR "${HIP_PLATFORM}" STREQUAL "amd")
set(HIP_RUNTIME_DEFINE "__HIP_PLATFORM_HCC__")
elseif("${HIP_PLATFORM}" STREQUAL "nvcc")
set(HIP_RUNTIME_DEFINE "__HIP_PLATFORM_NVCC__")
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()
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 "")
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 "")
set(HIP_RUNTIME_INCLUDE_DIRS "${HIP_ROOT_DIR}/include" CACHE STRING "")
endif()
set(HIP_RUNTIME_COMPILE_FLAGS "${HIP_RUNTIME_COMPILE_FLAGS};-D${HIP_RUNTIME_DEFINE};-Wno-unused-parameter")
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 -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)
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)

# 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
ENV ROCM_DIR
ENV ROCM_PATH
${HIP_ROOT_DIR}/../
${ROCM_ROOT_DIR}
/opt/rocm)
endif()

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")
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 hip
DEFINES ${_hip_compile_defines}
COMPILE_FLAGS ${_hip_compile_flags}
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.
blt_import_library(NAME hip)
blt_import_library(NAME hip)
endif()


# 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
Expand All @@ -41,5 +125,6 @@ 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}
TREAT_INCLUDES_AS_SYSTEM ON
EXPORTABLE ${BLT_EXPORT_THIRDPARTY})
8 changes: 7 additions & 1 deletion cmake/thirdparty/SetupMPI.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,13 @@ set(_mpi_includes )
set(_mpi_libraries )
set(_mpi_link_flags )

message(STATUS "Enable FindMPI: ${ENABLE_FIND_MPI}")

if(ENABLE_FIND_MPI)
message(STATUS "FindMPI Enabled (ENABLE_FIND_MPI == ON)")
else()
message(STATUS "FindMPI Disabled (ENABLE_FIND_MPI == OFF) ")
endif()


if (ENABLE_FIND_MPI)
find_package(MPI REQUIRED)
Expand Down
2 changes: 1 addition & 1 deletion docs/_static/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -33,5 +33,5 @@
}

a img.logo {
scale: 75%
transform: scale(.75)
}
Loading

0 comments on commit ddd5a0c

Please sign in to comment.