From da89066c217b16f1abe1bc7e952fc9824ce6f682 Mon Sep 17 00:00:00 2001 From: Salvatore Filippone Date: Tue, 12 Dec 2017 12:51:01 +0000 Subject: [PATCH] Add option in mumps for modules dir. --- config/pac.m4 | 59 ++++++++++++++++++++++++++++++++++++++++----------- configure.ac | 4 ++-- 2 files changed, 49 insertions(+), 14 deletions(-) diff --git a/config/pac.m4 b/config/pac.m4 index 60869b3c..eb5a7d83 100644 --- a/config/pac.m4 +++ b/config/pac.m4 @@ -823,6 +823,10 @@ AC_ARG_WITH(mumpsincdir, AC_HELP_STRING([--with-mumpsincdir=DIR], [Specify the d [mld2p4_cv_mumpsincdir=$withval], [mld2p4_cv_mumpsincdir='']) +AC_ARG_WITH(mumpsmoddir, AC_HELP_STRING([--with-mumpsmoddir=DIR], [Specify the directory for MUMPS modules.]), + [mld2p4_cv_mumpsmoddir=$withval], + [mld2p4_cv_mumpsmoddir='']) + AC_ARG_WITH(mumpslibdir, AC_HELP_STRING([--with-mumpslibdir=DIR], [Specify the directory for MUMPS library.]), [mld2p4_cv_mumpslibdir=$withval], [mld2p4_cv_mumpslibdir='']) @@ -838,6 +842,13 @@ elif test "x$mld2p4_cv_mumpsdir" != "x"; then AC_MSG_NOTICE([mumps dir $mld2p4_cv_mumpsdir]) MUMPS_INCLUDES="$FMFLAG$mld2p4_cv_mumpsdir" fi +if test "x$mld2p4_cv_mumpsmoddir" != "x"; then + AC_MSG_NOTICE([mumps dir $mld2p4_cv_mumpsmoddir]) + MUMPS_MODULES="$FMFLAG$mld2p4_cv_mumpsmoddir" +elif test "x$mld2p4_cv_mumpsdir" != "x"; then + AC_MSG_NOTICE([mumps dir $mld2p4_cv_mumpsdir]) + MUMPS_MODULES="$FMFLAG$mld2p4_cv_mumpsdir" +fi if test "x$mld2p4_cv_mumpslibdir" != "x"; then MUMPS_LIBS="-L$mld2p4_cv_mumpslibdir" elif test "x$mld2p4_cv_mumpsdir" != "x"; then @@ -851,36 +862,60 @@ ac_objext='o' ac_ext='f90' ac_fc="${MPIFC-$FC}"; save_FCFLAGS="$FCFLAGS"; -FCFLAGS=" $MUMPS_INCLUDES $save_FCFLAGS" +FCFLAGS="$MUMPS_MODULES $MUMPS_INCLUDES $save_FCFLAGS" AC_COMPILE_IFELSE([ program test use dmumps_struc_def end program test], - [pac_mumps_header_ok=yes; mld2p4_cv_mumpsincdir="$MUMPS_INCLUDES";], - [pac_mumps_header_ok=no; MUMPS_INCLUDES=""]) + [pac_mumps_header_ok=yes; mld2p4_cv_mumpmoddir="$MUMPS_MODULES";], + [pac_mumps_header_ok=no; MUMPS_MODULES=""]) if test "x$pac_mumps_header_ok" == "xno" ; then dnl Maybe Include or include subdirs? - MUMPS_INCLUDES="$FMFLAG$mld2p4_cv_mumpsdir/include" - FCFLAGS="$MUMPS_INCLUDES $save_CPPFLAGS" + MUMPS_MODULES="$FMFLAG$mld2p4_cv_mumpsdir/include" + FCFLAGS="$MUMPS_MODULES $save_CPPFLAGS" AC_COMPILE_IFELSE([ program test use dmumps_struc_def end program test], - [pac_mumps_header_ok=yes mld2p4_cv_mumpsincdir="$MUMPS_INCLUDES";], - [pac_mumps_header_ok=no; MUMPS_INCLUDES=""]) + [pac_mumps_header_ok=yes mld2p4_cv_mumpsmoddir="$MUMPS_MODULES";], + [pac_mumps_header_ok=no; MUMPS_MODULES=""]) fi if test "x$pac_mumps_header_ok" == "xno" ; then dnl Maybe Include or include subdirs? - MUMPS_INCLUDES="$FMFLAG$mld2p4_cv_mumpsdir/Include" - FCFLAGS="$MUMPS_INCLUDES $save_CPPFLAGS" + MUMPS_MODULES="$FMFLAG$mld2p4_cv_mumpsdir/Include" + FCFLAGS="$MUMPS_MODULES $save_CPPFLAGS" + + AC_COMPILE_IFELSE([ + program test + use dmumps_struc_def + end program test], + [pac_mumps_header_ok=yes mld2p4_cv_mumpsmoddir="$MUMPS_MODULES";], + [pac_mumps_header_ok=no; MUMPS_MODULES=""]) + fi +if test "x$pac_mumps_header_ok" == "xno" ; then + dnl Maybe Modules or modules subdirs? + MUMPS_MODULES="$FMFLAG$mld2p4_cv_mumpsdir/modules" + FCFLAGS="$MUMPS_MODULES $save_CPPFLAGS" + + AC_COMPILE_IFELSE([ + program test + use dmumps_struc_def + end program test], + [pac_mumps_header_ok=yes mld2p4_cv_mumpsmoddir="$MUMPS_MODULES";], + [pac_mumps_header_ok=no; MUMPS_MODULES=""]) + fi +if test "x$pac_mumps_header_ok" == "xno" ; then + dnl Maybe Modules or modules subdirs? + MUMPS_MODULES="$FMFLAG$mld2p4_cv_mumpsdir/Modules" + FCFLAGS="$MUMPS_MODULES $save_CPPFLAGS" AC_COMPILE_IFELSE([ program test use dmumps_struc_def end program test], - [pac_mumps_header_ok=yes mld2p4_cv_mumpsincdir="$MUMPS_INCLUDES";], - [pac_mumps_header_ok=no; MUMPS_INCLUDES=""]) + [pac_mumps_header_ok=yes mld2p4_cv_mumpsmoddir="$MUMPS_MODULES";], + [pac_mumps_header_ok=no; MUMPS_MODULES=""]) fi @@ -899,7 +934,7 @@ if test "x$pac_mumps_header_ok" == "xyes" ; then AC_TRY_LINK_FUNC(dmumps, [mld2p4_cv_have_mumps=yes;pac_mumps_lib_ok=yes;], [mld2p4_cv_have_mumps=no;pac_mumps_lib_ok=no; - MUMPS_LIBS="";MUMPS_INCLUDES=""]) + MUMPS_LIBS="";MUMPS_MODULES=""]) fi AC_MSG_RESULT($pac_mumps_lib_ok) fi diff --git a/configure.ac b/configure.ac index 848bc696..429d541d 100755 --- a/configure.ac +++ b/configure.ac @@ -630,8 +630,8 @@ AC_LANG([C]) PAC_CHECK_MUMPS if test "x$mld2p4_cv_have_mumps" == "xyes" ; then - MUMPS_FLAGS="-DHave_MUMPS_ $MUMPS_INCLUDES" - FDEFINES="$mld_cv_define_prepend-DHAVE_MUMPS_ $mld2p4_cv_mumpsincdir $FDEFINES" + MUMPS_FLAGS="-DHave_MUMPS_ $MUMPS_MODULES" + FDEFINES="$mld_cv_define_prepend-DHAVE_MUMPS_ $mld2p4_cv_mumpsmoddir $FDEFINES" else MUMPS_FLAGS="" fi