Skip to content
Open
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
672 changes: 547 additions & 125 deletions CMakeLists.txt

Large diffs are not rendered by default.

52 changes: 52 additions & 0 deletions cmake/apply-patches.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
# Apply one or more unified patches without failing when a patch is already
# present in an incremental ExternalProject build.
if( NOT DEFINED GEOS_PATCH_FILES OR GEOS_PATCH_FILES STREQUAL "" )
message( FATAL_ERROR "GEOS_PATCH_FILES must name at least one patch file." )
endif()

if( NOT DEFINED GEOS_PATCH_STRIP OR GEOS_PATCH_STRIP STREQUAL "" )
set( GEOS_PATCH_STRIP 1 )
endif()

# A pipe is used as the list separator because semicolons are list separators
# in CMake command-line definitions.
string( REPLACE "|" ";" _geos_patch_files "${GEOS_PATCH_FILES}" )

foreach( _geos_patch_file IN LISTS _geos_patch_files )
if( NOT EXISTS "${_geos_patch_file}" )
message( FATAL_ERROR "Patch file does not exist: ${_geos_patch_file}" )
endif()

execute_process(
COMMAND patch --batch --forward --dry-run -p${GEOS_PATCH_STRIP} -i "${_geos_patch_file}"
RESULT_VARIABLE _geos_patch_forward_status
OUTPUT_VARIABLE _geos_patch_forward_output
ERROR_VARIABLE _geos_patch_forward_error )

if( _geos_patch_forward_status EQUAL 0 )
execute_process(
COMMAND patch --batch --forward -p${GEOS_PATCH_STRIP} -i "${_geos_patch_file}"
RESULT_VARIABLE _geos_patch_apply_status
OUTPUT_VARIABLE _geos_patch_apply_output
ERROR_VARIABLE _geos_patch_apply_error )
if( NOT _geos_patch_apply_status EQUAL 0 )
message( FATAL_ERROR
"Failed to apply patch ${_geos_patch_file}:\n"
"${_geos_patch_apply_output}${_geos_patch_apply_error}" )
endif()
else()
execute_process(
COMMAND patch --batch --reverse --dry-run -p${GEOS_PATCH_STRIP} -i "${_geos_patch_file}"
RESULT_VARIABLE _geos_patch_reverse_status
OUTPUT_VARIABLE _geos_patch_reverse_output
ERROR_VARIABLE _geos_patch_reverse_error )
if( _geos_patch_reverse_status EQUAL 0 )
message( STATUS "Patch already applied: ${_geos_patch_file}" )
else()
message( FATAL_ERROR
"Patch cannot be applied or recognized as already applied: ${_geos_patch_file}\n"
"Forward check:\n${_geos_patch_forward_output}${_geos_patch_forward_error}\n"
"Reverse check:\n${_geos_patch_reverse_output}${_geos_patch_reverse_error}" )
endif()
endif()
endforeach()
119 changes: 119 additions & 0 deletions cmake/geos-host-config.cmake.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,119 @@
# Generated by the legacy GEOS TPL build.
# Configuration: @GEOS_TPL_HOST_CONFIG_FILENAME@
#
# This file configures a downstream GEOS build. It intentionally does not
# set CMAKE_INSTALL_PREFIX, so the GEOS installation location remains a
# downstream choice.

set(GEOS_TPL_HOST_CONFIG_LOADED ON CACHE INTERNAL "Generated GEOS TPL host config loaded")
set(GEOS_TPL_DIR "@GEOS_TPL_HOST_CONFIG_TPL_DIR@" CACHE PATH "GEOS third-party library installation")

set(CMAKE_BUILD_TYPE "@CMAKE_BUILD_TYPE@" CACHE STRING "")
set(CMAKE_C_COMPILER "@CMAKE_C_COMPILER@" CACHE FILEPATH "")
set(CMAKE_CXX_COMPILER "@CMAKE_CXX_COMPILER@" CACHE FILEPATH "")
set(CMAKE_Fortran_COMPILER "@CMAKE_Fortran_COMPILER@" CACHE FILEPATH "")
set(CMAKE_CXX_STANDARD "@GEOS_TPL_HOST_CONFIG_CXX_STANDARD@" CACHE STRING "")
set(CMAKE_CXX_STANDARD_REQUIRED ON CACHE BOOL "")
set(CMAKE_CXX_EXTENSIONS OFF CACHE BOOL "")
set(BLT_CXX_STD "@BLT_CXX_STD@" CACHE STRING "")
set(ENABLE_FORTRAN OFF CACHE BOOL "")
set(CMAKE_C_FLAGS "@CMAKE_C_FLAGS@" CACHE STRING "")
set(CMAKE_CXX_FLAGS "@CMAKE_CXX_FLAGS@" CACHE STRING "")

set(ENABLE_MPI "@ENABLE_MPI@" CACHE BOOL "")
set(MPI_C_COMPILER "@MPI_C_COMPILER@" CACHE FILEPATH "")
set(MPI_CXX_COMPILER "@MPI_CXX_COMPILER@" CACHE FILEPATH "")
set(MPI_Fortran_COMPILER "@MPI_Fortran_COMPILER@" CACHE FILEPATH "")
set(MPIEXEC_EXECUTABLE "@GEOS_TPL_HOST_CONFIG_MPIEXEC@" CACHE FILEPATH "")
set(MPIEXEC_NUMPROC_FLAG "@GEOS_TPL_HOST_CONFIG_MPIEXEC_NUMPROC_FLAG@" CACHE STRING "")

set(CMAKE_PREFIX_PATH "@GEOS_TPL_HOST_CONFIG_PREFIX_PATH@" CACHE STRING "")
set(RAJA_DIR "@RAJA_DIR@" CACHE PATH "")
set(CAMP_DIR "@GEOS_TPL_HOST_CONFIG_CAMP_DIR@" CACHE PATH "")
set(UMPIRE_DIR "@CHAI_DIR@" CACHE PATH "")
set(CHAI_DIR "@CHAI_DIR@" CACHE PATH "")
set(HDF5_DIR "@HDF5_DIR@" CACHE PATH "")
set(CONDUIT_DIR "@CONDUIT_DIR@" CACHE PATH "")
set(SILO_DIR "@SILO_DIR@" CACHE PATH "")
set(ADIAK_DIR "@ADIAK_DIR@" CACHE PATH "")
set(CALIPER_DIR "@CALIPER_DIR@" CACHE PATH "")
set(PUGIXML_DIR "@PUGIXML_DIR@" CACHE PATH "")
set(VTK_DIR "@VTK_DIR@" CACHE PATH "")
set(FMT_DIR "@GEOS_TPL_HOST_CONFIG_FMT_DIR@" CACHE PATH "")
set(METIS_DIR "@METIS_DIR@" CACHE PATH "")
set(PARMETIS_DIR "@PARMETIS_DIR@" CACHE PATH "")
set(SUPERLU_DIST_DIR "@SUPERLU_DIR@" CACHE PATH "")
set(SUITESPARSE_DIR "@SUITESPARSE_DIR@" CACHE PATH "")
# HypreDrive's package config may probe for a CMake HYPRE package while GEOS
# consumes the superbuild's headers and archive directly. That probe can leave
# HYPRE_DIR as HYPRE_DIR-NOTFOUND; recover that value on the next configure
# while preserving a valid explicit -DHYPRE_DIR override.
if(NOT DEFINED HYPRE_DIR OR HYPRE_DIR MATCHES "-NOTFOUND$")
set(HYPRE_DIR "@HYPRE_DIR@" CACHE PATH "" FORCE)
endif()
set(HYPREDRV_DIR "@HYPREDRV_DIR@" CACHE PATH "")
set(SCOTCH_DIR "@SCOTCH_DIR@" CACHE PATH "")
set(PETSC_DIR "@PETSC_INSTALL_DIR@" CACHE PATH "")
set(MATHPRESSO_DIR "@MATHPRESSO_DIR@" CACHE PATH "")
set(DOXYGEN_EXECUTABLE "@GEOS_TPL_HOST_CONFIG_DOXYGEN_EXECUTABLE@" CACHE FILEPATH "")
set(UNCRUSTIFY_EXECUTABLE "@GEOS_TPL_HOST_CONFIG_UNCRUSTIFY_EXECUTABLE@" CACHE FILEPATH "")

