mirror of
https://github.com/OPM/opm-simulators.git
synced 2025-02-25 18:55:30 -06:00
Use system-provided MUMPS library for AGMG
This require us to compile in a small glue module which maps the name of the internal routine to the system routine.
This commit is contained in:
parent
ff9da40f32
commit
30a7e953a7
@ -23,6 +23,16 @@ find_file (AGMG_SOURCES
|
|||||||
NO_DEFAULT_PATH
|
NO_DEFAULT_PATH
|
||||||
)
|
)
|
||||||
|
|
||||||
|
# AGMG is dependent on having the MUMPS library present
|
||||||
|
find_path (MUMPS_INCLUDE_DIR
|
||||||
|
dmumps_struc.h
|
||||||
|
PATH_SUFFIXES include
|
||||||
|
)
|
||||||
|
find_library (MUMPS_LIBRARY
|
||||||
|
NAMES dmumps_seq
|
||||||
|
DOC "MUltifrontal Massive Parallel sparse direct Solver"
|
||||||
|
)
|
||||||
|
|
||||||
# make sure that we can compile Fortran code
|
# make sure that we can compile Fortran code
|
||||||
if (AGMG_SOURCES)
|
if (AGMG_SOURCES)
|
||||||
enable_language (Fortran)
|
enable_language (Fortran)
|
||||||
@ -32,7 +42,7 @@ endif (AGMG_SOURCES)
|
|||||||
if (AGMG_SOURCES)
|
if (AGMG_SOURCES)
|
||||||
set (HAVE_AGMG 1 CACHE INT "Is AGMG present?")
|
set (HAVE_AGMG 1 CACHE INT "Is AGMG present?")
|
||||||
else (AGMG_SOURCES)
|
else (AGMG_SOURCES)
|
||||||
set (HAVE_AGMG "" CACHE INT "Is AGMG present?")
|
unset (HAVE_AGMG CACHE)
|
||||||
endif (AGMG_SOURCES)
|
endif (AGMG_SOURCES)
|
||||||
|
|
||||||
# handle REQUIRED and QUIET standard options
|
# handle REQUIRED and QUIET standard options
|
||||||
@ -40,5 +50,14 @@ include (FindPackageHandleStandardArgs)
|
|||||||
find_package_handle_standard_args (AGMG
|
find_package_handle_standard_args (AGMG
|
||||||
DEFAULT_MSG
|
DEFAULT_MSG
|
||||||
AGMG_SOURCES
|
AGMG_SOURCES
|
||||||
|
MUMPS_INCLUDE_DIR
|
||||||
|
MUMPS_LIBRARY
|
||||||
CMAKE_Fortran_COMPILER_SUPPORTS_F90
|
CMAKE_Fortran_COMPILER_SUPPORTS_F90
|
||||||
)
|
)
|
||||||
|
|
||||||
|
# add our own compatibility routine to link with system MUMPS
|
||||||
|
if (AGMG_SOURCES)
|
||||||
|
list (APPEND AGMG_SOURCES "${CMAKE_CURRENT_SOURCE_DIR}/cmake/Templates/dagmg_mumps.f90")
|
||||||
|
list (APPEND AGMG_INCLUDE_DIRS "${MUMPS_INCLUDE_DIR}")
|
||||||
|
list (APPEND AGMG_LIBRARIES "${MUMPS_LIBRARY}")
|
||||||
|
endif ()
|
||||||
|
11
cmake/Templates/dagmg_mumps.f90
Normal file
11
cmake/Templates/dagmg_mumps.f90
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
! AGMG expects an interface to MUMPS named like this
|
||||||
|
subroutine DAGMG_MUMPS (id)
|
||||||
|
|
||||||
|
! In here are the official defines for the parameter passed to
|
||||||
|
! MUMPS. These must match the corresponding ones in dagmg.f90
|
||||||
|
include 'dmumps_struc.h'
|
||||||
|
type (DMUMPS_STRUC) :: id
|
||||||
|
|
||||||
|
! Let the system library do all the heavy lifting
|
||||||
|
call DMUMPS (id)
|
||||||
|
end subroutine DAGMG_MUMPS
|
Loading…
Reference in New Issue
Block a user