Skip to content

Commit

Permalink
add cmake option for WHOLE_ARCHIVE
Browse files Browse the repository at this point in the history
  • Loading branch information
rrsettgast committed Aug 17, 2024
1 parent b315558 commit f0dd264
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 5 deletions.
9 changes: 6 additions & 3 deletions .github/workflows/ci_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -149,33 +149,39 @@ jobs:
- name: Ubuntu (20.04, gcc 9.4.0, open-mpi 4.0.3)
CMAKE_BUILD_TYPE: Release
DOCKER_REPOSITORY: geosx/ubuntu20.04-gcc9
BUILD_SHARED_LIBS: ON

- name: Ubuntu debug (20.04, gcc 10.5.0, open-mpi 4.0.3) - github codespaces
CMAKE_BUILD_TYPE: Debug
DOCKER_REPOSITORY: geosx/ubuntu20.04-gcc10
BUILD_SHARED_LIBS: ON

- name: Ubuntu (20.04, gcc 10.5.0, open-mpi 4.0.3) - github codespaces
CMAKE_BUILD_TYPE: Release
DOCKER_REPOSITORY: geosx/ubuntu20.04-gcc10
BUILD_SHARED_LIBS: ON

- name: Ubuntu (22.04, gcc 11.4.0, open-mpi 4.1.2)
CMAKE_BUILD_TYPE: Release
DOCKER_REPOSITORY: geosx/ubuntu22.04-gcc11
ENABLE_HYPRE: ON
ENABLE_TRILINOS: OFF
GCP_BUCKET: geosx/ubuntu22.04-gcc11
BUILD_SHARED_LIBS: ON

- name: Ubuntu (22.04, gcc 12.3.0, open-mpi 4.1.2)
CMAKE_BUILD_TYPE: Release
DOCKER_REPOSITORY: geosx/ubuntu22.04-gcc12
ENABLE_HYPRE: ON
ENABLE_TRILINOS: OFF
BUILD_SHARED_LIBS: ON

- name: Ubuntu (22.04, clang 15.0.7, open-mpi 4.1.2)
CMAKE_BUILD_TYPE: Release
DOCKER_REPOSITORY: geosx/ubuntu22.04-clang15
ENABLE_HYPRE: ON
ENABLE_TRILINOS: OFF
BUILD_SHARED_LIBS: ON

uses: ./.github/workflows/build_and_test.yml
with:
Expand All @@ -186,7 +192,6 @@ jobs:
ENABLE_HYPRE: ${{ matrix.ENABLE_HYPRE }}
ENABLE_TRILINOS: ${{ matrix.ENABLE_TRILINOS }}
GCP_BUCKET: ${{ matrix.GCP_BUCKET }}
HOST_CONFIG: ${{ matrix.HOST_CONFIG }}
RUNS_ON: ubuntu-22.04
secrets: inherit

Expand Down Expand Up @@ -329,8 +334,6 @@ jobs:
ENABLE_HYPRE_DEVICE: ${{ matrix.ENABLE_HYPRE_DEVICE }}
ENABLE_HYPRE: ${{ matrix.ENABLE_HYPRE }}
ENABLE_TRILINOS: ${{ matrix.ENABLE_TRILINOS }}
GCP_BUCKET: ${{ matrix.GCP_BUCKET }}
HOST_CONFIG: ${{ matrix.HOST_CONFIG }}
NPROC: ${{ matrix.NPROC }}
RUNS_ON: ${{ matrix.RUNS_ON }}
REQUIRED_LABEL: "ci: run CUDA builds"
Expand Down
2 changes: 1 addition & 1 deletion host-configs/apple/macOS_base.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ set( LAPACK_LIBRARIES ${HOMEBREW_DIR}/opt/lapack/lib/liblapack.dylib CACHE PATH
set(ENABLE_DOXYGEN OFF CACHE BOOL "" FORCE)
set(ENABLE_MATHPRESSO OFF CACHE BOOL "" FORCE )

set(GEOS_BUILD_SHARED_LIBS ON CACHE BOOL "" FORCE)
set(GEOS_BUILD_SHARED_LIBS OFF CACHE BOOL "" FORCE)



Expand Down
14 changes: 13 additions & 1 deletion src/coreComponents/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,19 @@ foreach( lib ${subdirs} )
endforeach()

add_library(geosx_core INTERFACE)
target_link_libraries(geosx_core INTERFACE mainInterface )
if( GEOS_BUILD_SHARED_LIBS)
target_link_libraries(geosx_core INTERFACE mainInterface )
else()
get_target_property( libs geosx_core INTERFACE_LINK_LIBRARIES )

set( linkLibs "" )
foreach( lib ${coreLibs} )
list( APPEND linkLibs "$<LINK_LIBRARY:WHOLE_ARCHIVE,${lib}>" )
endforeach()
message( "linkLibs = ${linkLibs}" )
target_link_libraries(geosx_core INTERFACE ${linkLibs} )
endif()
blt_print_target_properties( TARGET geosx_core )

geosx_add_code_checks( PREFIX coreComponents
EXCLUDES cmake constitutive/PVTPackage )
Expand Down

0 comments on commit f0dd264

Please sign in to comment.