set(ENABLE_CALIPER "@ENABLE_CALIPER@" CACHE BOOL "")
set(ENABLE_CUDA "@ENABLE_CUDA@" CACHE BOOL "")
set(ENABLE_CUDA_NVTOOLSEXT "@GEOS_TPL_HOST_CONFIG_CUDA_NVTOOLSEXT@" CACHE BOOL "")
set(ENABLE_HIP "@ENABLE_HIP@" CACHE BOOL "")
set(ENABLE_OPENMP "@ENABLE_OPENMP@" CACHE BOOL "")
set(ENABLE_HYPRE "@ENABLE_HYPRE@" CACHE BOOL "")
set(ENABLE_HYPREDRV "@ENABLE_HYPREDRV@" CACHE BOOL "")
set(ENABLE_HYPRE_DEVICE "@GEOS_TPL_HOST_CONFIG_HYPRE_DEVICE@" CACHE STRING "")
set(ENABLE_HYPRE_GPU_AWARE_MPI "@GEOS_TPL_HOST_CONFIG_HYPRE_GPU_AWARE_MPI@" CACHE BOOL "")
set(ENABLE_HYPRE_GPU_PROFILING "@ENABLE_HYPRE_GPU_PROFILING@" CACHE BOOL "")
set(ENABLE_CALIPER_HYPRE "@GEOS_TPL_HOST_CONFIG_CALIPER_HYPRE@" CACHE BOOL "")
set(ENABLE_HYPRE_MIXINT "@GEOS_TPL_HOST_CONFIG_HYPRE_MIXINT@" CACHE BOOL "")
set(GEOS_LA_INTERFACE "@GEOS_TPL_HOST_CONFIG_LA_INTERFACE@" CACHE STRING "")
set(ENABLE_TRILINOS "@ENABLE_TRILINOS@" CACHE BOOL "")
set(ENABLE_PETSC "@ENABLE_PETSC@" CACHE BOOL "")
set(ENABLE_METIS "@GEOS_TPL_HOST_CONFIG_METIS@" CACHE BOOL "")
set(ENABLE_PARMETIS "@GEOS_TPL_HOST_CONFIG_PARMETIS@" CACHE BOOL "")
set(ENABLE_SCOTCH "@ENABLE_SCOTCH@" CACHE BOOL "")
set(ENABLE_SUPERLU_DIST "@ENABLE_SUPERLU_DIST@" CACHE BOOL "")
set(ENABLE_SUITESPARSE "@ENABLE_SUITESPARSE@" CACHE BOOL "")
set(ENABLE_SILO "@GEOS_TPL_HOST_CONFIG_SILO@" CACHE BOOL "")
set(ENABLE_MATHPRESSO "@GEOS_TPL_HOST_CONFIG_MATHPRESSO@" CACHE BOOL "")
set(ENABLE_VTK "@ENABLE_VTK@" CACHE BOOL "")
set(ENABLE_VTK_WRAP_PYTHON "@ENABLE_VTK_WRAP_PYTHON@" CACHE BOOL "")
set(ENABLE_UNCRUSTIFY "@GEOS_TPL_HOST_CONFIG_UNCRUSTIFY@" CACHE BOOL "")
set(ENABLE_DOXYGEN OFF CACHE BOOL "")
set(ENABLE_DOCS OFF CACHE BOOL "")
set(ENABLE_EXAMPLES OFF CACHE BOOL "")
set(ENABLE_BENCHMARKS OFF CACHE BOOL "")
set(ENABLE_TESTS ON CACHE BOOL "")
set(GEOS_ENABLE_TESTS ON CACHE BOOL "")

# Compare the substituted option as a string because this cache file is
# loaded before the downstream project establishes CMake's boolean policies.
if("@ENABLE_CUDA@" STREQUAL "ON")
set(CMAKE_CUDA_COMPILER "@CMAKE_CUDA_COMPILER@" CACHE FILEPATH "")
set(CMAKE_CUDA_HOST_COMPILER "@CMAKE_CUDA_HOST_COMPILER@" CACHE FILEPATH "")
set(CUDA_TOOLKIT_ROOT_DIR "@CUDA_TOOLKIT_ROOT_DIR@" CACHE PATH "")
set(CUDA_ARCH "@CUDA_ARCH@" CACHE STRING "")
set(CMAKE_CUDA_ARCHITECTURES "@CMAKE_CUDA_ARCHITECTURES@" CACHE STRING "")
set(CMAKE_CUDA_STANDARD "@CMAKE_CUDA_STANDARD@" CACHE STRING "")
set(CMAKE_CUDA_STANDARD_REQUIRED ON CACHE BOOL "")
set(CMAKE_CUDA_FLAGS "@CMAKE_CUDA_FLAGS@" CACHE STRING "")
endif()

if("@ENABLE_HIP@" STREQUAL "ON")
set(CMAKE_HIP_COMPILER "@CMAKE_HIP_COMPILER@" CACHE FILEPATH "")
set(CMAKE_HIP_ARCHITECTURES "@CMAKE_HIP_ARCHITECTURES@" CACHE STRING "")
set(CMAKE_HIP_STANDARD "@CMAKE_HIP_STANDARD@" CACHE STRING "")
set(CMAKE_HIP_STANDARD_REQUIRED ON CACHE BOOL "")
set(ROCM_PATH "@ROCM_PATH@" CACHE PATH "")
set(HIP_ROOT "@HIP_ROOT@" CACHE PATH "")
set(CMAKE_HIP_FLAGS "@CMAKE_HIP_FLAGS@" CACHE STRING "")
set(GPU_TARGETS "@CMAKE_HIP_ARCHITECTURES@" CACHE STRING "")
set(AMDGPU_TARGETS "@CMAKE_HIP_ARCHITECTURES@" CACHE STRING "")
endif()

set(BLAS_LIBRARIES "@BLAS_LIBRARIES@" CACHE STRING "")
set(LAPACK_LIBRARIES "@LAPACK_LIBRARIES@" CACHE STRING "")
24 changes: 24 additions & 0 deletions patch/hypre-hip-rocsparse-sort.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
--- a/src/seq_mv/csr_matop_device.c
+++ b/src/seq_mv/csr_matop_device.c
@@ -4016,6 +4016,21 @@
void *pBuffer = NULL;
HYPRE_Int *P = NULL;
HYPRE_Complex *d_a_tmp;
+#if defined(HYPRE_USING_HIP)
+ /*
+ * ROCm 7.2's legacy rocSPARSE csrsort path poisons the subsequent
+ * csritilu0 preprocessing on gfx1100. Use HYPRE's device-side stable
+ * tuple sort instead. The row index is a secondary key; row pointers
+ * remain valid because entries from different rows are never exchanged.
+ */
+ HYPRE_Int *d_row_ind = hypre_CsrRowPtrsToIndicesDevice(n, num_nonzeros,
+ (HYPRE_Int *) d_ia);
+ hypre_StableSortByTupleKeyDevice(num_nonzeros, d_row_ind, d_ja_sorted,
+ d_a_sorted, 0);
+ hypre_ForceSyncComputeStream();
+ hypre_TFree(d_row_ind, HYPRE_MEMORY_DEVICE);
+ return hypre_error_flag;
+#endif

// FIXME: There is not in-place version of csr sort in rocSPARSE currently, so we make
// a temporary copy of the data for gthr, sort that, and then copy the sorted values
28 changes: 28 additions & 0 deletions patch/hypre-hip-standard-ilu.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
--- a/src/parcsr_ls/par_ilu_setup_device.c
+++ b/src/parcsr_ls/par_ilu_setup_device.c
@@ -161,1 +161,1 @@
-#if !defined(HYPRE_USING_SYCL)
+#if !defined(HYPRE_USING_SYCL) && !defined(HYPRE_USING_HIP)
@@ -187,0 +188,15 @@
+#if defined(HYPRE_USING_HIP)
+ /*
+ * rocSPARSE's legacy csrilu0 analysis is not functional on the
+ * gfx1100 devices shipped with ROCm 7.2. Use HYPRE's classical
+ * ILU(0) implementation instead. The factorization is performed
+ * on the host only during setup and the resulting LDU factors are
+ * migrated back to the device by hypre_ILUSetupLDUtoVendor.
+ */
+ if (fill_level == 0 && !(ilu_type % 10))
+ {
+ hypre_ParCSRMatrixMigrate(Apq, HYPRE_MEMORY_HOST);
+ hypre_ILUSetupILU0(Apq, NULL, NULL, n, n,
+ &parL, &parD, &parU, &parS, &uend);
+ }
+#endif
@@ -214,0 +215,6 @@
+#if defined(HYPRE_USING_HIP)
+ else if (fill_level == 0 && !(ilu_type % 10))
+ {
+ hypre_TFree(parD, HYPRE_MEMORY_HOST);
+ }
+#endif
12 changes: 12 additions & 0 deletions patch/hypre-mixedint-export.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
diff --git a/src/parcsr_mv/par_csr_matrix.c b/src/parcsr_mv/par_csr_matrix.c
--- a/src/parcsr_mv/par_csr_matrix.c
+++ b/src/parcsr_mv/par_csr_matrix.c
@@ -2458,1 +2458,1 @@
- HYPRE_Int contact_send_buf[1];
+ HYPRE_BigInt contact_send_buf[1];
@@ -2504,1 +2504,1 @@
- contact_send_buf[0] = (HYPRE_Int) hypre_ParCSRMatrixLastRowIndex(par_matrix);
+ contact_send_buf[0] = hypre_ParCSRMatrixLastRowIndex(par_matrix);
@@ -2533,1 +2533,1 @@
- contact_send_buf_starts, sizeof(HYPRE_Int),
+ contact_send_buf_starts, sizeof(HYPRE_BigInt),
7 changes: 7 additions & 0 deletions patch/hypre-rcm-capacity.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
diff --git a/src/parcsr_ls/par_ilu.c b/src/parcsr_ls/par_ilu.c
--- a/src/parcsr_ls/par_ilu.c
+++ b/src/parcsr_ls/par_ilu.c
@@ -2579,1 +2579,2 @@
- G_capacity = hypre_max((A_nnz * n * n / num_nodes / num_nodes) - num_nodes, 1);
+ G_capacity = hypre_max((HYPRE_Int)((HYPRE_Real) A_nnz * n * n /
+ num_nodes / num_nodes) - num_nodes, 1);
8 changes: 8 additions & 0 deletions patch/hypre-tagged-innerprod.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
diff --git a/src/seq_mv/vector.c b/src/seq_mv/vector.c
--- a/src/seq_mv/vector.c
+++ b/src/seq_mv/vector.c
@@ -1384,1 +1384,1 @@
- num_threads * num_tags,
+ num_threads * (num_tags + 1),
@@ -1413,0 +1414,1 @@
+ hypre_TFree(thread_sums, HYPRE_MEMORY_HOST);
87 changes: 87 additions & 0 deletions patch/hypre-umpire-wrapper-lifetime.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
diff --git a/src/utilities/umpire.c b/src/utilities/umpire.c
--- a/src/utilities/umpire.c
+++ b/src/utilities/umpire.c
@@ -44,0 +45,1 @@
+ umpire_allocator_delete(&allocator);
@@ -140,0 +141,1 @@
+ umpire_allocator_delete(&allocator);
@@ -202,0 +203,1 @@
+ umpire_allocator_delete(&allocator);
@@ -265,0 +266,1 @@
+ umpire_allocator_delete(&allocator);
@@ -354,43 +358,63 @@ hypre_UmpireFinalize(hypre_Handle *hypre_handle_)
umpire_allocator allocator;

#if defined(HYPRE_USING_UMPIRE_HOST)
- if (hypre_HandleUmpireOwnHostPool(hypre_handle_))
+ if (hypre_HandleUmpireHostAllocatorAddress(hypre_handle_))
{
- allocator = hypre_HandleUmpireHostPool(hypre_handle_);
- umpire_allocator_release(&allocator);
+ if (hypre_HandleUmpireOwnHostPool(hypre_handle_))
+ {
+ allocator = hypre_HandleUmpireHostPool(hypre_handle_);
+ umpire_allocator_release(&allocator);
+ }
+ umpire_allocator_delete(&hypre_HandleUmpireHostPool(hypre_handle_));
}
hypre_HandleUmpireHostAllocatorAddress(hypre_handle_) = NULL;
hypre_HandleUmpireHostAllocatorId(hypre_handle_) = 0;
+ hypre_HandleUmpireOwnHostPool(hypre_handle_) = 0;
#endif

