Merge pull request #5963 from akva2/fix_shared

Fix shared library linking issues
This commit is contained in:
Markus Blatt 2025-02-10 13:47:12 +01:00 committed by GitHub
commit 78ba88e7a9
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 6 additions and 2 deletions

View File

@ -538,6 +538,9 @@ endif()
add_library(moduleVersion OBJECT opm/simulators/utils/moduleVersion.cpp) add_library(moduleVersion OBJECT opm/simulators/utils/moduleVersion.cpp)
set_property(TARGET moduleVersion PROPERTY POSITION_INDEPENDENT_CODE ON) set_property(TARGET moduleVersion PROPERTY POSITION_INDEPENDENT_CODE ON)
add_library(MainDispatchDynamic OBJECT opm/simulators/flow/MainDispatchDynamic.cpp)
set_property(TARGET MainDispatchDynamic PROPERTY POSITION_INDEPENDENT_CODE ON)
# Strictly we only depend on the update-version target, # Strictly we only depend on the update-version target,
# but this is not exposed in a super-build. # but this is not exposed in a super-build.
add_dependencies(moduleVersion opmsimulators) add_dependencies(moduleVersion opmsimulators)
@ -587,6 +590,7 @@ opm_add_test(flow
flow/flow.cpp flow/flow.cpp
${FLOW_TGTS} ${FLOW_TGTS}
$<TARGET_OBJECTS:moduleVersion> $<TARGET_OBJECTS:moduleVersion>
$<TARGET_OBJECTS:MainDispatchDynamic>
) )
opm_add_test(flow_blackoil_polyhedralgrid opm_add_test(flow_blackoil_polyhedralgrid
@ -609,6 +613,7 @@ opm_add_test(flow_distribute_z
flow/flow_distribute_z.cpp flow/flow_distribute_z.cpp
${FLOW_TGTS} ${FLOW_TGTS}
$<TARGET_OBJECTS:moduleVersion> $<TARGET_OBJECTS:moduleVersion>
$<TARGET_OBJECTS:MainDispatchDynamic>
) )
opm_add_test(flowexp_blackoil opm_add_test(flowexp_blackoil
@ -695,7 +700,7 @@ if(CUDA_FOUND)
${CUDA_nvptxcompiler_static_LIBRARY} ${CUDA_nvptxcompiler_static_LIBRARY}
) )
foreach(tgt test_gpu_safe_call test_cuda_check_last_error test_GpuVector) foreach(tgt test_gpu_safe_call test_cuda_check_last_error test_GpuVector test_is_gpu_pointer)
target_link_libraries(${tgt} CUDA::cudart) target_link_libraries(${tgt} CUDA::cudart)
endforeach() endforeach()
endif() endif()

View File

@ -107,7 +107,6 @@ list (APPEND MAIN_SOURCE_FILES
opm/simulators/flow/KeywordValidation.cpp opm/simulators/flow/KeywordValidation.cpp
opm/simulators/flow/LogOutputHelper.cpp opm/simulators/flow/LogOutputHelper.cpp
opm/simulators/flow/Main.cpp opm/simulators/flow/Main.cpp
opm/simulators/flow/MainDispatchDynamic.cpp
opm/simulators/flow/MechContainer.cpp opm/simulators/flow/MechContainer.cpp
opm/simulators/flow/MICPContainer.cpp opm/simulators/flow/MICPContainer.cpp
opm/simulators/flow/MixingRateControls.cpp opm/simulators/flow/MixingRateControls.cpp