Skip to content
Snippets Groups Projects
Commit bc3194cc authored by Jorrit Fahlke's avatar Jorrit Fahlke
Browse files

* Better documentation for DUNE_MPI.

 * Adapt superlu-dist.m4, parmetis.m4, hdf5.m4, dune/common/test/Makefile.am
   and duneproject to the MPI changes.

 * Add DUNE_CHECK_LIB_EXT, a wrapper around AC_CHECK_LIB which allows to set
   the library path.

[[Imported from SVN: r5814]]
parent 7383e592
No related branches found
No related tags found
No related merge requests found
......@@ -496,8 +496,31 @@ noinst_PROGRAMS = ${CMODULE}
${CMODULE}_SOURCES = $CMODULE.cc
${CMODULE}_CXXFLAGS = \$(MPI_CPPFLAGS) \$(UG_CPPFLAGS) \$(AMIRAMESH_CPPFLAGS) \$(ALBERTA_CPPFLAGS) \$(ALUGRID_CPPFLAGS)
${CMODULE}_LDADD = \$(MPI_LDFLAGS) \$(ALBERTA_LDFLAGS) \$(ALBERTA_LIBS) \$(ALUGRID_LDFLAGS) \$(ALUGRID_LIBS) \$(AMIRAMESH_LDFLAGS) \$(AMIRAMESH_LIBS) \$(UG_LDFLAGS) \$(UG_LIBS) \$(MPI_LDFLAGS) \$(DUNE_LDFLAGS) \$(DUNE_LIBS)
${CMODULE}_CXXFLAGS = \$(AM_CXXFLAGS) \\
\$(DUNEMPICPPFLAGS) \\
\$(UG_CPPFLAGS) \\
\$(AMIRAMESH_CPPFLAGS) \\
\$(ALBERTA_CPPFLAGS) \\
\$(ALUGRID_CPPFLAGS)
# The libraries have to be given in reverse order (most basic libraries
# last). Also, due to some misunderstanding, a lot of libraries include the
# -L option in LDFLAGS instead of LIBS -- so we have to include the LDFLAGS
# here as well.
${CMODULE}_LDADD = \\
\$(DUNE_LDFLAGS) \$(DUNE_LIBS) \\
\$(ALUGRID_LDFLAGS) \$(ALUGRID_LIBS) \\
\$(ALBERTA_LDFLAGS) \$(ALBERTA_LIBS) \\
\$(AMIRAMESH_LDFLAGS) \$(AMIRAMESH_LIBS) \\
\$(UG_LDFLAGS) \$(UG_LIBS) \\
\$(DUNEMPILIBS) \\
\$(LDADD)
${CMODULE}_LDFLAGS = \$(AM_LDFLAGS) \\
\$(DUNEMPILDFLAGS) \\
\$(UG_LDFLAGS) \\
\$(AMIRAMESH_LDFLAGS) \\
\$(ALBERTA_LDFLAGS) \\
\$(ALUGRID_LDFLAGS) \\
\$(DUNE_LDFLAGS)
# don't follow the full GNU-standard
# we need automake 1.5
......
......@@ -39,7 +39,7 @@ check_PROGRAMS = $(TESTPROGS)
noinst_HEADERS = dummyiterator.hh
AM_LDFLAGS = $(LOCAL_LIBS)
LDADD = $(LOCAL_LIBS)
# define the programs
smallobject_SOURCES = smallobject.cc
......@@ -48,7 +48,7 @@ bitsetvectortest_SOURCES = bitsetvectortest.cc
nullptr_test_SOURCES = nullptr-test.cc nullptr-test2.cc
nullptr_test_fail_SOURCES = nullptr-test.cc
nullptr_test_fail_CPPFLAGS = -DFAIL
nullptr_test_fail_CPPFLAGS = $(AM_CPPFLAGS) -DFAIL
static_assert_test_SOURCES = static_assert_test.cc
static_assert_test_fail_SOURCES = static_assert_test_fail.cc
......@@ -90,18 +90,18 @@ settest_SOURCES=settest.cc
gcdlcmtest_SOURCES = gcdlcmtest.cc
mpihelpertest_SOURCES = mpihelpertest.cc
mpihelpertest_CXXFLAGS = $(MPI_CPPFLAGS)
mpihelpertest_LDFLAGS = $(LOCAL_LIBS) $(MPI_LDFLAGS) $(MPI_LIBS)
mpihelpertest_CPPFLAGS = $(AM_CPPFLAGS) $(DUNEMPICPPFLAGS)
mpihelpertest_LDADD = $(DUNEMPILIBS) $(LDADD)
mpihelpertest_LDFLAGS = $(AM_LDFLAGS) $(DUNEMPILDFLAGS)
mpicollcomm_SOURCES = mpicollectivecommunication.cc
mpicollcomm_CXXFLAGS = $(MPI_CPPFLAGS)
mpicollcomm_LDFLAGS = $(LOCAL_LIBS) $(MPI_LDFLAGS) $(MPI_LIBS)
mpicollcomm_CPPFLAGS = $(AM_CPPFLAGS) $(DUNEMPICPPFLAGS)
mpicollcomm_LDADD = $(DUNEMPILIBS) $(LDADD)
mpicollcomm_LDFLAGS = $(AM_LDFLAGS) $(DUNEMPILDFLAGS)
singletontest_SOURCES = singletontest.cc
singletontest_LDFLAGS = $(LOCAL_LIBS)
utilitytest_SOURCES = utilitytest.cc
utilitytest_LDFLAGS = $(LOCAL_LIBS)
testfassign1_SOURCES = testfassign.cc testfassign2.cc
testfassign1_CPPFLAGS = $(AM_CPPFLAGS) -D_N=3 -D_VALUES="1,2,3"
......
......@@ -2,9 +2,12 @@
ALLM4S = acx_blas.m4 acx_lapack.m4 acx_mpi.m4 acx_pthread.m4 \
ax_check_gl.m4 ax_lang_compiler_ms.m4 dune_all.m4 \
dune_autobuild.m4 dune_common.m4 dune_compiler.m4 \
dune_deprecated.m4 \
dune_deprecated_cppflags.m4 \
dune_autobuild.m4 \
dune_check_lib.m4 \
dune_common.m4 \
dune_compiler.m4 \
dune_deprecated.m4 \
dune_deprecated_cppflags.m4 \
dune_docu.m4 dune_exprtmpl.m4 dune_linkcxx.m4 \
dune.m4 \
dune_mpi.m4 dune_streams.m4 \
......
dnl -*- autoconf -*-
# Just like AC_CHECK_LIB, but in allow a library path to be specified. The
# default ACTION-IF-FOUND is extended to also add that library path to LIBS.
#
# DUNE_CHECK_LIB_EXT(PATH, LIBRARY, FUNCTION, [ACTION-IF-FOUND],
# [ACTION-IF-NOT-FOUND], [OTHER-LIBRARIES])
AC_DEFUN([DUNE_CHECK_LIB_EXT],
[
dune_cle_save_LDFLAGS="$LDFLAGS"
LDFLAGS="$LDFLAGS -L$1"
m4_ifelse(m4_eval([$# <= 3]), [1],
[AC_CHECK_LIBS([$2], [$3],
[
LIBS="-L$1 -l$2 $LIBS"
AC_DEFINE([HAVE_LIB]m4_translit([[$2]], [-a-z], [_A-Z]), [1],
[Define to 1 if you have the `$2' library (-l$2).])
])],
[AC_CHECK_LIBS(m4_shift($@))])
LDFLAGS="$dune_cle_save_LDFLAGS"
])
......@@ -51,6 +51,39 @@ dnl -*- autoconf -*-
# --disable-parallel
# [Christian 9.7.2006]
# DUNE_MPI()
#
# With the help of ACX_MPI find the MPI compiler, and with the help of
# MPI_CONFIG find the libraries and compiler and linker options necessary to
# compile MPI programs with the standard compiler. Will set the following
# things:
#
# configure shell variables:
# MPICC
# MPILIBS
# DUNEMPICPPFLAGS
# DUNEMPILDFLAGS
# DUNEMPILIBS
# MPI_CPPFLAGS (deprecated in favor of DUNEMPICPPFLAGS)
# MPI_LDFLAGS (deprecated in favor of DUNEMPILIBS and DUNEMPILDFLAGS)
# dune_MPI_VERSION
# with_mpi
#
# configure substitutions/Makefile variables
# MPICC
# MPILIBS
# DUNEMPICPPFLAGS
# DUNEMPILDFLAGS
# DUNEMPILIBS
# MPI_CPPFLAGS (deprecated in favor of DUNEMPICPPFLAGS)
# MPI_LDFLAGS (deprecated in favor of DUNEMPILIBS and DUNEMPILDFLAGS)
# MPI_VERSION (set from dune_MPI_VERSION)
#
# preprocessor defines
# HAVE_MPI (defined when $with_mpi!=no)
#
# automake conditionals
# MPI (true when $with_mpi!=no)
AC_DEFUN([DUNE_MPI],[
AC_PREREQ(2.50) dnl for AC_LANG_CASE
......
......@@ -39,9 +39,9 @@ AC_DEFUN([DUNE_PATH_HDF5],[
# test if we are parallel
AC_CHECK_DECL(H5_HAVE_PARALLEL, [dnl
LIBS="$LIBS $MPI_LIB"
LDFLAGS="$LDFLAGS $MPI_LDFLAGS"
CPPFLAGS="$CPPFLAGS $MPI_CPPFLAGS"
LIBS="$DUNEMPILIBS $LIBS"
LDFLAGS="$LDFLAGS $DUNEMPILDFLAGS"
CPPFLAGS="$CPPFLAGS $DUNEMPICPPFLAGS"
HDF5_PARALLEL=1],[],[#include"H5pubconf.h"])
# test for an arbitrary header
......
#! /bin/bash
dnl -*- mode: autoconf; tab-width: 8; indent-tabs-mode: nil; -*-
dnl vi: set et ts=8 sw=2 sts=2:
# $Id$
# searches for ParMetis headers and libs
......@@ -55,13 +56,14 @@ AC_DEFUN([DUNE_PATH_PARMETIS],[
ac_save_LIBS="$LIBS"
## do nothing if --without-parmetis is used
if test x"$MPI_LDFLAGS" != x"" && test x"$with_parmetis" != x"no" ; then
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 $MPI_LDFLAGS $MPI_LIBS"
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 $MPI_CPPFLAGS"
......@@ -80,22 +82,27 @@ AC_DEFUN([DUNE_PATH_PARMETIS],[
# if header is found check for the libs
LIBS="$LIBS $PARMETIS_LIBS -lm"
LIBS="$DUNEMPILIBS -lm $LIBS"
if test x$HAVE_PARMETIS = x1 ; then
AC_CHECK_LIB(metis, [metis_partgraphkway],[
PARMETIS_LIBS="$PARMETIS_LIBS -lmetis"
LIBS="$LIBS -lmetis"],[
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!)])
AC_MSG_WARN(libmetis not found!)
])
fi
if test x$HAVE_PARMETIS = x1 ; then
AC_CHECK_LIB(parmetis, [parmetis_v3_partkway],[
PARMETIS_LIBS="$PARMETIS_LIBS -lparmetis -lmetis"
HAVE_PARMETIS="1"],[
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!)])
AC_MSG_WARN(libparmetis not found!)
])
fi
# AC_LANG_POP([C++])
......@@ -107,6 +114,7 @@ AC_DEFUN([DUNE_PATH_PARMETIS],[
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
......@@ -114,7 +122,8 @@ AC_DEFUN([DUNE_PATH_PARMETIS],[
AC_MSG_RESULT(ok)
# add to global list
DUNE_PKG_LIBS="$DUNE_PKG_LIBS $PARMETIS_LIBS"
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
......@@ -140,7 +149,3 @@ AC_DEFUN([DUNE_PATH_PARMETIS],[
DUNE_ADD_SUMMARY_ENTRY([ParMETIS],[$with_parmetis])
])
dnl Local Variables:
dnl mode: shell-script
dnl End:
......@@ -95,10 +95,10 @@ AC_DEFUN([DUNE_PATH_SUPERLU_DIST],[
SUPERLU_DIST_LIB_PATH="$with_superlu_dist/$my_lib_path"
SUPERLU_DIST_INCLUDE_PATH="$with_superlu_dist/$my_include_path"
SUPERLU_DIST_LDFLAGS="-L$SUPERLU_DIST_LIB_PATH $MPI_LDFLAGS"
SUPERLU_DIST_LDFLAGS="-L$SUPERLU_DIST_LIB_PATH $DUNEMPILDFLAGS"
# set variables so that tests can use them
CPPFLAGS="$CPPFLAGS -I$SUPERLU_DIST_INCLUDE_PATH $MPI_CPPFLAGS"
CPPFLAGS="$CPPFLAGS -I$SUPERLU_DIST_INCLUDE_PATH $DUNEMPICPPFLAGS"
# check for central header
AC_CHECK_HEADER([superlu_ddefs.h],[
......@@ -108,7 +108,7 @@ AC_DEFUN([DUNE_PATH_SUPERLU_DIST],[
AC_MSG_WARN([superlu_ddefs.h not found in $SUPERLU_DIST_INCLUDE_PATH with $CPPFLAGS])]
)
SUPERLU_DIST_CPPFLAGS="-I$SUPERLU_DIST_INCLUDE_PATH $MPI_CPPFLAGS"
SUPERLU_DIST_CPPFLAGS="-I$SUPERLU_DIST_INCLUDE_PATH $DUNEMPICPPFLAGS"
# if header is found check for the libs
......@@ -116,8 +116,8 @@ AC_DEFUN([DUNE_PATH_SUPERLU_DIST],[
# set variables so that tests can use them
OLDFLAGS="$LDFLAGS"
LDFLAGS="$LDFLAGS -L$SUPERLU_DIST_LIB_PATH $MPI_LDFLAGS"
LIBS="$BLAS_LIBS $LIBS $FLIBS $MPILIBS $MPI_LDFLAGS"
LDFLAGS="$LDFLAGS -L$SUPERLU_DIST_LIB_PATH $DUNEMPILDFLAGS"
LIBS="$BLAS_LIBS $LIBS $FLIBS $DUNEMPILIBS"
AC_CHECK_LIB(superlu-mpi, [pdgssvx],
[dnl
......
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