#if defined(HYPRE_USING_UMPIRE_DEVICE)
- if (hypre_HandleUmpireOwnDevicePool(hypre_handle_))
+ if (hypre_HandleUmpireDeviceAllocatorAddress(hypre_handle_))
{
- allocator = hypre_HandleUmpireDevicePool(hypre_handle_);
- umpire_allocator_release(&allocator);
+ if (hypre_HandleUmpireOwnDevicePool(hypre_handle_))
+ {
+ allocator = hypre_HandleUmpireDevicePool(hypre_handle_);
+ umpire_allocator_release(&allocator);
+ }
+ umpire_allocator_delete(&hypre_HandleUmpireDevicePool(hypre_handle_));
}
hypre_HandleUmpireDeviceAllocatorAddress(hypre_handle_) = NULL;
hypre_HandleUmpireDeviceAllocatorId(hypre_handle_) = 0;
+ hypre_HandleUmpireOwnDevicePool(hypre_handle_) = 0;
#endif

#if defined(HYPRE_USING_UMPIRE_UM)
- if (hypre_HandleUmpireOwnUMPool(hypre_handle_))
+ if (hypre_HandleUmpireUMAllocatorAddress(hypre_handle_))
{
- allocator = hypre_HandleUmpireUMPool(hypre_handle_);
- umpire_allocator_release(&allocator);
+ if (hypre_HandleUmpireOwnUMPool(hypre_handle_))
+ {
+ allocator = hypre_HandleUmpireUMPool(hypre_handle_);
+ umpire_allocator_release(&allocator);
+ }
+ umpire_allocator_delete(&hypre_HandleUmpireUMPool(hypre_handle_));
}
hypre_HandleUmpireUMAllocatorAddress(hypre_handle_) = NULL;
hypre_HandleUmpireUMAllocatorId(hypre_handle_) = 0;
+ hypre_HandleUmpireOwnUMPool(hypre_handle_) = 0;
#endif

#if defined(HYPRE_USING_UMPIRE_PINNED)
- if (hypre_HandleUmpireOwnPinnedPool(hypre_handle_))
+ if (hypre_HandleUmpirePinnedAllocatorAddress(hypre_handle_))
{
- allocator = hypre_HandleUmpirePinnedPool(hypre_handle_);
- umpire_allocator_release(&allocator);
+ if (hypre_HandleUmpireOwnPinnedPool(hypre_handle_))
+ {
+ allocator = hypre_HandleUmpirePinnedPool(hypre_handle_);
+ umpire_allocator_release(&allocator);
+ }
+ umpire_allocator_delete(&hypre_HandleUmpirePinnedPool(hypre_handle_));
}
hypre_HandleUmpirePinnedAllocatorAddress(hypre_handle_) = NULL;
hypre_HandleUmpirePinnedAllocatorId(hypre_handle_) = 0;
+ hypre_HandleUmpireOwnPinnedPool(hypre_handle_) = 0;
#endif

return hypre_error_flag;
25 changes: 25 additions & 0 deletions patch/hypredrive-cxx-linker.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -235,6 +235,12 @@
$<BUILD_INTERFACE:HYPRE::HYPRE>
INTERFACE
$<INSTALL_INTERFACE:HYPRE::HYPRE>)
+if(HYPREDRV_HYPRE_USE_OPENMP)
+ find_package(OpenMP REQUIRED COMPONENTS C)
+ if(TARGET OpenMP::OpenMP_C)
+ target_link_libraries(HYPREDRV PUBLIC OpenMP::OpenMP_C)
+ endif()
+endif()

if(HYPREDRV_INSTRUMENTATION_LINK_FLAGS)
target_link_options(HYPREDRV PUBLIC ${HYPREDRV_INSTRUMENTATION_LINK_FLAGS})
@@ -419,4 +425,9 @@
# Define the main executable (hypredrive-cli)
add_executable(hypredrive-cli src/internal/main.c)
+# HYPRE's static dependency graph can contain C++ libraries such as
+# SuperLU_DIST. Select the C++ linker so the C++ runtime is linked as well.
+if(CMAKE_CXX_COMPILER)
+ set_property(TARGET hypredrive-cli PROPERTY LINKER_LANGUAGE CXX)
+endif()
target_link_libraries(hypredrive-cli PRIVATE ${HYPREDRV_INTERNAL_LINK_TARGET})
hypredrv_add_hypre_build_dependency(hypredrive-cli)
Loading
Loading