Skip to content
Snippets Groups Projects
Commit d5c8c27e authored by Christoph Grüninger's avatar Christoph Grüninger
Browse files

Reverted move of metis and parmetis tests from dune-common to dune-istl.

[[Imported from SVN: r1526]]
parent 2e556573
No related branches found
No related tags found
No related merge requests found
......@@ -2,9 +2,7 @@
ALLM4S = \
dune_istl.m4 \
immdx_lib_metis.m4 \
pardiso.m4 \
parmetis.m4 \
superlu-dist.m4 \
superlu.m4
......
dnl @synopsis IMMDX_LIB_METIS([ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
dnl
dnl This macro searches for the METIS library in the user specified
dnl location. The user may specify the location either by defining the
dnl environment variable METIS or by using the --with-metis option to
dnl configure. If the environment variable is defined it has precedent
dnl over everything else. If no location was specified then it searches
dnl in /usr/lib and /usr/local/lib for the library and in /usr/include
dnl and /usr/local/include for the header files. Upon sucessful
dnl completion the variables METIS_LIB and METIS_INCLUDE are set.
dnl
dnl ACTION-IF-FOUND is a list of shell commands to run if a METIS
dnl library is found, and ACTION-IF-NOT-FOUND is a list of commands to
dnl run it if it is not found. If ACTION-IF-FOUND is not specified, the
dnl default action will define HAVE_METIS. If ACTION-IF-NOT-FOUND is
dnl not specified then an error will be generated halting configure.
dnl
dnl @category InstalledPackages
dnl @author Ben Bergen <ben@cs.fau.de>
dnl @version 2003-01-19
dnl @license AllPermissive
AC_DEFUN([IMMDX_LIB_METIS], [
AC_MSG_CHECKING(for METIS library)
AC_REQUIRE([AC_PROG_CC])
#
# User hints...
#
AC_ARG_VAR([METIS], [METIS library location])
AC_ARG_WITH([metis],
[AC_HELP_STRING([--with-metis],
[user defined path to METIS library])],
[
if test -n "$METIS" ; then
AC_MSG_RESULT(yes)
with_metis=$METIS
elif test "$withval" != no ; then
AC_MSG_RESULT(yes)
with_metis=$withval
else
AC_MSG_RESULT(no)
fi
],
[
if test -n "$METIS" ; then
with_metis=$METIS
AC_MSG_RESULT(yes)
else
with_metis=/usr
if test ! -f "$with_metis/include/metis.h" ; then
with_metis=/usr/local
if test ! -f "$with_metis/include/metis.h" ; then
with_metis=""
AC_MSG_RESULT(failed)
else
AC_MSG_RESULT(yes)
fi
else
AC_MSG_RESULT(yes)
fi
fi
])
#
# locate METIS library
#
if test -n "$with_metis" ; then
old_CFLAGS=$CFLAGS
old_LDFLAGS=$LDFLAGS
if test -f "$with_metis/include/metis.h"; then
lib_path="/lib"
include_path="/include"
fi
if test -f "$with_metis/Lib/metis.h"; then
# catch bad convention in the downloadable metis version
lib_path=""
include_path="/Lib"
fi
CFLAGS="-I$with_metis/$include_path"
LDFLAGS="-L$with_metis/$lib_path"
AC_LANG_SAVE
AC_LANG_C
AC_CHECK_LIB(metis, METIS_PartMeshDual,
[metis_lib=yes], [metis_lib=no], [-lm])
AC_CHECK_HEADER(metis.h, [metis_h=yes],
[metis_h=no], [/* check */])
echo x$metis_h
AC_LANG_RESTORE
CFLAGS=$old_CFLAGS
LDFLAGS=$old_LDFLAGS
AC_MSG_CHECKING(METIS in $with_metis)
if test "$metis_lib" = "yes" -a "$metis_h" = "yes" ; then
AC_SUBST(METIS_INCLUDE, [-I$with_metis$include_path])
AC_SUBST(METIS_LDFLAGS, [-L$with_metis$lib_path])
AC_SUBST(METIS_LIB, [-lmetis])
AC_MSG_RESULT(ok)
else
AC_MSG_RESULT(failed)
fi
fi
#
#
#
# tell automake
AM_CONDITIONAL(METIS, test x$METIS_LIB = x1)
if test x = x"$METIS_LIB" ; then
with_metis=no
ifelse([$2],,[AC_MSG_WARN(Failed to find valid METIS library)],[$2])
:
else
with_metis=yes
ifelse([$1],,[AC_DEFINE(HAVE_METIS,1,[Define if you have METIS library])
],[$1])
:
fi
])dnl IMMDX_LIB_METIS
dnl -*- mode: autoconf; tab-width: 8; indent-tabs-mode: nil; -*-
dnl vi: set et ts=8 sw=2 sts=2:
# $Id: parmetis.m4 6417 2011-04-12 21:01:08Z mblatt $
# searches for ParMetis headers and libs
AC_DEFUN([DUNE_PATH_PARMETIS],[
AC_MSG_CHECKING(for ParMETIS library)
AC_REQUIRE([AC_PROG_CC])
AC_REQUIRE([AC_PATH_XTRA])
AC_REQUIRE([DUNE_MPI])
#
# USer hints ...
#
AC_ARG_VAR([PARMETIS], [ParMETIS library location])
AC_ARG_WITH([parmetis],
[AC_HELP_STRING([--with-parmetis],[user defined path to ParMETIS library])],
[
# --with-parmetis supersedes $PARMETIS
PARMETIS=""
if test "$withval" != no ; then
if test -d "$withval" ; then
# get absolute path
with_parmetis=`eval cd $withval 2>&1 && pwd`
AC_MSG_RESULT(yes)
else
with_parmetis="no"
AC_MSG_RESULT(no)
fi
else
AC_MSG_RESULT(no)
fi
],
[
if test -n "$PARMETIS" ; then
if test -d "$PARMETIS" ; then
# get absolute path
with_parmetis=`eval cd $PARMETIS 2>&1 && pwd`
PARMETIS=""
AC_MSG_RESULT(yes)
else
PARMETIS=""
with_parmetis=no
AC_MSG_RESULT(no)
fi
else
with_parmetis=/usr/
include_path=include
lib_path=lib
if test ! -f "$with_parmetis/$include_path/parmetis.h" ; then
with_parmetis=/usr/local/
if test ! -f "$with_metis/$include_path/parmetis.h" ; then
with_parmetis="no"
AC_MSG_RESULT(failed)
else
AC_MSG_RESULT(yes)
fi
else
AC_MSG_RESULT(yes)
fi
fi
])
# store old values
ac_save_LDFLAGS="$LDFLAGS"
ac_save_CPPFLAGS="$CPPFLAGS"
ac_save_LIBS="$LIBS"
## do nothing if --without-parmetis is used
if test x"$with_mpi" != x"no" && test x"$with_parmetis" != x"no" ; then
# defaultpath
PARMETIS_LIB_PATH="$with_parmetis$lib_path"
PARMETIS_INCLUDE_PATH="$with_parmetis$lib_path"
PARMETIS_LIBS="-L$PARMETIS_LIB_PATH -lmetis $DUNEMPILIBS -lm"
PARMETIS_LDFLAGS="$DUNEMPILDFLAGS"
# set variables so that tests can use them
CPPFLAGS="$CPPFLAGS -I$PARMETIS_INCLUDE_PATH $DUNEMPICPPFLAGS"
# check for central header
AC_CHECK_HEADER([parmetis.h],[
PARMETIS_CPPFLAGS="-I$PARMETIS_INCLUDE_PATH"
HAVE_PARMETIS="1"],[
HAVE_PARMETIS="0"
AC_MSG_WARN([parmetis.h not found in $PARMETIS_INCLUDE_PATH with $CPPFLAGS])]
)
PARMETIS_CPPFLAGS="${DUNEMPICPPFLAGS} ${PARMETIS_CPPFLAGS} -DENABLE_PARMETIS=1"
# AC_LANG_PUSH([C++])
# if header is found check for the libs
LIBS="$DUNEMPILIBS -lm $LIBS"
if test x$HAVE_PARMETIS = x1 ; then
DUNE_CHECK_LIB_EXT([$PARMETIS_LIB_PATH], [metis], [metis_partgraphkway],
[
PARMETIS_LIBS="-L$PARMETIS_LIB_PATH -lmetis $DUNEMPILIBS -lm"
LIBS="$PARMETIS_LIBS $ac_save_LIBS"
],[
HAVE_PARMETIS="0"
AC_MSG_WARN(libmetis not found!)
])
fi
if test x$HAVE_PARMETIS = x1 ; then
DUNE_CHECK_LIB_EXT([$PARMETIS_LIB_PATH], [parmetis], [parmetis_v3_partkway],
[
PARMETIS_LIBS="-L$PARMETIS_LIB_PATH -lparmetis -lmetis $DUNEMPILIBS -lm"
],[
HAVE_PARMETIS="0"
AC_MSG_WARN(libparmetis not found!)
])
fi
# AC_LANG_POP([C++])
# pre-set variable for summary
#with_parmetis="no"
# did it work?
AC_MSG_CHECKING(ParMETIS in $with_parmetis)
if test x$HAVE_PARMETIS = x1 ; then
AC_SUBST(PARMETIS_LIBS, $PARMETIS_LIBS)
AC_SUBST(PARMETIS_LDFLAGS, $PARMETIS_LDFLAGS)
AC_SUBST(PARMETIS_CPPFLAGS, $PARMETIS_CPPFLAGS)
AC_DEFINE(HAVE_PARMETIS,ENABLE_PARMETIS,[Define if you have the Parmetis library.
This is only true if MPI was found by configure
_and_ if the application uses the PARMETIS_CPPFLAGS])
AC_MSG_RESULT(ok)
# add to global list
DUNE_PKG_LIBS="$PARMETIS_LIBS $DUNE_PKG_LIBS"
DUNE_PKG_LDFLAGS="$DUNE_PKG_LDFLAGS $PARMETIS_LDFLAGS"
DUNE_PKG_CPPFLAGS="$DUNE_PKG_CPPFLAGS $PARMETIS_CPPFLAGS"
# re-set variable correctly
with_parmetis="yes"
else
with_parmetis="no"
AC_MSG_RESULT(failed)
fi
# end of "no --without-parmetis"
else
with_parmetis="no"
fi
# tell automake
AM_CONDITIONAL(PARMETIS, test x$HAVE_PARMETIS = x1)
# restore variables
LDFLAGS="$ac_save_LDFLAGS"
CPPFLAGS="$ac_save_CPPFLAGS"
LIBS="$ac_save_LIBS"
DUNE_ADD_SUMMARY_ENTRY([ParMETIS],[$with_parmetis])
])
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment