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:
Roland Kaufmann 2013-08-07 00:14:09 +02:00
parent ff9da40f32
commit 30a7e953a7
2 changed files with 31 additions and 1 deletions

View File

@ -23,6 +23,16 @@ find_file (AGMG_SOURCES
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
if (AGMG_SOURCES)
enable_language (Fortran)
@ -32,7 +42,7 @@ endif (AGMG_SOURCES)
if (AGMG_SOURCES)
set (HAVE_AGMG 1 CACHE INT "Is AGMG present?")
else (AGMG_SOURCES)
set (HAVE_AGMG "" CACHE INT "Is AGMG present?")
unset (HAVE_AGMG CACHE)
endif (AGMG_SOURCES)
# handle REQUIRED and QUIET standard options
@ -40,5 +50,14 @@ include (FindPackageHandleStandardArgs)
find_package_handle_standard_args (AGMG
DEFAULT_MSG
AGMG_SOURCES
MUMPS_INCLUDE_DIR
MUMPS_LIBRARY
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 ()

View 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