Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add BLT_CMAKE_IMPLICIT_LINK_LIBRARIES_EXCLUDE variable #598

Merged
merged 2 commits into from
Oct 5, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions RELEASE-NOTES.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@ The project release numbers follow [Semantic Versioning](http://semver.org/spec/
### Added
- Added `blt_convert_to_system_includes` macro to convert existing interface includes to system interface includes.
- `blt_check_code_compiles` which compiles a C++ code snippet and returns the result.
- Added variable ``BLT_CMAKE_IMPLICIT_LINK_LIBRARIES_EXCLUDE`` for filtering
link libraries implicitly added by CMake. See the following example host-config:
``host-configs/llnl/blueos_3_ppc64le_ib_p9/clang@upstream_nvcc_xlf.cmake``

### Changed
- Added three extra options to `blt_print_target_properties` macro to print properties of
Expand Down
19 changes: 19 additions & 0 deletions cmake/SetupCompilerOptions.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -373,3 +373,22 @@ if(BLT_CMAKE_IMPLICIT_LINK_DIRECTORIES_EXCLUDE)
message(STATUS "Updated CUDA implicit Link Directories: ${CMAKE_CUDA_IMPLICIT_LINK_DIRECTORIES}")
endif ()
endif()

##################################
# Remove implicit link libraries
##################################
if(BLT_CMAKE_IMPLICIT_LINK_LIBRARIES_EXCLUDE)
message(STATUS "Removing implicit link libraries: ${BLT_CMAKE_IMPLICIT_LINK_LIBRARIES_EXCLUDE}")
list(REMOVE_ITEM CMAKE_CXX_IMPLICIT_LINK_LIBRARIES ${BLT_CMAKE_IMPLICIT_LINK_LIBRARIES_EXCLUDE})
message(STATUS "Updated CXX implicit Link Libraries: ${CMAKE_CXX_IMPLICIT_LINK_LIBRARIES}")
list(REMOVE_ITEM CMAKE_C_IMPLICIT_LINK_LIBRARIES ${BLT_CMAKE_IMPLICIT_LINK_LIBRARIES_EXCLUDE})
message(STATUS "Updated C implicit Link Libraries: ${CMAKE_C_IMPLICIT_LINK_LIBRARIES}")
if (ENABLE_FORTRAN)
list(REMOVE_ITEM CMAKE_Fortran_IMPLICIT_LINK_LIBRARIES ${BLT_CMAKE_IMPLICIT_LINK_LIBRARIES_EXCLUDE})
message(STATUS "Updated Fortran implicit Link Libraries: ${CMAKE_Fortran_IMPLICIT_LINK_LIBRARIES}")
endif ()
if (ENABLE_CUDA)
list(REMOVE_ITEM CMAKE_CUDA_IMPLICIT_LINK_LIBRARIES ${BLT_CMAKE_IMPLICIT_LINK_LIBRARIES_EXCLUDE})
message(STATUS "Updated CUDA implicit Link Libraries: ${CMAKE_CUDA_IMPLICIT_LINK_LIBRARIES}")
endif ()
endif()
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,8 @@ set(BLT_MPI_COMMAND_APPEND "mpibind" CACHE PATH "")
set(CMAKE_Fortran_COMPILER_ID "XL" CACHE PATH "All of BlueOS compilers report clang due to nvcc, override to proper compiler family")
set(BLT_FORTRAN_FLAGS "-WF,-C!" CACHE PATH "Converts C-style comments to Fortran style in preprocessed files")

set(BLT_CMAKE_IMPLICIT_LINK_LIBRARIES_EXCLUDE "xlomp_ser" CACHE STRING "")

#------------------------------------------------------------------------------
# CUDA support
#------------------------------------------------------------------------------
Expand Down