Skip to content

Commit 9ff7734

Browse files
authored
Merge pull request #683 from LLNL/v0.6.2-rc
V0.6.2 Release Candidate
2 parents 058b312 + 8c7966e commit 9ff7734

25 files changed

+421
-499
lines changed

.gitlab-ci.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ stages:
1919
.build_script:
2020
script:
2121
#Use pre-existing allocation if any
22-
- JOBID=$(if [[ $SYS_TYPE = toss_* ]]; then squeue -h --name=${PROJECT_ALLOC_NAME} --format=%A; fi)
22+
- JOBID=$(if [[ "$SYS_TYPE" == "toss_4_x86_64_ib" ]]; then squeue -h --name=${PROJECT_ALLOC_NAME} --format=%A; fi)
2323
- ASSIGN_ID=$(if [[ -n "${JOBID}" ]]; then echo "--jobid=${JOBID}"; fi)
2424
#BUILD + TEST
2525
- echo -e "section_start:$(date +%s):build_and_test\r\e[0K

.gitlab/build_lassen.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -67,5 +67,5 @@ lassen-clang_14.0.5_with_gcc_8.3.1_nvcc_c++_only:
6767
lassen-clang_10.0.1_nvcc_cuda_clang_test:
6868
variables:
6969
ENABLED_BLT_TESTS: "cuda-arch cuda-mpi-cpp"
70-
HOST_CONFIG: "cuda-arch/base/[email protected]_nvcc_c++14_lassen.cmake"
70+
HOST_CONFIG: "[email protected]_nvcc_c++17.cmake"
7171
extends: [.run_project_integration_test_on_lassen, .with_cuda]

.gitlab/build_quartz.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,6 @@ quartz-intel_2022_1_0_cxx17:
7878
# HIP project tests
7979
quartz_openmp_mpi_fortran_tests:
8080
variables:
81-
HOST_CONFIG: openmp-cpp-fortran/base/[email protected]
8281
ENABLED_BLT_TESTS: "mpi-cpp-fortran,openmp-cpp-fortran,openmp-mpi-cpp"
82+
HOST_CONFIG: "[email protected]"
8383
extends: [.run_project_integration_test_on_quartz]

.gitlab/build_tioga.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -38,5 +38,5 @@ tioga-clang_14_0_0_hip:
3838
tioga-clang_14.0.1_hip_config_test:
3939
variables:
4040
ENABLED_BLT_TESTS: "hip-config-test"
41-
HOST_CONFIG: "hip-config-test/base/[email protected]_hip.cmake"
41+
HOST_CONFIG: "[email protected]_hip.cmake"
4242
extends: [.run_project_integration_test_on_tioga]

.gitlab/run_project_integration_tests.sh

+3-7
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,7 @@
22

33
BLT_DIR=`pwd`
44
RUNNER_SCRIPT=`pwd`/tests/projects/run_tests.py
5-
cd `pwd`/tests/projects/
5+
HOST_CONFIG_PATH=`pwd`/host-configs/llnl/$SYS_TYPE/$HOST_CONFIG
66

7-
if [[ -z $HOST_CONFIG ]]; then
8-
HOST_CONFIG=`pwd`/tests/projects/$HOST_CONFIG
9-
python3 $RUNNER_SCRIPT --run-test $ENABLED_BLT_TESTS --verbose --clean --blt-source-dir $BLT_DIR
10-
else
11-
python3 $RUNNER_SCRIPT --run-test $ENABLED_BLT_TESTS --host-config $HOST_CONFIG --verbose --clean --blt-source-dir $BLT_DIR
12-
fi
7+
cd `pwd`/tests/projects/
8+
python3 $RUNNER_SCRIPT --run-test $ENABLED_BLT_TESTS --host-config $HOST_CONFIG_PATH --verbose --clean --blt-source-dir $BLT_DIR

RELEASE-NOTES.md

