From 4ba97a56baa997e3fc6c29b5bbb2b1d999feddf4 Mon Sep 17 00:00:00 2001 From: Salvatore Filippone Date: Tue, 16 Jul 2013 10:43:59 +0000 Subject: [PATCH] mld2p4-2: Make.inc.in config/pac.m4 configure.ac configure Added --with-extra-libs to handle additional requirements coming from, e.g., SuperLU_Dist needing ParMetis --- Make.inc.in | 3 ++- config/pac.m4 | 37 ++++++++++++++++++++++++++++++++++++- configure | 24 +++++++++++++----------- configure.ac | 3 ++- 4 files changed, 53 insertions(+), 14 deletions(-) diff --git a/Make.inc.in b/Make.inc.in index a493ed2a..150a0853 100644 --- a/Make.inc.in +++ b/Make.inc.in @@ -44,8 +44,9 @@ SLUDISTFLAGS=@SLUDIST_FLAGS@ UMFLIBS=@UMF_LIBS@ UMFFLAGS=@UMF_FLAGS@ +EXTRALIBS=@EXTRA_LIBS@ -MLDLDLIBS=$(SLULIBS) $(SLUDISTLIBS) $(UMFLIBS) $(PSBLDLIBS) +MLDLDLIBS=$(SLULIBS) $(SLUDISTLIBS) $(UMFLIBS) $(EXTRALIBS) $(PSBLDLIBS) LDLIBS=$(MLDLDLIBS) # diff --git a/config/pac.m4 b/config/pac.m4 index ccaaf237..b60c4445 100644 --- a/config/pac.m4 +++ b/config/pac.m4 @@ -270,6 +270,41 @@ AC_MSG_RESULT(no) ) ] ) + + +dnl @synopsis PAC_ARG_WITH_EXTRA_LIBS +dnl +dnl Test for --with-extra-libs="name(s)". +dnl +dnl Appends the specified name(s) to the list of libraries to link +dnl with. +dnl +dnl note: Renamed after PAC_ARG_WITH_EXTRA_LIBS as in the Trilinos package. +dnl +dnl Example use: +dnl +dnl PAC_ARG_WITH_EXTRA_LIBS +dnl +dnl tests for --with-extra-libs and pre-pends to LIBS +dnl +dnl @author Jim Willenbring +dnl +AC_DEFUN([PAC_ARG_WITH_EXTRA_LIBS], +[ +AC_MSG_CHECKING([whether additional libraries are needed]) +AC_ARG_WITH(extra-libs, +AC_HELP_STRING([--with-extra-libs], +[List additional link flags here. For example, --with-extra-libs=-lspecial_system_lib +or --with-extra-libs=-L/path/to/libs]), +[ +EXTRA_LIBS="${withval}" +AC_MSG_RESULT([EXTRA_LIBS = ${EXTRA_LIBS}]) +], +AC_MSG_RESULT(no) +) +] +) + dnl @synopsis PAC_ARG_WITH_PSBLAS dnl dnl Test for --with-psblas="pathname". @@ -903,7 +938,7 @@ if test "x$pac_sludist_header_ok" == "xyes" ; then SLUDIST_LIBS=""; ]) if test "x$pac_sludist_lib_ok" == "xno" ; then dnl Maybe lib? - SLUDIST_LIBS="$mld2p4_cv_superludist -L$mld2p4_cv_superludistdir/lib"; + SLUDIST_LIBS="$mld2p4_cv_superludist -L$mld2p4_cv_superludistdir/lib"; LIBS="$SLUDIST_LIBS -lm $SAVE_LIBS"; AC_TRY_LINK_FUNC(superlu_malloc_dist, [mld2p4_cv_have_superludist=yes;pac_sludist_lib_ok=yes;], diff --git a/configure b/configure index 76585ec4..b4a4fba9 100755 --- a/configure +++ b/configure @@ -646,6 +646,7 @@ UMF_LIBS UMF_FLAGS SLU_LIBS SLU_FLAGS +EXTRA_LIBS INSTALL_DOCSDIR INSTALL_INCLUDEDIR INSTALL_LIBDIR @@ -716,7 +717,7 @@ ac_subst_files='' ac_user_opts=' enable_option_checking with_psblas -with_libs +with_extra_libs with_umfpack with_umfpackdir with_umfpackincdir @@ -1376,9 +1377,9 @@ Optional Packages: --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) --with-psblas The install directory for PSBLAS, for example, --with-psblas=/opt/packages/psblas-3.1 - --with-libs List additional link flags here. For example, - --with-libs=-lspecial_system_lib or - --with-libs=-L/path/to/libs + --with-extra-libs List additional link flags here. For example, + --with-extra-libs=-lspecial_system_lib or + --with-extra-libs=-L/path/to/libs --with-umfpack=LIBNAME Specify the library name for UMFPACK library. Default: "-lumfpack -lamd" --with-umfpackdir=DIR Specify the directory for UMFPACK library and @@ -3102,12 +3103,12 @@ fi { $as_echo "$as_me:$LINENO: checking whether additional libraries are needed" >&5 $as_echo_n "checking whether additional libraries are needed... " >&6; } -# Check whether --with-libs was given. -if test "${with_libs+set}" = set; then - withval=$with_libs; -LIBS="${withval} ${LIBS}" -{ $as_echo "$as_me:$LINENO: result: LIBS = ${LIBS}" >&5 -$as_echo "LIBS = ${LIBS}" >&6; } +# Check whether --with-extra-libs was given. +if test "${with_extra_libs+set}" = set; then + withval=$with_extra_libs; +EXTRA_LIBS="${withval}" +{ $as_echo "$as_me:$LINENO: result: EXTRA_LIBS = ${EXTRA_LIBS}" >&5 +$as_echo "EXTRA_LIBS = ${EXTRA_LIBS}" >&6; } else { $as_echo "$as_me:$LINENO: result: no" >&5 @@ -7047,7 +7048,7 @@ rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext if test "x$pac_sludist_lib_ok" == "xno" ; then - SLUDIST_LIBS="$mld2p4_cv_superludist -L$mld2p4_cv_superludistdir/lib"; + SLUDIST_LIBS="$mld2p4_cv_superludist -L$mld2p4_cv_superludistdir/lib"; LIBS="$SLUDIST_LIBS -lm $SAVE_LIBS"; cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -7298,6 +7299,7 @@ rm -f conftest* + ############################################################################### # the following files will be created by Automake diff --git a/configure.ac b/configure.ac index 0a754f5c..60e68755 100755 --- a/configure.ac +++ b/configure.ac @@ -134,7 +134,7 @@ if eval "$FC -qversion 2>&1 | grep XL 2>/dev/null" ; then # since (as far as it is known to us) -WF, is not used in earlier versions. # More problems could be undocumented yet. fi -PAC_ARG_WITH_LIBS +PAC_ARG_WITH_EXTRA_LIBS dnl PAC_ARG_WITH_FLAGS(clibs,CLIBS) dnl PAC_ARG_WITH_FLAGS(flibs,FLIBS) dnl PAC_ARG_WITH_FLAGS(library-path,LIBRARYPATH) @@ -265,6 +265,7 @@ AC_SUBST(INSTALL_LIBDIR) AC_SUBST(INSTALL_INCLUDEDIR) AC_SUBST(INSTALL_DOCSDIR) +AC_SUBST(EXTRA_LIBS) AC_SUBST(SLU_FLAGS) AC_SUBST(SLU_LIBS) AC_SUBST(UMF_FLAGS)