Merge pull request #5794 from akva2/fix_serial_build_hypre

fixed: remove HYPRE from prereqs
This commit is contained in:
Arne Morten Kvarving 2024-12-11 13:52:45 +01:00 committed by GitHub
commit c3921711b8
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 28 additions and 24 deletions

View File

@ -289,6 +289,20 @@ if(OpenCL_FOUND)
endif()
endif()
if(USE_HYPRE AND USE_MPI)
find_package(HYPRE)
if(HYPRE_FOUND)
set(HAVE_HYPRE 1)
list(APPEND opm-simulators_LIBRARIES HYPRE::HYPRE)
else()
message(WARNING "Hypre requested but not found. Continuing without Hypre support.")
set(USE_HYPRE OFF)
endif()
elseif(USE_HYPRE)
message(WARNING "Hypre requested but MPI not activated. Continuing without Hypre support.")
set(USE_HYPRE OFF)
set(HYPRE_FOUND OFF)
endif()
macro (config_hook)
opm_need_version_of ("dune-common")
@ -396,6 +410,12 @@ macro (files_hook)
endmacro (files_hook)
macro (tests_hook)
if(HYPRE_FOUND)
list(APPEND tests_SOURCES tests/test_HyprePreconditionerCPU.cpp)
if(HYPRE_USING_CUDA OR HYPRE_USING_HIP)
list(APPEND tests_SOURCES tests/test_HyprePreconditionerGPU.cpp)
endif()
endif()
endmacro (tests_hook)
@ -692,6 +712,14 @@ if(CUDA_FOUND)
PROPERTIES LABELS ${gpu_label})
endif()
if(HYPRE_FOUND)
if (HYPRE_USING_CUDA)
set_tests_properties(HyprePreconditionerGPU PROPERTIES LABELS gpu_cuda)
elseif (HYPRE_USING_HIP)
set_tests_properties(HyprePreconditionerGPU PROPERTIES LABELS gpu_hip)
endif()
endif()
if(USE_GPU_BRIDGE)
if(OpenCL_FOUND)
target_link_libraries( opmsimulators PUBLIC ${OpenCL_LIBRARIES} )
@ -722,18 +750,3 @@ endif()
install(DIRECTORY doc/man1 DESTINATION ${CMAKE_INSTALL_MANDIR}
FILES_MATCHING PATTERN "*.1")
if(USE_HYPRE)
find_package(HYPRE)
if(HYPRE_FOUND)
set(HAVE_HYPRE 1)
target_link_libraries(opmsimulators PUBLIC HYPRE::HYPRE)
if (HYPRE_USING_CUDA)
set_tests_properties(HyprePreconditionerGPU PROPERTIES LABELS gpu_cuda)
elseif (HYPRE_USING_HIP)
set_tests_properties(HyprePreconditionerGPU PROPERTIES LABELS gpu_hip)
endif()
else()
message(WARNING "Hypre requested but not found. Continuing without Hypre support.")
set(USE_HYPRE OFF)
endif()
endif()

View File

@ -492,13 +492,6 @@ if(HDF5_FOUND)
list(APPEND TEST_SOURCE_FILES tests/test_HDF5Serializer.cpp)
endif()
if(HYPRE_FOUND)
list(APPEND TEST_SOURCE_FILES tests/test_HyprePreconditionerCPU.cpp)
if(HYPRE_USING_CUDA OR HYPRE_USING_HIP)
list(APPEND TEST_SOURCE_FILES tests/test_HyprePreconditionerGPU.cpp)
endif()
endif()
list (APPEND TEST_DATA_FILES
tests/equil_base.DATA
tests/equil_capillary.DATA

View File

@ -57,8 +57,6 @@ set (opm-simulators_DEPS
# packages from ROCm framework
"rocblas"
"rocsparse"
# HYPRE solver library
"HYPRE"
# OPM dependency
"opm-common REQUIRED"
"opm-grid REQUIRED"