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

* Fix some bugs in the mpi stuff which were introduced in the last commit.

* Infrastructure to warn about the use of deprecated preprocessor make
  variables.
* Use that infrastructure to war about MPI_CPPFLAGS.

[[Imported from SVN: r5807]]
parent 15839472
No related branches found
No related tags found
No related merge requests found
......@@ -26,6 +26,7 @@ AC_CONFIG_FILES([Makefile
dune/common/Makefile
dune/common/test/Makefile
dune/common/exprtmpl/Makefile
dune/common/warnings/Makefile
doc/Makefile
doc/devel/Makefile
doc/layout/Makefile
......
......@@ -850,7 +850,7 @@ target_LIBADD =
In addition, this macro substitutes \texttt{MPI\_VERSION} a text string
identifying the detected version of MPI. It defines the following
preprocessor defines: \texttt{MPI\_2}, defined if the detected MPI supports
the MPI-2 standard. \texttt{HAVE_MPI}, 1 if MPI is detected and enabled.
the MPI-2 standard. \texttt{HAVE\_MPI}, 1 if MPI is detected and enabled.
It also defines the automake conditional \texttt{MPI}.
\end{description}
......
# $Id$
SUBDIRS = . test exprtmpl
SUBDIRS = . test exprtmpl warnings
# the standard debug streams are put into the libdune
noinst_LTLIBRARIES = libcommon.la
......
Makefile
Makefile.in
# $Id$
warningsincludedir = $(includedir)/dune/common/warnings
warningsinclude_HEADERS = \
mpi_cppflags_deprecation.hh
include $(top_srcdir)/am/global-rules
// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
// vi: set et ts=4 sw=2 sts=2:
#ifndef DUNE_MPI_CPPFLAGS_DEPRECATION
#define DUNE_MPI_CPPFLAGS_DEPRECATION
#warning The MPI_CPPFLAGS configure substitute is deprecated. Please change
#warning your Makefile.am to use DUNEMPICPPFLAGS instead. Note that it is a
#warning good idea to change any occurance of MPI_LDFLAGS into DUNEMPILIBS and
#warning DUNEMPILDFLAGS as apropriate, since it is not possible to issue a
#warning deprecation warning in that case.
#endif // DUNE_MPI_CPPFLAGS_DEPRECATION
......@@ -2,7 +2,9 @@
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_autobuild.m4 dune_common.m4 dune_compiler.m4 \
dune_cppincludeopt.m4 \
dune_deprecated.m4 \
dune_docu.m4 dune_exprtmpl.m4 dune_linkcxx.m4 \
dune.m4 \
dune_mpi.m4 dune_streams.m4 \
......
dnl -*- autoconf -*-
# Determine how to make the C preprocessor include a certain file before the
# main input file from the command line. Sets the following configure
# substitution:
#
# CPPINCLUDEOPT The include option. This is something like "-include " (note
# trailing space). If no such option could determined, this variable will
# be set to something like "-D DUMMY=". This means it must be used like
# CPPFLAGS="$CPPINCLUDEOPT$header" (note: no whitespace between
# $CPPINCLUDEOPT and $header).
#
# Sets the following automake conditional:
#
# HAVE_CPPINCLUDEOPT
AC_DEFUN([DUNE_CPPINCLUDEOPT],
[
AC_LANG_PUSH([C])
AC_REQUIRE([AC_PROG_CPP])
AC_MSG_CHECKING([for preprocessor option to preinclude a header])
cat >conftestpreinc.h <<EOF
#define PREINC_WORKS
EOF
ac_save_CPPFLAGS="$CPPFLAGS"
HAVE_CPPINCLUDEOPT=no
if ! test yes = "$HAVE_CPPINCLUDEOPT"; then
# check for -include
CPPINCLUDEOPT="-include "
CPPFLAGS="$ac_save_CPPFLAGS ${CPPINCLUDEOPT}conftestpreinc.h"
AC_COMPILE_IFELSE([
#ifdef PREINC_WORKS
/* OK */
#else
#error preinc does not work
#endif
],[HAVE_CPPINCLUDEOPT=yes])
fi
rm -f conftestpreinc.h
if ! test yes = "$HAVE_CPPINCLUDEOPT"; then
CPPINCLUDEOPT="-D DUMMY="
fi
AC_MSG_RESULT([$HAVE_CPPINCLUDEOPT (${CPPINCLUDEOPT}file.h)])
AC_SUBST([CPPINCLUDEOPT])
AM_CONDITIONAL([HAVE_CPPINCLUDEOPT], [test yes = "$HAVE_CPPINCLUDEOPT"])
CPPFLAGS="$ac_save_CPPFLAGS"
AC_LANG_POP([C])
])
dnl -*- autoconf -*-
# $Id$
# wrapper for the autoconf-archive check. Note: compiling MPI-stuff sucks!
......@@ -52,6 +53,7 @@
AC_DEFUN([DUNE_MPI],[
AC_PREREQ(2.50) dnl for AC_LANG_CASE
AC_REQUIRE([DUNE_CPPINCLUDEOPT])
# get compilation script
AC_LANG_CASE([C],[
......@@ -160,15 +162,16 @@ AC_DEFUN([DUNE_MPI],[
])
# set flags
MPI_CPPFLAGS="$DUNEMPICPPFLAGS"
MPI_LDFLAGS="$DUNEMPILDFLAGS $DUNEMPILIBS"
AS_IF([test yes = "$HAVE_CPPINCLUDEOPT"],
[dune_mpicppflagswarn="${CPPINCLUDEOPT}dune/common/warnings/mpi_cppflags_deprecation.hh"],
[dune_mpicppflagswarn=""])
AS_IF([test "x$with_mpi" != "xno"],[
AC_SUBST(DUNEMPICPPFLAGS, $DUNEMPICPPFLAGS)
AC_SUBST(DUNEMPILDFLAGS, $DUNEMPILDFLAGS)
AC_SUBST(DUNEMPILIBS, $DUNEMPILIBS)
AC_SUBST(MPI_CPPFLAGS, $MPI_CPPFLAGS)
AC_SUBST(MPI_LDFLAGS, $MPI_LDFLAGS)
AC_SUBST(MPI_CPPFLAGS, "$dune_mpicppflagswarn $DUNEMPICPPFLAGS")
AC_SUBST(MPI_LDFLAGS, "$DUNEMPILDFLAGS $DUNEMPILIBS")
AC_SUBST(MPI_VERSION, $dune_MPI_VERSION)
AC_DEFINE(HAVE_MPI,ENABLE_MPI,[Define if you have the MPI library.
This is only true if MPI was found by configure _and_ if the application
......@@ -178,7 +181,7 @@ AC_DEFUN([DUNE_MPI],[
AC_SUBST(DUNEMPILDFLAGS, "")
AC_SUBST(DUNEMPILIBS, "")
AC_SUBST(MPI_CPPFLAGS, "")
AC_SUBST(MPI_CPPFLAGS, "$dune_mpicppflagswarn")
AC_SUBST(MPI_LDFLAGS, "")
])
......
......@@ -55,18 +55,18 @@ _EOF
if test x"$DUNEMPICPPFLAGS" = x; then
DUNEMPICPPFLAGS="$retval"
fi
if x"$DUNEMPILIBS" = x; then
if test x"$DUNEMPILIBS" = x; then
mpi_getflags "-showme:link"
DUNEMPILIBS="$retval"
fi
else
dune_MPI_VERSION="LAM < 7.1"
# use -showme and dummy parameters to extract flags
if x"$DUNEMPICPPFLAGS" = x; then
if test x"$DUNEMPICPPFLAGS" = x; then
mpi_getflags "-showme" "-c $MPISOURCE"
DUNEMPICPPFLAGS="$retval"
fi
if x"$DUNEMPILIBS" = x; then
if test x"$DUNEMPILIBS" = x; then
mpi_getflags "-showme" "dummy.o -o dummy"
DUNEMPILIBS="$retval"
fi
......@@ -94,7 +94,7 @@ mpi_getmpichflags() {
DUNEMPICPPFLAGS="$retval"
fi
if x"$DUNEMPILIBS" = x; then
if test x"$DUNEMPILIBS" = x; then
# get linker options
mpi_getflags "-link_info"
DUNEMPILIBS="$retval"
......@@ -120,7 +120,7 @@ mpi_getmpich2flags() {
DUNEMPICPPFLAGS="$retval"
fi
if x"$DUNEMPILIBS" = x; then
if test x"$DUNEMPILIBS" = x; then
# get linker options
mpi_getflags "-show" "-o"
DUNEMPILIBS="$retval"
......@@ -196,7 +196,7 @@ _EOF
mpi_getflags "-showme:compile"
DUNEMPICPPFLAGS="$retval"
fi
if x"$DUNEMPILIBS" = x; then
if test x"$DUNEMPILIBS" = x; then
mpi_getflags "-showme:link"
DUNEMPILIBS="$retval"
fi
......@@ -269,7 +269,7 @@ test_ibmmpi() {
DUNEMPICPPFLAGS="$retval"
fi
if x"$DUNEMPILIBS" = x; then
if test x"$DUNEMPILIBS" = x; then
mpi_getflags "-v" "dummy.o -o dummy"
DUNEMPILIBS="$retval"
fi
......
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