+16-1
Original file line numberDiff line numberDiff line change
@@ -9,6 +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.6.2] - Release date 2024-03-15
13+
14+
### Added
15+
- Added output for CMake's implicitly added link libraries and directories.
16+
17+
### Changed
18+
- OpenMP target now uses a generator expression for Fortran flags instead of replacing flags in
19+
Fortran targets created with BLT macros.
20+
- Remove setting CMP0076 to OLD which left relative paths in `target_sources()` instead of altering
21+
them to absolute paths.
22+
- Header-only libraries headers now show up under their own target in IDE project views instead of
23+
under downstream targets. This only works in CMake >= 3.19, otherwise they will not show up at all.
24+
- Raised version for base CMake version supported by BLT to 3.15 to support ALIAS targets across BLT.
25+
1226
## [Version 0.6.1] - Release date 2024-01-29
1327

1428
### Fixed
@@ -317,7 +331,8 @@ The project release numbers follow [Semantic Versioning](http://semver.org/spec/
317331

318332

319333

320-
[Unreleased]: https://github.com/LLNL/blt/compare/v0.6.1...develop
334+
[Unreleased]: https://github.com/LLNL/blt/compare/v0.6.2...develop
335+
[Version 0.6.2]: https://github.com/LLNL/blt/compare/v0.6.1...v0.6.2
321336
[Version 0.6.1]: https://github.com/LLNL/blt/compare/v0.6.0...v0.6.1
322337
[Version 0.6.0]: https://github.com/LLNL/blt/compare/v0.5.3...v0.6.0
323338
[Version 0.5.3]: https://github.com/LLNL/blt/compare/v0.5.2...v0.5.3

SetupBLT.cmake

+9-10
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.6.1" CACHE STRING "")
7+
set(BLT_VERSION "0.6.2" CACHE STRING "")
88
mark_as_advanced(BLT_VERSION)
99
message(STATUS "BLT Version: ${BLT_VERSION}")
1010

@@ -41,10 +41,10 @@ if (NOT BLT_LOADED)
4141
endif()
4242
unset(_is_multi_config)
4343

44-
if(${CMAKE_VERSION} VERSION_LESS 3.8.0)
44+
if(${CMAKE_VERSION} VERSION_LESS 3.15.0)
4545
message("*************************************")
4646
message("* Unsupported version of CMake detected.")
47-
message("* BLT requires CMake 3.8 or above.")
47+
message("* BLT requires CMake 3.15 or above.")
4848
message("* Some BLT features may not work.")
4949
message("*************************************")
5050
endif()
@@ -79,13 +79,12 @@ if (NOT BLT_LOADED)
7979
cmake_policy(SET CMP0074 NEW)
8080
endif()
8181

82-
# New turns relative target_sources() paths to absolute
83-
# Policy added in 3.13+
84-
# NOTE: this will be deprecated eventually but NEW causes
85-
# problems in header only libraries, OLD keeps current behavior
86-
if(POLICY CMP0076)
87-
cmake_policy(SET CMP0076 OLD)
88-
endif()
82+
################################
83+
# Enable various find commands to look in non-default paths
84+
################################
85+
set_property(GLOBAL PROPERTY FIND_LIBRARY_USE_LIB32_PATHS TRUE)
86+
set_property(GLOBAL PROPERTY FIND_LIBRARY_USE_LIB64_PATHS TRUE)
87+
set_property(GLOBAL PROPERTY FIND_LIBRARY_USE_LIBX32_PATHS TRUE)
8988

9089
################################
9190
# Invoke CMake Fortran setup

cmake/BLTMacros.cmake

+7-19
Original file line numberDiff line numberDiff line change
@@ -209,19 +209,13 @@ macro(blt_add_library)
209209
#
210210
# Header-only library support
211211
#
212-
foreach (_file ${arg_HEADERS})
213-
# Determine build location of headers
214-
get_filename_component(_absolute ${_file} ABSOLUTE)
215-
list(APPEND _build_headers ${_absolute})
216-
endforeach()
217-
218-
#Note: This only works if both libraries are handled in the same directory,
219-
# otherwise just don't include non-header files in your source list.
220-
set_source_files_properties(${_build_headers} PROPERTIES HEADER_FILE_ONLY ON)
221-
222-
add_library( ${arg_NAME} INTERFACE )
223-
target_sources( ${arg_NAME} INTERFACE
224-
$<BUILD_INTERFACE:${_build_headers}>)
212+
if( ${CMAKE_VERSION} VERSION_GREATER_EQUAL "3.19.0" )
213+
# Adding headers here allows them to show up in IDE projects but is not
214+
# necessary for building
215+
add_library( ${arg_NAME} INTERFACE ${arg_HEADERS} )
216+
else()
217+
add_library( ${arg_NAME} INTERFACE )
218+
endif()
225219
endif()
226220

227221
# Clear value of _have_fortran from previous calls
@@ -348,12 +342,6 @@ macro(blt_add_executable)
348342
set_target_properties(${arg_NAME} PROPERTIES LINKER_LANGUAGE ${_blt_link_lang})
349343
endif()
350344

351-
# fix the openmp flags for fortran if needed
352-
# NOTE: this needs to be called after blt_setup_target()
353-
if (_lang STREQUAL Fortran)
354-
blt_fix_fortran_openmp_flags( ${arg_NAME} )
355-
endif()
356-
357345
if ( arg_INCLUDES )
358346
target_include_directories(${arg_NAME} PUBLIC ${arg_INCLUDES})
359347
endif()

cmake/BLTPrivateMacros.cmake

-77
Original file line numberDiff line numberDiff line change
@@ -20,83 +20,6 @@ function(blt_error_if_target_exists target_name error_msg)
2020
endif()
2121
endfunction()
2222

23-
##-----------------------------------------------------------------------------
24-
## blt_fix_fortran_openmp_flags(<target name>)
25-
##
26-
## Fixes the openmp flags for a Fortran target if they are different from the
27-
## corresponding C/C++ OpenMP flags.
28-
##-----------------------------------------------------------------------------
29-
function(blt_fix_fortran_openmp_flags target_name)
30-
31-
if (ENABLE_FORTRAN AND ENABLE_OPENMP AND BLT_OPENMP_FLAGS_DIFFER)
32-
33-
# The OpenMP interface library will have been added as a direct
34-
# link dependency instead of via flags
35-
get_target_property(target_link_libs ${target_name} LINK_LIBRARIES)
36-
if ( target_link_libs )
37-
# Since this is only called on executable targets we can safely convert
38-
# from a "real" target back to a "fake" one as this is a sink vertex in
39-
# the DAG. Only the link flags need to be modified.
40-
list(FIND target_link_libs "openmp" _omp_index)
41-
list(FIND target_link_libs "blt::openmp" _blt_omp_index)
42-
if(${_omp_index} GREATER -1 OR ${_blt_omp_index} GREATER -1)
43-
message(STATUS "Fixing OpenMP Flags for target[${target_name}]")
44-
45-
# Remove openmp from libraries
46-
list(REMOVE_ITEM target_link_libs "openmp")
47-
list(REMOVE_ITEM target_link_libs "blt::openmp")
48-
set_target_properties( ${target_name} PROPERTIES
49-
LINK_LIBRARIES "${target_link_libs}" )
50-
51-
# Add openmp compile flags verbatim w/ generator expression
52-
get_target_property(omp_compile_flags openmp INTERFACE_COMPILE_OPTIONS)
53-
target_compile_options(${target_name} PUBLIC ${omp_compile_flags})
54-
55-
# Change CXX flags to Fortran flags
56-
57-
# These are set through blt_add_target_link_flags which needs to use
58-
# the link_libraries for interface libraries in CMake < 3.13
59-
if( ${CMAKE_VERSION} VERSION_GREATER_EQUAL "3.13.0" )
60-
get_target_property(omp_link_flags openmp INTERFACE_LINK_OPTIONS)
61-
else()
62-
get_target_property(omp_link_flags openmp INTERFACE_LINK_LIBRARIES)
63-
endif()
64-
65-
string( REPLACE "${OpenMP_CXX_FLAGS}" "${OpenMP_Fortran_FLAGS}"
66-
correct_omp_link_flags
67-
"${omp_link_flags}"
68-
)
69-
if( ${CMAKE_VERSION} VERSION_GREATER_EQUAL "3.13.0" )
70-
target_link_options(${target_name} PRIVATE "${correct_omp_link_flags}")
71-
else()
72-
set_property(TARGET ${target_name} APPEND PROPERTY LINK_FLAGS "${correct_omp_link_flags}")
73-
endif()
74-
endif()
75-
76-
# Handle registered library general case
77-
78-
# OpenMP is an interface library which doesn't have a LINK_FLAGS property
79-
# in versions < 3.13
80-
set(_property_name LINK_FLAGS)
81-
if( ${CMAKE_VERSION} VERSION_GREATER_EQUAL "3.13.0" )
82-
# In CMake 3.13+, LINK_FLAGS was converted to LINK_OPTIONS.
83-
set(_property_name LINK_OPTIONS)
84-
endif()
85-
get_target_property(target_link_flags ${target_name} ${_property_name})
86-
if ( target_link_flags )
87-
88-
string( REPLACE "${OpenMP_CXX_FLAGS}" "${OpenMP_Fortran_FLAGS}"
89-
correct_link_flags
90-
"${target_link_flags}"
91-
)
92-
set_target_properties( ${target_name} PROPERTIES ${_property_name}
93-
"${correct_link_flags}" )
94-
endif()
95-
endif()
96-
97-
endif()
98-
99-
endfunction()
10023

10124
##-----------------------------------------------------------------------------
10225
## blt_find_executable(NAME <name of program to find>

cmake/BLTSetupTargets.cmake

+30-22
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@
33
#
44
# SPDX-License-Identifier: (BSD-3-Clause)
55

6-
# This file is intended to be included in the *-config.cmake files of
7-
# any project using a third-party library. The macro
8-
# `blt_install_tpl_setups(DESTINATION <dir>)` installs this file
6+
# This file is intended to be included in the installed config files of
7+
# any project using BLT's third-party library as well as in a BLT project.
8+
# The macro `blt_install_tpl_setups(DESTINATION <dir>)` installs this file
99
# into the destination specified by the argument <dir>.
1010

1111
# BLTInstallableMacros provides helper macros for setting up and creating
@@ -14,40 +14,48 @@
1414
if (NOT BLT_LOADED)
1515
include("${CMAKE_CURRENT_LIST_DIR}/BLTInstallableMacros.cmake")
1616
endif()
17-
# If the generated TPL config file exists, include it here.
17+
18+
# Handle the two cases of TPL config variables, installed from upstream project
19+
# and the current/main BLT project. Prefix all variables here to not conflict with
20+
# non-BLT projects that load this as a configuration file.
1821
if (EXISTS "${CMAKE_CURRENT_LIST_DIR}/BLTThirdPartyConfigFlags.cmake")
22+
# Case: Imported BLT project (ie. an installed TPL loading its BLT targets)
1923
include("${CMAKE_CURRENT_LIST_DIR}/BLTThirdPartyConfigFlags.cmake")
2024
else()
21-
# Otherwise, configure the TPL flags. We have to prefix these variables with
22-
# BLT so that they never conflict with user-level CMake variables in downstream
23-
# projects.
24-
#
25-
# We have to do some checks before we overwrite these internal variables to assure
26-
# that we don't turn off a third-party library enabled by the dependency.
27-
if (NOT DEFINED BLT_ENABLE_HIP OR NOT ${BLT_ENABLE_HIP})
25+
# Case: Main BLT project (ie. a project loading it's own BLT)
26+
#
27+
# Always stay enabled if any upstream has already turned you on.
28+
if(NOT BLT_ENABLE_HIP)
2829
set(BLT_ENABLE_HIP ${ENABLE_HIP})
2930
endif()
30-
if (NOT DEFINED BLT_ENABLE_CUDA OR NOT ${BLT_ENABLE_CUDA})
31+
if(NOT BLT_ENABLE_CUDA)
3132
set(BLT_ENABLE_CUDA ${ENABLE_CUDA})
3233
endif()
33-
if (NOT DEFINED BLT_ENABLE_MPI OR NOT ${BLT_ENABLE_MPI})
34+
if(NOT BLT_ENABLE_MPI)
3435
set(BLT_ENABLE_MPI ${ENABLE_MPI})
3536
endif()
36-
if (NOT DEFINED BLT_ENABLE_OPENMP OR NOT ${BLT_ENABLE_OPENMP})
37+
if(NOT BLT_ENABLE_OPENMP)
3738
set(BLT_ENABLE_OPENMP ${ENABLE_OPENMP})
3839
endif()
39-
if (NOT DEFINED BLT_ENABLE_FIND_MPI OR NOT ${BLT_ENABLE_FIND_MPI})
40+
if(NOT BLT_ENABLE_FIND_MPI)
4041
set(BLT_ENABLE_FIND_MPI ${ENABLE_FIND_MPI})
4142
endif()
42-
set(BLT_ENABLE_CLANG_CUDA ${ENABLE_CLANG_CUDA})
43+
if(NOT BLT_ENABLE_CLANG_CUDA)
44+
set(BLT_ENABLE_CLANG_CUDA ${ENABLE_CLANG_CUDA})
45+
endif()
46+
47+
message(STATUS "BLT MPI support is ${BLT_ENABLE_MPI}")
48+
message(STATUS "BLT OpenMP support is ${BLT_ENABLE_OPENMP}")
49+
message(STATUS "BLT CUDA support is ${BLT_ENABLE_CUDA}")
50+
message(STATUS "BLT HIP support is ${BLT_ENABLE_HIP}")
4351
endif()
4452

4553
# Detect if Fortran has been introduced.
4654
get_property(_languages GLOBAL PROPERTY ENABLED_LANGUAGES)
4755
if(_languages MATCHES "Fortran")
48-
set(_fortran_already_enabled TRUE)
56+
set(_fortran_already_enabled TRUE)
4957
else()
50-
set(_fortran_already_enabled FALSE)
58+
set(_fortran_already_enabled FALSE)
5159
endif()
5260

5361
# Only update ENABLE_FORTRAN if it is a new requirement, don't turn
@@ -62,8 +70,8 @@ endif()
6270
# MPI
6371
#------------------------------------
6472
if (NOT TARGET mpi)
65-
message(STATUS "MPI Support is ${BLT_ENABLE_MPI}")
6673
if (BLT_ENABLE_MPI AND EXISTS "${CMAKE_CURRENT_LIST_DIR}/thirdparty/BLTSetupMPI.cmake")
74+
message(STATUS "Creating BLT MPI targets...")
6775
include("${CMAKE_CURRENT_LIST_DIR}/thirdparty/BLTSetupMPI.cmake")
6876
endif()
6977
endif()
@@ -73,8 +81,8 @@ endif()
7381
# OpenMP
7482
#------------------------------------
7583
if (NOT TARGET openmp)
76-
message(STATUS "OpenMP Support is ${BLT_ENABLE_OPENMP}")
7784
if (BLT_ENABLE_OPENMP AND EXISTS "${CMAKE_CURRENT_LIST_DIR}/thirdparty/BLTSetupOpenMP.cmake")
85+
message(STATUS "Creating BLT OpenMP targets...")
7886
include("${CMAKE_CURRENT_LIST_DIR}/thirdparty/BLTSetupOpenMP.cmake")
7987
endif()
8088
endif()
@@ -84,8 +92,8 @@ endif()
8492
# CUDA
8593
#------------------------------------
8694
if (NOT TARGET cuda)
87-
message(STATUS "CUDA Support is ${BLT_ENABLE_CUDA}")
8895
if (BLT_ENABLE_CUDA AND EXISTS "${CMAKE_CURRENT_LIST_DIR}/thirdparty/BLTSetupCUDA.cmake")
96+
message(STATUS "Creating BLT CUDA targets...")
8997
include("${CMAKE_CURRENT_LIST_DIR}/thirdparty/BLTSetupCUDA.cmake")
9098
endif()
9199
endif()
@@ -95,8 +103,8 @@ endif()
95103
# HIP
96104
#------------------------------------
97105
if (NOT TARGET blt_hip)
98-
message(STATUS "HIP Support is ${BLT_ENABLE_HIP}")
99106
if (BLT_ENABLE_HIP AND EXISTS "${CMAKE_CURRENT_LIST_DIR}/thirdparty/BLTSetupHIP.cmake")
107+
message(STATUS "Creating BLT HIP targets...")
100108
include("${CMAKE_CURRENT_LIST_DIR}/thirdparty/BLTSetupHIP.cmake")
101109
endif()
102110
endif()

0 commit comments

Comments
 (0)