Files
opm-simulators/opm-simulators-prereqs.cmake
T

78 lines
2.5 KiB
CMake

find_package(Boost COMPONENTS date_time REQUIRED)
find_package(dune-common REQUIRED)
find_package(dune-istl REQUIRED)
find_package(BLAS REQUIRED)
find_package(LAPACK REQUIRED)
find_package(SuiteSparse COMPONENTS UMFPACK REQUIRED)
find_package(opm-grid REQUIRED)
if(TARGET opmsimulators)
# This branch is executed if find_package(opm-simulators) was called.
get_property(opm-simulators_libs TARGET opmsimulators PROPERTY INTERFACE_LINK_LIBRARIES)
get_property(opm-simulators_def TARGET opmsimulators PROPERTY INTERFACE_COMPILE_DEFINITIONS)
if(opm-simulators_def MATCHES USE_HIP)
enable_language(HIP)
elseif(opm-simulators_def MATCHES HAVE_CUDA)
include(UseCUDA)
find_package(CUDAToolkit REQUIRED)
endif()
if(opm-simulators_libs MATCHES ParMETIS::ParMETIS)
find_package(ParMETIS REQUIRED)
endif()
if(opm-simulators_libs MATCHES OpenCL::OpenCL)
find_package(OpenCL REQUIRED)
endif()
if(opm-simulators_libs MATCHES VexCL::Common)
find_package(VexCL REQUIRED)
endif()
if(opm-simulators_libs MATCHES amgcl::amgcl)
find_package(amgcl REQUIRED)
endif()
if(opm-simulators_libs MATCHES HDF5::HDF5)
find_package(HDF5 REQUIRED)
endif()
if(opm-simulators_libs MATCHES roc::rocsparse)
find_package(rocsparse REQUIRED)
endif()
if(opm-simulators_libs MATCHES roc::rocblas)
find_package(rocblas REQUIRED)
endif()
if(opm-simulators_libs MATCHES roc::rocalution)
find_package(rocalution REQUIRED)
endif()
if(opm-simulators_libs MATCHES roc::hipblas)
find_package(hipblas REQUIRED)
endif()
if(opm-simulators_libs MATCHES roc::hipsparse)
find_package(hipsparse REQUIRED)
endif()
if(opm-simulators_libs MATCHES HYPRE::HYPRE)
find_package(HYPRE REQUIRED)
endif()
if(opm-simulators_libs MATCHES AMGX::AMGX)
find_package(AMGX REQUIRED)
endif()
if(opm-simulators_libs MATCHES damaris)
find_package(Damaris 1.9 REQUIRED)
endif()
if(opm-simulators_libs MATCHES dunealugrid)
find_package(dune-alugrid REQUIRED)
endif()
if(opm-simulators_libs MATCHES dunefem)
find_package(dune-fem REQUIRED)
endif()
else()
# This branch is excuted when cmake is run for opom-simulators
find_package(fmt)
find_package(HDF5)
find_package(MPI)
find_package(ParMETIS)
# Note: have to look for alugrid before dune-fem.
# If not dune-fem finds alugrid, but does not use
# the opm find-module which means the HAVE_DUNE_ALUGRID
# define will be missing.
find_package(dune-alugrid)
find_package(dune-fem)
endif()