[mpich2-commits] r9548 - in mpich2/trunk: . confdb maint src/binding/f77 src/binding/f90 src/include src/mpe2 src/mpe2/cross_spec src/mpe2/maint src/mpe2/sbin src/mpe2/src/callstack src/mpe2/src/collchk src/mpe2/src/graphics src/mpe2/src/logging src/mpe2/src/misc src/mpe2/src/slog2sdk src/mpe2/src/slog2sdk/maint src/mpe2/src/slog2sdk/src src/mpe2/src/slog2sdk/trace_rlog src/mpe2/src/slog2sdk/trace_sample src/mpe2/src/wrappers src/mpi/romio src/mpi/romio/adio/include src/mpid/ch3/channels/dllchan src/mpid/ch3/channels/nemesis src/mpid/ch3/channels/sctp src/mpid/ch3/channels/sock src/mpid/dcmfd src/mpid/globus src/mpix/armci/m4 src/mpl src/pm/hydra src/pm/mpd src/pm/remshell src/pmi/pmi2 src/pmi/slurm src/util/logging/rlog test/mpi test/mpi/maint
balaji at mcs.anl.gov
balaji at mcs.anl.gov
Tue Feb 28 17:26:34 CST 2012
Author: balaji
Date: 2012-02-28 17:26:34 -0600 (Tue, 28 Feb 2012)
New Revision: 9548
Added:
mpich2/trunk/configure.ac
mpich2/trunk/maint/configure.ac
mpich2/trunk/src/mpe2/configure.ac
mpich2/trunk/src/mpe2/cross_spec/configure.ac
mpich2/trunk/src/mpe2/src/callstack/configure.ac
mpich2/trunk/src/mpe2/src/collchk/configure.ac
mpich2/trunk/src/mpe2/src/graphics/configure.ac
mpich2/trunk/src/mpe2/src/logging/configure.ac
mpich2/trunk/src/mpe2/src/misc/configure.ac
mpich2/trunk/src/mpe2/src/slog2sdk/configure.ac
mpich2/trunk/src/mpe2/src/slog2sdk/src/configure.ac
mpich2/trunk/src/mpe2/src/slog2sdk/trace_rlog/configure.ac
mpich2/trunk/src/mpe2/src/slog2sdk/trace_sample/configure.ac
mpich2/trunk/src/mpe2/src/wrappers/configure.ac
mpich2/trunk/src/mpi/romio/configure.ac
mpich2/trunk/src/mpid/ch3/channels/dllchan/configure.ac
mpich2/trunk/src/mpid/ch3/channels/sctp/configure.ac
mpich2/trunk/src/mpid/dcmfd/configure.ac
mpich2/trunk/src/mpid/globus/configure.ac
mpich2/trunk/src/mpl/configure.ac
mpich2/trunk/src/pm/hydra/configure.ac
mpich2/trunk/src/pm/mpd/configure.ac
mpich2/trunk/src/pm/remshell/configure.ac
mpich2/trunk/src/pmi/pmi2/configure.ac
mpich2/trunk/src/pmi/slurm/configure.ac
mpich2/trunk/src/util/logging/rlog/configure.ac
mpich2/trunk/test/mpi/configure.ac
mpich2/trunk/test/mpi/maint/configure.ac
Removed:
mpich2/trunk/configure.in
mpich2/trunk/maint/configure.in
mpich2/trunk/src/mpe2/configure.in
mpich2/trunk/src/mpe2/cross_spec/configure.in
mpich2/trunk/src/mpe2/src/callstack/configure.in
mpich2/trunk/src/mpe2/src/collchk/configure.in
mpich2/trunk/src/mpe2/src/graphics/configure.in
mpich2/trunk/src/mpe2/src/logging/configure.in
mpich2/trunk/src/mpe2/src/misc/configure.in
mpich2/trunk/src/mpe2/src/slog2sdk/configure.in
mpich2/trunk/src/mpe2/src/slog2sdk/src/configure.in
mpich2/trunk/src/mpe2/src/slog2sdk/trace_rlog/configure.in
mpich2/trunk/src/mpe2/src/slog2sdk/trace_sample/configure.in
mpich2/trunk/src/mpe2/src/wrappers/configure.in
mpich2/trunk/src/mpi/romio/configure.in
mpich2/trunk/src/mpid/ch3/channels/dllchan/configure.in
mpich2/trunk/src/mpid/ch3/channels/sctp/configure.in
mpich2/trunk/src/mpid/dcmfd/configure.in
mpich2/trunk/src/mpid/globus/configure.in
mpich2/trunk/src/mpl/configure.in
mpich2/trunk/src/pm/hydra/configure.in
mpich2/trunk/src/pm/mpd/configure.in
mpich2/trunk/src/pm/remshell/configure.in
mpich2/trunk/src/pmi/pmi2/configure.in
mpich2/trunk/src/pmi/slurm/configure.in
mpich2/trunk/src/util/logging/rlog/configure.in
mpich2/trunk/test/mpi/configure.in
mpich2/trunk/test/mpi/maint/configure.in
Modified:
mpich2/trunk/confdb/aclocal_cc.m4
mpich2/trunk/confdb/aclocal_shl.m4
mpich2/trunk/confdb/aclocal_subcfg.m4
mpich2/trunk/maint/Makefile.mk
mpich2/trunk/maint/sampleconf.in
mpich2/trunk/maint/simplemake.in
mpich2/trunk/maint/simplemake.txt
mpich2/trunk/maint/updatefiles
mpich2/trunk/src/binding/f77/buildiface
mpich2/trunk/src/binding/f90/subconfigure.m4
mpich2/trunk/src/include/mpichtimer.h.in
mpich2/trunk/src/include/nopackage.h
mpich2/trunk/src/mpe2/Makefile.in
mpich2/trunk/src/mpe2/autogen.sh
mpich2/trunk/src/mpe2/maint/README
mpich2/trunk/src/mpe2/sbin/mpeinstall.in
mpich2/trunk/src/mpe2/src/slog2sdk/README.sdk
mpich2/trunk/src/mpe2/src/slog2sdk/autogen.sh
mpich2/trunk/src/mpe2/src/slog2sdk/maint/rename_oldsrc
mpich2/trunk/src/mpi/romio/adio/include/nopackage.h
mpich2/trunk/src/mpid/ch3/channels/nemesis/subconfigure.m4
mpich2/trunk/src/mpid/ch3/channels/sock/subconfigure.m4
mpich2/trunk/src/mpix/armci/m4/aclocal_cc.m4
mpich2/trunk/src/mpix/armci/m4/aclocal_shl.m4
mpich2/trunk/src/mpix/armci/m4/aclocal_subcfg.m4
mpich2/trunk/src/pm/hydra/hydra-doxygen.cfg.in
mpich2/trunk/test/mpi/Makefile.am
mpich2/trunk/test/mpi/maint/updatefiles
mpich2/trunk/winconfigure.wsf
Log:
configure.in --> configure.ac to be consistent with the autotools
preferred naming convention.
Modified: mpich2/trunk/confdb/aclocal_cc.m4
===================================================================
--- mpich2/trunk/confdb/aclocal_cc.m4 2012-02-28 23:25:23 UTC (rev 9547)
+++ mpich2/trunk/confdb/aclocal_cc.m4 2012-02-28 23:26:34 UTC (rev 9548)
@@ -1302,7 +1302,7 @@
#
# determine if the compiler defines a symbol containing the function name
-# Inspired by checks within the src/mpid/globus/configure.in file in MPICH2
+# Inspired by checks within the src/mpid/globus/configure.ac file in MPICH2
#
# These tests check not only that the compiler defines some symbol, such
# as __FUNCTION__, but that the symbol correctly names the function.
Modified: mpich2/trunk/confdb/aclocal_shl.m4
===================================================================
--- mpich2/trunk/confdb/aclocal_shl.m4 2012-02-28 23:25:23 UTC (rev 9547)
+++ mpich2/trunk/confdb/aclocal_shl.m4 2012-02-28 23:26:34 UTC (rev 9548)
@@ -380,7 +380,7 @@
fi
# Libtool needs master_top_builddir
if test "X$master_top_builddir" = "X" ; then
- AC_MSG_ERROR([Libtool requires master_top_builddir - check configure.in sources])
+ AC_MSG_ERROR([Libtool requires master_top_builddir - check configure.ac sources])
fi
AC_SUBST(master_top_builddir)
fi
Modified: mpich2/trunk/confdb/aclocal_subcfg.m4
===================================================================
--- mpich2/trunk/confdb/aclocal_subcfg.m4 2012-02-28 23:25:23 UTC (rev 9547)
+++ mpich2/trunk/confdb/aclocal_subcfg.m4 2012-02-28 23:26:34 UTC (rev 9548)
@@ -25,7 +25,7 @@
dnl The subconfigure argument list is created based on "ac_precious_vars"
dnl instead of explicitly use of well-known Makefile variables, like
dnl CC/CFLAGS/CPPFLAGS..., this generalization is effective as long as
-dnl calling configure.in declares the needed variables to be passed down
+dnl calling configure.ac declares the needed variables to be passed down
dnl to subconfigure as "precious" appropriately. The precious variable
dnl can be created in the following ways:
dnl 1) implicit declaration through use of autoconf macros, like
@@ -34,7 +34,7 @@
dnl which are in turns invoked by other subconfigure.
dnl When in doubt, check "ac_precious_var" in the calling configure.
dnl 2) explicit "precious" declaration through AC_ARG_VAR.
-dnl Without correct "precious" declaration in the calling configure.in,
+dnl Without correct "precious" declaration in the calling configure.ac,
dnl there would be variables not being included in the subconfigure
dnl argument list.
dnl
@@ -159,7 +159,7 @@
pac_sub_configure=$ac_srcdir/configure.gnu
elif test -f "$ac_srcdir/configure"; then
pac_sub_configure=$ac_srcdir/configure
- elif test -f "$ac_srcdir/configure.in"; then
+ elif test -f "$ac_srcdir/configure.ac"; then
# This should be Cygnus configure.
pac_sub_configure=$ac_aux_dir/configure
else
Copied: mpich2/trunk/configure.ac (from rev 9546, mpich2/trunk/configure.in)
===================================================================
--- mpich2/trunk/configure.ac (rev 0)
+++ mpich2/trunk/configure.ac 2012-02-28 23:26:34 UTC (rev 9548)
@@ -0,0 +1,5989 @@
+AC_PREREQ(2.63)
+#
+# (C) 2006 by Argonne National Laboratory.
+# See COPYRIGHT in top-level directory.
+#
+dnl Process this file with autoconf to produce a configure script.
+dnl
+dnl aclocal_cache.m4, included by sowing/confdb/aclocal.m4, fixes
+dnl bugs in autoconf caching.
+dnl
+dnl This is a large configure script and it is important to keep it
+dnl clearly organized. In addition, this script must coordinate with
+dnl the other modules that can be used to construct MPICH2, such as
+dnl the communication device and the process manager. Each of these
+dnl may have special features or limitations that other modules or
+dnl this configure may need to take into account. To handle this, there
+dnl are xx major steps in this configure script:
+dnl
+dnl 1. Identify major modules and source any prerequisite scripts
+dnl 2. Determine compiler characteristics
+dnl 3. Setup and configure the other modules
+dnl 4. Determine MPI features and characteristics (such as datatype values)
+dnl
+dnl Each of these is described in more detail below.
+dnl
+dnl 1. Identify the modules (most are specified by
+dnl --with-<modulename>=instance,
+dnl for example, --with-pm=mpd or --with-device=ch3:nemesis).
+dnl For each module, source the file mpich2prereq if present (in the
+dnl module's top-level directory). This
+dnl must be a bourne (sh) shell script; it can access any of the variables
+dnl in the configure script. In addition, there are a few variables that
+dnl are defined and provided to allow the modules to communicate their
+dnl needs or limitations to the other modules. These are:
+dnl MPID_MAX_THREAD_LEVEL - thread level supported by device.
+dnl if unset, is MPI_THREAD_FUNNELED
+dnl MPID_NO_LONG_LONG - if yes, the device does not support the
+dnl long long integer type
+dnl MPID_NO_LONG_DOUBLE - if yes, the device does not support the
+dnl long double type
+dnl MPID_PM_NAMESERVER - if set, provides the name of the nameserver
+dnl that the process manager supports.
+dnl This name server will be used if the
+dnl default name server is selected.
+dnl MPID_NO_PM - If yes, the device does not require any
+dnl PM implementation.
+dnl MPID_NO_PMI - If yes, the device does not require any
+dnl PMI implementation.
+dnl EXTRA_STATUS_DECL - Any extra declarations that the device
+dnl needs added to the definition of MPI_Status.
+dnl MPID_MAX_PROCESSOR_NAME - The maximum number of character in a processor
+dnl name. If not set, 128 will be used.
+dnl PMI_REQUIRES_READABLE_TOKENS - if yes, define the C-preprocessor
+dnl value USE_HUMAN_READABLE_TOKENS, which is
+dnl used in src/include/mpimem.h to define token
+dnl separators used in src/util/mem/argstr.c
+dnl PM_REQUIRES_PMI - if set, provides the name of the PMI
+dnl interface implementation. If not set,
+dnl the "simple" PMI implementation is used.
+dnl A process manager that needs a particular
+dnl process manager should check that this is
+dnl not set to an incompatible value.
+dnl MPID_NO_SPAWN - if yes, the device does not support the
+dnl dynamic process routines (spawn, connect
+dnl attach, join, plus port and publish
+dnl routines). The major effect of this
+dnl is to let the test codes know that
+dnl spawn is not implemented.
+dnl MPID_NO_RMA - if yes, the device does not support the
+dnl MPI RMA routines (MPI_Win_create and
+dnl MPI_Put etc.). The major effect of this
+dnl is to let the test codes know that
+dnl RMA is not implemented.
+dnl
+dnl Note that the meanings of these variables are defined so that an
+dnl undefined value gives the default. This makes it easy to expand
+dnl the set of such variables, since only modules that need the new
+dnl variable will need to be changed.
+dnl
+dnl 2. Determine compiler characteristics
+dnl Here is where features of the compilers are determined, including
+dnl support for shared libraries and sizes of the basic datatype types.
+dnl
+dnl 3. Setup and configure the other modules
+dnl Before each module configure is executed, the script setup_<module>
+dnl is run if present. This is a bourne (sh) shell script and may
+dnl access configure variables. It should not make any changes to the
+dnl compiler name or flags (e.g., do not add -D_XOPEN_SOURCE to CFLAGS here,
+dnl because that may invalidate the determination of the compiler
+dnl characteristics in the prior step).
+dnl
+dnl 4. Determine MPI features
+dnl
+dnl
+dnl Special environment variables
+dnl To let other scripts and in particular the configure in test/mpi
+dnl know that they are being invoked from within the MPICH2 configure,
+dnl the following environment variables are set and exported:
+dnl FROM_MPICH2
+dnl MPICH2_ENABLE_F77
+dnl MPICH2_ENABLE_FC
+dnl MPICH2_ENABLE_CXX
+dnl
+dnl The file name here refers to a file in the source being configured
+dnl In later versions of autoconf, the binding of AC_INIT changed (!!!)
+dnl The original version was AC_INIT(a source file)
+dnl The later version is AC_INIT(package,version,[bug-report],[tarname])
+dnl
+dnl Note that no executable statements are allowed (and any are silently
+dnl dropped) before AC_INIT.
+dnl
+dnl AC_INIT requires an explicit version number
+dnl Args are package name, version, bug report, and tar file name
+dnl All must be literals
+dnl Note that AC_PACKAGE_STRING is not a command but must be defined(!)
+dnl Unfortunately, setting the PACKAGE names is not compatible with
+dnl AC_CONFIG_SUBDIRS, since the resulting values in the generated
+dnl conf file will not be consistent.
+dnl define([AC_PACKAGE_STRING],[MPICH2 1.0.6])
+dnl AC_INIT(mpich2,1.0.6,mpich2-maint at mcs.anl.gov,mpich2-1.0.6)
+dnl Use the oldstyle AC_INIT instead
+
+m4_include([maint/version.m4])
+dnl 2nd arg is intentionally underquoted
+AC_INIT([MPICH2],
+ MPICH2_VERSION_m4,
+ [mpich-discuss at mcs.anl.gov],
+ [mpich2],
+ [http://www.mcs.anl.gov/research/projects/mpich2/])
+
+if test "x$prefix" != "xNONE" && test -d "$prefix"; then
+ if test "x`(cd \"$prefix\"; echo \"$PWD\")`" = "x`(cd \"$srcdir\"; echo \"$PWD\")`" ||\
+ test "x`(cd \"$prefix\"; echo \"$PWD\")`" = "x$PWD" ; then
+ AC_MSG_ERROR([The install directory (--prefix=) cannot be the same as the build or src directory.])
+ fi
+fi
+
+CONFIGURE_ARGS_CLEAN=`echo $* | tr '"' ' '`
+AC_SUBST(CONFIGURE_ARGS_CLEAN)
+
+# these values come from the m4_include above
+MPICH2_VERSION=MPICH2_VERSION_m4
+AC_SUBST([MPICH2_VERSION])
+MPICH2_RELEASE_DATE="MPICH2_RELEASE_DATE_m4"
+AC_SUBST([MPICH2_RELEASE_DATE])
+libmpich_so_version="libmpich_so_version_m4"
+AC_SUBST([libmpich_so_version])
+
+
+if test -z "$MPICH2_VERSION" ; then
+ AC_MSG_ERROR([MPICH2_VERSION is empty, check maint/version.m4 for errors])
+fi
+# Produce a numeric version assuming the following format:
+# Version: [MAJ].[MIN].[REV][EXT][EXT_NUMBER]
+# Example: 1.0.7rc1 has
+# MAJ = 1
+# MIN = 0
+# REV = 7
+# EXT = rc
+# EXT_NUMBER = 1
+#
+# Converting to numeric version will convert EXT to a format number:
+# ALPHA (a) = 0
+# BETA (b) = 1
+# RC (rc) = 2
+# PATCH (p) = 3
+# Regular releases are treated as patch 0
+#
+# Numeric version will have 1 digit for MAJ, 2 digits for MIN,
+# 2 digits for REV, 1 digit for EXT and 2 digits for EXT_NUMBER.
+changequote(<<,>>)
+V1=`expr $MPICH2_VERSION : '\([0-9]*\)\.[0-9]*\.*[0-9]*[a-zA-Z]*[0-9]*'`
+V2=`expr $MPICH2_VERSION : '[0-9]*\.\([0-9]*\)\.*[0-9]*[a-zA-Z]*[0-9]*'`
+V3=`expr $MPICH2_VERSION : '[0-9]*\.[0-9]*\.*\([0-9]*\)[a-zA-Z]*[0-9]*'`
+V4=`expr $MPICH2_VERSION : '[0-9]*\.[0-9]*\.*[0-9]*\([a-zA-Z]*\)[0-9]*'`
+V5=`expr $MPICH2_VERSION : '[0-9]*\.[0-9]*\.*[0-9]*[a-zA-Z]*\([0-9]*\)'`
+changequote([,])
+
+if test "$V2" -le 9 ; then V2=0$V2 ; fi
+if test "$V3" = "" ; then V3=0; fi
+if test "$V3" -le 9 ; then V3=0$V3 ; fi
+if test "$V4" = "a" ; then
+ V4=0
+elif test "$V4" = "b" ; then
+ V4=1
+elif test "$V4" = "rc" ; then
+ V4=2
+elif test "$V4" = "" ; then
+ V4=3
+ V5=0
+elif test "$V4" = "p" ; then
+ V4=3
+fi
+if test "$V5" -le 9 ; then V5=0$V5 ; fi
+
+MPICH2_NUMVERSION=`expr $V1$V2$V3$V4$V5 + 0`
+AC_SUBST(MPICH2_NUMVERSION)
+
+# ABIVERSION is the name used by simplemake, so we reassign the
+# libmpich_so_version number to it
+ABIVERSION=${libmpich_so_version}
+export ABIVERSION
+export libmpich_so_version
+AC_SUBST(ABIVERSION)
+
+# Print out the configure options
+CONFIGURE_ARGUMENTS="$ac_configure_args"
+AC_SUBST(CONFIGURE_ARGUMENTS)
+if test -n "$ac_configure_args" ; then
+ echo "Configuring MPICH2 version $MPICH2_VERSION with $ac_configure_args"
+else
+ echo "Configuring MPICH2 version $MPICH2_VERSION"
+fi
+
+# Add the information on the system:
+echo "Running on system: `uname -a`"
+
+dnl Definitions will be placed in this file rather than in the DEFS variable
+AC_CONFIG_HEADER(src/include/mpichconf.h)
+AH_TOP([/* -*- Mode: C; c-basic-offset:4 ; -*- */
+/*
+ * (C) 2001 by Argonne National Laboratory.
+ * See COPYRIGHT in top-level directory.
+ */
+#ifndef MPICHCONF_H_INCLUDED
+#define MPICHCONF_H_INCLUDED
+])
+
+# We use an #include strategy here because all of the alternative strategies for
+# quashing these variables have various drawbacks. The alternatives are listed
+# here to avoid rediscovery of these problems by someone else in the future:
+#
+# 1) Strategy: Rewrite mpichconf.h.in with sed at maint/updatefiles time.
+# Problem: Automatic remaking of config.status and friends will re-run
+# autoheader and blow away our sed changes without an opportunity to
+# patch the resulting file again.
+# 2) Strategy: Add literal "#undef PACKAGE" lines to the AH_BOTTOM text.
+# Problem: These lines get rewritten by config.status to be "#define" lines,
+# so the intended quashing never actually occurs.
+# 3) Strategy: Use AC_CONFIG_COMMANDS to run a sed rewrite command on
+# mpichconf.h at config.status time.
+# Problem: Causes mpichconf.h to always be rewritten, first by the normal
+# config.status commands and then by sed. This can cause
+# unnecessary remaking of object files since nearly every C source
+# file includes this header (see the Autoconf Manual, "Automatic
+# Remaking")
+#
+# The only other plausible strategy would seem to be rewriting config.status
+# itself via AC_CONFIG_COMMANDS_POST, but that seems error prone. The best
+# solution would be to stop all subconfigures from including config.h headers
+# from other packages. Then all of this nonsense can be eliminated.
+# [goodell@ 2011-08-26]
+AH_BOTTOM([
+/* Include nopackage.h to undef autoconf-defined macros that cause conflicts in
+ * subpackages. This should not be necessary, but some packages are too
+ * tightly intertwined right now (such as ROMIO and the MPICH2 core) */
+#include "nopackage.h"
+
+#endif /* !defined(MPICHCONF_H_INCLUDED) */
+])
+
+dnl Set the directory that contains support scripts such as install-sh and
+dnl config.guess
+AC_CONFIG_AUX_DIR(confdb)
+dnl our macro dir is the same as our aux dir
+AC_CONFIG_MACRO_DIR([confdb])
+
+# Set the FROM_MPICH2 variable to tell subconfigures that they are
+# built from within MPICH2
+FROM_MPICH2=yes
+export FROM_MPICH2
+AC_SUBST([FROM_MPICH2])
+
+# Save a copy of precious flags as USER_* before any of these flags
+# are being modified by configure tests.
+PAC_PREFIX_ALL_FLAGS(USER)
+
+# WRAPPER_xFLAGS are used by mpicc and friends.
+#
+# WRAPPER_CFLAGS and other compile flags are used for compile options
+# that are added by MPICH2, but should be used by applications (such
+# as include paths).
+#
+# All libraries that are detected by MPICH2 as needed for some of its
+# functionality (such as -lpthread) should be added to LIBS so
+# autoconf link tests can use them. Libraries that are built by MPICH2
+# at make time (and hence are not available for autoconf link tests to
+# use), such as OPA and MPL, should be added to WRAPPER_LIBS for
+# static builds. All libraries in LIBS are added to WRAPPER_LIBS
+# (similarly LDFLAGS are added to WRAPPER_LDFLAGS) as well, at the end
+# of configure.
+PAC_PREFIX_ALL_FLAGS(WRAPPER)
+WRAPPER_CFLAGS="$CFLAGS $MPICH2_MPICC_FLAGS"
+WRAPPER_CPPFLAGS="$CPPFLAGS $MPICH2_MPICPP_FLAGS"
+WRAPPER_CXXFLAGS="$CXXFLAGS $MPICH2_MPICXX_FLAGS"
+WRAPPER_FFLAGS="$FFLAGS $MPICH2_MPIF77_FLAGS"
+WRAPPER_FCFLAGS="$FCFLAGS $MPICH2_MPIFC_FLAGS"
+WRAPPER_LDFLAGS="$MPICH2_LDFLAGS"
+WRAPPER_LIBS="$MPICH2_LIBS"
+
+# Add MPICH2LIB_* to the appropriate flags
+AC_ARG_VAR(MPICH2LIB_CFLAGS,
+ [extra CFLAGS used in building MPICH2 libraries])
+AC_ARG_VAR(MPICH2LIB_CPPFLAGS,
+ [extra CPPFLAGS used in building MPICH2 libraries])
+AC_ARG_VAR(MPICH2LIB_CXXFLAGS,
+ [extra CXXFLAGS used in building MPICH2 libraries])
+AC_ARG_VAR(MPICH2LIB_FFLAGS,
+ [extra FFLAGS used in building MPICH2 libraries])
+AC_ARG_VAR(MPICH2LIB_FCFLAGS,
+ [extra FCFLAGS used in building MPICH2 libraries])
+AC_ARG_VAR(MPICH2LIB_LDFLAGS,
+ [extra LDFLAGS used in building MPICH2 libraries])
+AC_ARG_VAR(MPICH2LIB_LIBS,
+ [extra LIBS used in building MPICH2 libraries])
+CFLAGS="$CFLAGS $MPICH2LIB_CFLAGS"
+CPPFLAGS="$CPPFLAGS $MPICH2LIB_CPPFLAGS"
+CXXFLAGS="$CXXFLAGS $MPICH2LIB_CXXFLAGS"
+FFLAGS="$FFLAGS $MPICH2LIB_FFLAGS"
+FCFLAGS="$FCFLAGS $MPICH2LIB_FCFLAGS"
+LDFLAGS="$LDFLAGS $MPICH2LIB_LDFLAGS"
+LIBS="$LIBS $MPICH2LIB_LIBS"
+
+dnl include all subsystem m4 fragments now that the core autoconf functionality
+dnl has been setup. No fragment should do anything except define
+dnl PAC_SUBCFG_{PREREQ,BODY} macros which will be expanded later as
+dnl appropriate
+# begin subsys includes
+m4_include([subsys_include.m4])
+# end subsys includes
+
+dnl ----------------------------------------------------------------------------
+dnl setup top-level argument handling
+AC_ARG_ENABLE(lib-depend,
+ AC_HELP_STRING([--enable-lib-depend], [Turn on library dependencies (experimental)]),,
+ [enable_lib_depend=no])
+
+AC_ARG_ENABLE(echo,
+ AC_HELP_STRING([--enable-echo], [Turn on strong echoing. The default is enable=no.]),
+ set -x)
+
+AC_ARG_ENABLE(dynamiclibs,
+ AC_HELP_STRING([--enable-dynamiclibs], [Enable the use of dynamic libraries
+ by the devices that support them]),,enable_dynamiclibs=no)
+
+AC_ARG_ENABLE(error-checking,
+[ --enable-error-checking=level
+ Control the amount of error checking.
+ no - no error checking
+ runtime - error checking controllable at runtime through environment
+ variables
+ all - error checking always enabled (default)
+],,enable_error_checking=default)
+
+AC_ARG_ENABLE(error-messages,
+[ --enable-error-messages=level - Control the amount of detail in error messages.
+ all - Maximum amount of information
+ generic - Only generic messages (no information about the specific
+ instance)
+ class - One message per MPI error class
+ none - No messages
+],,enable_error_messages=all)
+
+AC_ARG_ENABLE(timing,
+[ --enable-timing=level - Control the amount of timing information
+ collected by the MPICH implementation.
+ none - Collect no data (default)
+ all - Collect lots of data
+ runtime - Runtime control of data collected
+],,enable_timing=default)
+
+AC_ARG_ENABLE(g,
+[ --enable-g=option - Control the level of debugging support in the
+ MPICH implementation. option is a list of comma
+ separated names including
+ none - No debugging
+ handle - Trace handle operations
+ handlealloc - Trace handle allocations
+ dbg - Add compiler flag, -g, to all internal
+ compiler flags, i.e. MPICH2LIB_CFLAGS, MPICH2LIB_CXXFLAGS,
+ MPICH2LIB_FFLAGS, and MPICH2LIB_FCFLAGS.
+ debug - Synonym for dbg
+ instr - Enable instrumentation
+ log - Enable debug event logging
+ mem - Memory usage tracing
+ meminit - Preinitialize memory associated structures and unions to
+ eliminate access warnings from programs like valgrind
+ memarena - Check for overwrite errors in memory allocation arena
+ mutex - Enable error checking on pthread mutexes
+ mutexnesting - Check for non-nesting of mutexes
+ all - All of the above choices
+],,enable_g=none)
+
+dnl We may want to force MPI_Aint to be the same size as MPI_Offset,
+dnl particularly on 32 bit systems with large (64 bit) file systems.
+AC_ARG_WITH(aint-size,
+ AC_HELP_STRING([--with-aint-size], [Override the size of MPI_AINT (in bytes)]),,
+ with_aint_size=0)
+
+AC_ARG_ENABLE(fast,
+[ --enable-fast=option - Control the level of fast execution in the
+ MPICH implementation. option is a list of
+ comma separated names including
+ defopt - Default compiler optimization -O2 for all language bindings,
+ i.e. --enable-fast=O2, when neither --enable-fast
+ nor --disable-fast is specified. (default)
+ O<n> - Appends default optimization flags, -O<n>, to all internal
+ compiler flags, i.e. MPICH2LIB_CFLAGS, MPICH2LIB_CXXFLAGS,
+ MPICH2LIB_FFLAGS, and MPICH2LIB_FCFLAGS.
+ nochkmsg - No error checking, i.e. --disable-error-checking
+ notiming - No timing collection, i.e. --disable-timing.
+ ndebug - Appends -DNDEBUG to MPICH2LIB_CFLAGS.
+ all|yes - "defopt", "nochkmsg", "notiming" and "ndebug" are enabled
+ when --enable-fast is specified without any option.
+ none - None of above options, i.e. --disable-fast. Note that
+ --enable-strict will add the -O2 option even if
+ --enable-fast=none is given.
+],,enable_fast=defopt)
+
+AC_ARG_ENABLE(check-compiler-flags,
+ AC_HELP_STRING([--enable-check-compiler-flags], [enable the checks for all compiler
+ options, xxxFLAGS, MPICH2_xxxFLAGS. Default is on.]),,
+ enable_check_compiler_flags=yes)
+
+dnl We enable f77 and fc if we can find compilers for them.
+dnl In addition, we check whether f77 and fc can work together.
+AC_ARG_ENABLE(f77,
+ AC_HELP_STRING([--enable-f77], [Enable Fortran 77 bindings]),,enable_f77=yes)
+
+AC_ARG_ENABLE(fc,
+ AC_HELP_STRING([--enable-fc], [Enable Fortran 90 bindings]),,enable_fc=yes)
+
+AC_ARG_ENABLE(f90,
+ AC_HELP_STRING([--enable-f90],
+ [Obsolete option: Use --enable-fc or --disable-fc instead]),
+ [AC_MSG_ERROR([
+--enable-f90 and --disable-f90 are NO longer valid configure options,
+use --enable-fc or --disable-fc instead])]
+)
+
+AC_ARG_ENABLE(cxx,
+ AC_HELP_STRING([--enable-cxx], [Enable C++ bindings]),,enable_cxx=yes)
+
+AC_ARG_ENABLE(romio,
+ AC_HELP_STRING([--enable-romio], [Enable ROMIO MPI I/O implementation]),,
+ enable_romio=yes)
+
+AC_ARG_ENABLE(debuginfo,
+ AC_HELP_STRING([--enable-debuginfo], [Enable support for debuggers]),,
+ enable_debuginfo=no)
+
+AC_ARG_ENABLE(smpcoll,
+ AC_HELP_STRING([--enable-smpcoll],
+ [Enable support for SMP/multi-core aware collectives]),
+ smpcoll=$enableval,smpcoll=yes)
+if test $smpcoll = "yes" ; then
+ AC_DEFINE(USE_SMP_COLLECTIVES,1,[define to enable SMP/multi-core aware collectives])
+fi
+
+dnl The environment variable MPICH_DEBUGLIBNAME may be used to
+dnl override the default name of the library that the debugger will
+dnl load to access the MPICH2 internal data structures.
+AC_ARG_ENABLE(nmpi-as-mpi,
+ AC_HELP_STRING([--enable-nmpi-as-mpi], [Use MPI rather than PMPI routines for MPI
+ routines, such as the collectives, that may be
+ implemented in terms of other MPI routines]),,
+ enable_nmpi_as_mpi=no)
+
+dnl "default" is a special device that allows MPICH to choose one
+dnl based on the environment.
+AC_ARG_WITH(device,
+ AC_HELP_STRING([--with-device=name], [Specify the communication device for MPICH]),,
+ with_device=default)
+
+AC_ARG_WITH(pmi,
+ AC_HELP_STRING([--with-pmi=name], [Specify the pmi interface for MPICH]),,
+ with_pmi=default)
+
+AC_ARG_WITH(pm,
+ AC_HELP_STRING([--with-pm=name],
+ [Specify the process manager for MPICH. "no" or "none" are
+ valid values. Multiple process managers may be specified as
+ long as they all use the same pmi interface by separating them
+ with colons. The mpiexec for the first named process manager
+ will be installed. Example: "--with-pm=hydra:mpd:gforker"
+ builds the three process managers hydra, mpd and gforker;
+ only the mpiexec from hydra is installed into the bin
+ directory.]),,with_pm=default)
+
+AC_ARG_WITH(logging,
+ AC_HELP_STRING([--with-logging=name], [Specify the logging library for MPICH]),
+ [if test -z "$withval" ; then with_logging=rlog ; fi],with_logging=none)
+
+dnl both --without-mpe and --disable-mpe are supported
+dnl AC_ARG_ENABLE(mpe) is used only when --with(out)-mpe is not used.
+AC_ARG_WITH(mpe,
+ AC_HELP_STRING([--with-mpe], [Build the MPE (MPI Parallel Environment) routines]),,
+ with_mpe=default)
+if test "$with_mpe" = "default" ; then
+ AC_ARG_ENABLE(mpe,
+ AC_HELP_STRING([--enable-mpe], [Build the MPE (MPI Parallel Environment) routines]),
+ with_mpe=$enableval,with_mpe=default)
+fi
+
+dnl
+dnl The default option needs to be defined in terms of a specific choice
+dnl (runtime in this case). Note that the default choice is the same as
+dnl runtime only for certain devices - not for every device.
+AC_ARG_ENABLE(threads,
+[ --enable-threads=level - Control the level of thread support in the
+ MPICH implementation. The following levels
+ are supported.
+ single - No threads (MPI_THREAD_SINGLE)
+ funneled - Only the main thread calls MPI (MPI_THREAD_FUNNELED)
+ serialized - User serializes calls to MPI (MPI_THREAD_SERIALIZED)
+ runtime - The level of thread support is determined by
+ the arguments to MPI_Init_thread, with
+ MPI_THREAD_MULTIPLE available. The default option
+ for many communication devices.
+ multiple - Fully multi-threaded (MPI_THREAD_MULTIPLE) always.
+ DO NOT select this option. The option runtime is more
+ efficient and also supports thread_multiple.
+ (multiple aliased to runtime now)
+ default - Make a good choice depending on the communication
+ device. For ch3:nemesis, this is runtime.
+
+ See also the --enable-thread-cs option for controlling the granularity of
+ the concurrency inside of the library
+],,enable_threads=default)
+
+AC_ARG_ENABLE(thread-cs,
+ AC_HELP_STRING([--enable-thread-cs=type],
+ [Choose the method used for critical sections
+ and other atomic updates when multiple
+ threads are present. Values may be global
+ (default), per-object, lock-free]),,enable_thread_cs=global)
+
+AC_ARG_ENABLE(refcount,
+ AC_HELP_STRING([--enable-refcount=type],
+ [Choose the method for ensuring atomic updates
+ to the reference counts for MPI objects.
+ Values may be lock, lock-free, none. The
+ default depends on the thread-cs choice; for
+ global it is none (because none is required),
+ for per-object it is lock, and for lock-free
+ it is lock-free]),,enable_refcount=default)
+
+AC_ARG_ENABLE(mutex-timing,
+ AC_HELP_STRING([--enable-mutex-timing], [calculate the time spent waiting on mutexes]),
+ AC_DEFINE(MPIU_MUTEX_WAIT_TIME,1,[Define to enable timing mutexes]))
+
+AC_ARG_ENABLE(handle-allocation,
+ AC_HELP_STRING([--enable-handle-allocation=type],
+ [Choose the method used for allocating MPI
+ object handles. Values may be 'tls' for
+ thread-local storage or 'mutex' for simple
+ locking. 'mutex' is the default.]),,enable_handle_allocation=default)
+
+AC_ARG_ENABLE([predefined-refcount],
+ AS_HELP_STRING([--enable-predefined-refcount],
+ [control whether predefined objects like
+ MPI_COMM_WORLD are reference counted (default
+ depends on --enable-thread-cs choice)]),[],
+ [enable_predefined_refcount=default])
+
+AC_ARG_ENABLE(weak-symbols,
+ AC_HELP_STRING([--enable-weak-symbols],
+ [Use weak symbols to implement PMPI routines (default)]),,
+ enable_weak_symbols=yes)
+
+AC_ARG_ENABLE(multi-aliases,
+ AC_HELP_STRING([--enable-multi-aliases],
+ [Multiple aliasing to support multiple fortran compilers (default)]),,
+ enable_multi_aliases=yes)
+
+AC_ARG_ENABLE([rpath],
+ [AC_HELP_STRING([--enable-rpath],
+ [Determine whether the rpath is set when programs are
+ compiled and linked when shared libraries are built.
+ The default is yes; use --disable-rpath to turn this
+ feature off; in that case, shared libraries will be
+ found according to the rules for your system (e.g., in
+ LD_LIBRARY_PATH)])],
+ [],[enable_rpath=yes])
+AC_SUBST([enable_rpath])
+
+
+AC_ARG_WITH(cross,
+ AC_HELP_STRING([--with-cross=file],
+ [Specify the values of variables that configure cannot
+ determine in a cross-compilation environment]),,with_cross=no)
+
+AC_ARG_WITH(namepublisher,
+[ --with-namepublisher=name Choose the system that will support
+ MPI_PUBLISH_NAME and MPI_LOOKUP_NAME. Options
+ include
+ no (no service available)
+ mpd
+ file[:directory] (optional directory)
+ pmi],,with_namepublisher=default)
+AC_ARG_WITH(name-publisher,
+ [],
+ with_namepublisher=$with_name_publisher,)
+
+AC_SUBST(MPIFLIBNAME)
+AC_SUBST(PMPIFLIBNAME)
+
+dnl The default is a special wrapper library
+AC_ARG_WITH(fwrapname,
+ AC_HELP_STRING([--with-fwrapname=name],
+ [Specify name of library containing Fortran interface routines]),
+ [FWRAPNAME=$withval;set_FWRAPNAME="yes"],FWRAPNAME=fmpich)
+AC_SUBST(FWRAPNAME)
+
+# Find a C compiler.
+# We also need to do this before the F77 and FC test to ensure that we
+# find the C preprocessor reliably.
+PAC_PROG_CC
+AC_PROG_CC_C_O dnl needed for automake "silent-rules"
+PAC_PUSH_FLAG([CFLAGS])
+AC_PROG_CPP
+# Bug in autoconf. Restore cross settings
+if test "$pac_cross_compiling" = "yes" -a "$ac_cv_prog_cc_cross" = "no" ; then
+ AC_MSG_RESULT([Resetting cross compilation to yes])
+ cross_compiling=yes
+ ac_cv_prog_cc_cross=yes
+ ac_cv_prog_f77_cross=yes
+ ac_cv_prog_fc_cross=yes
+ ac_cv_prog_cxx_cross=yes
+fi
+PAC_POP_FLAG([CFLAGS])
+
+dnl now that autoconf and core compilers are setup, init automake and libtool
+AM_INIT_AUTOMAKE([-Wall -Werror foreign 1.11 silent-rules subdir-objects])
+AM_MAINTAINER_MODE([enable])
+LT_INIT([disable-shared])
+# Non-verbose make by default
+m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
+
+# Disable rpath if shared libraries are disabled, since rpath makes no sense in
+# the context of static libraries. This also disables any attempt to add rpath
+# flags in the compiler wrappers
+if test "X$enable_shared" = "Xno" ; then
+ enable_rpath=no
+fi
+
+dnl AC_PROG_{CXX,F77,FC} must come early in configure.ac in order to avoid some
+dnl esoteric autoconf macro expansion errors
+dnl
+dnl Also, DO NOT attempt to place shell conditionals (either manually or via
+dnl AS_IF) around these macros in an effort to save configure time. It will
+dnl lead to weird AM_CONDITIONAL errors and potentially other problems.
+
+# suppress default "-g -O2" from AC_PROG_CXX
+: ${CXXFLAGS=""}
+AC_PROG_CXX([PAC_CXX_SEARCH_LIST])
+
+# suppress default "-g -O2" from AC_PROG_F77
+: ${FFLAGS=""}
+AC_PROG_F77([PAC_F77_SEARCH_LIST])
+
+# suppress default "-g -O2" from AC_PROG_FC
+: ${FCFLAGS=""}
+AC_PROG_FC([PAC_FC_SEARCH_LIST])
+
+
+# compute canonical system types
+AC_CANONICAL_BUILD
+AC_CANONICAL_HOST
+# TARGET not needed, MPICH2 isn't a compiler
+
+# Enable better caching control
+PAC_ARG_CACHING
+
+# Set CFLAGS for enable strict if necessary. Do this *first* because
+# it may influence the output of the other tests
+PAC_ARG_STRICT
+
+# -----------------------------------------------------------------------------
+# First check that we have a clean build if we are doing a VPATH build
+PAC_VPATH_CHECK(src/include/mpi.h src/env/mpicc src/env/mpicc.conf,lib)
+
+# ----------------------------------------------------------------------------
+# This test is complicated by the fact that top_srcdir is not set until
+# the very end of configure. Instead, we get it ourselves
+if test -z "$top_srcdir" ; then
+ use_top_srcdir=$srcdir
+else
+ use_top_srcdir=$top_srcdir
+fi
+if test -z "$master_top_srcdir" ; then
+ # This needs to be an absolute pathname
+ case "$use_top_srcdir" in
+ /*) ;;
+ *)
+ use_top_srcdir=`(cd $use_top_srcdir && pwd)`
+ ;;
+ esac
+ master_top_srcdir=$use_top_srcdir
+fi
+# Get the directory that we're running in...
+if test -z "$master_top_builddir" ; then
+ master_top_builddir="`pwd`"
+fi
+AC_SUBST(master_top_builddir)
+AC_SUBST(master_top_srcdir)
+export master_top_builddir
+export master_top_srcdir
+# ----------------------------------------------------------------------------
+# We create this file to allow other configures to find the "master"
+# top builddir
+rm -f .mpich2
+date > .mpich2
+# ----------------------------------------------------------------------------
+# with-device
+if test "$with_device" = "default" ; then
+ # Pick the device. For now, always choose ch3
+ with_device=ch3
+fi
+# Extract the device name from any options
+# Allow the device to specify a directory; if no directory, use the
+# included directories
+#
+DEVICE=$with_device
+AC_SUBST(DEVICE)
+
+device_name=`echo $with_device | sed -e 's/:.*$//'`
+changequote(<<,>>)
+device_args=`echo $with_device | sed -e 's/^[^:]*//' -e 's/^://'`
+changequote([,])
+
+devicedir=$use_top_srcdir/src/mpid/$device_name
+devicereldir=src/mpid/$device_name
+case "$device_name" in
+ /*)
+ devicedir=$DEVICE
+ # Get the name from the leaf
+ device_name=`echo $device_name ~ sed -e 's%.*/%%'`
+ # FIXME: should the devicereldir be different (perhaps not -
+ # this allows use to build within our tree, even when other data
+ # is outside of the tree)
+ ;;
+ *)
+ ;;
+esac
+export device_name
+export device_args
+export devicedir
+# Make the device base name and args available to generated files
+DEVICE_NAME=$device_name
+AC_SUBST(DEVICE_NAME)
+DEVICE_ARGS=$device_args
+AC_SUBST(DEVICE_ARGS)
+#
+# Give the device an opportunity to include a header file in mpi.h. The
+# default value of INCLUDE_MPIDDEFS_H is set prior to the inclusion of the
+# device's mpich2prereq script. The device's script may override the value
+# if needed.
+INCLUDE_MPIDDEFS_H='/* ... no device specific definitions ... */'
+AC_SUBST(INCLUDE_MPIDDEFS_H)
+
+#
+# See if the device wants to say something about the compilers (for example,
+# the globus device may need to do this)
+if test -f $devicedir/mpich2prereq ; then
+ . $devicedir/mpich2prereq
+fi
+
+# expand all of the prereq macros in the correct order
+m4_map([PAC_SUBCFG_DO_PREREQ], [PAC_SUBCFG_MODULE_LIST])
+
+# ----------------------------------------------------------------------------
+# Set default library names if names haven't already been provided
+AC_ARG_VAR([MPILIBNAME],[can be used to override the name of the MPI library (default: "mpich")])
+AC_ARG_VAR([PMPILIBNAME],[can be used to override the name of the MPI profiling library (default: "p$MPILIBNAME")])
+AC_ARG_VAR([MPICXXLIBNAME],[can be used to override the name of the MPI C++ library (default: "${MPILIBNAME}cxx")])
+MPILIBNAME=${MPILIBNAME:-"mpich"}
+PMPILIBNAME_set=no
+if test -n "$PMPILIBNAME" ; then
+ PMPILIBNAME_set=yes
+fi
+PMPILIBNAME=${PMPILIBNAME:-"p$MPILIBNAME"}
+# Note that the name for this library may be updated after we check for
+# enable_shmem
+# Fortran names are set later.
+# We use a different library for the C++ wrappers to avoid problems when
+# creating shared libraries
+if test -z "$MPICXXLIBNAME" ; then MPICXXLIBNAME="${MPILIBNAME}cxx" ; fi
+export MPIFLIBNAME
+export PMPIFLIBNAME
+export MPICXXLIBNAME
+AC_SUBST(MPICXXLIBNAME)
+
+# We'll set FORTRAN_BINDING to 1 if we support Fortran
+FORTRAN_BINDING=0
+
+# Set up default compiler optimization
+MPI_DEFAULT_COPTS="-O2"
+MPI_DEFAULT_CXXOPTS="-O2"
+MPI_DEFAULT_FOPTS="-O2"
+MPI_DEFAULT_FCOPTS="-O2"
+
+# enable-fast
+# strip off multiple options, separated by commas
+save_IFS="$IFS"
+IFS=","
+for option in $enable_fast ; do
+ case "$option" in
+ defopt)
+ enable_default_optimize=yes
+ ;;
+ nochkmsg)
+ enable_fast_nochkmsg=yes
+ ;;
+ notiming)
+ enable_timing=no
+ ;;
+ ndebug)
+ enable_append_ndebug=yes
+ ;;
+#
+# [BRT] removed the reseting of enable_g so that --with-enable=dbg,meminit
+# can be specified with -enable-fast. This change was largely made for the
+# PETSc folks who want to use --enable-fast to eliminate parameter checking
+# overhead, but also wish to use meminit to eliminate initialization
+# warnings from valgrind.
+#
+ all|yes)
+ enable_default_optimize=yes
+ enable_fast_nochkmsg=yes
+ # Disable timing/logging stuffs
+ enable_timing=no
+ enable_append_ndebug=yes
+ ;;
+ O*)
+ # Allows O<n> where <n> can be [0-9] or ' '.
+ opt_flags=`echo $option | sed -e 's%\(O[0-9] \)%\1%g'`
+ if test -n "$opt_flags" ; then
+ enable_default_optimize=yes
+ MPI_DEFAULT_COPTS="-$option"
+ MPI_DEFAULT_CXXOPTS="-$option"
+ MPI_DEFAULT_FOPTS="-$option"
+ MPI_DEFAULT_FCOPTS="-$option"
+ else
+ IFS="$save_IFS"
+ AC_MSG_WARN([Unknown value $option for --enable-fast])
+ IFS=","
+ fi
+ ;;
+ none|no)
+ enable_default_optimize=no
+ enable_fast_nochkmsg=no
+ # Reset timing/logging stuffs to when --enable-timing isn't specified.
+ enable_timing=default
+ enable_append_ndebug=no
+ ;;
+ *)
+ IFS="$save_IFS"
+ AC_MSG_WARN([Unknown value $option for --enable-fast])
+ IFS=","
+ ;;
+ esac
+done
+IFS="$save_IFS"
+
+# ----------------------------------------------------------------------------
+# Process any enable or with values
+# We must do enable-fast first, because it changes the other enable values
+if test "$enable_fast_nochkmsg" = "yes" ; then
+ #
+ if test "$enable_error_checking" != "default" -a "$enable_error_checking" != "no" ; then
+ AC_MSG_ERROR([enable-fast overrides enable-error-checking; error-checking option $enable_error_checking ignored])
+ fi
+ enable_error_checking=no
+ # Export a variable that will allow the test suite to detect that
+ # MPICH has no error testing
+ MPICH_FAST=yes
+ export MPICH_FAST
+fi
+
+# error-checking
+# Change default into the specific value of the default
+if test "$enable_error_checking" = "default" ; then
+ enable_error_checking=all
+fi
+# glue_romio.h needs the variable HAVE_ERROR_CHECKING to have the value 0 or 1
+HAVE_ERROR_CHECKING=0
+case "$enable_error_checking" in
+ no)
+ # if error checking has been disabled, then automatically disable the error
+ # checking tests in the test suite
+ ac_configure_args="${ac_configure_args} --disable-checkerrors"
+ ;;
+ all|yes|runtime)
+ error_checking_kind=`echo $enable_error_checking | \
+ tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
+ error_checking_kind=MPID_ERROR_LEVEL_$error_checking_kind
+ AC_DEFINE_UNQUOTED(HAVE_ERROR_CHECKING,$error_checking_kind,[Define to enable error checking])
+ HAVE_ERROR_CHECKING=1
+ ;;
+ *)
+ AC_MSG_WARN([Unknown value $enable_error_checking for enable-error-checking])
+ ;;
+esac
+# permit @HAVE_ERROR_CHECKING@ substitution in glue_romio.h
+AC_SUBST([HAVE_ERROR_CHECKING])
+
+# error-messages
+case "$enable_error_messages" in
+ no|none)
+ error_message_kind="MPICH_ERROR_MSG_NONE"
+ ;;
+ all|yes)
+ error_message_kind="MPICH_ERROR_MSG_ALL"
+ ;;
+ generic)
+ error_message_kind="MPICH_ERROR_MSG_GENERIC"
+ ;;
+ class)
+ error_message_kind="MPICH_ERROR_MSG_CLASS"
+ ;;
+ *)
+ AC_MSG_WARN([Unknown value $enable_error_messages for enable-error-messages])
+ ;;
+esac
+AC_DEFINE_UNQUOTED(MPICH_ERROR_MSG_LEVEL,$error_message_kind,[define to enable error messages])
+
+# ----------------------------------------------------------------------------
+#
+# enable-timing and with-logging
+#
+# Still to do: add subsets: e.g., class=pt2pt,class=coll. See mpich2 doc
+#
+# Logging and timing are intertwined. If you select logging, you
+# may also need to select a timing level. If no timing is selected
+# but logging with rlog is selected, make "all" the default timing level.
+#
+# FIXME: make timing and logging options work more cleanly together,
+# particularly when other logging options are selected (e.g., logging is not
+# rlog).
+# ----------------------------------------------------------------------------
+AM_CONDITIONAL([BUILD_LOGGING_RLOG],[test "X$with_logging" = "Xrlog"])
+collect_stats=false
+logging_required=false
+if test "$enable_timing" = "default" ; then
+ if test "$with_logging" = "rlog" ; then
+ enable_timing=all
+ fi
+fi
+timing_name=$enable_timing
+case "$enable_timing" in
+ no)
+ timing_name=none
+ ;;
+ time)
+ collect_stats=true
+ ;;
+ log|log_detailed)
+ logging_required=true
+ ;;
+ yes)
+ timing_name=all
+ collect_stats=true
+ logging_required=true
+ ;;
+ all|runtime)
+ collect_stats=true
+ logging_required=true
+ ;;
+ none|default)
+ timing_name=none
+ ;;
+ *)
+ AC_MSG_WARN([Unknown value $enable_timing for enable-timing])
+ enable_timing=no
+ timing_name=none
+ ;;
+esac
+#
+# The default logging package is rlog; you can get it by
+# specifying --with-logging or --with-logging=rlog
+#
+case $with_logging in
+ yes)
+ logging_name=rlog
+ ;;
+ no|none)
+ logging_name=none
+ ;;
+ default)
+ if test "$logging_required" = "true" ; then
+ logging_name=rlog
+ else
+ logging_name=none
+ fi
+ ;;
+ *)
+ logging_name=$with_logging
+ ;;
+esac
+#
+# Include the selected logging subsystem
+#
+# Choices:
+# 1) A subdir of src/util/logging
+# This directory must contain a configure which will be executed
+# to build the
+# 2) An external directory
+# This directory must contain
+# a mpilogging.h file
+# It may contain
+# a setup_logging script
+# a configure
+#
+#
+logging_subsystems=
+if test "$logging_name" != "none" ; then
+ # Check for an external name (directory containing a /)
+ hasSlash=`echo A$logging_name | sed -e 's%[[^/]]%%g'`
+ if test -n "$hasSlash" ; then
+ # Check that the external logging system is complete.
+ # Any failure will cause configure to abort
+ if test ! -d $logging_name ; then
+ AC_MSG_ERROR([External logging directory $logging_name not found. Configure aborted])
+ logging_name=none
+ elif test ! -s $logging_name/mpilogging.h ; then
+ AC_MSG_ERROR([External logging header $logging_name/mpilogging.h not found. Configure aborted])
+ logging_name=none
+ fi
+
+ logdir=$logging_name
+ # Force the logdir to be absolute
+ logdir=`cd $logdir && pwd`
+ # Switch name to "external" because that is how the MPICH2
+ # code will know it
+ logging_name=external
+ # Add the dir to the include paths
+ #CPPFLAGS="$CPPFLAGS -I$logdir"
+ CPPFLAGS="$CPPFLAGS -I$logdir"
+ EXTERNAL_SRC_DIRS="$EXTERNAL_SRC_DIRS $logdir"
+ # Add to the list of external modules to setup
+ if test -x $logdir/setup_logging ; then
+ EXTERNAL_SETUPS="$EXTERNAL_SETUPS $logdir/setup_logging"
+ fi
+ else
+ logdir=$srcdir/src/util/logging
+ logreldir=src/util/logging/$logging_name
+ logging_subsystems="$logging_subsystems $logreldir"
+ logging_subdirs=$logging_name
+ for dir in $logging_subdirs ; do
+ if test ! -d $logdir/$dir ; then
+ AC_MSG_ERROR([$logdir/$dir does not exist. Configure aborted])
+ logging_name=none
+ fi
+ done
+ for dir in $logging_subsystems ; do
+ if test ! -x $srcdir/$dir/configure ; then
+ AC_MSG_ERROR([$logdir/$dir has no configure (required). Configure aborted])
+ logging_name=none
+ fi
+ other_install_dirs="${other_install_dirs} $logreldir"
+ done
+ fi
+fi
+#
+# FIXME: Logging doesn't necessarily require timing (e.g., simply logging the
+# sequence of routines).
+if test "$logging_name" != "none" ; then
+ if test "$enable_timing" != "no" ; then
+ if test "$enable_timing" = "default" -o "$enable_timing" = "none" ; then
+ enable_timing=log
+ timing_name=log
+ fi
+ logging_dir=logging
+ subsystems="$subsystems $logging_subsystems"
+ else
+ AC_MSG_WARN([Timing was disabled. Logging has been disabled as well.])
+ with_logging=no
+ logging_name=none
+ logging_dir=
+ logging_subdirs=
+ fi
+else
+ if test "$logging_required" = "true" ; then
+ AC_MSG_WARN([Timing was enabled with log option but no logging library is available. Timing has been disabled.])
+ enable_timing=no
+ timing_name=none
+ fi
+ logging_dir=
+ logging_subdirs=
+fi
+if test "$timing_name" != "none" ; then
+ timing_kind=`echo $timing_name | \
+ tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
+ timing_kind=MPID_TIMING_KIND_$timing_kind
+ AC_DEFINE_UNQUOTED(HAVE_TIMING,$timing_kind,[define to enable timing collection])
+ if test "$collect_stats" = "true" ; then
+ AC_DEFINE(COLLECT_STATS,1,[define to enable collection of statistics])
+ fi
+fi
+#
+AC_SUBST(logging_dir)
+AC_SUBST(logging_name)
+AC_SUBST(logging_subdirs)
+use_logging_variable="MPID_LOGGING_`echo $logging_name | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`"
+AC_DEFINE_UNQUOTED(USE_LOGGING,$use_logging_variable,[define to choose logging library])
+# ----------------------------------------------------------------------------
+# End of logging tests
+# ----------------------------------------------------------------------------
+
+# ----------------------------------------------------------------------------
+# Check to see if the device does not support spawn.
+# FIXME: This should provide the option of not building the dynamic
+# process routines. It could also allow us to specialize support
+# for all processes are members of MPI_COMM_WORLD (only one comm_world).
+# ----------------------------------------------------------------------------
+if test "$MPID_NO_SPAWN" = yes ; then
+ AC_MSG_WARN([The device $with_device does not support MPI dynamic process routines])
+fi
+
+# MPL
+PAC_CONFIG_SUBDIR(src/mpl,,AC_MSG_ERROR(MPL configure failed))
+PAC_PREPEND_FLAG([-lmpl], [WRAPPER_LIBS])
+PAC_APPEND_FLAG([-I${master_top_builddir}/src/mpl/include], [CPPFLAGS])
+PAC_APPEND_FLAG([-I${use_top_srcdir}/src/mpl/include], [CPPFLAGS])
+EXTERNAL_SRC_DIRS="$EXTERNAL_SRC_DIRS src/mpl"
+other_install_dirs="$other_install_dirs src/mpl"
+
+# OpenPA
+AC_ARG_WITH([openpa-prefix],
+ [AS_HELP_STRING([[--with-openpa-prefix[=DIR]]],
+ [use the OpenPA atomics library installed in DIR,
+ rather than the one included in src/openpa. Pass
+ "embedded" to force usage of the OpenPA source
+ distributed with MPICH2.])],
+ [],
+ [# see if OPA is already installed on the system
+ PAC_PUSH_FLAG([LIBS])
+ PAC_PREPEND_FLAG([-lopa],[LIBS])
+ AC_LINK_IFELSE([AC_LANG_PROGRAM([dnl
+#include "opa_primitives.h"
+],[
+OPA_int_t i;
+OPA_store_int(i,10);
+OPA_fetch_and_incr_int(&i,5);
+])dnl
+ ],
+ [with_openpa_prefix=system],[with_openpa_prefix=embedded])
+ PAC_POP_FLAG([LIBS])
+ ])
+# @opadir@ is used in src/Makefile.sm to control whether or not the OPA in
+# src/openpa is built and installed
+opadir=""
+AC_SUBST([opadir])
+
+if test "$with_openpa_prefix" = "embedded" ; then
+ if test -e "${use_top_srcdir}/src/openpa" ; then
+ opadir="openpa"
+ EXTERNAL_SRC_DIRS="$EXTERNAL_SRC_DIRS src/openpa"
+ PAC_APPEND_FLAG([-I${use_top_srcdir}/src/openpa/src],[CPPFLAGS])
+ PAC_APPEND_FLAG([-I${master_top_builddir}/src/openpa/src],[CPPFLAGS])
+
+ # OPA defaults to "auto", but in MPICH2 we want "auto_allow_emulation" to
+ # easily permit using channels like ch3:sock that don't care about atomics
+ AC_ARG_WITH([atomic-primitives],
+ [AS_HELP_STRING([--with-atomic-primitives],
+ [Force OPA to use a specific atomic primitives
+ implementation. See the src/openpa directory
+ for more info.])],
+ [],[with_atomic_primitives=not_specified])
+ opa_subdir_args=""
+ if test "$with_atomic_primitives" = "not_specified" ; then
+ opa_subdir_args="--with-atomic-primitives=auto_allow_emulation"
+ fi
+ PAC_CONFIG_SUBDIR_ARGS([src/openpa],[$opa_subdir_args],[],[AC_MSG_ERROR([OpenPA configure failed])])
+ PAC_PREPEND_FLAG([-lopa],[WRAPPER_LIBS])
+
+ other_install_dirs="$other_install_dirs src/openpa"
+ else
+ AC_MSG_WARN([Attempted to use the embedded OpenPA source tree in "src/openpa", but it is missing. Configuration or compilation may fail later.])
+ fi
+elif test "$with_openpa_prefix" = "system" ; then
+ PAC_PREPEND_FLAG([-lopa],[WRAPPER_LIBS])
+elif test "$with_openpa_prefix" = "no" ; then
+ # The user doesn't want to use OPA. This may or may not cause MPICH2 to
+ # fail to configure/build, depending on many other factors.
+ :
+else
+ # The user specified an already-installed OPA; just sanity check, don't
+ # subconfigure it
+ AS_IF([test -s "${with_openpa_prefix}/include/opa_primitives.h" -a -s "${with_openpa_prefix}/include/opa_config.h"],
+ [:],[AC_MSG_ERROR([the OpenPA installation in "${with_openpa_prefix}" appears broken])])
+ PAC_APPEND_FLAG([-I${with_openpa_prefix}/include],[CPPFLAGS])
+ PAC_PREPEND_FLAG([-lopa],[WRAPPER_LIBS])
+ if test -d ${with_openpa_prefix}/lib64 ; then
+ PAC_APPEND_FLAG([-L${with_openpa_prefix}/lib64],[WRAPPER_LDFLAGS])
+ fi
+ PAC_APPEND_FLAG([-L${with_openpa_prefix}/lib],[WRAPPER_LDFLAGS])
+fi
+
+# ----------------------------------------------------------------------------
+# Threads
+# ----------------------------------------------------------------------------
+#
+# Threads must be supported by the device. First, set the default to
+# be the highest supported by the device
+if test "$enable_threads" = default ; then
+ # XXX DJG bug is here, PREREQ is not being used right now
+ if test -n "$MPID_MAX_THREAD_LEVEL" ; then
+ case $MPID_MAX_THREAD_LEVEL in
+ MPI_THREAD_SINGLE) enable_threads=single ;;
+ MPI_THREAD_FUNNELED) enable_threads=funneled ;;
+ MPI_THREAD_SERIALIZED) enable_threads=serialized ;;
+ MPI_THREAD_MULTIPLE) enable_threads=runtime ;;
+ *) AC_MSG_ERROR([Unrecognized thread level from device $MPID_MAX_THREAD_LEVEL])
+ ;;
+ esac
+ else
+ enable_threads=single
+ fi
+fi
+
+if test "$enable_threads" = "yes" ; then
+ enable_threads=multiple
+elif test "$enable_threads" = "no" ; then
+ enable_threads=single
+elif test "$enable_threads" = "default"; then
+ if test "$with_device" = "default" -o "$with_device" = "ch3:sock" ; then
+ enable_threads=runtime
+ fi
+fi
+
+# Runtime is an alias for multiple with an additional value
+if test "$enable_threads" = "runtime" ; then
+ AC_DEFINE(HAVE_RUNTIME_THREADCHECK,1,[Define if MPI supports MPI_THREAD_MULTIPLE with a runtime check for thread level])
+ enable_threads=multiple
+fi
+
+MPICH_THREAD_LEVEL=MPI_THREAD_FUNNELED
+case "$enable_threads" in
+ single)
+ thread_pkg_required=no
+ MPICH_THREAD_LEVEL=MPI_THREAD_SINGLE
+ ;;
+ funneled)
+ thread_pkg_required=no
+ MPICH_THREAD_LEVEL=MPI_THREAD_FUNNELED
+ ;;
+ serialized)
+ # FIXME: Why does serialized require a thread package?
+ thread_pkg_required=yes
+ MPICH_THREAD_LEVEL=MPI_THREAD_SERIALIZED
+ ;;
+ multiple)
+ thread_pkg_required=yes
+ MPICH_THREAD_LEVEL=MPI_THREAD_MULTIPLE
+ ;;
+ *)
+ AC_MSG_ERROR(["$enable_threads" is not a valid value for --enable-threads])
+ ;;
+esac
+# Check that the requested thread level is available.
+threadLevelOK=yes
+if test -z "$MPID_MAX_THREAD_LEVEL" ; then
+ if test "$MPICH_THREAD_LEVEL" = "MPI_THREAD_MULTIPLE" -o "$MPICH_THREAD_LEVEL" = "MPI_THREAD_SERIALIZED" ; then
+ threadLevelOK=no
+ fi
+else
+ # Check that MPID_MAX_THREAD_LEVEL is at least as large as the
+ # selected MPICH_THREAD_LEVEL
+ case $MPICH_THREAD_LEVEL in
+ MPI_THREAD_MULTIPLE)
+ if test "$MPID_MAX_THREAD_LEVEL" != "MPI_THREAD_MULTIPLE" ; then
+ threadLevelOK=no
+ fi
+ ;;
+ MPI_THREAD_SERIALIZED)
+ if test "$MPID_MAX_THREAD_LEVEL" != "MPI_THREAD_MULTIPLE" -a \
+ "$MPID_MAX_THREAD_LEVEL" != "MPI_THREAD_SERIALIZED" ; then
+ threadLevelOK=no
+ fi
+ ;;
+ MPI_THREAD_FUNNELED)
+ if test "$MPID_MAX_THREAD_LEVEL" = "MPI_THREAD_SINGLE" ; then
+ threadLevelOK=no
+ fi
+ ;;
+ MPI_THREAD_SINGLE)
+ ;;
+ esac
+fi
+if test "$threadLevelOK" != yes ; then
+ AC_MSG_ERROR([The device $with_device does not support $MPICH_THREAD_LEVEL])
+fi
+
+export MPICH_THREAD_LEVEL
+AC_DEFINE_UNQUOTED(MPICH_THREAD_LEVEL,$MPICH_THREAD_LEVEL,[Level of thread support selected at compile time])
+
+if test "$thread_pkg_required" = "no" ; then
+ MPIU_THREAD_DEFAULT=${MPIU_THREAD_DEFAULT:-none}
+fi
+export MPIU_THREAD_DEFAULT
+
+# Check for value thread_cs choice; set the refcount default if necessary
+thread_granularity=MPIU_THREAD_GRANULARITY_SINGLE
+thread_refcount=MPIU_REFCOUNT_NONE
+if test "$enable_threads" = "multiple" ; then
+ case $enable_thread_cs in
+ global)
+ thread_granularity=MPIU_THREAD_GRANULARITY_GLOBAL
+ if test "$enable_refcount" = "default" ; then enable_refcount=none ; fi
+ ;;
+ brief-global|brief_global)
+ AC_MSG_ERROR([--enable-thread-cs=brief-global is no longer supported, please select a different granularity])
+ ;;
+ per-object|per_object)
+ thread_granularity=MPIU_THREAD_GRANULARITY_PER_OBJECT
+ if test "$enable_refcount" = "default" ; then enable_refcount=lock ; fi
+ ;;
+ lock-free|lock_free|lockfree)
+ thread_granularity=MPIU_THREAD_GRANULARITY_LOCK_FREE
+ if test "$enable_refcount" = "default" ; then enable_refcount=lock-free ; fi
+ if test "$enable_predefined_refcount" = "default" ; then enable_predefined_refcount=no ; fi
+ ;;
+ *)
+ AC_MSG_ERROR([Unrecognized value $enable_thread_cs for --enable-thread-cs])
+ ;;
+ esac
+
+ case $enable_refcount in
+ lock)
+ thread_refcount=MPIU_REFCOUNT_LOCK
+ ;;
+ lock-free|lock_free|lockfree)
+ thread_refcount=MPIU_REFCOUNT_LOCKFREE
+ ;;
+ none)
+ thread_refcount=MPIU_REFCOUNT_NONE
+ ;;
+ *)
+ AC_MSG_ERROR([Unrecognized value $enable_refcount for --enable-refcount])
+ ;;
+ esac
+fi
+AC_DEFINE_UNQUOTED([MPIU_THREAD_GRANULARITY],$thread_granularity,[Method used to implement atomic updates and access])
+
+if test "$enable_predefined_refcount" = "no" ; then
+ AC_DEFINE([MPIU_THREAD_SUPPRESS_PREDEFINED_REFCOUNTS],[1],[define to disable reference counting predefined objects like MPI_COMM_WORLD])
+fi
+
+case $enable_handle_allocation in
+ mutex|default)
+ handle_allocation_method=MPIU_HANDLE_ALLOCATION_MUTEX
+ ;;
+ tls)
+ handle_allocation_method=MPIU_HANDLE_ALLOCATION_THREAD_LOCAL
+ ;;
+ *)
+ AC_MSG_ERROR([Unrecognized value $enable_handle_allocation for --enable-handle-allocation])
+ ;;
+esac
+AC_DEFINE_UNQUOTED([MPIU_HANDLE_ALLOCATION_METHOD],$handle_allocation_method,[Method used to allocate MPI object handles])
+
+
+AC_DEFINE_UNQUOTED([MPIU_THREAD_REFCOUNT],$thread_refcount,[Method used to implement refcount updates])
+
+# enable-g
+# strip off multiple options, separated by commas
+save_IFS="$IFS"
+IFS=","
+for option in $enable_g ; do
+ case "$option" in
+ debug|dbg)
+ enable_append_g=yes
+ ;;
+ no|none)
+ ;;
+ handlealloc)
+ perform_handlealloc=yes
+ ;;
+ handle)
+ AC_DEFINE(MPICH_DEBUG_HANDLES,1,[Define to enable handle checking])
+ ;;
+ instr)
+ perform_instr=yes
+ ;;
+ meminit)
+ perform_meminit=yes
+ ;;
+ memarena)
+ perform_memarena=yes
+ perform_memtracing=yes
+ ;;
+ mem)
+ perform_memtracing=yes
+ ;;
+ log)
+ perform_dbglog=yes
+ ;;
+ mutex)
+ perform_dbgmutex=yes
+ ;;
+ mutexnesting)
+ perform_mutexnesting=yes
+ ;;
+ all|yes)
+ perform_memtracing=yes
+ perform_dbglog=yes
+ enable_append_g=yes
+ perform_meminit=yes
+ perform_instr=yes
+ perform_dbgmutex=yes
+ perform_mutexnesting=yes
+ perform_handlealloc=yes
+ ;;
+ *)
+ IFS=$save_IFS
+ AC_MSG_WARN([Unknown value $option for enable-g])
+ IFS=","
+ ;;
+ esac
+done
+IFS="$save_IFS"
+
+if test "$enable_append_g" = "yes" ; then
+ CFLAGS="$CFLAGS -g"
+ CXXFLAGS="$CXXFLAGS -g"
+ FFLAGS="$FFLAGS -g"
+ FCFLAGS="$FCFLAGS -g"
+fi
+if test "$enable_append_ndebug" = "yes" ; then
+ CFLAGS="$CFLAGS -DNDEBUG -DNVALGRIND"
+ CXXFLAGS="$CXXFLAGS -DNDEBUG -DNVALGRIND"
+ # MPICH2 do NOT assume any preprocessing support from the Fortran compiler,
+ # so no Fortran files contain any preprocessing statements.
+ # Don't set FFLAGS or FCFLAGS with any -D.
+fi
+if test -n "$perform_meminit" ; then
+ AC_DEFINE(MPICH_DEBUG_MEMINIT,1,[Define to enable preinitialization of memory used by structures and unions])
+fi
+if test "$perform_handlealloc" = yes ; then
+ AC_DEFINE(MPICH_DEBUG_HANDLEALLOC,1,[Define to enable checking of handles still allocated at MPI_Finalize])
+fi
+if test "$perform_instr" = yes ; then
+ AC_DEFINE(USE_MPIU_INSTR,1,[Define this to enable internal instrumentation] )
+fi
+
+if test -n "$perform_memtracing" ; then
+ enable_g_mem=yes
+ AC_DEFINE(USE_MEMORY_TRACING,1,[Define to enable memory tracing])
+ if test -n "$perform_memarena" ; then
+ AC_DEFINE(MPICH_DEBUG_MEMARENA,1,[Define if each function exit should confirm memory arena correctness])
+ fi
+fi
+if test -n "$perform_mutexnesting" ; then
+ AC_DEFINE(MPICH_DEBUG_MUTEXNESTING,1,[Define to check nesting in mutexes])
+fi
+USE_DBG_LOGGING=0
+if test -n "$perform_dbglog" ; then
+ if test "$with_logging" != "none" ; then
+ AC_MSG_WARN([--with-logging overrides --enable-g=log])
+ else
+ AC_DEFINE(USE_DBG_LOGGING,1,[Define to enable logging macros])
+ USE_DBG_LOGGING=1
+ fi
+fi
+# allow @USE_DBG_LOGGING@ substitution in glue_romio.h
+AC_SUBST([USE_DBG_LOGGING])
+
+if test -n "$perform_dbgmutex" ; then
+ AC_DEFINE(MPICH_DEBUG_MUTEX,1,[Define to enable mutex debugging])
+fi
+
+pac_cross_compiling=no
+if test "$with_cross" != "no" ; then
+ if test -s "$with_cross" ; then
+ AC_MSG_RESULT([Reading values from cross-compilation file $with_cross])
+ . $with_cross
+ # Autoconf 2.52 no longer sets cross_compiling except with the
+ # awkward "targethost" options.
+ pac_cross_compiling=yes
+ cross_compiling=yes
+ ac_cv_prog_cc_cross=yes
+ ac_cv_prog_f77_cross=yes
+ ac_cv_prog_fc_cross=yes
+ ac_cv_prog_cxx_cross=yes
+ export cross_compiling
+ # Export all cross variables. Any subsidiary configure should also
+ # export CROSS_xxx
+ rm -f confcross
+ (set) 2>&1 | grep CROSS_ | \
+ sed -e 's/^/export /g' -e 's/=.*//g' > confcross
+ . confcross
+ rm -f confcross
+ fi
+fi
+
+if test "$enable_nmpi_as_mpi" = yes ; then
+ AC_DEFINE(USE_MPI_FOR_NMPI,1,[Define if the NMPI names should use MPI instead of PMPI])
+fi
+
+# This goes here because we need the top_srcdir
+if test "$enable_romio" = "yes" ; then
+ if test -d $use_top_srcdir/src/mpi/romio ; then
+ subsystems="$subsystems src/mpi/romio"
+ AC_DEFINE(HAVE_ROMIO,1,[Define if ROMIO is enabled])
+
+ # make it possible to "#include" mpio.h at build time
+ #
+ # This ought to be sufficient, but there is also a symlink setup in
+ # src/include to accomodate current mpicc and MPE2 limitations. See
+ # src/mpi/Makefile.mk for more info.
+ PAC_APPEND_FLAG([-I${master_top_builddir}/src/mpi/romio/include],[CPPFLAGS])
+
+ # Set environment variables that the romio configure expects
+ romio_dir=romio
+ AC_SUBST(romio_dir)
+ export use_top_srcdir
+ top_build_dir=`pwd`
+ export top_build_dir
+ # if there is no $top_build_dir/lib, romio puts lib in wrong place
+ # This test used -e under Linux, but not all test programs understand
+ # -e
+ if test ! -d lib ; then mkdir lib ; fi
+ # tell mpi.h to include mpio.h
+ PAC_HAVE_ROMIO
+ else
+ AC_MSG_WARN([ROMIO src directory is not available])
+ fi
+fi
+
+AM_CONDITIONAL([BUILD_ROMIO], [test x$enable_romio = xyes])
+
+#
+# FIXME: If an external device, don't necessarily complain (e.g.,
+# if the device is already built)
+if test ! -d $devicedir ; then
+ AC_MSG_ERROR([Device $device_name is unknown])
+elif test -f $devicedir/subconfigure.m4 ; then
+ # this is a new-style subconfigure device, don't add it as a subsystem
+ :
+elif test ! -x $devicedir/configure ; then
+ if test -s $devicedir/configure ; then
+ AC_MSG_WARN([The configure in $devicedir exists but is not executable])
+ else
+ AC_MSG_WARN([Device $device_name has no configure])
+ fi
+ device_name=""
+else
+ # Add the device to the configure list
+ devsubsystems="$devsubsystems $devicereldir"
+ # Make device_name available to subdirs
+fi
+#
+# Allow the device to request that the install step invoke the install
+# target in the device's Makefile.
+if test -n "$device_name" -a "$INSTALL_FROM_DEVICE" = yes ; then
+ other_install_dirs="${other_install_dirs} $devicereldir"
+fi
+AC_SUBST(device_name)
+#
+# with-pm
+if test "$with_pm" = "none" ; then
+ # add "none" as synonym for "no" to agree with older erroneous docs
+ with_pm="no"
+fi
+if test "$MPID_NO_PM" = yes ; then
+ if test "$with_pm" != "default" -a "$with_pm" != no ; then
+ AC_MSG_ERROR([The PM chosen ($with_pm) is is not valid for the selected device ($with_device)])
+ fi
+ # This is used to change with_pm=default to with_pm=no in the case
+ # where the device does not want a PM
+ with_pm=no
+fi
+if test -z "$with_pm" ; then
+ with_pm="no"
+fi
+if test "$with_pmi" = "uni" -a "$with_pm" = "default" ; then
+ with_pm="no"
+fi
+if test "$with_pm" = "default" -o "$with_pm" = "yes" ; then
+ with_pm=hydra
+fi
+
+# We allow multiple pm names, separated by : or ,
+# If multiple PMs are provided, we set the value MANY_PM to yes
+MANY_PM=no
+AC_SUBST(MANY_PM)
+if test "$with_pm" != "no" ; then
+ pm_names="`echo $with_pm | sed -e 's/:/ /g' -e 's/,/ /g'`"
+else
+ pm_names=""
+fi
+#
+hasError=no
+# We need to be careful about PM's that have either conflicting
+# requirements (e.g., different PMI implementations) or different
+# optional features (e.g., MPID_PM_NAMESERVER).
+# In addition, we need to interleave the setup of the PMI and PM
+# modules. The order is as follows:
+#
+# For each PM, execute the mpich2prereq script for that pm (if present).
+# This script provides information about the PM, including which PMI
+# implementations are supported.
+#
+# Then, for the selected PMI, the setup script (if any) is run. This is
+# necessary because the setup of the PM may require information discovered
+# or provided duing the PMI setup step (e.g., smpd requires this)
+#
+# Finally, for each PM, the setup script is executed.
+#
+# Step 1: invoke the mpich2prereq for each PM
+for pm_name in $pm_names ; do
+ if test -z "$first_pm_name" ; then
+ first_pm_name=$pm_name
+ export first_pm_name
+ else
+ # Only add to other_pm_names if the directory exists,
+ # since the Makefile in src/pm/Makefile will try to cd to
+ # that directory
+ if test -d $use_top_srcdir/src/pm/$pm_name ; then
+ other_pm_names="$other_pm_names $pm_name"
+ fi
+ fi
+ if test ! -d $use_top_srcdir/src/pm/$pm_name ; then
+ AC_MSG_WARN([$use_top_srcdir/src/pm/$pm_name does not exist. PM is unknown])
+ hasError=yes
+ elif test ! -x $use_top_srcdir/src/pm/$pm_name/configure -a \
+ ! -f $use_top_srcdir/src/pm/$pm_name/subconfigure.m4 ; then
+ if test -s $use_top_srcdir/src/pm/$pm_name/configure ; then
+ AC_MSG_WARN([The configure in $use_top_srcdir/src/pm/$pm_name exists but is not executable])
+ else
+ AC_MSG_WARN([pm $pm_name has no configure or subconfigure.m4])
+ fi
+ pm_name=""
+ hasError=yes
+ else
+ nameserver=$MPID_PM_NAMESERVER
+ if test -f $use_top_srcdir/src/pm/$pm_name/mpich2prereq ; then
+ echo sourcing $use_top_srcdir/src/pm/$pm_name/mpich2prereq
+ . $use_top_srcdir/src/pm/$pm_name/mpich2prereq
+ fi
+ # Check for a change; if found, we'll take the default
+ if test "$MPID_PM_NAMESERVER" != "$nameserver" ; then
+ if test "$first_pm_name" != "$pm_name" ; then
+ # Reject suggestion (use the default, common mode)
+ MPID_PM_NAMESERVER=""
+ fi
+ fi
+ fi
+done
+if test "$hasError" != no ; then
+ AC_MSG_ERROR([Aborting configure because an error was seen in the selection of process managers])
+fi
+#
+# pm_name is the *primary* pm
+pm_name=$first_pm_name
+AC_SUBST(pm_name)
+AC_SUBST(other_pm_names)
+
+# Some versions of PM and PMI require a special definition (currently, only
+# smpd requires this)
+if test "$PMI_REQUIRES_READABLE_TOKENS" = "yes" ; then
+ AC_DEFINE(USE_HUMAN_READABLE_TOKENS,1,[Define to use ='s and spaces in the string utilities.])
+fi
+
+if test -n "$first_pm_name" ; then
+ other_install_dirs="${other_install_dirs} src/pm/$first_pm_name"
+fi
+# Step 2:
+# Once we've selected the process manager (or managers), we can
+# check that we have a compatible PMI implemenatation.
+# with-pmi
+if test "$MPID_NO_PMI" = yes ; then
+ if test "$with_pmi" != "default" -a "$with_pmi" != no ; then
+ AC_MSG_ERROR([The PMI chosen ($with_pmi) is is not valid for the selected device ($with_device)])
+ fi
+ # This is used to change with_pmi=default to with_pmi=no in the case
+ # where the device does not want a PMI
+ with_pmi=no
+elif test "$with_pmi" != "no" ; then
+ if test "$with_pmi" = "default" -o "$with_pmi" = "yes" ; then
+ if test -n "$PM_REQUIRES_PMI" ; then
+ with_pmi=$PM_REQUIRES_PMI
+ else
+ with_pmi=simple
+ fi
+ elif test -n "$PM_REQUIRES_PMI" ; then
+ # Test for compatibility between pm and pmi choices
+ if test "$PM_REQUIRES_PMI" != "$with_pmi" ; then
+ AC_MSG_ERROR([The PM chosen ($with_pm) requires the PMI implementation $PM_REQUIRES_PMI but $with_pmi was selected as the PMI implementation.])
+ fi
+ fi
+ pmi_name=$with_pmi
+
+ if test ! -d $use_top_srcdir/src/pmi/$pmi_name ; then
+ AC_MSG_WARN([$use_top_srcdir/src/pmi/$pmi_name does not exist. PMI is unknown])
+ elif test ! -x $use_top_srcdir/src/pmi/$pmi_name/configure ; then
+ if test ! -f $use_top_srcdir/src/pmi/$pmi_name/subconfigure.m4 ; then
+ AC_MSG_WARN([pmi $pmi_name has no configure or subconfigure.m4])
+ pmi_name=""
+ fi
+ else
+ # only add to subsystems if a full configure is present
+ subsystems="$subsystems src/pmi/$pmi_name"
+ fi
+else
+ AC_MSG_ERROR([A PMI implementation must be selected or the default used.])
+fi
+AC_SUBST(pmi_name)
+
+# Step 3: complete pm setup.
+# Note that checks for errors have already been performed, so this
+# loop does not need to perform any extra error checks.
+# Note that this uses this_pm_name because pm_name must be the *first*
+# of the PM names
+for this_pm_name in $pm_names ; do
+ # only add the PM to the subsystems if it has a full configure to be
+ # executed
+ if test -f $use_top_srcdir/src/pm/$this_pm_name/configure ; then
+ subsystems="$subsystems src/pm/$this_pm_name"
+ fi
+ if test -f $use_top_srcdir/src/pm/$this_pm_name/setup_pm ; then
+ echo sourcing $use_top_srcdir/src/pm/$this_pm_name/setup_pm
+ . $use_top_srcdir/src/pm/$this_pm_name/setup_pm
+ fi
+done
+
+# ----------------------------------------------------------------------------
+if test $with_mpe != no ; then
+ if test ! -d $use_top_srcdir/src/mpe2 ; then
+ if test $with_mpe = yes ; then
+ # No warning message on the default
+ AC_MSG_WARN([No MPE directory available])
+ fi
+ elif test ! -x $use_top_srcdir/src/mpe2/configure ; then
+ if test $with_mpe = yes ; then
+ # No warning message on the default
+ AC_MSG_WARN([No configure available for MPE])
+ fi
+ else
+ subsystems="$subsystems src/mpe2"
+ other_install_dirs="$other_install_dirs src/mpe2"
+ mpe_dir=mpe2
+
+ # for AM_CONDITIONAL
+ build_src_mpe2=yes
+
+ # Temporarily replace the default NONE value for exec_prefix
+ # and prefix with the actual, default values.
+ savePrefix=$prefix
+ saveExecprefix=$exec_prefix
+ test "x$prefix" = xNONE && prefix=$ac_default_prefix
+ test "x$exec_prefix" = xNONE && exec_prefix=$prefix
+ eval actualbindir=$bindir
+ # MPI_CC and MPIF77 must use the local (build) bin dir, not
+ # the installation bin dir
+ #MPI_CC=$actualbindir/mpicc
+ #MPI_F77=$actualbindir/mpif77
+ #eval actuallibdir=$libdir
+ #MPI_LIBS="-L$actuallibdir -lmpich -lpmpich"
+ buildbindir=`pwd`/bin
+ #MPI_CC=$buildbindir/mpicc
+ #MPI_F77=$buildbindir/mpif77
+ prefix=$savePrefix
+ exec_prefix=$saveExecprefix
+ # NOTE: You must append LIBS to MPI_LIBS before invoking the mpe
+ # configure
+ #export MPI_CC
+ #export MPI_F77
+ #export MPI_LIBS
+ export use_top_srcdir
+ top_build_dir=`pwd`
+ export top_build_dir
+ fi
+fi
+AC_SUBST(mpe_dir)
+AC_SUBST(other_install_dirs)
+AM_CONDITIONAL([BUILD_SRC_MPE2],[test "X$build_src_mpe2" = "Xyes"])
+
+# Check for whether the compiler defines a symbol that contains the
+# function name. The MPICH2 code, for greater portability, defines
+# its own symbols, FCNAME (a string) and FUNCNAME (a token that is not a
+# string). Code should use these symbols where possible. However,
+# some debugging macros may want to use a compiler-provided symbol
+# for the function name, and this check makes it possible to
+# define such macros in a way that is always correct.
+PAC_CC_FUNCTION_NAME_SYMBOL
+
+# Check if $MPI_DEFAULT_COPTS is valid with $CC
+if test "$enable_default_optimize" = "yes" \
+ -a -n "$MPI_DEFAULT_COPTS" ; then
+ if test "$enable_check_compiler_flags" = "yes" ; then
+ PAC_C_CHECK_COMPILER_OPTION( [$MPI_DEFAULT_COPTS], [
+ CFLAGS="$CFLAGS $MPI_DEFAULT_COPTS"
+ ] )
+ else
+ CFLAGS="$CFLAGS $MPI_DEFAULT_COPTS"
+ fi
+fi
+
+# Check for support for weak symbols. If not found, set NO_WEAK_SYM
+# to the Make target name understood by simplemake.
+# Set NEEDSPLIB to yes if link commands need both -l$MPILIBNAME
+# and -lp$MPILIBNAME.
+NEEDSPLIB=yes
+NO_WEAK_SYM_TARGET=build_proflib
+if test $enable_weak_symbols = yes ; then
+ # Turn off weak symbols if they aren't available
+ PAC_PROG_C_WEAK_SYMBOLS(,enable_weak_symbols=no)
+fi
+if test $enable_weak_symbols = "yes" ; then
+ AC_DEFINE(USE_WEAK_SYMBOLS,1,[Define if weak symbols should be used])
+ NEEDSPLIB=no
+ # Check for the ability to support multiple weak symbols
+ if test "$pac_cv_prog_c_weak_symbols" = "pragma weak" ; then
+ PAC_PROG_C_MULTIPLE_WEAK_SYMBOLS(AC_DEFINE(HAVE_MULTIPLE_PRAGMA_WEAK,1,[Define if multiple weak symbols may be defined]))
+ fi
+else
+ NO_WEAK_SYM=build_proflib
+ PROFILE_DEF_MPI="-DMPICH_MPI_FROM_PMPI"
+fi
+export NEEDSPLIB
+export NO_WEAK_SYM
+export NO_WEAK_SYM_TARGET
+export PROFILE_DEF_MPI
+AC_SUBST(NEEDSPLIB)
+AC_SUBST(NO_WEAK_SYM)
+AC_SUBST(NO_WEAK_SYM_TARGET)
+AC_SUBST(PROFILE_DEF_MPI)
+
+AM_CONDITIONAL([BUILD_PROFILING_LIB],[test "$NEEDSPLIB" = "yes"])
+
+# ---------------------------------------------------------------------------
+# determine rpath and other shared library flags for CC
+# src/env may not exist yet in a vpath build
+$MKDIR_P src/env
+cc_shlib_conf=src/env/cc_shlib.conf
+PAC_COMPILER_SHLIB_FLAGS([CC],[$cc_shlib_conf])
+AC_SUBST_FILE([cc_shlib_conf])
+
+# ---------------------------------------------------------------------------
+# Support for the language bindings: Fortran 77, Fortran 90, and C++
+#
+# First, we handle the case of no explicit enable/disable option. In that
+# case, we look for a usable compiler. We cannot use the ac macros for this
+# because they abort the configure step if they fail to find a compiler
+# (earlier versions of autoconf did not have this behavior!).
+#
+# Second, we perform the langugage-specific tests, if necessary. This may
+# be relatively simple (C++) or complex (Fortran 77, including formation of
+# the encoded MPI handles).
+#
+# Note that the bindings support needs to know some of the properties of
+# the C compiler, so those tests (particularly for weak symbols)
+# must come first.
+# ----------------------------------------------------------------------------
+
+#
+# First, determine whether we are/can support the language bindings
+#
+# Since F90/F90FLAGS are replaced by FC/FCFLAGS, rather than silently
+# substituting them, i.e. FC=$F90 and FCFLAGS=$F90FLAGS, we choose to emit
+# an error message and abort to avoid any ambiguous/hidden bug in choosing
+# Fortran90 compilers.
+if test -n "$F90" -o -n "$F90FLAGS" ; then
+ AC_MSG_ERROR([F90 and F90FLAGS are replaced by FC and FCFLAGS respectively in this configure, please unset F90/F90FLAGS and set FC/FCFLAGS instead and rerun configure again.])
+fi
+# ----------------------------------------------------------------------------
+# Handle default choices for the Fortran compilers
+if test "$enable_f77" = "yes" ; then
+ # Check for a Fortran compiler
+ # FIXME already done earlier
+ dnl PAC_PROG_F77
+ :
+fi
+
+if test "$enable_f77" = "yes" -a "$F77" = "" ; then
+ # No Fortran 77 compiler found; abort
+ AC_MSG_ERROR([No Fortran 77 compiler found. If you don't need to
+ build any Fortran programs, you can disable Fortran support using
+ --disable-f77 and --disable-fc. If you do want to build Fortran
+ programs, you need to install a Fortran compiler such as gfortran
+ or ifort before you can proceed.])
+fi
+
+if test "$enable_f77" = yes ; then
+ # Check if $MPI_DEFAULT_FOPTS is valid with $F77
+ if test "$enable_default_optimize" = "yes" \
+ -a -n "$MPI_DEFAULT_FOPTS" ; then
+ if test "$enable_check_compiler_flags" = "yes" ; then
+ PAC_F77_CHECK_COMPILER_OPTION( [$MPI_DEFAULT_FOPTS], [
+ FFLAGS="$FFLAGS $MPI_DEFAULT_FOPTS"
+ ] )
+ else
+ FFLAGS="$FFLAGS $MPI_DEFAULT_FOPTS"
+ fi
+ fi
+fi
+
+#
+# We need to know the name mangling for Fortran before testing for FC
+# compatibility (we need this because of the way we decide to generate
+# the Fortran 77 bindings)
+if test "$enable_f77" = yes ; then
+ FLIBS_save="$FLIBS"
+ FLIBS=""
+ AC_F77_LIBRARY_LDFLAGS
+ # The autoconf macro for finding FLIBS sometimes makes mistakes
+ # (particularly with the Fujitsu frt compiler). This next step
+ # first sees if the FLIBS is valid with the Fortran compiler
+ PAC_PROG_F77_FLIBS_VALID
+ # Now see if FLIBS works with the C compiler
+ PAC_PROG_F77_CHECK_FLIBS
+
+ # Check F77+FLAGS is compatible with CC+CFLAGS before using F77+CC.
+ PAC_PROG_F77_OBJ_LINKS_WITH_C
+
+ PAC_PROG_F77_LINKER_WITH_C
+ # For name mangle, we need the library flags
+ PAC_PROG_F77_NAME_MANGLE
+ # Check whether additional libraries are needed when linking with C
+ PAC_PROG_F77_AND_C_STDIO_LIBS
+ AC_SUBST(F77_OTHER_LIBS)
+
+ # Warn about mixed name mangling, since many of the tests will fail
+ if test "$pac_cv_prog_f77_name_mangle" = "mixed" ; then
+ AC_MSG_WARN([The compiler $F77 uses mixed case names. Fortran is monocase
+and many Fortran programs may use either upper or lower case names for MPI
+calls. Consider specifying a particular parameter to your Fortran compiler
+to select either upper or lower case names. For the Absoft compiler,
+-f selects lower case and -N109 selects upper case (if you use -f, also use
+-B108 to enable the iargc and getarg routines, which are needed for some
+tests and by many user programs). Specify new command
+line options by setting the environment variable FFLAGS to include
+the options (e.g., setenv FFLAGS "-f -B108"). In addition, make sure that your
+Fortran 90 compiler uses a compatible naming choice. For the
+Absoft Fortran 90, -YALL_NAMES=LCS selects lower case names and -B108
+adds underscores to names, as required for iargc and getarg. Pass this
+information to configure with the FCFLAGS environment variable.])
+ # If Fortran implicitly enabled, disable it now. Otherwise,
+ # abort the configure since warning messages are often lost in
+ # the output.
+ AC_MSG_ERROR([Aborting configure because of mixed case names in Fortran. Either select --disable-f77 or set FFLAGS to force the compiler to select monocase names])
+ fi
+
+ # The MPI standard requires that MPI_Init in any language initialize
+ # MPI in all languages. This can be a problem when objects produced
+ # by the Fortran compiler require symbols from the Fortran runtime
+ # (making linking C-only programs unnecessarily difficult). What we test
+ # here is whether the much more restricted needs of the Fortran
+ # initialize can be met with no special use of the Fortran runtime
+ PAC_F77_INIT_WORKS_WITH_C
+ if test "$pac_f_init_works_with_c" = "yes" ; then
+ AC_DEFINE(HAVE_MPI_F_INIT_WORKS_WITH_C,1,[Define if the Fortran init code for MPI works from C programs without special libraries])
+ fi
+
+fi
+
+# FC requires F77 as well. If the user disabled f77, do not run the
+# next test; instead, drop into the warning message
+# Set a default value for fc works with f77. This value is
+# set to no *only* if fc was selected but was not compatible with f77
+fc_with_f77=yes
+if test "$enable_fc" = "yes" -a "$enable_f77" = yes ; then
+ enable_fc=no
+ if test -n "$FC" ; then
+ # If we allow multiple weak symbols, we should test a name
+ # that does not contain an underscore. The Fortran binding uses
+ # this rule for enabling multiple weak symbols:
+ # if defined(USE_WEAK_SYMBOLS) && !defined(USE_ONLY_MPI_NAMES) &&
+ # defined(HAVE_MULTIPLE_PRAGMA_WEAK) &&
+ # defined(F77_NAME_LOWER_2USCORE)
+ #
+ testRoutine="t1_2"
+ if test "$pac_cv_prog_c_multiple_weak_symbols" = "yes" -a \
+ "$enable_weak_symbols" = "yes" -a \
+ "$pac_cv_prog_f77_name_mangle" = "lower doubleunderscore" ; then
+ testRoutine="t12"
+ fi
+ PAC_FC_AND_F77_COMPATIBLE(fc_with_f77=yes,fc_with_f77=no,$testRoutine)
+ if test "$fc_with_f77" != yes ; then
+ enable_fc=no
+ AC_MSG_ERROR([The selected Fortran 90 compiler $FC does not work with the selected Fortran 77 compiler $F77. Use the environment variables FC and F77 respectively to select compatible Fortran compilers. The check here tests to see if a main program compiled with the Fortran 90 compiler can link with a subroutine compiled with the Fortran 77 compiler.])
+ elif test "$fc_with_f77" = "yes" ; then
+ # If we got here, there is a Fortran 90 compiler that we can use
+ enable_fc=yes
+ fi
+ elif test "$pac_cv_prog_fc_works" = no; then
+ AC_MSG_WARN([Use --disable-fc to keep configure from searching for a Fortran 90 compiler])
+ fi
+
+ if test "$enable_fc" = "yes" -a "$FC" = "" ; then
+ # No Fortran 90 compiler found; abort
+ AC_MSG_ERROR([No Fortran 90 compiler found. If you don't need
+ to build any Fortran 90 programs, you can disable Fortran 90
+ support using --disable-fc. If you do want to build Fortran 90
+ programs, you need to install a Fortran 90 compiler such as
+ gfortran or ifort before you can proceed.])
+ fi
+fi
+
+if test "$enable_fc" = "yes" -a "$enable_f77" != "yes" ; then
+ # Fortran 90 support requires compatible Fortran 77 support
+ AC_MSG_ERROR([
+Fortran 90 support requires compatible Fortran 77 support.
+To force the use of the Fortran 90 compiler for Fortran 77,
+do not use configure option --disable-f77, and set the environment
+variable F77 to the name of the Fortran 90 compiler, or \$FC.
+If you do not want any Fortran support, use configure options
+--disable-f77 and --disable-fc.])
+ # We should probably do the compatibility test as well
+ enable_f77=yes
+fi
+
+# ----------------------------------------------------------------------------
+# Now test for Fortran compiler characteristics
+# ----------------------------------------------------------------------------
+if test "$enable_f77" = "yes" ; then
+ # determine rpath and other shared library flags for F77
+ f77_shlib_conf=src/env/f77_shlib.conf
+ PAC_COMPILER_SHLIB_FLAGS([F77],[$f77_shlib_conf])
+ AC_SUBST_FILE([f77_shlib_conf])
+
+ AC_LANG_FORTRAN77
+ PAC_PROG_F77_EXCLAIM_COMMENTS(has_exclaim="yes",has_exclaim="no")
+ PAC_PROG_F77_HAS_INCDIR(src)
+ if test -n "$F77_INCDIR" ; then
+ # For building the Fortran files, add the directory where we are building
+ # the object to the include list. This is needed for g77, which makes
+ # includes relative to the source directory of the file, not the
+ # directory that the command is executed in
+ FINCLUDES="$F77_INCDIR`pwd`/src"
+ fi
+ AC_SUBST(FINCLUDES)
+ #
+ PAC_PROG_F77_LIBRARY_DIR_FLAG
+
+ AC_SUBST(MPIFPMPI)
+ if test "$MPI_WITH_PMPI" = "no" ; then
+ # If the PMPI routines are not in the same library with the MPI
+ # routines, we may need to remove the pmpi declarations
+ PAC_PROG_F77_ALLOWS_UNUSED_EXTERNALS([MPIFPMPI=",PMPI_WTIME,PMPI_WTICK"],[
+ MPIFPMPI="";
+ AC_MSG_WARN([Removed PMPI_WTIME and PMPI_WTICK from mpif.h])])
+ else
+ MPIFPMPI=",PMPI_WTIME,PMPI_WTICK"
+ fi
+
+ # Once we have name mangle, we can try to limit the number of needed libs
+ dnl F77_IN_C_LIBS is not needed currently because mpirinitf_() in setbotf.f
+ dnl is called in initthread.c only when FLIBS is not needed to initialize
+ dnl Fortran constants from a C main, See PAC_F77_INIT_WORKS_WITH_C.
+ dnl PAC_PROG_F77_IN_C_LIBS
+ dnl AC_SUBST(F77_IN_C_LIBS)
+
+ # Most systems allow the Fortran compiler to process .F and .F90 files
+ # using the C preprocessor. However, some systems either do not
+ # allow this or have serious bugs (OSF Fortran compilers have a bug
+ # that generates an error message from cpp). The following test
+ # checks to see if .F works, and if not, whether "cpp -P -C" can be used
+ # This is needed for Mac OSX 10.5
+ PAC_F77_WORKS_WITH_CPP([F77CPP])
+ AC_SUBST(F77CPP)
+
+ bindings="$bindings f77"
+ bindings_dirs="$bindings_dirs src/binding/f77"
+ AC_DEFINE(HAVE_FORTRAN_BINDING,1,[Define if Fortran is supported])
+ # Also define the name FORTRAN_BINDING for use in #if @FORTRAN_BINDING at ..
+ FORTRAN_BINDING=1
+
+fi
+
+dnl By modifying mpif.h to use ! for comments, it can work with many f90
+dnl compilers without creating a separate version.
+dnl Note that this is run AFTER the AC_OUTPUT actions
+AC_OUTPUT_COMMANDS([if test "$enable_f77" = yes ; then
+if test "$has_exclaim" = "yes" ; then
+ sed -e 's/^C/\!/g' src/binding/f77/mpif.h > src/include/mpif.h
+ cp src/include/mpif.h src/binding/f77/mpif.h
+else
+ cp src/binding/f77/mpif.h src/include
+fi
+if test "$has_fort_real8" = "yes" ; then
+ sed -e 's/DOUBLE PRECISION/REAL*8/g' src/include/mpif.h > src/include/mpif.h.new
+ mv src/include/mpif.h.new src/include/mpif.h
+ cp src/include/mpif.h src/binding/f77/mpif.h
+fi
+fi],
+master_top_srcdir=$master_top_srcdir
+enable_f77=$enable_f77
+enable_fc=$enable_fc
+has_exclaim=$has_exclaim
+has_fort_real8=$pac_cv_fort_real8
+includebuild_dir=$includebuild_dir
+libbuild_dir=$libbuild_dir
+bashWorks=$bashWorks)
+
+if test "$enable_fc" = "yes" ; then
+ if test "$enable_f77" != "yes" ; then
+ AC_MSG_WARN([Fortran 90 requires Fortran 77])
+ enable_fc=no
+ else
+ bindingsubsystems="$bindingsubsystems src/binding/f90"
+ bindings="$bindings f90"
+ bindings_dirs="$bindings_dirs src/binding/f90"
+ fi
+fi
+
+# Set defaults for these values so that the Makefile in src/bindings/f90
+# is valid even if fc is not enabled (this is necessary for the
+# distclean target)
+MPIMODNAME=mpi
+MPICONSTMODNAME=mpi_constants
+MPISIZEOFMODNAME=mpi_sizeofs
+MPIBASEMODNAME=mpi_base
+if test "$enable_fc" = "yes" ; then
+ # determine rpath and other shared library flags for FC
+ fc_shlib_conf=src/env/fc_shlib.conf
+ PAC_COMPILER_SHLIB_FLAGS([FC],[$fc_shlib_conf])
+ AC_SUBST_FILE([fc_shlib_conf])
+
+ # Determine characteristics of the Fortran 90 compiler
+ # Find a Fortran 90 compiler. Sets FC
+ # Work around bug in autoconf that adds -g to FCFLAGS
+ saveFCFLAGS="$FCFLAGS"
+ dnl FIXME XXX DJG this needs to be reconciled with our separate use of
+ dnl AC_PROG_FC earlier
+ dnl PAC_PROG_FC
+ PAC_PROG_FC_WORKS
+ FCFLAGS=$saveFCFLAGS
+ if test "$pac_cv_prog_fc_works" = no ; then
+ # Reject this compiler
+ if test -n "$FC" ; then
+ fc_rejected=yes
+ oldFC="$FC"
+ FC=""
+ fi
+ fi
+
+ # Determine the extension for Fortran 90 files (it isn't always .f90)
+ FCEXT=$ac_fc_srcext
+ AC_SUBST(FCEXT)
+
+ if test -z "$FC" ; then
+ if test "$fc_rejected" = "yes" ; then
+ AC_MSG_ERROR([Could not find a usable Fortran 90 compiler. The compiler $oldFC may be incompatible with the Fortran 77 compiler $F77; check the output of configure and consult the installation manuals])
+ else
+ AC_MSG_ERROR([Could not find a usable Fortran 90 compiler.])
+ fi
+ fi
+
+ # Find the extension that this compiler uses for modules.
+ # Sets FCMODEXT (and adds it to the list substed)
+ # Sets FCMODINCFLAG (and adds it to the list substed)
+ PAC_FC_MODULE
+ AC_SUBST(FCMODINCSPEC)
+ if test "$pac_cv_fc_module_case" = "upper" ; then
+ MPIMODNAME=MPI
+ MPICONSTMODNAME=MPI_CONSTANTS
+ MPISIZEOFMODNAME=MPI_SIZEOFS
+ MPIBASEMODNAME=MPI_BASE
+ else
+ MPIMODNAME=mpi
+ MPICONSTMODNAME=mpi_constants
+ MPISIZEOFMODNAME=mpi_sizeofs
+ MPIBASEMODNAME=mpi_base
+ fi
+ AC_SUBST(MPIMODNAME)
+ AC_SUBST(MPICONSTMODNAME)
+ AC_SUBST(MPISIZEOFMODNAME)
+ AC_SUBST(MPIBASEMODNAME)
+ if test -z "$modincdir" ; then
+ # The default module include dir is the same as the include dir
+ modincdir=$includedir
+ fi
+ AC_SUBST(modincdir)
+ #
+ # Assume that all Fortran 90 compilers accept -I for include directories
+ FCINC=-I
+ AC_SUBST(FCINC)
+ FCINCFLAG=-I
+ AC_SUBST(FCINCFLAG)
+
+ # Check if $MPI_DEFAULT_FCOPTS is valid with $F90
+ if test "$enable_default_optimize" = "yes" \
+ -a -n "$MPI_DEFAULT_FCOPTS" ; then
+ if test "$enable_check_compiler_flags" = "yes" ; then
+ PAC_FC_CHECK_COMPILER_OPTION( [$MPI_DEFAULT_FCOPTS], [
+ FCFLAGS="$FCFLAGS $MPI_DEFAULT_FCOPTS"
+ ] )
+ else
+ FCFLAGS="$FCFLAGS $MPI_DEFAULT_FCOPTS"
+ fi
+ fi
+
+ # Most systems allow the Fortran compiler to process .F and .F90 files
+ # using the C preprocessor. However, some systems either do not
+ # allow this or have serious bugs (OSF Fortran compilers have a bug
+ # that generates an error message from cpp). The following test
+ # checks to see if .F works, and if not, whether "cpp -P -C" can be used
+ PAC_FC_WORKS_WITH_CPP([FCCPP])
+ AC_SUBST(FCCPP)
+
+ # Check whether additional libraries are needed when linking with C
+ PAC_PROG_FC_AND_C_STDIO_LIBS
+ AC_SUBST(FC_OTHER_LIBS)
+ # ------------------------------------------------
+fi
+
+# ----------------------------------------------------------------------------
+# We previously allowed "default" as a valid value for $enable_cxx. Now we
+# assume its available by default and error out if it doesn't work (just like
+# F77 & FC). The user must pass "--disable-cxx" in order to successfully
+# complete configure in this case.
+if test "$enable_cxx" = "default" ; then
+ AC_MSG_ERROR([aborting because "--enable-cxx=default" is no longer a supported value])
+fi
+
+if test "$enable_cxx" = "yes" ; then
+ # Another bug in autoconf. The checks for the C++ compiler do not
+ # ensure that you can link a program that is built with the C++
+ # compiler. We've seen this error with gcc and icc, particularly
+ # when those compilers accept C++ language elements but are unable
+ # to link programs that are really C++. For that reason,
+ # we've added a test to see if the C++ compiler can produce
+ # an executable.
+ AC_CACHE_CHECK([whether the C++ compiler $CXX can build an executable],
+ pac_cv_cxx_builds_exe,[
+ AC_LANG_PUSH([C++])
+ AC_TRY_LINK([
+class mytest {
+ int a;
+public:
+ mytest(void) : a(1) {}
+ ~mytest(void) {}
+};],[mytest a;],
+ pac_cv_cxx_builds_exe=yes, pac_cv_cxx_builds_exe=no)
+ AC_LANG_POP([C++])
+])
+ if test "$pac_cv_cxx_builds_exe" != yes ; then
+ AC_MSG_ERROR([Aborting because C++ compiler does not work. If you do not need a C++ compiler, configure with --disable-cxx])
+ fi
+ # Recent failures have come when a standard header is loaded
+ # The Intel icpc 10.x compiler fails with <string> if gcc 4.2 is installed.
+ AC_CACHE_CHECK([whether C++ compiler works with string],pac_cv_cxx_compiles_string,[
+ AC_LANG_PUSH([C++])
+ AC_TRY_COMPILE([#include <string>],[return 0;],pac_cv_cxx_compiles_string=yes,pac_cv_cxx_compiles_string=no)
+ AC_LANG_POP([C++])
+])
+ if test "$pac_cv_cxx_compiles_string" != yes ; then
+ AC_MSG_WARN([The C++ compiler $CXX cannot compile a program containing the <string> header - this may indicate a problem with the C++ installation. Consider configuing with --disable-cxx])
+ fi
+
+ AC_LANG_CPLUSPLUS
+ AX_CXX_EXCEPTIONS
+ AX_CXX_BOOL
+ AX_CXX_NAMESPACES
+ if test "$ac_cv_cxx_namespaces" != "yes" ; then
+ AC_MSG_ERROR([Namespaces are required for the MPI C++ interface])
+ fi
+ HAVE_CXX_EXCEPTIONS=0
+ AC_SUBST(HAVE_CXX_EXCEPTIONS)
+ if test "$ac_cv_cxx_exceptions" = "yes" ; then
+ HAVE_CXX_EXCEPTIONS=1
+ fi
+ # iostream and math are needed for examples/cxx/cxxpi.cxx
+ AC_CACHE_CHECK([whether <iostream> available],pac_cv_cxx_has_iostream,[
+ AC_TRY_COMPILE([
+#include <iostream>
+],[using namespace std;],pac_cv_cxx_has_iostream=yes,pac_cv_cxx_has_iostream=no)])
+ if test "$pac_cv_cxx_has_iostream" = yes ; then
+ CXX_DEFS="$CXX_DEFS -DHAVE_CXX_IOSTREAM"
+ fi
+ AX_CXX_NAMESPACE_STD
+ if test "$ac_cv_cxx_namespace_std" = "yes" ; then
+ CXX_DEFS="$CXX_DEFS -DHAVE_NAMESPACE_STD"
+ fi
+
+ AC_CACHE_CHECK([whether <math> available],pac_cv_cxx_has_math,[
+ AC_TRY_COMPILE([
+#include <math>
+],[using namespace std;],pac_cv_cxx_has_math=yes,pac_cv_cxx_has_math=no)])
+ if test "$pac_cv_cxx_has_math" = yes ; then
+ CXX_DEFS="$CXX_DEFS -DHAVE_CXX_MATH"
+ fi
+ AC_SUBST(CXX_DEFS)
+
+ # GNU changed the calling conventions between minor releases (!!!)
+ # This is too hard to detect, but we should be able to detect
+ # the version mismatch. By default, we set the GNU version to 0.
+ # In a cross-compiling environment, these can be set with environment
+ # variables, either directly or through the standard "CROSS" variable.
+ if test -z "$GNUCXX_VERSION" ; then
+ if test -n "$CROSS_GNUCXX_VERSION" ; then
+ GNUCXX_VERSION=$CROSS_GNUCXX_VERSION
+ else
+ GNUCXX_VERSION=0
+ fi
+ fi
+ if test -z "$GNUCXX_MINORVERSION" ; then
+ if test -n "$CROSS_GNUCXX_MINORVERSION" ; then
+ GNUCXX_MINORVERSION=$CROSS_GNUCXX_MINORVERSION
+ else
+ GNUCXX_MINORVERSION=0
+ fi
+ fi
+ if test "$cross_compiling" = "no" -a "$ac_compiler_gnu" = "yes" -a \
+ "$GNUCXX_VERSION" = 0 -a "$GNUCXX_MINORVERSION" = 0 ; then
+ ac_vals=""
+ AC_MSG_CHECKING([for GNU g++ version])
+ AC_TRY_RUN([#include <stdio.h>
+int main() {
+ int v = -1, m = -1;
+ FILE *fp = fopen("conftest.out","w");
+#ifdef __GNUC_MINOR__
+ m = __GNUC_MINOR__;
+#endif
+#ifdef __GNUC__
+ v = __GNUC__;
+#endif
+ fprintf( fp, "v=%d, m=%d\n", v, m );
+ fclose( fp );
+ return 0;
+}],ac_vals=`cat conftest.out`)
+ if test -n "$ac_vals" ; then
+ v=`echo "$ac_vals" | sed -e 's/v=\(.*\),.*/\1/'`
+ m=`echo "$ac_vals" | sed -e 's/.*m=\(.*\)/\1/'`
+ AC_MSG_RESULT([$v . $m])
+ GNUCXX_VERSION=$v
+ GNUCXX_MINORVERSION=$m
+ else
+ AC_MSG_RESULT([unknown])
+ fi
+ fi
+ AC_SUBST(GNUCXX_VERSION)
+ AC_SUBST(GNUCXX_MINORVERSION)
+
+ bindings="$bindings cxx"
+ bindings_dirs="$bindings_dirs src/binding/cxx"
+ AC_DEFINE(HAVE_CXX_BINDING,1,[Define if C++ is supported])
+ INCLUDE_MPICXX_H='#include "mpicxx.h"'
+ AC_SUBST(INCLUDE_MPICXX_H)
+
+ # In order to support the Fortran datatypes within C++,
+ #
+ # FORTRAN_BINDING always has a CPP-time value of either 0 or 1,
+ # so that it may be used in #if statements without adding to
+ # the CPP name space
+ AC_SUBST(FORTRAN_BINDING)
+
+ # Special C++ datatypes. Set to DATATYPE NULL first; we'll
+ # replace the ones that we have later, after we have determined
+ # the C datatypes
+ MPIR_CXX_BOOL=0x0c000000
+ MPIR_CXX_COMPLEX=0x0c000000
+ MPIR_CXX_DOUBLE_COMPLEX=0x0c000000
+ MPIR_CXX_LONG_DOUBLE_COMPLEX=0x0c000000
+ AC_SUBST(MPIR_CXX_BOOL)
+ AC_SUBST(MPIR_CXX_COMPLEX)
+ AC_SUBST(MPIR_CXX_DOUBLE_COMPLEX)
+ AC_SUBST(MPIR_CXX_LONG_DOUBLE_COMPLEX)
+
+ # determine rpath and other shared library flags for CXX
+ cxx_shlib_conf=src/env/cxx_shlib.conf
+ PAC_COMPILER_SHLIB_FLAGS([CXX],[$cxx_shlib_conf])
+ AC_SUBST_FILE([cxx_shlib_conf])
+fi
+
+if test "$enable_cxx" = yes; then
+ # Check if $MPI_DEFAULT_CXXOPTS is valid with $CXX
+ if test "$enable_default_optimize" = "yes" \
+ -a -n "$MPI_DEFAULT_CXXOPTS" ; then
+ if test "$enable_check_compiler_flags" = "yes" ; then
+ PAC_CXX_CHECK_COMPILER_OPTION( [$MPI_DEFAULT_CXXOPTS], [
+ CXXFLAGS="$CXXFLAGS $MPI_DEFAULT_CXXOPTS"
+ ] )
+ else
+ CXXFLAGS="$CXXFLAGS $MPI_DEFAULT_CXXOPTS"
+ fi
+ fi
+fi
+
+AC_SUBST(bindings)
+# Bindings dirs is used for the installation target
+AC_SUBST(bindings_dirs)
+#
+# ----------------------------------------------------------------------------
+# End of the bindings support
+# ----------------------------------------------------------------------------
+
+AC_LANG_C
+#
+# ----------------------------------------------------------------------------
+# Done with the basic argument processing and decisions about which
+# subsystems to build
+# ----------------------------------------------------------------------------
+
+# Look for perl. Perl is used *only* in the tests of the commands such as
+# mpiexec, mpicc, etc, in test/commands, and in some of the utility
+# programs for processing log files . If perl is not found,
+# MPICH2 may still be built and used.
+# We need the full path to perl since we'll use it as the interpreter for
+# a shell script.
+AC_PATH_PROG(PERL,perl)
+# Look for ar. If we fail, abort
+AC_CHECK_PROGS(AR,ar)
+if test -z "$AR" ; then
+ AC_MSG_ERROR([The program ar is required for building MPICH2. Make sure that your path includes ar])
+fi
+
+# FIXME: this is probably unnecessary now that we only do one "ar" at the end
+# (via libtool). If anything, it's likely to cause problems instead.
+# AR_FLAGS provides a way to potentially improve build performance on Mac OSX
+AR_FLAGS=cr
+# this logic is lame, should really write a real test at some point
+AS_CASE([$host],
+ # Barry proposes AR_FLAGS="Scq" in trac#754, but that won't work correctly for re-builds
+ [*-*-darwin*], [AR_FLAGS=Scr]
+)
+AC_ARG_VAR(AR_FLAGS,[AR command flags]) # causes AC_SUBST too
+
+# Note that we set RANLIB to true if we don't find it (some systems neither
+# need it nor provide it)
+AC_CHECK_PROGS(RANLIB,ranlib,true)
+
+# Check for the killall program; this can be used in some of the tests
+# in test/commands
+AC_CHECK_PROGS(KILLALL,killall,true)
+
+# Does xargs need the -r option to handle the case where the input
+# is empty (gnu utils do, Mac OSX does not accept -r)
+xargs_out=`echo "" | xargs ls | wc -l | sed -e 's/ //g'`
+if test "$xargs_out" != "0" ; then
+ XARGS_NODATA_OPT=-r
+fi
+AC_SUBST(XARGS_NODATA_OPT)
+
+AC_PROG_INSTALL
+PAC_PROG_CHECK_INSTALL_WORKS
+#
+# On Mac OS/X, install breaks libraries unless used with the -p switch
+dnl FIXME not necessary now that we are using libtool
+dnl PAC_PROG_INSTALL_BREAKS_LIBS
+# We also need mkdir -p.
+PAC_PROG_MKDIR_P
+PAC_PROG_MAKE
+
+#
+# Check for bash to allow more robust shell scripts
+AC_PATH_PROG(BASH_SHELL,bash)
+#
+# Confirm that bash has working arrays. We can use this to
+# build more robust versions of the scripts (particularly the
+# compliation scripts) by taking advantage of the array features in
+# bash.
+bashWorks=no
+if test -x "$BASH_SHELL" ; then
+changequote(%%,::)dnl
+ cat >>conftest <<EOF
+#! $BASH_SHELL
+A[0]="b"
+A[1]="c"
+rc=1
+if test \${A[1]} != "c" ; then rc=2 ; else rc=0 ; fi
+exit \$rc
+EOF
+changequote([,])dnl
+ AC_MSG_CHECKING([whether $BASH_SHELL supports arrays])
+ chmod +x conftest
+ if ./conftest 2>&1 >/dev/null ; then
+ bashWorks=yes
+ else
+ bashWorks=no
+ fi
+ rm -f conftest*
+ AC_MSG_RESULT($bashWorks)
+fi
+dnl BUILD_BASH_SCRIPTS used to be an AC_SUBST
+AM_CONDITIONAL([BUILD_BASH_SCRIPTS], [test "x$bashWorks" = xyes])
+
+# ----------------------------------------------------------------------------
+# Check for the routines and libraries needed for accessing dynamically
+# loaded libraries.
+# This is very approximate for now; it is enough to allow use to experiment
+# with this feature under Linux.
+# ----------------------------------------------------------------------------
+BUILD_DLLS=no
+if test "$enable_dynamiclibs" = "yes" ; then
+ AC_CHECK_HEADERS(dlfcn.h)
+ AC_SEARCH_LIBS(dlopen,dl)
+ AC_CHECK_FUNCS(dlopen dlsym)
+ if test "$ac_cv_func_dlopen" = yes -a \
+ "$ac_cv_func_dlsym" = yes -a \
+ "$ac_cv_header_dlfcn_h" = yes ; then
+ AC_DEFINE(USE_DYNAMIC_LIBRARIES,1,[Define if dynamic libraries are available and should be used])
+ if test "$enable_sharedlibs" = no -o "$enable_sharedlibs" = none -o \
+ -z "$enable_sharedlibs" ; then
+ AC_MSG_ERROR([You must specify --enable-sharedlibs=type when building with dynamic libraries])
+dnl # We still need to determine how to build shared libraries
+dnl AC_MSG_CHECKING([for how to build shared library for dynamically loaded libraries])
+dnl PAC_CC_SHAREDLIBS(,CC_SHL,C_LINK_SHL)
+dnl PAC_CC_SHLIB_EXT
+dnl if test "$SHLIB_EXT" = "unknown" ; then
+dnl # Guess that the extension is .so
+dnl SHLIB_EXT=so
+dnl fi
+dnl if test "$CC_SHL" = true ; then
+dnl AC_MSG_RESULT([none found])
+dnl AC_MSG_WARN([Dynamic library support requires shared libraries])
+dnl else
+dnl AC_MSG_RESULT($CC_SHL)
+dnl BUILD_DLLS=yes
+dnl fi
+ fi
+ fi
+ AC_SUBST(BUILD_DLLS)
+
+ # Let the DLL code know where we plan to install the libraries.
+ # This will make it easier for the user, who may not need
+ # to set a search path for the library.
+ savePrefix=$prefix
+ saveExecprefix=$exec_prefix
+ test "x$prefix" = xNONE && prefix=$ac_default_prefix
+ test "x$exec_prefix" = xNONE && exec_prefix=$prefix
+ eval MPICH2_LIBDIR=$libdir
+ prefix=$savePrefix
+ exec_prefix=$saveExecprefix
+ MPICH2_LIBDIR='"'$MPICH2_LIBDIR'"'
+ AC_DEFINE_UNQUOTED(MPICH2_LIBDIR,$MPICH2_LIBDIR,[Name of installation directory intended for MPICH2])
+fi
+
+# ----------------------------------------------------------------------------
+# At this point, we've finally settled on the value of PMPILIBNAME. We
+# can now set NEEDSPLIB.
+if test "$NEEDSPLIB" = yes -a "$PMPILIBNAME" = "$MPILIBNAME" ; then
+ NEEDSPLIB=no
+fi
+# Set the defaults for the Fortran libraries to be the same as the C libraries
+if test -z "$MPIFLIBNAME" ; then
+ MPIFLIBNAME=$MPILIBNAME
+fi
+if test -z "$PMPIFLIBNAME" ; then
+ PMPIFLIBNAME=$PMPILIBNAME
+fi
+
+# ----------------------------------------------------------------------------
+#
+# Add the steps for debugger support
+BUILD_TVDLL=no
+if test "$enable_debuginfo" = "yes" ; then
+ # We can build the Totalview interface DLL only if we know how to build
+ # shared libraries.
+
+ # FIXME is this really the right test?
+ # No. Before MPICH2 1.5, there was the capability to build the debugger
+ # libraries without forcing the build of shared libraries for everything.
+ # There may be some way to restore this capability, but until then, we
+ # at least cause the configure to cleanly fail with a clear error message
+ if test "X$enable_shared" = "Xyes" ; then
+ BUILD_TVDLL=yes
+ else
+ AC_MSG_ERROR([Building with --enable-debuginfo now requires building with shared library support. Add --enable-shared and reconfigure])
+ fi
+
+ # One more nasty problem. Totalview relies on debugger symbols
+ # being present in the executable. Some experimental versions of
+ # gcc (3.2 20020329 for ia64) do *not* include the object symbols
+ # when debugging. For HPUX, the necessary linking options are
+ # +noobjdebug
+ # for C, Fortran, and C++. We don't have a good test for this yet,
+ # so we add a warning
+ if test "$ac_cv_prog_gcc" = "yes" ; then
+ AC_MSG_WARN([Some versions of gcc do not include debugging information
+within the executable. Totalview requires this information to detect
+an MPICH code. If you have trouble, try linking with the additional
+option
+ +noobjdebug
+on all link lines (consider adding it to LDFLAGS)])
+ fi
+ AC_SUBST(BUILD_TVDLL)
+
+ # The debugger library name cannot be set until we know the extension
+ # of shared libraries - the name is so on most Unix system, dylib on OS X.
+ debugger_dir=debugger
+ AC_DEFINE(HAVE_DEBUGGER_SUPPORT,1,[Define if debugger support is included])
+ # The debugger support requires a shared library. This is handled
+ # below, after we check for compiler support for shared libraries
+ # Note: if libdir contains exec_prefix, handle the fact that the
+ # default exec_prefix is NONE, which (much later in configure)
+ # gets turned into the value of prefix
+ ##ENVVAR: MPICH_DEBUGLIBNAME - Set this environment variable to
+ ## override the default name of the debugger support library.
+ ## The default name is libtvmpich2.$SHLIB_EXT (e.g., libtvmpich2.so for
+ ## most Unix versions, libtvmpich2.dylib for Mac OSX).
+ ##ENVVAR END:
+
+ # We are cheating a bit here and reaching inside of the libtool macros to
+ # extract the correct shared library extension. It would be nice if this
+ # were publicly available in at least the same way that $libext is.
+ eval SHLIB_EXT='"'$shrext_cmds'"'
+
+ if test -z "$MPICH_DEBUGLIBNAME" ; then
+ DEBUGLIBNAME=libtvmpich2.$SHLIB_EXT
+ else
+ # FIXME DJG I don't think this can be supported arbitrarily by the new
+ # build system (I'm not sure it was supported correctly by the old
+ # system either)
+ AC_MSG_WARN([overriding MPICH_DEBUGLIBNAME is currently untested and probably does not work])
+ DEBUGLIBNAME=$MPICH_DEBUGLIBNAME
+ fi
+ if test "x$exec_prefix" = xNONE ; then
+ saveExecPrefix=$exec_prefix
+ exec_prefix=$prefix
+ eval dlldir=$libdir/$DEBUGLIBNAME
+ exec_prefix=$saveExecPrefix
+ else
+ eval dlldir=$libdir/$DEBUGLIBNAME
+ fi
+ dlldir='"'$dlldir'"'
+ AC_DEFINE_UNQUOTED(MPICH_INFODLL_LOC,$dlldir,[Define as the name of the debugger support library])
+fi
+AC_SUBST(debugger_dir)
+
+# used by automakefiles to conditionally build the DLL
+AM_CONDITIONAL([BUILD_DEBUGGER_DLL], [test x$BUILD_TVDLL = xyes])
+
+# ----------------------------------------------------------------------------
+
+nameserv_name=""
+AC_SUBST(nameserv_name)
+#
+# Get the default nameserver, if no nameserver was selected. A process
+# manager may advertise a nameserver name by setting the variable
+# MPID_PM_NAMESERVER.
+if test "$with_namepublisher" = "default" ; then
+ if test -n "$MPID_PM_NAMESERVER" ; then
+ with_namepublisher=$MPID_PM_NAMESERVER
+ else
+ # The default is to use a file to communicate published names
+ with_namepublisher=file
+ fi
+fi
+
+if test "$with_namepublisher" != no -a "$with_namepublisher" != "none" ; then
+ case "$with_namepublisher" in
+ none|no) ;;
+ # Removed ldap namepublisher hook - we no longer support or distribute
+ # the ldap-based name server
+ file*)
+ # Note that we always build the Makefile for the file version because
+ # this name publisher is really too simple to require a
+ # separate configure, and we might as well include a basic
+ # name publisher with any MPICH2 distribution
+ # We DO need to extract the directory name that is used for writing
+ # the files, with the User's home directory as the default
+ nameserv_name="file"
+ basedir=`echo $with_namepublisher | sed -e 's/file://'`
+ if test "$basedir" = "$with_namepublisher" ; then
+ # Reset since no directory was set.
+ basedir='"."';
+ fi
+ AC_DEFINE_UNQUOTED(FILE_NAMEPUB_BASEDIR,$basedir,[Directory to use in namepub])
+ AC_DEFINE(USE_FILE_FOR_NAMEPUB,1,[Define if file should be used for name publisher])
+ ;;
+
+ mpd)
+ nameserv_name="mpd"
+ # The mpd nameserver is specific to the mpd process manager
+ foundMPD=no
+ for pm_name in $pm_names ; do
+ if test "$pm_name" = "mpd" ; then
+ foundMPD=yes
+ break
+ fi
+ done
+ if test "$foundMPD" = no ; then
+ AC_MSG_ERROR([The mpd nameserver requires the mpd process manager])
+ fi
+ ;;
+
+ *)
+ # Check for a new namepublisher
+ dir=$with_namepublisher
+ # If we later need args, here is where we can strip them off of the
+ # with argument
+ if test -d "$use_top_srcdir/src/nameserv/$dir" ; then
+ if test -x "$use_top_srcdir/src/nameserv/$dir/configure" ; then
+ # Run the configure in this directory if necessary
+ subsystems="$subsystems src/nameserv/$dir"
+ fi
+ nameserv_name=$dir
+ else
+ AC_MSG_WARN([Unknown name publisher $with_namepublisher])
+ fi
+ ;;
+ esac
+fi
+if test -n "$nameserv_name" ; then
+ AC_DEFINE(HAVE_NAMEPUB_SERVICE,1,[Define if a name publishing service is available])
+fi
+AM_CONDITIONAL([BUILD_NAMEPUB_FILE],[test "X$nameserv_name" = "Xfile"])
+AM_CONDITIONAL([BUILD_NAMEPUB_MPD],[test "X$nameserv_name" = "Xmpd"])
+AM_CONDITIONAL([BUILD_NAMEPUB_PMI],[test "X$nameserv_name" = "Xpmi"])
+
+# In case the documentation targets are used, find doctext and attempt to
+# find the source for the doctext LaTeX style files. Use "false" if
+# doctext is not found
+AC_PATH_PROG(DOCTEXT,doctext,false)
+if test -n "$DOCTEXT" -a "$DOCTEXT" != "false" ; then
+ if test -z "$DOCTEXTSYTLE" ; then
+ AC_MSG_CHECKING([for location of doctext style files])
+ dpath=`$DOCTEXT -debug_paths 2>&1 | grep 'default path' | \
+ sed -e 's%.*default path\(.*\),%\1:%g'`
+ saveIFS="$IFS"
+ IFS=": "
+ for dir in $dpath ; do
+ if test -s $dir/refman.sty ; then
+ DOCTEXTSTYLE=$dir
+ break
+ fi
+ done
+ IFS="$saveIFS"
+ if test -n "$DOCTEXTSTYLE" ; then
+ AC_MSG_RESULT($DOCTEXTSTYLE)
+ else
+ AC_MSG_RESULT([unavailable])
+ fi
+ fi
+fi
+export DOCTEXT
+export DOCTEXTSTYLE
+AC_SUBST(DOCTEXT)
+AC_SUBST(DOCTEXTSTYLE)
+
+# ----------------------------------------------------------------------------
+# Check for C compiler characteristics
+AC_C_CONST
+AC_C_VOLATILE
+AC_C_RESTRICT
+AC_C_INLINE
+
+PAC_C_GNU_ATTRIBUTE
+# We need to check for the endianess in order to implement the
+# "external32" representations. This defines "WORDS_BIGENDIAN when
+# the system is bigendian.
+# As of autoconf 2.62, this macro takes an additional argument for systems
+# that can produce object files for either endianess.
+# With the as-always-incompatible-with-every-version autoconf, the
+# arguments for this macro *changed* in 2.62 to
+# (if-bigendian,if-littleendian,unknown,universal)
+# The fourth argument is new.
+# Also note that the definition emitted by autoheader requires that gcc
+# be used to compile the programs - other compilers may not define the
+# non-standard __BIG_ENDIAN__ or __LITTLE_ENDIAN__ CPP names on which
+# autoconf 2.62 now depends.
+byteOrdering=unknown
+AC_C_BIGENDIAN(byteOrdering=big,byteOrdering=little,,byteOrdering=universal)
+case $byteOrdering in
+ big)
+ # Nothing to do - the c_bigendian macro takes care of it
+ :
+ ;;
+ little)
+ AC_DEFINE(WORDS_LITTLEENDIAN,1,[Define if words are little endian])
+ ;;
+ universal)
+ AC_DEFINE(WORDS_UNIVERSAL_ENDIAN,1,[Define if configure will not tell us, for universal binaries])
+ ;;
+ unknown)
+ AC_MSG_ERROR([Unable to determine endianess])
+ ;;
+esac
+
+# We only need this test if we are using Fortran
+if test "$enable_f77" ; then
+ PAC_PROG_C_UNALIGNED_DOUBLES(,
+[AC_MSG_WARN(Your C compiler $CC does not support unaligned accesses
+to doubles. This is required for interoperation with
+Fortran (the Fortran standard requires it).
+You may need to specify an additional argument to your C compiler to
+force it to allow unaligned accesses.)])
+fi
+# Check for __func__ (defined in C99) or __FUNCTION__ (defined in older GCC)
+AC_CACHE_CHECK([whether $CC supports __func__],pac_cv_cc_has___func__,
+[AC_TRY_COMPILE([],
+ [const char *cp = __func__; ],pac_cv_cc_has___func__=yes,
+pac_cv_cc_has___func__=no)])
+if test "$pac_cv_cc_has___func__" != "yes" ; then
+ AC_CACHE_CHECK([whether $CC supports __FUNCTION__],pac_cv_cc_has___FUNCTION__,
+[AC_TRY_COMPILE([],
+ [const char *cp = __FUNCTION__;],pac_cv_cc_has___FUNCTION__=yes,
+pac_cv_cc_has___FUNCTION__=no)])
+fi
+
+# ----------------------------------------------------------------------------
+# Attempt to support dependency handling
+# ----------------------------------------------------------------------------
+# Set a default for MAKE_DEPEND_C
+MAKE_DEPEND_C=true
+AC_SUBST(MAKE_DEPEND_C)
+AC_ARG_ENABLE(dependencies,
+ AC_HELP_STRING([--enable-dependencies],
+ [Generate dependencies for sourcefiles. This requires
+ that the Makefile.in files are also created to support
+ dependencies (see maint/updatefiles)]),,enable_dependencies=default)
+
+if test -z "$enable_dependencies" ; then
+ enable_dependencies=default
+fi
+if test "$enable_dependencies" = "default" ; then
+ # Try to use gcc if available
+ enable_dependencies=no
+ if test "$ac_cv_prog_gcc" != "yes" ; then
+ # See if gcc is available
+ AC_CHECK_PROGS(GCC,gcc)
+ if test -n "$GCC" ; then
+ enable_dependencies=gcc
+ else
+ # Try for another form, based on the stock compiler on the
+ # given system
+ ostype=`uname -s`
+ case "$ostype" in
+ SunOS)
+ enable_dependencies=solaris
+ ;;
+ *)
+ # Unrecognized; ignore
+ ;;
+ esac
+ fi
+ else
+ enable_dependencies=gcc
+ fi
+ # We use this to indicate that we use gcc for dependencies,
+ # even if a different compiler (e.g., pgcc) is selected for
+ # compiling the code. This will normally be adequate, even
+ # if gcc points to different system header files, we're really
+ # only interested in dependencies on the MPICH2 source files.
+ if test "$enable_dependencies" = "gcc" ; then
+ AC_MSG_RESULT([Using gcc to determine dependencies])
+ fi
+fi
+if test "$enable_dependencies" != "no" ; then
+ case "$enable_dependencies" in
+ gcc|yes)
+ # Ensure that the profiling libraries get their targets into
+ # the files. Use -MMD if you want the file in the build directory
+ # instead of a subdirectory
+ MAKE_DEPEND_C="gcc -MM"
+ ;;
+ solaris)
+ # At least some Solaris SunPro compilers accept -xM1 -MT name, though
+ # they ignore the -MT name argument.
+ MAKE_DEPEND_C="cc -xM1"
+ ;;
+ *)
+ AC_MSG_RESULT([Using $enable_dependencies for MAKE_DEPEND_C])
+ MAKE_DEPEND_C="$enable_dependencies"
+ ;;
+ esac
+fi
+export MAKE_DEPEND_C
+# ----------------------------------------------------------------------------
+# Check on support for long double and long long types. Do this before the
+# structure alignment test because it will test for including those
+# types as well. In addition, allow the device to suppress support for these
+# optional C types by setting MPID_NO_LONG_DOUBLE and/or MPID_NO_LONG_LONG
+# to yes.
+if test "$MPID_NO_LONG_DOUBLE" != "yes" ; then
+ AC_CACHE_CHECK([whether long double is supported],
+ pac_cv_have_long_double,[
+ AC_TRY_COMPILE(,[long double a;],
+ pac_cv_have_long_double=yes,pac_cv_have_long_double=no)])
+ if test "$pac_cv_have_long_double" = "yes" ; then
+ AC_DEFINE(HAVE_LONG_DOUBLE,1,[Define if long double is supported])
+ fi
+fi
+if test "$MPID_NO_LONG_LONG" != "yes" ; then
+ AC_CACHE_CHECK([whether long long is supported],
+ pac_cv_have_long_long,[
+ AC_TRY_COMPILE(,[long long a;],
+ pac_cv_have_long_long=yes,pac_cv_have_long_long=no)])
+ if test "$pac_cv_have_long_long" = "yes" ; then
+ AC_DEFINE(HAVE_LONG_LONG_INT,1,[Define if long long is supported])
+ fi
+fi
+# ----------------------------------------------------------------------------
+# Get default structure alignment for integers
+dnl PAC_C_MAX_INTEGER_ALIGN places the default alignment into
+dnl pac_cv_c_max_integer_align, with possible values including
+dnl packed (byte), largest, two, four, eight (or other failure message).
+PAC_C_MAX_INTEGER_ALIGN
+
+if test "$pac_cv_c_max_integer_align" = "packed" ; then
+ pac_cv_c_struct_align_nr=1
+elif test "$pac_cv_c_max_integer_align" = "two" ; then
+ pac_cv_c_struct_align_nr=2
+elif test "$pac_cv_c_max_integer_align" = "four" ; then
+ pac_cv_c_struct_align_nr=4
+elif test "$pac_cv_c_max_integer_align" = "eight" ; then
+ pac_cv_c_struct_align_nr=8
+fi
+
+if test -n "$pac_cv_c_struct_align_nr" ; then
+ AC_DEFINE_UNQUOTED(HAVE_MAX_INTEGER_ALIGNMENT,$pac_cv_c_struct_align_nr,[Controls byte alignment of integer structures (for MPI structs)])
+ AC_DEFINE_UNQUOTED(HAVE_MAX_STRUCT_ALIGNMENT,$pac_cv_c_struct_align_nr,[Controls byte alignment of structures (for aligning allocated structures)])
+fi
+# Get default structure alignment for floating point types
+dnl PAC_C_MAX_FP_ALIGN places the default alignment into
+dnl pac_cv_c_max_fp_align, with possible values including
+dnl packed (byte), largest, two, four, eight (or other failure message).
+PAC_C_MAX_FP_ALIGN
+
+if test "$pac_cv_c_max_fp_align" = "packed" ; then
+ pac_cv_c_fp_align_nr=1
+elif test "$pac_cv_c_max_fp_align" = "two" ; then
+ pac_cv_c_fp_align_nr=2
+elif test "$pac_cv_c_max_fp_align" = "four" ; then
+ pac_cv_c_fp_align_nr=4
+elif test "$pac_cv_c_max_fp_align" = "eight" ; then
+ pac_cv_c_fp_align_nr=8
+elif test "$pac_cv_c_max_fp_align" = "sixteen" ; then
+ pac_cv_c_fp_align_nr=16
+elif test "$pac_cv_c_max_fp_align" = "largest" ; then
+ AC_MSG_ERROR([Configure detected unsupported structure alignment rules.])
+fi
+
+if test -n "$pac_cv_c_fp_align_nr" ; then
+ AC_DEFINE_UNQUOTED(HAVE_MAX_FP_ALIGNMENT,$pac_cv_c_fp_align_nr,[Controls byte alignment of structures with floats, doubles, and long doubles (for MPI structs)])
+fi
+
+# Test for the alignment of structs containing only long doubles.
+if test "$pac_cv_have_long_double" = yes ; then
+ # Check for alignment of just float and double (no long doubles)
+ PAC_C_MAX_DOUBLE_FP_ALIGN
+ PAC_C_MAX_LONGDOUBLE_FP_ALIGN
+ # FIXME: If this alignment is not the same as that for all float types,
+ # we need to do something else in the alignment rule code.
+ if test "$pac_cv_c_max_fp_align" != "$pac_cv_c_max_longdouble_fp_align" -o \
+ "$pac_cv_c_max_fp_align" != "$pac_cv_c_max_double_fp_align" ; then
+ AC_MSG_WARN([Structures containing long doubles may be aligned differently from structures with floats or longs. MPICH2 does not handle this case automatically and you should avoid assumed extents for structures containing float types.])
+
+ double_align=-1
+ case $pac_cv_c_max_double_fp_align in
+ packed) double_align=1 ;;
+ two) double_align=2 ;;
+ four) double_align=4 ;;
+ eight) double_align=8 ;;
+ esac
+ longdouble_align=-1
+ case $pac_cv_c_max_longdouble_fp_align in
+ packed) longdouble_align=1 ;;
+ two) longdouble_align=2 ;;
+ four) longdouble_align=4 ;;
+ eight) longdouble_align=8 ;;
+ sixteen)longdouble_align=16 ;;
+ esac
+
+ AC_DEFINE_UNQUOTED(HAVE_MAX_DOUBLE_FP_ALIGNMENT,$double_align,[Controls byte alignment of structs with doubles])
+ AC_DEFINE_UNQUOTED(HAVE_MAX_LONG_DOUBLE_FP_ALIGNMENT,$longdouble_align,[Controls byte alignment of structs with long doubles])
+ fi
+fi
+
+# Test for weird struct alignment rules that vary padding based on
+# size of leading type only.
+PAC_C_DOUBLE_POS_ALIGN
+if test "$pac_cv_c_double_pos_align" = "yes" ; then
+ AC_DEFINE_UNQUOTED(HAVE_DOUBLE_POS_ALIGNMENT,1,[Controls how alignment is applied based on position of doubles in the structure])
+fi
+
+# Test for same weird issues with long long int.
+PAC_C_LLINT_POS_ALIGN
+if test "$pac_cv_c_llint_pos_align" = "yes" ; then
+ AC_DEFINE_UNQUOTED(HAVE_LLINT_POS_ALIGNMENT,1,[Controls how alignment is applied based on position of long long ints in the structure])
+fi
+
+# Test for double alignment not following all our other carefully constructed rules
+PAC_C_DOUBLE_ALIGNMENT_EXCEPTION
+if test "$pac_cv_c_double_alignment_exception" = "four" ; then
+ AC_DEFINE_UNQUOTED(HAVE_DOUBLE_ALIGNMENT_EXCEPTION,4,[Controls how alignment of doubles is performed, separate from other FP values])
+fi
+
+# Test whether pointers can be aligned on a int boundary or require
+# a pointer boundary.
+AC_MSG_CHECKING([for alignment restrictions on pointers])
+AC_TRY_RUN(
+changequote(<<,>>)
+struct foo { int a; void *b; };
+int main() {
+ int buf[10];
+ struct foo *p1;
+ p1=(struct foo*)&buf[0];
+ p1->b = (void *)0;
+ p1=(struct foo*)&buf[1];
+ p1->b = (void *)0;
+ return 0;
+changequote([,])
+},pac_cv_pointers_have_int_alignment=yes,pac_cv_pointers_have_int_alignment=no,pac_cv_pointers_have_int_alignment=unknown)
+
+if test "$pac_cv_pointers_have_int_alignment" != "yes" ; then
+ AC_DEFINE(NEEDS_POINTER_ALIGNMENT_ADJUST,1,[define if pointers must be aligned on pointer boundaries])
+ AC_MSG_RESULT([pointer])
+else
+ AC_MSG_RESULT([int or better])
+fi
+
+# There are further alignment checks after we test for int64_t etc. below.
+
+# Get the size of the C types for encoding in the basic datatypes and for
+# the specific-sized integers
+AC_CHECK_SIZEOF(char)
+AC_CHECK_SIZEOF(unsigned char)
+AC_CHECK_SIZEOF(short)
+AC_CHECK_SIZEOF(unsigned short)
+AC_CHECK_SIZEOF(int)
+AC_CHECK_SIZEOF(unsigned int)
+AC_CHECK_SIZEOF(long)
+AC_CHECK_SIZEOF(unsigned long)
+AC_CHECK_SIZEOF(long long)
+AC_CHECK_SIZEOF(unsigned long long)
+AC_CHECK_SIZEOF(float)
+AC_CHECK_SIZEOF(double)
+AC_CHECK_SIZEOF(long double)
+AC_CHECK_SIZEOF(void *)
+
+AC_HEADER_STDC
+AC_CHECK_HEADERS([stddef.h])
+AC_CHECK_SIZEOF(wchar_t, 0, [
+#ifdef HAVE_STDDEF_H
+#include <stddef.h>
+#endif
+])
+
+AC_CHECK_SIZEOF(float_int, 0, [typedef struct { float a; int b; } float_int; ])
+AC_CHECK_SIZEOF(double_int, 0, [typedef struct { double a; int b; } double_int; ])
+AC_CHECK_SIZEOF(long_int, 0, [typedef struct { long a; int b; } long_int; ])
+AC_CHECK_SIZEOF(short_int, 0, [typedef struct { short a; int b; } short_int; ])
+AC_CHECK_SIZEOF(two_int, 0, [typedef struct { int a; int b; } two_int; ])
+AC_CHECK_SIZEOF(long_double_int, 0, [typedef struct { long double a; int b;} long_double_int; ])
+
+# sys/bitypes.h defines the int16_t etc. on some systems (e.g., OSF1).
+# Include it when testing for these types
+AC_CHECK_HEADER(sys/bitypes.h,[use_bitypes="#include <sys/bitypes.h>"
+AC_DEFINE(HAVE_SYS_BITYPES_H,1,[Define if sys/bitypes.h exists])])
+# A C99 compliant compiler should have inttypes.h for fixed-size int types
+AC_CHECK_HEADERS(inttypes.h stdint.h)
+
+# Check for types
+AC_TYPE_INT8_T
+AC_TYPE_INT16_T
+AC_TYPE_INT32_T
+AC_TYPE_INT64_T
+
+# Temporary issue in autoconf integer type checking (remove when
+# autoconf fixes this or provides a workaround for it)
+if test "$ac_cv_c_int8_t" != no ; then
+ AC_DEFINE(HAVE_INT8_T,1,[Define if int8_t is supported by the C compiler])
+fi
+if test "$ac_cv_c_int16_t" != no ; then
+ AC_DEFINE(HAVE_INT16_T,1,[Define if int16_t is supported by the C compiler])
+fi
+if test "$ac_cv_c_int32_t" != no ; then
+ AC_DEFINE(HAVE_INT32_T,1,[Define if int32_t is supported by the C compiler])
+fi
+if test "$ac_cv_c_int64_t" != no ; then
+ AC_DEFINE(HAVE_INT64_T,1,[Define if int64_t is supported by the C compiler])
+fi
+
+# The following make these definitions:
+# define _UINT<n>_T 1
+# if uint<n>_t is available. E.g., define _UINT8_T as 1 if uint8_t is available
+# if not available, define uint<n>_t as the related C type, e.g.,
+# define uint8_t unsigned char
+#
+AC_TYPE_UINT8_T
+AC_TYPE_UINT16_T
+AC_TYPE_UINT32_T
+AC_TYPE_UINT64_T
+
+# Temporary issue in autoconf integer type checking (remove when
+# autoconf fixes this or provides a workaround for it)
+if test "$ac_cv_c_uint8_t" != no ; then
+ AC_DEFINE(HAVE_UINT8_T,1,[Define if uint8_t is supported by the C compiler])
+fi
+if test "$ac_cv_c_uint16_t" != no ; then
+ AC_DEFINE(HAVE_UINT16_T,1,[Define if uint16_t is supported by the C compiler])
+fi
+if test "$ac_cv_c_uint32_t" != no ; then
+ AC_DEFINE(HAVE_UINT32_T,1,[Define if uint32_t is supported by the C compiler])
+fi
+if test "$ac_cv_c_uint64_t" != no ; then
+ AC_DEFINE(HAVE_UINT64_T,1,[Define if uint64_t is supported by the C compiler])
+fi
+
+# Other C99 types.
+AC_CHECK_HEADERS([stdbool.h complex.h])
+AC_CHECK_SIZEOF([_Bool],0,[
+#ifdef HAVE_STDBOOL_H
+#include <stdbool.h>
+#endif
+])
+AC_CHECK_SIZEOF([float _Complex],0,[
+#ifdef HAVE_COMPLEX_H
+#include <complex.h>
+#endif
+])
+AC_CHECK_SIZEOF([double _Complex],0,[
+#ifdef HAVE_COMPLEX_H
+#include <complex.h>
+#endif
+])
+AC_CHECK_SIZEOF([long double _Complex],0,[
+#ifdef HAVE_COMPLEX_H
+#include <complex.h>
+#endif
+])
+# we need really could just use the result of AC_CHECK_SIZEOF, but having a
+# HAVE_typename macro is useful for consistency
+AC_CHECK_TYPES([_Bool, float _Complex, double _Complex, long double _Complex])
+
+# Generate a hex version of the size of each type
+for type in short int long long_long float double long_double wchar_t \
+ float_int double_int long_int short_int two_int long_double_int \
+ _Bool float__Complex double__Complex long_double__Complex ; do
+ eval len=\$ac_cv_sizeof_$type
+ if test -z "$len" ; then
+ len=0
+ # Check for sizes from the CHECK_SIZEOF_DERIVED macro
+ eval pclen=\$ac_cv_sizeof_$type
+ if test -n "$pclen" ; then
+ len=$pclen
+ else
+ # check for a non-optional type
+ if test $type != long_long -a \
+ $type != long_double -a \
+ $type != long_double_int -a \
+ $type != _Bool -a \
+ $type != float__Complex -a \
+ $type != double__Complex -a \
+ $type != long_double__Complex ; then
+ AC_MSG_ERROR([Configure was unable to determine the size of $type ; if cross compiling,
+use the environment variables CROSS_SIZEOF_typename, e.g., CROSS_SIZEOF_SHORT,
+or use the --with-cross=file configure option to specify a file containing
+Bourne (sh) shell assignments to CROSS_SIZEOF_typename for all datatype
+types. The program maint/getcross.c can be compiled and run on the target
+system; this program outputs an appropriate file for the --with-cross option])
+ fi
+ fi
+ fi
+ #
+ # Take len and turn it into two hex digits (there are 8 bits available
+ # in the built-in datatype handle for the length; see
+ # src/mpid/common/datatype/mpid_datatype.h)
+ if test "$len" -gt 255 ; then
+ AC_MSG_ERROR([Type sizes greater than 255 bytes are not supported (type $type is $len bytes)])
+ fi
+ tmplen=$len
+ hexlen=""
+ while test $tmplen -gt 0 ; do
+ lowdigit=`expr $tmplen - 16 \* \( $tmplen / 16 \)`
+ case $lowdigit in
+ 10) char=a ;;
+ 11) char=b ;;
+ 12) char=c ;;
+ 13) char=d ;;
+ 14) char=e ;;
+ 15) char=f ;;
+ *) char=$lowdigit ;;
+ esac
+ hexlen="$char$hexlen"
+ tmplen=`expr $tmplen / 16`
+ done
+ if test $len -lt 16 ; then
+ hexlen="0$hexlen"
+ fi
+ if test $len = 0 ; then
+ # This sometimes happens for wchar_t
+ hexlen="00";
+ fi
+ eval len_$type=$hexlen
+done
+# By definition, sizeof char is 1
+MPI_CHAR="0x4c000101"
+MPI_UNSIGNED_CHAR="0x4c000102"
+MPI_SHORT="0x4c00${len_short}03"
+MPI_UNSIGNED_SHORT="0x4c00${len_short}04"
+MPI_INT="0x4c00${len_int}05"
+MPI_UNSIGNED_INT="0x4c00${len_int}06"
+MPI_LONG="0x4c00${len_long}07"
+MPI_UNSIGNED_LONG="0x4c00${len_long}08"
+if test "$len_long_long" != 0 -a "$MPID_NO_LONG_LONG" != yes ; then
+ MPI_LONG_LONG="0x4c00${len_long_long}09"
+else
+ MPI_LONG_LONG=MPI_DATATYPE_NULL;
+fi
+MPI_FLOAT="0x4c00${len_float}0a"
+MPI_DOUBLE="0x4c00${len_double}0b"
+if test "$len_long_double" != 0 -a "$MPID_NO_LONG_DOUBLE" != yes ; then
+ MPI_LONG_DOUBLE="0x4c00${len_long_double}0c"
+else
+ MPI_LONG_DOUBLE=MPI_DATATYPE_NULL
+fi
+# If you change MPI_BYTE, you must change it in src/binding/f77/buildiface
+MPI_BYTE="0x4c00010d"
+MPI_WCHAR="0x4c00${len_wchar_t}0e"
+MPI_PACKED="0x4c00010f"
+MPI_LB="0x4c000010"
+MPI_UB="0x4c000011"
+#
+# These should define the mixed types *only* for contiguous data.
+# For example, MPI_SHORT_INT may have a gap; it will need to be defined
+# as a derived type instead. For IA32, this only affects short_int.
+MPI_2INT="0x4c00${len_two_int}16"
+#
+# For now we aren't being too clever about figuring out which of these
+# are in fact contiguous, so these are all allocated as "real" types.
+#
+# These values correspond to direct types 0..5.
+#
+dnl MPI_FLOAT_INT="0x4c00${len_float_int}12"
+dnl MPI_DOUBLE_INT="0x4c00${len_double_int}13"
+dnl MPI_LONG_INT="0x4c00${len_long_int}14"
+dnl MPI_SHORT_INT="0x4c00${len_short_int}15"
+dnl MPI_LONG_DOUBLE_INT="0x4c00${len_long_double_int}17"
+MPI_FLOAT_INT="0x8c000000"
+MPI_DOUBLE_INT="0x8c000001"
+MPI_LONG_INT="0x8c000002"
+MPI_SHORT_INT="0x8c000003"
+if test "$MPID_NO_LONG_DOUBLE" != yes ; then
+ MPI_LONG_DOUBLE_INT="0x8c000004"
+else
+ MPI_LONG_DOUBLE_INT=MPI_DATATYPE_NULL
+fi
+
+# 2 additional predefined types named in MPI-2
+MPI_SIGNED_CHAR="0x4c000118"
+if test "$len_long_long" != 0 -a "$MPID_NO_LONG_LONG" != yes ; then
+ MPI_UNSIGNED_LONG_LONG="0x4c00${len_long_long}19"
+else
+ MPI_UNSIGNED_LONG_LONG=MPI_DATATYPE_NULL
+fi
+
+AC_SUBST(MPI_CHAR)
+AC_SUBST(MPI_UNSIGNED_CHAR)
+AC_SUBST(MPI_SHORT)
+AC_SUBST(MPI_UNSIGNED_SHORT)
+AC_SUBST(MPI_INT)
+AC_SUBST(MPI_UNSIGNED_INT)
+AC_SUBST(MPI_LONG)
+AC_SUBST(MPI_UNSIGNED_LONG)
+AC_SUBST(MPI_LONG_LONG)
+AC_SUBST(MPI_FLOAT)
+AC_SUBST(MPI_DOUBLE)
+AC_SUBST(MPI_LONG_DOUBLE)
+AC_SUBST(MPI_BYTE)
+AC_SUBST(MPI_WCHAR)
+AC_SUBST(MPI_PACKED)
+AC_SUBST(MPI_LB)
+AC_SUBST(MPI_UB)
+AC_SUBST(MPI_FLOAT_INT)
+AC_SUBST(MPI_DOUBLE_INT)
+AC_SUBST(MPI_LONG_INT)
+AC_SUBST(MPI_SHORT_INT)
+AC_SUBST(MPI_2INT)
+AC_SUBST(MPI_LONG_DOUBLE_INT)
+AC_SUBST(MPI_SIGNED_CHAR)
+AC_SUBST(MPI_UNSIGNED_LONG_LONG)
+#
+# FIXME: Leftover from separate fortran system
+## Export the basic C types so that the Fortran system can use them
+#export MPI_CHAR
+#export MPI_SHORT
+#export MPI_INT
+#export MPI_LONG
+#export MPI_LONG_LONG
+#export MPI_FLOAT
+#export MPI_DOUBLE
+#export MPI_LONG_DOUBLE
+#
+# Size-specific types. Initialize as NULL
+MPI_REAL4=MPI_DATATYPE_NULL
+MPI_REAL8=MPI_DATATYPE_NULL
+MPI_REAL16=MPI_DATATYPE_NULL
+MPI_COMPLEX8=MPI_DATATYPE_NULL
+MPI_COMPLEX16=MPI_DATATYPE_NULL
+MPI_COMPLEX32=MPI_DATATYPE_NULL
+MPI_INTEGER1=MPI_DATATYPE_NULL
+MPI_INTEGER2=MPI_DATATYPE_NULL
+MPI_INTEGER4=MPI_DATATYPE_NULL
+MPI_INTEGER8=MPI_DATATYPE_NULL
+MPI_INTEGER16=MPI_DATATYPE_NULL
+AC_SUBST(MPI_REAL4)
+AC_SUBST(MPI_REAL8)
+AC_SUBST(MPI_REAL16)
+AC_SUBST(MPI_COMPLEX8)
+AC_SUBST(MPI_COMPLEX16)
+AC_SUBST(MPI_COMPLEX32)
+AC_SUBST(MPI_INTEGER1)
+AC_SUBST(MPI_INTEGER2)
+AC_SUBST(MPI_INTEGER4)
+AC_SUBST(MPI_INTEGER8)
+AC_SUBST(MPI_INTEGER16)
+export MPI_REAL4
+export MPI_REAL8
+export MPI_REAL16
+export MPI_COMPLEX8
+export MPI_COMPLEX16
+export MPI_COMPLEX32
+export MPI_INTEGER1
+export MPI_INTEGER2
+export MPI_INTEGER4
+export MPI_INTEGER8
+export MPI_INTEGER16
+#
+# Try to find corresponding types for the size-specific types.
+#
+# Assume that the float/double/long double are simply spaced
+# Datatypes used up through 26 in Fortran
+# 27,28,29,2a,2b,2c
+if test "$ac_cv_sizeof_float" = "4" ; then
+ MPI_REAL4="0x4c000427"
+ MPI_COMPLEX8="0x4c000828"
+ MPIR_REAL4_CTYPE=float
+fi
+if test "$ac_cv_sizeof_double" = "8" ; then
+ MPI_REAL8="0x4c000829"
+ MPI_COMPLEX16="0x4c00102a"
+ MPIR_REAL8_CTYPE=double
+fi
+if test "$ac_cv_sizeof_long_double" = "16" -a "$MPID_NO_LONG_DOUBLE" != yes ; then
+ MPI_REAL16="0x4c00102b"
+ MPI_COMPLEX32="0x4c00202c"
+ MPIR_REAL16_CTYPE="long double"
+fi
+if test -n "$MPIR_REAL4_CTYPE" ; then
+ AC_DEFINE_UNQUOTED(MPIR_REAL4_CTYPE,$MPIR_REAL4_CTYPE,[C type to use for MPI_REAL4])
+fi
+if test -n "$MPIR_REAL8_CTYPE" ; then
+ AC_DEFINE_UNQUOTED(MPIR_REAL8_CTYPE,$MPIR_REAL8_CTYPE,[C type to use for MPI_REAL8])
+fi
+if test -n "$MPIR_REAL16_CTYPE" ; then
+ AC_DEFINE_UNQUOTED(MPIR_REAL16_CTYPE,$MPIR_REAL16_CTYPE,[C type to use for MPI_REAL16])
+fi
+# For complex 8/16/32, we assume that these are 2 consequetive real4/8/16
+#
+# Search for the integer types
+for type in char short int long long_long ; do
+ # ctype is a valid C type which we can use to declare a C version of
+ # this item
+ ctype=`echo $type | sed 's/_/ /'`
+ eval len=\$ac_cv_sizeof_$type
+ if test -n "$len" ; then
+ case $len in
+ 1) if test "$MPI_INTEGER1" = "MPI_DATATYPE_NULL" ; then
+ MPI_INTEGER1="0x4c00012d"
+ MPIR_INTEGER1_CTYPE="$ctype"
+ fi
+ ;;
+ 2) if test "$MPI_INTEGER2" = "MPI_DATATYPE_NULL" ; then
+ MPI_INTEGER2="0x4c00022f"
+ MPIR_INTEGER2_CTYPE="$ctype"
+ fi
+ ;;
+ 4) if test "$MPI_INTEGER4" = "MPI_DATATYPE_NULL" ; then
+ MPI_INTEGER4="0x4c000430"
+ MPIR_INTEGER4_CTYPE="$ctype"
+ fi
+ ;;
+ 8) if test "$MPI_INTEGER8" = "MPI_DATATYPE_NULL" ; then
+ MPI_INTEGER8="0x4c000831"
+ MPIR_INTEGER8_CTYPE="$ctype"
+ fi
+ ;;
+ 16) if test "$MPI_INTEGER16" = "MPI_DATATYPE_NULL" ; then
+ MPI_INTEGER16="0x4c001032"
+ MPIR_INTEGER16_CTYPE="$ctype"
+ fi
+ ;;
+ *)
+ ;;
+ esac
+ fi
+done
+#
+# Add the definitions of these types
+if test -n "$MPIR_INTEGER1_CTYPE" ; then
+ AC_DEFINE_UNQUOTED(MPIR_INTEGER1_CTYPE,$MPIR_INTEGER1_CTYPE,[C type to use for MPI_INTEGER1])
+fi
+if test -n "$MPIR_INTEGER2_CTYPE" ; then
+ AC_DEFINE_UNQUOTED(MPIR_INTEGER2_CTYPE,$MPIR_INTEGER2_CTYPE,[C type to use for MPI_INTEGER2])
+fi
+if test -n "$MPIR_INTEGER4_CTYPE" ; then
+ AC_DEFINE_UNQUOTED(MPIR_INTEGER4_CTYPE,$MPIR_INTEGER4_CTYPE,[C type to use for MPI_INTEGER4])
+fi
+if test -n "$MPIR_INTEGER8_CTYPE" ; then
+ AC_DEFINE_UNQUOTED(MPIR_INTEGER8_CTYPE,$MPIR_INTEGER8_CTYPE,[C type to use for MPI_INTEGER8])
+fi
+if test -n "$MPIR_INTEGER16_CTYPE" ; then
+ AC_DEFINE_UNQUOTED(MPIR_INTEGER16_CTYPE,$MPIR_INTEGER16_CTYPE,[C type to use for MPI_INTEGER16])
+fi
+
+# ----------------------------------------------------------------------------
+
+# C99 types
+# The predefined types must be distinct types (as opposed to aliases to MPI_INT
+# or MPI_WHATEVER) in order to correctly support MPI_Type_{get,set}_name.
+#
+# FIXME the "basic id" portion should be automatically assigned. It's too easy
+# to have a conflict when this is done by hand.
+#
+# Because we make up a matching type for the fixed-width types if one doesn't
+# exist, we don't ever set these to MPI_DATATYPE_NULL. If we come across a
+# platform where 64-bit sizes aren't supported just add a test like the other
+# types.
+MPI_INT8_T=0x4c000137
+MPI_INT16_T=0x4c000238
+MPI_INT32_T=0x4c000439
+MPI_INT64_T=0x4c00083a
+MPI_UINT8_T=0x4c00013b
+MPI_UINT16_T=0x4c00023c
+MPI_UINT32_T=0x4c00043d
+MPI_UINT64_T=0x4c00083e
+
+# The compiler may or may not support these types, depending on its level of C99
+# compliance. We check for each one individually before assigning a handle
+# number.
+MPI_C_BOOL=$MPI_DATATYPE_NULL
+MPI_C_FLOAT_COMPLEX=$MPI_DATATYPE_NULL
+MPI_C_DOUBLE_COMPLEX=$MPI_DATATYPE_NULL
+MPI_C_LONG_DOUBLE_COMPLEX=$MPI_DATATYPE_NULL
+if test ${len__Bool} != 0 ; then
+ MPI_C_BOOL=0x4c00${len__Bool}3f
+fi
+if test ${len_float__Complex} != 0 ; then
+ MPI_C_FLOAT_COMPLEX=0x4c00${len_float__Complex}40
+fi
+if test ${len_double__Complex} != 0 ; then
+ MPI_C_DOUBLE_COMPLEX=0x4c00${len_double__Complex}41
+fi
+if test ${len_long_double__Complex} != 0 ; then
+ MPI_C_LONG_DOUBLE_COMPLEX=0x4c00${len_long_double__Complex}42
+fi
+
+AC_SUBST(MPI_INT8_T)
+AC_SUBST(MPI_INT16_T)
+AC_SUBST(MPI_INT32_T)
+AC_SUBST(MPI_INT64_T)
+AC_SUBST(MPI_UINT8_T)
+AC_SUBST(MPI_UINT16_T)
+AC_SUBST(MPI_UINT32_T)
+AC_SUBST(MPI_UINT64_T)
+AC_SUBST(MPI_C_BOOL)
+AC_SUBST(MPI_C_FLOAT_COMPLEX)
+AC_SUBST(MPI_C_DOUBLE_COMPLEX)
+AC_SUBST(MPI_C_LONG_DOUBLE_COMPLEX)
+export MPI_INT8_T
+export MPI_INT16_T
+export MPI_INT32_T
+export MPI_INT64_T
+export MPI_UINT8_T
+export MPI_UINT16_T
+export MPI_UINT32_T
+export MPI_UINT64_T
+export MPI_C_BOOL
+export MPI_C_FLOAT_COMPLEX
+export MPI_C_DOUBLE_COMPLEX
+export MPI_C_LONG_DOUBLE_COMPLEX
+
+
+# ----------------------------------------------------------------------------
+# We can now create the Fortran versions of the datatype values, along with
+# some of the other datatype-dependent sizes
+
+# There are two parts to handling the datatypes:
+# Convert the C datatype values to their Fortran equivalent. This
+# involves converting the hex values for the C version into decimal
+# since standard Fortran does not have hex constants
+#
+# Determine the existence of the Fortran 'sized' types and set those
+# values.
+#
+# In addition, we need to look at a few additional constants that depend
+# on how the compiler sizes some datatypes. These are:
+# STATUS_SIZE, INTEGER_KIND, ADDRESS_KIND, and OFFSET_KIND
+#
+# ----------------------------------------------------------------------------
+if test "$enable_f77" = yes ; then
+ # Up to size checking code in master configure.ac (where it tries to
+ # find the matching C sizes) as part of defining mpi_integer8 etc.
+ # The results are available in pac_cv_sizeof_f77_<type>
+ # Size is 0 if unknown or unavailable (or cross-compiling)
+ # Due to limitations in autoconf, we cannot put these into a loop.
+ # We also check integer to find the type of MPI_Fint
+ #
+ # Cross-compilation results can be included with the --with-cross=file
+ # option.
+ CROSS_F77_SIZEOF_INTEGER=${CROSS_F77_SIZEOF_INTEGER:-0}
+ CROSS_F77_SIZEOF_REAL=${CROSS_F77_SIZEOF_REAL:-0}
+ CROSS_F77_SIZEOF_DOUBLE_PRECISION=${CROSS_F77_SIZEOF_DOUBLE_PRECISION:-0}
+ PAC_PROG_F77_CHECK_SIZEOF_EXT(integer,$CROSS_F77_SIZEOF_INTEGER)
+ PAC_PROG_F77_CHECK_SIZEOF_EXT(real,$CROSS_F77_SIZEOF_REAL)
+ PAC_PROG_F77_CHECK_SIZEOF_EXT(double precision,$CROSS_F77_SIZEOF_DOUBLE_PRECISION)
+ AC_LANG_FORTRAN77
+ # If we have sizes for real and double, we do not need to call
+ # mpir_get_fsize at run time.
+ # For the size-defined types (e.g., integer*2), we assume that if the
+ # compiler allows it, it has the stated size.
+ AC_CACHE_CHECK([whether integer*1 is supported],pac_cv_fort_integer1,[
+ AC_COMPILE_IFELSE([AC_LANG_PROGRAM(,[ integer*1 i])],
+ pac_cv_fort_integer1=yes,
+ pac_cv_fort_integer1=no)])
+ AC_CACHE_CHECK([whether integer*2 is supported],pac_cv_fort_integer2,[
+ AC_COMPILE_IFELSE([AC_LANG_PROGRAM(,[ integer*2 i])],
+ pac_cv_fort_integer2=yes,
+ pac_cv_fort_integer2=no)])
+ AC_CACHE_CHECK([whether integer*4 is supported],pac_cv_fort_integer4,[
+ AC_COMPILE_IFELSE([AC_LANG_PROGRAM(,[ integer*4 i])],
+ pac_cv_fort_integer4=yes,
+ pac_cv_fort_integer4=no)])
+ AC_CACHE_CHECK([whether integer*8 is supported],pac_cv_fort_integer8,[
+ AC_COMPILE_IFELSE([AC_LANG_PROGRAM(,[ integer*8 i])],
+ pac_cv_fort_integer8=yes,
+ pac_cv_fort_integer8=no)])
+ AC_CACHE_CHECK([whether integer*16 is supported],pac_cv_fort_integer16,[
+ AC_COMPILE_IFELSE([AC_LANG_PROGRAM(,[ integer*16 i])],
+ pac_cv_fort_integer16=yes,
+ pac_cv_fort_integer16=no)])
+ AC_CACHE_CHECK([whether real*4 is supported],pac_cv_fort_real4,[
+ AC_COMPILE_IFELSE([AC_LANG_PROGRAM(,[ real*4 a])],
+ pac_cv_fort_real4=yes,
+ pac_cv_fort_real4=no)])
+ AC_CACHE_CHECK([whether real*8 is supported],pac_cv_fort_real8,[
+ AC_COMPILE_IFELSE([AC_LANG_PROGRAM(,[ real*8 a])],
+ pac_cv_fort_real8=yes,
+ pac_cv_fort_real8=no)])
+ AC_CACHE_CHECK([whether real*16 is supported],pac_cv_fort_real16,[
+ AC_COMPILE_IFELSE([AC_LANG_PROGRAM(,[ real*16 a])],
+ pac_cv_fort_real16=yes,
+ pac_cv_fort_real16=no)])
+
+ # Create the default datatype names for the standard MPI Fortran types
+ MPI_CHARACTER=0x4c00011a
+ AC_SUBST(MPI_CHARACTER)
+
+ if test -z "$pac_cv_f77_sizeof_integer" ; then
+ AC_MSG_ERROR([Unable to configure with Fortran support because configure could not determine the size of a Fortran INTEGER. Consider setting CROSS_F77_SIZEOF_INTEGER to the length in bytes of a Fortran INTEGER])
+ fi
+ len_integer=$pac_cv_f77_sizeof_integer
+ # Convert to two digit hex
+ len=$len_integer
+ #
+ # Take len and turn it into two hex digits (there are 8 bits available
+ # in the built-in datatype handle for the length; see
+ # src/mpid/common/datatype/mpid_datatype.h). This code is taken
+ # from the code in mpich2/configure.ac
+ if test "$len" -gt 255 ; then
+ AC_MSG_ERROR([Type sizes greater than 255 bytes are not supported (type INTEGER is $len bytes)])
+ fi
+ tmplen=$len
+ hexlen=""
+ while test $tmplen -gt 0 ; do
+ lowdigit=`expr $tmplen - 16 \* \( $tmplen / 16 \)`
+ case $lowdigit in
+ 10) char=a ;;
+ 11) char=b ;;
+ 12) char=c ;;
+ 13) char=d ;;
+ 14) char=e ;;
+ 15) char=f ;;
+ *) char=$lowdigit ;;
+ esac
+ hexlen="$char$hexlen"
+ tmplen=`expr $tmplen / 16`
+ done
+ if test $len -lt 16 ; then
+ hexlen="0$hexlen"
+ fi
+ len_integer=$hexlen
+ if test "$len_integer" = 0 ; then
+ # We have a problem
+ AC_MSG_WARN([Unable to determine size of an INTEGER type; using 4])
+ # We make the length 4
+ len_integer="04"
+ fi
+ MPI_INTEGER=0x4c00${len_integer}1b
+ MPI_REAL=0x4c00${len_integer}1c
+ MPI_LOGICAL=0x4c00${len_integer}1d
+ AC_SUBST(MPI_INTEGER)
+ AC_SUBST(MPI_REAL)
+ AC_SUBST(MPI_LOGICAL)
+
+ if test -z "$pac_cv_f77_sizeof_double_precision" ; then
+ AC_MSG_ERROR([Unable to configure with Fortran support because configure could not determine the size of a Fortran DOUBLE PRECISION. Consider setting CROSS_F77_SIZEOF_DOUBLE_PRECISION to the length in bytes of a Fortran DOUBLE PRECISION])
+ fi
+ len_double=$pac_cv_f77_sizeof_double_precision
+ # Convert to two digit hex
+ len=$len_double
+ #
+ # Take len and turn it into two hex digits (there are 8 bits available
+ # in the built-in datatype handle for the length; see
+ # src/mpid/common/datatype/mpid_datatype.h). This code is taken
+ # from the code in mpich2/configure.ac
+ if test "$len" -gt 255 ; then
+ AC_MSG_ERROR([Type sizes greater than 255 bytes are not supported (type DOUBLE is $len bytes)])
+ fi
+ tmplen=$len
+ hexlen=""
+ while test $tmplen -gt 0 ; do
+ lowdigit=`expr $tmplen - 16 \* \( $tmplen / 16 \)`
+ case $lowdigit in
+ 10) char=a ;;
+ 11) char=b ;;
+ 12) char=c ;;
+ 13) char=d ;;
+ 14) char=e ;;
+ 15) char=f ;;
+ *) char=$lowdigit ;;
+ esac
+ hexlen="$char$hexlen"
+ tmplen=`expr $tmplen / 16`
+ done
+ if test $len -lt 16 ; then
+ hexlen="0$hexlen"
+ fi
+ len_double=$hexlen
+ if test "$len_double" = 0 ; then
+ # We have a problem
+ AC_MSG_WARN([Unable to determine size of a DOUBLE PRECISION type; using 8])
+ # We make the length 8
+ len_double="08"
+ fi
+
+ # Provide the corresponding C types for MPI_REAL and MPI_DOUBLE
+ AC_MSG_CHECKING([for C type matching Fortran real])
+ noval=yes
+ for c_type in float double "long_double" ; do
+ eval ctypelen=\$"ac_cv_sizeof_$c_type"
+ if test "$pac_cv_f77_sizeof_real" = "$ctypelen" -a \
+ "$ctypelen" -gt 0 ; then
+ c_type=`echo $c_type | sed -e 's/_/ /g'`
+ AC_MSG_RESULT($c_type)
+ MPIR_FC_REAL_CTYPE=$c_type
+ noval="no"
+ break
+ fi
+ done
+ if test "$noval" = "yes" ; then
+ # Set a default
+ MPIR_RC_REAL_CTYPE="float"
+ AC_MSG_RESULT([unavailable])
+ fi
+
+ noval=yes
+ AC_MSG_CHECKING([for C type matching Fortran double])
+ for c_type in double "long_double" float ; do
+ eval ctypelen=\$"ac_cv_sizeof_$c_type"
+ if test "$pac_cv_f77_sizeof_double_precision" = "$ctypelen" -a \
+ "$ctypelen" -gt 0 ; then
+ c_type=`echo $c_type | sed -e 's/_/ /g'`
+ AC_MSG_RESULT($c_type)
+ MPIR_FC_DOUBLE_CTYPE=$c_type
+ noval="no"
+ break
+ fi
+ done
+ if test "$noval" = "yes" ; then
+ # Set a default
+ MPIR_FC_DOUBLE_CTYPE="double"
+ AC_MSG_RESULT([unavailable])
+ fi
+
+ # These are needed to correctly implement the MPI reduction operations
+ AC_DEFINE_UNQUOTED([MPIR_FC_REAL_CTYPE],[$MPIR_FC_REAL_CTYPE],
+ [The C type for FORTRAN REAL])
+ AC_DEFINE_UNQUOTED([MPIR_FC_DOUBLE_CTYPE],[$MPIR_FC_DOUBLE_CTYPE],
+ [The C type for FORTRAN DOUBLE PRECISION])
+
+ # Use the proper length values for these items in case we are building
+ # with Fortran integers that are not the same size as C ints and
+ # reals and double precision that are the same size (not valid Fortran,
+ # but used by some applications)
+
+ len_2integer=`expr 2 \* $len_integer`
+ len_2real=`expr 2 \* $len_integer`
+ len_doublecplx=`expr $pac_cv_f77_sizeof_double_precision \* 2`
+ if test "$len_doublecplx" = 0 ; then
+ # We have a problem
+ AC_MSG_WARN([Unable to determine size of a DOUBLE PRECISION type; using 8])
+ # We make the length 8*2 (in hex)
+ len_doublecplx="16"
+ fi
+
+ for lenname in len_2integer len_2real len_doublecplx ; do
+ eval len=\$$lenname
+ if test "$len" -gt 255 ; then
+ AC_MSG_ERROR([Type sizes greater than 255 bytes are not supported (type $lenname is $len bytes)])
+ fi
+ tmplen=$len
+ hexlen=""
+ while test $tmplen -gt 0 ; do
+ lowdigit=`expr $tmplen - 16 \* \( $tmplen / 16 \)`
+ case $lowdigit in
+ 10) char=a ;;
+ 11) char=b ;;
+ 12) char=c ;;
+ 13) char=d ;;
+ 14) char=e ;;
+ 15) char=f ;;
+ *) char=$lowdigit ;;
+ esac
+ hexlen="$char$hexlen"
+ tmplen=`expr $tmplen / 16`
+ done
+ if test $len -lt 16 ; then
+ hexlen="0$hexlen"
+ fi
+ eval ${lenname}=$hexlen
+ if test "$hexlen" = 0 ; then
+ # We have a problem
+ AC_MSG_WARN([Unable to determine size of a $lenname type; using 8])
+ # We make the length 8
+ eval ${lenname}=$hexlen
+ fi
+ done
+
+ MPI_DOUBLE_PRECISION=0x4c00${len_double}1f
+ MPI_2INTEGER=0x4c00${len_2integer}20
+ MPI_2REAL=0x4c00${len_2real}21
+ MPI_COMPLEX=0x4c00${len_2real}1e
+ AC_SUBST(MPI_COMPLEX)
+ AC_SUBST(MPI_DOUBLE_PRECISION)
+ AC_SUBST(MPI_2INTEGER)
+ AC_SUBST(MPI_2REAL)
+
+dnl len=$len_doublecplx
+dnl #
+dnl # Take len and turn it into two hex digits (there are 8 bits available
+dnl # in the built-in datatype handle for the length; see
+dnl # src/mpid/common/datatype/mpid_datatype.h). This code is taken
+dnl # from the code in mpich2/configure.ac
+dnl if test "$len" -gt 255 ; then
+dnl AC_MSG_ERROR([Type sizes greater than 255 bytes are not supported (type DOUBLE COMPLEX is $len bytes)])
+dnl fi
+dnl tmplen=$len
+dnl hexlen=""
+dnl while test $tmplen -gt 0 ; do
+dnl lowdigit=`expr $tmplen - 16 \* \( $tmplen / 16 \)`
+dnl case $lowdigit in
+dnl 10) char=a ;;
+dnl 11) char=b ;;
+dnl 12) char=c ;;
+dnl 13) char=d ;;
+dnl 14) char=e ;;
+dnl 15) char=f ;;
+dnl *) char=$lowdigit ;;
+dnl esac
+dnl hexlen="$char$hexlen"
+dnl tmplen=`expr $tmplen / 16`
+dnl done
+dnl if test $len -lt 16 ; then
+dnl hexlen="0$hexlen"
+dnl fi
+dnl len_doublecplx=$hexlen
+
+ MPI_DOUBLE_COMPLEX=0x4c00${len_doublecplx}22
+ MPI_2DOUBLE_PRECISION=0x4c00${len_doublecplx}23
+ MPI_2COMPLEX=0x4c00${len_doublecplx}24
+ AC_SUBST(MPI_DOUBLE_COMPLEX)
+ AC_SUBST(MPI_2DOUBLE_PRECISION)
+ AC_SUBST(MPI_2COMPLEX)
+
+ #
+ # Temporary for the vast majority of systems that use 4 byte reals and
+ # 8 byte doubles
+ # Lengths at this point are in hex, hence "10" = 10 base 16 = 16 base 10.
+ if test "$len_double" = "08" ; then
+ F77_COMPLEX8=$MPI_COMPLEX
+ fi
+ if test "$len_doublecplx" = "10" ; then
+ F77_COMPLEX16=$MPI_DOUBLE_COMPLEX
+ fi
+ if test "$len_long_double" = "10" -a "$MPID_NO_LONG_DOUBLE" != "yes" ; then
+ F77_COMPLEX32="0x4c002025"
+ else
+ F77_COMPLEX32="MPI_DATATYPE_NULL"
+ fi
+
+ len_2dc=`expr $pac_cv_f77_sizeof_double_precision \* 4`
+ firstdigit=0
+ seconddigit=0
+ while test $len_2dc -ge 16 ; do
+ firstdigit=`expr $firstdigit + 1`
+ len_2dc=`expr $len_2dc - 16`
+ done
+ case $len_2dc in
+ 10) seconddigit=a ;;
+ 11) seconddigit=b ;;
+ 12) seconddigit=c ;;
+ 13) seconddigit=d ;;
+ 14) seconddigit=e ;;
+ 15) seconddigit=f ;;
+ *) seconddigit=$len_2dc ;;
+ esac
+ len_2dc="$firstdigit$seconddigit"
+ #echo "2double complex = $len_2dc"
+ MPI_2DOUBLE_COMPLEX=0x4c00${len_2dc}25
+ AC_SUBST(MPI_2DOUBLE_COMPLEX)
+ MPI_F77_PACKED=$MPI_PACKED
+ MPI_F77_UB=$MPI_UB
+ MPI_F77_LB=$MPI_LB
+ MPI_F77_BYTE=$MPI_BYTE
+ AC_SUBST(MPI_F77_PACKED)
+ AC_SUBST(MPI_F77_UB)
+ AC_SUBST(MPI_F77_LB)
+ AC_SUBST(MPI_F77_BYTE)
+ #
+ # We must convert all hex values to decimal (!)
+ # It would be nice to use expr to extract the next character rather than
+ # the heavier-weight sed, but expr under Tru64 Unix discards leading zeros,
+ # even when used only with the match (:) command. Rather than have
+ # configure figure out if expr works, we just use sed. Sigh.
+ for var in CHARACTER INTEGER REAL LOGICAL DOUBLE_PRECISION COMPLEX \
+ DOUBLE_COMPLEX 2INTEGER 2REAL 2COMPLEX 2DOUBLE_PRECISION \
+ 2DOUBLE_COMPLEX F77_PACKED F77_UB F77_LB F77_BYTE; do
+ fullvar="MPI_$var"
+ eval fullvarvalue=\$$fullvar
+ #echo "$fullvar = $fullvarvalue"
+ value=0
+ fullvarvalue=`echo $fullvarvalue | sed -e 's/..\(.*\)/\1/'`
+ for pos in 3 4 5 6 7 8 9 10 ; do
+ # This works, even for Tru64, because only a single character
+ # is extracted
+ char=`expr $fullvarvalue : '\(.\)'`
+ # FIXME: Tru64 Unix eliminates leading zeros (!)
+ # How do we fix something that broken?
+ fullvarvalue=`echo $fullvarvalue | sed -e 's/.\(.*\)/\1/'`
+ case $char in
+ a) char=10 ;;
+ b) char=11 ;;
+ c) char=12 ;;
+ d) char=13 ;;
+ e) char=14 ;;
+ f) char=15 ;;
+ esac
+ value=`expr $value \* 16 + $char`
+ done
+ #echo "$fullvar = $value"
+ if test "X$value" = "X"; then
+ eval origvarvalue=\$$fullvar
+ AC_MSG_ERROR([Internal Error: Failed to convert $fullvar value to hex! Original value was $origvarvalue])
+ fi
+ eval $fullvar=$value
+ done
+ AC_LANG_C
+
+ # Now, handle the sized types
+ #
+ # Preload the C mpi types
+ # THESE MUST MATCH THE DEFINITIONS IN MPI.H and MPIF.H
+ # We use these to match the optional Fortran types
+ char_mpi=${MPI_CHAR:-0}
+ short_mpi=${MPI_SHORT:-0}
+ int_mpi=${MPI_INT:-0}
+ long_mpi=${MPI_LONG:-0}
+ long_long_mpi=${MPI_LONG_LONG:-0}
+ float_mpi=${MPI_FLOAT:-0}
+ double_mpi=${MPI_DOUBLE:-0}
+ long_double_mpi=${MPI_LONG_DOUBLE:-0}
+
+ #
+ # The following code was correct for MPI-1, which allowed these datatypes
+ # to be an alias for another MPI type. MPI-2 requires these to
+ # be distinct types, so these are enumerated
+ if test "$use_alias_types" = yes ; then
+ for len in 1 2 4 8 16 ; do
+ eval F77_INTEGER$len=0
+ #eval testval=\$"pac_cv_f77_sizeof_integer_$len"
+ eval testval=\$"pac_cv_fort_integer$len"
+ if test "$testval" = no ; then continue ; fi
+ testval=$len
+ noval="yes"
+ AC_MSG_CHECKING([for C type matching Fortran integer*$len])
+ for c_type in char short int long "long_long" ; do
+ eval ctypelen=\$"ac_cv_sizeof_$c_type"
+ if test "$testval" = "$ctypelen" -a "$ctypelen" -gt 0 ; then
+ AC_MSG_RESULT($c_type)
+ eval F77_INTEGER$len=\$"${c_type}_mpi"
+ noval="no"
+ break
+ fi
+ done
+ if test "$noval" = "yes" ; then
+ AC_MSG_RESULT([unavailable])
+ fi
+ done
+
+ # Complex is set separately above
+ for len in 4 8 16 ; do
+ len2=`expr $len + $len`
+ eval F77_REAL$len=0
+ #eval F77_COMPLEX$len2=0
+ #eval testval=\$"pac_cv_f77_sizeof_real_$len"
+ eval testval=\$"pac_cv_fort_real$len"
+ if test "$testval" = no ; then continue ; fi
+ testval=$len
+ noval="yes"
+ AC_MSG_CHECKING([for C type matching Fortran real*$len])
+ for c_type in float double "long_double" ; do
+ eval ctypelen=\$"ac_cv_sizeof_$c_type"
+ if test "$testval" = "$ctypelen" -a "$ctypelen" -gt 0 ; then
+ AC_MSG_RESULT($c_type)
+ eval F77_REAL$len=\$"${c_type}_mpi"
+ #eval F77_COMPLEX$len2=\$"${c_type}_cplx_mpi"
+ noval="no"
+ break
+ fi
+ done
+ if test "$noval" = "yes" ; then
+ AC_MSG_RESULT([unavailable])
+ fi
+ done
+ else
+ # Simply determine which types exist. These may have been set by the
+ # toplevel configure
+ for var in INTEGER1 INTEGER2 INTEGER4 INTEGER8 INTEGER16 \
+ REAL4 REAL8 REAL16 COMPLEX8 COMPLEX16 COMPLEX32 ; do
+ eval varname=MPI_$var
+ eval varvalue=\$$varname
+ #echo "$varname = $varvalue"
+ if test "$varvalue" = MPI_DATATYPE_NULL ; then
+ eval F77_$var=0
+ else
+ eval F77_$var=\$$varname
+ fi
+ done
+ fi
+ # We must convert all hex values to decimal (!)
+ for var in INTEGER1 INTEGER2 INTEGER4 INTEGER8 INTEGER16 \
+ REAL4 REAL8 REAL16 COMPLEX8 COMPLEX16 COMPLEX32 ; do
+ fullvar="F77_$var"
+ eval fullvarvalue=\$$fullvar
+ if test "$fullvarvalue" = 0 -o -z "$fullvarvalue" ; then
+ eval $fullvar=MPI_DATATYPE_NULL
+ continue
+ fi
+ #echo "$fullvar = $fullvarvalue"
+ value=0
+ # See the comments above on why expr with : cannot be used here
+ fullvarvalue=`echo $fullvarvalue | sed -e 's/..\(.*\)/\1/'`
+ for pos in 3 4 5 6 7 8 9 10 ; do
+ #char=`expr substr $fullvarvalue $pos 1`
+ char=`expr $fullvarvalue : '\(.\)'`
+ # We don't test for success of expr here because some expr's are
+ # buggy and set the status to one on expressions like
+ # expr 00ccc : '\(.\)'
+ # while both
+ # expr 00ccc : '\(..\)'
+ # and
+ # expr 100cc : '\(.\)'
+ # return a zero status. So the status is set even on success,
+ # if the result is a single character that is a zero (!)
+ #rc=$?
+ #if test "$rc" != 0 ; then
+ dnl # AC_MSG_WARN([Failure (status $rc) in extracting first char from $fullvarvalue])
+ # break
+ #fi
+ fullvarvalue=`echo $fullvarvalue | sed -e 's/.\(.*\)/\1/'`
+ case $char in
+ a) char=10 ;;
+ b) char=11 ;;
+ c) char=12 ;;
+ d) char=13 ;;
+ e) char=14 ;;
+ f) char=15 ;;
+ esac
+ value=`expr $value \* 16 + $char`
+ if test $? != 0 ; then
+ AC_MSG_WARN([Failure to evaluate $value \* 16 + $char])
+ fi
+ done
+ #echo "$fullvar = $value"
+ eval $fullvar=$value
+ done
+ AC_SUBST(F77_INTEGER1)
+ AC_SUBST(F77_INTEGER2)
+ AC_SUBST(F77_INTEGER4)
+ AC_SUBST(F77_INTEGER8)
+ AC_SUBST(F77_INTEGER16)
+ AC_SUBST(F77_REAL4)
+ AC_SUBST(F77_REAL8)
+ AC_SUBST(F77_REAL16)
+ AC_SUBST(F77_COMPLEX8)
+ AC_SUBST(F77_COMPLEX16)
+ AC_SUBST(F77_COMPLEX32)
+
+ noval="yes"
+ AC_MSG_CHECKING([for C type matching Fortran integer])
+ for c_type in char short int long "long_long" ; do
+ eval ctypelen=\$"ac_cv_sizeof_$c_type"
+ if test "$pac_cv_f77_sizeof_integer" = "$ctypelen" -a \
+ "$ctypelen" -gt 0 ; then
+ c_type=`echo $c_type | sed -e 's/_/ /g'`
+ AC_MSG_RESULT($c_type)
+ MPI_FINT=$c_type
+ noval="no"
+ break
+ fi
+ done
+ if test "$noval" = "yes" ; then
+ # Set a default
+ MPI_FINT="int"
+ AC_MSG_RESULT([unavailable])
+ fi
+ # We also need to check the size of MPI_Aint vs MPI_Fint, and
+ # define AINT_LARGER_THAN_FINT if aint is larger (this
+ # affects code in MPI_Address)
+ if test "$ac_cv_sizeof_void_p" != "0" -a \
+ "$ac_cv_sizeof_void_p" -gt "$pac_cv_f77_sizeof_integer" ; then
+ AC_DEFINE(HAVE_AINT_LARGER_THAN_FINT,1,[Define if addresses are larger than Fortran integers])
+ fi
+ if test "$ac_cv_sizeof_void_p" != 0 -a \
+ "$ac_cv_sizeof_void_p" != "$pac_cv_f77_sizeof_integer" ; then
+ AC_DEFINE(HAVE_AINT_DIFFERENT_THAN_FINT,1,[Define if addresses are a different size than Fortran integers])
+ fi
+
+ # Include a defined value for Fint is int
+ if test "$MPI_FINT" = "int" ; then
+ AC_DEFINE(HAVE_FINT_IS_INT,1,[Define if Fortran integer are the same size as C ints])
+ elif test "$SIZEOF_F77_INTEGER" != "$ac_cv_sizeof_int" ; then
+ # Make this fatal because we do not want to build a broken fortran
+ # interface (was error)
+ # Check to see if the f77 binding has enabled the code to support
+ # the case of int != fint.
+ if grep HAVE_FINT_IS_INT $master_top_srcdir/src/binding/f77/testf.c 2>&1 1>/dev/null ; then
+ AC_MSG_WARN([Fortran integers and C ints are not the same size. Support for this case is experimental; use at your own risk])
+ else
+ AC_MSG_ERROR([Fortran integers and C ints are not the same size. The current Fortran binding does not support this case. Either force the Fortran compiler to use integers of $ac_cv_sizeof_int bytes, or use --disable-f77 on the configure line for MPICH2.])
+ fi
+ fi
+
+ #
+ # Set size of MPI_Status. We may need sizeof_int here as well
+ #
+
+ #
+ # The size of MPI_Status is needed for the Fortran interface.
+ # This is not quite right unless the device setup script, executed above,
+ # sets the EXTRA_STATUS_DECL that will be used in defining a status.
+ # The default size assumes that there are 5 ints
+ AC_CACHE_CHECK([for size of MPI_Status],pac_cv_sizeof_mpi_status,[
+ rm -f pac_mpi_status.h
+ cat > pac_mpi_status.h <<_EOF
+typedef struct {
+ int count;
+ int cancelled;
+ int MPI_SOURCE;
+ int MPI_TAG;
+ int MPI_ERROR;
+ $EXTRA_STATUS_DECL
+} MPI_Status;
+_EOF
+ dnl another alternative is to use AC_CHECK_SIZEOF as follows:
+ dnl AC_CHECK_SIZEOF([MPI_Status],[], [#include "pac_status.h"])
+ dnl But AC_CHECK_SIZEOF has its own AC_MSG_CHECKING, so can't use
+ dnl AC_CACHE_CHECK, so use AC_COMPUTE_INT here.
+ default_status_size=`expr 5 \* $ac_cv_sizeof_int`
+ AC_COMPUTE_INT([pac_cv_sizeof_mpi_status],
+ [sizeof(MPI_Status)],
+ [#include "pac_mpi_status.h"],
+ [pac_cv_sizeof_mpi_status=$default_status_size])
+ rm -f pac_mpi_status.h
+ ])
+
+ SIZEOF_MPI_STATUS=$pac_cv_sizeof_mpi_status
+ export SIZEOF_MPI_STATUS
+ AC_SUBST(SIZEOF_MPI_STATUS)
+
+ if test -z "$MPI_STATUS_SIZE" ; then
+ if test -n "$SIZEOF_MPI_STATUS" ; then
+ # compute from the C sizeof
+ MPI_STATUS_SIZE=`expr $SIZEOF_MPI_STATUS / $ac_cv_sizeof_int`
+ if test "$MPI_STATUS_SIZE" = "0" ; then
+ AC_MSG_WARN([Could not compute the size of MPI_Status])
+ MPI_STATUS_SIZE=5
+ fi
+ else
+ AC_MSG_WARN([MPI_STATUS_SIZE was not defined!])
+ # The default size is 5. See mpi.h.in
+ MPI_STATUS_SIZE=5
+ fi
+ fi
+ AC_SUBST(MPI_STATUS_SIZE)
+ MPIF_STATUS_SIZE=$MPI_STATUS_SIZE
+ AC_DEFINE_UNQUOTED(MPIF_STATUS_SIZE,$MPIF_STATUS_SIZE,[Size of an MPI_STATUS, in Fortran, in Fortran integers])
+
+ # We must convert all hex values to decimal (!).
+ # This is for the C types so they are also available in Fortran
+ for var in CHAR SIGNED_CHAR UNSIGNED_CHAR WCHAR SHORT \
+ UNSIGNED_SHORT INT UNSIGNED_INT LONG UNSIGNED_LONG \
+ FLOAT DOUBLE LONG_DOUBLE LONG_LONG_INT \
+ UNSIGNED_LONG_LONG LONG_LONG FLOAT_INT DOUBLE_INT \
+ LONG_INT SHORT_INT "2INT" LONG_DOUBLE_INT \
+ INT8_T INT16_T INT32_T INT64_T \
+ UINT8_T UINT16_T UINT32_T UINT64_T \
+ C_BOOL C_FLOAT_COMPLEX C_DOUBLE_COMPLEX \
+ C_LONG_DOUBLE_COMPLEX AINT OFFSET ; do
+ fullvar="MPI_$var"
+ fullf77var="MPI_F77_$var"
+ eval fullvarvalue=\$$fullvar
+ #echo "$fullvar = $fullvarvalue"
+ if test "x$fullvarvalue" = "x" -o \
+ "x$fullvarvalue" = "xMPI_DATATYPE_NULL" ; then
+ eval $fullf77var="MPI_DATATYPE_NULL"
+ continue
+ fi
+ value=0
+ fullvarvalue=`echo $fullvarvalue | sed -e 's/..\(.*\)/\1/'`
+ offset=0
+ for pos in 3 4 5 6 7 8 9 10 ; do
+ # This works, even for Tru64, because only a single character
+ # is extracted
+ char=`expr $fullvarvalue : '\(.\)'`
+ # FIXME: Tru64 Unix eliminates leading zeros (!)
+ # How do we fix something that broken?
+ fullvarvalue=`echo $fullvarvalue | sed -e 's/.\(.*\)/\1/'`
+ case $char in
+ a) char=10 ;;
+ b) char=11 ;;
+ c) char=12 ;;
+ d) char=13 ;;
+ e) char=14 ;;
+ f) char=15 ;;
+ esac
+ # For Fortran, if the value is too big for an unsigned int,
+ # we need to make it a signed (negative) int. Currently, the
+ # types in this class are the minloc/maxloc types.
+ if test $pos = 3 -a $char -ge 8 ; then
+ #echo "for $var in position $pos found a value >= 8"
+ char=`expr $char - 8`
+ offset=-2147483648
+ fi
+ value=`expr $value \* 16 + $char`
+ done
+ if test "$offset" != 0 ; then
+ #echo "$fullf77var: $value, $offset"
+ value=`expr $value + $offset`
+ fi
+ #echo "$fullf77var = $value"
+ eval $fullf77var=$value
+ done
+ AC_SUBST(MPI_F77_CHAR)
+ AC_SUBST(MPI_F77_SIGNED_CHAR)
+ AC_SUBST(MPI_F77_UNSIGNED_CHAR)
+ AC_SUBST(MPI_F77_WCHAR)
+ AC_SUBST(MPI_F77_SHORT)
+ AC_SUBST(MPI_F77_UNSIGNED_SHORT)
+ MPI_F77_UNSIGNED=$MPI_F77_UNSIGNED_INT
+ AC_SUBST(MPI_F77_UNSIGNED)
+ AC_SUBST(MPI_F77_INT)
+ AC_SUBST(MPI_F77_LONG)
+ AC_SUBST(MPI_F77_UNSIGNED_LONG)
+ AC_SUBST(MPI_F77_FLOAT)
+ AC_SUBST(MPI_F77_DOUBLE)
+ AC_SUBST(MPI_F77_LONG_DOUBLE)
+ AC_SUBST(MPI_F77_UNSIGNED_LONG_LONG)
+ MPI_F77_LONG_LONG_INT=$MPI_F77_LONG_LONG
+ AC_SUBST(MPI_F77_LONG_LONG_INT)
+ AC_SUBST(MPI_F77_LONG_LONG)
+ AC_SUBST(MPI_F77_FLOAT_INT)
+ AC_SUBST(MPI_F77_DOUBLE_INT)
+ AC_SUBST(MPI_F77_LONG_INT)
+ AC_SUBST(MPI_F77_SHORT_INT)
+ AC_SUBST(MPI_F77_2INT)
+ AC_SUBST(MPI_F77_LONG_DOUBLE_INT)
+ AC_SUBST(MPI_F77_INT8_T)
+ AC_SUBST(MPI_F77_INT16_T)
+ AC_SUBST(MPI_F77_INT32_T)
+ AC_SUBST(MPI_F77_INT64_T)
+ AC_SUBST(MPI_F77_UINT8_T)
+ AC_SUBST(MPI_F77_UINT16_T)
+ AC_SUBST(MPI_F77_UINT32_T)
+ AC_SUBST(MPI_F77_UINT64_T)
+ AC_SUBST(MPI_F77_C_BOOL)
+ AC_SUBST(MPI_F77_C_FLOAT_COMPLEX)
+ # C_COMPLEX is an alias for FLOAT_COMPLEX
+ MPI_F77_C_COMPLEX=$MPI_F77_C_FLOAT_COMPLEX
+ AC_SUBST(MPI_F77_C_COMPLEX)
+ AC_SUBST(MPI_F77_C_DOUBLE_COMPLEX)
+ AC_SUBST(MPI_F77_C_LONG_DOUBLE_COMPLEX)
+ # these two are not yet defined, but AC_SUBST only cares about them at
+ # AC_OUTPUT-time
+ AC_SUBST(MPI_F77_AINT)
+ AC_SUBST(MPI_F77_OFFSET)
+
+ # Try and compute the values of .true. and .false. in Fortran
+ # This code has been removed because the Fortran binding code does
+ # not yet support it.
+ PAC_F77_LOGICALS_IN_C([$MPI_FINT])
+
+ # Check if multiple __attribute__((alias)) is available
+ if test "$enable_multi_aliases" = "yes" ; then
+ PAC_C_MULTI_ATTR_ALIAS
+ if test "$pac_c_multi_attr_alias" = "yes" ; then
+ PAC_F2C_ATTR_ALIGNED_SIZE([1],[CMB_1INT_ALIGNMENT])
+ AC_SUBST(CMB_1INT_ALIGNMENT)
+ PAC_F2C_ATTR_ALIGNED_SIZE([$MPI_STATUS_SIZE],[CMB_STATUS_ALIGNMENT],
+ [32])
+ AC_SUBST(CMB_STATUS_ALIGNMENT)
+ if test "X$CMB_1INT_ALIGNMENT" != "X" \
+ -a "X$CMB_STATUS_ALIGNMENT" != "X" ; then
+ AC_DEFINE(HAVE_C_MULTI_ATTR_ALIAS, 1,
+ [Define if multiple __attribute__((alias)) are supported])
+ fi
+ fi
+ fi
+
+ # Get the INTEGER_KIND, ADDRESS_KIND and OFFSET_KIND if possible
+ #
+ # For Fortran 90, we'll also need MPI_ADDRESS_KIND and MPI_OFFSET_KIND
+ # Since our compiler might BE a Fortran 90 compiler, try and determine the
+ # values.
+ if test -z "$FC" ; then
+ PAC_F77_IS_FC([
+ FC=$F77
+ if test -z "$FCFLAGS" ; then
+ FCFLAGS="$FFLAGS"
+ fi
+ ])
+ fi
+ if test -n "$FC" ; then
+ # Offset kind should be for 8 bytes if possible (Romio prefers that)
+ # address should be sizeof void * (unless --with-aint-size has
+ # been set)
+ # FIXME in the current configure implementation OFFSET_KIND and
+ # MPI_Offset won't always agree, but generally will. The MPI Standard
+ # implies that these types must have identical size, so this is a bug
+ # waiting to happen.
+ if test "$with_aint_size" -gt 0 -a \
+ "$with_aint_size" -gt "$ac_cv_sizeof_void_p" ; then
+ testsize=$with_aint_size
+ else
+ testsize=$ac_cv_sizeof_void_p
+ fi
+ if test "$testsize" = 0 ; then
+ # Set a default
+ testsize=4
+ fi
+ dnl Using the {} around testsize helps the comments work correctly
+ PAC_PROG_FC_INT_KIND(ADDRESS_KIND,${testsize},$CROSS_F90_ADDRESS_KIND)
+ if test "$testsize" = 8 ; then
+ OFFSET_KIND=$ADDRESS_KIND
+ else
+ PAC_PROG_FC_INT_KIND(OFFSET_KIND,8,$CROSS_F90_OFFSET_KIND)
+ fi
+ #
+ PAC_PROG_FC_INT_KIND(INTEGER_KIND,$pac_cv_f77_sizeof_integer,$CROSS_F90_INTEGER_KIND)
+ if test "$INTEGER_KIND" = "-1" ; then
+ # Wild guess; probably means that Fortran 90 is not available
+ AC_MSG_WARN([Unable to determine Fortran 90 KIND values for either address-sized integers or offset-sized integers. Using 4 in that case.])
+ INTEGER_KIND=4
+ fi
+ #
+ # Some compilers won't allow a -1 kind (e.g., absoft). In this case,
+ # use a fallback (sizeof(int) kind)
+ if test "$ADDRESS_KIND" = "-1" -o "$OFFSET_KIND" = "-1" ; then
+ if test "$ADDRESS_KIND" = "-1" ; then
+ ADDRESS_KIND=$INTEGER_KIND
+ fi
+ if test "$OFFSET_KIND" = "-1" ; then
+ OFFSET_KIND=$INTEGER_KIND
+ fi
+ fi
+ AC_LANG_PUSH([Fortran])
+ AC_CACHE_CHECK([if real*8 is supported in Fortran 90],
+ [pac_cv_fort90_real8],[
+ AC_COMPILE_IFELSE([
+ AC_LANG_PROGRAM([],[ real*8 a])
+ ],[
+ pac_cv_fort90_real8=yes
+ ],[
+ pac_cv_fort90_real8=no
+ ])
+ ])
+ AC_LANG_POP([Fortran])
+ WTIME_DOUBLE_TYPE="DOUBLE PRECISION"
+ # Save a copy of the original mpi_base.f90 file
+ if test "$enable_fc" = "yes" -a "$pac_cv_fort90_real8" = "yes" ; then
+ WTIME_DOUBLE_TYPE="REAL*8"
+ fi
+ # WTIME_DOUBLE_TYPE is substituted into mpi_base.f90
+ AC_SUBST(WTIME_DOUBLE_TYPE)
+ fi
+ # Make sure that address kind and offset kind have values.
+ if test -z "$ADDRESS_KIND" ; then
+ ADDRESS_KIND=0
+ fi
+ if test -z "$OFFSET_KIND" ; then
+ OFFSET_KIND=0
+ fi
+ # Note, however, that zero value are (in all practical case) invalid
+ # for Fortran 90, and indicate a failure. Test and fail if Fortran 90
+ # enabled.
+ if test "$enable_fc" = "yes" ; then
+ if test "$ADDRESS_KIND" -le 0 -o "$OFFSET_KIND" -le 0 ; then
+ AC_MSG_ERROR([Unable to determine Fortran 90 integer kinds for MPI types. If you do not need Fortran 90, add --disable-fc to the configure options.])
+ # If the above is converted to a warning, you need to change
+ # enable_fc and remote f90 from the bindings
+ enable_fc=no
+ fi
+ fi
+ AC_SUBST(ADDRESS_KIND)
+ AC_SUBST(OFFSET_KIND)
+ AC_SUBST(INTEGER_KIND)
+
+ # Some compilers may require special directives to handle the common
+ # block in a library. In particular, directives are needed for Microsoft
+ # Windows to support dynamic library import. The following six
+ # directives may be needed:
+ # CMS\$ATTRIBUTES DLLIMPORT::/MPIPRIV1/
+ # CMS\$ATTRIBUTES DLLIMPORT::/MPIPRIV2/
+ # CMS\$ATTRIBUTES DLLIMPORT::/MPIPRIVC/
+ # CDEC\$ATTRIBUTES DLLIMPORT::/MPIPRIV1/
+ # CDEC\$ATTRIBUTES DLLIMPORT::/MPIPRIV2/
+ # CDEC\$ATTRIBUTES DLLIMPORT::/MPIPRIVC/
+ # CMS is for the Microsoft compiler,
+ # CDEC is (we believe) for the DEC Fortran compiler.
+ # We need to make this a configure-time variable because some compilers
+ # (in particular, a version of the Intel Fortran compiler for Linux)
+ # will read directives for other compilers and then flag as fatal
+ # errors directives that it does not support but does recognize.
+
+ DLLIMPORT=""
+ AC_SUBST(DLLIMPORT)
+
+ # FIXME:
+ # We also need to include
+ # SIZEOF_FC_MPI_OFFSET
+ # SIZEOF_FC_MPI_AINT
+ #
+ # If other "kinds" are supported, MPI_SIZEOF needs to identify
+ # those as well. This is very difficult to do in a general way.
+
+ # To start with, we use the sizes determined for the Fortran 77 values.
+ # These must be the same as for the Fortran 90 values.
+ CROSS_F90_SIZEOF_INTEGER=${CROSS_F90_SIZEOF_INTEGER:-0}
+ CROSS_F90_SIZEOF_REAL=${CROSS_F90_SIZEOF_REAL:-0}
+ CROSS_F90_SIZEOF_DOUBLE_PRECISION=${CROSS_F90_SIZEOF_DOUBLE_PRECISION:-0}
+ SIZEOF_FC_INTEGER=$CROSS_F90_SIZEOF_INTEGER
+ SIZEOF_FC_REAL=$CROSS_F90_SIZEOF_REAL
+ SIZEOF_FC_CHARACTER=1
+ SIZEOF_FC_DOUBLE_PRECISION=$CROSS_F90_SIZEOF_DOUBLE_PRECISION
+ if test "$pac_cv_f77_sizeof_integer" -gt 0 -a \
+ "$SIZEOF_FC_INTEGER" = "0" ; then
+ SIZEOF_FC_INTEGER=$pac_cv_f77_sizeof_integer
+ fi
+ if test "$pac_cv_f77_sizeof_real" -gt 0 -a "$SIZEOF_FC_REAL" = "0" ; then
+ SIZEOF_FC_REAL=$pac_cv_f77_sizeof_real
+ fi
+ if test "$pac_cv_f77_sizeof_double_precision" -gt 0 -a \
+ "$SIZEOF_FC_DOUBLE_PRECISION" = "0" ; then
+ SIZEOF_FC_DOUBLE_PRECISION=$pac_cv_f77_sizeof_double_precision
+ fi
+ AC_SUBST(SIZEOF_FC_INTEGER)
+ AC_SUBST(SIZEOF_FC_REAL)
+ AC_SUBST(SIZEOF_FC_DOUBLE_PRECISION)
+ AC_SUBST(SIZEOF_FC_CHARACTER)
+
+ # REQD is short for "real equal double precision" and is set to the
+ # Fortran 90 comment character if true. This is necessary to
+ # allow the mpi_sizeofs module to be built, since if this part of the
+ # Fortran standard is violated by the compiler (unfortunately common,
+ # as some applications are written to require this non-standard
+ # version), the double precision versions of the MPI_SIZEOF routine
+ # must be commented out of the module (!).
+ REQD=
+ if test "$SIZEOF_FC_REAL" = "$SIZEOF_FC_DOUBLE_PRECISION" ; then
+ REQD="!"
+ fi
+ AC_SUBST(REQD)
+ # Is integer*1 supported, and is it a different size than integer?
+ REQI1="!"
+ if test "$pac_cv_fort_integer1" = yes -a "$SIZEOF_FC_INTEGER" != 1 ; then
+ REQI1=
+ fi
+ AC_SUBST(REQI1)
+ # Is integer*2 supported, and is it a different size than integer?
+ REQI2="!"
+ if test "$pac_cv_fort_integer2" = yes -a "$SIZEOF_FC_INTEGER" != 2 ; then
+ REQI2=
+ fi
+ AC_SUBST(REQI2)
+ # Is integer*8 supported, and is it a different size than integer?
+ REQI8="!"
+ if test "$pac_cv_fort_integer8" = yes -a "$SIZEOF_FC_INTEGER" != 8 ; then
+ REQI8=
+ fi
+ AC_SUBST(REQI8)
+ #
+
+ AC_LANG_C
+fi
+# ----------------------------------------------------------------------------
+# C++ types
+if test "$enable_cxx" = "yes" ; then
+ AC_LANG_CPLUSPLUS
+ AC_CHECK_SIZEOF(bool)
+
+ # Find a C type that matches the size of the C++ boolean type
+ case "$ac_cv_sizeof_bool" in
+ $ac_cv_sizeof__Bool)
+ bool_type=_Bool
+ ;;
+ $ac_cv_sizeof_unsigned_char)
+ bool_type="unsigned char"
+ ;;
+ $ac_cv_sizeof_unsigned_short)
+ bool_type="unsigned short"
+ ;;
+ $ac_cv_sizeof_unsigned_int)
+ bool_type="unsigned int"
+ ;;
+ $ac_cv_sizeof_unsigned_long)
+ bool_type="unsigned long"
+ ;;
+ $ac_cv_sizeof_unsigned_long_long)
+ bool_type="unsigned long long"
+ ;;
+ *)
+ AC_MSG_ERROR([unable to determine matching C type for C++ bool])
+ ;;
+ esac
+ AC_DEFINE_UNQUOTED([MPIR_CXX_BOOL_CTYPE],[$bool_type],
+ [a C type used to compute C++ bool reductions])
+
+ AC_CHECK_HEADER(complex)
+ if test "$ac_cv_header_complex" = "yes" ; then
+ # The C++ complex types are all templated. We finagle this by
+ # defining a standin name
+ AC_CHECK_SIZEOF(Complex,0,[#include <stdio.h>
+#include <complex>
+using namespace std;
+#define Complex complex<float>
+])
+ AC_CHECK_SIZEOF(DoubleComplex,0,[#include <stdio.h>
+#include <complex>
+using namespace std;
+#define DoubleComplex complex<double>
+])
+ if test "$MPID_NO_LONG_DOUBLE" != yes ; then
+ AC_CHECK_SIZEOF(LongDoubleComplex,0,[#include <stdio.h>
+#include <complex>
+using namespace std;
+#define LongDoubleComplex complex<long double>
+])
+ fi
+
+ # If either complex or double complex have length 0, then mark
+ # c++ complex as unavailable
+ if test "$ac_cv_sizeof_Complex" != 0 -a \
+ "$ac_cv_sizeof_DoubleComplex" != 0 ; then
+ AC_DEFINE(HAVE_CXX_COMPLEX,1,[Define is C++ supports complex types])
+ fi
+
+ # Datatypes are given by
+ # 0x4c00 <length in bytes> (1 byte) <unique num> (1 byte)
+ # where the unique nums are
+ # 33,34,35,36
+ case "$ac_cv_sizeof_bool" in
+ 1) MPIR_CXX_BOOL=0x4c000133 ;;
+ 2) MPIR_CXX_BOOL=0x4c000233 ;;
+ 4) MPIR_CXX_BOOL=0x4c000433 ;;
+ 8) MPIR_CXX_BOOL=0x4c000833 ;;
+ *) ;;
+ esac
+ case "$ac_cv_sizeof_Complex" in
+ 8) MPIR_CXX_COMPLEX=0x4c000834 ;;
+ 16) MPIR_CXX_COMPLEX=0x4c001034 ;;
+ *) ;;
+ esac
+ case "$ac_cv_sizeof_DoubleComplex" in
+ 8) MPIR_CXX_DOUBLE_COMPLEX=0x4c000835 ;;
+ 16) MPIR_CXX_DOUBLE_COMPLEX=0x4c001035 ;;
+ 32) MPIR_CXX_DOUBLE_COMPLEX=0x4c002035 ;;
+ *) ;;
+ esac
+ case "$ac_cv_sizeof_LongDoubleComplex" in
+ 8) MPIR_CXX_LONG_DOUBLE_COMPLEX=0x4c000836 ;;
+ 16) MPIR_CXX_LONG_DOUBLE_COMPLEX=0x4c001036 ;;
+ 24) MPIR_CXX_LONG_DOUBLE_COMPLEX=0x4c001836 ;;
+ 32) MPIR_CXX_LONG_DOUBLE_COMPLEX=0x4c002036 ;;
+ *) ;;
+ esac
+ fi
+ AC_LANG_C
+
+ # Make these available to the collective operations and other code
+ AC_DEFINE_UNQUOTED(MPIR_CXX_BOOL_VALUE,$MPIR_CXX_BOOL,[Define as the MPI Datatype handle for MPI::BOOL])
+ AC_DEFINE_UNQUOTED(MPIR_CXX_COMPLEX_VALUE,$MPIR_CXX_COMPLEX,[Define as the MPI Datatype handle for MPI::COMPLEX])
+ AC_DEFINE_UNQUOTED(MPIR_CXX_DOUBLE_COMPLEX_VALUE,$MPIR_CXX_DOUBLE_COMPLEX,[Define as the MPI Datatype handle for MPI::DOUBLE_COMPLEX])
+ AC_DEFINE_UNQUOTED(MPIR_CXX_LONG_DOUBLE_COMPLEX_VALUE,$MPIR_CXX_LONG_DOUBLE_COMPLEX,[Define as the MPI Datatype handle for MPI::LONG_DOUBLE_COMPLEX])
+
+fi
+
+
+# ----------------------------------------------------------------------------
+# Check for the alignment rules moves with types int64_t etc. These
+# are used in the datatype code to perform pack and unpack operations.
+# These only determine if different alignments *work*, not whether they
+# work efficiently. The datatype pack code (should) allow the developer
+# to include stricter alignment rules than are needed for correctness to
+# get better performance.
+if test "$ac_cv_c_int64_t" != "no" -o -n "$INT64_T" ; then
+ default_int64_t_alignment=${CROSS_INT64_T_ALIGNMENT:-"unknown"}
+ if test -z "$INT64_T" ; then
+ if test "$ac_cv_c_int64_t" = yes ; then
+ INT64_T="int64_t"
+ else
+ INT64_T="$ac_cv_int64_t"
+ fi
+ fi
+ # We use the type that we're going use for int64.
+ AC_CACHE_CHECK([for alignment restrictions on $MYINT64_T],pac_cv_int64_t_alignment,[
+ AC_TRY_RUN([
+#include <sys/types.h>
+#include <stdlib.h>
+int main(int argc, char **argv )
+{
+ $INT64_T *p1, v;
+ char *buf_p = (char *)malloc( 64 ), *bp;
+ bp = buf_p;
+ /* Make bp aligned on 4, not 8 bytes */
+ if (!( (long)bp & 0x7 ) ) bp += 4;
+ p1 = ($INT64_T *)bp;
+ v = -1;
+ *p1 = v;
+ if (!( (long)bp & 0x3 ) ) bp += 2;
+ p1 = ($INT64_T *)bp;
+ *p1 = 1;
+ if (!( (long)bp & 0x1 ) ) bp += 1;
+ p1 = ($INT64_T *)bp;
+ *p1 = 1;
+ return 0;
+}
+],pac_cv_int64_t_alignment=no,pac_cv_int64_t_alignment=yes,pac_cv_int64_t_alignment=$default_int64_t_alignment)
+])
+ if test "$pac_cv_int64_t_alignment" = "no" ; then
+ AC_DEFINE(HAVE_ANY_INT64_T_ALIGNMENT,1,[Define if int64_t works with any alignment])
+ fi
+fi
+
+if test "$ac_cv_int32_t" != "no" ; then
+ default_int32_t_alignment=${CROSS_INT32_T_ALIGNMENT:-"unknown"}
+ if test -z "$INT32_T" ; then
+ if test "$ac_cv_c_int32_t" = yes ; then
+ INT32_T="int32_t"
+ else
+ INT32_T="$ac_cv_int32_t"
+ fi
+ fi
+
+ AC_CACHE_CHECK([for alignment restrictions on int32_t],pac_cv_int32_t_alignment,[
+ AC_TRY_RUN([
+#include <sys/types.h>
+#include <stdlib.h>
+int main(int argc, char **argv )
+{
+ $INT32_T *p1, v;
+ char *buf_p = (char *)malloc( 64 ), *bp;
+ bp = buf_p;
+ /* Make bp aligned on 4, not 8 bytes */
+ if (!( (long)bp & 0x7 ) ) bp += 4;
+ p1 = ($INT32_T *)bp;
+ v = -1;
+ *p1 = v;
+ if (!( (long)bp & 0x3 ) ) bp += 2;
+ p1 = ($INT32_T *)bp;
+ *p1 = 1;
+ if (!( (long)bp & 0x1 ) ) bp += 1;
+ p1 = ($INT32_T *)bp;
+ *p1 = 1;
+ return 0;
+}
+],pac_cv_int32_t_alignment=no,pac_cv_int32_t_alignment=yes,pac_cv_int32_t_alignment=$default_int32_t_alignment)
+])
+ if test "$pac_cv_int32_t_alignment" = "no" ; then
+ AC_DEFINE(HAVE_ANY_INT32_T_ALIGNMENT,1,[Define if int32_t works with any alignment])
+ fi
+fi
+
+# Get the size for the bsendoverhead
+AC_CHECK_SIZEOF(MPIR_Bsend_data_t,128,[
+#define MPI_Datatype int
+#include "${master_top_srcdir}/src/include/mpibsend.h"]
+)
+BSEND_OVERHEAD=$ac_cv_sizeof_MPIR_Bsend_data_t
+export BSEND_OVERHEAD
+AC_SUBST(BSEND_OVERHEAD)
+
+# Check for special compile characteristics
+# If we are either gcc or icc, see if we can use __asm__
+# We test on prog_gcc to allow gcc by any name; if we are using
+# icc, the value of CC must be icc for this test to pass
+if test "$ac_cv_prog_gcc" = "yes" -o "$ac_cv_prog_CC" = "icc" ; then
+AC_MSG_CHECKING([for gcc __asm__ and pentium cmpxchgl instruction])
+AC_TRY_RUN([
+int main(int argc, char *argv[])
+{
+long int compval = 10;
+volatile long int *p = &compval;
+long int oldval = 10;
+long int newval = 20;
+char ret;
+long int readval;
+__asm__ __volatile__ ("lock; cmpxchgl %3, %1; sete %0"
+ : "=q" (ret), "=m" (*p), "=a" (readval)
+ : "r" (newval), "m" (*p), "a" (oldval) : "memory");
+return (compval == 20) ? 0 : -1;
+}
+], AC_MSG_RESULT(yes)
+ AC_DEFINE(HAVE_GCC_AND_PENTIUM_ASM, 1,[Define if using gcc on a system with an Intel Pentium class chip])
+ lac_cv_use_atomic_updates="yes",
+AC_MSG_RESULT(no), AC_MSG_RESULT(not checking when cross compiling))
+fi
+if test "$lac_cv_use_atomic_updates" = "yes" ; then
+ AC_DEFINE(USE_ATOMIC_UPDATES,, [Define if assembly language atomic update macros should be used (if available)])
+fi
+
+# check for x86_64
+if test "$ac_cv_prog_gcc" = "yes" ; then
+AC_MSG_CHECKING([for gcc __asm__ and AMD x86_64 cmpxchgq instruction])
+AC_TRY_RUN([
+int main(int argc, char *argv[])
+{
+long int compval = 10;
+volatile long int *p = &compval;
+long int oldval = 10;
+long int newval = 20;
+char ret;
+long int readval;
+__asm__ __volatile__ ("lock; cmpxchgq %3, %1; sete %0"
+ : "=q" (ret), "=m" (*p), "=a" (readval)
+ : "r" (newval), "m" (*p), "a" (oldval) : "memory");
+return (compval == 20) ? 0 : -1;
+}
+], AC_MSG_RESULT(yes)
+ AC_DEFINE(HAVE_GCC_AND_X86_64_ASM, 1,[Define if using gcc on a system with an AMD x86_64 class chip]),
+AC_MSG_RESULT(no), AC_MSG_RESULT(not checking when cross compiling))
+fi
+dnl
+dnl check for asm() format
+dnl
+dnl AC_MSG_CHECKING([for asm() and pentium cmpxchgl instruction])
+dnl AC_TRY_RUN([
+dnl int main(int argc, char *argv[])
+dnl {
+dnl long int compval = 10;
+dnl volatile long int *p = &compval;
+dnl long int oldval = 10;
+dnl long int newval = 20;
+dnl char ret;
+dnl long int readval;
+dnl asm("lock; cmpxchgl %3, %1; sete %0"
+dnl : "=q" (ret), "=m" (*p), "=a" (readval)
+dnl : "r" (newval), "m" (*p), "a" (oldval) : "memory");
+dnl return (compval == 20) ? 0 : -1;
+dnl }
+dnl ], AC_MSG_RESULT(yes)
+dnl AC_DEFINE(HAVE_PENTIUM_ASM, 1,[Define if using asm() on a system with an Intel Pentium class chip]),
+dnl AC_MSG_RESULT(no), AC_MSG_RESULT(not checking when cross compiling))
+dnl
+dnl
+dnl check for IA64
+dnl
+if test "$ac_cv_prog_gcc" = "yes" ; then
+AC_MSG_CHECKING([for gcc __asm__ and IA64 xchg4 instruction])
+AC_TRY_RUN([
+unsigned long _InterlockedExchange(volatile void *ptr, unsigned long x)
+{
+ unsigned long result;
+ __asm__ __volatile ("xchg4 %0=[%1],%2" : "=r" (result)
+ : "r" (ptr), "r" (x) : "memory");
+ return result;
+}
+int main(int argc, char *argv[])
+{
+long val = 1;
+volatile long *p = &val;
+long oldval = _InterlockedExchange(p, (unsigned long)2);
+return (oldval == 1 && val == 2) ? 0 : -1;
+}
+], AC_MSG_RESULT(yes)
+ AC_DEFINE(HAVE_GCC_AND_IA64_ASM, 1,[Define if using gcc on a system with an IA64 class chip]),
+AC_MSG_RESULT(no), AC_MSG_RESULT(not checking when cross compiling))
+fi
+# -----------------------------------------------------------------------------
+# Check for support of enable-coverage. Put this near the end of the tests
+# because the coverage options may affect the other tests.
+PAC_ENABLE_COVERAGE
+
+# -----------------------------------------------------------------------------
+# Look for Standard headers
+AC_HEADER_STDC
+# Check for a specific header
+# Grrr. OS/X fails the test for sys/uio.h because uio *requires* sys/types.h
+# to compile. Thus, we'll make that a separate test
+# stddef.h is sometimes needed for types like wchar_t
+AC_CHECK_HEADERS(stdlib.h stdarg.h sys/types.h string.h inttypes.h limits.h stddef.h errno.h sys/socket.h sys/time.h unistd.h endian.h assert.h sys/param.h)
+AC_CACHE_CHECK([for sys/uio.h],ac_cv_header_sys_uio_h,[
+AC_TRY_COMPILE([
+#include <sys/types.h>
+#include <sys/uio.h>
+],[int a;],ac_cv_header_sys_uio_h=yes,ac_cv_header_sys_uio_h=no)])
+if test "$ac_cv_header_sys_uio_h" = yes ; then
+ AC_DEFINE(HAVE_SYS_UIO_H,1,[Define if you have the <sys/uio.h> header file.])
+fi
+
+# Check for special types
+AC_TYPE_SIZE_T
+
+# These are used to support timeouts
+AC_CHECK_FUNCS(setitimer alarm)
+# These are used for error reporting
+AC_CHECK_FUNCS(vsnprintf vsprintf)
+if test "$ac_cv_func_vsnprintf" = "yes" ; then
+ # vsnprintf may be declared in stdio.h and may need stdarg.h
+ PAC_FUNC_NEEDS_DECL([#include <stdio.h>
+#include <stdarg.h>],vsnprintf)
+fi
+# We would like to use strerror in the file namepublisher; it is also used
+# in MPIU_Strerror (whose implementation is broken if strerror is not found)
+AC_CHECK_FUNCS(strerror strncasecmp)
+AC_FUNC_STRERROR_R
+if test "$ac_cv_func_strerror_r" = "yes" ; then
+ PAC_FUNC_NEEDS_DECL([#include <string.h>],strerror_r)
+fi
+
+# Use snprintf if possible when creating messages
+AC_CHECK_FUNCS(snprintf)
+if test "$ac_cv_func_snprintf" = "yes" ; then
+ PAC_FUNC_NEEDS_DECL([#include <stdio.h>],snprintf)
+fi
+
+# qsort will be used in MPI_Comm_split, if available
+AC_CHECK_FUNCS([qsort])
+
+# if we are using stdarg, we may need va_copy . Test to see if we have it
+# Since it may be a built-in instead of a function, we must try to
+# compile and link a program that uses it.
+# va_copy is currently used only in src/util/dbg_printf.c, in an obsolete
+# debugging routine. We may want to withdraw this (saving the
+# test in confdb/aclocal_cc.m4).
+AC_CACHE_CHECK([for va_copy],pac_cv_func_va_copy,[
+AC_TRY_LINK([
+#include <stdarg.h>
+void foo1( char *fmt, ... ) {
+ va_list ap, list;
+ va_start(ap,fmt);
+ va_copy(list,ap);
+ va_end(list);
+ va_end(ap);
+}
+],[foo1("a test %d", 3);],pac_cv_func_va_copy=yes,pac_cv_func_va_copy=no)])
+
+if test "$pac_cv_func_va_copy" = "yes" ; then
+ AC_DEFINE(HAVE_VA_COPY,1,[Define if we have va_copy])
+else
+ AC_CACHE_CHECK([for __va_copy],pac_cv_func___va_copy,[
+ AC_TRY_LINK([
+#include <stdarg.h>
+void foo1( char *fmt, ... ) {
+ va_list ap, list;
+ va_start(ap,fmt);
+ __va_copy(list,ap);
+ va_end(list);
+ va_end(ap);
+}
+],[foo1("a test %d", 3);],pac_cv_func___va_copy=yes,pac_cv_func___va_copy=no)])
+ if test "$pac_cv_func___va_copy" = "yes" ; then
+ AC_DEFINE(HAVE___VA_COPY,1,[Define if we have __va_copy])
+ fi
+fi
+
+PAC_C_MACRO_VA_ARGS
+
+dnl
+dnl If internationalization selected, try to find the needed functions
+dnl if test "$enable_internat" = "yes" ; then
+dnl AC_CHECK_HEADERS(libintl.h)
+dnl AC_CHECK_FUNCS(gettext dgettext)
+dnl if test "$ac_cv_header_libintl" = "yes" -a \
+dnl "$ac_cv_func_gettext" = "yes" -a \
+dnl "$ac_cv_func_dgettext" = "yes" ; then
+dnl AC_DEFINE(USE_GETTEXT,1,[Define if messages should use gettext])
+dnl else
+dnl AC_MSG_WARN([Cannot use internationalization because necessary headers and functions are not available])
+dnl fi
+dnl fi
+# Check for alloca function. May set HAVE_ALLOCA_H and HAVE_ALLOCA
+AC_FUNC_ALLOCA
+# We don't use alloca unless USE_ALLOCA is also set.
+AC_ARG_ENABLE(alloca,
+ AC_HELP_STRING([--enable-alloca],
+ [Use alloca to allocate temporary memory if available]),,enable_alloca=no)
+if test "$enable_alloca" = yes ; then
+ AC_DEFINE(USE_ALLOCA,1,[Define if alloca should be used if available])
+fi
+
+if test "$enable_g_mem" != "yes" ; then
+ # Strdup is needed only if memory tracing is not enabled.
+ AC_CHECK_FUNCS(strdup)
+ if test "$ac_cv_func_strdup" = "yes" ; then
+ # Do we need to declare strdup?
+ PAC_FUNC_NEEDS_DECL([#include <string.h>],strdup)
+ fi
+else
+ # search.h is used for fancier output from trmem. Disabled for now,
+ # since the tsearch routines have problematic prototypes.
+ AC_CHECK_HEADERS(search)
+ AC_CHECK_FUNCS(tsearch)
+ # Check that we can compile tsearch without error. Try to compile
+ # it with the header and the char * args
+ if test "$ac_cv_func_tsearch" = "yes" ; then
+ AC_CACHE_CHECK([whether tsearch requires char* args],
+ pac_cv_tsearch_charp,[
+ AC_TRY_COMPILE([#include <search.h>
+ char *tsearch( char *k, char **r, (int (*)())compare ) { return k; }],
+ [int f=0;],pac_cv_tsearch_charp=yes,pac_cv_tsearch_charp=no)])
+ if test "$pac_cv_tsearch_charp" = "yes" ; then
+ # this should consider defining a name with the argument type
+ # so that no further ifdefs are needed
+ AC_DEFINE(USE_TSEARCH_WITH_CHARP,1,[Define if tsearch requires char pointers])
+ fi
+ fi
+ # Note that HPUX and AIX may require _INCLUDE_XOPEN_SOURCE or
+ # _XOPEN_SOURCE be defined respectively.
+fi
+
+# ----------------------------------------------------------------------------
+# Look for some non-posix, but commonly provided functions
+# ----------------------------------------------------------------------------
+# mkstemp() is a better replacement for mktemp()
+AC_HAVE_FUNCS(mkstemp)
+if test "$ac_cv_func_mkstemp" = "yes" ; then
+ PAC_FUNC_NEEDS_DECL([#include <stdlib.h>],mkstemp)
+fi
+# fdopen() converts from an fd to a FILE*
+AC_HAVE_FUNCS(fdopen)
+if test "$ac_cv_func_fdopen" = "yes" ; then
+ PAC_FUNC_NEEDS_DECL([#include <stdlib.h>],fdopen)
+fi
+# putenv() sets environment variable
+AC_HAVE_FUNCS(putenv)
+if test "$ac_cv_func_putenv" = "yes" ; then
+ PAC_FUNC_NEEDS_DECL([#include <stdlib.h>],putenv)
+fi
+
+
+# ----------------------------------------------------------------------------
+# Support for timers. The following code processes the
+# --enable-timer-type=name argument and selects the timer based on
+# both that field and what configure is able to determine is available.
+# The file src/include/mpichtimer.h is also created.
+# Note that at least the handling of the "device" option must come *after*
+# the setup_device script is loaded so that the device can set the appropriate
+# fields. For now, we've split this so that there is an update to the timer
+# after the setup_device script is loaded, but we should consider moving
+# this entire block.
+# FIXME DJG setup_device has been eliminated in favor of subconfigure.m4 files
+# ----------------------------------------------------------------------------
+# Default type for timer stamp.
+MPID_TIMER_TYPE=long
+AC_SUBST(MPID_TIMER_TYPE)
+
+# clock_gettime is the POSIX gettimeofday
+# gethrtime is the Solaris high-resolution timer
+dnl
+dnl Specific checks that a function works correctly
+dnl
+dnl Now that we know what the options are, choose the timer to use
+dnl
+dnl The default preference is
+dnl Solaris gethrtime
+dnl Posix clock_gettime
+dnl Unix gettimeofday (one of two versions)
+dnl
+dnl Also available are various hardware time stamps
+dnl Linux-x86 cycle counter
+dnl Linux-alpha cycle counter
+dnl
+dnl We also allow --enable-timer-type=name to select a timer type
+AC_ARG_ENABLE(timer-type,
+[ --enable-timer-type=name - Select the timer to use for MPI_Wtime and
+ internal timestamps.
+ gethrtime - Solaris timer (Solaris systems only)
+ clock_gettime - Posix timer (where available)
+ gettimeofday - Most Unix systems
+ linux86_cycle - Linux x86; returns cycle counts, not time in seconds*
+ gcc_ia64_cycle - IPF ar.itc timer*
+ mach_absolute_time - Mach absolute time (alternative to clock_gettime
+ for OSX)
+ device - The timer is provided by the device
+
+ *Note that the cycle timers are intended to be used by MPICH2
+ developers for internal low-level timing. Normal users should
+ not use these as they are not guaranteed to be accurate in
+ certain situations.
+
+ linuxalpha_cycle is no longer supported.
+],timer_type=$enable_timer_type)
+
+if test -z "$timer_type" ; then
+ # Try to pick a timer based on what is available
+ AC_CHECK_FUNCS(clock_gettime clock_getres gethrtime mach_absolute_time gettimeofday)
+ if test "$ac_cv_func_gethrtime" = "yes" ; then
+ # Sigh. The Solaris include files do not define hrtime_t
+ # Before we accept this choice, make sure that we can
+ # do arithmetic with hrtime_t .
+ AC_CACHE_CHECK([that hrtime_t is properly defined for gethrtime],
+ pac_cv_hrtime_works,[
+ AC_TRY_COMPILE([
+#include <sys/time.h>
+],[hrtime_t t1, t2; t1 = 1; t2 = 2; t1 = t1 + t2;],
+pac_cv_hrtime_works=yes,pac_cv_hrtime_works=no)])
+ # A more ambitious test would look to see if casting an
+ # hrtime_t to int64_t works, and even more ambitious
+ # would check whether long or long long was 64 bits (or even
+ # better, the sizeof hrtime_t).
+ fi
+ if test "$ac_cv_func_gethrtime" = "yes" -a \
+ "$pac_cv_hrtime_works" = "yes" ; then
+ timer_type=gethrtime
+ elif test "$ac_cv_func_clock_gettime" = "yes" -a \
+ "$ac_cv_func_clock_getres" = "yes" ; then
+ # Test on both because some systems (e.g., cygwin) provide
+ # clock_gettime but not clock_getres
+ timer_type=clock_gettime
+ elif test "$ac_cv_func_mach_absolute_time" = "yes" ; then
+ timer_type=mach_absolute_time
+ elif test "$ac_cv_func_gettimeofday" = "yes" ; then
+ timer_type=gettimeofday
+ fi
+fi
+if test -z "$timer_type" ; then
+ AC_MSG_ERROR([No timer found])
+fi
+
+# Check for valid timer and select datatypes for the time stamp
+case "$timer_type" in
+
+ gethrtime)
+ MPID_TIMER_TYPE=hrtime_t
+ AC_CHECK_FUNC(gethrtime,,[
+ AC_MSG_ERROR([Requested timer gethrtime is not available])
+])
+ ;;
+
+ clock_gettime)
+ missing_function=no
+ AC_SEARCH_LIBS([clock_gettime],[rt],,AC_MSG_ERROR([clock_gettime is not available]))
+ AC_SEARCH_LIBS([clock_getres],[rt],,AC_MSG_ERROR([clock_getres is not available]))
+ MPID_TIMER_TYPE="struct timespec"
+ # AIX does not always define struct timespec (!)
+ # Make sure that we can use struct timespec
+ AC_CACHE_CHECK([whether struct timespec is defined in time.h],
+ pac_cv_struct_timespec_defined,[
+ AC_TRY_COMPILE([
+#include <time.h>],[
+ struct timespec t;],pac_cv_struct_timespec_defined=yes,
+ pac_cv_struct_timespec_defined=no)
+])
+ if test "$pac_cv_struct_timespec_defined" != "yes" ; then
+ # Try again, but with -D_XOPEN_SOURCE=500 (works for AIX)
+ AC_CACHE_CHECK([whether struct timespec is defined in time.h with _XOPEN_SOURCE=500],
+ pac_cv_struct_timespec_defined_with_xopen500,[
+ AC_TRY_COMPILE([
+#define _XOPEN_SOURCE 500
+#include <time.h>],[
+ struct timespec t;],pac_cv_struct_timespec_defined_with_xopen500=yes,
+ pac_cv_struct_timespec_defined_with_xopen500=no)
+])
+ if test "$pac_cv_struct_timespec_defined_with_xopen500" = "yes" ; then
+ # We need to define _XOPEN_SOURCE=500, but we need to ensure that
+ # this is done before any include files are loaded. At
+ # this point it is really too late to add this definition,
+ # since it may make other tests incompatible.
+ AC_MSG_ERROR([The available timer requires _XOPEN_SOURCE=500. Add -D_XOPEN_SOURCE=500 to CFLAGS and rerun configure])
+ fi
+ fi
+ #
+ # FreeBSD 4.3 incorrectly puts the header into sys/time.h;
+ # time.h is required (see pages 45 and 46 in the POSIX standard).
+ # See if we can compile
+ AC_CACHE_CHECK([for CLOCK_REALTIME defined in time.h],pac_cv_posix_clock_realtime,[
+ AC_TRY_COMPILE([
+#include <time.h>],[
+ clockid_t cid = CLOCK_REALTIME;],pac_cv_posix_clock_realtime=yes,
+pac_cv_posix_clock_realtime=no)])
+ if test "$pac_cv_posix_clock_realtime" = "no" ; then
+ AC_MSG_WARN([POSIX timer requires definitions in time.h])
+ # Check for the definition in sys/time.h, which is where
+ # OpenBSD and FreeBSD have put it by mistake
+ AC_TRY_COMPILE([
+#include <time.h>
+#include <sys/time.h>],[
+ clockid_t cid = CLOCK_REALTIME;],pac_cv_posix_clock_realtime=yes,
+pac_cv_posix_clock_realtime=no)
+ if test "$pac_cv_posix_clock_realtime" = yes ; then
+ AC_MSG_WARN([sys/time.h required for POSIX timer])
+ AC_DEFINE(NEEDS_SYS_TIME_H,1,[Define if sys/time.h is required to get timer definitions])
+ else
+ AC_MSG_ERROR([Cannot find the definition of CLOCK_REALTIME for the POSIX timer])
+ fi
+ fi
+ ;;
+
+ gettimeofday)
+ MPID_TIMER_TYPE="struct timeval"
+ # We may have already tested for gettimeofday. If we got a "yes",
+ # we're good to go
+ if test "$ac_cv_func_gettimeofday" != "yes" ; then
+ AC_CHECK_FUNC(gettimeofday,,[
+ AC_MSG_ERROR([Requested timer gettimeofday is not available])
+])
+ fi
+ ;;
+
+ linux86_cycle|linux86_cycle_2)
+
+# The following AC_TRY_RUN statements are needed because x86_64 compilers
+# usually know about rdtscp but the cpu may or may not actually implement the
+# feature. This is not cross-compile safe, unfortunately. In the long run we
+# should allow the user to override this with a configure flag.
+ AC_CACHE_CHECK([that linux86 cycle counter is available],
+ pac_cv_linux86_cycle,
+ AC_TRY_RUN([
+int main()
+{
+ /* rdtscp */
+ long long var, *var_ptr=&var;
+ __asm__ __volatile__("rdtscp; shl \$32, %%rdx; or %%rdx, %%rax" : "=a" (*var_ptr) : : "ecx", "rdx");
+ return 0;
+}
+ ],pac_cv_linux86_cycle=rdtscp,
+ AC_TRY_RUN([[
+int main()
+{
+ /* cpuid 64 */
+ long long var, *var_ptr=&var;
+ __asm__ __volatile__("push %%rbx ; cpuid ; rdtsc ; pop %%rbx ; shl $32, %%rdx; or %%rdx, %%rax" : "=a" (*var_ptr) : : "ecx", "rdx");
+ return 0;
+}
+ ]],pac_cv_linux86_cycle=cpuid_rdtsc64,
+ AC_TRY_RUN([[[
+int main()
+{
+ /* cpuid 32 */
+ long long var, *var_ptr=&var;
+ __asm__ __volatile__("push %%ebx ; cpuid ; rdtsc ; pop %%ebx" : "=A" (*var_ptr) : : "ecx");
+ return 0;
+}
+ ]]],pac_cv_linux86_cycle=cpuid_rdtsc32,
+ AC_TRY_RUN([[[[
+int main()
+{
+ /* simple */
+ long long var, *var_ptr=&var;
+ __asm__ __volatile__("rdtsc" : "=A" (*var_ptr));
+ return 0;
+}
+ ]]]],pac_cv_linux86_cycle=rdtsc,
+ pac_cv_linux86_cycle=no)
+ )
+ ),
+dnl The if-cross-compiling clause from the first AC_TRY_RUN. Hope that if the
+dnl compiler knows about the instruction then it's supported by the target
+dnl platform.
+ AC_TRY_COMPILE(,[[
+ long long var, *var_ptr=&var;
+ __asm__ __volatile__("rdtscp; shl \$32, %%rdx; or %%rdx, %%rax" : "=a" (*var_ptr) : : "ecx", "rdx");
+ ]],pac_cv_linux86_cycle=rdtscp,
+ AC_TRY_COMPILE(,[[[
+ long long var, *var_ptr=&var;
+ __asm__ __volatile__("push %%rbx ; cpuid ; rdtsc ; pop %%rbx ; shl $32, %%rdx; or %%rdx, %%rax" : "=a" (*var_ptr) : : "ecx", "rdx");
+ ]]],pac_cv_linux86_cycle=cpuid_rdtsc64,
+ AC_TRY_COMPILE(,[[[[
+ long long var, *var_ptr=&var;
+ __asm__ __volatile__("push %%ebx ; cpuid ; rdtsc ; pop %%ebx" : "=A" (*var_ptr) : : "ecx");
+ ]]]],pac_cv_linux86_cycle=cpuid_rdtsc32,
+ AC_TRY_COMPILE(,[[[[[
+ long long var, *var_ptr=&var;
+ __asm__ __volatile__("rdtsc" : "=A" (*var_ptr));
+ ]]]]],pac_cv_linux86_cycle=rdtsc,
+ pac_cv_linux86_cycle=no)
+ )
+ )
+ )
+ )
+ )
+
+ case "$pac_cv_linux86_cycle" in
+ "rdtscp")
+ AC_DEFINE(LINUX86_CYCLE_RDTSCP,1,[Define which x86 cycle counter to use])
+ ;;
+ "cpuid_rdtsc64")
+ AC_DEFINE(LINUX86_CYCLE_CPUID_RDTSC64,1,[Define which x86 cycle counter to use])
+ ;;
+ "cpuid_rdtsc32")
+ AC_DEFINE(LINUX86_CYCLE_CPUID_RDTSC32,1,[Define which x86 cycle counter to use])
+ ;;
+ "rdtsc")
+ AC_DEFINE(LINUX86_CYCLE_RDTSC,1,[Define which x86 cycle counter to use])
+ ;;
+ *)
+ cpu_gcc_x86_cycle=no
+ ;;
+ esac
+
+ if test "$cpu_gcc_x86_cycle" = "no" ; then
+ AC_MSG_ERROR([Linux86 cycle counter is not available on this system and or with the $CC compiler])
+ fi
+ MPID_TIMER_TYPE="long long"
+ ;;
+
+ gcc_ia64_cycle)
+ AC_CACHE_CHECK([that IPF timer is available],
+pac_cv_ia64_cycle,[
+ AC_TRY_COMPILE(,[
+ long var, *var_ptr=&var;
+#ifdef __INTEL_COMPILER
+#include "ia64regs.h"
+ var=__getReg(_IA64_REG_AR_ITC);
+#else
+ __asm__ __volatile__("mov %0=ar.itc" : "=r" (var_ptr));
+#endif
+],pac_cv_gcc_ia64_cycle=yes,pac_cv_gcc_ia64_cycle=no)])
+ if test "$pac_cv_gcc_ia64_cycle" != "yes" ; then
+ AC_MSG_ERROR([IPF cycle counter is not available on this system and or with the $CC compiler])
+ fi
+ MPID_TIMER_TYPE="long"
+ ;;
+
+ linuxalpha_cycle)
+ AC_MSG_ERROR([linuxalpha_cycle is no longer supported])
+ ;;
+
+ mach_absolute_time)
+ AC_CHECK_FUNC(mach_absolute_time,,[AC_MSG_ERROR([mach_absolute_time is not available])])
+ AC_CHECK_FUNC(mach_timebase_info,,[AC_MSG_ERROR([mach_timebase_info is not available])])
+ MPID_TIMER_TYPE="uint64_t"
+ ;;
+
+ device)
+ # The device selected should export the datatype for the timer
+ # in MPID_DEVICE_TIMER_TYPE if something other than long is needed
+ if test -n "$MPID_DEVICE_TIMER_TYPE" ; then
+ MPID_TIMER_TYPE=$MPID_DEVICE_TIMER_TYPE
+ fi
+ ;;
+
+ *)
+ AC_MSG_ERROR([Invalid timer type $timer_type])
+ ;;
+esac
+# Convert timer type to upper case
+timer_type=`echo $timer_type | \
+ tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
+MPICH_TIMER_KIND=USE_$timer_type
+AC_SUBST(MPICH_TIMER_KIND)
+# ----------------------------------------------------------------------------
+# End of code for timer support (except for ac_ OUTPUT)
+# ----------------------------------------------------------------------------
+# Setup other replaceable values
+AC_SUBST(MPILIBNAME)
+AC_SUBST(PMPILIBNAME)
+
+if test "$NEEDSPLIB" = "yes" ; then
+ LPMPILIBNAME="-l${PMPILIBNAME}"
+fi
+AC_SUBST(LPMPILIBNAME)
+
+# Note that aint_size must be used instead of void_p where the desired check
+# is on the size of MPI_Aint
+aint_size=$ac_cv_sizeof_void_p
+if test "$with_aint_size" -gt 0 ; then
+ aint_size=$with_aint_size
+ if test "$aint_size" != "$ac_cv_sizeof_void_p" ; then
+ AC_MSG_RESULT([Overriding MPI_Aint to be $aint_size bytes])
+ fi
+fi
+MPI_AINT=int
+for type in int long long_long short ; do
+ eval len=\$ac_cv_sizeof_$type
+ if test "$len" = "$aint_size" ; then
+ MPI_AINT=`echo $type | sed -e 's/_/ /'`
+ # Make the sizeof AINT available to other configures
+ MPI_SIZEOF_AINT=$len
+ export MPI_SIZEOF_AINT
+ case $type in
+ int)
+ MPI_AINT_FMT_DEC_SPEC="%d"
+ MPI_AINT_FMT_HEX_SPEC="%x"
+ ;;
+ long)
+ MPI_AINT_FMT_DEC_SPEC="%ld"
+ MPI_AINT_FMT_HEX_SPEC="%lx"
+ ;;
+ long_long)
+ MPI_AINT_FMT_DEC_SPEC="%lld"
+ MPI_AINT_FMT_HEX_SPEC="%llx"
+ ;;
+ short)
+ MPI_AINT_FMT_DEC_SPEC="%hd"
+ MPI_AINT_FMT_HEX_SPEC="%hx"
+ ;;
+ *)
+ AC_MSG_WARN([unable to determine format specifiers for MPI_Aint, defaulting to int])
+ MPI_AINT_FMT_DEC_SPEC="%d"
+ MPI_AINT_FMT_HEX_SPEC="%x"
+ ;;
+ esac
+ export MPI_AINT_FMT_DEC_SPEC MPI_AINT_FMT_HEX_SPEC
+ break
+ fi
+done
+AC_SUBST(MPI_AINT)
+AC_SUBST(MPI_AINT_FMT_DEC_SPEC)
+AC_SUBST(MPI_AINT_FMT_HEX_SPEC)
+
+# If sizeof(mpi_aint) = sizeof(int), set this value
+if test "$ac_cv_sizeof_int" = "$aint_size" ; then
+ AC_DEFINE(SIZEOF_INT_IS_AINT,1,[define if sizeof(int) = sizeof(MPI_Aint)])
+fi
+
+# Find a pointer-sized int
+for type in int long long_long short ; do
+ eval len=\$ac_cv_sizeof_$type
+ if test "$len" = "$ac_cv_sizeof_void_p" ; then
+ case $type in
+ int)
+ MPIR_PINT_FMT_DEC_SPEC="\"%d\""
+ MPIR_UPINT_FMT_DEC_SPEC="\"%u\""
+ ;;
+ long)
+ MPIR_PINT_FMT_DEC_SPEC="\"%ld\""
+ MPIR_UPINT_FMT_DEC_SPEC="\"%lu\""
+ ;;
+ long_long)
+ MPIR_PINT_FMT_DEC_SPEC="\"%lld\""
+ MPIR_UPINT_FMT_DEC_SPEC="\"%llu\""
+ ;;
+ short)
+ MPIR_PINT_FMT_DEC_SPEC="\"%hd\""
+ MPIR_UPINT_FMT_DEC_SPEC="\"%hu\""
+ ;;
+ *)
+ AC_MSG_WARN([unable to determine format specifiers for MPIR_Pint, defaulting to int])
+ MPIR_PINT_FMT_DEC_SPEC="\"%d\""
+ MPIR_UPINT_FMT_DEC_SPEC="\"%u\""
+ ;;
+ esac
+ MPIR_PINT=`echo $type | sed -e 's/_/ /'`
+ break
+ fi
+done
+AC_DEFINE_UNQUOTED(MPIR_Pint,$MPIR_PINT,[MPIR_Pint is a pointer-sized integer])
+# allow @MPIR_PINT@ substitution in glue_romio.h
+AC_SUBST([MPIR_PINT])
+
+AC_DEFINE_UNQUOTED(MPIR_PINT_FMT_DEC_SPEC,
+ $MPIR_PINT_FMT_DEC_SPEC,[MPIR_PINT_FMT_DEC_SPEC is the format
+ specifier for printing Pint as a decimal])
+AC_DEFINE_UNQUOTED(MPIR_Upint,unsigned $MPIR_PINT,[MPIR_Upint is an unsigned pointer-sized integer])
+AC_DEFINE_UNQUOTED(MPIR_UPINT_FMT_DEC_SPEC,
+ $MPIR_UPINT_FMT_DEC_SPEC,[MPIR_UPINT_FMT_DEC_SPEC is the format
+ specifier for printing Upint as a decimal])
+
+# ----------------------------------------------------------------------------
+# MPI_AINT datatype
+# ----------------------------------------------------------------------------
+# Must be done after MPI_Aint type determination but before subconfigures.
+
+# convert to 2-char hex size
+case "$MPI_SIZEOF_AINT" in
+ 4) len_mpi_aint=04 ;;
+ 8) len_mpi_aint=08 ;;
+ 16) len_mpi_aint=10 ;;
+ *) AC_MSG_ERROR([Unable to convert MPI_SIZEOF_AINT to a hex string. This is either because we are building on a very strange platform or there is a bug somewhere in configure.]) ;;
+esac
+# MPI_AINT and MPI_OFFSET are already taken, appending a _DATATYPE suffix
+MPI_AINT_DATATYPE=0x4c00${len_mpi_aint}43
+AC_SUBST(MPI_AINT_DATATYPE)
+export MPI_AINT_DATATYPE
+
+# 0x4c000043 is 1275068483 in decimal, add ($MPI_SIZEOF_AINT * 256) and you get
+# the decimal equivalent of the hex number
+MPI_F77_AINT=`expr 1275068483 '+' '(' 256 '*' $MPI_SIZEOF_AINT ')'`
+AC_SUBST(MPI_F77_AINT)
+export MPI_F77_AINT
+# ----------------------------------------------------------------------------
+
+# define MPIU_Size_t - used to express the size of objects
+# This is used in src/include/mpitypedefs.h to define MPIU_SIZE_T,
+# and is used in various parts of ch3 and mpid/common/sock.
+# This is used to handle the potential problem that a message is
+# too long to fit with an int. However, we may still need to make
+# some more adjustments in the code (this may not be used everywhere
+# that it is needed).
+#
+# FIXME: this should really be in a util configure file, but we don't
+# have one at the moment
+#
+MPIU_SIZE_T="unsigned $MPI_AINT"
+AC_DEFINE_UNQUOTED(MPIU_SIZE_T,$MPIU_SIZE_T,[Set to a type that can express the size of the entire address space])
+
+if test "$ac_cv_sizeof_void_p" -lt "$aint_size" ; then
+ AC_DEFINE(USE_AINT_FOR_ATTRVAL,1,[Define if MPI_Aint should be used instead of void * for storing attribute values])
+fi
+#
+# See if we need to update the timer type (which was converted to uppercase)
+if test "$timer_type" = "DEVICE" ; then
+ # The device selected should export the datatype for the timer
+ # in MPID_DEVICE_TIMER_TYPE if something other than long is needed
+ if test -n "$MPID_DEVICE_TIMER_TYPE" ; then
+ MPID_TIMER_TYPE=$MPID_DEVICE_TIMER_TYPE
+ fi
+fi
+
+dnl Configure any subdirectories. Note that config.status will *not*
+dnl reexecute these!
+dnl Export any important variables first:
+dnl
+dnl Gastly problem. CONFIG_SUBDIRS only adds the directories to the
+dnl list of directories to be configured. It does NOT control the
+dnl timing of the configuration. For that, we must do something different.
+dnl Our original solution was to use a separate macro that does cause
+dnl immediate configure; this macro made use of the code that autoconf
+dnl uses to handle the subdir configure. However, later versions of
+dnl autoconf did this in a way that caused problems, paritcularly with
+dnl errors reported as inconsistent cache files. Instead, we simply
+dnl invoke the configure scripts (if present) directly.
+export AR
+export AR_FLAGS
+export RANLIB
+export MPILIBNAME
+export PMPILIBNAME
+export CC
+export CPPFLAGS
+export LIBS
+export CXX
+export CXXFLAGS
+export FFLAGS
+export CFLAGS
+export FCFLAGS
+export LDFLAGS
+# Make sure that any Fortran 77 and Fortran 90 compilers are exported to
+# the subdir builds (in particular, ROMIO may try to use the Fortran 90
+# compiler to determine the Fortran 90 KINDS for MPI_OFFSET_KIND).
+export F77
+export FC
+#
+# -----------------------------------------------------------------------------
+# Configure threads first. This is necessary to obtain all required
+# definitions, flags, and libraries that the other subsystems will need
+#
+#
+# -----------------------------------------------------------------------------
+MPIU_THREAD_DEFAULT=${MPIU_THREAD_DEFAULT:-posix}
+
+AC_ARG_WITH([thread-package],
+[ --with-thread-package=package Thread package to use. Supported thread packages include:
+ posix or pthreads - POSIX threads
+ solaris - Solaris threads (Solaris OS only)
+ win - windows threads
+ none - no threads
+
+ If the option is not specified, the default package is
+ ${MPIU_THREAD_DEFAULT}. If the option is specified, but a package
+ is not given, then the default is posix
+],,with_thread_package=${MPIU_THREAD_DEFAULT})
+
+if test "$with_thread_package" = "yes" ; then
+ with_thread_package=posix
+fi
+
+MPICH2_THREAD_PACKAGE=none
+MPIU_THREAD_PACKAGE_NAME=MPIU_THREAD_PACKAGE_INVALID
+case $with_thread_package in
+ posix|pthreads)
+ with_thread_package=posix
+ AC_CHECK_HEADERS(pthread.h)
+
+ # If pthreads library is found, just include it on the link line. We don't try
+ # to test if the C compiler needs it or not, since the C++ or Fortran
+ # compilers might need it even if the C compiler doesn't
+ # (nvcc with gfortran, for example).
+ #
+ # OSF1 has __pthread_create but not pthread_create (because of
+ # inconsistencies in the pthread spec). Thus, we look for pthread_key_create
+ AC_CHECK_LIB([pthread],[pthread_key_create],have_pthreads=yes)
+ if test "$have_pthreads" = "yes" ; then
+ PAC_PREPEND_FLAG([-lpthread],[LIBS])
+ fi
+
+ AC_CHECK_FUNCS(pthread_yield)
+
+ # this check should come after the AC_CHECK_LIB for -lpthread
+ AC_CHECK_FUNC([pthread_key_create],[],[AC_MSG_ERROR([unable to find pthreads library])])
+
+ # Check for a routine that specify a routine to call on
+ # thread exit. We can use this to release memory that may
+ # be allocated by the MPICH2 library in the thread.
+ # A complication: pthread_cleanup_push may be a macro; in that
+ # case, check_funcs will fail to find it.
+ # Under OSX, pthread_cleanup_push and pop are macros that must
+ # appear together in the same lexical scope, and hence are
+ # really useless in libraries that may allocate data within
+ # a user-managed thread.
+ AC_CHECK_FUNCS(pthread_cleanup_push)
+ if test "$ac_cv_func_pthread_cleanup_push" = "no" ; then
+ AC_CACHE_CHECK([whether pthread_cleanup_push is available (may be a macro in pthread.h)],pac_cv_func_pthread_cleanup_push,[
+ AC_TRY_LINK([
+#include <pthread.h>
+void f1(void *a) { return; }],
+[pthread_cleanup_push( f1, (void *)0 );],
+ pac_cv_func_pthread_cleanup_push=yes,
+ pac_cv_func_pthread_cleanup_push=no)])
+ if test "$pac_cv_func_pthread_cleanup_push" = yes ; then
+ AC_DEFINE(HAVE_PTHREAD_CLEANUP_PUSH_MACRO,1,[Define if pthread_cleanup_push is available, even as a macro])
+ fi
+
+ fi
+ # Check for PTHREAD_MUTEX_RECURSIVE_NP and PTHREAD_MUTEX_RECURSIVE
+ AC_CACHE_CHECK([whether pthread.h defines PTHREAD_MUTEX_RECURSIVE_NP],
+ pac_cv_has_pthread_mutex_recursive_np,[
+ AC_TRY_COMPILE([#include <pthread.h>],
+ [int a=PTHREAD_MUTEX_RECURSIVE_NP;],
+ pac_cv_has_pthread_mutex_recursive_np=yes,
+ pac_cv_has_pthread_mutex_recursive_np=no)])
+ AC_CACHE_CHECK([whether pthread.h defines PTHREAD_MUTEX_RECURSIVE],
+ pac_cv_has_pthread_mutex_recursive,[
+ AC_TRY_COMPILE([#include <pthread.h>],
+ [int a=PTHREAD_MUTEX_RECURSIVE;],
+ pac_cv_has_pthread_mutex_recursive=yes,
+ pac_cv_has_pthread_mutex_recursive=no)])
+ if test "$pac_cv_has_pthread_mutex_recursive_np" = yes ; then
+ AC_DEFINE(HAVE_PTHREAD_MUTEX_RECURSIVE_NP,1,[Define if PTHREAD_MUTEX_RECURSIVE_NP is available in pthread.h])
+ fi
+ if test "$pac_cv_has_pthread_mutex_recursive" = yes ; then
+ AC_DEFINE(HAVE_PTHREAD_MUTEX_RECURSIVE,1,[Define if PTHREAD_MUTEX_RECURSIVE is available in pthread.h])
+ fi
+
+ # Check for PTHREAD_MUTEX_ERRORCHECK_NP and PTHREAD_MUTEX_ERRORCHECK
+ AC_CACHE_CHECK([whether pthread.h defines PTHREAD_MUTEX_ERRORCHECK_NP],
+ pac_cv_has_pthread_mutex_errorcheck_np,[
+ AC_TRY_COMPILE([#include <pthread.h>],
+ [int a=PTHREAD_MUTEX_ERRORCHECK_NP;],
+ pac_cv_has_pthread_mutex_errorcheck_np=yes,
+ pac_cv_has_pthread_mutex_errorcheck_np=no)])
+ AC_CACHE_CHECK([whether pthread.h defines PTHREAD_MUTEX_ERRORCHECK],
+ pac_cv_has_pthread_mutex_errorcheck,[
+ AC_TRY_COMPILE([#include <pthread.h>],
+ [int a=PTHREAD_MUTEX_ERRORCHECK;],
+ pac_cv_has_pthread_mutex_errorcheck=yes,
+ pac_cv_has_pthread_mutex_errorcheck=no)])
+
+ if test "$pac_cv_has_pthread_mutex_errorcheck" = yes ; then
+ AC_DEFINE(PTHREAD_MUTEX_ERRORCHECK_VALUE,PTHREAD_MUTEX_ERRORCHECK,
+ [Define to an expression that will result in an error checking mutex type.])
+ elif test "$pac_cv_has_pthread_mutex_errorcheck_np" = yes ; then
+ AC_DEFINE(PTHREAD_MUTEX_ERRORCHECK_VALUE,PTHREAD_MUTEX_ERRORCHECK_NP,
+ [Define to an expression that will result in an error checking mutex type.])
+ fi
+
+ MPICH2_THREAD_PACKAGE=pthreads
+ MPIU_THREAD_PACKAGE_NAME=MPIU_THREAD_PACKAGE_POSIX
+ ;;
+ solaris)
+ AC_CHECK_HEADERS(thread.h)
+ AC_CHECK_FUNCS(thr_yield)
+ AC_SEARCH_LIBS(thr_create,thread,found=yes,found=no)
+ if test "$found" != "yes" ; then
+ AC_MSG_ERROR([unable to find Solaris threads library])
+ fi
+ # FIXME: need to add -mt if using solaris compilers
+ MPICH2_THREAD_PACKAGE=solaris
+ MPIU_THREAD_PACKAGE_NAME=MPIU_THREAD_PACKAGE_SOLARIS
+ ;;
+ win|windows)
+ with_thread_package=win
+ MPICH2_THREAD_PACKAGE=win
+ MPIU_THREAD_PACKAGE_NAME=MPIU_THREAD_PACKAGE_WIN
+ AC_MSG_ERROR([The 'win' thread package is not supported via autoconf builds at this time.])
+ ;;
+ no|none)
+ with_thread_package=none
+ MPIU_THREAD_PACKAGE_NAME=MPIU_THREAD_PACKAGE_NONE
+ ;;
+ *)
+ AC_MSG_ERROR([The specified thread package, $with_thread_package, is not supported.])
+ ;;
+esac
+
+# Define and export the selected thread library so that other packages,
+# such as MPE, will know what's used in MPICH2
+export MPICH2_THREAD_PACKAGE
+AC_DEFINE_UNQUOTED([MPIU_THREAD_PACKAGE_NAME],[$MPIU_THREAD_PACKAGE_NAME],[set to the name of the thread package])
+
+# check for compiler-support for thread-local storage (MPIU_TLS_SPECIFIER)
+AX_TLS
+
+AC_CHECK_HEADERS(sched.h)
+AC_CHECK_FUNCS(sched_yield yield usleep sleep select getpid)
+
+# Check for the Linux functions for controlling processor affinity.
+# LINUX: sched_setaffinity
+# AIX: bindprocessor
+# OSX (Leopard): thread_policy_set
+AC_CHECK_FUNCS(sched_setaffinity sched_getaffinity bindprocessor thread_policy_set)
+if test "$ac_cv_func_sched_setaffinity" = "yes" ; then
+ # Test for the cpu process set type
+ AC_CACHE_CHECK([whether cpu_set_t available],pac_cv_have_cpu_set_t,[
+ AC_TRY_COMPILE( [
+#include <sched.h>],[ cpu_set_t t; ],pac_cv_have_cpu_set_t=yes,pac_cv_have_cpu_set_t=no)])
+ if test "$pac_cv_have_cpu_set_t" = yes ; then
+ AC_DEFINE(HAVE_CPU_SET_T,1,[Define if cpu_set_t is defined in sched.h])
+
+ AC_CACHE_CHECK([whether the CPU_SET and CPU_ZERO macros are defined],
+ pac_cv_cpu_set_defined,[
+ AC_TRY_LINK( [
+#include <sched.h>],[ cpu_set_t t; CPU_ZERO(&t); CPU_SET(1,&t); ],
+ pac_cv_cpu_set_defined=yes,pac_cv_cpu_set_defined=no)])
+ if test "$pac_cv_cpu_set_defined" = "yes" ; then
+ AC_DEFINE(HAVE_CPU_SET_MACROS,1,[Define if CPU_SET and CPU_ZERO defined])
+ fi
+ # FIXME: Some versions of sched_setaffinity return ENOSYS (!),
+ # so we should test for the unfriendly and useless behavior
+ fi
+fi
+if test "$ac_cv_func_thread_policy_set" = yes ; then
+ AC_CACHE_CHECK([whether thread affinity macros defined],
+ pac_cv_have_thread_affinity_policy,[
+ AC_TRY_COMPILE([#include <mach/thread_policy.h>],[
+#if !defined(THREAD_AFFINITY_POLICY) || !defined(THREAD_AFFINITY_TAG_NULL)
+ :'thread macros not defined
+],pac_cv_have_thread_affinity_policy=yes,
+ pac_cv_have_thread_affinity_policy=no)])
+ if test "$pac_cv_have_thread_affinity_policy" = yes ; then
+ AC_DEFINE(HAVE_OSX_THREAD_AFFINITY,1,[Define is the OSX thread affinity policy macros defined])
+ fi
+fi
+
+MPIU_THREAD_LIB_NAME=${MPILIBNAME}
+AC_SUBST(MPIU_THREAD_LIB_NAME)
+
+# -----------------------------------------------------------------------------
+# End of thread configure
+# -----------------------------------------------------------------------------
+
+
+# Checkpointing
+AC_ARG_ENABLE(checkpointing,
+ [AC_HELP_STRING([--enable-checkpointing], [Enable application checkpointing])],
+ [ if test "$enableval" != "no" ; then
+ PAC_SET_HEADER_LIB_PATH(blcr)
+ PAC_CHECK_HEADER_LIB_FATAL(blcr, libcr.h, cr, cr_init)
+ AC_DEFINE(ENABLE_CHECKPOINTING,1,[Application checkpointing enabled])
+ fi ],
+)
+
+# Update the cache first with the results of the previous configure steps
+# We don't use the subdir cache because ensuring that the cache is consistant
+# with the way in which configure wishes to use it is very difficult and
+# too prone to error.
+dnl PAC_SUBDIR_CACHE(always)
+# -----------------------------------------------------------------------------
+# experiment with creating a cache file
+#if test "$CONF_USE_CACHEFILE" = yes ; then
+# basecachefile=`pwd`/cache.base
+# set | grep ac_cv > $basecachefile
+# # Tell other configures to load this file
+# echo "Creating and exporting the base cache file $basecachefile"
+# CONF_BASE_CACHEFILE=$basecachefile
+# export CONF_BASE_CACHEFILE
+#fi
+PAC_CREATE_BASE_CACHE
+# -----------------------------------------------------------------------------
+
+#
+# Configure the device second. This way, any libraries or variables that
+# it needs can be extracted before building the other subsystems (this is
+# particularly important for the bindings, which may need to know the
+# libraries in order to create the compilation scripts)
+
+user_specified_atomic_primitives=no
+if test "$DEBUG_SUBDIR_CACHE" = yes ; then
+ set -x
+fi
+
+dnl "configure" the device here via subconfigure.m4 files
+m4_map([PAC_SUBCFG_CONFIGURE_SUBSYS], [PAC_SUBCFG_MODULE_LIST])
+
+# now configure any actual recursively configures subsystems, such as ROMIO and
+# hydra, or older components that haven't been updated to a subconfigure.m4 yet
+for subsys in $devsubsystems $subsystems ; do
+ PAC_CONFIG_SUBDIR([$subsys],[],[AC_MSG_ERROR([$subsys configure failed])])
+done
+if test "$DEBUG_SUBDIR_CACHE" = yes -a "$enable_echo" != yes ; then
+ set +x
+fi
+dnl PAC_SUBDIR_CACHE_CLEANUP
+
+## The MPE configure requires MPI_LIBS, and that requires all of the LIBS
+#MPI_LIBS="$MPI_LIBS $LIBS"
+#
+# Get any localdefs that the subsystems created. Use a guard in case
+# the list is empty
+#for dir in $subsystems /dev/null ; do
+# if test -f $dir/localdefs ; then
+# . $dir/localdefs
+# fi
+#done
+#
+# Make subsystems available to makefiles.
+# FIXME does the makefile actually need this?
+subsystems="$devsubsystems $subsystems $bindingsubsystems"
+AC_SUBST(subsystems)
+
+# Find the size of OPA_ptr_t. This step needs to come after the OPA
+# configure above in order to get the size OPA_ptr_t evaluated for
+# this platform.
+AC_CHECK_SIZEOF(OPA_ptr_t,-1,[
+#include "${master_top_srcdir}/src/openpa/src/opa_primitives.h"
+pthread_mutex_t *OPA_emulation_lock;
+])
+
+if test "$enable_f77" != "yes" ; then
+ # These are Fortran datatypes ONLY. Set to null if no Fortran compiler.
+ for name in CHARACTER INTEGER REAL LOGICAL COMPLEX DOUBLE_PRECISION \
+ 2INTEGER 2REAL DOUBLE_COMPLEX 2COMPLEX 2DOUBLE_PRECISION \
+ 2DOUBLE_COMPLEX ; do
+ fullname="MPI_$name"
+ eval $fullname=MPI_DATATYPE_NULL
+ done
+ AC_MSG_WARN([Could not define Fortran MPI datatypes for C])
+ AC_DEFINE(HAVE_NO_FORTRAN_MPI_TYPES_IN_C,1,[Define if the Fortran types are not available in C])
+ # Temporary values for MPI_Fint (need help from the Fortran subsystem)
+ MPI_FINT=int
+fi
+AC_SUBST(MPI_CHARACTER)
+AC_SUBST(MPI_INTEGER)
+AC_SUBST(MPI_REAL)
+AC_SUBST(MPI_LOGICAL)
+AC_SUBST(MPI_COMPLEX)
+AC_SUBST(MPI_DOUBLE_PRECISION)
+AC_SUBST(MPI_2INTEGER)
+AC_SUBST(MPI_2REAL)
+AC_SUBST(MPI_DOUBLE_COMPLEX)
+AC_SUBST(MPI_2DOUBLE_PRECISION)
+AC_SUBST(MPI_2COMPLEX)
+AC_SUBST(MPI_2DOUBLE_COMPLEX)
+AC_SUBST(MPI_FINT)
+
+# If ROMIO was successfully configured, then ROMIO will have exported the
+# definition of MPI_OFFSET_TYPE through its localdefs file (created by the
+# ROMIO configure in src/mpi/romio/localdefs). If MPI_OFFSET_TYPE was not
+# defined, this code attempts to find a good choice for MPI_OFFSET_TYPE
+# (As the offset type is used for File operations, the specific type
+# really doesn't matter if ROMIO doesn't provide it).
+if test -n "$MPI_OFFSET_TYPE" ; then
+ # We got the value from the ROMIO configure
+ MPI_OFFSET="$MPI_OFFSET_TYPE"
+ # Get and export the size of this type if possible
+ if test -z "$MPI_SIZEOF_OFFSET" ; then
+ # set a default
+ AC_CACHE_CHECK([the sizeof MPI_Offset],ac_cv_sizeof_MPI_Offset,[
+ ac_cv_sizeof_MPI_Offset=unknown
+ AC_COMPUTE_INT([ac_cv_sizeof_MPI_Offset],[sizeof($MPI_OFFSET)],[],[
+ AC_MSG_WARN([Unable to determine the size of MPI_Offset])
+ ])
+ ])
+ if test "$ac_cv_sizeof_MPI_Offset" != "unknown" ; then
+ MPI_SIZEOF_OFFSET=$ac_cv_sizeof_MPI_Offset
+ fi
+ fi
+ export MPI_SIZEOF_OFFSET
+else
+ # Make a guess at the appropriate definition for offset. Try to
+ # find a 64bit type.
+ if test "$ac_cv_sizeof_long" = 8 ; then
+ MPI_OFFSET="long"
+ # Make the size of this type available to other configures
+ MPI_SIZEOF_OFFSET=8
+ elif test "$ac_cv_sizeof_long_long" = 8 ; then
+ MPI_OFFSET="long long"
+ # Make the size of this type available to other configures
+ MPI_SIZEOF_OFFSET=8
+ else
+ MPI_OFFSET=long
+ MPI_SIZEOF_OFFSET=$ac_cv_sizeof_long
+ fi
+ export MPI_SIZEOF_OFFSET
+fi
+AC_SUBST(MPI_OFFSET)
+#
+# FIXME: we need an explanation of why we need both MPI_OFFSET and
+# MPI_OFFSET_TYPEDEF. Why is MPI_OFFSET_TYPEDEF necessary?
+# This appears to be used by the Windows "winconfigure.wsf" which is used
+# to create a multiline definition using an #ifdef check on USE_GCC
+# We may wish to use a different approach
+MPI_OFFSET_TYPEDEF="typedef $MPI_OFFSET MPI_Offset;"
+AC_SUBST(MPI_OFFSET_TYPEDEF)
+#
+# Fortran type for an Offset type (needed to define MPI_DISPLACEMENT_CURRENT
+# The value for this comes from ROMIO, and is needed in mpif.h.in
+# First, we check that this works with both Fortran compilers (if
+# they are defined)
+#
+# If there is no FORTRAN_MPI_OFFSET type (because ROMIO is disabled),
+# just use INTEGER
+if test -z "$FORTRAN_MPI_OFFSET" ; then
+ FORTRAN_MPI_OFFSET=INTEGER
+fi
+if test "$enable_f77" = yes -a "$enable_fc" = yes ; then
+ AC_LANG_PUSH([Fortran 77])
+ AC_MSG_CHECKING([whether the Fortran Offset type works with Fortran 77])
+ AC_COMPILE_IFELSE([
+ AC_LANG_PROGRAM([],[ $FORTRAN_MPI_OFFSET i])
+ ],[has_f77_offsettype=yes],[has_f77_offsetype=no])
+ AC_MSG_RESULT($has_f77_offsettype)
+ AC_LANG_POP([Fortran 77])
+
+ AC_LANG_PUSH([Fortran])
+ AC_MSG_CHECKING([whether the Fortran Offset type works with Fortran 90])
+ AC_COMPILE_IFELSE([
+ AC_LANG_PROGRAM([],[ $FORTRAN_MPI_OFFSET i])
+ ],[has_fc_offsettype=yes],[has_fc_offsetype=no])
+ AC_LANG_POP([Fortran])
+ AC_MSG_RESULT($has_fc_offsettype)
+
+ if test "$has_f77_offsettype" != yes -o "$has_fc_offsettype" != yes ; then
+ AC_MSG_WARN([mpif.h is not compatible with both $F77 $FFLAGS and $FC $FCFLAGS. We recommend that you set both F77 and FC to the same compiler and reconfigure.])
+ fi
+fi
+AC_SUBST(FORTRAN_MPI_OFFSET)
+#
+
+# ----------------------------------------------------------------------------
+# MPI_OFFSET datatype
+# ----------------------------------------------------------------------------
+# must be done after ROMIO configure step
+case "$MPI_SIZEOF_OFFSET" in
+ 4) len_mpi_offset=04 ;;
+ 8) len_mpi_offset=08 ;;
+ 16) len_mpi_offset=10 ;;
+ *) AC_MSG_ERROR([Unable to convert MPI_SIZEOF_OFFSET to a hex string. This is either because we are building on a very strange platform or there is a bug somewhere in configure.]) ;;
+esac
+MPI_OFFSET_DATATYPE=0x4c00${len_mpi_offset}44
+AC_SUBST(MPI_OFFSET_DATATYPE)
+export MPI_OFFSET_DATATYPE
+
+# 0x4c000044 is 1275068484 in decimal, add ($MPI_SIZEOF_OFFSET * 256) and you get
+# the decimal equivalent of the hex number
+MPI_F77_OFFSET=`expr 1275068484 '+' '(' 256 '*' $MPI_SIZEOF_OFFSET ')'`
+AC_SUBST(MPI_F77_OFFSET)
+export MPI_F77_OFFSET
+# ----------------------------------------------------------------------------
+
+dnl Extra status information, from device subsystem, to be included in the
+dnl declaration of MPI_Status in mpi.h.in
+AC_SUBST(EXTRA_STATUS_DECL)
+
+dnl FIXME XXX DJG does this need to actually be conditional on something?
+dnl previously it was conditional on the successful execution of
+dnl "src/binding/f90/configure" but that would only fail if FC couldn't be
+dnl determined or a bad VPATH build env was detected
+AC_DEFINE(HAVE_FC_TYPE_ROUTINES,1,[Define if Fortran 90 type routines available])
+
+# -----------------------------------------------------------------------------
+# Get the value of MPI_MAX_PROCESSOR_NAME
+if test -z "$MPID_MAX_PROCESSOR_NAME" ; then
+ if test -z "$MPI_MAX_PROCESSOR_NAME" ; then
+ MPI_MAX_PROCESSOR_NAME=128
+ fi
+ AC_MSG_WARN([The $with_device device did not set the maximum size of a processor name, $MPI_MAX_PROCESSOR_NAME being used.])
+else
+ MPI_MAX_PROCESSOR_NAME=$MPID_MAX_PROCESSOR_NAME
+fi
+AC_SUBST(MPI_MAX_PROCESSOR_NAME)
+
+# Add a definition that is used to help support Windows DLLs (used in mpi.h.in)
+MPIU_DLL_SPEC_DEF="#define MPIU_DLL_SPEC"
+AC_SUBST(MPIU_DLL_SPEC_DEF)
+
+dnl We can include external packages at configure/build time by
+dnl adding them to EXTERNAL_SRC_DIRS.
+AC_SUBST(EXTERNAL_SRC_DIRS)
+
+dnl We can configure the test directory after the rest of the configure
+dnl steps because it does not depend on them.
+# set and export values that the test/mpi configure will reference to ensure
+# that the correct decisions are made since this configure happens before the
+# MPICH2 library is built.
+MPICH2_ENABLE_CXX=$enable_cxx
+MPICH2_ENABLE_F77=$enable_f77
+MPICH2_ENABLE_FC=$enable_fc
+export MPICH2_ENABLE_CXX
+export MPICH2_ENABLE_F77
+export MPICH2_ENABLE_FC
+AM_CONDITIONAL([BUILD_CXX_LIB],[test "$enable_cxx" = "yes"])
+AM_CONDITIONAL([BUILD_F77_BINDING],[test "$enable_f77" = "yes"])
+dnl FIXME DJG this has been moved to the f90 bindings subconfigure.m4 for now
+dnl AM_CONDITIONAL([BUILD_F90_LIB],[test "$enable_fc" = "yes"])
+# MPI_SRCDIR gives the test/mpi configure the location of the source
+# files for an MPI implementation
+if test -n "$ac_abs_srcdir" ; then
+ MPI_SRCDIR=$ac_abs_srcdir
+fi
+# Pass these two values with "MPI" names to the test configure
+MPI_NO_SPAWN=$MPID_NO_SPAWN
+export MPI_NO_SPAWN
+MPI_NO_RMA=$MPID_NO_RMA
+export MPI_NO_RMA
+
+AC_CONFIG_SUBDIRS([test/mpi])
+dnl
+dnl Generate the Makefiles from Makefile.in
+dnl Also generate mpi.h from mpi.h.in so that we can eliminate all ifdefs
+dnl from the file.
+dnl
+dnl Run a setup command for any external modules (normally, this is empty)
+dnl Pass a subset of the environment to the invoked process.
+AC_OUTPUT_COMMANDS([
+for prog in $EXTERNAL_SETUPS - ; do
+ if test "$prog" != "-" ; then
+ dir=`dirname $prog`
+ name=`basename $prog`
+ (cd $dir && ./$name)
+ fi
+done],[
+EXTERNAL_SETUPS="$EXTERNAL_SETUPS"
+LIBDIR="$libbuild_dir"
+MPILIBNAME="$MPILIBNAME"
+PMPILIBNAME="$PMPILIBNAME"
+AR="$AR"
+CC="$CC"
+CPPFLAGS="$CPPFLAGS"
+CFLAGS="$CFLAGS"
+export LIBDIR ; export MPILIBNAME ; export AR ; export CC ; export CPPFLAGS
+export PMPILIBNAME
+export CFLAGS
+# For test/mpi/configure
+MPI_SRCDIR=$MPI_SRCDIR
+MPI_NO_SPAWN=$MPID_NO_SPAWN
+export MPI_SRCDIR
+export MPI_NO_SPAWN
+])
+
+if test -z "$includebuild_dir" ; then
+ includebuild_dir=`pwd`/src/include
+fi
+if test -z "$libbuild_dir" ; then
+ libbuild_dir=`pwd`/lib
+fi
+if test -z "$modincbuild_dir" ; then
+ # The include files may be in a different directory from the mpif.h file
+ modincbuild_dir=`pwd`/src/binding/f90
+fi
+
+AC_OUTPUT_COMMANDS([chmod +x doc/mansrc/createhtmlindex])
+
+dnl
+dnl If we rerun configure, place a file in the lib directory with the
+dnl date. We can use this to avoid rebuilding the library when
+dnl a build aborts due to an error (this is intended to help developers)
+AC_OUTPUT_COMMANDS([if [ ! -d lib ] ; then mkdir lib ; fi
+date > lib/newconfig])
+
+AC_OUTPUT_COMMANDS([chmod a+x src/util/dbg/getfuncstack])
+
+AC_OUTPUT_COMMANDS([chmod a+x test/commands/cmdtests])
+
+
+# For the examples, we want to use the scripts to encourage users
+# to use them and to make them work more robustly with shared libraries
+# and, for Fortran 90, any special Fortran 90 module features.
+if test -z "$MPICC" ; then MPICC='$(bindir)/mpicc' ; fi
+if test -z "$MPIF77" ; then MPIF77='$(bindir)/mpif77' ; fi
+if test -z "$MPIFC" ; then MPIFC='$(bindir)/mpif90' ; fi
+if test -z "$MPICXX" ; then MPICXX='$(bindir)/mpicxx' ; fi
+AC_SUBST(MPICC)
+AC_SUBST(MPICXX)
+AC_SUBST(MPIF77)
+AC_SUBST(MPIFC)
+
+AC_DEFINE(HAVE_MPICHCONF,1,[Define so that we can test whether the mpichconf.h file has been included])
+
+# Add the LDFLAGS/LIBS we got so far to WRAPPERs
+WRAPPER_LDFLAGS="$WRAPPER_LDFLAGS $LDFLAGS"
+WRAPPER_LIBS="$WRAPPER_LIBS $LIBS"
+
+if test "$USE_PMI2_API" = "yes" ; then
+ AC_DEFINE(USE_PMI2_API, 1, [Define if PMI2 API must be used])
+fi
+
+########################################################################
+
+# cause libtool script to be built now so that we can use it to test one last
+# linking issue on Darwin
+LT_OUTPUT
+
+if test "X$enable_f77" = "Xyes" -a "X$enable_shared" = "Xyes" ; then
+ AS_CASE([$host],
+ [*-*-darwin*],
+ [
+ # TODO, move this into a PAC macro with real autoconf caching
+ pac_cv_wl_commons_use_dylibs_works=no
+ AC_MSG_CHECKING([if the F77 compiler accepts -Wl,-commons,use_dylibs])
+ AC_LANG_PUSH([Fortran 77])
+ PAC_PUSH_FLAG([LDFLAGS])
+ PAC_APPEND_FLAG([-Wl,-commons,use_dylibs], [LDFLAGS])
+ AC_LINK_IFELSE([AC_LANG_PROGRAM([],[ INTEGER i])],
+ [AC_MSG_RESULT([yes])
+ pac_cv_wl_commons_use_dylibs_works=yes],
+ [AC_MSG_RESULT([no])])
+ PAC_POP_FLAG([LDFLAGS])
+ AC_LANG_POP([Fortran 77])
+
+ # Add the flag to the WRAPPER_LDFLAGS, since this common block issue
+ # is really only a problem for dynamically linked user programs.
+ #
+ # Technically we may not be able to use the same form of the argument
+ # for all four compilers (CC/CXX/F77/FC). But we only think this is
+ # necessary for Darwin for now, so this unconditional, single-var
+ # approximation will work for now.
+ if test "X$pac_cv_wl_commons_use_dylibs_works" = "Xyes" ; then
+ PAC_APPEND_FLAG([-Wl,-commons,use_dylibs], [WRAPPER_LDFLAGS])
+ fi
+ ]
+ )
+fi
+
+########################################################################
+
+dnl This includes an experimental pkgconfig file for ch3 in the src/pkgconfig
+dnl directory
+AC_OUTPUT(Makefile \
+ examples/Makefile \
+ test/Makefile \
+ test/commands/Makefile \
+ src/include/mpich2info.h \
+ mpich2-doxygen \
+ src/include/glue_romio.h \
+ src/include/mpichtimer.h \
+ src/binding/cxx/mpicxx.h \
+ src/binding/f77/mpif.h \
+ src/binding/f77/setbotf.f \
+ src/binding/f77/setbot.c \
+ src/binding/f90/mpi_sizeofs.f90 \
+ src/binding/f90/mpi_base.f90 \
+ src/packaging/pkgconfig/mpich2.pc \
+ src/packaging/envmods/mpich2.module \
+ src/env/mpixxx_opts.conf \
+ src/env/mpicc.sh \
+ src/env/mpicc.conf \
+ src/env/mpicc.bash \
+ src/env/mpicxx.sh \
+ src/env/mpicxx.conf \
+ src/env/mpicxx.bash \
+ src/env/mpif77.sh \
+ src/env/mpif77.conf \
+ src/env/mpif77.bash \
+ src/env/mpif90.sh \
+ src/env/mpif90.conf \
+ src/env/mpif90.bash \
+ src/env/parkill \
+ src/util/dbg/getfuncstack \
+ src/include/mpi.h \
+ doc/design/Makefile \
+ doc/installguide/Makefile \
+ doc/logging/Makefile \
+ doc/refman/Makefile \
+ doc/smpd/Makefile \
+ doc/userguide/Makefile \
+ doc/windev/Makefile \
+ test/commands/cmdtests \
+ doc/mansrc/createhtmlindex)
+
+echo 'Configuration completed.'
Deleted: mpich2/trunk/configure.in
===================================================================
--- mpich2/trunk/configure.in 2012-02-28 23:25:23 UTC (rev 9547)
+++ mpich2/trunk/configure.in 2012-02-28 23:26:34 UTC (rev 9548)
@@ -1,5989 +0,0 @@
-AC_PREREQ(2.63)
-#
-# (C) 2006 by Argonne National Laboratory.
-# See COPYRIGHT in top-level directory.
-#
-dnl Process this file with autoconf to produce a configure script.
-dnl
-dnl aclocal_cache.m4, included by sowing/confdb/aclocal.m4, fixes
-dnl bugs in autoconf caching.
-dnl
-dnl This is a large configure script and it is important to keep it
-dnl clearly organized. In addition, this script must coordinate with
-dnl the other modules that can be used to construct MPICH2, such as
-dnl the communication device and the process manager. Each of these
-dnl may have special features or limitations that other modules or
-dnl this configure may need to take into account. To handle this, there
-dnl are xx major steps in this configure script:
-dnl
-dnl 1. Identify major modules and source any prerequisite scripts
-dnl 2. Determine compiler characteristics
-dnl 3. Setup and configure the other modules
-dnl 4. Determine MPI features and characteristics (such as datatype values)
-dnl
-dnl Each of these is described in more detail below.
-dnl
-dnl 1. Identify the modules (most are specified by
-dnl --with-<modulename>=instance,
-dnl for example, --with-pm=mpd or --with-device=ch3:nemesis).
-dnl For each module, source the file mpich2prereq if present (in the
-dnl module's top-level directory). This
-dnl must be a bourne (sh) shell script; it can access any of the variables
-dnl in the configure script. In addition, there are a few variables that
-dnl are defined and provided to allow the modules to communicate their
-dnl needs or limitations to the other modules. These are:
-dnl MPID_MAX_THREAD_LEVEL - thread level supported by device.
-dnl if unset, is MPI_THREAD_FUNNELED
-dnl MPID_NO_LONG_LONG - if yes, the device does not support the
-dnl long long integer type
-dnl MPID_NO_LONG_DOUBLE - if yes, the device does not support the
-dnl long double type
-dnl MPID_PM_NAMESERVER - if set, provides the name of the nameserver
-dnl that the process manager supports.
-dnl This name server will be used if the
-dnl default name server is selected.
-dnl MPID_NO_PM - If yes, the device does not require any
-dnl PM implementation.
-dnl MPID_NO_PMI - If yes, the device does not require any
-dnl PMI implementation.
-dnl EXTRA_STATUS_DECL - Any extra declarations that the device
-dnl needs added to the definition of MPI_Status.
-dnl MPID_MAX_PROCESSOR_NAME - The maximum number of character in a processor
-dnl name. If not set, 128 will be used.
-dnl PMI_REQUIRES_READABLE_TOKENS - if yes, define the C-preprocessor
-dnl value USE_HUMAN_READABLE_TOKENS, which is
-dnl used in src/include/mpimem.h to define token
-dnl separators used in src/util/mem/argstr.c
-dnl PM_REQUIRES_PMI - if set, provides the name of the PMI
-dnl interface implementation. If not set,
-dnl the "simple" PMI implementation is used.
-dnl A process manager that needs a particular
-dnl process manager should check that this is
-dnl not set to an incompatible value.
-dnl MPID_NO_SPAWN - if yes, the device does not support the
-dnl dynamic process routines (spawn, connect
-dnl attach, join, plus port and publish
-dnl routines). The major effect of this
-dnl is to let the test codes know that
-dnl spawn is not implemented.
-dnl MPID_NO_RMA - if yes, the device does not support the
-dnl MPI RMA routines (MPI_Win_create and
-dnl MPI_Put etc.). The major effect of this
-dnl is to let the test codes know that
-dnl RMA is not implemented.
-dnl
-dnl Note that the meanings of these variables are defined so that an
-dnl undefined value gives the default. This makes it easy to expand
-dnl the set of such variables, since only modules that need the new
-dnl variable will need to be changed.
-dnl
-dnl 2. Determine compiler characteristics
-dnl Here is where features of the compilers are determined, including
-dnl support for shared libraries and sizes of the basic datatype types.
-dnl
-dnl 3. Setup and configure the other modules
-dnl Before each module configure is executed, the script setup_<module>
-dnl is run if present. This is a bourne (sh) shell script and may
-dnl access configure variables. It should not make any changes to the
-dnl compiler name or flags (e.g., do not add -D_XOPEN_SOURCE to CFLAGS here,
-dnl because that may invalidate the determination of the compiler
-dnl characteristics in the prior step).
-dnl
-dnl 4. Determine MPI features
-dnl
-dnl
-dnl Special environment variables
-dnl To let other scripts and in particular the configure in test/mpi
-dnl know that they are being invoked from within the MPICH2 configure,
-dnl the following environment variables are set and exported:
-dnl FROM_MPICH2
-dnl MPICH2_ENABLE_F77
-dnl MPICH2_ENABLE_FC
-dnl MPICH2_ENABLE_CXX
-dnl
-dnl The file name here refers to a file in the source being configured
-dnl In later versions of autoconf, the binding of AC_INIT changed (!!!)
-dnl The original version was AC_INIT(a source file)
-dnl The later version is AC_INIT(package,version,[bug-report],[tarname])
-dnl
-dnl Note that no executable statements are allowed (and any are silently
-dnl dropped) before AC_INIT.
-dnl
-dnl AC_INIT requires an explicit version number
-dnl Args are package name, version, bug report, and tar file name
-dnl All must be literals
-dnl Note that AC_PACKAGE_STRING is not a command but must be defined(!)
-dnl Unfortunately, setting the PACKAGE names is not compatible with
-dnl AC_CONFIG_SUBDIRS, since the resulting values in the generated
-dnl conf file will not be consistent.
-dnl define([AC_PACKAGE_STRING],[MPICH2 1.0.6])
-dnl AC_INIT(mpich2,1.0.6,mpich2-maint at mcs.anl.gov,mpich2-1.0.6)
-dnl Use the oldstyle AC_INIT instead
-
-m4_include([maint/version.m4])
-dnl 2nd arg is intentionally underquoted
-AC_INIT([MPICH2],
- MPICH2_VERSION_m4,
- [mpich-discuss at mcs.anl.gov],
- [mpich2],
- [http://www.mcs.anl.gov/research/projects/mpich2/])
-
-if test "x$prefix" != "xNONE" && test -d "$prefix"; then
- if test "x`(cd \"$prefix\"; echo \"$PWD\")`" = "x`(cd \"$srcdir\"; echo \"$PWD\")`" ||\
- test "x`(cd \"$prefix\"; echo \"$PWD\")`" = "x$PWD" ; then
- AC_MSG_ERROR([The install directory (--prefix=) cannot be the same as the build or src directory.])
- fi
-fi
-
-CONFIGURE_ARGS_CLEAN=`echo $* | tr '"' ' '`
-AC_SUBST(CONFIGURE_ARGS_CLEAN)
-
-# these values come from the m4_include above
-MPICH2_VERSION=MPICH2_VERSION_m4
-AC_SUBST([MPICH2_VERSION])
-MPICH2_RELEASE_DATE="MPICH2_RELEASE_DATE_m4"
-AC_SUBST([MPICH2_RELEASE_DATE])
-libmpich_so_version="libmpich_so_version_m4"
-AC_SUBST([libmpich_so_version])
-
-
-if test -z "$MPICH2_VERSION" ; then
- AC_MSG_ERROR([MPICH2_VERSION is empty, check maint/version.m4 for errors])
-fi
-# Produce a numeric version assuming the following format:
-# Version: [MAJ].[MIN].[REV][EXT][EXT_NUMBER]
-# Example: 1.0.7rc1 has
-# MAJ = 1
-# MIN = 0
-# REV = 7
-# EXT = rc
-# EXT_NUMBER = 1
-#
-# Converting to numeric version will convert EXT to a format number:
-# ALPHA (a) = 0
-# BETA (b) = 1
-# RC (rc) = 2
-# PATCH (p) = 3
-# Regular releases are treated as patch 0
-#
-# Numeric version will have 1 digit for MAJ, 2 digits for MIN,
-# 2 digits for REV, 1 digit for EXT and 2 digits for EXT_NUMBER.
-changequote(<<,>>)
-V1=`expr $MPICH2_VERSION : '\([0-9]*\)\.[0-9]*\.*[0-9]*[a-zA-Z]*[0-9]*'`
-V2=`expr $MPICH2_VERSION : '[0-9]*\.\([0-9]*\)\.*[0-9]*[a-zA-Z]*[0-9]*'`
-V3=`expr $MPICH2_VERSION : '[0-9]*\.[0-9]*\.*\([0-9]*\)[a-zA-Z]*[0-9]*'`
-V4=`expr $MPICH2_VERSION : '[0-9]*\.[0-9]*\.*[0-9]*\([a-zA-Z]*\)[0-9]*'`
-V5=`expr $MPICH2_VERSION : '[0-9]*\.[0-9]*\.*[0-9]*[a-zA-Z]*\([0-9]*\)'`
-changequote([,])
-
-if test "$V2" -le 9 ; then V2=0$V2 ; fi
-if test "$V3" = "" ; then V3=0; fi
-if test "$V3" -le 9 ; then V3=0$V3 ; fi
-if test "$V4" = "a" ; then
- V4=0
-elif test "$V4" = "b" ; then
- V4=1
-elif test "$V4" = "rc" ; then
- V4=2
-elif test "$V4" = "" ; then
- V4=3
- V5=0
-elif test "$V4" = "p" ; then
- V4=3
-fi
-if test "$V5" -le 9 ; then V5=0$V5 ; fi
-
-MPICH2_NUMVERSION=`expr $V1$V2$V3$V4$V5 + 0`
-AC_SUBST(MPICH2_NUMVERSION)
-
-# ABIVERSION is the name used by simplemake, so we reassign the
-# libmpich_so_version number to it
-ABIVERSION=${libmpich_so_version}
-export ABIVERSION
-export libmpich_so_version
-AC_SUBST(ABIVERSION)
-
-# Print out the configure options
-CONFIGURE_ARGUMENTS="$ac_configure_args"
-AC_SUBST(CONFIGURE_ARGUMENTS)
-if test -n "$ac_configure_args" ; then
- echo "Configuring MPICH2 version $MPICH2_VERSION with $ac_configure_args"
-else
- echo "Configuring MPICH2 version $MPICH2_VERSION"
-fi
-
-# Add the information on the system:
-echo "Running on system: `uname -a`"
-
-dnl Definitions will be placed in this file rather than in the DEFS variable
-AC_CONFIG_HEADER(src/include/mpichconf.h)
-AH_TOP([/* -*- Mode: C; c-basic-offset:4 ; -*- */
-/*
- * (C) 2001 by Argonne National Laboratory.
- * See COPYRIGHT in top-level directory.
- */
-#ifndef MPICHCONF_H_INCLUDED
-#define MPICHCONF_H_INCLUDED
-])
-
-# We use an #include strategy here because all of the alternative strategies for
-# quashing these variables have various drawbacks. The alternatives are listed
-# here to avoid rediscovery of these problems by someone else in the future:
-#
-# 1) Strategy: Rewrite mpichconf.h.in with sed at maint/updatefiles time.
-# Problem: Automatic remaking of config.status and friends will re-run
-# autoheader and blow away our sed changes without an opportunity to
-# patch the resulting file again.
-# 2) Strategy: Add literal "#undef PACKAGE" lines to the AH_BOTTOM text.
-# Problem: These lines get rewritten by config.status to be "#define" lines,
-# so the intended quashing never actually occurs.
-# 3) Strategy: Use AC_CONFIG_COMMANDS to run a sed rewrite command on
-# mpichconf.h at config.status time.
-# Problem: Causes mpichconf.h to always be rewritten, first by the normal
-# config.status commands and then by sed. This can cause
-# unnecessary remaking of object files since nearly every C source
-# file includes this header (see the Autoconf Manual, "Automatic
-# Remaking")
-#
-# The only other plausible strategy would seem to be rewriting config.status
-# itself via AC_CONFIG_COMMANDS_POST, but that seems error prone. The best
-# solution would be to stop all subconfigures from including config.h headers
-# from other packages. Then all of this nonsense can be eliminated.
-# [goodell@ 2011-08-26]
-AH_BOTTOM([
-/* Include nopackage.h to undef autoconf-defined macros that cause conflicts in
- * subpackages. This should not be necessary, but some packages are too
- * tightly intertwined right now (such as ROMIO and the MPICH2 core) */
-#include "nopackage.h"
-
-#endif /* !defined(MPICHCONF_H_INCLUDED) */
-])
-
-dnl Set the directory that contains support scripts such as install-sh and
-dnl config.guess
-AC_CONFIG_AUX_DIR(confdb)
-dnl our macro dir is the same as our aux dir
-AC_CONFIG_MACRO_DIR([confdb])
-
-# Set the FROM_MPICH2 variable to tell subconfigures that they are
-# built from within MPICH2
-FROM_MPICH2=yes
-export FROM_MPICH2
-AC_SUBST([FROM_MPICH2])
-
-# Save a copy of precious flags as USER_* before any of these flags
-# are being modified by configure tests.
-PAC_PREFIX_ALL_FLAGS(USER)
-
-# WRAPPER_xFLAGS are used by mpicc and friends.
-#
-# WRAPPER_CFLAGS and other compile flags are used for compile options
-# that are added by MPICH2, but should be used by applications (such
-# as include paths).
-#
-# All libraries that are detected by MPICH2 as needed for some of its
-# functionality (such as -lpthread) should be added to LIBS so
-# autoconf link tests can use them. Libraries that are built by MPICH2
-# at make time (and hence are not available for autoconf link tests to
-# use), such as OPA and MPL, should be added to WRAPPER_LIBS for
-# static builds. All libraries in LIBS are added to WRAPPER_LIBS
-# (similarly LDFLAGS are added to WRAPPER_LDFLAGS) as well, at the end
-# of configure.
-PAC_PREFIX_ALL_FLAGS(WRAPPER)
-WRAPPER_CFLAGS="$CFLAGS $MPICH2_MPICC_FLAGS"
-WRAPPER_CPPFLAGS="$CPPFLAGS $MPICH2_MPICPP_FLAGS"
-WRAPPER_CXXFLAGS="$CXXFLAGS $MPICH2_MPICXX_FLAGS"
-WRAPPER_FFLAGS="$FFLAGS $MPICH2_MPIF77_FLAGS"
-WRAPPER_FCFLAGS="$FCFLAGS $MPICH2_MPIFC_FLAGS"
-WRAPPER_LDFLAGS="$MPICH2_LDFLAGS"
-WRAPPER_LIBS="$MPICH2_LIBS"
-
-# Add MPICH2LIB_* to the appropriate flags
-AC_ARG_VAR(MPICH2LIB_CFLAGS,
- [extra CFLAGS used in building MPICH2 libraries])
-AC_ARG_VAR(MPICH2LIB_CPPFLAGS,
- [extra CPPFLAGS used in building MPICH2 libraries])
-AC_ARG_VAR(MPICH2LIB_CXXFLAGS,
- [extra CXXFLAGS used in building MPICH2 libraries])
-AC_ARG_VAR(MPICH2LIB_FFLAGS,
- [extra FFLAGS used in building MPICH2 libraries])
-AC_ARG_VAR(MPICH2LIB_FCFLAGS,
- [extra FCFLAGS used in building MPICH2 libraries])
-AC_ARG_VAR(MPICH2LIB_LDFLAGS,
- [extra LDFLAGS used in building MPICH2 libraries])
-AC_ARG_VAR(MPICH2LIB_LIBS,
- [extra LIBS used in building MPICH2 libraries])
-CFLAGS="$CFLAGS $MPICH2LIB_CFLAGS"
-CPPFLAGS="$CPPFLAGS $MPICH2LIB_CPPFLAGS"
-CXXFLAGS="$CXXFLAGS $MPICH2LIB_CXXFLAGS"
-FFLAGS="$FFLAGS $MPICH2LIB_FFLAGS"
-FCFLAGS="$FCFLAGS $MPICH2LIB_FCFLAGS"
-LDFLAGS="$LDFLAGS $MPICH2LIB_LDFLAGS"
-LIBS="$LIBS $MPICH2LIB_LIBS"
-
-dnl include all subsystem m4 fragments now that the core autoconf functionality
-dnl has been setup. No fragment should do anything except define
-dnl PAC_SUBCFG_{PREREQ,BODY} macros which will be expanded later as
-dnl appropriate
-# begin subsys includes
-m4_include([subsys_include.m4])
-# end subsys includes
-
-dnl ----------------------------------------------------------------------------
-dnl setup top-level argument handling
-AC_ARG_ENABLE(lib-depend,
- AC_HELP_STRING([--enable-lib-depend], [Turn on library dependencies (experimental)]),,
- [enable_lib_depend=no])
-
-AC_ARG_ENABLE(echo,
- AC_HELP_STRING([--enable-echo], [Turn on strong echoing. The default is enable=no.]),
- set -x)
-
-AC_ARG_ENABLE(dynamiclibs,
- AC_HELP_STRING([--enable-dynamiclibs], [Enable the use of dynamic libraries
- by the devices that support them]),,enable_dynamiclibs=no)
-
-AC_ARG_ENABLE(error-checking,
-[ --enable-error-checking=level
- Control the amount of error checking.
- no - no error checking
- runtime - error checking controllable at runtime through environment
- variables
- all - error checking always enabled (default)
-],,enable_error_checking=default)
-
-AC_ARG_ENABLE(error-messages,
-[ --enable-error-messages=level - Control the amount of detail in error messages.
- all - Maximum amount of information
- generic - Only generic messages (no information about the specific
- instance)
- class - One message per MPI error class
- none - No messages
-],,enable_error_messages=all)
-
-AC_ARG_ENABLE(timing,
-[ --enable-timing=level - Control the amount of timing information
- collected by the MPICH implementation.
- none - Collect no data (default)
- all - Collect lots of data
- runtime - Runtime control of data collected
-],,enable_timing=default)
-
-AC_ARG_ENABLE(g,
-[ --enable-g=option - Control the level of debugging support in the
- MPICH implementation. option is a list of comma
- separated names including
- none - No debugging
- handle - Trace handle operations
- handlealloc - Trace handle allocations
- dbg - Add compiler flag, -g, to all internal
- compiler flags, i.e. MPICH2LIB_CFLAGS, MPICH2LIB_CXXFLAGS,
- MPICH2LIB_FFLAGS, and MPICH2LIB_FCFLAGS.
- debug - Synonym for dbg
- instr - Enable instrumentation
- log - Enable debug event logging
- mem - Memory usage tracing
- meminit - Preinitialize memory associated structures and unions to
- eliminate access warnings from programs like valgrind
- memarena - Check for overwrite errors in memory allocation arena
- mutex - Enable error checking on pthread mutexes
- mutexnesting - Check for non-nesting of mutexes
- all - All of the above choices
-],,enable_g=none)
-
-dnl We may want to force MPI_Aint to be the same size as MPI_Offset,
-dnl particularly on 32 bit systems with large (64 bit) file systems.
-AC_ARG_WITH(aint-size,
- AC_HELP_STRING([--with-aint-size], [Override the size of MPI_AINT (in bytes)]),,
- with_aint_size=0)
-
-AC_ARG_ENABLE(fast,
-[ --enable-fast=option - Control the level of fast execution in the
- MPICH implementation. option is a list of
- comma separated names including
- defopt - Default compiler optimization -O2 for all language bindings,
- i.e. --enable-fast=O2, when neither --enable-fast
- nor --disable-fast is specified. (default)
- O<n> - Appends default optimization flags, -O<n>, to all internal
- compiler flags, i.e. MPICH2LIB_CFLAGS, MPICH2LIB_CXXFLAGS,
- MPICH2LIB_FFLAGS, and MPICH2LIB_FCFLAGS.
- nochkmsg - No error checking, i.e. --disable-error-checking
- notiming - No timing collection, i.e. --disable-timing.
- ndebug - Appends -DNDEBUG to MPICH2LIB_CFLAGS.
- all|yes - "defopt", "nochkmsg", "notiming" and "ndebug" are enabled
- when --enable-fast is specified without any option.
- none - None of above options, i.e. --disable-fast. Note that
- --enable-strict will add the -O2 option even if
- --enable-fast=none is given.
-],,enable_fast=defopt)
-
-AC_ARG_ENABLE(check-compiler-flags,
- AC_HELP_STRING([--enable-check-compiler-flags], [enable the checks for all compiler
- options, xxxFLAGS, MPICH2_xxxFLAGS. Default is on.]),,
- enable_check_compiler_flags=yes)
-
-dnl We enable f77 and fc if we can find compilers for them.
-dnl In addition, we check whether f77 and fc can work together.
-AC_ARG_ENABLE(f77,
- AC_HELP_STRING([--enable-f77], [Enable Fortran 77 bindings]),,enable_f77=yes)
-
-AC_ARG_ENABLE(fc,
- AC_HELP_STRING([--enable-fc], [Enable Fortran 90 bindings]),,enable_fc=yes)
-
-AC_ARG_ENABLE(f90,
- AC_HELP_STRING([--enable-f90],
- [Obsolete option: Use --enable-fc or --disable-fc instead]),
- [AC_MSG_ERROR([
---enable-f90 and --disable-f90 are NO longer valid configure options,
-use --enable-fc or --disable-fc instead])]
-)
-
-AC_ARG_ENABLE(cxx,
- AC_HELP_STRING([--enable-cxx], [Enable C++ bindings]),,enable_cxx=yes)
-
-AC_ARG_ENABLE(romio,
- AC_HELP_STRING([--enable-romio], [Enable ROMIO MPI I/O implementation]),,
- enable_romio=yes)
-
-AC_ARG_ENABLE(debuginfo,
- AC_HELP_STRING([--enable-debuginfo], [Enable support for debuggers]),,
- enable_debuginfo=no)
-
-AC_ARG_ENABLE(smpcoll,
- AC_HELP_STRING([--enable-smpcoll],
- [Enable support for SMP/multi-core aware collectives]),
- smpcoll=$enableval,smpcoll=yes)
-if test $smpcoll = "yes" ; then
- AC_DEFINE(USE_SMP_COLLECTIVES,1,[define to enable SMP/multi-core aware collectives])
-fi
-
-dnl The environment variable MPICH_DEBUGLIBNAME may be used to
-dnl override the default name of the library that the debugger will
-dnl load to access the MPICH2 internal data structures.
-AC_ARG_ENABLE(nmpi-as-mpi,
- AC_HELP_STRING([--enable-nmpi-as-mpi], [Use MPI rather than PMPI routines for MPI
- routines, such as the collectives, that may be
- implemented in terms of other MPI routines]),,
- enable_nmpi_as_mpi=no)
-
-dnl "default" is a special device that allows MPICH to choose one
-dnl based on the environment.
-AC_ARG_WITH(device,
- AC_HELP_STRING([--with-device=name], [Specify the communication device for MPICH]),,
- with_device=default)
-
-AC_ARG_WITH(pmi,
- AC_HELP_STRING([--with-pmi=name], [Specify the pmi interface for MPICH]),,
- with_pmi=default)
-
-AC_ARG_WITH(pm,
- AC_HELP_STRING([--with-pm=name],
- [Specify the process manager for MPICH. "no" or "none" are
- valid values. Multiple process managers may be specified as
- long as they all use the same pmi interface by separating them
- with colons. The mpiexec for the first named process manager
- will be installed. Example: "--with-pm=hydra:mpd:gforker"
- builds the three process managers hydra, mpd and gforker;
- only the mpiexec from hydra is installed into the bin
- directory.]),,with_pm=default)
-
-AC_ARG_WITH(logging,
- AC_HELP_STRING([--with-logging=name], [Specify the logging library for MPICH]),
- [if test -z "$withval" ; then with_logging=rlog ; fi],with_logging=none)
-
-dnl both --without-mpe and --disable-mpe are supported
-dnl AC_ARG_ENABLE(mpe) is used only when --with(out)-mpe is not used.
-AC_ARG_WITH(mpe,
- AC_HELP_STRING([--with-mpe], [Build the MPE (MPI Parallel Environment) routines]),,
- with_mpe=default)
-if test "$with_mpe" = "default" ; then
- AC_ARG_ENABLE(mpe,
- AC_HELP_STRING([--enable-mpe], [Build the MPE (MPI Parallel Environment) routines]),
- with_mpe=$enableval,with_mpe=default)
-fi
-
-dnl
-dnl The default option needs to be defined in terms of a specific choice
-dnl (runtime in this case). Note that the default choice is the same as
-dnl runtime only for certain devices - not for every device.
-AC_ARG_ENABLE(threads,
-[ --enable-threads=level - Control the level of thread support in the
- MPICH implementation. The following levels
- are supported.
- single - No threads (MPI_THREAD_SINGLE)
- funneled - Only the main thread calls MPI (MPI_THREAD_FUNNELED)
- serialized - User serializes calls to MPI (MPI_THREAD_SERIALIZED)
- runtime - The level of thread support is determined by
- the arguments to MPI_Init_thread, with
- MPI_THREAD_MULTIPLE available. The default option
- for many communication devices.
- multiple - Fully multi-threaded (MPI_THREAD_MULTIPLE) always.
- DO NOT select this option. The option runtime is more
- efficient and also supports thread_multiple.
- (multiple aliased to runtime now)
- default - Make a good choice depending on the communication
- device. For ch3:nemesis, this is runtime.
-
- See also the --enable-thread-cs option for controlling the granularity of
- the concurrency inside of the library
-],,enable_threads=default)
-
-AC_ARG_ENABLE(thread-cs,
- AC_HELP_STRING([--enable-thread-cs=type],
- [Choose the method used for critical sections
- and other atomic updates when multiple
- threads are present. Values may be global
- (default), per-object, lock-free]),,enable_thread_cs=global)
-
-AC_ARG_ENABLE(refcount,
- AC_HELP_STRING([--enable-refcount=type],
- [Choose the method for ensuring atomic updates
- to the reference counts for MPI objects.
- Values may be lock, lock-free, none. The
- default depends on the thread-cs choice; for
- global it is none (because none is required),
- for per-object it is lock, and for lock-free
- it is lock-free]),,enable_refcount=default)
-
-AC_ARG_ENABLE(mutex-timing,
- AC_HELP_STRING([--enable-mutex-timing], [calculate the time spent waiting on mutexes]),
- AC_DEFINE(MPIU_MUTEX_WAIT_TIME,1,[Define to enable timing mutexes]))
-
-AC_ARG_ENABLE(handle-allocation,
- AC_HELP_STRING([--enable-handle-allocation=type],
- [Choose the method used for allocating MPI
- object handles. Values may be 'tls' for
- thread-local storage or 'mutex' for simple
- locking. 'mutex' is the default.]),,enable_handle_allocation=default)
-
-AC_ARG_ENABLE([predefined-refcount],
- AS_HELP_STRING([--enable-predefined-refcount],
- [control whether predefined objects like
- MPI_COMM_WORLD are reference counted (default
- depends on --enable-thread-cs choice)]),[],
- [enable_predefined_refcount=default])
-
-AC_ARG_ENABLE(weak-symbols,
- AC_HELP_STRING([--enable-weak-symbols],
- [Use weak symbols to implement PMPI routines (default)]),,
- enable_weak_symbols=yes)
-
-AC_ARG_ENABLE(multi-aliases,
- AC_HELP_STRING([--enable-multi-aliases],
- [Multiple aliasing to support multiple fortran compilers (default)]),,
- enable_multi_aliases=yes)
-
-AC_ARG_ENABLE([rpath],
- [AC_HELP_STRING([--enable-rpath],
- [Determine whether the rpath is set when programs are
- compiled and linked when shared libraries are built.
- The default is yes; use --disable-rpath to turn this
- feature off; in that case, shared libraries will be
- found according to the rules for your system (e.g., in
- LD_LIBRARY_PATH)])],
- [],[enable_rpath=yes])
-AC_SUBST([enable_rpath])
-
-
-AC_ARG_WITH(cross,
- AC_HELP_STRING([--with-cross=file],
- [Specify the values of variables that configure cannot
- determine in a cross-compilation environment]),,with_cross=no)
-
-AC_ARG_WITH(namepublisher,
-[ --with-namepublisher=name Choose the system that will support
- MPI_PUBLISH_NAME and MPI_LOOKUP_NAME. Options
- include
- no (no service available)
- mpd
- file[:directory] (optional directory)
- pmi],,with_namepublisher=default)
-AC_ARG_WITH(name-publisher,
- [],
- with_namepublisher=$with_name_publisher,)
-
-AC_SUBST(MPIFLIBNAME)
-AC_SUBST(PMPIFLIBNAME)
-
-dnl The default is a special wrapper library
-AC_ARG_WITH(fwrapname,
- AC_HELP_STRING([--with-fwrapname=name],
- [Specify name of library containing Fortran interface routines]),
- [FWRAPNAME=$withval;set_FWRAPNAME="yes"],FWRAPNAME=fmpich)
-AC_SUBST(FWRAPNAME)
-
-# Find a C compiler.
-# We also need to do this before the F77 and FC test to ensure that we
-# find the C preprocessor reliably.
-PAC_PROG_CC
-AC_PROG_CC_C_O dnl needed for automake "silent-rules"
-PAC_PUSH_FLAG([CFLAGS])
-AC_PROG_CPP
-# Bug in autoconf. Restore cross settings
-if test "$pac_cross_compiling" = "yes" -a "$ac_cv_prog_cc_cross" = "no" ; then
- AC_MSG_RESULT([Resetting cross compilation to yes])
- cross_compiling=yes
- ac_cv_prog_cc_cross=yes
- ac_cv_prog_f77_cross=yes
- ac_cv_prog_fc_cross=yes
- ac_cv_prog_cxx_cross=yes
-fi
-PAC_POP_FLAG([CFLAGS])
-
-dnl now that autoconf and core compilers are setup, init automake and libtool
-AM_INIT_AUTOMAKE([-Wall -Werror foreign 1.11 silent-rules subdir-objects])
-AM_MAINTAINER_MODE([enable])
-LT_INIT([disable-shared])
-# Non-verbose make by default
-m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
-
-# Disable rpath if shared libraries are disabled, since rpath makes no sense in
-# the context of static libraries. This also disables any attempt to add rpath
-# flags in the compiler wrappers
-if test "X$enable_shared" = "Xno" ; then
- enable_rpath=no
-fi
-
-dnl AC_PROG_{CXX,F77,FC} must come early in configure.in in order to avoid some
-dnl esoteric autoconf macro expansion errors
-dnl
-dnl Also, DO NOT attempt to place shell conditionals (either manually or via
-dnl AS_IF) around these macros in an effort to save configure time. It will
-dnl lead to weird AM_CONDITIONAL errors and potentially other problems.
-
-# suppress default "-g -O2" from AC_PROG_CXX
-: ${CXXFLAGS=""}
-AC_PROG_CXX([PAC_CXX_SEARCH_LIST])
-
-# suppress default "-g -O2" from AC_PROG_F77
-: ${FFLAGS=""}
-AC_PROG_F77([PAC_F77_SEARCH_LIST])
-
-# suppress default "-g -O2" from AC_PROG_FC
-: ${FCFLAGS=""}
-AC_PROG_FC([PAC_FC_SEARCH_LIST])
-
-
-# compute canonical system types
-AC_CANONICAL_BUILD
-AC_CANONICAL_HOST
-# TARGET not needed, MPICH2 isn't a compiler
-
-# Enable better caching control
-PAC_ARG_CACHING
-
-# Set CFLAGS for enable strict if necessary. Do this *first* because
-# it may influence the output of the other tests
-PAC_ARG_STRICT
-
-# -----------------------------------------------------------------------------
-# First check that we have a clean build if we are doing a VPATH build
-PAC_VPATH_CHECK(src/include/mpi.h src/env/mpicc src/env/mpicc.conf,lib)
-
-# ----------------------------------------------------------------------------
-# This test is complicated by the fact that top_srcdir is not set until
-# the very end of configure. Instead, we get it ourselves
-if test -z "$top_srcdir" ; then
- use_top_srcdir=$srcdir
-else
- use_top_srcdir=$top_srcdir
-fi
-if test -z "$master_top_srcdir" ; then
- # This needs to be an absolute pathname
- case "$use_top_srcdir" in
- /*) ;;
- *)
- use_top_srcdir=`(cd $use_top_srcdir && pwd)`
- ;;
- esac
- master_top_srcdir=$use_top_srcdir
-fi
-# Get the directory that we're running in...
-if test -z "$master_top_builddir" ; then
- master_top_builddir="`pwd`"
-fi
-AC_SUBST(master_top_builddir)
-AC_SUBST(master_top_srcdir)
-export master_top_builddir
-export master_top_srcdir
-# ----------------------------------------------------------------------------
-# We create this file to allow other configures to find the "master"
-# top builddir
-rm -f .mpich2
-date > .mpich2
-# ----------------------------------------------------------------------------
-# with-device
-if test "$with_device" = "default" ; then
- # Pick the device. For now, always choose ch3
- with_device=ch3
-fi
-# Extract the device name from any options
-# Allow the device to specify a directory; if no directory, use the
-# included directories
-#
-DEVICE=$with_device
-AC_SUBST(DEVICE)
-
-device_name=`echo $with_device | sed -e 's/:.*$//'`
-changequote(<<,>>)
-device_args=`echo $with_device | sed -e 's/^[^:]*//' -e 's/^://'`
-changequote([,])
-
-devicedir=$use_top_srcdir/src/mpid/$device_name
-devicereldir=src/mpid/$device_name
-case "$device_name" in
- /*)
- devicedir=$DEVICE
- # Get the name from the leaf
- device_name=`echo $device_name ~ sed -e 's%.*/%%'`
- # FIXME: should the devicereldir be different (perhaps not -
- # this allows use to build within our tree, even when other data
- # is outside of the tree)
- ;;
- *)
- ;;
-esac
-export device_name
-export device_args
-export devicedir
-# Make the device base name and args available to generated files
-DEVICE_NAME=$device_name
-AC_SUBST(DEVICE_NAME)
-DEVICE_ARGS=$device_args
-AC_SUBST(DEVICE_ARGS)
-#
-# Give the device an opportunity to include a header file in mpi.h. The
-# default value of INCLUDE_MPIDDEFS_H is set prior to the inclusion of the
-# device's mpich2prereq script. The device's script may override the value
-# if needed.
-INCLUDE_MPIDDEFS_H='/* ... no device specific definitions ... */'
-AC_SUBST(INCLUDE_MPIDDEFS_H)
-
-#
-# See if the device wants to say something about the compilers (for example,
-# the globus device may need to do this)
-if test -f $devicedir/mpich2prereq ; then
- . $devicedir/mpich2prereq
-fi
-
-# expand all of the prereq macros in the correct order
-m4_map([PAC_SUBCFG_DO_PREREQ], [PAC_SUBCFG_MODULE_LIST])
-
-# ----------------------------------------------------------------------------
-# Set default library names if names haven't already been provided
-AC_ARG_VAR([MPILIBNAME],[can be used to override the name of the MPI library (default: "mpich")])
-AC_ARG_VAR([PMPILIBNAME],[can be used to override the name of the MPI profiling library (default: "p$MPILIBNAME")])
-AC_ARG_VAR([MPICXXLIBNAME],[can be used to override the name of the MPI C++ library (default: "${MPILIBNAME}cxx")])
-MPILIBNAME=${MPILIBNAME:-"mpich"}
-PMPILIBNAME_set=no
-if test -n "$PMPILIBNAME" ; then
- PMPILIBNAME_set=yes
-fi
-PMPILIBNAME=${PMPILIBNAME:-"p$MPILIBNAME"}
-# Note that the name for this library may be updated after we check for
-# enable_shmem
-# Fortran names are set later.
-# We use a different library for the C++ wrappers to avoid problems when
-# creating shared libraries
-if test -z "$MPICXXLIBNAME" ; then MPICXXLIBNAME="${MPILIBNAME}cxx" ; fi
-export MPIFLIBNAME
-export PMPIFLIBNAME
-export MPICXXLIBNAME
-AC_SUBST(MPICXXLIBNAME)
-
-# We'll set FORTRAN_BINDING to 1 if we support Fortran
-FORTRAN_BINDING=0
-
-# Set up default compiler optimization
-MPI_DEFAULT_COPTS="-O2"
-MPI_DEFAULT_CXXOPTS="-O2"
-MPI_DEFAULT_FOPTS="-O2"
-MPI_DEFAULT_FCOPTS="-O2"
-
-# enable-fast
-# strip off multiple options, separated by commas
-save_IFS="$IFS"
-IFS=","
-for option in $enable_fast ; do
- case "$option" in
- defopt)
- enable_default_optimize=yes
- ;;
- nochkmsg)
- enable_fast_nochkmsg=yes
- ;;
- notiming)
- enable_timing=no
- ;;
- ndebug)
- enable_append_ndebug=yes
- ;;
-#
-# [BRT] removed the reseting of enable_g so that --with-enable=dbg,meminit
-# can be specified with -enable-fast. This change was largely made for the
-# PETSc folks who want to use --enable-fast to eliminate parameter checking
-# overhead, but also wish to use meminit to eliminate initialization
-# warnings from valgrind.
-#
- all|yes)
- enable_default_optimize=yes
- enable_fast_nochkmsg=yes
- # Disable timing/logging stuffs
- enable_timing=no
- enable_append_ndebug=yes
- ;;
- O*)
- # Allows O<n> where <n> can be [0-9] or ' '.
- opt_flags=`echo $option | sed -e 's%\(O[0-9] \)%\1%g'`
- if test -n "$opt_flags" ; then
- enable_default_optimize=yes
- MPI_DEFAULT_COPTS="-$option"
- MPI_DEFAULT_CXXOPTS="-$option"
- MPI_DEFAULT_FOPTS="-$option"
- MPI_DEFAULT_FCOPTS="-$option"
- else
- IFS="$save_IFS"
- AC_MSG_WARN([Unknown value $option for --enable-fast])
- IFS=","
- fi
- ;;
- none|no)
- enable_default_optimize=no
- enable_fast_nochkmsg=no
- # Reset timing/logging stuffs to when --enable-timing isn't specified.
- enable_timing=default
- enable_append_ndebug=no
- ;;
- *)
- IFS="$save_IFS"
- AC_MSG_WARN([Unknown value $option for --enable-fast])
- IFS=","
- ;;
- esac
-done
-IFS="$save_IFS"
-
-# ----------------------------------------------------------------------------
-# Process any enable or with values
-# We must do enable-fast first, because it changes the other enable values
-if test "$enable_fast_nochkmsg" = "yes" ; then
- #
- if test "$enable_error_checking" != "default" -a "$enable_error_checking" != "no" ; then
- AC_MSG_ERROR([enable-fast overrides enable-error-checking; error-checking option $enable_error_checking ignored])
- fi
- enable_error_checking=no
- # Export a variable that will allow the test suite to detect that
- # MPICH has no error testing
- MPICH_FAST=yes
- export MPICH_FAST
-fi
-
-# error-checking
-# Change default into the specific value of the default
-if test "$enable_error_checking" = "default" ; then
- enable_error_checking=all
-fi
-# glue_romio.h needs the variable HAVE_ERROR_CHECKING to have the value 0 or 1
-HAVE_ERROR_CHECKING=0
-case "$enable_error_checking" in
- no)
- # if error checking has been disabled, then automatically disable the error
- # checking tests in the test suite
- ac_configure_args="${ac_configure_args} --disable-checkerrors"
- ;;
- all|yes|runtime)
- error_checking_kind=`echo $enable_error_checking | \
- tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
- error_checking_kind=MPID_ERROR_LEVEL_$error_checking_kind
- AC_DEFINE_UNQUOTED(HAVE_ERROR_CHECKING,$error_checking_kind,[Define to enable error checking])
- HAVE_ERROR_CHECKING=1
- ;;
- *)
- AC_MSG_WARN([Unknown value $enable_error_checking for enable-error-checking])
- ;;
-esac
-# permit @HAVE_ERROR_CHECKING@ substitution in glue_romio.h
-AC_SUBST([HAVE_ERROR_CHECKING])
-
-# error-messages
-case "$enable_error_messages" in
- no|none)
- error_message_kind="MPICH_ERROR_MSG_NONE"
- ;;
- all|yes)
- error_message_kind="MPICH_ERROR_MSG_ALL"
- ;;
- generic)
- error_message_kind="MPICH_ERROR_MSG_GENERIC"
- ;;
- class)
- error_message_kind="MPICH_ERROR_MSG_CLASS"
- ;;
- *)
- AC_MSG_WARN([Unknown value $enable_error_messages for enable-error-messages])
- ;;
-esac
-AC_DEFINE_UNQUOTED(MPICH_ERROR_MSG_LEVEL,$error_message_kind,[define to enable error messages])
-
-# ----------------------------------------------------------------------------
-#
-# enable-timing and with-logging
-#
-# Still to do: add subsets: e.g., class=pt2pt,class=coll. See mpich2 doc
-#
-# Logging and timing are intertwined. If you select logging, you
-# may also need to select a timing level. If no timing is selected
-# but logging with rlog is selected, make "all" the default timing level.
-#
-# FIXME: make timing and logging options work more cleanly together,
-# particularly when other logging options are selected (e.g., logging is not
-# rlog).
-# ----------------------------------------------------------------------------
-AM_CONDITIONAL([BUILD_LOGGING_RLOG],[test "X$with_logging" = "Xrlog"])
-collect_stats=false
-logging_required=false
-if test "$enable_timing" = "default" ; then
- if test "$with_logging" = "rlog" ; then
- enable_timing=all
- fi
-fi
-timing_name=$enable_timing
-case "$enable_timing" in
- no)
- timing_name=none
- ;;
- time)
- collect_stats=true
- ;;
- log|log_detailed)
- logging_required=true
- ;;
- yes)
- timing_name=all
- collect_stats=true
- logging_required=true
- ;;
- all|runtime)
- collect_stats=true
- logging_required=true
- ;;
- none|default)
- timing_name=none
- ;;
- *)
- AC_MSG_WARN([Unknown value $enable_timing for enable-timing])
- enable_timing=no
- timing_name=none
- ;;
-esac
-#
-# The default logging package is rlog; you can get it by
-# specifying --with-logging or --with-logging=rlog
-#
-case $with_logging in
- yes)
- logging_name=rlog
- ;;
- no|none)
- logging_name=none
- ;;
- default)
- if test "$logging_required" = "true" ; then
- logging_name=rlog
- else
- logging_name=none
- fi
- ;;
- *)
- logging_name=$with_logging
- ;;
-esac
-#
-# Include the selected logging subsystem
-#
-# Choices:
-# 1) A subdir of src/util/logging
-# This directory must contain a configure which will be executed
-# to build the
-# 2) An external directory
-# This directory must contain
-# a mpilogging.h file
-# It may contain
-# a setup_logging script
-# a configure
-#
-#
-logging_subsystems=
-if test "$logging_name" != "none" ; then
- # Check for an external name (directory containing a /)
- hasSlash=`echo A$logging_name | sed -e 's%[[^/]]%%g'`
- if test -n "$hasSlash" ; then
- # Check that the external logging system is complete.
- # Any failure will cause configure to abort
- if test ! -d $logging_name ; then
- AC_MSG_ERROR([External logging directory $logging_name not found. Configure aborted])
- logging_name=none
- elif test ! -s $logging_name/mpilogging.h ; then
- AC_MSG_ERROR([External logging header $logging_name/mpilogging.h not found. Configure aborted])
- logging_name=none
- fi
-
- logdir=$logging_name
- # Force the logdir to be absolute
- logdir=`cd $logdir && pwd`
- # Switch name to "external" because that is how the MPICH2
- # code will know it
- logging_name=external
- # Add the dir to the include paths
- #CPPFLAGS="$CPPFLAGS -I$logdir"
- CPPFLAGS="$CPPFLAGS -I$logdir"
- EXTERNAL_SRC_DIRS="$EXTERNAL_SRC_DIRS $logdir"
- # Add to the list of external modules to setup
- if test -x $logdir/setup_logging ; then
- EXTERNAL_SETUPS="$EXTERNAL_SETUPS $logdir/setup_logging"
- fi
- else
- logdir=$srcdir/src/util/logging
- logreldir=src/util/logging/$logging_name
- logging_subsystems="$logging_subsystems $logreldir"
- logging_subdirs=$logging_name
- for dir in $logging_subdirs ; do
- if test ! -d $logdir/$dir ; then
- AC_MSG_ERROR([$logdir/$dir does not exist. Configure aborted])
- logging_name=none
- fi
- done
- for dir in $logging_subsystems ; do
- if test ! -x $srcdir/$dir/configure ; then
- AC_MSG_ERROR([$logdir/$dir has no configure (required). Configure aborted])
- logging_name=none
- fi
- other_install_dirs="${other_install_dirs} $logreldir"
- done
- fi
-fi
-#
-# FIXME: Logging doesn't necessarily require timing (e.g., simply logging the
-# sequence of routines).
-if test "$logging_name" != "none" ; then
- if test "$enable_timing" != "no" ; then
- if test "$enable_timing" = "default" -o "$enable_timing" = "none" ; then
- enable_timing=log
- timing_name=log
- fi
- logging_dir=logging
- subsystems="$subsystems $logging_subsystems"
- else
- AC_MSG_WARN([Timing was disabled. Logging has been disabled as well.])
- with_logging=no
- logging_name=none
- logging_dir=
- logging_subdirs=
- fi
-else
- if test "$logging_required" = "true" ; then
- AC_MSG_WARN([Timing was enabled with log option but no logging library is available. Timing has been disabled.])
- enable_timing=no
- timing_name=none
- fi
- logging_dir=
- logging_subdirs=
-fi
-if test "$timing_name" != "none" ; then
- timing_kind=`echo $timing_name | \
- tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
- timing_kind=MPID_TIMING_KIND_$timing_kind
- AC_DEFINE_UNQUOTED(HAVE_TIMING,$timing_kind,[define to enable timing collection])
- if test "$collect_stats" = "true" ; then
- AC_DEFINE(COLLECT_STATS,1,[define to enable collection of statistics])
- fi
-fi
-#
-AC_SUBST(logging_dir)
-AC_SUBST(logging_name)
-AC_SUBST(logging_subdirs)
-use_logging_variable="MPID_LOGGING_`echo $logging_name | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`"
-AC_DEFINE_UNQUOTED(USE_LOGGING,$use_logging_variable,[define to choose logging library])
-# ----------------------------------------------------------------------------
-# End of logging tests
-# ----------------------------------------------------------------------------
-
-# ----------------------------------------------------------------------------
-# Check to see if the device does not support spawn.
-# FIXME: This should provide the option of not building the dynamic
-# process routines. It could also allow us to specialize support
-# for all processes are members of MPI_COMM_WORLD (only one comm_world).
-# ----------------------------------------------------------------------------
-if test "$MPID_NO_SPAWN" = yes ; then
- AC_MSG_WARN([The device $with_device does not support MPI dynamic process routines])
-fi
-
-# MPL
-PAC_CONFIG_SUBDIR(src/mpl,,AC_MSG_ERROR(MPL configure failed))
-PAC_PREPEND_FLAG([-lmpl], [WRAPPER_LIBS])
-PAC_APPEND_FLAG([-I${master_top_builddir}/src/mpl/include], [CPPFLAGS])
-PAC_APPEND_FLAG([-I${use_top_srcdir}/src/mpl/include], [CPPFLAGS])
-EXTERNAL_SRC_DIRS="$EXTERNAL_SRC_DIRS src/mpl"
-other_install_dirs="$other_install_dirs src/mpl"
-
-# OpenPA
-AC_ARG_WITH([openpa-prefix],
- [AS_HELP_STRING([[--with-openpa-prefix[=DIR]]],
- [use the OpenPA atomics library installed in DIR,
- rather than the one included in src/openpa. Pass
- "embedded" to force usage of the OpenPA source
- distributed with MPICH2.])],
- [],
- [# see if OPA is already installed on the system
- PAC_PUSH_FLAG([LIBS])
- PAC_PREPEND_FLAG([-lopa],[LIBS])
- AC_LINK_IFELSE([AC_LANG_PROGRAM([dnl
-#include "opa_primitives.h"
-],[
-OPA_int_t i;
-OPA_store_int(i,10);
-OPA_fetch_and_incr_int(&i,5);
-])dnl
- ],
- [with_openpa_prefix=system],[with_openpa_prefix=embedded])
- PAC_POP_FLAG([LIBS])
- ])
-# @opadir@ is used in src/Makefile.sm to control whether or not the OPA in
-# src/openpa is built and installed
-opadir=""
-AC_SUBST([opadir])
-
-if test "$with_openpa_prefix" = "embedded" ; then
- if test -e "${use_top_srcdir}/src/openpa" ; then
- opadir="openpa"
- EXTERNAL_SRC_DIRS="$EXTERNAL_SRC_DIRS src/openpa"
- PAC_APPEND_FLAG([-I${use_top_srcdir}/src/openpa/src],[CPPFLAGS])
- PAC_APPEND_FLAG([-I${master_top_builddir}/src/openpa/src],[CPPFLAGS])
-
- # OPA defaults to "auto", but in MPICH2 we want "auto_allow_emulation" to
- # easily permit using channels like ch3:sock that don't care about atomics
- AC_ARG_WITH([atomic-primitives],
- [AS_HELP_STRING([--with-atomic-primitives],
- [Force OPA to use a specific atomic primitives
- implementation. See the src/openpa directory
- for more info.])],
- [],[with_atomic_primitives=not_specified])
- opa_subdir_args=""
- if test "$with_atomic_primitives" = "not_specified" ; then
- opa_subdir_args="--with-atomic-primitives=auto_allow_emulation"
- fi
- PAC_CONFIG_SUBDIR_ARGS([src/openpa],[$opa_subdir_args],[],[AC_MSG_ERROR([OpenPA configure failed])])
- PAC_PREPEND_FLAG([-lopa],[WRAPPER_LIBS])
-
- other_install_dirs="$other_install_dirs src/openpa"
- else
- AC_MSG_WARN([Attempted to use the embedded OpenPA source tree in "src/openpa", but it is missing. Configuration or compilation may fail later.])
- fi
-elif test "$with_openpa_prefix" = "system" ; then
- PAC_PREPEND_FLAG([-lopa],[WRAPPER_LIBS])
-elif test "$with_openpa_prefix" = "no" ; then
- # The user doesn't want to use OPA. This may or may not cause MPICH2 to
- # fail to configure/build, depending on many other factors.
- :
-else
- # The user specified an already-installed OPA; just sanity check, don't
- # subconfigure it
- AS_IF([test -s "${with_openpa_prefix}/include/opa_primitives.h" -a -s "${with_openpa_prefix}/include/opa_config.h"],
- [:],[AC_MSG_ERROR([the OpenPA installation in "${with_openpa_prefix}" appears broken])])
- PAC_APPEND_FLAG([-I${with_openpa_prefix}/include],[CPPFLAGS])
- PAC_PREPEND_FLAG([-lopa],[WRAPPER_LIBS])
- if test -d ${with_openpa_prefix}/lib64 ; then
- PAC_APPEND_FLAG([-L${with_openpa_prefix}/lib64],[WRAPPER_LDFLAGS])
- fi
- PAC_APPEND_FLAG([-L${with_openpa_prefix}/lib],[WRAPPER_LDFLAGS])
-fi
-
-# ----------------------------------------------------------------------------
-# Threads
-# ----------------------------------------------------------------------------
-#
-# Threads must be supported by the device. First, set the default to
-# be the highest supported by the device
-if test "$enable_threads" = default ; then
- # XXX DJG bug is here, PREREQ is not being used right now
- if test -n "$MPID_MAX_THREAD_LEVEL" ; then
- case $MPID_MAX_THREAD_LEVEL in
- MPI_THREAD_SINGLE) enable_threads=single ;;
- MPI_THREAD_FUNNELED) enable_threads=funneled ;;
- MPI_THREAD_SERIALIZED) enable_threads=serialized ;;
- MPI_THREAD_MULTIPLE) enable_threads=runtime ;;
- *) AC_MSG_ERROR([Unrecognized thread level from device $MPID_MAX_THREAD_LEVEL])
- ;;
- esac
- else
- enable_threads=single
- fi
-fi
-
-if test "$enable_threads" = "yes" ; then
- enable_threads=multiple
-elif test "$enable_threads" = "no" ; then
- enable_threads=single
-elif test "$enable_threads" = "default"; then
- if test "$with_device" = "default" -o "$with_device" = "ch3:sock" ; then
- enable_threads=runtime
- fi
-fi
-
-# Runtime is an alias for multiple with an additional value
-if test "$enable_threads" = "runtime" ; then
- AC_DEFINE(HAVE_RUNTIME_THREADCHECK,1,[Define if MPI supports MPI_THREAD_MULTIPLE with a runtime check for thread level])
- enable_threads=multiple
-fi
-
-MPICH_THREAD_LEVEL=MPI_THREAD_FUNNELED
-case "$enable_threads" in
- single)
- thread_pkg_required=no
- MPICH_THREAD_LEVEL=MPI_THREAD_SINGLE
- ;;
- funneled)
- thread_pkg_required=no
- MPICH_THREAD_LEVEL=MPI_THREAD_FUNNELED
- ;;
- serialized)
- # FIXME: Why does serialized require a thread package?
- thread_pkg_required=yes
- MPICH_THREAD_LEVEL=MPI_THREAD_SERIALIZED
- ;;
- multiple)
- thread_pkg_required=yes
- MPICH_THREAD_LEVEL=MPI_THREAD_MULTIPLE
- ;;
- *)
- AC_MSG_ERROR(["$enable_threads" is not a valid value for --enable-threads])
- ;;
-esac
-# Check that the requested thread level is available.
-threadLevelOK=yes
-if test -z "$MPID_MAX_THREAD_LEVEL" ; then
- if test "$MPICH_THREAD_LEVEL" = "MPI_THREAD_MULTIPLE" -o "$MPICH_THREAD_LEVEL" = "MPI_THREAD_SERIALIZED" ; then
- threadLevelOK=no
- fi
-else
- # Check that MPID_MAX_THREAD_LEVEL is at least as large as the
- # selected MPICH_THREAD_LEVEL
- case $MPICH_THREAD_LEVEL in
- MPI_THREAD_MULTIPLE)
- if test "$MPID_MAX_THREAD_LEVEL" != "MPI_THREAD_MULTIPLE" ; then
- threadLevelOK=no
- fi
- ;;
- MPI_THREAD_SERIALIZED)
- if test "$MPID_MAX_THREAD_LEVEL" != "MPI_THREAD_MULTIPLE" -a \
- "$MPID_MAX_THREAD_LEVEL" != "MPI_THREAD_SERIALIZED" ; then
- threadLevelOK=no
- fi
- ;;
- MPI_THREAD_FUNNELED)
- if test "$MPID_MAX_THREAD_LEVEL" = "MPI_THREAD_SINGLE" ; then
- threadLevelOK=no
- fi
- ;;
- MPI_THREAD_SINGLE)
- ;;
- esac
-fi
-if test "$threadLevelOK" != yes ; then
- AC_MSG_ERROR([The device $with_device does not support $MPICH_THREAD_LEVEL])
-fi
-
-export MPICH_THREAD_LEVEL
-AC_DEFINE_UNQUOTED(MPICH_THREAD_LEVEL,$MPICH_THREAD_LEVEL,[Level of thread support selected at compile time])
-
-if test "$thread_pkg_required" = "no" ; then
- MPIU_THREAD_DEFAULT=${MPIU_THREAD_DEFAULT:-none}
-fi
-export MPIU_THREAD_DEFAULT
-
-# Check for value thread_cs choice; set the refcount default if necessary
-thread_granularity=MPIU_THREAD_GRANULARITY_SINGLE
-thread_refcount=MPIU_REFCOUNT_NONE
-if test "$enable_threads" = "multiple" ; then
- case $enable_thread_cs in
- global)
- thread_granularity=MPIU_THREAD_GRANULARITY_GLOBAL
- if test "$enable_refcount" = "default" ; then enable_refcount=none ; fi
- ;;
- brief-global|brief_global)
- AC_MSG_ERROR([--enable-thread-cs=brief-global is no longer supported, please select a different granularity])
- ;;
- per-object|per_object)
- thread_granularity=MPIU_THREAD_GRANULARITY_PER_OBJECT
- if test "$enable_refcount" = "default" ; then enable_refcount=lock ; fi
- ;;
- lock-free|lock_free|lockfree)
- thread_granularity=MPIU_THREAD_GRANULARITY_LOCK_FREE
- if test "$enable_refcount" = "default" ; then enable_refcount=lock-free ; fi
- if test "$enable_predefined_refcount" = "default" ; then enable_predefined_refcount=no ; fi
- ;;
- *)
- AC_MSG_ERROR([Unrecognized value $enable_thread_cs for --enable-thread-cs])
- ;;
- esac
-
- case $enable_refcount in
- lock)
- thread_refcount=MPIU_REFCOUNT_LOCK
- ;;
- lock-free|lock_free|lockfree)
- thread_refcount=MPIU_REFCOUNT_LOCKFREE
- ;;
- none)
- thread_refcount=MPIU_REFCOUNT_NONE
- ;;
- *)
- AC_MSG_ERROR([Unrecognized value $enable_refcount for --enable-refcount])
- ;;
- esac
-fi
-AC_DEFINE_UNQUOTED([MPIU_THREAD_GRANULARITY],$thread_granularity,[Method used to implement atomic updates and access])
-
-if test "$enable_predefined_refcount" = "no" ; then
- AC_DEFINE([MPIU_THREAD_SUPPRESS_PREDEFINED_REFCOUNTS],[1],[define to disable reference counting predefined objects like MPI_COMM_WORLD])
-fi
-
-case $enable_handle_allocation in
- mutex|default)
- handle_allocation_method=MPIU_HANDLE_ALLOCATION_MUTEX
- ;;
- tls)
- handle_allocation_method=MPIU_HANDLE_ALLOCATION_THREAD_LOCAL
- ;;
- *)
- AC_MSG_ERROR([Unrecognized value $enable_handle_allocation for --enable-handle-allocation])
- ;;
-esac
-AC_DEFINE_UNQUOTED([MPIU_HANDLE_ALLOCATION_METHOD],$handle_allocation_method,[Method used to allocate MPI object handles])
-
-
-AC_DEFINE_UNQUOTED([MPIU_THREAD_REFCOUNT],$thread_refcount,[Method used to implement refcount updates])
-
-# enable-g
-# strip off multiple options, separated by commas
-save_IFS="$IFS"
-IFS=","
-for option in $enable_g ; do
- case "$option" in
- debug|dbg)
- enable_append_g=yes
- ;;
- no|none)
- ;;
- handlealloc)
- perform_handlealloc=yes
- ;;
- handle)
- AC_DEFINE(MPICH_DEBUG_HANDLES,1,[Define to enable handle checking])
- ;;
- instr)
- perform_instr=yes
- ;;
- meminit)
- perform_meminit=yes
- ;;
- memarena)
- perform_memarena=yes
- perform_memtracing=yes
- ;;
- mem)
- perform_memtracing=yes
- ;;
- log)
- perform_dbglog=yes
- ;;
- mutex)
- perform_dbgmutex=yes
- ;;
- mutexnesting)
- perform_mutexnesting=yes
- ;;
- all|yes)
- perform_memtracing=yes
- perform_dbglog=yes
- enable_append_g=yes
- perform_meminit=yes
- perform_instr=yes
- perform_dbgmutex=yes
- perform_mutexnesting=yes
- perform_handlealloc=yes
- ;;
- *)
- IFS=$save_IFS
- AC_MSG_WARN([Unknown value $option for enable-g])
- IFS=","
- ;;
- esac
-done
-IFS="$save_IFS"
-
-if test "$enable_append_g" = "yes" ; then
- CFLAGS="$CFLAGS -g"
- CXXFLAGS="$CXXFLAGS -g"
- FFLAGS="$FFLAGS -g"
- FCFLAGS="$FCFLAGS -g"
-fi
-if test "$enable_append_ndebug" = "yes" ; then
- CFLAGS="$CFLAGS -DNDEBUG -DNVALGRIND"
- CXXFLAGS="$CXXFLAGS -DNDEBUG -DNVALGRIND"
- # MPICH2 do NOT assume any preprocessing support from the Fortran compiler,
- # so no Fortran files contain any preprocessing statements.
- # Don't set FFLAGS or FCFLAGS with any -D.
-fi
-if test -n "$perform_meminit" ; then
- AC_DEFINE(MPICH_DEBUG_MEMINIT,1,[Define to enable preinitialization of memory used by structures and unions])
-fi
-if test "$perform_handlealloc" = yes ; then
- AC_DEFINE(MPICH_DEBUG_HANDLEALLOC,1,[Define to enable checking of handles still allocated at MPI_Finalize])
-fi
-if test "$perform_instr" = yes ; then
- AC_DEFINE(USE_MPIU_INSTR,1,[Define this to enable internal instrumentation] )
-fi
-
-if test -n "$perform_memtracing" ; then
- enable_g_mem=yes
- AC_DEFINE(USE_MEMORY_TRACING,1,[Define to enable memory tracing])
- if test -n "$perform_memarena" ; then
- AC_DEFINE(MPICH_DEBUG_MEMARENA,1,[Define if each function exit should confirm memory arena correctness])
- fi
-fi
-if test -n "$perform_mutexnesting" ; then
- AC_DEFINE(MPICH_DEBUG_MUTEXNESTING,1,[Define to check nesting in mutexes])
-fi
-USE_DBG_LOGGING=0
-if test -n "$perform_dbglog" ; then
- if test "$with_logging" != "none" ; then
- AC_MSG_WARN([--with-logging overrides --enable-g=log])
- else
- AC_DEFINE(USE_DBG_LOGGING,1,[Define to enable logging macros])
- USE_DBG_LOGGING=1
- fi
-fi
-# allow @USE_DBG_LOGGING@ substitution in glue_romio.h
-AC_SUBST([USE_DBG_LOGGING])
-
-if test -n "$perform_dbgmutex" ; then
- AC_DEFINE(MPICH_DEBUG_MUTEX,1,[Define to enable mutex debugging])
-fi
-
-pac_cross_compiling=no
-if test "$with_cross" != "no" ; then
- if test -s "$with_cross" ; then
- AC_MSG_RESULT([Reading values from cross-compilation file $with_cross])
- . $with_cross
- # Autoconf 2.52 no longer sets cross_compiling except with the
- # awkward "targethost" options.
- pac_cross_compiling=yes
- cross_compiling=yes
- ac_cv_prog_cc_cross=yes
- ac_cv_prog_f77_cross=yes
- ac_cv_prog_fc_cross=yes
- ac_cv_prog_cxx_cross=yes
- export cross_compiling
- # Export all cross variables. Any subsidiary configure should also
- # export CROSS_xxx
- rm -f confcross
- (set) 2>&1 | grep CROSS_ | \
- sed -e 's/^/export /g' -e 's/=.*//g' > confcross
- . confcross
- rm -f confcross
- fi
-fi
-
-if test "$enable_nmpi_as_mpi" = yes ; then
- AC_DEFINE(USE_MPI_FOR_NMPI,1,[Define if the NMPI names should use MPI instead of PMPI])
-fi
-
-# This goes here because we need the top_srcdir
-if test "$enable_romio" = "yes" ; then
- if test -d $use_top_srcdir/src/mpi/romio ; then
- subsystems="$subsystems src/mpi/romio"
- AC_DEFINE(HAVE_ROMIO,1,[Define if ROMIO is enabled])
-
- # make it possible to "#include" mpio.h at build time
- #
- # This ought to be sufficient, but there is also a symlink setup in
- # src/include to accomodate current mpicc and MPE2 limitations. See
- # src/mpi/Makefile.mk for more info.
- PAC_APPEND_FLAG([-I${master_top_builddir}/src/mpi/romio/include],[CPPFLAGS])
-
- # Set environment variables that the romio configure expects
- romio_dir=romio
- AC_SUBST(romio_dir)
- export use_top_srcdir
- top_build_dir=`pwd`
- export top_build_dir
- # if there is no $top_build_dir/lib, romio puts lib in wrong place
- # This test used -e under Linux, but not all test programs understand
- # -e
- if test ! -d lib ; then mkdir lib ; fi
- # tell mpi.h to include mpio.h
- PAC_HAVE_ROMIO
- else
- AC_MSG_WARN([ROMIO src directory is not available])
- fi
-fi
-
-AM_CONDITIONAL([BUILD_ROMIO], [test x$enable_romio = xyes])
-
-#
-# FIXME: If an external device, don't necessarily complain (e.g.,
-# if the device is already built)
-if test ! -d $devicedir ; then
- AC_MSG_ERROR([Device $device_name is unknown])
-elif test -f $devicedir/subconfigure.m4 ; then
- # this is a new-style subconfigure device, don't add it as a subsystem
- :
-elif test ! -x $devicedir/configure ; then
- if test -s $devicedir/configure ; then
- AC_MSG_WARN([The configure in $devicedir exists but is not executable])
- else
- AC_MSG_WARN([Device $device_name has no configure])
- fi
- device_name=""
-else
- # Add the device to the configure list
- devsubsystems="$devsubsystems $devicereldir"
- # Make device_name available to subdirs
-fi
-#
-# Allow the device to request that the install step invoke the install
-# target in the device's Makefile.
-if test -n "$device_name" -a "$INSTALL_FROM_DEVICE" = yes ; then
- other_install_dirs="${other_install_dirs} $devicereldir"
-fi
-AC_SUBST(device_name)
-#
-# with-pm
-if test "$with_pm" = "none" ; then
- # add "none" as synonym for "no" to agree with older erroneous docs
- with_pm="no"
-fi
-if test "$MPID_NO_PM" = yes ; then
- if test "$with_pm" != "default" -a "$with_pm" != no ; then
- AC_MSG_ERROR([The PM chosen ($with_pm) is is not valid for the selected device ($with_device)])
- fi
- # This is used to change with_pm=default to with_pm=no in the case
- # where the device does not want a PM
- with_pm=no
-fi
-if test -z "$with_pm" ; then
- with_pm="no"
-fi
-if test "$with_pmi" = "uni" -a "$with_pm" = "default" ; then
- with_pm="no"
-fi
-if test "$with_pm" = "default" -o "$with_pm" = "yes" ; then
- with_pm=hydra
-fi
-
-# We allow multiple pm names, separated by : or ,
-# If multiple PMs are provided, we set the value MANY_PM to yes
-MANY_PM=no
-AC_SUBST(MANY_PM)
-if test "$with_pm" != "no" ; then
- pm_names="`echo $with_pm | sed -e 's/:/ /g' -e 's/,/ /g'`"
-else
- pm_names=""
-fi
-#
-hasError=no
-# We need to be careful about PM's that have either conflicting
-# requirements (e.g., different PMI implementations) or different
-# optional features (e.g., MPID_PM_NAMESERVER).
-# In addition, we need to interleave the setup of the PMI and PM
-# modules. The order is as follows:
-#
-# For each PM, execute the mpich2prereq script for that pm (if present).
-# This script provides information about the PM, including which PMI
-# implementations are supported.
-#
-# Then, for the selected PMI, the setup script (if any) is run. This is
-# necessary because the setup of the PM may require information discovered
-# or provided duing the PMI setup step (e.g., smpd requires this)
-#
-# Finally, for each PM, the setup script is executed.
-#
-# Step 1: invoke the mpich2prereq for each PM
-for pm_name in $pm_names ; do
- if test -z "$first_pm_name" ; then
- first_pm_name=$pm_name
- export first_pm_name
- else
- # Only add to other_pm_names if the directory exists,
- # since the Makefile in src/pm/Makefile will try to cd to
- # that directory
- if test -d $use_top_srcdir/src/pm/$pm_name ; then
- other_pm_names="$other_pm_names $pm_name"
- fi
- fi
- if test ! -d $use_top_srcdir/src/pm/$pm_name ; then
- AC_MSG_WARN([$use_top_srcdir/src/pm/$pm_name does not exist. PM is unknown])
- hasError=yes
- elif test ! -x $use_top_srcdir/src/pm/$pm_name/configure -a \
- ! -f $use_top_srcdir/src/pm/$pm_name/subconfigure.m4 ; then
- if test -s $use_top_srcdir/src/pm/$pm_name/configure ; then
- AC_MSG_WARN([The configure in $use_top_srcdir/src/pm/$pm_name exists but is not executable])
- else
- AC_MSG_WARN([pm $pm_name has no configure or subconfigure.m4])
- fi
- pm_name=""
- hasError=yes
- else
- nameserver=$MPID_PM_NAMESERVER
- if test -f $use_top_srcdir/src/pm/$pm_name/mpich2prereq ; then
- echo sourcing $use_top_srcdir/src/pm/$pm_name/mpich2prereq
- . $use_top_srcdir/src/pm/$pm_name/mpich2prereq
- fi
- # Check for a change; if found, we'll take the default
- if test "$MPID_PM_NAMESERVER" != "$nameserver" ; then
- if test "$first_pm_name" != "$pm_name" ; then
- # Reject suggestion (use the default, common mode)
- MPID_PM_NAMESERVER=""
- fi
- fi
- fi
-done
-if test "$hasError" != no ; then
- AC_MSG_ERROR([Aborting configure because an error was seen in the selection of process managers])
-fi
-#
-# pm_name is the *primary* pm
-pm_name=$first_pm_name
-AC_SUBST(pm_name)
-AC_SUBST(other_pm_names)
-
-# Some versions of PM and PMI require a special definition (currently, only
-# smpd requires this)
-if test "$PMI_REQUIRES_READABLE_TOKENS" = "yes" ; then
- AC_DEFINE(USE_HUMAN_READABLE_TOKENS,1,[Define to use ='s and spaces in the string utilities.])
-fi
-
-if test -n "$first_pm_name" ; then
- other_install_dirs="${other_install_dirs} src/pm/$first_pm_name"
-fi
-# Step 2:
-# Once we've selected the process manager (or managers), we can
-# check that we have a compatible PMI implemenatation.
-# with-pmi
-if test "$MPID_NO_PMI" = yes ; then
- if test "$with_pmi" != "default" -a "$with_pmi" != no ; then
- AC_MSG_ERROR([The PMI chosen ($with_pmi) is is not valid for the selected device ($with_device)])
- fi
- # This is used to change with_pmi=default to with_pmi=no in the case
- # where the device does not want a PMI
- with_pmi=no
-elif test "$with_pmi" != "no" ; then
- if test "$with_pmi" = "default" -o "$with_pmi" = "yes" ; then
- if test -n "$PM_REQUIRES_PMI" ; then
- with_pmi=$PM_REQUIRES_PMI
- else
- with_pmi=simple
- fi
- elif test -n "$PM_REQUIRES_PMI" ; then
- # Test for compatibility between pm and pmi choices
- if test "$PM_REQUIRES_PMI" != "$with_pmi" ; then
- AC_MSG_ERROR([The PM chosen ($with_pm) requires the PMI implementation $PM_REQUIRES_PMI but $with_pmi was selected as the PMI implementation.])
- fi
- fi
- pmi_name=$with_pmi
-
- if test ! -d $use_top_srcdir/src/pmi/$pmi_name ; then
- AC_MSG_WARN([$use_top_srcdir/src/pmi/$pmi_name does not exist. PMI is unknown])
- elif test ! -x $use_top_srcdir/src/pmi/$pmi_name/configure ; then
- if test ! -f $use_top_srcdir/src/pmi/$pmi_name/subconfigure.m4 ; then
- AC_MSG_WARN([pmi $pmi_name has no configure or subconfigure.m4])
- pmi_name=""
- fi
- else
- # only add to subsystems if a full configure is present
- subsystems="$subsystems src/pmi/$pmi_name"
- fi
-else
- AC_MSG_ERROR([A PMI implementation must be selected or the default used.])
-fi
-AC_SUBST(pmi_name)
-
-# Step 3: complete pm setup.
-# Note that checks for errors have already been performed, so this
-# loop does not need to perform any extra error checks.
-# Note that this uses this_pm_name because pm_name must be the *first*
-# of the PM names
-for this_pm_name in $pm_names ; do
- # only add the PM to the subsystems if it has a full configure to be
- # executed
- if test -f $use_top_srcdir/src/pm/$this_pm_name/configure ; then
- subsystems="$subsystems src/pm/$this_pm_name"
- fi
- if test -f $use_top_srcdir/src/pm/$this_pm_name/setup_pm ; then
- echo sourcing $use_top_srcdir/src/pm/$this_pm_name/setup_pm
- . $use_top_srcdir/src/pm/$this_pm_name/setup_pm
- fi
-done
-
-# ----------------------------------------------------------------------------
-if test $with_mpe != no ; then
- if test ! -d $use_top_srcdir/src/mpe2 ; then
- if test $with_mpe = yes ; then
- # No warning message on the default
- AC_MSG_WARN([No MPE directory available])
- fi
- elif test ! -x $use_top_srcdir/src/mpe2/configure ; then
- if test $with_mpe = yes ; then
- # No warning message on the default
- AC_MSG_WARN([No configure available for MPE])
- fi
- else
- subsystems="$subsystems src/mpe2"
- other_install_dirs="$other_install_dirs src/mpe2"
- mpe_dir=mpe2
-
- # for AM_CONDITIONAL
- build_src_mpe2=yes
-
- # Temporarily replace the default NONE value for exec_prefix
- # and prefix with the actual, default values.
- savePrefix=$prefix
- saveExecprefix=$exec_prefix
- test "x$prefix" = xNONE && prefix=$ac_default_prefix
- test "x$exec_prefix" = xNONE && exec_prefix=$prefix
- eval actualbindir=$bindir
- # MPI_CC and MPIF77 must use the local (build) bin dir, not
- # the installation bin dir
- #MPI_CC=$actualbindir/mpicc
- #MPI_F77=$actualbindir/mpif77
- #eval actuallibdir=$libdir
- #MPI_LIBS="-L$actuallibdir -lmpich -lpmpich"
- buildbindir=`pwd`/bin
- #MPI_CC=$buildbindir/mpicc
- #MPI_F77=$buildbindir/mpif77
- prefix=$savePrefix
- exec_prefix=$saveExecprefix
- # NOTE: You must append LIBS to MPI_LIBS before invoking the mpe
- # configure
- #export MPI_CC
- #export MPI_F77
- #export MPI_LIBS
- export use_top_srcdir
- top_build_dir=`pwd`
- export top_build_dir
- fi
-fi
-AC_SUBST(mpe_dir)
-AC_SUBST(other_install_dirs)
-AM_CONDITIONAL([BUILD_SRC_MPE2],[test "X$build_src_mpe2" = "Xyes"])
-
-# Check for whether the compiler defines a symbol that contains the
-# function name. The MPICH2 code, for greater portability, defines
-# its own symbols, FCNAME (a string) and FUNCNAME (a token that is not a
-# string). Code should use these symbols where possible. However,
-# some debugging macros may want to use a compiler-provided symbol
-# for the function name, and this check makes it possible to
-# define such macros in a way that is always correct.
-PAC_CC_FUNCTION_NAME_SYMBOL
-
-# Check if $MPI_DEFAULT_COPTS is valid with $CC
-if test "$enable_default_optimize" = "yes" \
- -a -n "$MPI_DEFAULT_COPTS" ; then
- if test "$enable_check_compiler_flags" = "yes" ; then
- PAC_C_CHECK_COMPILER_OPTION( [$MPI_DEFAULT_COPTS], [
- CFLAGS="$CFLAGS $MPI_DEFAULT_COPTS"
- ] )
- else
- CFLAGS="$CFLAGS $MPI_DEFAULT_COPTS"
- fi
-fi
-
-# Check for support for weak symbols. If not found, set NO_WEAK_SYM
-# to the Make target name understood by simplemake.
-# Set NEEDSPLIB to yes if link commands need both -l$MPILIBNAME
-# and -lp$MPILIBNAME.
-NEEDSPLIB=yes
-NO_WEAK_SYM_TARGET=build_proflib
-if test $enable_weak_symbols = yes ; then
- # Turn off weak symbols if they aren't available
- PAC_PROG_C_WEAK_SYMBOLS(,enable_weak_symbols=no)
-fi
-if test $enable_weak_symbols = "yes" ; then
- AC_DEFINE(USE_WEAK_SYMBOLS,1,[Define if weak symbols should be used])
- NEEDSPLIB=no
- # Check for the ability to support multiple weak symbols
- if test "$pac_cv_prog_c_weak_symbols" = "pragma weak" ; then
- PAC_PROG_C_MULTIPLE_WEAK_SYMBOLS(AC_DEFINE(HAVE_MULTIPLE_PRAGMA_WEAK,1,[Define if multiple weak symbols may be defined]))
- fi
-else
- NO_WEAK_SYM=build_proflib
- PROFILE_DEF_MPI="-DMPICH_MPI_FROM_PMPI"
-fi
-export NEEDSPLIB
-export NO_WEAK_SYM
-export NO_WEAK_SYM_TARGET
-export PROFILE_DEF_MPI
-AC_SUBST(NEEDSPLIB)
-AC_SUBST(NO_WEAK_SYM)
-AC_SUBST(NO_WEAK_SYM_TARGET)
-AC_SUBST(PROFILE_DEF_MPI)
-
-AM_CONDITIONAL([BUILD_PROFILING_LIB],[test "$NEEDSPLIB" = "yes"])
-
-# ---------------------------------------------------------------------------
-# determine rpath and other shared library flags for CC
-# src/env may not exist yet in a vpath build
-$MKDIR_P src/env
-cc_shlib_conf=src/env/cc_shlib.conf
-PAC_COMPILER_SHLIB_FLAGS([CC],[$cc_shlib_conf])
-AC_SUBST_FILE([cc_shlib_conf])
-
-# ---------------------------------------------------------------------------
-# Support for the language bindings: Fortran 77, Fortran 90, and C++
-#
-# First, we handle the case of no explicit enable/disable option. In that
-# case, we look for a usable compiler. We cannot use the ac macros for this
-# because they abort the configure step if they fail to find a compiler
-# (earlier versions of autoconf did not have this behavior!).
-#
-# Second, we perform the langugage-specific tests, if necessary. This may
-# be relatively simple (C++) or complex (Fortran 77, including formation of
-# the encoded MPI handles).
-#
-# Note that the bindings support needs to know some of the properties of
-# the C compiler, so those tests (particularly for weak symbols)
-# must come first.
-# ----------------------------------------------------------------------------
-
-#
-# First, determine whether we are/can support the language bindings
-#
-# Since F90/F90FLAGS are replaced by FC/FCFLAGS, rather than silently
-# substituting them, i.e. FC=$F90 and FCFLAGS=$F90FLAGS, we choose to emit
-# an error message and abort to avoid any ambiguous/hidden bug in choosing
-# Fortran90 compilers.
-if test -n "$F90" -o -n "$F90FLAGS" ; then
- AC_MSG_ERROR([F90 and F90FLAGS are replaced by FC and FCFLAGS respectively in this configure, please unset F90/F90FLAGS and set FC/FCFLAGS instead and rerun configure again.])
-fi
-# ----------------------------------------------------------------------------
-# Handle default choices for the Fortran compilers
-if test "$enable_f77" = "yes" ; then
- # Check for a Fortran compiler
- # FIXME already done earlier
- dnl PAC_PROG_F77
- :
-fi
-
-if test "$enable_f77" = "yes" -a "$F77" = "" ; then
- # No Fortran 77 compiler found; abort
- AC_MSG_ERROR([No Fortran 77 compiler found. If you don't need to
- build any Fortran programs, you can disable Fortran support using
- --disable-f77 and --disable-fc. If you do want to build Fortran
- programs, you need to install a Fortran compiler such as gfortran
- or ifort before you can proceed.])
-fi
-
-if test "$enable_f77" = yes ; then
- # Check if $MPI_DEFAULT_FOPTS is valid with $F77
- if test "$enable_default_optimize" = "yes" \
- -a -n "$MPI_DEFAULT_FOPTS" ; then
- if test "$enable_check_compiler_flags" = "yes" ; then
- PAC_F77_CHECK_COMPILER_OPTION( [$MPI_DEFAULT_FOPTS], [
- FFLAGS="$FFLAGS $MPI_DEFAULT_FOPTS"
- ] )
- else
- FFLAGS="$FFLAGS $MPI_DEFAULT_FOPTS"
- fi
- fi
-fi
-
-#
-# We need to know the name mangling for Fortran before testing for FC
-# compatibility (we need this because of the way we decide to generate
-# the Fortran 77 bindings)
-if test "$enable_f77" = yes ; then
- FLIBS_save="$FLIBS"
- FLIBS=""
- AC_F77_LIBRARY_LDFLAGS
- # The autoconf macro for finding FLIBS sometimes makes mistakes
- # (particularly with the Fujitsu frt compiler). This next step
- # first sees if the FLIBS is valid with the Fortran compiler
- PAC_PROG_F77_FLIBS_VALID
- # Now see if FLIBS works with the C compiler
- PAC_PROG_F77_CHECK_FLIBS
-
- # Check F77+FLAGS is compatible with CC+CFLAGS before using F77+CC.
- PAC_PROG_F77_OBJ_LINKS_WITH_C
-
- PAC_PROG_F77_LINKER_WITH_C
- # For name mangle, we need the library flags
- PAC_PROG_F77_NAME_MANGLE
- # Check whether additional libraries are needed when linking with C
- PAC_PROG_F77_AND_C_STDIO_LIBS
- AC_SUBST(F77_OTHER_LIBS)
-
- # Warn about mixed name mangling, since many of the tests will fail
- if test "$pac_cv_prog_f77_name_mangle" = "mixed" ; then
- AC_MSG_WARN([The compiler $F77 uses mixed case names. Fortran is monocase
-and many Fortran programs may use either upper or lower case names for MPI
-calls. Consider specifying a particular parameter to your Fortran compiler
-to select either upper or lower case names. For the Absoft compiler,
--f selects lower case and -N109 selects upper case (if you use -f, also use
--B108 to enable the iargc and getarg routines, which are needed for some
-tests and by many user programs). Specify new command
-line options by setting the environment variable FFLAGS to include
-the options (e.g., setenv FFLAGS "-f -B108"). In addition, make sure that your
-Fortran 90 compiler uses a compatible naming choice. For the
-Absoft Fortran 90, -YALL_NAMES=LCS selects lower case names and -B108
-adds underscores to names, as required for iargc and getarg. Pass this
-information to configure with the FCFLAGS environment variable.])
- # If Fortran implicitly enabled, disable it now. Otherwise,
- # abort the configure since warning messages are often lost in
- # the output.
- AC_MSG_ERROR([Aborting configure because of mixed case names in Fortran. Either select --disable-f77 or set FFLAGS to force the compiler to select monocase names])
- fi
-
- # The MPI standard requires that MPI_Init in any language initialize
- # MPI in all languages. This can be a problem when objects produced
- # by the Fortran compiler require symbols from the Fortran runtime
- # (making linking C-only programs unnecessarily difficult). What we test
- # here is whether the much more restricted needs of the Fortran
- # initialize can be met with no special use of the Fortran runtime
- PAC_F77_INIT_WORKS_WITH_C
- if test "$pac_f_init_works_with_c" = "yes" ; then
- AC_DEFINE(HAVE_MPI_F_INIT_WORKS_WITH_C,1,[Define if the Fortran init code for MPI works from C programs without special libraries])
- fi
-
-fi
-
-# FC requires F77 as well. If the user disabled f77, do not run the
-# next test; instead, drop into the warning message
-# Set a default value for fc works with f77. This value is
-# set to no *only* if fc was selected but was not compatible with f77
-fc_with_f77=yes
-if test "$enable_fc" = "yes" -a "$enable_f77" = yes ; then
- enable_fc=no
- if test -n "$FC" ; then
- # If we allow multiple weak symbols, we should test a name
- # that does not contain an underscore. The Fortran binding uses
- # this rule for enabling multiple weak symbols:
- # if defined(USE_WEAK_SYMBOLS) && !defined(USE_ONLY_MPI_NAMES) &&
- # defined(HAVE_MULTIPLE_PRAGMA_WEAK) &&
- # defined(F77_NAME_LOWER_2USCORE)
- #
- testRoutine="t1_2"
- if test "$pac_cv_prog_c_multiple_weak_symbols" = "yes" -a \
- "$enable_weak_symbols" = "yes" -a \
- "$pac_cv_prog_f77_name_mangle" = "lower doubleunderscore" ; then
- testRoutine="t12"
- fi
- PAC_FC_AND_F77_COMPATIBLE(fc_with_f77=yes,fc_with_f77=no,$testRoutine)
- if test "$fc_with_f77" != yes ; then
- enable_fc=no
- AC_MSG_ERROR([The selected Fortran 90 compiler $FC does not work with the selected Fortran 77 compiler $F77. Use the environment variables FC and F77 respectively to select compatible Fortran compilers. The check here tests to see if a main program compiled with the Fortran 90 compiler can link with a subroutine compiled with the Fortran 77 compiler.])
- elif test "$fc_with_f77" = "yes" ; then
- # If we got here, there is a Fortran 90 compiler that we can use
- enable_fc=yes
- fi
- elif test "$pac_cv_prog_fc_works" = no; then
- AC_MSG_WARN([Use --disable-fc to keep configure from searching for a Fortran 90 compiler])
- fi
-
- if test "$enable_fc" = "yes" -a "$FC" = "" ; then
- # No Fortran 90 compiler found; abort
- AC_MSG_ERROR([No Fortran 90 compiler found. If you don't need
- to build any Fortran 90 programs, you can disable Fortran 90
- support using --disable-fc. If you do want to build Fortran 90
- programs, you need to install a Fortran 90 compiler such as
- gfortran or ifort before you can proceed.])
- fi
-fi
-
-if test "$enable_fc" = "yes" -a "$enable_f77" != "yes" ; then
- # Fortran 90 support requires compatible Fortran 77 support
- AC_MSG_ERROR([
-Fortran 90 support requires compatible Fortran 77 support.
-To force the use of the Fortran 90 compiler for Fortran 77,
-do not use configure option --disable-f77, and set the environment
-variable F77 to the name of the Fortran 90 compiler, or \$FC.
-If you do not want any Fortran support, use configure options
---disable-f77 and --disable-fc.])
- # We should probably do the compatibility test as well
- enable_f77=yes
-fi
-
-# ----------------------------------------------------------------------------
-# Now test for Fortran compiler characteristics
-# ----------------------------------------------------------------------------
-if test "$enable_f77" = "yes" ; then
- # determine rpath and other shared library flags for F77
- f77_shlib_conf=src/env/f77_shlib.conf
- PAC_COMPILER_SHLIB_FLAGS([F77],[$f77_shlib_conf])
- AC_SUBST_FILE([f77_shlib_conf])
-
- AC_LANG_FORTRAN77
- PAC_PROG_F77_EXCLAIM_COMMENTS(has_exclaim="yes",has_exclaim="no")
- PAC_PROG_F77_HAS_INCDIR(src)
- if test -n "$F77_INCDIR" ; then
- # For building the Fortran files, add the directory where we are building
- # the object to the include list. This is needed for g77, which makes
- # includes relative to the source directory of the file, not the
- # directory that the command is executed in
- FINCLUDES="$F77_INCDIR`pwd`/src"
- fi
- AC_SUBST(FINCLUDES)
- #
- PAC_PROG_F77_LIBRARY_DIR_FLAG
-
- AC_SUBST(MPIFPMPI)
- if test "$MPI_WITH_PMPI" = "no" ; then
- # If the PMPI routines are not in the same library with the MPI
- # routines, we may need to remove the pmpi declarations
- PAC_PROG_F77_ALLOWS_UNUSED_EXTERNALS([MPIFPMPI=",PMPI_WTIME,PMPI_WTICK"],[
- MPIFPMPI="";
- AC_MSG_WARN([Removed PMPI_WTIME and PMPI_WTICK from mpif.h])])
- else
- MPIFPMPI=",PMPI_WTIME,PMPI_WTICK"
- fi
-
- # Once we have name mangle, we can try to limit the number of needed libs
- dnl F77_IN_C_LIBS is not needed currently because mpirinitf_() in setbotf.f
- dnl is called in initthread.c only when FLIBS is not needed to initialize
- dnl Fortran constants from a C main, See PAC_F77_INIT_WORKS_WITH_C.
- dnl PAC_PROG_F77_IN_C_LIBS
- dnl AC_SUBST(F77_IN_C_LIBS)
-
- # Most systems allow the Fortran compiler to process .F and .F90 files
- # using the C preprocessor. However, some systems either do not
- # allow this or have serious bugs (OSF Fortran compilers have a bug
- # that generates an error message from cpp). The following test
- # checks to see if .F works, and if not, whether "cpp -P -C" can be used
- # This is needed for Mac OSX 10.5
- PAC_F77_WORKS_WITH_CPP([F77CPP])
- AC_SUBST(F77CPP)
-
- bindings="$bindings f77"
- bindings_dirs="$bindings_dirs src/binding/f77"
- AC_DEFINE(HAVE_FORTRAN_BINDING,1,[Define if Fortran is supported])
- # Also define the name FORTRAN_BINDING for use in #if @FORTRAN_BINDING at ..
- FORTRAN_BINDING=1
-
-fi
-
-dnl By modifying mpif.h to use ! for comments, it can work with many f90
-dnl compilers without creating a separate version.
-dnl Note that this is run AFTER the AC_OUTPUT actions
-AC_OUTPUT_COMMANDS([if test "$enable_f77" = yes ; then
-if test "$has_exclaim" = "yes" ; then
- sed -e 's/^C/\!/g' src/binding/f77/mpif.h > src/include/mpif.h
- cp src/include/mpif.h src/binding/f77/mpif.h
-else
- cp src/binding/f77/mpif.h src/include
-fi
-if test "$has_fort_real8" = "yes" ; then
- sed -e 's/DOUBLE PRECISION/REAL*8/g' src/include/mpif.h > src/include/mpif.h.new
- mv src/include/mpif.h.new src/include/mpif.h
- cp src/include/mpif.h src/binding/f77/mpif.h
-fi
-fi],
-master_top_srcdir=$master_top_srcdir
-enable_f77=$enable_f77
-enable_fc=$enable_fc
-has_exclaim=$has_exclaim
-has_fort_real8=$pac_cv_fort_real8
-includebuild_dir=$includebuild_dir
-libbuild_dir=$libbuild_dir
-bashWorks=$bashWorks)
-
-if test "$enable_fc" = "yes" ; then
- if test "$enable_f77" != "yes" ; then
- AC_MSG_WARN([Fortran 90 requires Fortran 77])
- enable_fc=no
- else
- bindingsubsystems="$bindingsubsystems src/binding/f90"
- bindings="$bindings f90"
- bindings_dirs="$bindings_dirs src/binding/f90"
- fi
-fi
-
-# Set defaults for these values so that the Makefile in src/bindings/f90
-# is valid even if fc is not enabled (this is necessary for the
-# distclean target)
-MPIMODNAME=mpi
-MPICONSTMODNAME=mpi_constants
-MPISIZEOFMODNAME=mpi_sizeofs
-MPIBASEMODNAME=mpi_base
-if test "$enable_fc" = "yes" ; then
- # determine rpath and other shared library flags for FC
- fc_shlib_conf=src/env/fc_shlib.conf
- PAC_COMPILER_SHLIB_FLAGS([FC],[$fc_shlib_conf])
- AC_SUBST_FILE([fc_shlib_conf])
-
- # Determine characteristics of the Fortran 90 compiler
- # Find a Fortran 90 compiler. Sets FC
- # Work around bug in autoconf that adds -g to FCFLAGS
- saveFCFLAGS="$FCFLAGS"
- dnl FIXME XXX DJG this needs to be reconciled with our separate use of
- dnl AC_PROG_FC earlier
- dnl PAC_PROG_FC
- PAC_PROG_FC_WORKS
- FCFLAGS=$saveFCFLAGS
- if test "$pac_cv_prog_fc_works" = no ; then
- # Reject this compiler
- if test -n "$FC" ; then
- fc_rejected=yes
- oldFC="$FC"
- FC=""
- fi
- fi
-
- # Determine the extension for Fortran 90 files (it isn't always .f90)
- FCEXT=$ac_fc_srcext
- AC_SUBST(FCEXT)
-
- if test -z "$FC" ; then
- if test "$fc_rejected" = "yes" ; then
- AC_MSG_ERROR([Could not find a usable Fortran 90 compiler. The compiler $oldFC may be incompatible with the Fortran 77 compiler $F77; check the output of configure and consult the installation manuals])
- else
- AC_MSG_ERROR([Could not find a usable Fortran 90 compiler.])
- fi
- fi
-
- # Find the extension that this compiler uses for modules.
- # Sets FCMODEXT (and adds it to the list substed)
- # Sets FCMODINCFLAG (and adds it to the list substed)
- PAC_FC_MODULE
- AC_SUBST(FCMODINCSPEC)
- if test "$pac_cv_fc_module_case" = "upper" ; then
- MPIMODNAME=MPI
- MPICONSTMODNAME=MPI_CONSTANTS
- MPISIZEOFMODNAME=MPI_SIZEOFS
- MPIBASEMODNAME=MPI_BASE
- else
- MPIMODNAME=mpi
- MPICONSTMODNAME=mpi_constants
- MPISIZEOFMODNAME=mpi_sizeofs
- MPIBASEMODNAME=mpi_base
- fi
- AC_SUBST(MPIMODNAME)
- AC_SUBST(MPICONSTMODNAME)
- AC_SUBST(MPISIZEOFMODNAME)
- AC_SUBST(MPIBASEMODNAME)
- if test -z "$modincdir" ; then
- # The default module include dir is the same as the include dir
- modincdir=$includedir
- fi
- AC_SUBST(modincdir)
- #
- # Assume that all Fortran 90 compilers accept -I for include directories
- FCINC=-I
- AC_SUBST(FCINC)
- FCINCFLAG=-I
- AC_SUBST(FCINCFLAG)
-
- # Check if $MPI_DEFAULT_FCOPTS is valid with $F90
- if test "$enable_default_optimize" = "yes" \
- -a -n "$MPI_DEFAULT_FCOPTS" ; then
- if test "$enable_check_compiler_flags" = "yes" ; then
- PAC_FC_CHECK_COMPILER_OPTION( [$MPI_DEFAULT_FCOPTS], [
- FCFLAGS="$FCFLAGS $MPI_DEFAULT_FCOPTS"
- ] )
- else
- FCFLAGS="$FCFLAGS $MPI_DEFAULT_FCOPTS"
- fi
- fi
-
- # Most systems allow the Fortran compiler to process .F and .F90 files
- # using the C preprocessor. However, some systems either do not
- # allow this or have serious bugs (OSF Fortran compilers have a bug
- # that generates an error message from cpp). The following test
- # checks to see if .F works, and if not, whether "cpp -P -C" can be used
- PAC_FC_WORKS_WITH_CPP([FCCPP])
- AC_SUBST(FCCPP)
-
- # Check whether additional libraries are needed when linking with C
- PAC_PROG_FC_AND_C_STDIO_LIBS
- AC_SUBST(FC_OTHER_LIBS)
- # ------------------------------------------------
-fi
-
-# ----------------------------------------------------------------------------
-# We previously allowed "default" as a valid value for $enable_cxx. Now we
-# assume its available by default and error out if it doesn't work (just like
-# F77 & FC). The user must pass "--disable-cxx" in order to successfully
-# complete configure in this case.
-if test "$enable_cxx" = "default" ; then
- AC_MSG_ERROR([aborting because "--enable-cxx=default" is no longer a supported value])
-fi
-
-if test "$enable_cxx" = "yes" ; then
- # Another bug in autoconf. The checks for the C++ compiler do not
- # ensure that you can link a program that is built with the C++
- # compiler. We've seen this error with gcc and icc, particularly
- # when those compilers accept C++ language elements but are unable
- # to link programs that are really C++. For that reason,
- # we've added a test to see if the C++ compiler can produce
- # an executable.
- AC_CACHE_CHECK([whether the C++ compiler $CXX can build an executable],
- pac_cv_cxx_builds_exe,[
- AC_LANG_PUSH([C++])
- AC_TRY_LINK([
-class mytest {
- int a;
-public:
- mytest(void) : a(1) {}
- ~mytest(void) {}
-};],[mytest a;],
- pac_cv_cxx_builds_exe=yes, pac_cv_cxx_builds_exe=no)
- AC_LANG_POP([C++])
-])
- if test "$pac_cv_cxx_builds_exe" != yes ; then
- AC_MSG_ERROR([Aborting because C++ compiler does not work. If you do not need a C++ compiler, configure with --disable-cxx])
- fi
- # Recent failures have come when a standard header is loaded
- # The Intel icpc 10.x compiler fails with <string> if gcc 4.2 is installed.
- AC_CACHE_CHECK([whether C++ compiler works with string],pac_cv_cxx_compiles_string,[
- AC_LANG_PUSH([C++])
- AC_TRY_COMPILE([#include <string>],[return 0;],pac_cv_cxx_compiles_string=yes,pac_cv_cxx_compiles_string=no)
- AC_LANG_POP([C++])
-])
- if test "$pac_cv_cxx_compiles_string" != yes ; then
- AC_MSG_WARN([The C++ compiler $CXX cannot compile a program containing the <string> header - this may indicate a problem with the C++ installation. Consider configuing with --disable-cxx])
- fi
-
- AC_LANG_CPLUSPLUS
- AX_CXX_EXCEPTIONS
- AX_CXX_BOOL
- AX_CXX_NAMESPACES
- if test "$ac_cv_cxx_namespaces" != "yes" ; then
- AC_MSG_ERROR([Namespaces are required for the MPI C++ interface])
- fi
- HAVE_CXX_EXCEPTIONS=0
- AC_SUBST(HAVE_CXX_EXCEPTIONS)
- if test "$ac_cv_cxx_exceptions" = "yes" ; then
- HAVE_CXX_EXCEPTIONS=1
- fi
- # iostream and math are needed for examples/cxx/cxxpi.cxx
- AC_CACHE_CHECK([whether <iostream> available],pac_cv_cxx_has_iostream,[
- AC_TRY_COMPILE([
-#include <iostream>
-],[using namespace std;],pac_cv_cxx_has_iostream=yes,pac_cv_cxx_has_iostream=no)])
- if test "$pac_cv_cxx_has_iostream" = yes ; then
- CXX_DEFS="$CXX_DEFS -DHAVE_CXX_IOSTREAM"
- fi
- AX_CXX_NAMESPACE_STD
- if test "$ac_cv_cxx_namespace_std" = "yes" ; then
- CXX_DEFS="$CXX_DEFS -DHAVE_NAMESPACE_STD"
- fi
-
- AC_CACHE_CHECK([whether <math> available],pac_cv_cxx_has_math,[
- AC_TRY_COMPILE([
-#include <math>
-],[using namespace std;],pac_cv_cxx_has_math=yes,pac_cv_cxx_has_math=no)])
- if test "$pac_cv_cxx_has_math" = yes ; then
- CXX_DEFS="$CXX_DEFS -DHAVE_CXX_MATH"
- fi
- AC_SUBST(CXX_DEFS)
-
- # GNU changed the calling conventions between minor releases (!!!)
- # This is too hard to detect, but we should be able to detect
- # the version mismatch. By default, we set the GNU version to 0.
- # In a cross-compiling environment, these can be set with environment
- # variables, either directly or through the standard "CROSS" variable.
- if test -z "$GNUCXX_VERSION" ; then
- if test -n "$CROSS_GNUCXX_VERSION" ; then
- GNUCXX_VERSION=$CROSS_GNUCXX_VERSION
- else
- GNUCXX_VERSION=0
- fi
- fi
- if test -z "$GNUCXX_MINORVERSION" ; then
- if test -n "$CROSS_GNUCXX_MINORVERSION" ; then
- GNUCXX_MINORVERSION=$CROSS_GNUCXX_MINORVERSION
- else
- GNUCXX_MINORVERSION=0
- fi
- fi
- if test "$cross_compiling" = "no" -a "$ac_compiler_gnu" = "yes" -a \
- "$GNUCXX_VERSION" = 0 -a "$GNUCXX_MINORVERSION" = 0 ; then
- ac_vals=""
- AC_MSG_CHECKING([for GNU g++ version])
- AC_TRY_RUN([#include <stdio.h>
-int main() {
- int v = -1, m = -1;
- FILE *fp = fopen("conftest.out","w");
-#ifdef __GNUC_MINOR__
- m = __GNUC_MINOR__;
-#endif
-#ifdef __GNUC__
- v = __GNUC__;
-#endif
- fprintf( fp, "v=%d, m=%d\n", v, m );
- fclose( fp );
- return 0;
-}],ac_vals=`cat conftest.out`)
- if test -n "$ac_vals" ; then
- v=`echo "$ac_vals" | sed -e 's/v=\(.*\),.*/\1/'`
- m=`echo "$ac_vals" | sed -e 's/.*m=\(.*\)/\1/'`
- AC_MSG_RESULT([$v . $m])
- GNUCXX_VERSION=$v
- GNUCXX_MINORVERSION=$m
- else
- AC_MSG_RESULT([unknown])
- fi
- fi
- AC_SUBST(GNUCXX_VERSION)
- AC_SUBST(GNUCXX_MINORVERSION)
-
- bindings="$bindings cxx"
- bindings_dirs="$bindings_dirs src/binding/cxx"
- AC_DEFINE(HAVE_CXX_BINDING,1,[Define if C++ is supported])
- INCLUDE_MPICXX_H='#include "mpicxx.h"'
- AC_SUBST(INCLUDE_MPICXX_H)
-
- # In order to support the Fortran datatypes within C++,
- #
- # FORTRAN_BINDING always has a CPP-time value of either 0 or 1,
- # so that it may be used in #if statements without adding to
- # the CPP name space
- AC_SUBST(FORTRAN_BINDING)
-
- # Special C++ datatypes. Set to DATATYPE NULL first; we'll
- # replace the ones that we have later, after we have determined
- # the C datatypes
- MPIR_CXX_BOOL=0x0c000000
- MPIR_CXX_COMPLEX=0x0c000000
- MPIR_CXX_DOUBLE_COMPLEX=0x0c000000
- MPIR_CXX_LONG_DOUBLE_COMPLEX=0x0c000000
- AC_SUBST(MPIR_CXX_BOOL)
- AC_SUBST(MPIR_CXX_COMPLEX)
- AC_SUBST(MPIR_CXX_DOUBLE_COMPLEX)
- AC_SUBST(MPIR_CXX_LONG_DOUBLE_COMPLEX)
-
- # determine rpath and other shared library flags for CXX
- cxx_shlib_conf=src/env/cxx_shlib.conf
- PAC_COMPILER_SHLIB_FLAGS([CXX],[$cxx_shlib_conf])
- AC_SUBST_FILE([cxx_shlib_conf])
-fi
-
-if test "$enable_cxx" = yes; then
- # Check if $MPI_DEFAULT_CXXOPTS is valid with $CXX
- if test "$enable_default_optimize" = "yes" \
- -a -n "$MPI_DEFAULT_CXXOPTS" ; then
- if test "$enable_check_compiler_flags" = "yes" ; then
- PAC_CXX_CHECK_COMPILER_OPTION( [$MPI_DEFAULT_CXXOPTS], [
- CXXFLAGS="$CXXFLAGS $MPI_DEFAULT_CXXOPTS"
- ] )
- else
- CXXFLAGS="$CXXFLAGS $MPI_DEFAULT_CXXOPTS"
- fi
- fi
-fi
-
-AC_SUBST(bindings)
-# Bindings dirs is used for the installation target
-AC_SUBST(bindings_dirs)
-#
-# ----------------------------------------------------------------------------
-# End of the bindings support
-# ----------------------------------------------------------------------------
-
-AC_LANG_C
-#
-# ----------------------------------------------------------------------------
-# Done with the basic argument processing and decisions about which
-# subsystems to build
-# ----------------------------------------------------------------------------
-
-# Look for perl. Perl is used *only* in the tests of the commands such as
-# mpiexec, mpicc, etc, in test/commands, and in some of the utility
-# programs for processing log files . If perl is not found,
-# MPICH2 may still be built and used.
-# We need the full path to perl since we'll use it as the interpreter for
-# a shell script.
-AC_PATH_PROG(PERL,perl)
-# Look for ar. If we fail, abort
-AC_CHECK_PROGS(AR,ar)
-if test -z "$AR" ; then
- AC_MSG_ERROR([The program ar is required for building MPICH2. Make sure that your path includes ar])
-fi
-
-# FIXME: this is probably unnecessary now that we only do one "ar" at the end
-# (via libtool). If anything, it's likely to cause problems instead.
-# AR_FLAGS provides a way to potentially improve build performance on Mac OSX
-AR_FLAGS=cr
-# this logic is lame, should really write a real test at some point
-AS_CASE([$host],
- # Barry proposes AR_FLAGS="Scq" in trac#754, but that won't work correctly for re-builds
- [*-*-darwin*], [AR_FLAGS=Scr]
-)
-AC_ARG_VAR(AR_FLAGS,[AR command flags]) # causes AC_SUBST too
-
-# Note that we set RANLIB to true if we don't find it (some systems neither
-# need it nor provide it)
-AC_CHECK_PROGS(RANLIB,ranlib,true)
-
-# Check for the killall program; this can be used in some of the tests
-# in test/commands
-AC_CHECK_PROGS(KILLALL,killall,true)
-
-# Does xargs need the -r option to handle the case where the input
-# is empty (gnu utils do, Mac OSX does not accept -r)
-xargs_out=`echo "" | xargs ls | wc -l | sed -e 's/ //g'`
-if test "$xargs_out" != "0" ; then
- XARGS_NODATA_OPT=-r
-fi
-AC_SUBST(XARGS_NODATA_OPT)
-
-AC_PROG_INSTALL
-PAC_PROG_CHECK_INSTALL_WORKS
-#
-# On Mac OS/X, install breaks libraries unless used with the -p switch
-dnl FIXME not necessary now that we are using libtool
-dnl PAC_PROG_INSTALL_BREAKS_LIBS
-# We also need mkdir -p.
-PAC_PROG_MKDIR_P
-PAC_PROG_MAKE
-
-#
-# Check for bash to allow more robust shell scripts
-AC_PATH_PROG(BASH_SHELL,bash)
-#
-# Confirm that bash has working arrays. We can use this to
-# build more robust versions of the scripts (particularly the
-# compliation scripts) by taking advantage of the array features in
-# bash.
-bashWorks=no
-if test -x "$BASH_SHELL" ; then
-changequote(%%,::)dnl
- cat >>conftest <<EOF
-#! $BASH_SHELL
-A[0]="b"
-A[1]="c"
-rc=1
-if test \${A[1]} != "c" ; then rc=2 ; else rc=0 ; fi
-exit \$rc
-EOF
-changequote([,])dnl
- AC_MSG_CHECKING([whether $BASH_SHELL supports arrays])
- chmod +x conftest
- if ./conftest 2>&1 >/dev/null ; then
- bashWorks=yes
- else
- bashWorks=no
- fi
- rm -f conftest*
- AC_MSG_RESULT($bashWorks)
-fi
-dnl BUILD_BASH_SCRIPTS used to be an AC_SUBST
-AM_CONDITIONAL([BUILD_BASH_SCRIPTS], [test "x$bashWorks" = xyes])
-
-# ----------------------------------------------------------------------------
-# Check for the routines and libraries needed for accessing dynamically
-# loaded libraries.
-# This is very approximate for now; it is enough to allow use to experiment
-# with this feature under Linux.
-# ----------------------------------------------------------------------------
-BUILD_DLLS=no
-if test "$enable_dynamiclibs" = "yes" ; then
- AC_CHECK_HEADERS(dlfcn.h)
- AC_SEARCH_LIBS(dlopen,dl)
- AC_CHECK_FUNCS(dlopen dlsym)
- if test "$ac_cv_func_dlopen" = yes -a \
- "$ac_cv_func_dlsym" = yes -a \
- "$ac_cv_header_dlfcn_h" = yes ; then
- AC_DEFINE(USE_DYNAMIC_LIBRARIES,1,[Define if dynamic libraries are available and should be used])
- if test "$enable_sharedlibs" = no -o "$enable_sharedlibs" = none -o \
- -z "$enable_sharedlibs" ; then
- AC_MSG_ERROR([You must specify --enable-sharedlibs=type when building with dynamic libraries])
-dnl # We still need to determine how to build shared libraries
-dnl AC_MSG_CHECKING([for how to build shared library for dynamically loaded libraries])
-dnl PAC_CC_SHAREDLIBS(,CC_SHL,C_LINK_SHL)
-dnl PAC_CC_SHLIB_EXT
-dnl if test "$SHLIB_EXT" = "unknown" ; then
-dnl # Guess that the extension is .so
-dnl SHLIB_EXT=so
-dnl fi
-dnl if test "$CC_SHL" = true ; then
-dnl AC_MSG_RESULT([none found])
-dnl AC_MSG_WARN([Dynamic library support requires shared libraries])
-dnl else
-dnl AC_MSG_RESULT($CC_SHL)
-dnl BUILD_DLLS=yes
-dnl fi
- fi
- fi
- AC_SUBST(BUILD_DLLS)
-
- # Let the DLL code know where we plan to install the libraries.
- # This will make it easier for the user, who may not need
- # to set a search path for the library.
- savePrefix=$prefix
- saveExecprefix=$exec_prefix
- test "x$prefix" = xNONE && prefix=$ac_default_prefix
- test "x$exec_prefix" = xNONE && exec_prefix=$prefix
- eval MPICH2_LIBDIR=$libdir
- prefix=$savePrefix
- exec_prefix=$saveExecprefix
- MPICH2_LIBDIR='"'$MPICH2_LIBDIR'"'
- AC_DEFINE_UNQUOTED(MPICH2_LIBDIR,$MPICH2_LIBDIR,[Name of installation directory intended for MPICH2])
-fi
-
-# ----------------------------------------------------------------------------
-# At this point, we've finally settled on the value of PMPILIBNAME. We
-# can now set NEEDSPLIB.
-if test "$NEEDSPLIB" = yes -a "$PMPILIBNAME" = "$MPILIBNAME" ; then
- NEEDSPLIB=no
-fi
-# Set the defaults for the Fortran libraries to be the same as the C libraries
-if test -z "$MPIFLIBNAME" ; then
- MPIFLIBNAME=$MPILIBNAME
-fi
-if test -z "$PMPIFLIBNAME" ; then
- PMPIFLIBNAME=$PMPILIBNAME
-fi
-
-# ----------------------------------------------------------------------------
-#
-# Add the steps for debugger support
-BUILD_TVDLL=no
-if test "$enable_debuginfo" = "yes" ; then
- # We can build the Totalview interface DLL only if we know how to build
- # shared libraries.
-
- # FIXME is this really the right test?
- # No. Before MPICH2 1.5, there was the capability to build the debugger
- # libraries without forcing the build of shared libraries for everything.
- # There may be some way to restore this capability, but until then, we
- # at least cause the configure to cleanly fail with a clear error message
- if test "X$enable_shared" = "Xyes" ; then
- BUILD_TVDLL=yes
- else
- AC_MSG_ERROR([Building with --enable-debuginfo now requires building with shared library support. Add --enable-shared and reconfigure])
- fi
-
- # One more nasty problem. Totalview relies on debugger symbols
- # being present in the executable. Some experimental versions of
- # gcc (3.2 20020329 for ia64) do *not* include the object symbols
- # when debugging. For HPUX, the necessary linking options are
- # +noobjdebug
- # for C, Fortran, and C++. We don't have a good test for this yet,
- # so we add a warning
- if test "$ac_cv_prog_gcc" = "yes" ; then
- AC_MSG_WARN([Some versions of gcc do not include debugging information
-within the executable. Totalview requires this information to detect
-an MPICH code. If you have trouble, try linking with the additional
-option
- +noobjdebug
-on all link lines (consider adding it to LDFLAGS)])
- fi
- AC_SUBST(BUILD_TVDLL)
-
- # The debugger library name cannot be set until we know the extension
- # of shared libraries - the name is so on most Unix system, dylib on OS X.
- debugger_dir=debugger
- AC_DEFINE(HAVE_DEBUGGER_SUPPORT,1,[Define if debugger support is included])
- # The debugger support requires a shared library. This is handled
- # below, after we check for compiler support for shared libraries
- # Note: if libdir contains exec_prefix, handle the fact that the
- # default exec_prefix is NONE, which (much later in configure)
- # gets turned into the value of prefix
- ##ENVVAR: MPICH_DEBUGLIBNAME - Set this environment variable to
- ## override the default name of the debugger support library.
- ## The default name is libtvmpich2.$SHLIB_EXT (e.g., libtvmpich2.so for
- ## most Unix versions, libtvmpich2.dylib for Mac OSX).
- ##ENVVAR END:
-
- # We are cheating a bit here and reaching inside of the libtool macros to
- # extract the correct shared library extension. It would be nice if this
- # were publicly available in at least the same way that $libext is.
- eval SHLIB_EXT='"'$shrext_cmds'"'
-
- if test -z "$MPICH_DEBUGLIBNAME" ; then
- DEBUGLIBNAME=libtvmpich2.$SHLIB_EXT
- else
- # FIXME DJG I don't think this can be supported arbitrarily by the new
- # build system (I'm not sure it was supported correctly by the old
- # system either)
- AC_MSG_WARN([overriding MPICH_DEBUGLIBNAME is currently untested and probably does not work])
- DEBUGLIBNAME=$MPICH_DEBUGLIBNAME
- fi
- if test "x$exec_prefix" = xNONE ; then
- saveExecPrefix=$exec_prefix
- exec_prefix=$prefix
- eval dlldir=$libdir/$DEBUGLIBNAME
- exec_prefix=$saveExecPrefix
- else
- eval dlldir=$libdir/$DEBUGLIBNAME
- fi
- dlldir='"'$dlldir'"'
- AC_DEFINE_UNQUOTED(MPICH_INFODLL_LOC,$dlldir,[Define as the name of the debugger support library])
-fi
-AC_SUBST(debugger_dir)
-
-# used by automakefiles to conditionally build the DLL
-AM_CONDITIONAL([BUILD_DEBUGGER_DLL], [test x$BUILD_TVDLL = xyes])
-
-# ----------------------------------------------------------------------------
-
-nameserv_name=""
-AC_SUBST(nameserv_name)
-#
-# Get the default nameserver, if no nameserver was selected. A process
-# manager may advertise a nameserver name by setting the variable
-# MPID_PM_NAMESERVER.
-if test "$with_namepublisher" = "default" ; then
- if test -n "$MPID_PM_NAMESERVER" ; then
- with_namepublisher=$MPID_PM_NAMESERVER
- else
- # The default is to use a file to communicate published names
- with_namepublisher=file
- fi
-fi
-
-if test "$with_namepublisher" != no -a "$with_namepublisher" != "none" ; then
- case "$with_namepublisher" in
- none|no) ;;
- # Removed ldap namepublisher hook - we no longer support or distribute
- # the ldap-based name server
- file*)
- # Note that we always build the Makefile for the file version because
- # this name publisher is really too simple to require a
- # separate configure, and we might as well include a basic
- # name publisher with any MPICH2 distribution
- # We DO need to extract the directory name that is used for writing
- # the files, with the User's home directory as the default
- nameserv_name="file"
- basedir=`echo $with_namepublisher | sed -e 's/file://'`
- if test "$basedir" = "$with_namepublisher" ; then
- # Reset since no directory was set.
- basedir='"."';
- fi
- AC_DEFINE_UNQUOTED(FILE_NAMEPUB_BASEDIR,$basedir,[Directory to use in namepub])
- AC_DEFINE(USE_FILE_FOR_NAMEPUB,1,[Define if file should be used for name publisher])
- ;;
-
- mpd)
- nameserv_name="mpd"
- # The mpd nameserver is specific to the mpd process manager
- foundMPD=no
- for pm_name in $pm_names ; do
- if test "$pm_name" = "mpd" ; then
- foundMPD=yes
- break
- fi
- done
- if test "$foundMPD" = no ; then
- AC_MSG_ERROR([The mpd nameserver requires the mpd process manager])
- fi
- ;;
-
- *)
- # Check for a new namepublisher
- dir=$with_namepublisher
- # If we later need args, here is where we can strip them off of the
- # with argument
- if test -d "$use_top_srcdir/src/nameserv/$dir" ; then
- if test -x "$use_top_srcdir/src/nameserv/$dir/configure" ; then
- # Run the configure in this directory if necessary
- subsystems="$subsystems src/nameserv/$dir"
- fi
- nameserv_name=$dir
- else
- AC_MSG_WARN([Unknown name publisher $with_namepublisher])
- fi
- ;;
- esac
-fi
-if test -n "$nameserv_name" ; then
- AC_DEFINE(HAVE_NAMEPUB_SERVICE,1,[Define if a name publishing service is available])
-fi
-AM_CONDITIONAL([BUILD_NAMEPUB_FILE],[test "X$nameserv_name" = "Xfile"])
-AM_CONDITIONAL([BUILD_NAMEPUB_MPD],[test "X$nameserv_name" = "Xmpd"])
-AM_CONDITIONAL([BUILD_NAMEPUB_PMI],[test "X$nameserv_name" = "Xpmi"])
-
-# In case the documentation targets are used, find doctext and attempt to
-# find the source for the doctext LaTeX style files. Use "false" if
-# doctext is not found
-AC_PATH_PROG(DOCTEXT,doctext,false)
-if test -n "$DOCTEXT" -a "$DOCTEXT" != "false" ; then
- if test -z "$DOCTEXTSYTLE" ; then
- AC_MSG_CHECKING([for location of doctext style files])
- dpath=`$DOCTEXT -debug_paths 2>&1 | grep 'default path' | \
- sed -e 's%.*default path\(.*\),%\1:%g'`
- saveIFS="$IFS"
- IFS=": "
- for dir in $dpath ; do
- if test -s $dir/refman.sty ; then
- DOCTEXTSTYLE=$dir
- break
- fi
- done
- IFS="$saveIFS"
- if test -n "$DOCTEXTSTYLE" ; then
- AC_MSG_RESULT($DOCTEXTSTYLE)
- else
- AC_MSG_RESULT([unavailable])
- fi
- fi
-fi
-export DOCTEXT
-export DOCTEXTSTYLE
-AC_SUBST(DOCTEXT)
-AC_SUBST(DOCTEXTSTYLE)
-
-# ----------------------------------------------------------------------------
-# Check for C compiler characteristics
-AC_C_CONST
-AC_C_VOLATILE
-AC_C_RESTRICT
-AC_C_INLINE
-
-PAC_C_GNU_ATTRIBUTE
-# We need to check for the endianess in order to implement the
-# "external32" representations. This defines "WORDS_BIGENDIAN when
-# the system is bigendian.
-# As of autoconf 2.62, this macro takes an additional argument for systems
-# that can produce object files for either endianess.
-# With the as-always-incompatible-with-every-version autoconf, the
-# arguments for this macro *changed* in 2.62 to
-# (if-bigendian,if-littleendian,unknown,universal)
-# The fourth argument is new.
-# Also note that the definition emitted by autoheader requires that gcc
-# be used to compile the programs - other compilers may not define the
-# non-standard __BIG_ENDIAN__ or __LITTLE_ENDIAN__ CPP names on which
-# autoconf 2.62 now depends.
-byteOrdering=unknown
-AC_C_BIGENDIAN(byteOrdering=big,byteOrdering=little,,byteOrdering=universal)
-case $byteOrdering in
- big)
- # Nothing to do - the c_bigendian macro takes care of it
- :
- ;;
- little)
- AC_DEFINE(WORDS_LITTLEENDIAN,1,[Define if words are little endian])
- ;;
- universal)
- AC_DEFINE(WORDS_UNIVERSAL_ENDIAN,1,[Define if configure will not tell us, for universal binaries])
- ;;
- unknown)
- AC_MSG_ERROR([Unable to determine endianess])
- ;;
-esac
-
-# We only need this test if we are using Fortran
-if test "$enable_f77" ; then
- PAC_PROG_C_UNALIGNED_DOUBLES(,
-[AC_MSG_WARN(Your C compiler $CC does not support unaligned accesses
-to doubles. This is required for interoperation with
-Fortran (the Fortran standard requires it).
-You may need to specify an additional argument to your C compiler to
-force it to allow unaligned accesses.)])
-fi
-# Check for __func__ (defined in C99) or __FUNCTION__ (defined in older GCC)
-AC_CACHE_CHECK([whether $CC supports __func__],pac_cv_cc_has___func__,
-[AC_TRY_COMPILE([],
- [const char *cp = __func__; ],pac_cv_cc_has___func__=yes,
-pac_cv_cc_has___func__=no)])
-if test "$pac_cv_cc_has___func__" != "yes" ; then
- AC_CACHE_CHECK([whether $CC supports __FUNCTION__],pac_cv_cc_has___FUNCTION__,
-[AC_TRY_COMPILE([],
- [const char *cp = __FUNCTION__;],pac_cv_cc_has___FUNCTION__=yes,
-pac_cv_cc_has___FUNCTION__=no)])
-fi
-
-# ----------------------------------------------------------------------------
-# Attempt to support dependency handling
-# ----------------------------------------------------------------------------
-# Set a default for MAKE_DEPEND_C
-MAKE_DEPEND_C=true
-AC_SUBST(MAKE_DEPEND_C)
-AC_ARG_ENABLE(dependencies,
- AC_HELP_STRING([--enable-dependencies],
- [Generate dependencies for sourcefiles. This requires
- that the Makefile.in files are also created to support
- dependencies (see maint/updatefiles)]),,enable_dependencies=default)
-
-if test -z "$enable_dependencies" ; then
- enable_dependencies=default
-fi
-if test "$enable_dependencies" = "default" ; then
- # Try to use gcc if available
- enable_dependencies=no
- if test "$ac_cv_prog_gcc" != "yes" ; then
- # See if gcc is available
- AC_CHECK_PROGS(GCC,gcc)
- if test -n "$GCC" ; then
- enable_dependencies=gcc
- else
- # Try for another form, based on the stock compiler on the
- # given system
- ostype=`uname -s`
- case "$ostype" in
- SunOS)
- enable_dependencies=solaris
- ;;
- *)
- # Unrecognized; ignore
- ;;
- esac
- fi
- else
- enable_dependencies=gcc
- fi
- # We use this to indicate that we use gcc for dependencies,
- # even if a different compiler (e.g., pgcc) is selected for
- # compiling the code. This will normally be adequate, even
- # if gcc points to different system header files, we're really
- # only interested in dependencies on the MPICH2 source files.
- if test "$enable_dependencies" = "gcc" ; then
- AC_MSG_RESULT([Using gcc to determine dependencies])
- fi
-fi
-if test "$enable_dependencies" != "no" ; then
- case "$enable_dependencies" in
- gcc|yes)
- # Ensure that the profiling libraries get their targets into
- # the files. Use -MMD if you want the file in the build directory
- # instead of a subdirectory
- MAKE_DEPEND_C="gcc -MM"
- ;;
- solaris)
- # At least some Solaris SunPro compilers accept -xM1 -MT name, though
- # they ignore the -MT name argument.
- MAKE_DEPEND_C="cc -xM1"
- ;;
- *)
- AC_MSG_RESULT([Using $enable_dependencies for MAKE_DEPEND_C])
- MAKE_DEPEND_C="$enable_dependencies"
- ;;
- esac
-fi
-export MAKE_DEPEND_C
-# ----------------------------------------------------------------------------
-# Check on support for long double and long long types. Do this before the
-# structure alignment test because it will test for including those
-# types as well. In addition, allow the device to suppress support for these
-# optional C types by setting MPID_NO_LONG_DOUBLE and/or MPID_NO_LONG_LONG
-# to yes.
-if test "$MPID_NO_LONG_DOUBLE" != "yes" ; then
- AC_CACHE_CHECK([whether long double is supported],
- pac_cv_have_long_double,[
- AC_TRY_COMPILE(,[long double a;],
- pac_cv_have_long_double=yes,pac_cv_have_long_double=no)])
- if test "$pac_cv_have_long_double" = "yes" ; then
- AC_DEFINE(HAVE_LONG_DOUBLE,1,[Define if long double is supported])
- fi
-fi
-if test "$MPID_NO_LONG_LONG" != "yes" ; then
- AC_CACHE_CHECK([whether long long is supported],
- pac_cv_have_long_long,[
- AC_TRY_COMPILE(,[long long a;],
- pac_cv_have_long_long=yes,pac_cv_have_long_long=no)])
- if test "$pac_cv_have_long_long" = "yes" ; then
- AC_DEFINE(HAVE_LONG_LONG_INT,1,[Define if long long is supported])
- fi
-fi
-# ----------------------------------------------------------------------------
-# Get default structure alignment for integers
-dnl PAC_C_MAX_INTEGER_ALIGN places the default alignment into
-dnl pac_cv_c_max_integer_align, with possible values including
-dnl packed (byte), largest, two, four, eight (or other failure message).
-PAC_C_MAX_INTEGER_ALIGN
-
-if test "$pac_cv_c_max_integer_align" = "packed" ; then
- pac_cv_c_struct_align_nr=1
-elif test "$pac_cv_c_max_integer_align" = "two" ; then
- pac_cv_c_struct_align_nr=2
-elif test "$pac_cv_c_max_integer_align" = "four" ; then
- pac_cv_c_struct_align_nr=4
-elif test "$pac_cv_c_max_integer_align" = "eight" ; then
- pac_cv_c_struct_align_nr=8
-fi
-
-if test -n "$pac_cv_c_struct_align_nr" ; then
- AC_DEFINE_UNQUOTED(HAVE_MAX_INTEGER_ALIGNMENT,$pac_cv_c_struct_align_nr,[Controls byte alignment of integer structures (for MPI structs)])
- AC_DEFINE_UNQUOTED(HAVE_MAX_STRUCT_ALIGNMENT,$pac_cv_c_struct_align_nr,[Controls byte alignment of structures (for aligning allocated structures)])
-fi
-# Get default structure alignment for floating point types
-dnl PAC_C_MAX_FP_ALIGN places the default alignment into
-dnl pac_cv_c_max_fp_align, with possible values including
-dnl packed (byte), largest, two, four, eight (or other failure message).
-PAC_C_MAX_FP_ALIGN
-
-if test "$pac_cv_c_max_fp_align" = "packed" ; then
- pac_cv_c_fp_align_nr=1
-elif test "$pac_cv_c_max_fp_align" = "two" ; then
- pac_cv_c_fp_align_nr=2
-elif test "$pac_cv_c_max_fp_align" = "four" ; then
- pac_cv_c_fp_align_nr=4
-elif test "$pac_cv_c_max_fp_align" = "eight" ; then
- pac_cv_c_fp_align_nr=8
-elif test "$pac_cv_c_max_fp_align" = "sixteen" ; then
- pac_cv_c_fp_align_nr=16
-elif test "$pac_cv_c_max_fp_align" = "largest" ; then
- AC_MSG_ERROR([Configure detected unsupported structure alignment rules.])
-fi
-
-if test -n "$pac_cv_c_fp_align_nr" ; then
- AC_DEFINE_UNQUOTED(HAVE_MAX_FP_ALIGNMENT,$pac_cv_c_fp_align_nr,[Controls byte alignment of structures with floats, doubles, and long doubles (for MPI structs)])
-fi
-
-# Test for the alignment of structs containing only long doubles.
-if test "$pac_cv_have_long_double" = yes ; then
- # Check for alignment of just float and double (no long doubles)
- PAC_C_MAX_DOUBLE_FP_ALIGN
- PAC_C_MAX_LONGDOUBLE_FP_ALIGN
- # FIXME: If this alignment is not the same as that for all float types,
- # we need to do something else in the alignment rule code.
- if test "$pac_cv_c_max_fp_align" != "$pac_cv_c_max_longdouble_fp_align" -o \
- "$pac_cv_c_max_fp_align" != "$pac_cv_c_max_double_fp_align" ; then
- AC_MSG_WARN([Structures containing long doubles may be aligned differently from structures with floats or longs. MPICH2 does not handle this case automatically and you should avoid assumed extents for structures containing float types.])
-
- double_align=-1
- case $pac_cv_c_max_double_fp_align in
- packed) double_align=1 ;;
- two) double_align=2 ;;
- four) double_align=4 ;;
- eight) double_align=8 ;;
- esac
- longdouble_align=-1
- case $pac_cv_c_max_longdouble_fp_align in
- packed) longdouble_align=1 ;;
- two) longdouble_align=2 ;;
- four) longdouble_align=4 ;;
- eight) longdouble_align=8 ;;
- sixteen)longdouble_align=16 ;;
- esac
-
- AC_DEFINE_UNQUOTED(HAVE_MAX_DOUBLE_FP_ALIGNMENT,$double_align,[Controls byte alignment of structs with doubles])
- AC_DEFINE_UNQUOTED(HAVE_MAX_LONG_DOUBLE_FP_ALIGNMENT,$longdouble_align,[Controls byte alignment of structs with long doubles])
- fi
-fi
-
-# Test for weird struct alignment rules that vary padding based on
-# size of leading type only.
-PAC_C_DOUBLE_POS_ALIGN
-if test "$pac_cv_c_double_pos_align" = "yes" ; then
- AC_DEFINE_UNQUOTED(HAVE_DOUBLE_POS_ALIGNMENT,1,[Controls how alignment is applied based on position of doubles in the structure])
-fi
-
-# Test for same weird issues with long long int.
-PAC_C_LLINT_POS_ALIGN
-if test "$pac_cv_c_llint_pos_align" = "yes" ; then
- AC_DEFINE_UNQUOTED(HAVE_LLINT_POS_ALIGNMENT,1,[Controls how alignment is applied based on position of long long ints in the structure])
-fi
-
-# Test for double alignment not following all our other carefully constructed rules
-PAC_C_DOUBLE_ALIGNMENT_EXCEPTION
-if test "$pac_cv_c_double_alignment_exception" = "four" ; then
- AC_DEFINE_UNQUOTED(HAVE_DOUBLE_ALIGNMENT_EXCEPTION,4,[Controls how alignment of doubles is performed, separate from other FP values])
-fi
-
-# Test whether pointers can be aligned on a int boundary or require
-# a pointer boundary.
-AC_MSG_CHECKING([for alignment restrictions on pointers])
-AC_TRY_RUN(
-changequote(<<,>>)
-struct foo { int a; void *b; };
-int main() {
- int buf[10];
- struct foo *p1;
- p1=(struct foo*)&buf[0];
- p1->b = (void *)0;
- p1=(struct foo*)&buf[1];
- p1->b = (void *)0;
- return 0;
-changequote([,])
-},pac_cv_pointers_have_int_alignment=yes,pac_cv_pointers_have_int_alignment=no,pac_cv_pointers_have_int_alignment=unknown)
-
-if test "$pac_cv_pointers_have_int_alignment" != "yes" ; then
- AC_DEFINE(NEEDS_POINTER_ALIGNMENT_ADJUST,1,[define if pointers must be aligned on pointer boundaries])
- AC_MSG_RESULT([pointer])
-else
- AC_MSG_RESULT([int or better])
-fi
-
-# There are further alignment checks after we test for int64_t etc. below.
-
-# Get the size of the C types for encoding in the basic datatypes and for
-# the specific-sized integers
-AC_CHECK_SIZEOF(char)
-AC_CHECK_SIZEOF(unsigned char)
-AC_CHECK_SIZEOF(short)
-AC_CHECK_SIZEOF(unsigned short)
-AC_CHECK_SIZEOF(int)
-AC_CHECK_SIZEOF(unsigned int)
-AC_CHECK_SIZEOF(long)
-AC_CHECK_SIZEOF(unsigned long)
-AC_CHECK_SIZEOF(long long)
-AC_CHECK_SIZEOF(unsigned long long)
-AC_CHECK_SIZEOF(float)
-AC_CHECK_SIZEOF(double)
-AC_CHECK_SIZEOF(long double)
-AC_CHECK_SIZEOF(void *)
-
-AC_HEADER_STDC
-AC_CHECK_HEADERS([stddef.h])
-AC_CHECK_SIZEOF(wchar_t, 0, [
-#ifdef HAVE_STDDEF_H
-#include <stddef.h>
-#endif
-])
-
-AC_CHECK_SIZEOF(float_int, 0, [typedef struct { float a; int b; } float_int; ])
-AC_CHECK_SIZEOF(double_int, 0, [typedef struct { double a; int b; } double_int; ])
-AC_CHECK_SIZEOF(long_int, 0, [typedef struct { long a; int b; } long_int; ])
-AC_CHECK_SIZEOF(short_int, 0, [typedef struct { short a; int b; } short_int; ])
-AC_CHECK_SIZEOF(two_int, 0, [typedef struct { int a; int b; } two_int; ])
-AC_CHECK_SIZEOF(long_double_int, 0, [typedef struct { long double a; int b;} long_double_int; ])
-
-# sys/bitypes.h defines the int16_t etc. on some systems (e.g., OSF1).
-# Include it when testing for these types
-AC_CHECK_HEADER(sys/bitypes.h,[use_bitypes="#include <sys/bitypes.h>"
-AC_DEFINE(HAVE_SYS_BITYPES_H,1,[Define if sys/bitypes.h exists])])
-# A C99 compliant compiler should have inttypes.h for fixed-size int types
-AC_CHECK_HEADERS(inttypes.h stdint.h)
-
-# Check for types
-AC_TYPE_INT8_T
-AC_TYPE_INT16_T
-AC_TYPE_INT32_T
-AC_TYPE_INT64_T
-
-# Temporary issue in autoconf integer type checking (remove when
-# autoconf fixes this or provides a workaround for it)
-if test "$ac_cv_c_int8_t" != no ; then
- AC_DEFINE(HAVE_INT8_T,1,[Define if int8_t is supported by the C compiler])
-fi
-if test "$ac_cv_c_int16_t" != no ; then
- AC_DEFINE(HAVE_INT16_T,1,[Define if int16_t is supported by the C compiler])
-fi
-if test "$ac_cv_c_int32_t" != no ; then
- AC_DEFINE(HAVE_INT32_T,1,[Define if int32_t is supported by the C compiler])
-fi
-if test "$ac_cv_c_int64_t" != no ; then
- AC_DEFINE(HAVE_INT64_T,1,[Define if int64_t is supported by the C compiler])
-fi
-
-# The following make these definitions:
-# define _UINT<n>_T 1
-# if uint<n>_t is available. E.g., define _UINT8_T as 1 if uint8_t is available
-# if not available, define uint<n>_t as the related C type, e.g.,
-# define uint8_t unsigned char
-#
-AC_TYPE_UINT8_T
-AC_TYPE_UINT16_T
-AC_TYPE_UINT32_T
-AC_TYPE_UINT64_T
-
-# Temporary issue in autoconf integer type checking (remove when
-# autoconf fixes this or provides a workaround for it)
-if test "$ac_cv_c_uint8_t" != no ; then
- AC_DEFINE(HAVE_UINT8_T,1,[Define if uint8_t is supported by the C compiler])
-fi
-if test "$ac_cv_c_uint16_t" != no ; then
- AC_DEFINE(HAVE_UINT16_T,1,[Define if uint16_t is supported by the C compiler])
-fi
-if test "$ac_cv_c_uint32_t" != no ; then
- AC_DEFINE(HAVE_UINT32_T,1,[Define if uint32_t is supported by the C compiler])
-fi
-if test "$ac_cv_c_uint64_t" != no ; then
- AC_DEFINE(HAVE_UINT64_T,1,[Define if uint64_t is supported by the C compiler])
-fi
-
-# Other C99 types.
-AC_CHECK_HEADERS([stdbool.h complex.h])
-AC_CHECK_SIZEOF([_Bool],0,[
-#ifdef HAVE_STDBOOL_H
-#include <stdbool.h>
-#endif
-])
-AC_CHECK_SIZEOF([float _Complex],0,[
-#ifdef HAVE_COMPLEX_H
-#include <complex.h>
-#endif
-])
-AC_CHECK_SIZEOF([double _Complex],0,[
-#ifdef HAVE_COMPLEX_H
-#include <complex.h>
-#endif
-])
-AC_CHECK_SIZEOF([long double _Complex],0,[
-#ifdef HAVE_COMPLEX_H
-#include <complex.h>
-#endif
-])
-# we need really could just use the result of AC_CHECK_SIZEOF, but having a
-# HAVE_typename macro is useful for consistency
-AC_CHECK_TYPES([_Bool, float _Complex, double _Complex, long double _Complex])
-
-# Generate a hex version of the size of each type
-for type in short int long long_long float double long_double wchar_t \
- float_int double_int long_int short_int two_int long_double_int \
- _Bool float__Complex double__Complex long_double__Complex ; do
- eval len=\$ac_cv_sizeof_$type
- if test -z "$len" ; then
- len=0
- # Check for sizes from the CHECK_SIZEOF_DERIVED macro
- eval pclen=\$ac_cv_sizeof_$type
- if test -n "$pclen" ; then
- len=$pclen
- else
- # check for a non-optional type
- if test $type != long_long -a \
- $type != long_double -a \
- $type != long_double_int -a \
- $type != _Bool -a \
- $type != float__Complex -a \
- $type != double__Complex -a \
- $type != long_double__Complex ; then
- AC_MSG_ERROR([Configure was unable to determine the size of $type ; if cross compiling,
-use the environment variables CROSS_SIZEOF_typename, e.g., CROSS_SIZEOF_SHORT,
-or use the --with-cross=file configure option to specify a file containing
-Bourne (sh) shell assignments to CROSS_SIZEOF_typename for all datatype
-types. The program maint/getcross.c can be compiled and run on the target
-system; this program outputs an appropriate file for the --with-cross option])
- fi
- fi
- fi
- #
- # Take len and turn it into two hex digits (there are 8 bits available
- # in the built-in datatype handle for the length; see
- # src/mpid/common/datatype/mpid_datatype.h)
- if test "$len" -gt 255 ; then
- AC_MSG_ERROR([Type sizes greater than 255 bytes are not supported (type $type is $len bytes)])
- fi
- tmplen=$len
- hexlen=""
- while test $tmplen -gt 0 ; do
- lowdigit=`expr $tmplen - 16 \* \( $tmplen / 16 \)`
- case $lowdigit in
- 10) char=a ;;
- 11) char=b ;;
- 12) char=c ;;
- 13) char=d ;;
- 14) char=e ;;
- 15) char=f ;;
- *) char=$lowdigit ;;
- esac
- hexlen="$char$hexlen"
- tmplen=`expr $tmplen / 16`
- done
- if test $len -lt 16 ; then
- hexlen="0$hexlen"
- fi
- if test $len = 0 ; then
- # This sometimes happens for wchar_t
- hexlen="00";
- fi
- eval len_$type=$hexlen
-done
-# By definition, sizeof char is 1
-MPI_CHAR="0x4c000101"
-MPI_UNSIGNED_CHAR="0x4c000102"
-MPI_SHORT="0x4c00${len_short}03"
-MPI_UNSIGNED_SHORT="0x4c00${len_short}04"
-MPI_INT="0x4c00${len_int}05"
-MPI_UNSIGNED_INT="0x4c00${len_int}06"
-MPI_LONG="0x4c00${len_long}07"
-MPI_UNSIGNED_LONG="0x4c00${len_long}08"
-if test "$len_long_long" != 0 -a "$MPID_NO_LONG_LONG" != yes ; then
- MPI_LONG_LONG="0x4c00${len_long_long}09"
-else
- MPI_LONG_LONG=MPI_DATATYPE_NULL;
-fi
-MPI_FLOAT="0x4c00${len_float}0a"
-MPI_DOUBLE="0x4c00${len_double}0b"
-if test "$len_long_double" != 0 -a "$MPID_NO_LONG_DOUBLE" != yes ; then
- MPI_LONG_DOUBLE="0x4c00${len_long_double}0c"
-else
- MPI_LONG_DOUBLE=MPI_DATATYPE_NULL
-fi
-# If you change MPI_BYTE, you must change it in src/binding/f77/buildiface
-MPI_BYTE="0x4c00010d"
-MPI_WCHAR="0x4c00${len_wchar_t}0e"
-MPI_PACKED="0x4c00010f"
-MPI_LB="0x4c000010"
-MPI_UB="0x4c000011"
-#
-# These should define the mixed types *only* for contiguous data.
-# For example, MPI_SHORT_INT may have a gap; it will need to be defined
-# as a derived type instead. For IA32, this only affects short_int.
-MPI_2INT="0x4c00${len_two_int}16"
-#
-# For now we aren't being too clever about figuring out which of these
-# are in fact contiguous, so these are all allocated as "real" types.
-#
-# These values correspond to direct types 0..5.
-#
-dnl MPI_FLOAT_INT="0x4c00${len_float_int}12"
-dnl MPI_DOUBLE_INT="0x4c00${len_double_int}13"
-dnl MPI_LONG_INT="0x4c00${len_long_int}14"
-dnl MPI_SHORT_INT="0x4c00${len_short_int}15"
-dnl MPI_LONG_DOUBLE_INT="0x4c00${len_long_double_int}17"
-MPI_FLOAT_INT="0x8c000000"
-MPI_DOUBLE_INT="0x8c000001"
-MPI_LONG_INT="0x8c000002"
-MPI_SHORT_INT="0x8c000003"
-if test "$MPID_NO_LONG_DOUBLE" != yes ; then
- MPI_LONG_DOUBLE_INT="0x8c000004"
-else
- MPI_LONG_DOUBLE_INT=MPI_DATATYPE_NULL
-fi
-
-# 2 additional predefined types named in MPI-2
-MPI_SIGNED_CHAR="0x4c000118"
-if test "$len_long_long" != 0 -a "$MPID_NO_LONG_LONG" != yes ; then
- MPI_UNSIGNED_LONG_LONG="0x4c00${len_long_long}19"
-else
- MPI_UNSIGNED_LONG_LONG=MPI_DATATYPE_NULL
-fi
-
-AC_SUBST(MPI_CHAR)
-AC_SUBST(MPI_UNSIGNED_CHAR)
-AC_SUBST(MPI_SHORT)
-AC_SUBST(MPI_UNSIGNED_SHORT)
-AC_SUBST(MPI_INT)
-AC_SUBST(MPI_UNSIGNED_INT)
-AC_SUBST(MPI_LONG)
-AC_SUBST(MPI_UNSIGNED_LONG)
-AC_SUBST(MPI_LONG_LONG)
-AC_SUBST(MPI_FLOAT)
-AC_SUBST(MPI_DOUBLE)
-AC_SUBST(MPI_LONG_DOUBLE)
-AC_SUBST(MPI_BYTE)
-AC_SUBST(MPI_WCHAR)
-AC_SUBST(MPI_PACKED)
-AC_SUBST(MPI_LB)
-AC_SUBST(MPI_UB)
-AC_SUBST(MPI_FLOAT_INT)
-AC_SUBST(MPI_DOUBLE_INT)
-AC_SUBST(MPI_LONG_INT)
-AC_SUBST(MPI_SHORT_INT)
-AC_SUBST(MPI_2INT)
-AC_SUBST(MPI_LONG_DOUBLE_INT)
-AC_SUBST(MPI_SIGNED_CHAR)
-AC_SUBST(MPI_UNSIGNED_LONG_LONG)
-#
-# FIXME: Leftover from separate fortran system
-## Export the basic C types so that the Fortran system can use them
-#export MPI_CHAR
-#export MPI_SHORT
-#export MPI_INT
-#export MPI_LONG
-#export MPI_LONG_LONG
-#export MPI_FLOAT
-#export MPI_DOUBLE
-#export MPI_LONG_DOUBLE
-#
-# Size-specific types. Initialize as NULL
-MPI_REAL4=MPI_DATATYPE_NULL
-MPI_REAL8=MPI_DATATYPE_NULL
-MPI_REAL16=MPI_DATATYPE_NULL
-MPI_COMPLEX8=MPI_DATATYPE_NULL
-MPI_COMPLEX16=MPI_DATATYPE_NULL
-MPI_COMPLEX32=MPI_DATATYPE_NULL
-MPI_INTEGER1=MPI_DATATYPE_NULL
-MPI_INTEGER2=MPI_DATATYPE_NULL
-MPI_INTEGER4=MPI_DATATYPE_NULL
-MPI_INTEGER8=MPI_DATATYPE_NULL
-MPI_INTEGER16=MPI_DATATYPE_NULL
-AC_SUBST(MPI_REAL4)
-AC_SUBST(MPI_REAL8)
-AC_SUBST(MPI_REAL16)
-AC_SUBST(MPI_COMPLEX8)
-AC_SUBST(MPI_COMPLEX16)
-AC_SUBST(MPI_COMPLEX32)
-AC_SUBST(MPI_INTEGER1)
-AC_SUBST(MPI_INTEGER2)
-AC_SUBST(MPI_INTEGER4)
-AC_SUBST(MPI_INTEGER8)
-AC_SUBST(MPI_INTEGER16)
-export MPI_REAL4
-export MPI_REAL8
-export MPI_REAL16
-export MPI_COMPLEX8
-export MPI_COMPLEX16
-export MPI_COMPLEX32
-export MPI_INTEGER1
-export MPI_INTEGER2
-export MPI_INTEGER4
-export MPI_INTEGER8
-export MPI_INTEGER16
-#
-# Try to find corresponding types for the size-specific types.
-#
-# Assume that the float/double/long double are simply spaced
-# Datatypes used up through 26 in Fortran
-# 27,28,29,2a,2b,2c
-if test "$ac_cv_sizeof_float" = "4" ; then
- MPI_REAL4="0x4c000427"
- MPI_COMPLEX8="0x4c000828"
- MPIR_REAL4_CTYPE=float
-fi
-if test "$ac_cv_sizeof_double" = "8" ; then
- MPI_REAL8="0x4c000829"
- MPI_COMPLEX16="0x4c00102a"
- MPIR_REAL8_CTYPE=double
-fi
-if test "$ac_cv_sizeof_long_double" = "16" -a "$MPID_NO_LONG_DOUBLE" != yes ; then
- MPI_REAL16="0x4c00102b"
- MPI_COMPLEX32="0x4c00202c"
- MPIR_REAL16_CTYPE="long double"
-fi
-if test -n "$MPIR_REAL4_CTYPE" ; then
- AC_DEFINE_UNQUOTED(MPIR_REAL4_CTYPE,$MPIR_REAL4_CTYPE,[C type to use for MPI_REAL4])
-fi
-if test -n "$MPIR_REAL8_CTYPE" ; then
- AC_DEFINE_UNQUOTED(MPIR_REAL8_CTYPE,$MPIR_REAL8_CTYPE,[C type to use for MPI_REAL8])
-fi
-if test -n "$MPIR_REAL16_CTYPE" ; then
- AC_DEFINE_UNQUOTED(MPIR_REAL16_CTYPE,$MPIR_REAL16_CTYPE,[C type to use for MPI_REAL16])
-fi
-# For complex 8/16/32, we assume that these are 2 consequetive real4/8/16
-#
-# Search for the integer types
-for type in char short int long long_long ; do
- # ctype is a valid C type which we can use to declare a C version of
- # this item
- ctype=`echo $type | sed 's/_/ /'`
- eval len=\$ac_cv_sizeof_$type
- if test -n "$len" ; then
- case $len in
- 1) if test "$MPI_INTEGER1" = "MPI_DATATYPE_NULL" ; then
- MPI_INTEGER1="0x4c00012d"
- MPIR_INTEGER1_CTYPE="$ctype"
- fi
- ;;
- 2) if test "$MPI_INTEGER2" = "MPI_DATATYPE_NULL" ; then
- MPI_INTEGER2="0x4c00022f"
- MPIR_INTEGER2_CTYPE="$ctype"
- fi
- ;;
- 4) if test "$MPI_INTEGER4" = "MPI_DATATYPE_NULL" ; then
- MPI_INTEGER4="0x4c000430"
- MPIR_INTEGER4_CTYPE="$ctype"
- fi
- ;;
- 8) if test "$MPI_INTEGER8" = "MPI_DATATYPE_NULL" ; then
- MPI_INTEGER8="0x4c000831"
- MPIR_INTEGER8_CTYPE="$ctype"
- fi
- ;;
- 16) if test "$MPI_INTEGER16" = "MPI_DATATYPE_NULL" ; then
- MPI_INTEGER16="0x4c001032"
- MPIR_INTEGER16_CTYPE="$ctype"
- fi
- ;;
- *)
- ;;
- esac
- fi
-done
-#
-# Add the definitions of these types
-if test -n "$MPIR_INTEGER1_CTYPE" ; then
- AC_DEFINE_UNQUOTED(MPIR_INTEGER1_CTYPE,$MPIR_INTEGER1_CTYPE,[C type to use for MPI_INTEGER1])
-fi
-if test -n "$MPIR_INTEGER2_CTYPE" ; then
- AC_DEFINE_UNQUOTED(MPIR_INTEGER2_CTYPE,$MPIR_INTEGER2_CTYPE,[C type to use for MPI_INTEGER2])
-fi
-if test -n "$MPIR_INTEGER4_CTYPE" ; then
- AC_DEFINE_UNQUOTED(MPIR_INTEGER4_CTYPE,$MPIR_INTEGER4_CTYPE,[C type to use for MPI_INTEGER4])
-fi
-if test -n "$MPIR_INTEGER8_CTYPE" ; then
- AC_DEFINE_UNQUOTED(MPIR_INTEGER8_CTYPE,$MPIR_INTEGER8_CTYPE,[C type to use for MPI_INTEGER8])
-fi
-if test -n "$MPIR_INTEGER16_CTYPE" ; then
- AC_DEFINE_UNQUOTED(MPIR_INTEGER16_CTYPE,$MPIR_INTEGER16_CTYPE,[C type to use for MPI_INTEGER16])
-fi
-
-# ----------------------------------------------------------------------------
-
-# C99 types
-# The predefined types must be distinct types (as opposed to aliases to MPI_INT
-# or MPI_WHATEVER) in order to correctly support MPI_Type_{get,set}_name.
-#
-# FIXME the "basic id" portion should be automatically assigned. It's too easy
-# to have a conflict when this is done by hand.
-#
-# Because we make up a matching type for the fixed-width types if one doesn't
-# exist, we don't ever set these to MPI_DATATYPE_NULL. If we come across a
-# platform where 64-bit sizes aren't supported just add a test like the other
-# types.
-MPI_INT8_T=0x4c000137
-MPI_INT16_T=0x4c000238
-MPI_INT32_T=0x4c000439
-MPI_INT64_T=0x4c00083a
-MPI_UINT8_T=0x4c00013b
-MPI_UINT16_T=0x4c00023c
-MPI_UINT32_T=0x4c00043d
-MPI_UINT64_T=0x4c00083e
-
-# The compiler may or may not support these types, depending on its level of C99
-# compliance. We check for each one individually before assigning a handle
-# number.
-MPI_C_BOOL=$MPI_DATATYPE_NULL
-MPI_C_FLOAT_COMPLEX=$MPI_DATATYPE_NULL
-MPI_C_DOUBLE_COMPLEX=$MPI_DATATYPE_NULL
-MPI_C_LONG_DOUBLE_COMPLEX=$MPI_DATATYPE_NULL
-if test ${len__Bool} != 0 ; then
- MPI_C_BOOL=0x4c00${len__Bool}3f
-fi
-if test ${len_float__Complex} != 0 ; then
- MPI_C_FLOAT_COMPLEX=0x4c00${len_float__Complex}40
-fi
-if test ${len_double__Complex} != 0 ; then
- MPI_C_DOUBLE_COMPLEX=0x4c00${len_double__Complex}41
-fi
-if test ${len_long_double__Complex} != 0 ; then
- MPI_C_LONG_DOUBLE_COMPLEX=0x4c00${len_long_double__Complex}42
-fi
-
-AC_SUBST(MPI_INT8_T)
-AC_SUBST(MPI_INT16_T)
-AC_SUBST(MPI_INT32_T)
-AC_SUBST(MPI_INT64_T)
-AC_SUBST(MPI_UINT8_T)
-AC_SUBST(MPI_UINT16_T)
-AC_SUBST(MPI_UINT32_T)
-AC_SUBST(MPI_UINT64_T)
-AC_SUBST(MPI_C_BOOL)
-AC_SUBST(MPI_C_FLOAT_COMPLEX)
-AC_SUBST(MPI_C_DOUBLE_COMPLEX)
-AC_SUBST(MPI_C_LONG_DOUBLE_COMPLEX)
-export MPI_INT8_T
-export MPI_INT16_T
-export MPI_INT32_T
-export MPI_INT64_T
-export MPI_UINT8_T
-export MPI_UINT16_T
-export MPI_UINT32_T
-export MPI_UINT64_T
-export MPI_C_BOOL
-export MPI_C_FLOAT_COMPLEX
-export MPI_C_DOUBLE_COMPLEX
-export MPI_C_LONG_DOUBLE_COMPLEX
-
-
-# ----------------------------------------------------------------------------
-# We can now create the Fortran versions of the datatype values, along with
-# some of the other datatype-dependent sizes
-
-# There are two parts to handling the datatypes:
-# Convert the C datatype values to their Fortran equivalent. This
-# involves converting the hex values for the C version into decimal
-# since standard Fortran does not have hex constants
-#
-# Determine the existence of the Fortran 'sized' types and set those
-# values.
-#
-# In addition, we need to look at a few additional constants that depend
-# on how the compiler sizes some datatypes. These are:
-# STATUS_SIZE, INTEGER_KIND, ADDRESS_KIND, and OFFSET_KIND
-#
-# ----------------------------------------------------------------------------
-if test "$enable_f77" = yes ; then
- # Up to size checking code in master configure.in (where it tries to
- # find the matching C sizes) as part of defining mpi_integer8 etc.
- # The results are available in pac_cv_sizeof_f77_<type>
- # Size is 0 if unknown or unavailable (or cross-compiling)
- # Due to limitations in autoconf, we cannot put these into a loop.
- # We also check integer to find the type of MPI_Fint
- #
- # Cross-compilation results can be included with the --with-cross=file
- # option.
- CROSS_F77_SIZEOF_INTEGER=${CROSS_F77_SIZEOF_INTEGER:-0}
- CROSS_F77_SIZEOF_REAL=${CROSS_F77_SIZEOF_REAL:-0}
- CROSS_F77_SIZEOF_DOUBLE_PRECISION=${CROSS_F77_SIZEOF_DOUBLE_PRECISION:-0}
- PAC_PROG_F77_CHECK_SIZEOF_EXT(integer,$CROSS_F77_SIZEOF_INTEGER)
- PAC_PROG_F77_CHECK_SIZEOF_EXT(real,$CROSS_F77_SIZEOF_REAL)
- PAC_PROG_F77_CHECK_SIZEOF_EXT(double precision,$CROSS_F77_SIZEOF_DOUBLE_PRECISION)
- AC_LANG_FORTRAN77
- # If we have sizes for real and double, we do not need to call
- # mpir_get_fsize at run time.
- # For the size-defined types (e.g., integer*2), we assume that if the
- # compiler allows it, it has the stated size.
- AC_CACHE_CHECK([whether integer*1 is supported],pac_cv_fort_integer1,[
- AC_COMPILE_IFELSE([AC_LANG_PROGRAM(,[ integer*1 i])],
- pac_cv_fort_integer1=yes,
- pac_cv_fort_integer1=no)])
- AC_CACHE_CHECK([whether integer*2 is supported],pac_cv_fort_integer2,[
- AC_COMPILE_IFELSE([AC_LANG_PROGRAM(,[ integer*2 i])],
- pac_cv_fort_integer2=yes,
- pac_cv_fort_integer2=no)])
- AC_CACHE_CHECK([whether integer*4 is supported],pac_cv_fort_integer4,[
- AC_COMPILE_IFELSE([AC_LANG_PROGRAM(,[ integer*4 i])],
- pac_cv_fort_integer4=yes,
- pac_cv_fort_integer4=no)])
- AC_CACHE_CHECK([whether integer*8 is supported],pac_cv_fort_integer8,[
- AC_COMPILE_IFELSE([AC_LANG_PROGRAM(,[ integer*8 i])],
- pac_cv_fort_integer8=yes,
- pac_cv_fort_integer8=no)])
- AC_CACHE_CHECK([whether integer*16 is supported],pac_cv_fort_integer16,[
- AC_COMPILE_IFELSE([AC_LANG_PROGRAM(,[ integer*16 i])],
- pac_cv_fort_integer16=yes,
- pac_cv_fort_integer16=no)])
- AC_CACHE_CHECK([whether real*4 is supported],pac_cv_fort_real4,[
- AC_COMPILE_IFELSE([AC_LANG_PROGRAM(,[ real*4 a])],
- pac_cv_fort_real4=yes,
- pac_cv_fort_real4=no)])
- AC_CACHE_CHECK([whether real*8 is supported],pac_cv_fort_real8,[
- AC_COMPILE_IFELSE([AC_LANG_PROGRAM(,[ real*8 a])],
- pac_cv_fort_real8=yes,
- pac_cv_fort_real8=no)])
- AC_CACHE_CHECK([whether real*16 is supported],pac_cv_fort_real16,[
- AC_COMPILE_IFELSE([AC_LANG_PROGRAM(,[ real*16 a])],
- pac_cv_fort_real16=yes,
- pac_cv_fort_real16=no)])
-
- # Create the default datatype names for the standard MPI Fortran types
- MPI_CHARACTER=0x4c00011a
- AC_SUBST(MPI_CHARACTER)
-
- if test -z "$pac_cv_f77_sizeof_integer" ; then
- AC_MSG_ERROR([Unable to configure with Fortran support because configure could not determine the size of a Fortran INTEGER. Consider setting CROSS_F77_SIZEOF_INTEGER to the length in bytes of a Fortran INTEGER])
- fi
- len_integer=$pac_cv_f77_sizeof_integer
- # Convert to two digit hex
- len=$len_integer
- #
- # Take len and turn it into two hex digits (there are 8 bits available
- # in the built-in datatype handle for the length; see
- # src/mpid/common/datatype/mpid_datatype.h). This code is taken
- # from the code in mpich2/configure.in
- if test "$len" -gt 255 ; then
- AC_MSG_ERROR([Type sizes greater than 255 bytes are not supported (type INTEGER is $len bytes)])
- fi
- tmplen=$len
- hexlen=""
- while test $tmplen -gt 0 ; do
- lowdigit=`expr $tmplen - 16 \* \( $tmplen / 16 \)`
- case $lowdigit in
- 10) char=a ;;
- 11) char=b ;;
- 12) char=c ;;
- 13) char=d ;;
- 14) char=e ;;
- 15) char=f ;;
- *) char=$lowdigit ;;
- esac
- hexlen="$char$hexlen"
- tmplen=`expr $tmplen / 16`
- done
- if test $len -lt 16 ; then
- hexlen="0$hexlen"
- fi
- len_integer=$hexlen
- if test "$len_integer" = 0 ; then
- # We have a problem
- AC_MSG_WARN([Unable to determine size of an INTEGER type; using 4])
- # We make the length 4
- len_integer="04"
- fi
- MPI_INTEGER=0x4c00${len_integer}1b
- MPI_REAL=0x4c00${len_integer}1c
- MPI_LOGICAL=0x4c00${len_integer}1d
- AC_SUBST(MPI_INTEGER)
- AC_SUBST(MPI_REAL)
- AC_SUBST(MPI_LOGICAL)
-
- if test -z "$pac_cv_f77_sizeof_double_precision" ; then
- AC_MSG_ERROR([Unable to configure with Fortran support because configure could not determine the size of a Fortran DOUBLE PRECISION. Consider setting CROSS_F77_SIZEOF_DOUBLE_PRECISION to the length in bytes of a Fortran DOUBLE PRECISION])
- fi
- len_double=$pac_cv_f77_sizeof_double_precision
- # Convert to two digit hex
- len=$len_double
- #
- # Take len and turn it into two hex digits (there are 8 bits available
- # in the built-in datatype handle for the length; see
- # src/mpid/common/datatype/mpid_datatype.h). This code is taken
- # from the code in mpich2/configure.in
- if test "$len" -gt 255 ; then
- AC_MSG_ERROR([Type sizes greater than 255 bytes are not supported (type DOUBLE is $len bytes)])
- fi
- tmplen=$len
- hexlen=""
- while test $tmplen -gt 0 ; do
- lowdigit=`expr $tmplen - 16 \* \( $tmplen / 16 \)`
- case $lowdigit in
- 10) char=a ;;
- 11) char=b ;;
- 12) char=c ;;
- 13) char=d ;;
- 14) char=e ;;
- 15) char=f ;;
- *) char=$lowdigit ;;
- esac
- hexlen="$char$hexlen"
- tmplen=`expr $tmplen / 16`
- done
- if test $len -lt 16 ; then
- hexlen="0$hexlen"
- fi
- len_double=$hexlen
- if test "$len_double" = 0 ; then
- # We have a problem
- AC_MSG_WARN([Unable to determine size of a DOUBLE PRECISION type; using 8])
- # We make the length 8
- len_double="08"
- fi
-
- # Provide the corresponding C types for MPI_REAL and MPI_DOUBLE
- AC_MSG_CHECKING([for C type matching Fortran real])
- noval=yes
- for c_type in float double "long_double" ; do
- eval ctypelen=\$"ac_cv_sizeof_$c_type"
- if test "$pac_cv_f77_sizeof_real" = "$ctypelen" -a \
- "$ctypelen" -gt 0 ; then
- c_type=`echo $c_type | sed -e 's/_/ /g'`
- AC_MSG_RESULT($c_type)
- MPIR_FC_REAL_CTYPE=$c_type
- noval="no"
- break
- fi
- done
- if test "$noval" = "yes" ; then
- # Set a default
- MPIR_RC_REAL_CTYPE="float"
- AC_MSG_RESULT([unavailable])
- fi
-
- noval=yes
- AC_MSG_CHECKING([for C type matching Fortran double])
- for c_type in double "long_double" float ; do
- eval ctypelen=\$"ac_cv_sizeof_$c_type"
- if test "$pac_cv_f77_sizeof_double_precision" = "$ctypelen" -a \
- "$ctypelen" -gt 0 ; then
- c_type=`echo $c_type | sed -e 's/_/ /g'`
- AC_MSG_RESULT($c_type)
- MPIR_FC_DOUBLE_CTYPE=$c_type
- noval="no"
- break
- fi
- done
- if test "$noval" = "yes" ; then
- # Set a default
- MPIR_FC_DOUBLE_CTYPE="double"
- AC_MSG_RESULT([unavailable])
- fi
-
- # These are needed to correctly implement the MPI reduction operations
- AC_DEFINE_UNQUOTED([MPIR_FC_REAL_CTYPE],[$MPIR_FC_REAL_CTYPE],
- [The C type for FORTRAN REAL])
- AC_DEFINE_UNQUOTED([MPIR_FC_DOUBLE_CTYPE],[$MPIR_FC_DOUBLE_CTYPE],
- [The C type for FORTRAN DOUBLE PRECISION])
-
- # Use the proper length values for these items in case we are building
- # with Fortran integers that are not the same size as C ints and
- # reals and double precision that are the same size (not valid Fortran,
- # but used by some applications)
-
- len_2integer=`expr 2 \* $len_integer`
- len_2real=`expr 2 \* $len_integer`
- len_doublecplx=`expr $pac_cv_f77_sizeof_double_precision \* 2`
- if test "$len_doublecplx" = 0 ; then
- # We have a problem
- AC_MSG_WARN([Unable to determine size of a DOUBLE PRECISION type; using 8])
- # We make the length 8*2 (in hex)
- len_doublecplx="16"
- fi
-
- for lenname in len_2integer len_2real len_doublecplx ; do
- eval len=\$$lenname
- if test "$len" -gt 255 ; then
- AC_MSG_ERROR([Type sizes greater than 255 bytes are not supported (type $lenname is $len bytes)])
- fi
- tmplen=$len
- hexlen=""
- while test $tmplen -gt 0 ; do
- lowdigit=`expr $tmplen - 16 \* \( $tmplen / 16 \)`
- case $lowdigit in
- 10) char=a ;;
- 11) char=b ;;
- 12) char=c ;;
- 13) char=d ;;
- 14) char=e ;;
- 15) char=f ;;
- *) char=$lowdigit ;;
- esac
- hexlen="$char$hexlen"
- tmplen=`expr $tmplen / 16`
- done
- if test $len -lt 16 ; then
- hexlen="0$hexlen"
- fi
- eval ${lenname}=$hexlen
- if test "$hexlen" = 0 ; then
- # We have a problem
- AC_MSG_WARN([Unable to determine size of a $lenname type; using 8])
- # We make the length 8
- eval ${lenname}=$hexlen
- fi
- done
-
- MPI_DOUBLE_PRECISION=0x4c00${len_double}1f
- MPI_2INTEGER=0x4c00${len_2integer}20
- MPI_2REAL=0x4c00${len_2real}21
- MPI_COMPLEX=0x4c00${len_2real}1e
- AC_SUBST(MPI_COMPLEX)
- AC_SUBST(MPI_DOUBLE_PRECISION)
- AC_SUBST(MPI_2INTEGER)
- AC_SUBST(MPI_2REAL)
-
-dnl len=$len_doublecplx
-dnl #
-dnl # Take len and turn it into two hex digits (there are 8 bits available
-dnl # in the built-in datatype handle for the length; see
-dnl # src/mpid/common/datatype/mpid_datatype.h). This code is taken
-dnl # from the code in mpich2/configure.in
-dnl if test "$len" -gt 255 ; then
-dnl AC_MSG_ERROR([Type sizes greater than 255 bytes are not supported (type DOUBLE COMPLEX is $len bytes)])
-dnl fi
-dnl tmplen=$len
-dnl hexlen=""
-dnl while test $tmplen -gt 0 ; do
-dnl lowdigit=`expr $tmplen - 16 \* \( $tmplen / 16 \)`
-dnl case $lowdigit in
-dnl 10) char=a ;;
-dnl 11) char=b ;;
-dnl 12) char=c ;;
-dnl 13) char=d ;;
-dnl 14) char=e ;;
-dnl 15) char=f ;;
-dnl *) char=$lowdigit ;;
-dnl esac
-dnl hexlen="$char$hexlen"
-dnl tmplen=`expr $tmplen / 16`
-dnl done
-dnl if test $len -lt 16 ; then
-dnl hexlen="0$hexlen"
-dnl fi
-dnl len_doublecplx=$hexlen
-
- MPI_DOUBLE_COMPLEX=0x4c00${len_doublecplx}22
- MPI_2DOUBLE_PRECISION=0x4c00${len_doublecplx}23
- MPI_2COMPLEX=0x4c00${len_doublecplx}24
- AC_SUBST(MPI_DOUBLE_COMPLEX)
- AC_SUBST(MPI_2DOUBLE_PRECISION)
- AC_SUBST(MPI_2COMPLEX)
-
- #
- # Temporary for the vast majority of systems that use 4 byte reals and
- # 8 byte doubles
- # Lengths at this point are in hex, hence "10" = 10 base 16 = 16 base 10.
- if test "$len_double" = "08" ; then
- F77_COMPLEX8=$MPI_COMPLEX
- fi
- if test "$len_doublecplx" = "10" ; then
- F77_COMPLEX16=$MPI_DOUBLE_COMPLEX
- fi
- if test "$len_long_double" = "10" -a "$MPID_NO_LONG_DOUBLE" != "yes" ; then
- F77_COMPLEX32="0x4c002025"
- else
- F77_COMPLEX32="MPI_DATATYPE_NULL"
- fi
-
- len_2dc=`expr $pac_cv_f77_sizeof_double_precision \* 4`
- firstdigit=0
- seconddigit=0
- while test $len_2dc -ge 16 ; do
- firstdigit=`expr $firstdigit + 1`
- len_2dc=`expr $len_2dc - 16`
- done
- case $len_2dc in
- 10) seconddigit=a ;;
- 11) seconddigit=b ;;
- 12) seconddigit=c ;;
- 13) seconddigit=d ;;
- 14) seconddigit=e ;;
- 15) seconddigit=f ;;
- *) seconddigit=$len_2dc ;;
- esac
- len_2dc="$firstdigit$seconddigit"
- #echo "2double complex = $len_2dc"
- MPI_2DOUBLE_COMPLEX=0x4c00${len_2dc}25
- AC_SUBST(MPI_2DOUBLE_COMPLEX)
- MPI_F77_PACKED=$MPI_PACKED
- MPI_F77_UB=$MPI_UB
- MPI_F77_LB=$MPI_LB
- MPI_F77_BYTE=$MPI_BYTE
- AC_SUBST(MPI_F77_PACKED)
- AC_SUBST(MPI_F77_UB)
- AC_SUBST(MPI_F77_LB)
- AC_SUBST(MPI_F77_BYTE)
- #
- # We must convert all hex values to decimal (!)
- # It would be nice to use expr to extract the next character rather than
- # the heavier-weight sed, but expr under Tru64 Unix discards leading zeros,
- # even when used only with the match (:) command. Rather than have
- # configure figure out if expr works, we just use sed. Sigh.
- for var in CHARACTER INTEGER REAL LOGICAL DOUBLE_PRECISION COMPLEX \
- DOUBLE_COMPLEX 2INTEGER 2REAL 2COMPLEX 2DOUBLE_PRECISION \
- 2DOUBLE_COMPLEX F77_PACKED F77_UB F77_LB F77_BYTE; do
- fullvar="MPI_$var"
- eval fullvarvalue=\$$fullvar
- #echo "$fullvar = $fullvarvalue"
- value=0
- fullvarvalue=`echo $fullvarvalue | sed -e 's/..\(.*\)/\1/'`
- for pos in 3 4 5 6 7 8 9 10 ; do
- # This works, even for Tru64, because only a single character
- # is extracted
- char=`expr $fullvarvalue : '\(.\)'`
- # FIXME: Tru64 Unix eliminates leading zeros (!)
- # How do we fix something that broken?
- fullvarvalue=`echo $fullvarvalue | sed -e 's/.\(.*\)/\1/'`
- case $char in
- a) char=10 ;;
- b) char=11 ;;
- c) char=12 ;;
- d) char=13 ;;
- e) char=14 ;;
- f) char=15 ;;
- esac
- value=`expr $value \* 16 + $char`
- done
- #echo "$fullvar = $value"
- if test "X$value" = "X"; then
- eval origvarvalue=\$$fullvar
- AC_MSG_ERROR([Internal Error: Failed to convert $fullvar value to hex! Original value was $origvarvalue])
- fi
- eval $fullvar=$value
- done
- AC_LANG_C
-
- # Now, handle the sized types
- #
- # Preload the C mpi types
- # THESE MUST MATCH THE DEFINITIONS IN MPI.H and MPIF.H
- # We use these to match the optional Fortran types
- char_mpi=${MPI_CHAR:-0}
- short_mpi=${MPI_SHORT:-0}
- int_mpi=${MPI_INT:-0}
- long_mpi=${MPI_LONG:-0}
- long_long_mpi=${MPI_LONG_LONG:-0}
- float_mpi=${MPI_FLOAT:-0}
- double_mpi=${MPI_DOUBLE:-0}
- long_double_mpi=${MPI_LONG_DOUBLE:-0}
-
- #
- # The following code was correct for MPI-1, which allowed these datatypes
- # to be an alias for another MPI type. MPI-2 requires these to
- # be distinct types, so these are enumerated
- if test "$use_alias_types" = yes ; then
- for len in 1 2 4 8 16 ; do
- eval F77_INTEGER$len=0
- #eval testval=\$"pac_cv_f77_sizeof_integer_$len"
- eval testval=\$"pac_cv_fort_integer$len"
- if test "$testval" = no ; then continue ; fi
- testval=$len
- noval="yes"
- AC_MSG_CHECKING([for C type matching Fortran integer*$len])
- for c_type in char short int long "long_long" ; do
- eval ctypelen=\$"ac_cv_sizeof_$c_type"
- if test "$testval" = "$ctypelen" -a "$ctypelen" -gt 0 ; then
- AC_MSG_RESULT($c_type)
- eval F77_INTEGER$len=\$"${c_type}_mpi"
- noval="no"
- break
- fi
- done
- if test "$noval" = "yes" ; then
- AC_MSG_RESULT([unavailable])
- fi
- done
-
- # Complex is set separately above
- for len in 4 8 16 ; do
- len2=`expr $len + $len`
- eval F77_REAL$len=0
- #eval F77_COMPLEX$len2=0
- #eval testval=\$"pac_cv_f77_sizeof_real_$len"
- eval testval=\$"pac_cv_fort_real$len"
- if test "$testval" = no ; then continue ; fi
- testval=$len
- noval="yes"
- AC_MSG_CHECKING([for C type matching Fortran real*$len])
- for c_type in float double "long_double" ; do
- eval ctypelen=\$"ac_cv_sizeof_$c_type"
- if test "$testval" = "$ctypelen" -a "$ctypelen" -gt 0 ; then
- AC_MSG_RESULT($c_type)
- eval F77_REAL$len=\$"${c_type}_mpi"
- #eval F77_COMPLEX$len2=\$"${c_type}_cplx_mpi"
- noval="no"
- break
- fi
- done
- if test "$noval" = "yes" ; then
- AC_MSG_RESULT([unavailable])
- fi
- done
- else
- # Simply determine which types exist. These may have been set by the
- # toplevel configure
- for var in INTEGER1 INTEGER2 INTEGER4 INTEGER8 INTEGER16 \
- REAL4 REAL8 REAL16 COMPLEX8 COMPLEX16 COMPLEX32 ; do
- eval varname=MPI_$var
- eval varvalue=\$$varname
- #echo "$varname = $varvalue"
- if test "$varvalue" = MPI_DATATYPE_NULL ; then
- eval F77_$var=0
- else
- eval F77_$var=\$$varname
- fi
- done
- fi
- # We must convert all hex values to decimal (!)
- for var in INTEGER1 INTEGER2 INTEGER4 INTEGER8 INTEGER16 \
- REAL4 REAL8 REAL16 COMPLEX8 COMPLEX16 COMPLEX32 ; do
- fullvar="F77_$var"
- eval fullvarvalue=\$$fullvar
- if test "$fullvarvalue" = 0 -o -z "$fullvarvalue" ; then
- eval $fullvar=MPI_DATATYPE_NULL
- continue
- fi
- #echo "$fullvar = $fullvarvalue"
- value=0
- # See the comments above on why expr with : cannot be used here
- fullvarvalue=`echo $fullvarvalue | sed -e 's/..\(.*\)/\1/'`
- for pos in 3 4 5 6 7 8 9 10 ; do
- #char=`expr substr $fullvarvalue $pos 1`
- char=`expr $fullvarvalue : '\(.\)'`
- # We don't test for success of expr here because some expr's are
- # buggy and set the status to one on expressions like
- # expr 00ccc : '\(.\)'
- # while both
- # expr 00ccc : '\(..\)'
- # and
- # expr 100cc : '\(.\)'
- # return a zero status. So the status is set even on success,
- # if the result is a single character that is a zero (!)
- #rc=$?
- #if test "$rc" != 0 ; then
- dnl # AC_MSG_WARN([Failure (status $rc) in extracting first char from $fullvarvalue])
- # break
- #fi
- fullvarvalue=`echo $fullvarvalue | sed -e 's/.\(.*\)/\1/'`
- case $char in
- a) char=10 ;;
- b) char=11 ;;
- c) char=12 ;;
- d) char=13 ;;
- e) char=14 ;;
- f) char=15 ;;
- esac
- value=`expr $value \* 16 + $char`
- if test $? != 0 ; then
- AC_MSG_WARN([Failure to evaluate $value \* 16 + $char])
- fi
- done
- #echo "$fullvar = $value"
- eval $fullvar=$value
- done
- AC_SUBST(F77_INTEGER1)
- AC_SUBST(F77_INTEGER2)
- AC_SUBST(F77_INTEGER4)
- AC_SUBST(F77_INTEGER8)
- AC_SUBST(F77_INTEGER16)
- AC_SUBST(F77_REAL4)
- AC_SUBST(F77_REAL8)
- AC_SUBST(F77_REAL16)
- AC_SUBST(F77_COMPLEX8)
- AC_SUBST(F77_COMPLEX16)
- AC_SUBST(F77_COMPLEX32)
-
- noval="yes"
- AC_MSG_CHECKING([for C type matching Fortran integer])
- for c_type in char short int long "long_long" ; do
- eval ctypelen=\$"ac_cv_sizeof_$c_type"
- if test "$pac_cv_f77_sizeof_integer" = "$ctypelen" -a \
- "$ctypelen" -gt 0 ; then
- c_type=`echo $c_type | sed -e 's/_/ /g'`
- AC_MSG_RESULT($c_type)
- MPI_FINT=$c_type
- noval="no"
- break
- fi
- done
- if test "$noval" = "yes" ; then
- # Set a default
- MPI_FINT="int"
- AC_MSG_RESULT([unavailable])
- fi
- # We also need to check the size of MPI_Aint vs MPI_Fint, and
- # define AINT_LARGER_THAN_FINT if aint is larger (this
- # affects code in MPI_Address)
- if test "$ac_cv_sizeof_void_p" != "0" -a \
- "$ac_cv_sizeof_void_p" -gt "$pac_cv_f77_sizeof_integer" ; then
- AC_DEFINE(HAVE_AINT_LARGER_THAN_FINT,1,[Define if addresses are larger than Fortran integers])
- fi
- if test "$ac_cv_sizeof_void_p" != 0 -a \
- "$ac_cv_sizeof_void_p" != "$pac_cv_f77_sizeof_integer" ; then
- AC_DEFINE(HAVE_AINT_DIFFERENT_THAN_FINT,1,[Define if addresses are a different size than Fortran integers])
- fi
-
- # Include a defined value for Fint is int
- if test "$MPI_FINT" = "int" ; then
- AC_DEFINE(HAVE_FINT_IS_INT,1,[Define if Fortran integer are the same size as C ints])
- elif test "$SIZEOF_F77_INTEGER" != "$ac_cv_sizeof_int" ; then
- # Make this fatal because we do not want to build a broken fortran
- # interface (was error)
- # Check to see if the f77 binding has enabled the code to support
- # the case of int != fint.
- if grep HAVE_FINT_IS_INT $master_top_srcdir/src/binding/f77/testf.c 2>&1 1>/dev/null ; then
- AC_MSG_WARN([Fortran integers and C ints are not the same size. Support for this case is experimental; use at your own risk])
- else
- AC_MSG_ERROR([Fortran integers and C ints are not the same size. The current Fortran binding does not support this case. Either force the Fortran compiler to use integers of $ac_cv_sizeof_int bytes, or use --disable-f77 on the configure line for MPICH2.])
- fi
- fi
-
- #
- # Set size of MPI_Status. We may need sizeof_int here as well
- #
-
- #
- # The size of MPI_Status is needed for the Fortran interface.
- # This is not quite right unless the device setup script, executed above,
- # sets the EXTRA_STATUS_DECL that will be used in defining a status.
- # The default size assumes that there are 5 ints
- AC_CACHE_CHECK([for size of MPI_Status],pac_cv_sizeof_mpi_status,[
- rm -f pac_mpi_status.h
- cat > pac_mpi_status.h <<_EOF
-typedef struct {
- int count;
- int cancelled;
- int MPI_SOURCE;
- int MPI_TAG;
- int MPI_ERROR;
- $EXTRA_STATUS_DECL
-} MPI_Status;
-_EOF
- dnl another alternative is to use AC_CHECK_SIZEOF as follows:
- dnl AC_CHECK_SIZEOF([MPI_Status],[], [#include "pac_status.h"])
- dnl But AC_CHECK_SIZEOF has its own AC_MSG_CHECKING, so can't use
- dnl AC_CACHE_CHECK, so use AC_COMPUTE_INT here.
- default_status_size=`expr 5 \* $ac_cv_sizeof_int`
- AC_COMPUTE_INT([pac_cv_sizeof_mpi_status],
- [sizeof(MPI_Status)],
- [#include "pac_mpi_status.h"],
- [pac_cv_sizeof_mpi_status=$default_status_size])
- rm -f pac_mpi_status.h
- ])
-
- SIZEOF_MPI_STATUS=$pac_cv_sizeof_mpi_status
- export SIZEOF_MPI_STATUS
- AC_SUBST(SIZEOF_MPI_STATUS)
-
- if test -z "$MPI_STATUS_SIZE" ; then
- if test -n "$SIZEOF_MPI_STATUS" ; then
- # compute from the C sizeof
- MPI_STATUS_SIZE=`expr $SIZEOF_MPI_STATUS / $ac_cv_sizeof_int`
- if test "$MPI_STATUS_SIZE" = "0" ; then
- AC_MSG_WARN([Could not compute the size of MPI_Status])
- MPI_STATUS_SIZE=5
- fi
- else
- AC_MSG_WARN([MPI_STATUS_SIZE was not defined!])
- # The default size is 5. See mpi.h.in
- MPI_STATUS_SIZE=5
- fi
- fi
- AC_SUBST(MPI_STATUS_SIZE)
- MPIF_STATUS_SIZE=$MPI_STATUS_SIZE
- AC_DEFINE_UNQUOTED(MPIF_STATUS_SIZE,$MPIF_STATUS_SIZE,[Size of an MPI_STATUS, in Fortran, in Fortran integers])
-
- # We must convert all hex values to decimal (!).
- # This is for the C types so they are also available in Fortran
- for var in CHAR SIGNED_CHAR UNSIGNED_CHAR WCHAR SHORT \
- UNSIGNED_SHORT INT UNSIGNED_INT LONG UNSIGNED_LONG \
- FLOAT DOUBLE LONG_DOUBLE LONG_LONG_INT \
- UNSIGNED_LONG_LONG LONG_LONG FLOAT_INT DOUBLE_INT \
- LONG_INT SHORT_INT "2INT" LONG_DOUBLE_INT \
- INT8_T INT16_T INT32_T INT64_T \
- UINT8_T UINT16_T UINT32_T UINT64_T \
- C_BOOL C_FLOAT_COMPLEX C_DOUBLE_COMPLEX \
- C_LONG_DOUBLE_COMPLEX AINT OFFSET ; do
- fullvar="MPI_$var"
- fullf77var="MPI_F77_$var"
- eval fullvarvalue=\$$fullvar
- #echo "$fullvar = $fullvarvalue"
- if test "x$fullvarvalue" = "x" -o \
- "x$fullvarvalue" = "xMPI_DATATYPE_NULL" ; then
- eval $fullf77var="MPI_DATATYPE_NULL"
- continue
- fi
- value=0
- fullvarvalue=`echo $fullvarvalue | sed -e 's/..\(.*\)/\1/'`
- offset=0
- for pos in 3 4 5 6 7 8 9 10 ; do
- # This works, even for Tru64, because only a single character
- # is extracted
- char=`expr $fullvarvalue : '\(.\)'`
- # FIXME: Tru64 Unix eliminates leading zeros (!)
- # How do we fix something that broken?
- fullvarvalue=`echo $fullvarvalue | sed -e 's/.\(.*\)/\1/'`
- case $char in
- a) char=10 ;;
- b) char=11 ;;
- c) char=12 ;;
- d) char=13 ;;
- e) char=14 ;;
- f) char=15 ;;
- esac
- # For Fortran, if the value is too big for an unsigned int,
- # we need to make it a signed (negative) int. Currently, the
- # types in this class are the minloc/maxloc types.
- if test $pos = 3 -a $char -ge 8 ; then
- #echo "for $var in position $pos found a value >= 8"
- char=`expr $char - 8`
- offset=-2147483648
- fi
- value=`expr $value \* 16 + $char`
- done
- if test "$offset" != 0 ; then
- #echo "$fullf77var: $value, $offset"
- value=`expr $value + $offset`
- fi
- #echo "$fullf77var = $value"
- eval $fullf77var=$value
- done
- AC_SUBST(MPI_F77_CHAR)
- AC_SUBST(MPI_F77_SIGNED_CHAR)
- AC_SUBST(MPI_F77_UNSIGNED_CHAR)
- AC_SUBST(MPI_F77_WCHAR)
- AC_SUBST(MPI_F77_SHORT)
- AC_SUBST(MPI_F77_UNSIGNED_SHORT)
- MPI_F77_UNSIGNED=$MPI_F77_UNSIGNED_INT
- AC_SUBST(MPI_F77_UNSIGNED)
- AC_SUBST(MPI_F77_INT)
- AC_SUBST(MPI_F77_LONG)
- AC_SUBST(MPI_F77_UNSIGNED_LONG)
- AC_SUBST(MPI_F77_FLOAT)
- AC_SUBST(MPI_F77_DOUBLE)
- AC_SUBST(MPI_F77_LONG_DOUBLE)
- AC_SUBST(MPI_F77_UNSIGNED_LONG_LONG)
- MPI_F77_LONG_LONG_INT=$MPI_F77_LONG_LONG
- AC_SUBST(MPI_F77_LONG_LONG_INT)
- AC_SUBST(MPI_F77_LONG_LONG)
- AC_SUBST(MPI_F77_FLOAT_INT)
- AC_SUBST(MPI_F77_DOUBLE_INT)
- AC_SUBST(MPI_F77_LONG_INT)
- AC_SUBST(MPI_F77_SHORT_INT)
- AC_SUBST(MPI_F77_2INT)
- AC_SUBST(MPI_F77_LONG_DOUBLE_INT)
- AC_SUBST(MPI_F77_INT8_T)
- AC_SUBST(MPI_F77_INT16_T)
- AC_SUBST(MPI_F77_INT32_T)
- AC_SUBST(MPI_F77_INT64_T)
- AC_SUBST(MPI_F77_UINT8_T)
- AC_SUBST(MPI_F77_UINT16_T)
- AC_SUBST(MPI_F77_UINT32_T)
- AC_SUBST(MPI_F77_UINT64_T)
- AC_SUBST(MPI_F77_C_BOOL)
- AC_SUBST(MPI_F77_C_FLOAT_COMPLEX)
- # C_COMPLEX is an alias for FLOAT_COMPLEX
- MPI_F77_C_COMPLEX=$MPI_F77_C_FLOAT_COMPLEX
- AC_SUBST(MPI_F77_C_COMPLEX)
- AC_SUBST(MPI_F77_C_DOUBLE_COMPLEX)
- AC_SUBST(MPI_F77_C_LONG_DOUBLE_COMPLEX)
- # these two are not yet defined, but AC_SUBST only cares about them at
- # AC_OUTPUT-time
- AC_SUBST(MPI_F77_AINT)
- AC_SUBST(MPI_F77_OFFSET)
-
- # Try and compute the values of .true. and .false. in Fortran
- # This code has been removed because the Fortran binding code does
- # not yet support it.
- PAC_F77_LOGICALS_IN_C([$MPI_FINT])
-
- # Check if multiple __attribute__((alias)) is available
- if test "$enable_multi_aliases" = "yes" ; then
- PAC_C_MULTI_ATTR_ALIAS
- if test "$pac_c_multi_attr_alias" = "yes" ; then
- PAC_F2C_ATTR_ALIGNED_SIZE([1],[CMB_1INT_ALIGNMENT])
- AC_SUBST(CMB_1INT_ALIGNMENT)
- PAC_F2C_ATTR_ALIGNED_SIZE([$MPI_STATUS_SIZE],[CMB_STATUS_ALIGNMENT],
- [32])
- AC_SUBST(CMB_STATUS_ALIGNMENT)
- if test "X$CMB_1INT_ALIGNMENT" != "X" \
- -a "X$CMB_STATUS_ALIGNMENT" != "X" ; then
- AC_DEFINE(HAVE_C_MULTI_ATTR_ALIAS, 1,
- [Define if multiple __attribute__((alias)) are supported])
- fi
- fi
- fi
-
- # Get the INTEGER_KIND, ADDRESS_KIND and OFFSET_KIND if possible
- #
- # For Fortran 90, we'll also need MPI_ADDRESS_KIND and MPI_OFFSET_KIND
- # Since our compiler might BE a Fortran 90 compiler, try and determine the
- # values.
- if test -z "$FC" ; then
- PAC_F77_IS_FC([
- FC=$F77
- if test -z "$FCFLAGS" ; then
- FCFLAGS="$FFLAGS"
- fi
- ])
- fi
- if test -n "$FC" ; then
- # Offset kind should be for 8 bytes if possible (Romio prefers that)
- # address should be sizeof void * (unless --with-aint-size has
- # been set)
- # FIXME in the current configure implementation OFFSET_KIND and
- # MPI_Offset won't always agree, but generally will. The MPI Standard
- # implies that these types must have identical size, so this is a bug
- # waiting to happen.
- if test "$with_aint_size" -gt 0 -a \
- "$with_aint_size" -gt "$ac_cv_sizeof_void_p" ; then
- testsize=$with_aint_size
- else
- testsize=$ac_cv_sizeof_void_p
- fi
- if test "$testsize" = 0 ; then
- # Set a default
- testsize=4
- fi
- dnl Using the {} around testsize helps the comments work correctly
- PAC_PROG_FC_INT_KIND(ADDRESS_KIND,${testsize},$CROSS_F90_ADDRESS_KIND)
- if test "$testsize" = 8 ; then
- OFFSET_KIND=$ADDRESS_KIND
- else
- PAC_PROG_FC_INT_KIND(OFFSET_KIND,8,$CROSS_F90_OFFSET_KIND)
- fi
- #
- PAC_PROG_FC_INT_KIND(INTEGER_KIND,$pac_cv_f77_sizeof_integer,$CROSS_F90_INTEGER_KIND)
- if test "$INTEGER_KIND" = "-1" ; then
- # Wild guess; probably means that Fortran 90 is not available
- AC_MSG_WARN([Unable to determine Fortran 90 KIND values for either address-sized integers or offset-sized integers. Using 4 in that case.])
- INTEGER_KIND=4
- fi
- #
- # Some compilers won't allow a -1 kind (e.g., absoft). In this case,
- # use a fallback (sizeof(int) kind)
- if test "$ADDRESS_KIND" = "-1" -o "$OFFSET_KIND" = "-1" ; then
- if test "$ADDRESS_KIND" = "-1" ; then
- ADDRESS_KIND=$INTEGER_KIND
- fi
- if test "$OFFSET_KIND" = "-1" ; then
- OFFSET_KIND=$INTEGER_KIND
- fi
- fi
- AC_LANG_PUSH([Fortran])
- AC_CACHE_CHECK([if real*8 is supported in Fortran 90],
- [pac_cv_fort90_real8],[
- AC_COMPILE_IFELSE([
- AC_LANG_PROGRAM([],[ real*8 a])
- ],[
- pac_cv_fort90_real8=yes
- ],[
- pac_cv_fort90_real8=no
- ])
- ])
- AC_LANG_POP([Fortran])
- WTIME_DOUBLE_TYPE="DOUBLE PRECISION"
- # Save a copy of the original mpi_base.f90 file
- if test "$enable_fc" = "yes" -a "$pac_cv_fort90_real8" = "yes" ; then
- WTIME_DOUBLE_TYPE="REAL*8"
- fi
- # WTIME_DOUBLE_TYPE is substituted into mpi_base.f90
- AC_SUBST(WTIME_DOUBLE_TYPE)
- fi
- # Make sure that address kind and offset kind have values.
- if test -z "$ADDRESS_KIND" ; then
- ADDRESS_KIND=0
- fi
- if test -z "$OFFSET_KIND" ; then
- OFFSET_KIND=0
- fi
- # Note, however, that zero value are (in all practical case) invalid
- # for Fortran 90, and indicate a failure. Test and fail if Fortran 90
- # enabled.
- if test "$enable_fc" = "yes" ; then
- if test "$ADDRESS_KIND" -le 0 -o "$OFFSET_KIND" -le 0 ; then
- AC_MSG_ERROR([Unable to determine Fortran 90 integer kinds for MPI types. If you do not need Fortran 90, add --disable-fc to the configure options.])
- # If the above is converted to a warning, you need to change
- # enable_fc and remote f90 from the bindings
- enable_fc=no
- fi
- fi
- AC_SUBST(ADDRESS_KIND)
- AC_SUBST(OFFSET_KIND)
- AC_SUBST(INTEGER_KIND)
-
- # Some compilers may require special directives to handle the common
- # block in a library. In particular, directives are needed for Microsoft
- # Windows to support dynamic library import. The following six
- # directives may be needed:
- # CMS\$ATTRIBUTES DLLIMPORT::/MPIPRIV1/
- # CMS\$ATTRIBUTES DLLIMPORT::/MPIPRIV2/
- # CMS\$ATTRIBUTES DLLIMPORT::/MPIPRIVC/
- # CDEC\$ATTRIBUTES DLLIMPORT::/MPIPRIV1/
- # CDEC\$ATTRIBUTES DLLIMPORT::/MPIPRIV2/
- # CDEC\$ATTRIBUTES DLLIMPORT::/MPIPRIVC/
- # CMS is for the Microsoft compiler,
- # CDEC is (we believe) for the DEC Fortran compiler.
- # We need to make this a configure-time variable because some compilers
- # (in particular, a version of the Intel Fortran compiler for Linux)
- # will read directives for other compilers and then flag as fatal
- # errors directives that it does not support but does recognize.
-
- DLLIMPORT=""
- AC_SUBST(DLLIMPORT)
-
- # FIXME:
- # We also need to include
- # SIZEOF_FC_MPI_OFFSET
- # SIZEOF_FC_MPI_AINT
- #
- # If other "kinds" are supported, MPI_SIZEOF needs to identify
- # those as well. This is very difficult to do in a general way.
-
- # To start with, we use the sizes determined for the Fortran 77 values.
- # These must be the same as for the Fortran 90 values.
- CROSS_F90_SIZEOF_INTEGER=${CROSS_F90_SIZEOF_INTEGER:-0}
- CROSS_F90_SIZEOF_REAL=${CROSS_F90_SIZEOF_REAL:-0}
- CROSS_F90_SIZEOF_DOUBLE_PRECISION=${CROSS_F90_SIZEOF_DOUBLE_PRECISION:-0}
- SIZEOF_FC_INTEGER=$CROSS_F90_SIZEOF_INTEGER
- SIZEOF_FC_REAL=$CROSS_F90_SIZEOF_REAL
- SIZEOF_FC_CHARACTER=1
- SIZEOF_FC_DOUBLE_PRECISION=$CROSS_F90_SIZEOF_DOUBLE_PRECISION
- if test "$pac_cv_f77_sizeof_integer" -gt 0 -a \
- "$SIZEOF_FC_INTEGER" = "0" ; then
- SIZEOF_FC_INTEGER=$pac_cv_f77_sizeof_integer
- fi
- if test "$pac_cv_f77_sizeof_real" -gt 0 -a "$SIZEOF_FC_REAL" = "0" ; then
- SIZEOF_FC_REAL=$pac_cv_f77_sizeof_real
- fi
- if test "$pac_cv_f77_sizeof_double_precision" -gt 0 -a \
- "$SIZEOF_FC_DOUBLE_PRECISION" = "0" ; then
- SIZEOF_FC_DOUBLE_PRECISION=$pac_cv_f77_sizeof_double_precision
- fi
- AC_SUBST(SIZEOF_FC_INTEGER)
- AC_SUBST(SIZEOF_FC_REAL)
- AC_SUBST(SIZEOF_FC_DOUBLE_PRECISION)
- AC_SUBST(SIZEOF_FC_CHARACTER)
-
- # REQD is short for "real equal double precision" and is set to the
- # Fortran 90 comment character if true. This is necessary to
- # allow the mpi_sizeofs module to be built, since if this part of the
- # Fortran standard is violated by the compiler (unfortunately common,
- # as some applications are written to require this non-standard
- # version), the double precision versions of the MPI_SIZEOF routine
- # must be commented out of the module (!).
- REQD=
- if test "$SIZEOF_FC_REAL" = "$SIZEOF_FC_DOUBLE_PRECISION" ; then
- REQD="!"
- fi
- AC_SUBST(REQD)
- # Is integer*1 supported, and is it a different size than integer?
- REQI1="!"
- if test "$pac_cv_fort_integer1" = yes -a "$SIZEOF_FC_INTEGER" != 1 ; then
- REQI1=
- fi
- AC_SUBST(REQI1)
- # Is integer*2 supported, and is it a different size than integer?
- REQI2="!"
- if test "$pac_cv_fort_integer2" = yes -a "$SIZEOF_FC_INTEGER" != 2 ; then
- REQI2=
- fi
- AC_SUBST(REQI2)
- # Is integer*8 supported, and is it a different size than integer?
- REQI8="!"
- if test "$pac_cv_fort_integer8" = yes -a "$SIZEOF_FC_INTEGER" != 8 ; then
- REQI8=
- fi
- AC_SUBST(REQI8)
- #
-
- AC_LANG_C
-fi
-# ----------------------------------------------------------------------------
-# C++ types
-if test "$enable_cxx" = "yes" ; then
- AC_LANG_CPLUSPLUS
- AC_CHECK_SIZEOF(bool)
-
- # Find a C type that matches the size of the C++ boolean type
- case "$ac_cv_sizeof_bool" in
- $ac_cv_sizeof__Bool)
- bool_type=_Bool
- ;;
- $ac_cv_sizeof_unsigned_char)
- bool_type="unsigned char"
- ;;
- $ac_cv_sizeof_unsigned_short)
- bool_type="unsigned short"
- ;;
- $ac_cv_sizeof_unsigned_int)
- bool_type="unsigned int"
- ;;
- $ac_cv_sizeof_unsigned_long)
- bool_type="unsigned long"
- ;;
- $ac_cv_sizeof_unsigned_long_long)
- bool_type="unsigned long long"
- ;;
- *)
- AC_MSG_ERROR([unable to determine matching C type for C++ bool])
- ;;
- esac
- AC_DEFINE_UNQUOTED([MPIR_CXX_BOOL_CTYPE],[$bool_type],
- [a C type used to compute C++ bool reductions])
-
- AC_CHECK_HEADER(complex)
- if test "$ac_cv_header_complex" = "yes" ; then
- # The C++ complex types are all templated. We finagle this by
- # defining a standin name
- AC_CHECK_SIZEOF(Complex,0,[#include <stdio.h>
-#include <complex>
-using namespace std;
-#define Complex complex<float>
-])
- AC_CHECK_SIZEOF(DoubleComplex,0,[#include <stdio.h>
-#include <complex>
-using namespace std;
-#define DoubleComplex complex<double>
-])
- if test "$MPID_NO_LONG_DOUBLE" != yes ; then
- AC_CHECK_SIZEOF(LongDoubleComplex,0,[#include <stdio.h>
-#include <complex>
-using namespace std;
-#define LongDoubleComplex complex<long double>
-])
- fi
-
- # If either complex or double complex have length 0, then mark
- # c++ complex as unavailable
- if test "$ac_cv_sizeof_Complex" != 0 -a \
- "$ac_cv_sizeof_DoubleComplex" != 0 ; then
- AC_DEFINE(HAVE_CXX_COMPLEX,1,[Define is C++ supports complex types])
- fi
-
- # Datatypes are given by
- # 0x4c00 <length in bytes> (1 byte) <unique num> (1 byte)
- # where the unique nums are
- # 33,34,35,36
- case "$ac_cv_sizeof_bool" in
- 1) MPIR_CXX_BOOL=0x4c000133 ;;
- 2) MPIR_CXX_BOOL=0x4c000233 ;;
- 4) MPIR_CXX_BOOL=0x4c000433 ;;
- 8) MPIR_CXX_BOOL=0x4c000833 ;;
- *) ;;
- esac
- case "$ac_cv_sizeof_Complex" in
- 8) MPIR_CXX_COMPLEX=0x4c000834 ;;
- 16) MPIR_CXX_COMPLEX=0x4c001034 ;;
- *) ;;
- esac
- case "$ac_cv_sizeof_DoubleComplex" in
- 8) MPIR_CXX_DOUBLE_COMPLEX=0x4c000835 ;;
- 16) MPIR_CXX_DOUBLE_COMPLEX=0x4c001035 ;;
- 32) MPIR_CXX_DOUBLE_COMPLEX=0x4c002035 ;;
- *) ;;
- esac
- case "$ac_cv_sizeof_LongDoubleComplex" in
- 8) MPIR_CXX_LONG_DOUBLE_COMPLEX=0x4c000836 ;;
- 16) MPIR_CXX_LONG_DOUBLE_COMPLEX=0x4c001036 ;;
- 24) MPIR_CXX_LONG_DOUBLE_COMPLEX=0x4c001836 ;;
- 32) MPIR_CXX_LONG_DOUBLE_COMPLEX=0x4c002036 ;;
- *) ;;
- esac
- fi
- AC_LANG_C
-
- # Make these available to the collective operations and other code
- AC_DEFINE_UNQUOTED(MPIR_CXX_BOOL_VALUE,$MPIR_CXX_BOOL,[Define as the MPI Datatype handle for MPI::BOOL])
- AC_DEFINE_UNQUOTED(MPIR_CXX_COMPLEX_VALUE,$MPIR_CXX_COMPLEX,[Define as the MPI Datatype handle for MPI::COMPLEX])
- AC_DEFINE_UNQUOTED(MPIR_CXX_DOUBLE_COMPLEX_VALUE,$MPIR_CXX_DOUBLE_COMPLEX,[Define as the MPI Datatype handle for MPI::DOUBLE_COMPLEX])
- AC_DEFINE_UNQUOTED(MPIR_CXX_LONG_DOUBLE_COMPLEX_VALUE,$MPIR_CXX_LONG_DOUBLE_COMPLEX,[Define as the MPI Datatype handle for MPI::LONG_DOUBLE_COMPLEX])
-
-fi
-
-
-# ----------------------------------------------------------------------------
-# Check for the alignment rules moves with types int64_t etc. These
-# are used in the datatype code to perform pack and unpack operations.
-# These only determine if different alignments *work*, not whether they
-# work efficiently. The datatype pack code (should) allow the developer
-# to include stricter alignment rules than are needed for correctness to
-# get better performance.
-if test "$ac_cv_c_int64_t" != "no" -o -n "$INT64_T" ; then
- default_int64_t_alignment=${CROSS_INT64_T_ALIGNMENT:-"unknown"}
- if test -z "$INT64_T" ; then
- if test "$ac_cv_c_int64_t" = yes ; then
- INT64_T="int64_t"
- else
- INT64_T="$ac_cv_int64_t"
- fi
- fi
- # We use the type that we're going use for int64.
- AC_CACHE_CHECK([for alignment restrictions on $MYINT64_T],pac_cv_int64_t_alignment,[
- AC_TRY_RUN([
-#include <sys/types.h>
-#include <stdlib.h>
-int main(int argc, char **argv )
-{
- $INT64_T *p1, v;
- char *buf_p = (char *)malloc( 64 ), *bp;
- bp = buf_p;
- /* Make bp aligned on 4, not 8 bytes */
- if (!( (long)bp & 0x7 ) ) bp += 4;
- p1 = ($INT64_T *)bp;
- v = -1;
- *p1 = v;
- if (!( (long)bp & 0x3 ) ) bp += 2;
- p1 = ($INT64_T *)bp;
- *p1 = 1;
- if (!( (long)bp & 0x1 ) ) bp += 1;
- p1 = ($INT64_T *)bp;
- *p1 = 1;
- return 0;
-}
-],pac_cv_int64_t_alignment=no,pac_cv_int64_t_alignment=yes,pac_cv_int64_t_alignment=$default_int64_t_alignment)
-])
- if test "$pac_cv_int64_t_alignment" = "no" ; then
- AC_DEFINE(HAVE_ANY_INT64_T_ALIGNMENT,1,[Define if int64_t works with any alignment])
- fi
-fi
-
-if test "$ac_cv_int32_t" != "no" ; then
- default_int32_t_alignment=${CROSS_INT32_T_ALIGNMENT:-"unknown"}
- if test -z "$INT32_T" ; then
- if test "$ac_cv_c_int32_t" = yes ; then
- INT32_T="int32_t"
- else
- INT32_T="$ac_cv_int32_t"
- fi
- fi
-
- AC_CACHE_CHECK([for alignment restrictions on int32_t],pac_cv_int32_t_alignment,[
- AC_TRY_RUN([
-#include <sys/types.h>
-#include <stdlib.h>
-int main(int argc, char **argv )
-{
- $INT32_T *p1, v;
- char *buf_p = (char *)malloc( 64 ), *bp;
- bp = buf_p;
- /* Make bp aligned on 4, not 8 bytes */
- if (!( (long)bp & 0x7 ) ) bp += 4;
- p1 = ($INT32_T *)bp;
- v = -1;
- *p1 = v;
- if (!( (long)bp & 0x3 ) ) bp += 2;
- p1 = ($INT32_T *)bp;
- *p1 = 1;
- if (!( (long)bp & 0x1 ) ) bp += 1;
- p1 = ($INT32_T *)bp;
- *p1 = 1;
- return 0;
-}
-],pac_cv_int32_t_alignment=no,pac_cv_int32_t_alignment=yes,pac_cv_int32_t_alignment=$default_int32_t_alignment)
-])
- if test "$pac_cv_int32_t_alignment" = "no" ; then
- AC_DEFINE(HAVE_ANY_INT32_T_ALIGNMENT,1,[Define if int32_t works with any alignment])
- fi
-fi
-
-# Get the size for the bsendoverhead
-AC_CHECK_SIZEOF(MPIR_Bsend_data_t,128,[
-#define MPI_Datatype int
-#include "${master_top_srcdir}/src/include/mpibsend.h"]
-)
-BSEND_OVERHEAD=$ac_cv_sizeof_MPIR_Bsend_data_t
-export BSEND_OVERHEAD
-AC_SUBST(BSEND_OVERHEAD)
-
-# Check for special compile characteristics
-# If we are either gcc or icc, see if we can use __asm__
-# We test on prog_gcc to allow gcc by any name; if we are using
-# icc, the value of CC must be icc for this test to pass
-if test "$ac_cv_prog_gcc" = "yes" -o "$ac_cv_prog_CC" = "icc" ; then
-AC_MSG_CHECKING([for gcc __asm__ and pentium cmpxchgl instruction])
-AC_TRY_RUN([
-int main(int argc, char *argv[])
-{
-long int compval = 10;
-volatile long int *p = &compval;
-long int oldval = 10;
-long int newval = 20;
-char ret;
-long int readval;
-__asm__ __volatile__ ("lock; cmpxchgl %3, %1; sete %0"
- : "=q" (ret), "=m" (*p), "=a" (readval)
- : "r" (newval), "m" (*p), "a" (oldval) : "memory");
-return (compval == 20) ? 0 : -1;
-}
-], AC_MSG_RESULT(yes)
- AC_DEFINE(HAVE_GCC_AND_PENTIUM_ASM, 1,[Define if using gcc on a system with an Intel Pentium class chip])
- lac_cv_use_atomic_updates="yes",
-AC_MSG_RESULT(no), AC_MSG_RESULT(not checking when cross compiling))
-fi
-if test "$lac_cv_use_atomic_updates" = "yes" ; then
- AC_DEFINE(USE_ATOMIC_UPDATES,, [Define if assembly language atomic update macros should be used (if available)])
-fi
-
-# check for x86_64
-if test "$ac_cv_prog_gcc" = "yes" ; then
-AC_MSG_CHECKING([for gcc __asm__ and AMD x86_64 cmpxchgq instruction])
-AC_TRY_RUN([
-int main(int argc, char *argv[])
-{
-long int compval = 10;
-volatile long int *p = &compval;
-long int oldval = 10;
-long int newval = 20;
-char ret;
-long int readval;
-__asm__ __volatile__ ("lock; cmpxchgq %3, %1; sete %0"
- : "=q" (ret), "=m" (*p), "=a" (readval)
- : "r" (newval), "m" (*p), "a" (oldval) : "memory");
-return (compval == 20) ? 0 : -1;
-}
-], AC_MSG_RESULT(yes)
- AC_DEFINE(HAVE_GCC_AND_X86_64_ASM, 1,[Define if using gcc on a system with an AMD x86_64 class chip]),
-AC_MSG_RESULT(no), AC_MSG_RESULT(not checking when cross compiling))
-fi
-dnl
-dnl check for asm() format
-dnl
-dnl AC_MSG_CHECKING([for asm() and pentium cmpxchgl instruction])
-dnl AC_TRY_RUN([
-dnl int main(int argc, char *argv[])
-dnl {
-dnl long int compval = 10;
-dnl volatile long int *p = &compval;
-dnl long int oldval = 10;
-dnl long int newval = 20;
-dnl char ret;
-dnl long int readval;
-dnl asm("lock; cmpxchgl %3, %1; sete %0"
-dnl : "=q" (ret), "=m" (*p), "=a" (readval)
-dnl : "r" (newval), "m" (*p), "a" (oldval) : "memory");
-dnl return (compval == 20) ? 0 : -1;
-dnl }
-dnl ], AC_MSG_RESULT(yes)
-dnl AC_DEFINE(HAVE_PENTIUM_ASM, 1,[Define if using asm() on a system with an Intel Pentium class chip]),
-dnl AC_MSG_RESULT(no), AC_MSG_RESULT(not checking when cross compiling))
-dnl
-dnl
-dnl check for IA64
-dnl
-if test "$ac_cv_prog_gcc" = "yes" ; then
-AC_MSG_CHECKING([for gcc __asm__ and IA64 xchg4 instruction])
-AC_TRY_RUN([
-unsigned long _InterlockedExchange(volatile void *ptr, unsigned long x)
-{
- unsigned long result;
- __asm__ __volatile ("xchg4 %0=[%1],%2" : "=r" (result)
- : "r" (ptr), "r" (x) : "memory");
- return result;
-}
-int main(int argc, char *argv[])
-{
-long val = 1;
-volatile long *p = &val;
-long oldval = _InterlockedExchange(p, (unsigned long)2);
-return (oldval == 1 && val == 2) ? 0 : -1;
-}
-], AC_MSG_RESULT(yes)
- AC_DEFINE(HAVE_GCC_AND_IA64_ASM, 1,[Define if using gcc on a system with an IA64 class chip]),
-AC_MSG_RESULT(no), AC_MSG_RESULT(not checking when cross compiling))
-fi
-# -----------------------------------------------------------------------------
-# Check for support of enable-coverage. Put this near the end of the tests
-# because the coverage options may affect the other tests.
-PAC_ENABLE_COVERAGE
-
-# -----------------------------------------------------------------------------
-# Look for Standard headers
-AC_HEADER_STDC
-# Check for a specific header
-# Grrr. OS/X fails the test for sys/uio.h because uio *requires* sys/types.h
-# to compile. Thus, we'll make that a separate test
-# stddef.h is sometimes needed for types like wchar_t
-AC_CHECK_HEADERS(stdlib.h stdarg.h sys/types.h string.h inttypes.h limits.h stddef.h errno.h sys/socket.h sys/time.h unistd.h endian.h assert.h sys/param.h)
-AC_CACHE_CHECK([for sys/uio.h],ac_cv_header_sys_uio_h,[
-AC_TRY_COMPILE([
-#include <sys/types.h>
-#include <sys/uio.h>
-],[int a;],ac_cv_header_sys_uio_h=yes,ac_cv_header_sys_uio_h=no)])
-if test "$ac_cv_header_sys_uio_h" = yes ; then
- AC_DEFINE(HAVE_SYS_UIO_H,1,[Define if you have the <sys/uio.h> header file.])
-fi
-
-# Check for special types
-AC_TYPE_SIZE_T
-
-# These are used to support timeouts
-AC_CHECK_FUNCS(setitimer alarm)
-# These are used for error reporting
-AC_CHECK_FUNCS(vsnprintf vsprintf)
-if test "$ac_cv_func_vsnprintf" = "yes" ; then
- # vsnprintf may be declared in stdio.h and may need stdarg.h
- PAC_FUNC_NEEDS_DECL([#include <stdio.h>
-#include <stdarg.h>],vsnprintf)
-fi
-# We would like to use strerror in the file namepublisher; it is also used
-# in MPIU_Strerror (whose implementation is broken if strerror is not found)
-AC_CHECK_FUNCS(strerror strncasecmp)
-AC_FUNC_STRERROR_R
-if test "$ac_cv_func_strerror_r" = "yes" ; then
- PAC_FUNC_NEEDS_DECL([#include <string.h>],strerror_r)
-fi
-
-# Use snprintf if possible when creating messages
-AC_CHECK_FUNCS(snprintf)
-if test "$ac_cv_func_snprintf" = "yes" ; then
- PAC_FUNC_NEEDS_DECL([#include <stdio.h>],snprintf)
-fi
-
-# qsort will be used in MPI_Comm_split, if available
-AC_CHECK_FUNCS([qsort])
-
-# if we are using stdarg, we may need va_copy . Test to see if we have it
-# Since it may be a built-in instead of a function, we must try to
-# compile and link a program that uses it.
-# va_copy is currently used only in src/util/dbg_printf.c, in an obsolete
-# debugging routine. We may want to withdraw this (saving the
-# test in confdb/aclocal_cc.m4).
-AC_CACHE_CHECK([for va_copy],pac_cv_func_va_copy,[
-AC_TRY_LINK([
-#include <stdarg.h>
-void foo1( char *fmt, ... ) {
- va_list ap, list;
- va_start(ap,fmt);
- va_copy(list,ap);
- va_end(list);
- va_end(ap);
-}
-],[foo1("a test %d", 3);],pac_cv_func_va_copy=yes,pac_cv_func_va_copy=no)])
-
-if test "$pac_cv_func_va_copy" = "yes" ; then
- AC_DEFINE(HAVE_VA_COPY,1,[Define if we have va_copy])
-else
- AC_CACHE_CHECK([for __va_copy],pac_cv_func___va_copy,[
- AC_TRY_LINK([
-#include <stdarg.h>
-void foo1( char *fmt, ... ) {
- va_list ap, list;
- va_start(ap,fmt);
- __va_copy(list,ap);
- va_end(list);
- va_end(ap);
-}
-],[foo1("a test %d", 3);],pac_cv_func___va_copy=yes,pac_cv_func___va_copy=no)])
- if test "$pac_cv_func___va_copy" = "yes" ; then
- AC_DEFINE(HAVE___VA_COPY,1,[Define if we have __va_copy])
- fi
-fi
-
-PAC_C_MACRO_VA_ARGS
-
-dnl
-dnl If internationalization selected, try to find the needed functions
-dnl if test "$enable_internat" = "yes" ; then
-dnl AC_CHECK_HEADERS(libintl.h)
-dnl AC_CHECK_FUNCS(gettext dgettext)
-dnl if test "$ac_cv_header_libintl" = "yes" -a \
-dnl "$ac_cv_func_gettext" = "yes" -a \
-dnl "$ac_cv_func_dgettext" = "yes" ; then
-dnl AC_DEFINE(USE_GETTEXT,1,[Define if messages should use gettext])
-dnl else
-dnl AC_MSG_WARN([Cannot use internationalization because necessary headers and functions are not available])
-dnl fi
-dnl fi
-# Check for alloca function. May set HAVE_ALLOCA_H and HAVE_ALLOCA
-AC_FUNC_ALLOCA
-# We don't use alloca unless USE_ALLOCA is also set.
-AC_ARG_ENABLE(alloca,
- AC_HELP_STRING([--enable-alloca],
- [Use alloca to allocate temporary memory if available]),,enable_alloca=no)
-if test "$enable_alloca" = yes ; then
- AC_DEFINE(USE_ALLOCA,1,[Define if alloca should be used if available])
-fi
-
-if test "$enable_g_mem" != "yes" ; then
- # Strdup is needed only if memory tracing is not enabled.
- AC_CHECK_FUNCS(strdup)
- if test "$ac_cv_func_strdup" = "yes" ; then
- # Do we need to declare strdup?
- PAC_FUNC_NEEDS_DECL([#include <string.h>],strdup)
- fi
-else
- # search.h is used for fancier output from trmem. Disabled for now,
- # since the tsearch routines have problematic prototypes.
- AC_CHECK_HEADERS(search)
- AC_CHECK_FUNCS(tsearch)
- # Check that we can compile tsearch without error. Try to compile
- # it with the header and the char * args
- if test "$ac_cv_func_tsearch" = "yes" ; then
- AC_CACHE_CHECK([whether tsearch requires char* args],
- pac_cv_tsearch_charp,[
- AC_TRY_COMPILE([#include <search.h>
- char *tsearch( char *k, char **r, (int (*)())compare ) { return k; }],
- [int f=0;],pac_cv_tsearch_charp=yes,pac_cv_tsearch_charp=no)])
- if test "$pac_cv_tsearch_charp" = "yes" ; then
- # this should consider defining a name with the argument type
- # so that no further ifdefs are needed
- AC_DEFINE(USE_TSEARCH_WITH_CHARP,1,[Define if tsearch requires char pointers])
- fi
- fi
- # Note that HPUX and AIX may require _INCLUDE_XOPEN_SOURCE or
- # _XOPEN_SOURCE be defined respectively.
-fi
-
-# ----------------------------------------------------------------------------
-# Look for some non-posix, but commonly provided functions
-# ----------------------------------------------------------------------------
-# mkstemp() is a better replacement for mktemp()
-AC_HAVE_FUNCS(mkstemp)
-if test "$ac_cv_func_mkstemp" = "yes" ; then
- PAC_FUNC_NEEDS_DECL([#include <stdlib.h>],mkstemp)
-fi
-# fdopen() converts from an fd to a FILE*
-AC_HAVE_FUNCS(fdopen)
-if test "$ac_cv_func_fdopen" = "yes" ; then
- PAC_FUNC_NEEDS_DECL([#include <stdlib.h>],fdopen)
-fi
-# putenv() sets environment variable
-AC_HAVE_FUNCS(putenv)
-if test "$ac_cv_func_putenv" = "yes" ; then
- PAC_FUNC_NEEDS_DECL([#include <stdlib.h>],putenv)
-fi
-
-
-# ----------------------------------------------------------------------------
-# Support for timers. The following code processes the
-# --enable-timer-type=name argument and selects the timer based on
-# both that field and what configure is able to determine is available.
-# The file src/include/mpichtimer.h is also created.
-# Note that at least the handling of the "device" option must come *after*
-# the setup_device script is loaded so that the device can set the appropriate
-# fields. For now, we've split this so that there is an update to the timer
-# after the setup_device script is loaded, but we should consider moving
-# this entire block.
-# FIXME DJG setup_device has been eliminated in favor of subconfigure.m4 files
-# ----------------------------------------------------------------------------
-# Default type for timer stamp.
-MPID_TIMER_TYPE=long
-AC_SUBST(MPID_TIMER_TYPE)
-
-# clock_gettime is the POSIX gettimeofday
-# gethrtime is the Solaris high-resolution timer
-dnl
-dnl Specific checks that a function works correctly
-dnl
-dnl Now that we know what the options are, choose the timer to use
-dnl
-dnl The default preference is
-dnl Solaris gethrtime
-dnl Posix clock_gettime
-dnl Unix gettimeofday (one of two versions)
-dnl
-dnl Also available are various hardware time stamps
-dnl Linux-x86 cycle counter
-dnl Linux-alpha cycle counter
-dnl
-dnl We also allow --enable-timer-type=name to select a timer type
-AC_ARG_ENABLE(timer-type,
-[ --enable-timer-type=name - Select the timer to use for MPI_Wtime and
- internal timestamps.
- gethrtime - Solaris timer (Solaris systems only)
- clock_gettime - Posix timer (where available)
- gettimeofday - Most Unix systems
- linux86_cycle - Linux x86; returns cycle counts, not time in seconds*
- gcc_ia64_cycle - IPF ar.itc timer*
- mach_absolute_time - Mach absolute time (alternative to clock_gettime
- for OSX)
- device - The timer is provided by the device
-
- *Note that the cycle timers are intended to be used by MPICH2
- developers for internal low-level timing. Normal users should
- not use these as they are not guaranteed to be accurate in
- certain situations.
-
- linuxalpha_cycle is no longer supported.
-],timer_type=$enable_timer_type)
-
-if test -z "$timer_type" ; then
- # Try to pick a timer based on what is available
- AC_CHECK_FUNCS(clock_gettime clock_getres gethrtime mach_absolute_time gettimeofday)
- if test "$ac_cv_func_gethrtime" = "yes" ; then
- # Sigh. The Solaris include files do not define hrtime_t
- # Before we accept this choice, make sure that we can
- # do arithmetic with hrtime_t .
- AC_CACHE_CHECK([that hrtime_t is properly defined for gethrtime],
- pac_cv_hrtime_works,[
- AC_TRY_COMPILE([
-#include <sys/time.h>
-],[hrtime_t t1, t2; t1 = 1; t2 = 2; t1 = t1 + t2;],
-pac_cv_hrtime_works=yes,pac_cv_hrtime_works=no)])
- # A more ambitious test would look to see if casting an
- # hrtime_t to int64_t works, and even more ambitious
- # would check whether long or long long was 64 bits (or even
- # better, the sizeof hrtime_t).
- fi
- if test "$ac_cv_func_gethrtime" = "yes" -a \
- "$pac_cv_hrtime_works" = "yes" ; then
- timer_type=gethrtime
- elif test "$ac_cv_func_clock_gettime" = "yes" -a \
- "$ac_cv_func_clock_getres" = "yes" ; then
- # Test on both because some systems (e.g., cygwin) provide
- # clock_gettime but not clock_getres
- timer_type=clock_gettime
- elif test "$ac_cv_func_mach_absolute_time" = "yes" ; then
- timer_type=mach_absolute_time
- elif test "$ac_cv_func_gettimeofday" = "yes" ; then
- timer_type=gettimeofday
- fi
-fi
-if test -z "$timer_type" ; then
- AC_MSG_ERROR([No timer found])
-fi
-
-# Check for valid timer and select datatypes for the time stamp
-case "$timer_type" in
-
- gethrtime)
- MPID_TIMER_TYPE=hrtime_t
- AC_CHECK_FUNC(gethrtime,,[
- AC_MSG_ERROR([Requested timer gethrtime is not available])
-])
- ;;
-
- clock_gettime)
- missing_function=no
- AC_SEARCH_LIBS([clock_gettime],[rt],,AC_MSG_ERROR([clock_gettime is not available]))
- AC_SEARCH_LIBS([clock_getres],[rt],,AC_MSG_ERROR([clock_getres is not available]))
- MPID_TIMER_TYPE="struct timespec"
- # AIX does not always define struct timespec (!)
- # Make sure that we can use struct timespec
- AC_CACHE_CHECK([whether struct timespec is defined in time.h],
- pac_cv_struct_timespec_defined,[
- AC_TRY_COMPILE([
-#include <time.h>],[
- struct timespec t;],pac_cv_struct_timespec_defined=yes,
- pac_cv_struct_timespec_defined=no)
-])
- if test "$pac_cv_struct_timespec_defined" != "yes" ; then
- # Try again, but with -D_XOPEN_SOURCE=500 (works for AIX)
- AC_CACHE_CHECK([whether struct timespec is defined in time.h with _XOPEN_SOURCE=500],
- pac_cv_struct_timespec_defined_with_xopen500,[
- AC_TRY_COMPILE([
-#define _XOPEN_SOURCE 500
-#include <time.h>],[
- struct timespec t;],pac_cv_struct_timespec_defined_with_xopen500=yes,
- pac_cv_struct_timespec_defined_with_xopen500=no)
-])
- if test "$pac_cv_struct_timespec_defined_with_xopen500" = "yes" ; then
- # We need to define _XOPEN_SOURCE=500, but we need to ensure that
- # this is done before any include files are loaded. At
- # this point it is really too late to add this definition,
- # since it may make other tests incompatible.
- AC_MSG_ERROR([The available timer requires _XOPEN_SOURCE=500. Add -D_XOPEN_SOURCE=500 to CFLAGS and rerun configure])
- fi
- fi
- #
- # FreeBSD 4.3 incorrectly puts the header into sys/time.h;
- # time.h is required (see pages 45 and 46 in the POSIX standard).
- # See if we can compile
- AC_CACHE_CHECK([for CLOCK_REALTIME defined in time.h],pac_cv_posix_clock_realtime,[
- AC_TRY_COMPILE([
-#include <time.h>],[
- clockid_t cid = CLOCK_REALTIME;],pac_cv_posix_clock_realtime=yes,
-pac_cv_posix_clock_realtime=no)])
- if test "$pac_cv_posix_clock_realtime" = "no" ; then
- AC_MSG_WARN([POSIX timer requires definitions in time.h])
- # Check for the definition in sys/time.h, which is where
- # OpenBSD and FreeBSD have put it by mistake
- AC_TRY_COMPILE([
-#include <time.h>
-#include <sys/time.h>],[
- clockid_t cid = CLOCK_REALTIME;],pac_cv_posix_clock_realtime=yes,
-pac_cv_posix_clock_realtime=no)
- if test "$pac_cv_posix_clock_realtime" = yes ; then
- AC_MSG_WARN([sys/time.h required for POSIX timer])
- AC_DEFINE(NEEDS_SYS_TIME_H,1,[Define if sys/time.h is required to get timer definitions])
- else
- AC_MSG_ERROR([Cannot find the definition of CLOCK_REALTIME for the POSIX timer])
- fi
- fi
- ;;
-
- gettimeofday)
- MPID_TIMER_TYPE="struct timeval"
- # We may have already tested for gettimeofday. If we got a "yes",
- # we're good to go
- if test "$ac_cv_func_gettimeofday" != "yes" ; then
- AC_CHECK_FUNC(gettimeofday,,[
- AC_MSG_ERROR([Requested timer gettimeofday is not available])
-])
- fi
- ;;
-
- linux86_cycle|linux86_cycle_2)
-
-# The following AC_TRY_RUN statements are needed because x86_64 compilers
-# usually know about rdtscp but the cpu may or may not actually implement the
-# feature. This is not cross-compile safe, unfortunately. In the long run we
-# should allow the user to override this with a configure flag.
- AC_CACHE_CHECK([that linux86 cycle counter is available],
- pac_cv_linux86_cycle,
- AC_TRY_RUN([
-int main()
-{
- /* rdtscp */
- long long var, *var_ptr=&var;
- __asm__ __volatile__("rdtscp; shl \$32, %%rdx; or %%rdx, %%rax" : "=a" (*var_ptr) : : "ecx", "rdx");
- return 0;
-}
- ],pac_cv_linux86_cycle=rdtscp,
- AC_TRY_RUN([[
-int main()
-{
- /* cpuid 64 */
- long long var, *var_ptr=&var;
- __asm__ __volatile__("push %%rbx ; cpuid ; rdtsc ; pop %%rbx ; shl $32, %%rdx; or %%rdx, %%rax" : "=a" (*var_ptr) : : "ecx", "rdx");
- return 0;
-}
- ]],pac_cv_linux86_cycle=cpuid_rdtsc64,
- AC_TRY_RUN([[[
-int main()
-{
- /* cpuid 32 */
- long long var, *var_ptr=&var;
- __asm__ __volatile__("push %%ebx ; cpuid ; rdtsc ; pop %%ebx" : "=A" (*var_ptr) : : "ecx");
- return 0;
-}
- ]]],pac_cv_linux86_cycle=cpuid_rdtsc32,
- AC_TRY_RUN([[[[
-int main()
-{
- /* simple */
- long long var, *var_ptr=&var;
- __asm__ __volatile__("rdtsc" : "=A" (*var_ptr));
- return 0;
-}
- ]]]],pac_cv_linux86_cycle=rdtsc,
- pac_cv_linux86_cycle=no)
- )
- ),
-dnl The if-cross-compiling clause from the first AC_TRY_RUN. Hope that if the
-dnl compiler knows about the instruction then it's supported by the target
-dnl platform.
- AC_TRY_COMPILE(,[[
- long long var, *var_ptr=&var;
- __asm__ __volatile__("rdtscp; shl \$32, %%rdx; or %%rdx, %%rax" : "=a" (*var_ptr) : : "ecx", "rdx");
- ]],pac_cv_linux86_cycle=rdtscp,
- AC_TRY_COMPILE(,[[[
- long long var, *var_ptr=&var;
- __asm__ __volatile__("push %%rbx ; cpuid ; rdtsc ; pop %%rbx ; shl $32, %%rdx; or %%rdx, %%rax" : "=a" (*var_ptr) : : "ecx", "rdx");
- ]]],pac_cv_linux86_cycle=cpuid_rdtsc64,
- AC_TRY_COMPILE(,[[[[
- long long var, *var_ptr=&var;
- __asm__ __volatile__("push %%ebx ; cpuid ; rdtsc ; pop %%ebx" : "=A" (*var_ptr) : : "ecx");
- ]]]],pac_cv_linux86_cycle=cpuid_rdtsc32,
- AC_TRY_COMPILE(,[[[[[
- long long var, *var_ptr=&var;
- __asm__ __volatile__("rdtsc" : "=A" (*var_ptr));
- ]]]]],pac_cv_linux86_cycle=rdtsc,
- pac_cv_linux86_cycle=no)
- )
- )
- )
- )
- )
-
- case "$pac_cv_linux86_cycle" in
- "rdtscp")
- AC_DEFINE(LINUX86_CYCLE_RDTSCP,1,[Define which x86 cycle counter to use])
- ;;
- "cpuid_rdtsc64")
- AC_DEFINE(LINUX86_CYCLE_CPUID_RDTSC64,1,[Define which x86 cycle counter to use])
- ;;
- "cpuid_rdtsc32")
- AC_DEFINE(LINUX86_CYCLE_CPUID_RDTSC32,1,[Define which x86 cycle counter to use])
- ;;
- "rdtsc")
- AC_DEFINE(LINUX86_CYCLE_RDTSC,1,[Define which x86 cycle counter to use])
- ;;
- *)
- cpu_gcc_x86_cycle=no
- ;;
- esac
-
- if test "$cpu_gcc_x86_cycle" = "no" ; then
- AC_MSG_ERROR([Linux86 cycle counter is not available on this system and or with the $CC compiler])
- fi
- MPID_TIMER_TYPE="long long"
- ;;
-
- gcc_ia64_cycle)
- AC_CACHE_CHECK([that IPF timer is available],
-pac_cv_ia64_cycle,[
- AC_TRY_COMPILE(,[
- long var, *var_ptr=&var;
-#ifdef __INTEL_COMPILER
-#include "ia64regs.h"
- var=__getReg(_IA64_REG_AR_ITC);
-#else
- __asm__ __volatile__("mov %0=ar.itc" : "=r" (var_ptr));
-#endif
-],pac_cv_gcc_ia64_cycle=yes,pac_cv_gcc_ia64_cycle=no)])
- if test "$pac_cv_gcc_ia64_cycle" != "yes" ; then
- AC_MSG_ERROR([IPF cycle counter is not available on this system and or with the $CC compiler])
- fi
- MPID_TIMER_TYPE="long"
- ;;
-
- linuxalpha_cycle)
- AC_MSG_ERROR([linuxalpha_cycle is no longer supported])
- ;;
-
- mach_absolute_time)
- AC_CHECK_FUNC(mach_absolute_time,,[AC_MSG_ERROR([mach_absolute_time is not available])])
- AC_CHECK_FUNC(mach_timebase_info,,[AC_MSG_ERROR([mach_timebase_info is not available])])
- MPID_TIMER_TYPE="uint64_t"
- ;;
-
- device)
- # The device selected should export the datatype for the timer
- # in MPID_DEVICE_TIMER_TYPE if something other than long is needed
- if test -n "$MPID_DEVICE_TIMER_TYPE" ; then
- MPID_TIMER_TYPE=$MPID_DEVICE_TIMER_TYPE
- fi
- ;;
-
- *)
- AC_MSG_ERROR([Invalid timer type $timer_type])
- ;;
-esac
-# Convert timer type to upper case
-timer_type=`echo $timer_type | \
- tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
-MPICH_TIMER_KIND=USE_$timer_type
-AC_SUBST(MPICH_TIMER_KIND)
-# ----------------------------------------------------------------------------
-# End of code for timer support (except for ac_ OUTPUT)
-# ----------------------------------------------------------------------------
-# Setup other replaceable values
-AC_SUBST(MPILIBNAME)
-AC_SUBST(PMPILIBNAME)
-
-if test "$NEEDSPLIB" = "yes" ; then
- LPMPILIBNAME="-l${PMPILIBNAME}"
-fi
-AC_SUBST(LPMPILIBNAME)
-
-# Note that aint_size must be used instead of void_p where the desired check
-# is on the size of MPI_Aint
-aint_size=$ac_cv_sizeof_void_p
-if test "$with_aint_size" -gt 0 ; then
- aint_size=$with_aint_size
- if test "$aint_size" != "$ac_cv_sizeof_void_p" ; then
- AC_MSG_RESULT([Overriding MPI_Aint to be $aint_size bytes])
- fi
-fi
-MPI_AINT=int
-for type in int long long_long short ; do
- eval len=\$ac_cv_sizeof_$type
- if test "$len" = "$aint_size" ; then
- MPI_AINT=`echo $type | sed -e 's/_/ /'`
- # Make the sizeof AINT available to other configures
- MPI_SIZEOF_AINT=$len
- export MPI_SIZEOF_AINT
- case $type in
- int)
- MPI_AINT_FMT_DEC_SPEC="%d"
- MPI_AINT_FMT_HEX_SPEC="%x"
- ;;
- long)
- MPI_AINT_FMT_DEC_SPEC="%ld"
- MPI_AINT_FMT_HEX_SPEC="%lx"
- ;;
- long_long)
- MPI_AINT_FMT_DEC_SPEC="%lld"
- MPI_AINT_FMT_HEX_SPEC="%llx"
- ;;
- short)
- MPI_AINT_FMT_DEC_SPEC="%hd"
- MPI_AINT_FMT_HEX_SPEC="%hx"
- ;;
- *)
- AC_MSG_WARN([unable to determine format specifiers for MPI_Aint, defaulting to int])
- MPI_AINT_FMT_DEC_SPEC="%d"
- MPI_AINT_FMT_HEX_SPEC="%x"
- ;;
- esac
- export MPI_AINT_FMT_DEC_SPEC MPI_AINT_FMT_HEX_SPEC
- break
- fi
-done
-AC_SUBST(MPI_AINT)
-AC_SUBST(MPI_AINT_FMT_DEC_SPEC)
-AC_SUBST(MPI_AINT_FMT_HEX_SPEC)
-
-# If sizeof(mpi_aint) = sizeof(int), set this value
-if test "$ac_cv_sizeof_int" = "$aint_size" ; then
- AC_DEFINE(SIZEOF_INT_IS_AINT,1,[define if sizeof(int) = sizeof(MPI_Aint)])
-fi
-
-# Find a pointer-sized int
-for type in int long long_long short ; do
- eval len=\$ac_cv_sizeof_$type
- if test "$len" = "$ac_cv_sizeof_void_p" ; then
- case $type in
- int)
- MPIR_PINT_FMT_DEC_SPEC="\"%d\""
- MPIR_UPINT_FMT_DEC_SPEC="\"%u\""
- ;;
- long)
- MPIR_PINT_FMT_DEC_SPEC="\"%ld\""
- MPIR_UPINT_FMT_DEC_SPEC="\"%lu\""
- ;;
- long_long)
- MPIR_PINT_FMT_DEC_SPEC="\"%lld\""
- MPIR_UPINT_FMT_DEC_SPEC="\"%llu\""
- ;;
- short)
- MPIR_PINT_FMT_DEC_SPEC="\"%hd\""
- MPIR_UPINT_FMT_DEC_SPEC="\"%hu\""
- ;;
- *)
- AC_MSG_WARN([unable to determine format specifiers for MPIR_Pint, defaulting to int])
- MPIR_PINT_FMT_DEC_SPEC="\"%d\""
- MPIR_UPINT_FMT_DEC_SPEC="\"%u\""
- ;;
- esac
- MPIR_PINT=`echo $type | sed -e 's/_/ /'`
- break
- fi
-done
-AC_DEFINE_UNQUOTED(MPIR_Pint,$MPIR_PINT,[MPIR_Pint is a pointer-sized integer])
-# allow @MPIR_PINT@ substitution in glue_romio.h
-AC_SUBST([MPIR_PINT])
-
-AC_DEFINE_UNQUOTED(MPIR_PINT_FMT_DEC_SPEC,
- $MPIR_PINT_FMT_DEC_SPEC,[MPIR_PINT_FMT_DEC_SPEC is the format
- specifier for printing Pint as a decimal])
-AC_DEFINE_UNQUOTED(MPIR_Upint,unsigned $MPIR_PINT,[MPIR_Upint is an unsigned pointer-sized integer])
-AC_DEFINE_UNQUOTED(MPIR_UPINT_FMT_DEC_SPEC,
- $MPIR_UPINT_FMT_DEC_SPEC,[MPIR_UPINT_FMT_DEC_SPEC is the format
- specifier for printing Upint as a decimal])
-
-# ----------------------------------------------------------------------------
-# MPI_AINT datatype
-# ----------------------------------------------------------------------------
-# Must be done after MPI_Aint type determination but before subconfigures.
-
-# convert to 2-char hex size
-case "$MPI_SIZEOF_AINT" in
- 4) len_mpi_aint=04 ;;
- 8) len_mpi_aint=08 ;;
- 16) len_mpi_aint=10 ;;
- *) AC_MSG_ERROR([Unable to convert MPI_SIZEOF_AINT to a hex string. This is either because we are building on a very strange platform or there is a bug somewhere in configure.]) ;;
-esac
-# MPI_AINT and MPI_OFFSET are already taken, appending a _DATATYPE suffix
-MPI_AINT_DATATYPE=0x4c00${len_mpi_aint}43
-AC_SUBST(MPI_AINT_DATATYPE)
-export MPI_AINT_DATATYPE
-
-# 0x4c000043 is 1275068483 in decimal, add ($MPI_SIZEOF_AINT * 256) and you get
-# the decimal equivalent of the hex number
-MPI_F77_AINT=`expr 1275068483 '+' '(' 256 '*' $MPI_SIZEOF_AINT ')'`
-AC_SUBST(MPI_F77_AINT)
-export MPI_F77_AINT
-# ----------------------------------------------------------------------------
-
-# define MPIU_Size_t - used to express the size of objects
-# This is used in src/include/mpitypedefs.h to define MPIU_SIZE_T,
-# and is used in various parts of ch3 and mpid/common/sock.
-# This is used to handle the potential problem that a message is
-# too long to fit with an int. However, we may still need to make
-# some more adjustments in the code (this may not be used everywhere
-# that it is needed).
-#
-# FIXME: this should really be in a util configure file, but we don't
-# have one at the moment
-#
-MPIU_SIZE_T="unsigned $MPI_AINT"
-AC_DEFINE_UNQUOTED(MPIU_SIZE_T,$MPIU_SIZE_T,[Set to a type that can express the size of the entire address space])
-
-if test "$ac_cv_sizeof_void_p" -lt "$aint_size" ; then
- AC_DEFINE(USE_AINT_FOR_ATTRVAL,1,[Define if MPI_Aint should be used instead of void * for storing attribute values])
-fi
-#
-# See if we need to update the timer type (which was converted to uppercase)
-if test "$timer_type" = "DEVICE" ; then
- # The device selected should export the datatype for the timer
- # in MPID_DEVICE_TIMER_TYPE if something other than long is needed
- if test -n "$MPID_DEVICE_TIMER_TYPE" ; then
- MPID_TIMER_TYPE=$MPID_DEVICE_TIMER_TYPE
- fi
-fi
-
-dnl Configure any subdirectories. Note that config.status will *not*
-dnl reexecute these!
-dnl Export any important variables first:
-dnl
-dnl Gastly problem. CONFIG_SUBDIRS only adds the directories to the
-dnl list of directories to be configured. It does NOT control the
-dnl timing of the configuration. For that, we must do something different.
-dnl Our original solution was to use a separate macro that does cause
-dnl immediate configure; this macro made use of the code that autoconf
-dnl uses to handle the subdir configure. However, later versions of
-dnl autoconf did this in a way that caused problems, paritcularly with
-dnl errors reported as inconsistent cache files. Instead, we simply
-dnl invoke the configure scripts (if present) directly.
-export AR
-export AR_FLAGS
-export RANLIB
-export MPILIBNAME
-export PMPILIBNAME
-export CC
-export CPPFLAGS
-export LIBS
-export CXX
-export CXXFLAGS
-export FFLAGS
-export CFLAGS
-export FCFLAGS
-export LDFLAGS
-# Make sure that any Fortran 77 and Fortran 90 compilers are exported to
-# the subdir builds (in particular, ROMIO may try to use the Fortran 90
-# compiler to determine the Fortran 90 KINDS for MPI_OFFSET_KIND).
-export F77
-export FC
-#
-# -----------------------------------------------------------------------------
-# Configure threads first. This is necessary to obtain all required
-# definitions, flags, and libraries that the other subsystems will need
-#
-#
-# -----------------------------------------------------------------------------
-MPIU_THREAD_DEFAULT=${MPIU_THREAD_DEFAULT:-posix}
-
-AC_ARG_WITH([thread-package],
-[ --with-thread-package=package Thread package to use. Supported thread packages include:
- posix or pthreads - POSIX threads
- solaris - Solaris threads (Solaris OS only)
- win - windows threads
- none - no threads
-
- If the option is not specified, the default package is
- ${MPIU_THREAD_DEFAULT}. If the option is specified, but a package
- is not given, then the default is posix
-],,with_thread_package=${MPIU_THREAD_DEFAULT})
-
-if test "$with_thread_package" = "yes" ; then
- with_thread_package=posix
-fi
-
-MPICH2_THREAD_PACKAGE=none
-MPIU_THREAD_PACKAGE_NAME=MPIU_THREAD_PACKAGE_INVALID
-case $with_thread_package in
- posix|pthreads)
- with_thread_package=posix
- AC_CHECK_HEADERS(pthread.h)
-
- # If pthreads library is found, just include it on the link line. We don't try
- # to test if the C compiler needs it or not, since the C++ or Fortran
- # compilers might need it even if the C compiler doesn't
- # (nvcc with gfortran, for example).
- #
- # OSF1 has __pthread_create but not pthread_create (because of
- # inconsistencies in the pthread spec). Thus, we look for pthread_key_create
- AC_CHECK_LIB([pthread],[pthread_key_create],have_pthreads=yes)
- if test "$have_pthreads" = "yes" ; then
- PAC_PREPEND_FLAG([-lpthread],[LIBS])
- fi
-
- AC_CHECK_FUNCS(pthread_yield)
-
- # this check should come after the AC_CHECK_LIB for -lpthread
- AC_CHECK_FUNC([pthread_key_create],[],[AC_MSG_ERROR([unable to find pthreads library])])
-
- # Check for a routine that specify a routine to call on
- # thread exit. We can use this to release memory that may
- # be allocated by the MPICH2 library in the thread.
- # A complication: pthread_cleanup_push may be a macro; in that
- # case, check_funcs will fail to find it.
- # Under OSX, pthread_cleanup_push and pop are macros that must
- # appear together in the same lexical scope, and hence are
- # really useless in libraries that may allocate data within
- # a user-managed thread.
- AC_CHECK_FUNCS(pthread_cleanup_push)
- if test "$ac_cv_func_pthread_cleanup_push" = "no" ; then
- AC_CACHE_CHECK([whether pthread_cleanup_push is available (may be a macro in pthread.h)],pac_cv_func_pthread_cleanup_push,[
- AC_TRY_LINK([
-#include <pthread.h>
-void f1(void *a) { return; }],
-[pthread_cleanup_push( f1, (void *)0 );],
- pac_cv_func_pthread_cleanup_push=yes,
- pac_cv_func_pthread_cleanup_push=no)])
- if test "$pac_cv_func_pthread_cleanup_push" = yes ; then
- AC_DEFINE(HAVE_PTHREAD_CLEANUP_PUSH_MACRO,1,[Define if pthread_cleanup_push is available, even as a macro])
- fi
-
- fi
- # Check for PTHREAD_MUTEX_RECURSIVE_NP and PTHREAD_MUTEX_RECURSIVE
- AC_CACHE_CHECK([whether pthread.h defines PTHREAD_MUTEX_RECURSIVE_NP],
- pac_cv_has_pthread_mutex_recursive_np,[
- AC_TRY_COMPILE([#include <pthread.h>],
- [int a=PTHREAD_MUTEX_RECURSIVE_NP;],
- pac_cv_has_pthread_mutex_recursive_np=yes,
- pac_cv_has_pthread_mutex_recursive_np=no)])
- AC_CACHE_CHECK([whether pthread.h defines PTHREAD_MUTEX_RECURSIVE],
- pac_cv_has_pthread_mutex_recursive,[
- AC_TRY_COMPILE([#include <pthread.h>],
- [int a=PTHREAD_MUTEX_RECURSIVE;],
- pac_cv_has_pthread_mutex_recursive=yes,
- pac_cv_has_pthread_mutex_recursive=no)])
- if test "$pac_cv_has_pthread_mutex_recursive_np" = yes ; then
- AC_DEFINE(HAVE_PTHREAD_MUTEX_RECURSIVE_NP,1,[Define if PTHREAD_MUTEX_RECURSIVE_NP is available in pthread.h])
- fi
- if test "$pac_cv_has_pthread_mutex_recursive" = yes ; then
- AC_DEFINE(HAVE_PTHREAD_MUTEX_RECURSIVE,1,[Define if PTHREAD_MUTEX_RECURSIVE is available in pthread.h])
- fi
-
- # Check for PTHREAD_MUTEX_ERRORCHECK_NP and PTHREAD_MUTEX_ERRORCHECK
- AC_CACHE_CHECK([whether pthread.h defines PTHREAD_MUTEX_ERRORCHECK_NP],
- pac_cv_has_pthread_mutex_errorcheck_np,[
- AC_TRY_COMPILE([#include <pthread.h>],
- [int a=PTHREAD_MUTEX_ERRORCHECK_NP;],
- pac_cv_has_pthread_mutex_errorcheck_np=yes,
- pac_cv_has_pthread_mutex_errorcheck_np=no)])
- AC_CACHE_CHECK([whether pthread.h defines PTHREAD_MUTEX_ERRORCHECK],
- pac_cv_has_pthread_mutex_errorcheck,[
- AC_TRY_COMPILE([#include <pthread.h>],
- [int a=PTHREAD_MUTEX_ERRORCHECK;],
- pac_cv_has_pthread_mutex_errorcheck=yes,
- pac_cv_has_pthread_mutex_errorcheck=no)])
-
- if test "$pac_cv_has_pthread_mutex_errorcheck" = yes ; then
- AC_DEFINE(PTHREAD_MUTEX_ERRORCHECK_VALUE,PTHREAD_MUTEX_ERRORCHECK,
- [Define to an expression that will result in an error checking mutex type.])
- elif test "$pac_cv_has_pthread_mutex_errorcheck_np" = yes ; then
- AC_DEFINE(PTHREAD_MUTEX_ERRORCHECK_VALUE,PTHREAD_MUTEX_ERRORCHECK_NP,
- [Define to an expression that will result in an error checking mutex type.])
- fi
-
- MPICH2_THREAD_PACKAGE=pthreads
- MPIU_THREAD_PACKAGE_NAME=MPIU_THREAD_PACKAGE_POSIX
- ;;
- solaris)
- AC_CHECK_HEADERS(thread.h)
- AC_CHECK_FUNCS(thr_yield)
- AC_SEARCH_LIBS(thr_create,thread,found=yes,found=no)
- if test "$found" != "yes" ; then
- AC_MSG_ERROR([unable to find Solaris threads library])
- fi
- # FIXME: need to add -mt if using solaris compilers
- MPICH2_THREAD_PACKAGE=solaris
- MPIU_THREAD_PACKAGE_NAME=MPIU_THREAD_PACKAGE_SOLARIS
- ;;
- win|windows)
- with_thread_package=win
- MPICH2_THREAD_PACKAGE=win
- MPIU_THREAD_PACKAGE_NAME=MPIU_THREAD_PACKAGE_WIN
- AC_MSG_ERROR([The 'win' thread package is not supported via autoconf builds at this time.])
- ;;
- no|none)
- with_thread_package=none
- MPIU_THREAD_PACKAGE_NAME=MPIU_THREAD_PACKAGE_NONE
- ;;
- *)
- AC_MSG_ERROR([The specified thread package, $with_thread_package, is not supported.])
- ;;
-esac
-
-# Define and export the selected thread library so that other packages,
-# such as MPE, will know what's used in MPICH2
-export MPICH2_THREAD_PACKAGE
-AC_DEFINE_UNQUOTED([MPIU_THREAD_PACKAGE_NAME],[$MPIU_THREAD_PACKAGE_NAME],[set to the name of the thread package])
-
-# check for compiler-support for thread-local storage (MPIU_TLS_SPECIFIER)
-AX_TLS
-
-AC_CHECK_HEADERS(sched.h)
-AC_CHECK_FUNCS(sched_yield yield usleep sleep select getpid)
-
-# Check for the Linux functions for controlling processor affinity.
-# LINUX: sched_setaffinity
-# AIX: bindprocessor
-# OSX (Leopard): thread_policy_set
-AC_CHECK_FUNCS(sched_setaffinity sched_getaffinity bindprocessor thread_policy_set)
-if test "$ac_cv_func_sched_setaffinity" = "yes" ; then
- # Test for the cpu process set type
- AC_CACHE_CHECK([whether cpu_set_t available],pac_cv_have_cpu_set_t,[
- AC_TRY_COMPILE( [
-#include <sched.h>],[ cpu_set_t t; ],pac_cv_have_cpu_set_t=yes,pac_cv_have_cpu_set_t=no)])
- if test "$pac_cv_have_cpu_set_t" = yes ; then
- AC_DEFINE(HAVE_CPU_SET_T,1,[Define if cpu_set_t is defined in sched.h])
-
- AC_CACHE_CHECK([whether the CPU_SET and CPU_ZERO macros are defined],
- pac_cv_cpu_set_defined,[
- AC_TRY_LINK( [
-#include <sched.h>],[ cpu_set_t t; CPU_ZERO(&t); CPU_SET(1,&t); ],
- pac_cv_cpu_set_defined=yes,pac_cv_cpu_set_defined=no)])
- if test "$pac_cv_cpu_set_defined" = "yes" ; then
- AC_DEFINE(HAVE_CPU_SET_MACROS,1,[Define if CPU_SET and CPU_ZERO defined])
- fi
- # FIXME: Some versions of sched_setaffinity return ENOSYS (!),
- # so we should test for the unfriendly and useless behavior
- fi
-fi
-if test "$ac_cv_func_thread_policy_set" = yes ; then
- AC_CACHE_CHECK([whether thread affinity macros defined],
- pac_cv_have_thread_affinity_policy,[
- AC_TRY_COMPILE([#include <mach/thread_policy.h>],[
-#if !defined(THREAD_AFFINITY_POLICY) || !defined(THREAD_AFFINITY_TAG_NULL)
- :'thread macros not defined
-],pac_cv_have_thread_affinity_policy=yes,
- pac_cv_have_thread_affinity_policy=no)])
- if test "$pac_cv_have_thread_affinity_policy" = yes ; then
- AC_DEFINE(HAVE_OSX_THREAD_AFFINITY,1,[Define is the OSX thread affinity policy macros defined])
- fi
-fi
-
-MPIU_THREAD_LIB_NAME=${MPILIBNAME}
-AC_SUBST(MPIU_THREAD_LIB_NAME)
-
-# -----------------------------------------------------------------------------
-# End of thread configure
-# -----------------------------------------------------------------------------
-
-
-# Checkpointing
-AC_ARG_ENABLE(checkpointing,
- [AC_HELP_STRING([--enable-checkpointing], [Enable application checkpointing])],
- [ if test "$enableval" != "no" ; then
- PAC_SET_HEADER_LIB_PATH(blcr)
- PAC_CHECK_HEADER_LIB_FATAL(blcr, libcr.h, cr, cr_init)
- AC_DEFINE(ENABLE_CHECKPOINTING,1,[Application checkpointing enabled])
- fi ],
-)
-
-# Update the cache first with the results of the previous configure steps
-# We don't use the subdir cache because ensuring that the cache is consistant
-# with the way in which configure wishes to use it is very difficult and
-# too prone to error.
-dnl PAC_SUBDIR_CACHE(always)
-# -----------------------------------------------------------------------------
-# experiment with creating a cache file
-#if test "$CONF_USE_CACHEFILE" = yes ; then
-# basecachefile=`pwd`/cache.base
-# set | grep ac_cv > $basecachefile
-# # Tell other configures to load this file
-# echo "Creating and exporting the base cache file $basecachefile"
-# CONF_BASE_CACHEFILE=$basecachefile
-# export CONF_BASE_CACHEFILE
-#fi
-PAC_CREATE_BASE_CACHE
-# -----------------------------------------------------------------------------
-
-#
-# Configure the device second. This way, any libraries or variables that
-# it needs can be extracted before building the other subsystems (this is
-# particularly important for the bindings, which may need to know the
-# libraries in order to create the compilation scripts)
-
-user_specified_atomic_primitives=no
-if test "$DEBUG_SUBDIR_CACHE" = yes ; then
- set -x
-fi
-
-dnl "configure" the device here via subconfigure.m4 files
-m4_map([PAC_SUBCFG_CONFIGURE_SUBSYS], [PAC_SUBCFG_MODULE_LIST])
-
-# now configure any actual recursively configures subsystems, such as ROMIO and
-# hydra, or older components that haven't been updated to a subconfigure.m4 yet
-for subsys in $devsubsystems $subsystems ; do
- PAC_CONFIG_SUBDIR([$subsys],[],[AC_MSG_ERROR([$subsys configure failed])])
-done
-if test "$DEBUG_SUBDIR_CACHE" = yes -a "$enable_echo" != yes ; then
- set +x
-fi
-dnl PAC_SUBDIR_CACHE_CLEANUP
-
-## The MPE configure requires MPI_LIBS, and that requires all of the LIBS
-#MPI_LIBS="$MPI_LIBS $LIBS"
-#
-# Get any localdefs that the subsystems created. Use a guard in case
-# the list is empty
-#for dir in $subsystems /dev/null ; do
-# if test -f $dir/localdefs ; then
-# . $dir/localdefs
-# fi
-#done
-#
-# Make subsystems available to makefiles.
-# FIXME does the makefile actually need this?
-subsystems="$devsubsystems $subsystems $bindingsubsystems"
-AC_SUBST(subsystems)
-
-# Find the size of OPA_ptr_t. This step needs to come after the OPA
-# configure above in order to get the size OPA_ptr_t evaluated for
-# this platform.
-AC_CHECK_SIZEOF(OPA_ptr_t,-1,[
-#include "${master_top_srcdir}/src/openpa/src/opa_primitives.h"
-pthread_mutex_t *OPA_emulation_lock;
-])
-
-if test "$enable_f77" != "yes" ; then
- # These are Fortran datatypes ONLY. Set to null if no Fortran compiler.
- for name in CHARACTER INTEGER REAL LOGICAL COMPLEX DOUBLE_PRECISION \
- 2INTEGER 2REAL DOUBLE_COMPLEX 2COMPLEX 2DOUBLE_PRECISION \
- 2DOUBLE_COMPLEX ; do
- fullname="MPI_$name"
- eval $fullname=MPI_DATATYPE_NULL
- done
- AC_MSG_WARN([Could not define Fortran MPI datatypes for C])
- AC_DEFINE(HAVE_NO_FORTRAN_MPI_TYPES_IN_C,1,[Define if the Fortran types are not available in C])
- # Temporary values for MPI_Fint (need help from the Fortran subsystem)
- MPI_FINT=int
-fi
-AC_SUBST(MPI_CHARACTER)
-AC_SUBST(MPI_INTEGER)
-AC_SUBST(MPI_REAL)
-AC_SUBST(MPI_LOGICAL)
-AC_SUBST(MPI_COMPLEX)
-AC_SUBST(MPI_DOUBLE_PRECISION)
-AC_SUBST(MPI_2INTEGER)
-AC_SUBST(MPI_2REAL)
-AC_SUBST(MPI_DOUBLE_COMPLEX)
-AC_SUBST(MPI_2DOUBLE_PRECISION)
-AC_SUBST(MPI_2COMPLEX)
-AC_SUBST(MPI_2DOUBLE_COMPLEX)
-AC_SUBST(MPI_FINT)
-
-# If ROMIO was successfully configured, then ROMIO will have exported the
-# definition of MPI_OFFSET_TYPE through its localdefs file (created by the
-# ROMIO configure in src/mpi/romio/localdefs). If MPI_OFFSET_TYPE was not
-# defined, this code attempts to find a good choice for MPI_OFFSET_TYPE
-# (As the offset type is used for File operations, the specific type
-# really doesn't matter if ROMIO doesn't provide it).
-if test -n "$MPI_OFFSET_TYPE" ; then
- # We got the value from the ROMIO configure
- MPI_OFFSET="$MPI_OFFSET_TYPE"
- # Get and export the size of this type if possible
- if test -z "$MPI_SIZEOF_OFFSET" ; then
- # set a default
- AC_CACHE_CHECK([the sizeof MPI_Offset],ac_cv_sizeof_MPI_Offset,[
- ac_cv_sizeof_MPI_Offset=unknown
- AC_COMPUTE_INT([ac_cv_sizeof_MPI_Offset],[sizeof($MPI_OFFSET)],[],[
- AC_MSG_WARN([Unable to determine the size of MPI_Offset])
- ])
- ])
- if test "$ac_cv_sizeof_MPI_Offset" != "unknown" ; then
- MPI_SIZEOF_OFFSET=$ac_cv_sizeof_MPI_Offset
- fi
- fi
- export MPI_SIZEOF_OFFSET
-else
- # Make a guess at the appropriate definition for offset. Try to
- # find a 64bit type.
- if test "$ac_cv_sizeof_long" = 8 ; then
- MPI_OFFSET="long"
- # Make the size of this type available to other configures
- MPI_SIZEOF_OFFSET=8
- elif test "$ac_cv_sizeof_long_long" = 8 ; then
- MPI_OFFSET="long long"
- # Make the size of this type available to other configures
- MPI_SIZEOF_OFFSET=8
- else
- MPI_OFFSET=long
- MPI_SIZEOF_OFFSET=$ac_cv_sizeof_long
- fi
- export MPI_SIZEOF_OFFSET
-fi
-AC_SUBST(MPI_OFFSET)
-#
-# FIXME: we need an explanation of why we need both MPI_OFFSET and
-# MPI_OFFSET_TYPEDEF. Why is MPI_OFFSET_TYPEDEF necessary?
-# This appears to be used by the Windows "winconfigure.wsf" which is used
-# to create a multiline definition using an #ifdef check on USE_GCC
-# We may wish to use a different approach
-MPI_OFFSET_TYPEDEF="typedef $MPI_OFFSET MPI_Offset;"
-AC_SUBST(MPI_OFFSET_TYPEDEF)
-#
-# Fortran type for an Offset type (needed to define MPI_DISPLACEMENT_CURRENT
-# The value for this comes from ROMIO, and is needed in mpif.h.in
-# First, we check that this works with both Fortran compilers (if
-# they are defined)
-#
-# If there is no FORTRAN_MPI_OFFSET type (because ROMIO is disabled),
-# just use INTEGER
-if test -z "$FORTRAN_MPI_OFFSET" ; then
- FORTRAN_MPI_OFFSET=INTEGER
-fi
-if test "$enable_f77" = yes -a "$enable_fc" = yes ; then
- AC_LANG_PUSH([Fortran 77])
- AC_MSG_CHECKING([whether the Fortran Offset type works with Fortran 77])
- AC_COMPILE_IFELSE([
- AC_LANG_PROGRAM([],[ $FORTRAN_MPI_OFFSET i])
- ],[has_f77_offsettype=yes],[has_f77_offsetype=no])
- AC_MSG_RESULT($has_f77_offsettype)
- AC_LANG_POP([Fortran 77])
-
- AC_LANG_PUSH([Fortran])
- AC_MSG_CHECKING([whether the Fortran Offset type works with Fortran 90])
- AC_COMPILE_IFELSE([
- AC_LANG_PROGRAM([],[ $FORTRAN_MPI_OFFSET i])
- ],[has_fc_offsettype=yes],[has_fc_offsetype=no])
- AC_LANG_POP([Fortran])
- AC_MSG_RESULT($has_fc_offsettype)
-
- if test "$has_f77_offsettype" != yes -o "$has_fc_offsettype" != yes ; then
- AC_MSG_WARN([mpif.h is not compatible with both $F77 $FFLAGS and $FC $FCFLAGS. We recommend that you set both F77 and FC to the same compiler and reconfigure.])
- fi
-fi
-AC_SUBST(FORTRAN_MPI_OFFSET)
-#
-
-# ----------------------------------------------------------------------------
-# MPI_OFFSET datatype
-# ----------------------------------------------------------------------------
-# must be done after ROMIO configure step
-case "$MPI_SIZEOF_OFFSET" in
- 4) len_mpi_offset=04 ;;
- 8) len_mpi_offset=08 ;;
- 16) len_mpi_offset=10 ;;
- *) AC_MSG_ERROR([Unable to convert MPI_SIZEOF_OFFSET to a hex string. This is either because we are building on a very strange platform or there is a bug somewhere in configure.]) ;;
-esac
-MPI_OFFSET_DATATYPE=0x4c00${len_mpi_offset}44
-AC_SUBST(MPI_OFFSET_DATATYPE)
-export MPI_OFFSET_DATATYPE
-
-# 0x4c000044 is 1275068484 in decimal, add ($MPI_SIZEOF_OFFSET * 256) and you get
-# the decimal equivalent of the hex number
-MPI_F77_OFFSET=`expr 1275068484 '+' '(' 256 '*' $MPI_SIZEOF_OFFSET ')'`
-AC_SUBST(MPI_F77_OFFSET)
-export MPI_F77_OFFSET
-# ----------------------------------------------------------------------------
-
-dnl Extra status information, from device subsystem, to be included in the
-dnl declaration of MPI_Status in mpi.h.in
-AC_SUBST(EXTRA_STATUS_DECL)
-
-dnl FIXME XXX DJG does this need to actually be conditional on something?
-dnl previously it was conditional on the successful execution of
-dnl "src/binding/f90/configure" but that would only fail if FC couldn't be
-dnl determined or a bad VPATH build env was detected
-AC_DEFINE(HAVE_FC_TYPE_ROUTINES,1,[Define if Fortran 90 type routines available])
-
-# -----------------------------------------------------------------------------
-# Get the value of MPI_MAX_PROCESSOR_NAME
-if test -z "$MPID_MAX_PROCESSOR_NAME" ; then
- if test -z "$MPI_MAX_PROCESSOR_NAME" ; then
- MPI_MAX_PROCESSOR_NAME=128
- fi
- AC_MSG_WARN([The $with_device device did not set the maximum size of a processor name, $MPI_MAX_PROCESSOR_NAME being used.])
-else
- MPI_MAX_PROCESSOR_NAME=$MPID_MAX_PROCESSOR_NAME
-fi
-AC_SUBST(MPI_MAX_PROCESSOR_NAME)
-
-# Add a definition that is used to help support Windows DLLs (used in mpi.h.in)
-MPIU_DLL_SPEC_DEF="#define MPIU_DLL_SPEC"
-AC_SUBST(MPIU_DLL_SPEC_DEF)
-
-dnl We can include external packages at configure/build time by
-dnl adding them to EXTERNAL_SRC_DIRS.
-AC_SUBST(EXTERNAL_SRC_DIRS)
-
-dnl We can configure the test directory after the rest of the configure
-dnl steps because it does not depend on them.
-# set and export values that the test/mpi configure will reference to ensure
-# that the correct decisions are made since this configure happens before the
-# MPICH2 library is built.
-MPICH2_ENABLE_CXX=$enable_cxx
-MPICH2_ENABLE_F77=$enable_f77
-MPICH2_ENABLE_FC=$enable_fc
-export MPICH2_ENABLE_CXX
-export MPICH2_ENABLE_F77
-export MPICH2_ENABLE_FC
-AM_CONDITIONAL([BUILD_CXX_LIB],[test "$enable_cxx" = "yes"])
-AM_CONDITIONAL([BUILD_F77_BINDING],[test "$enable_f77" = "yes"])
-dnl FIXME DJG this has been moved to the f90 bindings subconfigure.m4 for now
-dnl AM_CONDITIONAL([BUILD_F90_LIB],[test "$enable_fc" = "yes"])
-# MPI_SRCDIR gives the test/mpi configure the location of the source
-# files for an MPI implementation
-if test -n "$ac_abs_srcdir" ; then
- MPI_SRCDIR=$ac_abs_srcdir
-fi
-# Pass these two values with "MPI" names to the test configure
-MPI_NO_SPAWN=$MPID_NO_SPAWN
-export MPI_NO_SPAWN
-MPI_NO_RMA=$MPID_NO_RMA
-export MPI_NO_RMA
-
-AC_CONFIG_SUBDIRS([test/mpi])
-dnl
-dnl Generate the Makefiles from Makefile.in
-dnl Also generate mpi.h from mpi.h.in so that we can eliminate all ifdefs
-dnl from the file.
-dnl
-dnl Run a setup command for any external modules (normally, this is empty)
-dnl Pass a subset of the environment to the invoked process.
-AC_OUTPUT_COMMANDS([
-for prog in $EXTERNAL_SETUPS - ; do
- if test "$prog" != "-" ; then
- dir=`dirname $prog`
- name=`basename $prog`
- (cd $dir && ./$name)
- fi
-done],[
-EXTERNAL_SETUPS="$EXTERNAL_SETUPS"
-LIBDIR="$libbuild_dir"
-MPILIBNAME="$MPILIBNAME"
-PMPILIBNAME="$PMPILIBNAME"
-AR="$AR"
-CC="$CC"
-CPPFLAGS="$CPPFLAGS"
-CFLAGS="$CFLAGS"
-export LIBDIR ; export MPILIBNAME ; export AR ; export CC ; export CPPFLAGS
-export PMPILIBNAME
-export CFLAGS
-# For test/mpi/configure
-MPI_SRCDIR=$MPI_SRCDIR
-MPI_NO_SPAWN=$MPID_NO_SPAWN
-export MPI_SRCDIR
-export MPI_NO_SPAWN
-])
-
-if test -z "$includebuild_dir" ; then
- includebuild_dir=`pwd`/src/include
-fi
-if test -z "$libbuild_dir" ; then
- libbuild_dir=`pwd`/lib
-fi
-if test -z "$modincbuild_dir" ; then
- # The include files may be in a different directory from the mpif.h file
- modincbuild_dir=`pwd`/src/binding/f90
-fi
-
-AC_OUTPUT_COMMANDS([chmod +x doc/mansrc/createhtmlindex])
-
-dnl
-dnl If we rerun configure, place a file in the lib directory with the
-dnl date. We can use this to avoid rebuilding the library when
-dnl a build aborts due to an error (this is intended to help developers)
-AC_OUTPUT_COMMANDS([if [ ! -d lib ] ; then mkdir lib ; fi
-date > lib/newconfig])
-
-AC_OUTPUT_COMMANDS([chmod a+x src/util/dbg/getfuncstack])
-
-AC_OUTPUT_COMMANDS([chmod a+x test/commands/cmdtests])
-
-
-# For the examples, we want to use the scripts to encourage users
-# to use them and to make them work more robustly with shared libraries
-# and, for Fortran 90, any special Fortran 90 module features.
-if test -z "$MPICC" ; then MPICC='$(bindir)/mpicc' ; fi
-if test -z "$MPIF77" ; then MPIF77='$(bindir)/mpif77' ; fi
-if test -z "$MPIFC" ; then MPIFC='$(bindir)/mpif90' ; fi
-if test -z "$MPICXX" ; then MPICXX='$(bindir)/mpicxx' ; fi
-AC_SUBST(MPICC)
-AC_SUBST(MPICXX)
-AC_SUBST(MPIF77)
-AC_SUBST(MPIFC)
-
-AC_DEFINE(HAVE_MPICHCONF,1,[Define so that we can test whether the mpichconf.h file has been included])
-
-# Add the LDFLAGS/LIBS we got so far to WRAPPERs
-WRAPPER_LDFLAGS="$WRAPPER_LDFLAGS $LDFLAGS"
-WRAPPER_LIBS="$WRAPPER_LIBS $LIBS"
-
-if test "$USE_PMI2_API" = "yes" ; then
- AC_DEFINE(USE_PMI2_API, 1, [Define if PMI2 API must be used])
-fi
-
-########################################################################
-
-# cause libtool script to be built now so that we can use it to test one last
-# linking issue on Darwin
-LT_OUTPUT
-
-if test "X$enable_f77" = "Xyes" -a "X$enable_shared" = "Xyes" ; then
- AS_CASE([$host],
- [*-*-darwin*],
- [
- # TODO, move this into a PAC macro with real autoconf caching
- pac_cv_wl_commons_use_dylibs_works=no
- AC_MSG_CHECKING([if the F77 compiler accepts -Wl,-commons,use_dylibs])
- AC_LANG_PUSH([Fortran 77])
- PAC_PUSH_FLAG([LDFLAGS])
- PAC_APPEND_FLAG([-Wl,-commons,use_dylibs], [LDFLAGS])
- AC_LINK_IFELSE([AC_LANG_PROGRAM([],[ INTEGER i])],
- [AC_MSG_RESULT([yes])
- pac_cv_wl_commons_use_dylibs_works=yes],
- [AC_MSG_RESULT([no])])
- PAC_POP_FLAG([LDFLAGS])
- AC_LANG_POP([Fortran 77])
-
- # Add the flag to the WRAPPER_LDFLAGS, since this common block issue
- # is really only a problem for dynamically linked user programs.
- #
- # Technically we may not be able to use the same form of the argument
- # for all four compilers (CC/CXX/F77/FC). But we only think this is
- # necessary for Darwin for now, so this unconditional, single-var
- # approximation will work for now.
- if test "X$pac_cv_wl_commons_use_dylibs_works" = "Xyes" ; then
- PAC_APPEND_FLAG([-Wl,-commons,use_dylibs], [WRAPPER_LDFLAGS])
- fi
- ]
- )
-fi
-
-########################################################################
-
-dnl This includes an experimental pkgconfig file for ch3 in the src/pkgconfig
-dnl directory
-AC_OUTPUT(Makefile \
- examples/Makefile \
- test/Makefile \
- test/commands/Makefile \
- src/include/mpich2info.h \
- mpich2-doxygen \
- src/include/glue_romio.h \
- src/include/mpichtimer.h \
- src/binding/cxx/mpicxx.h \
- src/binding/f77/mpif.h \
- src/binding/f77/setbotf.f \
- src/binding/f77/setbot.c \
- src/binding/f90/mpi_sizeofs.f90 \
- src/binding/f90/mpi_base.f90 \
- src/packaging/pkgconfig/mpich2.pc \
- src/packaging/envmods/mpich2.module \
- src/env/mpixxx_opts.conf \
- src/env/mpicc.sh \
- src/env/mpicc.conf \
- src/env/mpicc.bash \
- src/env/mpicxx.sh \
- src/env/mpicxx.conf \
- src/env/mpicxx.bash \
- src/env/mpif77.sh \
- src/env/mpif77.conf \
- src/env/mpif77.bash \
- src/env/mpif90.sh \
- src/env/mpif90.conf \
- src/env/mpif90.bash \
- src/env/parkill \
- src/util/dbg/getfuncstack \
- src/include/mpi.h \
- doc/design/Makefile \
- doc/installguide/Makefile \
- doc/logging/Makefile \
- doc/refman/Makefile \
- doc/smpd/Makefile \
- doc/userguide/Makefile \
- doc/windev/Makefile \
- test/commands/cmdtests \
- doc/mansrc/createhtmlindex)
-
-echo 'Configuration completed.'
Modified: mpich2/trunk/maint/Makefile.mk
===================================================================
--- mpich2/trunk/maint/Makefile.mk 2012-02-28 23:25:23 UTC (rev 9547)
+++ mpich2/trunk/maint/Makefile.mk 2012-02-28 23:26:34 UTC (rev 9548)
@@ -9,7 +9,7 @@
# properly when we "make dist"
dist_noinst_SCRIPTS += \
- maint/configure.in \
+ maint/configure.ac \
maint/checkbuilds.in \
maint/checkmake \
maint/clmake.in \
Copied: mpich2/trunk/maint/configure.ac (from rev 9546, mpich2/trunk/maint/configure.in)
===================================================================
--- mpich2/trunk/maint/configure.ac (rev 0)
+++ mpich2/trunk/maint/configure.ac 2012-02-28 23:26:34 UTC (rev 9548)
@@ -0,0 +1,41 @@
+# -*- Mode: shell-script; -*-
+AC_PREREQ(2.59)
+AC_INIT
+#
+# Try to find the version
+if test -s "$srcdir/Version" ; then
+ VERSION="`cat $srcdir/Version`"
+else
+ VERSION="Unknown"
+fi
+AC_SUBST(VERSION)
+AC_PATH_PROG(PERL,perl)
+
+# Find the location of the mpich2 sources
+if test -z "$abs_srcdir" ; then
+ abs_srcdir=`cd $srcdir && pwd`
+fi
+abs_mpich2srcdir=`cd $abs_srcdir && cd .. && pwd`
+
+AC_SUBST(abs_mpich2srcdir)
+
+# Does xargs need the -r option to handle the case where the input
+# is empty (gnu utils do, Mac OSX does not accept -r)
+xargs_out=`echo "" | xargs ls | wc -l | sed -e 's/ //g'`
+if test "$xargs_out" != "0" ; then
+ XARGS_NODATA_OPT=-r
+fi
+AC_SUBST(XARGS_NODATA_OPT)
+
+AC_OUTPUT_COMMANDS([chmod a+x simplemake checkbuilds getcoverage genstates clmake f77tof90 extractstrings extractstates extractfixme createcoverage gcovmerge])
+# We have to redefine the variables that autoconf always substitutes and that
+# are used in simplemake
+CFLAGS='@CFLAGS@'
+FFLAGS='@FFLAGS@'
+CXXFLAGS='@CXXFLAGS@'
+# The directory substitutions apparently don't work under Cygwin, so
+# simplemake manufactures these in a way that avoids triggering the
+# autoconf replacement.
+# Note that top_srcdir and srcdir are special cases (they must not
+# be changed in configure.ac because configure uses them to find other files)
+AC_OUTPUT(simplemake checkbuilds getcoverage genstates clmake f77tof90 extractstrings extractstates extractfixme createcoverage gcovmerge)
Deleted: mpich2/trunk/maint/configure.in
===================================================================
--- mpich2/trunk/maint/configure.in 2012-02-28 23:25:23 UTC (rev 9547)
+++ mpich2/trunk/maint/configure.in 2012-02-28 23:26:34 UTC (rev 9548)
@@ -1,41 +0,0 @@
-# -*- Mode: shell-script; -*-
-AC_PREREQ(2.59)
-AC_INIT
-#
-# Try to find the version
-if test -s "$srcdir/Version" ; then
- VERSION="`cat $srcdir/Version`"
-else
- VERSION="Unknown"
-fi
-AC_SUBST(VERSION)
-AC_PATH_PROG(PERL,perl)
-
-# Find the location of the mpich2 sources
-if test -z "$abs_srcdir" ; then
- abs_srcdir=`cd $srcdir && pwd`
-fi
-abs_mpich2srcdir=`cd $abs_srcdir && cd .. && pwd`
-
-AC_SUBST(abs_mpich2srcdir)
-
-# Does xargs need the -r option to handle the case where the input
-# is empty (gnu utils do, Mac OSX does not accept -r)
-xargs_out=`echo "" | xargs ls | wc -l | sed -e 's/ //g'`
-if test "$xargs_out" != "0" ; then
- XARGS_NODATA_OPT=-r
-fi
-AC_SUBST(XARGS_NODATA_OPT)
-
-AC_OUTPUT_COMMANDS([chmod a+x simplemake checkbuilds getcoverage genstates clmake f77tof90 extractstrings extractstates extractfixme createcoverage gcovmerge])
-# We have to redefine the variables that autoconf always substitutes and that
-# are used in simplemake
-CFLAGS='@CFLAGS@'
-FFLAGS='@FFLAGS@'
-CXXFLAGS='@CXXFLAGS@'
-# The directory substitutions apparently don't work under Cygwin, so
-# simplemake manufactures these in a way that avoids triggering the
-# autoconf replacement.
-# Note that top_srcdir and srcdir are special cases (they must not
-# be changed in configure.in because configure uses them to find other files)
-AC_OUTPUT(simplemake checkbuilds getcoverage genstates clmake f77tof90 extractstrings extractstates extractfixme createcoverage gcovmerge)
Modified: mpich2/trunk/maint/sampleconf.in
===================================================================
--- mpich2/trunk/maint/sampleconf.in 2012-02-28 23:25:23 UTC (rev 9547)
+++ mpich2/trunk/maint/sampleconf.in 2012-02-28 23:26:34 UTC (rev 9548)
@@ -27,7 +27,7 @@
dnl
dnl
PAC_ARG_SHAREDLIBS
-dnl The recommended order for items in a configure.in file is
+dnl The recommended order for items in a configure.ac file is
dnl check for programs
dnl check for libraries
dnl check for header files
@@ -39,7 +39,7 @@
dnl Here are some sample tests
dnl
dnl Find a C compiler (choose gcc first)
-dnl Here are some example calls. See mpich/configure.in for others
+dnl Here are some example calls. See mpich/configure.ac for others
AC_PROG_CC
AC_PATH_PROG(AR,ar)
AC_SUBST(AR_FLAGS)
Modified: mpich2/trunk/maint/simplemake.in
===================================================================
--- mpich2/trunk/maint/simplemake.in 2012-02-28 23:25:23 UTC (rev 9547)
+++ mpich2/trunk/maint/simplemake.in 2012-02-28 23:26:34 UTC (rev 9548)
@@ -188,7 +188,7 @@
$debug = 0; # General debugging
$debug_dirs = 0; # Debug the choice of directories
$debug_confdir = 0; # Track the directory containing the controlling
- # configure.in
+ # configure.ac
$gDebugWhy = 0; # Provide an explanation of why certain
# targets are created
$gDebugSubdirVar = 0; # Track changes to internal variables that
@@ -1641,7 +1641,7 @@
&RuleDocs;
# Configure update targets
- if ( -s "configure.in" && $maint_targets ) {
+ if ( -s "configure.ac" && $maint_targets ) {
# Convert ROOTDIR as necessary
$aargs = $autoconf_args;
if (!$rootdirpath || $rootdirpath eq "") {
@@ -1677,8 +1677,8 @@
close (AFD);
}
}
- # Extract includes from configure.in
- open (AFD, "<configure.in" );
+ # Extract includes from configure.ac
+ open (AFD, "<configure.ac" );
while (<AFD>) {
if (/^\s*builtin\(include,([\w\-\/\.]*\.m4)\)\s*$/)
{
@@ -1703,7 +1703,7 @@
print "Adding $header_depend to configure target\n";
}
}
- &print_make_longline( FD, "$header_depend \${srcdir}/configure: \${srcdir}/configure.in $autoconf_deps" );
+ &print_make_longline( FD, "$header_depend \${srcdir}/configure: \${srcdir}/configure.ac $autoconf_deps" );
&print_make_setpos( 8 );
&FindWorkingAutoconf ;
# Use autoheader only if AC_CONFIG_HEADER is in the configure file
@@ -2102,9 +2102,9 @@
&ResetFileName( "$curdir$file" );
print "Processing $curdir$file\n" if (!$quiet && $debug_dirs);
$configure_has_config_headers = "no";
- if (-s "configure.in") {
+ if (-s "configure.ac") {
&ReadAutoconf;
- print "Found configure.in in $curdir, set last_config_dir to $curdir\n" if $debug_confdir;
+ print "Found configure.ac in $curdir, set last_config_dir to $curdir\n" if $debug_confdir;
if ($curdir eq "") { $last_config_dir = "."; }
else { $last_config_dir = $curdir; }
}
@@ -4586,7 +4586,7 @@
# ===========================================================================
#
# Routines to support autoconf and configure, including extracting information
-# from the configure file and rebuilding configure from configure.in
+# from the configure file and rebuilding configure from configure.ac
#
#
# Extract derived files from autoconf
@@ -4602,7 +4602,7 @@
sub ReadAutoconf {
$configure_has_config_headers = "no";
%confvars = ();
- open FDCONF, "configure.in" || die "Could not open configure.in file";
+ open FDCONF, "configure.ac" || die "Could not open configure.ac file";
while (<FDCONF>) {
#if (/^\s*#/) { next; }
if (/^\s*AC_CONFIG_HEADER\((.*)\)/) {
@@ -4627,7 +4627,7 @@
chop($_); # remove the backslash
$line .= $_;
$_ = <FDCONF>;
- die "unexpected EOF in configure.in, aborting" unless defined $_;
+ die "unexpected EOF in configure.ac, aborting" unless defined $_;
# Remove any M4 dnl line
s/\sdnl\s.*//;
# Remove any shell comment line
@@ -4642,7 +4642,7 @@
# If there's no closing paren yet, keep reading
while (! ($line =~ /\)/)) {
$_ = <FDCONF>;
- die "unexpected EOF in configure.in, aborting" unless defined $_;
+ die "unexpected EOF in configure.ac, aborting" unless defined $_;
s/\r?\n$//; # Removes eol on both Unix and Windows
# Remove any M4 dnl line
s/\sdnl\s.*//;
Modified: mpich2/trunk/maint/simplemake.txt
===================================================================
--- mpich2/trunk/maint/simplemake.txt 2012-02-28 23:25:23 UTC (rev 9547)
+++ mpich2/trunk/maint/simplemake.txt 2012-02-28 23:26:34 UTC (rev 9548)
@@ -178,7 +178,7 @@
Maintenance Targets:
These are targets included for use by the developer of the package. They
include targets to rebuild files created by simplemake or by autoheader
-and autoconf. These are created in part by reading the configure.in file.
+and autoconf. These are created in part by reading the configure.ac file.
simplemake read the AC_CONFIG_HEADER and AC_OUTPUT commands. If the AC_OUTPUT
command includes a shell variable, the possible values of that shell variable
can be provided to simplemake by assigning a literal string to the variable name with _VALUE postpended. E.g., if AC_OUTPUT references $otherfiles, and $otherfiles might have the values "foo/Makefile" and "bar/Makefile", then include
Modified: mpich2/trunk/maint/updatefiles
===================================================================
--- mpich2/trunk/maint/updatefiles 2012-02-28 23:25:23 UTC (rev 9547)
+++ mpich2/trunk/maint/updatefiles 2012-02-28 23:26:34 UTC (rev 9548)
@@ -439,7 +439,7 @@
recreate_tmp
ver=2.67
# petsc.mcs.anl.gov's /usr/bin/autoreconf is version 2.65 which returns OK
-# if configure.in has AC_PREREQ() withOUT AC_INIT.
+# if configure.ac has AC_PREREQ() withOUT AC_INIT.
#
# ~/> hostname
# petsc
@@ -455,7 +455,7 @@
# rc=63
# ~/> /usr/bin/autoreconf ; echo "rc=$?"
# rc=0
-cat > .tmp/configure.in<<EOF
+cat > .tmp/configure.ac<<EOF
AC_INIT
AC_PREREQ($ver)
AC_OUTPUT
@@ -485,7 +485,7 @@
echo_n "Checking for automake version... "
recreate_tmp
ver=1.11
-cat > .tmp/configure.in<<EOF
+cat > .tmp/configure.ac<<EOF
AC_INIT(testver,1.0)
AC_CONFIG_AUX_DIR([m4])
AC_CONFIG_MACRO_DIR([m4])
@@ -559,7 +559,7 @@
########################################################################
echo_n "Checking for UNIX find... "
-find . -name 'configure.in' > /dev/null 2>&1
+find . -name 'configure.ac' > /dev/null 2>&1
if [ $? = 0 ] ; then
echo "done"
else
@@ -789,7 +789,7 @@
# file; since this cache is not accurate, we delete it.
if [ ! -x maint/configure ] ; then
(cd maint && $autoconf && rm -rf autom4te*.cache )
-elif find maint -name 'configure.in' -newer 'maint/configure' >/dev/null 2>&1 ; then
+elif find maint -name 'configure.ac' -newer 'maint/configure' >/dev/null 2>&1 ; then
# The above relies on the Unix find command
(cd maint && $autoconf && rm -rf autom4te*.cache)
fi
@@ -924,7 +924,7 @@
echo
echo "---------------------------------------------------------------"
echo "Generating configure scripts"
- for dir in `find . -name 'configure.in' -print` ; do
+ for dir in `find . -name 'configure.ac' -print` ; do
dir=`dirname $dir`
found=0
@@ -953,7 +953,7 @@
# First, check for a configure target in Makefile.in
# FIXME: this check is completely broken for Makefiles
# that have multiple targets on the same line (e.g.,
- # configure config.h: configure.in)
+ # configure config.h: configure.ac)
if grep 'configure:' $dir/Makefile.in >/dev/null 2>&1 ; then
# The make -q checks whether the target is upto date first;
# if it isn't, we remake it.
@@ -969,7 +969,7 @@
sed -e 's%@SHELL@%/bin/sh%' -e "s%@srcdir@%.%g" \
-e '/include .*alldeps/d' -e '/@SET_MAKE@/d' \
-e 's%@VPATH@%%' Makefile.in > mf.tmp ; \
- echo "Found $dir/configure.in; executing ${MAKE} -f mf.tmp ./configure" ; \
+ echo "Found $dir/configure.ac; executing ${MAKE} -f mf.tmp ./configure" ; \
if ${MAKE} -q -f mf.tmp ./configure >mf.out 2>&1 ; then \
: ; \
else \
Modified: mpich2/trunk/src/binding/f77/buildiface
===================================================================
--- mpich2/trunk/src/binding/f77/buildiface 2012-02-28 23:25:23 UTC (rev 9547)
+++ mpich2/trunk/src/binding/f77/buildiface 2012-02-28 23:26:34 UTC (rev 9548)
@@ -981,7 +981,7 @@
endif BUILD_PROFILING_LIB
# config.status copies src/binding/f77/mpif.h to src/include (see the relevant
-# AC_OUTPUT_COMMANDS in configure.in), so we need to delete it at distclean time
+# AC_OUTPUT_COMMANDS in configure.ac), so we need to delete it at distclean time
# too. More work is needed in this Makefile.mk to keep src/include/mpif.h up to
# date w.r.t. the src/binding/f77 version.
DISTCLEANFILES += src/binding/f77/mpif.h src/include/mpif.h
@@ -4709,8 +4709,8 @@
# Check for a working autoconf
#
# Try the following first
-# in a new directory, create configure.in containing:
-# AC_INIT(configure.in)
+# in a new directory, create configure.ac containing:
+# AC_INIT(configure.ac)
# AC_LANG_FORTRAN77
# AC_TRY_COMPILE(,[integer a],a=1,a=0)
# Then run autoconf
@@ -4722,8 +4722,8 @@
if (! -d "tmp") {
mkdir "tmp", 0777 || die "Cannot create temporary directory\n";
}
- open (ACFD, ">tmp/configure.in" ) || die "Cannot create test configure.in\n";
- print ACFD "AC_INIT(configure.in)\nAC_LANG_FORTRAN77\n";
+ open (ACFD, ">tmp/configure.ac" ) || die "Cannot create test configure.ac\n";
+ print ACFD "AC_INIT(configure.ac)\nAC_LANG_FORTRAN77\n";
print ACFD "AC_TRY_COMPILE(,[integer a],a=1,a=0)\n";
close ACFD;
Modified: mpich2/trunk/src/binding/f90/subconfigure.m4
===================================================================
--- mpich2/trunk/src/binding/f90/subconfigure.m4 2012-02-28 23:25:23 UTC (rev 9547)
+++ mpich2/trunk/src/binding/f90/subconfigure.m4 2012-02-28 23:26:34 UTC (rev 9548)
@@ -11,7 +11,7 @@
AM_COND_IF([BUILD_F90_LIB],[
# FIXME XXX DJG this code came from a sub-configure in src/binding/f90. Why
# isn't this just all up in the top-level configure? Alternatively, why doesn't
-# most/all of the f90 configure code from the top level configure.in live here
+# most/all of the f90 configure code from the top level configure.ac live here
# instead? Is it because of the c/f77/f90 interplay?
AC_MSG_NOTICE([RUNNING CONFIGURE FOR F90 CODE])
Modified: mpich2/trunk/src/include/mpichtimer.h.in
===================================================================
--- mpich2/trunk/src/include/mpichtimer.h.in 2012-02-28 23:25:23 UTC (rev 9547)
+++ mpich2/trunk/src/include/mpichtimer.h.in 2012-02-28 23:26:34 UTC (rev 9548)
@@ -10,7 +10,7 @@
* timer calls, including the definition of the time stamp type and
* any inlined timer calls.
*
- * The include file timerconf.h (created by autoheader from configure.in)
+ * The include file timerconf.h (created by autoheader from configure.ac)
* is needed only to build the function versions of the timers.
*/
/* Include the appropriate files */
Modified: mpich2/trunk/src/include/nopackage.h
===================================================================
--- mpich2/trunk/src/include/nopackage.h 2012-02-28 23:25:23 UTC (rev 9547)
+++ mpich2/trunk/src/include/nopackage.h 2012-02-28 23:26:34 UTC (rev 9548)
@@ -2,7 +2,7 @@
* (C) 2011 by Argonne National Laboratory.
* See COPYRIGHT in top-level directory.
*/
-/* See comments in MPICH2's configure.in for an explanation of what this file is
+/* See comments in MPICH2's configure.ac for an explanation of what this file is
* and why it exists. */
/* intentionally omitting any #ifndef guard, repeated inclusion is intentional */
Modified: mpich2/trunk/src/mpe2/Makefile.in
===================================================================
--- mpich2/trunk/src/mpe2/Makefile.in 2012-02-28 23:25:23 UTC (rev 9547)
+++ mpich2/trunk/src/mpe2/Makefile.in 2012-02-28 23:26:34 UTC (rev 9548)
@@ -194,7 +194,7 @@
@-$(RM) -f mpe_conf.h.in
@-$(RM) -f configure
-configure: configure.in aclocal_core.m4 aclocal_f77.m4 aclocal_make.m4 \
+configure: configure.ac aclocal_core.m4 aclocal_f77.m4 aclocal_make.m4 \
aclocal_mpi.m4 aclocal.m4
autoheader
autoconf
Modified: mpich2/trunk/src/mpe2/autogen.sh
===================================================================
--- mpich2/trunk/src/mpe2/autogen.sh 2012-02-28 23:25:23 UTC (rev 9547)
+++ mpich2/trunk/src/mpe2/autogen.sh 2012-02-28 23:26:34 UTC (rev 9548)
@@ -11,8 +11,8 @@
if test ! -d .tmp ; then
mkdir .tmp 2>&1 >/dev/null
fi
-rm -f .tmp/configure.in .tmp/configure
-cat >.tmp/configure.in <<EOF
+rm -f .tmp/configure.ac .tmp/configure
+cat >.tmp/configure.ac <<EOF
AC_PREREQ(2.52)
EOF
if (cd .tmp && $MPE_AUTOCONF >/dev/null 2>&1 ) ; then
@@ -42,7 +42,7 @@
fi
rm -rf .tmp
-# We cannot use "find . -name 'configre.in'" to locate configure.ins
+# We cannot use "find . -name 'configre.in'" to locate configure.acs
# because "." is the working directory not the top-level MPE2 source
# directory. So we use the full-pathname of this script to locate the
# MPE2's top-level directory. 'dirname' does not return the full-pathname
@@ -64,8 +64,8 @@
fi
done
-# Locate all the configure.in and invoke autoconf if no configure is found.
-cfgins=`find $master_dir -name 'configure.in' -print`
+# Locate all the configure.ac and invoke autoconf if no configure is found.
+cfgins=`find $master_dir -name 'configure.ac' -print`
for cfgin in $cfgins ; do
dir="`dirname $cfgin`"
if [ ! -x "$dir/configure" ] ; then
Copied: mpich2/trunk/src/mpe2/configure.ac (from rev 9546, mpich2/trunk/src/mpe2/configure.in)
===================================================================
--- mpich2/trunk/src/mpe2/configure.ac (rev 0)
+++ mpich2/trunk/src/mpe2/configure.ac 2012-02-28 23:26:34 UTC (rev 9548)
@@ -0,0 +1,864 @@
+dnl
+dnl Caching is usually WRONG for systems with cross-mounted file systems
+dnl (the cache file may correspond to a different system). Since configure
+dnl is not on a performance-critical path, go for robustness over speed.
+dnl
+define([AC_CACHE_LOAD], )dnl
+define([AC_CACHE_SAVE], )dnl
+dnl
+dnl
+AC_INIT()
+AC_PREREQ(2.52)
+AC_CONFIG_AUX_DIR([.])
+AC_CONFIG_HEADER(mpe_conf.h)
+#
+echo "Configuring MPE Profiling System with $ac_configure_args"
+dnl
+dnl Set top_srcdir_abs to be the ABSOLUTE path to the home directory of MPE
+dnl top_srcdir is in relative path.
+if test "X$srcdir" != "X." -a -s $srcdir/include/mpe.h ; then
+ top_srcdir_abs=$srcdir
+else
+ PAC_GETWD( top_srcdir_abs, include/mpe.h )
+fi
+AC_SUBST(top_srcdir_abs)
+
+# Determine this package's name based on its directory name
+changequote(,)dnl
+tmpname="`echo $top_srcdir_abs | sed -e 's%\(.*\)/\([^/]*\)%\2%'`"
+pkgname="`echo $tmpname | sed -e 'y%abcdefghijklmnopqrstuvwxyz/%ABCDEFGHIJKLMNOPQRSTUVWXYZ_%'`"
+changequote([,])dnl
+if test "x$pkgname" = "x" ; then
+ pkgname="MPE-2"
+fi
+
+AC_ARG_ENABLE( echo,
+[--enable-echo - Turn on strong echoing.
+ The default is enable=no.],
+set -x )
+
+AC_ARG_ENABLE( softerror,
+[--enable-softerror - Turn on soft error, i.e. instead of
+ issuing MSG_ERROR, MSG_WARN + exit 0
+ are used. The default is enable=no.],
+, enable_softerror=${mpe_enable_softerror:-no} )
+
+dnl Don't preset F77 when MPE is configured with MPICH2
+dnl otherwise AC_PROG_F77 or other PAC F77 tests could be messed up below.
+dnl This is especially true when no fortran compiler in PATH.
+VERSION=""
+if test "$FROM_MPICH2" != "yes" ; then
+ CC=${CC:-cc}
+ F77=${F77:-f77}
+ CFLAGS=${CFLAGS}
+ FFLAGS=${FFLAGS}
+fi
+MPE_LIBNAME=""
+
+dnl Read FROM_MPICHx variables from the environment
+MAKE=${MAKE:-make}
+FROM_MPICH=${FROM_MPICH:-no}
+FROM_MPICH2=${FROM_MPICH2:-no}
+FROM_LAM=${FROM_LAM:-no}
+
+
+dnl Fixup for make
+PAC_MAKE_IS_GNUMAKE
+PAC_MAKE_IS_BSD44
+PAC_MAKE_IS_OSF
+PAC_MAKE_VPATH
+AC_SUBST(MAKE)
+
+dnl If we are relying on vpath and no vpath is set, then we must exit
+if test ! -s include/mpe.h -a -z "$VPATH" ; then
+ AC_MSG_ERROR( [No virtual MAKE path command found.
+ You may need to set your make command
+ The GNU make (sometimes available as gnumake) can be used.] )
+fi
+
+dnl CPRP is the version of cp that accepts -r and -p arguments.
+MKDIR=mkdir
+CPRP=cp
+RM=rm
+MV=mv
+AC_SUBST(MKDIR)
+AC_SUBST(CPRP)
+AC_SUBST(RM)
+AC_SUBST(MV)
+
+AC_ARG_ENABLE( strict,
+[--enable-strict - Turn on strict compilation testing
+ when using gcc],,enable_strict=no )
+dnl
+AC_ARG_ENABLE( g,
+[--enable-g - Turn on/off the compilation flag -g.
+ The default is enable=no.],
+[if test "$enable_g" != "no" ; then enable_g=yes ; fi],
+[enable_g=no] )
+
+dnl MPE_BUILD_FORTRAN2C=yes means that ALL subpackages will be building
+dnl the fortran2c wrapper libraries. This does not necessarily mean that
+dnl specific subpackage has to build fortran2c wrapper library. One example:
+dnl src/wrappers may have --with-f2cmpilibs set by user, so src/wrappers's
+dnl own libmpe_f2cmpi.a will not be built but MPE_BUILD_FORTRAN2C could
+dnl still be set to yes because it means other subpackages like src/graphics
+dnl and src/logging will build their fortran2c wrapper objects. So treat
+dnl MPE_BUILD_FORTRAN2C as a directive, i.e. generally a necessary but
+dnl insufficient condition to build fortran2c wrapper library.
+AC_ARG_ENABLE( f77,
+[--enable-f77 - Compile routines that require a Fortran
+ compiler. If configuring with MPICH, the
+ configure in the top-level MPICH directory
+ will choose the appropriate value for you.
+ The default is enable=yes.], ,
+enable_f77=yes )
+if test "$enable_f77" = "yes" ; then
+ MPE_BUILD_FORTRAN2C=yes
+else
+ MPE_BUILD_FORTRAN2C=no
+fi
+
+AC_ARG_ENABLE( mpich,
+[--enable-mpich - Indicates if this MPE will be built as
+ part of the MPICH build. The default is
+ enable=no.], ,
+enable_mpich=no )
+
+dnl Translating FROM_MPICHx into MPI_IMPL. So don't pass FROM_MPICHx down
+dnl to subpackages. All subpackages will use MPI_IMPL instead.
+dnl BUILDING_MPI=yes disables the linkage test during building, i.e. make
+dnl BUILDING_MPI=yes when MPI_IMPL=MPICH or MPI_IMPL=MPICH2
+dnl MPE_KNOWN_MPI_IMPL can be tested by testing MPI_IMPL = MPICH, MPICH2
+if test "$enable_mpich" = "yes" -o "$FROM_MPICH" = "yes" ; then
+ AC_MSG_RESULT([This MPE build is part of the MPICH build])
+ MPI_IMPL="MPICH"
+ enable_softerror=yes
+ enable_checkMPI=no
+dnl BUILDING_MPI=yes & MPE_KNOWN_MPI_IMPL=yes
+elif test "$FROM_MPICH2" = "yes" ; then
+ AC_MSG_RESULT([This MPE build is part of the MPICH2 build])
+ MPI_IMPL="MPICH2"
+ if test -d "$includebuild_dir" ; then
+ MPICPPFLAGS="$MPICPPFLAGS -I$includebuild_dir"
+ else
+ MPICPPFLAGS="$MPICPPFLAGS -I$master_top_srcdir/src/include -I$master_top_builddir/src/include"
+ fi
+ enable_softerror=yes
+ enable_checkMPI=no
+dnl BUILDING_MPI=yes & MPE_KNOWN_MPI_IMPL=yes
+dnl elif test "$FROM_LAM" = yes ; then
+dnl AC_MSG_RESULT([This MPE build is part of the LAM build])
+dnl MPI_IMPL="LAM"
+dnl BUILDING_MPI=yes & MPE_KNOWN_MPI_IMPL=yes
+else
+ AC_MSG_RESULT([User supplied MPI implmentation (Good Luck!)])
+ MPI_IMPL="UserSupplied"
+ enable_checkMPI=yes
+dnl BUILDING_MPI=no & MPE_KNOWN_MPI_IMPL=no
+fi
+
+AC_ARG_ENABLE( checkMPI,
+[--enable-checkMPI - Turn on/off the linking test for the MPI
+ include files, MPI libraries and MPI_CC
+ compiler. The default is enable=yes.],
+enable_checkMPI=${mpe_enable_checkMPI:-$enableval} )
+
+AC_ARG_ENABLE( checkMPIwtime,
+[--enable-checkMPIwtime - Turn on/off the linking test for the
+ MPI_Wtime(). The default is enable=no.], ,
+enable_checkMPIwtime=no )
+
+dnl
+dnl Set the MPE Libraries name
+dnl
+AC_ARG_WITH( mpelibname,
+[--with-mpelibname=MPE_LIBNAME - Set the MPE library name instead of the
+ default 'mpe', e.g. if MPE_LIBNAME=mpe_new,
+ then the libraries generated will be
+ libmpe_new.a, liblmpe_new.a, libtmpe_new.a
+ and libampe_new.a.],
+MPE_LIBNAME="$withval" )
+
+dnl
+dnl Set the Fortran Include Library Leading Characters
+dnl
+AC_ARG_WITH( finc_path_leader,
+[--with-finc_path_leader=FINC_PATH_LEADER - Specify a Fortran include path
+ leader for compilation,
+ default value is -I.],
+FINC_PATH_LEADER="$withval" )
+dnl
+AC_ARG_WITH( flib_path_leader,
+[--with-flib_path_leader=FLIB_PATH_LEADER - Specify a Fortran library path
+ leader for linking, default value is -L.],
+FLIB_PATH_LEADER="$withval" )
+dnl
+
+dnl
+dnl Check if -g is needed to appended to CFLAGS and FFLAGS
+dnl
+dnl Append "-g" to xFLAGS and MPI_xFLAGS if enable_g=yes
+if test "$enable_g" = "yes" ; then
+ for flagname in CFLAGS FFLAGS MPI_CFLAGS MPI_FFLAGS ; do
+ eval flagvalue=\$"$flagname"
+ case " $flagvalue " in
+ *" -g "*)
+ ;; # Avoid duplication, do nothing
+ *)
+ # Split eval command into 2 lines so
+ # vi's hightlight mode won't get confused.
+ flagcmd="$flagname=\"$flagvalue -g\""
+ eval ${flagcmd}
+ ;;
+ esac
+ done
+fi
+
+# Set the various build directories and export them as environmental variables.
+#
+# [mpe_]includebuild_dir is for all user header files
+# [mpe_]libbuild_dir is for building the libraries in before they are installed.
+# [mpe_]binbuild_dir is for the scripts/programs
+# [mpe_]sbinbuild_dir is for all system admin tools
+# [mpe_]etcbuild_dir is for all system admin configuration settings
+#
+rootbuild_dir=`pwd`
+for dir in include lib bin sbin etc ; do
+ dirname=${dir}build_dir
+ eval dirvalue=\$"$dirname"
+ eval $dirname=$rootbuild_dir/$dir
+ mpe_dirname=mpe_$dirname
+ eval $mpe_dirname=\$"$dirname"
+ export $mpe_dirname
+done
+
+srcbuild_dir=$rootbuild_dir/src
+for dir in include lib bin sbin src etc ; do
+ dirname=${dir}build_dir
+ eval dirvalue=\$"$dirname"
+ if test -n "$dirvalue" ; then
+ if test ! -d $dirvalue ; then
+ if mkdir -p $dirvalue ; then
+ :
+ else
+ PAC_MSG_ERROR( $enable_softerror,
+ [Could not create directory $dirvalue] )
+ fi
+ fi
+ fi
+done
+
+AC_SUBST(includebuild_dir)
+AC_SUBST(libbuild_dir)
+AC_SUBST(binbuild_dir)
+AC_SUBST(sbinbuild_dir)
+AC_SUBST(etcbuild_dir)
+
+
+dnl
+dnl Unknown MPI implmentation, i.e. User defined MPI_LIBS and MPI_INC
+dnl
+AC_ARG_WITH( mpicc,
+[--with-mpicc=MPI_CC - C compiler for MPI program,
+ e.g. mpixlc_r for BG/P MPI, or
+ mpicc from MPICHx, Open-MPI, or LAM-MPI.
+ Setting --with-mpicc to MPI wrapper
+ means no need to set --with-mpiinc
+ and --with-mpilibs.],
+MPI_CC="$withval" )
+
+AC_ARG_WITH( mpif77,
+[--with-mpif77=MPI_F77 - Fortran compiler for MPI program,
+ e.g. mpixlf77_r for BG/P MPI, or
+ mpif77 from MPICHx, Open-MPI, or LAM-MPI.
+ Setting --with-mpif77 to MPI wrapper
+ means no need to set --with-mpiinc
+ and --with-mpilibs.],
+MPI_F77="$withval" )
+
+AC_ARG_WITH( mpiinc,
+[--with-mpiinc=MPI_INC - MPI include path prefixed with -I.
+ It specifies MPI header files location,
+ where mpi.h and mpif.h are located,
+ e.g. -I/pkgs/MPI/include. This flag will
+ be added to MPI_CFLAGS and MPI_FFLAGS,
+ i.e. the MPI include path can be
+ explicitly set in MPI_CFLAGS and
+ MPI_FFLAGS without setting --with-mpiinc.],
+MPI_INC="$withval" )
+
+AC_ARG_WITH( mpilibs,
+[--with-mpilibs=MPI_LIBS - MPI library flags with -L and -l.
+ It specifies the location of the MPI
+ libraries. The flags contains library
+ path prefixed with -L and MPI libraries
+ name prefixed with -l,
+ e.g. -L/opt/MPI/lib -lpmpich -lmpich.],
+MPI_LIBS="$withval" )
+
+dnl
+misc_dirname="src/misc"
+callstack_dirname="src/callstack"
+logging_dirname="src/logging"
+wrappers_dirname="src/wrappers"
+graphics_dirname="src/graphics"
+collchk_dirname="src/collchk"
+slog2_dirname="src/slog2sdk"
+
+dnl Cleanup the subpackages' Makefiles if they exist
+AC_MSG_CHECKING( [for leftover Makefiles in subpackages] )
+leftover_pkgs=""
+for pkg in misc callstack logging wrappers graphics collchk slog2 ; do
+ dirname=${pkg}_dirname
+ eval dirvalue=\$"$dirname"
+ if test -s $rootbuild_dir/$dirvalue/Makefile ; then
+ leftover_pkgs="$leftover_pkgs \"$dirvalue\""
+ ( cd $rootbuild_dir/$dirvalue && $MAKE distclean > /dev/null 2>&1 )
+ dnl Just in case "make distclean" does not remove Makefile.
+ if test -f $rootbuild_dir/$dirvalue/Makefile ; then
+ $RM -f $rootbuild_dir/$dirvalue/Makefile
+ fi
+ fi
+done
+if test "X$leftover_pkgs" = "X" ; then
+ AC_MSG_RESULT( [none] )
+else
+ AC_MSG_RESULT( [$leftover_pkgs cleaned] )
+fi
+
+dnl trial_pkgs="misc callstack logging wrappers graphics collchk"
+
+dnl
+AC_ARG_ENABLE( misc,
+[--enable-misc - Build MPE miscellaneous routines, e.g.
+ MPE_Errors_xxx(), MPE_Seq_xxx(),
+ MPE_xxxTags() and MPE_GetHostName()....
+ The default enable=yes.],
+, enable_misc=yes )
+
+dnl
+AC_ARG_ENABLE( callstack,
+[--enable-callstack - Build MPE callstack routines, i.e.
+ MPE_CallStack_xxx()...
+ The default enable=yes.],
+, enable_callstack=yes )
+
+dnl
+AC_ARG_ENABLE( logging,
+[--enable-logging - Build MPE logging routines for
+ CLOG-2, e.g. MPE_Log_xxx()...
+ The default enable=yes.],
+, enable_logging=yes )
+
+dnl
+AC_ARG_ENABLE( wrappers,
+[--enable-wrappers - Build various MPI wrapper libraries.
+ MPI logging library, liblmpe.a;
+ MPI tracing library, libtmpe.a;
+ MPI Fortran to C library, libmpe_f2cmpi.a],
+, enable_wrappers=yes )
+dnl src/wrappers requires at least src/logging
+if test "$enable_wrappers" = "yes" ; then
+ if test "$enable_logging" != "yes" ; then
+ enable_logging=yes
+ AC_MSG_WARN( [Enabling Logging which is required by Wrappers.] );
+ fi
+fi
+
+dnl Determine if the X graphics is going to be configured
+AC_ARG_ENABLE( graphics,
+[--enable-graphics - Build MPE graphics routines and MPI
+ animation library, libampe.a. If disabled
+ then the MPE routines that make use of X11
+ graphics will NOT be built. This is
+ appropriate for systems that either do not
+ have the X11 include files or that do not
+ support X11 graphics.
+ The default enable=yes.],
+, enable_graphics=yes )
+dnl src/graphics's libmpe_nompi.a requires mpehname.c defined in src/misc
+dnl but then libmpe_nompi.a is rarely used, tests in src/grahics will pass
+dnl without src/misc. Let user decides.
+if test "$enable_graphics" = "yes" -a "$enable_misc" != "yes" ; then
+ AC_MSG_WARN( [libmpe_nompi.a in src/graphics needs mpehname.c in src/misc!
+ If you need libmpe_nompi.a, reconfigure with --enable-misc.] )
+fi
+
+AC_ARG_ENABLE( collchk,
+[--enable-collchk - Build MPI Collective and Datatype
+ checking library, libmpe_collchk.a],
+, enable_collchk=yes )
+dnl src/collchk requires at least src/callstack
+if test "$enable_collchk" = "yes" ; then
+ if test "$enable_callstack" != "yes" ; then
+ enable_callstack=yes
+ AC_MSG_WARN( [Enabling CallStack which is required by CollChk.] );
+ fi
+fi
+
+selected_pkgs=""
+
+if test "$enable_misc" = "yes" -a -s $srcdir/src/misc/configure ; then
+ selected_pkgs="$selected_pkgs misc"
+ AC_CONFIG_SUBDIRS(src/misc)
+fi
+if test "$enable_callstack" = "yes" -a -s $srcdir/src/callstack/configure ; then
+ selected_pkgs="$selected_pkgs callstack"
+ AC_CONFIG_SUBDIRS(src/callstack)
+fi
+if test "$enable_logging" = "yes" -a -s $srcdir/src/logging/configure ; then
+ selected_pkgs="$selected_pkgs logging"
+ AC_CONFIG_SUBDIRS(src/logging)
+fi
+if test "$enable_wrappers" = "yes" -a -s $srcdir/src/wrappers/configure ; then
+ selected_pkgs="$selected_pkgs wrappers"
+ AC_CONFIG_SUBDIRS(src/wrappers)
+fi
+if test "$enable_graphics" = "yes" -a -s $srcdir/src/graphics/configure ; then
+ selected_pkgs="$selected_pkgs graphics"
+ AC_CONFIG_SUBDIRS(src/graphics)
+fi
+if test "$enable_collchk" = "yes" -a -s $srcdir/src/collchk/configure ; then
+ selected_pkgs="$selected_pkgs collchk"
+ AC_CONFIG_SUBDIRS(src/collchk)
+fi
+
+dnl Determine if the slog2sdk directory is going to be configured.
+AC_ARG_ENABLE( slog2,
+[--enable-slog2{=build} - Configure all the SLOG-2 tools.
+ --enable-slog2 without any argument will
+ use the prebuilt jar files.
+ --enable-slog2=build will rebuild all the
+ jar files from the source code.
+ The default is enable=yes.], ,
+enable_slog2=yes )
+
+
+dnl if SLOG-2 is here, configure it
+if test -s $srcdir/$slog2_dirname/configure ; then
+ if test "$enable_slog2" = "yes" -o "$enable_slog2" = "build" ; then
+ if test "$enable_slog2" = "build" ; then
+ slog2_enable_source=yes
+ else
+ slog2_enable_source=no
+ fi
+ export slog2_enable_source
+ dnl Enable softerror in SLOG2 configure won't abort the entire process
+ slog2_enable_softerror=yes
+ export slog2_enable_softerror
+ selected_pkgs="$selected_pkgs slog2"
+ if test "$MPI_IMPL" = "MPICH" -o "$MPI_IMPL" = "MPICH2" ; then
+ dnl Disable the SAMPLE code in slog2sdk for MPICH2
+ slog2_enable_sample=no
+ export slog2_enable_sample
+ fi
+ AC_CONFIG_SUBDIRS(src/slog2sdk)
+ fi
+fi
+
+dnl The following statement is no longer true as of 6/24/2007,
+dnl a thread-specific MPE logging on/off switch has been added
+dnl to mpe_log_thread[.h/.c] and MPI logging wrappper library
+dnl has been updated accordingly.
+dnl
+dnl AC_ARG_ENABLE( threadlogging,
+dnl [--enable-threadlogging - Turn on/off the coarse-grained thread
+dnl support in MPE logging. The default
+dnl is enable=no.], ,
+dnl enable_threadlogging=no )
+dnl
+dnl When thread-logging is enabled in multi-thread environment,
+dnl safePMPI guard can't be used, i.e. global variables is_mpelog_on
+dnl can't be used in coarse-grained thread support,
+dnl becasue these varaibles need to be thread-specific. Otherwise
+dnl turn off logging on 1 thread would mean turning it off for all
+dnl threads.
+dnl
+dnl if test "$enable_threadlogging" = "yes" ; then
+dnl enable_safePMPI=no
+dnl export enable_safePMPI
+dnl fi
+
+
+AC_ARG_VAR( MPI_CC, [C compiler for MPI program, e.g. mpixlc_r for BG/P MPI, or mpicc from MPICHx, Open-MPI, or LAM-MPI. Setting MPI_CC to MPI wrapper means no need to set MPI_INC and MPI_LIBS.] )
+AC_ARG_VAR( MPI_F77, [Fortran compiler for MPI program, e.g. mpixlf77_r for BG/P MPI, or mpif77 from MPICHx, Open-MPI, or LAM-MPI. Setting MPI_F77 to MPI wrapper means no need to set MPI_INC and MPI_LIBS.] )
+AC_ARG_VAR( MPI_INC, [MPI include path prefixed with -I. It specifies MPI header files location, where mpi.h and mpif.h are located, e.g. -I/pkgs/MPI/include. This flag will be added to MPI_CFLAGS and MPI_FFLAGS, i.e. the MPI include path can be explicitly set in MPI_CFLAGS and MPI_FFLAGS without setting MPI_INC.] )
+AC_ARG_VAR( MPI_CFLAGS, [MPI C compiler flags to compile MPI program.] )
+AC_ARG_VAR( MPI_FFLAGS, [MPI Fortran compiler flags to compile MPI Fortran program.] )
+AC_ARG_VAR( MPI_LIBS, [MPI library flags with -L and -l. It specifies the location of the MPI libraries. The flags contains library path prefixed with -L and MPI libraries name prefixed with -l, e.g. -L/opt/MPI/lib -lpmpich -lmpich.] )
+dnl AC_ARG_VAR( MPI_LDFLAGS, [MPI linker flags used with MPI_CC or MPI_F77 during linking.] )
+AC_ARG_VAR( MPERUN, [MPI application launch command. This variable is necessary only if user wants to run "make check", "make installcheck-all" or "$sbindir/mpecheckinstall -run" when the default MPERUN value, "$bindir/mpiexec -n 4", is not correct.] )
+
+# Prepend/Append '"' before/after MPERUN.
+if test "x$MPERUN" != "x" ; then
+ MPERUN="\"$MPERUN\""
+fi
+
+# Preppend MPI_INC to MPI_CFLAGS/MPI_FFLAGS
+if test "x$MPI_INC" != "x" ; then
+ MPI_CFLAGS="$MPI_INC $MPI_CFLAGS"
+ MPI_FFLAGS="$MPI_INC $MPI_FFLAGS"
+fi
+
+dnl
+AC_ARG_WITH( cross-spec,
+[--with-cross-spec=file - Specify the values of variables that
+ configure cannot determine in a
+ cross-compilation environment through
+ a file], ,
+with_cross_spec=no )
+dnl
+pac_cross_compiling=no
+if test "$with_cross_spec" != "no" ; then
+ if test -s "$with_cross_spec" ; then
+ AC_MSG_RESULT([Reading the cross-compilation file $with_cross_spec])
+ . $with_cross_spec
+ # Autoconf 2.52 no longer sets cross_compiling except with the
+ # awkward "targethost" options.
+ pac_cross_compiling=yes
+ cross_compiling=yes
+ ac_cv_prog_cc_cross=yes
+ ac_cv_prog_f77_cross=yes
+ ac_cv_prog_f90_cross=yes
+ ac_cv_prog_cxx_cross=yes
+ export cross_compiling
+ # Export all the variables in cross_spec/cross_spec.txt
+ # i.e. CROSS_xxx, MPI_xxx and friends...
+ cross_spec_vars=`grep -v '^#' $with_cross_spec | sed -e 's/=.*//g'`
+ for var in $cross_spec_vars ; do
+ eval value=\$"$var"
+ echo "Exporting $var=$value ..."
+ export $var
+ done
+ fi
+fi
+
+
+dnl
+AC_ARG_WITH( config-args,
+[--with-config-args=filename - Specify configure argument file that
+ contains the values of variables that
+ configure reads, e.g. CC, CFLAGS,
+ F77, FFLAGS, MPI_CC, MPI_F77....
+ If the filename does not begin with
+ / (absolute path), . or .. (relative path),
+ the filename will be assumed to be
+ $top_srcdir/configargs/<filename>.cfg.], ,
+with_config_args=no )
+dnl
+if test "$with_config_args" != "no" ; then
+ case "$with_config_args" in
+ /*|../*|./*)
+ config_args_file="$with_config_args"
+ ;;
+ *)
+ config_args_file="$srcdir/configargs/${with_config_args}.cfg"
+ ;;
+ esac
+ if test -s "$config_args_file" ; then
+ AC_MSG_RESULT([Reading the configure arguments in ${config_args_file}.])
+ . $config_args_file
+ # Export all the variables in $config_args_file
+ # i.e. CC, F77, CFLAGS, FFLAGS and friends...
+ config_args_vars=`grep -v '^#' $config_args_file | sed -e 's/=.*//g'`
+ for var in $config_args_vars ; do
+ eval value=\$"$var"
+ echo "Exporting $var=$value ..."
+ export $var
+ done
+ else
+ AC_MSG_WARN([Non-existent ${config_args_file}.])
+ fi
+fi
+
+
+AC_PROG_CC
+dnl Check for broken handling of common symbols
+dnl PAC_PROG_C_BROKEN_COMMON
+
+dnl Adding --enable-strict flags to CFLAGS if needed.
+dnl No space should be added after "(" and before ")", otherwise invalid
+dnl statement, like 'CFLAGS ="$CFLAGS ..."', will be resulted in configure.
+dnl Also, PAC_GET_GCC_STRICT_FLAGS should be called after AC_PROG_CC.
+if test "$FROM_MPICH2" != "yes" ; then
+ MPE_COPTION=""
+ PAC_GET_GCC_STRICT_FLAGS([MPE_COPTION])
+ if test "x$MPE_COPTION" != "x" ; then
+ CFLAGS="$CFLAGS $MPE_COPTION"
+ MPI_CFLAGS="$MPI_CFLAGS $MPE_COPTION"
+ fi
+fi
+
+dnl MPI_CC is only use for MPI programs.
+dnl CC should be the same compiler that is used within the MPI_CC
+dnl environment. MPI_LIBS should also be set for linking MPI programs
+AC_MSG_CHECKING( whether MPI_CC has been set )
+if test -z "$MPI_CC" ; then
+ MPI_CC="$CC $MPICPPFLAGS"
+fi
+AC_MSG_RESULT( $MPI_CC )
+
+if test "$MPE_BUILD_FORTRAN2C" = "yes" ; then
+ AC_PROG_F77
+ if test "x$F77" = "x" ; then
+ MPE_BUILD_FORTRAN2C=no
+ fi
+ AC_MSG_CHECKING( whether MPI_F77 has been set )
+ if test -z "$MPI_F77" ; then
+ # FIXME: Temporary for F77 accepting the same flags as CC for
+ # file includes
+ MPI_F77="$F77 $MPICPPFLAGS"
+ fi
+ AC_MSG_RESULT( $MPI_F77 )
+fi
+
+# Determine the name of the various library being built
+if test -z "$MPE_LIBNAME" ; then
+ MPE_LIBNAME=mpe
+fi
+
+
+
+dnl
+dnl Check if MPI_CC, MPI_CFLAGS, and MPI_LIBS together provide
+dnl a linkable environment for a simple MPI program
+dnl
+if test "$MPI_IMPL" != "MPICH" -a "$MPI_IMPL" != "MPICH2" ; then
+ if test "$enable_checkMPI" = "yes" ; then
+ AC_MSG_CHECKING( [for the linkage of the supplied MPI C definitions] )
+ PAC_MPI_LINK_CC_FUNC( $MPI_CC, [$MPI_CFLAGS], $MPI_LIBS, , , ,
+ [ mpe_link_ok=yes ], [ mpe_link_ok=no ] )
+ if test "$mpe_link_ok" = "yes" ; then
+ AC_MSG_RESULT(yes)
+ else
+ AC_MSG_RESULT(no)
+ PAC_MSG_ERROR( $enable_softerror,
+ [Cannot link with basic MPI C program!
+ Check your MPI include paths, MPI libraries and MPI CC compiler] )
+ fi
+ fi
+ if test "$enable_checkMPI" = "yes" -a "$MPE_BUILD_FORTRAN2C" = "yes" ; then
+ AC_MSG_CHECKING( [for the linkage of the supplied MPI F77 definitions] )
+ PAC_MPI_LINK_F77_FUNC( $MPI_F77, [$MPI_FFLAGS], $MPI_LIBS, [
+ integer mytid
+ integer ierr
+ ], [
+ call MPI_Comm_rank( MPI_COMM_WORLD, mytid, ierr )
+ ],
+ [ mpe_link_ok=yes ], [ mpe_link_ok=no ] )
+ if test "$mpe_link_ok" = "yes" ; then
+ AC_MSG_RESULT(yes)
+ else
+ AC_MSG_RESULT(no)
+ PAC_MSG_ERROR( $enable_softerror,
+ [Cannot link with basic MPI F77 program!
+ Check your MPI include paths, MPI libraries and MPI F77 compiler ] )
+ fi
+ fi
+
+ dnl
+ dnl Some MPI's seem to have trouble with
+ dnl MPI_Wtime, PMPI_Wtime, and MPI_Attr_get
+ dnl (Fujitsu for MPI_Wtime and MPI_Attr_get; IBM's PMPI_Wtime returned 0)
+ dnl Check at least that we can link with MPI_Wtime and MPI_Attr_get
+ dnl
+ if test "$enable_checkMPI" = "yes" -a "$enable_checkMPIwtime" = "yes" ; then
+ AC_MSG_CHECKING( [for the C version of MPI_Wtime()] )
+ PAC_MPI_LINK_CC_FUNC( $MPI_CC, [$MPI_CFLAGS], $MPI_LIBS, ,
+ [ double d ],
+ [ d=MPI_Wtime() ],
+ [ mpe_link_ok=yes ], [ mpe_link_ok=no ] )
+ if test "$mpe_link_ok" = "yes" ; then
+ AC_MSG_RESULT(yes)
+ AC_DEFINE( HAVE_MPI_WTIME,1,[Define if MPI_Wtime available] )
+ else
+ AC_MSG_RESULT(no)
+ PAC_MSG_ERROR( $enable_softerror, [Cannot link with MPI_Wtime()!
+ Check your MPI include paths, MPI libraries and MPI CC compiler ] )
+ fi
+ fi
+fi
+
+if test -z "$CC" -o -z "$MPI_CC"; then
+ PAC_MSG_ERROR( $enable_softerror,
+ [You must configure MPE with a specific MPI] )
+fi
+
+if test -n "$F77" -a "$MPE_BUILD_FORTRAN2C" = "yes" ; then
+ FLIBS_save="$FLIBS"
+ FLIBS=""
+ AC_F77_LIBRARY_LDFLAGS
+ # The autoconf macro for finding FLIBS sometimes makes mistakes
+ # (particularly with the Fujitsu frt compiler). This next step
+ # first sees if the FLIBS is valid with the Fortran compiler
+ PAC_PROG_F77_FLIBS_VALID
+ # Now see if FLIBS works with the C compiler
+ PAC_PROG_F77_CHECK_FLIBS
+
+ PAC_PROG_F77_LINKER_WITH_C
+ PAC_PROG_F77_OBJ_LINKS_WITH_C
+ # For name mangle, we need the library flags
+ PAC_PROG_F77_NAME_MANGLE
+ # Check whether additional libraries are needed when linking with C
+ PAC_PROG_F77_AND_C_STDIO_LIBS
+ AC_SUBST(F77_OTHER_LIBS)
+
+ PAC_PROG_F77_LIBRARY_DIR_FLAG
+ if test -z "$FLIB_PATH_LEADER" ; then
+ FLIB_PATH_LEADER=$F77_LIBDIR_LEADER
+ fi
+ PAC_PROG_F77_HAS_INCDIR(f77tmpdir)
+ FINC_PATH_LEADER=$F77_INCDIR
+
+ # Replace all -I in MPI_FFLAGS by $FINC_PATH_LEADER
+ MPI_FFLAGS=`echo "$MPI_FFLAGS" | sed -e "s|-I|$FINC_PATH_LEADER|g"`
+ # If there is MPI_FLIBS, to replace -L by $FLIB_PATH_LEADER
+fi
+
+dnl We need to check that this has worked. The autoconf macro is broken
+AC_PROG_CPP
+if test "$CPP" = "/lib/cpp" -a ! -x /lib/cpp ; then
+ AC_MSG_ERROR( [configure could not find a working C preprocessor] )
+fi
+
+dnl check for "ln -s" exists. It is for install program, mpeinstall
+AC_PROG_LN_S
+
+dnl checking for working INSTALL
+AC_PROG_INSTALL
+PAC_PROG_CHECK_INSTALL_WORKS
+PAC_PROG_INSTALL_BREAKS_LIBS
+
+dnl
+dnl MPE_CFLAGS/MPE_FFLAGS are used to pass MPE-modified CFLAGS/FFLAGS
+dnl to other subpackages. Can't use CFLAGS to pass this info because
+dnl user may have set CFLAGS in the environment. In that scenario,
+dnl env variable CFLAGS can't be set! So subpackages cannot get the
+dnl MPE-modified CFLAGS.
+dnl
+MPE_CFLAGS="$CFLAGS"
+if test "$MPE_BUILD_FORTRAN2C" = "yes" ; then
+ MPE_FFLAGS="$FFLAGS"
+fi
+
+dnl Determine if this is "UserSupplied" MPI implmentation.
+dnl If so, build mpecc and mpefc.
+dnl MPE_CLINKER/MPE_FLINKER need to sync with sbin/mpeinstall
+if test "$MPI_IMPL" != "MPICH" -a "$MPI_IMPL" != "MPICH2" ; then
+ mpe_compilers=bin/mpecc
+ if test "$MPE_BUILD_FORTRAN2C" = "yes" ; then
+ mpe_compilers="$mpe_compilers bin/mpefc"
+ fi
+ MPE_CLINKER="$binbuild_dir/mpecc -"
+ MPE_FLINKER="$binbuild_dir/mpefc -"
+else dnl This is MPICH2.
+ MPE_CLINKER="$MPI_CC -mpe="
+ MPE_FLINKER="$MPI_F77 -mpe="
+fi
+
+dnl The following does not work as expected because
+dnl AC_CONFIG_SUBDIRS sets the "precious" variables like CFLAGS from the
+dnl settings recorded at the top of the configure. That means CFLAGS cannot
+dnl be inherit from the mpich2's configure enviroment.
+dnl
+dnl Include --enable-strict option only if this isn't part of MPICHx build.
+dnl MPE does not even need to check enable_strict_done passed down by MPICH2.
+dnl if test "$MPI_IMPL" != "MPICH" -a "$MPI_IMPL" != "MPICH2" ; then
+dnl MPE_CFLAGS="$MPE_CFLAGS $STRICT_COPTS"
+dnl fi
+dnl
+if test -z "$CLINKER" ; then CLINKER="$CC" ; fi
+if test -z "$FLINKER" ; then FLINKER="$F77" ; fi
+AC_SUBST(MPI_IMPL)
+AC_SUBST(MPE_LIBNAME)
+AC_SUBST(MPE_BUILD_FORTRAN2C)
+dnl "precious" AC_SUBST(CC)
+AC_SUBST(CLINKER)
+AC_SUBST(MPE_CFLAGS)
+dnl "precious" AC_SUBST(MPI_CC)
+dnl "precious" AC_SUBST(MPI_CFLAGS)
+AC_SUBST(MPE_CLINKER)
+AC_SUBST(F77)
+AC_SUBST(FLINKER)
+AC_SUBST(MPE_FFLAGS)
+dnl "precious" AC_SUBST(MPI_F77)
+dnl "precious" AC_SUBST(MPI_FFLAGS)
+AC_SUBST(MPE_FLINKER)
+dnl "precious" AC_SUBST(MPI_LIBS)
+dnl "precious" AC_SUBST(LDFLAGS)
+dnl "precious" AC_SUBST(MPERUN)
+
+dnl Make the directories that do not contain Makefiles (should they?) but
+dnl are needed for the subsequent directories.
+$RM -f $srcdir/mpe_conf.h
+
+export MPI_IMPL
+export MPE_LIBNAME
+export MPE_BUILD_FORTRAN2C
+export CC
+export CLINKER
+export MPI_CC
+export MPI_CFLAGS
+export MPE_CLINKER
+export MPE_CFLAGS
+export F77
+export FLINKER
+export MPI_F77
+export MPI_FFLAGS
+export MPE_FLINKER
+export MPE_FFLAGS
+export MPI_LIBS
+export LDFLAGS
+export FINC_PATH_LEADER
+export FLIB_PATH_LEADER
+
+mpe_enable_softerror=yes
+export mpe_enable_softerror
+
+
+
+
+AC_OUTPUT_COMMANDS( [
+if test ! -x ./sbin/mpeinstall -a -s ./sbin/mpeinstall ; then
+ chmod u+x ./sbin/mpeinstall
+fi
+if test ! -x ./sbin/mpecheckinstall -a -s ./sbin/mpecheckinstall ; then
+ chmod u+x ./sbin/mpecheckinstall
+fi
+if test ! -x ./sbin/mpecheckbuild -a -s ./sbin/mpecheckbuild ; then
+ chmod u+x ./sbin/mpecheckbuild
+fi
+if test ! -x ./sbin/mpetestlink -a -s ./sbin/mpetestlink ; then
+ chmod u+x ./sbin/mpetestlink
+fi
+if test ! -x ./sbin/mpetestexec -a -s ./sbin/mpetestexec ; then
+ chmod u+x ./sbin/mpetestexec
+fi
+if test ! -x ./sbin/mpetestexeclog -a -s ./sbin/mpetestexeclog ; then
+ chmod u+x ./sbin/mpetestexeclog
+fi
+if test ! -x ./bin/mpecc -a -s ./bin/mpecc ; then
+ chmod a+x ./bin/mpecc
+fi
+if test ! -x ./bin/mpefc -a -s ./bin/mpefc ; then
+ chmod a+x ./bin/mpefc
+fi
+] )
+AC_OUTPUT( Makefile sbin/mpetestlink sbin/mpetestexec sbin/mpetestexeclog \
+ sbin/mpeinstall sbin/mpecheckinstall sbin/mpecheckbuild \
+ etc/mpe_help.conf etc/mpe_f77env.conf $mpe_compilers )
+
+configured_pkgs=""
+for pkg in $selected_pkgs ; do
+ dirname=${pkg}_dirname
+ eval dirvalue=\$"$dirname"
+ if test -s $dirvalue/Makefile ; then
+ configured_pkgs="$configured_pkgs \"$dirvalue\""
+ fi
+done
+
+if test -z "$configured_pkgs" ; then
+ AC_MSG_WARN([$pkgname: No sub-package has been configured])
+else
+ AC_MSG_RESULT([$pkgname: $configured_pkgs have been configured])
+fi
Deleted: mpich2/trunk/src/mpe2/configure.in
===================================================================
--- mpich2/trunk/src/mpe2/configure.in 2012-02-28 23:25:23 UTC (rev 9547)
+++ mpich2/trunk/src/mpe2/configure.in 2012-02-28 23:26:34 UTC (rev 9548)
@@ -1,864 +0,0 @@
-dnl
-dnl Caching is usually WRONG for systems with cross-mounted file systems
-dnl (the cache file may correspond to a different system). Since configure
-dnl is not on a performance-critical path, go for robustness over speed.
-dnl
-define([AC_CACHE_LOAD], )dnl
-define([AC_CACHE_SAVE], )dnl
-dnl
-dnl
-AC_INIT()
-AC_PREREQ(2.52)
-AC_CONFIG_AUX_DIR([.])
-AC_CONFIG_HEADER(mpe_conf.h)
-#
-echo "Configuring MPE Profiling System with $ac_configure_args"
-dnl
-dnl Set top_srcdir_abs to be the ABSOLUTE path to the home directory of MPE
-dnl top_srcdir is in relative path.
-if test "X$srcdir" != "X." -a -s $srcdir/include/mpe.h ; then
- top_srcdir_abs=$srcdir
-else
- PAC_GETWD( top_srcdir_abs, include/mpe.h )
-fi
-AC_SUBST(top_srcdir_abs)
-
-# Determine this package's name based on its directory name
-changequote(,)dnl
-tmpname="`echo $top_srcdir_abs | sed -e 's%\(.*\)/\([^/]*\)%\2%'`"
-pkgname="`echo $tmpname | sed -e 'y%abcdefghijklmnopqrstuvwxyz/%ABCDEFGHIJKLMNOPQRSTUVWXYZ_%'`"
-changequote([,])dnl
-if test "x$pkgname" = "x" ; then
- pkgname="MPE-2"
-fi
-
-AC_ARG_ENABLE( echo,
-[--enable-echo - Turn on strong echoing.
- The default is enable=no.],
-set -x )
-
-AC_ARG_ENABLE( softerror,
-[--enable-softerror - Turn on soft error, i.e. instead of
- issuing MSG_ERROR, MSG_WARN + exit 0
- are used. The default is enable=no.],
-, enable_softerror=${mpe_enable_softerror:-no} )
-
-dnl Don't preset F77 when MPE is configured with MPICH2
-dnl otherwise AC_PROG_F77 or other PAC F77 tests could be messed up below.
-dnl This is especially true when no fortran compiler in PATH.
-VERSION=""
-if test "$FROM_MPICH2" != "yes" ; then
- CC=${CC:-cc}
- F77=${F77:-f77}
- CFLAGS=${CFLAGS}
- FFLAGS=${FFLAGS}
-fi
-MPE_LIBNAME=""
-
-dnl Read FROM_MPICHx variables from the environment
-MAKE=${MAKE:-make}
-FROM_MPICH=${FROM_MPICH:-no}
-FROM_MPICH2=${FROM_MPICH2:-no}
-FROM_LAM=${FROM_LAM:-no}
-
-
-dnl Fixup for make
-PAC_MAKE_IS_GNUMAKE
-PAC_MAKE_IS_BSD44
-PAC_MAKE_IS_OSF
-PAC_MAKE_VPATH
-AC_SUBST(MAKE)
-
-dnl If we are relying on vpath and no vpath is set, then we must exit
-if test ! -s include/mpe.h -a -z "$VPATH" ; then
- AC_MSG_ERROR( [No virtual MAKE path command found.
- You may need to set your make command
- The GNU make (sometimes available as gnumake) can be used.] )
-fi
-
-dnl CPRP is the version of cp that accepts -r and -p arguments.
-MKDIR=mkdir
-CPRP=cp
-RM=rm
-MV=mv
-AC_SUBST(MKDIR)
-AC_SUBST(CPRP)
-AC_SUBST(RM)
-AC_SUBST(MV)
-
-AC_ARG_ENABLE( strict,
-[--enable-strict - Turn on strict compilation testing
- when using gcc],,enable_strict=no )
-dnl
-AC_ARG_ENABLE( g,
-[--enable-g - Turn on/off the compilation flag -g.
- The default is enable=no.],
-[if test "$enable_g" != "no" ; then enable_g=yes ; fi],
-[enable_g=no] )
-
-dnl MPE_BUILD_FORTRAN2C=yes means that ALL subpackages will be building
-dnl the fortran2c wrapper libraries. This does not necessarily mean that
-dnl specific subpackage has to build fortran2c wrapper library. One example:
-dnl src/wrappers may have --with-f2cmpilibs set by user, so src/wrappers's
-dnl own libmpe_f2cmpi.a will not be built but MPE_BUILD_FORTRAN2C could
-dnl still be set to yes because it means other subpackages like src/graphics
-dnl and src/logging will build their fortran2c wrapper objects. So treat
-dnl MPE_BUILD_FORTRAN2C as a directive, i.e. generally a necessary but
-dnl insufficient condition to build fortran2c wrapper library.
-AC_ARG_ENABLE( f77,
-[--enable-f77 - Compile routines that require a Fortran
- compiler. If configuring with MPICH, the
- configure in the top-level MPICH directory
- will choose the appropriate value for you.
- The default is enable=yes.], ,
-enable_f77=yes )
-if test "$enable_f77" = "yes" ; then
- MPE_BUILD_FORTRAN2C=yes
-else
- MPE_BUILD_FORTRAN2C=no
-fi
-
-AC_ARG_ENABLE( mpich,
-[--enable-mpich - Indicates if this MPE will be built as
- part of the MPICH build. The default is
- enable=no.], ,
-enable_mpich=no )
-
-dnl Translating FROM_MPICHx into MPI_IMPL. So don't pass FROM_MPICHx down
-dnl to subpackages. All subpackages will use MPI_IMPL instead.
-dnl BUILDING_MPI=yes disables the linkage test during building, i.e. make
-dnl BUILDING_MPI=yes when MPI_IMPL=MPICH or MPI_IMPL=MPICH2
-dnl MPE_KNOWN_MPI_IMPL can be tested by testing MPI_IMPL = MPICH, MPICH2
-if test "$enable_mpich" = "yes" -o "$FROM_MPICH" = "yes" ; then
- AC_MSG_RESULT([This MPE build is part of the MPICH build])
- MPI_IMPL="MPICH"
- enable_softerror=yes
- enable_checkMPI=no
-dnl BUILDING_MPI=yes & MPE_KNOWN_MPI_IMPL=yes
-elif test "$FROM_MPICH2" = "yes" ; then
- AC_MSG_RESULT([This MPE build is part of the MPICH2 build])
- MPI_IMPL="MPICH2"
- if test -d "$includebuild_dir" ; then
- MPICPPFLAGS="$MPICPPFLAGS -I$includebuild_dir"
- else
- MPICPPFLAGS="$MPICPPFLAGS -I$master_top_srcdir/src/include -I$master_top_builddir/src/include"
- fi
- enable_softerror=yes
- enable_checkMPI=no
-dnl BUILDING_MPI=yes & MPE_KNOWN_MPI_IMPL=yes
-dnl elif test "$FROM_LAM" = yes ; then
-dnl AC_MSG_RESULT([This MPE build is part of the LAM build])
-dnl MPI_IMPL="LAM"
-dnl BUILDING_MPI=yes & MPE_KNOWN_MPI_IMPL=yes
-else
- AC_MSG_RESULT([User supplied MPI implmentation (Good Luck!)])
- MPI_IMPL="UserSupplied"
- enable_checkMPI=yes
-dnl BUILDING_MPI=no & MPE_KNOWN_MPI_IMPL=no
-fi
-
-AC_ARG_ENABLE( checkMPI,
-[--enable-checkMPI - Turn on/off the linking test for the MPI
- include files, MPI libraries and MPI_CC
- compiler. The default is enable=yes.],
-enable_checkMPI=${mpe_enable_checkMPI:-$enableval} )
-
-AC_ARG_ENABLE( checkMPIwtime,
-[--enable-checkMPIwtime - Turn on/off the linking test for the
- MPI_Wtime(). The default is enable=no.], ,
-enable_checkMPIwtime=no )
-
-dnl
-dnl Set the MPE Libraries name
-dnl
-AC_ARG_WITH( mpelibname,
-[--with-mpelibname=MPE_LIBNAME - Set the MPE library name instead of the
- default 'mpe', e.g. if MPE_LIBNAME=mpe_new,
- then the libraries generated will be
- libmpe_new.a, liblmpe_new.a, libtmpe_new.a
- and libampe_new.a.],
-MPE_LIBNAME="$withval" )
-
-dnl
-dnl Set the Fortran Include Library Leading Characters
-dnl
-AC_ARG_WITH( finc_path_leader,
-[--with-finc_path_leader=FINC_PATH_LEADER - Specify a Fortran include path
- leader for compilation,
- default value is -I.],
-FINC_PATH_LEADER="$withval" )
-dnl
-AC_ARG_WITH( flib_path_leader,
-[--with-flib_path_leader=FLIB_PATH_LEADER - Specify a Fortran library path
- leader for linking, default value is -L.],
-FLIB_PATH_LEADER="$withval" )
-dnl
-
-dnl
-dnl Check if -g is needed to appended to CFLAGS and FFLAGS
-dnl
-dnl Append "-g" to xFLAGS and MPI_xFLAGS if enable_g=yes
-if test "$enable_g" = "yes" ; then
- for flagname in CFLAGS FFLAGS MPI_CFLAGS MPI_FFLAGS ; do
- eval flagvalue=\$"$flagname"
- case " $flagvalue " in
- *" -g "*)
- ;; # Avoid duplication, do nothing
- *)
- # Split eval command into 2 lines so
- # vi's hightlight mode won't get confused.
- flagcmd="$flagname=\"$flagvalue -g\""
- eval ${flagcmd}
- ;;
- esac
- done
-fi
-
-# Set the various build directories and export them as environmental variables.
-#
-# [mpe_]includebuild_dir is for all user header files
-# [mpe_]libbuild_dir is for building the libraries in before they are installed.
-# [mpe_]binbuild_dir is for the scripts/programs
-# [mpe_]sbinbuild_dir is for all system admin tools
-# [mpe_]etcbuild_dir is for all system admin configuration settings
-#
-rootbuild_dir=`pwd`
-for dir in include lib bin sbin etc ; do
- dirname=${dir}build_dir
- eval dirvalue=\$"$dirname"
- eval $dirname=$rootbuild_dir/$dir
- mpe_dirname=mpe_$dirname
- eval $mpe_dirname=\$"$dirname"
- export $mpe_dirname
-done
-
-srcbuild_dir=$rootbuild_dir/src
-for dir in include lib bin sbin src etc ; do
- dirname=${dir}build_dir
- eval dirvalue=\$"$dirname"
- if test -n "$dirvalue" ; then
- if test ! -d $dirvalue ; then
- if mkdir -p $dirvalue ; then
- :
- else
- PAC_MSG_ERROR( $enable_softerror,
- [Could not create directory $dirvalue] )
- fi
- fi
- fi
-done
-
-AC_SUBST(includebuild_dir)
-AC_SUBST(libbuild_dir)
-AC_SUBST(binbuild_dir)
-AC_SUBST(sbinbuild_dir)
-AC_SUBST(etcbuild_dir)
-
-
-dnl
-dnl Unknown MPI implmentation, i.e. User defined MPI_LIBS and MPI_INC
-dnl
-AC_ARG_WITH( mpicc,
-[--with-mpicc=MPI_CC - C compiler for MPI program,
- e.g. mpixlc_r for BG/P MPI, or
- mpicc from MPICHx, Open-MPI, or LAM-MPI.
- Setting --with-mpicc to MPI wrapper
- means no need to set --with-mpiinc
- and --with-mpilibs.],
-MPI_CC="$withval" )
-
-AC_ARG_WITH( mpif77,
-[--with-mpif77=MPI_F77 - Fortran compiler for MPI program,
- e.g. mpixlf77_r for BG/P MPI, or
- mpif77 from MPICHx, Open-MPI, or LAM-MPI.
- Setting --with-mpif77 to MPI wrapper
- means no need to set --with-mpiinc
- and --with-mpilibs.],
-MPI_F77="$withval" )
-
-AC_ARG_WITH( mpiinc,
-[--with-mpiinc=MPI_INC - MPI include path prefixed with -I.
- It specifies MPI header files location,
- where mpi.h and mpif.h are located,
- e.g. -I/pkgs/MPI/include. This flag will
- be added to MPI_CFLAGS and MPI_FFLAGS,
- i.e. the MPI include path can be
- explicitly set in MPI_CFLAGS and
- MPI_FFLAGS without setting --with-mpiinc.],
-MPI_INC="$withval" )
-
-AC_ARG_WITH( mpilibs,
-[--with-mpilibs=MPI_LIBS - MPI library flags with -L and -l.
- It specifies the location of the MPI
- libraries. The flags contains library
- path prefixed with -L and MPI libraries
- name prefixed with -l,
- e.g. -L/opt/MPI/lib -lpmpich -lmpich.],
-MPI_LIBS="$withval" )
-
-dnl
-misc_dirname="src/misc"
-callstack_dirname="src/callstack"
-logging_dirname="src/logging"
-wrappers_dirname="src/wrappers"
-graphics_dirname="src/graphics"
-collchk_dirname="src/collchk"
-slog2_dirname="src/slog2sdk"
-
-dnl Cleanup the subpackages' Makefiles if they exist
-AC_MSG_CHECKING( [for leftover Makefiles in subpackages] )
-leftover_pkgs=""
-for pkg in misc callstack logging wrappers graphics collchk slog2 ; do
- dirname=${pkg}_dirname
- eval dirvalue=\$"$dirname"
- if test -s $rootbuild_dir/$dirvalue/Makefile ; then
- leftover_pkgs="$leftover_pkgs \"$dirvalue\""
- ( cd $rootbuild_dir/$dirvalue && $MAKE distclean > /dev/null 2>&1 )
- dnl Just in case "make distclean" does not remove Makefile.
- if test -f $rootbuild_dir/$dirvalue/Makefile ; then
- $RM -f $rootbuild_dir/$dirvalue/Makefile
- fi
- fi
-done
-if test "X$leftover_pkgs" = "X" ; then
- AC_MSG_RESULT( [none] )
-else
- AC_MSG_RESULT( [$leftover_pkgs cleaned] )
-fi
-
-dnl trial_pkgs="misc callstack logging wrappers graphics collchk"
-
-dnl
-AC_ARG_ENABLE( misc,
-[--enable-misc - Build MPE miscellaneous routines, e.g.
- MPE_Errors_xxx(), MPE_Seq_xxx(),
- MPE_xxxTags() and MPE_GetHostName()....
- The default enable=yes.],
-, enable_misc=yes )
-
-dnl
-AC_ARG_ENABLE( callstack,
-[--enable-callstack - Build MPE callstack routines, i.e.
- MPE_CallStack_xxx()...
- The default enable=yes.],
-, enable_callstack=yes )
-
-dnl
-AC_ARG_ENABLE( logging,
-[--enable-logging - Build MPE logging routines for
- CLOG-2, e.g. MPE_Log_xxx()...
- The default enable=yes.],
-, enable_logging=yes )
-
-dnl
-AC_ARG_ENABLE( wrappers,
-[--enable-wrappers - Build various MPI wrapper libraries.
- MPI logging library, liblmpe.a;
- MPI tracing library, libtmpe.a;
- MPI Fortran to C library, libmpe_f2cmpi.a],
-, enable_wrappers=yes )
-dnl src/wrappers requires at least src/logging
-if test "$enable_wrappers" = "yes" ; then
- if test "$enable_logging" != "yes" ; then
- enable_logging=yes
- AC_MSG_WARN( [Enabling Logging which is required by Wrappers.] );
- fi
-fi
-
-dnl Determine if the X graphics is going to be configured
-AC_ARG_ENABLE( graphics,
-[--enable-graphics - Build MPE graphics routines and MPI
- animation library, libampe.a. If disabled
- then the MPE routines that make use of X11
- graphics will NOT be built. This is
- appropriate for systems that either do not
- have the X11 include files or that do not
- support X11 graphics.
- The default enable=yes.],
-, enable_graphics=yes )
-dnl src/graphics's libmpe_nompi.a requires mpehname.c defined in src/misc
-dnl but then libmpe_nompi.a is rarely used, tests in src/grahics will pass
-dnl without src/misc. Let user decides.
-if test "$enable_graphics" = "yes" -a "$enable_misc" != "yes" ; then
- AC_MSG_WARN( [libmpe_nompi.a in src/graphics needs mpehname.c in src/misc!
- If you need libmpe_nompi.a, reconfigure with --enable-misc.] )
-fi
-
-AC_ARG_ENABLE( collchk,
-[--enable-collchk - Build MPI Collective and Datatype
- checking library, libmpe_collchk.a],
-, enable_collchk=yes )
-dnl src/collchk requires at least src/callstack
-if test "$enable_collchk" = "yes" ; then
- if test "$enable_callstack" != "yes" ; then
- enable_callstack=yes
- AC_MSG_WARN( [Enabling CallStack which is required by CollChk.] );
- fi
-fi
-
-selected_pkgs=""
-
-if test "$enable_misc" = "yes" -a -s $srcdir/src/misc/configure ; then
- selected_pkgs="$selected_pkgs misc"
- AC_CONFIG_SUBDIRS(src/misc)
-fi
-if test "$enable_callstack" = "yes" -a -s $srcdir/src/callstack/configure ; then
- selected_pkgs="$selected_pkgs callstack"
- AC_CONFIG_SUBDIRS(src/callstack)
-fi
-if test "$enable_logging" = "yes" -a -s $srcdir/src/logging/configure ; then
- selected_pkgs="$selected_pkgs logging"
- AC_CONFIG_SUBDIRS(src/logging)
-fi
-if test "$enable_wrappers" = "yes" -a -s $srcdir/src/wrappers/configure ; then
- selected_pkgs="$selected_pkgs wrappers"
- AC_CONFIG_SUBDIRS(src/wrappers)
-fi
-if test "$enable_graphics" = "yes" -a -s $srcdir/src/graphics/configure ; then
- selected_pkgs="$selected_pkgs graphics"
- AC_CONFIG_SUBDIRS(src/graphics)
-fi
-if test "$enable_collchk" = "yes" -a -s $srcdir/src/collchk/configure ; then
- selected_pkgs="$selected_pkgs collchk"
- AC_CONFIG_SUBDIRS(src/collchk)
-fi
-
-dnl Determine if the slog2sdk directory is going to be configured.
-AC_ARG_ENABLE( slog2,
-[--enable-slog2{=build} - Configure all the SLOG-2 tools.
- --enable-slog2 without any argument will
- use the prebuilt jar files.
- --enable-slog2=build will rebuild all the
- jar files from the source code.
- The default is enable=yes.], ,
-enable_slog2=yes )
-
-
-dnl if SLOG-2 is here, configure it
-if test -s $srcdir/$slog2_dirname/configure ; then
- if test "$enable_slog2" = "yes" -o "$enable_slog2" = "build" ; then
- if test "$enable_slog2" = "build" ; then
- slog2_enable_source=yes
- else
- slog2_enable_source=no
- fi
- export slog2_enable_source
- dnl Enable softerror in SLOG2 configure won't abort the entire process
- slog2_enable_softerror=yes
- export slog2_enable_softerror
- selected_pkgs="$selected_pkgs slog2"
- if test "$MPI_IMPL" = "MPICH" -o "$MPI_IMPL" = "MPICH2" ; then
- dnl Disable the SAMPLE code in slog2sdk for MPICH2
- slog2_enable_sample=no
- export slog2_enable_sample
- fi
- AC_CONFIG_SUBDIRS(src/slog2sdk)
- fi
-fi
-
-dnl The following statement is no longer true as of 6/24/2007,
-dnl a thread-specific MPE logging on/off switch has been added
-dnl to mpe_log_thread[.h/.c] and MPI logging wrappper library
-dnl has been updated accordingly.
-dnl
-dnl AC_ARG_ENABLE( threadlogging,
-dnl [--enable-threadlogging - Turn on/off the coarse-grained thread
-dnl support in MPE logging. The default
-dnl is enable=no.], ,
-dnl enable_threadlogging=no )
-dnl
-dnl When thread-logging is enabled in multi-thread environment,
-dnl safePMPI guard can't be used, i.e. global variables is_mpelog_on
-dnl can't be used in coarse-grained thread support,
-dnl becasue these varaibles need to be thread-specific. Otherwise
-dnl turn off logging on 1 thread would mean turning it off for all
-dnl threads.
-dnl
-dnl if test "$enable_threadlogging" = "yes" ; then
-dnl enable_safePMPI=no
-dnl export enable_safePMPI
-dnl fi
-
-
-AC_ARG_VAR( MPI_CC, [C compiler for MPI program, e.g. mpixlc_r for BG/P MPI, or mpicc from MPICHx, Open-MPI, or LAM-MPI. Setting MPI_CC to MPI wrapper means no need to set MPI_INC and MPI_LIBS.] )
-AC_ARG_VAR( MPI_F77, [Fortran compiler for MPI program, e.g. mpixlf77_r for BG/P MPI, or mpif77 from MPICHx, Open-MPI, or LAM-MPI. Setting MPI_F77 to MPI wrapper means no need to set MPI_INC and MPI_LIBS.] )
-AC_ARG_VAR( MPI_INC, [MPI include path prefixed with -I. It specifies MPI header files location, where mpi.h and mpif.h are located, e.g. -I/pkgs/MPI/include. This flag will be added to MPI_CFLAGS and MPI_FFLAGS, i.e. the MPI include path can be explicitly set in MPI_CFLAGS and MPI_FFLAGS without setting MPI_INC.] )
-AC_ARG_VAR( MPI_CFLAGS, [MPI C compiler flags to compile MPI program.] )
-AC_ARG_VAR( MPI_FFLAGS, [MPI Fortran compiler flags to compile MPI Fortran program.] )
-AC_ARG_VAR( MPI_LIBS, [MPI library flags with -L and -l. It specifies the location of the MPI libraries. The flags contains library path prefixed with -L and MPI libraries name prefixed with -l, e.g. -L/opt/MPI/lib -lpmpich -lmpich.] )
-dnl AC_ARG_VAR( MPI_LDFLAGS, [MPI linker flags used with MPI_CC or MPI_F77 during linking.] )
-AC_ARG_VAR( MPERUN, [MPI application launch command. This variable is necessary only if user wants to run "make check", "make installcheck-all" or "$sbindir/mpecheckinstall -run" when the default MPERUN value, "$bindir/mpiexec -n 4", is not correct.] )
-
-# Prepend/Append '"' before/after MPERUN.
-if test "x$MPERUN" != "x" ; then
- MPERUN="\"$MPERUN\""
-fi
-
-# Preppend MPI_INC to MPI_CFLAGS/MPI_FFLAGS
-if test "x$MPI_INC" != "x" ; then
- MPI_CFLAGS="$MPI_INC $MPI_CFLAGS"
- MPI_FFLAGS="$MPI_INC $MPI_FFLAGS"
-fi
-
-dnl
-AC_ARG_WITH( cross-spec,
-[--with-cross-spec=file - Specify the values of variables that
- configure cannot determine in a
- cross-compilation environment through
- a file], ,
-with_cross_spec=no )
-dnl
-pac_cross_compiling=no
-if test "$with_cross_spec" != "no" ; then
- if test -s "$with_cross_spec" ; then
- AC_MSG_RESULT([Reading the cross-compilation file $with_cross_spec])
- . $with_cross_spec
- # Autoconf 2.52 no longer sets cross_compiling except with the
- # awkward "targethost" options.
- pac_cross_compiling=yes
- cross_compiling=yes
- ac_cv_prog_cc_cross=yes
- ac_cv_prog_f77_cross=yes
- ac_cv_prog_f90_cross=yes
- ac_cv_prog_cxx_cross=yes
- export cross_compiling
- # Export all the variables in cross_spec/cross_spec.txt
- # i.e. CROSS_xxx, MPI_xxx and friends...
- cross_spec_vars=`grep -v '^#' $with_cross_spec | sed -e 's/=.*//g'`
- for var in $cross_spec_vars ; do
- eval value=\$"$var"
- echo "Exporting $var=$value ..."
- export $var
- done
- fi
-fi
-
-
-dnl
-AC_ARG_WITH( config-args,
-[--with-config-args=filename - Specify configure argument file that
- contains the values of variables that
- configure reads, e.g. CC, CFLAGS,
- F77, FFLAGS, MPI_CC, MPI_F77....
- If the filename does not begin with
- / (absolute path), . or .. (relative path),
- the filename will be assumed to be
- $top_srcdir/configargs/<filename>.cfg.], ,
-with_config_args=no )
-dnl
-if test "$with_config_args" != "no" ; then
- case "$with_config_args" in
- /*|../*|./*)
- config_args_file="$with_config_args"
- ;;
- *)
- config_args_file="$srcdir/configargs/${with_config_args}.cfg"
- ;;
- esac
- if test -s "$config_args_file" ; then
- AC_MSG_RESULT([Reading the configure arguments in ${config_args_file}.])
- . $config_args_file
- # Export all the variables in $config_args_file
- # i.e. CC, F77, CFLAGS, FFLAGS and friends...
- config_args_vars=`grep -v '^#' $config_args_file | sed -e 's/=.*//g'`
- for var in $config_args_vars ; do
- eval value=\$"$var"
- echo "Exporting $var=$value ..."
- export $var
- done
- else
- AC_MSG_WARN([Non-existent ${config_args_file}.])
- fi
-fi
-
-
-AC_PROG_CC
-dnl Check for broken handling of common symbols
-dnl PAC_PROG_C_BROKEN_COMMON
-
-dnl Adding --enable-strict flags to CFLAGS if needed.
-dnl No space should be added after "(" and before ")", otherwise invalid
-dnl statement, like 'CFLAGS ="$CFLAGS ..."', will be resulted in configure.
-dnl Also, PAC_GET_GCC_STRICT_FLAGS should be called after AC_PROG_CC.
-if test "$FROM_MPICH2" != "yes" ; then
- MPE_COPTION=""
- PAC_GET_GCC_STRICT_FLAGS([MPE_COPTION])
- if test "x$MPE_COPTION" != "x" ; then
- CFLAGS="$CFLAGS $MPE_COPTION"
- MPI_CFLAGS="$MPI_CFLAGS $MPE_COPTION"
- fi
-fi
-
-dnl MPI_CC is only use for MPI programs.
-dnl CC should be the same compiler that is used within the MPI_CC
-dnl environment. MPI_LIBS should also be set for linking MPI programs
-AC_MSG_CHECKING( whether MPI_CC has been set )
-if test -z "$MPI_CC" ; then
- MPI_CC="$CC $MPICPPFLAGS"
-fi
-AC_MSG_RESULT( $MPI_CC )
-
-if test "$MPE_BUILD_FORTRAN2C" = "yes" ; then
- AC_PROG_F77
- if test "x$F77" = "x" ; then
- MPE_BUILD_FORTRAN2C=no
- fi
- AC_MSG_CHECKING( whether MPI_F77 has been set )
- if test -z "$MPI_F77" ; then
- # FIXME: Temporary for F77 accepting the same flags as CC for
- # file includes
- MPI_F77="$F77 $MPICPPFLAGS"
- fi
- AC_MSG_RESULT( $MPI_F77 )
-fi
-
-# Determine the name of the various library being built
-if test -z "$MPE_LIBNAME" ; then
- MPE_LIBNAME=mpe
-fi
-
-
-
-dnl
-dnl Check if MPI_CC, MPI_CFLAGS, and MPI_LIBS together provide
-dnl a linkable environment for a simple MPI program
-dnl
-if test "$MPI_IMPL" != "MPICH" -a "$MPI_IMPL" != "MPICH2" ; then
- if test "$enable_checkMPI" = "yes" ; then
- AC_MSG_CHECKING( [for the linkage of the supplied MPI C definitions] )
- PAC_MPI_LINK_CC_FUNC( $MPI_CC, [$MPI_CFLAGS], $MPI_LIBS, , , ,
- [ mpe_link_ok=yes ], [ mpe_link_ok=no ] )
- if test "$mpe_link_ok" = "yes" ; then
- AC_MSG_RESULT(yes)
- else
- AC_MSG_RESULT(no)
- PAC_MSG_ERROR( $enable_softerror,
- [Cannot link with basic MPI C program!
- Check your MPI include paths, MPI libraries and MPI CC compiler] )
- fi
- fi
- if test "$enable_checkMPI" = "yes" -a "$MPE_BUILD_FORTRAN2C" = "yes" ; then
- AC_MSG_CHECKING( [for the linkage of the supplied MPI F77 definitions] )
- PAC_MPI_LINK_F77_FUNC( $MPI_F77, [$MPI_FFLAGS], $MPI_LIBS, [
- integer mytid
- integer ierr
- ], [
- call MPI_Comm_rank( MPI_COMM_WORLD, mytid, ierr )
- ],
- [ mpe_link_ok=yes ], [ mpe_link_ok=no ] )
- if test "$mpe_link_ok" = "yes" ; then
- AC_MSG_RESULT(yes)
- else
- AC_MSG_RESULT(no)
- PAC_MSG_ERROR( $enable_softerror,
- [Cannot link with basic MPI F77 program!
- Check your MPI include paths, MPI libraries and MPI F77 compiler ] )
- fi
- fi
-
- dnl
- dnl Some MPI's seem to have trouble with
- dnl MPI_Wtime, PMPI_Wtime, and MPI_Attr_get
- dnl (Fujitsu for MPI_Wtime and MPI_Attr_get; IBM's PMPI_Wtime returned 0)
- dnl Check at least that we can link with MPI_Wtime and MPI_Attr_get
- dnl
- if test "$enable_checkMPI" = "yes" -a "$enable_checkMPIwtime" = "yes" ; then
- AC_MSG_CHECKING( [for the C version of MPI_Wtime()] )
- PAC_MPI_LINK_CC_FUNC( $MPI_CC, [$MPI_CFLAGS], $MPI_LIBS, ,
- [ double d ],
- [ d=MPI_Wtime() ],
- [ mpe_link_ok=yes ], [ mpe_link_ok=no ] )
- if test "$mpe_link_ok" = "yes" ; then
- AC_MSG_RESULT(yes)
- AC_DEFINE( HAVE_MPI_WTIME,1,[Define if MPI_Wtime available] )
- else
- AC_MSG_RESULT(no)
- PAC_MSG_ERROR( $enable_softerror, [Cannot link with MPI_Wtime()!
- Check your MPI include paths, MPI libraries and MPI CC compiler ] )
- fi
- fi
-fi
-
-if test -z "$CC" -o -z "$MPI_CC"; then
- PAC_MSG_ERROR( $enable_softerror,
- [You must configure MPE with a specific MPI] )
-fi
-
-if test -n "$F77" -a "$MPE_BUILD_FORTRAN2C" = "yes" ; then
- FLIBS_save="$FLIBS"
- FLIBS=""
- AC_F77_LIBRARY_LDFLAGS
- # The autoconf macro for finding FLIBS sometimes makes mistakes
- # (particularly with the Fujitsu frt compiler). This next step
- # first sees if the FLIBS is valid with the Fortran compiler
- PAC_PROG_F77_FLIBS_VALID
- # Now see if FLIBS works with the C compiler
- PAC_PROG_F77_CHECK_FLIBS
-
- PAC_PROG_F77_LINKER_WITH_C
- PAC_PROG_F77_OBJ_LINKS_WITH_C
- # For name mangle, we need the library flags
- PAC_PROG_F77_NAME_MANGLE
- # Check whether additional libraries are needed when linking with C
- PAC_PROG_F77_AND_C_STDIO_LIBS
- AC_SUBST(F77_OTHER_LIBS)
-
- PAC_PROG_F77_LIBRARY_DIR_FLAG
- if test -z "$FLIB_PATH_LEADER" ; then
- FLIB_PATH_LEADER=$F77_LIBDIR_LEADER
- fi
- PAC_PROG_F77_HAS_INCDIR(f77tmpdir)
- FINC_PATH_LEADER=$F77_INCDIR
-
- # Replace all -I in MPI_FFLAGS by $FINC_PATH_LEADER
- MPI_FFLAGS=`echo "$MPI_FFLAGS" | sed -e "s|-I|$FINC_PATH_LEADER|g"`
- # If there is MPI_FLIBS, to replace -L by $FLIB_PATH_LEADER
-fi
-
-dnl We need to check that this has worked. The autoconf macro is broken
-AC_PROG_CPP
-if test "$CPP" = "/lib/cpp" -a ! -x /lib/cpp ; then
- AC_MSG_ERROR( [configure could not find a working C preprocessor] )
-fi
-
-dnl check for "ln -s" exists. It is for install program, mpeinstall
-AC_PROG_LN_S
-
-dnl checking for working INSTALL
-AC_PROG_INSTALL
-PAC_PROG_CHECK_INSTALL_WORKS
-PAC_PROG_INSTALL_BREAKS_LIBS
-
-dnl
-dnl MPE_CFLAGS/MPE_FFLAGS are used to pass MPE-modified CFLAGS/FFLAGS
-dnl to other subpackages. Can't use CFLAGS to pass this info because
-dnl user may have set CFLAGS in the environment. In that scenario,
-dnl env variable CFLAGS can't be set! So subpackages cannot get the
-dnl MPE-modified CFLAGS.
-dnl
-MPE_CFLAGS="$CFLAGS"
-if test "$MPE_BUILD_FORTRAN2C" = "yes" ; then
- MPE_FFLAGS="$FFLAGS"
-fi
-
-dnl Determine if this is "UserSupplied" MPI implmentation.
-dnl If so, build mpecc and mpefc.
-dnl MPE_CLINKER/MPE_FLINKER need to sync with sbin/mpeinstall
-if test "$MPI_IMPL" != "MPICH" -a "$MPI_IMPL" != "MPICH2" ; then
- mpe_compilers=bin/mpecc
- if test "$MPE_BUILD_FORTRAN2C" = "yes" ; then
- mpe_compilers="$mpe_compilers bin/mpefc"
- fi
- MPE_CLINKER="$binbuild_dir/mpecc -"
- MPE_FLINKER="$binbuild_dir/mpefc -"
-else dnl This is MPICH2.
- MPE_CLINKER="$MPI_CC -mpe="
- MPE_FLINKER="$MPI_F77 -mpe="
-fi
-
-dnl The following does not work as expected because
-dnl AC_CONFIG_SUBDIRS sets the "precious" variables like CFLAGS from the
-dnl settings recorded at the top of the configure. That means CFLAGS cannot
-dnl be inherit from the mpich2's configure enviroment.
-dnl
-dnl Include --enable-strict option only if this isn't part of MPICHx build.
-dnl MPE does not even need to check enable_strict_done passed down by MPICH2.
-dnl if test "$MPI_IMPL" != "MPICH" -a "$MPI_IMPL" != "MPICH2" ; then
-dnl MPE_CFLAGS="$MPE_CFLAGS $STRICT_COPTS"
-dnl fi
-dnl
-if test -z "$CLINKER" ; then CLINKER="$CC" ; fi
-if test -z "$FLINKER" ; then FLINKER="$F77" ; fi
-AC_SUBST(MPI_IMPL)
-AC_SUBST(MPE_LIBNAME)
-AC_SUBST(MPE_BUILD_FORTRAN2C)
-dnl "precious" AC_SUBST(CC)
-AC_SUBST(CLINKER)
-AC_SUBST(MPE_CFLAGS)
-dnl "precious" AC_SUBST(MPI_CC)
-dnl "precious" AC_SUBST(MPI_CFLAGS)
-AC_SUBST(MPE_CLINKER)
-AC_SUBST(F77)
-AC_SUBST(FLINKER)
-AC_SUBST(MPE_FFLAGS)
-dnl "precious" AC_SUBST(MPI_F77)
-dnl "precious" AC_SUBST(MPI_FFLAGS)
-AC_SUBST(MPE_FLINKER)
-dnl "precious" AC_SUBST(MPI_LIBS)
-dnl "precious" AC_SUBST(LDFLAGS)
-dnl "precious" AC_SUBST(MPERUN)
-
-dnl Make the directories that do not contain Makefiles (should they?) but
-dnl are needed for the subsequent directories.
-$RM -f $srcdir/mpe_conf.h
-
-export MPI_IMPL
-export MPE_LIBNAME
-export MPE_BUILD_FORTRAN2C
-export CC
-export CLINKER
-export MPI_CC
-export MPI_CFLAGS
-export MPE_CLINKER
-export MPE_CFLAGS
-export F77
-export FLINKER
-export MPI_F77
-export MPI_FFLAGS
-export MPE_FLINKER
-export MPE_FFLAGS
-export MPI_LIBS
-export LDFLAGS
-export FINC_PATH_LEADER
-export FLIB_PATH_LEADER
-
-mpe_enable_softerror=yes
-export mpe_enable_softerror
-
-
-
-
-AC_OUTPUT_COMMANDS( [
-if test ! -x ./sbin/mpeinstall -a -s ./sbin/mpeinstall ; then
- chmod u+x ./sbin/mpeinstall
-fi
-if test ! -x ./sbin/mpecheckinstall -a -s ./sbin/mpecheckinstall ; then
- chmod u+x ./sbin/mpecheckinstall
-fi
-if test ! -x ./sbin/mpecheckbuild -a -s ./sbin/mpecheckbuild ; then
- chmod u+x ./sbin/mpecheckbuild
-fi
-if test ! -x ./sbin/mpetestlink -a -s ./sbin/mpetestlink ; then
- chmod u+x ./sbin/mpetestlink
-fi
-if test ! -x ./sbin/mpetestexec -a -s ./sbin/mpetestexec ; then
- chmod u+x ./sbin/mpetestexec
-fi
-if test ! -x ./sbin/mpetestexeclog -a -s ./sbin/mpetestexeclog ; then
- chmod u+x ./sbin/mpetestexeclog
-fi
-if test ! -x ./bin/mpecc -a -s ./bin/mpecc ; then
- chmod a+x ./bin/mpecc
-fi
-if test ! -x ./bin/mpefc -a -s ./bin/mpefc ; then
- chmod a+x ./bin/mpefc
-fi
-] )
-AC_OUTPUT( Makefile sbin/mpetestlink sbin/mpetestexec sbin/mpetestexeclog \
- sbin/mpeinstall sbin/mpecheckinstall sbin/mpecheckbuild \
- etc/mpe_help.conf etc/mpe_f77env.conf $mpe_compilers )
-
-configured_pkgs=""
-for pkg in $selected_pkgs ; do
- dirname=${pkg}_dirname
- eval dirvalue=\$"$dirname"
- if test -s $dirvalue/Makefile ; then
- configured_pkgs="$configured_pkgs \"$dirvalue\""
- fi
-done
-
-if test -z "$configured_pkgs" ; then
- AC_MSG_WARN([$pkgname: No sub-package has been configured])
-else
- AC_MSG_RESULT([$pkgname: $configured_pkgs have been configured])
-fi
Copied: mpich2/trunk/src/mpe2/cross_spec/configure.ac (from rev 9546, mpich2/trunk/src/mpe2/cross_spec/configure.in)
===================================================================
--- mpich2/trunk/src/mpe2/cross_spec/configure.ac (rev 0)
+++ mpich2/trunk/src/mpe2/cross_spec/configure.ac 2012-02-28 23:26:34 UTC (rev 9548)
@@ -0,0 +1,281 @@
+dnl
+dnl Caching is usually WRONG for systems with cross-mounted file systems
+dnl (the cache file may correspond to a different system). Since configure
+dnl is not on a performance-critical path, go for robustness over speed.
+dnl
+define([AC_CACHE_LOAD], )dnl
+define([AC_CACHE_SAVE], )dnl
+dnl
+dnl
+AC_INIT()
+AC_PREREQ(2.52)
+AC_CONFIG_AUX_DIR([..])
+AC_CONFIG_HEADER(cross_conf.h)
+#
+echo "Configuring MPE Cross-Compilation Spec with $ac_configure_args"
+dnl
+dnl Set top_srcdir_abs to be the ABSOLUTE path to the home directory of MPE
+dnl top_srcdir is in relative path.
+if test "X$srcdir" != "X." -a -s $srcdir/cross_cc.c ; then
+ top_srcdir_abs=$srcdir
+else
+ PAC_GETWD( top_srcdir_abs, cross_cc.c )
+fi
+AC_SUBST(top_srcdir_abs)
+
+# Determine this package's name based on its directory name
+changequote(,)dnl
+tmpname="`echo $top_srcdir_abs | sed -e 's%\(.*\)/\([^/]*\)%\2%'`"
+pkgname="`echo $tmpname | sed -e 'y%abcdefghijklmnopqrstuvwxyz/%ABCDEFGHIJKLMNOPQRSTUVWXYZ_%'`"
+changequote([,])dnl
+if test "x$pkgname" = "x" ; then
+ pkgname="MPE-2 Cross-Compilation Spec"
+fi
+
+AC_ARG_ENABLE( echo,
+[--enable-echo - Turn on strong echoing.
+ The default is enable=no.],
+set -x )
+
+VERSION=""
+CC=${CC:-cc}
+F77=${F77:-f77}
+CFLAGS=${CFLAGS}
+FFLAGS=${FFLAGS}
+MAKE=${MAKE:-make}
+
+dnl Fixup for make
+PAC_MAKE_IS_GNUMAKE
+PAC_MAKE_IS_BSD44
+PAC_MAKE_IS_OSF
+PAC_MAKE_VPATH
+AC_SUBST(MAKE)
+
+dnl If we are relying on vpath and no vpath is set, then we must exit
+if test ! -s cross_cc.c -a -z "$VPATH" ; then
+ AC_MSG_ERROR( [No virtual MAKE path command found.
+ You may need to set your make command
+ The GNU make (sometimes available as gnumake) can be used.] )
+fi
+
+RM=rm
+MV=mv
+CPRP=cp
+AC_SUBST(RM)
+AC_SUBST(MV)
+AC_SUBST(CPRP)
+
+AC_ARG_WITH( spec,
+[--with-spec=filename - Specify the default filename to
+ store the cross-compilation
+ variables and property values to
+ be used in MPE2's --with-cross-spec
+ option. The default filename is
+ cross_spec.txt],
+[CROSS_SPEC_FILE=$withval], [CROSS_SPEC_FILE="cross_spec.txt"] )
+dnl Export CROSS_SPEC_FILE so cross_env.in and *.c can use it.
+AC_SUBST(CROSS_SPEC_FILE)
+AC_DEFINE_UNQUOTED( CROSS_SPEC_FILE, "$CROSS_SPEC_FILE",
+ [Define Cross-Spec's output filename] )
+
+dnl MPE_BUILD_FORTRAN2C=yes means that ALL subpackages will be building
+dnl the fortran2c wrapper libraries. This does not necessarily mean that
+dnl specific subpackage has to build fortran2c wrapper library. One example:
+dnl src/wrappers may have --with-f2cmpilibs set by user, so src/wrappers's
+dnl own libmpe_f2cmpi.a will not be built but MPE_BUILD_FORTRAN2C could
+dnl still be set to yes because it means other subpackages like src/graphics
+dnl and src/logging will build their fortran2c wrapper objects. So treat
+dnl MPE_BUILD_FORTRAN2C as a directive, i.e. generally a necessary but
+dnl insufficient condition to build fortran2c wrapper library.
+AC_ARG_ENABLE( f77,
+[--enable-f77 - Compile routines that require a Fortran
+ compiler. If configuring with MPICH, the
+ configure in the top-level MPICH directory
+ will choose the appropriate value for you.
+ The default is enable=yes.], ,
+enable_f77=yes )
+if test "$enable_f77" = "yes" ; then
+ MPE_BUILD_FORTRAN2C=yes
+else
+ MPE_BUILD_FORTRAN2C=no
+fi
+
+dnl
+dnl Unknown MPI implmentation, i.e. User defined MPI_LIBS and MPI_INC
+dnl
+AC_ARG_WITH( mpicc,
+[--with-mpicc=MPI_CC - C compiler used to compile MPI program
+ and to create parallel executable,
+ e.g. mpcc for IBM MPI, or mpicc from
+ MPICHx or LAM-MPI.],
+MPI_CC="$withval" )
+
+AC_ARG_WITH( mpif77,
+[--with-mpif77=MPI_F77 - F77 compiler used to compile MPI program
+ and to create parallel executable,
+ e.g. mpxlf for IBM MPI, or mpif77 from
+ MPICHx or LAM-MPI.],
+MPI_F77="$withval" )
+
+AC_ARG_WITH( mpiinc,
+[--with-mpiinc=MPI_INC - MPI compiler's include flags prefixed
+ with -I. It specifies where mpi.h and
+ mpif.h are located,
+ e.g. -I/pkgs/MPI/include.],
+MPI_INC="$withval" )
+
+AC_ARG_WITH( mpilibs,
+[--with-mpilibs=MPI_LIBS - MPI compiler's library flags prefixed
+ with -L for the library path and prefixed
+ with -l for the name of the MPI libraries.
+ It specifies the location of the MPI
+ libraries.
+ e.g. -L/pkgs/MPI/lib -lpmpich -lmpich.],
+MPI_LIBS="$withval" )
+
+AC_ARG_VAR( MPI_LIBS, [MPI compiler's library flags prefixed with -L for the library path and prefixed with -l for the name of the MPI libraries. It specifies the location of the MPI libraries. e.g. -L/pkgs/MPI/lib -lpmpich -lmpich.] )
+
+AC_ARG_VAR( MPI_CC, [C compiler to compile MPI program and to create parallel executable, e.g. mpcc for IBM MPI, or mpicc from MPICHx, Open-MPI, or LAM-MPI.] )
+AC_ARG_VAR( MPI_F77, [Fortran compiler to compile MPI program and to create parallel executable, e.g. mpxlf for IBM MPI, or mpif77 from MPICHx, Open-MPI, or LAM-MPI.] )
+AC_ARG_VAR( MPI_INC, [MPI compiler's include path prefixed with -I. It specifies where mpi.h and mpif.h are located, e.g. -I/pkgs/MPI/include. This flag will be added to MPI_CFLAGS and MPI_FFLAGS, i.e. the MPI include path can be explicitly set in MPI_CFLAGS and MPI_FFLAGS without setting MPI_INC.] )
+AC_ARG_VAR( MPI_CFLAGS, [MPI C compiler flags to compile MPI program.] )
+AC_ARG_VAR( MPI_FFLAGS, [MPI Fortran compiler flags to compile MPI Fortran program.] )
+AC_ARG_VAR( MPI_LIBS, [MPI compiler library flags which specifies the location of the MPI libraries. The flags contains library path prefixed with -L and MPI library name prefixed with -l, e.g. -L/opt/MPI/lib -lpmpich -lmpich.] )
+dnl AC_ARG_VAR( MPI_LDFLAGS, [MPI linker flags used with MPI_CC or MPI_F77 during linking.] )
+
+AC_ARG_VAR( MPERUN, [MPI application launch command for the test programs created by this package. This variable is necessary only if user needs a special command to launch MPI testing application to run in the backend compute nodes.] )
+
+# Preppend MPI_INC to MPI_CFLAGS/MPI_FFLAGS
+if test "x$MPI_INC" != "x" ; then
+ MPI_CFLAGS="$MPI_INC $MPI_CFLAGS"
+ MPI_FFLAGS="$MPI_INC $MPI_FFLAGS"
+fi
+
+AC_PROG_CC
+AC_OBJEXT
+AC_EXEEXT
+AC_HEADER_STDC
+AC_CHECK_HEADERS(stdio.h)
+
+AC_MSG_CHECKING( whether MPI_CC has been set )
+if test -z "$MPI_CC" ; then
+ MPI_CC="$CC $MPICPPFLAGS"
+fi
+AC_MSG_RESULT( $MPI_CC )
+
+if test "$MPE_BUILD_FORTRAN2C" = "yes" ; then
+ AC_PROG_F77
+ if test "x$F77" = "x" ; then
+ MPE_BUILD_FORTRAN2C=no
+ fi
+ AC_MSG_CHECKING( whether MPI_F77 has been set )
+ if test -z "$MPI_F77" ; then
+ # FIXME: Temporary for F77 accepting the same flags as CC for
+ # file includes
+ MPI_F77="$F77 $MPICPPFLAGS"
+ fi
+ AC_MSG_RESULT( $MPI_F77 )
+fi
+
+AC_MSG_CHECKING( [for the linkage of the supplied MPI C definitions] )
+PAC_MPI_LINK_CC_FUNC( $MPI_CC, [$MPI_CFLAGS], $MPI_LIBS, , , ,
+ [ mpe_link_ok=yes ], [ mpe_link_ok=no ] )
+if test "$mpe_link_ok" = "yes" ; then
+ AC_MSG_RESULT(yes)
+else
+ AC_MSG_RESULT(no)
+ PAC_MSG_ERROR( $enable_softerror,
+ [Cannot link with basic MPI C program!
+ Check your MPI include paths, MPI libraries and MPI CC compiler] )
+fi
+
+if test "$MPE_BUILD_FORTRAN2C" = "yes" ; then
+ AC_MSG_CHECKING( [for the linkage of the supplied MPI F77 definitions] )
+ PAC_MPI_LINK_F77_FUNC( $MPI_F77, [$MPI_FFLAGS], $MPI_LIBS, [
+ integer mytid
+ integer ierr
+ ], [
+ call MPI_Comm_rank( MPI_COMM_WORLD, mytid, ierr )
+ ], [ mpe_link_ok=yes ], [ mpe_link_ok=no ] )
+ if test "$mpe_link_ok" = "yes" ; then
+ AC_MSG_RESULT(yes)
+ else
+ AC_MSG_RESULT(no)
+ PAC_MSG_ERROR( $enable_softerror,
+ [Cannot link with basic MPI F77 program!
+ Check your MPI include paths, MPI libraries and MPI F77 compiler ] )
+ fi
+fi
+
+if test -z "$CC" -o -z "$MPI_CC"; then
+ PAC_MSG_ERROR( $enable_softerror,
+ [You must configure MPE with a specific MPI] )
+fi
+
+if test -n "$F77" -a "$MPE_BUILD_FORTRAN2C" = "yes" ; then
+ FLIBS_save="$FLIBS"
+ FLIBS=""
+ AC_F77_LIBRARY_LDFLAGS
+ # The autoconf macro for finding FLIBS sometimes makes mistakes
+ # (particularly with the Fujitsu frt compiler). This next step
+ # first sees if the FLIBS is valid with the Fortran compiler
+ PAC_PROG_F77_FLIBS_VALID
+ # Now see if FLIBS works with the C compiler
+ PAC_PROG_F77_CHECK_FLIBS
+
+ PAC_PROG_F77_LINKER_WITH_C
+ # For name mangle, we need the library flags
+ PAC_PROG_F77_NAME_MANGLE
+ # Check whether additional libraries are needed when linking with C
+ PAC_PROG_F77_AND_C_STDIO_LIBS
+ AC_SUBST(F77_OTHER_LIBS)
+
+ PAC_PROG_F77_LIBRARY_DIR_FLAG
+ if test -z "$FLIB_PATH_LEADER" ; then
+ FLIB_PATH_LEADER=$F77_LIBDIR_LEADER
+ fi
+ PAC_PROG_F77_HAS_INCDIR(f77tmpdir)
+ FINC_PATH_LEADER=$F77_INCDIR
+
+dnl Determine MPI_Fint
+dnl (same test done in graphics's configure.ac)
+ AC_MSG_CHECKING( [for MPI_Fint] )
+ PAC_MPI_LINK_CC_FUNC( $MPI_CC, [$MPI_CFLAGS], $MPI_LIBS, ,
+ [ MPI_Fint aa=1 ], ,
+ [ mpe_link_ok=yes ], [ mpe_link_ok=no ] )
+ if test "$mpe_link_ok" = "yes" ; then
+ AC_MSG_RESULT(yes)
+ MPI_FINT_TYPE=MPI_Fint
+ else
+ AC_MSG_RESULT([no, assumed MPI_Fint to be int])
+ MPI_FINT_TYPE=int
+ AC_DEFINE( MPI_Fint, int, [Define MPI_Fint as int] )
+ fi
+fi
+
+if test -z "$CLINKER" ; then CLINKER="$CC" ; fi
+if test -z "$FLINKER" ; then FLINKER="$F77" ; fi
+AC_SUBST(MPE_BUILD_FORTRAN2C)
+AC_SUBST(CC)
+AC_SUBST(CLINKER)
+AC_SUBST(MPI_CC)
+AC_SUBST(MPE_CLINKER)
+AC_SUBST(F77)
+AC_SUBST(FLINKER)
+AC_SUBST(MPI_F77)
+AC_SUBST(MPE_FLINKER)
+AC_SUBST(MPI_CFLAGS)
+AC_SUBST(MPI_FFLAGS)
+AC_SUBST(MPI_LIBS)
+AC_SUBST(LDFLAGS)
+AC_SUBST(MPERUN)
+AC_SUBST(AR)
+AC_SUBST(AR_FLAGS)
+AC_SUBST(RANLIB)
+
+AC_OUTPUT_COMMANDS( [
+if test ! -x ./cross_env -a -s ./cross_env ; then
+ chmod u+x ./cross_env
+fi
+] )
+AC_OUTPUT( Makefile cross_env )
Deleted: mpich2/trunk/src/mpe2/cross_spec/configure.in
===================================================================
--- mpich2/trunk/src/mpe2/cross_spec/configure.in 2012-02-28 23:25:23 UTC (rev 9547)
+++ mpich2/trunk/src/mpe2/cross_spec/configure.in 2012-02-28 23:26:34 UTC (rev 9548)
@@ -1,281 +0,0 @@
-dnl
-dnl Caching is usually WRONG for systems with cross-mounted file systems
-dnl (the cache file may correspond to a different system). Since configure
-dnl is not on a performance-critical path, go for robustness over speed.
-dnl
-define([AC_CACHE_LOAD], )dnl
-define([AC_CACHE_SAVE], )dnl
-dnl
-dnl
-AC_INIT()
-AC_PREREQ(2.52)
-AC_CONFIG_AUX_DIR([..])
-AC_CONFIG_HEADER(cross_conf.h)
-#
-echo "Configuring MPE Cross-Compilation Spec with $ac_configure_args"
-dnl
-dnl Set top_srcdir_abs to be the ABSOLUTE path to the home directory of MPE
-dnl top_srcdir is in relative path.
-if test "X$srcdir" != "X." -a -s $srcdir/cross_cc.c ; then
- top_srcdir_abs=$srcdir
-else
- PAC_GETWD( top_srcdir_abs, cross_cc.c )
-fi
-AC_SUBST(top_srcdir_abs)
-
-# Determine this package's name based on its directory name
-changequote(,)dnl
-tmpname="`echo $top_srcdir_abs | sed -e 's%\(.*\)/\([^/]*\)%\2%'`"
-pkgname="`echo $tmpname | sed -e 'y%abcdefghijklmnopqrstuvwxyz/%ABCDEFGHIJKLMNOPQRSTUVWXYZ_%'`"
-changequote([,])dnl
-if test "x$pkgname" = "x" ; then
- pkgname="MPE-2 Cross-Compilation Spec"
-fi
-
-AC_ARG_ENABLE( echo,
-[--enable-echo - Turn on strong echoing.
- The default is enable=no.],
-set -x )
-
-VERSION=""
-CC=${CC:-cc}
-F77=${F77:-f77}
-CFLAGS=${CFLAGS}
-FFLAGS=${FFLAGS}
-MAKE=${MAKE:-make}
-
-dnl Fixup for make
-PAC_MAKE_IS_GNUMAKE
-PAC_MAKE_IS_BSD44
-PAC_MAKE_IS_OSF
-PAC_MAKE_VPATH
-AC_SUBST(MAKE)
-
-dnl If we are relying on vpath and no vpath is set, then we must exit
-if test ! -s cross_cc.c -a -z "$VPATH" ; then
- AC_MSG_ERROR( [No virtual MAKE path command found.
- You may need to set your make command
- The GNU make (sometimes available as gnumake) can be used.] )
-fi
-
-RM=rm
-MV=mv
-CPRP=cp
-AC_SUBST(RM)
-AC_SUBST(MV)
-AC_SUBST(CPRP)
-
-AC_ARG_WITH( spec,
-[--with-spec=filename - Specify the default filename to
- store the cross-compilation
- variables and property values to
- be used in MPE2's --with-cross-spec
- option. The default filename is
- cross_spec.txt],
-[CROSS_SPEC_FILE=$withval], [CROSS_SPEC_FILE="cross_spec.txt"] )
-dnl Export CROSS_SPEC_FILE so cross_env.in and *.c can use it.
-AC_SUBST(CROSS_SPEC_FILE)
-AC_DEFINE_UNQUOTED( CROSS_SPEC_FILE, "$CROSS_SPEC_FILE",
- [Define Cross-Spec's output filename] )
-
-dnl MPE_BUILD_FORTRAN2C=yes means that ALL subpackages will be building
-dnl the fortran2c wrapper libraries. This does not necessarily mean that
-dnl specific subpackage has to build fortran2c wrapper library. One example:
-dnl src/wrappers may have --with-f2cmpilibs set by user, so src/wrappers's
-dnl own libmpe_f2cmpi.a will not be built but MPE_BUILD_FORTRAN2C could
-dnl still be set to yes because it means other subpackages like src/graphics
-dnl and src/logging will build their fortran2c wrapper objects. So treat
-dnl MPE_BUILD_FORTRAN2C as a directive, i.e. generally a necessary but
-dnl insufficient condition to build fortran2c wrapper library.
-AC_ARG_ENABLE( f77,
-[--enable-f77 - Compile routines that require a Fortran
- compiler. If configuring with MPICH, the
- configure in the top-level MPICH directory
- will choose the appropriate value for you.
- The default is enable=yes.], ,
-enable_f77=yes )
-if test "$enable_f77" = "yes" ; then
- MPE_BUILD_FORTRAN2C=yes
-else
- MPE_BUILD_FORTRAN2C=no
-fi
-
-dnl
-dnl Unknown MPI implmentation, i.e. User defined MPI_LIBS and MPI_INC
-dnl
-AC_ARG_WITH( mpicc,
-[--with-mpicc=MPI_CC - C compiler used to compile MPI program
- and to create parallel executable,
- e.g. mpcc for IBM MPI, or mpicc from
- MPICHx or LAM-MPI.],
-MPI_CC="$withval" )
-
-AC_ARG_WITH( mpif77,
-[--with-mpif77=MPI_F77 - F77 compiler used to compile MPI program
- and to create parallel executable,
- e.g. mpxlf for IBM MPI, or mpif77 from
- MPICHx or LAM-MPI.],
-MPI_F77="$withval" )
-
-AC_ARG_WITH( mpiinc,
-[--with-mpiinc=MPI_INC - MPI compiler's include flags prefixed
- with -I. It specifies where mpi.h and
- mpif.h are located,
- e.g. -I/pkgs/MPI/include.],
-MPI_INC="$withval" )
-
-AC_ARG_WITH( mpilibs,
-[--with-mpilibs=MPI_LIBS - MPI compiler's library flags prefixed
- with -L for the library path and prefixed
- with -l for the name of the MPI libraries.
- It specifies the location of the MPI
- libraries.
- e.g. -L/pkgs/MPI/lib -lpmpich -lmpich.],
-MPI_LIBS="$withval" )
-
-AC_ARG_VAR( MPI_LIBS, [MPI compiler's library flags prefixed with -L for the library path and prefixed with -l for the name of the MPI libraries. It specifies the location of the MPI libraries. e.g. -L/pkgs/MPI/lib -lpmpich -lmpich.] )
-
-AC_ARG_VAR( MPI_CC, [C compiler to compile MPI program and to create parallel executable, e.g. mpcc for IBM MPI, or mpicc from MPICHx, Open-MPI, or LAM-MPI.] )
-AC_ARG_VAR( MPI_F77, [Fortran compiler to compile MPI program and to create parallel executable, e.g. mpxlf for IBM MPI, or mpif77 from MPICHx, Open-MPI, or LAM-MPI.] )
-AC_ARG_VAR( MPI_INC, [MPI compiler's include path prefixed with -I. It specifies where mpi.h and mpif.h are located, e.g. -I/pkgs/MPI/include. This flag will be added to MPI_CFLAGS and MPI_FFLAGS, i.e. the MPI include path can be explicitly set in MPI_CFLAGS and MPI_FFLAGS without setting MPI_INC.] )
-AC_ARG_VAR( MPI_CFLAGS, [MPI C compiler flags to compile MPI program.] )
-AC_ARG_VAR( MPI_FFLAGS, [MPI Fortran compiler flags to compile MPI Fortran program.] )
-AC_ARG_VAR( MPI_LIBS, [MPI compiler library flags which specifies the location of the MPI libraries. The flags contains library path prefixed with -L and MPI library name prefixed with -l, e.g. -L/opt/MPI/lib -lpmpich -lmpich.] )
-dnl AC_ARG_VAR( MPI_LDFLAGS, [MPI linker flags used with MPI_CC or MPI_F77 during linking.] )
-
-AC_ARG_VAR( MPERUN, [MPI application launch command for the test programs created by this package. This variable is necessary only if user needs a special command to launch MPI testing application to run in the backend compute nodes.] )
-
-# Preppend MPI_INC to MPI_CFLAGS/MPI_FFLAGS
-if test "x$MPI_INC" != "x" ; then
- MPI_CFLAGS="$MPI_INC $MPI_CFLAGS"
- MPI_FFLAGS="$MPI_INC $MPI_FFLAGS"
-fi
-
-AC_PROG_CC
-AC_OBJEXT
-AC_EXEEXT
-AC_HEADER_STDC
-AC_CHECK_HEADERS(stdio.h)
-
-AC_MSG_CHECKING( whether MPI_CC has been set )
-if test -z "$MPI_CC" ; then
- MPI_CC="$CC $MPICPPFLAGS"
-fi
-AC_MSG_RESULT( $MPI_CC )
-
-if test "$MPE_BUILD_FORTRAN2C" = "yes" ; then
- AC_PROG_F77
- if test "x$F77" = "x" ; then
- MPE_BUILD_FORTRAN2C=no
- fi
- AC_MSG_CHECKING( whether MPI_F77 has been set )
- if test -z "$MPI_F77" ; then
- # FIXME: Temporary for F77 accepting the same flags as CC for
- # file includes
- MPI_F77="$F77 $MPICPPFLAGS"
- fi
- AC_MSG_RESULT( $MPI_F77 )
-fi
-
-AC_MSG_CHECKING( [for the linkage of the supplied MPI C definitions] )
-PAC_MPI_LINK_CC_FUNC( $MPI_CC, [$MPI_CFLAGS], $MPI_LIBS, , , ,
- [ mpe_link_ok=yes ], [ mpe_link_ok=no ] )
-if test "$mpe_link_ok" = "yes" ; then
- AC_MSG_RESULT(yes)
-else
- AC_MSG_RESULT(no)
- PAC_MSG_ERROR( $enable_softerror,
- [Cannot link with basic MPI C program!
- Check your MPI include paths, MPI libraries and MPI CC compiler] )
-fi
-
-if test "$MPE_BUILD_FORTRAN2C" = "yes" ; then
- AC_MSG_CHECKING( [for the linkage of the supplied MPI F77 definitions] )
- PAC_MPI_LINK_F77_FUNC( $MPI_F77, [$MPI_FFLAGS], $MPI_LIBS, [
- integer mytid
- integer ierr
- ], [
- call MPI_Comm_rank( MPI_COMM_WORLD, mytid, ierr )
- ], [ mpe_link_ok=yes ], [ mpe_link_ok=no ] )
- if test "$mpe_link_ok" = "yes" ; then
- AC_MSG_RESULT(yes)
- else
- AC_MSG_RESULT(no)
- PAC_MSG_ERROR( $enable_softerror,
- [Cannot link with basic MPI F77 program!
- Check your MPI include paths, MPI libraries and MPI F77 compiler ] )
- fi
-fi
-
-if test -z "$CC" -o -z "$MPI_CC"; then
- PAC_MSG_ERROR( $enable_softerror,
- [You must configure MPE with a specific MPI] )
-fi
-
-if test -n "$F77" -a "$MPE_BUILD_FORTRAN2C" = "yes" ; then
- FLIBS_save="$FLIBS"
- FLIBS=""
- AC_F77_LIBRARY_LDFLAGS
- # The autoconf macro for finding FLIBS sometimes makes mistakes
- # (particularly with the Fujitsu frt compiler). This next step
- # first sees if the FLIBS is valid with the Fortran compiler
- PAC_PROG_F77_FLIBS_VALID
- # Now see if FLIBS works with the C compiler
- PAC_PROG_F77_CHECK_FLIBS
-
- PAC_PROG_F77_LINKER_WITH_C
- # For name mangle, we need the library flags
- PAC_PROG_F77_NAME_MANGLE
- # Check whether additional libraries are needed when linking with C
- PAC_PROG_F77_AND_C_STDIO_LIBS
- AC_SUBST(F77_OTHER_LIBS)
-
- PAC_PROG_F77_LIBRARY_DIR_FLAG
- if test -z "$FLIB_PATH_LEADER" ; then
- FLIB_PATH_LEADER=$F77_LIBDIR_LEADER
- fi
- PAC_PROG_F77_HAS_INCDIR(f77tmpdir)
- FINC_PATH_LEADER=$F77_INCDIR
-
-dnl Determine MPI_Fint
-dnl (same test done in graphics's configure.in)
- AC_MSG_CHECKING( [for MPI_Fint] )
- PAC_MPI_LINK_CC_FUNC( $MPI_CC, [$MPI_CFLAGS], $MPI_LIBS, ,
- [ MPI_Fint aa=1 ], ,
- [ mpe_link_ok=yes ], [ mpe_link_ok=no ] )
- if test "$mpe_link_ok" = "yes" ; then
- AC_MSG_RESULT(yes)
- MPI_FINT_TYPE=MPI_Fint
- else
- AC_MSG_RESULT([no, assumed MPI_Fint to be int])
- MPI_FINT_TYPE=int
- AC_DEFINE( MPI_Fint, int, [Define MPI_Fint as int] )
- fi
-fi
-
-if test -z "$CLINKER" ; then CLINKER="$CC" ; fi
-if test -z "$FLINKER" ; then FLINKER="$F77" ; fi
-AC_SUBST(MPE_BUILD_FORTRAN2C)
-AC_SUBST(CC)
-AC_SUBST(CLINKER)
-AC_SUBST(MPI_CC)
-AC_SUBST(MPE_CLINKER)
-AC_SUBST(F77)
-AC_SUBST(FLINKER)
-AC_SUBST(MPI_F77)
-AC_SUBST(MPE_FLINKER)
-AC_SUBST(MPI_CFLAGS)
-AC_SUBST(MPI_FFLAGS)
-AC_SUBST(MPI_LIBS)
-AC_SUBST(LDFLAGS)
-AC_SUBST(MPERUN)
-AC_SUBST(AR)
-AC_SUBST(AR_FLAGS)
-AC_SUBST(RANLIB)
-
-AC_OUTPUT_COMMANDS( [
-if test ! -x ./cross_env -a -s ./cross_env ; then
- chmod u+x ./cross_env
-fi
-] )
-AC_OUTPUT( Makefile cross_env )
Modified: mpich2/trunk/src/mpe2/maint/README
===================================================================
--- mpich2/trunk/src/mpe2/maint/README 2012-02-28 23:25:23 UTC (rev 9547)
+++ mpich2/trunk/src/mpe2/maint/README 2012-02-28 23:26:34 UTC (rev 9548)
@@ -1,4 +1,4 @@
-The MPE-2 has a top level configure.in and all the C source files are
+The MPE-2 has a top level configure.ac and all the C source files are
splitted into 4 subpackages, each has its own include and source directory
and configure. Because of this structure, the install and build include
directory contains only relevant user .h files, i.e. mpe.h,
Modified: mpich2/trunk/src/mpe2/sbin/mpeinstall.in
===================================================================
--- mpich2/trunk/src/mpe2/sbin/mpeinstall.in 2012-02-28 23:25:23 UTC (rev 9547)
+++ mpich2/trunk/src/mpe2/sbin/mpeinstall.in 2012-02-28 23:26:34 UTC (rev 9548)
@@ -323,7 +323,7 @@
#
# Fixup files with various xxxxbuild_dir to xxxxdir, install directory.
#
-# The MPE_CLINKER/MPE_FLINKER need to sync with mpe2/configure.in
+# The MPE_CLINKER/MPE_FLINKER need to sync with mpe2/configure.ac
#
FixInstallFile() {
if [ -d $DESTDIR$2 ] ; then
Copied: mpich2/trunk/src/mpe2/src/callstack/configure.ac (from rev 9546, mpich2/trunk/src/mpe2/src/callstack/configure.in)
===================================================================
--- mpich2/trunk/src/mpe2/src/callstack/configure.ac (rev 0)
+++ mpich2/trunk/src/mpe2/src/callstack/configure.ac 2012-02-28 23:26:34 UTC (rev 9548)
@@ -0,0 +1,254 @@
+dnl
+dnl Caching is usually WRONG for systems with cross-mounted file systems
+dnl (the cache file may correspond to a different system). Since configure
+dnl is not on a performance-critical path, go for robustness over speed.
+dnl
+define([AC_CACHE_LOAD], )dnl
+define([AC_CACHE_SAVE], )dnl
+dnl
+dnl
+AC_INIT()
+AC_PREREQ(2.52)
+AC_CONFIG_HEADER( mpe_callstack_conf.h )
+dnl
+echo "Configuring MPE CallStack Library with $ac_configure_args"
+dnl
+dnl Set top_srcdir_abs to be the ABSOLUTE path to the home directory of MPE
+dnl top_srcdir is in relative path.
+if test "X$srcdir" != "X." -a -s $srcdir/include/mpe_callstack.h.in ; then
+ top_srcdir_abs=$srcdir
+else
+ PAC_GETWD( top_srcdir_abs, include/mpe_callstack.h.in )
+fi
+AC_SUBST(top_srcdir_abs)
+
+AC_ARG_ENABLE( echo,
+[--enable-echo - Turn on strong echoing.
+ The default is enable=no.],
+set -x )
+
+AC_ARG_ENABLE( softerror,
+[--enable-softerror - Turn on soft error, i.e. instead of
+ issuing MSG_ERROR, MSG_WARN + exit 0
+ are used. The default is enable=no.],
+, enable_softerror=${mpe_enable_softerror:-no} )
+
+MAKE=${MAKE:-make}
+MPI_IMPL=${MPI_IMPL:-UserSupplied}
+MPE_BUILD_FORTRAN2C=${MPE_BUILD_FORTRAN2C:-no}
+CC=${CC:-cc}
+CLINKER=${CLINKER:-$CC}
+CFLAGS=${MPE_CFLAGS}
+MPI_CC=${MPI_CC:-${CC}}
+MPI_CFLAGS=${MPI_CFLAGS}
+MPI_LIBS=${MPI_LIBS}
+
+MPE_LIBNAME=${MPE_LIBNAME:-mpe}
+PROF_LIBNAME="$MPE_LIBNAME"
+PROF_LIBS="-l$PROF_LIBNAME"
+
+dnl Fixup for make
+PAC_MAKE_IS_GNUMAKE
+PAC_MAKE_IS_BSD44
+PAC_MAKE_IS_OSF
+PAC_MAKE_VPATH
+AC_SUBST(MAKE)
+
+dnl if we are relying on vpath and no vpath is set, then we must exit
+if test ! -s include/mpe_callstack.h.in -a -z "$VPATH" ; then
+ AC_MSG_ERROR( [No virtual MAKE path command found.
+ You may need to set your make command
+ The GNU make (sometimes available as gnumake) can be used.] )
+fi
+
+dnl CPRP is the version of cp that accepts -r and -p arguments.
+MKDIR=mkdir
+CPRP=cp
+RM=rm
+MV=mv
+AC_SUBST(MKDIR)
+AC_SUBST(CPRP)
+AC_SUBST(RM)
+AC_SUBST(MV)
+
+dnl Set the various build directories from their mpe_ prefixed env variables.
+dnl
+dnl includebuild_dir is for all user header files
+dnl libbuild_dir is used to build the libraries in before they are installed.
+dnl binbuild_dir is for the scripts/programs
+dnl sbinbuild_dir is for all system admin tools
+dnl etcbuild_dir is for all system admin configuration settings
+dnl
+rootbuild_dir=`pwd`
+for dir in include lib bin etc ; do
+ dirname=${dir}build_dir
+ mpe_dirname=mpe_${dirname}
+ eval dirvalue=\$"$dirname"
+ eval $dirname=\$\{${mpe_dirname}\}
+done
+
+for dir in include lib bin etc ; do
+ dirname=${dir}build_dir
+ eval dirvalue=\$"$dirname"
+ if test -n "$dirvalue" ; then
+ if test ! -d $dirvalue ; then
+ if mkdir -p $dirvalue ; then
+ :
+ else
+ PAC_MSG_ERROR( $enable_softerror,
+ [Could not create directory $dirvalue] )
+ fi
+ fi
+ fi
+done
+
+AC_SUBST(includebuild_dir)
+AC_SUBST(libbuild_dir)
+AC_SUBST(binbuild_dir)
+AC_SUBST(etcbuild_dir)
+
+AC_PROG_CC
+AC_OBJEXT
+AC_EXEEXT
+dnl Check for broken handling of common symbols
+dnl PAC_PROG_C_BROKEN_COMMON
+AC_CHECK_PROG(AR, ar, ar, ;)
+AC_PROG_RANLIB
+
+AC_PROG_CC_C_O
+# set CC_DOES_C_O to the value of \${ac_cv_prog_cc_${ac_cc}_c_o}
+eval CC_DOES_C_O=\${ac_cv_prog_cc_${ac_cc}_c_o}
+AC_SUBST(CC_DOES_C_O)
+
+dnl We need to check that this has worked. The autoconf macro is broken
+AC_PROG_CPP
+if test "$CPP" = "/lib/cpp" -a ! -x /lib/cpp ; then
+ AC_MSG_ERROR( [configure could not find a working C preprocessor] )
+fi
+
+AC_HEADER_STDC
+
+AC_C_CONST
+AC_C_INLINE
+
+AC_CHECK_HEADERS( stdio.h string.h unistd.h fcntl.h )
+
+mpe_callstack_impl_type=""
+mpe_callstack_ldflags=""
+if test "X$mpe_callstack_impl_type" = "X" ; then
+ dnl Check if backtrace() API is available
+ AC_CHECK_HEADERS( [execinfo.h], [
+ AC_MSG_CHECKING( [whether <execinfo.h> defines backtrace_symbols_fd()] )
+ AC_COMPILE_IFELSE( [
+ AC_LANG_PROGRAM( [
+ #include <execinfo.h>
+ ], [
+changequote(<<, >>)dnl
+ void* buffer[10];
+changequote([, ])dnl
+ int depth;
+ depth = backtrace( buffer, 10 );
+ backtrace_symbols_fd( buffer, depth, 1 );
+ ] )
+ ], [
+ AC_MSG_RESULT(yes)
+ mpe_callstack_impl_type="#define HAVE_BACKTRACE 1"
+ dnl Only gcc compiler suite knows -rdynamic, other compilers like
+ dnl ifort does not know -rdynamic. So explicit linker option,
+ dnl -Wl,--export-dynamic will be more universal.
+ AC_MSG_CHECKING( [if <execinfo.h> links with -Wl,--export-dynamic] )
+ old_LDFLAGS="$LDFLAGS"
+ LDFLAGS="$LDFLAGS -Wl,--export-dynamic"
+ AC_LINK_IFELSE( [
+ AC_LANG_PROGRAM( [
+ #include <execinfo.h>
+ ], [
+changequote(<<, >>)dnl
+ void* buffer[10];
+changequote([, ])dnl
+ int depth;
+ depth = backtrace( buffer, 10 );
+ backtrace_symbols_fd( buffer, depth, 1 );
+ ] )
+ ], [
+ AC_MSG_RESULT(yes)
+ mpe_callstack_ldflags="-Wl,--export-dynamic"
+ ], [
+ AC_MSG_RESULT(no)
+ LDFLAGS="$old_LDFLAGS"
+ ] ) dnl Endof AC_LINK_IFELSE
+ ], [
+ AC_MSG_RESULT(no)
+ ] ) dnl Endof AC_COMPILE_IFELSE
+ ] ) dnl Endof AC_CHECK_HEADERS
+fi
+
+if test "X$mpe_callstack_impl_type" = "X" ; then
+ dnl Check if printstack() API is available
+ AC_CHECK_HEADERS( [ucontext.h], [
+ AC_MSG_CHECKING( [whether <ucontext.h> defines printstack()] )
+ AC_COMPILE_IFELSE( [
+ AC_LANG_PROGRAM( [
+ #include <ucontext.h>
+ ], [
+ printstack( 1 );
+ ] )
+ ], [
+ AC_MSG_RESULT(yes)
+ AC_MSG_CHECKING( [whether printstack() can be linked] )
+ AC_LINK_IFELSE( [
+ AC_LANG_PROGRAM( [
+ #include <ucontext.h>
+ ], [
+ printstack( 1 );
+ ] )
+ ], [
+ AC_MSG_RESULT(yes)
+ mpe_callstack_impl_type="#define HAVE_PRINTSTACK 1"
+ ], [
+ AC_MSG_RESULT(no)
+ ] ) dnl Endof AC_LINK_IFELSE
+ ], [
+ AC_MSG_RESULT(no)
+ ] ) dnl Endof AC_COMPILE_IFELSE
+ ] ) dnl Endof AC_CHECK_HEADERS
+fi
+
+if test "X$mpe_callstack_impl_type" = "X" ; then
+ dnl Since no available callstack implementation, fall back to default.
+ if test "$ac_cv_header_string_h" = "yes" ; then
+ mpe_callstack_string_h="#define HAVE_STRING_H 1"
+ fi
+ if test "$ac_cv_header_unistd_h" = "yes" ; then
+ mpe_callstack_unistd_h="#define HAVE_UNISTD_H 1"
+ fi
+fi
+
+AC_SUBST(mpe_callstack_impl_type)
+AC_SUBST(mpe_callstack_ldflags)
+AC_SUBST(mpe_callstack_string_h)
+AC_SUBST(mpe_callstack_unistd_h)
+
+dnl fdopen may have been missing in headerfile,
+dnl e.g. gcc -ansi remove fdopen's prototype
+AC_CHECK_FUNCS(fdopen)
+if test "$ac_cv_func_fdopen" = "yes" ; then
+ PAC_FUNC_NEEDS_DECL([#include <stdio.h>],fdopen)
+fi
+
+AC_SUBST(MPE_BUILD_FORTRAN2C)
+AC_SUBST(CC)
+AC_SUBST(CLINKER)
+AC_SUBST(CFLAGS)
+AC_SUBST(MPI_CC)
+AC_SUBST(MPI_CFLAGS)
+AC_SUBST(MPI_LIBS)
+AC_SUBST(PROF_LIBNAME)
+
+AC_OUTPUT_COMMANDS( [
+if test ! -x ./bin/bt2line -a -s ./bin/bt2line ; then
+ chmod a+x ./bin/bt2line
+fi
+] )
+AC_OUTPUT( Makefile src/Makefile include/mpe_callstack.h \
+ etc/mpe_callstack_ldflags.conf bin/bt2line )
Deleted: mpich2/trunk/src/mpe2/src/callstack/configure.in
===================================================================
--- mpich2/trunk/src/mpe2/src/callstack/configure.in 2012-02-28 23:25:23 UTC (rev 9547)
+++ mpich2/trunk/src/mpe2/src/callstack/configure.in 2012-02-28 23:26:34 UTC (rev 9548)
@@ -1,254 +0,0 @@
-dnl
-dnl Caching is usually WRONG for systems with cross-mounted file systems
-dnl (the cache file may correspond to a different system). Since configure
-dnl is not on a performance-critical path, go for robustness over speed.
-dnl
-define([AC_CACHE_LOAD], )dnl
-define([AC_CACHE_SAVE], )dnl
-dnl
-dnl
-AC_INIT()
-AC_PREREQ(2.52)
-AC_CONFIG_HEADER( mpe_callstack_conf.h )
-dnl
-echo "Configuring MPE CallStack Library with $ac_configure_args"
-dnl
-dnl Set top_srcdir_abs to be the ABSOLUTE path to the home directory of MPE
-dnl top_srcdir is in relative path.
-if test "X$srcdir" != "X." -a -s $srcdir/include/mpe_callstack.h.in ; then
- top_srcdir_abs=$srcdir
-else
- PAC_GETWD( top_srcdir_abs, include/mpe_callstack.h.in )
-fi
-AC_SUBST(top_srcdir_abs)
-
-AC_ARG_ENABLE( echo,
-[--enable-echo - Turn on strong echoing.
- The default is enable=no.],
-set -x )
-
-AC_ARG_ENABLE( softerror,
-[--enable-softerror - Turn on soft error, i.e. instead of
- issuing MSG_ERROR, MSG_WARN + exit 0
- are used. The default is enable=no.],
-, enable_softerror=${mpe_enable_softerror:-no} )
-
-MAKE=${MAKE:-make}
-MPI_IMPL=${MPI_IMPL:-UserSupplied}
-MPE_BUILD_FORTRAN2C=${MPE_BUILD_FORTRAN2C:-no}
-CC=${CC:-cc}
-CLINKER=${CLINKER:-$CC}
-CFLAGS=${MPE_CFLAGS}
-MPI_CC=${MPI_CC:-${CC}}
-MPI_CFLAGS=${MPI_CFLAGS}
-MPI_LIBS=${MPI_LIBS}
-
-MPE_LIBNAME=${MPE_LIBNAME:-mpe}
-PROF_LIBNAME="$MPE_LIBNAME"
-PROF_LIBS="-l$PROF_LIBNAME"
-
-dnl Fixup for make
-PAC_MAKE_IS_GNUMAKE
-PAC_MAKE_IS_BSD44
-PAC_MAKE_IS_OSF
-PAC_MAKE_VPATH
-AC_SUBST(MAKE)
-
-dnl if we are relying on vpath and no vpath is set, then we must exit
-if test ! -s include/mpe_callstack.h.in -a -z "$VPATH" ; then
- AC_MSG_ERROR( [No virtual MAKE path command found.
- You may need to set your make command
- The GNU make (sometimes available as gnumake) can be used.] )
-fi
-
-dnl CPRP is the version of cp that accepts -r and -p arguments.
-MKDIR=mkdir
-CPRP=cp
-RM=rm
-MV=mv
-AC_SUBST(MKDIR)
-AC_SUBST(CPRP)
-AC_SUBST(RM)
-AC_SUBST(MV)
-
-dnl Set the various build directories from their mpe_ prefixed env variables.
-dnl
-dnl includebuild_dir is for all user header files
-dnl libbuild_dir is used to build the libraries in before they are installed.
-dnl binbuild_dir is for the scripts/programs
-dnl sbinbuild_dir is for all system admin tools
-dnl etcbuild_dir is for all system admin configuration settings
-dnl
-rootbuild_dir=`pwd`
-for dir in include lib bin etc ; do
- dirname=${dir}build_dir
- mpe_dirname=mpe_${dirname}
- eval dirvalue=\$"$dirname"
- eval $dirname=\$\{${mpe_dirname}\}
-done
-
-for dir in include lib bin etc ; do
- dirname=${dir}build_dir
- eval dirvalue=\$"$dirname"
- if test -n "$dirvalue" ; then
- if test ! -d $dirvalue ; then
- if mkdir -p $dirvalue ; then
- :
- else
- PAC_MSG_ERROR( $enable_softerror,
- [Could not create directory $dirvalue] )
- fi
- fi
- fi
-done
-
-AC_SUBST(includebuild_dir)
-AC_SUBST(libbuild_dir)
-AC_SUBST(binbuild_dir)
-AC_SUBST(etcbuild_dir)
-
-AC_PROG_CC
-AC_OBJEXT
-AC_EXEEXT
-dnl Check for broken handling of common symbols
-dnl PAC_PROG_C_BROKEN_COMMON
-AC_CHECK_PROG(AR, ar, ar, ;)
-AC_PROG_RANLIB
-
-AC_PROG_CC_C_O
-# set CC_DOES_C_O to the value of \${ac_cv_prog_cc_${ac_cc}_c_o}
-eval CC_DOES_C_O=\${ac_cv_prog_cc_${ac_cc}_c_o}
-AC_SUBST(CC_DOES_C_O)
-
-dnl We need to check that this has worked. The autoconf macro is broken
-AC_PROG_CPP
-if test "$CPP" = "/lib/cpp" -a ! -x /lib/cpp ; then
- AC_MSG_ERROR( [configure could not find a working C preprocessor] )
-fi
-
-AC_HEADER_STDC
-
-AC_C_CONST
-AC_C_INLINE
-
-AC_CHECK_HEADERS( stdio.h string.h unistd.h fcntl.h )
-
-mpe_callstack_impl_type=""
-mpe_callstack_ldflags=""
-if test "X$mpe_callstack_impl_type" = "X" ; then
- dnl Check if backtrace() API is available
- AC_CHECK_HEADERS( [execinfo.h], [
- AC_MSG_CHECKING( [whether <execinfo.h> defines backtrace_symbols_fd()] )
- AC_COMPILE_IFELSE( [
- AC_LANG_PROGRAM( [
- #include <execinfo.h>
- ], [
-changequote(<<, >>)dnl
- void* buffer[10];
-changequote([, ])dnl
- int depth;
- depth = backtrace( buffer, 10 );
- backtrace_symbols_fd( buffer, depth, 1 );
- ] )
- ], [
- AC_MSG_RESULT(yes)
- mpe_callstack_impl_type="#define HAVE_BACKTRACE 1"
- dnl Only gcc compiler suite knows -rdynamic, other compilers like
- dnl ifort does not know -rdynamic. So explicit linker option,
- dnl -Wl,--export-dynamic will be more universal.
- AC_MSG_CHECKING( [if <execinfo.h> links with -Wl,--export-dynamic] )
- old_LDFLAGS="$LDFLAGS"
- LDFLAGS="$LDFLAGS -Wl,--export-dynamic"
- AC_LINK_IFELSE( [
- AC_LANG_PROGRAM( [
- #include <execinfo.h>
- ], [
-changequote(<<, >>)dnl
- void* buffer[10];
-changequote([, ])dnl
- int depth;
- depth = backtrace( buffer, 10 );
- backtrace_symbols_fd( buffer, depth, 1 );
- ] )
- ], [
- AC_MSG_RESULT(yes)
- mpe_callstack_ldflags="-Wl,--export-dynamic"
- ], [
- AC_MSG_RESULT(no)
- LDFLAGS="$old_LDFLAGS"
- ] ) dnl Endof AC_LINK_IFELSE
- ], [
- AC_MSG_RESULT(no)
- ] ) dnl Endof AC_COMPILE_IFELSE
- ] ) dnl Endof AC_CHECK_HEADERS
-fi
-
-if test "X$mpe_callstack_impl_type" = "X" ; then
- dnl Check if printstack() API is available
- AC_CHECK_HEADERS( [ucontext.h], [
- AC_MSG_CHECKING( [whether <ucontext.h> defines printstack()] )
- AC_COMPILE_IFELSE( [
- AC_LANG_PROGRAM( [
- #include <ucontext.h>
- ], [
- printstack( 1 );
- ] )
- ], [
- AC_MSG_RESULT(yes)
- AC_MSG_CHECKING( [whether printstack() can be linked] )
- AC_LINK_IFELSE( [
- AC_LANG_PROGRAM( [
- #include <ucontext.h>
- ], [
- printstack( 1 );
- ] )
- ], [
- AC_MSG_RESULT(yes)
- mpe_callstack_impl_type="#define HAVE_PRINTSTACK 1"
- ], [
- AC_MSG_RESULT(no)
- ] ) dnl Endof AC_LINK_IFELSE
- ], [
- AC_MSG_RESULT(no)
- ] ) dnl Endof AC_COMPILE_IFELSE
- ] ) dnl Endof AC_CHECK_HEADERS
-fi
-
-if test "X$mpe_callstack_impl_type" = "X" ; then
- dnl Since no available callstack implementation, fall back to default.
- if test "$ac_cv_header_string_h" = "yes" ; then
- mpe_callstack_string_h="#define HAVE_STRING_H 1"
- fi
- if test "$ac_cv_header_unistd_h" = "yes" ; then
- mpe_callstack_unistd_h="#define HAVE_UNISTD_H 1"
- fi
-fi
-
-AC_SUBST(mpe_callstack_impl_type)
-AC_SUBST(mpe_callstack_ldflags)
-AC_SUBST(mpe_callstack_string_h)
-AC_SUBST(mpe_callstack_unistd_h)
-
-dnl fdopen may have been missing in headerfile,
-dnl e.g. gcc -ansi remove fdopen's prototype
-AC_CHECK_FUNCS(fdopen)
-if test "$ac_cv_func_fdopen" = "yes" ; then
- PAC_FUNC_NEEDS_DECL([#include <stdio.h>],fdopen)
-fi
-
-AC_SUBST(MPE_BUILD_FORTRAN2C)
-AC_SUBST(CC)
-AC_SUBST(CLINKER)
-AC_SUBST(CFLAGS)
-AC_SUBST(MPI_CC)
-AC_SUBST(MPI_CFLAGS)
-AC_SUBST(MPI_LIBS)
-AC_SUBST(PROF_LIBNAME)
-
-AC_OUTPUT_COMMANDS( [
-if test ! -x ./bin/bt2line -a -s ./bin/bt2line ; then
- chmod a+x ./bin/bt2line
-fi
-] )
-AC_OUTPUT( Makefile src/Makefile include/mpe_callstack.h \
- etc/mpe_callstack_ldflags.conf bin/bt2line )
Copied: mpich2/trunk/src/mpe2/src/collchk/configure.ac (from rev 9546, mpich2/trunk/src/mpe2/src/collchk/configure.in)
===================================================================
--- mpich2/trunk/src/mpe2/src/collchk/configure.ac (rev 0)
+++ mpich2/trunk/src/mpe2/src/collchk/configure.ac 2012-02-28 23:26:34 UTC (rev 9548)
@@ -0,0 +1,800 @@
+dnl
+dnl Caching is usually WRONG for systems with cross-mounted file systems
+dnl (the cache file may correspond to a different system). Since configure
+dnl is not on a performance-critical path, go for robustness over speed.
+dnl
+define([AC_CACHE_LOAD], )dnl
+define([AC_CACHE_SAVE], )dnl
+dnl
+dnl
+AC_INIT()
+AC_PREREQ(2.52)
+AC_CONFIG_HEADER(mpe_collchk_conf.h)
+dnl
+echo "Configuring MPE Collective and Datatype Checking Library with $ac_configure_args"
+dnl
+dnl Set top_srcdir_abs to be the ABSOLUTE path to the home directory of MPE
+dnl top_srcdir is in relative path.
+if test "X$srcdir" != "X." -a -s $srcdir/include/collchk.h ; then
+ top_srcdir_abs=$srcdir
+else
+ PAC_GETWD( top_srcdir_abs, include/collchk.h )
+fi
+AC_SUBST(top_srcdir_abs)
+
+AC_ARG_ENABLE( echo,
+[--enable-echo - Turn on strong echoing.
+ The default is enable=no.],
+set -x )
+
+AC_ARG_ENABLE( softerror,
+[--enable-softerror - Turn on soft error, i.e. instead of
+ issuing MSG_ERROR, MSG_WARN + exit 0
+ are used. The default is enable=no.],
+, enable_softerror=${mpe_enable_softerror:-no} )
+
+MAKE=${MAKE:-make}
+MPI_IMPL=${MPI_IMPL:-UserSupplied}
+MPE_BUILD_FORTRAN2C=${MPE_BUILD_FORTRAN2C:-no}
+CC=${CC:-cc}
+CLINKER=${CLINKER:-$CC}
+CFLAGS=${MPE_CFLAGS}
+MPI_CC=${MPI_CC:-${CC}}
+MPE_CLINKER=${MPE_CLINKER}
+F77=${F77:-f77}
+FLINKER=${FLINKER:-$F77}
+FFLAGS=${MPE_FFLAGS}
+MPI_F77=${MPI_F77:-${F77}}
+MPE_FLINKER=${MPE_FLINKER}
+FINC_PATH_LEADER=${FINC_PATH_LEADER:-"-I"}
+FLIB_PATH_LEADER=${FLIB_PATH_LEADER:-"-L"}
+MPI_CFLAGS=${MPI_CFLAGS}
+MPI_FFLAGS=${MPI_FFLAGS}
+MPI_LIBS=${MPI_LIBS}
+
+MPE_LIBNAME=${MPE_LIBNAME:-mpe}
+PROF_LIBNAME="$MPE_LIBNAME"
+COLLCHK_LIBNAME="${MPE_LIBNAME}_collchk"
+F2CMPI_LIBNAME="${MPE_LIBNAME}_f2cmpi"
+
+PROF_LIBS="-l$PROF_LIBNAME"
+COLLCHK_LIBS="-l$COLLCHK_LIBNAME $PROF_LIBS"
+F2CMPI_LIBS="-l$F2CMPI_LIBNAME"
+
+dnl Fixup for make
+PAC_MAKE_IS_GNUMAKE
+PAC_MAKE_IS_BSD44
+PAC_MAKE_IS_OSF
+PAC_MAKE_VPATH
+AC_SUBST(MAKE)
+
+dnl If we are relying on vpath and no vpath is set, then we must exit
+if test ! -s include/collchk.h -a -z "$VPATH" ; then
+ AC_MSG_ERROR( [No virtual MAKE path command found.
+ You may need to set your make command
+ The GNU make (sometimes available as gnumake) can be used.] )
+fi
+
+dnl CPRP is the version of cp that accepts -r and -p arguments.
+MKDIR=mkdir
+CPRP=cp
+RM=rm
+MV=mv
+AC_SUBST(MKDIR)
+AC_SUBST(CPRP)
+AC_SUBST(RM)
+AC_SUBST(MV)
+
+AC_ARG_WITH( mpiio,
+[--with-mpiio - Enable/Disable MPI-IO checking.
+ in MPICHx buiid. The default is yes.], ,
+with_mpiio=yes )
+
+AC_ARG_ENABLE( romio,
+[--enable-romio - Enable/Disable ROMIO MPI-IO checking
+ in MPICHx build. The default is yes.] ,
+with_mpiio=$enableval,
+with_mpiio=yes )
+
+AC_ARG_ENABLE( checkMPI,
+[--enable-checkMPI - Turn on/off the linking test for the MPI
+ include files, MPI libraries and MPI_CC
+ compiler. The default is enable=yes.], ,
+enable_checkMPI=yes )
+
+AC_ARG_WITH( checkMPIO,
+[--enable-checkMPIO - Turn on/off the linking test for MPI-IO
+ routines in MPI implementation.
+ The default is enable=yes.], ,
+enable_checkMPIO=yes )
+
+AC_ARG_WITH( f2cmpilibs,
+[--with-f2cmpilibs=F2CMPI_LIBS - compiler's library flags for
+ Fortran to C MPI wrapper library.
+ Using this option disables building of
+ MPE's internal Fortran to C MPI library,
+ --disable-f2cmpilib. The library is
+ needed for profiling MPI Fortran program.
+ e.g. "-lfmpich" when MPE is building with
+ MPICH.],
+F2CMPI_LIBS="$withval" )
+
+if test -z "$nonopt" ; then nonopt=NONE ; fi
+AC_CANONICAL_HOST
+
+dnl Set the various build directories from their mpe_ prefixed env variables.
+dnl
+dnl includebuild_dir is for all user header files
+dnl libbuild_dir is used to build the libraries in before they are installed.
+dnl binbuild_dir is for the scripts/programs
+dnl sbinbuild_dir is for all system admin tools
+dnl etcbuild_dir is for all system admin configuration settings
+dnl
+rootbuild_dir=`pwd`
+for dir in include lib bin sbin etc ; do
+ dirname=${dir}build_dir
+ mpe_dirname=mpe_${dirname}
+ eval dirvalue=\$"$dirname"
+ eval $dirname=\$\{${mpe_dirname}\}
+done
+
+for dir in include lib bin sbin etc ; do
+ dirname=${dir}build_dir
+ eval dirvalue=\$"$dirname"
+ if test -n "$dirvalue" ; then
+ if test ! -d $dirvalue ; then
+ if mkdir -p $dirvalue ; then
+ :
+ else
+ PAC_MSG_ERROR( $enable_softerror,
+ [Could not create directory $dirvalue] )
+ fi
+ fi
+ fi
+done
+
+AC_SUBST(includebuild_dir)
+AC_SUBST(libbuild_dir)
+AC_SUBST(binbuild_dir)
+AC_SUBST(sbinbuild_dir)
+AC_SUBST(etcbuild_dir)
+
+AC_PROG_CC
+AC_OBJEXT
+AC_EXEEXT
+dnl Check for broken handling of common symbols
+dnl PAC_PROG_C_BROKEN_COMMON
+AC_CHECK_PROG(AR, ar, ar, ;)
+AC_PROG_RANLIB
+
+dnl We need to check that this has worked. The autoconf macro is broken
+AC_PROG_CPP
+if test "$CPP" = "/lib/cpp" -a ! -x /lib/cpp ; then
+ AC_MSG_ERROR( [configure could not find a working C preprocessor] )
+fi
+
+dnl Invoking AC_CHECK_LIB before AC_PROG_CC makes AC_PROG_CC fail
+dnl in autoconf 2.59
+DEBUG_LIBS=""
+if test "$enable_debugcheck" = "yes" ; then
+ AC_CHECK_LIB( efence, malloc, DEBUG_LIBS="-lefence" )
+fi
+AC_SUBST(DEBUG_LIBS)
+
+AC_HEADER_STDC
+AC_C_CONST
+
+dnl Checking Headers
+AC_CHECK_HEADERS( stdio.h stdlib.h string.h unistd.h )
+
+AC_FUNC_ALLOCA
+
+dnl Check MPI_Type_get_envelope() and MPI_Type_get_content()
+if test "$MPI_IMPL" != "MPICH" -a "$MPI_IMPL" != "MPICH2" ; then
+ if test "$enable_checkMPI" = "yes" ; then
+ AC_MSG_CHECKING( [for MPI_Datatype decoding functions] )
+ PAC_MPI_LINK_CC_FUNC( $MPI_CC, [$MPI_CFLAGS], $MPI_LIBS, ,
+ [
+ int nints, naddrs, ntypes, combiner;
+ int *ints;
+ MPI_Aint *addrs;
+ MPI_Datatype *types;
+ MPI_Datatype type;
+ int itmp
+ ],
+ [
+ itmp=MPI_Type_get_envelope( type, &nints, &naddrs, &ntypes, &combiner );
+ itmp=MPI_Type_get_contents(type, nints, naddrs, ntypes, ints, addrs, types);
+ combiner=MPI_COMBINER_NAMED;
+ ],
+ [ mpe_link_ok=yes ], [ mpe_link_ok=no ] )
+ if test "$mpe_link_ok" = "yes" ; then
+ AC_MSG_RESULT(yes)
+ else
+ AC_MSG_RESULT(no)
+ PAC_MSG_ERROR( $enable_softerror,
+ [Missing MPI_Datatype decoding functions!] )
+ fi
+ fi
+dnl if MPICH2/MPICH1, assume MPI_Type_get_envelope()/MPI_Type_get_content()
+fi
+
+dnl Check MPI_COMBINER_xxx
+if test "$MPI_IMPL" != "MPICH" -a "$MPI_IMPL" != "MPICH2" ; then
+ if test "$enable_checkMPI" = "yes" ; then
+ AC_MSG_CHECKING( [for rare MPI_COMBINER_XXX types] )
+ PAC_MPI_LINK_CC_FUNC( $MPI_CC, [$MPI_CFLAGS], $MPI_LIBS, ,
+ [ int cbr1, cbr2, cbr3, cbr4, cbr5, cbr6; ],
+ [
+ cbr1=MPI_COMBINER_DUP; cbr2=MPI_COMBINER_F90_COMPLEX;
+ cbr3=MPI_COMBINER_INDEXED_BLOCK; cbr4=MPI_COMBINER_HINDEXED_INTEGER;
+ cbr5=MPI_COMBINER_STRUCT_INTEGER; cbr6=MPI_COMBINER_SUBARRAY;
+ ],
+ [ mpe_link_ok=yes ], [ mpe_link_ok=no ] )
+ if test "$mpe_link_ok" = "yes" ; then
+ AC_MSG_RESULT(yes)
+ AC_DEFINE( HAVE_RARE_MPI_COMBINERS, 1,
+ [Define if rare MPI_COMBINER_xxx exist] )
+ else
+ AC_MSG_RESULT(no)
+ fi
+ fi
+else
+dnl if MPICH2, assume are MPI_COMBINER_XXX are available, not in MPICH1
+ if test "$MPI_IMPL" = "MPICH2" ; then
+ AC_DEFINE( HAVE_RARE_MPI_COMBINERS, 1,
+ [Define if rare MPI_COMBINER_xxx exist] )
+ fi
+fi
+
+
+dnl Check MPI_Add_error_class(), MPI_Add_error_code(), MPI_Add_error_string()
+dnl and MPI_Comm_call_errhandler()
+if test "$MPI_IMPL" != "MPICH" -a "$MPI_IMPL" != "MPICH2" ; then
+ if test "$enable_checkMPI" = "yes" ; then
+ AC_MSG_CHECKING( [for MPI Error functions] )
+ PAC_MPI_LINK_CC_FUNC( $MPI_CC, [$MPI_CFLAGS], $MPI_LIBS, ,
+ [
+ int itmp, err_class, err_code;
+ char err_str[]="test";
+ ],
+ [
+ itmp=MPI_Add_error_class( &err_class );
+ itmp=MPI_Add_error_code( err_class, &err_code );
+ itmp=MPI_Add_error_string( err_code, err_str );
+ itmp=MPI_Comm_call_errhandler( MPI_COMM_WORLD, err_code );
+ ],
+ [ mpe_link_ok=yes ], [ mpe_link_ok=no ] )
+ if test "$mpe_link_ok" = "yes" ; then
+ AC_MSG_RESULT(yes)
+ AC_DEFINE( HAVE_MPI_ERR_FNS, 1,
+ [Define if MPI Error functions exist] )
+ else
+ AC_MSG_RESULT(no)
+ fi
+ fi
+else
+dnl if MPICH2, assume MPI_IN_PLACE is available, not in MPICH1
+ if test "$MPI_IMPL" = "MPICH2" ; then
+ AC_DEFINE( HAVE_MPI_ERR_FNS, 1, [Define if MPI Error functions exist] )
+ fi
+fi
+
+
+dnl Check MPI_IN_PLACE
+if test "$MPI_IMPL" != "MPICH" -a "$MPI_IMPL" != "MPICH2" ; then
+ if test "$enable_checkMPI" = "yes" ; then
+ AC_MSG_CHECKING( [for MPI_IN_PLACE] )
+ PAC_MPI_LINK_CC_FUNC( $MPI_CC, [$MPI_CFLAGS], $MPI_LIBS, ,
+ [ int itmp, iboolean; ],
+ [
+ itmp=MPI_Allreduce( MPI_IN_PLACE, &iboolean, 1, MPI_INT,
+ MPI_LAND, MPI_COMM_WORLD )
+ ],
+ [ mpe_link_ok=yes ], [ mpe_link_ok=no ] )
+ if test "$mpe_link_ok" = "yes" ; then
+ AC_MSG_RESULT(yes)
+ AC_DEFINE( HAVE_MPI_IN_PLACE, 1, [Define if MPI_IN_PLACE exists] )
+ else
+ AC_MSG_RESULT(no)
+ fi
+ fi
+else
+dnl if MPICH2, assume MPI_IN_PLACE is available, not in MPICH1
+ if test "$MPI_IMPL" = "MPICH2" ; then
+ AC_DEFINE( HAVE_MPI_IN_PLACE, 1, [Define if MPI_IN_PLACE exists] )
+ fi
+fi
+
+dnl Check MPI_WCHAR
+if test "$MPI_IMPL" != "MPICH" -a "$MPI_IMPL" != "MPICH2" ; then
+ if test "$enable_checkMPI" = "yes" ; then
+ AC_MSG_CHECKING( [for MPI_WCHAR] )
+ PAC_MPI_LINK_CC_FUNC( $MPI_CC, [$MPI_CFLAGS], $MPI_LIBS, ,
+ [ MPI_Datatype type; ],
+ [ type = MPI_WCHAR ],
+ [ mpe_link_ok=yes ], [ mpe_link_ok=no ] )
+ if test "$mpe_link_ok" = "yes" ; then
+ AC_MSG_RESULT(yes)
+ AC_DEFINE( HAVE_MPI_WCHAR, 1,
+ [Define if MPI_WCHAR exists] )
+ else
+ AC_MSG_RESULT(no)
+ fi
+ fi
+else
+dnl if MPICH2, assume MPI_SIGNED_CHAR is available, not in MPICH1
+ if test "$MPI_IMPL" = "MPICH2" ; then
+ AC_DEFINE( HAVE_MPI_WCHAR, 1,
+ [Define if MPI_WCHAR exists] )
+ fi
+fi
+
+dnl Check MPI_SIGNED_CHAR
+if test "$MPI_IMPL" != "MPICH" -a "$MPI_IMPL" != "MPICH2" ; then
+ if test "$enable_checkMPI" = "yes" ; then
+ AC_MSG_CHECKING( [for MPI_SIGNED_CHAR] )
+ PAC_MPI_LINK_CC_FUNC( $MPI_CC, [$MPI_CFLAGS], $MPI_LIBS, ,
+ [ MPI_Datatype type; ],
+ [ type = MPI_SIGNED_CHAR ],
+ [ mpe_link_ok=yes ], [ mpe_link_ok=no ] )
+ if test "$mpe_link_ok" = "yes" ; then
+ AC_MSG_RESULT(yes)
+ AC_DEFINE( HAVE_MPI_SIGNED_CHAR, 1,
+ [Define if MPI_SIGNED_CHAR exists] )
+ else
+ AC_MSG_RESULT(no)
+ fi
+ fi
+else
+dnl if MPICH2, assume MPI_SIGNED_CHAR is available, not in MPICH1
+ if test "$MPI_IMPL" = "MPICH2" ; then
+ AC_DEFINE( HAVE_MPI_SIGNED_CHAR, 1,
+ [Define if MPI_SIGNED_CHAR exists] )
+ fi
+fi
+
+dnl Check MPI_UNSIGNED_LONG_LONG
+if test "$MPI_IMPL" != "MPICH" -a "$MPI_IMPL" != "MPICH2" ; then
+ if test "$enable_checkMPI" = "yes" ; then
+ AC_MSG_CHECKING( [for MPI_UNSIGNED_LONG_LONG] )
+ PAC_MPI_LINK_CC_FUNC( $MPI_CC, [$MPI_CFLAGS], $MPI_LIBS, ,
+ [ MPI_Datatype type; ],
+ [ type = MPI_UNSIGNED_LONG_LONG ],
+ [ mpe_link_ok=yes ], [ mpe_link_ok=no ] )
+ if test "$mpe_link_ok" = "yes" ; then
+ AC_MSG_RESULT(yes)
+ AC_DEFINE( HAVE_MPI_UNSIGNED_LONG_LONG, 1,
+ [Define if MPI_UNSIGNED_LONG_LONG exists] )
+ else
+ AC_MSG_RESULT(no)
+ fi
+ fi
+else
+dnl if MPICH2, assume MPI_SIGNED_CHAR is available, not in MPICH1
+ if test "$MPI_IMPL" = "MPICH2" ; then
+ AC_DEFINE( HAVE_MPI_UNSIGNED_LONG_LONG, 1,
+ [Define if MPI_UNSIGNED_LONG_LONG exists] )
+ fi
+fi
+
+dnl Check Fortran MPI_Datatype definitions in C
+if test "$MPI_IMPL" != "MPICH" -a "$MPI_IMPL" != "MPICH2" ; then
+ if test "$enable_checkMPI" = "yes" ; then
+ AC_MSG_CHECKING( [for Fortran MPI_Datatype in C] )
+ PAC_MPI_LINK_CC_FUNC( $MPI_CC, [$MPI_CFLAGS], $MPI_LIBS, ,
+ [ MPI_Datatype type ],
+ [
+ type = MPI_COMPLEX;
+ ],
+ [ mpe_link_ok=yes ], [ mpe_link_ok=no ] )
+ if test "$mpe_link_ok" = "yes" ; then
+ AC_MSG_RESULT(yes)
+ AC_DEFINE( HAVE_FORTRAN_MPI_DATATYPE_IN_C, 1,
+ [Define if Fortran MPI_Datatype exists in C] )
+
+dnl Check for MPI_INTEGERx
+ AC_MSG_CHECKING( [for Fortran MPI_Datatype, INTEGER related, in C] )
+ PAC_MPI_LINK_CC_FUNC( $MPI_CC, [$MPI_CFLAGS], $MPI_LIBS, ,
+ [ MPI_Datatype type1, type2, type3, type4 ],
+ [
+ type1 = MPI_INTEGER1;
+ type2 = MPI_INTEGER2;
+ type3 = MPI_INTEGER4;
+ type4 = MPI_INTEGER8;
+ ],
+ [ mpe_link_ok=yes ], [ mpe_link_ok=no ] )
+ if test "$mpe_link_ok" = "yes" ; then
+ AC_MSG_RESULT(yes)
+ AC_DEFINE( HAVE_FORTRAN_MPI_DATATYPE_INTEGERX_IN_C, 1,
+ [Define if Fortran MPI_Datatype, INTEGERs, exist in C] )
+ else
+ AC_MSG_RESULT(no)
+ fi
+
+dnl Check for MPI_REALx
+ AC_MSG_CHECKING( [for Fortran MPI_Datatype, REAL related, in C] )
+ PAC_MPI_LINK_CC_FUNC( $MPI_CC, [$MPI_CFLAGS], $MPI_LIBS, ,
+ [ MPI_Datatype type1, type2 ],
+ [
+ type1 = MPI_REAL4;
+ type2 = MPI_REAL8;
+ ],
+ [ mpe_link_ok=yes ], [ mpe_link_ok=no ] )
+ if test "$mpe_link_ok" = "yes" ; then
+ AC_MSG_RESULT(yes)
+ AC_DEFINE( HAVE_FORTRAN_MPI_DATATYPE_REALX_IN_C, 1,
+ [Define if Fortran MPI_Datatype, REALs, exist in C] )
+ else
+ AC_MSG_RESULT(no)
+ fi
+
+dnl Check for MPI_COMPLEXx
+ AC_MSG_CHECKING( [for Fortran MPI_Datatype, COMPLEXn related, in C] )
+ PAC_MPI_LINK_CC_FUNC( $MPI_CC, [$MPI_CFLAGS], $MPI_LIBS, ,
+ [ MPI_Datatype type1, type2 ],
+ [
+ type1 = MPI_COMPLEX8;
+ type2 = MPI_COMPLEX16;
+ ],
+ [ mpe_link_ok=yes ], [ mpe_link_ok=no ] )
+ if test "$mpe_link_ok" = "yes" ; then
+ AC_MSG_RESULT(yes)
+ AC_DEFINE( HAVE_FORTRAN_MPI_DATATYPE_COMPLEXX_IN_C, 1,
+ [Define if Fortran MPI_Datatype, COMPLEXs, exist in C] )
+ else
+ AC_MSG_RESULT(no)
+ fi
+
+dnl Check for MPI_2COMPLEXxxx
+ AC_MSG_CHECKING( [for Fortran MPI_Datatype, 2COMPLEX related, in C] )
+ PAC_MPI_LINK_CC_FUNC( $MPI_CC, [$MPI_CFLAGS], $MPI_LIBS, ,
+ [ MPI_Datatype type1, type2 ],
+ [
+ type1 = MPI_2COMPLEX;
+ type2 = MPI_2DOUBLE_COMPLEX;
+ ],
+ [ mpe_link_ok=yes ], [ mpe_link_ok=no ] )
+ if test "$mpe_link_ok" = "yes" ; then
+ AC_MSG_RESULT(yes)
+ AC_DEFINE( HAVE_FORTRAN_MPI_DATATYPE_2COMPLEX_IN_C, 1,
+ [Define if Fortran MPI_Datatype, 2COMPLEX, exist in C] )
+ else
+ AC_MSG_RESULT(no)
+ fi
+
+ else
+
+dnl if HAVE_FORTRAN_MPI_DATATYPE_IN_C is false
+ AC_MSG_RESULT(no)
+ AC_MSG_CHECKING( [for LAM/MPI Fortran MPI_Datatype in C] )
+ PAC_MPI_LINK_CC_FUNC( $MPI_CC, [$MPI_CFLAGS], $MPI_LIBS, ,
+ [ MPI_Datatype type ],
+ [
+#define MPI_COMPLEX ((MPI_Datatype) &lam_mpi_cplex)
+ type = MPI_COMPLEX;
+ ],
+ [ mpe_link_ok=yes ], [ mpe_link_ok=no ] )
+ if test "$mpe_link_ok" = "yes" ; then
+ AC_MSG_RESULT(yes)
+ AC_DEFINE( HAVE_LAM_FORTRAN_MPI_DATATYPE_IN_C, 1,
+ [Define if LAM Fortran MPI_Datatype exists in C] )
+ AC_DEFINE( HAVE_FORTRAN_MPI_DATATYPE_IN_C, 1,
+ [Define if Fortran MPI_Datatype exists in C] )
+ AC_DEFINE( HAVE_FORTRAN_MPI_DATATYPE_INTEGERX_IN_C, 1,
+ [Define if Fortran MPI_Datatype, INTEGERs, exist in C] )
+ AC_DEFINE( HAVE_FORTRAN_MPI_DATATYPE_REALX_IN_C, 1,
+ [Define if Fortran MPI_Datatype, REALs, exist in C] )
+ else
+ AC_MSG_RESULT(no)
+ fi
+ fi
+ fi
+else
+dnl if MPICH2, assume all Fortran MPI_Datatypes are available in C
+dnl if MPICH1, assume only basic Fortran MPI_Datatypes are available in C
+dnl if MPICH2, assume 2COMPLEX is *not* available (default as of 1.3x)
+ if test "$MPI_IMPL" = "MPICH2" ; then
+ AC_DEFINE( HAVE_FORTRAN_MPI_DATATYPE_IN_C, 1,
+ [Define if Fortran MPI_Datatype exists in C] )
+ AC_DEFINE( HAVE_FORTRAN_MPI_DATATYPE_INTEGERX_IN_C, 1,
+ [Define if Fortran MPI_Datatype, INTEGERs, exist in C] )
+ AC_DEFINE( HAVE_FORTRAN_MPI_DATATYPE_REALX_IN_C, 1,
+ [Define if Fortran MPI_Datatype, REALs, exist in C] )
+ AC_DEFINE( HAVE_FORTRAN_MPI_DATATYPE_COMPLEXX_IN_C, 1,
+ [Define if Fortran MPI_Datatype, COMPLEXs, exist in C] )
+ else
+ AC_DEFINE( HAVE_FORTRAN_MPI_DATATYPE_IN_C, 1,
+ [Define if Fortran MPI_Datatype exists in C] )
+ fi
+fi
+
+dnl Check if MPI_Datatype is pointer or int
+if test "$MPI_IMPL" != "MPICH" -a "$MPI_IMPL" != "MPICH2" ; then
+ if test "$enable_checkMPI" = "yes" ; then
+ AC_MSG_CHECKING( [for MPI_Datatype] )
+ PAC_MPI_LINK_CC_FUNC( $MPI_CC, [$MPI_CFLAGS], $MPI_LIBS, ,
+ [ MPI_Datatype type ],
+ [ type = type / 5 ],
+ [ mpe_link_ok=yes ], [ mpe_link_ok=no ] )
+ if test "$mpe_link_ok" = "yes" ; then
+ AC_MSG_RESULT([int])
+ AC_DEFINE( HAVE_INT_MPI_DATATYPE, 1,
+ [Define if MPI_Datatype is int] )
+ else
+ AC_MSG_RESULT([void*])
+ AC_DEFINE( HAVE_PTR_MPI_DATATYPE, 1,
+ [Define if MPI_Datatype is void*] )
+ fi
+ fi
+else
+dnl if MPICH2 or MPICH1, assume MPI_Datatype is int
+ AC_DEFINE( HAVE_INT_MPI_DATATYPE, 1,
+ [Define if MPI_Datatype is int] )
+fi
+
+
+dnl Check MPI_Exscan
+if test "$MPI_IMPL" != "MPICH" -a "$MPI_IMPL" != "MPICH2" ; then
+ if test "$enable_checkMPI" = "yes" ; then
+ AC_MSG_CHECKING( [for the C version of MPI_Exscan] )
+ PAC_MPI_LINK_CC_FUNC( $MPI_CC, [$MPI_CFLAGS], $MPI_LIBS, ,
+ [ int itmp, ibuff ],
+ [
+ itmp=MPI_Exscan( &ibuff, &ibuff, 1, MPI_INT, MPI_SUM, MPI_COMM_WORLD )
+ ],
+ [ mpe_link_ok=yes ], [ mpe_link_ok=no ] )
+ if test "$mpe_link_ok" = "yes" ; then
+ AC_MSG_RESULT(yes)
+ AC_MSG_CHECKING( [for the C version of PMPI_Exscan] )
+ PAC_MPI_LINK_CC_FUNC( $MPI_CC, [$MPI_CFLAGS], $MPI_LIBS, ,
+ [ int itmp, ibuff ],
+ [
+ itmp=PMPI_Exscan( &ibuff, &ibuff, 1, MPI_INT, MPI_SUM, MPI_COMM_WORLD )
+ ],
+ [ mpe_link_ok=yes ], [ mpe_link_ok=no ] )
+ if test "$mpe_link_ok" = "yes" ; then
+ AC_MSG_RESULT(yes)
+ COLLCHK_BUILD_EXSCAN=yes
+ else
+ AC_MSG_RESULT(no)
+ COLLCHK_BUILD_EXSCAN=no
+ fi
+ else
+ AC_MSG_RESULT(no)
+ COLLCHK_BUILD_EXSCAN=no
+ fi
+ fi
+else
+dnl if MPICH2, assume MPI_Exscan is available.
+ if test "$MPI_IMPL" = "MPICH2" ; then
+ COLLCHK_BUILD_EXSCAN=yes
+ else
+ COLLCHK_BUILD_EXSCAN=no
+ fi
+fi
+
+dnl Check MPI_Alltoallw
+if test "$MPI_IMPL" != "MPICH" -a "$MPI_IMPL" != "MPICH2" ; then
+ if test "$enable_checkMPI" = "yes" ; then
+ AC_MSG_CHECKING( [for the C version of MPI_Alltoallw] )
+ PAC_MPI_LINK_CC_FUNC( $MPI_CC, [$MPI_CFLAGS], $MPI_LIBS, ,
+ [[
+#define MAX 10
+ int *sbuff, *rbuff;
+ int scounts[MAX], rcounts[MAX], sdispls[MAX], rdispls[MAX];
+ MPI_Datatype stypes[MAX], rtypes[MAX];
+ int itmp
+ ]],
+ [
+ itmp=MPI_Alltoallw( sbuff, scounts, sdispls, stypes,
+ rbuff, rcounts, rdispls, rtypes, MPI_COMM_WORLD )
+ ],
+ [ mpe_link_ok=yes ], [ mpe_link_ok=no ] )
+ if test "$mpe_link_ok" = "yes" ; then
+ AC_MSG_RESULT(yes)
+ AC_MSG_CHECKING( [for the C version of PMPI_Alltoallw] )
+ PAC_MPI_LINK_CC_FUNC( $MPI_CC, [$MPI_CFLAGS], $MPI_LIBS, ,
+ [[
+#define MAX 10
+ int *sbuff, *rbuff;
+ int scounts[MAX], rcounts[MAX], sdispls[MAX], rdispls[MAX];
+ MPI_Datatype stypes[MAX], rtypes[MAX];
+ int itmp
+ ]],
+ [
+ itmp=PMPI_Alltoallw( sbuff, scounts, sdispls, stypes,
+ rbuff, rcounts, rdispls, rtypes, MPI_COMM_WORLD )
+ ],
+ [ mpe_link_ok=yes ], [ mpe_link_ok=no ] )
+ if test "$mpe_link_ok" = "yes" ; then
+ AC_MSG_RESULT(yes)
+ COLLCHK_BUILD_ALLW=yes
+ else
+ AC_MSG_RESULT(no)
+ COLLCHK_BUILD_ALLW=no
+ fi
+ else
+ AC_MSG_RESULT(no)
+ COLLCHK_BUILD_ALLW=no
+ fi
+ fi
+else
+dnl if MPICH2, assume MPI_Exscan is available.
+ if test "$MPI_IMPL" = "MPICH2" ; then
+ COLLCHK_BUILD_ALLW=yes
+ else
+ COLLCHK_BUILD_ALLW=no
+ fi
+fi
+
+dnl Check MPI-IO
+if test "$MPI_IMPL" != "MPICH" -a "$MPI_IMPL" != "MPICH2" ; then
+ if test "$enable_checkMPI" = "yes" -a "$enable_checkMPIO" = "yes" ; then
+ AC_MSG_CHECKING( [for the C version of MPI_File_open()] )
+ PAC_MPI_LINK_CC_FUNC( $MPI_CC, [$MPI_CFLAGS], $MPI_LIBS, ,
+ [ int itmp; MPI_File fh ],
+ [ itmp=MPI_File_open( MPI_COMM_WORLD, "mpiiotest", MPI_MODE_CREATE | MPI_MODE_RDWR, MPI_INFO_NULL, &fh ) ],
+ [ mpe_link_ok=yes ], [ mpe_link_ok=no ] )
+ if test "$mpe_link_ok" = "yes" ; then
+ AC_MSG_RESULT(yes)
+ AC_MSG_CHECKING( [for the C version of PMPI_File_open()] )
+ PAC_MPI_LINK_CC_FUNC( $MPI_CC, [$MPI_CFLAGS], $MPI_LIBS, ,
+ [ int itmp; MPI_File fh ],
+ [ itmp=PMPI_File_open( MPI_COMM_WORLD, "mpiiotest", MPI_MODE_CREATE | MPI_MODE_RDWR, MPI_INFO_NULL, &fh ) ],
+ [ mpe_link_ok=yes ], [ mpe_link_ok=no ] )
+ if test "$mpe_link_ok" = "yes" ; then
+ AC_MSG_RESULT(yes)
+ AC_MSG_CHECKING( [for ROMIO's MPIO_Request] )
+ PAC_MPI_LINK_CC_FUNC( $MPI_CC, [$MPI_CFLAGS], $MPI_LIBS, ,
+ [ MPIO_Request io_request], ,
+ [ mpe_link_ok=yes ], [ mpe_link_ok=no ] )
+ if test "$mpe_link_ok" = "yes" ; then
+ AC_MSG_RESULT(yes)
+ COLLCHK_BUILD_IO=yes
+ AC_DEFINE( HAVE_MPI_IO, 1,
+ [Define if MPI-IO routines exist.] )
+ else
+ AC_MSG_RESULT(no)
+ COLLCHK_BUILD_IO=no
+ fi
+ else
+ AC_MSG_RESULT([no, assumed No MPI-IO routines])
+ COLLCHK_BUILD_IO=no
+ fi
+ else
+ AC_MSG_RESULT([no, assumed No MPI-IO routines])
+ COLLCHK_BUILD_IO=no
+ fi
+ fi
+else
+dnl When built with MPICHx, MPE configure observes --with-mpiio & --enable-romio
+dnl if test \( "$MPI_IMPL" = "MPICH" -o "$MPI_IMPL" = "MPICH2" \) \
+ if test "$with_mpiio" = "yes" ; then
+ COLLCHK_BUILD_IO=yes
+ AC_DEFINE( HAVE_MPI_IO, 1, [Define if MPI-IO routines exist.] )
+ else
+ COLLCHK_BUILD_IO=no
+ fi
+fi
+
+dnl Check MPI-RMA
+if test "$MPI_IMPL" != "MPICH" -a "$MPI_IMPL" != "MPICH2" ; then
+ if test "$enable_checkMPI" = "yes" ; then
+ AC_MSG_CHECKING( [for the C version of MPI_Win_create] )
+ PAC_MPI_LINK_CC_FUNC( $MPI_CC, [$MPI_CFLAGS], $MPI_LIBS, ,
+ [ int itmp; MPI_Win win ],
+ [
+ itmp=MPI_Win_create( NULL, 0, 1, MPI_INFO_NULL, MPI_COMM_WORLD, &win )
+ ],
+ [ mpe_link_ok=yes ], [ mpe_link_ok=no ] )
+ if test "$mpe_link_ok" = "yes" ; then
+ AC_MSG_RESULT(yes)
+ AC_MSG_CHECKING( [for the C version of PMPI_Win_create] )
+ PAC_MPI_LINK_CC_FUNC( $MPI_CC, [$MPI_CFLAGS], $MPI_LIBS, ,
+ [ int itmp; MPI_Win win ],
+ [
+ itmp=PMPI_Win_create( NULL, 0, 1, MPI_INFO_NULL, MPI_COMM_WORLD, &win )
+ ],
+ [ mpe_link_ok=yes ], [ mpe_link_ok=no ] )
+ if test "$mpe_link_ok" = "yes" ; then
+ AC_MSG_RESULT(yes)
+ COLLCHK_BUILD_RMA=yes
+ AC_DEFINE( HAVE_MPI_RMA, 1,
+ [Define if MPI-RMA routines exist.] )
+ else
+ AC_MSG_RESULT([no, assumed No MPI-RMA routines])
+ COLLCHK_BUILD_RMA=no
+ fi
+ else
+ AC_MSG_RESULT([no, assumed No MPI-RMA routines])
+ COLLCHK_BUILD_RMA=no
+ fi
+ fi
+else
+dnl if MPICH2, assume MPI-RMA is available.
+ if test "$MPI_IMPL" = "MPICH2" ; then
+ COLLCHK_BUILD_RMA=yes
+ AC_DEFINE( HAVE_MPI_RMA, 1, [Define if MPI-RMA routines exist.] )
+ else
+ COLLCHK_BUILD_RMA=no
+ fi
+fi
+
+dnl Check MPI-COMMS
+if test "$MPI_IMPL" != "MPICH" -a "$MPI_IMPL" != "MPICH2" ; then
+ if test "$enable_checkMPI" = "yes" ; then
+ AC_MSG_CHECKING( [for the C version of MPI_Comm_spawn] )
+ PAC_MPI_LINK_CC_FUNC( $MPI_CC, [$MPI_CFLAGS], $MPI_LIBS, ,
+ [ MPI_Comm intercomm;
+ int itmp, np=1, ierrs; ],
+ [
+ itmp=MPI_Comm_spawn( "./test", MPI_ARGV_NULL, np, MPI_INFO_NULL, 0,
+ MPI_COMM_WORLD, &intercomm, &ierrs )
+ ],
+ [ mpe_link_ok=yes ], [ mpe_link_ok=no ] )
+ if test "$mpe_link_ok" = "yes" ; then
+ AC_MSG_RESULT(yes)
+ AC_MSG_CHECKING( [for the C version of PMPI_Comm_spawn] )
+ PAC_MPI_LINK_CC_FUNC( $MPI_CC, [$MPI_CFLAGS], $MPI_LIBS, ,
+ [ MPI_Comm intercomm;
+ int itmp, np=1, ierrs; ],
+ [
+ itmp=PMPI_Comm_spawn( "./test", MPI_ARGV_NULL, np, MPI_INFO_NULL, 0,
+ MPI_COMM_WORLD, &intercomm, &ierrs )
+ ],
+ [ mpe_link_ok=yes ], [ mpe_link_ok=no ] )
+ if test "$mpe_link_ok" = "yes" ; then
+ AC_MSG_RESULT(yes)
+ COLLCHK_BUILD_COMMS=yes
+ AC_DEFINE( HAVE_MPI_COMMS, 1,
+ [Define if MPI-RMA routines exist.] )
+ else
+ AC_MSG_RESULT([no, assumed No MPI-COMMS routines])
+ COLLCHK_BUILD_COMMS=no
+ fi
+ else
+ AC_MSG_RESULT([no, assumed No MPI-COMMS routines])
+ COLLCHK_BUILD_COMMS=no
+ fi
+ fi
+else
+dnl if MPICH2, assume MPI_COMMS is available.
+ if test "$MPI_IMPL" = "MPICH2" ; then
+ COLLCHK_BUILD_COMMS=yes
+ AC_DEFINE( HAVE_MPI_COMMS, 1, [Define if MPI-RMA routines exist.] )
+ else
+ COLLCHK_BUILD_COMMS=no
+ fi
+fi
+
+AC_SUBST(COLLCHK_BUILD_EXSCAN)
+AC_SUBST(COLLCHK_BUILD_ALLW)
+AC_SUBST(COLLCHK_BUILD_IO)
+AC_SUBST(COLLCHK_BUILD_RMA)
+AC_SUBST(COLLCHK_BUILD_COMMS)
+
+AC_SUBST(MPI_IMPL)
+AC_SUBST(MPE_BUILD_FORTRAN2C)
+AC_SUBST(CC)
+AC_SUBST(CLINKER)
+AC_SUBST(CFLAGS)
+AC_SUBST(MPI_CC)
+AC_SUBST(MPE_CLINKER)
+AC_SUBST(F77)
+AC_SUBST(FLINKER)
+AC_SUBST(FFLAGS)
+AC_SUBST(MPI_F77)
+AC_SUBST(MPE_FLINKER)
+AC_SUBST(FINC_PATH_LEADER)
+AC_SUBST(FLIB_PATH_LEADER)
+AC_SUBST(MPI_CFLAGS)
+AC_SUBST(MPI_FFLAGS)
+AC_SUBST(MPI_LIBS)
+
+AC_SUBST(COLLCHK_LIBNAME)
+AC_SUBST(COLLCHK_LIBS)
+AC_SUBST(F2CMPI_LIBS)
+
+AC_OUTPUT( Makefile src/Makefile test/Makefile \
+ etc/mpe_mpicheck.conf )
Deleted: mpich2/trunk/src/mpe2/src/collchk/configure.in
===================================================================
--- mpich2/trunk/src/mpe2/src/collchk/configure.in 2012-02-28 23:25:23 UTC (rev 9547)
+++ mpich2/trunk/src/mpe2/src/collchk/configure.in 2012-02-28 23:26:34 UTC (rev 9548)
@@ -1,800 +0,0 @@
-dnl
-dnl Caching is usually WRONG for systems with cross-mounted file systems
-dnl (the cache file may correspond to a different system). Since configure
-dnl is not on a performance-critical path, go for robustness over speed.
-dnl
-define([AC_CACHE_LOAD], )dnl
-define([AC_CACHE_SAVE], )dnl
-dnl
-dnl
-AC_INIT()
-AC_PREREQ(2.52)
-AC_CONFIG_HEADER(mpe_collchk_conf.h)
-dnl
-echo "Configuring MPE Collective and Datatype Checking Library with $ac_configure_args"
-dnl
-dnl Set top_srcdir_abs to be the ABSOLUTE path to the home directory of MPE
-dnl top_srcdir is in relative path.
-if test "X$srcdir" != "X." -a -s $srcdir/include/collchk.h ; then
- top_srcdir_abs=$srcdir
-else
- PAC_GETWD( top_srcdir_abs, include/collchk.h )
-fi
-AC_SUBST(top_srcdir_abs)
-
-AC_ARG_ENABLE( echo,
-[--enable-echo - Turn on strong echoing.
- The default is enable=no.],
-set -x )
-
-AC_ARG_ENABLE( softerror,
-[--enable-softerror - Turn on soft error, i.e. instead of
- issuing MSG_ERROR, MSG_WARN + exit 0
- are used. The default is enable=no.],
-, enable_softerror=${mpe_enable_softerror:-no} )
-
-MAKE=${MAKE:-make}
-MPI_IMPL=${MPI_IMPL:-UserSupplied}
-MPE_BUILD_FORTRAN2C=${MPE_BUILD_FORTRAN2C:-no}
-CC=${CC:-cc}
-CLINKER=${CLINKER:-$CC}
-CFLAGS=${MPE_CFLAGS}
-MPI_CC=${MPI_CC:-${CC}}
-MPE_CLINKER=${MPE_CLINKER}
-F77=${F77:-f77}
-FLINKER=${FLINKER:-$F77}
-FFLAGS=${MPE_FFLAGS}
-MPI_F77=${MPI_F77:-${F77}}
-MPE_FLINKER=${MPE_FLINKER}
-FINC_PATH_LEADER=${FINC_PATH_LEADER:-"-I"}
-FLIB_PATH_LEADER=${FLIB_PATH_LEADER:-"-L"}
-MPI_CFLAGS=${MPI_CFLAGS}
-MPI_FFLAGS=${MPI_FFLAGS}
-MPI_LIBS=${MPI_LIBS}
-
-MPE_LIBNAME=${MPE_LIBNAME:-mpe}
-PROF_LIBNAME="$MPE_LIBNAME"
-COLLCHK_LIBNAME="${MPE_LIBNAME}_collchk"
-F2CMPI_LIBNAME="${MPE_LIBNAME}_f2cmpi"
-
-PROF_LIBS="-l$PROF_LIBNAME"
-COLLCHK_LIBS="-l$COLLCHK_LIBNAME $PROF_LIBS"
-F2CMPI_LIBS="-l$F2CMPI_LIBNAME"
-
-dnl Fixup for make
-PAC_MAKE_IS_GNUMAKE
-PAC_MAKE_IS_BSD44
-PAC_MAKE_IS_OSF
-PAC_MAKE_VPATH
-AC_SUBST(MAKE)
-
-dnl If we are relying on vpath and no vpath is set, then we must exit
-if test ! -s include/collchk.h -a -z "$VPATH" ; then
- AC_MSG_ERROR( [No virtual MAKE path command found.
- You may need to set your make command
- The GNU make (sometimes available as gnumake) can be used.] )
-fi
-
-dnl CPRP is the version of cp that accepts -r and -p arguments.
-MKDIR=mkdir
-CPRP=cp
-RM=rm
-MV=mv
-AC_SUBST(MKDIR)
-AC_SUBST(CPRP)
-AC_SUBST(RM)
-AC_SUBST(MV)
-
-AC_ARG_WITH( mpiio,
-[--with-mpiio - Enable/Disable MPI-IO checking.
- in MPICHx buiid. The default is yes.], ,
-with_mpiio=yes )
-
-AC_ARG_ENABLE( romio,
-[--enable-romio - Enable/Disable ROMIO MPI-IO checking
- in MPICHx build. The default is yes.] ,
-with_mpiio=$enableval,
-with_mpiio=yes )
-
-AC_ARG_ENABLE( checkMPI,
-[--enable-checkMPI - Turn on/off the linking test for the MPI
- include files, MPI libraries and MPI_CC
- compiler. The default is enable=yes.], ,
-enable_checkMPI=yes )
-
-AC_ARG_WITH( checkMPIO,
-[--enable-checkMPIO - Turn on/off the linking test for MPI-IO
- routines in MPI implementation.
- The default is enable=yes.], ,
-enable_checkMPIO=yes )
-
-AC_ARG_WITH( f2cmpilibs,
-[--with-f2cmpilibs=F2CMPI_LIBS - compiler's library flags for
- Fortran to C MPI wrapper library.
- Using this option disables building of
- MPE's internal Fortran to C MPI library,
- --disable-f2cmpilib. The library is
- needed for profiling MPI Fortran program.
- e.g. "-lfmpich" when MPE is building with
- MPICH.],
-F2CMPI_LIBS="$withval" )
-
-if test -z "$nonopt" ; then nonopt=NONE ; fi
-AC_CANONICAL_HOST
-
-dnl Set the various build directories from their mpe_ prefixed env variables.
-dnl
-dnl includebuild_dir is for all user header files
-dnl libbuild_dir is used to build the libraries in before they are installed.
-dnl binbuild_dir is for the scripts/programs
-dnl sbinbuild_dir is for all system admin tools
-dnl etcbuild_dir is for all system admin configuration settings
-dnl
-rootbuild_dir=`pwd`
-for dir in include lib bin sbin etc ; do
- dirname=${dir}build_dir
- mpe_dirname=mpe_${dirname}
- eval dirvalue=\$"$dirname"
- eval $dirname=\$\{${mpe_dirname}\}
-done
-
-for dir in include lib bin sbin etc ; do
- dirname=${dir}build_dir
- eval dirvalue=\$"$dirname"
- if test -n "$dirvalue" ; then
- if test ! -d $dirvalue ; then
- if mkdir -p $dirvalue ; then
- :
- else
- PAC_MSG_ERROR( $enable_softerror,
- [Could not create directory $dirvalue] )
- fi
- fi
- fi
-done
-
-AC_SUBST(includebuild_dir)
-AC_SUBST(libbuild_dir)
-AC_SUBST(binbuild_dir)
-AC_SUBST(sbinbuild_dir)
-AC_SUBST(etcbuild_dir)
-
-AC_PROG_CC
-AC_OBJEXT
-AC_EXEEXT
-dnl Check for broken handling of common symbols
-dnl PAC_PROG_C_BROKEN_COMMON
-AC_CHECK_PROG(AR, ar, ar, ;)
-AC_PROG_RANLIB
-
-dnl We need to check that this has worked. The autoconf macro is broken
-AC_PROG_CPP
-if test "$CPP" = "/lib/cpp" -a ! -x /lib/cpp ; then
- AC_MSG_ERROR( [configure could not find a working C preprocessor] )
-fi
-
-dnl Invoking AC_CHECK_LIB before AC_PROG_CC makes AC_PROG_CC fail
-dnl in autoconf 2.59
-DEBUG_LIBS=""
-if test "$enable_debugcheck" = "yes" ; then
- AC_CHECK_LIB( efence, malloc, DEBUG_LIBS="-lefence" )
-fi
-AC_SUBST(DEBUG_LIBS)
-
-AC_HEADER_STDC
-AC_C_CONST
-
-dnl Checking Headers
-AC_CHECK_HEADERS( stdio.h stdlib.h string.h unistd.h )
-
-AC_FUNC_ALLOCA
-
-dnl Check MPI_Type_get_envelope() and MPI_Type_get_content()
-if test "$MPI_IMPL" != "MPICH" -a "$MPI_IMPL" != "MPICH2" ; then
- if test "$enable_checkMPI" = "yes" ; then
- AC_MSG_CHECKING( [for MPI_Datatype decoding functions] )
- PAC_MPI_LINK_CC_FUNC( $MPI_CC, [$MPI_CFLAGS], $MPI_LIBS, ,
- [
- int nints, naddrs, ntypes, combiner;
- int *ints;
- MPI_Aint *addrs;
- MPI_Datatype *types;
- MPI_Datatype type;
- int itmp
- ],
- [
- itmp=MPI_Type_get_envelope( type, &nints, &naddrs, &ntypes, &combiner );
- itmp=MPI_Type_get_contents(type, nints, naddrs, ntypes, ints, addrs, types);
- combiner=MPI_COMBINER_NAMED;
- ],
- [ mpe_link_ok=yes ], [ mpe_link_ok=no ] )
- if test "$mpe_link_ok" = "yes" ; then
- AC_MSG_RESULT(yes)
- else
- AC_MSG_RESULT(no)
- PAC_MSG_ERROR( $enable_softerror,
- [Missing MPI_Datatype decoding functions!] )
- fi
- fi
-dnl if MPICH2/MPICH1, assume MPI_Type_get_envelope()/MPI_Type_get_content()
-fi
-
-dnl Check MPI_COMBINER_xxx
-if test "$MPI_IMPL" != "MPICH" -a "$MPI_IMPL" != "MPICH2" ; then
- if test "$enable_checkMPI" = "yes" ; then
- AC_MSG_CHECKING( [for rare MPI_COMBINER_XXX types] )
- PAC_MPI_LINK_CC_FUNC( $MPI_CC, [$MPI_CFLAGS], $MPI_LIBS, ,
- [ int cbr1, cbr2, cbr3, cbr4, cbr5, cbr6; ],
- [
- cbr1=MPI_COMBINER_DUP; cbr2=MPI_COMBINER_F90_COMPLEX;
- cbr3=MPI_COMBINER_INDEXED_BLOCK; cbr4=MPI_COMBINER_HINDEXED_INTEGER;
- cbr5=MPI_COMBINER_STRUCT_INTEGER; cbr6=MPI_COMBINER_SUBARRAY;
- ],
- [ mpe_link_ok=yes ], [ mpe_link_ok=no ] )
- if test "$mpe_link_ok" = "yes" ; then
- AC_MSG_RESULT(yes)
- AC_DEFINE( HAVE_RARE_MPI_COMBINERS, 1,
- [Define if rare MPI_COMBINER_xxx exist] )
- else
- AC_MSG_RESULT(no)
- fi
- fi
-else
-dnl if MPICH2, assume are MPI_COMBINER_XXX are available, not in MPICH1
- if test "$MPI_IMPL" = "MPICH2" ; then
- AC_DEFINE( HAVE_RARE_MPI_COMBINERS, 1,
- [Define if rare MPI_COMBINER_xxx exist] )
- fi
-fi
-
-
-dnl Check MPI_Add_error_class(), MPI_Add_error_code(), MPI_Add_error_string()
-dnl and MPI_Comm_call_errhandler()
-if test "$MPI_IMPL" != "MPICH" -a "$MPI_IMPL" != "MPICH2" ; then
- if test "$enable_checkMPI" = "yes" ; then
- AC_MSG_CHECKING( [for MPI Error functions] )
- PAC_MPI_LINK_CC_FUNC( $MPI_CC, [$MPI_CFLAGS], $MPI_LIBS, ,
- [
- int itmp, err_class, err_code;
- char err_str[]="test";
- ],
- [
- itmp=MPI_Add_error_class( &err_class );
- itmp=MPI_Add_error_code( err_class, &err_code );
- itmp=MPI_Add_error_string( err_code, err_str );
- itmp=MPI_Comm_call_errhandler( MPI_COMM_WORLD, err_code );
- ],
- [ mpe_link_ok=yes ], [ mpe_link_ok=no ] )
- if test "$mpe_link_ok" = "yes" ; then
- AC_MSG_RESULT(yes)
- AC_DEFINE( HAVE_MPI_ERR_FNS, 1,
- [Define if MPI Error functions exist] )
- else
- AC_MSG_RESULT(no)
- fi
- fi
-else
-dnl if MPICH2, assume MPI_IN_PLACE is available, not in MPICH1
- if test "$MPI_IMPL" = "MPICH2" ; then
- AC_DEFINE( HAVE_MPI_ERR_FNS, 1, [Define if MPI Error functions exist] )
- fi
-fi
-
-
-dnl Check MPI_IN_PLACE
-if test "$MPI_IMPL" != "MPICH" -a "$MPI_IMPL" != "MPICH2" ; then
- if test "$enable_checkMPI" = "yes" ; then
- AC_MSG_CHECKING( [for MPI_IN_PLACE] )
- PAC_MPI_LINK_CC_FUNC( $MPI_CC, [$MPI_CFLAGS], $MPI_LIBS, ,
- [ int itmp, iboolean; ],
- [
- itmp=MPI_Allreduce( MPI_IN_PLACE, &iboolean, 1, MPI_INT,
- MPI_LAND, MPI_COMM_WORLD )
- ],
- [ mpe_link_ok=yes ], [ mpe_link_ok=no ] )
- if test "$mpe_link_ok" = "yes" ; then
- AC_MSG_RESULT(yes)
- AC_DEFINE( HAVE_MPI_IN_PLACE, 1, [Define if MPI_IN_PLACE exists] )
- else
- AC_MSG_RESULT(no)
- fi
- fi
-else
-dnl if MPICH2, assume MPI_IN_PLACE is available, not in MPICH1
- if test "$MPI_IMPL" = "MPICH2" ; then
- AC_DEFINE( HAVE_MPI_IN_PLACE, 1, [Define if MPI_IN_PLACE exists] )
- fi
-fi
-
-dnl Check MPI_WCHAR
-if test "$MPI_IMPL" != "MPICH" -a "$MPI_IMPL" != "MPICH2" ; then
- if test "$enable_checkMPI" = "yes" ; then
- AC_MSG_CHECKING( [for MPI_WCHAR] )
- PAC_MPI_LINK_CC_FUNC( $MPI_CC, [$MPI_CFLAGS], $MPI_LIBS, ,
- [ MPI_Datatype type; ],
- [ type = MPI_WCHAR ],
- [ mpe_link_ok=yes ], [ mpe_link_ok=no ] )
- if test "$mpe_link_ok" = "yes" ; then
- AC_MSG_RESULT(yes)
- AC_DEFINE( HAVE_MPI_WCHAR, 1,
- [Define if MPI_WCHAR exists] )
- else
- AC_MSG_RESULT(no)
- fi
- fi
-else
-dnl if MPICH2, assume MPI_SIGNED_CHAR is available, not in MPICH1
- if test "$MPI_IMPL" = "MPICH2" ; then
- AC_DEFINE( HAVE_MPI_WCHAR, 1,
- [Define if MPI_WCHAR exists] )
- fi
-fi
-
-dnl Check MPI_SIGNED_CHAR
-if test "$MPI_IMPL" != "MPICH" -a "$MPI_IMPL" != "MPICH2" ; then
- if test "$enable_checkMPI" = "yes" ; then
- AC_MSG_CHECKING( [for MPI_SIGNED_CHAR] )
- PAC_MPI_LINK_CC_FUNC( $MPI_CC, [$MPI_CFLAGS], $MPI_LIBS, ,
- [ MPI_Datatype type; ],
- [ type = MPI_SIGNED_CHAR ],
- [ mpe_link_ok=yes ], [ mpe_link_ok=no ] )
- if test "$mpe_link_ok" = "yes" ; then
- AC_MSG_RESULT(yes)
- AC_DEFINE( HAVE_MPI_SIGNED_CHAR, 1,
- [Define if MPI_SIGNED_CHAR exists] )
- else
- AC_MSG_RESULT(no)
- fi
- fi
-else
-dnl if MPICH2, assume MPI_SIGNED_CHAR is available, not in MPICH1
- if test "$MPI_IMPL" = "MPICH2" ; then
- AC_DEFINE( HAVE_MPI_SIGNED_CHAR, 1,
- [Define if MPI_SIGNED_CHAR exists] )
- fi
-fi
-
-dnl Check MPI_UNSIGNED_LONG_LONG
-if test "$MPI_IMPL" != "MPICH" -a "$MPI_IMPL" != "MPICH2" ; then
- if test "$enable_checkMPI" = "yes" ; then
- AC_MSG_CHECKING( [for MPI_UNSIGNED_LONG_LONG] )
- PAC_MPI_LINK_CC_FUNC( $MPI_CC, [$MPI_CFLAGS], $MPI_LIBS, ,
- [ MPI_Datatype type; ],
- [ type = MPI_UNSIGNED_LONG_LONG ],
- [ mpe_link_ok=yes ], [ mpe_link_ok=no ] )
- if test "$mpe_link_ok" = "yes" ; then
- AC_MSG_RESULT(yes)
- AC_DEFINE( HAVE_MPI_UNSIGNED_LONG_LONG, 1,
- [Define if MPI_UNSIGNED_LONG_LONG exists] )
- else
- AC_MSG_RESULT(no)
- fi
- fi
-else
-dnl if MPICH2, assume MPI_SIGNED_CHAR is available, not in MPICH1
- if test "$MPI_IMPL" = "MPICH2" ; then
- AC_DEFINE( HAVE_MPI_UNSIGNED_LONG_LONG, 1,
- [Define if MPI_UNSIGNED_LONG_LONG exists] )
- fi
-fi
-
-dnl Check Fortran MPI_Datatype definitions in C
-if test "$MPI_IMPL" != "MPICH" -a "$MPI_IMPL" != "MPICH2" ; then
- if test "$enable_checkMPI" = "yes" ; then
- AC_MSG_CHECKING( [for Fortran MPI_Datatype in C] )
- PAC_MPI_LINK_CC_FUNC( $MPI_CC, [$MPI_CFLAGS], $MPI_LIBS, ,
- [ MPI_Datatype type ],
- [
- type = MPI_COMPLEX;
- ],
- [ mpe_link_ok=yes ], [ mpe_link_ok=no ] )
- if test "$mpe_link_ok" = "yes" ; then
- AC_MSG_RESULT(yes)
- AC_DEFINE( HAVE_FORTRAN_MPI_DATATYPE_IN_C, 1,
- [Define if Fortran MPI_Datatype exists in C] )
-
-dnl Check for MPI_INTEGERx
- AC_MSG_CHECKING( [for Fortran MPI_Datatype, INTEGER related, in C] )
- PAC_MPI_LINK_CC_FUNC( $MPI_CC, [$MPI_CFLAGS], $MPI_LIBS, ,
- [ MPI_Datatype type1, type2, type3, type4 ],
- [
- type1 = MPI_INTEGER1;
- type2 = MPI_INTEGER2;
- type3 = MPI_INTEGER4;
- type4 = MPI_INTEGER8;
- ],
- [ mpe_link_ok=yes ], [ mpe_link_ok=no ] )
- if test "$mpe_link_ok" = "yes" ; then
- AC_MSG_RESULT(yes)
- AC_DEFINE( HAVE_FORTRAN_MPI_DATATYPE_INTEGERX_IN_C, 1,
- [Define if Fortran MPI_Datatype, INTEGERs, exist in C] )
- else
- AC_MSG_RESULT(no)
- fi
-
-dnl Check for MPI_REALx
- AC_MSG_CHECKING( [for Fortran MPI_Datatype, REAL related, in C] )
- PAC_MPI_LINK_CC_FUNC( $MPI_CC, [$MPI_CFLAGS], $MPI_LIBS, ,
- [ MPI_Datatype type1, type2 ],
- [
- type1 = MPI_REAL4;
- type2 = MPI_REAL8;
- ],
- [ mpe_link_ok=yes ], [ mpe_link_ok=no ] )
- if test "$mpe_link_ok" = "yes" ; then
- AC_MSG_RESULT(yes)
- AC_DEFINE( HAVE_FORTRAN_MPI_DATATYPE_REALX_IN_C, 1,
- [Define if Fortran MPI_Datatype, REALs, exist in C] )
- else
- AC_MSG_RESULT(no)
- fi
-
-dnl Check for MPI_COMPLEXx
- AC_MSG_CHECKING( [for Fortran MPI_Datatype, COMPLEXn related, in C] )
- PAC_MPI_LINK_CC_FUNC( $MPI_CC, [$MPI_CFLAGS], $MPI_LIBS, ,
- [ MPI_Datatype type1, type2 ],
- [
- type1 = MPI_COMPLEX8;
- type2 = MPI_COMPLEX16;
- ],
- [ mpe_link_ok=yes ], [ mpe_link_ok=no ] )
- if test "$mpe_link_ok" = "yes" ; then
- AC_MSG_RESULT(yes)
- AC_DEFINE( HAVE_FORTRAN_MPI_DATATYPE_COMPLEXX_IN_C, 1,
- [Define if Fortran MPI_Datatype, COMPLEXs, exist in C] )
- else
- AC_MSG_RESULT(no)
- fi
-
-dnl Check for MPI_2COMPLEXxxx
- AC_MSG_CHECKING( [for Fortran MPI_Datatype, 2COMPLEX related, in C] )
- PAC_MPI_LINK_CC_FUNC( $MPI_CC, [$MPI_CFLAGS], $MPI_LIBS, ,
- [ MPI_Datatype type1, type2 ],
- [
- type1 = MPI_2COMPLEX;
- type2 = MPI_2DOUBLE_COMPLEX;
- ],
- [ mpe_link_ok=yes ], [ mpe_link_ok=no ] )
- if test "$mpe_link_ok" = "yes" ; then
- AC_MSG_RESULT(yes)
- AC_DEFINE( HAVE_FORTRAN_MPI_DATATYPE_2COMPLEX_IN_C, 1,
- [Define if Fortran MPI_Datatype, 2COMPLEX, exist in C] )
- else
- AC_MSG_RESULT(no)
- fi
-
- else
-
-dnl if HAVE_FORTRAN_MPI_DATATYPE_IN_C is false
- AC_MSG_RESULT(no)
- AC_MSG_CHECKING( [for LAM/MPI Fortran MPI_Datatype in C] )
- PAC_MPI_LINK_CC_FUNC( $MPI_CC, [$MPI_CFLAGS], $MPI_LIBS, ,
- [ MPI_Datatype type ],
- [
-#define MPI_COMPLEX ((MPI_Datatype) &lam_mpi_cplex)
- type = MPI_COMPLEX;
- ],
- [ mpe_link_ok=yes ], [ mpe_link_ok=no ] )
- if test "$mpe_link_ok" = "yes" ; then
- AC_MSG_RESULT(yes)
- AC_DEFINE( HAVE_LAM_FORTRAN_MPI_DATATYPE_IN_C, 1,
- [Define if LAM Fortran MPI_Datatype exists in C] )
- AC_DEFINE( HAVE_FORTRAN_MPI_DATATYPE_IN_C, 1,
- [Define if Fortran MPI_Datatype exists in C] )
- AC_DEFINE( HAVE_FORTRAN_MPI_DATATYPE_INTEGERX_IN_C, 1,
- [Define if Fortran MPI_Datatype, INTEGERs, exist in C] )
- AC_DEFINE( HAVE_FORTRAN_MPI_DATATYPE_REALX_IN_C, 1,
- [Define if Fortran MPI_Datatype, REALs, exist in C] )
- else
- AC_MSG_RESULT(no)
- fi
- fi
- fi
-else
-dnl if MPICH2, assume all Fortran MPI_Datatypes are available in C
-dnl if MPICH1, assume only basic Fortran MPI_Datatypes are available in C
-dnl if MPICH2, assume 2COMPLEX is *not* available (default as of 1.3x)
- if test "$MPI_IMPL" = "MPICH2" ; then
- AC_DEFINE( HAVE_FORTRAN_MPI_DATATYPE_IN_C, 1,
- [Define if Fortran MPI_Datatype exists in C] )
- AC_DEFINE( HAVE_FORTRAN_MPI_DATATYPE_INTEGERX_IN_C, 1,
- [Define if Fortran MPI_Datatype, INTEGERs, exist in C] )
- AC_DEFINE( HAVE_FORTRAN_MPI_DATATYPE_REALX_IN_C, 1,
- [Define if Fortran MPI_Datatype, REALs, exist in C] )
- AC_DEFINE( HAVE_FORTRAN_MPI_DATATYPE_COMPLEXX_IN_C, 1,
- [Define if Fortran MPI_Datatype, COMPLEXs, exist in C] )
- else
- AC_DEFINE( HAVE_FORTRAN_MPI_DATATYPE_IN_C, 1,
- [Define if Fortran MPI_Datatype exists in C] )
- fi
-fi
-
-dnl Check if MPI_Datatype is pointer or int
-if test "$MPI_IMPL" != "MPICH" -a "$MPI_IMPL" != "MPICH2" ; then
- if test "$enable_checkMPI" = "yes" ; then
- AC_MSG_CHECKING( [for MPI_Datatype] )
- PAC_MPI_LINK_CC_FUNC( $MPI_CC, [$MPI_CFLAGS], $MPI_LIBS, ,
- [ MPI_Datatype type ],
- [ type = type / 5 ],
- [ mpe_link_ok=yes ], [ mpe_link_ok=no ] )
- if test "$mpe_link_ok" = "yes" ; then
- AC_MSG_RESULT([int])
- AC_DEFINE( HAVE_INT_MPI_DATATYPE, 1,
- [Define if MPI_Datatype is int] )
- else
- AC_MSG_RESULT([void*])
- AC_DEFINE( HAVE_PTR_MPI_DATATYPE, 1,
- [Define if MPI_Datatype is void*] )
- fi
- fi
-else
-dnl if MPICH2 or MPICH1, assume MPI_Datatype is int
- AC_DEFINE( HAVE_INT_MPI_DATATYPE, 1,
- [Define if MPI_Datatype is int] )
-fi
-
-
-dnl Check MPI_Exscan
-if test "$MPI_IMPL" != "MPICH" -a "$MPI_IMPL" != "MPICH2" ; then
- if test "$enable_checkMPI" = "yes" ; then
- AC_MSG_CHECKING( [for the C version of MPI_Exscan] )
- PAC_MPI_LINK_CC_FUNC( $MPI_CC, [$MPI_CFLAGS], $MPI_LIBS, ,
- [ int itmp, ibuff ],
- [
- itmp=MPI_Exscan( &ibuff, &ibuff, 1, MPI_INT, MPI_SUM, MPI_COMM_WORLD )
- ],
- [ mpe_link_ok=yes ], [ mpe_link_ok=no ] )
- if test "$mpe_link_ok" = "yes" ; then
- AC_MSG_RESULT(yes)
- AC_MSG_CHECKING( [for the C version of PMPI_Exscan] )
- PAC_MPI_LINK_CC_FUNC( $MPI_CC, [$MPI_CFLAGS], $MPI_LIBS, ,
- [ int itmp, ibuff ],
- [
- itmp=PMPI_Exscan( &ibuff, &ibuff, 1, MPI_INT, MPI_SUM, MPI_COMM_WORLD )
- ],
- [ mpe_link_ok=yes ], [ mpe_link_ok=no ] )
- if test "$mpe_link_ok" = "yes" ; then
- AC_MSG_RESULT(yes)
- COLLCHK_BUILD_EXSCAN=yes
- else
- AC_MSG_RESULT(no)
- COLLCHK_BUILD_EXSCAN=no
- fi
- else
- AC_MSG_RESULT(no)
- COLLCHK_BUILD_EXSCAN=no
- fi
- fi
-else
-dnl if MPICH2, assume MPI_Exscan is available.
- if test "$MPI_IMPL" = "MPICH2" ; then
- COLLCHK_BUILD_EXSCAN=yes
- else
- COLLCHK_BUILD_EXSCAN=no
- fi
-fi
-
-dnl Check MPI_Alltoallw
-if test "$MPI_IMPL" != "MPICH" -a "$MPI_IMPL" != "MPICH2" ; then
- if test "$enable_checkMPI" = "yes" ; then
- AC_MSG_CHECKING( [for the C version of MPI_Alltoallw] )
- PAC_MPI_LINK_CC_FUNC( $MPI_CC, [$MPI_CFLAGS], $MPI_LIBS, ,
- [[
-#define MAX 10
- int *sbuff, *rbuff;
- int scounts[MAX], rcounts[MAX], sdispls[MAX], rdispls[MAX];
- MPI_Datatype stypes[MAX], rtypes[MAX];
- int itmp
- ]],
- [
- itmp=MPI_Alltoallw( sbuff, scounts, sdispls, stypes,
- rbuff, rcounts, rdispls, rtypes, MPI_COMM_WORLD )
- ],
- [ mpe_link_ok=yes ], [ mpe_link_ok=no ] )
- if test "$mpe_link_ok" = "yes" ; then
- AC_MSG_RESULT(yes)
- AC_MSG_CHECKING( [for the C version of PMPI_Alltoallw] )
- PAC_MPI_LINK_CC_FUNC( $MPI_CC, [$MPI_CFLAGS], $MPI_LIBS, ,
- [[
-#define MAX 10
- int *sbuff, *rbuff;
- int scounts[MAX], rcounts[MAX], sdispls[MAX], rdispls[MAX];
- MPI_Datatype stypes[MAX], rtypes[MAX];
- int itmp
- ]],
- [
- itmp=PMPI_Alltoallw( sbuff, scounts, sdispls, stypes,
- rbuff, rcounts, rdispls, rtypes, MPI_COMM_WORLD )
- ],
- [ mpe_link_ok=yes ], [ mpe_link_ok=no ] )
- if test "$mpe_link_ok" = "yes" ; then
- AC_MSG_RESULT(yes)
- COLLCHK_BUILD_ALLW=yes
- else
- AC_MSG_RESULT(no)
- COLLCHK_BUILD_ALLW=no
- fi
- else
- AC_MSG_RESULT(no)
- COLLCHK_BUILD_ALLW=no
- fi
- fi
-else
-dnl if MPICH2, assume MPI_Exscan is available.
- if test "$MPI_IMPL" = "MPICH2" ; then
- COLLCHK_BUILD_ALLW=yes
- else
- COLLCHK_BUILD_ALLW=no
- fi
-fi
-
-dnl Check MPI-IO
-if test "$MPI_IMPL" != "MPICH" -a "$MPI_IMPL" != "MPICH2" ; then
- if test "$enable_checkMPI" = "yes" -a "$enable_checkMPIO" = "yes" ; then
- AC_MSG_CHECKING( [for the C version of MPI_File_open()] )
- PAC_MPI_LINK_CC_FUNC( $MPI_CC, [$MPI_CFLAGS], $MPI_LIBS, ,
- [ int itmp; MPI_File fh ],
- [ itmp=MPI_File_open( MPI_COMM_WORLD, "mpiiotest", MPI_MODE_CREATE | MPI_MODE_RDWR, MPI_INFO_NULL, &fh ) ],
- [ mpe_link_ok=yes ], [ mpe_link_ok=no ] )
- if test "$mpe_link_ok" = "yes" ; then
- AC_MSG_RESULT(yes)
- AC_MSG_CHECKING( [for the C version of PMPI_File_open()] )
- PAC_MPI_LINK_CC_FUNC( $MPI_CC, [$MPI_CFLAGS], $MPI_LIBS, ,
- [ int itmp; MPI_File fh ],
- [ itmp=PMPI_File_open( MPI_COMM_WORLD, "mpiiotest", MPI_MODE_CREATE | MPI_MODE_RDWR, MPI_INFO_NULL, &fh ) ],
- [ mpe_link_ok=yes ], [ mpe_link_ok=no ] )
- if test "$mpe_link_ok" = "yes" ; then
- AC_MSG_RESULT(yes)
- AC_MSG_CHECKING( [for ROMIO's MPIO_Request] )
- PAC_MPI_LINK_CC_FUNC( $MPI_CC, [$MPI_CFLAGS], $MPI_LIBS, ,
- [ MPIO_Request io_request], ,
- [ mpe_link_ok=yes ], [ mpe_link_ok=no ] )
- if test "$mpe_link_ok" = "yes" ; then
- AC_MSG_RESULT(yes)
- COLLCHK_BUILD_IO=yes
- AC_DEFINE( HAVE_MPI_IO, 1,
- [Define if MPI-IO routines exist.] )
- else
- AC_MSG_RESULT(no)
- COLLCHK_BUILD_IO=no
- fi
- else
- AC_MSG_RESULT([no, assumed No MPI-IO routines])
- COLLCHK_BUILD_IO=no
- fi
- else
- AC_MSG_RESULT([no, assumed No MPI-IO routines])
- COLLCHK_BUILD_IO=no
- fi
- fi
-else
-dnl When built with MPICHx, MPE configure observes --with-mpiio & --enable-romio
-dnl if test \( "$MPI_IMPL" = "MPICH" -o "$MPI_IMPL" = "MPICH2" \) \
- if test "$with_mpiio" = "yes" ; then
- COLLCHK_BUILD_IO=yes
- AC_DEFINE( HAVE_MPI_IO, 1, [Define if MPI-IO routines exist.] )
- else
- COLLCHK_BUILD_IO=no
- fi
-fi
-
-dnl Check MPI-RMA
-if test "$MPI_IMPL" != "MPICH" -a "$MPI_IMPL" != "MPICH2" ; then
- if test "$enable_checkMPI" = "yes" ; then
- AC_MSG_CHECKING( [for the C version of MPI_Win_create] )
- PAC_MPI_LINK_CC_FUNC( $MPI_CC, [$MPI_CFLAGS], $MPI_LIBS, ,
- [ int itmp; MPI_Win win ],
- [
- itmp=MPI_Win_create( NULL, 0, 1, MPI_INFO_NULL, MPI_COMM_WORLD, &win )
- ],
- [ mpe_link_ok=yes ], [ mpe_link_ok=no ] )
- if test "$mpe_link_ok" = "yes" ; then
- AC_MSG_RESULT(yes)
- AC_MSG_CHECKING( [for the C version of PMPI_Win_create] )
- PAC_MPI_LINK_CC_FUNC( $MPI_CC, [$MPI_CFLAGS], $MPI_LIBS, ,
- [ int itmp; MPI_Win win ],
- [
- itmp=PMPI_Win_create( NULL, 0, 1, MPI_INFO_NULL, MPI_COMM_WORLD, &win )
- ],
- [ mpe_link_ok=yes ], [ mpe_link_ok=no ] )
- if test "$mpe_link_ok" = "yes" ; then
- AC_MSG_RESULT(yes)
- COLLCHK_BUILD_RMA=yes
- AC_DEFINE( HAVE_MPI_RMA, 1,
- [Define if MPI-RMA routines exist.] )
- else
- AC_MSG_RESULT([no, assumed No MPI-RMA routines])
- COLLCHK_BUILD_RMA=no
- fi
- else
- AC_MSG_RESULT([no, assumed No MPI-RMA routines])
- COLLCHK_BUILD_RMA=no
- fi
- fi
-else
-dnl if MPICH2, assume MPI-RMA is available.
- if test "$MPI_IMPL" = "MPICH2" ; then
- COLLCHK_BUILD_RMA=yes
- AC_DEFINE( HAVE_MPI_RMA, 1, [Define if MPI-RMA routines exist.] )
- else
- COLLCHK_BUILD_RMA=no
- fi
-fi
-
-dnl Check MPI-COMMS
-if test "$MPI_IMPL" != "MPICH" -a "$MPI_IMPL" != "MPICH2" ; then
- if test "$enable_checkMPI" = "yes" ; then
- AC_MSG_CHECKING( [for the C version of MPI_Comm_spawn] )
- PAC_MPI_LINK_CC_FUNC( $MPI_CC, [$MPI_CFLAGS], $MPI_LIBS, ,
- [ MPI_Comm intercomm;
- int itmp, np=1, ierrs; ],
- [
- itmp=MPI_Comm_spawn( "./test", MPI_ARGV_NULL, np, MPI_INFO_NULL, 0,
- MPI_COMM_WORLD, &intercomm, &ierrs )
- ],
- [ mpe_link_ok=yes ], [ mpe_link_ok=no ] )
- if test "$mpe_link_ok" = "yes" ; then
- AC_MSG_RESULT(yes)
- AC_MSG_CHECKING( [for the C version of PMPI_Comm_spawn] )
- PAC_MPI_LINK_CC_FUNC( $MPI_CC, [$MPI_CFLAGS], $MPI_LIBS, ,
- [ MPI_Comm intercomm;
- int itmp, np=1, ierrs; ],
- [
- itmp=PMPI_Comm_spawn( "./test", MPI_ARGV_NULL, np, MPI_INFO_NULL, 0,
- MPI_COMM_WORLD, &intercomm, &ierrs )
- ],
- [ mpe_link_ok=yes ], [ mpe_link_ok=no ] )
- if test "$mpe_link_ok" = "yes" ; then
- AC_MSG_RESULT(yes)
- COLLCHK_BUILD_COMMS=yes
- AC_DEFINE( HAVE_MPI_COMMS, 1,
- [Define if MPI-RMA routines exist.] )
- else
- AC_MSG_RESULT([no, assumed No MPI-COMMS routines])
- COLLCHK_BUILD_COMMS=no
- fi
- else
- AC_MSG_RESULT([no, assumed No MPI-COMMS routines])
- COLLCHK_BUILD_COMMS=no
- fi
- fi
-else
-dnl if MPICH2, assume MPI_COMMS is available.
- if test "$MPI_IMPL" = "MPICH2" ; then
- COLLCHK_BUILD_COMMS=yes
- AC_DEFINE( HAVE_MPI_COMMS, 1, [Define if MPI-RMA routines exist.] )
- else
- COLLCHK_BUILD_COMMS=no
- fi
-fi
-
-AC_SUBST(COLLCHK_BUILD_EXSCAN)
-AC_SUBST(COLLCHK_BUILD_ALLW)
-AC_SUBST(COLLCHK_BUILD_IO)
-AC_SUBST(COLLCHK_BUILD_RMA)
-AC_SUBST(COLLCHK_BUILD_COMMS)
-
-AC_SUBST(MPI_IMPL)
-AC_SUBST(MPE_BUILD_FORTRAN2C)
-AC_SUBST(CC)
-AC_SUBST(CLINKER)
-AC_SUBST(CFLAGS)
-AC_SUBST(MPI_CC)
-AC_SUBST(MPE_CLINKER)
-AC_SUBST(F77)
-AC_SUBST(FLINKER)
-AC_SUBST(FFLAGS)
-AC_SUBST(MPI_F77)
-AC_SUBST(MPE_FLINKER)
-AC_SUBST(FINC_PATH_LEADER)
-AC_SUBST(FLIB_PATH_LEADER)
-AC_SUBST(MPI_CFLAGS)
-AC_SUBST(MPI_FFLAGS)
-AC_SUBST(MPI_LIBS)
-
-AC_SUBST(COLLCHK_LIBNAME)
-AC_SUBST(COLLCHK_LIBS)
-AC_SUBST(F2CMPI_LIBS)
-
-AC_OUTPUT( Makefile src/Makefile test/Makefile \
- etc/mpe_mpicheck.conf )
Copied: mpich2/trunk/src/mpe2/src/graphics/configure.ac (from rev 9546, mpich2/trunk/src/mpe2/src/graphics/configure.in)
===================================================================
--- mpich2/trunk/src/mpe2/src/graphics/configure.ac (rev 0)
+++ mpich2/trunk/src/mpe2/src/graphics/configure.ac 2012-02-28 23:26:34 UTC (rev 9548)
@@ -0,0 +1,270 @@
+dnl
+dnl Caching is usually WRONG for systems with cross-mounted file systems
+dnl (the cache file may correspond to a different system). Since configure
+dnl is not on a performance-critical path, go for robustness over speed.
+dnl
+define([AC_CACHE_LOAD], )dnl
+define([AC_CACHE_SAVE], )dnl
+dnl
+dnl
+AC_INIT()
+AC_PREREQ(2.52)
+AC_CONFIG_HEADER(mpe_graphics_conf.h)
+dnl
+echo "Configuring MPE X Graphics Library with $ac_configure_args"
+dnl
+dnl Set top_srcdir_abs to be the ABSOLUTE path to the home directory of MPE
+dnl top_srcdir is in relative path.
+if test "X$srcdir" != "X." -a -s $srcdir/include/mpe_graphics.h ; then
+ top_srcdir_abs=$srcdir
+else
+ PAC_GETWD( top_srcdir_abs, include/mpe_graphics.h )
+fi
+AC_SUBST(top_srcdir_abs)
+
+AC_ARG_ENABLE( echo,
+[--enable-echo - Turn on strong echoing.
+ The default is enable=no.],
+set -x )
+
+AC_ARG_ENABLE( softerror,
+[--enable-softerror - Turn on soft error, i.e. instead of
+ issuing MSG_ERROR, MSG_WARN + exit 0
+ are used. The default is enable=no.],
+, enable_softerror=${mpe_enable_softerror:-no} )
+
+MAKE=${MAKE:-make}
+MPI_IMPL=${MPI_IMPL:-UserSupplied}
+MPE_BUILD_FORTRAN2C=${MPE_BUILD_FORTRAN2C:-no}
+CC=${CC:-cc}
+CLINKER=${CLINKER:-$CC}
+CFLAGS=${MPE_CFLAGS}
+MPI_CC=${MPI_CC:-${CC}}
+MPE_CLINKER=${MPE_CLINKER}
+F77=${F77:-f77}
+FLINKER=${FLINKER:-$F77}
+FFLAGS=${MPE_FFLAGS}
+MPI_F77=${MPI_F77:-${F77}}
+MPE_FLINKER=${MPE_FLINKER}
+FINC_PATH_LEADER=${FINC_PATH_LEADER:-"-I"}
+FLIB_PATH_LEADER=${FLIB_PATH_LEADER:-"-L"}
+MPI_CFLAGS=${MPI_CFLAGS}
+MPI_FFLAGS=${MPI_FFLAGS}
+MPI_LIBS=${MPI_LIBS}
+
+MPE_LIBNAME=${MPE_LIBNAME:-mpe}
+PROF_LIBNAME="$MPE_LIBNAME"
+ANIM_LIBNAME="a$MPE_LIBNAME"
+
+PROF_LIBS="-l$PROF_LIBNAME"
+ANIM_LIBS="-l$ANIM_LIBNAME $PROF_LIBS"
+XGRAPH_LIBS="$PROF_LIBS"
+
+
+dnl Fixup for make
+PAC_MAKE_IS_GNUMAKE
+PAC_MAKE_IS_BSD44
+PAC_MAKE_IS_OSF
+PAC_MAKE_VPATH
+AC_SUBST(MAKE)
+
+dnl If we are relying on vpath and no vpath is set, then we must exit
+if test ! -s include/mpe_graphics.h -a -z "$VPATH" ; then
+ AC_MSG_ERROR( [No virtual MAKE path command found.
+ You may need to set your make command
+ The GNU make (sometimes available as gnumake) can be used.] )
+fi
+
+dnl CPRP is the version of cp that accepts -r and -p arguments.
+MKDIR=mkdir
+CPRP=cp
+RM=rm
+MV=mv
+AC_SUBST(MKDIR)
+AC_SUBST(CPRP)
+AC_SUBST(RM)
+AC_SUBST(MV)
+
+AC_ARG_ENABLE( debugcheck,
+[--enable-debugcheck - Turn on/off the debugging & diagnostic
+ checking code in MPE code.
+ The default is enable=no.] )
+
+dnl Set the various build directories from their mpe_ prefixed env variables.
+dnl
+dnl includebuild_dir is for all user header files
+dnl libbuild_dir is used to build the libraries in before they are installed.
+dnl binbuild_dir is for the scripts/programs
+dnl sbinbuild_dir is for all system admin tools
+dnl etcbuild_dir is for all system admin configuration settings
+dnl
+rootbuild_dir=`pwd`
+for dir in include lib bin sbin etc ; do
+ dirname=${dir}build_dir
+ mpe_dirname=mpe_${dirname}
+ eval dirvalue=\$"$dirname"
+ eval $dirname=\$\{${mpe_dirname}\}
+done
+
+for dir in include lib bin sbin etc ; do
+ dirname=${dir}build_dir
+ eval dirvalue=\$"$dirname"
+ if test -n "$dirvalue" ; then
+ if test ! -d $dirvalue ; then
+ if mkdir -p $dirvalue ; then
+ :
+ else
+ PAC_MSG_ERROR( $enable_softerror,
+ [Could not create directory $dirvalue] )
+ fi
+ fi
+ fi
+done
+
+AC_SUBST(includebuild_dir)
+AC_SUBST(libbuild_dir)
+AC_SUBST(binbuild_dir)
+AC_SUBST(sbinbuild_dir)
+AC_SUBST(etcbuild_dir)
+
+AC_PROG_CC
+AC_OBJEXT
+AC_EXEEXT
+dnl Check for broken handling of common symbols
+dnl PAC_PROG_C_BROKEN_COMMON
+AC_CHECK_PROG(AR, ar, ar, ;)
+AC_PROG_RANLIB
+
+AC_PROG_CC_C_O
+# set CC_DOES_C_O to the value of \${ac_cv_prog_cc_${ac_cc}_c_o}
+eval CC_DOES_C_O=\${ac_cv_prog_cc_${ac_cc}_c_o}
+AC_SUBST(CC_DOES_C_O)
+
+dnl We need to check that this has worked. The autoconf macro is broken
+AC_PROG_CPP
+if test "$CPP" = "/lib/cpp" -a ! -x /lib/cpp ; then
+ AC_MSG_ERROR( [configure could not find a working C preprocessor] )
+fi
+
+dnl Invoking AC_CHECK_LIB before AC_PROG_CC makes AC_PROG_CC fail
+dnl in autoconf 2.59
+DEBUG_LIBS=""
+if test "$enable_debugcheck" = "yes" ; then
+ AC_CHECK_LIB( efence, malloc, DEBUG_LIBS="-lefence" )
+fi
+AC_SUBST(DEBUG_LIBS)
+
+AC_PATH_X
+
+dnl AC_PATH_X set no_x=yes if user invokes configure with --without-x,
+dnl or x_includes/x_libraries is/are empty
+if test -z "$no_x" ; then
+ if test -n "$x_includes" ; then
+ X_INC=-I$x_includes
+ fi
+ if test -n "$x_libraries" ; then
+ X_LIB="-L$x_libraries -lX11"
+ ANIM_LIBS="$ANIM_LIBS -L$x_libraries -lX11"
+ XGRAPH_LIBS="$XGRAPH_LIBS -L$x_libraries -lX11"
+ else
+ X_LIB="-lX11"
+ ANIM_LIBS="$ANIM_LIBS -lX11"
+ XGRAPH_LIBS="$XGRAPH_LIBS -lX11"
+ fi
+else
+ PAC_MSG_ERROR( $enable_softerror,
+ [Could not find appropriate X windows libraries. MPE routines that make use of X11 graphics will NOT be built unless you put X windows libraries in your path and reconfigure!] )
+fi
+
+AC_HEADER_STDC
+AC_C_CONST
+
+AC_CHECK_SIZEOF(void *)
+AC_MSG_CHECKING(for long pointer)
+if test "$ac_cv_sizeof_void_p" -gt 4 ; then
+ AC_DEFINE( POINTER_64_BITS, 1, [Define if pointers are 64 bits] )
+ AC_MSG_RESULT([yes])
+else
+ AC_MSG_RESULT([no])
+fi
+
+dnl Checking for specific functions needed for the package.
+AC_HAVE_FUNCS(system)
+
+AC_CHECK_HEADERS( unistd.h stdlib.h string.h )
+
+dnl
+if test "$MPE_BUILD_FORTRAN2C" = "yes" ; then
+
+# Determine MPI_Fint
+ if test "$MPI_IMPL" != "MPICH" -a "$MPI_IMPL" != "MPICH2" ; then
+ AC_MSG_CHECKING( [for MPI_Fint] )
+ PAC_MPI_LINK_CC_FUNC( $MPI_CC, [$MPI_CFLAGS], $MPI_LIBS, ,
+ [ MPI_Fint aa=1 ], ,
+ [ mpe_link_ok=yes ], [ mpe_link_ok=no ] )
+ AC_MSG_RESULT($mpe_link_ok)
+ else
+ # MPICH2,MPICH has MPI_Fint
+ mpe_link_ok=yes
+ fi
+ if test "$mpe_link_ok" = "yes" ; then
+ MPI_FINT_TYPE=MPI_Fint
+ else
+ AC_MSG_RESULT([Assumed MPI_Fint to be int])
+ MPI_FINT_TYPE=int
+ AC_DEFINE( MPI_Fint, int, [Define MPI_Fint as int] )
+ fi
+
+# Determmine if MPI_Comm_f2c() and MPI_Comm_c2f() are there
+ if test "$MPI_IMPL" != "MPICH" -a "$MPI_IMPL" != "MPICH2" ; then
+ AC_MSG_CHECKING( [for MPI_Comm_c2f() and MPI_Comm_f2c()] )
+ PAC_MPI_LINK_CC_FUNC( $MPI_CC, [$MPI_CFLAGS], $MPI_LIBS, , [
+ MPI_Comm comm; ${MPI_FINT_TYPE} aa;
+ ], [
+ aa=MPI_Comm_c2f(comm) ;
+ comm=MPI_Comm_f2c(aa) ;
+ ], [ mpe_link_ok=yes ], [ mpe_link_ok=no ] )
+ AC_MSG_RESULT($mpe_link_ok)
+ else
+ mpe_link_ok=yes
+ fi
+ if test "$mpe_link_ok" = "yes" ; then
+ AC_DEFINE( HAVE_MPI_COMM_F2C, 1,
+ [Define if MPI_Comm_f2c and c2f available] )
+ fi
+fi
+
+if test ! -d contrib ; then mkdir contrib ; fi
+
+AC_SUBST(MPI_IMPL)
+AC_SUBST(MPE_BUILD_FORTRAN2C)
+AC_SUBST(CC)
+AC_SUBST(CLINKER)
+AC_SUBST(CFLAGS)
+AC_SUBST(MPI_CC)
+AC_SUBST(MPE_CLINKER)
+AC_SUBST(F77)
+AC_SUBST(FLINKER)
+AC_SUBST(FFLAGS)
+AC_SUBST(MPI_F77)
+AC_SUBST(MPE_FLINKER)
+AC_SUBST(FINC_PATH_LEADER)
+AC_SUBST(FLIB_PATH_LEADER)
+AC_SUBST(MPI_CFLAGS)
+AC_SUBST(MPI_FFLAGS)
+AC_SUBST(MPI_LIBS)
+
+AC_SUBST(X_INC)
+AC_SUBST(X_LIB)
+AC_SUBST(XGRAPH_LIBS)
+
+AC_SUBST(PROF_LIBNAME)
+AC_SUBST(ANIM_LIBNAME)
+AC_SUBST(PROF_LIBS)
+AC_SUBST(ANIM_LIBS)
+
+
+AC_OUTPUT( Makefile src/Makefile \
+ contrib/life/Makefile contrib/mandel/Makefile \
+ contrib/mastermind/Makefile contrib/test/Makefile \
+ etc/mpe_mpianim.conf etc/mpe_graphics.conf )
Deleted: mpich2/trunk/src/mpe2/src/graphics/configure.in
===================================================================
--- mpich2/trunk/src/mpe2/src/graphics/configure.in 2012-02-28 23:25:23 UTC (rev 9547)
+++ mpich2/trunk/src/mpe2/src/graphics/configure.in 2012-02-28 23:26:34 UTC (rev 9548)
@@ -1,270 +0,0 @@
-dnl
-dnl Caching is usually WRONG for systems with cross-mounted file systems
-dnl (the cache file may correspond to a different system). Since configure
-dnl is not on a performance-critical path, go for robustness over speed.
-dnl
-define([AC_CACHE_LOAD], )dnl
-define([AC_CACHE_SAVE], )dnl
-dnl
-dnl
-AC_INIT()
-AC_PREREQ(2.52)
-AC_CONFIG_HEADER(mpe_graphics_conf.h)
-dnl
-echo "Configuring MPE X Graphics Library with $ac_configure_args"
-dnl
-dnl Set top_srcdir_abs to be the ABSOLUTE path to the home directory of MPE
-dnl top_srcdir is in relative path.
-if test "X$srcdir" != "X." -a -s $srcdir/include/mpe_graphics.h ; then
- top_srcdir_abs=$srcdir
-else
- PAC_GETWD( top_srcdir_abs, include/mpe_graphics.h )
-fi
-AC_SUBST(top_srcdir_abs)
-
-AC_ARG_ENABLE( echo,
-[--enable-echo - Turn on strong echoing.
- The default is enable=no.],
-set -x )
-
-AC_ARG_ENABLE( softerror,
-[--enable-softerror - Turn on soft error, i.e. instead of
- issuing MSG_ERROR, MSG_WARN + exit 0
- are used. The default is enable=no.],
-, enable_softerror=${mpe_enable_softerror:-no} )
-
-MAKE=${MAKE:-make}
-MPI_IMPL=${MPI_IMPL:-UserSupplied}
-MPE_BUILD_FORTRAN2C=${MPE_BUILD_FORTRAN2C:-no}
-CC=${CC:-cc}
-CLINKER=${CLINKER:-$CC}
-CFLAGS=${MPE_CFLAGS}
-MPI_CC=${MPI_CC:-${CC}}
-MPE_CLINKER=${MPE_CLINKER}
-F77=${F77:-f77}
-FLINKER=${FLINKER:-$F77}
-FFLAGS=${MPE_FFLAGS}
-MPI_F77=${MPI_F77:-${F77}}
-MPE_FLINKER=${MPE_FLINKER}
-FINC_PATH_LEADER=${FINC_PATH_LEADER:-"-I"}
-FLIB_PATH_LEADER=${FLIB_PATH_LEADER:-"-L"}
-MPI_CFLAGS=${MPI_CFLAGS}
-MPI_FFLAGS=${MPI_FFLAGS}
-MPI_LIBS=${MPI_LIBS}
-
-MPE_LIBNAME=${MPE_LIBNAME:-mpe}
-PROF_LIBNAME="$MPE_LIBNAME"
-ANIM_LIBNAME="a$MPE_LIBNAME"
-
-PROF_LIBS="-l$PROF_LIBNAME"
-ANIM_LIBS="-l$ANIM_LIBNAME $PROF_LIBS"
-XGRAPH_LIBS="$PROF_LIBS"
-
-
-dnl Fixup for make
-PAC_MAKE_IS_GNUMAKE
-PAC_MAKE_IS_BSD44
-PAC_MAKE_IS_OSF
-PAC_MAKE_VPATH
-AC_SUBST(MAKE)
-
-dnl If we are relying on vpath and no vpath is set, then we must exit
-if test ! -s include/mpe_graphics.h -a -z "$VPATH" ; then
- AC_MSG_ERROR( [No virtual MAKE path command found.
- You may need to set your make command
- The GNU make (sometimes available as gnumake) can be used.] )
-fi
-
-dnl CPRP is the version of cp that accepts -r and -p arguments.
-MKDIR=mkdir
-CPRP=cp
-RM=rm
-MV=mv
-AC_SUBST(MKDIR)
-AC_SUBST(CPRP)
-AC_SUBST(RM)
-AC_SUBST(MV)
-
-AC_ARG_ENABLE( debugcheck,
-[--enable-debugcheck - Turn on/off the debugging & diagnostic
- checking code in MPE code.
- The default is enable=no.] )
-
-dnl Set the various build directories from their mpe_ prefixed env variables.
-dnl
-dnl includebuild_dir is for all user header files
-dnl libbuild_dir is used to build the libraries in before they are installed.
-dnl binbuild_dir is for the scripts/programs
-dnl sbinbuild_dir is for all system admin tools
-dnl etcbuild_dir is for all system admin configuration settings
-dnl
-rootbuild_dir=`pwd`
-for dir in include lib bin sbin etc ; do
- dirname=${dir}build_dir
- mpe_dirname=mpe_${dirname}
- eval dirvalue=\$"$dirname"
- eval $dirname=\$\{${mpe_dirname}\}
-done
-
-for dir in include lib bin sbin etc ; do
- dirname=${dir}build_dir
- eval dirvalue=\$"$dirname"
- if test -n "$dirvalue" ; then
- if test ! -d $dirvalue ; then
- if mkdir -p $dirvalue ; then
- :
- else
- PAC_MSG_ERROR( $enable_softerror,
- [Could not create directory $dirvalue] )
- fi
- fi
- fi
-done
-
-AC_SUBST(includebuild_dir)
-AC_SUBST(libbuild_dir)
-AC_SUBST(binbuild_dir)
-AC_SUBST(sbinbuild_dir)
-AC_SUBST(etcbuild_dir)
-
-AC_PROG_CC
-AC_OBJEXT
-AC_EXEEXT
-dnl Check for broken handling of common symbols
-dnl PAC_PROG_C_BROKEN_COMMON
-AC_CHECK_PROG(AR, ar, ar, ;)
-AC_PROG_RANLIB
-
-AC_PROG_CC_C_O
-# set CC_DOES_C_O to the value of \${ac_cv_prog_cc_${ac_cc}_c_o}
-eval CC_DOES_C_O=\${ac_cv_prog_cc_${ac_cc}_c_o}
-AC_SUBST(CC_DOES_C_O)
-
-dnl We need to check that this has worked. The autoconf macro is broken
-AC_PROG_CPP
-if test "$CPP" = "/lib/cpp" -a ! -x /lib/cpp ; then
- AC_MSG_ERROR( [configure could not find a working C preprocessor] )
-fi
-
-dnl Invoking AC_CHECK_LIB before AC_PROG_CC makes AC_PROG_CC fail
-dnl in autoconf 2.59
-DEBUG_LIBS=""
-if test "$enable_debugcheck" = "yes" ; then
- AC_CHECK_LIB( efence, malloc, DEBUG_LIBS="-lefence" )
-fi
-AC_SUBST(DEBUG_LIBS)
-
-AC_PATH_X
-
-dnl AC_PATH_X set no_x=yes if user invokes configure with --without-x,
-dnl or x_includes/x_libraries is/are empty
-if test -z "$no_x" ; then
- if test -n "$x_includes" ; then
- X_INC=-I$x_includes
- fi
- if test -n "$x_libraries" ; then
- X_LIB="-L$x_libraries -lX11"
- ANIM_LIBS="$ANIM_LIBS -L$x_libraries -lX11"
- XGRAPH_LIBS="$XGRAPH_LIBS -L$x_libraries -lX11"
- else
- X_LIB="-lX11"
- ANIM_LIBS="$ANIM_LIBS -lX11"
- XGRAPH_LIBS="$XGRAPH_LIBS -lX11"
- fi
-else
- PAC_MSG_ERROR( $enable_softerror,
- [Could not find appropriate X windows libraries. MPE routines that make use of X11 graphics will NOT be built unless you put X windows libraries in your path and reconfigure!] )
-fi
-
-AC_HEADER_STDC
-AC_C_CONST
-
-AC_CHECK_SIZEOF(void *)
-AC_MSG_CHECKING(for long pointer)
-if test "$ac_cv_sizeof_void_p" -gt 4 ; then
- AC_DEFINE( POINTER_64_BITS, 1, [Define if pointers are 64 bits] )
- AC_MSG_RESULT([yes])
-else
- AC_MSG_RESULT([no])
-fi
-
-dnl Checking for specific functions needed for the package.
-AC_HAVE_FUNCS(system)
-
-AC_CHECK_HEADERS( unistd.h stdlib.h string.h )
-
-dnl
-if test "$MPE_BUILD_FORTRAN2C" = "yes" ; then
-
-# Determine MPI_Fint
- if test "$MPI_IMPL" != "MPICH" -a "$MPI_IMPL" != "MPICH2" ; then
- AC_MSG_CHECKING( [for MPI_Fint] )
- PAC_MPI_LINK_CC_FUNC( $MPI_CC, [$MPI_CFLAGS], $MPI_LIBS, ,
- [ MPI_Fint aa=1 ], ,
- [ mpe_link_ok=yes ], [ mpe_link_ok=no ] )
- AC_MSG_RESULT($mpe_link_ok)
- else
- # MPICH2,MPICH has MPI_Fint
- mpe_link_ok=yes
- fi
- if test "$mpe_link_ok" = "yes" ; then
- MPI_FINT_TYPE=MPI_Fint
- else
- AC_MSG_RESULT([Assumed MPI_Fint to be int])
- MPI_FINT_TYPE=int
- AC_DEFINE( MPI_Fint, int, [Define MPI_Fint as int] )
- fi
-
-# Determmine if MPI_Comm_f2c() and MPI_Comm_c2f() are there
- if test "$MPI_IMPL" != "MPICH" -a "$MPI_IMPL" != "MPICH2" ; then
- AC_MSG_CHECKING( [for MPI_Comm_c2f() and MPI_Comm_f2c()] )
- PAC_MPI_LINK_CC_FUNC( $MPI_CC, [$MPI_CFLAGS], $MPI_LIBS, , [
- MPI_Comm comm; ${MPI_FINT_TYPE} aa;
- ], [
- aa=MPI_Comm_c2f(comm) ;
- comm=MPI_Comm_f2c(aa) ;
- ], [ mpe_link_ok=yes ], [ mpe_link_ok=no ] )
- AC_MSG_RESULT($mpe_link_ok)
- else
- mpe_link_ok=yes
- fi
- if test "$mpe_link_ok" = "yes" ; then
- AC_DEFINE( HAVE_MPI_COMM_F2C, 1,
- [Define if MPI_Comm_f2c and c2f available] )
- fi
-fi
-
-if test ! -d contrib ; then mkdir contrib ; fi
-
-AC_SUBST(MPI_IMPL)
-AC_SUBST(MPE_BUILD_FORTRAN2C)
-AC_SUBST(CC)
-AC_SUBST(CLINKER)
-AC_SUBST(CFLAGS)
-AC_SUBST(MPI_CC)
-AC_SUBST(MPE_CLINKER)
-AC_SUBST(F77)
-AC_SUBST(FLINKER)
-AC_SUBST(FFLAGS)
-AC_SUBST(MPI_F77)
-AC_SUBST(MPE_FLINKER)
-AC_SUBST(FINC_PATH_LEADER)
-AC_SUBST(FLIB_PATH_LEADER)
-AC_SUBST(MPI_CFLAGS)
-AC_SUBST(MPI_FFLAGS)
-AC_SUBST(MPI_LIBS)
-
-AC_SUBST(X_INC)
-AC_SUBST(X_LIB)
-AC_SUBST(XGRAPH_LIBS)
-
-AC_SUBST(PROF_LIBNAME)
-AC_SUBST(ANIM_LIBNAME)
-AC_SUBST(PROF_LIBS)
-AC_SUBST(ANIM_LIBS)
-
-
-AC_OUTPUT( Makefile src/Makefile \
- contrib/life/Makefile contrib/mandel/Makefile \
- contrib/mastermind/Makefile contrib/test/Makefile \
- etc/mpe_mpianim.conf etc/mpe_graphics.conf )
Copied: mpich2/trunk/src/mpe2/src/logging/configure.ac (from rev 9546, mpich2/trunk/src/mpe2/src/logging/configure.in)
===================================================================
--- mpich2/trunk/src/mpe2/src/logging/configure.ac (rev 0)
+++ mpich2/trunk/src/mpe2/src/logging/configure.ac 2012-02-28 23:26:34 UTC (rev 9548)
@@ -0,0 +1,654 @@
+dnl
+dnl Caching is usually WRONG for systems with cross-mounted file systems
+dnl (the cache file may correspond to a different system). Since configure
+dnl is not on a performance-critical path, go for robustness over speed.
+dnl
+define([AC_CACHE_LOAD], )dnl
+define([AC_CACHE_SAVE], )dnl
+dnl
+dnl
+AH_BOTTOM([
+/* Temporary fix of undefined int64_t on SLES8 with "icc -no-gcc" */
+#if defined(FIX_STDINT_ORDER)
+#include "clog_inttypes.h"
+#endif
+
+/* Define WINDOWS specific features */
+/*
+ Windows' open() opens an ASCII file by default, add Windows specific
+ flag O_BINARY to open()'s argument
+*/
+#if !defined( OPEN )
+
+#if defined(HAVE_WINDOWS_H)
+
+#define OPEN( a, b, c ) open( a, b | O_BINARY, c )
+
+#else
+
+#if defined(HAVE_O_LARGEFILE)
+
+#if defined(HAVE_O_BINARY)
+#define OPEN( a, b, c ) open( a, b | O_LARGEFILE | O_BINARY, c )
+#else
+#define OPEN( a, b, c ) open( a, b | O_LARGEFILE, c )
+#endif /* HAVE_O_BINARY */
+
+#else
+
+#if defined(HAVE_O_BINARY)
+#define OPEN( a, b, c ) open( a, b | O_BINARY, c )
+#else
+#define OPEN( a, b, c ) open( a, b, c )
+#endif /* HAVE_O_BINARY */
+
+#endif /* HAVE_O_LARGEFILE */
+
+#endif /* HAVE_WINDOWS_H */
+
+#endif /* OPEN */
+])
+AC_INIT()
+AC_PREREQ(2.52)
+AC_CONFIG_HEADER( mpe_logging_conf.h )
+dnl
+echo "Configuring MPE Logging Library and Tools with $ac_configure_args"
+dnl
+dnl Set top_srcdir_abs to be the ABSOLUTE path to the home directory of MPE
+dnl top_srcdir is in relative path.
+if test "X$srcdir" != "X." -a -s $srcdir/include/mpe_log.h ; then
+ top_srcdir_abs=$srcdir
+else
+ PAC_GETWD( top_srcdir_abs, include/mpe_log.h )
+fi
+AC_SUBST(top_srcdir_abs)
+
+AC_ARG_ENABLE( echo,
+[--enable-echo - Turn on strong echoing.
+ The default is enable=no.],
+set -x )
+
+AC_ARG_ENABLE( softerror,
+[--enable-softerror - Turn on soft error, i.e. instead of
+ issuing MSG_ERROR, MSG_WARN + exit 0
+ are used. The default is enable=no.],
+, enable_softerror=${mpe_enable_softerror:-no} )
+
+MAKE=${MAKE:-make}
+MPI_IMPL=${MPI_IMPL:-UserSupplied}
+MPE_BUILD_FORTRAN2C=${MPE_BUILD_FORTRAN2C:-no}
+CC=${CC:-cc}
+CLINKER=${CLINKER:-$CC}
+CFLAGS=${MPE_CFLAGS}
+MPI_CC=${MPI_CC:-${CC}}
+MPI_CFLAGS=${MPI_CFLAGS}
+MPI_LIBS=${MPI_LIBS}
+
+MPE_LIBNAME=${MPE_LIBNAME:-mpe}
+PROF_LIBNAME="$MPE_LIBNAME"
+PROF_LIBS="-l$PROF_LIBNAME"
+
+dnl Fixup for make
+PAC_MAKE_IS_GNUMAKE
+PAC_MAKE_IS_BSD44
+PAC_MAKE_IS_OSF
+PAC_MAKE_VPATH
+AC_SUBST(MAKE)
+
+dnl If we are relying on vpath and no vpath is set, then we must exit
+if test ! -s include/mpe_log.h -a -z "$VPATH" ; then
+ AC_MSG_ERROR( [No virtual MAKE path command found.
+ You may need to set your make command
+ The GNU make (sometimes available as gnumake) can be used.] )
+fi
+
+dnl CPRP is the version of cp that accepts -r and -p arguments.
+MKDIR=mkdir
+CPRP=cp
+RM=rm
+MV=mv
+AC_SUBST(MKDIR)
+AC_SUBST(CPRP)
+AC_SUBST(RM)
+AC_SUBST(MV)
+
+AC_ARG_ENABLE( threadlogging,
+[--enable-threadlogging - Turn on/off the coarse-grained thread
+ support in MPE logging. The default is
+ enable=yes.], ,
+enable_threadlogging=yes )
+
+dnl Set the various build directories from their mpe_ prefixed env variables.
+dnl
+dnl includebuild_dir is for all user header files
+dnl libbuild_dir is used to build the libraries in before they are installed.
+dnl binbuild_dir is for the scripts/programs
+dnl sbinbuild_dir is for all system admin tools
+dnl etcbuild_dir is for all system admin configuration settings
+dnl
+rootbuild_dir=`pwd`
+for dir in include lib bin etc ; do
+ dirname=${dir}build_dir
+ mpe_dirname=mpe_${dirname}
+ eval dirvalue=\$"$dirname"
+ eval $dirname=\$\{${mpe_dirname}\}
+done
+
+for dir in include lib bin etc ; do
+ dirname=${dir}build_dir
+ eval dirvalue=\$"$dirname"
+ if test -n "$dirvalue" ; then
+ if test ! -d $dirvalue ; then
+ if mkdir -p $dirvalue ; then
+ :
+ else
+ PAC_MSG_ERROR( $enable_softerror,
+ [Could not create directory $dirvalue] )
+ fi
+ fi
+ fi
+done
+
+AC_SUBST(includebuild_dir)
+AC_SUBST(libbuild_dir)
+AC_SUBST(binbuild_dir)
+AC_SUBST(etcbuild_dir)
+
+AC_PROG_CC
+AC_OBJEXT
+AC_EXEEXT
+dnl Check for broken handling of common symbols
+dnl PAC_PROG_C_BROKEN_COMMON
+AC_CHECK_PROG(AR, ar, ar, ;)
+AC_PROG_RANLIB
+
+AC_PROG_CC_C_O
+# set CC_DOES_C_O to the value of \${ac_cv_prog_cc_${ac_cc}_c_o}
+eval CC_DOES_C_O=\${ac_cv_prog_cc_${ac_cc}_c_o}
+AC_SUBST(CC_DOES_C_O)
+
+dnl We need to check that this has worked. The autoconf macro is broken
+AC_PROG_CPP
+if test "$CPP" = "/lib/cpp" -a ! -x /lib/cpp ; then
+ AC_MSG_ERROR( [configure could not find a working C preprocessor] )
+fi
+
+AC_HEADER_STDC
+
+AC_C_CONST
+
+AC_DEFINE( CLOG_IMPL, 1,
+ [The configuration header enables CLOG2 implementation related API] )
+
+dnl -- Check if byteswapping needs to be done.
+dnl if test "$cross_compiling" = "yes" -o "$cross_compiling" = 1 ; then
+dnl AC_MSG_CHECKING([for byte ordering])
+dnl if test "X$CROSS_BIGENDIAN" != "X" ; then
+dnl if test "$CROSS_BIGENDIAN" = "true" \
+dnl -o "$CROSS_BIGENDIAN" = "false" ; then
+dnl if test "$CROSS_BIGENDIAN" = "true" ; then
+dnl AC_DEFINE( WORDS_BIGENDIAN, 1,
+dnl [Define if byte order is bigendian] )
+dnl AC_MSG_RESULT( [defined to be big endian] )
+dnl else
+dnl AC_MSG_RESULT( [defined to be little endian] )
+dnl fi
+dnl else
+dnl AC_DEFINE( WORDS_BIGENDIAN, 1,
+dnl [Define if byte order is bigendian] )
+dnl AC_MSG_RESULT( [Unknown CROSS_BIGENDIAN, $CROSS_BIGENDIAN! Assumed big endian] )
+dnl fi
+dnl else
+dnl AC_DEFINE( WORDS_BIGENDIAN, 1, [Define if byte order is bigendian] )
+dnl AC_MSG_RESULT( [Undefined CROSS_BIGENDIAN! Assumed big endian] )
+dnl fi
+dnl else
+ AC_C_BIGENDIAN
+dnl fi
+
+AC_CHECK_HEADERS(stdio.h stdlib.h string.h unistd.h sys/time.h sys/types.h sys/bitypes.h sys/stat.h fcntl.h)
+
+
+dnl
+dnl Check system headers for C99 intXX_t.
+dnl
+PAC_GET_STDINT_HEADER([mpe_c99_stdint_h])
+
+if test "X$mpe_c99_stdint_h" != "X" ; then
+ mpe_int8_t="int8_t"
+ mpe_int16_t="int16_t"
+ mpe_int32_t="int32_t"
+ mpe_int64_t="int64_t"
+else
+dnl Since there isn't any intXX_t defined in the system headers.
+dnl Define intXX_t based on basic integer types, char, short, int, long...
+ PAC_GET_BASIC_INT_TYPES([mpe_int8_t], [mpe_int16_t],
+ [mpe_int32_t], [mpe_int64_t])
+fi
+
+dnl
+dnl Check for PRIdXX
+dnl
+PAC_GET_STDINT_FORMATS([$mpe_int8_t], [$mpe_int16_t],
+ [$mpe_int32_t], [$mpe_int64_t],
+ [mpe_int8_fmt], [mpe_int16_fmt],
+ [mpe_int32_fmt], [mpe_int64_fmt],
+ [mpe_c99_pridxx_h])
+
+dnl Create the output stdint.h for MPE logging
+dnl PAC_OUTPUT_STDINT_HEADER([include/clog_stdint.h],
+dnl [$mpe_c99_stdint_h], [$mpe_c99_pridxx_h],
+dnl [$mpe_int8_t], [$mpe_int16_t],
+dnl [$mpe_int32_t], [$mpe_int64_t],
+dnl [$mpe_int8_fmt], [$mpe_int16_fmt],
+dnl [$mpe_int32_fmt], [$mpe_int64_fmt])
+mpe_c99_stdint_inc=""
+mpe_c99_pridxx_inc=""
+if test "X$mpe_c99_stdint_h" != "X" ; then
+ mpe_c99_stdint_inc="#include <$mpe_c99_stdint_h>"
+ if test "X$mpe_c99_pridxx_h" != "X" ; then
+ if test "$mpe_c99_pridxx_h" != "$mpe_c99_stdint_h" ; then
+ mpe_c99_pridxx_inc="#include <$mpe_c99_pridxx_h>"
+ fi
+ fi
+fi
+AC_SUBST(mpe_c99_stdint_inc)
+AC_SUBST(mpe_c99_pridxx_inc)
+AC_SUBST(mpe_int8_t)
+AC_SUBST(mpe_int16_t)
+AC_SUBST(mpe_int32_t)
+AC_SUBST(mpe_int64_t)
+AC_SUBST(mpe_int8_fmt)
+AC_SUBST(mpe_int16_fmt)
+AC_SUBST(mpe_int32_fmt)
+AC_SUBST(mpe_int64_fmt)
+
+if test "X$mpe_c99_stdint_h" != "X" ; then
+ AC_MSG_CHECKING( [if <$mpe_c99_stdint_h> can be behind system headers] )
+ AC_COMPILE_IFELSE( [ AC_LANG_PROGRAM( [
+#if defined( STDC_HEADERS ) || defined( HAVE_STDIO_H )
+#include <stdio.h>
+#endif
+#if defined( STDC_HEADERS ) || defined( HAVE_STDLIB_H )
+#include <stdlib.h>
+#endif
+#include <$mpe_c99_stdint_h>
+ ],
+ [ int64_t ii64 = 0; ] )
+ ], [ mpe_link_ok=yes ], [ mpe_link_ok=no ] )
+ if test "$mpe_link_ok" = "yes" ; then
+ AC_MSG_RESULT(yes)
+ else
+ AC_MSG_RESULT(no)
+ AC_DEFINE( FIX_STDINT_ORDER, 1,
+ [Define if stdint.h should be before system headers] )
+ fi
+fi
+
+dnl Since sizeof(MPI_Aint) >= sizeof(void *), cannot use MPI_Aint.
+dnl Define CLOG_Pint, where sizeof(CLOG_Pint) == sizeof(void *).
+dnl Define CLOG_Pint to be used by MPI_Comm_xxx_attr in clog_commset.c.
+AC_CHECK_SIZEOF(void *)
+CLOG_PINT=mpe_int64_t
+AC_MSG_CHECKING( [for address-sized integer] )
+for bytelen in 8 16 32 64 ; do
+ charlen=`expr $bytelen / 8`
+ if test "$ac_cv_sizeof_void_p" = "$charlen" ; then
+ CLOG_PINT=CLOG_int${bytelen}_t
+ CLOG_SIZEOF_PINT=$charlen
+ break;
+ fi
+done
+AC_MSG_RESULT([$CLOG_PINT])
+AC_SUBST(CLOG_PINT)
+
+# If sizeof(mpi_aint) = sizeof(int), set this value
+if test "$ac_cv_sizeof_int" = "$ac_cv_sizeof_void_p" ; then
+ AC_DEFINE(SIZEOF_INT_IS_AINT,1,[define if sizeof(int) = sizeof(void*)])
+fi
+
+
+
+dnl **** Checking for specific functions needed for the package.
+
+if test -z "$nonopt" ; then nonopt=NONE ; fi
+AC_CANONICAL_HOST
+case "$host" in
+ *cray*)
+ if test "$MPE_BUILD_FORTRAN2C" = "yes" ; then
+ AC_MSG_CHECKING( [for Cray's FCD string type] )
+ AC_LINK_IFELSE( [ AC_LANG_PROGRAM( [#include <fortran.h>], [
+ char *cstr;
+ int cstrlen;
+ _fcd fstr;
+ cstr = _fcdtocp( fstr );
+ cstr_len = _fcdlen( fstr );
+ ] ) ], [ mpe_link_ok=yes ], [ mpe_link_ok=no ] )
+ if test "$mpe_link_ok" = "yes" ; then
+ AC_MSG_RESULT(yes)
+ AC_DEFINE( HAVE_CRAY_FCD_STRING, 1,
+ [Define if CRAY's FCD string is found] )
+ else
+ AC_MSG_RESULT(no)
+ fi
+ fi
+ ;;
+esac
+
+dnl snprintf may have been missing in headerfile,
+dnl e.g. gcc -ansi remove gethostname's prototype
+AC_CHECK_FUNCS(gethostname)
+if test "$ac_cv_func_gethostname" = "yes" ; then
+ PAC_FUNC_NEEDS_DECL([#include <unistd.h>],gethostname)
+fi
+
+dnl snprintf may have been missing in headerfile,
+dnl e.g. gcc -ansi remove snprintf's prototype
+AC_CHECK_FUNCS(snprintf)
+if test "$ac_cv_func_snprintf" = "yes" ; then
+ PAC_FUNC_NEEDS_DECL([#include <stdio.h>],snprintf)
+fi
+
+dnl mkstemp() is a better replacement for mktemp()
+AC_HAVE_FUNCS(mkstemp)
+if test "$ac_cv_func_mkstemp" = "yes" ; then
+ PAC_FUNC_NEEDS_DECL([#include <stdlib.h>],mkstemp)
+fi
+
+dnl srand48 may have been missing in headerfile,
+dnl e.g. gcc -ansi remove srand48's prototype
+AC_CHECK_FUNCS(srand48)
+if test "$ac_cv_func_srand48" = "yes" ; then
+ PAC_FUNC_NEEDS_DECL([#include <stdlib.h>],srand48)
+fi
+
+dnl lrand48 may have been missing in headerfile,
+dnl e.g. gcc -ansi remove lrand48's prototype
+AC_CHECK_FUNCS(lrand48)
+if test "$ac_cv_func_lrand48" = "yes" ; then
+ PAC_FUNC_NEEDS_DECL([#include <stdlib.h>],lrand48)
+fi
+
+
+dnl check if uuid_generate exists
+dnl AC_CHECK_HEADERS( uuid/uuid.h,
+dnl AC_MSG_CHECKING( [for uuid_generate] )
+dnl AC_TRY_COMPILE( [
+dnl #include <uuid/uuid.h>
+dnl ], [
+dnl uuid_t new_uuid;
+dnl uuid_generate( new_uuid );
+dnl ],
+dnl AC_DEFINE( HAVE_UUID_GENERATE, 1,
+dnl [Define if uuid_generate() exists.] )
+dnl AC_MSG_RESULT(yes),
+dnl AC_MSG_RESULT(no)
+dnl )
+dnl )
+
+dnl check if Large File support is available for 32-bit OS
+dnl AC_CHECK_HEADERS( unistd.h,
+dnl AC_MSG_CHECKING( [for large file support in 32-bit OS] )
+dnl AC_TRY_COMPILE( [
+dnl #define _LARGEFILE64_SOURCE 1
+dnl #include <unistd.h>
+dnl ], [
+dnl #ifndef _LFS64_LARGEFILE
+dnl #error no largefile support
+dnl #endif
+dnl ],
+dnl AC_DEFINE( _LARGEFILE64_SOURCE, 1,
+dnl [Define if 64-bit file address support in 32-bit OS.] )
+dnl AC_DEFINE( _FILE_OFFSET_BITS, 64,
+dnl [Define if 64-bit file address support in 32-bit OS.] )
+dnl AC_MSG_RESULT(yes),
+dnl AC_MSG_RESULT(none)
+dnl )
+dnl )
+AC_SYS_LARGEFILE
+if test "$enable_largefile" != no ; then
+ AC_MSG_CHECKING( [for O_LARGEFILE for open()] )
+ AC_COMPILE_IFELSE([
+ AC_LANG_PROGRAM([
+#if defined( HAVE_SYS_TYPES_H )
+#include <sys/types.h>
+#endif
+#if defined( HAVE_SYS_STAT_H )
+#include <sys/stat.h>
+#endif
+#if defined( HAVE_FCNTL_H )
+#include <fcntl.h>
+#endif
+ ],[
+ int fd;
+ fd = open( "tmpfile", O_CREAT | O_LARGEFILE, 0644 );
+ ])
+ ],[
+ AC_DEFINE( HAVE_O_LARGEFILE, 1,
+ [Define to 1 if O_LARGEFILE flag for open() exists.] )
+ AC_MSG_RESULT(yes)
+ ],[
+ AC_COMPILE_IFELSE([
+ AC_LANG_PROGRAM([
+#define _LARGEFILE64_SOURCE
+#if defined( HAVE_SYS_TYPES_H )
+#include <sys/types.h>
+#endif
+#if defined( HAVE_SYS_STAT_H )
+#include <sys/stat.h>
+#endif
+#if defined( HAVE_FCNTL_H )
+#include <fcntl.h>
+#endif
+ ],[
+ int fd;
+ fd = open( "tmpfile", O_CREAT | O_LARGEFILE, 0644 );
+ ])
+ ],[
+ AC_DEFINE( HAVE_O_LARGEFILE, 1,
+ [Define to 1 if O_LARGEFILE flag for open() exists.] )
+ AC_DEFINE( _LARGEFILE64_SOURCE, 1,
+ [Define if 64-bit file address support in 32-bit OS.] )
+ AC_MSG_RESULT( [needs _LARGEFILE64_SOURCE] )
+ ],[
+ AC_MSG_RESULT(no)
+ ])
+ ])
+fi
+ dnl end of AC_COMPILE_IFELSE with O_LARGEFILE
+ dnl end of AC_COMPILE_IFELSE with O_LARGEFILE and _LARGEFILE64_SOURCE
+
+AC_MSG_CHECKING( [for O_BINARY for open()] )
+AC_LINK_IFELSE([
+ AC_LANG_PROGRAM([
+#if defined( HAVE_FCNTL_H )
+#include <fcntl.h>
+#endif
+ ],[
+ int fd;
+ fd = open( "tmpfile", O_CREAT | O_BINARY, 0644 );
+ ])
+],[
+ AC_DEFINE( HAVE_O_BINARY, 1,
+ [Define to 1 if O_BINARY flag for open() exists.] )
+ AC_MSG_RESULT(yes)
+],[
+ AC_MSG_RESULT(no)
+])
+
+dnl Determine if PMPI_Comm_create_keyval exists
+if test "$MPI_IMPL" != "MPICH" -a "$MPI_IMPL" != "MPICH2" ; then
+ AC_MSG_CHECKING( [for PMPI_Comm_create_keyval()] )
+ PAC_MPI_LINK_CC_FUNC( $MPI_CC, [$MPI_CFLAGS], $MPI_LIBS, ,
+ [ int comm_keyval ], [
+ PMPI_Comm_create_keyval( MPI_COMM_NULL_COPY_FN,
+ MPI_COMM_NULL_DELETE_FN,
+ &comm_keyval, NULL )
+ ],
+ [ mpe_link_ok=yes ], [ mpe_link_ok=no ] )
+ AC_MSG_RESULT($mpe_link_ok)
+else
+# only MPICH2 has PMPI_Comm_{create|free}_keyval, PMPI_Comm_{set|get}_attr
+ if test "$MPI_IMPL" = "MPICH2" ; then
+ mpe_link_ok=yes
+ else
+ mpe_link_ok=no
+ fi
+fi
+if test "$mpe_link_ok" = "yes" ; then
+ AC_DEFINE( HAVE_PMPI_COMM_CREATE_KEYVAL, 1,
+ [Define if PMPI_Comm_Create_keyval() available] )
+fi
+
+dnl Determine if PMPI_Comm_free_keyval exists
+if test "$MPI_IMPL" != "MPICH" -a "$MPI_IMPL" != "MPICH2" ; then
+ AC_MSG_CHECKING( [for PMPI_Comm_free_keyval()] )
+ PAC_MPI_LINK_CC_FUNC( $MPI_CC, [$MPI_CFLAGS], $MPI_LIBS, ,
+ [ int comm_keyval ], [
+ PMPI_Comm_free_keyval( &comm_keyval )
+ ],
+ [ mpe_link_ok=yes ], [ mpe_link_ok=no ] )
+ AC_MSG_RESULT($mpe_link_ok)
+else
+# only MPICH2 has PMPI_Comm_{create|free}_keyval, PMPI_Comm_{set|get}_attr
+ if test "$MPI_IMPL" = "MPICH2" ; then
+ mpe_link_ok=yes
+ else
+ mpe_link_ok=no
+ fi
+fi
+if test "$mpe_link_ok" = "yes" ; then
+ AC_DEFINE( HAVE_PMPI_COMM_FREE_KEYVAL, 1,
+ [Define if PMPI_Comm_free_keyval() available] )
+fi
+
+dnl Determine if PMPI_Comm_set_attr exists
+if test "$MPI_IMPL" != "MPICH" -a "$MPI_IMPL" != "MPICH2" ; then
+ AC_MSG_CHECKING( [for PMPI_Comm_set_attr()] )
+ PAC_MPI_LINK_CC_FUNC( $MPI_CC, [$MPI_CFLAGS], $MPI_LIBS, ,
+ [ int comm_keyval ], [
+ PMPI_Comm_set_attr( MPI_COMM_WORLD, comm_keyval,
+ (void *)5 )
+ ],
+ [ mpe_link_ok=yes ], [ mpe_link_ok=no ] )
+ AC_MSG_RESULT($mpe_link_ok)
+else
+# only MPICH2 has PMPI_Comm_{create|free}_keyval, PMPI_Comm_{set|get}_attr
+ if test "$MPI_IMPL" = "MPICH2" ; then
+ mpe_link_ok=yes
+ else
+ mpe_link_ok=no
+ fi
+fi
+if test "$mpe_link_ok" = "yes" ; then
+ AC_DEFINE( HAVE_PMPI_COMM_SET_ATTR, 1,
+ [Define if PMPI_Comm_set_attr() available] )
+fi
+
+dnl Determine if PMPI_Comm_get_attr exists
+if test "$MPI_IMPL" != "MPICH" -a "$MPI_IMPL" != "MPICH2" ; then
+ AC_MSG_CHECKING( [for PMPI_Comm_get_attr()] )
+ PAC_MPI_LINK_CC_FUNC( $MPI_CC, [$MPI_CFLAGS], $MPI_LIBS, ,
+ [ int comm_keyval, comm_val, istatus ], [
+ PMPI_Comm_get_attr( MPI_COMM_WORLD, comm_keyval,
+ &comm_val, &istatus )
+ ],
+ [ mpe_link_ok=yes ], [ mpe_link_ok=no ] )
+ AC_MSG_RESULT($mpe_link_ok)
+else
+# only MPICH2 has PMPI_Comm_{create|free}_keyval, PMPI_Comm_{set|get}_attr
+ if test "$MPI_IMPL" = "MPICH2" ; then
+ mpe_link_ok=yes
+ else
+ mpe_link_ok=no
+ fi
+fi
+if test "$mpe_link_ok" = "yes" ; then
+ AC_DEFINE( HAVE_PMPI_COMM_GET_ATTR, 1,
+ [Define if PMPI_Comm_get_attr() available] )
+fi
+
+dnl Check if pthread exists
+if test "$enable_threadlogging" = "yes" ; then
+ AC_CHECK_HEADERS( pthread.h, [
+ AC_CHECK_LIB( pthread, [pthread_mutex_lock],
+ [ have_pthread_in_cc=yes ],
+ [ have_pthread_in_cc=no ] )
+ ] )
+ if test "$have_pthread_in_cc" = "yes" ; then
+ AC_DEFINE( HAVE_LIBPTHREAD, 1,
+ [Define if libpthread.a(so) is defined] )
+ fi
+fi
+
+dnl Assume there is no thread support, by default.
+PTHREAD_IN_MPI_DEF="#undef HAVE_PTHREAD_IN_MPI"
+THREAD_LOG_LIBS=""
+if test "$MPI_IMPL" != "MPICH" -a "$MPI_IMPL" != "MPICH2" ; then
+ if test "$have_pthread_in_cc" = "yes" \
+ -a "$enable_threadlogging" = "yes" ; then
+ AC_MSG_CHECKING( [for pthread_mutex_lock/unlock in MPI] )
+dnl Check MPI_CC/MPI_LIBS without -lpthread can resolve pthread symbols,
+dnl no need to add -lpthread during linking.
+ PAC_MPI_LINK_CC_FUNC( $MPI_CC, [$MPI_CFLAGS],
+ [$MPI_LIBS],
+ [#include <pthread.h>],
+ [ pthread_mutex_t pthd_mutex ],
+ [
+ pthread_mutex_lock(&pthd_mutex);
+ pthread_mutex_unlock(&pthd_mutex);
+ ],
+ [ mpe_link_ok=yes ], [ mpe_link_ok=no ] )
+ if test "$mpe_link_ok" = "yes" ; then
+ AC_MSG_RESULT(yes)
+ PTHREAD_IN_MPI_DEF="#define HAVE_PTHREAD_IN_MPI 1"
+ THREAD_LOG_LIBS=""
+ else
+dnl Check MPI_CC/MPI_LIBS with -lpthread can resolve pthread symbols,
+dnl If so, add -lpthread during linking.
+ PAC_MPI_LINK_CC_FUNC( $MPI_CC, [$MPI_CFLAGS],
+ [$MPI_LIBS -lpthread],
+ [#include <pthread.h>],
+ [ pthread_mutex_t pthd_mutex ],
+ [
+ pthread_mutex_lock(&pthd_mutex);
+ pthread_mutex_unlock(&pthd_mutex);
+ ],
+ [ mpe_link_ok=yes ], [ mpe_link_ok=no ] )
+ if test "$mpe_link_ok" = "yes" ; then
+ AC_MSG_RESULT(yes)
+ PTHREAD_IN_MPI_DEF="#define HAVE_PTHREAD_IN_MPI 1"
+ THREAD_LOG_LIBS="-lpthread"
+ else
+ AC_MSG_RESULT(no)
+ fi
+ fi
+ fi
+else
+dnl MPICH1 has no MPI_Init_thread(), set HAVE_PTHREAD_IN_MPI to Null.
+ if test "$MPI_IMPL" = "MPICH2" ; then
+ if test "$enable_threadlogging" = "yes" ; then
+ if test "$MPICH_THREAD_LEVEL" = "MPI_THREAD_MULTIPLE" \
+ -a "$MPICH2_THREAD_PACKAGE" = "pthreads" ; then
+ PTHREAD_IN_MPI_DEF="#define HAVE_PTHREAD_IN_MPI 1"
+ THREAD_LOGGING_LIBS="-lpthread"
+ fi
+ fi
+ fi
+fi
+AC_SUBST(PTHREAD_IN_MPI_DEF)
+AC_SUBST(THREAD_LOG_LIBS)
+
+
+AC_SUBST(MPE_BUILD_FORTRAN2C)
+AC_SUBST(CC)
+AC_SUBST(CLINKER)
+AC_SUBST(CFLAGS)
+AC_SUBST(MPI_CC)
+AC_SUBST(MPI_CFLAGS)
+AC_SUBST(MPI_LIBS)
+AC_SUBST(PROF_LIBNAME)
+
+AC_OUTPUT( Makefile src/Makefile \
+ include/clog_inttypes.h include/mpi_null.h include/mpe_log_thread.h \
+ etc/mpe_log.conf etc/mpe_nolog.conf etc/mpe_log_postlib.conf )
Deleted: mpich2/trunk/src/mpe2/src/logging/configure.in
===================================================================
--- mpich2/trunk/src/mpe2/src/logging/configure.in 2012-02-28 23:25:23 UTC (rev 9547)
+++ mpich2/trunk/src/mpe2/src/logging/configure.in 2012-02-28 23:26:34 UTC (rev 9548)
@@ -1,654 +0,0 @@
-dnl
-dnl Caching is usually WRONG for systems with cross-mounted file systems
-dnl (the cache file may correspond to a different system). Since configure
-dnl is not on a performance-critical path, go for robustness over speed.
-dnl
-define([AC_CACHE_LOAD], )dnl
-define([AC_CACHE_SAVE], )dnl
-dnl
-dnl
-AH_BOTTOM([
-/* Temporary fix of undefined int64_t on SLES8 with "icc -no-gcc" */
-#if defined(FIX_STDINT_ORDER)
-#include "clog_inttypes.h"
-#endif
-
-/* Define WINDOWS specific features */
-/*
- Windows' open() opens an ASCII file by default, add Windows specific
- flag O_BINARY to open()'s argument
-*/
-#if !defined( OPEN )
-
-#if defined(HAVE_WINDOWS_H)
-
-#define OPEN( a, b, c ) open( a, b | O_BINARY, c )
-
-#else
-
-#if defined(HAVE_O_LARGEFILE)
-
-#if defined(HAVE_O_BINARY)
-#define OPEN( a, b, c ) open( a, b | O_LARGEFILE | O_BINARY, c )
-#else
-#define OPEN( a, b, c ) open( a, b | O_LARGEFILE, c )
-#endif /* HAVE_O_BINARY */
-
-#else
-
-#if defined(HAVE_O_BINARY)
-#define OPEN( a, b, c ) open( a, b | O_BINARY, c )
-#else
-#define OPEN( a, b, c ) open( a, b, c )
-#endif /* HAVE_O_BINARY */
-
-#endif /* HAVE_O_LARGEFILE */
-
-#endif /* HAVE_WINDOWS_H */
-
-#endif /* OPEN */
-])
-AC_INIT()
-AC_PREREQ(2.52)
-AC_CONFIG_HEADER( mpe_logging_conf.h )
-dnl
-echo "Configuring MPE Logging Library and Tools with $ac_configure_args"
-dnl
-dnl Set top_srcdir_abs to be the ABSOLUTE path to the home directory of MPE
-dnl top_srcdir is in relative path.
-if test "X$srcdir" != "X." -a -s $srcdir/include/mpe_log.h ; then
- top_srcdir_abs=$srcdir
-else
- PAC_GETWD( top_srcdir_abs, include/mpe_log.h )
-fi
-AC_SUBST(top_srcdir_abs)
-
-AC_ARG_ENABLE( echo,
-[--enable-echo - Turn on strong echoing.
- The default is enable=no.],
-set -x )
-
-AC_ARG_ENABLE( softerror,
-[--enable-softerror - Turn on soft error, i.e. instead of
- issuing MSG_ERROR, MSG_WARN + exit 0
- are used. The default is enable=no.],
-, enable_softerror=${mpe_enable_softerror:-no} )
-
-MAKE=${MAKE:-make}
-MPI_IMPL=${MPI_IMPL:-UserSupplied}
-MPE_BUILD_FORTRAN2C=${MPE_BUILD_FORTRAN2C:-no}
-CC=${CC:-cc}
-CLINKER=${CLINKER:-$CC}
-CFLAGS=${MPE_CFLAGS}
-MPI_CC=${MPI_CC:-${CC}}
-MPI_CFLAGS=${MPI_CFLAGS}
-MPI_LIBS=${MPI_LIBS}
-
-MPE_LIBNAME=${MPE_LIBNAME:-mpe}
-PROF_LIBNAME="$MPE_LIBNAME"
-PROF_LIBS="-l$PROF_LIBNAME"
-
-dnl Fixup for make
-PAC_MAKE_IS_GNUMAKE
-PAC_MAKE_IS_BSD44
-PAC_MAKE_IS_OSF
-PAC_MAKE_VPATH
-AC_SUBST(MAKE)
-
-dnl If we are relying on vpath and no vpath is set, then we must exit
-if test ! -s include/mpe_log.h -a -z "$VPATH" ; then
- AC_MSG_ERROR( [No virtual MAKE path command found.
- You may need to set your make command
- The GNU make (sometimes available as gnumake) can be used.] )
-fi
-
-dnl CPRP is the version of cp that accepts -r and -p arguments.
-MKDIR=mkdir
-CPRP=cp
-RM=rm
-MV=mv
-AC_SUBST(MKDIR)
-AC_SUBST(CPRP)
-AC_SUBST(RM)
-AC_SUBST(MV)
-
-AC_ARG_ENABLE( threadlogging,
-[--enable-threadlogging - Turn on/off the coarse-grained thread
- support in MPE logging. The default is
- enable=yes.], ,
-enable_threadlogging=yes )
-
-dnl Set the various build directories from their mpe_ prefixed env variables.
-dnl
-dnl includebuild_dir is for all user header files
-dnl libbuild_dir is used to build the libraries in before they are installed.
-dnl binbuild_dir is for the scripts/programs
-dnl sbinbuild_dir is for all system admin tools
-dnl etcbuild_dir is for all system admin configuration settings
-dnl
-rootbuild_dir=`pwd`
-for dir in include lib bin etc ; do
- dirname=${dir}build_dir
- mpe_dirname=mpe_${dirname}
- eval dirvalue=\$"$dirname"
- eval $dirname=\$\{${mpe_dirname}\}
-done
-
-for dir in include lib bin etc ; do
- dirname=${dir}build_dir
- eval dirvalue=\$"$dirname"
- if test -n "$dirvalue" ; then
- if test ! -d $dirvalue ; then
- if mkdir -p $dirvalue ; then
- :
- else
- PAC_MSG_ERROR( $enable_softerror,
- [Could not create directory $dirvalue] )
- fi
- fi
- fi
-done
-
-AC_SUBST(includebuild_dir)
-AC_SUBST(libbuild_dir)
-AC_SUBST(binbuild_dir)
-AC_SUBST(etcbuild_dir)
-
-AC_PROG_CC
-AC_OBJEXT
-AC_EXEEXT
-dnl Check for broken handling of common symbols
-dnl PAC_PROG_C_BROKEN_COMMON
-AC_CHECK_PROG(AR, ar, ar, ;)
-AC_PROG_RANLIB
-
-AC_PROG_CC_C_O
-# set CC_DOES_C_O to the value of \${ac_cv_prog_cc_${ac_cc}_c_o}
-eval CC_DOES_C_O=\${ac_cv_prog_cc_${ac_cc}_c_o}
-AC_SUBST(CC_DOES_C_O)
-
-dnl We need to check that this has worked. The autoconf macro is broken
-AC_PROG_CPP
-if test "$CPP" = "/lib/cpp" -a ! -x /lib/cpp ; then
- AC_MSG_ERROR( [configure could not find a working C preprocessor] )
-fi
-
-AC_HEADER_STDC
-
-AC_C_CONST
-
-AC_DEFINE( CLOG_IMPL, 1,
- [The configuration header enables CLOG2 implementation related API] )
-
-dnl -- Check if byteswapping needs to be done.
-dnl if test "$cross_compiling" = "yes" -o "$cross_compiling" = 1 ; then
-dnl AC_MSG_CHECKING([for byte ordering])
-dnl if test "X$CROSS_BIGENDIAN" != "X" ; then
-dnl if test "$CROSS_BIGENDIAN" = "true" \
-dnl -o "$CROSS_BIGENDIAN" = "false" ; then
-dnl if test "$CROSS_BIGENDIAN" = "true" ; then
-dnl AC_DEFINE( WORDS_BIGENDIAN, 1,
-dnl [Define if byte order is bigendian] )
-dnl AC_MSG_RESULT( [defined to be big endian] )
-dnl else
-dnl AC_MSG_RESULT( [defined to be little endian] )
-dnl fi
-dnl else
-dnl AC_DEFINE( WORDS_BIGENDIAN, 1,
-dnl [Define if byte order is bigendian] )
-dnl AC_MSG_RESULT( [Unknown CROSS_BIGENDIAN, $CROSS_BIGENDIAN! Assumed big endian] )
-dnl fi
-dnl else
-dnl AC_DEFINE( WORDS_BIGENDIAN, 1, [Define if byte order is bigendian] )
-dnl AC_MSG_RESULT( [Undefined CROSS_BIGENDIAN! Assumed big endian] )
-dnl fi
-dnl else
- AC_C_BIGENDIAN
-dnl fi
-
-AC_CHECK_HEADERS(stdio.h stdlib.h string.h unistd.h sys/time.h sys/types.h sys/bitypes.h sys/stat.h fcntl.h)
-
-
-dnl
-dnl Check system headers for C99 intXX_t.
-dnl
-PAC_GET_STDINT_HEADER([mpe_c99_stdint_h])
-
-if test "X$mpe_c99_stdint_h" != "X" ; then
- mpe_int8_t="int8_t"
- mpe_int16_t="int16_t"
- mpe_int32_t="int32_t"
- mpe_int64_t="int64_t"
-else
-dnl Since there isn't any intXX_t defined in the system headers.
-dnl Define intXX_t based on basic integer types, char, short, int, long...
- PAC_GET_BASIC_INT_TYPES([mpe_int8_t], [mpe_int16_t],
- [mpe_int32_t], [mpe_int64_t])
-fi
-
-dnl
-dnl Check for PRIdXX
-dnl
-PAC_GET_STDINT_FORMATS([$mpe_int8_t], [$mpe_int16_t],
- [$mpe_int32_t], [$mpe_int64_t],
- [mpe_int8_fmt], [mpe_int16_fmt],
- [mpe_int32_fmt], [mpe_int64_fmt],
- [mpe_c99_pridxx_h])
-
-dnl Create the output stdint.h for MPE logging
-dnl PAC_OUTPUT_STDINT_HEADER([include/clog_stdint.h],
-dnl [$mpe_c99_stdint_h], [$mpe_c99_pridxx_h],
-dnl [$mpe_int8_t], [$mpe_int16_t],
-dnl [$mpe_int32_t], [$mpe_int64_t],
-dnl [$mpe_int8_fmt], [$mpe_int16_fmt],
-dnl [$mpe_int32_fmt], [$mpe_int64_fmt])
-mpe_c99_stdint_inc=""
-mpe_c99_pridxx_inc=""
-if test "X$mpe_c99_stdint_h" != "X" ; then
- mpe_c99_stdint_inc="#include <$mpe_c99_stdint_h>"
- if test "X$mpe_c99_pridxx_h" != "X" ; then
- if test "$mpe_c99_pridxx_h" != "$mpe_c99_stdint_h" ; then
- mpe_c99_pridxx_inc="#include <$mpe_c99_pridxx_h>"
- fi
- fi
-fi
-AC_SUBST(mpe_c99_stdint_inc)
-AC_SUBST(mpe_c99_pridxx_inc)
-AC_SUBST(mpe_int8_t)
-AC_SUBST(mpe_int16_t)
-AC_SUBST(mpe_int32_t)
-AC_SUBST(mpe_int64_t)
-AC_SUBST(mpe_int8_fmt)
-AC_SUBST(mpe_int16_fmt)
-AC_SUBST(mpe_int32_fmt)
-AC_SUBST(mpe_int64_fmt)
-
-if test "X$mpe_c99_stdint_h" != "X" ; then
- AC_MSG_CHECKING( [if <$mpe_c99_stdint_h> can be behind system headers] )
- AC_COMPILE_IFELSE( [ AC_LANG_PROGRAM( [
-#if defined( STDC_HEADERS ) || defined( HAVE_STDIO_H )
-#include <stdio.h>
-#endif
-#if defined( STDC_HEADERS ) || defined( HAVE_STDLIB_H )
-#include <stdlib.h>
-#endif
-#include <$mpe_c99_stdint_h>
- ],
- [ int64_t ii64 = 0; ] )
- ], [ mpe_link_ok=yes ], [ mpe_link_ok=no ] )
- if test "$mpe_link_ok" = "yes" ; then
- AC_MSG_RESULT(yes)
- else
- AC_MSG_RESULT(no)
- AC_DEFINE( FIX_STDINT_ORDER, 1,
- [Define if stdint.h should be before system headers] )
- fi
-fi
-
-dnl Since sizeof(MPI_Aint) >= sizeof(void *), cannot use MPI_Aint.
-dnl Define CLOG_Pint, where sizeof(CLOG_Pint) == sizeof(void *).
-dnl Define CLOG_Pint to be used by MPI_Comm_xxx_attr in clog_commset.c.
-AC_CHECK_SIZEOF(void *)
-CLOG_PINT=mpe_int64_t
-AC_MSG_CHECKING( [for address-sized integer] )
-for bytelen in 8 16 32 64 ; do
- charlen=`expr $bytelen / 8`
- if test "$ac_cv_sizeof_void_p" = "$charlen" ; then
- CLOG_PINT=CLOG_int${bytelen}_t
- CLOG_SIZEOF_PINT=$charlen
- break;
- fi
-done
-AC_MSG_RESULT([$CLOG_PINT])
-AC_SUBST(CLOG_PINT)
-
-# If sizeof(mpi_aint) = sizeof(int), set this value
-if test "$ac_cv_sizeof_int" = "$ac_cv_sizeof_void_p" ; then
- AC_DEFINE(SIZEOF_INT_IS_AINT,1,[define if sizeof(int) = sizeof(void*)])
-fi
-
-
-
-dnl **** Checking for specific functions needed for the package.
-
-if test -z "$nonopt" ; then nonopt=NONE ; fi
-AC_CANONICAL_HOST
-case "$host" in
- *cray*)
- if test "$MPE_BUILD_FORTRAN2C" = "yes" ; then
- AC_MSG_CHECKING( [for Cray's FCD string type] )
- AC_LINK_IFELSE( [ AC_LANG_PROGRAM( [#include <fortran.h>], [
- char *cstr;
- int cstrlen;
- _fcd fstr;
- cstr = _fcdtocp( fstr );
- cstr_len = _fcdlen( fstr );
- ] ) ], [ mpe_link_ok=yes ], [ mpe_link_ok=no ] )
- if test "$mpe_link_ok" = "yes" ; then
- AC_MSG_RESULT(yes)
- AC_DEFINE( HAVE_CRAY_FCD_STRING, 1,
- [Define if CRAY's FCD string is found] )
- else
- AC_MSG_RESULT(no)
- fi
- fi
- ;;
-esac
-
-dnl snprintf may have been missing in headerfile,
-dnl e.g. gcc -ansi remove gethostname's prototype
-AC_CHECK_FUNCS(gethostname)
-if test "$ac_cv_func_gethostname" = "yes" ; then
- PAC_FUNC_NEEDS_DECL([#include <unistd.h>],gethostname)
-fi
-
-dnl snprintf may have been missing in headerfile,
-dnl e.g. gcc -ansi remove snprintf's prototype
-AC_CHECK_FUNCS(snprintf)
-if test "$ac_cv_func_snprintf" = "yes" ; then
- PAC_FUNC_NEEDS_DECL([#include <stdio.h>],snprintf)
-fi
-
-dnl mkstemp() is a better replacement for mktemp()
-AC_HAVE_FUNCS(mkstemp)
-if test "$ac_cv_func_mkstemp" = "yes" ; then
- PAC_FUNC_NEEDS_DECL([#include <stdlib.h>],mkstemp)
-fi
-
-dnl srand48 may have been missing in headerfile,
-dnl e.g. gcc -ansi remove srand48's prototype
-AC_CHECK_FUNCS(srand48)
-if test "$ac_cv_func_srand48" = "yes" ; then
- PAC_FUNC_NEEDS_DECL([#include <stdlib.h>],srand48)
-fi
-
-dnl lrand48 may have been missing in headerfile,
-dnl e.g. gcc -ansi remove lrand48's prototype
-AC_CHECK_FUNCS(lrand48)
-if test "$ac_cv_func_lrand48" = "yes" ; then
- PAC_FUNC_NEEDS_DECL([#include <stdlib.h>],lrand48)
-fi
-
-
-dnl check if uuid_generate exists
-dnl AC_CHECK_HEADERS( uuid/uuid.h,
-dnl AC_MSG_CHECKING( [for uuid_generate] )
-dnl AC_TRY_COMPILE( [
-dnl #include <uuid/uuid.h>
-dnl ], [
-dnl uuid_t new_uuid;
-dnl uuid_generate( new_uuid );
-dnl ],
-dnl AC_DEFINE( HAVE_UUID_GENERATE, 1,
-dnl [Define if uuid_generate() exists.] )
-dnl AC_MSG_RESULT(yes),
-dnl AC_MSG_RESULT(no)
-dnl )
-dnl )
-
-dnl check if Large File support is available for 32-bit OS
-dnl AC_CHECK_HEADERS( unistd.h,
-dnl AC_MSG_CHECKING( [for large file support in 32-bit OS] )
-dnl AC_TRY_COMPILE( [
-dnl #define _LARGEFILE64_SOURCE 1
-dnl #include <unistd.h>
-dnl ], [
-dnl #ifndef _LFS64_LARGEFILE
-dnl #error no largefile support
-dnl #endif
-dnl ],
-dnl AC_DEFINE( _LARGEFILE64_SOURCE, 1,
-dnl [Define if 64-bit file address support in 32-bit OS.] )
-dnl AC_DEFINE( _FILE_OFFSET_BITS, 64,
-dnl [Define if 64-bit file address support in 32-bit OS.] )
-dnl AC_MSG_RESULT(yes),
-dnl AC_MSG_RESULT(none)
-dnl )
-dnl )
-AC_SYS_LARGEFILE
-if test "$enable_largefile" != no ; then
- AC_MSG_CHECKING( [for O_LARGEFILE for open()] )
- AC_COMPILE_IFELSE([
- AC_LANG_PROGRAM([
-#if defined( HAVE_SYS_TYPES_H )
-#include <sys/types.h>
-#endif
-#if defined( HAVE_SYS_STAT_H )
-#include <sys/stat.h>
-#endif
-#if defined( HAVE_FCNTL_H )
-#include <fcntl.h>
-#endif
- ],[
- int fd;
- fd = open( "tmpfile", O_CREAT | O_LARGEFILE, 0644 );
- ])
- ],[
- AC_DEFINE( HAVE_O_LARGEFILE, 1,
- [Define to 1 if O_LARGEFILE flag for open() exists.] )
- AC_MSG_RESULT(yes)
- ],[
- AC_COMPILE_IFELSE([
- AC_LANG_PROGRAM([
-#define _LARGEFILE64_SOURCE
-#if defined( HAVE_SYS_TYPES_H )
-#include <sys/types.h>
-#endif
-#if defined( HAVE_SYS_STAT_H )
-#include <sys/stat.h>
-#endif
-#if defined( HAVE_FCNTL_H )
-#include <fcntl.h>
-#endif
- ],[
- int fd;
- fd = open( "tmpfile", O_CREAT | O_LARGEFILE, 0644 );
- ])
- ],[
- AC_DEFINE( HAVE_O_LARGEFILE, 1,
- [Define to 1 if O_LARGEFILE flag for open() exists.] )
- AC_DEFINE( _LARGEFILE64_SOURCE, 1,
- [Define if 64-bit file address support in 32-bit OS.] )
- AC_MSG_RESULT( [needs _LARGEFILE64_SOURCE] )
- ],[
- AC_MSG_RESULT(no)
- ])
- ])
-fi
- dnl end of AC_COMPILE_IFELSE with O_LARGEFILE
- dnl end of AC_COMPILE_IFELSE with O_LARGEFILE and _LARGEFILE64_SOURCE
-
-AC_MSG_CHECKING( [for O_BINARY for open()] )
-AC_LINK_IFELSE([
- AC_LANG_PROGRAM([
-#if defined( HAVE_FCNTL_H )
-#include <fcntl.h>
-#endif
- ],[
- int fd;
- fd = open( "tmpfile", O_CREAT | O_BINARY, 0644 );
- ])
-],[
- AC_DEFINE( HAVE_O_BINARY, 1,
- [Define to 1 if O_BINARY flag for open() exists.] )
- AC_MSG_RESULT(yes)
-],[
- AC_MSG_RESULT(no)
-])
-
-dnl Determine if PMPI_Comm_create_keyval exists
-if test "$MPI_IMPL" != "MPICH" -a "$MPI_IMPL" != "MPICH2" ; then
- AC_MSG_CHECKING( [for PMPI_Comm_create_keyval()] )
- PAC_MPI_LINK_CC_FUNC( $MPI_CC, [$MPI_CFLAGS], $MPI_LIBS, ,
- [ int comm_keyval ], [
- PMPI_Comm_create_keyval( MPI_COMM_NULL_COPY_FN,
- MPI_COMM_NULL_DELETE_FN,
- &comm_keyval, NULL )
- ],
- [ mpe_link_ok=yes ], [ mpe_link_ok=no ] )
- AC_MSG_RESULT($mpe_link_ok)
-else
-# only MPICH2 has PMPI_Comm_{create|free}_keyval, PMPI_Comm_{set|get}_attr
- if test "$MPI_IMPL" = "MPICH2" ; then
- mpe_link_ok=yes
- else
- mpe_link_ok=no
- fi
-fi
-if test "$mpe_link_ok" = "yes" ; then
- AC_DEFINE( HAVE_PMPI_COMM_CREATE_KEYVAL, 1,
- [Define if PMPI_Comm_Create_keyval() available] )
-fi
-
-dnl Determine if PMPI_Comm_free_keyval exists
-if test "$MPI_IMPL" != "MPICH" -a "$MPI_IMPL" != "MPICH2" ; then
- AC_MSG_CHECKING( [for PMPI_Comm_free_keyval()] )
- PAC_MPI_LINK_CC_FUNC( $MPI_CC, [$MPI_CFLAGS], $MPI_LIBS, ,
- [ int comm_keyval ], [
- PMPI_Comm_free_keyval( &comm_keyval )
- ],
- [ mpe_link_ok=yes ], [ mpe_link_ok=no ] )
- AC_MSG_RESULT($mpe_link_ok)
-else
-# only MPICH2 has PMPI_Comm_{create|free}_keyval, PMPI_Comm_{set|get}_attr
- if test "$MPI_IMPL" = "MPICH2" ; then
- mpe_link_ok=yes
- else
- mpe_link_ok=no
- fi
-fi
-if test "$mpe_link_ok" = "yes" ; then
- AC_DEFINE( HAVE_PMPI_COMM_FREE_KEYVAL, 1,
- [Define if PMPI_Comm_free_keyval() available] )
-fi
-
-dnl Determine if PMPI_Comm_set_attr exists
-if test "$MPI_IMPL" != "MPICH" -a "$MPI_IMPL" != "MPICH2" ; then
- AC_MSG_CHECKING( [for PMPI_Comm_set_attr()] )
- PAC_MPI_LINK_CC_FUNC( $MPI_CC, [$MPI_CFLAGS], $MPI_LIBS, ,
- [ int comm_keyval ], [
- PMPI_Comm_set_attr( MPI_COMM_WORLD, comm_keyval,
- (void *)5 )
- ],
- [ mpe_link_ok=yes ], [ mpe_link_ok=no ] )
- AC_MSG_RESULT($mpe_link_ok)
-else
-# only MPICH2 has PMPI_Comm_{create|free}_keyval, PMPI_Comm_{set|get}_attr
- if test "$MPI_IMPL" = "MPICH2" ; then
- mpe_link_ok=yes
- else
- mpe_link_ok=no
- fi
-fi
-if test "$mpe_link_ok" = "yes" ; then
- AC_DEFINE( HAVE_PMPI_COMM_SET_ATTR, 1,
- [Define if PMPI_Comm_set_attr() available] )
-fi
-
-dnl Determine if PMPI_Comm_get_attr exists
-if test "$MPI_IMPL" != "MPICH" -a "$MPI_IMPL" != "MPICH2" ; then
- AC_MSG_CHECKING( [for PMPI_Comm_get_attr()] )
- PAC_MPI_LINK_CC_FUNC( $MPI_CC, [$MPI_CFLAGS], $MPI_LIBS, ,
- [ int comm_keyval, comm_val, istatus ], [
- PMPI_Comm_get_attr( MPI_COMM_WORLD, comm_keyval,
- &comm_val, &istatus )
- ],
- [ mpe_link_ok=yes ], [ mpe_link_ok=no ] )
- AC_MSG_RESULT($mpe_link_ok)
-else
-# only MPICH2 has PMPI_Comm_{create|free}_keyval, PMPI_Comm_{set|get}_attr
- if test "$MPI_IMPL" = "MPICH2" ; then
- mpe_link_ok=yes
- else
- mpe_link_ok=no
- fi
-fi
-if test "$mpe_link_ok" = "yes" ; then
- AC_DEFINE( HAVE_PMPI_COMM_GET_ATTR, 1,
- [Define if PMPI_Comm_get_attr() available] )
-fi
-
-dnl Check if pthread exists
-if test "$enable_threadlogging" = "yes" ; then
- AC_CHECK_HEADERS( pthread.h, [
- AC_CHECK_LIB( pthread, [pthread_mutex_lock],
- [ have_pthread_in_cc=yes ],
- [ have_pthread_in_cc=no ] )
- ] )
- if test "$have_pthread_in_cc" = "yes" ; then
- AC_DEFINE( HAVE_LIBPTHREAD, 1,
- [Define if libpthread.a(so) is defined] )
- fi
-fi
-
-dnl Assume there is no thread support, by default.
-PTHREAD_IN_MPI_DEF="#undef HAVE_PTHREAD_IN_MPI"
-THREAD_LOG_LIBS=""
-if test "$MPI_IMPL" != "MPICH" -a "$MPI_IMPL" != "MPICH2" ; then
- if test "$have_pthread_in_cc" = "yes" \
- -a "$enable_threadlogging" = "yes" ; then
- AC_MSG_CHECKING( [for pthread_mutex_lock/unlock in MPI] )
-dnl Check MPI_CC/MPI_LIBS without -lpthread can resolve pthread symbols,
-dnl no need to add -lpthread during linking.
- PAC_MPI_LINK_CC_FUNC( $MPI_CC, [$MPI_CFLAGS],
- [$MPI_LIBS],
- [#include <pthread.h>],
- [ pthread_mutex_t pthd_mutex ],
- [
- pthread_mutex_lock(&pthd_mutex);
- pthread_mutex_unlock(&pthd_mutex);
- ],
- [ mpe_link_ok=yes ], [ mpe_link_ok=no ] )
- if test "$mpe_link_ok" = "yes" ; then
- AC_MSG_RESULT(yes)
- PTHREAD_IN_MPI_DEF="#define HAVE_PTHREAD_IN_MPI 1"
- THREAD_LOG_LIBS=""
- else
-dnl Check MPI_CC/MPI_LIBS with -lpthread can resolve pthread symbols,
-dnl If so, add -lpthread during linking.
- PAC_MPI_LINK_CC_FUNC( $MPI_CC, [$MPI_CFLAGS],
- [$MPI_LIBS -lpthread],
- [#include <pthread.h>],
- [ pthread_mutex_t pthd_mutex ],
- [
- pthread_mutex_lock(&pthd_mutex);
- pthread_mutex_unlock(&pthd_mutex);
- ],
- [ mpe_link_ok=yes ], [ mpe_link_ok=no ] )
- if test "$mpe_link_ok" = "yes" ; then
- AC_MSG_RESULT(yes)
- PTHREAD_IN_MPI_DEF="#define HAVE_PTHREAD_IN_MPI 1"
- THREAD_LOG_LIBS="-lpthread"
- else
- AC_MSG_RESULT(no)
- fi
- fi
- fi
-else
-dnl MPICH1 has no MPI_Init_thread(), set HAVE_PTHREAD_IN_MPI to Null.
- if test "$MPI_IMPL" = "MPICH2" ; then
- if test "$enable_threadlogging" = "yes" ; then
- if test "$MPICH_THREAD_LEVEL" = "MPI_THREAD_MULTIPLE" \
- -a "$MPICH2_THREAD_PACKAGE" = "pthreads" ; then
- PTHREAD_IN_MPI_DEF="#define HAVE_PTHREAD_IN_MPI 1"
- THREAD_LOGGING_LIBS="-lpthread"
- fi
- fi
- fi
-fi
-AC_SUBST(PTHREAD_IN_MPI_DEF)
-AC_SUBST(THREAD_LOG_LIBS)
-
-
-AC_SUBST(MPE_BUILD_FORTRAN2C)
-AC_SUBST(CC)
-AC_SUBST(CLINKER)
-AC_SUBST(CFLAGS)
-AC_SUBST(MPI_CC)
-AC_SUBST(MPI_CFLAGS)
-AC_SUBST(MPI_LIBS)
-AC_SUBST(PROF_LIBNAME)
-
-AC_OUTPUT( Makefile src/Makefile \
- include/clog_inttypes.h include/mpi_null.h include/mpe_log_thread.h \
- etc/mpe_log.conf etc/mpe_nolog.conf etc/mpe_log_postlib.conf )
Copied: mpich2/trunk/src/mpe2/src/misc/configure.ac (from rev 9546, mpich2/trunk/src/mpe2/src/misc/configure.in)
===================================================================
--- mpich2/trunk/src/mpe2/src/misc/configure.ac (rev 0)
+++ mpich2/trunk/src/mpe2/src/misc/configure.ac 2012-02-28 23:26:34 UTC (rev 9548)
@@ -0,0 +1,240 @@
+dnl
+dnl Caching is usually WRONG for systems with cross-mounted file systems
+dnl (the cache file may correspond to a different system). Since configure
+dnl is not on a performance-critical path, go for robustness over speed.
+dnl
+define([AC_CACHE_LOAD], )dnl
+define([AC_CACHE_SAVE], )dnl
+dnl
+dnl
+AC_INIT()
+AC_PREREQ(2.52)
+AC_CONFIG_HEADER(mpe_misc_conf.h)
+dnl
+echo "Configuring MPE Miscellaneous Library with $ac_configure_args"
+dnl
+dnl Set top_srcdir_abs to be the ABSOLUTE path to the home directory of MPE
+dnl top_srcdir is in relative path.
+if test "X$srcdir" != "X." -a -s $srcdir/include/mpe_misc.h ; then
+ top_srcdir_abs=$srcdir
+else
+ PAC_GETWD( top_srcdir_abs, include/mpe_misc.h )
+fi
+AC_SUBST(top_srcdir_abs)
+
+AC_ARG_ENABLE( echo,
+[--enable-echo - Turn on strong echoing.
+ The default is enable=no.],
+set -x )
+
+AC_ARG_ENABLE( softerror,
+[--enable-softerror - Turn on soft error, i.e. instead of
+ issuing MSG_ERROR, MSG_WARN + exit 0
+ are used. The default is enable=no.],
+, enable_softerror=${mpe_enable_softerror:-no} )
+
+MAKE=${MAKE:-make}
+MPI_IMPL=${MPI_IMPL:-UserSupplied}
+MPE_BUILD_FORTRAN2C=${MPE_BUILD_FORTRAN2C:-no}
+CC=${CC:-cc}
+CLINKER=${CLINKER:-$CC}
+CFLAGS=${MPE_CFLAGS}
+MPI_CC=${MPI_CC:-$CC}
+MPI_CFLAGS=${MPI_CFLAGS}
+MPI_LIBS=${MPI_LIBS}
+
+MPE_LIBNAME=${MPE_LIBNAME:-mpe}
+PROF_LIBNAME="$MPE_LIBNAME"
+PROF_LIBS="-l$PROF_LIBNAME"
+
+dnl Fixup for make
+PAC_MAKE_IS_GNUMAKE
+PAC_MAKE_IS_BSD44
+PAC_MAKE_IS_OSF
+PAC_MAKE_VPATH
+AC_SUBST(MAKE)
+
+dnl If we are relying on vpath and no vpath is set, then we must exit
+if test ! -s include/mpe_misc.h -a -z "$VPATH" ; then
+ AC_MSG_ERROR( [No virtual MAKE path command found.
+ You may need to set your make command
+ The GNU make (sometimes available as gnumake) can be used.] )
+fi
+
+dnl CPRP is the version of cp that accepts -r and -p arguments.
+MKDIR=mkdir
+CPRP=cp
+RM=rm
+MV=mv
+AC_SUBST(MKDIR)
+AC_SUBST(CPRP)
+AC_SUBST(RM)
+AC_SUBST(MV)
+
+AC_ARG_ENABLE( mpedbg,
+[--enable-mpedbg - Enable the -mpedbg command-line argument
+ (e.g., errors can start an xterm running
+ a debugger). Only works with some
+ workstation systems when used with MPICH.
+ The default is enable=yes],
+enable_mpedbg=yes )
+dnl
+if test "$enable_mpedbg" = "yes" ; then
+ MPEDBG=yes
+else
+ MPEDBG=no
+fi
+
+if test -z "$nonopt" ; then nonopt=NONE ; fi
+AC_CANONICAL_HOST
+case "$host" in
+ *alpha*)
+ CFLAGS="$CFLAGS -DDBX_IS_OSF"
+ MPI_CFLAGS="$MPI_CFLAGS -DDBX_IS_OSF"
+ host=alpha
+ ;;
+ *rs6000*)
+ host=rs6000
+ CFLAGS="$CFLAGS -DMPI_rs6000"
+ MPI_CFLAGS="$MPI_CFLAGS -DMPI_rs6000"
+ ;;
+ *solaris*)
+ host=solaris
+ CFLAGS="$CFLAGS -DMPI_solaris"
+ MPI_CFLAGS="$MPI_CFLAGS -DMPI_solaris"
+ ;;
+ *linux*)
+ host=linux
+ CFLAGS="$CFLAGS -DMPI_LINUX"
+ MPI_CFLAGS="$MPI_CFLAGS -DMPI_LINUX"
+ ;;
+ *sun4*)
+ host=sun4
+ CFLAGS="$CFLAGS -DMPI_sun4"
+ MPI_CFLAGS="$MPI_CFLAGS -DMPI_sun4"
+ ;;
+ mips-sgi-irix*)
+ host=irix
+ CFLAGS="$CFLAGS -DMPI_IRIX"
+ MPI_CFLAGS="$MPI_CFLAGS -DMPI_IRIX"
+ ;;
+esac
+
+dnl Set the various build directories from their mpe_ prefixed env variables.
+dnl
+dnl includebuild_dir is for all user header files
+dnl libbuild_dir is used for building libraries in before they are installed.
+dnl binbuild_dir is for the scripts/programs
+dnl
+
+rootbuild_dir=`pwd`
+for dir in include lib bin ; do
+ dirname=${dir}build_dir
+ mpe_dirname=mpe_${dirname}
+ eval dirvalue=\$"$dirname"
+ eval $dirname=\$\{${mpe_dirname}\}
+done
+
+for dir in include lib bin ; do
+ dirname=${dir}build_dir
+ eval dirvalue=\$"$dirname"
+ if test -n "$dirvalue" ; then
+ if test ! -d $dirvalue ; then
+ if mkdir -p $dirvalue ; then
+ :
+ else
+ PAC_MSG_ERROR( $enable_softerror,
+ [Could not create directory $dirvalue] )
+ fi
+ fi
+ fi
+done
+
+AC_SUBST(includebuild_dir)
+AC_SUBST(libbuild_dir)
+AC_SUBST(binbuild_dir)
+
+AC_PROG_CC
+AC_OBJEXT
+AC_EXEEXT
+dnl Check for broken handling of common symbols
+dnl PAC_PROG_C_BROKEN_COMMON
+AC_CHECK_PROG(AR, ar, ar, ;)
+AC_PROG_RANLIB
+
+AC_PROG_CC_C_O
+# set CC_DOES_C_O to the value of \${ac_cv_prog_cc_${ac_cc}_c_o}
+eval CC_DOES_C_O=\${ac_cv_prog_cc_${ac_cc}_c_o}
+AC_SUBST(CC_DOES_C_O)
+
+dnl We need to check that this has worked. The autoconf macro is broken
+AC_PROG_CPP
+if test "$CPP" = "/lib/cpp" -a ! -x /lib/cpp ; then
+ AC_MSG_ERROR( [configure could not find a working C preprocessor] )
+fi
+
+DBX_NAME=""
+AC_PATH_PROG(DBX_NAME,dbx)
+dnl if test -z "$DBX_NAME" ; then
+dnl if test -n "$MPICH_WARNING_SEP" ; then echo '>'$MPICH_WARNING_SEP ; fi
+dnl echo "*# Cannot find dbx in your path. You can put dbx in your path and"
+dnl echo "*# reconfigure or else you will not be able to run the debugger code"
+dnl echo "*# using the dbx debugger."
+dnl if test -n "$MPICH_WARNING_SEP" ; then echo '<'$MPICH_WARNING_SEP ; fi
+dnl fi
+#
+GDB_NAME=""
+AC_PATH_PROG(GDB_NAME,gdb)
+dnl if test -z "$GDB_NAME" ; then
+dnl if test -n "$MPICH_WARNING_SEP" ; then echo '>'$MPICH_WARNING_SEP ; fi
+dnl echo "*# Cannot find gdb in your path. You can put gdb in your path and"
+dnl echo "*# reconfigure or else you will not be able to run the debugger code"
+dnl echo "*# using the gdb debugger."
+dnl if test -n "$MPICH_WARNING_SEP" ; then echo '<'$MPICH_WARNING_SEP ; fi
+dnl fi
+
+AC_HEADER_STDC
+AC_C_CONST
+
+dnl Checking for specific functions needed for the package.
+AC_HAVE_FUNCS( sysinfo )
+AC_CHECK_FUNC( uname,
+ AC_DEFINE( HAVE_UNAME, 1,
+ [Define if uname availalble] )
+ haveuname=1 )
+AC_CHECK_FUNC( gethostbyname,
+ AC_DEFINE( HAVE_GETHOSTBYNAME, 1,
+ [Define if gethostbyname available] )
+ havegethostbyname=1 )
+
+dnl Checking Headers
+AC_CHECK_HEADERS( unistd.h stdlib.h string.h netdb.h sys/systeminfo.h sys/types.h)
+
+dnl
+AC_MSG_CHECKING([for sighandler_t])
+AC_TRY_COMPILE([#include <signal.h>],[sighandler_t *f;],
+has_sighandler_t=yes,has_sighandler_t=no)
+AC_MSG_RESULT($has_sighandler_t)
+if test "$has_sighandler_t" = "yes" ; then
+ AC_DEFINE( HAVE_SIGHANDLER_T, 1, [Define if sighandler_t available] )
+fi
+
+dnl kill() may have been missing in headerfile,
+dnl e.g. gcc -ansi removes kill()'s prototype.
+AC_CHECK_FUNCS(kill)
+if test "$ac_cv_func_kill" = "yes" ; then
+ PAC_FUNC_NEEDS_DECL([#include <signal.h>],kill)
+fi
+
+AC_SUBST(MPI_IMPL)
+AC_SUBST(MPE_BUILD_FORTRAN2C)
+AC_SUBST(MPEDBG)
+AC_SUBST(CC)
+AC_SUBST(CLINKER)
+AC_SUBST(CFLAGS)
+AC_SUBST(MPI_CC)
+AC_SUBST(MPI_CFLAGS)
+AC_SUBST(MPI_LIBS)
+AC_SUBST(PROF_LIBNAME)
+
+AC_OUTPUT( Makefile src/Makefile src/dbxerr.c )
Deleted: mpich2/trunk/src/mpe2/src/misc/configure.in
===================================================================
--- mpich2/trunk/src/mpe2/src/misc/configure.in 2012-02-28 23:25:23 UTC (rev 9547)
+++ mpich2/trunk/src/mpe2/src/misc/configure.in 2012-02-28 23:26:34 UTC (rev 9548)
@@ -1,240 +0,0 @@
-dnl
-dnl Caching is usually WRONG for systems with cross-mounted file systems
-dnl (the cache file may correspond to a different system). Since configure
-dnl is not on a performance-critical path, go for robustness over speed.
-dnl
-define([AC_CACHE_LOAD], )dnl
-define([AC_CACHE_SAVE], )dnl
-dnl
-dnl
-AC_INIT()
-AC_PREREQ(2.52)
-AC_CONFIG_HEADER(mpe_misc_conf.h)
-dnl
-echo "Configuring MPE Miscellaneous Library with $ac_configure_args"
-dnl
-dnl Set top_srcdir_abs to be the ABSOLUTE path to the home directory of MPE
-dnl top_srcdir is in relative path.
-if test "X$srcdir" != "X." -a -s $srcdir/include/mpe_misc.h ; then
- top_srcdir_abs=$srcdir
-else
- PAC_GETWD( top_srcdir_abs, include/mpe_misc.h )
-fi
-AC_SUBST(top_srcdir_abs)
-
-AC_ARG_ENABLE( echo,
-[--enable-echo - Turn on strong echoing.
- The default is enable=no.],
-set -x )
-
-AC_ARG_ENABLE( softerror,
-[--enable-softerror - Turn on soft error, i.e. instead of
- issuing MSG_ERROR, MSG_WARN + exit 0
- are used. The default is enable=no.],
-, enable_softerror=${mpe_enable_softerror:-no} )
-
-MAKE=${MAKE:-make}
-MPI_IMPL=${MPI_IMPL:-UserSupplied}
-MPE_BUILD_FORTRAN2C=${MPE_BUILD_FORTRAN2C:-no}
-CC=${CC:-cc}
-CLINKER=${CLINKER:-$CC}
-CFLAGS=${MPE_CFLAGS}
-MPI_CC=${MPI_CC:-$CC}
-MPI_CFLAGS=${MPI_CFLAGS}
-MPI_LIBS=${MPI_LIBS}
-
-MPE_LIBNAME=${MPE_LIBNAME:-mpe}
-PROF_LIBNAME="$MPE_LIBNAME"
-PROF_LIBS="-l$PROF_LIBNAME"
-
-dnl Fixup for make
-PAC_MAKE_IS_GNUMAKE
-PAC_MAKE_IS_BSD44
-PAC_MAKE_IS_OSF
-PAC_MAKE_VPATH
-AC_SUBST(MAKE)
-
-dnl If we are relying on vpath and no vpath is set, then we must exit
-if test ! -s include/mpe_misc.h -a -z "$VPATH" ; then
- AC_MSG_ERROR( [No virtual MAKE path command found.
- You may need to set your make command
- The GNU make (sometimes available as gnumake) can be used.] )
-fi
-
-dnl CPRP is the version of cp that accepts -r and -p arguments.
-MKDIR=mkdir
-CPRP=cp
-RM=rm
-MV=mv
-AC_SUBST(MKDIR)
-AC_SUBST(CPRP)
-AC_SUBST(RM)
-AC_SUBST(MV)
-
-AC_ARG_ENABLE( mpedbg,
-[--enable-mpedbg - Enable the -mpedbg command-line argument
- (e.g., errors can start an xterm running
- a debugger). Only works with some
- workstation systems when used with MPICH.
- The default is enable=yes],
-enable_mpedbg=yes )
-dnl
-if test "$enable_mpedbg" = "yes" ; then
- MPEDBG=yes
-else
- MPEDBG=no
-fi
-
-if test -z "$nonopt" ; then nonopt=NONE ; fi
-AC_CANONICAL_HOST
-case "$host" in
- *alpha*)
- CFLAGS="$CFLAGS -DDBX_IS_OSF"
- MPI_CFLAGS="$MPI_CFLAGS -DDBX_IS_OSF"
- host=alpha
- ;;
- *rs6000*)
- host=rs6000
- CFLAGS="$CFLAGS -DMPI_rs6000"
- MPI_CFLAGS="$MPI_CFLAGS -DMPI_rs6000"
- ;;
- *solaris*)
- host=solaris
- CFLAGS="$CFLAGS -DMPI_solaris"
- MPI_CFLAGS="$MPI_CFLAGS -DMPI_solaris"
- ;;
- *linux*)
- host=linux
- CFLAGS="$CFLAGS -DMPI_LINUX"
- MPI_CFLAGS="$MPI_CFLAGS -DMPI_LINUX"
- ;;
- *sun4*)
- host=sun4
- CFLAGS="$CFLAGS -DMPI_sun4"
- MPI_CFLAGS="$MPI_CFLAGS -DMPI_sun4"
- ;;
- mips-sgi-irix*)
- host=irix
- CFLAGS="$CFLAGS -DMPI_IRIX"
- MPI_CFLAGS="$MPI_CFLAGS -DMPI_IRIX"
- ;;
-esac
-
-dnl Set the various build directories from their mpe_ prefixed env variables.
-dnl
-dnl includebuild_dir is for all user header files
-dnl libbuild_dir is used for building libraries in before they are installed.
-dnl binbuild_dir is for the scripts/programs
-dnl
-
-rootbuild_dir=`pwd`
-for dir in include lib bin ; do
- dirname=${dir}build_dir
- mpe_dirname=mpe_${dirname}
- eval dirvalue=\$"$dirname"
- eval $dirname=\$\{${mpe_dirname}\}
-done
-
-for dir in include lib bin ; do
- dirname=${dir}build_dir
- eval dirvalue=\$"$dirname"
- if test -n "$dirvalue" ; then
- if test ! -d $dirvalue ; then
- if mkdir -p $dirvalue ; then
- :
- else
- PAC_MSG_ERROR( $enable_softerror,
- [Could not create directory $dirvalue] )
- fi
- fi
- fi
-done
-
-AC_SUBST(includebuild_dir)
-AC_SUBST(libbuild_dir)
-AC_SUBST(binbuild_dir)
-
-AC_PROG_CC
-AC_OBJEXT
-AC_EXEEXT
-dnl Check for broken handling of common symbols
-dnl PAC_PROG_C_BROKEN_COMMON
-AC_CHECK_PROG(AR, ar, ar, ;)
-AC_PROG_RANLIB
-
-AC_PROG_CC_C_O
-# set CC_DOES_C_O to the value of \${ac_cv_prog_cc_${ac_cc}_c_o}
-eval CC_DOES_C_O=\${ac_cv_prog_cc_${ac_cc}_c_o}
-AC_SUBST(CC_DOES_C_O)
-
-dnl We need to check that this has worked. The autoconf macro is broken
-AC_PROG_CPP
-if test "$CPP" = "/lib/cpp" -a ! -x /lib/cpp ; then
- AC_MSG_ERROR( [configure could not find a working C preprocessor] )
-fi
-
-DBX_NAME=""
-AC_PATH_PROG(DBX_NAME,dbx)
-dnl if test -z "$DBX_NAME" ; then
-dnl if test -n "$MPICH_WARNING_SEP" ; then echo '>'$MPICH_WARNING_SEP ; fi
-dnl echo "*# Cannot find dbx in your path. You can put dbx in your path and"
-dnl echo "*# reconfigure or else you will not be able to run the debugger code"
-dnl echo "*# using the dbx debugger."
-dnl if test -n "$MPICH_WARNING_SEP" ; then echo '<'$MPICH_WARNING_SEP ; fi
-dnl fi
-#
-GDB_NAME=""
-AC_PATH_PROG(GDB_NAME,gdb)
-dnl if test -z "$GDB_NAME" ; then
-dnl if test -n "$MPICH_WARNING_SEP" ; then echo '>'$MPICH_WARNING_SEP ; fi
-dnl echo "*# Cannot find gdb in your path. You can put gdb in your path and"
-dnl echo "*# reconfigure or else you will not be able to run the debugger code"
-dnl echo "*# using the gdb debugger."
-dnl if test -n "$MPICH_WARNING_SEP" ; then echo '<'$MPICH_WARNING_SEP ; fi
-dnl fi
-
-AC_HEADER_STDC
-AC_C_CONST
-
-dnl Checking for specific functions needed for the package.
-AC_HAVE_FUNCS( sysinfo )
-AC_CHECK_FUNC( uname,
- AC_DEFINE( HAVE_UNAME, 1,
- [Define if uname availalble] )
- haveuname=1 )
-AC_CHECK_FUNC( gethostbyname,
- AC_DEFINE( HAVE_GETHOSTBYNAME, 1,
- [Define if gethostbyname available] )
- havegethostbyname=1 )
-
-dnl Checking Headers
-AC_CHECK_HEADERS( unistd.h stdlib.h string.h netdb.h sys/systeminfo.h sys/types.h)
-
-dnl
-AC_MSG_CHECKING([for sighandler_t])
-AC_TRY_COMPILE([#include <signal.h>],[sighandler_t *f;],
-has_sighandler_t=yes,has_sighandler_t=no)
-AC_MSG_RESULT($has_sighandler_t)
-if test "$has_sighandler_t" = "yes" ; then
- AC_DEFINE( HAVE_SIGHANDLER_T, 1, [Define if sighandler_t available] )
-fi
-
-dnl kill() may have been missing in headerfile,
-dnl e.g. gcc -ansi removes kill()'s prototype.
-AC_CHECK_FUNCS(kill)
-if test "$ac_cv_func_kill" = "yes" ; then
- PAC_FUNC_NEEDS_DECL([#include <signal.h>],kill)
-fi
-
-AC_SUBST(MPI_IMPL)
-AC_SUBST(MPE_BUILD_FORTRAN2C)
-AC_SUBST(MPEDBG)
-AC_SUBST(CC)
-AC_SUBST(CLINKER)
-AC_SUBST(CFLAGS)
-AC_SUBST(MPI_CC)
-AC_SUBST(MPI_CFLAGS)
-AC_SUBST(MPI_LIBS)
-AC_SUBST(PROF_LIBNAME)
-
-AC_OUTPUT( Makefile src/Makefile src/dbxerr.c )
Modified: mpich2/trunk/src/mpe2/src/slog2sdk/README.sdk
===================================================================
--- mpich2/trunk/src/mpe2/src/slog2sdk/README.sdk 2012-02-28 23:25:23 UTC (rev 9547)
+++ mpich2/trunk/src/mpe2/src/slog2sdk/README.sdk 2012-02-28 23:26:34 UTC (rev 9548)
@@ -126,7 +126,7 @@
IMPL_CSRC defines the C programs needed to build a TRACE-API implementation.
If you are interested to modify the name of the utility program like
traceprint and traceTOslog2 to something more meaningful, you need
-to change TRACE_NAME define configure.in. The TRACE_NAME replaces
+to change TRACE_NAME define configure.ac. The TRACE_NAME replaces
the prefix "trace" in traceprint and traceTOslog2. Remember to run
autoconf afterward. If you need to add extra system header files to
be checked by autoconf, e.g. through AC_CHECK_HEAEDERS, you need to
Modified: mpich2/trunk/src/mpe2/src/slog2sdk/autogen.sh
===================================================================
--- mpich2/trunk/src/mpe2/src/slog2sdk/autogen.sh 2012-02-28 23:25:23 UTC (rev 9547)
+++ mpich2/trunk/src/mpe2/src/slog2sdk/autogen.sh 2012-02-28 23:26:34 UTC (rev 9548)
@@ -16,8 +16,8 @@
if test ! -d .tmp ; then
mkdir .tmp 2>&1 >/dev/null
fi
-rm -f .tmp/configure.in .tmp/configure
-cat >.tmp/configure.in <<EOF
+rm -f .tmp/configure.ac .tmp/configure
+cat >.tmp/configure.ac <<EOF
AC_PREREQ(2.52)
EOF
if (cd .tmp && $SLOG2_AUTOCONF >/dev/null 2>&1 ) ; then
@@ -50,9 +50,9 @@
# The parent directory of where this script is located
pgmdir="`dirname $0`"
master_dir=`(cd $pgmdir && pwd)`
-cfgins=`find $master_dir -name 'configure.in' -print`
+cfgins=`find $master_dir -name 'configure.ac' -print`
-# Locate all configure.ins that need libtoolize.
+# Locate all configure.acs that need libtoolize.
for cfgin in $cfgins ; do
dir="`dirname $cfgin`"
if [ -n "`grep AC_PROG_LIBTOOL $cfgin`" ] ; then
@@ -61,7 +61,7 @@
fi
done
-# Locate all the configure.in under master_dir to invoke autoconf.
+# Locate all the configure.ac under master_dir to invoke autoconf.
for cfgin in $cfgins ; do
dir="`dirname $cfgin`"
if [ -n "`grep AC_CONFIG_HEADER $cfgin`" ] ; then
Copied: mpich2/trunk/src/mpe2/src/slog2sdk/configure.ac (from rev 9546, mpich2/trunk/src/mpe2/src/slog2sdk/configure.in)
===================================================================
--- mpich2/trunk/src/mpe2/src/slog2sdk/configure.ac (rev 0)
+++ mpich2/trunk/src/mpe2/src/slog2sdk/configure.ac 2012-02-28 23:26:34 UTC (rev 9548)
@@ -0,0 +1,517 @@
+#! /bin/sh
+dnl
+dnl Caching is usually WRONG for systems with cross-mounted file systems
+dnl (the cache file may correspond to a different system). Since configure
+dnl is not on a performance-critical path, go for robustness over speed.
+dnl
+define([AC_CACHE_LOAD], )dnl
+define([AC_CACHE_SAVE], )dnl
+dnl
+dnl
+AC_INIT()
+AC_PREREQ(2.52)
+AC_CONFIG_AUX_DIR([.])
+
+AC_ARG_ENABLE(echo,
+[--enable-echo - Turn on strong echoing. The default
+ is enable=no.] ,set -x)
+
+AC_ARG_ENABLE(softerror,
+[--enable-softerror - Turn on soft error, i.e. instead of
+ issuing MSG_ERROR, MSG_WARN + exit 0
+ are used. The default is enable=no.],
+, enable_softerror=${slog2_enable_softerror:-no})
+
+AC_ARG_ENABLE(swingcheck,
+[--enable-swingcheck - Turn on the Swing checking code.
+ The default is enable=yes],
+, enable_swingcheck=yes)
+
+AC_ARG_ENABLE(jdb,
+[--enable-jdb - Turn on the use of jdb to run the GUI.
+ The default is enable=no],
+,enable_jdb=no)
+
+# Find the home directory if not specified
+if test "X$srcdir" != "X." -a -s $srcdir/bin/jumpshot.in ; then
+ top_srcdir_abs=$srcdir
+else
+ PAC_GETWD(top_srcdir_abs,./bin/jumpshot.in)
+fi
+
+if test -z "$top_srcdir_abs" ; then
+ top_srcdir_abs=`pwd`
+fi
+
+if test ! -d "$top_srcdir_abs" ; then
+ PAC_MSG_ERROR($enable_softerror, [*** $top_srcdir_abs is not a valid directory - cannot continue])
+fi
+
+AC_SUBST(top_srcdir_abs)
+
+# Determine this package's name based on its directory name
+changequote(,)dnl
+tmpname="`echo $top_srcdir_abs | sed -e 's%\(.*\)/\([^/]*\)%\2%'`"
+pkgname="`echo $tmpname | sed -e 'y%abcdefghijklmnopqrstuvwxyz/%ABCDEFGHIJKLMNOPQRSTUVWXYZ_%'`"
+changequote([,])dnl
+if test "x$pkgname" = "x" ; then
+ pkgname="SLOG-2/Jumpshot-4"
+fi
+
+echo "Configuring $pkgname with $ac_configure_args"
+#
+# Cannot use JAVA_HOME here in this configure.ac.
+# Because JAVA_HOME is used in Blackdown's .java_wrapper in jdk117_v3
+# Using JAVA_HOME here would mistakenly set some variable in .java_wrapper
+# when .java_wrapper is invoked. i.e. causes mysterious error in tests.
+AC_ARG_WITH(java,
+[--with-java=JRE_TOPDIR - The path of the top-level directory of
+ the Java installation. If this option
+ or with-java2 is not given, configure
+ will try to locate java for you. Also,
+ with-java2 option overwrites the
+ with-java option to set JRE_TOPDIR.],
+JRE_TOPDIR=$withval, JRE_TOPDIR="")
+
+AC_ARG_WITH(java2,
+[--with-java2=JRE_TOPDIR - The path of the top-level directory of
+ the Java installation. If this option
+ or with-java is not given, configure will
+ try to locate java for you. Also,
+ with-java2 option overwrites the
+ with-java option to set JRE_TOPDIR.],
+JRE_TOPDIR=$withval, )
+
+AC_ARG_WITH(jvmflags,
+[--with-jvmflags=JVMFLAGS - supply java virtual machine flags, e.g.
+ -Xms32m -Xmx256m.],
+JVMFLAGS="$withval", )
+
+AC_ARG_WITH(trace_libdir,
+[--with-trace-libdir=TRACE_LIBDIR - The path to the user-defined
+ TRACE-API shared library, i.e.
+ libTraceInput.so/TraceInput.dll.
+ This option creates 2 extra utility
+ programs: traceprint and traceTOslog2.],
+TRACE_LIBDIR=$withval, )
+
+AC_ARG_WITH(trace_name,
+[--with-trace-name=TRACE_NAME - The new name prefix that replaces
+ the word trace in the utility programs
+ traceprint and traceTOslog2.],
+TRACE_NAME=$withval, )
+
+# Fixup for make
+MAKE=${MAKE:-make}
+PAC_MAKE_IS_GNUMAKE
+PAC_MAKE_IS_BSD44
+PAC_MAKE_IS_OSF
+PAC_MAKE_VPATH
+# If we are relying on VPATH and no VPATH is set, then we must exit
+if test ! -s bin/jumpshot.in -a -z "$VPATH" ; then
+ AC_MSG_ERROR([No virtual MAKE path command found.
+ You may need to set your make command.
+ The GNU make (sometimes available as gnumake) can be used.])
+fi
+AC_SUBST(MAKE)
+
+dnl checking for working INSTALL
+AC_PROG_INSTALL
+PAC_PROG_CHECK_INSTALL_WORKS
+
+CPRP=cp
+MKDIR=mkdir
+RM="rm -f"
+MV="mv -f"
+AC_SUBST(RM)
+
+# Check if --without-java is specified
+if test "$JRE_TOPDIR" = "no" ; then
+ PAC_MSG_ERROR($enable_softerror, [--without-java is specified, exit!])
+fi
+
+if test $enable_jdb = "yes" ; then
+ pac_JVM=jdb
+# Assume jdb is working
+ is_jvm_working=yes
+else
+ pac_JVM=java
+
+ JAC_CHECK_CLASSPATH
+ is_jvm_working=no
+#
+dnl JVM="$JRE_TOPDIR/bin/$pac_JVM" is used in JAC_PATH_PROG
+ JAC_PATH_PROG(JVM, $pac_JVM, [
+dnl Initialize the checking flag.
+ jac_java_working=yes
+dnl
+ if test "$jac_java_working" = "yes" ; then
+ AC_MSG_CHECKING([if $JVM runs simple java class])
+ JAC_TRY_RUN([$JVM], [$JVMFLAGS],
+ [ac_javatest/simple.class],
+ [jac_java_working=yes], [jac_java_working=no])
+ if test "$jac_java_working" = "yes" ; then
+ AC_MSG_RESULT(yes)
+ else
+ AC_MSG_RESULT(no)
+ fi
+ fi
+dnl
+ if test "$jac_java_working" = "yes" ; then
+ AC_MSG_CHECKING([if $JVM runs simple jar file])
+ JAC_TRY_RUNJAR([$JVM], [$JVMFLAGS],
+ [ac_javatest/simple.jar],
+ [jac_java_working=yes], [jac_java_working=no])
+ if test "$jac_java_working" = "yes" ; then
+ AC_MSG_RESULT(yes)
+ else
+ AC_MSG_RESULT(no)
+ fi
+ fi
+dnl
+ if test "$jac_java_working" = "yes" ; then
+ AC_MSG_CHECKING([if $JVM runs non-GUI tool])
+ JAC_TRY_RUNJAR([$JVM], [$JVMFLAGS],
+ [ac_javatest/awt_color.jar],
+ [jac_java_working=yes], [jac_java_working=no])
+ if test "$jac_java_working" = "no" ; then
+ JAC_TRY_RUNJAR([$JVM], [$JVMFLAGS -Djava.awt.headless=true],
+ [ac_javatest/awt_color.jar],
+ [jac_java_working=yes], [jac_java_working=no])
+ if test "$jac_java_working" = "yes" ; then
+ AC_MSG_RESULT([-Djava.awt.headless=true])
+ NONGUI_JVMFLAGS="-Djava.awt.headless=true"
+ else
+ AC_MSG_RESULT(no)
+ fi
+ else
+ AC_MSG_RESULT(yes)
+ fi
+ fi
+dnl
+ if test "$jac_java_working" = "yes" \
+ -a "$enable_swingcheck" = "yes" ; then
+ AC_MSG_CHECKING([if $JVM runs simple Swing class])
+ JAC_TRY_RUN([$JVM], [$JVMFLAGS],
+ [ac_javatest/simple_swing.class],
+ [jac_java_working=yes], [jac_java_working=no])
+ if test "$jac_java_working" = "yes" ; then
+ AC_MSG_RESULT(yes)
+ else
+ AC_MSG_RESULT(no)
+ fi
+ fi
+dnl
+ if test "$jac_java_working" = "yes" \
+ -a "$enable_swingcheck" = "yes" ; then
+ AC_MSG_CHECKING([if $JVM runs simple Swing jar file])
+ JAC_TRY_RUNJAR([$JVM], [$JVMFLAGS],
+ [ac_javatest/simple_swing.jar],
+ [jac_java_working=yes], [jac_java_working=no])
+ if test "$jac_java_working" = "yes" ; then
+ AC_MSG_RESULT(yes)
+ else
+ AC_MSG_RESULT(no)
+ fi
+ fi
+dnl
+ if test "$jac_java_working" = "yes" ; then
+ jac_prog_working=yes
+ else
+ jac_prog_working=no
+ fi
+ ])
+ AC_SUBST(NONGUI_JVMFLAGS)
+# If JVM still hasn't been found, we need to abort!
+ if test "x$JVM" = "x" ; then
+ PAC_MSG_ERROR($enable_softerror,
+ [No Java Virtual Machine can be found anywhere!])
+ fi
+ is_jvm_working=yes
+fi
+
+# CHECK the version of Java used
+# Filter out the version of JDK that causes problem
+if test "$enable_jdb" = "no" ; then
+ AC_MSG_CHECKING(for Java version)
+ VERSION=`$JVM -fullversion 2>&1`
+ case "$VERSION" in
+ *1.0.*)
+ AC_MSG_RESULT([$VERSION, i.e. the oldest Java])
+ AC_MSG_WARN([Java $VERSION is too old to be used with $pkgname !])
+ ;;
+ *1.1.*)
+ AC_MSG_RESULT([$VERSION, i.e. Java 1 SDK])
+ AC_MSG_WARN([Java $VERSION is too old to be used with $pkgname !])
+ ;;
+ *)
+ AC_MSG_RESULT([$VERSION, i.e. Java 2 SDK])
+ ;;
+ esac
+fi
+
+if test "$is_jvm_working" = "no" ; then
+ PAC_MSG_ERROR($enable_softerror,
+ [$pkgname can be used with Java 2 Run Time Environment,
+ i.e. j2sdk 1.2.2 or newer.])
+fi
+
+AC_SUBST(JVMFLAGS)
+AC_SUBST(JVM)
+
+JAC_CHECK_CYGPATH(JPATH_START, JPATH_FINAL)
+AC_SUBST(JPATH_START)
+AC_SUBST(JPATH_FINAL)
+
+#
+# Naming the various build directories, don't inherit them from environment
+#
+rootbuild_dir=`pwd`
+for dir in lib bin doc etc share sbin ; do
+ dirname=${dir}build_dir
+ eval dirvalue=\$"$dirname"
+ eval $dirname=$rootbuild_dir/$dir
+done
+
+# VPATH build: Set the libbuild_dir
+if test ! -d $libbuild_dir -a -d $srcdir/lib ; then
+ AC_MSG_NOTICE([creating $libbuild_dir from source])
+ $CPRP -pr $srcdir/lib $libbuild_dir
+fi
+AC_SUBST(libbuild_dir)
+
+# VPATH: Set the binbuild_dir
+if test ! -d $binbuild_dir ; then
+ AC_MSG_NOTICE([creating directory $binbuild_dir])
+ $MKDIR $binbuild_dir
+fi
+AC_SUBST(binbuild_dir)
+
+# VPATH build: Set the docbuild_dir
+if test ! -d $docbuild_dir -a -d $srcdir/doc ; then
+ AC_MSG_NOTICE([creating $docbuild_dir from source])
+ $CPRP -pr $srcdir/doc $docbuild_dir
+ $RM -r $docbuild_dir/old
+fi
+AC_SUBST(docbuild_dir)
+
+# VPATH build: Set the etcbuild_dir
+if test ! -d $etcbuild_dir -a -d $srcdir/etc ; then
+ AC_MSG_NOTICE([creating $etcbuild_dir from source])
+ $CPRP -pr $srcdir/etc $etcbuild_dir
+fi
+AC_SUBST(etcbuild_dir)
+
+# VPATH build: Set the sharebuild_dir
+if test ! -d $sharebuild_dir ; then
+ AC_MSG_NOTICE([creating directory $sharebuild_dir])
+ $MKDIR $sharebuild_dir
+fi
+AC_SUBST(sharebuild_dir)
+
+logfilesbuild_dir="$sharebuild_dir/examples/logfiles"
+if test ! -d $logfilesbuild_dir ; then
+ AC_MSG_NOTICE([creating directory $logfilesbuild_dir])
+ AS_MKDIR_P($logfilesbuild_dir)
+fi
+
+# Copying $srcdir/logfiles to sharebuild_dir
+if test -d $srcdir/logfiles ; then
+ AC_MSG_NOTICE([creating sample logfiles from source])
+ $CPRP -pr $srcdir/logfiles/*.clog* $logfilesbuild_dir
+ $CPRP -pr $srcdir/logfiles/*.slog* $logfilesbuild_dir
+fi
+
+AC_SUBST(sbinbuild_dir)
+
+# Options to disselect individual subpackage
+# slog2_enable_{build|source|sample|rlog} are env. variables set by MPE2
+AC_ARG_ENABLE(build,
+[--enable-build - Build the jar files from the java source
+ and the sample TRACE-API implementation.
+ Java Standard Development Kit, SDK,
+ is needed. The default is enable=yes.],
+,enable_build=${slog2_enable_build:-yes})
+
+AC_ARG_ENABLE(source,
+[--enable-source - Build the jar files from the java source.
+ Java Standard Development Kit, SDK,
+ is needed. The default is enable=yes.],
+,enable_source=${slog2_enable_source:-yes})
+
+AC_ARG_ENABLE(sample,
+[--enable-sample - Build sample TRACE-API implementation.
+ Java Standard Development Kit, SDK,
+ is needed. The default is enable=yes.],
+,enable_sample=${slog2_enable_sample:-yes})
+
+AC_ARG_ENABLE(rlog,
+[--enable-rlog - Build RLOG TRACE-API implementation.
+ Java Standard Development Kit, SDK,
+ is needed. The default is enable=yes.],
+,enable_rlog=${slog2_enable_rlog:-yes})
+
+AC_ARG_ENABLE(clog,
+[--enable-clog - Build CLOG related wrappers, e.g.
+ clog2TOslog2, clog2print....
+ The default is enable=yes.],
+,enable_clog=${slog2_enable_clog:-yes})
+
+AC_ARG_WITH(oldsource,
+[--with-oldsource=OLD_SRCDIR - Build the old jar files from the given OLD
+ Java source and to build slog2updater.
+ This option is ignored if --enable-source
+ is turned off. The option should be set
+ with a valid directory name. e.g. src_205,
+ then --with-oldsource=src_205.
+ The default is no.],
+,with_oldsource="")
+
+if test "$enable_build" = "no" ; then
+ enable_source=no;
+ enable_sample=no;
+ enable_rlog=no;
+fi
+
+# The XXX in XXX_dirname below must match with AC_ARG_ENABLE( XXX, .. ) above
+source_dirname="src"
+sample_dirname="trace_sample"
+rlog_dirname="trace_rlog"
+
+trial_pkgs="source sample rlog"
+
+# The XXX in XXX_dirname below must match with AC_ARG_WITH( XXX, .. ) above
+if test "$enable_source" = "yes" \
+ -a "X$with_oldsource" != "X" ; then
+ oldsource_dirname="$with_oldsource"
+ trial_pkgs="$trial_pkgs oldsource"
+fi
+
+dnl Cleanup the subpackages\' Makefiles if they exist
+AC_MSG_CHECKING( [for leftover Makefiles in subpackages] )
+leftover_pkgs=""
+for pkg in $trial_pkgs ; do
+ dirname=${pkg}_dirname
+ eval dirvalue=\$"$dirname"
+ if test -s $rootbuild_dir/$dirvalue/Makefile ; then
+ leftover_pkgs="$leftover_pkgs \"$dirvalue\""
+ ( cd $rootbuild_dir/$dirvalue && $MAKE distclean > /dev/null 2>&1 )
+ if test -f $rootbuild_dir/$dirvalue/Makefile ; then
+ $RM $rootbuild_dir/$dirvalue/Makefile
+ fi
+ fi
+done
+if test "X$leftover_pkgs" = "X" ; then
+ AC_MSG_RESULT( [none] )
+else
+ AC_MSG_RESULT( [$leftover_pkgs cleaned] )
+fi
+
+# Enable softerror for all subpackages,
+# i.e. use AC_MSG_WARN instead of AC_MSG_ERROR
+slog2_enable_softerror=yes
+export slog2_enable_softerror
+selected_pkgs=""
+if test "$enable_source" = "yes" \
+ -a -s $srcdir/src/configure ; then
+ selected_pkgs="$selected_pkgs source"
+ AC_CONFIG_SUBDIRS(src)
+fi
+if test "$enable_sample" = "yes" \
+ -a -s $srcdir/trace_sample/configure ; then
+ selected_pkgs="$selected_pkgs sample"
+ AC_CONFIG_SUBDIRS(trace_sample)
+fi
+if test "$enable_rlog" = "yes" \
+ -a -s $srcdir/trace_rlog/configure ; then
+ selected_pkgs="$selected_pkgs rlog"
+ AC_CONFIG_SUBDIRS(trace_rlog)
+fi
+if test "X$with_oldsource" != "X" \
+ -a -s $srcdir/$oldsource_dirname/configure ; then
+ selected_pkgs="$selected_pkgs oldsource"
+ AC_CONFIG_SUBDIRS([$oldsource_dirname])
+fi
+# Define bindir's executables, and pass them down to sbindir's install-package
+BASIC_PGMS="slog2print slog2navigator slog2filter slog2updater logconvertor jumpshot"
+TRACE_PGMS="traceprint traceTOslog2"
+
+CLOG_PGMS="clogprint clogTOslog2 clog2print clog2TOslog2"
+if test "$enable_clog" = "yes" ; then
+ BASIC_PGMS="$BASIC_PGMS $CLOG_PGMS"
+fi
+
+if test "x$TRACE_LIBDIR" != "x" ; then
+ AC_MSG_CHECKING([for libTraceInput.so and TraceInput.dll])
+ if test -f "$TRACE_LIBDIR/libTraceInput.so" \
+ -o -f "$TRACE_LIBDIR/TraceInput.dll" ; then
+ AC_MSG_RESULT(yes)
+ AC_SUBST(TRACE_LIBDIR)
+ has_tracelib=yes
+ else
+ AC_MSG_RESULT(no)
+ has_tracelib=no
+ fi
+fi
+
+PATH_EXEFILES="sbin/install-package"
+EXTRA_PGMS=""
+if test "$has_tracelib" = "yes" ; then
+ for exefile in $BASIC_PGMS $TRACE_PGMS ; do
+ PATH_EXEFILES="$PATH_EXEFILES bin/$exefile"
+ done
+# define EXTRA_PGMS to be renamed TRACE_PGMS according to the TRACE_NAME
+ if test "x$TRACE_NAME" != "x" -a "$TRACE_NAME" != "trace" ; then
+ for oldpgm in $TRACE_PGMS ; do
+ newpgm=$TRACE_NAME`echo $oldpgm | sed -e 's%trace%%'`
+ EXTRA_PGMS="$EXTRA_PGMS $newpgm"
+ done
+ else
+ EXTRA_PGMS="$TRACE_PGMS"
+ fi
+else
+ for exefile in $BASIC_PGMS ; do
+ PATH_EXEFILES="$PATH_EXEFILES bin/$exefile"
+ done
+fi
+
+# EXEFILES is used in sbin/install-package.in, so EXEFILES needs updated names.
+EXEFILES="$BASIC_PGMS $EXTRA_PGMS"
+AC_SUBST(EXEFILES)
+
+AC_OUTPUT(Makefile $PATH_EXEFILES)
+
+for script in $PATH_EXEFILES ; do
+ if test -f "$script" ; then
+ chmod a+x $script
+ else
+ PAC_MSG_ERROR($enable_softerror, [$script is not a valid file - Make sure you have configured with a valid $pkgname source directory])
+ fi
+done
+
+if test "$has_tracelib" = "yes" ; then
+# Rename all the scripts in bindir according to the TRACE_NAME
+ if test "x$TRACE_NAME" != "x" -a "$TRACE_NAME" != "trace" ; then
+ for oldpgm in $TRACE_PGMS ; do
+ if test -x "bin/$oldpgm" ; then
+ newpgm=$TRACE_NAME`echo $oldpgm | sed -e 's%trace%%'`
+ $MV bin/$oldpgm bin/$newpgm
+ fi
+ done
+ fi
+fi
+
+configured_pkgs=""
+for pkg in $selected_pkgs ; do
+ dirname=${pkg}_dirname
+ eval dirvalue=\$"$dirname"
+ if test -s $dirvalue/Makefile ; then
+ configured_pkgs="$configured_pkgs \"$dirvalue\""
+ fi
+done
+
+if test -z "$configured_pkgs" ; then
+ AC_MSG_WARN([$pkgname: No sub-package has been configured])
+else
+ AC_MSG_RESULT([$pkgname: $configured_pkgs have been configured])
+fi
Deleted: mpich2/trunk/src/mpe2/src/slog2sdk/configure.in
===================================================================
--- mpich2/trunk/src/mpe2/src/slog2sdk/configure.in 2012-02-28 23:25:23 UTC (rev 9547)
+++ mpich2/trunk/src/mpe2/src/slog2sdk/configure.in 2012-02-28 23:26:34 UTC (rev 9548)
@@ -1,517 +0,0 @@
-#! /bin/sh
-dnl
-dnl Caching is usually WRONG for systems with cross-mounted file systems
-dnl (the cache file may correspond to a different system). Since configure
-dnl is not on a performance-critical path, go for robustness over speed.
-dnl
-define([AC_CACHE_LOAD], )dnl
-define([AC_CACHE_SAVE], )dnl
-dnl
-dnl
-AC_INIT()
-AC_PREREQ(2.52)
-AC_CONFIG_AUX_DIR([.])
-
-AC_ARG_ENABLE(echo,
-[--enable-echo - Turn on strong echoing. The default
- is enable=no.] ,set -x)
-
-AC_ARG_ENABLE(softerror,
-[--enable-softerror - Turn on soft error, i.e. instead of
- issuing MSG_ERROR, MSG_WARN + exit 0
- are used. The default is enable=no.],
-, enable_softerror=${slog2_enable_softerror:-no})
-
-AC_ARG_ENABLE(swingcheck,
-[--enable-swingcheck - Turn on the Swing checking code.
- The default is enable=yes],
-, enable_swingcheck=yes)
-
-AC_ARG_ENABLE(jdb,
-[--enable-jdb - Turn on the use of jdb to run the GUI.
- The default is enable=no],
-,enable_jdb=no)
-
-# Find the home directory if not specified
-if test "X$srcdir" != "X." -a -s $srcdir/bin/jumpshot.in ; then
- top_srcdir_abs=$srcdir
-else
- PAC_GETWD(top_srcdir_abs,./bin/jumpshot.in)
-fi
-
-if test -z "$top_srcdir_abs" ; then
- top_srcdir_abs=`pwd`
-fi
-
-if test ! -d "$top_srcdir_abs" ; then
- PAC_MSG_ERROR($enable_softerror, [*** $top_srcdir_abs is not a valid directory - cannot continue])
-fi
-
-AC_SUBST(top_srcdir_abs)
-
-# Determine this package's name based on its directory name
-changequote(,)dnl
-tmpname="`echo $top_srcdir_abs | sed -e 's%\(.*\)/\([^/]*\)%\2%'`"
-pkgname="`echo $tmpname | sed -e 'y%abcdefghijklmnopqrstuvwxyz/%ABCDEFGHIJKLMNOPQRSTUVWXYZ_%'`"
-changequote([,])dnl
-if test "x$pkgname" = "x" ; then
- pkgname="SLOG-2/Jumpshot-4"
-fi
-
-echo "Configuring $pkgname with $ac_configure_args"
-#
-# Cannot use JAVA_HOME here in this configure.in.
-# Because JAVA_HOME is used in Blackdown's .java_wrapper in jdk117_v3
-# Using JAVA_HOME here would mistakenly set some variable in .java_wrapper
-# when .java_wrapper is invoked. i.e. causes mysterious error in tests.
-AC_ARG_WITH(java,
-[--with-java=JRE_TOPDIR - The path of the top-level directory of
- the Java installation. If this option
- or with-java2 is not given, configure
- will try to locate java for you. Also,
- with-java2 option overwrites the
- with-java option to set JRE_TOPDIR.],
-JRE_TOPDIR=$withval, JRE_TOPDIR="")
-
-AC_ARG_WITH(java2,
-[--with-java2=JRE_TOPDIR - The path of the top-level directory of
- the Java installation. If this option
- or with-java is not given, configure will
- try to locate java for you. Also,
- with-java2 option overwrites the
- with-java option to set JRE_TOPDIR.],
-JRE_TOPDIR=$withval, )
-
-AC_ARG_WITH(jvmflags,
-[--with-jvmflags=JVMFLAGS - supply java virtual machine flags, e.g.
- -Xms32m -Xmx256m.],
-JVMFLAGS="$withval", )
-
-AC_ARG_WITH(trace_libdir,
-[--with-trace-libdir=TRACE_LIBDIR - The path to the user-defined
- TRACE-API shared library, i.e.
- libTraceInput.so/TraceInput.dll.
- This option creates 2 extra utility
- programs: traceprint and traceTOslog2.],
-TRACE_LIBDIR=$withval, )
-
-AC_ARG_WITH(trace_name,
-[--with-trace-name=TRACE_NAME - The new name prefix that replaces
- the word trace in the utility programs
- traceprint and traceTOslog2.],
-TRACE_NAME=$withval, )
-
-# Fixup for make
-MAKE=${MAKE:-make}
-PAC_MAKE_IS_GNUMAKE
-PAC_MAKE_IS_BSD44
-PAC_MAKE_IS_OSF
-PAC_MAKE_VPATH
-# If we are relying on VPATH and no VPATH is set, then we must exit
-if test ! -s bin/jumpshot.in -a -z "$VPATH" ; then
- AC_MSG_ERROR([No virtual MAKE path command found.
- You may need to set your make command.
- The GNU make (sometimes available as gnumake) can be used.])
-fi
-AC_SUBST(MAKE)
-
-dnl checking for working INSTALL
-AC_PROG_INSTALL
-PAC_PROG_CHECK_INSTALL_WORKS
-
-CPRP=cp
-MKDIR=mkdir
-RM="rm -f"
-MV="mv -f"
-AC_SUBST(RM)
-
-# Check if --without-java is specified
-if test "$JRE_TOPDIR" = "no" ; then
- PAC_MSG_ERROR($enable_softerror, [--without-java is specified, exit!])
-fi
-
-if test $enable_jdb = "yes" ; then
- pac_JVM=jdb
-# Assume jdb is working
- is_jvm_working=yes
-else
- pac_JVM=java
-
- JAC_CHECK_CLASSPATH
- is_jvm_working=no
-#
-dnl JVM="$JRE_TOPDIR/bin/$pac_JVM" is used in JAC_PATH_PROG
- JAC_PATH_PROG(JVM, $pac_JVM, [
-dnl Initialize the checking flag.
- jac_java_working=yes
-dnl
- if test "$jac_java_working" = "yes" ; then
- AC_MSG_CHECKING([if $JVM runs simple java class])
- JAC_TRY_RUN([$JVM], [$JVMFLAGS],
- [ac_javatest/simple.class],
- [jac_java_working=yes], [jac_java_working=no])
- if test "$jac_java_working" = "yes" ; then
- AC_MSG_RESULT(yes)
- else
- AC_MSG_RESULT(no)
- fi
- fi
-dnl
- if test "$jac_java_working" = "yes" ; then
- AC_MSG_CHECKING([if $JVM runs simple jar file])
- JAC_TRY_RUNJAR([$JVM], [$JVMFLAGS],
- [ac_javatest/simple.jar],
- [jac_java_working=yes], [jac_java_working=no])
- if test "$jac_java_working" = "yes" ; then
- AC_MSG_RESULT(yes)
- else
- AC_MSG_RESULT(no)
- fi
- fi
-dnl
- if test "$jac_java_working" = "yes" ; then
- AC_MSG_CHECKING([if $JVM runs non-GUI tool])
- JAC_TRY_RUNJAR([$JVM], [$JVMFLAGS],
- [ac_javatest/awt_color.jar],
- [jac_java_working=yes], [jac_java_working=no])
- if test "$jac_java_working" = "no" ; then
- JAC_TRY_RUNJAR([$JVM], [$JVMFLAGS -Djava.awt.headless=true],
- [ac_javatest/awt_color.jar],
- [jac_java_working=yes], [jac_java_working=no])
- if test "$jac_java_working" = "yes" ; then
- AC_MSG_RESULT([-Djava.awt.headless=true])
- NONGUI_JVMFLAGS="-Djava.awt.headless=true"
- else
- AC_MSG_RESULT(no)
- fi
- else
- AC_MSG_RESULT(yes)
- fi
- fi
-dnl
- if test "$jac_java_working" = "yes" \
- -a "$enable_swingcheck" = "yes" ; then
- AC_MSG_CHECKING([if $JVM runs simple Swing class])
- JAC_TRY_RUN([$JVM], [$JVMFLAGS],
- [ac_javatest/simple_swing.class],
- [jac_java_working=yes], [jac_java_working=no])
- if test "$jac_java_working" = "yes" ; then
- AC_MSG_RESULT(yes)
- else
- AC_MSG_RESULT(no)
- fi
- fi
-dnl
- if test "$jac_java_working" = "yes" \
- -a "$enable_swingcheck" = "yes" ; then
- AC_MSG_CHECKING([if $JVM runs simple Swing jar file])
- JAC_TRY_RUNJAR([$JVM], [$JVMFLAGS],
- [ac_javatest/simple_swing.jar],
- [jac_java_working=yes], [jac_java_working=no])
- if test "$jac_java_working" = "yes" ; then
- AC_MSG_RESULT(yes)
- else
- AC_MSG_RESULT(no)
- fi
- fi
-dnl
- if test "$jac_java_working" = "yes" ; then
- jac_prog_working=yes
- else
- jac_prog_working=no
- fi
- ])
- AC_SUBST(NONGUI_JVMFLAGS)
-# If JVM still hasn't been found, we need to abort!
- if test "x$JVM" = "x" ; then
- PAC_MSG_ERROR($enable_softerror,
- [No Java Virtual Machine can be found anywhere!])
- fi
- is_jvm_working=yes
-fi
-
-# CHECK the version of Java used
-# Filter out the version of JDK that causes problem
-if test "$enable_jdb" = "no" ; then
- AC_MSG_CHECKING(for Java version)
- VERSION=`$JVM -fullversion 2>&1`
- case "$VERSION" in
- *1.0.*)
- AC_MSG_RESULT([$VERSION, i.e. the oldest Java])
- AC_MSG_WARN([Java $VERSION is too old to be used with $pkgname !])
- ;;
- *1.1.*)
- AC_MSG_RESULT([$VERSION, i.e. Java 1 SDK])
- AC_MSG_WARN([Java $VERSION is too old to be used with $pkgname !])
- ;;
- *)
- AC_MSG_RESULT([$VERSION, i.e. Java 2 SDK])
- ;;
- esac
-fi
-
-if test "$is_jvm_working" = "no" ; then
- PAC_MSG_ERROR($enable_softerror,
- [$pkgname can be used with Java 2 Run Time Environment,
- i.e. j2sdk 1.2.2 or newer.])
-fi
-
-AC_SUBST(JVMFLAGS)
-AC_SUBST(JVM)
-
-JAC_CHECK_CYGPATH(JPATH_START, JPATH_FINAL)
-AC_SUBST(JPATH_START)
-AC_SUBST(JPATH_FINAL)
-
-#
-# Naming the various build directories, don't inherit them from environment
-#
-rootbuild_dir=`pwd`
-for dir in lib bin doc etc share sbin ; do
- dirname=${dir}build_dir
- eval dirvalue=\$"$dirname"
- eval $dirname=$rootbuild_dir/$dir
-done
-
-# VPATH build: Set the libbuild_dir
-if test ! -d $libbuild_dir -a -d $srcdir/lib ; then
- AC_MSG_NOTICE([creating $libbuild_dir from source])
- $CPRP -pr $srcdir/lib $libbuild_dir
-fi
-AC_SUBST(libbuild_dir)
-
-# VPATH: Set the binbuild_dir
-if test ! -d $binbuild_dir ; then
- AC_MSG_NOTICE([creating directory $binbuild_dir])
- $MKDIR $binbuild_dir
-fi
-AC_SUBST(binbuild_dir)
-
-# VPATH build: Set the docbuild_dir
-if test ! -d $docbuild_dir -a -d $srcdir/doc ; then
- AC_MSG_NOTICE([creating $docbuild_dir from source])
- $CPRP -pr $srcdir/doc $docbuild_dir
- $RM -r $docbuild_dir/old
-fi
-AC_SUBST(docbuild_dir)
-
-# VPATH build: Set the etcbuild_dir
-if test ! -d $etcbuild_dir -a -d $srcdir/etc ; then
- AC_MSG_NOTICE([creating $etcbuild_dir from source])
- $CPRP -pr $srcdir/etc $etcbuild_dir
-fi
-AC_SUBST(etcbuild_dir)
-
-# VPATH build: Set the sharebuild_dir
-if test ! -d $sharebuild_dir ; then
- AC_MSG_NOTICE([creating directory $sharebuild_dir])
- $MKDIR $sharebuild_dir
-fi
-AC_SUBST(sharebuild_dir)
-
-logfilesbuild_dir="$sharebuild_dir/examples/logfiles"
-if test ! -d $logfilesbuild_dir ; then
- AC_MSG_NOTICE([creating directory $logfilesbuild_dir])
- AS_MKDIR_P($logfilesbuild_dir)
-fi
-
-# Copying $srcdir/logfiles to sharebuild_dir
-if test -d $srcdir/logfiles ; then
- AC_MSG_NOTICE([creating sample logfiles from source])
- $CPRP -pr $srcdir/logfiles/*.clog* $logfilesbuild_dir
- $CPRP -pr $srcdir/logfiles/*.slog* $logfilesbuild_dir
-fi
-
-AC_SUBST(sbinbuild_dir)
-
-# Options to disselect individual subpackage
-# slog2_enable_{build|source|sample|rlog} are env. variables set by MPE2
-AC_ARG_ENABLE(build,
-[--enable-build - Build the jar files from the java source
- and the sample TRACE-API implementation.
- Java Standard Development Kit, SDK,
- is needed. The default is enable=yes.],
-,enable_build=${slog2_enable_build:-yes})
-
-AC_ARG_ENABLE(source,
-[--enable-source - Build the jar files from the java source.
- Java Standard Development Kit, SDK,
- is needed. The default is enable=yes.],
-,enable_source=${slog2_enable_source:-yes})
-
-AC_ARG_ENABLE(sample,
-[--enable-sample - Build sample TRACE-API implementation.
- Java Standard Development Kit, SDK,
- is needed. The default is enable=yes.],
-,enable_sample=${slog2_enable_sample:-yes})
-
-AC_ARG_ENABLE(rlog,
-[--enable-rlog - Build RLOG TRACE-API implementation.
- Java Standard Development Kit, SDK,
- is needed. The default is enable=yes.],
-,enable_rlog=${slog2_enable_rlog:-yes})
-
-AC_ARG_ENABLE(clog,
-[--enable-clog - Build CLOG related wrappers, e.g.
- clog2TOslog2, clog2print....
- The default is enable=yes.],
-,enable_clog=${slog2_enable_clog:-yes})
-
-AC_ARG_WITH(oldsource,
-[--with-oldsource=OLD_SRCDIR - Build the old jar files from the given OLD
- Java source and to build slog2updater.
- This option is ignored if --enable-source
- is turned off. The option should be set
- with a valid directory name. e.g. src_205,
- then --with-oldsource=src_205.
- The default is no.],
-,with_oldsource="")
-
-if test "$enable_build" = "no" ; then
- enable_source=no;
- enable_sample=no;
- enable_rlog=no;
-fi
-
-# The XXX in XXX_dirname below must match with AC_ARG_ENABLE( XXX, .. ) above
-source_dirname="src"
-sample_dirname="trace_sample"
-rlog_dirname="trace_rlog"
-
-trial_pkgs="source sample rlog"
-
-# The XXX in XXX_dirname below must match with AC_ARG_WITH( XXX, .. ) above
-if test "$enable_source" = "yes" \
- -a "X$with_oldsource" != "X" ; then
- oldsource_dirname="$with_oldsource"
- trial_pkgs="$trial_pkgs oldsource"
-fi
-
-dnl Cleanup the subpackages\' Makefiles if they exist
-AC_MSG_CHECKING( [for leftover Makefiles in subpackages] )
-leftover_pkgs=""
-for pkg in $trial_pkgs ; do
- dirname=${pkg}_dirname
- eval dirvalue=\$"$dirname"
- if test -s $rootbuild_dir/$dirvalue/Makefile ; then
- leftover_pkgs="$leftover_pkgs \"$dirvalue\""
- ( cd $rootbuild_dir/$dirvalue && $MAKE distclean > /dev/null 2>&1 )
- if test -f $rootbuild_dir/$dirvalue/Makefile ; then
- $RM $rootbuild_dir/$dirvalue/Makefile
- fi
- fi
-done
-if test "X$leftover_pkgs" = "X" ; then
- AC_MSG_RESULT( [none] )
-else
- AC_MSG_RESULT( [$leftover_pkgs cleaned] )
-fi
-
-# Enable softerror for all subpackages,
-# i.e. use AC_MSG_WARN instead of AC_MSG_ERROR
-slog2_enable_softerror=yes
-export slog2_enable_softerror
-selected_pkgs=""
-if test "$enable_source" = "yes" \
- -a -s $srcdir/src/configure ; then
- selected_pkgs="$selected_pkgs source"
- AC_CONFIG_SUBDIRS(src)
-fi
-if test "$enable_sample" = "yes" \
- -a -s $srcdir/trace_sample/configure ; then
- selected_pkgs="$selected_pkgs sample"
- AC_CONFIG_SUBDIRS(trace_sample)
-fi
-if test "$enable_rlog" = "yes" \
- -a -s $srcdir/trace_rlog/configure ; then
- selected_pkgs="$selected_pkgs rlog"
- AC_CONFIG_SUBDIRS(trace_rlog)
-fi
-if test "X$with_oldsource" != "X" \
- -a -s $srcdir/$oldsource_dirname/configure ; then
- selected_pkgs="$selected_pkgs oldsource"
- AC_CONFIG_SUBDIRS([$oldsource_dirname])
-fi
-# Define bindir's executables, and pass them down to sbindir's install-package
-BASIC_PGMS="slog2print slog2navigator slog2filter slog2updater logconvertor jumpshot"
-TRACE_PGMS="traceprint traceTOslog2"
-
-CLOG_PGMS="clogprint clogTOslog2 clog2print clog2TOslog2"
-if test "$enable_clog" = "yes" ; then
- BASIC_PGMS="$BASIC_PGMS $CLOG_PGMS"
-fi
-
-if test "x$TRACE_LIBDIR" != "x" ; then
- AC_MSG_CHECKING([for libTraceInput.so and TraceInput.dll])
- if test -f "$TRACE_LIBDIR/libTraceInput.so" \
- -o -f "$TRACE_LIBDIR/TraceInput.dll" ; then
- AC_MSG_RESULT(yes)
- AC_SUBST(TRACE_LIBDIR)
- has_tracelib=yes
- else
- AC_MSG_RESULT(no)
- has_tracelib=no
- fi
-fi
-
-PATH_EXEFILES="sbin/install-package"
-EXTRA_PGMS=""
-if test "$has_tracelib" = "yes" ; then
- for exefile in $BASIC_PGMS $TRACE_PGMS ; do
- PATH_EXEFILES="$PATH_EXEFILES bin/$exefile"
- done
-# define EXTRA_PGMS to be renamed TRACE_PGMS according to the TRACE_NAME
- if test "x$TRACE_NAME" != "x" -a "$TRACE_NAME" != "trace" ; then
- for oldpgm in $TRACE_PGMS ; do
- newpgm=$TRACE_NAME`echo $oldpgm | sed -e 's%trace%%'`
- EXTRA_PGMS="$EXTRA_PGMS $newpgm"
- done
- else
- EXTRA_PGMS="$TRACE_PGMS"
- fi
-else
- for exefile in $BASIC_PGMS ; do
- PATH_EXEFILES="$PATH_EXEFILES bin/$exefile"
- done
-fi
-
-# EXEFILES is used in sbin/install-package.in, so EXEFILES needs updated names.
-EXEFILES="$BASIC_PGMS $EXTRA_PGMS"
-AC_SUBST(EXEFILES)
-
-AC_OUTPUT(Makefile $PATH_EXEFILES)
-
-for script in $PATH_EXEFILES ; do
- if test -f "$script" ; then
- chmod a+x $script
- else
- PAC_MSG_ERROR($enable_softerror, [$script is not a valid file - Make sure you have configured with a valid $pkgname source directory])
- fi
-done
-
-if test "$has_tracelib" = "yes" ; then
-# Rename all the scripts in bindir according to the TRACE_NAME
- if test "x$TRACE_NAME" != "x" -a "$TRACE_NAME" != "trace" ; then
- for oldpgm in $TRACE_PGMS ; do
- if test -x "bin/$oldpgm" ; then
- newpgm=$TRACE_NAME`echo $oldpgm | sed -e 's%trace%%'`
- $MV bin/$oldpgm bin/$newpgm
- fi
- done
- fi
-fi
-
-configured_pkgs=""
-for pkg in $selected_pkgs ; do
- dirname=${pkg}_dirname
- eval dirvalue=\$"$dirname"
- if test -s $dirvalue/Makefile ; then
- configured_pkgs="$configured_pkgs \"$dirvalue\""
- fi
-done
-
-if test -z "$configured_pkgs" ; then
- AC_MSG_WARN([$pkgname: No sub-package has been configured])
-else
- AC_MSG_RESULT([$pkgname: $configured_pkgs have been configured])
-fi
Modified: mpich2/trunk/src/mpe2/src/slog2sdk/maint/rename_oldsrc
===================================================================
--- mpich2/trunk/src/mpe2/src/slog2sdk/maint/rename_oldsrc 2012-02-28 23:25:23 UTC (rev 9547)
+++ mpich2/trunk/src/mpe2/src/slog2sdk/maint/rename_oldsrc 2012-02-28 23:26:34 UTC (rev 9548)
@@ -19,7 +19,7 @@
-help|-u|-usage|-h)
cat <<EOF
- Rename configure.in, Makefile.in's, and *.java in the provided
+ Rename configure.ac, Makefile.in's, and *.java in the provided
old java slog2sdk's src directory to avoid namespace collision
with the existing slog2sdk's src directory.
@@ -119,8 +119,8 @@
exit 1
fi
-# Fixup configure.in
-file="configure.in"
+# Fixup configure.ac
+file="configure.ac"
echo "Fixing $file ...."
$Show mv ${file} ${file}~
$Show FixConfigureIn ${file}~ ${file}
Copied: mpich2/trunk/src/mpe2/src/slog2sdk/src/configure.ac (from rev 9546, mpich2/trunk/src/mpe2/src/slog2sdk/src/configure.in)
===================================================================
--- mpich2/trunk/src/mpe2/src/slog2sdk/src/configure.ac (rev 0)
+++ mpich2/trunk/src/mpe2/src/slog2sdk/src/configure.ac 2012-02-28 23:26:34 UTC (rev 9548)
@@ -0,0 +1,440 @@
+#! /bin/sh
+dnl
+dnl Caching is usually WRONG for systems with cross-mounted file systems
+dnl (the cache file may correspond to a different system). Since configure
+dnl is not on a performance-critical path, go for robustness over speed.
+dnl
+define([AC_CACHE_LOAD], )dnl
+define([AC_CACHE_SAVE], )dnl
+dnl
+dnl
+AC_INIT()
+AC_PREREQ(2.52)
+AC_CONFIG_AUX_DIR([..])
+
+AC_ARG_ENABLE(echo,
+[--enable-echo - Turn on strong echoing. The default
+ is enable=no.] ,set -x)
+
+AC_ARG_ENABLE(softerror,
+[--enable-softerror - Turn on soft error, i.e. instead of
+ issuing MSG_ERROR, MSG_WARN + exit 0
+ are used. The default is enable=no.],
+, enable_softerror=${slog2_enable_softerror:-no})
+
+AC_ARG_ENABLE(g,
+[--enable-g - Turn on the debugging flags, -g, and
+ uses jdb to run the GUI. The default
+ is enable=no], ,enable_g=no)
+
+AC_ARG_ENABLE(checkversion,
+[--enable-checkversion - Turn on the Java version checking code.
+ The default is enable=yes],
+, enable_checkversion=yes)
+
+echo "Configuring the Build of SLOG-2/Jumpshot-4 with $ac_configure_args"
+#
+# Find the home directory if not specified
+if test "X$srcdir" != "X." -a -s $srcdir/base/drawable/Makefile.in ; then
+ top_srcdir_abs=$srcdir
+else
+ PAC_GETWD(top_srcdir_abs, base/drawable/Makefile.in)
+fi
+
+if test -z "$top_srcdir_abs" ; then
+ top_srcdir_abs=`pwd`
+fi
+
+if test ! -d "$top_srcdir_abs" ; then
+ PAC_MSG_ERROR($enable_softerror, [*** $top_srcdir_abs is not a valid directory - cannot continue])
+fi
+
+AC_SUBST(top_srcdir_abs)
+
+# Cannot use JAVA_HOME here in this configure.ac.
+# Because JAVA_HOME is used in Blackdown's .java_wrapper in jdk117_v3
+# Using JAVA_HOME here would mistakenly set some variable in .java_wrapper
+# when .java_wrapper is invoked. i.e. causes mysterious error in tests.
+AC_ARG_WITH(java,
+[--with-java=JDK_TOPDIR - The path of the top-level directory of
+ the Java SDK installation. If this option
+ or with-java2 is not given, configure
+ will try to locate java for you. Also,
+ with-java2 option overwrites the
+ with-java option to set JDK_TOPDIR.],
+JDK_TOPDIR=$withval, JDK_TOPDIR="")
+
+AC_ARG_WITH(java2,
+[--with-java2=JDK_TOPDIR - The path of the top-level directory of
+ the Java SDK installation. If this option
+ or with-java is not given, configure will
+ try to locate java for you. Also,
+ with-java2 option overwrites the
+ with-java option to set JDK_TOPDIR.],
+JDK_TOPDIR=$withval, )
+
+AC_ARG_WITH(jflags,
+[--with-jflags=JFLAGS - supply java compiler flags, e.g.
+ optimization flags, -O, to the java
+ compiler], JFLAGS="$withval")
+
+AC_ARG_ENABLE(clog,
+[--enable-clog - Build CLOG related utility jar files,
+ clog2TOslog2.jar, clog2print.jar....
+ Java Standard Development Kit, SDK,
+ is needed. The default is enable=yes.],
+,enable_clog=yes)
+
+AC_ARG_WITH(oldsource,
+[--with-oldsource=OLD_SRCDIR - Build slog2updater from the given OLD
+ Java source directory OLD_SRCDIR which
+ should be a valid directory name in the
+ parent directory of this configure.
+ e.g. src_205, --with-oldsource=src_205.
+ The default is old_src.],
+old_slog2srcdir="$withval", old_slog2srcdir="old_src")
+AC_SUBST(old_slog2srcdir)
+
+# Append "-g" to JFLAGS if enable_g=yes
+if test "$enable_g" = "yes" ; then
+ if test -z "`echo $JFLAGS | grep "\-g"`" ; then
+ JFLAGS="-g $JFLAGS"
+ fi
+fi
+
+# Fixup for make
+MAKE=${MAKE:-make}
+PAC_MAKE_IS_GNUMAKE
+PAC_MAKE_IS_BSD44
+PAC_MAKE_IS_OSF
+PAC_MAKE_VPATH
+# If we are relying on VPATH and no VPATH is set, then we must exit
+if test ! -s base/drawable/TimeBoundingBox.java -a -z "$VPATH" ; then
+ AC_MSG_ERROR([No virtual MAKE path command found.
+ You may need to set your make command.
+ The GNU make (sometimes available as gnumake) can be used.])
+fi
+AC_SUBST(MAKE)
+
+# Check if --without-java is specified
+if test "$JDK_TOPDIR" = "no" ; then
+ PAC_MSG_ERROR($enable_softerror, [--without-java is specified, exit!])
+fi
+
+is_javac_working=no
+if test "x$JDK_TOPDIR" != "x" ; then
+dnl
+ JC="$JDK_TOPDIR/bin/javac"
+ AC_MSG_CHECKING([if $JC exists])
+ if test -x "$JC" ; then
+ AC_MSG_RESULT(yes)
+ jac_javac_working=yes
+ else
+ AC_MSG_RESULT(no)
+ jac_javac_working=no
+ fi
+dnl
+ if test "$jac_javac_working" = "yes" ; then
+ AC_MSG_CHECKING([if $JC compiles])
+ JAC_TRY_COMPILE( [$JC], , , [
+ public static void main( String args[] )
+ {
+ System.out.println( "Hello world" );
+ }
+ ], [ jac_javac_working=yes ], [ jac_javac_working=no ] )
+ if test "$jac_javac_working" = "yes" ; then
+ AC_MSG_RESULT(yes)
+ else
+ AC_MSG_RESULT(no)
+ fi
+ fi
+dnl
+ if test "$jac_javac_working" = "yes" ; then
+ AC_MSG_CHECKING([if $JC accepts -classpath, -d & -sourcepath])
+ JAC_TRY_COMPILE( [$JC], [-classpath . -d . -sourcepath .], , [
+ public static void main( String args[] )
+ {
+ System.out.println( "Hello world" );
+ }
+ ], [ jac_javac_working=yes ], [ jac_javac_working=no ] )
+ if test "$jac_javac_working" = "yes" ; then
+ AC_MSG_RESULT(yes)
+ else
+ AC_MSG_RESULT(no)
+ fi
+ fi
+dnl
+ if test "$jac_javac_working" = "yes" ; then
+ AC_MSG_CHECKING([if $JC understands List & Map])
+ JAC_TRY_COMPILE( [$JC], [-classpath . -d . -sourcepath .], [
+ import java.util.List;
+ import java.util.Map;
+ ], [
+ public static void main( String args[] )
+ {
+ List list;
+ Map map;
+ }
+ ], [ jac_javac_working=yes ], [ jac_javac_working=no ] )
+ if test "$jac_javac_working" = "yes" ; then
+ AC_MSG_RESULT(yes)
+ else
+ AC_MSG_RESULT(no)
+ fi
+ fi
+dnl
+ if test "$jac_javac_working" = "yes" ; then
+ AC_MSG_CHECKING([if $JC handles static-inner-class reference])
+ JAC_TRY_COMPILE( [$JC], [-classpath . -d . -sourcepath .], , [
+ public class RecType
+ {
+ static final int STATEDEF = 6;
+ }
+ public static void main( String args[] )
+ {
+ int itmp = conftest.RecType.STATEDEF;
+ System.out.println( itmp );
+ }
+ ], [ jac_javac_working=yes ], [ jac_javac_working=no ] )
+ if test "$jac_javac_working" = "yes" ; then
+ AC_MSG_RESULT(yes)
+ else
+ AC_MSG_RESULT(no)
+ fi
+ fi
+dnl
+ if test "$jac_javac_working" = "yes" ; then
+ AC_MSG_CHECKING([if $JC compiles Swing-1.1.1 code])
+ JAC_TRY_COMPILE( [$JC], ,[
+ import javax.swing.*;
+ ], [
+ public static void main( String args[] )
+ {
+ JFrame frame = new JFrame();
+ System.out.println( "Checking Swing" );
+ }
+ ], [ jac_javac_working=yes ], [ jac_javac_working=no ] )
+ if test "$jac_javac_working" = "yes" ; then
+ AC_MSG_RESULT([yes, assume Java 2 SDK!])
+ else
+ AC_MSG_RESULT([no, assume Java 1 SDK!])
+ fi
+ fi
+dnl
+ if test "$jac_javac_working" = "yes" ; then
+ is_javac_working=yes
+ else
+ is_javac_working=no
+ fi
+dnl
+fi dnl endof { if test "x$JDK_TOPDIR" = "x" }
+
+if test "$is_javac_working" = "no" ; then
+# Locate Java from user's PATH and known locations
+ JAC_PATH_PROG(JC, javac, [
+ JAC_TRY_COMPILE( [$JC], , , [
+ public static void main( String args[] )
+ {
+ System.out.println( "Hello world" );
+ }
+ ], [ jac_javac_working=yes ], [ jac_javac_working=no ] )
+ if test "$jac_javac_working" = "yes" ; then
+ AC_MSG_RESULT(yes)
+ AC_MSG_CHECKING([if $JC accepts -classpath, -d & -sourcepath])
+ JAC_TRY_COMPILE( [$JC], [-classpath . -d . -sourcepath .], , [
+ public static void main( String args[] )
+ {
+ System.out.println( "Hello world" );
+ }
+ ], [ jac_javac_working=yes ], [ jac_javac_working=no ] )
+ fi
+ if test "$jac_javac_working" = "yes" ; then
+ AC_MSG_RESULT(yes)
+ AC_MSG_CHECKING([if $JC understands List & Map])
+ JAC_TRY_COMPILE( [$JC], [-classpath . -d . -sourcepath .], [
+ import java.util.List;
+ import java.util.Map;
+ ], [
+ public static void main( String args[] )
+ {
+ List list;
+ Map map;
+ }
+ ], [ jac_javac_working=yes ], [ jac_javac_working=no ] )
+ fi
+ if test "$jac_javac_working" = "yes" ; then
+ AC_MSG_RESULT(yes)
+ AC_MSG_CHECKING([if $JC handles static-inner-class reference])
+ JAC_TRY_COMPILE( [$JC], [-classpath . -d . -sourcepath .], , [
+ public class RecType
+ {
+ static final int STATEDEF = 6;
+ }
+ public static void main( String args[] )
+ {
+ int itmp = conftest.RecType.STATEDEF;
+ System.out.println( itmp );
+ }
+ ], [ jac_javac_working=yes ], [ jac_javac_working=no ] )
+ fi
+ if test "$jac_javac_working" = "yes" ; then
+ AC_MSG_RESULT(yes)
+ AC_MSG_CHECKING([if $JC compiles Swing-1.1.1 code])
+ JAC_TRY_COMPILE( [$JC], ,[
+ import javax.swing.*;
+ ], [
+ public static void main( String args[] )
+ {
+ JFrame frame = new JFrame();
+ System.out.println( "Checking Swing" );
+ }
+ ], [ jac_javac_working=yes ], [ jac_javac_working=no ] )
+ fi
+ if test "$jac_javac_working" = "yes" ; then
+ jac_prog_working=yes
+ else
+ jac_prog_working=no
+ fi
+ ])
+# if JC still hasn't been found, we have exhausted all options! Abort.
+ if test "x$JC" = "x" ; then
+ AC_MSG_WARN([Cannot find a working javac in \$PATH or known locations!])
+ PAC_MSG_ERROR($enable_softerror,
+ [Put a working javac in your path or set the --with-java option])
+ fi
+# Set JDK_TOPDIR from JC found by JAC_PATH_PROG
+ changequote(,)dnl
+ JDK_TOPDIR="`echo $JC | sed -e 's%\(.*\)/[^/]*/[^/]*$%\1%'`"
+ changequote([,])dnl
+ is_javac_working=yes
+dnl
+fi dnl end of { if test "x$JDK_TOPDIR" = "x" }
+
+# Print the version of Java used
+# Warn the version of JDK that causes problem
+if test "$enable_checkversion" = "yes" ; then
+ AC_MSG_CHECKING(for Java version)
+ VERSION=`$JDK_TOPDIR/bin/java -fullversion 2>&1`
+ case "$VERSION" in
+ *1.0.*)
+ AC_MSG_RESULT([$VERSION, i.e. the oldest Java])
+ AC_MSG_WARN([Java $VERSION is too old to be used with SLOG-2/Jumpshot-2 !])
+ ;;
+ *1.1.*)
+ AC_MSG_RESULT([$VERSION, i.e. Java 1 SDK])
+ AC_MSG_WARN([Java $VERSION is too old to be used with SLOG-2/Jumpshot-2 !])
+ ;;
+ *)
+ AC_MSG_RESULT([$VERSION, i.e. Java 2 SDK])
+ ;;
+ esac
+fi
+
+if test "$is_javac_working" = "no" ; then
+ PAC_MSG_ERROR($enable_softerror,
+ [SLOG-2/Jumpshot-4 can be compiled with Java 2 SDK,
+ i.e. j2sdk 1.2.2 or newer.])
+fi
+
+# Set the JAVA related tools, like javah and jar.
+JH="$JDK_TOPDIR/bin/javah"
+RMIC="$JDK_TOPDIR/bin/rmic"
+JAR="$JDK_TOPDIR/bin/jar"
+for exe in "$JH" "$RMIC" "$JAR" ; do
+ AC_MSG_CHECKING([if $exe exists])
+ if test -x "$exe" ; then
+ AC_MSG_RESULT(yes)
+ else
+ AC_MSG_RESULT(no)
+ PAC_MSG_ERROR($enable_softerror,
+ [$exe does NOT exist, check JDK_TOPDIR = $JDK_TOPDIR])
+ fi
+done
+
+CPRP=cp
+RM="rm -f"
+MKDIR=mkdir
+AC_SUBST(RM)
+
+AC_SUBST(JFLAGS)
+AC_SUBST(JC)
+AC_SUBST(JH)
+AC_SUBST(RMIC)
+AC_SUBST(JAR)
+
+JAC_CHECK_CYGPATH(JPATH_START, JPATH_FINAL)
+AC_SUBST(JPATH_START)
+AC_SUBST(JPATH_FINAL)
+
+#
+# Naming the various build directories, don't inherit them from environment
+# Only srcbuild_dir( i.e. this directory ) and libbuild_dir are needed
+#
+srcbuild_dir=`pwd`
+changequote(, )dnl
+rootbuild_dir="`echo $srcbuild_dir | sed -e 's%\(.*\)/[^/]*$%\1%'`"
+changequote([, ])dnl
+# echo "rootbuild_dir = $rootbuild_dir"
+libbuild_dir=$rootbuild_dir/lib
+
+# VPATH: Set the srcbuild_dir
+if test ! -d $srcbuild_dir/base ; then
+ echo "creating directory $srcbuild_dir/base"
+ $MKDIR $srcbuild_dir/base
+fi
+if test ! -d $srcbuild_dir/logformat ; then
+ echo "creating directory $srcbuild_dir/logformat"
+ $MKDIR $srcbuild_dir/logformat
+fi
+if test ! -d $srcbuild_dir/viewer ; then
+ echo "creating directory $srcbuild_dir/viewer"
+ $MKDIR $srcbuild_dir/viewer
+fi
+if test ! -d $srcbuild_dir/images ; then
+ $CPRP -pr $srcdir/images $srcbuild_dir
+ $CPRP $srcdir/jumpshot.colors $srcbuild_dir
+ $CPRP $srcdir/applet.html $srcbuild_dir
+fi
+if test ! -d $srcbuild_dir/html ; then
+ $CPRP -pr $srcdir/../doc/jumpshot-4/html $srcbuild_dir
+fi
+AC_SUBST(srcbuild_dir)
+
+# VPATH build: Set the libbuild_dir
+if test ! -d $libbuild_dir ; then
+ echo "creating $libbuild_dir from source"
+ $MKDIR $libbuild_dir
+fi
+AC_SUBST(libbuild_dir)
+
+# Define the "dirs" components
+base_dirs="cern base/io base/drawable base/statistics base/topology"
+logformat_clog_dirs="logformat/clog logformat/clogTOdrawable logformat/clog2 logformat/clog2TOdrawable"
+logformat_basic_dirs="logformat/trace logformat/slog2"
+logformat_slog2_dirs="logformat/slog2/output logformat/slog2/input logformat/slog2/pipe logformat/slog2/update"
+viewer_dirs="viewer/common viewer/convertor viewer/legends viewer/zoomable viewer/histogram viewer/timelines viewer/first viewer/launcher"
+
+# Initial the "dirs" components: slog2_make_dirs, slog2_makefile_dirs.
+slog2_make_dirs="$base_dirs"
+slog2_makefile_dirs="$base_dirs"
+if test "$enable_clog" = "yes" ; then
+ slog2_make_dirs="$slog2_make_dirs $logformat_clog_dirs"
+ slog2_makefile_dirs="$slog2_makefile_dirs $logformat_clog_dirs"
+fi
+slog2_make_dirs="$slog2_make_dirs $logformat_basic_dirs"
+slog2_makefile_dirs="$slog2_makefile_dirs $logformat_basic_dirs"
+# Only slog2_makefile_dirs needs logformat/slog2's subdirectory list
+slog2_makefile_dirs="$slog2_makefile_dirs $logformat_slog2_dirs"
+slog2_make_dirs="$slog2_make_dirs $viewer_dirs"
+slog2_makefile_dirs="$slog2_makefile_dirs $viewer_dirs"
+
+# Output all the directories that needs to do "make"
+AC_SUBST(slog2_make_dirs)
+
+# Append each directory slog2_makefile_dirs with "/Makefile"
+slog2_makefiles="Makefile"
+for dir in $slog2_makefile_dirs ; do
+ slog2_makefiles="$slog2_makefiles $dir/Makefile"
+done
+
+AC_OUTPUT($slog2_makefiles)
Deleted: mpich2/trunk/src/mpe2/src/slog2sdk/src/configure.in
===================================================================
--- mpich2/trunk/src/mpe2/src/slog2sdk/src/configure.in 2012-02-28 23:25:23 UTC (rev 9547)
+++ mpich2/trunk/src/mpe2/src/slog2sdk/src/configure.in 2012-02-28 23:26:34 UTC (rev 9548)
@@ -1,440 +0,0 @@
-#! /bin/sh
-dnl
-dnl Caching is usually WRONG for systems with cross-mounted file systems
-dnl (the cache file may correspond to a different system). Since configure
-dnl is not on a performance-critical path, go for robustness over speed.
-dnl
-define([AC_CACHE_LOAD], )dnl
-define([AC_CACHE_SAVE], )dnl
-dnl
-dnl
-AC_INIT()
-AC_PREREQ(2.52)
-AC_CONFIG_AUX_DIR([..])
-
-AC_ARG_ENABLE(echo,
-[--enable-echo - Turn on strong echoing. The default
- is enable=no.] ,set -x)
-
-AC_ARG_ENABLE(softerror,
-[--enable-softerror - Turn on soft error, i.e. instead of
- issuing MSG_ERROR, MSG_WARN + exit 0
- are used. The default is enable=no.],
-, enable_softerror=${slog2_enable_softerror:-no})
-
-AC_ARG_ENABLE(g,
-[--enable-g - Turn on the debugging flags, -g, and
- uses jdb to run the GUI. The default
- is enable=no], ,enable_g=no)
-
-AC_ARG_ENABLE(checkversion,
-[--enable-checkversion - Turn on the Java version checking code.
- The default is enable=yes],
-, enable_checkversion=yes)
-
-echo "Configuring the Build of SLOG-2/Jumpshot-4 with $ac_configure_args"
-#
-# Find the home directory if not specified
-if test "X$srcdir" != "X." -a -s $srcdir/base/drawable/Makefile.in ; then
- top_srcdir_abs=$srcdir
-else
- PAC_GETWD(top_srcdir_abs, base/drawable/Makefile.in)
-fi
-
-if test -z "$top_srcdir_abs" ; then
- top_srcdir_abs=`pwd`
-fi
-
-if test ! -d "$top_srcdir_abs" ; then
- PAC_MSG_ERROR($enable_softerror, [*** $top_srcdir_abs is not a valid directory - cannot continue])
-fi
-
-AC_SUBST(top_srcdir_abs)
-
-# Cannot use JAVA_HOME here in this configure.in.
-# Because JAVA_HOME is used in Blackdown's .java_wrapper in jdk117_v3
-# Using JAVA_HOME here would mistakenly set some variable in .java_wrapper
-# when .java_wrapper is invoked. i.e. causes mysterious error in tests.
-AC_ARG_WITH(java,
-[--with-java=JDK_TOPDIR - The path of the top-level directory of
- the Java SDK installation. If this option
- or with-java2 is not given, configure
- will try to locate java for you. Also,
- with-java2 option overwrites the
- with-java option to set JDK_TOPDIR.],
-JDK_TOPDIR=$withval, JDK_TOPDIR="")
-
-AC_ARG_WITH(java2,
-[--with-java2=JDK_TOPDIR - The path of the top-level directory of
- the Java SDK installation. If this option
- or with-java is not given, configure will
- try to locate java for you. Also,
- with-java2 option overwrites the
- with-java option to set JDK_TOPDIR.],
-JDK_TOPDIR=$withval, )
-
-AC_ARG_WITH(jflags,
-[--with-jflags=JFLAGS - supply java compiler flags, e.g.
- optimization flags, -O, to the java
- compiler], JFLAGS="$withval")
-
-AC_ARG_ENABLE(clog,
-[--enable-clog - Build CLOG related utility jar files,
- clog2TOslog2.jar, clog2print.jar....
- Java Standard Development Kit, SDK,
- is needed. The default is enable=yes.],
-,enable_clog=yes)
-
-AC_ARG_WITH(oldsource,
-[--with-oldsource=OLD_SRCDIR - Build slog2updater from the given OLD
- Java source directory OLD_SRCDIR which
- should be a valid directory name in the
- parent directory of this configure.
- e.g. src_205, --with-oldsource=src_205.
- The default is old_src.],
-old_slog2srcdir="$withval", old_slog2srcdir="old_src")
-AC_SUBST(old_slog2srcdir)
-
-# Append "-g" to JFLAGS if enable_g=yes
-if test "$enable_g" = "yes" ; then
- if test -z "`echo $JFLAGS | grep "\-g"`" ; then
- JFLAGS="-g $JFLAGS"
- fi
-fi
-
-# Fixup for make
-MAKE=${MAKE:-make}
-PAC_MAKE_IS_GNUMAKE
-PAC_MAKE_IS_BSD44
-PAC_MAKE_IS_OSF
-PAC_MAKE_VPATH
-# If we are relying on VPATH and no VPATH is set, then we must exit
-if test ! -s base/drawable/TimeBoundingBox.java -a -z "$VPATH" ; then
- AC_MSG_ERROR([No virtual MAKE path command found.
- You may need to set your make command.
- The GNU make (sometimes available as gnumake) can be used.])
-fi
-AC_SUBST(MAKE)
-
-# Check if --without-java is specified
-if test "$JDK_TOPDIR" = "no" ; then
- PAC_MSG_ERROR($enable_softerror, [--without-java is specified, exit!])
-fi
-
-is_javac_working=no
-if test "x$JDK_TOPDIR" != "x" ; then
-dnl
- JC="$JDK_TOPDIR/bin/javac"
- AC_MSG_CHECKING([if $JC exists])
- if test -x "$JC" ; then
- AC_MSG_RESULT(yes)
- jac_javac_working=yes
- else
- AC_MSG_RESULT(no)
- jac_javac_working=no
- fi
-dnl
- if test "$jac_javac_working" = "yes" ; then
- AC_MSG_CHECKING([if $JC compiles])
- JAC_TRY_COMPILE( [$JC], , , [
- public static void main( String args[] )
- {
- System.out.println( "Hello world" );
- }
- ], [ jac_javac_working=yes ], [ jac_javac_working=no ] )
- if test "$jac_javac_working" = "yes" ; then
- AC_MSG_RESULT(yes)
- else
- AC_MSG_RESULT(no)
- fi
- fi
-dnl
- if test "$jac_javac_working" = "yes" ; then
- AC_MSG_CHECKING([if $JC accepts -classpath, -d & -sourcepath])
- JAC_TRY_COMPILE( [$JC], [-classpath . -d . -sourcepath .], , [
- public static void main( String args[] )
- {
- System.out.println( "Hello world" );
- }
- ], [ jac_javac_working=yes ], [ jac_javac_working=no ] )
- if test "$jac_javac_working" = "yes" ; then
- AC_MSG_RESULT(yes)
- else
- AC_MSG_RESULT(no)
- fi
- fi
-dnl
- if test "$jac_javac_working" = "yes" ; then
- AC_MSG_CHECKING([if $JC understands List & Map])
- JAC_TRY_COMPILE( [$JC], [-classpath . -d . -sourcepath .], [
- import java.util.List;
- import java.util.Map;
- ], [
- public static void main( String args[] )
- {
- List list;
- Map map;
- }
- ], [ jac_javac_working=yes ], [ jac_javac_working=no ] )
- if test "$jac_javac_working" = "yes" ; then
- AC_MSG_RESULT(yes)
- else
- AC_MSG_RESULT(no)
- fi
- fi
-dnl
- if test "$jac_javac_working" = "yes" ; then
- AC_MSG_CHECKING([if $JC handles static-inner-class reference])
- JAC_TRY_COMPILE( [$JC], [-classpath . -d . -sourcepath .], , [
- public class RecType
- {
- static final int STATEDEF = 6;
- }
- public static void main( String args[] )
- {
- int itmp = conftest.RecType.STATEDEF;
- System.out.println( itmp );
- }
- ], [ jac_javac_working=yes ], [ jac_javac_working=no ] )
- if test "$jac_javac_working" = "yes" ; then
- AC_MSG_RESULT(yes)
- else
- AC_MSG_RESULT(no)
- fi
- fi
-dnl
- if test "$jac_javac_working" = "yes" ; then
- AC_MSG_CHECKING([if $JC compiles Swing-1.1.1 code])
- JAC_TRY_COMPILE( [$JC], ,[
- import javax.swing.*;
- ], [
- public static void main( String args[] )
- {
- JFrame frame = new JFrame();
- System.out.println( "Checking Swing" );
- }
- ], [ jac_javac_working=yes ], [ jac_javac_working=no ] )
- if test "$jac_javac_working" = "yes" ; then
- AC_MSG_RESULT([yes, assume Java 2 SDK!])
- else
- AC_MSG_RESULT([no, assume Java 1 SDK!])
- fi
- fi
-dnl
- if test "$jac_javac_working" = "yes" ; then
- is_javac_working=yes
- else
- is_javac_working=no
- fi
-dnl
-fi dnl endof { if test "x$JDK_TOPDIR" = "x" }
-
-if test "$is_javac_working" = "no" ; then
-# Locate Java from user's PATH and known locations
- JAC_PATH_PROG(JC, javac, [
- JAC_TRY_COMPILE( [$JC], , , [
- public static void main( String args[] )
- {
- System.out.println( "Hello world" );
- }
- ], [ jac_javac_working=yes ], [ jac_javac_working=no ] )
- if test "$jac_javac_working" = "yes" ; then
- AC_MSG_RESULT(yes)
- AC_MSG_CHECKING([if $JC accepts -classpath, -d & -sourcepath])
- JAC_TRY_COMPILE( [$JC], [-classpath . -d . -sourcepath .], , [
- public static void main( String args[] )
- {
- System.out.println( "Hello world" );
- }
- ], [ jac_javac_working=yes ], [ jac_javac_working=no ] )
- fi
- if test "$jac_javac_working" = "yes" ; then
- AC_MSG_RESULT(yes)
- AC_MSG_CHECKING([if $JC understands List & Map])
- JAC_TRY_COMPILE( [$JC], [-classpath . -d . -sourcepath .], [
- import java.util.List;
- import java.util.Map;
- ], [
- public static void main( String args[] )
- {
- List list;
- Map map;
- }
- ], [ jac_javac_working=yes ], [ jac_javac_working=no ] )
- fi
- if test "$jac_javac_working" = "yes" ; then
- AC_MSG_RESULT(yes)
- AC_MSG_CHECKING([if $JC handles static-inner-class reference])
- JAC_TRY_COMPILE( [$JC], [-classpath . -d . -sourcepath .], , [
- public class RecType
- {
- static final int STATEDEF = 6;
- }
- public static void main( String args[] )
- {
- int itmp = conftest.RecType.STATEDEF;
- System.out.println( itmp );
- }
- ], [ jac_javac_working=yes ], [ jac_javac_working=no ] )
- fi
- if test "$jac_javac_working" = "yes" ; then
- AC_MSG_RESULT(yes)
- AC_MSG_CHECKING([if $JC compiles Swing-1.1.1 code])
- JAC_TRY_COMPILE( [$JC], ,[
- import javax.swing.*;
- ], [
- public static void main( String args[] )
- {
- JFrame frame = new JFrame();
- System.out.println( "Checking Swing" );
- }
- ], [ jac_javac_working=yes ], [ jac_javac_working=no ] )
- fi
- if test "$jac_javac_working" = "yes" ; then
- jac_prog_working=yes
- else
- jac_prog_working=no
- fi
- ])
-# if JC still hasn't been found, we have exhausted all options! Abort.
- if test "x$JC" = "x" ; then
- AC_MSG_WARN([Cannot find a working javac in \$PATH or known locations!])
- PAC_MSG_ERROR($enable_softerror,
- [Put a working javac in your path or set the --with-java option])
- fi
-# Set JDK_TOPDIR from JC found by JAC_PATH_PROG
- changequote(,)dnl
- JDK_TOPDIR="`echo $JC | sed -e 's%\(.*\)/[^/]*/[^/]*$%\1%'`"
- changequote([,])dnl
- is_javac_working=yes
-dnl
-fi dnl end of { if test "x$JDK_TOPDIR" = "x" }
-
-# Print the version of Java used
-# Warn the version of JDK that causes problem
-if test "$enable_checkversion" = "yes" ; then
- AC_MSG_CHECKING(for Java version)
- VERSION=`$JDK_TOPDIR/bin/java -fullversion 2>&1`
- case "$VERSION" in
- *1.0.*)
- AC_MSG_RESULT([$VERSION, i.e. the oldest Java])
- AC_MSG_WARN([Java $VERSION is too old to be used with SLOG-2/Jumpshot-2 !])
- ;;
- *1.1.*)
- AC_MSG_RESULT([$VERSION, i.e. Java 1 SDK])
- AC_MSG_WARN([Java $VERSION is too old to be used with SLOG-2/Jumpshot-2 !])
- ;;
- *)
- AC_MSG_RESULT([$VERSION, i.e. Java 2 SDK])
- ;;
- esac
-fi
-
-if test "$is_javac_working" = "no" ; then
- PAC_MSG_ERROR($enable_softerror,
- [SLOG-2/Jumpshot-4 can be compiled with Java 2 SDK,
- i.e. j2sdk 1.2.2 or newer.])
-fi
-
-# Set the JAVA related tools, like javah and jar.
-JH="$JDK_TOPDIR/bin/javah"
-RMIC="$JDK_TOPDIR/bin/rmic"
-JAR="$JDK_TOPDIR/bin/jar"
-for exe in "$JH" "$RMIC" "$JAR" ; do
- AC_MSG_CHECKING([if $exe exists])
- if test -x "$exe" ; then
- AC_MSG_RESULT(yes)
- else
- AC_MSG_RESULT(no)
- PAC_MSG_ERROR($enable_softerror,
- [$exe does NOT exist, check JDK_TOPDIR = $JDK_TOPDIR])
- fi
-done
-
-CPRP=cp
-RM="rm -f"
-MKDIR=mkdir
-AC_SUBST(RM)
-
-AC_SUBST(JFLAGS)
-AC_SUBST(JC)
-AC_SUBST(JH)
-AC_SUBST(RMIC)
-AC_SUBST(JAR)
-
-JAC_CHECK_CYGPATH(JPATH_START, JPATH_FINAL)
-AC_SUBST(JPATH_START)
-AC_SUBST(JPATH_FINAL)
-
-#
-# Naming the various build directories, don't inherit them from environment
-# Only srcbuild_dir( i.e. this directory ) and libbuild_dir are needed
-#
-srcbuild_dir=`pwd`
-changequote(, )dnl
-rootbuild_dir="`echo $srcbuild_dir | sed -e 's%\(.*\)/[^/]*$%\1%'`"
-changequote([, ])dnl
-# echo "rootbuild_dir = $rootbuild_dir"
-libbuild_dir=$rootbuild_dir/lib
-
-# VPATH: Set the srcbuild_dir
-if test ! -d $srcbuild_dir/base ; then
- echo "creating directory $srcbuild_dir/base"
- $MKDIR $srcbuild_dir/base
-fi
-if test ! -d $srcbuild_dir/logformat ; then
- echo "creating directory $srcbuild_dir/logformat"
- $MKDIR $srcbuild_dir/logformat
-fi
-if test ! -d $srcbuild_dir/viewer ; then
- echo "creating directory $srcbuild_dir/viewer"
- $MKDIR $srcbuild_dir/viewer
-fi
-if test ! -d $srcbuild_dir/images ; then
- $CPRP -pr $srcdir/images $srcbuild_dir
- $CPRP $srcdir/jumpshot.colors $srcbuild_dir
- $CPRP $srcdir/applet.html $srcbuild_dir
-fi
-if test ! -d $srcbuild_dir/html ; then
- $CPRP -pr $srcdir/../doc/jumpshot-4/html $srcbuild_dir
-fi
-AC_SUBST(srcbuild_dir)
-
-# VPATH build: Set the libbuild_dir
-if test ! -d $libbuild_dir ; then
- echo "creating $libbuild_dir from source"
- $MKDIR $libbuild_dir
-fi
-AC_SUBST(libbuild_dir)
-
-# Define the "dirs" components
-base_dirs="cern base/io base/drawable base/statistics base/topology"
-logformat_clog_dirs="logformat/clog logformat/clogTOdrawable logformat/clog2 logformat/clog2TOdrawable"
-logformat_basic_dirs="logformat/trace logformat/slog2"
-logformat_slog2_dirs="logformat/slog2/output logformat/slog2/input logformat/slog2/pipe logformat/slog2/update"
-viewer_dirs="viewer/common viewer/convertor viewer/legends viewer/zoomable viewer/histogram viewer/timelines viewer/first viewer/launcher"
-
-# Initial the "dirs" components: slog2_make_dirs, slog2_makefile_dirs.
-slog2_make_dirs="$base_dirs"
-slog2_makefile_dirs="$base_dirs"
-if test "$enable_clog" = "yes" ; then
- slog2_make_dirs="$slog2_make_dirs $logformat_clog_dirs"
- slog2_makefile_dirs="$slog2_makefile_dirs $logformat_clog_dirs"
-fi
-slog2_make_dirs="$slog2_make_dirs $logformat_basic_dirs"
-slog2_makefile_dirs="$slog2_makefile_dirs $logformat_basic_dirs"
-# Only slog2_makefile_dirs needs logformat/slog2's subdirectory list
-slog2_makefile_dirs="$slog2_makefile_dirs $logformat_slog2_dirs"
-slog2_make_dirs="$slog2_make_dirs $viewer_dirs"
-slog2_makefile_dirs="$slog2_makefile_dirs $viewer_dirs"
-
-# Output all the directories that needs to do "make"
-AC_SUBST(slog2_make_dirs)
-
-# Append each directory slog2_makefile_dirs with "/Makefile"
-slog2_makefiles="Makefile"
-for dir in $slog2_makefile_dirs ; do
- slog2_makefiles="$slog2_makefiles $dir/Makefile"
-done
-
-AC_OUTPUT($slog2_makefiles)
Copied: mpich2/trunk/src/mpe2/src/slog2sdk/trace_rlog/configure.ac (from rev 9546, mpich2/trunk/src/mpe2/src/slog2sdk/trace_rlog/configure.in)
===================================================================
--- mpich2/trunk/src/mpe2/src/slog2sdk/trace_rlog/configure.ac (rev 0)
+++ mpich2/trunk/src/mpe2/src/slog2sdk/trace_rlog/configure.ac 2012-02-28 23:26:34 UTC (rev 9548)
@@ -0,0 +1,337 @@
+dnl
+dnl Caching is usually WRONG for systems with cross-mounted file systems
+dnl (the cache file may correspond to a different system). Since configure
+dnl is not on a performance-critical path, go for robustness over speed.
+dnl
+define([AC_CACHE_LOAD], )dnl
+define([AC_CACHE_SAVE], )dnl
+dnl
+dnl
+dnl Process this file with autoconf to produce a configure script.
+AC_INIT()
+AC_PREREQ(2.52)
+AC_CONFIG_MACRO_DIR([confdb])
+AC_CONFIG_AUX_DIR([.])
+AC_CONFIG_HEADER([trace_impl.h])
+
+AC_ARG_ENABLE(strict,
+[--enable-strict - Turn on strict compilation testing
+ when using gcc],
+COPTIONS="${COPTIONS} -Wall -O -Wstrict-prototypes -Wmissing-prototypes -DGCC_WALL")
+
+AC_ARG_ENABLE(echo,
+[--enable-echo - Turn on strong echoing. The default
+ is enable=no.] ,set -x)
+
+AC_ARG_ENABLE(softerror,
+[--enable-softerror - Turn on soft error, i.e. instead of
+ issuing MSG_ERROR, MSG_WARN + exit 0
+ are used. The default is enable=no.],
+, enable_softerror=${slog2_enable_softerror:-no})
+
+# Find the home directory if not specified
+if test "X$srcdir" != "X." -a -s $srcdir/src/Makefile.in ; then
+ top_srcdir_abs=$srcdir
+else
+ PAC_GETWD(top_srcdir_abs,src/Makefile.in)
+fi
+
+if test -z "$top_srcdir_abs" ; then
+ top_srcdir_abs=`pwd`
+fi
+
+if test ! -d "$top_srcdir_abs" ; then
+ PAC_MSG_ERROR($enable_softerror, [*** $top_srcdir_abs is not a valid directory - cannot continue])
+fi
+
+AC_SUBST(top_srcdir_abs)
+
+# Determine this package's name based on its directory name
+changequote(,)
+tmpname="`echo $top_srcdir_abs | sed -e 's%\(.*\)/\([^/]*\)%\2%'`"
+pkgname="`echo $tmpname | sed -e 'y%abcdefghijklmnopqrstuvwxyz/%ABCDEFGHIJKLMNOPQRSTUVWXYZ_%'`"
+changequote([,])
+if test "x$pkgname" = "x" ; then
+ pkgname="TRACE-IMPL"
+fi
+
+echo "Configuring $pkgname implementation with $ac_configure_args"
+
+# Cannot use JAVA_HOME here in this configure.ac.
+# Because JAVA_HOME is used in Blackdown's .java_wrapper in jdk117_v3
+# Using JAVA_HOME here would mistakenly set some variable in .java_wrapper
+# when .java_wrapper is invoked. i.e. causes mysterious error in tests.
+AC_ARG_WITH(java,
+[--with-java=JDK_TOPDIR - The path of the top-level directory of
+ the Java SDK installation. If this option
+ or with-java2 is not given, configure
+ will try to locate java for you. Also,
+ with-java2 option overwrites the
+ with-java option to set JDK_TOPDIR.],
+JDK_TOPDIR=$withval, JDK_TOPDIR="")
+
+AC_ARG_WITH(java2,
+[--with-java2=JDK_TOPDIR - The path of the top-level directory of
+ the Java SDK installation. If this option
+ or with-java is not given, configure will
+ try to locate java for you. Also,
+ with-java2 option overwrites the
+ with-java option to set JDK_TOPDIR.],
+JDK_TOPDIR=$withval, )
+
+AC_ARG_WITH(jvmflags,
+[--with-jvmflags=JVMFLAGS - supply java virtual machine flags,
+ e.g. -Xms32m -Xmx256m.],
+JVMFLAGS="$withval")
+
+MAKE=${MAKE:-"make"}
+PAC_MAKE_IS_GNUMAKE
+PAC_MAKE_IS_BSD44
+PAC_MAKE_IS_OSF
+PAC_MAKE_VPATH
+if test ! -s src/rlog.h -a -z "$VPATH" ; then
+ AC_MSG_ERROR([No virtual MAKE path command found.
+ You may need to set your make command
+ The GNU make (sometimes available as gnumake) can be used.])
+fi
+VPATH_EXTRA=""
+case $VPATH in
+ VPATH=*)
+ VPATH_EXTRA=":\$(TRACE_SRCDIR)"
+ ;;
+ .PATH:*)
+ VPATH_EXTRA=" \$(TRACE_SRCDIR)"
+ ;;
+esac
+AC_SUBST(VPATH_EXTRA)
+AC_SUBST(MAKE)
+
+# Check if --without-java is specified
+if test "$JDK_TOPDIR" = "no" ; then
+ PAC_MSG_ERROR($enable_softerror, [--without-java is specified, exit!])
+fi
+
+AC_ARG_VAR(TRACE_CC,[TRACE_CC overrides CC if it exists.])
+AC_ARG_VAR(TRACE_CFLAGS,[TRACE_CFLAGS overrides CFLAGS if it exists.])
+dnl Check if TRACE_CC has been set before AC_PROG_CC
+if test -n "$TRACE_CC" ; then
+ TRACE_ORIG_CC="$CC"
+ CC="$TRACE_CC"
+fi
+dnl Check if TRACE_CFLAGS has been set before AC_PROG_CC
+if test -n "$TRACE_CFLAGS" ; then
+ TRACE_ORIG_CFLAGS="$CFLAGS"
+ CFLAGS="$TRACE_CFLAGS"
+fi
+dnl Checks for programs.
+AC_PROG_CC
+dnl Checks for header files.
+AC_HEADER_STDC
+AC_CHECK_HEADERS( stdlib.h stdio.h string.h ctype.h errno.h )
+dnl Checks for typedefs, structures, and compiler characteristics.
+AC_C_CONST
+dnl SIZEOF_VOID_P, SIZEOF_LONG, SIZEOF_LONG_LONG and SIZEOF__INT64 created
+dnl by AC_CHECK_SIZEOF( *, * ) are needed to compile
+dnl slog2sdk/src/logformat/trace/logformat_trace_InputLog.c
+AC_CHECK_SIZEOF(void *)
+AC_CHECK_SIZEOF(int)
+AC_CHECK_SIZEOF(long)
+AC_CHECK_SIZEOF(long long)
+AC_CHECK_SIZEOF(__int64)
+dnl -- Check if byteswapping needs to be done.
+if test "$cross_compiling" = "yes" -o "$cross_compiling" = 1 ; then
+ AC_MSG_CHECKING([for byte ordering])
+ if test "X$CROSS_BIGENDIAN" != "X" ; then
+ if test "$CROSS_BIGENDIAN" = "true" \
+ -o "$CROSS_BIGENDIAN" = "false" ; then
+ if test "$CROSS_BIGENDIAN" = "true" ; then
+ AC_DEFINE( WORDS_BIGENDIAN, 1,
+ [Define if byte order is bigendian] )
+ AC_MSG_RESULT( [defined to be big endian] )
+ else
+ AC_MSG_RESULT( [defined to be little endian] )
+ fi
+ else
+ AC_DEFINE( WORDS_BIGENDIAN, 1,
+ [Define if byte order is bigendian] )
+ AC_MSG_RESULT( [Unknown CROSS_BIGENDIAN, $CROSS_BIGENDIAN! Assumed big endian] )
+ fi
+ else
+ AC_DEFINE( WORDS_BIGENDIAN, 1, [Define if byte order is bigendian] )
+ AC_MSG_RESULT( [Undefined CROSS_BIGENDIAN! Assumed big endian] )
+ fi
+else
+ AC_C_BIGENDIAN
+fi
+
+LIBSO_PREFIX="lib"
+AC_CANONICAL_HOST
+case "$host_os" in
+ aix4* | aix5* )
+ dnl temporary fix to force libtool on AIX to generate .so file,
+ dnl i.e. inform libtool to do runtime linking.
+ LIBSO_LDFLAGS="-brtl"
+ ;;
+ *darwin* )
+ dnl force libtool to build .jnilib which is needed by Mac's JVM
+ LIBSO_LDFLAGS="-shrext .jnilib"
+ ;;
+ *cygwin* )
+ dnl Since SUN's JDK assumes a win32 compiler, so force cygwin/gcc
+ dnl to be in MINGW32 mode.
+ LIBSO_CFLAGS="-mno-cygwin"
+ LIBSO_LDFLAGS="-Wl,--enable-stdcall-fixup"
+ LIBSO_PREFIX=""
+ ;;
+esac
+dnl Strictly speaking, we need to test LIBSO_CFLAGS and LIBSO_LDFLAGS
+dnl with libtool before using them in Makefile. **FIXME**
+AC_SUBST(LIBSO_CFLAGS)
+AC_SUBST(LIBSO_LDFLAGS)
+AC_SUBST(LIBSO_PREFIX)
+
+dnl intel compiler does not need shared library symbol exported.
+EXPORT_SYMBOLS=yes
+case "$CC" in
+ *icc* )
+ EXPORT_SYMBOLS=no
+ ;;
+ *pgcc )
+ ;;
+esac
+AC_SUBST(EXPORT_SYMBOLS)
+
+AC_DISABLE_STATIC
+AC_LIBTOOL_WIN32_DLL
+dnl Set SED that is not set in AC_PROG_LIBTOOL in autoconf 2.5x
+AC_CHECK_PROG(SED, sed, sed, ;)
+AC_PROG_LIBTOOL
+AC_SUBST(LIBTOOL_DEPS)
+
+dnl Checks for libraries.
+dnl Replace `main' with a function in -lefence:
+AC_CHECK_LIB(efence, malloc, [DEBUG_LIBS="-lefence"; AC_SUBST(DEBUG_LIBS)])
+
+dnl Checks for library functions.
+AC_CHECK_FUNCS(strstr)
+
+JAC_JNI_HEADERS(JNI_INC, JDK_TOPDIR)
+if test "x$JNI_INC" = "x" ; then
+ PAC_MSG_ERROR($enable_softerror, [Invalid JNI include dir, exit!])
+fi
+AC_DEFINE(HAVE_JNI_H,1,[Define if <jni.h> is found])
+AC_SUBST(JNI_INC)
+
+JVM="$JDK_TOPDIR/bin/java"
+
+AC_SUBST(JVM)
+AC_SUBST(JVMFLAGS)
+
+JAC_CHECK_CYGPATH(JPATH_START, JPATH_FINAL)
+AC_SUBST(JPATH_START)
+AC_SUBST(JPATH_FINAL)
+
+dnl Checking for working INSTALL
+AC_PROG_INSTALL
+PAC_PROG_CHECK_INSTALL_WORKS
+PAC_PROG_INSTALL_BREAKS_LIBS
+
+CPRP=cp
+RM="rm -f"
+MV="mv -f"
+MKDIR=mkdir
+
+AC_SUBST(RM)
+#
+# libbuild_dir is used to build the libraries in before they are installed.
+# binbuild_dir is for the scripts/programs
+# includebuild_dir is for all user header files
+#
+rootbuild_dir=`pwd`
+for dir in lib bin share sbin ; do
+ dirname=${dir}build_dir
+ eval dirvalue=\$"$dirname"
+ eval $dirname=$rootbuild_dir/$dir
+done
+# echo "rootbuild_dir = $rootbuild_dir"
+changequote(,)
+gui_libbuild_dir="`echo $rootbuild_dir | sed -e 's%\(.*\)/[^/]*$%\1/lib%'`"
+changequote([,])
+# echo "gui_libbuild_dir = $gui_libbuild_dir"
+
+# VPATH build: Set the libbuild_dir
+if test ! -d $libbuild_dir ; then
+ AC_MSG_NOTICE([creating directory $libbuild_dir])
+ $MKDIR $libbuild_dir
+fi
+
+# VPATH build: Set the sharebuild_dir
+if test ! -d $sharebuild_dir ; then
+ AC_MSG_NOTICE([creating directory $sharebuild_dir])
+ $MKDIR $sharebuild_dir
+fi
+
+logfilesbuild_dir="$sharebuild_dir/examples/logfiles"
+if test ! -d $logfilesbuild_dir ; then
+ AC_MSG_NOTICE([creating directory $logfilesbuild_dir])
+ AS_MKDIR_P($logfilesbuild_dir)
+fi
+
+# Copying $srcdir/logfiles to logfilesbuild_dir
+if test -d $srcdir/logfiles ; then
+ AC_MSG_NOTICE([creating sample logfiles from source])
+ $CPRP -pr $srcdir/logfiles/*.rlog $logfilesbuild_dir
+fi
+
+AC_SUBST(libbuild_dir)
+AC_SUBST(binbuild_dir)
+AC_SUBST(sbinbuild_dir)
+AC_SUBST(sharebuild_dir)
+AC_SUBST(logfilesbuild_dir)
+AC_SUBST(gui_libbuild_dir)
+
+# Define bindir's executables, and pass them down to sbindir's install-package
+OLD_EXEFILES="traceprint traceTOslog2"
+
+PATH_OLD_EXEFILES="sbin/install-package"
+for exefile in $OLD_EXEFILES ; do
+ PATH_OLD_EXEFILES="$PATH_OLD_EXEFILES bin/$exefile"
+done
+
+TRACE_NAME=rlog
+AC_SUBST(TRACE_NAME)
+
+if test "X$TRACE_NAME" != "X" -a "$TRACE_NAME" != "trace" ; then
+ for oldpgm in $OLD_EXEFILES ; do
+ newpgm=$TRACE_NAME`echo $oldpgm | sed -e 's%trace%%'`
+ EXEFILES="$EXEFILES $newpgm"
+ done
+fi
+AC_SUBST(EXEFILES)
+
+AC_OUTPUT(Makefile src/Makefile $PATH_OLD_EXEFILES)
+
+for script in $PATH_OLD_EXEFILES ; do
+ if test -f "$script" ; then
+ chmod a+x $script
+ else
+ PAC_MSG_ERROR([*** $script is not a valid file - check if $srcdir is a valid TRACE-API implementation.])
+ fi
+done
+
+dnl Rename all the scripts in bindir according to the TRACE_NAME
+if test "X$TRACE_NAME" != "X" -a "$TRACE_NAME" != "trace" ; then
+ for oldpgm in $OLD_EXEFILES ; do
+ newpgm=$TRACE_NAME`echo $oldpgm | sed -e 's%trace%%'`
+ $MV bin/$oldpgm bin/$newpgm
+ done
+fi
+
+dnl Restore the original CC if it is needed
+if test -n "$TRACE_CC" ; then
+ CC="$TRACE_ORIG_CC"
+fi
+dnl Restore the original CFLAGS if it is needed
+if test -n "$TRACE_CFLAGS" ; then
+ CFLAGS="$TRACE_ORIG_CFLAGS"
+fi
Deleted: mpich2/trunk/src/mpe2/src/slog2sdk/trace_rlog/configure.in
===================================================================
--- mpich2/trunk/src/mpe2/src/slog2sdk/trace_rlog/configure.in 2012-02-28 23:25:23 UTC (rev 9547)
+++ mpich2/trunk/src/mpe2/src/slog2sdk/trace_rlog/configure.in 2012-02-28 23:26:34 UTC (rev 9548)
@@ -1,337 +0,0 @@
-dnl
-dnl Caching is usually WRONG for systems with cross-mounted file systems
-dnl (the cache file may correspond to a different system). Since configure
-dnl is not on a performance-critical path, go for robustness over speed.
-dnl
-define([AC_CACHE_LOAD], )dnl
-define([AC_CACHE_SAVE], )dnl
-dnl
-dnl
-dnl Process this file with autoconf to produce a configure script.
-AC_INIT()
-AC_PREREQ(2.52)
-AC_CONFIG_MACRO_DIR([confdb])
-AC_CONFIG_AUX_DIR([.])
-AC_CONFIG_HEADER([trace_impl.h])
-
-AC_ARG_ENABLE(strict,
-[--enable-strict - Turn on strict compilation testing
- when using gcc],
-COPTIONS="${COPTIONS} -Wall -O -Wstrict-prototypes -Wmissing-prototypes -DGCC_WALL")
-
-AC_ARG_ENABLE(echo,
-[--enable-echo - Turn on strong echoing. The default
- is enable=no.] ,set -x)
-
-AC_ARG_ENABLE(softerror,
-[--enable-softerror - Turn on soft error, i.e. instead of
- issuing MSG_ERROR, MSG_WARN + exit 0
- are used. The default is enable=no.],
-, enable_softerror=${slog2_enable_softerror:-no})
-
-# Find the home directory if not specified
-if test "X$srcdir" != "X." -a -s $srcdir/src/Makefile.in ; then
- top_srcdir_abs=$srcdir
-else
- PAC_GETWD(top_srcdir_abs,src/Makefile.in)
-fi
-
-if test -z "$top_srcdir_abs" ; then
- top_srcdir_abs=`pwd`
-fi
-
-if test ! -d "$top_srcdir_abs" ; then
- PAC_MSG_ERROR($enable_softerror, [*** $top_srcdir_abs is not a valid directory - cannot continue])
-fi
-
-AC_SUBST(top_srcdir_abs)
-
-# Determine this package's name based on its directory name
-changequote(,)
-tmpname="`echo $top_srcdir_abs | sed -e 's%\(.*\)/\([^/]*\)%\2%'`"
-pkgname="`echo $tmpname | sed -e 'y%abcdefghijklmnopqrstuvwxyz/%ABCDEFGHIJKLMNOPQRSTUVWXYZ_%'`"
-changequote([,])
-if test "x$pkgname" = "x" ; then
- pkgname="TRACE-IMPL"
-fi
-
-echo "Configuring $pkgname implementation with $ac_configure_args"
-
-# Cannot use JAVA_HOME here in this configure.in.
-# Because JAVA_HOME is used in Blackdown's .java_wrapper in jdk117_v3
-# Using JAVA_HOME here would mistakenly set some variable in .java_wrapper
-# when .java_wrapper is invoked. i.e. causes mysterious error in tests.
-AC_ARG_WITH(java,
-[--with-java=JDK_TOPDIR - The path of the top-level directory of
- the Java SDK installation. If this option
- or with-java2 is not given, configure
- will try to locate java for you. Also,
- with-java2 option overwrites the
- with-java option to set JDK_TOPDIR.],
-JDK_TOPDIR=$withval, JDK_TOPDIR="")
-
-AC_ARG_WITH(java2,
-[--with-java2=JDK_TOPDIR - The path of the top-level directory of
- the Java SDK installation. If this option
- or with-java is not given, configure will
- try to locate java for you. Also,
- with-java2 option overwrites the
- with-java option to set JDK_TOPDIR.],
-JDK_TOPDIR=$withval, )
-
-AC_ARG_WITH(jvmflags,
-[--with-jvmflags=JVMFLAGS - supply java virtual machine flags,
- e.g. -Xms32m -Xmx256m.],
-JVMFLAGS="$withval")
-
-MAKE=${MAKE:-"make"}
-PAC_MAKE_IS_GNUMAKE
-PAC_MAKE_IS_BSD44
-PAC_MAKE_IS_OSF
-PAC_MAKE_VPATH
-if test ! -s src/rlog.h -a -z "$VPATH" ; then
- AC_MSG_ERROR([No virtual MAKE path command found.
- You may need to set your make command
- The GNU make (sometimes available as gnumake) can be used.])
-fi
-VPATH_EXTRA=""
-case $VPATH in
- VPATH=*)
- VPATH_EXTRA=":\$(TRACE_SRCDIR)"
- ;;
- .PATH:*)
- VPATH_EXTRA=" \$(TRACE_SRCDIR)"
- ;;
-esac
-AC_SUBST(VPATH_EXTRA)
-AC_SUBST(MAKE)
-
-# Check if --without-java is specified
-if test "$JDK_TOPDIR" = "no" ; then
- PAC_MSG_ERROR($enable_softerror, [--without-java is specified, exit!])
-fi
-
-AC_ARG_VAR(TRACE_CC,[TRACE_CC overrides CC if it exists.])
-AC_ARG_VAR(TRACE_CFLAGS,[TRACE_CFLAGS overrides CFLAGS if it exists.])
-dnl Check if TRACE_CC has been set before AC_PROG_CC
-if test -n "$TRACE_CC" ; then
- TRACE_ORIG_CC="$CC"
- CC="$TRACE_CC"
-fi
-dnl Check if TRACE_CFLAGS has been set before AC_PROG_CC
-if test -n "$TRACE_CFLAGS" ; then
- TRACE_ORIG_CFLAGS="$CFLAGS"
- CFLAGS="$TRACE_CFLAGS"
-fi
-dnl Checks for programs.
-AC_PROG_CC
-dnl Checks for header files.
-AC_HEADER_STDC
-AC_CHECK_HEADERS( stdlib.h stdio.h string.h ctype.h errno.h )
-dnl Checks for typedefs, structures, and compiler characteristics.
-AC_C_CONST
-dnl SIZEOF_VOID_P, SIZEOF_LONG, SIZEOF_LONG_LONG and SIZEOF__INT64 created
-dnl by AC_CHECK_SIZEOF( *, * ) are needed to compile
-dnl slog2sdk/src/logformat/trace/logformat_trace_InputLog.c
-AC_CHECK_SIZEOF(void *)
-AC_CHECK_SIZEOF(int)
-AC_CHECK_SIZEOF(long)
-AC_CHECK_SIZEOF(long long)
-AC_CHECK_SIZEOF(__int64)
-dnl -- Check if byteswapping needs to be done.
-if test "$cross_compiling" = "yes" -o "$cross_compiling" = 1 ; then
- AC_MSG_CHECKING([for byte ordering])
- if test "X$CROSS_BIGENDIAN" != "X" ; then
- if test "$CROSS_BIGENDIAN" = "true" \
- -o "$CROSS_BIGENDIAN" = "false" ; then
- if test "$CROSS_BIGENDIAN" = "true" ; then
- AC_DEFINE( WORDS_BIGENDIAN, 1,
- [Define if byte order is bigendian] )
- AC_MSG_RESULT( [defined to be big endian] )
- else
- AC_MSG_RESULT( [defined to be little endian] )
- fi
- else
- AC_DEFINE( WORDS_BIGENDIAN, 1,
- [Define if byte order is bigendian] )
- AC_MSG_RESULT( [Unknown CROSS_BIGENDIAN, $CROSS_BIGENDIAN! Assumed big endian] )
- fi
- else
- AC_DEFINE( WORDS_BIGENDIAN, 1, [Define if byte order is bigendian] )
- AC_MSG_RESULT( [Undefined CROSS_BIGENDIAN! Assumed big endian] )
- fi
-else
- AC_C_BIGENDIAN
-fi
-
-LIBSO_PREFIX="lib"
-AC_CANONICAL_HOST
-case "$host_os" in
- aix4* | aix5* )
- dnl temporary fix to force libtool on AIX to generate .so file,
- dnl i.e. inform libtool to do runtime linking.
- LIBSO_LDFLAGS="-brtl"
- ;;
- *darwin* )
- dnl force libtool to build .jnilib which is needed by Mac's JVM
- LIBSO_LDFLAGS="-shrext .jnilib"
- ;;
- *cygwin* )
- dnl Since SUN's JDK assumes a win32 compiler, so force cygwin/gcc
- dnl to be in MINGW32 mode.
- LIBSO_CFLAGS="-mno-cygwin"
- LIBSO_LDFLAGS="-Wl,--enable-stdcall-fixup"
- LIBSO_PREFIX=""
- ;;
-esac
-dnl Strictly speaking, we need to test LIBSO_CFLAGS and LIBSO_LDFLAGS
-dnl with libtool before using them in Makefile. **FIXME**
-AC_SUBST(LIBSO_CFLAGS)
-AC_SUBST(LIBSO_LDFLAGS)
-AC_SUBST(LIBSO_PREFIX)
-
-dnl intel compiler does not need shared library symbol exported.
-EXPORT_SYMBOLS=yes
-case "$CC" in
- *icc* )
- EXPORT_SYMBOLS=no
- ;;
- *pgcc )
- ;;
-esac
-AC_SUBST(EXPORT_SYMBOLS)
-
-AC_DISABLE_STATIC
-AC_LIBTOOL_WIN32_DLL
-dnl Set SED that is not set in AC_PROG_LIBTOOL in autoconf 2.5x
-AC_CHECK_PROG(SED, sed, sed, ;)
-AC_PROG_LIBTOOL
-AC_SUBST(LIBTOOL_DEPS)
-
-dnl Checks for libraries.
-dnl Replace `main' with a function in -lefence:
-AC_CHECK_LIB(efence, malloc, [DEBUG_LIBS="-lefence"; AC_SUBST(DEBUG_LIBS)])
-
-dnl Checks for library functions.
-AC_CHECK_FUNCS(strstr)
-
-JAC_JNI_HEADERS(JNI_INC, JDK_TOPDIR)
-if test "x$JNI_INC" = "x" ; then
- PAC_MSG_ERROR($enable_softerror, [Invalid JNI include dir, exit!])
-fi
-AC_DEFINE(HAVE_JNI_H,1,[Define if <jni.h> is found])
-AC_SUBST(JNI_INC)
-
-JVM="$JDK_TOPDIR/bin/java"
-
-AC_SUBST(JVM)
-AC_SUBST(JVMFLAGS)
-
-JAC_CHECK_CYGPATH(JPATH_START, JPATH_FINAL)
-AC_SUBST(JPATH_START)
-AC_SUBST(JPATH_FINAL)
-
-dnl Checking for working INSTALL
-AC_PROG_INSTALL
-PAC_PROG_CHECK_INSTALL_WORKS
-PAC_PROG_INSTALL_BREAKS_LIBS
-
-CPRP=cp
-RM="rm -f"
-MV="mv -f"
-MKDIR=mkdir
-
-AC_SUBST(RM)
-#
-# libbuild_dir is used to build the libraries in before they are installed.
-# binbuild_dir is for the scripts/programs
-# includebuild_dir is for all user header files
-#
-rootbuild_dir=`pwd`
-for dir in lib bin share sbin ; do
- dirname=${dir}build_dir
- eval dirvalue=\$"$dirname"
- eval $dirname=$rootbuild_dir/$dir
-done
-# echo "rootbuild_dir = $rootbuild_dir"
-changequote(,)
-gui_libbuild_dir="`echo $rootbuild_dir | sed -e 's%\(.*\)/[^/]*$%\1/lib%'`"
-changequote([,])
-# echo "gui_libbuild_dir = $gui_libbuild_dir"
-
-# VPATH build: Set the libbuild_dir
-if test ! -d $libbuild_dir ; then
- AC_MSG_NOTICE([creating directory $libbuild_dir])
- $MKDIR $libbuild_dir
-fi
-
-# VPATH build: Set the sharebuild_dir
-if test ! -d $sharebuild_dir ; then
- AC_MSG_NOTICE([creating directory $sharebuild_dir])
- $MKDIR $sharebuild_dir
-fi
-
-logfilesbuild_dir="$sharebuild_dir/examples/logfiles"
-if test ! -d $logfilesbuild_dir ; then
- AC_MSG_NOTICE([creating directory $logfilesbuild_dir])
- AS_MKDIR_P($logfilesbuild_dir)
-fi
-
-# Copying $srcdir/logfiles to logfilesbuild_dir
-if test -d $srcdir/logfiles ; then
- AC_MSG_NOTICE([creating sample logfiles from source])
- $CPRP -pr $srcdir/logfiles/*.rlog $logfilesbuild_dir
-fi
-
-AC_SUBST(libbuild_dir)
-AC_SUBST(binbuild_dir)
-AC_SUBST(sbinbuild_dir)
-AC_SUBST(sharebuild_dir)
-AC_SUBST(logfilesbuild_dir)
-AC_SUBST(gui_libbuild_dir)
-
-# Define bindir's executables, and pass them down to sbindir's install-package
-OLD_EXEFILES="traceprint traceTOslog2"
-
-PATH_OLD_EXEFILES="sbin/install-package"
-for exefile in $OLD_EXEFILES ; do
- PATH_OLD_EXEFILES="$PATH_OLD_EXEFILES bin/$exefile"
-done
-
-TRACE_NAME=rlog
-AC_SUBST(TRACE_NAME)
-
-if test "X$TRACE_NAME" != "X" -a "$TRACE_NAME" != "trace" ; then
- for oldpgm in $OLD_EXEFILES ; do
- newpgm=$TRACE_NAME`echo $oldpgm | sed -e 's%trace%%'`
- EXEFILES="$EXEFILES $newpgm"
- done
-fi
-AC_SUBST(EXEFILES)
-
-AC_OUTPUT(Makefile src/Makefile $PATH_OLD_EXEFILES)
-
-for script in $PATH_OLD_EXEFILES ; do
- if test -f "$script" ; then
- chmod a+x $script
- else
- PAC_MSG_ERROR([*** $script is not a valid file - check if $srcdir is a valid TRACE-API implementation.])
- fi
-done
-
-dnl Rename all the scripts in bindir according to the TRACE_NAME
-if test "X$TRACE_NAME" != "X" -a "$TRACE_NAME" != "trace" ; then
- for oldpgm in $OLD_EXEFILES ; do
- newpgm=$TRACE_NAME`echo $oldpgm | sed -e 's%trace%%'`
- $MV bin/$oldpgm bin/$newpgm
- done
-fi
-
-dnl Restore the original CC if it is needed
-if test -n "$TRACE_CC" ; then
- CC="$TRACE_ORIG_CC"
-fi
-dnl Restore the original CFLAGS if it is needed
-if test -n "$TRACE_CFLAGS" ; then
- CFLAGS="$TRACE_ORIG_CFLAGS"
-fi
Copied: mpich2/trunk/src/mpe2/src/slog2sdk/trace_sample/configure.ac (from rev 9546, mpich2/trunk/src/mpe2/src/slog2sdk/trace_sample/configure.in)
===================================================================
--- mpich2/trunk/src/mpe2/src/slog2sdk/trace_sample/configure.ac (rev 0)
+++ mpich2/trunk/src/mpe2/src/slog2sdk/trace_sample/configure.ac 2012-02-28 23:26:34 UTC (rev 9548)
@@ -0,0 +1,363 @@
+dnl
+dnl Caching is usually WRONG for systems with cross-mounted file systems
+dnl (the cache file may correspond to a different system). Since configure
+dnl is not on a performance-critical path, go for robustness over speed.
+dnl
+define([AC_CACHE_LOAD], )dnl
+define([AC_CACHE_SAVE], )dnl
+dnl
+dnl
+dnl Process this file with autoconf to produce a configure script.
+dnl Prerequsite autoconf-2.60 for AC_TYPE_INT*_T and AC_TYPE_UINT*_T
+AC_INIT()
+AC_PREREQ(2.60)
+AC_CONFIG_MACRO_DIR([confdb])
+AC_CONFIG_AUX_DIR([.])
+AC_CONFIG_HEADER([trace_impl.h])
+
+AC_ARG_ENABLE(strict,
+[--enable-strict - Turn on strict compilation testing
+ when using gcc],
+COPTIONS="${COPTIONS} -Wall -O -Wstrict-prototypes -Wmissing-prototypes -DGCC_WALL")
+
+AC_ARG_ENABLE(echo,
+[--enable-echo - Turn on strong echoing. The default
+ is enable=no.] ,set -x)
+
+AC_ARG_ENABLE(softerror,
+[--enable-softerror - Turn on soft error, i.e. instead of
+ issuing MSG_ERROR, MSG_WARN + exit 0
+ are used. The default is enable=no.],
+, enable_softerror=${slog2_enable_softerror:-no})
+
+# Find the home directory if not specified
+if test "X$srcdir" != "X." -a -s $srcdir/src/Makefile.in ; then
+ top_srcdir_abs=$srcdir
+else
+ PAC_GETWD(top_srcdir_abs,src/Makefile.in)
+fi
+
+if test -z "$top_srcdir_abs" ; then
+ top_srcdir_abs=`pwd`
+fi
+
+if test ! -d "$top_srcdir_abs" ; then
+ PAC_MSG_ERROR($enable_softerror, [*** $top_srcdir_abs is not a valid directory - cannot continue])
+fi
+
+AC_SUBST(top_srcdir_abs)
+
+# Determine this package's name based on its directory name
+changequote(,)
+tmpname="`echo $top_srcdir_abs | sed -e 's%\(.*\)/\([^/]*\)%\2%'`"
+pkgname="`echo $tmpname | sed -e 'y%abcdefghijklmnopqrstuvwxyz/%ABCDEFGHIJKLMNOPQRSTUVWXYZ_%'`"
+changequote([,])
+if test "x$pkgname" = "x" ; then
+ pkgname="TRACE-IMPL"
+fi
+
+echo "Configuring $pkgname implementation with $ac_configure_args"
+
+# Cannot use JAVA_HOME here in this configure.ac.
+# Because JAVA_HOME is used in Blackdown's .java_wrapper in jdk117_v3
+# Using JAVA_HOME here would mistakenly set some variable in .java_wrapper
+# when .java_wrapper is invoked. i.e. causes mysterious error in tests.
+AC_ARG_WITH(java,
+[--with-java=JDK_TOPDIR - The path of the top-level directory of
+ the Java SDK installation. If this option
+ or with-java2 is not given, configure
+ will try to locate java for you. Also,
+ with-java2 option overwrites the
+ with-java option to set JDK_TOPDIR.],
+JDK_TOPDIR=$withval, JDK_TOPDIR="")
+
+AC_ARG_WITH(java2,
+[--with-java2=JDK_TOPDIR - The path of the top-level directory of
+ the Java SDK installation. If this option
+ or with-java is not given, configure will
+ try to locate java for you. Also,
+ with-java2 option overwrites the
+ with-java option to set JDK_TOPDIR.],
+JDK_TOPDIR=$withval, )
+
+AC_ARG_WITH(jvmflags,
+[--with-jvmflags=JVMFLAGS - supply java virtual machine flags,
+ e.g. -Xms32m -Xmx256m.],
+JVMFLAGS="$withval")
+
+MAKE=${MAKE:-"make"}
+PAC_MAKE_IS_GNUMAKE
+PAC_MAKE_IS_BSD44
+PAC_MAKE_IS_OSF
+PAC_MAKE_VPATH
+if test ! -s src/trace_impl.c -a -z "$VPATH" ; then
+ AC_MSG_ERROR([No virtual MAKE path command found.
+ You may need to set your make command
+ The GNU make (sometimes available as gnumake) can be used.])
+fi
+VPATH_EXTRA=""
+case $VPATH in
+ VPATH=*)
+ VPATH_EXTRA=":\$(TRACE_SRCDIR)"
+ ;;
+ .PATH:*)
+ VPATH_EXTRA=" \$(TRACE_SRCDIR)"
+ ;;
+esac
+AC_SUBST(VPATH_EXTRA)
+AC_SUBST(MAKE)
+
+# Check if --without-java is specified
+if test "$JDK_TOPDIR" = "no" ; then
+ PAC_MSG_ERROR($enable_softerror, [--without-java is specified, exit!])
+fi
+
+AC_ARG_VAR(TRACE_CC,[TRACE_CC overrides CC if it exists.])
+AC_ARG_VAR(TRACE_CFLAGS,[TRACE_CFLAGS overrides CFLAGS if it exists.])
+dnl Check if TRACE_CC has been set before AC_PROG_CC
+if test -n "$TRACE_CC" ; then
+ TRACE_ORIG_CC="$CC"
+ CC="$TRACE_CC"
+fi
+dnl Check if TRACE_CFLAGS has been set before AC_PROG_CC
+if test -n "$TRACE_CFLAGS" ; then
+ TRACE_ORIG_CFLAGS="$CFLAGS"
+ CFLAGS="$TRACE_CFLAGS"
+fi
+dnl Checks for programs.
+AC_PROG_CC
+dnl Checks for header files.
+AC_HEADER_STDC
+AC_CHECK_HEADERS( stdlib.h stdio.h string.h )
+dnl Checks for typedefs, structures, and compiler characteristics.
+AC_C_CONST
+dnl SIZEOF_VOID_P, SIZEOF_LONG, SIZEOF_LONG_LONG and SIZEOF__INT64 created
+dnl by AC_CHECK_SIZEOF( *, * ) are needed to compile
+dnl slog2sdk/src/logformat/trace/logformat_trace_InputLog.c
+AC_CHECK_SIZEOF(void *)
+AC_CHECK_SIZEOF(int)
+AC_CHECK_SIZEOF(long)
+AC_CHECK_SIZEOF(long long)
+AC_CHECK_SIZEOF(__int64)
+
+dnl Check for C99 integer types for info bytearray support.
+AC_TYPE_INT8_T
+AC_TYPE_INT16_T
+AC_TYPE_INT32_T
+AC_TYPE_INT64_T
+AC_TYPE_UINT8_T
+AC_TYPE_UINT16_T
+AC_TYPE_UINT32_T
+AC_TYPE_UINT64_T
+
+dnl If autoconf cannot define C99 integer types, we abort
+for bw in 8 16 32 64 ; do
+ eval pac_cv_c_intx_val=\$"ac_cv_c_int${bw}_t"
+ dnl echo "int${bw}_t = $pac_cv_c_intx_val"
+ if test "$pac_cv_c_intx_val" = no ; then
+ PAC_MSG_ERROR([int${bw}_t cannot be defined!])
+ fi
+ eval pac_cv_c_uintx_val=\$"ac_cv_c_uint${bw}_t"
+ dnl echo "uint${bw}_t = $pac_cv_c_uintx_val"
+ if test "$pac_cv_c_uintx_val" = no ; then
+ PAC_MSG_ERROR([uint${bw}_t cannot be defined!])
+ fi
+done
+
+dnl -- Check if byteswapping needs to be done.
+if test "$cross_compiling" = "yes" -o "$cross_compiling" = 1 ; then
+ AC_MSG_CHECKING([for byte ordering])
+ if test "X$CROSS_BIGENDIAN" != "X" ; then
+ if test "$CROSS_BIGENDIAN" = "true" \
+ -o "$CROSS_BIGENDIAN" = "false" ; then
+ if test "$CROSS_BIGENDIAN" = "true" ; then
+ AC_DEFINE( WORDS_BIGENDIAN, 1,
+ [Define if byte order is bigendian] )
+ AC_MSG_RESULT( [defined to be big endian] )
+ else
+ AC_MSG_RESULT( [defined to be little endian] )
+ fi
+ else
+ AC_DEFINE( WORDS_BIGENDIAN, 1,
+ [Define if byte order is bigendian] )
+ AC_MSG_RESULT( [Unknown CROSS_BIGENDIAN, $CROSS_BIGENDIAN! Assumed big endian] )
+ fi
+ else
+ AC_DEFINE( WORDS_BIGENDIAN, 1, [Define if byte order is bigendian] )
+ AC_MSG_RESULT( [Undefined CROSS_BIGENDIAN! Assumed big endian] )
+ fi
+else
+ AC_C_BIGENDIAN
+fi
+
+LIBSO_PREFIX="lib"
+AC_CANONICAL_HOST
+case "$host_os" in
+ aix4* | aix5* )
+ dnl temporary fix to force libtool on AIX to generate .so file,
+ dnl i.e. inform libtool to do runtime linking.
+ LIBSO_LDFLAGS="-brtl"
+ ;;
+ *darwin* )
+ dnl force libtool to build .jnilib which is needed by Mac's JVM
+ LIBSO_LDFLAGS="-shrext .jnilib"
+ ;;
+ *cygwin* )
+ dnl Since SUN's JDK assumes a win32 compiler, so force cygwin/gcc
+ dnl to be in MINGW32 mode.
+ LIBSO_CFLAGS="-mno-cygwin"
+ LIBSO_LDFLAGS="-Wl,--enable-stdcall-fixup"
+ LIBSO_PREFIX=""
+ ;;
+esac
+dnl Strictly speaking, we need to test LIBSO_CFLAGS and LIBSO_LDFLAGS
+dnl with libtool before using them in Makefile. **FIXME**
+AC_SUBST(LIBSO_CFLAGS)
+AC_SUBST(LIBSO_LDFLAGS)
+AC_SUBST(LIBSO_PREFIX)
+
+dnl intel compiler does not need shared library symbol exported.
+EXPORT_SYMBOLS=yes
+case "$CC" in
+ *icc* )
+ EXPORT_SYMBOLS=no
+ ;;
+ *pgcc )
+ ;;
+esac
+AC_SUBST(EXPORT_SYMBOLS)
+
+AC_DISABLE_STATIC
+AC_LIBTOOL_WIN32_DLL
+dnl Set SED that is not set in AC_PROG_LIBTOOL in autoconf 2.5x
+AC_CHECK_PROG(SED, sed, sed, ;)
+AC_PROG_LIBTOOL
+AC_SUBST(LIBTOOL_DEPS)
+
+dnl Checks for libraries.
+dnl Replace `main' with a function in -lefence:
+AC_CHECK_LIB(efence, malloc, [DEBUG_LIBS="-lefence"; AC_SUBST(DEBUG_LIBS)])
+
+dnl Checks for library functions.
+AC_CHECK_FUNCS(strstr)
+
+JAC_JNI_HEADERS(JNI_INC, JDK_TOPDIR)
+if test "x$JNI_INC" = "x" ; then
+ PAC_MSG_ERROR($enable_softerror, [Invalid JNI include dir, exit!])
+fi
+AC_DEFINE(HAVE_JNI_H,1,[Define if <jni.h> is found])
+AC_SUBST(JNI_INC)
+
+JVM="$JDK_TOPDIR/bin/java"
+
+AC_SUBST(JVM)
+AC_SUBST(JVMFLAGS)
+
+JAC_CHECK_CYGPATH(JPATH_START, JPATH_FINAL)
+AC_SUBST(JPATH_START)
+AC_SUBST(JPATH_FINAL)
+
+dnl Checking for working INSTALL
+AC_PROG_INSTALL
+PAC_PROG_CHECK_INSTALL_WORKS
+PAC_PROG_INSTALL_BREAKS_LIBS
+
+CPRP=cp
+RM="rm -f"
+MV="mv -f"
+MKDIR=mkdir
+
+AC_SUBST(RM)
+#
+# libbuild_dir is used to build the libraries in before they are installed.
+# binbuild_dir is for the scripts/programs
+# includebuild_dir is for all user header files
+#
+rootbuild_dir=`pwd`
+for dir in lib bin share sbin ; do
+ dirname=${dir}build_dir
+ eval dirvalue=\$"$dirname"
+ eval $dirname=$rootbuild_dir/$dir
+done
+# echo "rootbuild_dir = $rootbuild_dir"
+changequote(,)
+gui_libbuild_dir="`echo $rootbuild_dir | sed -e 's%\(.*\)/[^/]*$%\1/lib%'`"
+changequote([,])
+# echo "gui_libbuild_dir = $gui_libbuild_dir"
+
+# VPATH build: Set the libbuild_dir
+if test ! -d $libbuild_dir ; then
+ AC_MSG_NOTICE([creating directory $libbuild_dir])
+ $MKDIR $libbuild_dir
+fi
+
+# VPATH build: Set the sharebuild_dir
+if test ! -d $sharebuild_dir ; then
+ AC_MSG_NOTICE([creating directory $sharebuild_dir])
+ $MKDIR $sharebuild_dir
+fi
+
+logfilesbuild_dir="$sharebuild_dir/examples/logfiles"
+if test ! -d $logfilesbuild_dir ; then
+ AC_MSG_NOTICE([creating directory $logfilesbuild_dir])
+ AS_MKDIR_P($logfilesbuild_dir)
+fi
+
+# Copying $srcdir/logfiles to logfilesbuild_dir
+if test -d $srcdir/logfiles ; then
+ AC_MSG_NOTICE([creating sample logfiles from source])
+ $CPRP -pr $srcdir/logfiles/*.txt $logfilesbuild_dir
+fi
+
+AC_SUBST(libbuild_dir)
+AC_SUBST(binbuild_dir)
+AC_SUBST(sbinbuild_dir)
+AC_SUBST(sharebuild_dir)
+AC_SUBST(logfilesbuild_dir)
+AC_SUBST(gui_libbuild_dir)
+
+# Define bindir's executables, and pass them down to sbindir's install-package
+OLD_EXEFILES="traceprint traceTOslog2"
+
+PATH_OLD_EXEFILES="sbin/install-package"
+for exefile in $OLD_EXEFILES ; do
+ PATH_OLD_EXEFILES="$PATH_OLD_EXEFILES bin/$exefile"
+done
+
+TRACE_NAME=textlog
+AC_SUBST(TRACE_NAME)
+
+if test "X$TRACE_NAME" != "X" -a "$TRACE_NAME" != "trace" ; then
+ for oldpgm in $OLD_EXEFILES ; do
+ newpgm=$TRACE_NAME`echo $oldpgm | sed -e 's%trace%%'`
+ EXEFILES="$EXEFILES $newpgm"
+ done
+fi
+AC_SUBST(EXEFILES)
+
+AC_OUTPUT(Makefile src/Makefile $PATH_OLD_EXEFILES)
+
+for script in $PATH_OLD_EXEFILES ; do
+ if test -f "$script" ; then
+ chmod a+x $script
+ else
+ PAC_MSG_ERROR([*** $script is not a valid file - check if $srcdir is a valid TRACE-API implementation.])
+ fi
+done
+
+dnl Rename all the scripts in bindir according to the TRACE_NAME
+if test "X$TRACE_NAME" != "X" -a "$TRACE_NAME" != "trace" ; then
+ for oldpgm in $OLD_EXEFILES ; do
+ newpgm=$TRACE_NAME`echo $oldpgm | sed -e 's%trace%%'`
+ $MV bin/$oldpgm bin/$newpgm
+ done
+fi
+
+dnl Restore the original CC if it is needed
+if test -n "$TRACE_CC" ; then
+ CC="$TRACE_ORIG_CC"
+fi
+dnl Restore the original CFLAGS if it is needed
+if test -n "$TRACE_CFLAGS" ; then
+ CFLAGS="$TRACE_ORIG_CFLAGS"
+fi
Deleted: mpich2/trunk/src/mpe2/src/slog2sdk/trace_sample/configure.in
===================================================================
--- mpich2/trunk/src/mpe2/src/slog2sdk/trace_sample/configure.in 2012-02-28 23:25:23 UTC (rev 9547)
+++ mpich2/trunk/src/mpe2/src/slog2sdk/trace_sample/configure.in 2012-02-28 23:26:34 UTC (rev 9548)
@@ -1,363 +0,0 @@
-dnl
-dnl Caching is usually WRONG for systems with cross-mounted file systems
-dnl (the cache file may correspond to a different system). Since configure
-dnl is not on a performance-critical path, go for robustness over speed.
-dnl
-define([AC_CACHE_LOAD], )dnl
-define([AC_CACHE_SAVE], )dnl
-dnl
-dnl
-dnl Process this file with autoconf to produce a configure script.
-dnl Prerequsite autoconf-2.60 for AC_TYPE_INT*_T and AC_TYPE_UINT*_T
-AC_INIT()
-AC_PREREQ(2.60)
-AC_CONFIG_MACRO_DIR([confdb])
-AC_CONFIG_AUX_DIR([.])
-AC_CONFIG_HEADER([trace_impl.h])
-
-AC_ARG_ENABLE(strict,
-[--enable-strict - Turn on strict compilation testing
- when using gcc],
-COPTIONS="${COPTIONS} -Wall -O -Wstrict-prototypes -Wmissing-prototypes -DGCC_WALL")
-
-AC_ARG_ENABLE(echo,
-[--enable-echo - Turn on strong echoing. The default
- is enable=no.] ,set -x)
-
-AC_ARG_ENABLE(softerror,
-[--enable-softerror - Turn on soft error, i.e. instead of
- issuing MSG_ERROR, MSG_WARN + exit 0
- are used. The default is enable=no.],
-, enable_softerror=${slog2_enable_softerror:-no})
-
-# Find the home directory if not specified
-if test "X$srcdir" != "X." -a -s $srcdir/src/Makefile.in ; then
- top_srcdir_abs=$srcdir
-else
- PAC_GETWD(top_srcdir_abs,src/Makefile.in)
-fi
-
-if test -z "$top_srcdir_abs" ; then
- top_srcdir_abs=`pwd`
-fi
-
-if test ! -d "$top_srcdir_abs" ; then
- PAC_MSG_ERROR($enable_softerror, [*** $top_srcdir_abs is not a valid directory - cannot continue])
-fi
-
-AC_SUBST(top_srcdir_abs)
-
-# Determine this package's name based on its directory name
-changequote(,)
-tmpname="`echo $top_srcdir_abs | sed -e 's%\(.*\)/\([^/]*\)%\2%'`"
-pkgname="`echo $tmpname | sed -e 'y%abcdefghijklmnopqrstuvwxyz/%ABCDEFGHIJKLMNOPQRSTUVWXYZ_%'`"
-changequote([,])
-if test "x$pkgname" = "x" ; then
- pkgname="TRACE-IMPL"
-fi
-
-echo "Configuring $pkgname implementation with $ac_configure_args"
-
-# Cannot use JAVA_HOME here in this configure.in.
-# Because JAVA_HOME is used in Blackdown's .java_wrapper in jdk117_v3
-# Using JAVA_HOME here would mistakenly set some variable in .java_wrapper
-# when .java_wrapper is invoked. i.e. causes mysterious error in tests.
-AC_ARG_WITH(java,
-[--with-java=JDK_TOPDIR - The path of the top-level directory of
- the Java SDK installation. If this option
- or with-java2 is not given, configure
- will try to locate java for you. Also,
- with-java2 option overwrites the
- with-java option to set JDK_TOPDIR.],
-JDK_TOPDIR=$withval, JDK_TOPDIR="")
-
-AC_ARG_WITH(java2,
-[--with-java2=JDK_TOPDIR - The path of the top-level directory of
- the Java SDK installation. If this option
- or with-java is not given, configure will
- try to locate java for you. Also,
- with-java2 option overwrites the
- with-java option to set JDK_TOPDIR.],
-JDK_TOPDIR=$withval, )
-
-AC_ARG_WITH(jvmflags,
-[--with-jvmflags=JVMFLAGS - supply java virtual machine flags,
- e.g. -Xms32m -Xmx256m.],
-JVMFLAGS="$withval")
-
-MAKE=${MAKE:-"make"}
-PAC_MAKE_IS_GNUMAKE
-PAC_MAKE_IS_BSD44
-PAC_MAKE_IS_OSF
-PAC_MAKE_VPATH
-if test ! -s src/trace_impl.c -a -z "$VPATH" ; then
- AC_MSG_ERROR([No virtual MAKE path command found.
- You may need to set your make command
- The GNU make (sometimes available as gnumake) can be used.])
-fi
-VPATH_EXTRA=""
-case $VPATH in
- VPATH=*)
- VPATH_EXTRA=":\$(TRACE_SRCDIR)"
- ;;
- .PATH:*)
- VPATH_EXTRA=" \$(TRACE_SRCDIR)"
- ;;
-esac
-AC_SUBST(VPATH_EXTRA)
-AC_SUBST(MAKE)
-
-# Check if --without-java is specified
-if test "$JDK_TOPDIR" = "no" ; then
- PAC_MSG_ERROR($enable_softerror, [--without-java is specified, exit!])
-fi
-
-AC_ARG_VAR(TRACE_CC,[TRACE_CC overrides CC if it exists.])
-AC_ARG_VAR(TRACE_CFLAGS,[TRACE_CFLAGS overrides CFLAGS if it exists.])
-dnl Check if TRACE_CC has been set before AC_PROG_CC
-if test -n "$TRACE_CC" ; then
- TRACE_ORIG_CC="$CC"
- CC="$TRACE_CC"
-fi
-dnl Check if TRACE_CFLAGS has been set before AC_PROG_CC
-if test -n "$TRACE_CFLAGS" ; then
- TRACE_ORIG_CFLAGS="$CFLAGS"
- CFLAGS="$TRACE_CFLAGS"
-fi
-dnl Checks for programs.
-AC_PROG_CC
-dnl Checks for header files.
-AC_HEADER_STDC
-AC_CHECK_HEADERS( stdlib.h stdio.h string.h )
-dnl Checks for typedefs, structures, and compiler characteristics.
-AC_C_CONST
-dnl SIZEOF_VOID_P, SIZEOF_LONG, SIZEOF_LONG_LONG and SIZEOF__INT64 created
-dnl by AC_CHECK_SIZEOF( *, * ) are needed to compile
-dnl slog2sdk/src/logformat/trace/logformat_trace_InputLog.c
-AC_CHECK_SIZEOF(void *)
-AC_CHECK_SIZEOF(int)
-AC_CHECK_SIZEOF(long)
-AC_CHECK_SIZEOF(long long)
-AC_CHECK_SIZEOF(__int64)
-
-dnl Check for C99 integer types for info bytearray support.
-AC_TYPE_INT8_T
-AC_TYPE_INT16_T
-AC_TYPE_INT32_T
-AC_TYPE_INT64_T
-AC_TYPE_UINT8_T
-AC_TYPE_UINT16_T
-AC_TYPE_UINT32_T
-AC_TYPE_UINT64_T
-
-dnl If autoconf cannot define C99 integer types, we abort
-for bw in 8 16 32 64 ; do
- eval pac_cv_c_intx_val=\$"ac_cv_c_int${bw}_t"
- dnl echo "int${bw}_t = $pac_cv_c_intx_val"
- if test "$pac_cv_c_intx_val" = no ; then
- PAC_MSG_ERROR([int${bw}_t cannot be defined!])
- fi
- eval pac_cv_c_uintx_val=\$"ac_cv_c_uint${bw}_t"
- dnl echo "uint${bw}_t = $pac_cv_c_uintx_val"
- if test "$pac_cv_c_uintx_val" = no ; then
- PAC_MSG_ERROR([uint${bw}_t cannot be defined!])
- fi
-done
-
-dnl -- Check if byteswapping needs to be done.
-if test "$cross_compiling" = "yes" -o "$cross_compiling" = 1 ; then
- AC_MSG_CHECKING([for byte ordering])
- if test "X$CROSS_BIGENDIAN" != "X" ; then
- if test "$CROSS_BIGENDIAN" = "true" \
- -o "$CROSS_BIGENDIAN" = "false" ; then
- if test "$CROSS_BIGENDIAN" = "true" ; then
- AC_DEFINE( WORDS_BIGENDIAN, 1,
- [Define if byte order is bigendian] )
- AC_MSG_RESULT( [defined to be big endian] )
- else
- AC_MSG_RESULT( [defined to be little endian] )
- fi
- else
- AC_DEFINE( WORDS_BIGENDIAN, 1,
- [Define if byte order is bigendian] )
- AC_MSG_RESULT( [Unknown CROSS_BIGENDIAN, $CROSS_BIGENDIAN! Assumed big endian] )
- fi
- else
- AC_DEFINE( WORDS_BIGENDIAN, 1, [Define if byte order is bigendian] )
- AC_MSG_RESULT( [Undefined CROSS_BIGENDIAN! Assumed big endian] )
- fi
-else
- AC_C_BIGENDIAN
-fi
-
-LIBSO_PREFIX="lib"
-AC_CANONICAL_HOST
-case "$host_os" in
- aix4* | aix5* )
- dnl temporary fix to force libtool on AIX to generate .so file,
- dnl i.e. inform libtool to do runtime linking.
- LIBSO_LDFLAGS="-brtl"
- ;;
- *darwin* )
- dnl force libtool to build .jnilib which is needed by Mac's JVM
- LIBSO_LDFLAGS="-shrext .jnilib"
- ;;
- *cygwin* )
- dnl Since SUN's JDK assumes a win32 compiler, so force cygwin/gcc
- dnl to be in MINGW32 mode.
- LIBSO_CFLAGS="-mno-cygwin"
- LIBSO_LDFLAGS="-Wl,--enable-stdcall-fixup"
- LIBSO_PREFIX=""
- ;;
-esac
-dnl Strictly speaking, we need to test LIBSO_CFLAGS and LIBSO_LDFLAGS
-dnl with libtool before using them in Makefile. **FIXME**
-AC_SUBST(LIBSO_CFLAGS)
-AC_SUBST(LIBSO_LDFLAGS)
-AC_SUBST(LIBSO_PREFIX)
-
-dnl intel compiler does not need shared library symbol exported.
-EXPORT_SYMBOLS=yes
-case "$CC" in
- *icc* )
- EXPORT_SYMBOLS=no
- ;;
- *pgcc )
- ;;
-esac
-AC_SUBST(EXPORT_SYMBOLS)
-
-AC_DISABLE_STATIC
-AC_LIBTOOL_WIN32_DLL
-dnl Set SED that is not set in AC_PROG_LIBTOOL in autoconf 2.5x
-AC_CHECK_PROG(SED, sed, sed, ;)
-AC_PROG_LIBTOOL
-AC_SUBST(LIBTOOL_DEPS)
-
-dnl Checks for libraries.
-dnl Replace `main' with a function in -lefence:
-AC_CHECK_LIB(efence, malloc, [DEBUG_LIBS="-lefence"; AC_SUBST(DEBUG_LIBS)])
-
-dnl Checks for library functions.
-AC_CHECK_FUNCS(strstr)
-
-JAC_JNI_HEADERS(JNI_INC, JDK_TOPDIR)
-if test "x$JNI_INC" = "x" ; then
- PAC_MSG_ERROR($enable_softerror, [Invalid JNI include dir, exit!])
-fi
-AC_DEFINE(HAVE_JNI_H,1,[Define if <jni.h> is found])
-AC_SUBST(JNI_INC)
-
-JVM="$JDK_TOPDIR/bin/java"
-
-AC_SUBST(JVM)
-AC_SUBST(JVMFLAGS)
-
-JAC_CHECK_CYGPATH(JPATH_START, JPATH_FINAL)
-AC_SUBST(JPATH_START)
-AC_SUBST(JPATH_FINAL)
-
-dnl Checking for working INSTALL
-AC_PROG_INSTALL
-PAC_PROG_CHECK_INSTALL_WORKS
-PAC_PROG_INSTALL_BREAKS_LIBS
-
-CPRP=cp
-RM="rm -f"
-MV="mv -f"
-MKDIR=mkdir
-
-AC_SUBST(RM)
-#
-# libbuild_dir is used to build the libraries in before they are installed.
-# binbuild_dir is for the scripts/programs
-# includebuild_dir is for all user header files
-#
-rootbuild_dir=`pwd`
-for dir in lib bin share sbin ; do
- dirname=${dir}build_dir
- eval dirvalue=\$"$dirname"
- eval $dirname=$rootbuild_dir/$dir
-done
-# echo "rootbuild_dir = $rootbuild_dir"
-changequote(,)
-gui_libbuild_dir="`echo $rootbuild_dir | sed -e 's%\(.*\)/[^/]*$%\1/lib%'`"
-changequote([,])
-# echo "gui_libbuild_dir = $gui_libbuild_dir"
-
-# VPATH build: Set the libbuild_dir
-if test ! -d $libbuild_dir ; then
- AC_MSG_NOTICE([creating directory $libbuild_dir])
- $MKDIR $libbuild_dir
-fi
-
-# VPATH build: Set the sharebuild_dir
-if test ! -d $sharebuild_dir ; then
- AC_MSG_NOTICE([creating directory $sharebuild_dir])
- $MKDIR $sharebuild_dir
-fi
-
-logfilesbuild_dir="$sharebuild_dir/examples/logfiles"
-if test ! -d $logfilesbuild_dir ; then
- AC_MSG_NOTICE([creating directory $logfilesbuild_dir])
- AS_MKDIR_P($logfilesbuild_dir)
-fi
-
-# Copying $srcdir/logfiles to logfilesbuild_dir
-if test -d $srcdir/logfiles ; then
- AC_MSG_NOTICE([creating sample logfiles from source])
- $CPRP -pr $srcdir/logfiles/*.txt $logfilesbuild_dir
-fi
-
-AC_SUBST(libbuild_dir)
-AC_SUBST(binbuild_dir)
-AC_SUBST(sbinbuild_dir)
-AC_SUBST(sharebuild_dir)
-AC_SUBST(logfilesbuild_dir)
-AC_SUBST(gui_libbuild_dir)
-
-# Define bindir's executables, and pass them down to sbindir's install-package
-OLD_EXEFILES="traceprint traceTOslog2"
-
-PATH_OLD_EXEFILES="sbin/install-package"
-for exefile in $OLD_EXEFILES ; do
- PATH_OLD_EXEFILES="$PATH_OLD_EXEFILES bin/$exefile"
-done
-
-TRACE_NAME=textlog
-AC_SUBST(TRACE_NAME)
-
-if test "X$TRACE_NAME" != "X" -a "$TRACE_NAME" != "trace" ; then
- for oldpgm in $OLD_EXEFILES ; do
- newpgm=$TRACE_NAME`echo $oldpgm | sed -e 's%trace%%'`
- EXEFILES="$EXEFILES $newpgm"
- done
-fi
-AC_SUBST(EXEFILES)
-
-AC_OUTPUT(Makefile src/Makefile $PATH_OLD_EXEFILES)
-
-for script in $PATH_OLD_EXEFILES ; do
- if test -f "$script" ; then
- chmod a+x $script
- else
- PAC_MSG_ERROR([*** $script is not a valid file - check if $srcdir is a valid TRACE-API implementation.])
- fi
-done
-
-dnl Rename all the scripts in bindir according to the TRACE_NAME
-if test "X$TRACE_NAME" != "X" -a "$TRACE_NAME" != "trace" ; then
- for oldpgm in $OLD_EXEFILES ; do
- newpgm=$TRACE_NAME`echo $oldpgm | sed -e 's%trace%%'`
- $MV bin/$oldpgm bin/$newpgm
- done
-fi
-
-dnl Restore the original CC if it is needed
-if test -n "$TRACE_CC" ; then
- CC="$TRACE_ORIG_CC"
-fi
-dnl Restore the original CFLAGS if it is needed
-if test -n "$TRACE_CFLAGS" ; then
- CFLAGS="$TRACE_ORIG_CFLAGS"
-fi
Copied: mpich2/trunk/src/mpe2/src/wrappers/configure.ac (from rev 9546, mpich2/trunk/src/mpe2/src/wrappers/configure.in)
===================================================================
--- mpich2/trunk/src/mpe2/src/wrappers/configure.ac (rev 0)
+++ mpich2/trunk/src/mpe2/src/wrappers/configure.ac 2012-02-28 23:26:34 UTC (rev 9548)
@@ -0,0 +1,1043 @@
+dnl Caching is usually WRONG for systems with cross-mounted file systems
+dnl (the cache file may correspond to a different system). Since configure
+dnl is not on a performance-critical path, go for robustness over speed.
+dnl
+define([AC_CACHE_LOAD], )dnl
+define([AC_CACHE_SAVE], )dnl
+dnl
+dnl
+AC_INIT()
+AC_PREREQ(2.52)
+AC_CONFIG_HEADER(mpe_wrappers_conf.h)
+dnl
+echo "Configuring MPE Wrapper Libraries For MPI with $ac_configure_args"
+dnl
+dnl Set top_srcdir_abs to be the ABSOLUTE path to the home directory of MPE
+dnl top_srcdir is in relative path.
+if test "X$srcdir" != "X." -a -s $srcdir/src/log_mpi_core.c ; then
+ top_srcdir_abs=$srcdir
+else
+ PAC_GETWD( top_srcdir_abs, src/log_mpi_core.c )
+fi
+AC_SUBST(top_srcdir_abs)
+
+AC_ARG_ENABLE( echo,
+[--enable-echo - Turn on strong echoing.
+ The default is enable=no.],
+set -x )
+
+AC_ARG_ENABLE( softerror,
+[--enable-softerror - Turn on soft error, i.e. instead of
+ issuing MSG_ERROR, MSG_WARN + exit 0
+ are used. The default is enable=no.],
+, enable_softerror=${mpe_enable_softerror:-no} )
+
+MAKE=${MAKE:-make}
+MPI_IMPL=${MPI_IMPL:-UserSupplied}
+MPE_BUILD_FORTRAN2C=${MPE_BUILD_FORTRAN2C:-no}
+CC=${CC:-cc}
+CLINKER=${CLINKER:-$CC}
+CFLAGS=${MPE_CFLAGS}
+MPI_CC=${MPI_CC:-${CC}}
+MPE_CLINKER=${MPE_CLINKER}
+F77=${F77:-f77}
+FLINKER=${FLINKER:-$F77}
+FFLAGS=${MPE_FFLAGS}
+MPI_F77=${MPI_F77:-${F77}}
+MPE_FLINKER=${MPE_FLINKER}
+FINC_PATH_LEADER=${FINC_PATH_LEADER:-"-I"}
+FLIB_PATH_LEADER=${FLIB_PATH_LEADER:-"-L"}
+MPI_CFLAGS=${MPI_CFLAGS}
+MPI_FFLAGS=${MPI_FFLAGS}
+MPI_LIBS=${MPI_LIBS}
+
+MPE_LIBNAME=${MPE_LIBNAME:-mpe}
+PROF_LIBNAME="$MPE_LIBNAME"
+LOG_LIBNAME="l$MPE_LIBNAME"
+TRACE_LIBNAME="t$MPE_LIBNAME"
+F2CMPI_LIBNAME="${MPE_LIBNAME}_f2cmpi"
+
+PROF_LIBS="-l$PROF_LIBNAME"
+LOG_LIBS="-l$LOG_LIBNAME $PROF_LIBS"
+TRACE_LIBS="-l$TRACE_LIBNAME"
+F2CMPI_LIBS=""
+
+dnl Fixup for make
+PAC_MAKE_IS_GNUMAKE
+PAC_MAKE_IS_BSD44
+PAC_MAKE_IS_OSF
+PAC_MAKE_VPATH
+AC_SUBST(MAKE)
+
+dnl If we are relying on vpath and no vpath is set, then we must exit
+if test ! -s src/log_mpi_core.c -a -z "$VPATH" ; then
+ AC_MSG_ERROR( [No virtual MAKE path command found.
+ You may need to set your make command
+ The GNU make (sometimes available as gnumake) can be used.] )
+fi
+
+dnl CPRP is the version of cp that accepts -r and -p arguments.
+MKDIR=mkdir
+CPRP=cp
+RM=rm
+MV=mv
+AC_SUBST(MKDIR)
+AC_SUBST(CPRP)
+AC_SUBST(RM)
+AC_SUBST(MV)
+
+AC_ARG_WITH( mpiio,
+[--with-mpiio - Enable/Disable MPI-IO logging
+ in MPICHx build. The default is yes.], ,
+with_mpiio=yes )
+
+AC_ARG_ENABLE( romio,
+[--enable-romio - Enable/Disable ROMIO MPI-IO logging
+ in MPICHx build. The default is yes.],
+with_mpiio=$enableval,
+with_mpiio=yes )
+
+AC_ARG_ENABLE( checkMPI,
+[--enable-checkMPI - Turn on/off the linking test for the MPI
+ include files, MPI libraries and MPI_CC
+ compiler. The default is enable=yes.], ,
+enable_checkMPI=yes )
+
+AC_ARG_WITH( checkMPIO,
+[--enable-checkMPIO - Turn on/off the linking test for MPI-IO
+ routines in MPI implementation.
+ The default is enable=yes.], ,
+enable_checkMPIO=yes )
+
+dnl Ideally, enable_f2cmpilib should be extracted from the
+dnl CC/MPI_CC/MPI_CFLAGS/MPI_LIBS supplied by the user of MPE.
+dnl enable_f2cmpilib is used to determine if libmpe_f2cmpi.a( mpe_proff.o )
+dnl is needed for profiling of fortran MPI program
+dnl withOUT a PMPICH type of profiling library.
+AC_ARG_ENABLE( f2cmpilib,
+[--enable-f2cmpilib - Indicates if this MPE build will make
+ its own Fortran to C MPI wrapper library.
+ The library is needed for profiling
+ Fortran program in Non-MPICH platform.
+ The default is enable=yes.], ,
+enable_f2cmpilib=yes )
+
+AC_ARG_WITH( f2cmpilibs,
+[--with-f2cmpilibs=F2CMPI_LIBS - compiler's library flags for
+ Fortran to C MPI wrapper library.
+ Using this option disables building of
+ MPE's internal Fortran to C MPI library,
+ --disable-f2cmpilib. The library is
+ needed for profiling MPI Fortran program.
+ e.g. "-lfmpich" when MPE is building with
+ MPICH.],
+F2CMPI_LIBS="$withval" ; enable_f2cmpilib=no )
+
+AC_ARG_ENABLE( safePMPI,
+[--enable-safePMPI - Turn on/off the safe PMPI invocation, ie.
+ Turn off logging before making PMPI call.
+ Turn on logging after PMPI call. For
+ non-MPICH2 (standalone build), the default
+ is enable=yes for non-MPICH2 build. For
+ MPICH2 build, the default is enable=no.], ,
+enable_safePMPI=yes )
+
+AC_ARG_ENABLE( debugcheck,
+[--enable-debugcheck - Turn on/off the debugging & diagnostic
+ checking code in MPE code.
+ The default is enable=no.] )
+
+AC_ARG_ENABLE( broken-procnull,
+[--enable-broken-procnull - Handle MPI implementations with buggy
+ handling of MPI_PROC_NULL.],
+procnull_broken=$enableval, procnull_broken=default )
+
+dnl Set the various build directories from their mpe_ prefixed env variables.
+dnl
+dnl includebuild_dir is for all user header files
+dnl libbuild_dir is used to build the libraries in before they are installed.
+dnl binbuild_dir is for the scripts/programs
+dnl sbinbuild_dir is for all system admin tools
+dnl etcbuild_dir is for all system admin configuration settings
+dnl
+rootbuild_dir=`pwd`
+for dir in include lib bin sbin etc ; do
+ dirname=${dir}build_dir
+ mpe_dirname=mpe_${dirname}
+ eval dirvalue=\$"$dirname"
+ eval $dirname=\$\{${mpe_dirname}\}
+done
+
+for dir in include lib bin sbin etc ; do
+ dirname=${dir}build_dir
+ eval dirvalue=\$"$dirname"
+ if test -n "$dirvalue" ; then
+ if test ! -d $dirvalue ; then
+ if mkdir -p $dirvalue ; then
+ :
+ else
+ PAC_MSG_ERROR( $enable_softerror,
+ [Could not create directory $dirvalue] )
+ fi
+ fi
+ fi
+done
+
+AC_SUBST(includebuild_dir)
+AC_SUBST(libbuild_dir)
+AC_SUBST(binbuild_dir)
+AC_SUBST(sbinbuild_dir)
+AC_SUBST(etcbuild_dir)
+
+AC_PROG_CC
+AC_OBJEXT
+AC_EXEEXT
+dnl Check for broken handling of common symbols
+dnl PAC_PROG_C_BROKEN_COMMON
+AC_CHECK_PROG(AR, ar, ar, ;)
+AC_PROG_RANLIB
+
+dnl We need to check that this has worked. The autoconf macro is broken
+AC_PROG_CPP
+if test "$CPP" = "/lib/cpp" -a ! -x /lib/cpp ; then
+ AC_MSG_ERROR( [configure could not find a working C preprocessor] )
+fi
+
+dnl Invoking AC_CHECK_LIB before AC_PROG_CC makes AC_PROG_CC fail
+dnl in autoconf 2.59
+DEBUG_LIBS=""
+if test "$enable_debugcheck" = "yes" ; then
+ AC_CHECK_LIB( efence, malloc, DEBUG_LIBS="-lefence" )
+fi
+AC_SUBST(DEBUG_LIBS)
+
+AC_HEADER_STDC
+AC_C_CONST
+
+dnl Checking Headers
+AC_CHECK_HEADERS( stdio.h stdlib.h string.h )
+AC_CHECK_HEADER( stdarg.h,
+ [AC_DEFINE( HAVE_STDARG_H, 1,
+ [Define if stdarg.h is available] )
+ havestdarg=1], , )
+
+AC_FUNC_ALLOCA
+
+dnl
+dnl We need to build mpe with the shared library flags
+dnl This should rely on the same approach used in the mpich configure,
+dnl since just using TRY_LINK or TRY_COMPILE doesn't identify warning messages
+dnl about "compiler flag unrecognized".
+dnl
+dnl It isn't enough to check for stdarg. Even gcc doesn't get it right;
+dnl on some systems, the gcc version of stdio.h loads stdarg.h WITH THE WRONG
+dnl OPTIONS (causing it to choose the OLD STYLE va_start etc).
+dnl
+if test -n "$havestdarg" ; then
+ PAC_COMPILE_CHECK_FUNC(stdarg is correct,[
+#include <stdio.h>
+#include <stdarg.h>
+int func( int a, ... ){
+int b;
+va_list ap;
+va_start( ap, a );
+b = va_arg(ap, int);
+printf( "%d-%d\n", a, b );
+va_end(ap);
+fflush(stdout);
+return 0;
+}
+int main() { func( 1, 2 ); return 0;}],
+AC_DEFINE( USE_STDARG, 1, [Define is stdarg can be used] )
+)
+fi
+dnl
+AC_MSG_CHECKING( [if compiler accepts prototypes] )
+AC_TRY_COMPILE(, int f(double a);, have_proto=yes, have_proto=no)
+if test "$have_proto" = "yes" ; then
+ AC_DEFINE( HAVE_PROTOTYPES, 1,
+ [Define if the compiler supports simple prototyptes] )
+ AC_MSG_RESULT([yes])
+else
+ AC_MSG_RESULT([no])
+fi
+
+if test -z "$nonopt" ; then nonopt=NONE ; fi
+AC_CANONICAL_HOST
+case "$host" in
+ *irix*)
+dnl FIXME: the test has a problem when LAM on irix is configured!
+ if test "$MPI_IMPL" != "MPICH" -a "$MPI_IMPL" != "MPICH2" ; then
+ if test "$procnull_broken" = "default" ; then
+ procnull_broken=yes
+ fi
+ fi
+ ;;
+ *cray*)
+ if test "$MPE_BUILD_FORTRAN2C" = "yes" ; then
+ AC_MSG_CHECKING( [for Cray's FCD logical type] )
+ AC_LINK_IFELSE( [ AC_LANG_PROGRAM( [#include <fortran.h>], [
+ int clogical, flogical;
+ clogical = 1;
+ flogical = _btol( clogical );
+ clogical = _ltob( &flogical );
+ ] ) ], [ mpe_link_ok=yes ], [ mpe_link_ok=no ] )
+ if test "$mpe_link_ok" = "yes" ; then
+ AC_MSG_RESULT(yes)
+ AC_DEFINE( HAVE_CRAY_FCD_LOGICAL, 1,
+ [Define if CRAY's FCD logical is found] )
+ else
+ AC_MSG_RESULT(no)
+ fi
+ fi
+ ;;
+esac
+if test "$procnull_broken" = "yes" ; then
+ AC_DEFINE( HAVE_MPI_STATUS_BROKEN_ON_PROC_NULL, 1,
+ [Define if MPI_PROCNULL not handled in MPI_Status] )
+fi
+
+
+if test "$MPE_BUILD_FORTRAN2C" = "yes" ; then
+ if test "$enable_f2cmpilib" = "yes" ; then
+ F2CMPI_LIBS="-l$F2CMPI_LIBNAME"
+ fi
+dnl when --enable-f77 and --disable-f2cmpilib are selected,
+dnl value supplied in --with-f2cmpilibs will be used.
+else
+dnl If F2CMPI_LIBS="-lfmpich", disable building of libmpe_f2cmpi.a
+dnl by setting F2CMPI_LIBS="". Leave MPE_BUILD_FORTRAN2C=yes, so
+dnl fortran link/run tests can be performed.
+ F2CMPI_LIBS=""
+fi
+
+dnl Check Safe PMPI invocations
+AC_MSG_CHECKING( [for safe PMPI invocations] )
+if test "$MPI_IMPL" = "MPICH" -o "$MPI_IMPL" = "MPICH2" ; then
+ enable_safePMPI=no
+fi
+if test "$enable_safePMPI" = "yes" ; then
+ AC_MSG_RESULT(yes)
+ AC_DEFINE( MAKE_SAFE_PMPI_CALL, 1, [Define if safe PMPI calls are made] )
+else
+ AC_MSG_RESULT(no)
+fi
+
+dnl Check if Thread-support level in MPI implementation
+if test "$MPI_IMPL" != "MPICH" -a "$MPI_IMPL" != "MPICH2" ; then
+ if test "$enable_checkMPI" = "yes" ; then
+ AC_MSG_CHECKING( [for the C version of MPI_Init_thread] )
+ PAC_MPI_LINK_CC_FUNC( $MPI_CC, [$MPI_CFLAGS], $MPI_LIBS, ,
+ [ int itmp; int thread_level ],
+ [
+ itmp=MPI_Init_thread( NULL, NULL, MPI_THREAD_MULTIPLE, &thread_level )
+ ],
+ [ mpe_link_ok=yes ], [ mpe_link_ok=no ] )
+ if test "$mpe_link_ok" = "yes" ; then
+ AC_MSG_RESULT(yes)
+ AC_MSG_CHECKING( [for the C version of PMPI_Init_thread] )
+ PAC_MPI_LINK_CC_FUNC( $MPI_CC, [$MPI_CFLAGS], $MPI_LIBS, ,
+ [ int itmp; int thread_level],
+ [
+ itmp=PMPI_Init_thread( NULL, NULL, MPI_THREAD_MULTIPLE, &thread_level )
+ ],
+ [ mpe_link_ok=yes ], [ mpe_link_ok=no ] )
+ if test "$mpe_link_ok" = "yes" ; then
+ AC_MSG_RESULT(yes)
+ AC_DEFINE(HAVE_MPI_INIT_THREAD, 1,
+ [Define if MPI_Init_thread available])
+ else
+ AC_MSG_RESULT(no)
+ fi
+ else
+ AC_MSG_RESULT(no)
+ fi
+ fi
+else
+dnl MPICH2 has MPI_Init_thread().
+ if test "$MPI_IMPL" = "MPICH2" ; then
+ AC_DEFINE(HAVE_MPI_INIT_THREAD, 1,
+ [Define if MPI_Init_thread available])
+ fi
+fi
+
+
+dnl Check MPI-IO
+if test "$MPI_IMPL" != "MPICH" -a "$MPI_IMPL" != "MPICH2" ; then
+ if test "$enable_checkMPI" = "yes" -a "$enable_checkMPIO" = "yes" ; then
+ AC_MSG_CHECKING( [for the C version of MPI_File_open()] )
+ PAC_MPI_LINK_CC_FUNC( $MPI_CC, [$MPI_CFLAGS], $MPI_LIBS, ,
+ [ int itmp; MPI_File fh ],
+ [
+ itmp=MPI_File_open( MPI_COMM_WORLD, "mpiiotest",
+ MPI_MODE_CREATE | MPI_MODE_RDWR, MPI_INFO_NULL, &fh )
+ ],
+ [ mpe_link_ok=yes ], [ mpe_link_ok=no ] )
+ if test "$mpe_link_ok" = "yes" ; then
+ AC_MSG_RESULT(yes)
+ AC_MSG_CHECKING( [for the C version of PMPI_File_open()] )
+ PAC_MPI_LINK_CC_FUNC( $MPI_CC, [$MPI_CFLAGS], $MPI_LIBS, ,
+ [ int itmp; MPI_File fh ],
+ [
+ itmp=PMPI_File_open( MPI_COMM_WORLD, "mpiiotest",
+ MPI_MODE_CREATE | MPI_MODE_RDWR, MPI_INFO_NULL, &fh )
+ ],
+ [ mpe_link_ok=yes ], [ mpe_link_ok=no ] )
+ if test "$mpe_link_ok" = "yes" ; then
+ AC_MSG_RESULT(yes)
+ AC_DEFINE( HAVE_MPI_IO, 1, [Define if MPI-IO available] )
+ AC_MSG_CHECKING( [for ROMIO's MPIO_Request] )
+ PAC_MPI_LINK_CC_FUNC( $MPI_CC, [$MPI_CFLAGS], $MPI_LIBS, ,
+ [ MPIO_Request io_request], ,
+ [ mpe_link_ok=yes ], [ mpe_link_ok=no ] )
+ if test "$mpe_link_ok" = "yes" ; then
+ AC_MSG_RESULT(yes)
+ else
+ AC_MSG_RESULT(no)
+ AC_DEFINE( HAVE_NO_MPIO_REQUEST, 1,
+ [Define if no MPIO_Request] )
+ fi
+ else
+ AC_MSG_RESULT([no, assumed No MPI-IO routines])
+ fi
+ else
+ AC_MSG_RESULT([no, assumed No MPI-IO routines])
+ fi
+ fi
+else
+dnl When built with MPICHx, MPE configure observes --with-mpiio & --enable-romio
+dnl if test \( "$MPI_IMPL" = "MPICH" -o "$MPI_IMPL" = "MPICH2" \) \
+ if test "$with_mpiio" = "yes" ; then
+ AC_DEFINE( HAVE_MPI_IO, 1, [Define if MPI-IO available] )
+ fi
+fi
+
+dnl Check MPI-RMA
+if test "$MPI_IMPL" != "MPICH" -a "$MPI_IMPL" != "MPICH2" ; then
+ if test "$enable_checkMPI" = "yes" ; then
+ AC_MSG_CHECKING( [for the C version of MPI_Win_create] )
+ PAC_MPI_LINK_CC_FUNC( $MPI_CC, [$MPI_CFLAGS], $MPI_LIBS, ,
+ [ int itmp; MPI_Win win ],
+ [
+ itmp=MPI_Win_create( NULL, 0, 1, MPI_INFO_NULL, MPI_COMM_WORLD, &win )
+ ],
+ [ mpe_link_ok=yes ], [ mpe_link_ok=no ] )
+ if test "$mpe_link_ok" = "yes" ; then
+ AC_MSG_RESULT(yes)
+ AC_MSG_CHECKING( [for the C version of PMPI_Win_create] )
+ PAC_MPI_LINK_CC_FUNC( $MPI_CC, [$MPI_CFLAGS], $MPI_LIBS, ,
+ [ int itmp; MPI_Win win ],
+ [
+ itmp=PMPI_Win_create( NULL, 0, 1, MPI_INFO_NULL, MPI_COMM_WORLD, &win )
+ ],
+ [ mpe_link_ok=yes ], [ mpe_link_ok=no ] )
+ if test "$mpe_link_ok" = "yes" ; then
+ AC_MSG_RESULT(yes)
+ AC_DEFINE(HAVE_MPI_RMA, 1, [Define if MPI-RMA available])
+
+ dnl Start Test of MPI_Win_lock/unlock
+ AC_MSG_CHECKING([for the C version of MPI_Win_lock/unlock])
+ PAC_MPI_LINK_CC_FUNC($MPI_CC, [$MPI_CFLAGS], $MPI_LIBS, ,
+ [ int itmp; MPI_Win win ],
+ [
+ itmp=MPI_Win_create( NULL, 0, 1, MPI_INFO_NULL, MPI_COMM_WORLD, &win );
+ itmp=MPI_Win_lock( MPI_LOCK_EXCLUSIVE, 0, 0, win );
+ itmp=MPI_Win_unlock( 0, win )
+ ],
+ [ mpe_link_ok=yes ], [ mpe_link_ok=no ] )
+ if test "$mpe_link_ok" = "yes" ; then
+ AC_MSG_RESULT(yes)
+ AC_MSG_CHECKING([for the C version of PMPI_Win_lock/unlock])
+ PAC_MPI_LINK_CC_FUNC($MPI_CC, [$MPI_CFLAGS], $MPI_LIBS, ,
+ [ int itmp; MPI_Win win ],
+ [
+ itmp=PMPI_Win_create( NULL, 0, 1, MPI_INFO_NULL, MPI_COMM_WORLD, &win );
+ itmp=PMPI_Win_lock( MPI_LOCK_EXCLUSIVE, 0, 0, win );
+ itmp=PMPI_Win_unlock( 0, win )
+ ],
+ [ mpe_link_ok=yes ],
+ [ mpe_link_ok=no ] )
+ if test "$mpe_link_ok" = "yes" ; then
+ AC_MSG_RESULT(yes)
+ AC_DEFINE(HAVE_MPI_RMA_LOCK, 1,
+ [Define if MPI_Win_lock/unlock are available])
+ else
+ AC_MSG_RESULT(no)
+ fi
+ else
+ AC_MSG_RESULT(no)
+ fi
+ dnl End Test of MPI_Win_lock/unlock
+
+ dnl Start Test of MPI_Win_test
+ AC_MSG_CHECKING([for the C version of MPI_Win_test])
+ PAC_MPI_LINK_CC_FUNC($MPI_CC, [$MPI_CFLAGS], $MPI_LIBS, ,
+ [ int itmp, flag; MPI_Win win ],
+ [
+ itmp=MPI_Win_create( NULL, 0, 1, MPI_INFO_NULL, MPI_COMM_WORLD, &win );
+ itmp=MPI_Win_test( win, &flag )
+ ],
+ [ mpe_link_ok=yes ], [ mpe_link_ok=no ] )
+ if test "$mpe_link_ok" = "yes" ; then
+ AC_MSG_RESULT(yes)
+ AC_MSG_CHECKING([for the C version of PMPI_Win_test])
+ PAC_MPI_LINK_CC_FUNC($MPI_CC, [$MPI_CFLAGS], $MPI_LIBS, ,
+ [ int itmp, flag; MPI_Win win ],
+ [
+ itmp=PMPI_Win_create( NULL, 0, 1, MPI_INFO_NULL, MPI_COMM_WORLD, &win );
+ itmp=PMPI_Win_test( win, &flag )
+ ],
+ [ mpe_link_ok=yes ],
+ [ mpe_link_ok=no ] )
+ if test "$mpe_link_ok" = "yes" ; then
+ AC_MSG_RESULT(yes)
+ AC_DEFINE(HAVE_MPI_RMA_TEST, 1,
+ [Define if MPI_Win_test is available])
+ else
+ AC_MSG_RESULT(no)
+ fi
+ else
+ AC_MSG_RESULT(no)
+ fi
+ dnl End Test of MPI_Win_test
+
+ else
+ AC_MSG_RESULT([no, assumed No MPI-RMA routines])
+ fi
+ else
+ AC_MSG_RESULT([no, assumed No MPI-RMA routines])
+ fi
+ fi
+else
+dnl if MPICH2, assume MPI-RMA is available.
+ if test "$MPI_IMPL" = "MPICH2" ; then
+ AC_DEFINE( HAVE_MPI_RMA, 1, [Define if MPI-RMA is available] )
+ AC_DEFINE( HAVE_MPI_RMA_LOCK, 1,
+ [Define if MPI_Win_lock/unlock are available] )
+ AC_DEFINE(HAVE_MPI_RMA_TEST, 1,
+ [Define if MPI_Win_test is available])
+ fi
+fi
+
+dnl Check MPI-2 communicator functions
+if test "$MPI_IMPL" != "MPICH" -a "$MPI_IMPL" != "MPICH2" ; then
+ if test "$enable_checkMPI" = "yes" ; then
+ AC_MSG_CHECKING( [for the C version of MPI_Comm_connect/accept()] )
+ PAC_MPI_LINK_CC_FUNC( $MPI_CC, [$MPI_CFLAGS], $MPI_LIBS, ,
+ [ MPI_Comm intercomm; char *port ],
+ [
+ MPI_Comm_connect( port, MPI_INFO_NULL, 0, MPI_COMM_WORLD, &intercomm );
+ MPI_Comm_accept( port, MPI_INFO_NULL, 0, MPI_COMM_WORLD, &intercomm )
+ ],
+ [ mpe_link_ok=yes ], [ mpe_link_ok=no ] )
+ if test "$mpe_link_ok" = "yes" ; then
+ AC_MSG_RESULT(yes)
+ AC_MSG_CHECKING( [for the C version of PMPI_Comm_connect/accept()] )
+ PAC_MPI_LINK_CC_FUNC( $MPI_CC, [$MPI_CFLAGS], $MPI_LIBS, ,
+ [ MPI_Comm intercomm; char *port ],
+ [
+ PMPI_Comm_connect( port, MPI_INFO_NULL, 0, MPI_COMM_WORLD, &intercomm );
+ PMPI_Comm_accept( port, MPI_INFO_NULL, 0, MPI_COMM_WORLD, &intercomm )
+ ],
+ [ mpe_link_ok=yes ], [ mpe_link_ok=no ] )
+ if test "$mpe_link_ok" = "yes" ; then
+ AC_MSG_RESULT(yes)
+ AC_DEFINE( HAVE_MPI_SPAWN, 1,
+ [Define if MPI-SPAWN is available] )
+
+ dnl Start of Checking of MPI2 Naming Service
+ AC_MSG_CHECKING( [for the C version of MPI_Publish/Lookup_name()] )
+ PAC_MPI_LINK_CC_FUNC( $MPI_CC, [$MPI_CFLAGS], $MPI_LIBS, ,
+ [ char *port ],
+ [
+ MPI_Publish_name( "mpe_port_name", MPI_INFO_NULL, port );
+ MPI_Lookup_name( "mpe_port_name", MPI_INFO_NULL, port );
+ MPI_Unpublish_name( "mpe_port_name", MPI_INFO_NULL, port );
+ ],
+ [ mpe_link_ok=yes ], [ mpe_link_ok=no ] )
+ if test "$mpe_link_ok" = "yes" ; then
+ AC_MSG_RESULT(yes)
+ AC_MSG_CHECKING( [for the C version of PMPI_Publish/Lookup_name()] )
+ PAC_MPI_LINK_CC_FUNC($MPI_CC, [$MPI_CFLAGS], $MPI_LIBS, ,
+ [ char *port ],
+ [
+ PMPI_Publish_name( "mpe_port_name", MPI_INFO_NULL, port );
+ PMPI_Lookup_name( "mpe_port_name", MPI_INFO_NULL, port );
+ PMPI_Unpublish_name( "mpe_port_name", MPI_INFO_NULL, port );
+ ],
+ [ mpe_link_ok=yes ],
+ [ mpe_link_ok=no ] )
+ if test "$mpe_link_ok" = "yes" ; then
+ AC_MSG_RESULT(yes)
+ AC_DEFINE( HAVE_MPI_NAMING, 1,
+ [Define if MPI Naming Service is available] )
+ else
+ AC_MSG_RESULT(no)
+ fi
+ else
+ AC_MSG_RESULT(no)
+ fi
+ dnl End of Checking of MPI2 Naming Service
+ else
+ AC_MSG_RESULT(no)
+ fi
+ else
+ AC_MSG_RESULT(no)
+ fi
+ fi
+else
+dnl if MPICH2 assume all MPI-2 communicator functions are available.
+ if test "$MPI_IMPL" = "MPICH2" ; then
+ AC_DEFINE( HAVE_MPI_SPAWN, 1, [Define if MPI-SPAWN is available] )
+ fi
+fi
+
+dnl Determine if MPI_STATUS_IGNORE exists
+if test "$MPI_IMPL" != "MPICH" -a "$MPI_IMPL" != "MPICH2" ; then
+ AC_MSG_CHECKING( [for MPI_STATUS_IGNORE] )
+ PAC_MPI_LINK_CC_FUNC( $MPI_CC, [$MPI_CFLAGS], $MPI_LIBS, ,
+ [
+ MPI_Status* tmp_status;
+ tmp_status = MPI_STATUS_IGNORE;
+ ], ,
+ [ mpe_link_ok=yes ], [ mpe_link_ok=no ] )
+ AC_MSG_RESULT($mpe_link_ok)
+else
+ # All known impls, including MPICH, support STATUS_IGNORE
+ # (The MPICH support may have a few bugs, but it is close enough
+ # for our needs)
+ mpe_link_ok=yes
+fi
+if test "$mpe_link_ok" = "yes" ; then
+ AC_DEFINE( HAVE_MPI_STATUS_IGNORE, 1,
+ [Define if MPI_STATUS_IGNORE available] )
+fi
+
+dnl Determine if MPI_STATUSES_IGNORE exists
+if test "$MPI_IMPL" != "MPICH" -a "$MPI_IMPL" != "MPICH2" ; then
+ AC_MSG_CHECKING( [for MPI_STATUSES_IGNORE] )
+ PAC_MPI_LINK_CC_FUNC( $MPI_CC, [$MPI_CFLAGS], $MPI_LIBS, ,
+ [
+ MPI_Status* tmp_status;
+ tmp_status = MPI_STATUSES_IGNORE;
+ ], ,
+ [ mpe_link_ok=yes ], [ mpe_link_ok=no ] )
+ AC_MSG_RESULT($mpe_link_ok)
+else
+ # All known impls, including MPICH, support STATUS_IGNORE
+ # (The MPICH support may have a few bugs, but it is close enough
+ # for our needs)
+ mpe_link_ok=yes
+fi
+if test "$mpe_link_ok" = "yes" ; then
+ AC_DEFINE( HAVE_MPI_STATUSES_IGNORE, 1,
+ [Define if MPI_STATUSES_IGNORE available] )
+fi
+
+dnl This is temporary! Eventually MPICH-2 will have its own f2c MPI wrappers.
+dnl When MPICH-2 has the wrappers ready, the following block should be removed
+if test "${F2CMPI_LIBS}" = "-l${F2CMPI_LIBNAME}" \
+ -a "$MPI_IMPL" = "MPICH2" ; then
+
+# FIXME: MPICH2 include MPI_Fint, Need to fetch the value somehow.
+
+# Obtain MPICH2's MPI_STATUS_SIZE from environmental variable
+ AC_MSG_CHECKING( [for the value of MPI_STATUS_SIZE] )
+ if test -n "$SIZEOF_MPI_STATUS" ; then
+ # FIXME: Get true value of MPI_Fint instead of 4
+ CROSS_MPI_STATUS_SIZE=`expr $SIZEOF_MPI_STATUS / 4`
+ MPI_STATUS_SIZE=$CROSS_MPI_STATUS_SIZE
+ AC_MSG_RESULT($MPI_STATUS_SIZE)
+ AC_DEFINE_UNQUOTED( MPI_STATUS_SIZE, $MPI_STATUS_SIZE,
+ [Define as the size of MPI_STATUS_SIZE] )
+ else
+dnl For MPICH2, when SIZEOF_MPI_STATUS is not defined, enable_f77=no.
+dnl Set MPE_BUILD_FORTRAN2C=no and F2CMPI_LIBS="" so liblmpe.a
+dnl won't be built and fortran link/run tests won't executed.
+dnl If F2CMPI_LIBS="-lfmpich", disable building of libmpe_f2cmpi.a
+dnl by setting F2CMPI_LIBS="". Leave MPE_BUILD_FORTRAN2C=yes, so
+dnl fortran link/run tests can be performed.
+ AC_MSG_RESULT("undefined -- disabling fortran features.")
+ MPE_BUILD_FORTRAN2C=no
+ F2CMPI_LIBS=""
+ fi
+
+# MPICH2 after 1.0.2 release has MPI_F_STATUS_IGNORE, MPI_F_STATUSES_IGNORE
+ AC_DEFINE( HAVE_MPI_F_STATUS_IGNORE, 1,
+ [Define if MPI_F_STATUS_IGNORE available] )
+ AC_DEFINE( HAVE_MPI_F_STATUSES_IGNORE, 1,
+ [Define if MPI_F_STATUSES_IGNORE available] )
+
+# MPICH2 has MPI_Comm_f2c()/c2f()
+ AC_DEFINE( HAVE_MPI_COMM_F2C, 1,
+ [Define if MPI_Comm_f2c and c2f available] )
+
+# MPICH2 has MPI_Status_f2c()/c2f()
+ AC_DEFINE( HAVE_MPI_STATUS_F2C, 1,
+ [Define if MPI_Status_f2c and c2f available] )
+
+# MPICH2 has MPI_TYPE_f2c()/c2f()
+ AC_DEFINE( HAVE_MPI_TYPE_F2C, 1,
+ [Define if MPI_Type_F2c and c2f available] )
+
+# MPICH2 has MPI_Group_f2c()/c2f()
+ AC_DEFINE( HAVE_MPI_GROUP_F2C, 1,
+ [Define if MPI_Group_f2c and c2f available] )
+
+# MPICH2 has MPI_Request_f2c()/c2f()
+ AC_DEFINE( HAVE_MPI_REQUEST_F2C, 1,
+ [Define if MPI_Request_f2c and c2f available] )
+
+# MPICH2 has MPI_Op_f2c()/c2f()
+ AC_DEFINE( HAVE_MPI_OP_F2C, 1,
+ [Define if MPI_Op_f2c and c2f available] )
+
+# MPICH2 has MPI_Errhandler_f2c()/c2f()
+ AC_DEFINE( HAVE_MPI_ERRHANDLER_F2C, 1,
+ [Define if MPI_Errhandler_f2c and c2f available] )
+
+# Define MPICH2's Fortran TRUE/FALSE value
+ # FIXME: Use the values from the Fortran configure
+ true_val=1
+ AC_DEFINE_UNQUOTED( MPE_F77_TRUE_VALUE, $true_val,
+ [Define as the value for Fortran logical true] )
+ false_val=0
+ AC_DEFINE_UNQUOTED( MPE_F77_FALSE_VALUE, $false_val,
+ [Define as the value for Fortran logical false] )
+dnl endif test "${F2CMPI_LIBS}" = "-l${F2CMPI_LIBNAME}"
+dnl -a "$MPI_IMPL" = "MPICH2" ; then
+fi
+
+
+dnl
+dnl Test Non-MPICH platform's Fortran to C capability
+dnl
+if test "${F2CMPI_LIBS}" = "-l${F2CMPI_LIBNAME}" \
+ -a "$MPI_IMPL" != "MPICH2" ; then
+
+dnl Determine MPI_Fint
+dnl (same test done in graphics's configure.ac)
+ AC_MSG_CHECKING( [for MPI_Fint] )
+ PAC_MPI_LINK_CC_FUNC( $MPI_CC, [$MPI_CFLAGS], $MPI_LIBS, ,
+ [ MPI_Fint aa=1 ], ,
+ [ mpe_link_ok=yes ], [ mpe_link_ok=no ] )
+ if test "$mpe_link_ok" = "yes" ; then
+ AC_MSG_RESULT(yes)
+ MPI_FINT_TYPE=MPI_Fint
+ else
+ AC_MSG_RESULT([no, assumed MPI_Fint to be int])
+ MPI_FINT_TYPE=int
+ AC_DEFINE( MPI_Fint, int, [Define MPI_Fint as int] )
+ fi
+
+dnl Determine if MPI_F_STATUS_IGNORE exists
+ AC_MSG_CHECKING( [for MPI_F_STATUS_IGNORE] )
+ PAC_MPI_LINK_CC_FUNC( $MPI_CC, [$MPI_CFLAGS], $MPI_LIBS, ,
+ [
+ ${MPI_FINT_TYPE} *f_status;
+ f_status = MPI_F_STATUS_IGNORE;
+ ], ,
+ [ mpe_link_ok=yes ], [ mpe_link_ok=no ] )
+ AC_MSG_RESULT($mpe_link_ok)
+if test "$mpe_link_ok" = "yes" ; then
+ AC_DEFINE( HAVE_MPI_F_STATUS_IGNORE, 1,
+ [Define if MPI_F_STATUS_IGNORE available] )
+fi
+
+dnl Determine if MPI_F_STATUSES_IGNORE exists
+ AC_MSG_CHECKING( [for MPI_F_STATUSES_IGNORE] )
+ PAC_MPI_LINK_CC_FUNC( $MPI_CC, [$MPI_CFLAGS], $MPI_LIBS, ,
+ [
+ ${MPI_FINT_TYPE} *f_statuses;
+ f_statuses = MPI_F_STATUSES_IGNORE;
+ ], ,
+ [ mpe_link_ok=yes ], [ mpe_link_ok=no ] )
+ AC_MSG_RESULT($mpe_link_ok)
+if test "$mpe_link_ok" = "yes" ; then
+ AC_DEFINE( HAVE_MPI_F_STATUSES_IGNORE, 1,
+ [Define if MPI_F_STATUSES_IGNORE available] )
+fi
+
+dnl Determmine if MPI_Comm_f2c() and MPI_Comm_c2f() are there
+dnl (same test done in graphics's configure.ac)
+ AC_MSG_CHECKING( [for MPI_Comm_c2f() and MPI_Comm_f2c()] )
+ PAC_MPI_LINK_CC_FUNC( $MPI_CC, [$MPI_CFLAGS], $MPI_LIBS, ,
+ [ MPI_Comm comm; ${MPI_FINT_TYPE} aa; ],
+ [
+ aa=MPI_Comm_c2f(comm) ;
+ comm=MPI_Comm_f2c(aa) ;
+ ],
+ [ mpe_link_ok=yes ], [ mpe_link_ok=no ] )
+ AC_MSG_RESULT($mpe_link_ok)
+ if test "$mpe_link_ok" = "yes" ; then
+ AC_DEFINE( HAVE_MPI_COMM_F2C, 1,
+ [Define if MPI_Comm_f2c and c2f available] )
+ fi
+
+dnl # Determine MPI_STATUS_SIZE (this is the INTEGER status size for Fortran)
+dnl mpe_tmpfile=mpe_mpistatusvalue
+dnl AC_MSG_CHECKING( [for the value of MPI_STATUS_SIZE] )
+dnl if test "$cross_compiling" = "yes" -o "$cross_compiling" = 1 ; then
+dnl if test "X$CROSS_MPI_STATUS_SIZE" != "X" ; then
+dnl mpe_MPI_STATUS_SIZE="$CROSS_MPI_STATUS_SIZE"
+dnl AC_DEFINE_UNQUOTED( MPI_STATUS_SIZE, $mpe_MPI_STATUS_SIZE,
+dnl [Define as the size of MPI_STATUS_SIZE] )
+dnl AC_MSG_RESULT( [${mpe_MPI_STATUS_SIZE}] )
+dnl else
+dnl PAC_MSG_ERROR( $enable_softerror,
+dnl [Undefined CROSS_MPI_STATUS_SIZE! Exiting...] )
+dnl fi
+dnl else
+dnl dnl PAC_MPI_RUN_F77_PGM( $MPI_F77, [$MPI_FFLAGS],
+dnl dnl $F77, $FFLAGS, $LIBS, [
+dnl dnl program get_mpi_status_size
+dnl dnl include 'mpif.h'
+dnl dnl open(10, file="$mpe_tmpfile", status='unknown')
+dnl dnl rewind(10)
+dnl dnl write(10,*) MPI_STATUS_SIZE
+dnl dnl close(10)
+dnl dnl end
+dnl dnl ], [ mpe_run_ok=yes ], [ mpe_run_ok=no ] )
+dnl PAC_MPI_RUN_CC_PGM( $MPI_CC, [$MPI_CFLAGS],
+dnl $CC, $CFLAGS, $LIBS, [
+dnl #include <stdio.h>
+dnl #include "mpi.h"
+dnl main()
+dnl {
+dnl FILE *mpe_file = fopen( "$mpe_tmpfile", "w" );
+dnl if ( ! mpe_file ) exit( 1 );
+dnl fprintf( mpe_file, "%d\n",
+dnl sizeof( MPI_Status )/sizeof( ${MPI_FINT_TYPE} ) );
+dnl fclose( mpe_file );
+dnl exit( 0 );
+dnl }
+dnl ], [ mpe_run_ok=yes ], [ mpe_run_ok=no ] )
+dnl if test "$mpe_run_ok" = "yes" ; then
+dnl mpe_MPI_STATUS_SIZE="`cat ${mpe_tmpfile} | sed -e 's/ //g'`"
+dnl AC_DEFINE_UNQUOTED( MPI_STATUS_SIZE, $mpe_MPI_STATUS_SIZE,
+dnl [Define as the size of MPI_STATUS_SIZE] )
+dnl AC_MSG_RESULT( [${mpe_MPI_STATUS_SIZE}] )
+dnl rm -f ${mpe_tmpfile}
+dnl else
+dnl if test "X$CROSS_MPI_STATUS_SIZE" != "X" ; then
+dnl mpe_MPI_STATUS_SIZE="$CROSS_MPI_STATUS_SIZE"
+dnl AC_DEFINE_UNQUOTED( MPI_STATUS_SIZE, $mpe_MPI_STATUS_SIZE,
+dnl [Define as the size of MPI_STATUS_SIZE] )
+dnl AC_MSG_RESULT( [use supplied value: ${mpe_MPI_STATUS_SIZE}] )
+dnl else
+dnl PAC_MSG_ERROR( $enable_softerror, [could NOT determine!] )
+dnl fi
+dnl fi
+dnl fi
+
+# Determmine if MPI_Status_f2c() and MPI_Status_c2f() are there
+# Make mpe_MPI_STATUS_SIZE >> real sizeof(MPI_Status)/sizeof(MPI_Fint)
+ mpe_MPI_STATUS_SIZE=100
+ AC_MSG_CHECKING( [for MPI_Status_c2f() and MPI_Status_f2c()] )
+ PAC_MPI_LINK_CC_FUNC( $MPI_CC, [$MPI_CFLAGS], $MPI_LIBS, ,
+ [[
+ MPI_Status c_status;
+ ${MPI_FINT_TYPE} f_status[ ${mpe_MPI_STATUS_SIZE} ];
+ int ierr;
+ ]],
+ [
+ ierr=MPI_Status_c2f( &c_status, f_status ) ;
+ ierr=MPI_Status_f2c( f_status, &c_status ) ;
+ ],
+ [ mpe_link_ok=yes ], [ mpe_link_ok=no ] )
+ AC_MSG_RESULT($mpe_link_ok)
+ if test "$mpe_link_ok" = "yes" ; then
+ AC_DEFINE( HAVE_MPI_STATUS_F2C, 1,
+ [Define if MPI_Status_f2c and c2f available] )
+ fi
+
+# Determmine if MPI_Type_f2c() and MPI_Type_c2f() are there
+ AC_MSG_CHECKING( [for MPI_Type_c2f() and MPI_Type_f2c()] )
+ PAC_MPI_LINK_CC_FUNC( $MPI_CC, [$MPI_CFLAGS], $MPI_LIBS, ,
+ [ MPI_Datatype type; ${MPI_FINT_TYPE} aa; ],
+ [
+ aa=MPI_Type_c2f(type) ;
+ type=MPI_Type_f2c(aa) ;
+ ],
+ [ mpe_link_ok=yes ], [ mpe_link_ok=no ] )
+ AC_MSG_RESULT($mpe_link_ok)
+ if test "$mpe_link_ok" = "yes" ; then
+ AC_DEFINE( HAVE_MPI_TYPE_F2C, 1,
+ [Define if MPI_Type_F2c and c2f available] )
+ fi
+
+# Determmine if MPI_Group_f2c() and MPI_Group_c2f() are there
+ AC_MSG_CHECKING( [for MPI_Group_c2f() and MPI_Group_f2c()] )
+ PAC_MPI_LINK_CC_FUNC( $MPI_CC, [$MPI_CFLAGS], $MPI_LIBS, ,
+ [ MPI_Group group; ${MPI_FINT_TYPE} aa; ],
+ [
+ aa=MPI_Group_c2f(group) ;
+ group=MPI_Group_f2c(aa) ;
+ ],
+ [ mpe_link_ok=yes ], [ mpe_link_ok=no ] )
+ AC_MSG_RESULT($mpe_link_ok)
+ if test "$mpe_link_ok" = "yes" ; then
+ AC_DEFINE( HAVE_MPI_GROUP_F2C, 1,
+ [Define if MPI_Group_f2c and c2f available] )
+ fi
+
+# Determmine if MPI_Request_f2c() and MPI_Request_c2f() are there
+ AC_MSG_CHECKING( [for MPI_Request_c2f() and MPI_Request_f2c()] )
+ PAC_MPI_LINK_CC_FUNC( $MPI_CC, [$MPI_CFLAGS], $MPI_LIBS, ,
+ [ MPI_Request request; ${MPI_FINT_TYPE} aa; ],
+ [
+ aa=MPI_Request_c2f(request) ;
+ request=MPI_Request_f2c(aa) ;
+ ],
+ [ mpe_link_ok=yes ], [ mpe_link_ok=no ] )
+ AC_MSG_RESULT($mpe_link_ok)
+ if test "$mpe_link_ok" = "yes" ; then
+ AC_DEFINE( HAVE_MPI_REQUEST_F2C, 1,
+ [Define if MPI_Request_f2c and c2f available] )
+ fi
+
+# Determmine if MPI_Op_f2c() and MPI_Op_c2f() are there
+ AC_MSG_CHECKING( [for MPI_Op_c2f() and MPI_Op_f2c()] )
+ PAC_MPI_LINK_CC_FUNC( $MPI_CC, [$MPI_CFLAGS], $MPI_LIBS, ,
+ [ MPI_Op op; ${MPI_FINT_TYPE} aa; ],
+ [
+ aa=MPI_Op_c2f(op) ;
+ op=MPI_Op_f2c(aa) ;
+ ],
+ [ mpe_link_ok=yes ], [ mpe_link_ok=no ] )
+ AC_MSG_RESULT($mpe_link_ok)
+ if test "$mpe_link_ok" = "yes" ; then
+ AC_DEFINE( HAVE_MPI_OP_F2C, 1,
+ [Define if MPI_Op_f2c and c2f available] )
+ fi
+
+# Determmine if MPI_Errhandler_f2c() and MPI_Errhandler_c2f() are there
+ AC_MSG_CHECKING( [for MPI_Errhandler_c2f() and MPI_Errhandler_f2c()] )
+ PAC_MPI_LINK_CC_FUNC( $MPI_CC, [$MPI_CFLAGS], $MPI_LIBS, ,
+ [ MPI_Errhandler errhandler; ${MPI_FINT_TYPE} aa; ],
+ [
+ aa=MPI_Errhandler_c2f(errhandler) ;
+ errhandler=MPI_Errhandler_f2c(aa) ;
+ ],
+ [ mpe_link_ok=yes ], [ mpe_link_ok=no ] )
+ AC_MSG_RESULT($mpe_link_ok)
+ if test "$mpe_link_ok" = "yes" ; then
+ AC_DEFINE( HAVE_MPI_ERRHANDLER_F2C, 1,
+ [Define if MPI_Errhandler_f2c and c2f available] )
+ fi
+
+
+dnl # Determine the Fortran logical values, .TRUE. & .FALSE. in MPI C program
+dnl if test "$cross_compiling" = "yes" -o "$cross_compiling" = 1 ; then
+dnl AC_MSG_CHECKING( [for the Fortran .TRUE. values in MPI C program] )
+dnl if test "X$CROSS_FORTRAN2C_TRUE" != "X" ; then
+dnl AC_DEFINE_UNQUOTED( MPE_F77_TRUE_VALUE, $CROSS_FORTRAN2C_TRUE,
+dnl [Define as the value for Fortran logical true] )
+dnl AC_MSG_RESULT( [${CROSS_FORTRAN2C_TRUE}] )
+dnl else
+dnl PAC_MSG_ERROR( $enable_softerror,
+dnl [Undefined CROSS_FORTRAN2C_TRUE! Exiting...] )
+dnl fi
+dnl AC_MSG_CHECKING( [for the Fortran .FALSE. values in MPI C program] )
+dnl if test "X$CROSS_FORTRAN2C_FALSE" != "X" ; then
+dnl AC_DEFINE_UNQUOTED( MPE_F77_FALSE_VALUE, $CROSS_FORTRAN2C_FALSE,
+dnl [Define as the value for Fortran logical false] )
+dnl AC_MSG_RESULT( [${CROSS_FORTRAN2C_FALSE}] )
+dnl else
+dnl PAC_MSG_ERROR( $enable_softerror,
+dnl [Undefined CROSS_FORTRAN2C_FALSE! Exiting...] )
+dnl fi
+dnl else
+dnl AC_MSG_CHECKING( [for the Fortran logical values in MPI C program] )
+dnl mpe_tmpfile=mpe_f77logicals
+dnl PAC_MPI_RUN_F77_FUNC_FROM_C( $F77, $FFLAGS,
+dnl $MPI_CC, [-I../.. $MPI_CFLAGS],
+dnl $CC, [$CFLAGS], $LIBS, [
+dnl subroutine ftest( itrue, ifalse )
+dnl logical itrue, ifalse
+dnl itrue = .TRUE.
+dnl ifalse = .FALSE.
+dnl return
+dnl end
+dnl ], [
+dnl /* mpe_conf.h defines the needed F77_NAME_XXX, and is located in -I../.. */
+dnl #include "mpe_conf.h"
+dnl #ifdef F77_NAME_UPPER
+dnl #define ftest_ FTEST
+dnl #elif defined(F77_NAME_LOWER) || defined(F77_NAME_MIXED)
+dnl #define ftest_ ftest
+dnl #endif
+dnl #include <stdio.h>
+dnl #include "mpi.h"
+dnl int main()
+dnl {
+dnl ${MPI_FINT_TYPE} itrue, ifalse;
+dnl FILE *mpe_file = fopen( "$mpe_tmpfile", "w" );
+dnl if ( ! mpe_file ) exit( 1 );
+dnl ftest_( &itrue, &ifalse );
+dnl fprintf( mpe_file, "%d %d\n", itrue, ifalse );
+dnl fclose( mpe_file );
+dnl exit( 0 );
+dnl }
+dnl ],
+dnl [ mpe_link_ok=yes ], [ mpe_link_ok=no ] )
+dnl if test "$mpe_run_ok" = "yes" ; then
+dnl mpe_f77logicals="`cat ${mpe_tmpfile}`"
+dnl true_val="`echo ${mpe_f77logicals} | sed -e 's/ .*//g'`"
+dnl false_val="`echo ${mpe_f77logicals} | sed -e 's/.* *//g'`"
+dnl if test -n "$true_val" -a -n "$false_val" ; then
+dnl AC_DEFINE_UNQUOTED( MPE_F77_TRUE_VALUE, $true_val,
+dnl [Define as the value for Fortran logical true] )
+dnl AC_DEFINE_UNQUOTED( MPE_F77_FALSE_VALUE, $false_val,
+dnl [Define as the value for Fortran logical false] )
+dnl AC_MSG_RESULT( [True=$true_val and False=$false_val] )
+dnl else
+dnl PAC_MSG_ERROR( $enable_softerror, [could NOT determine!] )
+dnl fi
+dnl rm -f ${mpe_tmpfile}
+dnl else
+dnl if test "X$CROSS_FORTRAN2C_TRUE" != "X" \
+dnl -a "X$CROSS_FORTRAN2C_FALSE" != "X" ; then
+dnl AC_DEFINE_UNQUOTED( MPE_F77_TRUE_VALUE, $CROSS_FORTRAN2C_TRUE,
+dnl [Define as the value for Fortran logical true] )
+dnl AC_DEFINE_UNQUOTED( MPE_F77_FALSE_VALUE, $CROSS_FORTRAN2C_FALSE,
+dnl [Define as the value for Fortran logical false] )
+dnl AC_MSG_RESULT( [use supplied values: True=$CROSS_FORTRAN2C_TRUE and False=$CROSS_FORTRAN2C_FALSE] )
+dnl else
+dnl PAC_MSG_ERROR( $enable_softerror, [could NOT determine!] )
+dnl fi
+dnl fi
+dnl fi
+
+dnl endif test "${F2CMPI_LIBS}" = "-l${F2CMPI_LIBNAME}"
+dnl -a "$MPI_IMPL" != "MPICH2" ; then
+fi
+
+AC_SUBST(MPI_IMPL)
+AC_SUBST(MPE_BUILD_FORTRAN2C)
+AC_SUBST(CC)
+AC_SUBST(CLINKER)
+AC_SUBST(CFLAGS)
+AC_SUBST(MPI_CC)
+AC_SUBST(MPE_CLINKER)
+AC_SUBST(F77)
+AC_SUBST(FLINKER)
+AC_SUBST(FFLAGS)
+AC_SUBST(MPI_F77)
+AC_SUBST(MPE_FLINKER)
+AC_SUBST(FINC_PATH_LEADER)
+AC_SUBST(FLIB_PATH_LEADER)
+AC_SUBST(MPI_CFLAGS)
+AC_SUBST(MPI_FFLAGS)
+AC_SUBST(MPI_LIBS)
+
+AC_SUBST(LOG_LIBNAME)
+AC_SUBST(TRACE_LIBNAME)
+AC_SUBST(F2CMPI_LIBNAME)
+AC_SUBST(PROF_LIBS)
+AC_SUBST(LOG_LIBS)
+AC_SUBST(TRACE_LIBS)
+AC_SUBST(F2CMPI_LIBS)
+
+AC_OUTPUT( Makefile src/Makefile test/Makefile \
+ etc/mpe_f77env.conf etc/mpe_mpilog.conf etc/mpe_mpitrace.conf )
Deleted: mpich2/trunk/src/mpe2/src/wrappers/configure.in
===================================================================
--- mpich2/trunk/src/mpe2/src/wrappers/configure.in 2012-02-28 23:25:23 UTC (rev 9547)
+++ mpich2/trunk/src/mpe2/src/wrappers/configure.in 2012-02-28 23:26:34 UTC (rev 9548)
@@ -1,1043 +0,0 @@
-dnl Caching is usually WRONG for systems with cross-mounted file systems
-dnl (the cache file may correspond to a different system). Since configure
-dnl is not on a performance-critical path, go for robustness over speed.
-dnl
-define([AC_CACHE_LOAD], )dnl
-define([AC_CACHE_SAVE], )dnl
-dnl
-dnl
-AC_INIT()
-AC_PREREQ(2.52)
-AC_CONFIG_HEADER(mpe_wrappers_conf.h)
-dnl
-echo "Configuring MPE Wrapper Libraries For MPI with $ac_configure_args"
-dnl
-dnl Set top_srcdir_abs to be the ABSOLUTE path to the home directory of MPE
-dnl top_srcdir is in relative path.
-if test "X$srcdir" != "X." -a -s $srcdir/src/log_mpi_core.c ; then
- top_srcdir_abs=$srcdir
-else
- PAC_GETWD( top_srcdir_abs, src/log_mpi_core.c )
-fi
-AC_SUBST(top_srcdir_abs)
-
-AC_ARG_ENABLE( echo,
-[--enable-echo - Turn on strong echoing.
- The default is enable=no.],
-set -x )
-
-AC_ARG_ENABLE( softerror,
-[--enable-softerror - Turn on soft error, i.e. instead of
- issuing MSG_ERROR, MSG_WARN + exit 0
- are used. The default is enable=no.],
-, enable_softerror=${mpe_enable_softerror:-no} )
-
-MAKE=${MAKE:-make}
-MPI_IMPL=${MPI_IMPL:-UserSupplied}
-MPE_BUILD_FORTRAN2C=${MPE_BUILD_FORTRAN2C:-no}
-CC=${CC:-cc}
-CLINKER=${CLINKER:-$CC}
-CFLAGS=${MPE_CFLAGS}
-MPI_CC=${MPI_CC:-${CC}}
-MPE_CLINKER=${MPE_CLINKER}
-F77=${F77:-f77}
-FLINKER=${FLINKER:-$F77}
-FFLAGS=${MPE_FFLAGS}
-MPI_F77=${MPI_F77:-${F77}}
-MPE_FLINKER=${MPE_FLINKER}
-FINC_PATH_LEADER=${FINC_PATH_LEADER:-"-I"}
-FLIB_PATH_LEADER=${FLIB_PATH_LEADER:-"-L"}
-MPI_CFLAGS=${MPI_CFLAGS}
-MPI_FFLAGS=${MPI_FFLAGS}
-MPI_LIBS=${MPI_LIBS}
-
-MPE_LIBNAME=${MPE_LIBNAME:-mpe}
-PROF_LIBNAME="$MPE_LIBNAME"
-LOG_LIBNAME="l$MPE_LIBNAME"
-TRACE_LIBNAME="t$MPE_LIBNAME"
-F2CMPI_LIBNAME="${MPE_LIBNAME}_f2cmpi"
-
-PROF_LIBS="-l$PROF_LIBNAME"
-LOG_LIBS="-l$LOG_LIBNAME $PROF_LIBS"
-TRACE_LIBS="-l$TRACE_LIBNAME"
-F2CMPI_LIBS=""
-
-dnl Fixup for make
-PAC_MAKE_IS_GNUMAKE
-PAC_MAKE_IS_BSD44
-PAC_MAKE_IS_OSF
-PAC_MAKE_VPATH
-AC_SUBST(MAKE)
-
-dnl If we are relying on vpath and no vpath is set, then we must exit
-if test ! -s src/log_mpi_core.c -a -z "$VPATH" ; then
- AC_MSG_ERROR( [No virtual MAKE path command found.
- You may need to set your make command
- The GNU make (sometimes available as gnumake) can be used.] )
-fi
-
-dnl CPRP is the version of cp that accepts -r and -p arguments.
-MKDIR=mkdir
-CPRP=cp
-RM=rm
-MV=mv
-AC_SUBST(MKDIR)
-AC_SUBST(CPRP)
-AC_SUBST(RM)
-AC_SUBST(MV)
-
-AC_ARG_WITH( mpiio,
-[--with-mpiio - Enable/Disable MPI-IO logging
- in MPICHx build. The default is yes.], ,
-with_mpiio=yes )
-
-AC_ARG_ENABLE( romio,
-[--enable-romio - Enable/Disable ROMIO MPI-IO logging
- in MPICHx build. The default is yes.],
-with_mpiio=$enableval,
-with_mpiio=yes )
-
-AC_ARG_ENABLE( checkMPI,
-[--enable-checkMPI - Turn on/off the linking test for the MPI
- include files, MPI libraries and MPI_CC
- compiler. The default is enable=yes.], ,
-enable_checkMPI=yes )
-
-AC_ARG_WITH( checkMPIO,
-[--enable-checkMPIO - Turn on/off the linking test for MPI-IO
- routines in MPI implementation.
- The default is enable=yes.], ,
-enable_checkMPIO=yes )
-
-dnl Ideally, enable_f2cmpilib should be extracted from the
-dnl CC/MPI_CC/MPI_CFLAGS/MPI_LIBS supplied by the user of MPE.
-dnl enable_f2cmpilib is used to determine if libmpe_f2cmpi.a( mpe_proff.o )
-dnl is needed for profiling of fortran MPI program
-dnl withOUT a PMPICH type of profiling library.
-AC_ARG_ENABLE( f2cmpilib,
-[--enable-f2cmpilib - Indicates if this MPE build will make
- its own Fortran to C MPI wrapper library.
- The library is needed for profiling
- Fortran program in Non-MPICH platform.
- The default is enable=yes.], ,
-enable_f2cmpilib=yes )
-
-AC_ARG_WITH( f2cmpilibs,
-[--with-f2cmpilibs=F2CMPI_LIBS - compiler's library flags for
- Fortran to C MPI wrapper library.
- Using this option disables building of
- MPE's internal Fortran to C MPI library,
- --disable-f2cmpilib. The library is
- needed for profiling MPI Fortran program.
- e.g. "-lfmpich" when MPE is building with
- MPICH.],
-F2CMPI_LIBS="$withval" ; enable_f2cmpilib=no )
-
-AC_ARG_ENABLE( safePMPI,
-[--enable-safePMPI - Turn on/off the safe PMPI invocation, ie.
- Turn off logging before making PMPI call.
- Turn on logging after PMPI call. For
- non-MPICH2 (standalone build), the default
- is enable=yes for non-MPICH2 build. For
- MPICH2 build, the default is enable=no.], ,
-enable_safePMPI=yes )
-
-AC_ARG_ENABLE( debugcheck,
-[--enable-debugcheck - Turn on/off the debugging & diagnostic
- checking code in MPE code.
- The default is enable=no.] )
-
-AC_ARG_ENABLE( broken-procnull,
-[--enable-broken-procnull - Handle MPI implementations with buggy
- handling of MPI_PROC_NULL.],
-procnull_broken=$enableval, procnull_broken=default )
-
-dnl Set the various build directories from their mpe_ prefixed env variables.
-dnl
-dnl includebuild_dir is for all user header files
-dnl libbuild_dir is used to build the libraries in before they are installed.
-dnl binbuild_dir is for the scripts/programs
-dnl sbinbuild_dir is for all system admin tools
-dnl etcbuild_dir is for all system admin configuration settings
-dnl
-rootbuild_dir=`pwd`
-for dir in include lib bin sbin etc ; do
- dirname=${dir}build_dir
- mpe_dirname=mpe_${dirname}
- eval dirvalue=\$"$dirname"
- eval $dirname=\$\{${mpe_dirname}\}
-done
-
-for dir in include lib bin sbin etc ; do
- dirname=${dir}build_dir
- eval dirvalue=\$"$dirname"
- if test -n "$dirvalue" ; then
- if test ! -d $dirvalue ; then
- if mkdir -p $dirvalue ; then
- :
- else
- PAC_MSG_ERROR( $enable_softerror,
- [Could not create directory $dirvalue] )
- fi
- fi
- fi
-done
-
-AC_SUBST(includebuild_dir)
-AC_SUBST(libbuild_dir)
-AC_SUBST(binbuild_dir)
-AC_SUBST(sbinbuild_dir)
-AC_SUBST(etcbuild_dir)
-
-AC_PROG_CC
-AC_OBJEXT
-AC_EXEEXT
-dnl Check for broken handling of common symbols
-dnl PAC_PROG_C_BROKEN_COMMON
-AC_CHECK_PROG(AR, ar, ar, ;)
-AC_PROG_RANLIB
-
-dnl We need to check that this has worked. The autoconf macro is broken
-AC_PROG_CPP
-if test "$CPP" = "/lib/cpp" -a ! -x /lib/cpp ; then
- AC_MSG_ERROR( [configure could not find a working C preprocessor] )
-fi
-
-dnl Invoking AC_CHECK_LIB before AC_PROG_CC makes AC_PROG_CC fail
-dnl in autoconf 2.59
-DEBUG_LIBS=""
-if test "$enable_debugcheck" = "yes" ; then
- AC_CHECK_LIB( efence, malloc, DEBUG_LIBS="-lefence" )
-fi
-AC_SUBST(DEBUG_LIBS)
-
-AC_HEADER_STDC
-AC_C_CONST
-
-dnl Checking Headers
-AC_CHECK_HEADERS( stdio.h stdlib.h string.h )
-AC_CHECK_HEADER( stdarg.h,
- [AC_DEFINE( HAVE_STDARG_H, 1,
- [Define if stdarg.h is available] )
- havestdarg=1], , )
-
-AC_FUNC_ALLOCA
-
-dnl
-dnl We need to build mpe with the shared library flags
-dnl This should rely on the same approach used in the mpich configure,
-dnl since just using TRY_LINK or TRY_COMPILE doesn't identify warning messages
-dnl about "compiler flag unrecognized".
-dnl
-dnl It isn't enough to check for stdarg. Even gcc doesn't get it right;
-dnl on some systems, the gcc version of stdio.h loads stdarg.h WITH THE WRONG
-dnl OPTIONS (causing it to choose the OLD STYLE va_start etc).
-dnl
-if test -n "$havestdarg" ; then
- PAC_COMPILE_CHECK_FUNC(stdarg is correct,[
-#include <stdio.h>
-#include <stdarg.h>
-int func( int a, ... ){
-int b;
-va_list ap;
-va_start( ap, a );
-b = va_arg(ap, int);
-printf( "%d-%d\n", a, b );
-va_end(ap);
-fflush(stdout);
-return 0;
-}
-int main() { func( 1, 2 ); return 0;}],
-AC_DEFINE( USE_STDARG, 1, [Define is stdarg can be used] )
-)
-fi
-dnl
-AC_MSG_CHECKING( [if compiler accepts prototypes] )
-AC_TRY_COMPILE(, int f(double a);, have_proto=yes, have_proto=no)
-if test "$have_proto" = "yes" ; then
- AC_DEFINE( HAVE_PROTOTYPES, 1,
- [Define if the compiler supports simple prototyptes] )
- AC_MSG_RESULT([yes])
-else
- AC_MSG_RESULT([no])
-fi
-
-if test -z "$nonopt" ; then nonopt=NONE ; fi
-AC_CANONICAL_HOST
-case "$host" in
- *irix*)
-dnl FIXME: the test has a problem when LAM on irix is configured!
- if test "$MPI_IMPL" != "MPICH" -a "$MPI_IMPL" != "MPICH2" ; then
- if test "$procnull_broken" = "default" ; then
- procnull_broken=yes
- fi
- fi
- ;;
- *cray*)
- if test "$MPE_BUILD_FORTRAN2C" = "yes" ; then
- AC_MSG_CHECKING( [for Cray's FCD logical type] )
- AC_LINK_IFELSE( [ AC_LANG_PROGRAM( [#include <fortran.h>], [
- int clogical, flogical;
- clogical = 1;
- flogical = _btol( clogical );
- clogical = _ltob( &flogical );
- ] ) ], [ mpe_link_ok=yes ], [ mpe_link_ok=no ] )
- if test "$mpe_link_ok" = "yes" ; then
- AC_MSG_RESULT(yes)
- AC_DEFINE( HAVE_CRAY_FCD_LOGICAL, 1,
- [Define if CRAY's FCD logical is found] )
- else
- AC_MSG_RESULT(no)
- fi
- fi
- ;;
-esac
-if test "$procnull_broken" = "yes" ; then
- AC_DEFINE( HAVE_MPI_STATUS_BROKEN_ON_PROC_NULL, 1,
- [Define if MPI_PROCNULL not handled in MPI_Status] )
-fi
-
-
-if test "$MPE_BUILD_FORTRAN2C" = "yes" ; then
- if test "$enable_f2cmpilib" = "yes" ; then
- F2CMPI_LIBS="-l$F2CMPI_LIBNAME"
- fi
-dnl when --enable-f77 and --disable-f2cmpilib are selected,
-dnl value supplied in --with-f2cmpilibs will be used.
-else
-dnl If F2CMPI_LIBS="-lfmpich", disable building of libmpe_f2cmpi.a
-dnl by setting F2CMPI_LIBS="". Leave MPE_BUILD_FORTRAN2C=yes, so
-dnl fortran link/run tests can be performed.
- F2CMPI_LIBS=""
-fi
-
-dnl Check Safe PMPI invocations
-AC_MSG_CHECKING( [for safe PMPI invocations] )
-if test "$MPI_IMPL" = "MPICH" -o "$MPI_IMPL" = "MPICH2" ; then
- enable_safePMPI=no
-fi
-if test "$enable_safePMPI" = "yes" ; then
- AC_MSG_RESULT(yes)
- AC_DEFINE( MAKE_SAFE_PMPI_CALL, 1, [Define if safe PMPI calls are made] )
-else
- AC_MSG_RESULT(no)
-fi
-
-dnl Check if Thread-support level in MPI implementation
-if test "$MPI_IMPL" != "MPICH" -a "$MPI_IMPL" != "MPICH2" ; then
- if test "$enable_checkMPI" = "yes" ; then
- AC_MSG_CHECKING( [for the C version of MPI_Init_thread] )
- PAC_MPI_LINK_CC_FUNC( $MPI_CC, [$MPI_CFLAGS], $MPI_LIBS, ,
- [ int itmp; int thread_level ],
- [
- itmp=MPI_Init_thread( NULL, NULL, MPI_THREAD_MULTIPLE, &thread_level )
- ],
- [ mpe_link_ok=yes ], [ mpe_link_ok=no ] )
- if test "$mpe_link_ok" = "yes" ; then
- AC_MSG_RESULT(yes)
- AC_MSG_CHECKING( [for the C version of PMPI_Init_thread] )
- PAC_MPI_LINK_CC_FUNC( $MPI_CC, [$MPI_CFLAGS], $MPI_LIBS, ,
- [ int itmp; int thread_level],
- [
- itmp=PMPI_Init_thread( NULL, NULL, MPI_THREAD_MULTIPLE, &thread_level )
- ],
- [ mpe_link_ok=yes ], [ mpe_link_ok=no ] )
- if test "$mpe_link_ok" = "yes" ; then
- AC_MSG_RESULT(yes)
- AC_DEFINE(HAVE_MPI_INIT_THREAD, 1,
- [Define if MPI_Init_thread available])
- else
- AC_MSG_RESULT(no)
- fi
- else
- AC_MSG_RESULT(no)
- fi
- fi
-else
-dnl MPICH2 has MPI_Init_thread().
- if test "$MPI_IMPL" = "MPICH2" ; then
- AC_DEFINE(HAVE_MPI_INIT_THREAD, 1,
- [Define if MPI_Init_thread available])
- fi
-fi
-
-
-dnl Check MPI-IO
-if test "$MPI_IMPL" != "MPICH" -a "$MPI_IMPL" != "MPICH2" ; then
- if test "$enable_checkMPI" = "yes" -a "$enable_checkMPIO" = "yes" ; then
- AC_MSG_CHECKING( [for the C version of MPI_File_open()] )
- PAC_MPI_LINK_CC_FUNC( $MPI_CC, [$MPI_CFLAGS], $MPI_LIBS, ,
- [ int itmp; MPI_File fh ],
- [
- itmp=MPI_File_open( MPI_COMM_WORLD, "mpiiotest",
- MPI_MODE_CREATE | MPI_MODE_RDWR, MPI_INFO_NULL, &fh )
- ],
- [ mpe_link_ok=yes ], [ mpe_link_ok=no ] )
- if test "$mpe_link_ok" = "yes" ; then
- AC_MSG_RESULT(yes)
- AC_MSG_CHECKING( [for the C version of PMPI_File_open()] )
- PAC_MPI_LINK_CC_FUNC( $MPI_CC, [$MPI_CFLAGS], $MPI_LIBS, ,
- [ int itmp; MPI_File fh ],
- [
- itmp=PMPI_File_open( MPI_COMM_WORLD, "mpiiotest",
- MPI_MODE_CREATE | MPI_MODE_RDWR, MPI_INFO_NULL, &fh )
- ],
- [ mpe_link_ok=yes ], [ mpe_link_ok=no ] )
- if test "$mpe_link_ok" = "yes" ; then
- AC_MSG_RESULT(yes)
- AC_DEFINE( HAVE_MPI_IO, 1, [Define if MPI-IO available] )
- AC_MSG_CHECKING( [for ROMIO's MPIO_Request] )
- PAC_MPI_LINK_CC_FUNC( $MPI_CC, [$MPI_CFLAGS], $MPI_LIBS, ,
- [ MPIO_Request io_request], ,
- [ mpe_link_ok=yes ], [ mpe_link_ok=no ] )
- if test "$mpe_link_ok" = "yes" ; then
- AC_MSG_RESULT(yes)
- else
- AC_MSG_RESULT(no)
- AC_DEFINE( HAVE_NO_MPIO_REQUEST, 1,
- [Define if no MPIO_Request] )
- fi
- else
- AC_MSG_RESULT([no, assumed No MPI-IO routines])
- fi
- else
- AC_MSG_RESULT([no, assumed No MPI-IO routines])
- fi
- fi
-else
-dnl When built with MPICHx, MPE configure observes --with-mpiio & --enable-romio
-dnl if test \( "$MPI_IMPL" = "MPICH" -o "$MPI_IMPL" = "MPICH2" \) \
- if test "$with_mpiio" = "yes" ; then
- AC_DEFINE( HAVE_MPI_IO, 1, [Define if MPI-IO available] )
- fi
-fi
-
-dnl Check MPI-RMA
-if test "$MPI_IMPL" != "MPICH" -a "$MPI_IMPL" != "MPICH2" ; then
- if test "$enable_checkMPI" = "yes" ; then
- AC_MSG_CHECKING( [for the C version of MPI_Win_create] )
- PAC_MPI_LINK_CC_FUNC( $MPI_CC, [$MPI_CFLAGS], $MPI_LIBS, ,
- [ int itmp; MPI_Win win ],
- [
- itmp=MPI_Win_create( NULL, 0, 1, MPI_INFO_NULL, MPI_COMM_WORLD, &win )
- ],
- [ mpe_link_ok=yes ], [ mpe_link_ok=no ] )
- if test "$mpe_link_ok" = "yes" ; then
- AC_MSG_RESULT(yes)
- AC_MSG_CHECKING( [for the C version of PMPI_Win_create] )
- PAC_MPI_LINK_CC_FUNC( $MPI_CC, [$MPI_CFLAGS], $MPI_LIBS, ,
- [ int itmp; MPI_Win win ],
- [
- itmp=PMPI_Win_create( NULL, 0, 1, MPI_INFO_NULL, MPI_COMM_WORLD, &win )
- ],
- [ mpe_link_ok=yes ], [ mpe_link_ok=no ] )
- if test "$mpe_link_ok" = "yes" ; then
- AC_MSG_RESULT(yes)
- AC_DEFINE(HAVE_MPI_RMA, 1, [Define if MPI-RMA available])
-
- dnl Start Test of MPI_Win_lock/unlock
- AC_MSG_CHECKING([for the C version of MPI_Win_lock/unlock])
- PAC_MPI_LINK_CC_FUNC($MPI_CC, [$MPI_CFLAGS], $MPI_LIBS, ,
- [ int itmp; MPI_Win win ],
- [
- itmp=MPI_Win_create( NULL, 0, 1, MPI_INFO_NULL, MPI_COMM_WORLD, &win );
- itmp=MPI_Win_lock( MPI_LOCK_EXCLUSIVE, 0, 0, win );
- itmp=MPI_Win_unlock( 0, win )
- ],
- [ mpe_link_ok=yes ], [ mpe_link_ok=no ] )
- if test "$mpe_link_ok" = "yes" ; then
- AC_MSG_RESULT(yes)
- AC_MSG_CHECKING([for the C version of PMPI_Win_lock/unlock])
- PAC_MPI_LINK_CC_FUNC($MPI_CC, [$MPI_CFLAGS], $MPI_LIBS, ,
- [ int itmp; MPI_Win win ],
- [
- itmp=PMPI_Win_create( NULL, 0, 1, MPI_INFO_NULL, MPI_COMM_WORLD, &win );
- itmp=PMPI_Win_lock( MPI_LOCK_EXCLUSIVE, 0, 0, win );
- itmp=PMPI_Win_unlock( 0, win )
- ],
- [ mpe_link_ok=yes ],
- [ mpe_link_ok=no ] )
- if test "$mpe_link_ok" = "yes" ; then
- AC_MSG_RESULT(yes)
- AC_DEFINE(HAVE_MPI_RMA_LOCK, 1,
- [Define if MPI_Win_lock/unlock are available])
- else
- AC_MSG_RESULT(no)
- fi
- else
- AC_MSG_RESULT(no)
- fi
- dnl End Test of MPI_Win_lock/unlock
-
- dnl Start Test of MPI_Win_test
- AC_MSG_CHECKING([for the C version of MPI_Win_test])
- PAC_MPI_LINK_CC_FUNC($MPI_CC, [$MPI_CFLAGS], $MPI_LIBS, ,
- [ int itmp, flag; MPI_Win win ],
- [
- itmp=MPI_Win_create( NULL, 0, 1, MPI_INFO_NULL, MPI_COMM_WORLD, &win );
- itmp=MPI_Win_test( win, &flag )
- ],
- [ mpe_link_ok=yes ], [ mpe_link_ok=no ] )
- if test "$mpe_link_ok" = "yes" ; then
- AC_MSG_RESULT(yes)
- AC_MSG_CHECKING([for the C version of PMPI_Win_test])
- PAC_MPI_LINK_CC_FUNC($MPI_CC, [$MPI_CFLAGS], $MPI_LIBS, ,
- [ int itmp, flag; MPI_Win win ],
- [
- itmp=PMPI_Win_create( NULL, 0, 1, MPI_INFO_NULL, MPI_COMM_WORLD, &win );
- itmp=PMPI_Win_test( win, &flag )
- ],
- [ mpe_link_ok=yes ],
- [ mpe_link_ok=no ] )
- if test "$mpe_link_ok" = "yes" ; then
- AC_MSG_RESULT(yes)
- AC_DEFINE(HAVE_MPI_RMA_TEST, 1,
- [Define if MPI_Win_test is available])
- else
- AC_MSG_RESULT(no)
- fi
- else
- AC_MSG_RESULT(no)
- fi
- dnl End Test of MPI_Win_test
-
- else
- AC_MSG_RESULT([no, assumed No MPI-RMA routines])
- fi
- else
- AC_MSG_RESULT([no, assumed No MPI-RMA routines])
- fi
- fi
-else
-dnl if MPICH2, assume MPI-RMA is available.
- if test "$MPI_IMPL" = "MPICH2" ; then
- AC_DEFINE( HAVE_MPI_RMA, 1, [Define if MPI-RMA is available] )
- AC_DEFINE( HAVE_MPI_RMA_LOCK, 1,
- [Define if MPI_Win_lock/unlock are available] )
- AC_DEFINE(HAVE_MPI_RMA_TEST, 1,
- [Define if MPI_Win_test is available])
- fi
-fi
-
-dnl Check MPI-2 communicator functions
-if test "$MPI_IMPL" != "MPICH" -a "$MPI_IMPL" != "MPICH2" ; then
- if test "$enable_checkMPI" = "yes" ; then
- AC_MSG_CHECKING( [for the C version of MPI_Comm_connect/accept()] )
- PAC_MPI_LINK_CC_FUNC( $MPI_CC, [$MPI_CFLAGS], $MPI_LIBS, ,
- [ MPI_Comm intercomm; char *port ],
- [
- MPI_Comm_connect( port, MPI_INFO_NULL, 0, MPI_COMM_WORLD, &intercomm );
- MPI_Comm_accept( port, MPI_INFO_NULL, 0, MPI_COMM_WORLD, &intercomm )
- ],
- [ mpe_link_ok=yes ], [ mpe_link_ok=no ] )
- if test "$mpe_link_ok" = "yes" ; then
- AC_MSG_RESULT(yes)
- AC_MSG_CHECKING( [for the C version of PMPI_Comm_connect/accept()] )
- PAC_MPI_LINK_CC_FUNC( $MPI_CC, [$MPI_CFLAGS], $MPI_LIBS, ,
- [ MPI_Comm intercomm; char *port ],
- [
- PMPI_Comm_connect( port, MPI_INFO_NULL, 0, MPI_COMM_WORLD, &intercomm );
- PMPI_Comm_accept( port, MPI_INFO_NULL, 0, MPI_COMM_WORLD, &intercomm )
- ],
- [ mpe_link_ok=yes ], [ mpe_link_ok=no ] )
- if test "$mpe_link_ok" = "yes" ; then
- AC_MSG_RESULT(yes)
- AC_DEFINE( HAVE_MPI_SPAWN, 1,
- [Define if MPI-SPAWN is available] )
-
- dnl Start of Checking of MPI2 Naming Service
- AC_MSG_CHECKING( [for the C version of MPI_Publish/Lookup_name()] )
- PAC_MPI_LINK_CC_FUNC( $MPI_CC, [$MPI_CFLAGS], $MPI_LIBS, ,
- [ char *port ],
- [
- MPI_Publish_name( "mpe_port_name", MPI_INFO_NULL, port );
- MPI_Lookup_name( "mpe_port_name", MPI_INFO_NULL, port );
- MPI_Unpublish_name( "mpe_port_name", MPI_INFO_NULL, port );
- ],
- [ mpe_link_ok=yes ], [ mpe_link_ok=no ] )
- if test "$mpe_link_ok" = "yes" ; then
- AC_MSG_RESULT(yes)
- AC_MSG_CHECKING( [for the C version of PMPI_Publish/Lookup_name()] )
- PAC_MPI_LINK_CC_FUNC($MPI_CC, [$MPI_CFLAGS], $MPI_LIBS, ,
- [ char *port ],
- [
- PMPI_Publish_name( "mpe_port_name", MPI_INFO_NULL, port );
- PMPI_Lookup_name( "mpe_port_name", MPI_INFO_NULL, port );
- PMPI_Unpublish_name( "mpe_port_name", MPI_INFO_NULL, port );
- ],
- [ mpe_link_ok=yes ],
- [ mpe_link_ok=no ] )
- if test "$mpe_link_ok" = "yes" ; then
- AC_MSG_RESULT(yes)
- AC_DEFINE( HAVE_MPI_NAMING, 1,
- [Define if MPI Naming Service is available] )
- else
- AC_MSG_RESULT(no)
- fi
- else
- AC_MSG_RESULT(no)
- fi
- dnl End of Checking of MPI2 Naming Service
- else
- AC_MSG_RESULT(no)
- fi
- else
- AC_MSG_RESULT(no)
- fi
- fi
-else
-dnl if MPICH2 assume all MPI-2 communicator functions are available.
- if test "$MPI_IMPL" = "MPICH2" ; then
- AC_DEFINE( HAVE_MPI_SPAWN, 1, [Define if MPI-SPAWN is available] )
- fi
-fi
-
-dnl Determine if MPI_STATUS_IGNORE exists
-if test "$MPI_IMPL" != "MPICH" -a "$MPI_IMPL" != "MPICH2" ; then
- AC_MSG_CHECKING( [for MPI_STATUS_IGNORE] )
- PAC_MPI_LINK_CC_FUNC( $MPI_CC, [$MPI_CFLAGS], $MPI_LIBS, ,
- [
- MPI_Status* tmp_status;
- tmp_status = MPI_STATUS_IGNORE;
- ], ,
- [ mpe_link_ok=yes ], [ mpe_link_ok=no ] )
- AC_MSG_RESULT($mpe_link_ok)
-else
- # All known impls, including MPICH, support STATUS_IGNORE
- # (The MPICH support may have a few bugs, but it is close enough
- # for our needs)
- mpe_link_ok=yes
-fi
-if test "$mpe_link_ok" = "yes" ; then
- AC_DEFINE( HAVE_MPI_STATUS_IGNORE, 1,
- [Define if MPI_STATUS_IGNORE available] )
-fi
-
-dnl Determine if MPI_STATUSES_IGNORE exists
-if test "$MPI_IMPL" != "MPICH" -a "$MPI_IMPL" != "MPICH2" ; then
- AC_MSG_CHECKING( [for MPI_STATUSES_IGNORE] )
- PAC_MPI_LINK_CC_FUNC( $MPI_CC, [$MPI_CFLAGS], $MPI_LIBS, ,
- [
- MPI_Status* tmp_status;
- tmp_status = MPI_STATUSES_IGNORE;
- ], ,
- [ mpe_link_ok=yes ], [ mpe_link_ok=no ] )
- AC_MSG_RESULT($mpe_link_ok)
-else
- # All known impls, including MPICH, support STATUS_IGNORE
- # (The MPICH support may have a few bugs, but it is close enough
- # for our needs)
- mpe_link_ok=yes
-fi
-if test "$mpe_link_ok" = "yes" ; then
- AC_DEFINE( HAVE_MPI_STATUSES_IGNORE, 1,
- [Define if MPI_STATUSES_IGNORE available] )
-fi
-
-dnl This is temporary! Eventually MPICH-2 will have its own f2c MPI wrappers.
-dnl When MPICH-2 has the wrappers ready, the following block should be removed
-if test "${F2CMPI_LIBS}" = "-l${F2CMPI_LIBNAME}" \
- -a "$MPI_IMPL" = "MPICH2" ; then
-
-# FIXME: MPICH2 include MPI_Fint, Need to fetch the value somehow.
-
-# Obtain MPICH2's MPI_STATUS_SIZE from environmental variable
- AC_MSG_CHECKING( [for the value of MPI_STATUS_SIZE] )
- if test -n "$SIZEOF_MPI_STATUS" ; then
- # FIXME: Get true value of MPI_Fint instead of 4
- CROSS_MPI_STATUS_SIZE=`expr $SIZEOF_MPI_STATUS / 4`
- MPI_STATUS_SIZE=$CROSS_MPI_STATUS_SIZE
- AC_MSG_RESULT($MPI_STATUS_SIZE)
- AC_DEFINE_UNQUOTED( MPI_STATUS_SIZE, $MPI_STATUS_SIZE,
- [Define as the size of MPI_STATUS_SIZE] )
- else
-dnl For MPICH2, when SIZEOF_MPI_STATUS is not defined, enable_f77=no.
-dnl Set MPE_BUILD_FORTRAN2C=no and F2CMPI_LIBS="" so liblmpe.a
-dnl won't be built and fortran link/run tests won't executed.
-dnl If F2CMPI_LIBS="-lfmpich", disable building of libmpe_f2cmpi.a
-dnl by setting F2CMPI_LIBS="". Leave MPE_BUILD_FORTRAN2C=yes, so
-dnl fortran link/run tests can be performed.
- AC_MSG_RESULT("undefined -- disabling fortran features.")
- MPE_BUILD_FORTRAN2C=no
- F2CMPI_LIBS=""
- fi
-
-# MPICH2 after 1.0.2 release has MPI_F_STATUS_IGNORE, MPI_F_STATUSES_IGNORE
- AC_DEFINE( HAVE_MPI_F_STATUS_IGNORE, 1,
- [Define if MPI_F_STATUS_IGNORE available] )
- AC_DEFINE( HAVE_MPI_F_STATUSES_IGNORE, 1,
- [Define if MPI_F_STATUSES_IGNORE available] )
-
-# MPICH2 has MPI_Comm_f2c()/c2f()
- AC_DEFINE( HAVE_MPI_COMM_F2C, 1,
- [Define if MPI_Comm_f2c and c2f available] )
-
-# MPICH2 has MPI_Status_f2c()/c2f()
- AC_DEFINE( HAVE_MPI_STATUS_F2C, 1,
- [Define if MPI_Status_f2c and c2f available] )
-
-# MPICH2 has MPI_TYPE_f2c()/c2f()
- AC_DEFINE( HAVE_MPI_TYPE_F2C, 1,
- [Define if MPI_Type_F2c and c2f available] )
-
-# MPICH2 has MPI_Group_f2c()/c2f()
- AC_DEFINE( HAVE_MPI_GROUP_F2C, 1,
- [Define if MPI_Group_f2c and c2f available] )
-
-# MPICH2 has MPI_Request_f2c()/c2f()
- AC_DEFINE( HAVE_MPI_REQUEST_F2C, 1,
- [Define if MPI_Request_f2c and c2f available] )
-
-# MPICH2 has MPI_Op_f2c()/c2f()
- AC_DEFINE( HAVE_MPI_OP_F2C, 1,
- [Define if MPI_Op_f2c and c2f available] )
-
-# MPICH2 has MPI_Errhandler_f2c()/c2f()
- AC_DEFINE( HAVE_MPI_ERRHANDLER_F2C, 1,
- [Define if MPI_Errhandler_f2c and c2f available] )
-
-# Define MPICH2's Fortran TRUE/FALSE value
- # FIXME: Use the values from the Fortran configure
- true_val=1
- AC_DEFINE_UNQUOTED( MPE_F77_TRUE_VALUE, $true_val,
- [Define as the value for Fortran logical true] )
- false_val=0
- AC_DEFINE_UNQUOTED( MPE_F77_FALSE_VALUE, $false_val,
- [Define as the value for Fortran logical false] )
-dnl endif test "${F2CMPI_LIBS}" = "-l${F2CMPI_LIBNAME}"
-dnl -a "$MPI_IMPL" = "MPICH2" ; then
-fi
-
-
-dnl
-dnl Test Non-MPICH platform's Fortran to C capability
-dnl
-if test "${F2CMPI_LIBS}" = "-l${F2CMPI_LIBNAME}" \
- -a "$MPI_IMPL" != "MPICH2" ; then
-
-dnl Determine MPI_Fint
-dnl (same test done in graphics's configure.in)
- AC_MSG_CHECKING( [for MPI_Fint] )
- PAC_MPI_LINK_CC_FUNC( $MPI_CC, [$MPI_CFLAGS], $MPI_LIBS, ,
- [ MPI_Fint aa=1 ], ,
- [ mpe_link_ok=yes ], [ mpe_link_ok=no ] )
- if test "$mpe_link_ok" = "yes" ; then
- AC_MSG_RESULT(yes)
- MPI_FINT_TYPE=MPI_Fint
- else
- AC_MSG_RESULT([no, assumed MPI_Fint to be int])
- MPI_FINT_TYPE=int
- AC_DEFINE( MPI_Fint, int, [Define MPI_Fint as int] )
- fi
-
-dnl Determine if MPI_F_STATUS_IGNORE exists
- AC_MSG_CHECKING( [for MPI_F_STATUS_IGNORE] )
- PAC_MPI_LINK_CC_FUNC( $MPI_CC, [$MPI_CFLAGS], $MPI_LIBS, ,
- [
- ${MPI_FINT_TYPE} *f_status;
- f_status = MPI_F_STATUS_IGNORE;
- ], ,
- [ mpe_link_ok=yes ], [ mpe_link_ok=no ] )
- AC_MSG_RESULT($mpe_link_ok)
-if test "$mpe_link_ok" = "yes" ; then
- AC_DEFINE( HAVE_MPI_F_STATUS_IGNORE, 1,
- [Define if MPI_F_STATUS_IGNORE available] )
-fi
-
-dnl Determine if MPI_F_STATUSES_IGNORE exists
- AC_MSG_CHECKING( [for MPI_F_STATUSES_IGNORE] )
- PAC_MPI_LINK_CC_FUNC( $MPI_CC, [$MPI_CFLAGS], $MPI_LIBS, ,
- [
- ${MPI_FINT_TYPE} *f_statuses;
- f_statuses = MPI_F_STATUSES_IGNORE;
- ], ,
- [ mpe_link_ok=yes ], [ mpe_link_ok=no ] )
- AC_MSG_RESULT($mpe_link_ok)
-if test "$mpe_link_ok" = "yes" ; then
- AC_DEFINE( HAVE_MPI_F_STATUSES_IGNORE, 1,
- [Define if MPI_F_STATUSES_IGNORE available] )
-fi
-
-dnl Determmine if MPI_Comm_f2c() and MPI_Comm_c2f() are there
-dnl (same test done in graphics's configure.in)
- AC_MSG_CHECKING( [for MPI_Comm_c2f() and MPI_Comm_f2c()] )
- PAC_MPI_LINK_CC_FUNC( $MPI_CC, [$MPI_CFLAGS], $MPI_LIBS, ,
- [ MPI_Comm comm; ${MPI_FINT_TYPE} aa; ],
- [
- aa=MPI_Comm_c2f(comm) ;
- comm=MPI_Comm_f2c(aa) ;
- ],
- [ mpe_link_ok=yes ], [ mpe_link_ok=no ] )
- AC_MSG_RESULT($mpe_link_ok)
- if test "$mpe_link_ok" = "yes" ; then
- AC_DEFINE( HAVE_MPI_COMM_F2C, 1,
- [Define if MPI_Comm_f2c and c2f available] )
- fi
-
-dnl # Determine MPI_STATUS_SIZE (this is the INTEGER status size for Fortran)
-dnl mpe_tmpfile=mpe_mpistatusvalue
-dnl AC_MSG_CHECKING( [for the value of MPI_STATUS_SIZE] )
-dnl if test "$cross_compiling" = "yes" -o "$cross_compiling" = 1 ; then
-dnl if test "X$CROSS_MPI_STATUS_SIZE" != "X" ; then
-dnl mpe_MPI_STATUS_SIZE="$CROSS_MPI_STATUS_SIZE"
-dnl AC_DEFINE_UNQUOTED( MPI_STATUS_SIZE, $mpe_MPI_STATUS_SIZE,
-dnl [Define as the size of MPI_STATUS_SIZE] )
-dnl AC_MSG_RESULT( [${mpe_MPI_STATUS_SIZE}] )
-dnl else
-dnl PAC_MSG_ERROR( $enable_softerror,
-dnl [Undefined CROSS_MPI_STATUS_SIZE! Exiting...] )
-dnl fi
-dnl else
-dnl dnl PAC_MPI_RUN_F77_PGM( $MPI_F77, [$MPI_FFLAGS],
-dnl dnl $F77, $FFLAGS, $LIBS, [
-dnl dnl program get_mpi_status_size
-dnl dnl include 'mpif.h'
-dnl dnl open(10, file="$mpe_tmpfile", status='unknown')
-dnl dnl rewind(10)
-dnl dnl write(10,*) MPI_STATUS_SIZE
-dnl dnl close(10)
-dnl dnl end
-dnl dnl ], [ mpe_run_ok=yes ], [ mpe_run_ok=no ] )
-dnl PAC_MPI_RUN_CC_PGM( $MPI_CC, [$MPI_CFLAGS],
-dnl $CC, $CFLAGS, $LIBS, [
-dnl #include <stdio.h>
-dnl #include "mpi.h"
-dnl main()
-dnl {
-dnl FILE *mpe_file = fopen( "$mpe_tmpfile", "w" );
-dnl if ( ! mpe_file ) exit( 1 );
-dnl fprintf( mpe_file, "%d\n",
-dnl sizeof( MPI_Status )/sizeof( ${MPI_FINT_TYPE} ) );
-dnl fclose( mpe_file );
-dnl exit( 0 );
-dnl }
-dnl ], [ mpe_run_ok=yes ], [ mpe_run_ok=no ] )
-dnl if test "$mpe_run_ok" = "yes" ; then
-dnl mpe_MPI_STATUS_SIZE="`cat ${mpe_tmpfile} | sed -e 's/ //g'`"
-dnl AC_DEFINE_UNQUOTED( MPI_STATUS_SIZE, $mpe_MPI_STATUS_SIZE,
-dnl [Define as the size of MPI_STATUS_SIZE] )
-dnl AC_MSG_RESULT( [${mpe_MPI_STATUS_SIZE}] )
-dnl rm -f ${mpe_tmpfile}
-dnl else
-dnl if test "X$CROSS_MPI_STATUS_SIZE" != "X" ; then
-dnl mpe_MPI_STATUS_SIZE="$CROSS_MPI_STATUS_SIZE"
-dnl AC_DEFINE_UNQUOTED( MPI_STATUS_SIZE, $mpe_MPI_STATUS_SIZE,
-dnl [Define as the size of MPI_STATUS_SIZE] )
-dnl AC_MSG_RESULT( [use supplied value: ${mpe_MPI_STATUS_SIZE}] )
-dnl else
-dnl PAC_MSG_ERROR( $enable_softerror, [could NOT determine!] )
-dnl fi
-dnl fi
-dnl fi
-
-# Determmine if MPI_Status_f2c() and MPI_Status_c2f() are there
-# Make mpe_MPI_STATUS_SIZE >> real sizeof(MPI_Status)/sizeof(MPI_Fint)
- mpe_MPI_STATUS_SIZE=100
- AC_MSG_CHECKING( [for MPI_Status_c2f() and MPI_Status_f2c()] )
- PAC_MPI_LINK_CC_FUNC( $MPI_CC, [$MPI_CFLAGS], $MPI_LIBS, ,
- [[
- MPI_Status c_status;
- ${MPI_FINT_TYPE} f_status[ ${mpe_MPI_STATUS_SIZE} ];
- int ierr;
- ]],
- [
- ierr=MPI_Status_c2f( &c_status, f_status ) ;
- ierr=MPI_Status_f2c( f_status, &c_status ) ;
- ],
- [ mpe_link_ok=yes ], [ mpe_link_ok=no ] )
- AC_MSG_RESULT($mpe_link_ok)
- if test "$mpe_link_ok" = "yes" ; then
- AC_DEFINE( HAVE_MPI_STATUS_F2C, 1,
- [Define if MPI_Status_f2c and c2f available] )
- fi
-
-# Determmine if MPI_Type_f2c() and MPI_Type_c2f() are there
- AC_MSG_CHECKING( [for MPI_Type_c2f() and MPI_Type_f2c()] )
- PAC_MPI_LINK_CC_FUNC( $MPI_CC, [$MPI_CFLAGS], $MPI_LIBS, ,
- [ MPI_Datatype type; ${MPI_FINT_TYPE} aa; ],
- [
- aa=MPI_Type_c2f(type) ;
- type=MPI_Type_f2c(aa) ;
- ],
- [ mpe_link_ok=yes ], [ mpe_link_ok=no ] )
- AC_MSG_RESULT($mpe_link_ok)
- if test "$mpe_link_ok" = "yes" ; then
- AC_DEFINE( HAVE_MPI_TYPE_F2C, 1,
- [Define if MPI_Type_F2c and c2f available] )
- fi
-
-# Determmine if MPI_Group_f2c() and MPI_Group_c2f() are there
- AC_MSG_CHECKING( [for MPI_Group_c2f() and MPI_Group_f2c()] )
- PAC_MPI_LINK_CC_FUNC( $MPI_CC, [$MPI_CFLAGS], $MPI_LIBS, ,
- [ MPI_Group group; ${MPI_FINT_TYPE} aa; ],
- [
- aa=MPI_Group_c2f(group) ;
- group=MPI_Group_f2c(aa) ;
- ],
- [ mpe_link_ok=yes ], [ mpe_link_ok=no ] )
- AC_MSG_RESULT($mpe_link_ok)
- if test "$mpe_link_ok" = "yes" ; then
- AC_DEFINE( HAVE_MPI_GROUP_F2C, 1,
- [Define if MPI_Group_f2c and c2f available] )
- fi
-
-# Determmine if MPI_Request_f2c() and MPI_Request_c2f() are there
- AC_MSG_CHECKING( [for MPI_Request_c2f() and MPI_Request_f2c()] )
- PAC_MPI_LINK_CC_FUNC( $MPI_CC, [$MPI_CFLAGS], $MPI_LIBS, ,
- [ MPI_Request request; ${MPI_FINT_TYPE} aa; ],
- [
- aa=MPI_Request_c2f(request) ;
- request=MPI_Request_f2c(aa) ;
- ],
- [ mpe_link_ok=yes ], [ mpe_link_ok=no ] )
- AC_MSG_RESULT($mpe_link_ok)
- if test "$mpe_link_ok" = "yes" ; then
- AC_DEFINE( HAVE_MPI_REQUEST_F2C, 1,
- [Define if MPI_Request_f2c and c2f available] )
- fi
-
-# Determmine if MPI_Op_f2c() and MPI_Op_c2f() are there
- AC_MSG_CHECKING( [for MPI_Op_c2f() and MPI_Op_f2c()] )
- PAC_MPI_LINK_CC_FUNC( $MPI_CC, [$MPI_CFLAGS], $MPI_LIBS, ,
- [ MPI_Op op; ${MPI_FINT_TYPE} aa; ],
- [
- aa=MPI_Op_c2f(op) ;
- op=MPI_Op_f2c(aa) ;
- ],
- [ mpe_link_ok=yes ], [ mpe_link_ok=no ] )
- AC_MSG_RESULT($mpe_link_ok)
- if test "$mpe_link_ok" = "yes" ; then
- AC_DEFINE( HAVE_MPI_OP_F2C, 1,
- [Define if MPI_Op_f2c and c2f available] )
- fi
-
-# Determmine if MPI_Errhandler_f2c() and MPI_Errhandler_c2f() are there
- AC_MSG_CHECKING( [for MPI_Errhandler_c2f() and MPI_Errhandler_f2c()] )
- PAC_MPI_LINK_CC_FUNC( $MPI_CC, [$MPI_CFLAGS], $MPI_LIBS, ,
- [ MPI_Errhandler errhandler; ${MPI_FINT_TYPE} aa; ],
- [
- aa=MPI_Errhandler_c2f(errhandler) ;
- errhandler=MPI_Errhandler_f2c(aa) ;
- ],
- [ mpe_link_ok=yes ], [ mpe_link_ok=no ] )
- AC_MSG_RESULT($mpe_link_ok)
- if test "$mpe_link_ok" = "yes" ; then
- AC_DEFINE( HAVE_MPI_ERRHANDLER_F2C, 1,
- [Define if MPI_Errhandler_f2c and c2f available] )
- fi
-
-
-dnl # Determine the Fortran logical values, .TRUE. & .FALSE. in MPI C program
-dnl if test "$cross_compiling" = "yes" -o "$cross_compiling" = 1 ; then
-dnl AC_MSG_CHECKING( [for the Fortran .TRUE. values in MPI C program] )
-dnl if test "X$CROSS_FORTRAN2C_TRUE" != "X" ; then
-dnl AC_DEFINE_UNQUOTED( MPE_F77_TRUE_VALUE, $CROSS_FORTRAN2C_TRUE,
-dnl [Define as the value for Fortran logical true] )
-dnl AC_MSG_RESULT( [${CROSS_FORTRAN2C_TRUE}] )
-dnl else
-dnl PAC_MSG_ERROR( $enable_softerror,
-dnl [Undefined CROSS_FORTRAN2C_TRUE! Exiting...] )
-dnl fi
-dnl AC_MSG_CHECKING( [for the Fortran .FALSE. values in MPI C program] )
-dnl if test "X$CROSS_FORTRAN2C_FALSE" != "X" ; then
-dnl AC_DEFINE_UNQUOTED( MPE_F77_FALSE_VALUE, $CROSS_FORTRAN2C_FALSE,
-dnl [Define as the value for Fortran logical false] )
-dnl AC_MSG_RESULT( [${CROSS_FORTRAN2C_FALSE}] )
-dnl else
-dnl PAC_MSG_ERROR( $enable_softerror,
-dnl [Undefined CROSS_FORTRAN2C_FALSE! Exiting...] )
-dnl fi
-dnl else
-dnl AC_MSG_CHECKING( [for the Fortran logical values in MPI C program] )
-dnl mpe_tmpfile=mpe_f77logicals
-dnl PAC_MPI_RUN_F77_FUNC_FROM_C( $F77, $FFLAGS,
-dnl $MPI_CC, [-I../.. $MPI_CFLAGS],
-dnl $CC, [$CFLAGS], $LIBS, [
-dnl subroutine ftest( itrue, ifalse )
-dnl logical itrue, ifalse
-dnl itrue = .TRUE.
-dnl ifalse = .FALSE.
-dnl return
-dnl end
-dnl ], [
-dnl /* mpe_conf.h defines the needed F77_NAME_XXX, and is located in -I../.. */
-dnl #include "mpe_conf.h"
-dnl #ifdef F77_NAME_UPPER
-dnl #define ftest_ FTEST
-dnl #elif defined(F77_NAME_LOWER) || defined(F77_NAME_MIXED)
-dnl #define ftest_ ftest
-dnl #endif
-dnl #include <stdio.h>
-dnl #include "mpi.h"
-dnl int main()
-dnl {
-dnl ${MPI_FINT_TYPE} itrue, ifalse;
-dnl FILE *mpe_file = fopen( "$mpe_tmpfile", "w" );
-dnl if ( ! mpe_file ) exit( 1 );
-dnl ftest_( &itrue, &ifalse );
-dnl fprintf( mpe_file, "%d %d\n", itrue, ifalse );
-dnl fclose( mpe_file );
-dnl exit( 0 );
-dnl }
-dnl ],
-dnl [ mpe_link_ok=yes ], [ mpe_link_ok=no ] )
-dnl if test "$mpe_run_ok" = "yes" ; then
-dnl mpe_f77logicals="`cat ${mpe_tmpfile}`"
-dnl true_val="`echo ${mpe_f77logicals} | sed -e 's/ .*//g'`"
-dnl false_val="`echo ${mpe_f77logicals} | sed -e 's/.* *//g'`"
-dnl if test -n "$true_val" -a -n "$false_val" ; then
-dnl AC_DEFINE_UNQUOTED( MPE_F77_TRUE_VALUE, $true_val,
-dnl [Define as the value for Fortran logical true] )
-dnl AC_DEFINE_UNQUOTED( MPE_F77_FALSE_VALUE, $false_val,
-dnl [Define as the value for Fortran logical false] )
-dnl AC_MSG_RESULT( [True=$true_val and False=$false_val] )
-dnl else
-dnl PAC_MSG_ERROR( $enable_softerror, [could NOT determine!] )
-dnl fi
-dnl rm -f ${mpe_tmpfile}
-dnl else
-dnl if test "X$CROSS_FORTRAN2C_TRUE" != "X" \
-dnl -a "X$CROSS_FORTRAN2C_FALSE" != "X" ; then
-dnl AC_DEFINE_UNQUOTED( MPE_F77_TRUE_VALUE, $CROSS_FORTRAN2C_TRUE,
-dnl [Define as the value for Fortran logical true] )
-dnl AC_DEFINE_UNQUOTED( MPE_F77_FALSE_VALUE, $CROSS_FORTRAN2C_FALSE,
-dnl [Define as the value for Fortran logical false] )
-dnl AC_MSG_RESULT( [use supplied values: True=$CROSS_FORTRAN2C_TRUE and False=$CROSS_FORTRAN2C_FALSE] )
-dnl else
-dnl PAC_MSG_ERROR( $enable_softerror, [could NOT determine!] )
-dnl fi
-dnl fi
-dnl fi
-
-dnl endif test "${F2CMPI_LIBS}" = "-l${F2CMPI_LIBNAME}"
-dnl -a "$MPI_IMPL" != "MPICH2" ; then
-fi
-
-AC_SUBST(MPI_IMPL)
-AC_SUBST(MPE_BUILD_FORTRAN2C)
-AC_SUBST(CC)
-AC_SUBST(CLINKER)
-AC_SUBST(CFLAGS)
-AC_SUBST(MPI_CC)
-AC_SUBST(MPE_CLINKER)
-AC_SUBST(F77)
-AC_SUBST(FLINKER)
-AC_SUBST(FFLAGS)
-AC_SUBST(MPI_F77)
-AC_SUBST(MPE_FLINKER)
-AC_SUBST(FINC_PATH_LEADER)
-AC_SUBST(FLIB_PATH_LEADER)
-AC_SUBST(MPI_CFLAGS)
-AC_SUBST(MPI_FFLAGS)
-AC_SUBST(MPI_LIBS)
-
-AC_SUBST(LOG_LIBNAME)
-AC_SUBST(TRACE_LIBNAME)
-AC_SUBST(F2CMPI_LIBNAME)
-AC_SUBST(PROF_LIBS)
-AC_SUBST(LOG_LIBS)
-AC_SUBST(TRACE_LIBS)
-AC_SUBST(F2CMPI_LIBS)
-
-AC_OUTPUT( Makefile src/Makefile test/Makefile \
- etc/mpe_f77env.conf etc/mpe_mpilog.conf etc/mpe_mpitrace.conf )
Modified: mpich2/trunk/src/mpi/romio/adio/include/nopackage.h
===================================================================
--- mpich2/trunk/src/mpi/romio/adio/include/nopackage.h 2012-02-28 23:25:23 UTC (rev 9547)
+++ mpich2/trunk/src/mpi/romio/adio/include/nopackage.h 2012-02-28 23:26:34 UTC (rev 9548)
@@ -2,7 +2,7 @@
* (C) 2011 by Argonne National Laboratory.
* See COPYRIGHT in top-level directory.
*/
-/* See comments in MPICH2's configure.in for an explanation of what this file is
+/* See comments in MPICH2's configure.ac for an explanation of what this file is
* and why it exists. */
/* intentionally omitting any #ifndef guard, repeated inclusion is intentional */
Copied: mpich2/trunk/src/mpi/romio/configure.ac (from rev 9546, mpich2/trunk/src/mpi/romio/configure.in)
===================================================================
--- mpich2/trunk/src/mpi/romio/configure.ac (rev 0)
+++ mpich2/trunk/src/mpi/romio/configure.ac 2012-02-28 23:26:34 UTC (rev 9548)
@@ -0,0 +1,2233 @@
+# -*- Mode: shell-script -*-
+# build with
+# autoconf --localdir=../confdb configure.ac
+# (or wherever the confdb is)
+#
+AC_PREREQ([2.63])
+
+m4_include([version.m4])
+dnl 2nd arg is intentionally underquoted
+AC_INIT([ROMIO],
+ MPICH2_VERSION_m4,
+ [mpich-discuss at mcs.anl.gov],
+ [romio],
+ [http://www.mcs.anl.gov/research/projects/mpich2/])
+
+dnl AC_CONFIG_AUX_DIR(../../../confdb)
+dnl Set the directory that contains the required install-sh, config.sub,
+dnl and config.guess . Make sure that these are updated (in MPICH2, use
+dnl the top-level confdb files). This separate directory is used for
+dnl the moment to allow ROMIO to be separatedly distributed.
+dnl scripts.
+AC_CONFIG_AUX_DIR([confdb])
+AC_CONFIG_MACRO_DIR([confdb])
+
+AM_INIT_AUTOMAKE([-Wall -Werror foreign 1.11 silent-rules subdir-objects])
+AM_MAINTAINER_MODE([enable])
+LT_INIT([])
+# Non-verbose make by default
+m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
+
+# VERSION=1.2.6
+# AC_MSG_RESULT([Configuring ROMIO Version $VERSION])
+CONFIGURE_ARGS="$*"
+if test -n "$CONFIGURE_ARGS" ; then
+ echo "Configuring with args $CONFIGURE_ARGS"
+fi
+
+AC_CONFIG_HEADER(adio/include/romioconf.h)
+AH_TOP([/*
+ * (C) 2011 by Argonne National Laboratory.
+ * See COPYRIGHT in top-level directory.
+ */
+#ifndef ROMIOCONF_H_INCLUDED
+#define ROMIOCONF_H_INCLUDED
+])
+AH_BOTTOM([
+/* quash PACKAGE and PACKAGE_* vars, see MPICH2 top-level configure.ac for
+ * more info */
+#include "nopackage.h"
+
+#endif /* !defined(ROMIOCONF_H_INCLUDED) */
+])
+
+dnl
+NOF77=0
+NOF90=0
+ARCH=""
+arch_IRIX=""
+MPI_IMPL=""
+MPI_INCLUDE_DIR=""
+ROMIO_INCLUDE=""
+
+# Used by the new build system, should contain zero or more "-Iblah" args for
+# inclusion in AM_CPPFLAGS. Should not contain relative paths. This probably
+# overlaps with ROMIO_INCLUDE some, but adding a new var is easier than teasing
+# apart all of the current usages of that variable and re-testing all of the
+# non-MPICH2 and exotic platform cases.
+MPI_H_INCLUDE=""
+AC_SUBST([MPI_H_INCLUDE])
+
+TEST_LIBNAME=""
+FILE_SYSTEM=""
+# Do not set variables to empty that may be communicated from the
+# outside environment (e.g., MPI_LIB, MPI_BIN_DIR, LIBNAME)
+DEBUG=no
+MIPS=0
+BITS=0
+
+AC_ARG_VAR([FROM_MPICH],[set to "yes" if building ROMIO inside of MPICH])
+AC_ARG_VAR([FROM_MPICH2],[set to "yes" if building ROMIO inside of MPICH2])
+FROM_MPICH=${FROM_MPICH:-no}
+FROM_MPICH2=${FROM_MPICH2:-no}
+if test "$FROM_MPICH" = yes -a "$FROM_MPICH2" = yes ; then
+ AC_MSG_WARN([Both FROM_MPICH and FROM_MPICH2 set to yes; at most one should be yes])
+fi
+
+AC_ARG_VAR([FROM_LAM],[set to "yes" if building ROMIO inside of LAM])
+FROM_LAM=${FROM_LAM:-no}
+if test "$FROM_LAM" = 1 ; then FROM_LAM=yes ; fi
+
+CFLAGS=${CFLAGS:-""}
+LL="lld"
+AR_LOCAL=""
+DEFINE_HAVE_MPI_GREQUEST="#undef HAVE_MPI_GREQUEST"
+HAVE_MPI_INFO=""
+BUILD_MPI_INFO=""
+MPI_FINFO1=""
+MPI_FINFO2=""
+MPI_FINFO3=""
+MPI_FINFO4=""
+MPI_FARRAY1=""
+MPI_FARRAY2=""
+MPI_FARRAY3=""
+MPI_FARRAY4=""
+MPI_FARRAY5=""
+MPI_FARRAY6=""
+MPI_FARRAY7=""
+DEFS=""
+ROMIO_LFLAGS=""
+ROMIO_TCFLAGS=""
+ROMIO_TCPPFLAGS=""
+ROMIO_TFFLAGS=""
+NOPROFILE=0
+MPIRUN=""
+FORTRAN_TEST=""
+MAKE=${MAKE:-"make"}
+# foll. needed for f77 test programs
+F77GETARG="call getarg(i,str)"
+F77IARGC="iargc()"
+F77MPIOINC=""
+FTESTDEFINE=""
+FORTRAN_MPI_OFFSET=""
+MPIOF_H_INCLUDED=0
+MPI_OFFSET_KIND1="!"
+MPI_OFFSET_KIND2="!"
+TEST_CC=""
+TEST_F77=""
+TRY_WEAK_SYMBOLS=1
+#
+have_aio=no
+#
+known_mpi_impls="mpich2_mpi mpich_mpi sgi_mpi hp_mpi cray_mpi lam_mpi"
+
+dnl An m4 macro for use with m4_foreach_w and friends. You should modify this
+dnl list if you want to add a known file system. The list is just whitespace
+dnl separated, so you can use newlines and tabs as well.
+m4_define([known_filesystems_m4_w],
+ [nfs ufs pfs pvfs pvfs2 testfs xfs panfs gridftp lustre bgl bglockless zoidfs hfs piofs sfs])dnl
+dnl
+dnl An m4 macro for use with m4_foreach and friends. Expands to a quoted list of
+dnl quoted elements. A bit easier to use without unintended expansion than the
+dnl whitespace version.
+m4_define([known_filesystems_m4], m4_dquote(m4_map_args_w(m4_defn([known_filesystems_m4_w]),[],[],[,])))dnl
+dnl
+# a shell var for checking arguments given via --with-file-system=...
+known_filesystems="m4_join([ ],known_filesystems_m4)"
+
+#####################################################################
+
+#
+# Defaults
+AC_ARG_ENABLE(aio,[
+--enable-aio - Request use of asynchronous I/O routines (default)],
+[
+ if test "x$enableval" = "xno" ; then
+ disable_aio=yes
+ else
+ disable_aio=no
+ fi
+], disable_aio=no)
+AC_ARG_ENABLE(echo,
+[--enable-echo - Turn on strong echoing. The default is enable=no.] ,set -x)
+AC_ARG_ENABLE(f77,
+[--enable-f77 - Turn on support for Fortran 77 (default)],,enable_f77=yes)
+AC_ARG_ENABLE(f90,
+[--enable-f90 - Turn on support for Fortran 90 (default)],,enable_f90=yes)
+AC_ARG_ENABLE(weak-symbols,
+[--enable-weak-symbols - Turn on support for weak symbols],,enable_weak_symbols=yes)
+AC_ARG_ENABLE(debug,
+[--enable-debug - Build a debugging version],,)
+AC_ARG_WITH(file-system,[
+--with-file-system=name - Build with support for the named file systems],,)
+AC_ARG_WITH(pvfs2,[
+--with-pvfs2=path - Path to installation of PVFS (version 2)],,)
+AC_ARG_WITH(mpi-impl,[
+--with-mpi-impl=name - Specify MPI implementation to build ROMIO for],,)
+dnl
+AC_ARG_WITH(mpi, [
+--with-mpi=path - Path to instalation of MPI (headers, libs, etc)],,)
+dnl
+if test "$enable_f77" != "yes" ; then
+ NOF77=1
+fi
+if test "$enable_f90" != "yes" ; then
+ NOF90=1
+fi
+if test "$enable_debug" = "yes" ; then
+ DEBUG=yes
+fi
+if test "$enable_weak_symbols" = "no" ; then
+ TRY_WEAK_SYMBOLS=0
+fi
+MPI=$with_mpi
+if test -n "$with_mpi"; then
+ CC=$MPI/bin/mpicc
+fi
+
+# start with the set of file systems that the user asked for
+FILE_SYSTEM=$with_file_system
+
+
+# Check if Make is working
+PAC_PROG_MAKE
+#
+# Check that an arch was set
+# If it wasn't set, try to guess using "util/tarch"
+#
+# Sometimes tarch looses its execute bit (!)
+if test -s $srcdir/util/tarch -a ! -x $srcdir/util/tarch ; then
+ chmod a+x $srcdir/util/tarch
+fi
+if test -z "$ARCH" -a -x $srcdir/util/tarch ; then
+ AC_MSG_CHECKING(for architecture)
+ ARCH=`$srcdir/util/tarch | sed s/-/_/g`
+ if test -z "$ARCH" ; then
+ AC_MSG_RESULT(Unknown!)
+ AC_MSG_ERROR([Error: Could not guess target architecture, you must
+set an architecture type with the environment variable ARCH])
+ fi
+ eval "arch_$ARCH=1"
+ AC_MSG_RESULT($ARCH)
+fi
+#
+# check for valid architecture. Use __ so that _ALPHA_ does not match
+# LINUX_ALPHA_
+#### WE SHOULD REMOVE THIS SOON
+grep __"$ARCH"_ $srcdir/.config_params > /dev/null 2>&1
+if test $? != 0 ; then
+ AC_MSG_WARN([Unknown architecture $arch... proceeding anyway])
+fi
+#
+#
+# Find the home directory if not specified
+if test "X$srcdir" != "X." -a -s $srcdir/mpi-io/Makefile.in ; then
+ ROMIO_HOME_TRIAL=$srcdir
+else
+ # Take advantage of autoconf2 features
+ if test -n "$ac_confdir" ; then
+ ROMIO_HOME_TRIAL=$ac_confdir
+ else
+ if test -s configure ; then
+ ROMIO_HOME_TRIAL=`pwd`
+ else
+ ac_confdir=`dirname "$0" 2>/dev/null`
+ if test -n "$ac_confdir" ; then
+ ROMIO_HOME_TRIAL=$ac_confdir
+ fi
+ fi
+ fi
+fi
+AC_MSG_RESULT([ROMIO home directory is $ROMIO_HOME_TRIAL])
+ROMIO_HOME=$ROMIO_HOME_TRIAL
+
+# get a fully qualified pathname for our build directory
+top_build_dir=`pwd`
+# used in romioinstall
+AC_SUBST(top_build_dir)
+
+#
+# Create the "autoconf" style directory names...
+# Most of these are done for us; add the documentation directories
+#
+# mandir is the root for the man pages
+if test -z "$mandir" ; then mandir='${prefix}/man' ; fi
+AC_SUBST(mandir)
+if test -z "$docdir" ; then docdir='${prefix}/doc' ; fi
+AC_SUBST(docdir)
+if test -z "$htmldir" ; then htmldir='${prefix}/www' ; fi
+AC_SUBST(htmldir)
+
+
+# If we are building within a known MPI implementation, we must avoid the
+# tests about an existing implementation
+if test "$FROM_MPICH" != no -o "$FROM_MPICH2" != no -o "$FROM_LAM" != no ; then
+ WITHIN_KNOWN_MPI_IMPL=yes
+else
+ WITHIN_KNOWN_MPI_IMPL=no
+fi
+# check for valid MPI implementation
+if test -n "$MPI_IMPL" ; then
+ found=no
+ for mpi in $known_mpi_impls ; do
+ if test "${MPI_IMPL}_mpi" = "$mpi" ; then
+ found=yes
+ break
+ fi
+ done
+ if test $found = no ; then
+ AC_MSG_WARN([Unknown MPI implementation $MPI... proceeding anyway])
+ fi
+fi
+#
+
+if test -n "${with_mpi}" ; then
+ MPI_INCLUDE_DIR="${with_mpi}"/include
+ MPI_LIB_DIR="${with_mpi}"/lib
+fi
+
+# check for valid MPI include directory if specified
+if test $WITHIN_KNOWN_MPI_IMPL = no ; then
+ if test -n "$MPI_INCLUDE_DIR"; then
+ if test ! -f "$MPI_INCLUDE_DIR/mpi.h" ; then
+ AC_MSG_ERROR([Include file $MPI_INCLUDE_DIR/mpi.h not found])
+ fi
+ else
+# assume that mpi.h is in the default path
+# set MPI_INCLUDE_DIR to ".", so that it translates to -I. in the
+# compile command. Some compilers complain if it's only -I
+ MPI_INCLUDE_DIR=.
+ fi
+else
+ MPI_INCLUDE_DIR=.
+fi
+#
+# check for valid MPI library if specified
+if test $WITHIN_KNOWN_MPI_IMPL = no ; then
+ if test -n "$MPI_LIB" ; then
+ if test ! -f "$MPI_LIB" ; then
+ AC_MSG_ERROR([MPI library $MPI_LIB not found])
+ fi
+ fi
+fi
+
+# USER_CFLAGS and USER_FFLAGS are used only in test/Makefile.in
+if test $DEBUG = "yes"; then
+ USER_CFLAGS="$CFLAGS -g"
+ USER_FFLAGS="$FFLAGS -g"
+else
+ USER_CFLAGS="$CFLAGS -O"
+ USER_FFLAGS="$FFLAGS -O"
+fi
+#
+# Here begin the architecture-specific tests.
+# --------------------------------------------------------------------------
+# We must first select the C and Fortran compilers. Because of the
+# way that the PROG_CC autoconf macro works (and all of the macros that
+# require it, including CHECK_HEADERS), that macro must occur exactly
+# once in the configure.ac file, at least as of autoconf 2.57 .
+# Unfortunately, this requirement is not enforced. To handle this,
+# we first case on the architecture; then use PROG_CC, then case on the
+# architecture again for any arch-specific features. We also set the
+# C_DEBUG_FLAG and F77_DEBUG_FLAG in case debugging is selected.
+#
+# For the MPICH and MPICH2 configures, the compilers will already be
+# selected, so most of the compiler-selection code will be bypassed.
+# --------------------------------------------------------------------------
+# For historical reasons
+if test -z "$FC" ; then
+ FC=$F77
+fi
+#
+C_DEBUG_FLAG="-g"
+F77_DEBUG_FLAG="-g"
+# C_OPT_FLAG=${CFLAGS:-"-O"}
+# MPICH1 uses OPTFLAGS and OPTFLAGSC to specify separate optimization
+# flags for the C compiler (this is better that adding it to the
+# undifferentiated CFLAGS, at least on input).
+if test -n "$OPTFLAGS" ; then
+ C_OPT_FLAG="$C_OPT_FLAG $OPTFLAGS"
+fi
+if test -n "$OPTFLAGSC" ; then
+ C_OPT_FLAG="$C_OPT_FLAG $OPTFLAGSC"
+fi
+case $ARCH in
+ solaris|solaris86)
+ CC=${CC:-cc}
+ F77=${FC:-f77}
+ if test "$CC" != "gcc" ; then
+ C_DEBUG_FLAG="-g -v"
+ fi
+ ;;
+
+ rs6000)
+ F77=${FC}
+ # Try to use mpcc if no CC specified
+ AC_PROGRAMS_CHECK(CC, mpcc, cc)
+ if test $NOF77 = 0 && test -z "$F77"; then
+ AC_PROGRAMS_CHECK(F77, mpxlf, f77)
+ fi
+ ;;
+
+ tflop|tflops)
+ CC=${CC:-pgcc}
+ F77=${FC:-pgf77}
+ CFLAGS="$CFLAGS -cougar -D__PUMA"
+ if test "$CC" = "pgcc" ; then
+ C_OPT_FLAG="-Knoieee -Mvect -O3"
+ fi
+ ;;
+
+ freebsd|LINUX|netbsd|openbsd|LINUX_ALPHA)
+ CC=${CC:-gcc}
+ # Let the prog_f77 file g77/f77/others
+ F77=${FC}
+ ;;
+
+ SX4)
+ CC=${CC:-mpicc}
+ F77=${FC:-mpif90}
+ if test $DEBUG != "yes" ; then
+ USER_FFLAGS="$FFLAGS -Chopt"
+ F77_OPT_FLAG="-Chopt"
+ fi
+ ;;
+
+ hpux|sppux)
+ C_DEBUG_FLAG="-g +w1"
+ ;;
+
+ alpha|ALPHA)
+ CC=${CC:-cc}
+ F77=${FC:-f77}
+ dnl CFLAGS="$CFLAGS -g -std1 -warnprotos -verbose"
+ C_DEBUG_FLAG="-g -verbose"
+ ;;
+
+ CRAY)
+ CC=${CC:-cc}
+ F77=${FC:-f90}
+ NOF77=1
+ CFLAGS="$CFLAGS -D_UNICOS"
+ ;;
+
+ sgi|IRIX64|IRIX32|IRIXN32)
+ arch_IRIX=1
+ CC=${CC:-cc}
+ F77=${FC:-f77}
+ C_DEBUG_FLAG="-g -fullwarn"
+ ;;
+
+ sgi5)
+ ;;
+
+ *)
+ # Fall-through case. Take FC
+ F77=${FC:-f77}
+ ;;
+esac
+
+PAC_PROG_CC
+
+dnl AC_PROG_{CXX,F77,FC} must come early in configure.ac in order to control
+dnl compiler search order and avoid some esoteric autoconf macro expansion
+dnl errors
+if test "$enable_f77" = "yes" ; then
+ # suppress default "-g -O2" from AC_PROG_F77
+ : ${FFLAGS=""}
+ AC_PROG_F77([PAC_F77_SEARCH_LIST])
+fi
+if test "$enable_f90" = "yes" ; then
+ # suppress default "-g -O2" from AC_PROG_FC
+ : ${FCFLAGS=""}
+ AC_PROG_FC([PAC_FC_SEARCH_LIST])
+fi
+
+if test "$CC" = "gcc" -a -z "$C_DEBUG_FLAG" ; then
+ C_DEBUG_FLAG="-g -O -Wall -Wstrict-prototypes -Wmissing-prototypes"
+fi
+if test $DEBUG = "yes" ; then
+ CFLAGS="$CFLAGS $C_DEBUG_FLAG"
+else
+ CFLAGS="$CFLAGS $C_OPT_FLAG"
+fi
+# ---------------------------------------------------------------------------
+# Here go the rest of the tests
+# ---------------------------------------------------------------------------
+if test -n "$arch_solaris" || test -n "$arch_solaris86" ; then
+ if test -z "$MPI_IMPL" ; then
+ MPI_IMPL=mpich
+ mpi_mpich=1
+ fi
+ if test $MPI_IMPL = "mpich" ; then
+ TEST_CC=mpicc
+ TEST_F77=mpif77
+ else
+ TEST_CC="$CC"
+ TEST_F77="$F77"
+ fi
+ AR="ar cr"
+# solaris does not have l option to ar
+fi
+
+
+if test -n "$arch_rs6000"; then
+ if test -z "$MPI_IMPL" ; then
+ MPI_IMPL=mpich
+ mpi_mpich=1
+ fi
+ AC_DEFINE(AIX,1,[Define for AIX])
+# assume long long exists.
+ ac_cv_sizeof_long_long=${ac_cv_sizeof_long_long:-8}
+ MPI_OFFSET_KIND1=" INTEGER MPI_OFFSET_KIND"
+ MPI_OFFSET_KIND2=" PARAMETER (MPI_OFFSET_KIND=8)"
+ MPI_OFFSET_KIND_VAL=8
+fi
+#
+
+if test -n "$arch_tflop" || test -n "$arch_tflops"; then
+ # TFLOP_FLAGS="-cougar -D__PUMA"
+ AR="xar cr$AR_LOCAL"
+ RANLIB="xranlib"
+ MPI_LIB="$MPI_LIB"
+ if test -z "$MPI_IMPL" ; then
+ MPI_IMPL=mpich
+ mpi_mpich=1
+ fi
+ # supply a reasonable default fs
+ if test -z "$FILE_SYSTEM" ; then
+ FILE_SYSTEM="ufs"
+ fi
+fi
+#
+if test -n "$arch_freebsd" || test -n "$arch_LINUX" || test -n "$arch_LINUX_ALPHA" || test -n "$arch_netbsd" || test -n "$arch_openbsd" ; then
+ if test -n "$arch_freebsd" || test -n "$arch_netbsd" || test -n "$arch_openbsd"; then
+ ac_cv_sizeof_long_long=${ac_cv_sizeof_long_long:-0}
+ # printf doesn't work properly and no integer*8 as far as I can tell
+ fi
+ # Find the CPP before the header check
+ AC_PROG_CPP
+ if test -z "$MPI_IMPL" ; then
+ MPI_IMPL=mpich
+ mpi_mpich=1
+ fi
+fi
+#
+if test -n "$arch_SX4" ; then
+ have_aio=no
+ AC_DEFINE(SX4,1,[Define for NEC SX4])
+ if test -z "$MPI_IMPL" ; then
+ MPI_IMPL=mpich
+ mpi_mpich=1
+ fi
+ # supply a reasonable default fs
+ if test -z "$FILE_SYSTEM" ; then
+ FILE_SYSTEM="sfs nfs"
+ fi
+ MPI_OFFSET_KIND1=" INTEGER MPI_OFFSET_KIND"
+ MPI_OFFSET_KIND2=" PARAMETER (MPI_OFFSET_KIND=8)"
+ MPI_OFFSET_KIND_VAL=8
+fi
+#
+if test -n "$arch_hpux" || test -n "$arch_sppux" ; then
+ have_aio=no
+ RANLIB=":"
+ if test -z "$MPI_IMPL"; then
+ if test -f "/opt/mpi/include/mpi.h" ; then
+ echo "assuming that you want to use ROMIO with HP MPI"
+ MPI_IMPL=hp
+ else
+ echo "assuming that you want to use ROMIO with MPICH"
+ MPI_IMPL=mpich
+ fi
+ fi
+ if test $MPI_IMPL = "mpich" ; then
+ mpi_mpich=1
+ MPI_LIB="$MPI_LIB -lV3"
+ CC=${CC:-cc -Ae}
+ F77=${FC:-f77 +U77}
+ fi
+ if test $MPI_IMPL = "hp" ; then
+ mpi_hp=1
+ CC=${CC:-mpicc -Ae}
+ F77=${FC:-mpif77 +U77}
+ fi
+ if test $MPI_IMPL = "lam" && test "$FC" != ""; then
+ F77="$F77 +U77"
+ fi
+ FTESTDEFINE="external iargc, getarg"
+ if test -n "$arch_hpux" ; then
+ CFLAGS="$CFLAGS -D_LARGEFILE64_SOURCE"
+ AC_DEFINE(HPUX,1,[Define for HPUX])
+ if test $MPI_IMPL = "hp" ; then
+ F77=${FC:-mpif90 +U77}
+ else
+ F77=${FC:-f90 +U77}
+ fi
+ else
+ AC_DEFINE(SPPUX,1,[Define for SPPUX (Convex)])
+ fi
+
+ MPI_OFFSET_KIND1=" INTEGER MPI_OFFSET_KIND"
+ MPI_OFFSET_KIND2=" PARAMETER (MPI_OFFSET_KIND=8)"
+ MPI_OFFSET_KIND_VAL=8
+ if test "$CC" != "gcc" ; then
+ ROMIO_TCFLAGS="-Ae"
+ fi
+ if test "$F77" != "g77" ; then
+ ROMIO_TFFLAGS="+U77"
+ fi
+fi
+#
+if test -n "$arch_alpha" || test -n "$arch_ALPHA" ; then
+ if test -z "$MPI_IMPL" ; then
+ MPI_IMPL=mpich
+ mpi_mpich=1
+ fi
+
+ MPI_OFFSET_KIND1=" INTEGER MPI_OFFSET_KIND"
+ MPI_OFFSET_KIND2=" PARAMETER (MPI_OFFSET_KIND=8)"
+ MPI_OFFSET_KIND_VAL=8
+ LIBS="$LIBS -laio"
+fi
+#
+if test -n "$arch_CRAY" ; then
+ NOF77=1
+ FTESTDEFINE="integer ilen"
+ F77GETARG="call pxfgetarg(i, str, ilen, ierr)"
+ have_aio=no
+ RANLIB=":"
+ AC_DEFINE(CRAY,1,[Define if Cray])
+ if test -z "$MPI_IMPL" || test -n "$mpi_sgi" ; then
+ MPI_IMPL=cray
+ mpi_cray=1
+ mpi_sgi=""
+# above is to disable configure tests specific to SGI MPI
+ AC_DEFINE(MPISGI,1,[Define if SGI MPI])
+ AC_DEFINE(HAVE_MPI_COMBINERS,1,[Define if MPI supports datatype combiners])
+ AC_DEFINE(NO_MPI_SGI_type_is_contig,1,[Define if no types show contig])
+ fi
+# MPISGI needed because of error in Cray's and SGI's
+# MPI_Type_get_contents (does not increment reference count).
+# Others needed because MPISGI needed.
+
+ MPI_OFFSET_KIND1=" INTEGER MPI_OFFSET_KIND"
+ MPI_OFFSET_KIND2=" PARAMETER (MPI_OFFSET_KIND=8)"
+ MPI_OFFSET_KIND_VAL=8
+fi
+#
+if test -n "$arch_sgi" ; then
+ arch_IRIX=1
+ ARCH=IRIX
+fi
+if test -n "$arch_IRIX64" || test -n "$arch_IRIX32" || test -n "$arch_IRIXN32" ; then
+ arch_IRIX=1
+fi
+if test -n "$arch_sgi5" ; then
+ arch_IRIX5=1
+ ARCH=IRIX
+fi
+#
+PAC_GET_SPECIAL_SYSTEM_INFO
+#
+# special case 'sgi5' for use on MESHINE which is much like an SGI running
+# irix 5 with r4400 chips, but does not have 'hinv', so above code doesn't
+# work
+if test -n "$arch_sgi5"; then
+ osversion=5
+ cputype=4400
+ IRIXARCH="$ARCH_$osversion"
+ IRIXARCH="$IRIXARCH_$cputype"
+# now set arch_IRIX to 1
+ arch_IRIX=1
+ echo "IRIX-specific architecture is $IRIXARCH"
+ AC_DEFINE(IRIX,1,[Define if IRIX])
+fi
+#
+if test -n "$arch_IRIX"; then
+ if test $osversion = 4 ; then
+ RANLIB="ar ts"
+ if test -n "$mpi_sgi"; then
+ AC_MSG_ERROR([SGI\'s MPI does not work with IRIX 4.x])
+ fi
+ elif test $osversion = 5 ; then
+ if test -n "$mpi_sgi"; then
+ AC_MSG_ERROR([SGI\'s MPI does not work with IRIX 5.x])
+ fi
+ elif test $osversion = 6 ; then
+ if test -z "$MPI_IMPL"; then
+ if test "$FROM_MPICH2" = "yes" ; then
+ # Building with MPICH2. Distinguish from MPICH-1
+ MPI_IMPL=mpich2
+ mpi_mpich2=1
+ elif test -f "/usr/include/mpi.h" ; then
+ # removed use of escaped single quotes in messages
+ # because they confuse Emacs, making it hard to
+ # read the files (with emacs :) )
+ AC_MSG_WARN([assuming that you want to use ROMIO with the SGI MPI])
+ MPI_IMPL=sgi
+ mpi_sgi=1
+ else
+ AC_MSG_WARN([assuming that you want to use ROMIO with MPICH])
+ MPI_IMPL=mpich
+ mpi_mpich=1
+ fi
+ fi
+ RANLIB=":"
+ AC_DEFINE(AIO_SIGNOTIFY_NONE,1,[Define if no signotify])
+ if test $cputype -ge 5000 ; then
+ MIPS=4
+ else
+ MIPS=3
+ fi
+ fi
+ if test -n "$mpi_sgi" && test -z "$MPI_LIB" ; then
+ MPI_LIB="-lmpi"
+ fi
+# check if pread64 is defined
+ PAC_HAVE_PREAD64
+
+ # supply a reasonable default fs
+ if test -z "$FILE_SYSTEM" ; then
+ FILE_SYSTEM="nfs"
+ AC_MSG_CHECKING(for xfs)
+ AC_TRY_COMPILE([
+#include <aio.h>],
+[aiocb64_t *t1;],xfs_works=1;FILE_SYSTEM="xfs $FILE_SYSTEM";)
+ if test "$xfs_works" = 1 ; then
+ AC_MSG_RESULT(yes)
+ else
+ AC_MSG_RESULT(no)
+ FILE_SYSTEM="ufs $FILE_SYSTEM"
+ fi
+ fi
+ AC_DEFINE(IRIX,1,[Define if IRIX])
+ MPI_OFFSET_KIND1=" INTEGER MPI_OFFSET_KIND"
+ MPI_OFFSET_KIND2=" PARAMETER (MPI_OFFSET_KIND=8)"
+ MPI_OFFSET_KIND_VAL=8
+fi
+
+AC_HAVE_FUNCS(memalign)
+
+#
+# Question: Should ROMIO under MPICH2 ignore the Fortran tests, since
+# MPICH2 provides all of the Fortran interface routines?
+#
+if test $NOF77 = 0 ; then
+ echo "checking Fortran external names"
+ PAC_GET_FORTNAMES
+ if test -n "$WDEF" ; then
+ CFLAGS="$CFLAGS $WDEF"
+ fi
+ dnl PAC_PROG_F77_NAME_MANGLE
+ dnl (need to set the new name format)
+ rm -f test/mpif.h
+ if test "$MPI_INCLUDE_DIR" != "." && test $WITHIN_KNOWN_MPI_IMPL = no ; then
+ if test ! -d test ; then mkdir test ; fi
+ ln -s $MPI_INCLUDE_DIR/mpif.h test
+ fi
+else
+ F77=":"
+fi
+#
+AC_C_INLINE
+
+# Header files
+# Find the CPP before the header check
+AC_PROG_CPP
+AC_CHECK_HEADERS([unistd.h fcntl.h malloc.h stddef.h sys/types.h])
+#
+
+# When compiling ROMIO on Darwin with _POSIX_C_SOURCE defined (such as when
+# using --enable-strict in MPICH2), sys/types.h does not define u_short and
+# friends unless _DARWIN_C_SOURCE is also defined (see compat(5) on a Darwin
+# box). This would normally be fine, except sys/stat.h defines struct stat to
+# use u_long, so strict compiles fail. One option is to also compile with
+# _DARWIN_C_SOURCE, but this disables much of the strictness that is intended
+# by _POSIX_C_SOURCE. Instead we just define our own types if they are not
+# provided by the system. This isn't quite as safe as typedef'ing the
+# replacement types, but it will apply to later configure tests, which is
+# important.
+AC_CHECK_TYPE([u_char],[],[AC_DEFINE_UNQUOTED([u_char],[unsigned char],[Define to "unsigned char" if sys/types.h does not define.])])
+AC_CHECK_TYPE([u_short],[],[AC_DEFINE_UNQUOTED([u_short],[unsigned short],[Define to "unsigned short" if sys/types.h does not define.])])
+AC_CHECK_TYPE([u_int],[],[AC_DEFINE_UNQUOTED([u_int],[unsigned int],[Define to "unsigned int" if sys/types.h does not define.])])
+AC_CHECK_TYPE([u_long],[],[AC_DEFINE_UNQUOTED([u_long],[unsigned long],[Define to "unsigned long" if sys/types.h does not define.])])
+
+# must come _after_ the above checks for u_char/u_short/u_int/u_long
+AC_CHECK_HEADERS([sys/attr.h])
+
+AC_CHECK_SIZEOF(int)
+AC_CHECK_SIZEOF(void *)
+AC_CACHE_CHECK([for int large enough for pointers],
+pac_cv_int_hold_pointer,[
+if test "$ac_cv_sizeof_int" = "0" -o \
+ "$ac_cv_sizeof_void_p" = "0" ; then
+ pac_cv_int_hold_pointer=unknown
+elif test "$ac_cv_sizeof_int" -lt "$ac_cv_sizeof_void_p" ; then
+ pac_cv_int_hold_pointer=no
+else
+ pac_cv_int_hold_pointer=yes
+fi
+])
+if test "$pac_cv_int_hold_pointer" != yes ; then
+ AC_DEFINE(INT_LT_POINTER,1,[Define if int smaller than pointer])
+ dnl Switch to a conforming name (start with HAVE or USE)
+ AC_DEFINE(HAVE_INT_LT_POINTER,1,[Define if int smaller than pointer])
+fi
+
+# LL is the printf-style format name for output of a MPI_Offset.
+# We have to match this to the type that we use for MPI_Offset.
+AC_CHECK_SIZEOF(long long)
+if test "$ac_cv_sizeof_long_long" != 0 ; then
+ if test "$ac_cv_sizeof_long_long" = "8" ; then
+ AC_DEFINE(HAVE_LONG_LONG_64,1,[Define if long long is 64 bits])
+ MPI_OFFSET_TYPE="long long"
+ DEFINE_MPI_OFFSET="typedef long long MPI_Offset;"
+ FORTRAN_MPI_OFFSET="integer*8"
+ LL="lld"
+ elif test "$ac_cv_sizeof_long_long" = "$ac_cv_sizeof_int" ; then
+ MPI_OFFSET_TYPE="int"
+ DEFINE_MPI_OFFSET="typedef int MPI_Offset;"
+ FORTRAN_MPI_OFFSET="integer"
+ AC_DEFINE(MPI_OFFSET_IS_INT,1,[Define if MPI_Offset is int])
+ LL="d"
+ MPI_OFFSET_KIND1="!"
+ MPI_OFFSET_KIND2="!"
+ else
+ echo "defining MPI_Offset as long in C and integer in Fortran"
+ MPI_OFFSET_TYPE="long"
+ DEFINE_MPI_OFFSET="typedef long MPI_Offset;"
+ FORTRAN_MPI_OFFSET="integer"
+ LL="ld"
+ MPI_OFFSET_KIND1="!"
+ MPI_OFFSET_KIND2="!"
+ fi
+else
+ echo "defining MPI_Offset as long in C and integer in Fortran"
+ MPI_OFFSET_TYPE="long"
+ DEFINE_MPI_OFFSET="typedef long MPI_Offset;"
+ FORTRAN_MPI_OFFSET="integer"
+ LL="ld"
+ MPI_OFFSET_KIND1="!"
+ MPI_OFFSET_KIND2="!"
+fi
+
+
+#
+if test -n "$ac_cv_sizeof_long_long"; then
+ if test $WITHIN_KNOWN_MPI_IMPL = no ; then
+ PAC_MPI_LONG_LONG_INT
+ else
+ AC_DEFINE(HAVE_MPI_LONG_LONG_INT,1,[Define if supports long long int])
+ fi
+fi
+#
+if test -n "$OFFSET_KIND" -a "A$MPI_OFFSET_KIND1" = "A!" ; then
+ MPI_OFFSET_KIND1=" INTEGER MPI_OFFSET_KIND"
+ MPI_OFFSET_KIND2=" PARAMETER (MPI_OFFSET_KIND=$OFFSET_KIND)"
+ MPI_OFFSET_KIND_VAL=$OFFSET_KIND
+else
+ if test "$FORTRAN_MPI_OFFSET" = "integer*8" && test "A$MPI_OFFSET_KIND2" = "A!" && test $NOF77 = 0 && test $NOF90 = 0 ; then
+ PAC_MPI_OFFSET_KIND
+ fi
+ #
+ if test "$FORTRAN_MPI_OFFSET" = "integer" && test "A$MPI_OFFSET_KIND2" = "A!" && test $NOF77 = 0 && test $NOF90 = 0 ; then
+ PAC_MPI_OFFSET_KIND_4BYTE
+ fi
+fi
+#
+# Test that we can use the FORTRAN_MPI_OFFSET type. If the environment
+# is a strict Fortran 90/95 or later compiler, the "integer*8" format
+# may not work.
+if test "$NOF77" = 0 ; then
+ rm -f conftest*
+ ac_cv_f77_offset_type_works=no
+ AC_MSG_CHECKING([that we can use $FORTRAN_MPI_OFFSET to declare MPI_DISPLACMENT_CURRENT])
+ cat >conftest.f <<EOF
+ program main
+ $FORTRAN_MPI_OFFSET j
+ end
+EOF
+ if $F77 -o conftest$EXEEXT conftest.f >>config.log 2>&1 && test -x conftest$EXEEXT ; then
+ ac_cv_f77_offset_type_works=yes
+ fi
+ rm -f conftest*
+ AC_MSG_RESULT($ac_cv_f77_offset_type_works)
+
+ if test "$ac_cv_f77_offset_type_works" != "yes" -a -n "$MPI_OFFSET_KIND_VAL"; then
+ AC_MSG_CHECKING([whether we can use KIND with the selected F77 compiler $F77])
+ ac_cv_f77_allows_offset_kind=no
+ rm -f conftest*
+ cat >conftest.f <<EOF
+ program main
+ integer (kind=$MPI_OFFSET_KIND_VAL) j
+ end
+EOF
+ if $F77 -o conftest$EXEEXT conftest.f >>config.log 2>&1 && test -x conftest$EXEEXT ; then
+ ac_cv_f77_allows_offset_kind=yes
+ fi
+ rm -f conftest*
+ AC_MSG_RESULT($ac_cv_f77_allows_offset_kind)
+ if test "$ac_cv_f77_allows_offset_kind" ; then
+ FORTRAN_MPI_OFFSET="integer (kind=$MPI_OFFSET_KIND_VAL)"
+ else
+ AC_MSG_WARN([Could not find a way to declare an integer type corresponding to MPI_Offset in Fortran.])
+ fi
+ fi
+fi
+
+#
+# check if MPI_Info functions are defined in the MPI implementation
+if test $WITHIN_KNOWN_MPI_IMPL = no ; then
+ PAC_MPI_INFO
+else
+ AC_DEFINE(HAVE_MPI_INFO,1,[Define if MPI Info is available])
+ HAVE_MPI_INFO="#define HAVE_MPI_INFO"
+ MPI_FINFO1="!"
+ MPI_FINFO2="!"
+ MPI_FINFO3="!"
+ MPI_FINFO4="!"
+fi
+#
+if test -n "$mpi_sgi"; then
+dnl if test -z "$HAVE_MPI_INFO" ; then
+dnl PAC_CHECK_MPI_SGI_INFO_NULL # is MPI_INFO_NULL defined in mpi.h?
+dnl fi
+ PAC_TEST_MPI_SGI_type_is_contig
+ PAC_TEST_MPI_COMBINERS
+ PAC_TEST_MPI_HAVE_OFFSET_KIND
+fi
+#
+# check if darray and subarray constructors are defined in the MPI
+# implementation
+if test $WITHIN_KNOWN_MPI_IMPL = no ; then
+ PAC_MPI_DARRAY_SUBARRAY
+fi
+if test $FROM_MPICH2 = yes ; then
+ dnl Made this a message instead of a warning because the warning is
+ dnl likely to confuse users.
+ AC_MSG_RESULT([Overriding Array test for MPICH2])
+ unset BUILD_MPI_ARRAY
+ AC_DEFINE(HAVE_MPI_DARRAY_SUBARRAY,1,[Define if Darray is available])
+ HAVE_MPI_DARRAY_SUBARRAY="#define HAVE_MPI_DARRAY_SUBARRAY"
+ MPI_FARRAY1="!"
+ MPI_FARRAY2="!"
+ MPI_FARRAY3="!"
+ MPI_FARRAY4="!"
+ MPI_FARRAY5="!"
+ MPI_FARRAY6="!"
+ MPI_FARRAY7="!"
+fi
+#
+#
+# Test for weak symbol support...
+# We can't put # in the message because it causes autoconf to generate
+# incorrect code
+HAVE_WEAK_SYMBOLS=0
+if test -n "$arch_hpux" || test -n "$arch_sppux" ; then
+# multiple secondary definitions not allowed by HP compilers
+# Fortran interface for HP already uses one secondary defn.
+# therefore, do not use this method for profiling interface.
+# build profiling interface explicitly.
+ TRY_WEAK_SYMBOLS=0
+fi
+if test $TRY_WEAK_SYMBOLS = 1 ; then
+ AC_MSG_CHECKING([for weak symbol support])
+ AC_TRY_LINK([
+extern int PFoo(int);
+#pragma weak PFoo = Foo
+int Foo(int a) { return a; }
+],[return PFoo(1);],has_pragma_weak=1)
+ #
+ # Some systems (Linux ia64 and ecc, for example), support weak symbols
+ # only within a single object file! This tests that case.
+ # Note that there is an extern int PFoo declaration before the
+ # pragma. Some compilers require this in order to make the weak symbol
+ # extenally visible.
+if test "$has_pragma_weak" = 1 ; then
+ AC_MSG_RESULT([pragma weak])
+ AC_MSG_CHECKING([that weak symbols are visible to other files])
+ rm -f conftest*
+ cat >>conftest1.c <<EOF
+extern int PFoo(int);
+#pragma weak PFoo = Foo
+int Foo(int);
+int Foo(int a) { return a; }
+EOF
+ cat >>conftest2.c <<EOF
+extern int PFoo(int);
+int main(int argc, char **argv) {
+return PFoo(0);}
+EOF
+ ac_link2='${CC-cc} -o conftest$EXEEXT $CFLAGS $CPPFLAGS $LDFLAGS conftest1.c conftest2.c $LIBS >conftest.out 2>&1'
+ if eval $ac_link2 ; then
+ AC_MSG_RESULT(yes)
+ AC_MSG_CHECKING([that the compiler correctly implements weak symbols])
+ # The gcc 3.4.x compiler accepts the pragma weak, but does not
+ # correctly implement it on systems where the loader doesn't
+ # support weak symbols (e.g., cygwin). This is a bug in gcc, but it
+ # it is one that *we* have to detect.
+ rm -f conftest*
+ cat >>conftest1.c <<EOF
+extern int PFoo(int);
+#pragma weak PFoo = Foo
+int Foo(int);
+int Foo(int a) { return a; }
+EOF
+ cat >>conftest2.c <<EOF
+extern int Foo(int);
+int PFoo(int a) { return a+1;}
+int main(int argc, char **argv) {
+return Foo(0);}
+EOF
+ if eval $ac_link2 ; then
+ AC_MSG_RESULT(yes)
+ has_pragma_weak=1
+ else
+ AC_MSG_RESULT(no)
+ echo "$ac_link2" >> config.log
+ echo "Failed program was" >> config.log
+ cat conftest1.c >>config.log
+ cat conftest2.c >>config.log
+ if test -s conftest.out ; then cat conftest.out >> config.log ; fi
+ has_pragma_weak=0
+ fi
+ else
+ echo "$ac_link2" 1>&AC_FD_CC
+ echo "Failed program was" 1>&AC_FD_CC
+ cat conftest1.c 1>&AC_FD_CC
+ cat conftest2.c 1>&AC_FD_CC
+ if test -s conftest.out ; then cat conftest.out 1>&AC_FD_CC ; fi
+ AC_MSG_RESULT(no)
+ has_pragma_weak=0
+ fi
+ rm -f conftest*
+ fi
+ if test "$has_pragma_weak" = 1 ; then
+ HAVE_WEAK_SYMBOLS=1
+ AC_DEFINE(HAVE_PRAGMA_WEAK,1,[Define if pragma weak available])
+ else
+ AC_TRY_LINK([
+extern int PFoo(int);
+#pragma _HP_SECONDARY_DEF Foo PFoo
+int Foo(int a) { return a; }
+],[return PFoo(1);],has_pragma_hp_secondary=1)
+ if test "$has_pragma_hp_secondary" = 1 ; then
+ AC_MSG_RESULT([pragma _HP_SECONDARY_DEF])
+ HAVE_WEAK_SYMBOLS=1
+ AC_DEFINE(HAVE_PRAGMA_HP_SEC_DEF,1,[Define for HP weak pragma])
+ else
+ AC_TRY_LINK([
+extern int PFoo(int);
+#pragma _CRI duplicate PFoo as Foo
+int Foo(int a) { return a; }
+],[return PFoo(1);],has_pragma_cri_duplicate=1)
+ if test "$has_pragma_cri_duplicate" = 1 ; then
+ AC_MSG_RESULT([pragma _CRI duplicate x as y])
+ HAVE_WEAK_SYMBOLS=1
+ AC_DEFINE(HAVE_PRAGMA_CRI_DUP,1,[Define for CRAY weak dup])
+ else
+ AC_MSG_RESULT(no)
+ fi
+ fi
+ fi
+fi
+if test "$HAVE_WEAK_SYMBOLS" = 1 ; then
+ AC_DEFINE(HAVE_WEAK_SYMBOLS,1,[Define if weak symbols available])
+fi
+AC_SUBST(HAVE_WEAK_SYMBOLS)
+
+# FIXME we only build ROMIO in embedded mode for now
+AM_CONDITIONAL([BUILD_ROMIO_EMBEDDED],[true])
+# FIXME need to get this right for non-MPICH2 builds
+AM_CONDITIONAL([BUILD_MPIO_REQUEST],[false])
+# FIXME need to get this right for non-MPICH2 builds
+AM_CONDITIONAL([BUILD_MPIO_ERRHAN],[false])
+
+# if we don't have weak symbol support, we must build a separate convenience
+# library in order to provide the "PMPI_" symbols
+AM_CONDITIONAL([BUILD_PROFILING_LIB],[test "x$HAVE_WEAK_SYMBOLS" = "x0"])
+
+AM_CONDITIONAL([BUILD_F77_BINDINGS],[test "x$NOF77" != "x1" && test "x$FROM_MPICH2" != "xyes"])
+
+
+#
+# Check whether the MPI Offset type is compatible with struct flock
+AC_MSG_CHECKING([whether struct flock compatible with MPI_Offset])
+AC_TRY_COMPILE([#include <fcntl.h>],
+[struct flock l;
+ $MPI_OFFSET_TYPE a=1;
+ l.l_start = a;
+ l.l_len = a;
+],pac_cv_struct_flock_and_mpi_offset=yes,pac_cv_struct_flock_and_mpi_offset=no)
+AC_MSG_RESULT($pac_cv_struct_flock_and_mpi_offset)
+# FIXME: We should look for struct flock64 and the F_SETLK64/F_GETLK64
+# ADIOI_Set_lock could use these instead.
+if test "$pac_cv_struct_flock_and_mpi_offset" = no ; then
+ AC_MSG_CHECKING([whether struct flock compatible with int])
+ AC_TRY_COMPILE([#include <fcntl.h>],
+[struct flock l;
+ int a=1;
+ l.l_start = a;
+ l.l_len = a;
+],pac_cv_struct_flock_and_int=yes,pac_cv_struct_flock_and_int=no)
+ AC_MSG_RESULT($pac_cv_struct_flock_and_int)
+ if test "$pac_cv_struct_flock_and_int" = yes ; then
+ AC_DEFINE(NEEDS_INT_CAST_WITH_FLOCK,1,[Define if l_start and l_len data should be cast as int])
+ fi
+ # FIXME. Solaris header files define off_t as a UNION if 64bit file
+ # sizes are selected. Gah!
+fi
+
+#
+# if FILE_SYSTEM is not set above, use ufs and nfs as default
+#
+if test -z "$FILE_SYSTEM" ; then
+ FILE_SYSTEM="ufs nfs"
+fi
+
+# no matter what, always build testfs
+FILE_SYSTEM="testfs $FILE_SYSTEM"
+
+# check for valid file system
+if test -n "$FILE_SYSTEM" ; then
+ # if multiple filesystems are passed in, they are '+'-delimited
+ # we could set the IFS to tokenize FILE_SYSTEM, but the FILE_SYSTEM env var
+ # is used in multiple places in the build system: get rid of the '+'s so we
+ # can use the 'for x in $FILE_SYSTEM ...' idiom
+ FILE_SYSTEM=`echo $FILE_SYSTEM|sed -e 's/\+/ /g'`
+ for x in $FILE_SYSTEM
+ do
+ found=no
+ # We could also do test -d "ad_$y" to test for known file systems
+ # based on having access to the adio code. Then adding a file
+ # system would not require changing configure to change known_filesystems
+ for y in $known_filesystems ; do
+ if test $x = $y ; then
+ found=yes
+ eval "file_system_`echo $x`=1"
+ break
+ fi
+ done
+ if test "$found" = "no" ; then
+ AC_MSG_WARN([Unknown file system $x... proceeding anyway])
+ fi
+ done
+fi
+
+#############################################
+# This PVFS2 logic is special because it's hard to get it right if it comes
+# before the known_filesystems check loop above. So we handle it down here,
+# after the loop but before the AM_CONDITIONAL m4 loop.
+#############################################
+#
+# An attempt to "do the right thing" with as little help from the end-user as
+# possible:
+# - if 'with-pvfs2' given, use that to find pvfs2-config. complain if we
+# cannot find it, as this is probably what the user would expect
+# - if we can find 'pvfs2-config' in our path, we can use it to set CFLAGS,
+# LIBS, and LDFLAGS accordingly
+# - as a fallback, use CFLAGS, LIBS, and LDFLAGS passed in by the user
+# - don't do any of this if --with-file-system was given and did not include
+# 'pvfs2': i.e. don't surprise the user with pvfs support.
+
+AC_PATH_PROG(PVFS2_CONFIG, pvfs2-config, notfound, [${with_pvfs2}/bin:$PATH])
+if test $PVFS2_CONFIG != "notfound" ; then
+ if test -n "${with_pvfs2}" -o -n "${file_system_pvfs2}" ; then
+ # the user either told us where pvfs is or asked for it in
+ # --with-file-system (or both)
+ CFLAGS="$CFLAGS $( $PVFS2_CONFIG --cflags)"
+ LIBS="$LIBS $( $PVFS2_CONFIG --libs)"
+ FILE_SYSTEM="pvfs2 $FILE_SYSTEM"
+ file_system_pvfs2=1
+ fi
+fi
+
+if test "$PVFS2_CONFIG" = "notfound" -a -n "$with_pvfs2" ; then
+ AC_MSG_ERROR([pvfs2-config not found in $with_pvfs2])
+fi
+#############################################
+
+
+# Setup an AM_CONDITIONAL named BUILD_AD_FOO for use in each adio's Makefile.mk.
+# This must come *after* the condition becomes valid, in this case after all
+# $file_system_foo variables have been set.
+#
+# If you fiddle with this, please watch the m4 quoting carefully. m4_foreach
+# expands any macros in the "list" argument exactly once. The defn bits ensure
+# that any macro names in "fs"'s value will not be expanded, such as if someone
+# is daft enough to "m4_define([ufs],[some crazy value])".
+m4_foreach([fs],[known_filesystems_m4],[
+AM_CONDITIONAL([BUILD_AD_]m4_toupper(defn([fs])),[test x$file_system_]defn([fs])[ = x1])
+])
+
+
+#
+# Print list of configured file systems
+#
+# TODO: REMOVE BAD ONES FROM THE LIST SOMEHOW?
+#
+AC_MSG_CHECKING([configured file systems])
+AC_MSG_RESULT([$FILE_SYSTEM])
+
+if test -n "$file_system_nfs" ; then
+ AC_DEFINE(ROMIO_NFS,1,[Define for ROMIO with NFS])
+ AC_MSG_WARN([File locks may not work with NFS. See the Installation and
+users manual for instructions on testing and if necessary fixing this])
+fi
+
+if test -n "$file_system_panfs"; then
+ AC_DEFINE(ROMIO_PANFS,1,[Define for ROMIO with PANFS])
+fi
+if test -n "$file_system_ufs"; then
+ AC_DEFINE(ROMIO_UFS,1,[Define for ROMIO with UFS])
+fi
+if test -n "$file_system_bgl"; then
+ AC_DEFINE(ROMIO_BGL,1,[Define for ROMIO with BGL])
+fi
+if test -n "$file_system_bglockless"; then
+ if test x"$file_system_bgl" = x ; then
+ AC_MSG_ERROR("bglockless requested without bgl")
+ fi
+ AC_DEFINE(ROMIO_BGLOCKLESS,1,[Define for lock-free ROMIO with BGL])
+fi
+if test -n "$file_system_hfs"; then
+ AC_DEFINE(ROMIO_HFS,1,[Define for ROMIO with HFS])
+fi
+if test -n "$file_system_sfs"; then
+ AC_DEFINE(ROMIO_SFS,1,[Define for ROMIO with SFS])
+fi
+
+if test -n "$file_system_pfs"; then
+ AC_DEFINE(ROMIO_PFS,1,[Define for ROMIO with PFS])
+fi
+
+if test -n "$file_system_testfs"; then
+ AC_DEFINE(ROMIO_TESTFS,1,[Define for ROMIO with TESTFS])
+fi
+#
+# Verify presence of lustre/lustre_user.h
+#
+if test -n "$file_system_lustre"; then
+ AC_CHECK_HEADERS(lustre/lustre_user.h,
+ AC_DEFINE(ROMIO_LUSTRE,1,[Define for ROMIO with LUSTRE]),
+ AC_MSG_ERROR([LUSTRE support requested but cannot find lustre/lustre_user.h header file])
+ )
+fi
+
+if test -n "$file_system_xfs"; then
+ AC_DEFINE(ROMIO_XFS,1,[Define for ROMIO with XFS])
+ # Check for memalign value
+ AC_CACHE_CHECK([for memory alignment needed for direct I/O],
+ pac_cv_memalignval,
+ [
+ rm -f confmemalignval
+ rm -f /tmp/romio_tmp.bin
+ AC_TRY_RUN([
+#include <stdio.h>
+#include <unistd.h>
+#include <fcntl.h>
+#include <stdio.h>
+int main(int argc, char **argv) {
+ struct dioattr st;
+ int fd = open("/tmp/romio_tmp.bin", O_RDWR | O_CREAT, 0644);
+ FILE *f=fopen("confmemalignval","w");
+ if (fd == -1) exit(1);
+ if (!f) exit(1);
+ fcntl(fd, F_DIOINFO, &st);
+ fprintf( f, "%u\n", st.d_mem);
+ exit(0);
+ }
+ ],
+ pac_cv_memalignval=`cat confmemalignval`,
+ pac_cv_memalignval="unknown",pac_cv_memalignval="unknown"
+ )
+ rm -f confmemalignval
+ rm -f /tmp/romio_tmp.bin
+ ])
+ if test -n "$pac_cv_memalignval" -a "$pac_cv_memalignval" != 0 -a \
+ "$pac_cv_memalignval" != "unknown" ; then
+ CFLAGS="$CFLAGS -DXFS_MEMALIGN=$pac_cv_memalignval"
+ else
+ AC_MSG_RESULT(assuming 128 for memory alignment)
+ CFLAGS="$CFLAGS -DXFS_MEMALIGN=128"
+ fi
+fi
+
+#
+# Verify presence of pvfs.h, issue with int64
+#
+if test -n "$file_system_pvfs"; then
+ CPPFLAGS="$CPPFLAGS $CFLAGS"
+ AC_CHECK_HEADERS(pvfs.h,
+ AC_DEFINE(ROMIO_PVFS,1,[Define for ROMIO with PVFS]),
+ AC_MSG_ERROR([PVFS support requested but cannot find pvfs.h header file])
+ )
+ # Check for missing int64_t (intel version 8 compiler and -no-gcc
+ # selected)
+ AC_MSG_CHECKING([that pvfs.h can be compiled])
+ AC_TRY_COMPILE([
+#include <pvfs.h>
+ ],[
+ ],pvfs_header_ok=yes,pvfs_header_ok=no
+ )
+ AC_MSG_RESULT($pvfs_header_ok)
+ if test "$pvfs_header_ok" = no -a "$ac_cv_sizeof_long_long" = 8 ; then
+ AC_MSG_CHECKING([if pvfs.h can be compiled if we define int64_t])
+ # Try again, but with int64_t
+ AC_TRY_COMPILE([
+ typedef long long int int64_t;
+#include <pvfs.h>
+ ],[
+ ],
+ pvfs_header_ok="yes with int64 definition"
+ )
+ AC_MSG_RESULT($pvfs_header_ok)
+ fi
+ if test "$pvfs_header_ok" = "yes with int64 definition" ; then
+ AC_DEFINE(ROMIO_PVFS_NEEDS_INT64_DEFINITION,1,[Define if int64_t must be defined for PVFS])
+ fi
+ if test "$pvfs_header_ok" != "no" ; then
+ AC_DEFINE(ROMIO_PVFS,1,[Define for ROMIO with PVFS])
+ AC_DEFINE(HAVE_PVFS_SUPER_MAGIC, 1, [Define if PVFS_SUPER_MAGIC defined.])
+ else
+ AC_MSG_WARN(missing or broken pvfs.h header file; disabling ROMIO PVFS support)
+ fi
+fi
+
+
+
+if test -n "$file_system_zoidfs"; then
+ AC_CHECK_HEADERS(zoidfs.h,
+ AC_DEFINE(ROMIO_ZOIDFS,1,[Define for ROMIO with ZoidFD]),
+ AC_MSG_ERROR([ZoidFS support requested but cannot find zoidfs.h header file])
+ )
+fi
+
+#
+# Verify presence of pvfs2.h
+#
+if test -n "$file_system_pvfs2"; then
+ CPPFLAGS="$CPPFLAGS $CFLAGS"
+ AC_CHECK_HEADERS(pvfs2.h,
+ AC_DEFINE(ROMIO_PVFS2,1,[Define for ROMIO with PVFS2])
+ AC_DEFINE(HAVE_PVFS2_SUPER_MAGIC, 1, [Define if PVFS2_SUPER_MAGIC defined.]),
+ AC_MSG_ERROR([PVFS2 support requested but cannot find pvfs2.h header file])
+ )
+fi
+
+# layout change after pvfs-2.6.3:
+if test -n "$file_system_pvfs2"; then
+ AC_COMPILE_IFELSE([
+ AC_LANG_SOURCE([
+#include <stdlib.h>
+#include "pvfs2.h"
+ int main(int argc, char **argv) {
+ PVFS_object_ref ref;
+ PVFS_sys_attr attr;
+ PVFS_sys_create(NULL, ref, attr, NULL, NULL, NULL, NULL);
+ return 0; }
+ ])],
+ , AC_DEFINE(HAVE_PVFS2_CREATE_WITHOUT_LAYOUT, 1,
+ [Define if PVFS_sys_create does not have layout parameter])
+ )
+fi
+
+
+if test -n "$file_system_gridftp"; then
+ AC_DEFINE(ROMIO_GRIDFTP, 1, [Define for ROMIO with gridftp])
+fi
+
+if test -n "$file_system_bgl"; then
+ SYSDEP_INC=-I${prefix}/include
+else
+ SYSDEP_INC=
+
+# Check for presence and characteristics of async. I/O calls if
+# not disabled.
+
+# Some systems need pthreads to get AIO to work. However, we don't want
+# to add pthreads just because it is there, as that can cause problems
+# with some implementations of pthreads and compilers (e.g., gcc version 3
+# would fail if there was an int a[100000] on the stack if the application
+# was *linked* with pthreads, but would succeed if the application was
+# *not linked* with pthreads.
+#
+if test "x$disable_aio" = "xno" ; then
+ AC_SEARCH_LIBS(aio_write,aio rt,aio_write_found=yes,aio_write_found=no)
+ if test "$aio_write_found" = no ; then
+ # If not found, try finding pthread_create first, and if
+ # found, try the test again.
+ AC_SEARCH_LIBS(pthread_create,pthread,foundPTHREAD=yes,foundPTHREAD=no)
+ if test "$foundPTHREAD" = yes ; then
+ AC_SEARCH_LIBS(aio_write,aio rt,aio_write_found=yes,aio_write_found=no)
+ fi
+ fi
+fi
+
+if test "x$disable_aio" = "xno" -a -n "$aio_write_found" ; then
+ AC_CHECK_HEADERS(signal.h)
+ # Just because aio.h is found by CPP doesn't mean that we can use it
+ # We try to compile it, not just read it.
+ AC_MSG_CHECKING([if aio.h exists and can be compiled])
+ AC_TRY_COMPILE([
+#include <sys/types.h>
+#include <aio.h>],
+[],have_aio_h=yes,have_aio_h=no)
+ AC_MSG_RESULT($have_aio_h)
+ if test "$have_aio_h" = yes ; then
+ AC_DEFINE(HAVE_AIO_H,1,[Define if aio.h exists and can be compiled])
+ fi
+
+ AC_MSG_CHECKING([if sys/aio.h exists and can be compiled])
+ AC_TRY_COMPILE([
+#include <sys/types.h>
+#include <sys/aio.h>],
+[],have_sys_aio_h=yes,have_sys_aio_h=no)
+ AC_MSG_RESULT($have_sys_aio_h)
+ if test "$have_sys_aio_h" = yes ; then
+ AC_DEFINE(HAVE_SYS_AIO_H,1,[Define if sys/aio.h exists and can be compiled])
+ fi
+ if test "$have_aio_h" = "no" -a "$have_sys_aio_h" = "no" ; then
+ disable_aio=yes
+ fi
+fi
+
+if test "$have_aio_h" = "yes" -o "$have_sys_aio_h" = "yes" -o "x$disable_aio" = "xno"; then
+
+ # Check that aio is available (many systems appear to have aio
+ # either installed improperly or turned off).
+ # The test is the following: if not cross compiling, try to run a
+ # program that includes a *reference* to aio_write but does not call it
+ # If the libraries are not set up correctly, then this will fail.
+
+ AC_MSG_CHECKING([whether aio routines can be used])
+ # Include aio.h and the aiocb struct (since we'll need these to
+ # actually use the aio_write interface). Note that this will
+ # fail for some pre-POSIX implementations of the aio interface
+ # (an old IBM interface needs an fd argument as well)
+ AC_TRY_RUN([
+#include <sys/types.h>
+#ifdef HAVE_SIGNAL_H
+#include <signal.h>
+#endif
+#ifdef HAVE_AIO_H
+#include <aio.h>
+#endif
+#ifdef HAVE_SYS_AIO_H
+#include <sys/aio.h>
+#endif
+ int main(int argc, char **argv)
+ {
+ struct aiocb *aiocbp;
+ if (argc > 10) aio_write(aiocbp);
+ return 0;
+ }
+ ],
+ aio_runs=yes
+ AC_MSG_RESULT(yes),
+ aio_runs=no
+ AC_MSG_RESULT(no),
+ aio_runs=no
+ AC_MSG_RESULT(no: aio routines disabled when cross compiling)
+ )
+ if test "$aio_runs" != "no" ; then
+ AC_DEFINE(ROMIO_HAVE_WORKING_AIO, 1, Define if AIO calls seem to work)
+ fi
+
+ # now about that old IBM interface...
+ # modern AIO interfaces have the file descriptor in the aiocb structure,
+ # and will set ROMIO_HAVE_STRUCT_AIOCB_WITH_AIO_FILDES. Old IBM
+ # implementations pass the file descriptor as an argument to aio_write and
+ # aio_read. AIO still works on these platforms, but we have to test with
+ # two-argument aio_write to avoid a false negative. no need to worry about
+ # the two-argument vs. one-argument aio_write and aio_read: ROMIO already
+ # uses ROMIO_HAVE_STRUCT_AIOCB_WITH_AIO_FILDES to call aio_write and
+ # aio_read correctly
+
+ AC_MSG_CHECKING([for obsolete two-argument aio_write])
+ AC_TRY_RUN([
+#include <sys/types.h>
+#ifdef HAVE_SIGNAL_H
+#include <signal.h>
+#endif
+#ifdef HAVE_AIO_H
+#include <aio.h>
+#endif
+#ifdef HAVE_SYS_AIO_H
+#include <sys/aio.h>
+#endif
+ int main(int argc, char **argv)
+ {
+ int fd;
+ struct aiocb *aiocbp;
+ if (argc > 10) aio_write(fd, aiocbp);
+ return 0;
+ }
+ ],
+ aio_two_arg_write=yes
+ AC_MSG_RESULT(yes),
+ aio_two_arg_write=no
+ AC_MSG_RESULT(no),
+ aio_two_arg_write=no
+ AC_MSG_RESULT(no: cannot test when cross-compiling)
+ )
+
+ if test "$aio_two_arg_write" != "no" -a "$aio_runs" != "yes" ; then
+ AC_DEFINE(ROMIO_HAVE_WORKING_AIO, 1, Define if AIO calls seem to work)
+ AC_DEFINE(ROMIO_HAVE_AIO_CALLS_NEED_FILEDES, 1, Define if AIO calls need file descriptor)
+ fi
+
+ AC_MSG_CHECKING([for obsolete two-argument aio_suspend])
+ AC_TRY_RUN([
+#include <sys/types.h>
+#ifdef HAVE_SIGNAL_H
+#include <signal.h>
+#endif
+#ifdef HAVE_AIO_H
+#include <aio.h>
+#endif
+#ifdef HAVE_SYS_AIO_H
+#include <sys/aio.h>
+#endif
+ int main(int argc, char **argv)
+ {
+ struct aiocb *aiocbp;
+ if (argc > 10) aio_suspend(1, &aiocbp);
+ return 0;
+ }
+ ],
+ aio_two_arg_suspend=yes
+ AC_MSG_RESULT(yes),
+ aio_two_arg_suspend=no
+ AC_MSG_RESULT(no),
+ aio_two_arg_suspend=no
+ AC_MSG_RESULT(no: cannot test when cross compiling)
+ )
+
+ if test "$aio_two_arg_suspend" != "no" -a "$aio_runs" != "yes" ; then
+ AC_DEFINE(ROMIO_HAVE_AIO_SUSPEND_TWO_ARGS, 1, Define if aio_suspend needs two arguments)
+ fi
+
+ AC_MSG_CHECKING([for aio_fildes member of aiocb structure])
+ AC_TRY_COMPILE([
+#ifdef HAVE_SIGNAL_H
+#include <signal.h>
+#endif
+#ifdef HAVE_SYS_TYPES_H
+#include <sys/types.h>
+#endif
+#ifdef HAVE_AIO_H
+#include <aio.h>
+#endif
+#ifdef HAVE_SYS_AIO_H
+#include <sys/aio.h>
+#endif
+ ],[
+ struct aiocb a;
+ a.aio_fildes = 0;
+ ],
+ AC_MSG_RESULT(yes)
+ AC_DEFINE(ROMIO_HAVE_STRUCT_AIOCB_WITH_AIO_FILDES, 1, [Define if aiocb has aio_fildes member]),
+ AC_MSG_RESULT(no)
+ )
+ AC_MSG_CHECKING(for aio_whence member of aiocb structure)
+ AC_TRY_COMPILE([
+#ifdef HAVE_SIGNAL_H
+#include <signal.h>
+#endif
+#ifdef HAVE_SYS_TYPES_H
+#include <sys/types.h>
+#endif
+#ifdef HAVE_AIO_H
+#include <aio.h>
+#endif
+#ifdef HAVE_SYS_AIO_H
+#include <sys/aio.h>
+#endif
+#include <sys/types.h>
+#include <unistd.h>
+ ],[
+ struct aiocb a;
+ a.aio_whence = SEEK_SET;
+ ],
+ AC_MSG_RESULT(yes)
+ AC_DEFINE(ROMIO_HAVE_STRUCT_AIOCB_WITH_AIO_WHENCE, 1, [Define if aiocb has aio_whence member]),
+ AC_MSG_RESULT(no)
+ )
+ AC_MSG_CHECKING(for aio_handle member of aiocb structure)
+ AC_TRY_COMPILE([
+#ifdef HAVE_SIGNAL_H
+#include <signal.h>
+#endif
+#ifdef HAVE_SYS_TYPES_H
+#include <sys/types.h>
+#endif
+#ifdef HAVE_AIO_H
+#include <aio.h>
+#endif
+#ifdef HAVE_SYS_AIO_H
+#include <sys/aio.h>
+#endif
+ ],[
+ struct aiocb a;
+ aio_handle_t h;
+
+ a.aio_handle = h;
+ ],
+ AC_MSG_RESULT(yes)
+ AC_DEFINE(ROMIO_HAVE_STRUCT_AIOCB_WITH_AIO_HANDLE, 1, [Define if aiocb has aio_handle member]),
+ AC_MSG_RESULT(no)
+ )
+ AC_MSG_CHECKING(for aio_reqprio member of aiocb structure)
+ AC_TRY_COMPILE([
+#ifdef HAVE_SIGNAL_H
+#include <signal.h>
+#endif
+#ifdef HAVE_SYS_TYPES_H
+#include <sys/types.h>
+#endif
+#ifdef HAVE_AIO_H
+#include <aio.h>
+#endif
+#ifdef HAVE_SYS_AIO_H
+#include <sys/aio.h>
+#endif
+ ],[
+ struct aiocb a;
+
+ a.aio_reqprio = 0;
+ ],
+ AC_MSG_RESULT(yes)
+ AC_DEFINE(ROMIO_HAVE_STRUCT_AIOCB_WITH_AIO_REQPRIO, 1, [Define if aiocb has aio_reqprio member]),
+ AC_MSG_RESULT(no)
+ )
+ AC_MSG_CHECKING(for aio_sigevent member of aiocb structure)
+ AC_TRY_COMPILE([
+#ifdef HAVE_SIGNAL_H
+#include <signal.h>
+#endif
+#ifdef HAVE_SYS_TYPES_H
+#include <sys/types.h>
+#endif
+#ifdef HAVE_AIO_H
+#include <aio.h>
+#endif
+#ifdef HAVE_SYS_AIO_H
+#include <sys/aio.h>
+#endif
+ ],[
+ struct aiocb a;
+
+ a.aio_sigevent.sigev_signo = 0;
+ ],
+ AC_MSG_RESULT(yes)
+ AC_DEFINE(ROMIO_HAVE_STRUCT_AIOCB_WITH_AIO_SIGEVENT, 1, [Define if aiocb has aio_sigevent member]),
+ AC_MSG_RESULT(no)
+ )
+
+fi
+fi
+# End of aio-related tests
+
+#
+# Check for statfs (many) and specifically f_fstypename field (BSD)
+#
+AC_CHECK_HEADERS(sys/vfs.h sys/param.h sys/mount.h sys/statvfs.h)
+AC_MSG_CHECKING([whether struct statfs properly defined])
+AC_TRY_COMPILE([
+#ifdef HAVE_SYS_VFS_H
+#include <sys/vfs.h>
+#endif
+#ifdef HAVE_SYS_STATVFS_H
+#include <sys/statvfs.h>
+#endif
+#ifdef HAVE_SYS_PARAM_H
+#include <sys/param.h>
+#endif
+#ifdef HAVE_SYS_MOUNT_H
+#include <sys/mount.h>
+#endif
+ ],[
+ struct statfs f;
+ ],
+ pac_cv_have_statfs=yes,pac_cv_have_statfs=no
+)
+AC_MSG_RESULT($pac_cv_have_statfs)
+# At this point, we could check for whether defining
+# __SWORD_TYPE as sizet_t or int/long (size of pointer)
+# would help. FIXME
+
+if test "$pac_cv_have_statfs" = yes ; then
+ AC_DEFINE(HAVE_STRUCT_STATFS,1,[Define if struct statfs can be compiled])
+fi
+
+AC_MSG_CHECKING([for f_fstypename member of statfs structure])
+AC_TRY_COMPILE([
+#include <sys/param.h>
+#include <sys/mount.h>
+#include <string.h>
+ ],[
+ struct statfs f;
+ memset(&f, 0, sizeof(f));
+ strncmp("nfs", f.f_fstypename, 3);
+ ],
+ pac_cv_have_statfs_f_fstypename=yes,
+ pac_cv_have_statfs_f_fstypename=no
+)
+AC_MSG_RESULT($pac_cv_have_statfs_f_fstypename)
+if test $pac_cv_have_statfs_f_fstypename = yes ; then
+ AC_DEFINE(ROMIO_HAVE_STRUCT_STATFS_WITH_F_FSTYPENAME, 1,[Define if statfs has f_fstypename])
+fi
+
+#
+# Check for stat and st_fstype field (NEC SX4)
+#
+AC_CHECK_HEADERS(sys/stat.h sys/types.h unistd.h)
+AC_CHECK_FUNCS(stat,
+ AC_DEFINE(HAVE_STAT, 1, Define if stat function is present)
+ AC_MSG_CHECKING([for st_fstype member of stat structure])
+ AC_TRY_COMPILE([
+#ifdef HAVE_SYS_TYPES_H
+#include <sys/types.h>
+#endif
+#ifdef HAVE_SYS_STAT_H
+#include <sys/stat.h>
+#endif
+#ifdef HAVE_UNISTD_H
+#include <unistd.h>
+#endif
+ ],[
+ struct stat s;
+
+ s.st_fstype = NULL;
+ ],
+ AC_MSG_RESULT(yes)
+ AC_DEFINE(ROMIO_HAVE_STRUCT_STAT_WITH_ST_FSTYPE, 1, Define if struct stat has a st_fstype member),
+ AC_MSG_RESULT(no)
+ )
+)
+
+#
+# Check for statvfs and f_basetype field (Solaris, Irix, AIX, etc.)
+#
+AC_CHECK_HEADERS(sys/types.h sys/statvfs.h sys/vfs.h)
+AC_CHECK_FUNCS(statvfs,
+ AC_DEFINE(HAVE_STATVFS, 1, Define if statvfs function is present)
+ AC_MSG_CHECKING([for f_basetype member of statvfs structure])
+ AC_TRY_COMPILE([
+#ifdef HAVE_SYS_TYPES_H
+#include <sys/types.h>
+#endif
+#ifdef HAVE_SYS_VFS_H
+#include <sys/vfs.h>
+#endif
+#ifdef HAVE_SYS_STATVFS_H
+#include <sys/statvfs.h>
+#endif
+ ], [[
+ struct statvfs foo;
+
+ foo.f_basetype[0] = 'a';
+ ]],
+ AC_MSG_RESULT(yes)
+ AC_DEFINE(ROMIO_HAVE_STRUCT_STATVFS_WITH_F_BASETYPE, 1, defined if struct statvfs has a f_basetype member),
+ AC_MSG_RESULT(no)
+ )
+)
+
+#
+# Check for large file support. Make sure that we can use the off64_t
+# type (in some cases, it is an array, and the ROMIO code isn't prepared for
+# that).
+#
+AC_CHECK_HEADERS(unistd.h)
+if test "$ac_cv_header_unistd_h" = "yes" ; then
+ AC_CACHE_CHECK([for large file defines],ac_cv_has_large_file_defines,[
+ AC_TRY_COMPILE([
+#include <unistd.h>
+ ], [
+#ifndef _LFS64_LARGEFILE
+#error no largefile defines
+#endif
+ ],ac_cv_has_large_file_defines=yes,ac_cv_has_large_file_defines=no)])
+ if test "$ac_cv_has_large_file_defines" = "yes" ; then
+ # See if we can use them
+ AC_CACHE_CHECK([whether off64_t is an scalar type],ac_cv_off64_t_scalar,[
+ AC_TRY_COMPILE([
+#define _LARGEFILE64_SOURCE
+#define _FILE_OFFSET_BITS 64
+#include <sys/types.h>
+#include <unistd.h>
+],[off64_t a = 3;],ac_cv_off64_t_scalar=yes,ac_cv_off64_t_scalar=no)])
+
+ if test "$ac_cv_off64_t_scalar" = "yes" ; then
+ CFLAGS="${CFLAGS} -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64"
+ fi
+ fi
+fi
+
+
+####################################################################
+# We're about to mess with CC etc. No more feature tests past here,
+# because we may set CC to something that does not yet exist!
+####################################################################
+
+if test -n "$mpi_mpich"; then
+ if test -z "$arch_SX4" ; then
+ MPIOF_H_INCLUDED=1
+ fi
+ if test "$FROM_MPICH2" = no; then
+ AC_DEFINE(NEEDS_MPI_TEST,1,[Define if mpi_test needed])
+ AC_DEFINE(MPICH,1,[Define if using MPICH])
+ fi
+fi
+
+if test -n "$mpi_sgi"; then
+ AC_DEFINE(MPISGI,1,[Define if SGI MPI])
+fi
+
+if test -n "$mpi_lam"; then
+ AC_DEFINE(MPILAM,1,[Define if using LAM/MPI])
+fi
+
+if test -n "$mpi_hp"; then
+ AC_DEFINE(MPIHP,1,[Define if using HP MPI])
+ if test "$NOF77" = 0; then
+ PAC_CHECK_MPIOF_H
+ fi
+fi
+#
+AC_CHECK_FUNCS(strerror)
+if test -z "$srcdir" -o "$srcdir" = "." ; then srcdir="$ROMIO_HOME" ; fi
+AC_SUBST(srcdir)
+
+# preserve these values across a config.status --recheck
+AC_ARG_VAR([master_top_srcdir],[set by the MPICH2 configure to indicate the MPICH2 source root])
+AC_ARG_VAR([master_top_builddir],[set by the MPICH2 configure to indicate the MPICH2 build root])
+
+# The master_top_srcdir is the location of the source for the building
+# package. This is used only as part of the MPICH2 build, including
+# the documentation targets mandoc, htmldoc, and latexdoc
+if test -z "$master_top_srcdir" ; then
+ if test "$FROM_MPICH2" = yes ; then
+ AC_MSG_WARN([Could not determine master_top_srcdir])
+ fi
+fi
+#
+# Get the master builddir (which may be imported from above)
+if test -z "$master_top_builddir" ; then
+ if test "$FROM_MPICH2" = yes ; then
+ # this variable is essential to proper build operation
+ AC_MSG_ERROR([Could not determine master_top_srcdir])
+ fi
+ master_top_builddir=`pwd`
+fi
+# Make sure the alternate spelling is used until we clean up all of the code
+master_topbuild_dir=$master_top_builddir
+export master_topbuild_dir
+AC_SUBST(master_topbuild_dir)
+
+# The following definitions are needed within adio/common/status_setb.c
+if test "$FROM_MPICH" = yes ; then
+ AC_DEFINE(MPICH,1,[Define if compiling within MPICH])
+elif test "$FROM_MPICH2" = yes ; then
+ AC_DEFINE(ROMIO_INSIDE_MPICH2,1,[Define if compiling within MPICH2])
+elif test "$FROM_MPILAM" = yes ; then
+ AC_DEFINE(MPILAM,1,[Define if compiling within LAM/MPI])
+fi
+
+if test "$FROM_MPICH2" = no -a "$FROM_MPICH" = no ; then
+ if test -z "$LIBNAME"; then
+ LIBNAME="$top_build_dir/lib/libmpio.a"
+ fi
+ #
+ if test ! -d $top_build_dir/lib ; then
+ mkdir $top_build_dir/lib
+ fi
+else
+ MPILIBNAME=${MPILIBNAME:-mpich}
+ if test -z "$LIBNAME" ; then
+ if test -d "$master_top_builddir/lib" ; then
+ LIBNAME=$master_top_builddir/lib/lib${MPILIBNAME}.a
+ else
+ LIBNAME="$ROMIO_HOME/lib${MPILIBNAME}.a"
+ fi
+ fi
+fi
+if test "$FROM_MPICH2" != no ; then
+ # use the error handlers from MPICH2
+ MPIO_EXTRA_OBJECTS=
+ MPIO_EXTRA_TMP_POBJECTS=
+ MPIO_EXTRA_REAL_POBJECTS=
+ # Use generalized request to get the multiple-completion routines
+ MPIO_REQOBJECTS=
+fi
+AC_SUBST(MPIO_EXTRA_OBJECTS)
+AC_SUBST(MPIO_EXTRA_TMP_POBJECTS)
+AC_SUBST(MPIO_EXTRA_REAL_POBJECTS)
+#
+# Use DOCTEXT instead of doctext
+AC_CHECK_PROGS(DOCTEXT,doctext,true)
+AC_SUBST(DOCTEXT)
+#
+if test $NOF77 = 1 ; then
+ F77=":"
+else
+ FORTRAN_TEST="fperf fcoll_test fmisc pfcoll_test"
+fi
+#
+if test $WITHIN_KNOWN_MPI_IMPL = no ; then
+ PAC_TEST_MPI
+ PAC_NEEDS_FINT
+else
+ NEEDS_MPI_FINT=""
+fi
+#
+if test "$MPI_INCLUDE_DIR" = "." ; then
+ ROMIO_INCLUDE="-I../include"
+else
+ ROMIO_INCLUDE="-I../include -I$MPI_INCLUDE_DIR"
+fi
+#
+TEST_LIBNAME=$LIBNAME
+MPIRUN=mpirun
+#
+# if MPICH, use mpicc in test programs
+#
+if test "$FROM_MPICH" = yes ; then
+ MPICH_HOME=`dirname $ROMIO_HOME`
+ if test -z "$MPI_BIN_DIR" ; then MPI_BIN_DIR=$MPICH_HOME/bin ; fi
+ TEST_CC=$MPI_BIN_DIR/mpicc
+ MPI_LIB=""
+ ROMIO_INCLUDE=""
+ USER_CFLAGS=""
+ USER_FFLAGS=""
+ TEST_LIBNAME=""
+ MPIRUN=$MPI_BIN_DIR/mpirun
+ if test -n "$arch_SX4" || test -n "$arch_hpux" ; then
+ TEST_F77=$MPI_BIN_DIR/mpif90
+ else
+ TEST_F77=$MPI_BIN_DIR/mpif77
+ fi
+ CC=$MPI_BIN_DIR/mpicc
+ # A later test will insert the mpi2-other/info and array directories based
+ # on the value of BUILD_MPI_xxxx. This lets MPICH2 turn these off,
+ # since MPICH2 provides these routines elsewhere
+ EXTRA_DIRS="mpi-io/fortran"
+ # Some older implementations of the ADI do not include the
+ # MPID_Status_set_bytes routine. This uses either the
+ # environment variable ADI3_WITHOUT_SET_BYTES or the
+ # with arg --without-setbytes
+ if test "$ADI2_WITHOUT_SET_BYTES" != yes -a \
+ "$with_setbytes" != no ; then
+ AC_DEFINE(HAVE_STATUS_SET_BYTES,1,[Define if have MPIR_Status_set_bytes])
+ fi
+elif test $FROM_LAM = yes ; then
+ # LAM does have the status set bytes functionality
+ AC_DEFINE(HAVE_STATUS_SET_BYTES,1,[Define if have MPIR_Status_set_bytes])
+
+ # Used in the tests/ subdirectory for after ROMIO is built
+ TEST_CC=mpicc
+ TEST_F77=mpif77
+ MPIRUN=mpirun
+ MPI_LIB=
+ ROMIO_INCLUDE=
+ USER_CFLAGS=
+ USER_FFLAGS=
+ TEST_LIBNAME=
+ EXTRA_DIRS="mpi-io/fortran mpi2-other/info mpi2-other/info/fortran mpi2-other/array mpi2-other/array/fortran"
+elif test $FROM_MPICH2 = yes ; then
+ # For now, separate the mpich2 from mpich cases
+ MPICH_HOME=`dirname $ROMIO_HOME`
+ MPICH_HOME=`dirname $MPICH_HOME`
+ MPICH_HOME=`dirname $MPICH_HOME`
+ if test -z "$MPI_BIN_DIR" ; then MPI_BIN_DIR=$MPICH_HOME/bin ; fi
+ # No special compiler script.
+ # BUT we need the include paths
+ # CC="$CC -I${use_top_srcdir}/src/include -I${top_build_dir}/src/include"
+ # TEST_CC="$CC"
+ # MPI_LIB="$LIBNAME"
+ # To allow ROMIO to work with the LIBTOOL scripts, we want to
+ # work directly with the CC, not the mpicc, compiler.
+ # Note that in the "FROM_MPICH2" case, the CPPFLAGS and INCLUDES are already
+ # properly set
+ #CC=${top_build_dir}/bin/mpicc
+ #
+ # set the compilers to the ones in MPICH2 bin directory (master_top_builddir/bin)
+ TEST_CC='$(bindir)/mpicc'
+ TEST_F77='$(bindir)/mpif77'
+ MPI_H_INCLUDE="-I${master_top_builddir}/src/include"
+ ROMIO_INCLUDE=""
+ USER_CFLAGS=""
+ USER_FFLAGS=""
+ TEST_LIBNAME=""
+ MPIRUN='$(bindir)/mpiexec'
+ #
+ # Turn off the building of the Fortran interface and the Info routines
+ EXTRA_DIRS=""
+ AC_DEFINE(HAVE_STATUS_SET_BYTES,1,[Define if status_set_bytes available])
+ DEFINE_HAVE_MPI_GREQUEST="#define HAVE_MPI_GREQUEST 1"
+ AC_DEFINE(HAVE_MPIU_FUNCS,1,[Define if MPICH2 memory tracing macros defined])
+fi
+#
+#
+# feature tests: we can't test features if building as part of MPICH because
+# we don't yet have an implementation against which we can test
+#
+if test $WITHIN_KNOWN_MPI_IMPL = no ; then
+ PAC_TEST_MPIR_STATUS_SET_BYTES
+ PAC_TEST_MPI_GREQUEST
+ PAC_TEST_MPIU_FUNCS
+ AC_DEFINE(PRINT_ERR_MSG,1,[Define for printing error messages])
+fi
+#
+if test -z "$TEST_CC" ; then
+ TEST_CC="$CC"
+fi
+if test -z "$TEST_F77" ; then
+ TEST_F77="$F77"
+fi
+#
+AC_CHECK_FUNCS(strdup)
+if test "$ac_cv_func_strdup" = "yes" ; then
+ # Do we need to declare strdup?
+ PAC_FUNC_NEEDS_DECL([#include <string.h>],strdup)
+fi
+AC_CHECK_FUNCS(snprintf)
+if test "$ac_cv_func_snprintf" = "yes" ; then
+ # Do we need to declare snprintf?
+ PAC_FUNC_NEEDS_DECL([#include <stdio.h>],snprintf)
+fi
+AC_CHECK_FUNCS(lstat)
+if test "$ac_cv_func_lstat" = "yes" ; then
+ # Do we need to declare lstat?
+ PAC_FUNC_NEEDS_DECL([#include <unistd.h>],lstat)
+fi
+AC_CHECK_FUNCS(readlink)
+if test "$ac_cv_func_readlink" = "yes" ; then
+ # Do we need to declare readlink?
+ PAC_FUNC_NEEDS_DECL([#include <unistd.h>],readlink)
+fi
+AC_CHECK_FUNCS(fsync)
+if test "$ac_cv_func_fsync" = "yes" ; then
+ # Do we need to declare fsync?
+ PAC_FUNC_NEEDS_DECL([#include <unistd.h>],fsync)
+fi
+AC_CHECK_FUNCS(ftruncate)
+if test "$ac_cv_func_ftruncate" = "yes" ; then
+ # Do we need to declare ftruncate?
+ PAC_FUNC_NEEDS_DECL([#include <unistd.h>],ftruncate)
+fi
+
+AC_CHECK_FUNCS(lseek64)
+if test "$ac_cv_func_lseek64" = "yes" ; then
+ PAC_FUNC_NEEDS_DECL([#include <unistd.h>],lseek64)
+fi
+#
+# Create the directory lists for the Makefile
+FILE_SYS_DIRS=""
+for dir in $FILE_SYSTEM ; do
+ FILE_SYS_DIRS="$FILE_SYS_DIRS adio/ad_$dir"
+done
+# FIXME eliminate FILE_SYS_DIRS and EXTRA_SRC_DIRS
+EXTRA_SRC_DIRS=""
+
+mpio_glue=""
+if test "$FROM_MPICH2" = yes -o "${MPI_IMPL}_mpi" = "mpich2_mpi"; then
+ mpio_glue=mpich2
+elif test "$FROM_MPICH" = yes -o "${MPI_IMPL}_mpi" = "mpich_mpi"; then
+ mpio_glue=mpich1
+else
+ mpio_glue=default
+fi
+
+AM_CONDITIONAL([MPIO_GLUE_MPICH2],[test "X$mpio_glue" = "Xmpich2"])
+AM_CONDITIONAL([MPIO_GLUE_MPICH1],[test "X$mpio_glue" = "Xmpich1"])
+AM_CONDITIONAL([MPIO_GLUE_DEFAULT],[test "X$mpio_glue" = "Xdefault"])
+
+if test "$BUILD_MPI_INFO" = 1 ; then
+ EXTRA_SRC_DIRS="$EXTRA_SRC_DIRS mpi2-other/info"
+ if test "$NOF77" = 0 -a "$FROM_MPICH2" != yes ; then
+ EXTRA_SRC_DIRS="$EXTRA_SRC_DIRS mpi2-other/info/fortran"
+ fi
+fi
+if test "$BUILD_MPI_ARRAY" = 1 ; then
+ EXTRA_SRC_DIRS="$EXTRA_SRC_DIRS mpi2-other/array"
+ if test "$NOF77" = 0 -a "$FROM_MPICH2" != yes ; then
+ EXTRA_SRC_DIRS="$EXTRA_SRC_DIRS mpi2-other/array/fortran"
+ fi
+fi
+if test "$NOF77" = 0 -a "$FROM_MPICH2" != yes ; then
+ EXTRA_SRC_DIRS="$EXTRA_SRC_DIRS mpi-io/fortran"
+fi
+AC_SUBST(EXTRA_SRC_DIRS)
+AC_SUBST(FILE_SYS_DIRS)
+
+#
+CFLAGS="$CFLAGS -DHAVE_ROMIOCONF_H"
+#
+
+if test -n "$MPIOF_H_INCLUDED"; then
+ F77MPIOINC=""
+else
+ F77MPIOINC="include 'mpiof.h'"
+fi
+
+AC_CHECK_HEADERS(unistd.h,
+ AC_MSG_CHECKING([for large file defines])
+ AC_TRY_COMPILE([
+ #include <unistd.h>
+ ], [
+ #ifndef _LFS64_LARGEFILE
+ #error no largefile defines
+ #endif
+ ],
+ CFLAGS="${CFLAGS} -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64"
+ AC_MSG_RESULT(yes),
+ AC_MSG_RESULT(none) )
+ )
+
+echo "setting SYSDEP_INC to $SYSDEP_INC"
+AC_SUBST(SYSDEP_INC)
+
+AC_C_RESTRICT
+PAC_C_GNU_ATTRIBUTE
+
+# support gcov test coverage information
+PAC_ENABLE_COVERAGE
+
+echo "setting CC to $CC"
+echo "setting F77 to $F77"
+echo "setting TEST_CC to $TEST_CC"
+echo "setting TEST_F77 to $TEST_F77"
+echo "setting CFLAGS to $CFLAGS"
+echo "setting USER_CFLAGS to $USER_CFLAGS"
+echo "setting USER_FFLAGS to $USER_FFLAGS"
+
+AC_SUBST(ARCH)
+AC_SUBST(FILE_SYSTEM)
+AC_SUBST(CC)
+AC_SUBST(CPPFLAGS)
+AC_SUBST(CFLAGS)
+AC_SUBST(USER_CFLAGS)
+AC_SUBST(USER_FFLAGS)
+AC_SUBST(MIPS)
+AC_SUBST(BITS)
+AC_SUBST(AR)
+AC_SUBST(AR_FLAGS)
+AC_SUBST(MPI_INCLUDE_DIR)
+AC_SUBST(MPI_LIB)
+AC_SUBST(F77)
+AC_SUBST(NOF77)
+AC_SUBST(NOPROFILE)
+AC_SUBST(MAKE)
+AC_SUBST(arch_IRIX)
+AC_SUBST(ROMIO_HOME)
+AC_SUBST(LIBNAME)
+AC_SUBST(TEST_LIBNAME)
+AC_SUBST(LL)
+AC_SUBST(F77GETARG)
+AC_SUBST(F77IARGC)
+AC_SUBST(F77MPIOINC)
+AC_SUBST(FTESTDEFINE)
+AC_SUBST(FORTRAN_MPI_OFFSET)
+AC_SUBST(FROM_MPICH)
+AC_SUBST(FROM_MPICH2)
+AC_SUBST(FROM_LAM)
+AC_SUBST(WITHIN_KNOWN_MPI_IMPL)
+AC_SUBST(NEEDS_MPI_FINT)
+AC_SUBST(HAVE_MPI_INFO)
+AC_SUBST(BUILD_MPI_INFO)
+AC_SUBST(HAVE_MPI_DARRAY_SUBARRAY)
+AC_SUBST(BUILD_MPI_ARRAY)
+AC_SUBST(DEFINE_MPI_OFFSET)
+AC_SUBST(DEFINE_HAVE_MPI_GREQUEST)
+AC_SUBST(MPI_OFFSET_TYPE)
+AC_SUBST(MPI_FINFO1)
+AC_SUBST(MPI_FINFO2)
+AC_SUBST(MPI_FINFO3)
+AC_SUBST(MPI_FINFO4)
+AC_SUBST(MPI_FARRAY1)
+AC_SUBST(MPI_FARRAY2)
+AC_SUBST(MPI_FARRAY3)
+AC_SUBST(MPI_FARRAY4)
+AC_SUBST(MPI_FARRAY5)
+AC_SUBST(MPI_FARRAY6)
+AC_SUBST(MPI_FARRAY7)
+AC_SUBST(MPI_OFFSET_KIND1)
+AC_SUBST(MPI_OFFSET_KIND2)
+AC_SUBST(TEST_CC)
+AC_SUBST(TEST_F77)
+AC_SUBST(ROMIO_INCLUDE)
+AC_SUBST(ROMIO_LFLAGS)
+AC_SUBST(ROMIO_TCFLAGS)
+AC_SUBST(ROMIO_TCPPFLAGS)
+AC_SUBST(ROMIO_TFFLAGS)
+AC_SUBST(MPIRUN)
+AC_SUBST(FORTRAN_TEST)
+dnl
+dnl Dependency handling
+AC_SUBST(MAKE_DEPEND_C)
+dnl
+dnl Support shared libraries
+if test -z "$ENABLE_SHLIB" ; then
+ ENABLE_SHLIB=none
+fi
+AC_SUBST(ENABLE_SHLIB)
+AC_SUBST(CC_SHL)
+AC_SUBST(LIBTOOL)
+# Remove the .a from the library file name (so that we can use .so or
+# other appropriate suffix)
+SHLIBNAME=`echo $LIBNAME | sed 's/\.a$//'`
+AC_SUBST(SHLIBNAME)
+dnl
+if test ! -d adio ; then mkdir adio ; fi
+if test ! -d adio/include ; then mkdir adio/include ; fi
+if test ! -d mpi2-other ; then mkdir mpi2-other ; fi
+if test ! -d mpi-io ; then mkdir mpi-io ; fi
+if test ! -d mpi-io/glue ; then mkdir mpi-io/glue ; fi
+
+# Create makefiles for all of the adio devices. Only the ones that
+# are active will be called by the top level ROMIO make
+AC_OUTPUT_COMMANDS([chmod 755 util/romioinstall test/runtests])
+AC_CONFIG_FILES([
+ Makefile
+ localdefs
+ mpi2-other/info/Makefile
+ mpi2-other/array/Makefile
+ test/Makefile
+ test/misc.c
+ test/large_file.c
+ test/runtests
+ test-internal/Makefile
+ util/romioinstall
+ include/mpio.h
+ include/mpiof.h
+ mpi2-other/info/fortran/Makefile
+ mpi2-other/array/fortran/Makefile
+ test/fmisc.f
+ test/fcoll_test.f
+ test/pfcoll_test.f
+ test/fperf.f
+])
+AC_OUTPUT
+
+#
+rm -f *.o
+
+if test $FROM_MPICH = no -a $FROM_MPICH2 = no ; then
+ AC_MSG_RESULT([Configure done. Now type make.])
+fi
+dnl PAC_SUBDIR_CACHE_CLEANUP
+exit 0
Deleted: mpich2/trunk/src/mpi/romio/configure.in
===================================================================
--- mpich2/trunk/src/mpi/romio/configure.in 2012-02-28 23:25:23 UTC (rev 9547)
+++ mpich2/trunk/src/mpi/romio/configure.in 2012-02-28 23:26:34 UTC (rev 9548)
@@ -1,2233 +0,0 @@
-# -*- Mode: shell-script -*-
-# build with
-# autoconf --localdir=../confdb configure.in
-# (or wherever the confdb is)
-#
-AC_PREREQ([2.63])
-
-m4_include([version.m4])
-dnl 2nd arg is intentionally underquoted
-AC_INIT([ROMIO],
- MPICH2_VERSION_m4,
- [mpich-discuss at mcs.anl.gov],
- [romio],
- [http://www.mcs.anl.gov/research/projects/mpich2/])
-
-dnl AC_CONFIG_AUX_DIR(../../../confdb)
-dnl Set the directory that contains the required install-sh, config.sub,
-dnl and config.guess . Make sure that these are updated (in MPICH2, use
-dnl the top-level confdb files). This separate directory is used for
-dnl the moment to allow ROMIO to be separatedly distributed.
-dnl scripts.
-AC_CONFIG_AUX_DIR([confdb])
-AC_CONFIG_MACRO_DIR([confdb])
-
-AM_INIT_AUTOMAKE([-Wall -Werror foreign 1.11 silent-rules subdir-objects])
-AM_MAINTAINER_MODE([enable])
-LT_INIT([])
-# Non-verbose make by default
-m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
-
-# VERSION=1.2.6
-# AC_MSG_RESULT([Configuring ROMIO Version $VERSION])
-CONFIGURE_ARGS="$*"
-if test -n "$CONFIGURE_ARGS" ; then
- echo "Configuring with args $CONFIGURE_ARGS"
-fi
-
-AC_CONFIG_HEADER(adio/include/romioconf.h)
-AH_TOP([/*
- * (C) 2011 by Argonne National Laboratory.
- * See COPYRIGHT in top-level directory.
- */
-#ifndef ROMIOCONF_H_INCLUDED
-#define ROMIOCONF_H_INCLUDED
-])
-AH_BOTTOM([
-/* quash PACKAGE and PACKAGE_* vars, see MPICH2 top-level configure.in for
- * more info */
-#include "nopackage.h"
-
-#endif /* !defined(ROMIOCONF_H_INCLUDED) */
-])
-
-dnl
-NOF77=0
-NOF90=0
-ARCH=""
-arch_IRIX=""
-MPI_IMPL=""
-MPI_INCLUDE_DIR=""
-ROMIO_INCLUDE=""
-
-# Used by the new build system, should contain zero or more "-Iblah" args for
-# inclusion in AM_CPPFLAGS. Should not contain relative paths. This probably
-# overlaps with ROMIO_INCLUDE some, but adding a new var is easier than teasing
-# apart all of the current usages of that variable and re-testing all of the
-# non-MPICH2 and exotic platform cases.
-MPI_H_INCLUDE=""
-AC_SUBST([MPI_H_INCLUDE])
-
-TEST_LIBNAME=""
-FILE_SYSTEM=""
-# Do not set variables to empty that may be communicated from the
-# outside environment (e.g., MPI_LIB, MPI_BIN_DIR, LIBNAME)
-DEBUG=no
-MIPS=0
-BITS=0
-
-AC_ARG_VAR([FROM_MPICH],[set to "yes" if building ROMIO inside of MPICH])
-AC_ARG_VAR([FROM_MPICH2],[set to "yes" if building ROMIO inside of MPICH2])
-FROM_MPICH=${FROM_MPICH:-no}
-FROM_MPICH2=${FROM_MPICH2:-no}
-if test "$FROM_MPICH" = yes -a "$FROM_MPICH2" = yes ; then
- AC_MSG_WARN([Both FROM_MPICH and FROM_MPICH2 set to yes; at most one should be yes])
-fi
-
-AC_ARG_VAR([FROM_LAM],[set to "yes" if building ROMIO inside of LAM])
-FROM_LAM=${FROM_LAM:-no}
-if test "$FROM_LAM" = 1 ; then FROM_LAM=yes ; fi
-
-CFLAGS=${CFLAGS:-""}
-LL="lld"
-AR_LOCAL=""
-DEFINE_HAVE_MPI_GREQUEST="#undef HAVE_MPI_GREQUEST"
-HAVE_MPI_INFO=""
-BUILD_MPI_INFO=""
-MPI_FINFO1=""
-MPI_FINFO2=""
-MPI_FINFO3=""
-MPI_FINFO4=""
-MPI_FARRAY1=""
-MPI_FARRAY2=""
-MPI_FARRAY3=""
-MPI_FARRAY4=""
-MPI_FARRAY5=""
-MPI_FARRAY6=""
-MPI_FARRAY7=""
-DEFS=""
-ROMIO_LFLAGS=""
-ROMIO_TCFLAGS=""
-ROMIO_TCPPFLAGS=""
-ROMIO_TFFLAGS=""
-NOPROFILE=0
-MPIRUN=""
-FORTRAN_TEST=""
-MAKE=${MAKE:-"make"}
-# foll. needed for f77 test programs
-F77GETARG="call getarg(i,str)"
-F77IARGC="iargc()"
-F77MPIOINC=""
-FTESTDEFINE=""
-FORTRAN_MPI_OFFSET=""
-MPIOF_H_INCLUDED=0
-MPI_OFFSET_KIND1="!"
-MPI_OFFSET_KIND2="!"
-TEST_CC=""
-TEST_F77=""
-TRY_WEAK_SYMBOLS=1
-#
-have_aio=no
-#
-known_mpi_impls="mpich2_mpi mpich_mpi sgi_mpi hp_mpi cray_mpi lam_mpi"
-
-dnl An m4 macro for use with m4_foreach_w and friends. You should modify this
-dnl list if you want to add a known file system. The list is just whitespace
-dnl separated, so you can use newlines and tabs as well.
-m4_define([known_filesystems_m4_w],
- [nfs ufs pfs pvfs pvfs2 testfs xfs panfs gridftp lustre bgl bglockless zoidfs hfs piofs sfs])dnl
-dnl
-dnl An m4 macro for use with m4_foreach and friends. Expands to a quoted list of
-dnl quoted elements. A bit easier to use without unintended expansion than the
-dnl whitespace version.
-m4_define([known_filesystems_m4], m4_dquote(m4_map_args_w(m4_defn([known_filesystems_m4_w]),[],[],[,])))dnl
-dnl
-# a shell var for checking arguments given via --with-file-system=...
-known_filesystems="m4_join([ ],known_filesystems_m4)"
-
-#####################################################################
-
-#
-# Defaults
-AC_ARG_ENABLE(aio,[
---enable-aio - Request use of asynchronous I/O routines (default)],
-[
- if test "x$enableval" = "xno" ; then
- disable_aio=yes
- else
- disable_aio=no
- fi
-], disable_aio=no)
-AC_ARG_ENABLE(echo,
-[--enable-echo - Turn on strong echoing. The default is enable=no.] ,set -x)
-AC_ARG_ENABLE(f77,
-[--enable-f77 - Turn on support for Fortran 77 (default)],,enable_f77=yes)
-AC_ARG_ENABLE(f90,
-[--enable-f90 - Turn on support for Fortran 90 (default)],,enable_f90=yes)
-AC_ARG_ENABLE(weak-symbols,
-[--enable-weak-symbols - Turn on support for weak symbols],,enable_weak_symbols=yes)
-AC_ARG_ENABLE(debug,
-[--enable-debug - Build a debugging version],,)
-AC_ARG_WITH(file-system,[
---with-file-system=name - Build with support for the named file systems],,)
-AC_ARG_WITH(pvfs2,[
---with-pvfs2=path - Path to installation of PVFS (version 2)],,)
-AC_ARG_WITH(mpi-impl,[
---with-mpi-impl=name - Specify MPI implementation to build ROMIO for],,)
-dnl
-AC_ARG_WITH(mpi, [
---with-mpi=path - Path to instalation of MPI (headers, libs, etc)],,)
-dnl
-if test "$enable_f77" != "yes" ; then
- NOF77=1
-fi
-if test "$enable_f90" != "yes" ; then
- NOF90=1
-fi
-if test "$enable_debug" = "yes" ; then
- DEBUG=yes
-fi
-if test "$enable_weak_symbols" = "no" ; then
- TRY_WEAK_SYMBOLS=0
-fi
-MPI=$with_mpi
-if test -n "$with_mpi"; then
- CC=$MPI/bin/mpicc
-fi
-
-# start with the set of file systems that the user asked for
-FILE_SYSTEM=$with_file_system
-
-
-# Check if Make is working
-PAC_PROG_MAKE
-#
-# Check that an arch was set
-# If it wasn't set, try to guess using "util/tarch"
-#
-# Sometimes tarch looses its execute bit (!)
-if test -s $srcdir/util/tarch -a ! -x $srcdir/util/tarch ; then
- chmod a+x $srcdir/util/tarch
-fi
-if test -z "$ARCH" -a -x $srcdir/util/tarch ; then
- AC_MSG_CHECKING(for architecture)
- ARCH=`$srcdir/util/tarch | sed s/-/_/g`
- if test -z "$ARCH" ; then
- AC_MSG_RESULT(Unknown!)
- AC_MSG_ERROR([Error: Could not guess target architecture, you must
-set an architecture type with the environment variable ARCH])
- fi
- eval "arch_$ARCH=1"
- AC_MSG_RESULT($ARCH)
-fi
-#
-# check for valid architecture. Use __ so that _ALPHA_ does not match
-# LINUX_ALPHA_
-#### WE SHOULD REMOVE THIS SOON
-grep __"$ARCH"_ $srcdir/.config_params > /dev/null 2>&1
-if test $? != 0 ; then
- AC_MSG_WARN([Unknown architecture $arch... proceeding anyway])
-fi
-#
-#
-# Find the home directory if not specified
-if test "X$srcdir" != "X." -a -s $srcdir/mpi-io/Makefile.in ; then
- ROMIO_HOME_TRIAL=$srcdir
-else
- # Take advantage of autoconf2 features
- if test -n "$ac_confdir" ; then
- ROMIO_HOME_TRIAL=$ac_confdir
- else
- if test -s configure ; then
- ROMIO_HOME_TRIAL=`pwd`
- else
- ac_confdir=`dirname "$0" 2>/dev/null`
- if test -n "$ac_confdir" ; then
- ROMIO_HOME_TRIAL=$ac_confdir
- fi
- fi
- fi
-fi
-AC_MSG_RESULT([ROMIO home directory is $ROMIO_HOME_TRIAL])
-ROMIO_HOME=$ROMIO_HOME_TRIAL
-
-# get a fully qualified pathname for our build directory
-top_build_dir=`pwd`
-# used in romioinstall
-AC_SUBST(top_build_dir)
-
-#
-# Create the "autoconf" style directory names...
-# Most of these are done for us; add the documentation directories
-#
-# mandir is the root for the man pages
-if test -z "$mandir" ; then mandir='${prefix}/man' ; fi
-AC_SUBST(mandir)
-if test -z "$docdir" ; then docdir='${prefix}/doc' ; fi
-AC_SUBST(docdir)
-if test -z "$htmldir" ; then htmldir='${prefix}/www' ; fi
-AC_SUBST(htmldir)
-
-
-# If we are building within a known MPI implementation, we must avoid the
-# tests about an existing implementation
-if test "$FROM_MPICH" != no -o "$FROM_MPICH2" != no -o "$FROM_LAM" != no ; then
- WITHIN_KNOWN_MPI_IMPL=yes
-else
- WITHIN_KNOWN_MPI_IMPL=no
-fi
-# check for valid MPI implementation
-if test -n "$MPI_IMPL" ; then
- found=no
- for mpi in $known_mpi_impls ; do
- if test "${MPI_IMPL}_mpi" = "$mpi" ; then
- found=yes
- break
- fi
- done
- if test $found = no ; then
- AC_MSG_WARN([Unknown MPI implementation $MPI... proceeding anyway])
- fi
-fi
-#
-
-if test -n "${with_mpi}" ; then
- MPI_INCLUDE_DIR="${with_mpi}"/include
- MPI_LIB_DIR="${with_mpi}"/lib
-fi
-
-# check for valid MPI include directory if specified
-if test $WITHIN_KNOWN_MPI_IMPL = no ; then
- if test -n "$MPI_INCLUDE_DIR"; then
- if test ! -f "$MPI_INCLUDE_DIR/mpi.h" ; then
- AC_MSG_ERROR([Include file $MPI_INCLUDE_DIR/mpi.h not found])
- fi
- else
-# assume that mpi.h is in the default path
-# set MPI_INCLUDE_DIR to ".", so that it translates to -I. in the
-# compile command. Some compilers complain if it's only -I
- MPI_INCLUDE_DIR=.
- fi
-else
- MPI_INCLUDE_DIR=.
-fi
-#
-# check for valid MPI library if specified
-if test $WITHIN_KNOWN_MPI_IMPL = no ; then
- if test -n "$MPI_LIB" ; then
- if test ! -f "$MPI_LIB" ; then
- AC_MSG_ERROR([MPI library $MPI_LIB not found])
- fi
- fi
-fi
-
-# USER_CFLAGS and USER_FFLAGS are used only in test/Makefile.in
-if test $DEBUG = "yes"; then
- USER_CFLAGS="$CFLAGS -g"
- USER_FFLAGS="$FFLAGS -g"
-else
- USER_CFLAGS="$CFLAGS -O"
- USER_FFLAGS="$FFLAGS -O"
-fi
-#
-# Here begin the architecture-specific tests.
-# --------------------------------------------------------------------------
-# We must first select the C and Fortran compilers. Because of the
-# way that the PROG_CC autoconf macro works (and all of the macros that
-# require it, including CHECK_HEADERS), that macro must occur exactly
-# once in the configure.in file, at least as of autoconf 2.57 .
-# Unfortunately, this requirement is not enforced. To handle this,
-# we first case on the architecture; then use PROG_CC, then case on the
-# architecture again for any arch-specific features. We also set the
-# C_DEBUG_FLAG and F77_DEBUG_FLAG in case debugging is selected.
-#
-# For the MPICH and MPICH2 configures, the compilers will already be
-# selected, so most of the compiler-selection code will be bypassed.
-# --------------------------------------------------------------------------
-# For historical reasons
-if test -z "$FC" ; then
- FC=$F77
-fi
-#
-C_DEBUG_FLAG="-g"
-F77_DEBUG_FLAG="-g"
-# C_OPT_FLAG=${CFLAGS:-"-O"}
-# MPICH1 uses OPTFLAGS and OPTFLAGSC to specify separate optimization
-# flags for the C compiler (this is better that adding it to the
-# undifferentiated CFLAGS, at least on input).
-if test -n "$OPTFLAGS" ; then
- C_OPT_FLAG="$C_OPT_FLAG $OPTFLAGS"
-fi
-if test -n "$OPTFLAGSC" ; then
- C_OPT_FLAG="$C_OPT_FLAG $OPTFLAGSC"
-fi
-case $ARCH in
- solaris|solaris86)
- CC=${CC:-cc}
- F77=${FC:-f77}
- if test "$CC" != "gcc" ; then
- C_DEBUG_FLAG="-g -v"
- fi
- ;;
-
- rs6000)
- F77=${FC}
- # Try to use mpcc if no CC specified
- AC_PROGRAMS_CHECK(CC, mpcc, cc)
- if test $NOF77 = 0 && test -z "$F77"; then
- AC_PROGRAMS_CHECK(F77, mpxlf, f77)
- fi
- ;;
-
- tflop|tflops)
- CC=${CC:-pgcc}
- F77=${FC:-pgf77}
- CFLAGS="$CFLAGS -cougar -D__PUMA"
- if test "$CC" = "pgcc" ; then
- C_OPT_FLAG="-Knoieee -Mvect -O3"
- fi
- ;;
-
- freebsd|LINUX|netbsd|openbsd|LINUX_ALPHA)
- CC=${CC:-gcc}
- # Let the prog_f77 file g77/f77/others
- F77=${FC}
- ;;
-
- SX4)
- CC=${CC:-mpicc}
- F77=${FC:-mpif90}
- if test $DEBUG != "yes" ; then
- USER_FFLAGS="$FFLAGS -Chopt"
- F77_OPT_FLAG="-Chopt"
- fi
- ;;
-
- hpux|sppux)
- C_DEBUG_FLAG="-g +w1"
- ;;
-
- alpha|ALPHA)
- CC=${CC:-cc}
- F77=${FC:-f77}
- dnl CFLAGS="$CFLAGS -g -std1 -warnprotos -verbose"
- C_DEBUG_FLAG="-g -verbose"
- ;;
-
- CRAY)
- CC=${CC:-cc}
- F77=${FC:-f90}
- NOF77=1
- CFLAGS="$CFLAGS -D_UNICOS"
- ;;
-
- sgi|IRIX64|IRIX32|IRIXN32)
- arch_IRIX=1
- CC=${CC:-cc}
- F77=${FC:-f77}
- C_DEBUG_FLAG="-g -fullwarn"
- ;;
-
- sgi5)
- ;;
-
- *)
- # Fall-through case. Take FC
- F77=${FC:-f77}
- ;;
-esac
-
-PAC_PROG_CC
-
-dnl AC_PROG_{CXX,F77,FC} must come early in configure.in in order to control
-dnl compiler search order and avoid some esoteric autoconf macro expansion
-dnl errors
-if test "$enable_f77" = "yes" ; then
- # suppress default "-g -O2" from AC_PROG_F77
- : ${FFLAGS=""}
- AC_PROG_F77([PAC_F77_SEARCH_LIST])
-fi
-if test "$enable_f90" = "yes" ; then
- # suppress default "-g -O2" from AC_PROG_FC
- : ${FCFLAGS=""}
- AC_PROG_FC([PAC_FC_SEARCH_LIST])
-fi
-
-if test "$CC" = "gcc" -a -z "$C_DEBUG_FLAG" ; then
- C_DEBUG_FLAG="-g -O -Wall -Wstrict-prototypes -Wmissing-prototypes"
-fi
-if test $DEBUG = "yes" ; then
- CFLAGS="$CFLAGS $C_DEBUG_FLAG"
-else
- CFLAGS="$CFLAGS $C_OPT_FLAG"
-fi
-# ---------------------------------------------------------------------------
-# Here go the rest of the tests
-# ---------------------------------------------------------------------------
-if test -n "$arch_solaris" || test -n "$arch_solaris86" ; then
- if test -z "$MPI_IMPL" ; then
- MPI_IMPL=mpich
- mpi_mpich=1
- fi
- if test $MPI_IMPL = "mpich" ; then
- TEST_CC=mpicc
- TEST_F77=mpif77
- else
- TEST_CC="$CC"
- TEST_F77="$F77"
- fi
- AR="ar cr"
-# solaris does not have l option to ar
-fi
-
-
-if test -n "$arch_rs6000"; then
- if test -z "$MPI_IMPL" ; then
- MPI_IMPL=mpich
- mpi_mpich=1
- fi
- AC_DEFINE(AIX,1,[Define for AIX])
-# assume long long exists.
- ac_cv_sizeof_long_long=${ac_cv_sizeof_long_long:-8}
- MPI_OFFSET_KIND1=" INTEGER MPI_OFFSET_KIND"
- MPI_OFFSET_KIND2=" PARAMETER (MPI_OFFSET_KIND=8)"
- MPI_OFFSET_KIND_VAL=8
-fi
-#
-
-if test -n "$arch_tflop" || test -n "$arch_tflops"; then
- # TFLOP_FLAGS="-cougar -D__PUMA"
- AR="xar cr$AR_LOCAL"
- RANLIB="xranlib"
- MPI_LIB="$MPI_LIB"
- if test -z "$MPI_IMPL" ; then
- MPI_IMPL=mpich
- mpi_mpich=1
- fi
- # supply a reasonable default fs
- if test -z "$FILE_SYSTEM" ; then
- FILE_SYSTEM="ufs"
- fi
-fi
-#
-if test -n "$arch_freebsd" || test -n "$arch_LINUX" || test -n "$arch_LINUX_ALPHA" || test -n "$arch_netbsd" || test -n "$arch_openbsd" ; then
- if test -n "$arch_freebsd" || test -n "$arch_netbsd" || test -n "$arch_openbsd"; then
- ac_cv_sizeof_long_long=${ac_cv_sizeof_long_long:-0}
- # printf doesn't work properly and no integer*8 as far as I can tell
- fi
- # Find the CPP before the header check
- AC_PROG_CPP
- if test -z "$MPI_IMPL" ; then
- MPI_IMPL=mpich
- mpi_mpich=1
- fi
-fi
-#
-if test -n "$arch_SX4" ; then
- have_aio=no
- AC_DEFINE(SX4,1,[Define for NEC SX4])
- if test -z "$MPI_IMPL" ; then
- MPI_IMPL=mpich
- mpi_mpich=1
- fi
- # supply a reasonable default fs
- if test -z "$FILE_SYSTEM" ; then
- FILE_SYSTEM="sfs nfs"
- fi
- MPI_OFFSET_KIND1=" INTEGER MPI_OFFSET_KIND"
- MPI_OFFSET_KIND2=" PARAMETER (MPI_OFFSET_KIND=8)"
- MPI_OFFSET_KIND_VAL=8
-fi
-#
-if test -n "$arch_hpux" || test -n "$arch_sppux" ; then
- have_aio=no
- RANLIB=":"
- if test -z "$MPI_IMPL"; then
- if test -f "/opt/mpi/include/mpi.h" ; then
- echo "assuming that you want to use ROMIO with HP MPI"
- MPI_IMPL=hp
- else
- echo "assuming that you want to use ROMIO with MPICH"
- MPI_IMPL=mpich
- fi
- fi
- if test $MPI_IMPL = "mpich" ; then
- mpi_mpich=1
- MPI_LIB="$MPI_LIB -lV3"
- CC=${CC:-cc -Ae}
- F77=${FC:-f77 +U77}
- fi
- if test $MPI_IMPL = "hp" ; then
- mpi_hp=1
- CC=${CC:-mpicc -Ae}
- F77=${FC:-mpif77 +U77}
- fi
- if test $MPI_IMPL = "lam" && test "$FC" != ""; then
- F77="$F77 +U77"
- fi
- FTESTDEFINE="external iargc, getarg"
- if test -n "$arch_hpux" ; then
- CFLAGS="$CFLAGS -D_LARGEFILE64_SOURCE"
- AC_DEFINE(HPUX,1,[Define for HPUX])
- if test $MPI_IMPL = "hp" ; then
- F77=${FC:-mpif90 +U77}
- else
- F77=${FC:-f90 +U77}
- fi
- else
- AC_DEFINE(SPPUX,1,[Define for SPPUX (Convex)])
- fi
-
- MPI_OFFSET_KIND1=" INTEGER MPI_OFFSET_KIND"
- MPI_OFFSET_KIND2=" PARAMETER (MPI_OFFSET_KIND=8)"
- MPI_OFFSET_KIND_VAL=8
- if test "$CC" != "gcc" ; then
- ROMIO_TCFLAGS="-Ae"
- fi
- if test "$F77" != "g77" ; then
- ROMIO_TFFLAGS="+U77"
- fi
-fi
-#
-if test -n "$arch_alpha" || test -n "$arch_ALPHA" ; then
- if test -z "$MPI_IMPL" ; then
- MPI_IMPL=mpich
- mpi_mpich=1
- fi
-
- MPI_OFFSET_KIND1=" INTEGER MPI_OFFSET_KIND"
- MPI_OFFSET_KIND2=" PARAMETER (MPI_OFFSET_KIND=8)"
- MPI_OFFSET_KIND_VAL=8
- LIBS="$LIBS -laio"
-fi
-#
-if test -n "$arch_CRAY" ; then
- NOF77=1
- FTESTDEFINE="integer ilen"
- F77GETARG="call pxfgetarg(i, str, ilen, ierr)"
- have_aio=no
- RANLIB=":"
- AC_DEFINE(CRAY,1,[Define if Cray])
- if test -z "$MPI_IMPL" || test -n "$mpi_sgi" ; then
- MPI_IMPL=cray
- mpi_cray=1
- mpi_sgi=""
-# above is to disable configure tests specific to SGI MPI
- AC_DEFINE(MPISGI,1,[Define if SGI MPI])
- AC_DEFINE(HAVE_MPI_COMBINERS,1,[Define if MPI supports datatype combiners])
- AC_DEFINE(NO_MPI_SGI_type_is_contig,1,[Define if no types show contig])
- fi
-# MPISGI needed because of error in Cray's and SGI's
-# MPI_Type_get_contents (does not increment reference count).
-# Others needed because MPISGI needed.
-
- MPI_OFFSET_KIND1=" INTEGER MPI_OFFSET_KIND"
- MPI_OFFSET_KIND2=" PARAMETER (MPI_OFFSET_KIND=8)"
- MPI_OFFSET_KIND_VAL=8
-fi
-#
-if test -n "$arch_sgi" ; then
- arch_IRIX=1
- ARCH=IRIX
-fi
-if test -n "$arch_IRIX64" || test -n "$arch_IRIX32" || test -n "$arch_IRIXN32" ; then
- arch_IRIX=1
-fi
-if test -n "$arch_sgi5" ; then
- arch_IRIX5=1
- ARCH=IRIX
-fi
-#
-PAC_GET_SPECIAL_SYSTEM_INFO
-#
-# special case 'sgi5' for use on MESHINE which is much like an SGI running
-# irix 5 with r4400 chips, but does not have 'hinv', so above code doesn't
-# work
-if test -n "$arch_sgi5"; then
- osversion=5
- cputype=4400
- IRIXARCH="$ARCH_$osversion"
- IRIXARCH="$IRIXARCH_$cputype"
-# now set arch_IRIX to 1
- arch_IRIX=1
- echo "IRIX-specific architecture is $IRIXARCH"
- AC_DEFINE(IRIX,1,[Define if IRIX])
-fi
-#
-if test -n "$arch_IRIX"; then
- if test $osversion = 4 ; then
- RANLIB="ar ts"
- if test -n "$mpi_sgi"; then
- AC_MSG_ERROR([SGI\'s MPI does not work with IRIX 4.x])
- fi
- elif test $osversion = 5 ; then
- if test -n "$mpi_sgi"; then
- AC_MSG_ERROR([SGI\'s MPI does not work with IRIX 5.x])
- fi
- elif test $osversion = 6 ; then
- if test -z "$MPI_IMPL"; then
- if test "$FROM_MPICH2" = "yes" ; then
- # Building with MPICH2. Distinguish from MPICH-1
- MPI_IMPL=mpich2
- mpi_mpich2=1
- elif test -f "/usr/include/mpi.h" ; then
- # removed use of escaped single quotes in messages
- # because they confuse Emacs, making it hard to
- # read the files (with emacs :) )
- AC_MSG_WARN([assuming that you want to use ROMIO with the SGI MPI])
- MPI_IMPL=sgi
- mpi_sgi=1
- else
- AC_MSG_WARN([assuming that you want to use ROMIO with MPICH])
- MPI_IMPL=mpich
- mpi_mpich=1
- fi
- fi
- RANLIB=":"
- AC_DEFINE(AIO_SIGNOTIFY_NONE,1,[Define if no signotify])
- if test $cputype -ge 5000 ; then
- MIPS=4
- else
- MIPS=3
- fi
- fi
- if test -n "$mpi_sgi" && test -z "$MPI_LIB" ; then
- MPI_LIB="-lmpi"
- fi
-# check if pread64 is defined
- PAC_HAVE_PREAD64
-
- # supply a reasonable default fs
- if test -z "$FILE_SYSTEM" ; then
- FILE_SYSTEM="nfs"
- AC_MSG_CHECKING(for xfs)
- AC_TRY_COMPILE([
-#include <aio.h>],
-[aiocb64_t *t1;],xfs_works=1;FILE_SYSTEM="xfs $FILE_SYSTEM";)
- if test "$xfs_works" = 1 ; then
- AC_MSG_RESULT(yes)
- else
- AC_MSG_RESULT(no)
- FILE_SYSTEM="ufs $FILE_SYSTEM"
- fi
- fi
- AC_DEFINE(IRIX,1,[Define if IRIX])
- MPI_OFFSET_KIND1=" INTEGER MPI_OFFSET_KIND"
- MPI_OFFSET_KIND2=" PARAMETER (MPI_OFFSET_KIND=8)"
- MPI_OFFSET_KIND_VAL=8
-fi
-
-AC_HAVE_FUNCS(memalign)
-
-#
-# Question: Should ROMIO under MPICH2 ignore the Fortran tests, since
-# MPICH2 provides all of the Fortran interface routines?
-#
-if test $NOF77 = 0 ; then
- echo "checking Fortran external names"
- PAC_GET_FORTNAMES
- if test -n "$WDEF" ; then
- CFLAGS="$CFLAGS $WDEF"
- fi
- dnl PAC_PROG_F77_NAME_MANGLE
- dnl (need to set the new name format)
- rm -f test/mpif.h
- if test "$MPI_INCLUDE_DIR" != "." && test $WITHIN_KNOWN_MPI_IMPL = no ; then
- if test ! -d test ; then mkdir test ; fi
- ln -s $MPI_INCLUDE_DIR/mpif.h test
- fi
-else
- F77=":"
-fi
-#
-AC_C_INLINE
-
-# Header files
-# Find the CPP before the header check
-AC_PROG_CPP
-AC_CHECK_HEADERS([unistd.h fcntl.h malloc.h stddef.h sys/types.h])
-#
-
-# When compiling ROMIO on Darwin with _POSIX_C_SOURCE defined (such as when
-# using --enable-strict in MPICH2), sys/types.h does not define u_short and
-# friends unless _DARWIN_C_SOURCE is also defined (see compat(5) on a Darwin
-# box). This would normally be fine, except sys/stat.h defines struct stat to
-# use u_long, so strict compiles fail. One option is to also compile with
-# _DARWIN_C_SOURCE, but this disables much of the strictness that is intended
-# by _POSIX_C_SOURCE. Instead we just define our own types if they are not
-# provided by the system. This isn't quite as safe as typedef'ing the
-# replacement types, but it will apply to later configure tests, which is
-# important.
-AC_CHECK_TYPE([u_char],[],[AC_DEFINE_UNQUOTED([u_char],[unsigned char],[Define to "unsigned char" if sys/types.h does not define.])])
-AC_CHECK_TYPE([u_short],[],[AC_DEFINE_UNQUOTED([u_short],[unsigned short],[Define to "unsigned short" if sys/types.h does not define.])])
-AC_CHECK_TYPE([u_int],[],[AC_DEFINE_UNQUOTED([u_int],[unsigned int],[Define to "unsigned int" if sys/types.h does not define.])])
-AC_CHECK_TYPE([u_long],[],[AC_DEFINE_UNQUOTED([u_long],[unsigned long],[Define to "unsigned long" if sys/types.h does not define.])])
-
-# must come _after_ the above checks for u_char/u_short/u_int/u_long
-AC_CHECK_HEADERS([sys/attr.h])
-
-AC_CHECK_SIZEOF(int)
-AC_CHECK_SIZEOF(void *)
-AC_CACHE_CHECK([for int large enough for pointers],
-pac_cv_int_hold_pointer,[
-if test "$ac_cv_sizeof_int" = "0" -o \
- "$ac_cv_sizeof_void_p" = "0" ; then
- pac_cv_int_hold_pointer=unknown
-elif test "$ac_cv_sizeof_int" -lt "$ac_cv_sizeof_void_p" ; then
- pac_cv_int_hold_pointer=no
-else
- pac_cv_int_hold_pointer=yes
-fi
-])
-if test "$pac_cv_int_hold_pointer" != yes ; then
- AC_DEFINE(INT_LT_POINTER,1,[Define if int smaller than pointer])
- dnl Switch to a conforming name (start with HAVE or USE)
- AC_DEFINE(HAVE_INT_LT_POINTER,1,[Define if int smaller than pointer])
-fi
-
-# LL is the printf-style format name for output of a MPI_Offset.
-# We have to match this to the type that we use for MPI_Offset.
-AC_CHECK_SIZEOF(long long)
-if test "$ac_cv_sizeof_long_long" != 0 ; then
- if test "$ac_cv_sizeof_long_long" = "8" ; then
- AC_DEFINE(HAVE_LONG_LONG_64,1,[Define if long long is 64 bits])
- MPI_OFFSET_TYPE="long long"
- DEFINE_MPI_OFFSET="typedef long long MPI_Offset;"
- FORTRAN_MPI_OFFSET="integer*8"
- LL="lld"
- elif test "$ac_cv_sizeof_long_long" = "$ac_cv_sizeof_int" ; then
- MPI_OFFSET_TYPE="int"
- DEFINE_MPI_OFFSET="typedef int MPI_Offset;"
- FORTRAN_MPI_OFFSET="integer"
- AC_DEFINE(MPI_OFFSET_IS_INT,1,[Define if MPI_Offset is int])
- LL="d"
- MPI_OFFSET_KIND1="!"
- MPI_OFFSET_KIND2="!"
- else
- echo "defining MPI_Offset as long in C and integer in Fortran"
- MPI_OFFSET_TYPE="long"
- DEFINE_MPI_OFFSET="typedef long MPI_Offset;"
- FORTRAN_MPI_OFFSET="integer"
- LL="ld"
- MPI_OFFSET_KIND1="!"
- MPI_OFFSET_KIND2="!"
- fi
-else
- echo "defining MPI_Offset as long in C and integer in Fortran"
- MPI_OFFSET_TYPE="long"
- DEFINE_MPI_OFFSET="typedef long MPI_Offset;"
- FORTRAN_MPI_OFFSET="integer"
- LL="ld"
- MPI_OFFSET_KIND1="!"
- MPI_OFFSET_KIND2="!"
-fi
-
-
-#
-if test -n "$ac_cv_sizeof_long_long"; then
- if test $WITHIN_KNOWN_MPI_IMPL = no ; then
- PAC_MPI_LONG_LONG_INT
- else
- AC_DEFINE(HAVE_MPI_LONG_LONG_INT,1,[Define if supports long long int])
- fi
-fi
-#
-if test -n "$OFFSET_KIND" -a "A$MPI_OFFSET_KIND1" = "A!" ; then
- MPI_OFFSET_KIND1=" INTEGER MPI_OFFSET_KIND"
- MPI_OFFSET_KIND2=" PARAMETER (MPI_OFFSET_KIND=$OFFSET_KIND)"
- MPI_OFFSET_KIND_VAL=$OFFSET_KIND
-else
- if test "$FORTRAN_MPI_OFFSET" = "integer*8" && test "A$MPI_OFFSET_KIND2" = "A!" && test $NOF77 = 0 && test $NOF90 = 0 ; then
- PAC_MPI_OFFSET_KIND
- fi
- #
- if test "$FORTRAN_MPI_OFFSET" = "integer" && test "A$MPI_OFFSET_KIND2" = "A!" && test $NOF77 = 0 && test $NOF90 = 0 ; then
- PAC_MPI_OFFSET_KIND_4BYTE
- fi
-fi
-#
-# Test that we can use the FORTRAN_MPI_OFFSET type. If the environment
-# is a strict Fortran 90/95 or later compiler, the "integer*8" format
-# may not work.
-if test "$NOF77" = 0 ; then
- rm -f conftest*
- ac_cv_f77_offset_type_works=no
- AC_MSG_CHECKING([that we can use $FORTRAN_MPI_OFFSET to declare MPI_DISPLACMENT_CURRENT])
- cat >conftest.f <<EOF
- program main
- $FORTRAN_MPI_OFFSET j
- end
-EOF
- if $F77 -o conftest$EXEEXT conftest.f >>config.log 2>&1 && test -x conftest$EXEEXT ; then
- ac_cv_f77_offset_type_works=yes
- fi
- rm -f conftest*
- AC_MSG_RESULT($ac_cv_f77_offset_type_works)
-
- if test "$ac_cv_f77_offset_type_works" != "yes" -a -n "$MPI_OFFSET_KIND_VAL"; then
- AC_MSG_CHECKING([whether we can use KIND with the selected F77 compiler $F77])
- ac_cv_f77_allows_offset_kind=no
- rm -f conftest*
- cat >conftest.f <<EOF
- program main
- integer (kind=$MPI_OFFSET_KIND_VAL) j
- end
-EOF
- if $F77 -o conftest$EXEEXT conftest.f >>config.log 2>&1 && test -x conftest$EXEEXT ; then
- ac_cv_f77_allows_offset_kind=yes
- fi
- rm -f conftest*
- AC_MSG_RESULT($ac_cv_f77_allows_offset_kind)
- if test "$ac_cv_f77_allows_offset_kind" ; then
- FORTRAN_MPI_OFFSET="integer (kind=$MPI_OFFSET_KIND_VAL)"
- else
- AC_MSG_WARN([Could not find a way to declare an integer type corresponding to MPI_Offset in Fortran.])
- fi
- fi
-fi
-
-#
-# check if MPI_Info functions are defined in the MPI implementation
-if test $WITHIN_KNOWN_MPI_IMPL = no ; then
- PAC_MPI_INFO
-else
- AC_DEFINE(HAVE_MPI_INFO,1,[Define if MPI Info is available])
- HAVE_MPI_INFO="#define HAVE_MPI_INFO"
- MPI_FINFO1="!"
- MPI_FINFO2="!"
- MPI_FINFO3="!"
- MPI_FINFO4="!"
-fi
-#
-if test -n "$mpi_sgi"; then
-dnl if test -z "$HAVE_MPI_INFO" ; then
-dnl PAC_CHECK_MPI_SGI_INFO_NULL # is MPI_INFO_NULL defined in mpi.h?
-dnl fi
- PAC_TEST_MPI_SGI_type_is_contig
- PAC_TEST_MPI_COMBINERS
- PAC_TEST_MPI_HAVE_OFFSET_KIND
-fi
-#
-# check if darray and subarray constructors are defined in the MPI
-# implementation
-if test $WITHIN_KNOWN_MPI_IMPL = no ; then
- PAC_MPI_DARRAY_SUBARRAY
-fi
-if test $FROM_MPICH2 = yes ; then
- dnl Made this a message instead of a warning because the warning is
- dnl likely to confuse users.
- AC_MSG_RESULT([Overriding Array test for MPICH2])
- unset BUILD_MPI_ARRAY
- AC_DEFINE(HAVE_MPI_DARRAY_SUBARRAY,1,[Define if Darray is available])
- HAVE_MPI_DARRAY_SUBARRAY="#define HAVE_MPI_DARRAY_SUBARRAY"
- MPI_FARRAY1="!"
- MPI_FARRAY2="!"
- MPI_FARRAY3="!"
- MPI_FARRAY4="!"
- MPI_FARRAY5="!"
- MPI_FARRAY6="!"
- MPI_FARRAY7="!"
-fi
-#
-#
-# Test for weak symbol support...
-# We can't put # in the message because it causes autoconf to generate
-# incorrect code
-HAVE_WEAK_SYMBOLS=0
-if test -n "$arch_hpux" || test -n "$arch_sppux" ; then
-# multiple secondary definitions not allowed by HP compilers
-# Fortran interface for HP already uses one secondary defn.
-# therefore, do not use this method for profiling interface.
-# build profiling interface explicitly.
- TRY_WEAK_SYMBOLS=0
-fi
-if test $TRY_WEAK_SYMBOLS = 1 ; then
- AC_MSG_CHECKING([for weak symbol support])
- AC_TRY_LINK([
-extern int PFoo(int);
-#pragma weak PFoo = Foo
-int Foo(int a) { return a; }
-],[return PFoo(1);],has_pragma_weak=1)
- #
- # Some systems (Linux ia64 and ecc, for example), support weak symbols
- # only within a single object file! This tests that case.
- # Note that there is an extern int PFoo declaration before the
- # pragma. Some compilers require this in order to make the weak symbol
- # extenally visible.
-if test "$has_pragma_weak" = 1 ; then
- AC_MSG_RESULT([pragma weak])
- AC_MSG_CHECKING([that weak symbols are visible to other files])
- rm -f conftest*
- cat >>conftest1.c <<EOF
-extern int PFoo(int);
-#pragma weak PFoo = Foo
-int Foo(int);
-int Foo(int a) { return a; }
-EOF
- cat >>conftest2.c <<EOF
-extern int PFoo(int);
-int main(int argc, char **argv) {
-return PFoo(0);}
-EOF
- ac_link2='${CC-cc} -o conftest$EXEEXT $CFLAGS $CPPFLAGS $LDFLAGS conftest1.c conftest2.c $LIBS >conftest.out 2>&1'
- if eval $ac_link2 ; then
- AC_MSG_RESULT(yes)
- AC_MSG_CHECKING([that the compiler correctly implements weak symbols])
- # The gcc 3.4.x compiler accepts the pragma weak, but does not
- # correctly implement it on systems where the loader doesn't
- # support weak symbols (e.g., cygwin). This is a bug in gcc, but it
- # it is one that *we* have to detect.
- rm -f conftest*
- cat >>conftest1.c <<EOF
-extern int PFoo(int);
-#pragma weak PFoo = Foo
-int Foo(int);
-int Foo(int a) { return a; }
-EOF
- cat >>conftest2.c <<EOF
-extern int Foo(int);
-int PFoo(int a) { return a+1;}
-int main(int argc, char **argv) {
-return Foo(0);}
-EOF
- if eval $ac_link2 ; then
- AC_MSG_RESULT(yes)
- has_pragma_weak=1
- else
- AC_MSG_RESULT(no)
- echo "$ac_link2" >> config.log
- echo "Failed program was" >> config.log
- cat conftest1.c >>config.log
- cat conftest2.c >>config.log
- if test -s conftest.out ; then cat conftest.out >> config.log ; fi
- has_pragma_weak=0
- fi
- else
- echo "$ac_link2" 1>&AC_FD_CC
- echo "Failed program was" 1>&AC_FD_CC
- cat conftest1.c 1>&AC_FD_CC
- cat conftest2.c 1>&AC_FD_CC
- if test -s conftest.out ; then cat conftest.out 1>&AC_FD_CC ; fi
- AC_MSG_RESULT(no)
- has_pragma_weak=0
- fi
- rm -f conftest*
- fi
- if test "$has_pragma_weak" = 1 ; then
- HAVE_WEAK_SYMBOLS=1
- AC_DEFINE(HAVE_PRAGMA_WEAK,1,[Define if pragma weak available])
- else
- AC_TRY_LINK([
-extern int PFoo(int);
-#pragma _HP_SECONDARY_DEF Foo PFoo
-int Foo(int a) { return a; }
-],[return PFoo(1);],has_pragma_hp_secondary=1)
- if test "$has_pragma_hp_secondary" = 1 ; then
- AC_MSG_RESULT([pragma _HP_SECONDARY_DEF])
- HAVE_WEAK_SYMBOLS=1
- AC_DEFINE(HAVE_PRAGMA_HP_SEC_DEF,1,[Define for HP weak pragma])
- else
- AC_TRY_LINK([
-extern int PFoo(int);
-#pragma _CRI duplicate PFoo as Foo
-int Foo(int a) { return a; }
-],[return PFoo(1);],has_pragma_cri_duplicate=1)
- if test "$has_pragma_cri_duplicate" = 1 ; then
- AC_MSG_RESULT([pragma _CRI duplicate x as y])
- HAVE_WEAK_SYMBOLS=1
- AC_DEFINE(HAVE_PRAGMA_CRI_DUP,1,[Define for CRAY weak dup])
- else
- AC_MSG_RESULT(no)
- fi
- fi
- fi
-fi
-if test "$HAVE_WEAK_SYMBOLS" = 1 ; then
- AC_DEFINE(HAVE_WEAK_SYMBOLS,1,[Define if weak symbols available])
-fi
-AC_SUBST(HAVE_WEAK_SYMBOLS)
-
-# FIXME we only build ROMIO in embedded mode for now
-AM_CONDITIONAL([BUILD_ROMIO_EMBEDDED],[true])
-# FIXME need to get this right for non-MPICH2 builds
-AM_CONDITIONAL([BUILD_MPIO_REQUEST],[false])
-# FIXME need to get this right for non-MPICH2 builds
-AM_CONDITIONAL([BUILD_MPIO_ERRHAN],[false])
-
-# if we don't have weak symbol support, we must build a separate convenience
-# library in order to provide the "PMPI_" symbols
-AM_CONDITIONAL([BUILD_PROFILING_LIB],[test "x$HAVE_WEAK_SYMBOLS" = "x0"])
-
-AM_CONDITIONAL([BUILD_F77_BINDINGS],[test "x$NOF77" != "x1" && test "x$FROM_MPICH2" != "xyes"])
-
-
-#
-# Check whether the MPI Offset type is compatible with struct flock
-AC_MSG_CHECKING([whether struct flock compatible with MPI_Offset])
-AC_TRY_COMPILE([#include <fcntl.h>],
-[struct flock l;
- $MPI_OFFSET_TYPE a=1;
- l.l_start = a;
- l.l_len = a;
-],pac_cv_struct_flock_and_mpi_offset=yes,pac_cv_struct_flock_and_mpi_offset=no)
-AC_MSG_RESULT($pac_cv_struct_flock_and_mpi_offset)
-# FIXME: We should look for struct flock64 and the F_SETLK64/F_GETLK64
-# ADIOI_Set_lock could use these instead.
-if test "$pac_cv_struct_flock_and_mpi_offset" = no ; then
- AC_MSG_CHECKING([whether struct flock compatible with int])
- AC_TRY_COMPILE([#include <fcntl.h>],
-[struct flock l;
- int a=1;
- l.l_start = a;
- l.l_len = a;
-],pac_cv_struct_flock_and_int=yes,pac_cv_struct_flock_and_int=no)
- AC_MSG_RESULT($pac_cv_struct_flock_and_int)
- if test "$pac_cv_struct_flock_and_int" = yes ; then
- AC_DEFINE(NEEDS_INT_CAST_WITH_FLOCK,1,[Define if l_start and l_len data should be cast as int])
- fi
- # FIXME. Solaris header files define off_t as a UNION if 64bit file
- # sizes are selected. Gah!
-fi
-
-#
-# if FILE_SYSTEM is not set above, use ufs and nfs as default
-#
-if test -z "$FILE_SYSTEM" ; then
- FILE_SYSTEM="ufs nfs"
-fi
-
-# no matter what, always build testfs
-FILE_SYSTEM="testfs $FILE_SYSTEM"
-
-# check for valid file system
-if test -n "$FILE_SYSTEM" ; then
- # if multiple filesystems are passed in, they are '+'-delimited
- # we could set the IFS to tokenize FILE_SYSTEM, but the FILE_SYSTEM env var
- # is used in multiple places in the build system: get rid of the '+'s so we
- # can use the 'for x in $FILE_SYSTEM ...' idiom
- FILE_SYSTEM=`echo $FILE_SYSTEM|sed -e 's/\+/ /g'`
- for x in $FILE_SYSTEM
- do
- found=no
- # We could also do test -d "ad_$y" to test for known file systems
- # based on having access to the adio code. Then adding a file
- # system would not require changing configure to change known_filesystems
- for y in $known_filesystems ; do
- if test $x = $y ; then
- found=yes
- eval "file_system_`echo $x`=1"
- break
- fi
- done
- if test "$found" = "no" ; then
- AC_MSG_WARN([Unknown file system $x... proceeding anyway])
- fi
- done
-fi
-
-#############################################
-# This PVFS2 logic is special because it's hard to get it right if it comes
-# before the known_filesystems check loop above. So we handle it down here,
-# after the loop but before the AM_CONDITIONAL m4 loop.
-#############################################
-#
-# An attempt to "do the right thing" with as little help from the end-user as
-# possible:
-# - if 'with-pvfs2' given, use that to find pvfs2-config. complain if we
-# cannot find it, as this is probably what the user would expect
-# - if we can find 'pvfs2-config' in our path, we can use it to set CFLAGS,
-# LIBS, and LDFLAGS accordingly
-# - as a fallback, use CFLAGS, LIBS, and LDFLAGS passed in by the user
-# - don't do any of this if --with-file-system was given and did not include
-# 'pvfs2': i.e. don't surprise the user with pvfs support.
-
-AC_PATH_PROG(PVFS2_CONFIG, pvfs2-config, notfound, [${with_pvfs2}/bin:$PATH])
-if test $PVFS2_CONFIG != "notfound" ; then
- if test -n "${with_pvfs2}" -o -n "${file_system_pvfs2}" ; then
- # the user either told us where pvfs is or asked for it in
- # --with-file-system (or both)
- CFLAGS="$CFLAGS $( $PVFS2_CONFIG --cflags)"
- LIBS="$LIBS $( $PVFS2_CONFIG --libs)"
- FILE_SYSTEM="pvfs2 $FILE_SYSTEM"
- file_system_pvfs2=1
- fi
-fi
-
-if test "$PVFS2_CONFIG" = "notfound" -a -n "$with_pvfs2" ; then
- AC_MSG_ERROR([pvfs2-config not found in $with_pvfs2])
-fi
-#############################################
-
-
-# Setup an AM_CONDITIONAL named BUILD_AD_FOO for use in each adio's Makefile.mk.
-# This must come *after* the condition becomes valid, in this case after all
-# $file_system_foo variables have been set.
-#
-# If you fiddle with this, please watch the m4 quoting carefully. m4_foreach
-# expands any macros in the "list" argument exactly once. The defn bits ensure
-# that any macro names in "fs"'s value will not be expanded, such as if someone
-# is daft enough to "m4_define([ufs],[some crazy value])".
-m4_foreach([fs],[known_filesystems_m4],[
-AM_CONDITIONAL([BUILD_AD_]m4_toupper(defn([fs])),[test x$file_system_]defn([fs])[ = x1])
-])
-
-
-#
-# Print list of configured file systems
-#
-# TODO: REMOVE BAD ONES FROM THE LIST SOMEHOW?
-#
-AC_MSG_CHECKING([configured file systems])
-AC_MSG_RESULT([$FILE_SYSTEM])
-
-if test -n "$file_system_nfs" ; then
- AC_DEFINE(ROMIO_NFS,1,[Define for ROMIO with NFS])
- AC_MSG_WARN([File locks may not work with NFS. See the Installation and
-users manual for instructions on testing and if necessary fixing this])
-fi
-
-if test -n "$file_system_panfs"; then
- AC_DEFINE(ROMIO_PANFS,1,[Define for ROMIO with PANFS])
-fi
-if test -n "$file_system_ufs"; then
- AC_DEFINE(ROMIO_UFS,1,[Define for ROMIO with UFS])
-fi
-if test -n "$file_system_bgl"; then
- AC_DEFINE(ROMIO_BGL,1,[Define for ROMIO with BGL])
-fi
-if test -n "$file_system_bglockless"; then
- if test x"$file_system_bgl" = x ; then
- AC_MSG_ERROR("bglockless requested without bgl")
- fi
- AC_DEFINE(ROMIO_BGLOCKLESS,1,[Define for lock-free ROMIO with BGL])
-fi
-if test -n "$file_system_hfs"; then
- AC_DEFINE(ROMIO_HFS,1,[Define for ROMIO with HFS])
-fi
-if test -n "$file_system_sfs"; then
- AC_DEFINE(ROMIO_SFS,1,[Define for ROMIO with SFS])
-fi
-
-if test -n "$file_system_pfs"; then
- AC_DEFINE(ROMIO_PFS,1,[Define for ROMIO with PFS])
-fi
-
-if test -n "$file_system_testfs"; then
- AC_DEFINE(ROMIO_TESTFS,1,[Define for ROMIO with TESTFS])
-fi
-#
-# Verify presence of lustre/lustre_user.h
-#
-if test -n "$file_system_lustre"; then
- AC_CHECK_HEADERS(lustre/lustre_user.h,
- AC_DEFINE(ROMIO_LUSTRE,1,[Define for ROMIO with LUSTRE]),
- AC_MSG_ERROR([LUSTRE support requested but cannot find lustre/lustre_user.h header file])
- )
-fi
-
-if test -n "$file_system_xfs"; then
- AC_DEFINE(ROMIO_XFS,1,[Define for ROMIO with XFS])
- # Check for memalign value
- AC_CACHE_CHECK([for memory alignment needed for direct I/O],
- pac_cv_memalignval,
- [
- rm -f confmemalignval
- rm -f /tmp/romio_tmp.bin
- AC_TRY_RUN([
-#include <stdio.h>
-#include <unistd.h>
-#include <fcntl.h>
-#include <stdio.h>
-int main(int argc, char **argv) {
- struct dioattr st;
- int fd = open("/tmp/romio_tmp.bin", O_RDWR | O_CREAT, 0644);
- FILE *f=fopen("confmemalignval","w");
- if (fd == -1) exit(1);
- if (!f) exit(1);
- fcntl(fd, F_DIOINFO, &st);
- fprintf( f, "%u\n", st.d_mem);
- exit(0);
- }
- ],
- pac_cv_memalignval=`cat confmemalignval`,
- pac_cv_memalignval="unknown",pac_cv_memalignval="unknown"
- )
- rm -f confmemalignval
- rm -f /tmp/romio_tmp.bin
- ])
- if test -n "$pac_cv_memalignval" -a "$pac_cv_memalignval" != 0 -a \
- "$pac_cv_memalignval" != "unknown" ; then
- CFLAGS="$CFLAGS -DXFS_MEMALIGN=$pac_cv_memalignval"
- else
- AC_MSG_RESULT(assuming 128 for memory alignment)
- CFLAGS="$CFLAGS -DXFS_MEMALIGN=128"
- fi
-fi
-
-#
-# Verify presence of pvfs.h, issue with int64
-#
-if test -n "$file_system_pvfs"; then
- CPPFLAGS="$CPPFLAGS $CFLAGS"
- AC_CHECK_HEADERS(pvfs.h,
- AC_DEFINE(ROMIO_PVFS,1,[Define for ROMIO with PVFS]),
- AC_MSG_ERROR([PVFS support requested but cannot find pvfs.h header file])
- )
- # Check for missing int64_t (intel version 8 compiler and -no-gcc
- # selected)
- AC_MSG_CHECKING([that pvfs.h can be compiled])
- AC_TRY_COMPILE([
-#include <pvfs.h>
- ],[
- ],pvfs_header_ok=yes,pvfs_header_ok=no
- )
- AC_MSG_RESULT($pvfs_header_ok)
- if test "$pvfs_header_ok" = no -a "$ac_cv_sizeof_long_long" = 8 ; then
- AC_MSG_CHECKING([if pvfs.h can be compiled if we define int64_t])
- # Try again, but with int64_t
- AC_TRY_COMPILE([
- typedef long long int int64_t;
-#include <pvfs.h>
- ],[
- ],
- pvfs_header_ok="yes with int64 definition"
- )
- AC_MSG_RESULT($pvfs_header_ok)
- fi
- if test "$pvfs_header_ok" = "yes with int64 definition" ; then
- AC_DEFINE(ROMIO_PVFS_NEEDS_INT64_DEFINITION,1,[Define if int64_t must be defined for PVFS])
- fi
- if test "$pvfs_header_ok" != "no" ; then
- AC_DEFINE(ROMIO_PVFS,1,[Define for ROMIO with PVFS])
- AC_DEFINE(HAVE_PVFS_SUPER_MAGIC, 1, [Define if PVFS_SUPER_MAGIC defined.])
- else
- AC_MSG_WARN(missing or broken pvfs.h header file; disabling ROMIO PVFS support)
- fi
-fi
-
-
-
-if test -n "$file_system_zoidfs"; then
- AC_CHECK_HEADERS(zoidfs.h,
- AC_DEFINE(ROMIO_ZOIDFS,1,[Define for ROMIO with ZoidFD]),
- AC_MSG_ERROR([ZoidFS support requested but cannot find zoidfs.h header file])
- )
-fi
-
-#
-# Verify presence of pvfs2.h
-#
-if test -n "$file_system_pvfs2"; then
- CPPFLAGS="$CPPFLAGS $CFLAGS"
- AC_CHECK_HEADERS(pvfs2.h,
- AC_DEFINE(ROMIO_PVFS2,1,[Define for ROMIO with PVFS2])
- AC_DEFINE(HAVE_PVFS2_SUPER_MAGIC, 1, [Define if PVFS2_SUPER_MAGIC defined.]),
- AC_MSG_ERROR([PVFS2 support requested but cannot find pvfs2.h header file])
- )
-fi
-
-# layout change after pvfs-2.6.3:
-if test -n "$file_system_pvfs2"; then
- AC_COMPILE_IFELSE([
- AC_LANG_SOURCE([
-#include <stdlib.h>
-#include "pvfs2.h"
- int main(int argc, char **argv) {
- PVFS_object_ref ref;
- PVFS_sys_attr attr;
- PVFS_sys_create(NULL, ref, attr, NULL, NULL, NULL, NULL);
- return 0; }
- ])],
- , AC_DEFINE(HAVE_PVFS2_CREATE_WITHOUT_LAYOUT, 1,
- [Define if PVFS_sys_create does not have layout parameter])
- )
-fi
-
-
-if test -n "$file_system_gridftp"; then
- AC_DEFINE(ROMIO_GRIDFTP, 1, [Define for ROMIO with gridftp])
-fi
-
-if test -n "$file_system_bgl"; then
- SYSDEP_INC=-I${prefix}/include
-else
- SYSDEP_INC=
-
-# Check for presence and characteristics of async. I/O calls if
-# not disabled.
-
-# Some systems need pthreads to get AIO to work. However, we don't want
-# to add pthreads just because it is there, as that can cause problems
-# with some implementations of pthreads and compilers (e.g., gcc version 3
-# would fail if there was an int a[100000] on the stack if the application
-# was *linked* with pthreads, but would succeed if the application was
-# *not linked* with pthreads.
-#
-if test "x$disable_aio" = "xno" ; then
- AC_SEARCH_LIBS(aio_write,aio rt,aio_write_found=yes,aio_write_found=no)
- if test "$aio_write_found" = no ; then
- # If not found, try finding pthread_create first, and if
- # found, try the test again.
- AC_SEARCH_LIBS(pthread_create,pthread,foundPTHREAD=yes,foundPTHREAD=no)
- if test "$foundPTHREAD" = yes ; then
- AC_SEARCH_LIBS(aio_write,aio rt,aio_write_found=yes,aio_write_found=no)
- fi
- fi
-fi
-
-if test "x$disable_aio" = "xno" -a -n "$aio_write_found" ; then
- AC_CHECK_HEADERS(signal.h)
- # Just because aio.h is found by CPP doesn't mean that we can use it
- # We try to compile it, not just read it.
- AC_MSG_CHECKING([if aio.h exists and can be compiled])
- AC_TRY_COMPILE([
-#include <sys/types.h>
-#include <aio.h>],
-[],have_aio_h=yes,have_aio_h=no)
- AC_MSG_RESULT($have_aio_h)
- if test "$have_aio_h" = yes ; then
- AC_DEFINE(HAVE_AIO_H,1,[Define if aio.h exists and can be compiled])
- fi
-
- AC_MSG_CHECKING([if sys/aio.h exists and can be compiled])
- AC_TRY_COMPILE([
-#include <sys/types.h>
-#include <sys/aio.h>],
-[],have_sys_aio_h=yes,have_sys_aio_h=no)
- AC_MSG_RESULT($have_sys_aio_h)
- if test "$have_sys_aio_h" = yes ; then
- AC_DEFINE(HAVE_SYS_AIO_H,1,[Define if sys/aio.h exists and can be compiled])
- fi
- if test "$have_aio_h" = "no" -a "$have_sys_aio_h" = "no" ; then
- disable_aio=yes
- fi
-fi
-
-if test "$have_aio_h" = "yes" -o "$have_sys_aio_h" = "yes" -o "x$disable_aio" = "xno"; then
-
- # Check that aio is available (many systems appear to have aio
- # either installed improperly or turned off).
- # The test is the following: if not cross compiling, try to run a
- # program that includes a *reference* to aio_write but does not call it
- # If the libraries are not set up correctly, then this will fail.
-
- AC_MSG_CHECKING([whether aio routines can be used])
- # Include aio.h and the aiocb struct (since we'll need these to
- # actually use the aio_write interface). Note that this will
- # fail for some pre-POSIX implementations of the aio interface
- # (an old IBM interface needs an fd argument as well)
- AC_TRY_RUN([
-#include <sys/types.h>
-#ifdef HAVE_SIGNAL_H
-#include <signal.h>
-#endif
-#ifdef HAVE_AIO_H
-#include <aio.h>
-#endif
-#ifdef HAVE_SYS_AIO_H
-#include <sys/aio.h>
-#endif
- int main(int argc, char **argv)
- {
- struct aiocb *aiocbp;
- if (argc > 10) aio_write(aiocbp);
- return 0;
- }
- ],
- aio_runs=yes
- AC_MSG_RESULT(yes),
- aio_runs=no
- AC_MSG_RESULT(no),
- aio_runs=no
- AC_MSG_RESULT(no: aio routines disabled when cross compiling)
- )
- if test "$aio_runs" != "no" ; then
- AC_DEFINE(ROMIO_HAVE_WORKING_AIO, 1, Define if AIO calls seem to work)
- fi
-
- # now about that old IBM interface...
- # modern AIO interfaces have the file descriptor in the aiocb structure,
- # and will set ROMIO_HAVE_STRUCT_AIOCB_WITH_AIO_FILDES. Old IBM
- # implementations pass the file descriptor as an argument to aio_write and
- # aio_read. AIO still works on these platforms, but we have to test with
- # two-argument aio_write to avoid a false negative. no need to worry about
- # the two-argument vs. one-argument aio_write and aio_read: ROMIO already
- # uses ROMIO_HAVE_STRUCT_AIOCB_WITH_AIO_FILDES to call aio_write and
- # aio_read correctly
-
- AC_MSG_CHECKING([for obsolete two-argument aio_write])
- AC_TRY_RUN([
-#include <sys/types.h>
-#ifdef HAVE_SIGNAL_H
-#include <signal.h>
-#endif
-#ifdef HAVE_AIO_H
-#include <aio.h>
-#endif
-#ifdef HAVE_SYS_AIO_H
-#include <sys/aio.h>
-#endif
- int main(int argc, char **argv)
- {
- int fd;
- struct aiocb *aiocbp;
- if (argc > 10) aio_write(fd, aiocbp);
- return 0;
- }
- ],
- aio_two_arg_write=yes
- AC_MSG_RESULT(yes),
- aio_two_arg_write=no
- AC_MSG_RESULT(no),
- aio_two_arg_write=no
- AC_MSG_RESULT(no: cannot test when cross-compiling)
- )
-
- if test "$aio_two_arg_write" != "no" -a "$aio_runs" != "yes" ; then
- AC_DEFINE(ROMIO_HAVE_WORKING_AIO, 1, Define if AIO calls seem to work)
- AC_DEFINE(ROMIO_HAVE_AIO_CALLS_NEED_FILEDES, 1, Define if AIO calls need file descriptor)
- fi
-
- AC_MSG_CHECKING([for obsolete two-argument aio_suspend])
- AC_TRY_RUN([
-#include <sys/types.h>
-#ifdef HAVE_SIGNAL_H
-#include <signal.h>
-#endif
-#ifdef HAVE_AIO_H
-#include <aio.h>
-#endif
-#ifdef HAVE_SYS_AIO_H
-#include <sys/aio.h>
-#endif
- int main(int argc, char **argv)
- {
- struct aiocb *aiocbp;
- if (argc > 10) aio_suspend(1, &aiocbp);
- return 0;
- }
- ],
- aio_two_arg_suspend=yes
- AC_MSG_RESULT(yes),
- aio_two_arg_suspend=no
- AC_MSG_RESULT(no),
- aio_two_arg_suspend=no
- AC_MSG_RESULT(no: cannot test when cross compiling)
- )
-
- if test "$aio_two_arg_suspend" != "no" -a "$aio_runs" != "yes" ; then
- AC_DEFINE(ROMIO_HAVE_AIO_SUSPEND_TWO_ARGS, 1, Define if aio_suspend needs two arguments)
- fi
-
- AC_MSG_CHECKING([for aio_fildes member of aiocb structure])
- AC_TRY_COMPILE([
-#ifdef HAVE_SIGNAL_H
-#include <signal.h>
-#endif
-#ifdef HAVE_SYS_TYPES_H
-#include <sys/types.h>
-#endif
-#ifdef HAVE_AIO_H
-#include <aio.h>
-#endif
-#ifdef HAVE_SYS_AIO_H
-#include <sys/aio.h>
-#endif
- ],[
- struct aiocb a;
- a.aio_fildes = 0;
- ],
- AC_MSG_RESULT(yes)
- AC_DEFINE(ROMIO_HAVE_STRUCT_AIOCB_WITH_AIO_FILDES, 1, [Define if aiocb has aio_fildes member]),
- AC_MSG_RESULT(no)
- )
- AC_MSG_CHECKING(for aio_whence member of aiocb structure)
- AC_TRY_COMPILE([
-#ifdef HAVE_SIGNAL_H
-#include <signal.h>
-#endif
-#ifdef HAVE_SYS_TYPES_H
-#include <sys/types.h>
-#endif
-#ifdef HAVE_AIO_H
-#include <aio.h>
-#endif
-#ifdef HAVE_SYS_AIO_H
-#include <sys/aio.h>
-#endif
-#include <sys/types.h>
-#include <unistd.h>
- ],[
- struct aiocb a;
- a.aio_whence = SEEK_SET;
- ],
- AC_MSG_RESULT(yes)
- AC_DEFINE(ROMIO_HAVE_STRUCT_AIOCB_WITH_AIO_WHENCE, 1, [Define if aiocb has aio_whence member]),
- AC_MSG_RESULT(no)
- )
- AC_MSG_CHECKING(for aio_handle member of aiocb structure)
- AC_TRY_COMPILE([
-#ifdef HAVE_SIGNAL_H
-#include <signal.h>
-#endif
-#ifdef HAVE_SYS_TYPES_H
-#include <sys/types.h>
-#endif
-#ifdef HAVE_AIO_H
-#include <aio.h>
-#endif
-#ifdef HAVE_SYS_AIO_H
-#include <sys/aio.h>
-#endif
- ],[
- struct aiocb a;
- aio_handle_t h;
-
- a.aio_handle = h;
- ],
- AC_MSG_RESULT(yes)
- AC_DEFINE(ROMIO_HAVE_STRUCT_AIOCB_WITH_AIO_HANDLE, 1, [Define if aiocb has aio_handle member]),
- AC_MSG_RESULT(no)
- )
- AC_MSG_CHECKING(for aio_reqprio member of aiocb structure)
- AC_TRY_COMPILE([
-#ifdef HAVE_SIGNAL_H
-#include <signal.h>
-#endif
-#ifdef HAVE_SYS_TYPES_H
-#include <sys/types.h>
-#endif
-#ifdef HAVE_AIO_H
-#include <aio.h>
-#endif
-#ifdef HAVE_SYS_AIO_H
-#include <sys/aio.h>
-#endif
- ],[
- struct aiocb a;
-
- a.aio_reqprio = 0;
- ],
- AC_MSG_RESULT(yes)
- AC_DEFINE(ROMIO_HAVE_STRUCT_AIOCB_WITH_AIO_REQPRIO, 1, [Define if aiocb has aio_reqprio member]),
- AC_MSG_RESULT(no)
- )
- AC_MSG_CHECKING(for aio_sigevent member of aiocb structure)
- AC_TRY_COMPILE([
-#ifdef HAVE_SIGNAL_H
-#include <signal.h>
-#endif
-#ifdef HAVE_SYS_TYPES_H
-#include <sys/types.h>
-#endif
-#ifdef HAVE_AIO_H
-#include <aio.h>
-#endif
-#ifdef HAVE_SYS_AIO_H
-#include <sys/aio.h>
-#endif
- ],[
- struct aiocb a;
-
- a.aio_sigevent.sigev_signo = 0;
- ],
- AC_MSG_RESULT(yes)
- AC_DEFINE(ROMIO_HAVE_STRUCT_AIOCB_WITH_AIO_SIGEVENT, 1, [Define if aiocb has aio_sigevent member]),
- AC_MSG_RESULT(no)
- )
-
-fi
-fi
-# End of aio-related tests
-
-#
-# Check for statfs (many) and specifically f_fstypename field (BSD)
-#
-AC_CHECK_HEADERS(sys/vfs.h sys/param.h sys/mount.h sys/statvfs.h)
-AC_MSG_CHECKING([whether struct statfs properly defined])
-AC_TRY_COMPILE([
-#ifdef HAVE_SYS_VFS_H
-#include <sys/vfs.h>
-#endif
-#ifdef HAVE_SYS_STATVFS_H
-#include <sys/statvfs.h>
-#endif
-#ifdef HAVE_SYS_PARAM_H
-#include <sys/param.h>
-#endif
-#ifdef HAVE_SYS_MOUNT_H
-#include <sys/mount.h>
-#endif
- ],[
- struct statfs f;
- ],
- pac_cv_have_statfs=yes,pac_cv_have_statfs=no
-)
-AC_MSG_RESULT($pac_cv_have_statfs)
-# At this point, we could check for whether defining
-# __SWORD_TYPE as sizet_t or int/long (size of pointer)
-# would help. FIXME
-
-if test "$pac_cv_have_statfs" = yes ; then
- AC_DEFINE(HAVE_STRUCT_STATFS,1,[Define if struct statfs can be compiled])
-fi
-
-AC_MSG_CHECKING([for f_fstypename member of statfs structure])
-AC_TRY_COMPILE([
-#include <sys/param.h>
-#include <sys/mount.h>
-#include <string.h>
- ],[
- struct statfs f;
- memset(&f, 0, sizeof(f));
- strncmp("nfs", f.f_fstypename, 3);
- ],
- pac_cv_have_statfs_f_fstypename=yes,
- pac_cv_have_statfs_f_fstypename=no
-)
-AC_MSG_RESULT($pac_cv_have_statfs_f_fstypename)
-if test $pac_cv_have_statfs_f_fstypename = yes ; then
- AC_DEFINE(ROMIO_HAVE_STRUCT_STATFS_WITH_F_FSTYPENAME, 1,[Define if statfs has f_fstypename])
-fi
-
-#
-# Check for stat and st_fstype field (NEC SX4)
-#
-AC_CHECK_HEADERS(sys/stat.h sys/types.h unistd.h)
-AC_CHECK_FUNCS(stat,
- AC_DEFINE(HAVE_STAT, 1, Define if stat function is present)
- AC_MSG_CHECKING([for st_fstype member of stat structure])
- AC_TRY_COMPILE([
-#ifdef HAVE_SYS_TYPES_H
-#include <sys/types.h>
-#endif
-#ifdef HAVE_SYS_STAT_H
-#include <sys/stat.h>
-#endif
-#ifdef HAVE_UNISTD_H
-#include <unistd.h>
-#endif
- ],[
- struct stat s;
-
- s.st_fstype = NULL;
- ],
- AC_MSG_RESULT(yes)
- AC_DEFINE(ROMIO_HAVE_STRUCT_STAT_WITH_ST_FSTYPE, 1, Define if struct stat has a st_fstype member),
- AC_MSG_RESULT(no)
- )
-)
-
-#
-# Check for statvfs and f_basetype field (Solaris, Irix, AIX, etc.)
-#
-AC_CHECK_HEADERS(sys/types.h sys/statvfs.h sys/vfs.h)
-AC_CHECK_FUNCS(statvfs,
- AC_DEFINE(HAVE_STATVFS, 1, Define if statvfs function is present)
- AC_MSG_CHECKING([for f_basetype member of statvfs structure])
- AC_TRY_COMPILE([
-#ifdef HAVE_SYS_TYPES_H
-#include <sys/types.h>
-#endif
-#ifdef HAVE_SYS_VFS_H
-#include <sys/vfs.h>
-#endif
-#ifdef HAVE_SYS_STATVFS_H
-#include <sys/statvfs.h>
-#endif
- ], [[
- struct statvfs foo;
-
- foo.f_basetype[0] = 'a';
- ]],
- AC_MSG_RESULT(yes)
- AC_DEFINE(ROMIO_HAVE_STRUCT_STATVFS_WITH_F_BASETYPE, 1, defined if struct statvfs has a f_basetype member),
- AC_MSG_RESULT(no)
- )
-)
-
-#
-# Check for large file support. Make sure that we can use the off64_t
-# type (in some cases, it is an array, and the ROMIO code isn't prepared for
-# that).
-#
-AC_CHECK_HEADERS(unistd.h)
-if test "$ac_cv_header_unistd_h" = "yes" ; then
- AC_CACHE_CHECK([for large file defines],ac_cv_has_large_file_defines,[
- AC_TRY_COMPILE([
-#include <unistd.h>
- ], [
-#ifndef _LFS64_LARGEFILE
-#error no largefile defines
-#endif
- ],ac_cv_has_large_file_defines=yes,ac_cv_has_large_file_defines=no)])
- if test "$ac_cv_has_large_file_defines" = "yes" ; then
- # See if we can use them
- AC_CACHE_CHECK([whether off64_t is an scalar type],ac_cv_off64_t_scalar,[
- AC_TRY_COMPILE([
-#define _LARGEFILE64_SOURCE
-#define _FILE_OFFSET_BITS 64
-#include <sys/types.h>
-#include <unistd.h>
-],[off64_t a = 3;],ac_cv_off64_t_scalar=yes,ac_cv_off64_t_scalar=no)])
-
- if test "$ac_cv_off64_t_scalar" = "yes" ; then
- CFLAGS="${CFLAGS} -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64"
- fi
- fi
-fi
-
-
-####################################################################
-# We're about to mess with CC etc. No more feature tests past here,
-# because we may set CC to something that does not yet exist!
-####################################################################
-
-if test -n "$mpi_mpich"; then
- if test -z "$arch_SX4" ; then
- MPIOF_H_INCLUDED=1
- fi
- if test "$FROM_MPICH2" = no; then
- AC_DEFINE(NEEDS_MPI_TEST,1,[Define if mpi_test needed])
- AC_DEFINE(MPICH,1,[Define if using MPICH])
- fi
-fi
-
-if test -n "$mpi_sgi"; then
- AC_DEFINE(MPISGI,1,[Define if SGI MPI])
-fi
-
-if test -n "$mpi_lam"; then
- AC_DEFINE(MPILAM,1,[Define if using LAM/MPI])
-fi
-
-if test -n "$mpi_hp"; then
- AC_DEFINE(MPIHP,1,[Define if using HP MPI])
- if test "$NOF77" = 0; then
- PAC_CHECK_MPIOF_H
- fi
-fi
-#
-AC_CHECK_FUNCS(strerror)
-if test -z "$srcdir" -o "$srcdir" = "." ; then srcdir="$ROMIO_HOME" ; fi
-AC_SUBST(srcdir)
-
-# preserve these values across a config.status --recheck
-AC_ARG_VAR([master_top_srcdir],[set by the MPICH2 configure to indicate the MPICH2 source root])
-AC_ARG_VAR([master_top_builddir],[set by the MPICH2 configure to indicate the MPICH2 build root])
-
-# The master_top_srcdir is the location of the source for the building
-# package. This is used only as part of the MPICH2 build, including
-# the documentation targets mandoc, htmldoc, and latexdoc
-if test -z "$master_top_srcdir" ; then
- if test "$FROM_MPICH2" = yes ; then
- AC_MSG_WARN([Could not determine master_top_srcdir])
- fi
-fi
-#
-# Get the master builddir (which may be imported from above)
-if test -z "$master_top_builddir" ; then
- if test "$FROM_MPICH2" = yes ; then
- # this variable is essential to proper build operation
- AC_MSG_ERROR([Could not determine master_top_srcdir])
- fi
- master_top_builddir=`pwd`
-fi
-# Make sure the alternate spelling is used until we clean up all of the code
-master_topbuild_dir=$master_top_builddir
-export master_topbuild_dir
-AC_SUBST(master_topbuild_dir)
-
-# The following definitions are needed within adio/common/status_setb.c
-if test "$FROM_MPICH" = yes ; then
- AC_DEFINE(MPICH,1,[Define if compiling within MPICH])
-elif test "$FROM_MPICH2" = yes ; then
- AC_DEFINE(ROMIO_INSIDE_MPICH2,1,[Define if compiling within MPICH2])
-elif test "$FROM_MPILAM" = yes ; then
- AC_DEFINE(MPILAM,1,[Define if compiling within LAM/MPI])
-fi
-
-if test "$FROM_MPICH2" = no -a "$FROM_MPICH" = no ; then
- if test -z "$LIBNAME"; then
- LIBNAME="$top_build_dir/lib/libmpio.a"
- fi
- #
- if test ! -d $top_build_dir/lib ; then
- mkdir $top_build_dir/lib
- fi
-else
- MPILIBNAME=${MPILIBNAME:-mpich}
- if test -z "$LIBNAME" ; then
- if test -d "$master_top_builddir/lib" ; then
- LIBNAME=$master_top_builddir/lib/lib${MPILIBNAME}.a
- else
- LIBNAME="$ROMIO_HOME/lib${MPILIBNAME}.a"
- fi
- fi
-fi
-if test "$FROM_MPICH2" != no ; then
- # use the error handlers from MPICH2
- MPIO_EXTRA_OBJECTS=
- MPIO_EXTRA_TMP_POBJECTS=
- MPIO_EXTRA_REAL_POBJECTS=
- # Use generalized request to get the multiple-completion routines
- MPIO_REQOBJECTS=
-fi
-AC_SUBST(MPIO_EXTRA_OBJECTS)
-AC_SUBST(MPIO_EXTRA_TMP_POBJECTS)
-AC_SUBST(MPIO_EXTRA_REAL_POBJECTS)
-#
-# Use DOCTEXT instead of doctext
-AC_CHECK_PROGS(DOCTEXT,doctext,true)
-AC_SUBST(DOCTEXT)
-#
-if test $NOF77 = 1 ; then
- F77=":"
-else
- FORTRAN_TEST="fperf fcoll_test fmisc pfcoll_test"
-fi
-#
-if test $WITHIN_KNOWN_MPI_IMPL = no ; then
- PAC_TEST_MPI
- PAC_NEEDS_FINT
-else
- NEEDS_MPI_FINT=""
-fi
-#
-if test "$MPI_INCLUDE_DIR" = "." ; then
- ROMIO_INCLUDE="-I../include"
-else
- ROMIO_INCLUDE="-I../include -I$MPI_INCLUDE_DIR"
-fi
-#
-TEST_LIBNAME=$LIBNAME
-MPIRUN=mpirun
-#
-# if MPICH, use mpicc in test programs
-#
-if test "$FROM_MPICH" = yes ; then
- MPICH_HOME=`dirname $ROMIO_HOME`
- if test -z "$MPI_BIN_DIR" ; then MPI_BIN_DIR=$MPICH_HOME/bin ; fi
- TEST_CC=$MPI_BIN_DIR/mpicc
- MPI_LIB=""
- ROMIO_INCLUDE=""
- USER_CFLAGS=""
- USER_FFLAGS=""
- TEST_LIBNAME=""
- MPIRUN=$MPI_BIN_DIR/mpirun
- if test -n "$arch_SX4" || test -n "$arch_hpux" ; then
- TEST_F77=$MPI_BIN_DIR/mpif90
- else
- TEST_F77=$MPI_BIN_DIR/mpif77
- fi
- CC=$MPI_BIN_DIR/mpicc
- # A later test will insert the mpi2-other/info and array directories based
- # on the value of BUILD_MPI_xxxx. This lets MPICH2 turn these off,
- # since MPICH2 provides these routines elsewhere
- EXTRA_DIRS="mpi-io/fortran"
- # Some older implementations of the ADI do not include the
- # MPID_Status_set_bytes routine. This uses either the
- # environment variable ADI3_WITHOUT_SET_BYTES or the
- # with arg --without-setbytes
- if test "$ADI2_WITHOUT_SET_BYTES" != yes -a \
- "$with_setbytes" != no ; then
- AC_DEFINE(HAVE_STATUS_SET_BYTES,1,[Define if have MPIR_Status_set_bytes])
- fi
-elif test $FROM_LAM = yes ; then
- # LAM does have the status set bytes functionality
- AC_DEFINE(HAVE_STATUS_SET_BYTES,1,[Define if have MPIR_Status_set_bytes])
-
- # Used in the tests/ subdirectory for after ROMIO is built
- TEST_CC=mpicc
- TEST_F77=mpif77
- MPIRUN=mpirun
- MPI_LIB=
- ROMIO_INCLUDE=
- USER_CFLAGS=
- USER_FFLAGS=
- TEST_LIBNAME=
- EXTRA_DIRS="mpi-io/fortran mpi2-other/info mpi2-other/info/fortran mpi2-other/array mpi2-other/array/fortran"
-elif test $FROM_MPICH2 = yes ; then
- # For now, separate the mpich2 from mpich cases
- MPICH_HOME=`dirname $ROMIO_HOME`
- MPICH_HOME=`dirname $MPICH_HOME`
- MPICH_HOME=`dirname $MPICH_HOME`
- if test -z "$MPI_BIN_DIR" ; then MPI_BIN_DIR=$MPICH_HOME/bin ; fi
- # No special compiler script.
- # BUT we need the include paths
- # CC="$CC -I${use_top_srcdir}/src/include -I${top_build_dir}/src/include"
- # TEST_CC="$CC"
- # MPI_LIB="$LIBNAME"
- # To allow ROMIO to work with the LIBTOOL scripts, we want to
- # work directly with the CC, not the mpicc, compiler.
- # Note that in the "FROM_MPICH2" case, the CPPFLAGS and INCLUDES are already
- # properly set
- #CC=${top_build_dir}/bin/mpicc
- #
- # set the compilers to the ones in MPICH2 bin directory (master_top_builddir/bin)
- TEST_CC='$(bindir)/mpicc'
- TEST_F77='$(bindir)/mpif77'
- MPI_H_INCLUDE="-I${master_top_builddir}/src/include"
- ROMIO_INCLUDE=""
- USER_CFLAGS=""
- USER_FFLAGS=""
- TEST_LIBNAME=""
- MPIRUN='$(bindir)/mpiexec'
- #
- # Turn off the building of the Fortran interface and the Info routines
- EXTRA_DIRS=""
- AC_DEFINE(HAVE_STATUS_SET_BYTES,1,[Define if status_set_bytes available])
- DEFINE_HAVE_MPI_GREQUEST="#define HAVE_MPI_GREQUEST 1"
- AC_DEFINE(HAVE_MPIU_FUNCS,1,[Define if MPICH2 memory tracing macros defined])
-fi
-#
-#
-# feature tests: we can't test features if building as part of MPICH because
-# we don't yet have an implementation against which we can test
-#
-if test $WITHIN_KNOWN_MPI_IMPL = no ; then
- PAC_TEST_MPIR_STATUS_SET_BYTES
- PAC_TEST_MPI_GREQUEST
- PAC_TEST_MPIU_FUNCS
- AC_DEFINE(PRINT_ERR_MSG,1,[Define for printing error messages])
-fi
-#
-if test -z "$TEST_CC" ; then
- TEST_CC="$CC"
-fi
-if test -z "$TEST_F77" ; then
- TEST_F77="$F77"
-fi
-#
-AC_CHECK_FUNCS(strdup)
-if test "$ac_cv_func_strdup" = "yes" ; then
- # Do we need to declare strdup?
- PAC_FUNC_NEEDS_DECL([#include <string.h>],strdup)
-fi
-AC_CHECK_FUNCS(snprintf)
-if test "$ac_cv_func_snprintf" = "yes" ; then
- # Do we need to declare snprintf?
- PAC_FUNC_NEEDS_DECL([#include <stdio.h>],snprintf)
-fi
-AC_CHECK_FUNCS(lstat)
-if test "$ac_cv_func_lstat" = "yes" ; then
- # Do we need to declare lstat?
- PAC_FUNC_NEEDS_DECL([#include <unistd.h>],lstat)
-fi
-AC_CHECK_FUNCS(readlink)
-if test "$ac_cv_func_readlink" = "yes" ; then
- # Do we need to declare readlink?
- PAC_FUNC_NEEDS_DECL([#include <unistd.h>],readlink)
-fi
-AC_CHECK_FUNCS(fsync)
-if test "$ac_cv_func_fsync" = "yes" ; then
- # Do we need to declare fsync?
- PAC_FUNC_NEEDS_DECL([#include <unistd.h>],fsync)
-fi
-AC_CHECK_FUNCS(ftruncate)
-if test "$ac_cv_func_ftruncate" = "yes" ; then
- # Do we need to declare ftruncate?
- PAC_FUNC_NEEDS_DECL([#include <unistd.h>],ftruncate)
-fi
-
-AC_CHECK_FUNCS(lseek64)
-if test "$ac_cv_func_lseek64" = "yes" ; then
- PAC_FUNC_NEEDS_DECL([#include <unistd.h>],lseek64)
-fi
-#
-# Create the directory lists for the Makefile
-FILE_SYS_DIRS=""
-for dir in $FILE_SYSTEM ; do
- FILE_SYS_DIRS="$FILE_SYS_DIRS adio/ad_$dir"
-done
-# FIXME eliminate FILE_SYS_DIRS and EXTRA_SRC_DIRS
-EXTRA_SRC_DIRS=""
-
-mpio_glue=""
-if test "$FROM_MPICH2" = yes -o "${MPI_IMPL}_mpi" = "mpich2_mpi"; then
- mpio_glue=mpich2
-elif test "$FROM_MPICH" = yes -o "${MPI_IMPL}_mpi" = "mpich_mpi"; then
- mpio_glue=mpich1
-else
- mpio_glue=default
-fi
-
-AM_CONDITIONAL([MPIO_GLUE_MPICH2],[test "X$mpio_glue" = "Xmpich2"])
-AM_CONDITIONAL([MPIO_GLUE_MPICH1],[test "X$mpio_glue" = "Xmpich1"])
-AM_CONDITIONAL([MPIO_GLUE_DEFAULT],[test "X$mpio_glue" = "Xdefault"])
-
-if test "$BUILD_MPI_INFO" = 1 ; then
- EXTRA_SRC_DIRS="$EXTRA_SRC_DIRS mpi2-other/info"
- if test "$NOF77" = 0 -a "$FROM_MPICH2" != yes ; then
- EXTRA_SRC_DIRS="$EXTRA_SRC_DIRS mpi2-other/info/fortran"
- fi
-fi
-if test "$BUILD_MPI_ARRAY" = 1 ; then
- EXTRA_SRC_DIRS="$EXTRA_SRC_DIRS mpi2-other/array"
- if test "$NOF77" = 0 -a "$FROM_MPICH2" != yes ; then
- EXTRA_SRC_DIRS="$EXTRA_SRC_DIRS mpi2-other/array/fortran"
- fi
-fi
-if test "$NOF77" = 0 -a "$FROM_MPICH2" != yes ; then
- EXTRA_SRC_DIRS="$EXTRA_SRC_DIRS mpi-io/fortran"
-fi
-AC_SUBST(EXTRA_SRC_DIRS)
-AC_SUBST(FILE_SYS_DIRS)
-
-#
-CFLAGS="$CFLAGS -DHAVE_ROMIOCONF_H"
-#
-
-if test -n "$MPIOF_H_INCLUDED"; then
- F77MPIOINC=""
-else
- F77MPIOINC="include 'mpiof.h'"
-fi
-
-AC_CHECK_HEADERS(unistd.h,
- AC_MSG_CHECKING([for large file defines])
- AC_TRY_COMPILE([
- #include <unistd.h>
- ], [
- #ifndef _LFS64_LARGEFILE
- #error no largefile defines
- #endif
- ],
- CFLAGS="${CFLAGS} -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64"
- AC_MSG_RESULT(yes),
- AC_MSG_RESULT(none) )
- )
-
-echo "setting SYSDEP_INC to $SYSDEP_INC"
-AC_SUBST(SYSDEP_INC)
-
-AC_C_RESTRICT
-PAC_C_GNU_ATTRIBUTE
-
-# support gcov test coverage information
-PAC_ENABLE_COVERAGE
-
-echo "setting CC to $CC"
-echo "setting F77 to $F77"
-echo "setting TEST_CC to $TEST_CC"
-echo "setting TEST_F77 to $TEST_F77"
-echo "setting CFLAGS to $CFLAGS"
-echo "setting USER_CFLAGS to $USER_CFLAGS"
-echo "setting USER_FFLAGS to $USER_FFLAGS"
-
-AC_SUBST(ARCH)
-AC_SUBST(FILE_SYSTEM)
-AC_SUBST(CC)
-AC_SUBST(CPPFLAGS)
-AC_SUBST(CFLAGS)
-AC_SUBST(USER_CFLAGS)
-AC_SUBST(USER_FFLAGS)
-AC_SUBST(MIPS)
-AC_SUBST(BITS)
-AC_SUBST(AR)
-AC_SUBST(AR_FLAGS)
-AC_SUBST(MPI_INCLUDE_DIR)
-AC_SUBST(MPI_LIB)
-AC_SUBST(F77)
-AC_SUBST(NOF77)
-AC_SUBST(NOPROFILE)
-AC_SUBST(MAKE)
-AC_SUBST(arch_IRIX)
-AC_SUBST(ROMIO_HOME)
-AC_SUBST(LIBNAME)
-AC_SUBST(TEST_LIBNAME)
-AC_SUBST(LL)
-AC_SUBST(F77GETARG)
-AC_SUBST(F77IARGC)
-AC_SUBST(F77MPIOINC)
-AC_SUBST(FTESTDEFINE)
-AC_SUBST(FORTRAN_MPI_OFFSET)
-AC_SUBST(FROM_MPICH)
-AC_SUBST(FROM_MPICH2)
-AC_SUBST(FROM_LAM)
-AC_SUBST(WITHIN_KNOWN_MPI_IMPL)
-AC_SUBST(NEEDS_MPI_FINT)
-AC_SUBST(HAVE_MPI_INFO)
-AC_SUBST(BUILD_MPI_INFO)
-AC_SUBST(HAVE_MPI_DARRAY_SUBARRAY)
-AC_SUBST(BUILD_MPI_ARRAY)
-AC_SUBST(DEFINE_MPI_OFFSET)
-AC_SUBST(DEFINE_HAVE_MPI_GREQUEST)
-AC_SUBST(MPI_OFFSET_TYPE)
-AC_SUBST(MPI_FINFO1)
-AC_SUBST(MPI_FINFO2)
-AC_SUBST(MPI_FINFO3)
-AC_SUBST(MPI_FINFO4)
-AC_SUBST(MPI_FARRAY1)
-AC_SUBST(MPI_FARRAY2)
-AC_SUBST(MPI_FARRAY3)
-AC_SUBST(MPI_FARRAY4)
-AC_SUBST(MPI_FARRAY5)
-AC_SUBST(MPI_FARRAY6)
-AC_SUBST(MPI_FARRAY7)
-AC_SUBST(MPI_OFFSET_KIND1)
-AC_SUBST(MPI_OFFSET_KIND2)
-AC_SUBST(TEST_CC)
-AC_SUBST(TEST_F77)
-AC_SUBST(ROMIO_INCLUDE)
-AC_SUBST(ROMIO_LFLAGS)
-AC_SUBST(ROMIO_TCFLAGS)
-AC_SUBST(ROMIO_TCPPFLAGS)
-AC_SUBST(ROMIO_TFFLAGS)
-AC_SUBST(MPIRUN)
-AC_SUBST(FORTRAN_TEST)
-dnl
-dnl Dependency handling
-AC_SUBST(MAKE_DEPEND_C)
-dnl
-dnl Support shared libraries
-if test -z "$ENABLE_SHLIB" ; then
- ENABLE_SHLIB=none
-fi
-AC_SUBST(ENABLE_SHLIB)
-AC_SUBST(CC_SHL)
-AC_SUBST(LIBTOOL)
-# Remove the .a from the library file name (so that we can use .so or
-# other appropriate suffix)
-SHLIBNAME=`echo $LIBNAME | sed 's/\.a$//'`
-AC_SUBST(SHLIBNAME)
-dnl
-if test ! -d adio ; then mkdir adio ; fi
-if test ! -d adio/include ; then mkdir adio/include ; fi
-if test ! -d mpi2-other ; then mkdir mpi2-other ; fi
-if test ! -d mpi-io ; then mkdir mpi-io ; fi
-if test ! -d mpi-io/glue ; then mkdir mpi-io/glue ; fi
-
-# Create makefiles for all of the adio devices. Only the ones that
-# are active will be called by the top level ROMIO make
-AC_OUTPUT_COMMANDS([chmod 755 util/romioinstall test/runtests])
-AC_CONFIG_FILES([
- Makefile
- localdefs
- mpi2-other/info/Makefile
- mpi2-other/array/Makefile
- test/Makefile
- test/misc.c
- test/large_file.c
- test/runtests
- test-internal/Makefile
- util/romioinstall
- include/mpio.h
- include/mpiof.h
- mpi2-other/info/fortran/Makefile
- mpi2-other/array/fortran/Makefile
- test/fmisc.f
- test/fcoll_test.f
- test/pfcoll_test.f
- test/fperf.f
-])
-AC_OUTPUT
-
-#
-rm -f *.o
-
-if test $FROM_MPICH = no -a $FROM_MPICH2 = no ; then
- AC_MSG_RESULT([Configure done. Now type make.])
-fi
-dnl PAC_SUBDIR_CACHE_CLEANUP
-exit 0
Copied: mpich2/trunk/src/mpid/ch3/channels/dllchan/configure.ac (from rev 9546, mpich2/trunk/src/mpid/ch3/channels/dllchan/configure.in)
===================================================================
--- mpich2/trunk/src/mpid/ch3/channels/dllchan/configure.ac (rev 0)
+++ mpich2/trunk/src/mpid/ch3/channels/dllchan/configure.ac 2012-02-28 23:26:34 UTC (rev 9548)
@@ -0,0 +1,148 @@
+AC_INIT(configure.ac)
+
+dnl
+dnl Set the directory that contains support scripts such as install-sh and
+dnl config.guess
+dnl
+AC_CONFIG_AUX_DIR(../../../../../confdb)
+
+dnl Definitions will be placed in this file rather than in the DEFS variable
+dnl
+AC_CONFIG_HEADER(include/mpidi_ch3i_dllchan_conf.h)
+AH_TOP([/* -*- Mode: C; c-basic-offset:4 ; -*- */
+/*
+ * (C) 2001 by Argonne National Laboratory.
+ * See COPYRIGHT in top-level directory.
+ */
+#ifndef MPIDI_CH3I_DLLCHAN_CONF_H_INCLUDED
+#define MPIDI_CH3I_DLLCHAN_CONF_H_INCLUDED
+])
+AH_BOTTOM([#endif])
+
+echo "RUNNING CONFIGURE FOR THE DLL CHANNEL"
+
+save_libs=$LIBS
+LIBS=
+
+dnl
+dnl First check that we have a clean build if we are doing a VPATH build
+PAC_VPATH_CHECK()
+
+PAC_LOAD_BASE_CACHE
+
+PAC_PROG_MAKE
+
+AC_CHECK_HEADERS(assert.h)
+
+LIBS=$save_libs
+
+if test -z "$SHLIB_EXT" ; then
+ AC_MSG_ERROR([The dllchan channel requires shared library support and the symbold SHLIB_EXT (the extension of a shared library) is empty])
+fi
+MPICH_SHLIB_EXT='"'$SHLIB_EXT'"'
+AC_DEFINE_UNQUOTED(MPICH_SHLIB_EXT,$MPICH_SHLIB_EXT,[Extension for shared libraries])
+
+# AR_FLAGS provides a way to potentially improve build performance on Mac OSX
+if test -z "$AR_FLAGS" ; then AR_FLAGS=cr ; fi
+
+# ABIVERSION is needed when a separate sock dll library is built (e.g., for
+# dllchan)
+if test "X$ABIVERSION" = "X" ; then
+ if test "X$libmpich_so_version" != X ; then
+ ABIVERSION="$libmpich_so_version"
+ else
+ # Note that an install of a sock-dll will fail if the ABI version is not
+ # available
+ AC_MSG_WARN([Unable to set the ABIVERSION])
+ fi
+fi
+AC_SUBST(ABIVERSION)
+
+
+AC_SUBST(device_name)
+AC_SUBST(channel_name)
+AC_SUBST(AR)
+AC_SUBST(AR_FLAGS)
+AC_SUBST(RANLIB)
+AC_SUBST(MPILIBNAME)
+AC_SUBST(CC)
+AC_SUBST(CFLAGS)
+AC_SUBST(CPPFLAGS)
+PAC_CC_SUBDIR_SHLIBS
+AC_SUBST(master_top_srcdir)
+AC_SUBST(master_top_builddir)
+dnl
+dnl Dependency handling
+AC_SUBST(MAKE_DEPEND_C)
+
+dnl
+dnl Etags
+AC_SUBST(ETAGS)
+AC_SUBST(ETAGSADD)
+export ETAGS
+export ETAGSADD
+
+
+PAC_UPDATE_BASE_CACHE
+
+# -------------------------------------------------------------------------
+# FIXME: This isn't clean enough yet
+# We need to build the DLL for the selected channels.
+
+# Extract the subchannel names from the channel_args. Set the default to
+# sock
+if test -z "$channel_args" ; then
+ channel_args=sock
+fi
+
+export ABIVERSION
+
+channel_args=`echo $channel_args | sed -e 's/,/ /g'`
+builddir=`(cd .. && pwd)`
+SUBCHANNELS=$channel_args
+AC_SUBST(SUBCHANNELS)
+firstChannel=""
+for subchannel_name in $channel_args ; do
+
+ if test ! -d $srcdir/../${subchannel_name} ; then
+ AC_MSG_ERROR([Channel ${subchannel_name} is unknown])
+ elif test ! -x $srcdir/../${subchannel_name}/configure ; then
+ AC_MSG_ERROR([Channel ${subchannel_name} has no configure])
+ fi
+
+ if test -z "$firstChannel" ; then
+ firstChannel=$subchannel_name
+ fi
+ #
+ # Because of the complexity in setting up channels, we invoke a script
+ # for those channels that are prepared to provide dynamically-loaded modules
+ rc=0
+ if test -x $builddir/$subchannel_name/builddll ; then
+ # We're ok
+ :
+ elif test -x $srcdir/../${subchannel_name}/builddll ; then
+ # Create the local directory
+ if test ! -d $builddir/$subchannel_name ; then
+ mkdir $builddir/$subchannel_name
+ fi
+ else
+ AC_MSG_ERROR([Channel $subchannel_name does not support dynamic loading])
+ fi
+
+# (cd ../$subchannel_name && \
+# $srcdir/../$subchannel_name/builddll --prefix=${prefix} \
+# --libdir=${libdir} \
+# --exec-prefix=${exec_prefix} \
+# )
+# rc=$?
+# if test "$rc" != 0 ; then
+dnl # AC_MSG_ERROR([Failure in building dynamic library for $subchannel_name])
+# fi
+done
+
+# The default channel is sock if no channels selected. Otherwise,
+# it is the first of the channels in the list
+MPICH_DEFAULT_CH3_CHANNEL='"'$firstChannel'"'
+AC_DEFINE_UNQUOTED(MPICH_DEFAULT_CH3_CHANNEL,$MPICH_DEFAULT_CH3_CHANNEL,[Define the name of the channel to use if none is selected])
+
+AC_OUTPUT(Makefile src/Makefile localdefs)
Deleted: mpich2/trunk/src/mpid/ch3/channels/dllchan/configure.in
===================================================================
--- mpich2/trunk/src/mpid/ch3/channels/dllchan/configure.in 2012-02-28 23:25:23 UTC (rev 9547)
+++ mpich2/trunk/src/mpid/ch3/channels/dllchan/configure.in 2012-02-28 23:26:34 UTC (rev 9548)
@@ -1,148 +0,0 @@
-AC_INIT(configure.in)
-
-dnl
-dnl Set the directory that contains support scripts such as install-sh and
-dnl config.guess
-dnl
-AC_CONFIG_AUX_DIR(../../../../../confdb)
-
-dnl Definitions will be placed in this file rather than in the DEFS variable
-dnl
-AC_CONFIG_HEADER(include/mpidi_ch3i_dllchan_conf.h)
-AH_TOP([/* -*- Mode: C; c-basic-offset:4 ; -*- */
-/*
- * (C) 2001 by Argonne National Laboratory.
- * See COPYRIGHT in top-level directory.
- */
-#ifndef MPIDI_CH3I_DLLCHAN_CONF_H_INCLUDED
-#define MPIDI_CH3I_DLLCHAN_CONF_H_INCLUDED
-])
-AH_BOTTOM([#endif])
-
-echo "RUNNING CONFIGURE FOR THE DLL CHANNEL"
-
-save_libs=$LIBS
-LIBS=
-
-dnl
-dnl First check that we have a clean build if we are doing a VPATH build
-PAC_VPATH_CHECK()
-
-PAC_LOAD_BASE_CACHE
-
-PAC_PROG_MAKE
-
-AC_CHECK_HEADERS(assert.h)
-
-LIBS=$save_libs
-
-if test -z "$SHLIB_EXT" ; then
- AC_MSG_ERROR([The dllchan channel requires shared library support and the symbold SHLIB_EXT (the extension of a shared library) is empty])
-fi
-MPICH_SHLIB_EXT='"'$SHLIB_EXT'"'
-AC_DEFINE_UNQUOTED(MPICH_SHLIB_EXT,$MPICH_SHLIB_EXT,[Extension for shared libraries])
-
-# AR_FLAGS provides a way to potentially improve build performance on Mac OSX
-if test -z "$AR_FLAGS" ; then AR_FLAGS=cr ; fi
-
-# ABIVERSION is needed when a separate sock dll library is built (e.g., for
-# dllchan)
-if test "X$ABIVERSION" = "X" ; then
- if test "X$libmpich_so_version" != X ; then
- ABIVERSION="$libmpich_so_version"
- else
- # Note that an install of a sock-dll will fail if the ABI version is not
- # available
- AC_MSG_WARN([Unable to set the ABIVERSION])
- fi
-fi
-AC_SUBST(ABIVERSION)
-
-
-AC_SUBST(device_name)
-AC_SUBST(channel_name)
-AC_SUBST(AR)
-AC_SUBST(AR_FLAGS)
-AC_SUBST(RANLIB)
-AC_SUBST(MPILIBNAME)
-AC_SUBST(CC)
-AC_SUBST(CFLAGS)
-AC_SUBST(CPPFLAGS)
-PAC_CC_SUBDIR_SHLIBS
-AC_SUBST(master_top_srcdir)
-AC_SUBST(master_top_builddir)
-dnl
-dnl Dependency handling
-AC_SUBST(MAKE_DEPEND_C)
-
-dnl
-dnl Etags
-AC_SUBST(ETAGS)
-AC_SUBST(ETAGSADD)
-export ETAGS
-export ETAGSADD
-
-
-PAC_UPDATE_BASE_CACHE
-
-# -------------------------------------------------------------------------
-# FIXME: This isn't clean enough yet
-# We need to build the DLL for the selected channels.
-
-# Extract the subchannel names from the channel_args. Set the default to
-# sock
-if test -z "$channel_args" ; then
- channel_args=sock
-fi
-
-export ABIVERSION
-
-channel_args=`echo $channel_args | sed -e 's/,/ /g'`
-builddir=`(cd .. && pwd)`
-SUBCHANNELS=$channel_args
-AC_SUBST(SUBCHANNELS)
-firstChannel=""
-for subchannel_name in $channel_args ; do
-
- if test ! -d $srcdir/../${subchannel_name} ; then
- AC_MSG_ERROR([Channel ${subchannel_name} is unknown])
- elif test ! -x $srcdir/../${subchannel_name}/configure ; then
- AC_MSG_ERROR([Channel ${subchannel_name} has no configure])
- fi
-
- if test -z "$firstChannel" ; then
- firstChannel=$subchannel_name
- fi
- #
- # Because of the complexity in setting up channels, we invoke a script
- # for those channels that are prepared to provide dynamically-loaded modules
- rc=0
- if test -x $builddir/$subchannel_name/builddll ; then
- # We're ok
- :
- elif test -x $srcdir/../${subchannel_name}/builddll ; then
- # Create the local directory
- if test ! -d $builddir/$subchannel_name ; then
- mkdir $builddir/$subchannel_name
- fi
- else
- AC_MSG_ERROR([Channel $subchannel_name does not support dynamic loading])
- fi
-
-# (cd ../$subchannel_name && \
-# $srcdir/../$subchannel_name/builddll --prefix=${prefix} \
-# --libdir=${libdir} \
-# --exec-prefix=${exec_prefix} \
-# )
-# rc=$?
-# if test "$rc" != 0 ; then
-dnl # AC_MSG_ERROR([Failure in building dynamic library for $subchannel_name])
-# fi
-done
-
-# The default channel is sock if no channels selected. Otherwise,
-# it is the first of the channels in the list
-MPICH_DEFAULT_CH3_CHANNEL='"'$firstChannel'"'
-AC_DEFINE_UNQUOTED(MPICH_DEFAULT_CH3_CHANNEL,$MPICH_DEFAULT_CH3_CHANNEL,[Define the name of the channel to use if none is selected])
-
-AC_OUTPUT(Makefile src/Makefile localdefs)
Modified: mpich2/trunk/src/mpid/ch3/channels/nemesis/subconfigure.m4
===================================================================
--- mpich2/trunk/src/mpid/ch3/channels/nemesis/subconfigure.m4 2012-02-28 23:25:23 UTC (rev 9547)
+++ mpich2/trunk/src/mpid/ch3/channels/nemesis/subconfigure.m4 2012-02-28 23:26:34 UTC (rev 9548)
@@ -33,7 +33,7 @@
AM_COND_IF([BUILD_CH3_NEMESIS],[
AC_MSG_NOTICE([RUNNING CONFIGURE FOR ch3:nemesis])
-## below is code that formerly lived in configure.in
+## below is code that formerly lived in configure.ac
### Only include papi in CPPFLAGS configure will handle libs, and checking that it exists, etc.
##if test -n "${papi_dir}" ; then
Copied: mpich2/trunk/src/mpid/ch3/channels/sctp/configure.ac (from rev 9546, mpich2/trunk/src/mpid/ch3/channels/sctp/configure.in)
===================================================================
--- mpich2/trunk/src/mpid/ch3/channels/sctp/configure.ac (rev 0)
+++ mpich2/trunk/src/mpid/ch3/channels/sctp/configure.ac 2012-02-28 23:26:34 UTC (rev 9548)
@@ -0,0 +1,124 @@
+AC_INIT(configure.ac)
+
+dnl
+dnl Set the directory that contains support scripts such as install-sh and
+dnl config.guess
+dnl
+AC_CONFIG_AUX_DIR(../../../../../confdb)
+
+dnl Definitions will be placed in this file rather than in the DEFS variable
+dnl
+AC_CONFIG_HEADER(include/mpidi_ch3i_sctp_conf.h)
+AH_TOP([/* -*- Mode: C; c-basic-offset:4 ; -*- */
+/*
+ * (C) 2001 by Argonne National Laboratory.
+ * See COPYRIGHT in top-level directory.
+ */
+#ifndef MPIDI_CH3I_NEMESIS_CONF_H_INCLUDED
+#define MPIDI_CH3I_NEMESIS_CONF_H_INCLUDED
+])
+AH_BOTTOM([#endif])
+
+echo "RUNNING CONFIGURE FOR THE SCTP CHANNEL"
+
+dnl
+dnl First check that we have a clean build if we are doing a VPATH build
+if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status ; then
+ AC_MSG_ERROR([You cannot do a VPATH build if the source directory has been
+ configured. Run "make distclean" in $srcdir first.])
+fi
+
+PAC_PROG_MAKE
+
+dnl AC_CHECK_HEADER(net/if.h) fails on Solaris; extra header files needed
+AC_TRY_COMPILE([
+#include <sys/types.h>
+#include <sys/socket.h>
+#include <net/if.h>
+],,lac_cv_header_net_if_h=yes,lac_cv_header_net_if_h=no)
+
+echo "checking for net/if.h... $lac_cv_header_net_if_h"
+
+if test "$lac_cv_header_net_if_h" = "yes" ; then
+ AC_DEFINE(HAVE_NET_IF_H, 1, [Define if you have the <net/if.h> header file.])
+fi
+
+AC_CHECK_HEADERS( \
+ netdb.h \
+ sys/ioctl.h \
+ sys/socket.h \
+ sys/sockio.h \
+ sys/types.h \
+ errno.h)
+
+AC_CHECK_TYPE(caddr_t, char*)
+
+# netinet/in.h often requires sys/types.h first. With AC 2.57, check_headers
+# does the right thing, which is to test whether the header is found
+# by the compiler, but this can cause problems when the header needs
+# other headers. 2.57 changes the syntax (!) of check_headers to allow
+# additional headers.
+AC_CACHE_CHECK([for netinet/in.h],ac_cv_header_netinet_in_h,[
+AC_TRY_COMPILE([#ifdef HAVE_SYS_TYPES_H
+#include <sys/types.h>
+#endif
+#include <netinet/in.h>],[int a=0;],
+ ac_cv_header_netinet_in_h=yes,
+ ac_cv_header_netinet_in_h=no)])
+if test "$ac_cv_header_netinet_in_h" = yes ; then
+ AC_DEFINE(HAVE_NETINET_IN_H,1,[Define if netinet/in.h exists])
+fi
+
+
+AC_ARG_WITH(sctp, [--with-sctp=path - specify path where sctp include directory and lib directory can be found],
+if test "${with_sctp}" != "yes" -a "${with_sctp}" != "no" ; then
+ LDFLAGS="$LDFLAGS -L${with_sctp}/lib"
+ CPPFLAGS="$CPPFLAGS -I${with_sctp}/include"
+fi,)
+AC_ARG_WITH(sctp-include, [--with-sctp-include=path - specify path to sctp include directory],
+if test "${with_sctp_include}" != "yes" -a "${with_sctp_include}" != "no" ; then
+ CPPFLAGS="$CPPFLAGS -I${with_sctp_include}"
+fi,)
+AC_ARG_WITH(sctp-lib, [--with-sctp-lib=path - specify path to sctp lib directory],
+if test "${with_sctp_lib}" != "yes" -a "${with_sctp_lib}" != "no" ; then
+ LDFLAGS="$LDFLAGS -L${with_sctp_lib}"
+fi,)
+
+AC_CHECK_HEADER([netinet/sctp.h], , [
+ AC_MSG_ERROR(['sctp.h not found. Did you specify --with-sctp= or --with-sctp-include=?'])
+ ])
+AC_CHECK_FUNCS(sctp_recvmsg, , AC_CHECK_LIB(sctp, sctp_recvmsg, , [
+ AC_MSG_ERROR(['sctp library not found. Did you specify --with-sctp= or --with-sctp-lib=?'])
+ ]))
+
+AC_SUBST(device_name)
+AC_SUBST(channel_name)
+
+AC_SUBST(AR)
+AC_SUBST(AR_FLAGS)
+AC_SUBST(RANLIB)
+AC_SUBST(MPILIBNAME)
+AC_SUBST(CC)
+AC_SUBST(CFLAGS)
+AC_SUBST(CPPFLAGS)
+PAC_CC_SUBDIR_SHLIBS
+AC_SUBST(master_top_srcdir)
+# Master_top_builddir is imported from the top; use it for the "top"
+# (used for things like libtool)
+if test -z "$master_top_builddir" ; then
+ if test -s ../../../../../.mpich2 ; then
+ master_top_builddir=../../../../..
+ fi
+fi
+AC_SUBST(master_top_builddir)
+dnl
+dnl Dependency handling
+AC_SUBST(MAKE_DEPEND_C)
+dnl
+dnl Etags
+AC_SUBST(ETAGS)
+AC_SUBST(ETAGSADD)
+export ETAGS
+export ETAGSADD
+
+AC_OUTPUT(Makefile src/Makefile localdefs)
Deleted: mpich2/trunk/src/mpid/ch3/channels/sctp/configure.in
===================================================================
--- mpich2/trunk/src/mpid/ch3/channels/sctp/configure.in 2012-02-28 23:25:23 UTC (rev 9547)
+++ mpich2/trunk/src/mpid/ch3/channels/sctp/configure.in 2012-02-28 23:26:34 UTC (rev 9548)
@@ -1,124 +0,0 @@
-AC_INIT(configure.in)
-
-dnl
-dnl Set the directory that contains support scripts such as install-sh and
-dnl config.guess
-dnl
-AC_CONFIG_AUX_DIR(../../../../../confdb)
-
-dnl Definitions will be placed in this file rather than in the DEFS variable
-dnl
-AC_CONFIG_HEADER(include/mpidi_ch3i_sctp_conf.h)
-AH_TOP([/* -*- Mode: C; c-basic-offset:4 ; -*- */
-/*
- * (C) 2001 by Argonne National Laboratory.
- * See COPYRIGHT in top-level directory.
- */
-#ifndef MPIDI_CH3I_NEMESIS_CONF_H_INCLUDED
-#define MPIDI_CH3I_NEMESIS_CONF_H_INCLUDED
-])
-AH_BOTTOM([#endif])
-
-echo "RUNNING CONFIGURE FOR THE SCTP CHANNEL"
-
-dnl
-dnl First check that we have a clean build if we are doing a VPATH build
-if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status ; then
- AC_MSG_ERROR([You cannot do a VPATH build if the source directory has been
- configured. Run "make distclean" in $srcdir first.])
-fi
-
-PAC_PROG_MAKE
-
-dnl AC_CHECK_HEADER(net/if.h) fails on Solaris; extra header files needed
-AC_TRY_COMPILE([
-#include <sys/types.h>
-#include <sys/socket.h>
-#include <net/if.h>
-],,lac_cv_header_net_if_h=yes,lac_cv_header_net_if_h=no)
-
-echo "checking for net/if.h... $lac_cv_header_net_if_h"
-
-if test "$lac_cv_header_net_if_h" = "yes" ; then
- AC_DEFINE(HAVE_NET_IF_H, 1, [Define if you have the <net/if.h> header file.])
-fi
-
-AC_CHECK_HEADERS( \
- netdb.h \
- sys/ioctl.h \
- sys/socket.h \
- sys/sockio.h \
- sys/types.h \
- errno.h)
-
-AC_CHECK_TYPE(caddr_t, char*)
-
-# netinet/in.h often requires sys/types.h first. With AC 2.57, check_headers
-# does the right thing, which is to test whether the header is found
-# by the compiler, but this can cause problems when the header needs
-# other headers. 2.57 changes the syntax (!) of check_headers to allow
-# additional headers.
-AC_CACHE_CHECK([for netinet/in.h],ac_cv_header_netinet_in_h,[
-AC_TRY_COMPILE([#ifdef HAVE_SYS_TYPES_H
-#include <sys/types.h>
-#endif
-#include <netinet/in.h>],[int a=0;],
- ac_cv_header_netinet_in_h=yes,
- ac_cv_header_netinet_in_h=no)])
-if test "$ac_cv_header_netinet_in_h" = yes ; then
- AC_DEFINE(HAVE_NETINET_IN_H,1,[Define if netinet/in.h exists])
-fi
-
-
-AC_ARG_WITH(sctp, [--with-sctp=path - specify path where sctp include directory and lib directory can be found],
-if test "${with_sctp}" != "yes" -a "${with_sctp}" != "no" ; then
- LDFLAGS="$LDFLAGS -L${with_sctp}/lib"
- CPPFLAGS="$CPPFLAGS -I${with_sctp}/include"
-fi,)
-AC_ARG_WITH(sctp-include, [--with-sctp-include=path - specify path to sctp include directory],
-if test "${with_sctp_include}" != "yes" -a "${with_sctp_include}" != "no" ; then
- CPPFLAGS="$CPPFLAGS -I${with_sctp_include}"
-fi,)
-AC_ARG_WITH(sctp-lib, [--with-sctp-lib=path - specify path to sctp lib directory],
-if test "${with_sctp_lib}" != "yes" -a "${with_sctp_lib}" != "no" ; then
- LDFLAGS="$LDFLAGS -L${with_sctp_lib}"
-fi,)
-
-AC_CHECK_HEADER([netinet/sctp.h], , [
- AC_MSG_ERROR(['sctp.h not found. Did you specify --with-sctp= or --with-sctp-include=?'])
- ])
-AC_CHECK_FUNCS(sctp_recvmsg, , AC_CHECK_LIB(sctp, sctp_recvmsg, , [
- AC_MSG_ERROR(['sctp library not found. Did you specify --with-sctp= or --with-sctp-lib=?'])
- ]))
-
-AC_SUBST(device_name)
-AC_SUBST(channel_name)
-
-AC_SUBST(AR)
-AC_SUBST(AR_FLAGS)
-AC_SUBST(RANLIB)
-AC_SUBST(MPILIBNAME)
-AC_SUBST(CC)
-AC_SUBST(CFLAGS)
-AC_SUBST(CPPFLAGS)
-PAC_CC_SUBDIR_SHLIBS
-AC_SUBST(master_top_srcdir)
-# Master_top_builddir is imported from the top; use it for the "top"
-# (used for things like libtool)
-if test -z "$master_top_builddir" ; then
- if test -s ../../../../../.mpich2 ; then
- master_top_builddir=../../../../..
- fi
-fi
-AC_SUBST(master_top_builddir)
-dnl
-dnl Dependency handling
-AC_SUBST(MAKE_DEPEND_C)
-dnl
-dnl Etags
-AC_SUBST(ETAGS)
-AC_SUBST(ETAGSADD)
-export ETAGS
-export ETAGSADD
-
-AC_OUTPUT(Makefile src/Makefile localdefs)
Modified: mpich2/trunk/src/mpid/ch3/channels/sock/subconfigure.m4
===================================================================
--- mpich2/trunk/src/mpid/ch3/channels/sock/subconfigure.m4 2012-02-28 23:25:23 UTC (rev 9547)
+++ mpich2/trunk/src/mpid/ch3/channels/sock/subconfigure.m4 2012-02-28 23:26:34 UTC (rev 9548)
@@ -59,7 +59,7 @@
AC_DEFUN([PAC_SUBCFG_BODY_]PAC_SUBCFG_AUTO_SUFFIX,[
AM_COND_IF([BUILD_CH3_SOCK],[
AC_MSG_NOTICE([RUNNING CONFIGURE FOR ch3:sock])
-# code that formerly lived in configure.in
+# code that formerly lived in configure.ac
# FIXME this must be namespaced now that we've flattened things
#
Copied: mpich2/trunk/src/mpid/dcmfd/configure.ac (from rev 9546, mpich2/trunk/src/mpid/dcmfd/configure.in)
===================================================================
--- mpich2/trunk/src/mpid/dcmfd/configure.ac (rev 0)
+++ mpich2/trunk/src/mpid/dcmfd/configure.ac 2012-02-28 23:26:34 UTC (rev 9548)
@@ -0,0 +1,94 @@
+AC_INIT(configure.ac)
+
+dnl
+dnl Set the directory that contains support scripts such as install-sh and
+dnl config.guess
+dnl
+AC_CONFIG_AUX_DIR(../../../confdb)
+
+dnl Definitions will be placed in this file rather than in the DEFS variable
+dnl
+AC_CONFIG_HEADER(include/mpid_config.h)
+
+echo "RUNNING CONFIGURE FOR DCMF DEVICE"
+
+# First check that we have a clean build if we are doing a VPATH build
+PAC_VPATH_CHECK()
+
+# -----------------------------------------------------------------------------
+# experiment with creating a cache file. Load if it exists
+#if test -n "$CONF_BASE_CACHEFILE" -a -s "$CONF_BASE_CACHEFILE" ; then
+# echo "Loading base cachefile $CONF_BASE_CACHEFILE"
+# . $CONF_BASE_CACHEFILE
+# export CONF_BASE_CACHEFILE
+#fi
+PAC_LOAD_BASE_CACHE
+# -----------------------------------------------------------------------------
+
+
+ASSERT_LEVEL=2
+AC_ARG_WITH(assert-level,
+ AS_HELP_STRING([--with-assert-level={0 1 2}],[set build assert-level (default: 2)]),
+ [ ASSERT_LEVEL=$withval ])
+AC_SUBST(ASSERT_LEVEL)
+AC_DEFINE_UNQUOTED([ASSERT_LEVEL], $ASSERT_LEVEL, [Which messager is being used])
+
+USE_COLL=ccmi
+AC_ARG_WITH(opt-coll,
+ AS_HELP_STRING([--with-opt-coll={none ccmi}],[which optimized collectives to use (default: ccmi)]),
+ [ USE_COLL=$withval ])
+if test "$USE_COLL" = "ccmi" ; then
+ AC_DEFINE_UNQUOTED([USE_CCMI_COLL], 1, [Define to use CCMI collectives])
+fi
+
+
+#
+# bring in the default implementation of the MPID_Thread package
+#
+MPID_THREAD_SRCDIR="../common/thread"
+builtin(include,../common/thread/mpid_thread.m4)
+
+
+PAC_PROG_MAKE
+
+if echo $CFLAGS | grep -q -- -Wall
+then
+ CFLAGS="$CFLAGS -Werror"
+fi
+if echo $CFLAGS | grep -q -- -qflag
+then
+ CFLAGS="$CFLAGS -qhalt=w"
+fi
+AC_SUBST(AR)
+AC_SUBST(AR_FLAGS)
+AC_SUBST(RANLIB)
+AC_SUBST(MPILIBNAME)
+AC_SUBST(CC)
+AC_SUBST(CFLAGS)
+AC_SUBST(CPPFLAGS)
+AC_SUBST(CC_SHL)
+AC_SUBST(C_LINK_SHL)
+AC_SUBST(master_top_srcdir)
+AC_SUBST(master_top_builddir)
+AC_SUBST(MAKE_DEPEND_C)
+AC_SUBST(ENABLE_SHLIB)
+AC_SUBST(MKDIR_P)
+
+INSTALL="/usr/bin/install -c"
+INSTALL_PROGRAM="${INSTALL}"
+INSTALL_DATA="${INSTALL} -m 644"
+AC_SUBST(INSTALL)
+AC_SUBST(INSTALL_DATA)
+AC_SUBST(INSTALL_PROGRAM)
+
+LIBTOOL=false
+AC_SUBST(LIBTOOL)
+
+FILE=$(cd $srcdir && find -name Makefile.in | perl -pe 's,^\./,,;s/\.in$//;s/\n/ /g;')
+AC_OUTPUT(
+localdefs
+$MPID_THREAD_OUTPUT_FILES
+$FILE
+)
+
+PAC_SUBDIR_CACHE_CLEANUP
Deleted: mpich2/trunk/src/mpid/dcmfd/configure.in
===================================================================
--- mpich2/trunk/src/mpid/dcmfd/configure.in 2012-02-28 23:25:23 UTC (rev 9547)
+++ mpich2/trunk/src/mpid/dcmfd/configure.in 2012-02-28 23:26:34 UTC (rev 9548)
@@ -1,94 +0,0 @@
-AC_INIT(configure.in)
-
-dnl
-dnl Set the directory that contains support scripts such as install-sh and
-dnl config.guess
-dnl
-AC_CONFIG_AUX_DIR(../../../confdb)
-
-dnl Definitions will be placed in this file rather than in the DEFS variable
-dnl
-AC_CONFIG_HEADER(include/mpid_config.h)
-
-echo "RUNNING CONFIGURE FOR DCMF DEVICE"
-
-# First check that we have a clean build if we are doing a VPATH build
-PAC_VPATH_CHECK()
-
-# -----------------------------------------------------------------------------
-# experiment with creating a cache file. Load if it exists
-#if test -n "$CONF_BASE_CACHEFILE" -a -s "$CONF_BASE_CACHEFILE" ; then
-# echo "Loading base cachefile $CONF_BASE_CACHEFILE"
-# . $CONF_BASE_CACHEFILE
-# export CONF_BASE_CACHEFILE
-#fi
-PAC_LOAD_BASE_CACHE
-# -----------------------------------------------------------------------------
-
-
-ASSERT_LEVEL=2
-AC_ARG_WITH(assert-level,
- AS_HELP_STRING([--with-assert-level={0 1 2}],[set build assert-level (default: 2)]),
- [ ASSERT_LEVEL=$withval ])
-AC_SUBST(ASSERT_LEVEL)
-AC_DEFINE_UNQUOTED([ASSERT_LEVEL], $ASSERT_LEVEL, [Which messager is being used])
-
-USE_COLL=ccmi
-AC_ARG_WITH(opt-coll,
- AS_HELP_STRING([--with-opt-coll={none ccmi}],[which optimized collectives to use (default: ccmi)]),
- [ USE_COLL=$withval ])
-if test "$USE_COLL" = "ccmi" ; then
- AC_DEFINE_UNQUOTED([USE_CCMI_COLL], 1, [Define to use CCMI collectives])
-fi
-
-
-#
-# bring in the default implementation of the MPID_Thread package
-#
-MPID_THREAD_SRCDIR="../common/thread"
-builtin(include,../common/thread/mpid_thread.m4)
-
-
-PAC_PROG_MAKE
-
-if echo $CFLAGS | grep -q -- -Wall
-then
- CFLAGS="$CFLAGS -Werror"
-fi
-if echo $CFLAGS | grep -q -- -qflag
-then
- CFLAGS="$CFLAGS -qhalt=w"
-fi
-AC_SUBST(AR)
-AC_SUBST(AR_FLAGS)
-AC_SUBST(RANLIB)
-AC_SUBST(MPILIBNAME)
-AC_SUBST(CC)
-AC_SUBST(CFLAGS)
-AC_SUBST(CPPFLAGS)
-AC_SUBST(CC_SHL)
-AC_SUBST(C_LINK_SHL)
-AC_SUBST(master_top_srcdir)
-AC_SUBST(master_top_builddir)
-AC_SUBST(MAKE_DEPEND_C)
-AC_SUBST(ENABLE_SHLIB)
-AC_SUBST(MKDIR_P)
-
-INSTALL="/usr/bin/install -c"
-INSTALL_PROGRAM="${INSTALL}"
-INSTALL_DATA="${INSTALL} -m 644"
-AC_SUBST(INSTALL)
-AC_SUBST(INSTALL_DATA)
-AC_SUBST(INSTALL_PROGRAM)
-
-LIBTOOL=false
-AC_SUBST(LIBTOOL)
-
-FILE=$(cd $srcdir && find -name Makefile.in | perl -pe 's,^\./,,;s/\.in$//;s/\n/ /g;')
-AC_OUTPUT(
-localdefs
-$MPID_THREAD_OUTPUT_FILES
-$FILE
-)
-
-PAC_SUBDIR_CACHE_CLEANUP
Copied: mpich2/trunk/src/mpid/globus/configure.ac (from rev 9546, mpich2/trunk/src/mpid/globus/configure.in)
===================================================================
--- mpich2/trunk/src/mpid/globus/configure.ac (rev 0)
+++ mpich2/trunk/src/mpid/globus/configure.ac 2012-02-28 23:26:34 UTC (rev 9548)
@@ -0,0 +1,825 @@
+#
+# Globus device code: Copyright 2005 Northern Illinois University
+# Borrowed MPICH-G2 code: Copyright 2000 Argonne National Laboratory and Northern Illinois University
+# Borrowed MPICH2 device code: Copyright 2001 Argonne National Laboratory
+#
+# XXX: INSERT POINTER TO OFFICIAL COPYRIGHT TEXT
+#
+
+AC_INIT(configure.ac)
+
+notice_msg=`echo "start of configure for the ${device_name} device" | tr '[a-z]' '[A-Z]'`
+AC_MSG_NOTICE([----------------------------------------])
+AC_MSG_NOTICE([$notice_msg])
+
+#
+# set the directory that contains support scripts such as install-sh and config.guess
+#
+AC_CONFIG_AUX_DIR(../../../confdb)
+
+#
+# definitions will be placed in mpidconf.h file rather than in the DEFS variable
+#
+cp ${srcdir}/mpidconf.h.in .
+# echo "" >mpidconf-extras.h.in
+# echo '/**** mpidconf-extras.h.in: generated by src/mpid/$device_name/configure ****/' >>mpidconf-extras.h.in
+AC_CONFIG_HEADERS(mpidconf.h)
+
+AC_DEFUN([LAH_TEMPLATE],[
+ cat >>mpidconf.h.in <<_LACEOF
+
+m4_text_wrap([$2 */], [ ], [/* ])
+[@%:@undef] $1
+_LACEOF
+])
+
+#
+# save initial values of important variables
+#
+MPIG_SAVE_LIBS=${LIBS}
+
+#
+# configuration options
+#
+AC_ARG_ENABLE(mpig-threaded,
+[--enable-mpig-threaded=package - enable use of threads within the MPIg device.
+The following thread packages are supported.
+ globus - Globus threads [only option if using Globus middleware]
+ pthreads - POSIX threads [default if not using Globus middleware]
+ none - MPIg device will not use threads],,enable_mpig_threaded=default)
+
+#
+# first check that we have a clean build if we are doing a VPATH build
+#
+PAC_VPATH_CHECK()
+
+#
+# load cached results computed in the top-level configure tests
+#
+PAC_LOAD_BASE_CACHE
+
+#
+# check for standard programs needed by the Makefile
+#
+AC_PROG_INSTALL
+PAC_PROG_CHECK_INSTALL_WORKS
+PAC_PROG_MKDIR_P
+PAC_PROG_MAKE
+
+#
+# check for optional, but common C types
+#
+AC_CHECK_TYPES(bool bool_t)
+
+#
+# get sizes for intrinsic C types
+#
+AC_CHECK_SIZEOF(char)
+AC_CHECK_SIZEOF(short)
+AC_CHECK_SIZEOF(int)
+AC_CHECK_SIZEOF(long)
+AC_CHECK_SIZEOF(long long)
+AC_CHECK_SIZEOF(float)
+AC_CHECK_SIZEOF(double)
+AC_CHECK_SIZEOF(long double)
+AC_CHECK_SIZEOF(void *)
+
+#
+# create a mapping from integer types to printf integer conversion length modifiers
+#
+mpig_char_fmt_mod="hh"
+mpig_unsigned_char_fmt_mod="hh"
+mpig_short_fmt_mod="h"
+mpig_unsigned_short_fmt_mod="h"
+mpig_int_fmt_mod=""
+mpig_unsigned_int_fmt_mod=""
+mpig_long_fmt_mod="l"
+mpig_unsigned_long_fmt_mod="l"
+mpig_long_long_fmt_mod="ll"
+mpig_unsigned_long_long_fmt_mod="ll"
+
+#
+# determine the unsigned integer type to which a pointer should be cast when doing a printf. also get the corresponding printf
+# conversion specifier.
+#
+AC_MSG_CHECKING([for an unsigned integer type big enough to hold a pointer])
+MPIG_PTR_CAST=""
+for mpig_type in "char" "short" "int" "long" "long long" ; do
+ eval mpig_size="\${ac_cv_sizeof_`echo ${mpig_type} | tr '[ *]' [_p]`}"
+ if test ${ac_cv_sizeof_void_p} -eq ${mpig_size} ; then
+ MPIG_PTR_CAST="unsigned ${mpig_type}"
+ break
+ fi
+done
+if test -n "${MPIG_PTR_CAST}" ; then
+ AC_MSG_RESULT([${MPIG_PTR_CAST}])
+else
+ AC_MSG_RESULT([unknown])
+ AC_MSG_ERROR([unable to find an integer type big enough to hold a pointer!])
+fi
+
+AC_MSG_CHECKING([printf conversion specifier for a pointer])
+eval MPIG_PTR_FMT="\"\\\"0x%0`expr ${ac_cv_sizeof_void_p} \* 2`\${mpig_`echo ${MPIG_PTR_CAST} | tr '[ *]' [_p]`_fmt_mod}x\\\"\""
+AC_MSG_RESULT([${MPIG_PTR_FMT}])
+dnl AC_DEFINE_UNQUOTED(MPIG_PTR_CAST,${MPIG_PTR_CAST:?},[an unsigned integer big enough to hold a pointer])
+dnl AC_DEFINE_UNQUOTED(MPIG_PTR_FMT,${MPIG_PTR_FMT:?},[printf conversion specifier for a pointer converted to a MPIG_PTR_CAST])
+AC_SUBST(MPIG_PTR_CAST)
+AC_SUBST(MPIG_PTR_FMT)
+
+#
+# miscellaneous header and function checks
+#
+AC_CHECK_HEADERS(unistd.h limits.h stdint.h errno.h sched.h)
+AC_CHECK_FUNCS(sched_yield yield nanosleep usleep sleep)
+
+#
+# check for functions needed to get a complete fully qualified host name
+#
+AC_CHECK_FUNCS(gethostname getdomainname)
+if test "$ac_cv_func_gethostname" = "yes" ; then
+ # do we need to declare gethostname?
+ PAC_FUNC_NEEDS_DECL([#include <unistd.h>],gethostname)
+fi
+
+#
+# check for uuid generation packages
+#
+AC_CHECK_HEADERS(uuid/uuid.h)
+AC_SEARCH_LIBS(uuid_generate, uuid)
+AC_CHECK_FUNCS(uuid_generate uuid_parse uuid_unparse uuid_copy)
+
+#
+# determine this machine's endianess
+#
+AC_CACHE_CHECK([endianess of system],
+lac_cv_my_endian,[
+AC_RUN_IFELSE([
+AC_LANG_SOURCE([
+#include <stdio.h>
+#include <stdlib.h>
+int main(int argc, char **argv)
+{
+ int data;
+ char * datap = (char *) &data;
+ FILE *f;
+
+ f = fopen("conftest.out", "w");
+ data = 10;
+ if (*datap == 10)
+ {
+ fprintf(f, "little\n");
+ }
+ else if (*(datap + sizeof(int) - 1) == 10)
+ {
+ fprintf(f, "big\n");
+ }
+ else
+ {
+ fprintf(f, "undetermined\n");
+ }
+
+ fclose(f);
+ exit(0);
+}
+])
+],lac_cv_my_endian=`cat conftest.out`,
+ lac_cv_my_endian="FAILED",
+ lac_cv_my_endian=${CROSS_MY_ENDIAN:-undetermined})
+])
+
+if test "$lac_cv_my_endian" = "big" ; then
+ MPIG_MY_ENDIAN="MPIG_ENDIAN_BIG"
+elif test "$lac_cv_my_endian" = "little" ; then
+ MPIG_MY_ENDIAN="MPIG_ENDIAN_LITTLE"
+else
+ AC_MSG_ERROR([Unable to determine endianess of system. If cross compiling, set CROSS_MY_ENDIAN to "big" or "little".])
+fi
+AC_DEFINE_UNQUOTED(MPIG_MY_ENDIAN,${MPIG_MY_ENDIAN},[endianess of the system])
+
+#
+# determine if threads are to be used internally and which threads package will be used
+#
+if test -z "${MPIG_THREADED}" ; then
+ case ${enable_mpig_threaded} in
+ posix|pthread|pthreads|yes)
+ MPIG_THREADS_PKG=posix
+ MPIG_THREADED=yes
+ ;;
+ default|no|none)
+ MPIG_THREADS_PKG=
+ MPIG_THREADED=no
+ ;;
+ *)
+ AC_MSG_ERROR([The threads package "${enable_mpig_threaded}" is not known to the ${device_name} device. Please select another package.])
+ ;;
+ esac
+elif test "${enable_mpig_threaded}" = "yes" -a "${MPIG_THREADED}" = "no" ; then
+ AC_MSG_ERROR([The selected Grid Middleware package (${MPIG_GRID_PKG_NAME}) is not thread safe; however, the --enable-mpig-threaded option was passed to configure. Please remove the option or select a middleware package that is thread safe.])
+elif test "${enable_mpig_threaded}" = "no" -a "${MPIG_THREADED}" = "yes" ; then
+ AC_MSG_ERROR([The selected Grid Middleware package (${MPIG_GRID_PKG_NAME}) requires threads; however, the --disable-mpig-threaded option was passed to configure. Please remove the option or select a middleware package that does not require threads.])
+elif test "${enable_mpig_threaded}" != "default" -a "${enable_mpig_threaded}" != "${MPIG_THREADS_PKG}" ; then
+ AC_MSG_ERROR([The threads "${MPIG_THREADS_PKG} package is required by the selected Grid Middleware (${MPIG_GRID_PKG_NAME}); however, the --enable-mpig-threaded=${enable_mpig_threaded} option was passed to configure specified a different package. Please remove the option or select a middleware package that is compatible with the specified threads package.])
+fi
+if test "${MPIG_THREADED}" = "yes" ; then
+ AC_DEFINE(MPIG_THREADED,1,[define if MPIg is allowed to use threads internally])
+fi
+if test -n "${MPIG_THREADS_PKG}" ; then
+ mpig_define_name="HAVE_`echo ${MPIG_THREADS_PKG} | tr '[a-z- ]' '[A-Z__]'`_THREADS"
+ LAH_TEMPLATE([${mpig_define_name}], [threads package to be used internally by MPIg])
+ AC_DEFINE_UNQUOTED([${mpig_define_name}], 1)
+fi
+
+if test "${MPIG_THREADS_PKG}" = "posix" ; then
+ AC_CHECK_HEADERS(pthread.h)
+ AC_CHECK_FUNCS(pthread_yield)
+ if test "$ac_cv_func_pthread_yield" = "yes" ; then
+ PAC_FUNC_NEEDS_DECL([#include <pthread.h>],pthread_yield)
+ fi
+fi
+
+#
+# determine if C compiler supports function inlining
+#
+AC_C_INLINE
+if test "$ac_cv_c_inline" != "no" ; then
+ AC_DEFINE(HAVE_C_INLINE,1,[define if the C compiler supports function inlining])
+fi
+
+#
+# determine the size of MPICH2's MPI_AINT, and the printf conversion specifers for MPI_Aint and MPIU_Size_t
+#
+AC_MSG_CHECKING([size of MPICH2 MPI_AINT])
+eval SIZEOF_MPICH2_AINT="\${SIZEOF_`echo ${MPI_AINT} | tr '[a-z]' '[A-Z]'`}"
+AC_MSG_RESULT([$SIZEOF_MPICH2_AINT])
+AC_DEFINE_UNQUOTED(TYPEOF_MPICH2_AINT,${MPI_AINT:?},[integer type of the same size as the MPICH2 MPI_Aint type])
+AC_DEFINE_UNQUOTED(SIZEOF_MPICH2_AINT,${SIZEOF_MPICH2_AINT:?},[size of the MPICH2 MPI_Aint type])
+
+AC_MSG_NOTICE([INFO: MPI_Aint is "${MPI_AINT}"])
+AC_MSG_CHECKING([printf conversion specifier for MPI_Aint])
+eval MPIG_AINT_FMT="\"\\\"%\${MPIG_`echo ${MPI_AINT} | tr ' *' '_p'`_fmt_mod}d\\\"\""
+dnl AC_DEFINE_UNQUOTED(MPIG_AINT_FMT,${MPIG_AINT_FMT:?},[printf conversion specifier for MPI_Aint])
+AC_SUBST(MPIG_AINT_FMT)
+AC_MSG_RESULT([$MPIG_AINT_FMT])
+
+AC_MSG_NOTICE([INFO: MPIU_Size_t is "${MPIU_SIZE_T}"])
+AC_MSG_CHECKING([printf conversion specifier for MPIU_Size_t])
+eval MPIG_SIZE_FMT="\"\\\"%\${MPIG_`echo ${MPIU_SIZE_T} | tr ' *' '_p'`_fmt_mod}u\\\"\""
+dnl AC_DEFINE_UNQUOTED(MPIG_SIZE_FMT,${MPIG_SIZE_FMT:?},[printf conversion specifier for MPIU_Size_t])
+AC_SUBST(MPIG_SIZE_FMT)
+AC_MSG_RESULT([$MPIG_SIZE_FMT])
+
+#
+# determine if CPP supports variadic macros
+#
+AC_CACHE_CHECK([whether CPP accepts C99 style variadic macros],
+lac_cv_have_c99_variadic_macros,[
+AC_COMPILE_IFELSE([
+AC_LANG_SOURCE([
+#include <stdio.h>
+#define MY_PRINTF(rank, fmt, ...) printf("%d: " fmt, rank, ## __VA_ARGS__)
+int main(int argc, char ** argv)
+{
+ MY_PRINTF(0, "hello");
+ MY_PRINTF(1, "world %d", 3);
+ return 0;
+}
+])
+], lac_cv_have_c99_variadic_macros=yes, lac_cv_have_c99_variadic_macros=no)
+])
+if test $lac_cv_have_c99_variadic_macros = "yes" ; then
+ AC_DEFINE(HAVE_C99_VARIADIC_MACROS,,[define if CPP supports C99 style variadic macros])
+fi
+
+AC_CACHE_CHECK([whether CPP accepts GNU style variadic macros],
+lac_cv_have_gnu_variadic_macros,[
+AC_COMPILE_IFELSE([
+AC_LANG_SOURCE([
+#include <stdio.h>
+#define MY_PRINTF(rank, fmt, args...) printf("%d: " fmt, rank, ## args)
+int main(int argc, char ** argv)
+{
+ MY_PRINTF(0, "hello");
+ MY_PRINTF(1, "world %d", 3);
+ return 0;
+}
+])
+], lac_cv_have_gnu_variadic_macros=yes, lac_cv_have_gnu_variadic_macros=no)
+])
+if test $lac_cv_have_gnu_variadic_macros = "yes" ; then
+ AC_DEFINE(HAVE_GNU_VARIADIC_MACROS,,[define if CPP supports GNU style variadic macros])
+fi
+
+#
+# determine if the compiler defines a symbol containing the function name
+#
+AC_CACHE_CHECK([whether the compiler defines __func__],
+lac_cv_have__func__,[
+AC_RUN_IFELSE([
+AC_LANG_SOURCE([
+#include <string.h>
+int foo(void);
+int foo(void)
+{
+ return (strcmp(__func__, "foo") == 0);
+}
+int main(int argc, char ** argv)
+{
+ return (foo() ? 0 : 1);
+}
+])
+], lac_cv_have__func__=yes, lac_cv_have__func__=no)
+])
+if test $lac_cv_have__func__ = "yes" ; then
+ AC_DEFINE(HAVE__FUNC__,,[define if the compiler defines __func__])
+fi
+
+AC_CACHE_CHECK([whether the compiler defines __FUNC__],
+lac_cv_have_cap__func__,[
+AC_RUN_IFELSE([
+AC_LANG_SOURCE([
+#include <string.h>
+int foo(void);
+int foo(void)
+{
+ return (strcmp(__FUNC__, "foo") == 0);
+}
+int main(int argc, char ** argv)
+{
+ return (foo() ? 0 : 1);
+}
+])
+], lac_cv_have_cap__func__=yes, lac_cv_have_cap__func__=no)
+])
+if test $lac_cv_have_cap__func__ = "yes" ; then
+ AC_DEFINE(HAVE_CAP__FUNC__,,[define if the compiler defines __FUNC__])
+fi
+
+AC_CACHE_CHECK([whether the compiler sets __FUNCTION__],
+lac_cv_have__function__,[
+AC_RUN_IFELSE([
+AC_LANG_SOURCE([
+#include <string.h>
+int foo(void);
+int foo(void)
+{
+ return (strcmp(__FUNCTION__, "foo") == 0);
+}
+int main(int argc, char ** argv)
+{
+ return (foo() ? 0 : 1);
+}
+])
+], lac_cv_have__function__=yes, lac_cv_have__function__=no)
+])
+if test $lac_cv_have__function__ = "yes" ; then
+ AC_DEFINE(HAVE__FUNCTION__,,[define if the compiler defines __FUNCTION__])
+fi
+
+#
+# m4 macros to acquire information from the vendor MPI
+#
+AC_DEFUN([LAC_CHECK_C_VMPI_FUNC],
+[
+m4_pushdef([lac_upper_varname], m4_translit([HAVE_C_V$1], [a-z], [A-Z]))
+m4_pushdef([lac_lower_varname], m4_translit([lac_cv_have_c_v$1], [A-Z], [a-z]))
+AC_CACHE_CHECK([for the vendor MPI function $1 (C binding)], lac_lower_varname, [
+SAVE_MPIG_CONFIGURE_ACTIVE=${MPIG_CONFIGURE_ACTIVE}
+MPIG_CONFIGURE_ACTIVE=""
+AC_LINK_IFELSE([
+AC_LANG_SOURCE([
+void $1(float * a);
+int main(int argc, char *argv[[]])
+{
+ void (*func)(float * a) = $1;
+ float a = 1.0;
+ func(&a);
+ return 0;
+}
+], lac_lower_varname=yes, lac_lower_varname=no)
+])
+MPIG_CONFIGURE_ACTIVE=${SAVE_MPIG_CONFIGURE_ACTIVE}
+])
+if test ${lac_lower_varname} = "yes" ; then
+ AC_DEFINE_UNQUOTED(lac_upper_varname, 1, [define if the vendor MPI provides the function $1])
+fi
+m4_popdef([lac_lower_varname])
+m4_popdef([lac_upper_varname])
+])
+
+AC_DEFUN([LAC_CHECK_C_VMPI_CONSTANT],
+[
+m4_pushdef([lac_upper_varname], m4_translit([HAVE_C_V$2], [a-z], [A-Z]))
+m4_pushdef([lac_lower_varname], m4_translit([lac_cv_have_c_v$2], [A-Z], [a-z]))
+AC_CACHE_CHECK([for the vendor MPI constant $2 (C binding)], lac_lower_varname, [
+SAVE_MPIG_CONFIGURE_ACTIVE=${MPIG_CONFIGURE_ACTIVE}
+MPIG_CONFIGURE_ACTIVE=""
+AC_COMPILE_IFELSE([
+AC_LANG_SOURCE([
+#include "mpi.h"
+void func($1 a);
+int main(int argc, char *argv[[]])
+{
+ $1 a = $2;
+ func(a);
+ return 0;
+}
+])
+], lac_lower_varname=yes, lac_lower_varname=no)
+MPIG_CONFIGURE_ACTIVE=${SAVE_MPIG_CONFIGURE_ACTIVE}
+])
+if test ${lac_lower_varname} = "yes" ; then
+ AC_DEFINE_UNQUOTED(lac_upper_varname, 1, [define if the the vendor MPI provides the constant $2])
+fi
+m4_popdef([lac_lower_varname])
+m4_popdef([lac_upper_varname])
+])
+
+AC_DEFUN([LAC_GET_VMPI_TYPE_FORMAT],
+[
+m4_pushdef([lac_upper_type], m4_translit([V$1], [a-z], [A-Z]))
+m4_pushdef([lac_lower_varname], m4_translit([lac_cv_fmt_v$1], [A-Z], [a-z]))
+AC_CACHE_CHECK([printf conversion specifier for vendor $1], lac_lower_varname, [
+if test "${[TYPEOF_]lac_upper_type[_IS_BASIC]}" = "yes" ; then
+ lac_fmt_mod_varname='mpig_'${[TYPEOF_]lac_upper_type}'_fmt_mod'
+ eval lac_fmt_mod='${'${lac_fmt_mod_varname}'}'
+ lac_lower_varname="\"0x%0`expr 2 \* ${[SIZEOF_]lac_upper_type}`${lac_fmt_mod}x\""
+ unset lac_fmt_mod_varname
+ unset lac_fmt_mod
+else
+ lac_lower_varname="not basic!"
+fi
+])
+if test "${lac_lower_varname}" != "not basic!" ; then
+ AC_DEFINE_UNQUOTED([FMT_]lac_upper_type, ${lac_lower_varname}, [printf conversion specifier for vendor $1 handle])
+fi
+m4_popdef([lac_lower_varname])
+m4_popdef([lac_upper_type])
+])
+
+#
+# vendor MPI
+#
+if test "${MPIG_VMPI:?}" != "no" ; then
+ # vendor MPI settings from mpich2prereq
+ AC_DEFINE(MPIG_VMPI,1,[define if we are building on top of a vendor MPI])
+
+ AC_DEFINE_UNQUOTED(SIZEOF_VMPI_COMM,${SIZEOF_VMPI_COMM:?},[size of the vendor MPI_Comm handle])
+ AC_DEFINE_UNQUOTED(TYPEOF_VMPI_COMM, ${TYPEOF_VMPI_COMM:?}, [C type equivalent to a vendor MPI_Comm handle])
+ if test "${TYPEOF_VMPI_COMM_IS_BASIC:?}" = yes; then
+ AC_DEFINE(TYPEOF_VMPI_COMM_IS_BASIC, 1, [define if TYPEOF_VMPI_COMM is a basic C type])
+ fi
+ LAC_GET_VMPI_TYPE_FORMAT(MPI_Comm)
+
+ AC_DEFINE_UNQUOTED(SIZEOF_VMPI_DATATYPE,${SIZEOF_VMPI_DATATYPE:?},[size of the vendor MPI_Datatype handle])
+ AC_DEFINE_UNQUOTED(TYPEOF_VMPI_DATATYPE, ${TYPEOF_VMPI_DATATYPE:?}, [C type equivalent to a vendor MPI_Datatype handle])
+ if test "${TYPEOF_VMPI_DATATYPE_IS_BASIC:?}" = yes; then
+ AC_DEFINE(TYPEOF_VMPI_DATATYPE_IS_BASIC, 1, [define if TYPEOF_VMPI_DATATYPE is a basic C type])
+ fi
+ LAC_GET_VMPI_TYPE_FORMAT(MPI_Datatype)
+
+ AC_DEFINE_UNQUOTED(SIZEOF_VMPI_OP,${SIZEOF_VMPI_OP:?},[size of the vendor MPI_Op object])
+ AC_DEFINE_UNQUOTED(TYPEOF_VMPI_OP, ${TYPEOF_VMPI_OP:?}, [C type equivalent to a vendor MPI_Op handle])
+ if test "${TYPEOF_VMPI_OP_IS_BASIC:?}" = yes; then
+ AC_DEFINE(TYPEOF_VMPI_OP_IS_BASIC, 1, [define if TYPEOF_VMPI_OP is a basic C type])
+ fi
+ LAC_GET_VMPI_TYPE_FORMAT(MPI_Op)
+
+ AC_DEFINE_UNQUOTED(SIZEOF_VMPI_REQUEST,${SIZEOF_VMPI_REQUEST:?},[size of the vendor MPI_Request handle])
+ AC_DEFINE_UNQUOTED(TYPEOF_VMPI_REQUEST, ${TYPEOF_VMPI_REQUEST:?}, [C type equivalent to a vendor MPI_Request handle])
+ if test "${TYPEOF_VMPI_REQUEST_IS_BASIC:?}" = yes; then
+ AC_DEFINE(TYPEOF_VMPI_REQUEST_IS_BASIC, 1, [define if TYPEOF_VMPI_REQUEST is a basic C type])
+ fi
+ LAC_GET_VMPI_TYPE_FORMAT(MPI_Request)
+
+ AC_DEFINE_UNQUOTED(SIZEOF_VMPI_STATUS,${SIZEOF_VMPI_STATUS:?},[size of the vendor MPI_Status object])
+ AC_DEFINE_UNQUOTED(TYPEOF_VMPI_STATUS, ${TYPEOF_VMPI_STATUS:?}, [C type equivalent to a vendor MPI_Status handle])
+ if test "${TYPEOF_VMPI_STATUS_IS_BASIC:?}" = yes; then
+ AC_DEFINE(TYPEOF_VMPI_STATUS_IS_BASIC, 1, [define if TYPEOF_VMPI_STATUS is a basic C type])
+ fi
+ AC_DEFINE_UNQUOTED(SIZEOF_VMPI_AINT,${SIZEOF_VMPI_AINT:?},[size of the vendor MPI_Aint type])
+
+ # determine if the vendor MPI supports MPI-2 functionality
+ LAC_CHECK_C_VMPI_FUNC(MPI_Comm_get_attr)
+ LAC_CHECK_C_VMPI_FUNC(MPI_Comm_set_errhandler)
+ LAC_CHECK_C_VMPI_FUNC(MPI_Init_thread)
+ LAC_CHECK_C_VMPI_FUNC(MPI_Type_dup)
+ LAC_CHECK_C_VMPI_FUNC(MPI_Type_create_hvector)
+ LAC_CHECK_C_VMPI_FUNC(MPI_Type_create_hindexed)
+ LAC_CHECK_C_VMPI_FUNC(MPI_Type_create_indexed_block)
+ LAC_CHECK_C_VMPI_FUNC(MPI_Type_create_resized)
+ LAC_CHECK_C_VMPI_FUNC(MPI_Type_create_struct)
+
+ LAC_CHECK_C_VMPI_CONSTANT(MPI_Datatype, MPI_LONG_DOUBLE)
+ LAC_CHECK_C_VMPI_CONSTANT(MPI_Datatype, MPI_LONG_DOUBLE_INT)
+ LAC_CHECK_C_VMPI_CONSTANT(MPI_Datatype, MPI_LONG_LONG)
+ LAC_CHECK_C_VMPI_CONSTANT(MPI_Datatype, MPI_LONG_LONG_INT)
+ LAC_CHECK_C_VMPI_CONSTANT(MPI_Datatype, MPI_UNSIGNED_LONG_LONG)
+ LAC_CHECK_C_VMPI_CONSTANT(MPI_Datatype, MPI_SIGNED_CHAR)
+ LAC_CHECK_C_VMPI_CONSTANT(MPI_Datatype, MPI_WCHAR)
+
+ # determine which, if any, of the Fortran datatype handles are defined in the C header file
+ LAC_CHECK_C_VMPI_CONSTANT(MPI_Datatype, MPI_INTEGER)
+ if test "$lac_cv_have_c_vmpi_integer" = "yes" ; then
+ LAC_CHECK_C_VMPI_CONSTANT(MPI_Datatype, MPI_INTEGER1)
+ LAC_CHECK_C_VMPI_CONSTANT(MPI_Datatype, MPI_INTEGER2)
+ LAC_CHECK_C_VMPI_CONSTANT(MPI_Datatype, MPI_INTEGER4)
+ LAC_CHECK_C_VMPI_CONSTANT(MPI_Datatype, MPI_INTEGER8)
+ LAC_CHECK_C_VMPI_CONSTANT(MPI_Datatype, MPI_INTEGER16)
+ LAC_CHECK_C_VMPI_CONSTANT(MPI_Datatype, MPI_REAL4)
+ LAC_CHECK_C_VMPI_CONSTANT(MPI_Datatype, MPI_REAL8)
+ LAC_CHECK_C_VMPI_CONSTANT(MPI_Datatype, MPI_REAL16)
+ LAC_CHECK_C_VMPI_CONSTANT(MPI_Datatype, MPI_COMPLEX8)
+ LAC_CHECK_C_VMPI_CONSTANT(MPI_Datatype, MPI_COMPLEX16)
+ LAC_CHECK_C_VMPI_CONSTANT(MPI_Datatype, MPI_COMPLEX32)
+ LAC_CHECK_C_VMPI_CONSTANT(MPI_Datatype, MPI_DOUBLE_COMPLEX)
+ LAC_CHECK_C_VMPI_CONSTANT(MPI_Datatype, MPI_2DOUBLE_COMPLEX)
+
+ AC_DEFINE(HAVE_F77_VMPI_DATATYPES_IN_C,1,[define if the vendor MPI defines Fortran datatypes in its C binding])
+ else
+ # FIXME: if the Fortran datatype handles are not defined in the C header file, then we will need to jump through some
+ # hoops when mirroring the construction of datatypes that involve Fortran handles. this problem likely also exists for
+ # other bindings like C++ for which the MPI-2 assigns handles for boolean and complex types. MPI-2 provides a mechanism
+ # for converting handles from one language to another, but MPI-1 does not. this could get very complicated...
+ AC_MSG_FAILURE(
+ [MPIg requires the vendor MPI to define the datatype handles for all language bindings in the C header file])
+ fi
+
+ LAC_CHECK_C_VMPI_CONSTANT(MPI_Op, MPI_REPLACE)
+
+ LAC_CHECK_C_VMPI_CONSTANT(int, MPI_ERR_ACCESS)
+ LAC_CHECK_C_VMPI_CONSTANT(int, MPI_ERR_AMODE)
+ LAC_CHECK_C_VMPI_CONSTANT(int, MPI_ERR_ASSERT)
+ LAC_CHECK_C_VMPI_CONSTANT(int, MPI_ERR_BAD_FILE)
+ LAC_CHECK_C_VMPI_CONSTANT(int, MPI_ERR_BASE)
+ LAC_CHECK_C_VMPI_CONSTANT(int, MPI_ERR_CONVERSION)
+ LAC_CHECK_C_VMPI_CONSTANT(int, MPI_ERR_DISP)
+ LAC_CHECK_C_VMPI_CONSTANT(int, MPI_ERR_DUP_DATAREP)
+ LAC_CHECK_C_VMPI_CONSTANT(int, MPI_ERR_FILE)
+ LAC_CHECK_C_VMPI_CONSTANT(int, MPI_ERR_FILE_EXISTS)
+ LAC_CHECK_C_VMPI_CONSTANT(int, MPI_ERR_FILE_IN_USE)
+ LAC_CHECK_C_VMPI_CONSTANT(int, MPI_ERR_INFO)
+ LAC_CHECK_C_VMPI_CONSTANT(int, MPI_ERR_INFO_KEY)
+ LAC_CHECK_C_VMPI_CONSTANT(int, MPI_ERR_INFO_NOKEY)
+ LAC_CHECK_C_VMPI_CONSTANT(int, MPI_ERR_INFO_VALUE)
+ LAC_CHECK_C_VMPI_CONSTANT(int, MPI_ERR_IO)
+ LAC_CHECK_C_VMPI_CONSTANT(int, MPI_ERR_KEYVAL)
+ LAC_CHECK_C_VMPI_CONSTANT(int, MPI_ERR_LOCKTYPE)
+ LAC_CHECK_C_VMPI_CONSTANT(int, MPI_ERR_NAME)
+ LAC_CHECK_C_VMPI_CONSTANT(int, MPI_ERR_NOT_SAME)
+ LAC_CHECK_C_VMPI_CONSTANT(int, MPI_ERR_NO_MEM)
+ LAC_CHECK_C_VMPI_CONSTANT(int, MPI_ERR_NO_SPACE)
+ LAC_CHECK_C_VMPI_CONSTANT(int, MPI_ERR_NO_SUCH_FILE)
+ LAC_CHECK_C_VMPI_CONSTANT(int, MPI_ERR_PORT)
+ LAC_CHECK_C_VMPI_CONSTANT(int, MPI_ERR_QUOTA)
+ LAC_CHECK_C_VMPI_CONSTANT(int, MPI_ERR_READ_ONLY)
+ LAC_CHECK_C_VMPI_CONSTANT(int, MPI_ERR_RMA_CONFLICT)
+ LAC_CHECK_C_VMPI_CONSTANT(int, MPI_ERR_RMA_SYNC)
+ LAC_CHECK_C_VMPI_CONSTANT(int, MPI_ERR_SERVICE)
+ LAC_CHECK_C_VMPI_CONSTANT(int, MPI_ERR_SIZE)
+ LAC_CHECK_C_VMPI_CONSTANT(int, MPI_ERR_SPAWN)
+ LAC_CHECK_C_VMPI_CONSTANT(int, MPI_ERR_UNSUPPORTED_DATAREP)
+ LAC_CHECK_C_VMPI_CONSTANT(int, MPI_ERR_UNSUPPORTED_OPERATION)
+ LAC_CHECK_C_VMPI_CONSTANT(int, MPI_ERR_WIN)
+
+ AC_CACHE_CHECK([version of the MPI standard implemented by the vendor MPI],
+ lac_cv_vmpi_version,[
+ AC_RUN_IFELSE([
+ AC_LANG_SOURCE([
+ #include "mpi.h"
+ #include <stdio.h>
+ int main(int argc, char *argv[[]])
+ {
+ FILE * fp = fopen("conftest.out","w");
+ fprintf(fp, "%d\n", MPI_VERSION);
+ close(fp);
+ return 0;
+ }
+ ])
+ ], lac_cv_vmpi_version=`cat conftest.out`, lac_cv_vmpi_version=0)
+ ])
+
+ AC_DEFINE_UNQUOTED(MPIG_VMPI_VERSION,${lac_cv_vmpi_version},
+ [define with the MPI standard version implemented by the vendor MPI])
+
+ #
+ # if the vendor MPI does not implement the MPI-2 standard, then it is possible that it also does not support passing NULL in
+ # place of the command line arguments. in that case, we must provide an alternative main() that first calls MPI_Init and
+ # calls the application's main(). see comments in mpig_vmpi_premain.c for additional details.
+ #
+ if test -z "${MPIG_VMPI_PREMAIN_LIBS_REQUIRED}" ; then
+ if test ${lac_cv_vmpi_version} -lt 2 ; then
+ MPIG_VMPI_PREMAIN_LIBS_REQUIRED=yes
+ else
+ MPIG_VMPI_PREMAIN_LIBS_REQUIRED=no
+ fi
+ fi
+
+ if test "${MPIG_VMPI_PREMAIN_LIBS_REQUIRED}" = "yes" ; then
+ AC_DEFINE(MPIG_VMPI_PREMAIN_REQUIRED,1,
+ [define if MPIg must initialize the vendor MPI before the main routine of the application is called])
+ for c in cc cxx ; do
+ cnu=`echo ${c} | tr '[a-z]' '[A-Z]'`
+ cf=mpich2-grid-${c}
+ premain_lib="libmpig_vmpi_premain_${c}.a"
+ if test -f ${cf} ; then
+ AC_MSG_NOTICE([Updating the paths in the MPIg compiler script ${cf}])
+ mv ${cf} ${cf}.orig
+ sed -e 's!^\(MPIG_VMPI_PREMAIN_LIB\)=.*!\1="'"${MPIG_BUILD_DIR}/${premain_lib}"'"!' ${cf}.orig >${cf}
+ chmod 755 ${cf}
+ rm -f ${cf}.orig
+ eval MPIG_VMPI_PREMAIN_${cnu}_LIB=${premain_lib}
+ fi
+ done
+ fi
+
+ MPIG_VMPI_DEFINED=1
+
+else # no vendor MPI
+
+ MPIG_VMPI_DEFINED=0
+fi
+
+AC_SUBST(MPIG_VMPI)
+AC_SUBST(MPIG_VMPI_DEFINED)
+AC_SUBST(MPIG_VMPI_PREMAIN_CC_LIB)
+AC_SUBST(MPIG_VMPI_PREMAIN_CXX_LIB)
+# end of vendor MPI section
+
+#
+# miscellaneous settings from mpich2prereq
+#
+dnl AC_DEFINE_UNQUOTED(MPIG_USING_GRID_PKG,"${MPIG_USING_GRID_PKG:?}",[Grid middleware being used by MPIg])
+
+AC_SUBST(MPIG_SOURCE_DIR)
+AC_SUBST(MPIG_BUILD_DIR)
+
+AC_DEFINE_UNQUOTED(MPIG_MPICH2_VERSION,"${MPIG_MPICH2_VERSION:?}",[MPICH2 version])
+
+if test "${MPIG_DEBUG:?}" = "yes" ; then
+ AC_DEFINE(MPIG_DEBUG,1,[define if MPIg should include debugging output and checks])
+ MPIG_DEBUG_DEFINED=1
+else
+ MPIG_DEBUG_DEFINED=0
+fi
+AC_SUBST(MPIG_DEBUG_DEFINED)
+
+dnl AC_DEFINE_UNQUOTED(TYPEOF_MPIG_ALIGNED_T,${TYPEOF_MPIG_ALIGNED_T:?},[type to use insure proper memory alignment for all types])
+dnl AC_DEFINE_UNQUOTED(SIZEOF_MPIG_ALIGNED_T,${SIZEOF_MPIG_ALIGNED_T:?},[size of the type used for aligning memory accesses])
+dnl AC_DEFINE_UNQUOTED(MEMALIGN_MPIG_ALIGNED_T,${MEMALIGN_MPIG_ALIGNED_T:?},[memory alignment of MPIG_ALIGNED_T])
+
+if test "${MPIG_ROMIO_ENABLED:?}" = "yes" ; then
+ ROMIO_ENABLED=1
+else
+ ROMIO_ENABLED=0
+fi
+AC_SUBST(ROMIO_ENABLED)
+
+#
+# Globus settings from mpich2prereq
+#
+if test "${MPIG_USING_GRID_PKG}" = "globus" ; then
+ if test "${HAVE_GLOBUS_COMMON_MODULE}" = "yes" ; then
+ AC_DEFINE(HAVE_GLOBUS_COMMON_MODULE,1,[define if the Globus Common module is installed])
+ fi
+
+ if test "${HAVE_GLOBUS_DC_MODULE}" = "yes" ; then
+ AC_DEFINE(HAVE_GLOBUS_DC_MODULE,1,[define if the Globus Common module is installed])
+ fi
+
+ if test "${HAVE_GLOBUS_USAGE_MODULE:?}" = "yes" ; then
+ AC_DEFINE(HAVE_GLOBUS_USAGE_MODULE,1,[define if Globus Usage module is installed])
+ AC_DEFINE_UNQUOTED(HAVE_GLOBUS_USAGE_VERSION,"${HAVE_GLOBUS_USAGE_VERSION:?}",[Globus Usage module version])
+ fi
+
+ if test "${HAVE_GLOBUS_DUROC_MODULE}" = "yes" ; then
+ AC_DEFINE(HAVE_GLOBUS_DUROC_MODULE,1,[define if the Globus DUROC Runtime module is installed])
+ fi
+
+ if test "${HAVE_GLOBUS_RENDEZVOUS_MODULE}" = "yes" ; then
+ AC_DEFINE(HAVE_GLOBUS_RENDEZVOUS_MODULE,1,[define if the Globus Rendezvous Client C bindings module is installed])
+ fi
+
+ if test "${HAVE_GLOBUS_XIO_MODULE:?}" = "yes" ; then
+ AC_DEFINE(HAVE_GLOBUS_XIO_MODULE,1,[define if Globus XIO module is installed])
+ AC_DEFINE_UNQUOTED(HAVE_GLOBUS_XIO_VERSION,"${HAVE_GLOBUS_XIO_VERSION:?}",[Globus XIO module version])
+ fi
+
+ # since mpich2preq-globus sets MPIG_THREADS_PKG to globus, HAVE_GLOBUS_THREADS is automatically defined above in the
+ # section on thread packages
+ #
+ # if test "${HAVE_GLOBUS_THREADS}" = "yes" ; then
+ # AC_DEFINE(HAVE_GLOBUS_THREADS,1,[define if the flavor of Globus being used is multithreaded])
+ # fi
+fi
+
+#
+# setup file substitutions needed to create mpiddefs.h
+#
+if test "${MPIG_RENAME_SYMBOLS:?}" = "yes" ; then
+ MPIG_SYMBOL_MAP_PUBLIC_H=.mpig_symbol_map_public.h
+ MPIG_SYMBOL_MAP_INTERNAL_H=.mpig_symbol_map_internal.h
+ AC_DEFINE(MPIG_RENAME_SYMBOLS,1,[define if MPI symbols need to be renamed])
+ MPIG_RENAME_SYMBOLS_DEFINED=1
+else
+ MPIG_SYMBOL_MAP_PUBLIC_H=/dev/null
+ MPIG_SYMBOL_MAP_INTERNAL_H=/dev/null
+ MPIG_RENAME_SYMBOLS_DEFINED=0
+fi
+AC_SUBST_FILE(MPIG_SYMBOL_MAP_PUBLIC_H)
+AC_SUBST_FILE(MPIG_SYMBOL_MAP_INTERNAL_H)
+AC_SUBST(MPIG_RENAME_SYMBOLS_DEFINED)
+
+#
+# settings imported from the top-level configure
+#
+AC_SUBST(AR)
+AC_SUBST(AR_FLAGS)
+AC_SUBST(RANLIB)
+AC_SUBST(MPILIBNAME)
+AC_SUBST(PMPILIBNAME)
+AC_SUBST(CC)
+AC_SUBST(CFLAGS)
+AC_SUBST(CPPFLAGS)
+AC_SUBST(DEFS)
+AC_SUBST(LDFLAGS)
+AC_SUBST(LIBS)
+PAC_CC_SUBDIR_SHLIBS
+AC_SUBST(master_top_srcdir)
+AC_SUBST(master_top_builddir)
+AC_SUBST(ETAGS)
+AC_SUBST(ETAGSADD)
+
+#
+# dependency handling
+#
+AC_SUBST(MAKE_DEPEND_C)
+
+#
+# setting to be included in localdefs.h
+#
+# XXX: MPIG_SAVE_LIBS may contain special regex characters that need to be escaped
+EXTRA_LIBS=`echo ${LIBS} | sed -e "s/^${MPIG_SAVE_LIBS} *//"`
+AC_SUBST(EXTRA_LIBS)
+
+#
+# create Makefile, etc.
+#
+AC_OUTPUT(Makefile examples/Makefile mpiexec mpiddefs.h.out:mpiddefs.h.in localdefs,
+[
+ AC_MSG_NOTICE([Copying mpiexec to $master_top_builddir/bin/])
+ if test ! -d $master_top_builddir/bin ; then
+ mkdir $master_top_builddir/bin
+ fi
+ chmod 755 mpiexec
+ cp -pf mpiexec $master_top_builddir/bin/mpiexec
+
+ if test ! -d $master_top_builddir/src/include ; then
+ mkdir $master_top_builddir/src/include
+ fi
+
+ # if the mpiddefs.h file has changed, then copy it to the top-level include directory
+ mpig_copy_file=yes
+ if test -f $master_top_builddir/src/include/mpiddefs.h ; then
+ if diff $master_top_builddir/src/include/mpiddefs.h mpiddefs.h.out >/dev/null 2>&1 ; then
+ mpig_copy_file=no
+ fi
+ fi
+ if test "$mpig_copy_file" = "yes" ; then
+ AC_MSG_NOTICE([Copying mpiddefs.h.out to $master_top_builddir/src/include/])
+ cp -pf mpiddefs.h.out $master_top_builddir/src/include/mpiddefs.h
+ else
+ AC_MSG_NOTICE([mpiddefs.h.out has not changed. skipping copy to top-level include directory.])
+ fi
+ if test "$MPIG_RENAME_SYMBOLS" = "yes" ; then
+ true
+ # rm -f .mpig_symbol_map_*
+ fi
+],
+[
+ master_top_builddir=${master_top_builddir}
+ master_top_srcdir=${master_top_srcdir}
+ MPIG_RENAME_SYMBOLS=${MPIG_RENAME_SYMBOLS}
+ if test "${MPIG_RENAME_SYMBOLS}" = "yes" ; then
+ AC_MSG_NOTICE([Extracting symbols from the symbol map])
+ grep '^MPI_' ${srcdir}/mpig_symbol_map.txt | sed -e 's/^/#define /' >.mpig_symbol_map_public.h
+ grep '^PMPI_' ${srcdir}/mpig_symbol_map.txt | sed -e 's/^/#define /' >>.mpig_symbol_map_public.h
+ [grep '^\#[[:space:]]*define[[:space:]]\+P\?MPI_[[:alnum:]_]\+[[:space:]]\+MPI[RD][[:alnum:]_]\+' \
+ $master_top_srcdir/src/include/mpi.h.in | sed -e 's/.*[[:space:]]\(.*\)/^\1[ ]/' >.mpig_symbol_map_public_extras.txt]
+ if test -s .mpig_symbol_map_public_extras.txt ; then
+ grep -f .mpig_symbol_map_public_extras.txt ${srcdir}/mpig_symbol_map.txt | \
+ sed -e 's/^/#define /' >>.mpig_symbol_map_public.h
+ fi
+ if test "${MPIG_VMPI_PREMAIN_LIBS_REQUIRED}" = "yes" ; then
+ echo '#define main(argc_, argv_) mpig_app_main(argc_, argv_)' >>.mpig_symbol_map_public.h
+ fi
+ grep -v '^P\?MPI_' ${srcdir}/mpig_symbol_map.txt | grep -v -f .mpig_symbol_map_public_extras.txt \
+ ${srcdir}/mpig_symbol_map.txt | sed -e 's/^/#define /' >.mpig_symbol_map_internal.h
+ fi
+
+])
+
+AC_OUTPUT_COMMANDS
+
+notice_msg=`echo "end of configure for the ${device_name} device" | tr '[a-z]' '[A-Z]'`
+AC_MSG_NOTICE([$notice_msg])
+AC_MSG_NOTICE([----------------------------------------])
Deleted: mpich2/trunk/src/mpid/globus/configure.in
===================================================================
--- mpich2/trunk/src/mpid/globus/configure.in 2012-02-28 23:25:23 UTC (rev 9547)
+++ mpich2/trunk/src/mpid/globus/configure.in 2012-02-28 23:26:34 UTC (rev 9548)
@@ -1,825 +0,0 @@
-#
-# Globus device code: Copyright 2005 Northern Illinois University
-# Borrowed MPICH-G2 code: Copyright 2000 Argonne National Laboratory and Northern Illinois University
-# Borrowed MPICH2 device code: Copyright 2001 Argonne National Laboratory
-#
-# XXX: INSERT POINTER TO OFFICIAL COPYRIGHT TEXT
-#
-
-AC_INIT(configure.in)
-
-notice_msg=`echo "start of configure for the ${device_name} device" | tr '[a-z]' '[A-Z]'`
-AC_MSG_NOTICE([----------------------------------------])
-AC_MSG_NOTICE([$notice_msg])
-
-#
-# set the directory that contains support scripts such as install-sh and config.guess
-#
-AC_CONFIG_AUX_DIR(../../../confdb)
-
-#
-# definitions will be placed in mpidconf.h file rather than in the DEFS variable
-#
-cp ${srcdir}/mpidconf.h.in .
-# echo "" >mpidconf-extras.h.in
-# echo '/**** mpidconf-extras.h.in: generated by src/mpid/$device_name/configure ****/' >>mpidconf-extras.h.in
-AC_CONFIG_HEADERS(mpidconf.h)
-
-AC_DEFUN([LAH_TEMPLATE],[
- cat >>mpidconf.h.in <<_LACEOF
-
-m4_text_wrap([$2 */], [ ], [/* ])
-[@%:@undef] $1
-_LACEOF
-])
-
-#
-# save initial values of important variables
-#
-MPIG_SAVE_LIBS=${LIBS}
-
-#
-# configuration options
-#
-AC_ARG_ENABLE(mpig-threaded,
-[--enable-mpig-threaded=package - enable use of threads within the MPIg device.
-The following thread packages are supported.
- globus - Globus threads [only option if using Globus middleware]
- pthreads - POSIX threads [default if not using Globus middleware]
- none - MPIg device will not use threads],,enable_mpig_threaded=default)
-
-#
-# first check that we have a clean build if we are doing a VPATH build
-#
-PAC_VPATH_CHECK()
-
-#
-# load cached results computed in the top-level configure tests
-#
-PAC_LOAD_BASE_CACHE
-
-#
-# check for standard programs needed by the Makefile
-#
-AC_PROG_INSTALL
-PAC_PROG_CHECK_INSTALL_WORKS
-PAC_PROG_MKDIR_P
-PAC_PROG_MAKE
-
-#
-# check for optional, but common C types
-#
-AC_CHECK_TYPES(bool bool_t)
-
-#
-# get sizes for intrinsic C types
-#
-AC_CHECK_SIZEOF(char)
-AC_CHECK_SIZEOF(short)
-AC_CHECK_SIZEOF(int)
-AC_CHECK_SIZEOF(long)
-AC_CHECK_SIZEOF(long long)
-AC_CHECK_SIZEOF(float)
-AC_CHECK_SIZEOF(double)
-AC_CHECK_SIZEOF(long double)
-AC_CHECK_SIZEOF(void *)
-
-#
-# create a mapping from integer types to printf integer conversion length modifiers
-#
-mpig_char_fmt_mod="hh"
-mpig_unsigned_char_fmt_mod="hh"
-mpig_short_fmt_mod="h"
-mpig_unsigned_short_fmt_mod="h"
-mpig_int_fmt_mod=""
-mpig_unsigned_int_fmt_mod=""
-mpig_long_fmt_mod="l"
-mpig_unsigned_long_fmt_mod="l"
-mpig_long_long_fmt_mod="ll"
-mpig_unsigned_long_long_fmt_mod="ll"
-
-#
-# determine the unsigned integer type to which a pointer should be cast when doing a printf. also get the corresponding printf
-# conversion specifier.
-#
-AC_MSG_CHECKING([for an unsigned integer type big enough to hold a pointer])
-MPIG_PTR_CAST=""
-for mpig_type in "char" "short" "int" "long" "long long" ; do
- eval mpig_size="\${ac_cv_sizeof_`echo ${mpig_type} | tr '[ *]' [_p]`}"
- if test ${ac_cv_sizeof_void_p} -eq ${mpig_size} ; then
- MPIG_PTR_CAST="unsigned ${mpig_type}"
- break
- fi
-done
-if test -n "${MPIG_PTR_CAST}" ; then
- AC_MSG_RESULT([${MPIG_PTR_CAST}])
-else
- AC_MSG_RESULT([unknown])
- AC_MSG_ERROR([unable to find an integer type big enough to hold a pointer!])
-fi
-
-AC_MSG_CHECKING([printf conversion specifier for a pointer])
-eval MPIG_PTR_FMT="\"\\\"0x%0`expr ${ac_cv_sizeof_void_p} \* 2`\${mpig_`echo ${MPIG_PTR_CAST} | tr '[ *]' [_p]`_fmt_mod}x\\\"\""
-AC_MSG_RESULT([${MPIG_PTR_FMT}])
-dnl AC_DEFINE_UNQUOTED(MPIG_PTR_CAST,${MPIG_PTR_CAST:?},[an unsigned integer big enough to hold a pointer])
-dnl AC_DEFINE_UNQUOTED(MPIG_PTR_FMT,${MPIG_PTR_FMT:?},[printf conversion specifier for a pointer converted to a MPIG_PTR_CAST])
-AC_SUBST(MPIG_PTR_CAST)
-AC_SUBST(MPIG_PTR_FMT)
-
-#
-# miscellaneous header and function checks
-#
-AC_CHECK_HEADERS(unistd.h limits.h stdint.h errno.h sched.h)
-AC_CHECK_FUNCS(sched_yield yield nanosleep usleep sleep)
-
-#
-# check for functions needed to get a complete fully qualified host name
-#
-AC_CHECK_FUNCS(gethostname getdomainname)
-if test "$ac_cv_func_gethostname" = "yes" ; then
- # do we need to declare gethostname?
- PAC_FUNC_NEEDS_DECL([#include <unistd.h>],gethostname)
-fi
-
-#
-# check for uuid generation packages
-#
-AC_CHECK_HEADERS(uuid/uuid.h)
-AC_SEARCH_LIBS(uuid_generate, uuid)
-AC_CHECK_FUNCS(uuid_generate uuid_parse uuid_unparse uuid_copy)
-
-#
-# determine this machine's endianess
-#
-AC_CACHE_CHECK([endianess of system],
-lac_cv_my_endian,[
-AC_RUN_IFELSE([
-AC_LANG_SOURCE([
-#include <stdio.h>
-#include <stdlib.h>
-int main(int argc, char **argv)
-{
- int data;
- char * datap = (char *) &data;
- FILE *f;
-
- f = fopen("conftest.out", "w");
- data = 10;
- if (*datap == 10)
- {
- fprintf(f, "little\n");
- }
- else if (*(datap + sizeof(int) - 1) == 10)
- {
- fprintf(f, "big\n");
- }
- else
- {
- fprintf(f, "undetermined\n");
- }
-
- fclose(f);
- exit(0);
-}
-])
-],lac_cv_my_endian=`cat conftest.out`,
- lac_cv_my_endian="FAILED",
- lac_cv_my_endian=${CROSS_MY_ENDIAN:-undetermined})
-])
-
-if test "$lac_cv_my_endian" = "big" ; then
- MPIG_MY_ENDIAN="MPIG_ENDIAN_BIG"
-elif test "$lac_cv_my_endian" = "little" ; then
- MPIG_MY_ENDIAN="MPIG_ENDIAN_LITTLE"
-else
- AC_MSG_ERROR([Unable to determine endianess of system. If cross compiling, set CROSS_MY_ENDIAN to "big" or "little".])
-fi
-AC_DEFINE_UNQUOTED(MPIG_MY_ENDIAN,${MPIG_MY_ENDIAN},[endianess of the system])
-
-#
-# determine if threads are to be used internally and which threads package will be used
-#
-if test -z "${MPIG_THREADED}" ; then
- case ${enable_mpig_threaded} in
- posix|pthread|pthreads|yes)
- MPIG_THREADS_PKG=posix
- MPIG_THREADED=yes
- ;;
- default|no|none)
- MPIG_THREADS_PKG=
- MPIG_THREADED=no
- ;;
- *)
- AC_MSG_ERROR([The threads package "${enable_mpig_threaded}" is not known to the ${device_name} device. Please select another package.])
- ;;
- esac
-elif test "${enable_mpig_threaded}" = "yes" -a "${MPIG_THREADED}" = "no" ; then
- AC_MSG_ERROR([The selected Grid Middleware package (${MPIG_GRID_PKG_NAME}) is not thread safe; however, the --enable-mpig-threaded option was passed to configure. Please remove the option or select a middleware package that is thread safe.])
-elif test "${enable_mpig_threaded}" = "no" -a "${MPIG_THREADED}" = "yes" ; then
- AC_MSG_ERROR([The selected Grid Middleware package (${MPIG_GRID_PKG_NAME}) requires threads; however, the --disable-mpig-threaded option was passed to configure. Please remove the option or select a middleware package that does not require threads.])
-elif test "${enable_mpig_threaded}" != "default" -a "${enable_mpig_threaded}" != "${MPIG_THREADS_PKG}" ; then
- AC_MSG_ERROR([The threads "${MPIG_THREADS_PKG} package is required by the selected Grid Middleware (${MPIG_GRID_PKG_NAME}); however, the --enable-mpig-threaded=${enable_mpig_threaded} option was passed to configure specified a different package. Please remove the option or select a middleware package that is compatible with the specified threads package.])
-fi
-if test "${MPIG_THREADED}" = "yes" ; then
- AC_DEFINE(MPIG_THREADED,1,[define if MPIg is allowed to use threads internally])
-fi
-if test -n "${MPIG_THREADS_PKG}" ; then
- mpig_define_name="HAVE_`echo ${MPIG_THREADS_PKG} | tr '[a-z- ]' '[A-Z__]'`_THREADS"
- LAH_TEMPLATE([${mpig_define_name}], [threads package to be used internally by MPIg])
- AC_DEFINE_UNQUOTED([${mpig_define_name}], 1)
-fi
-
-if test "${MPIG_THREADS_PKG}" = "posix" ; then
- AC_CHECK_HEADERS(pthread.h)
- AC_CHECK_FUNCS(pthread_yield)
- if test "$ac_cv_func_pthread_yield" = "yes" ; then
- PAC_FUNC_NEEDS_DECL([#include <pthread.h>],pthread_yield)
- fi
-fi
-
-#
-# determine if C compiler supports function inlining
-#
-AC_C_INLINE
-if test "$ac_cv_c_inline" != "no" ; then
- AC_DEFINE(HAVE_C_INLINE,1,[define if the C compiler supports function inlining])
-fi
-
-#
-# determine the size of MPICH2's MPI_AINT, and the printf conversion specifers for MPI_Aint and MPIU_Size_t
-#
-AC_MSG_CHECKING([size of MPICH2 MPI_AINT])
-eval SIZEOF_MPICH2_AINT="\${SIZEOF_`echo ${MPI_AINT} | tr '[a-z]' '[A-Z]'`}"
-AC_MSG_RESULT([$SIZEOF_MPICH2_AINT])
-AC_DEFINE_UNQUOTED(TYPEOF_MPICH2_AINT,${MPI_AINT:?},[integer type of the same size as the MPICH2 MPI_Aint type])
-AC_DEFINE_UNQUOTED(SIZEOF_MPICH2_AINT,${SIZEOF_MPICH2_AINT:?},[size of the MPICH2 MPI_Aint type])
-
-AC_MSG_NOTICE([INFO: MPI_Aint is "${MPI_AINT}"])
-AC_MSG_CHECKING([printf conversion specifier for MPI_Aint])
-eval MPIG_AINT_FMT="\"\\\"%\${MPIG_`echo ${MPI_AINT} | tr ' *' '_p'`_fmt_mod}d\\\"\""
-dnl AC_DEFINE_UNQUOTED(MPIG_AINT_FMT,${MPIG_AINT_FMT:?},[printf conversion specifier for MPI_Aint])
-AC_SUBST(MPIG_AINT_FMT)
-AC_MSG_RESULT([$MPIG_AINT_FMT])
-
-AC_MSG_NOTICE([INFO: MPIU_Size_t is "${MPIU_SIZE_T}"])
-AC_MSG_CHECKING([printf conversion specifier for MPIU_Size_t])
-eval MPIG_SIZE_FMT="\"\\\"%\${MPIG_`echo ${MPIU_SIZE_T} | tr ' *' '_p'`_fmt_mod}u\\\"\""
-dnl AC_DEFINE_UNQUOTED(MPIG_SIZE_FMT,${MPIG_SIZE_FMT:?},[printf conversion specifier for MPIU_Size_t])
-AC_SUBST(MPIG_SIZE_FMT)
-AC_MSG_RESULT([$MPIG_SIZE_FMT])
-
-#
-# determine if CPP supports variadic macros
-#
-AC_CACHE_CHECK([whether CPP accepts C99 style variadic macros],
-lac_cv_have_c99_variadic_macros,[
-AC_COMPILE_IFELSE([
-AC_LANG_SOURCE([
-#include <stdio.h>
-#define MY_PRINTF(rank, fmt, ...) printf("%d: " fmt, rank, ## __VA_ARGS__)
-int main(int argc, char ** argv)
-{
- MY_PRINTF(0, "hello");
- MY_PRINTF(1, "world %d", 3);
- return 0;
-}
-])
-], lac_cv_have_c99_variadic_macros=yes, lac_cv_have_c99_variadic_macros=no)
-])
-if test $lac_cv_have_c99_variadic_macros = "yes" ; then
- AC_DEFINE(HAVE_C99_VARIADIC_MACROS,,[define if CPP supports C99 style variadic macros])
-fi
-
-AC_CACHE_CHECK([whether CPP accepts GNU style variadic macros],
-lac_cv_have_gnu_variadic_macros,[
-AC_COMPILE_IFELSE([
-AC_LANG_SOURCE([
-#include <stdio.h>
-#define MY_PRINTF(rank, fmt, args...) printf("%d: " fmt, rank, ## args)
-int main(int argc, char ** argv)
-{
- MY_PRINTF(0, "hello");
- MY_PRINTF(1, "world %d", 3);
- return 0;
-}
-])
-], lac_cv_have_gnu_variadic_macros=yes, lac_cv_have_gnu_variadic_macros=no)
-])
-if test $lac_cv_have_gnu_variadic_macros = "yes" ; then
- AC_DEFINE(HAVE_GNU_VARIADIC_MACROS,,[define if CPP supports GNU style variadic macros])
-fi
-
-#
-# determine if the compiler defines a symbol containing the function name
-#
-AC_CACHE_CHECK([whether the compiler defines __func__],
-lac_cv_have__func__,[
-AC_RUN_IFELSE([
-AC_LANG_SOURCE([
-#include <string.h>
-int foo(void);
-int foo(void)
-{
- return (strcmp(__func__, "foo") == 0);
-}
-int main(int argc, char ** argv)
-{
- return (foo() ? 0 : 1);
-}
-])
-], lac_cv_have__func__=yes, lac_cv_have__func__=no)
-])
-if test $lac_cv_have__func__ = "yes" ; then
- AC_DEFINE(HAVE__FUNC__,,[define if the compiler defines __func__])
-fi
-
-AC_CACHE_CHECK([whether the compiler defines __FUNC__],
-lac_cv_have_cap__func__,[
-AC_RUN_IFELSE([
-AC_LANG_SOURCE([
-#include <string.h>
-int foo(void);
-int foo(void)
-{
- return (strcmp(__FUNC__, "foo") == 0);
-}
-int main(int argc, char ** argv)
-{
- return (foo() ? 0 : 1);
-}
-])
-], lac_cv_have_cap__func__=yes, lac_cv_have_cap__func__=no)
-])
-if test $lac_cv_have_cap__func__ = "yes" ; then
- AC_DEFINE(HAVE_CAP__FUNC__,,[define if the compiler defines __FUNC__])
-fi
-
-AC_CACHE_CHECK([whether the compiler sets __FUNCTION__],
-lac_cv_have__function__,[
-AC_RUN_IFELSE([
-AC_LANG_SOURCE([
-#include <string.h>
-int foo(void);
-int foo(void)
-{
- return (strcmp(__FUNCTION__, "foo") == 0);
-}
-int main(int argc, char ** argv)
-{
- return (foo() ? 0 : 1);
-}
-])
-], lac_cv_have__function__=yes, lac_cv_have__function__=no)
-])
-if test $lac_cv_have__function__ = "yes" ; then
- AC_DEFINE(HAVE__FUNCTION__,,[define if the compiler defines __FUNCTION__])
-fi
-
-#
-# m4 macros to acquire information from the vendor MPI
-#
-AC_DEFUN([LAC_CHECK_C_VMPI_FUNC],
-[
-m4_pushdef([lac_upper_varname], m4_translit([HAVE_C_V$1], [a-z], [A-Z]))
-m4_pushdef([lac_lower_varname], m4_translit([lac_cv_have_c_v$1], [A-Z], [a-z]))
-AC_CACHE_CHECK([for the vendor MPI function $1 (C binding)], lac_lower_varname, [
-SAVE_MPIG_CONFIGURE_ACTIVE=${MPIG_CONFIGURE_ACTIVE}
-MPIG_CONFIGURE_ACTIVE=""
-AC_LINK_IFELSE([
-AC_LANG_SOURCE([
-void $1(float * a);
-int main(int argc, char *argv[[]])
-{
- void (*func)(float * a) = $1;
- float a = 1.0;
- func(&a);
- return 0;
-}
-], lac_lower_varname=yes, lac_lower_varname=no)
-])
-MPIG_CONFIGURE_ACTIVE=${SAVE_MPIG_CONFIGURE_ACTIVE}
-])
-if test ${lac_lower_varname} = "yes" ; then
- AC_DEFINE_UNQUOTED(lac_upper_varname, 1, [define if the vendor MPI provides the function $1])
-fi
-m4_popdef([lac_lower_varname])
-m4_popdef([lac_upper_varname])
-])
-
-AC_DEFUN([LAC_CHECK_C_VMPI_CONSTANT],
-[
-m4_pushdef([lac_upper_varname], m4_translit([HAVE_C_V$2], [a-z], [A-Z]))
-m4_pushdef([lac_lower_varname], m4_translit([lac_cv_have_c_v$2], [A-Z], [a-z]))
-AC_CACHE_CHECK([for the vendor MPI constant $2 (C binding)], lac_lower_varname, [
-SAVE_MPIG_CONFIGURE_ACTIVE=${MPIG_CONFIGURE_ACTIVE}
-MPIG_CONFIGURE_ACTIVE=""
-AC_COMPILE_IFELSE([
-AC_LANG_SOURCE([
-#include "mpi.h"
-void func($1 a);
-int main(int argc, char *argv[[]])
-{
- $1 a = $2;
- func(a);
- return 0;
-}
-])
-], lac_lower_varname=yes, lac_lower_varname=no)
-MPIG_CONFIGURE_ACTIVE=${SAVE_MPIG_CONFIGURE_ACTIVE}
-])
-if test ${lac_lower_varname} = "yes" ; then
- AC_DEFINE_UNQUOTED(lac_upper_varname, 1, [define if the the vendor MPI provides the constant $2])
-fi
-m4_popdef([lac_lower_varname])
-m4_popdef([lac_upper_varname])
-])
-
-AC_DEFUN([LAC_GET_VMPI_TYPE_FORMAT],
-[
-m4_pushdef([lac_upper_type], m4_translit([V$1], [a-z], [A-Z]))
-m4_pushdef([lac_lower_varname], m4_translit([lac_cv_fmt_v$1], [A-Z], [a-z]))
-AC_CACHE_CHECK([printf conversion specifier for vendor $1], lac_lower_varname, [
-if test "${[TYPEOF_]lac_upper_type[_IS_BASIC]}" = "yes" ; then
- lac_fmt_mod_varname='mpig_'${[TYPEOF_]lac_upper_type}'_fmt_mod'
- eval lac_fmt_mod='${'${lac_fmt_mod_varname}'}'
- lac_lower_varname="\"0x%0`expr 2 \* ${[SIZEOF_]lac_upper_type}`${lac_fmt_mod}x\""
- unset lac_fmt_mod_varname
- unset lac_fmt_mod
-else
- lac_lower_varname="not basic!"
-fi
-])
-if test "${lac_lower_varname}" != "not basic!" ; then
- AC_DEFINE_UNQUOTED([FMT_]lac_upper_type, ${lac_lower_varname}, [printf conversion specifier for vendor $1 handle])
-fi
-m4_popdef([lac_lower_varname])
-m4_popdef([lac_upper_type])
-])
-
-#
-# vendor MPI
-#
-if test "${MPIG_VMPI:?}" != "no" ; then
- # vendor MPI settings from mpich2prereq
- AC_DEFINE(MPIG_VMPI,1,[define if we are building on top of a vendor MPI])
-
- AC_DEFINE_UNQUOTED(SIZEOF_VMPI_COMM,${SIZEOF_VMPI_COMM:?},[size of the vendor MPI_Comm handle])
- AC_DEFINE_UNQUOTED(TYPEOF_VMPI_COMM, ${TYPEOF_VMPI_COMM:?}, [C type equivalent to a vendor MPI_Comm handle])
- if test "${TYPEOF_VMPI_COMM_IS_BASIC:?}" = yes; then
- AC_DEFINE(TYPEOF_VMPI_COMM_IS_BASIC, 1, [define if TYPEOF_VMPI_COMM is a basic C type])
- fi
- LAC_GET_VMPI_TYPE_FORMAT(MPI_Comm)
-
- AC_DEFINE_UNQUOTED(SIZEOF_VMPI_DATATYPE,${SIZEOF_VMPI_DATATYPE:?},[size of the vendor MPI_Datatype handle])
- AC_DEFINE_UNQUOTED(TYPEOF_VMPI_DATATYPE, ${TYPEOF_VMPI_DATATYPE:?}, [C type equivalent to a vendor MPI_Datatype handle])
- if test "${TYPEOF_VMPI_DATATYPE_IS_BASIC:?}" = yes; then
- AC_DEFINE(TYPEOF_VMPI_DATATYPE_IS_BASIC, 1, [define if TYPEOF_VMPI_DATATYPE is a basic C type])
- fi
- LAC_GET_VMPI_TYPE_FORMAT(MPI_Datatype)
-
- AC_DEFINE_UNQUOTED(SIZEOF_VMPI_OP,${SIZEOF_VMPI_OP:?},[size of the vendor MPI_Op object])
- AC_DEFINE_UNQUOTED(TYPEOF_VMPI_OP, ${TYPEOF_VMPI_OP:?}, [C type equivalent to a vendor MPI_Op handle])
- if test "${TYPEOF_VMPI_OP_IS_BASIC:?}" = yes; then
- AC_DEFINE(TYPEOF_VMPI_OP_IS_BASIC, 1, [define if TYPEOF_VMPI_OP is a basic C type])
- fi
- LAC_GET_VMPI_TYPE_FORMAT(MPI_Op)
-
- AC_DEFINE_UNQUOTED(SIZEOF_VMPI_REQUEST,${SIZEOF_VMPI_REQUEST:?},[size of the vendor MPI_Request handle])
- AC_DEFINE_UNQUOTED(TYPEOF_VMPI_REQUEST, ${TYPEOF_VMPI_REQUEST:?}, [C type equivalent to a vendor MPI_Request handle])
- if test "${TYPEOF_VMPI_REQUEST_IS_BASIC:?}" = yes; then
- AC_DEFINE(TYPEOF_VMPI_REQUEST_IS_BASIC, 1, [define if TYPEOF_VMPI_REQUEST is a basic C type])
- fi
- LAC_GET_VMPI_TYPE_FORMAT(MPI_Request)
-
- AC_DEFINE_UNQUOTED(SIZEOF_VMPI_STATUS,${SIZEOF_VMPI_STATUS:?},[size of the vendor MPI_Status object])
- AC_DEFINE_UNQUOTED(TYPEOF_VMPI_STATUS, ${TYPEOF_VMPI_STATUS:?}, [C type equivalent to a vendor MPI_Status handle])
- if test "${TYPEOF_VMPI_STATUS_IS_BASIC:?}" = yes; then
- AC_DEFINE(TYPEOF_VMPI_STATUS_IS_BASIC, 1, [define if TYPEOF_VMPI_STATUS is a basic C type])
- fi
- AC_DEFINE_UNQUOTED(SIZEOF_VMPI_AINT,${SIZEOF_VMPI_AINT:?},[size of the vendor MPI_Aint type])
-
- # determine if the vendor MPI supports MPI-2 functionality
- LAC_CHECK_C_VMPI_FUNC(MPI_Comm_get_attr)
- LAC_CHECK_C_VMPI_FUNC(MPI_Comm_set_errhandler)
- LAC_CHECK_C_VMPI_FUNC(MPI_Init_thread)
- LAC_CHECK_C_VMPI_FUNC(MPI_Type_dup)
- LAC_CHECK_C_VMPI_FUNC(MPI_Type_create_hvector)
- LAC_CHECK_C_VMPI_FUNC(MPI_Type_create_hindexed)
- LAC_CHECK_C_VMPI_FUNC(MPI_Type_create_indexed_block)
- LAC_CHECK_C_VMPI_FUNC(MPI_Type_create_resized)
- LAC_CHECK_C_VMPI_FUNC(MPI_Type_create_struct)
-
- LAC_CHECK_C_VMPI_CONSTANT(MPI_Datatype, MPI_LONG_DOUBLE)
- LAC_CHECK_C_VMPI_CONSTANT(MPI_Datatype, MPI_LONG_DOUBLE_INT)
- LAC_CHECK_C_VMPI_CONSTANT(MPI_Datatype, MPI_LONG_LONG)
- LAC_CHECK_C_VMPI_CONSTANT(MPI_Datatype, MPI_LONG_LONG_INT)
- LAC_CHECK_C_VMPI_CONSTANT(MPI_Datatype, MPI_UNSIGNED_LONG_LONG)
- LAC_CHECK_C_VMPI_CONSTANT(MPI_Datatype, MPI_SIGNED_CHAR)
- LAC_CHECK_C_VMPI_CONSTANT(MPI_Datatype, MPI_WCHAR)
-
- # determine which, if any, of the Fortran datatype handles are defined in the C header file
- LAC_CHECK_C_VMPI_CONSTANT(MPI_Datatype, MPI_INTEGER)
- if test "$lac_cv_have_c_vmpi_integer" = "yes" ; then
- LAC_CHECK_C_VMPI_CONSTANT(MPI_Datatype, MPI_INTEGER1)
- LAC_CHECK_C_VMPI_CONSTANT(MPI_Datatype, MPI_INTEGER2)
- LAC_CHECK_C_VMPI_CONSTANT(MPI_Datatype, MPI_INTEGER4)
- LAC_CHECK_C_VMPI_CONSTANT(MPI_Datatype, MPI_INTEGER8)
- LAC_CHECK_C_VMPI_CONSTANT(MPI_Datatype, MPI_INTEGER16)
- LAC_CHECK_C_VMPI_CONSTANT(MPI_Datatype, MPI_REAL4)
- LAC_CHECK_C_VMPI_CONSTANT(MPI_Datatype, MPI_REAL8)
- LAC_CHECK_C_VMPI_CONSTANT(MPI_Datatype, MPI_REAL16)
- LAC_CHECK_C_VMPI_CONSTANT(MPI_Datatype, MPI_COMPLEX8)
- LAC_CHECK_C_VMPI_CONSTANT(MPI_Datatype, MPI_COMPLEX16)
- LAC_CHECK_C_VMPI_CONSTANT(MPI_Datatype, MPI_COMPLEX32)
- LAC_CHECK_C_VMPI_CONSTANT(MPI_Datatype, MPI_DOUBLE_COMPLEX)
- LAC_CHECK_C_VMPI_CONSTANT(MPI_Datatype, MPI_2DOUBLE_COMPLEX)
-
- AC_DEFINE(HAVE_F77_VMPI_DATATYPES_IN_C,1,[define if the vendor MPI defines Fortran datatypes in its C binding])
- else
- # FIXME: if the Fortran datatype handles are not defined in the C header file, then we will need to jump through some
- # hoops when mirroring the construction of datatypes that involve Fortran handles. this problem likely also exists for
- # other bindings like C++ for which the MPI-2 assigns handles for boolean and complex types. MPI-2 provides a mechanism
- # for converting handles from one language to another, but MPI-1 does not. this could get very complicated...
- AC_MSG_FAILURE(
- [MPIg requires the vendor MPI to define the datatype handles for all language bindings in the C header file])
- fi
-
- LAC_CHECK_C_VMPI_CONSTANT(MPI_Op, MPI_REPLACE)
-
- LAC_CHECK_C_VMPI_CONSTANT(int, MPI_ERR_ACCESS)
- LAC_CHECK_C_VMPI_CONSTANT(int, MPI_ERR_AMODE)
- LAC_CHECK_C_VMPI_CONSTANT(int, MPI_ERR_ASSERT)
- LAC_CHECK_C_VMPI_CONSTANT(int, MPI_ERR_BAD_FILE)
- LAC_CHECK_C_VMPI_CONSTANT(int, MPI_ERR_BASE)
- LAC_CHECK_C_VMPI_CONSTANT(int, MPI_ERR_CONVERSION)
- LAC_CHECK_C_VMPI_CONSTANT(int, MPI_ERR_DISP)
- LAC_CHECK_C_VMPI_CONSTANT(int, MPI_ERR_DUP_DATAREP)
- LAC_CHECK_C_VMPI_CONSTANT(int, MPI_ERR_FILE)
- LAC_CHECK_C_VMPI_CONSTANT(int, MPI_ERR_FILE_EXISTS)
- LAC_CHECK_C_VMPI_CONSTANT(int, MPI_ERR_FILE_IN_USE)
- LAC_CHECK_C_VMPI_CONSTANT(int, MPI_ERR_INFO)
- LAC_CHECK_C_VMPI_CONSTANT(int, MPI_ERR_INFO_KEY)
- LAC_CHECK_C_VMPI_CONSTANT(int, MPI_ERR_INFO_NOKEY)
- LAC_CHECK_C_VMPI_CONSTANT(int, MPI_ERR_INFO_VALUE)
- LAC_CHECK_C_VMPI_CONSTANT(int, MPI_ERR_IO)
- LAC_CHECK_C_VMPI_CONSTANT(int, MPI_ERR_KEYVAL)
- LAC_CHECK_C_VMPI_CONSTANT(int, MPI_ERR_LOCKTYPE)
- LAC_CHECK_C_VMPI_CONSTANT(int, MPI_ERR_NAME)
- LAC_CHECK_C_VMPI_CONSTANT(int, MPI_ERR_NOT_SAME)
- LAC_CHECK_C_VMPI_CONSTANT(int, MPI_ERR_NO_MEM)
- LAC_CHECK_C_VMPI_CONSTANT(int, MPI_ERR_NO_SPACE)
- LAC_CHECK_C_VMPI_CONSTANT(int, MPI_ERR_NO_SUCH_FILE)
- LAC_CHECK_C_VMPI_CONSTANT(int, MPI_ERR_PORT)
- LAC_CHECK_C_VMPI_CONSTANT(int, MPI_ERR_QUOTA)
- LAC_CHECK_C_VMPI_CONSTANT(int, MPI_ERR_READ_ONLY)
- LAC_CHECK_C_VMPI_CONSTANT(int, MPI_ERR_RMA_CONFLICT)
- LAC_CHECK_C_VMPI_CONSTANT(int, MPI_ERR_RMA_SYNC)
- LAC_CHECK_C_VMPI_CONSTANT(int, MPI_ERR_SERVICE)
- LAC_CHECK_C_VMPI_CONSTANT(int, MPI_ERR_SIZE)
- LAC_CHECK_C_VMPI_CONSTANT(int, MPI_ERR_SPAWN)
- LAC_CHECK_C_VMPI_CONSTANT(int, MPI_ERR_UNSUPPORTED_DATAREP)
- LAC_CHECK_C_VMPI_CONSTANT(int, MPI_ERR_UNSUPPORTED_OPERATION)
- LAC_CHECK_C_VMPI_CONSTANT(int, MPI_ERR_WIN)
-
- AC_CACHE_CHECK([version of the MPI standard implemented by the vendor MPI],
- lac_cv_vmpi_version,[
- AC_RUN_IFELSE([
- AC_LANG_SOURCE([
- #include "mpi.h"
- #include <stdio.h>
- int main(int argc, char *argv[[]])
- {
- FILE * fp = fopen("conftest.out","w");
- fprintf(fp, "%d\n", MPI_VERSION);
- close(fp);
- return 0;
- }
- ])
- ], lac_cv_vmpi_version=`cat conftest.out`, lac_cv_vmpi_version=0)
- ])
-
- AC_DEFINE_UNQUOTED(MPIG_VMPI_VERSION,${lac_cv_vmpi_version},
- [define with the MPI standard version implemented by the vendor MPI])
-
- #
- # if the vendor MPI does not implement the MPI-2 standard, then it is possible that it also does not support passing NULL in
- # place of the command line arguments. in that case, we must provide an alternative main() that first calls MPI_Init and
- # calls the application's main(). see comments in mpig_vmpi_premain.c for additional details.
- #
- if test -z "${MPIG_VMPI_PREMAIN_LIBS_REQUIRED}" ; then
- if test ${lac_cv_vmpi_version} -lt 2 ; then
- MPIG_VMPI_PREMAIN_LIBS_REQUIRED=yes
- else
- MPIG_VMPI_PREMAIN_LIBS_REQUIRED=no
- fi
- fi
-
- if test "${MPIG_VMPI_PREMAIN_LIBS_REQUIRED}" = "yes" ; then
- AC_DEFINE(MPIG_VMPI_PREMAIN_REQUIRED,1,
- [define if MPIg must initialize the vendor MPI before the main routine of the application is called])
- for c in cc cxx ; do
- cnu=`echo ${c} | tr '[a-z]' '[A-Z]'`
- cf=mpich2-grid-${c}
- premain_lib="libmpig_vmpi_premain_${c}.a"
- if test -f ${cf} ; then
- AC_MSG_NOTICE([Updating the paths in the MPIg compiler script ${cf}])
- mv ${cf} ${cf}.orig
- sed -e 's!^\(MPIG_VMPI_PREMAIN_LIB\)=.*!\1="'"${MPIG_BUILD_DIR}/${premain_lib}"'"!' ${cf}.orig >${cf}
- chmod 755 ${cf}
- rm -f ${cf}.orig
- eval MPIG_VMPI_PREMAIN_${cnu}_LIB=${premain_lib}
- fi
- done
- fi
-
- MPIG_VMPI_DEFINED=1
-
-else # no vendor MPI
-
- MPIG_VMPI_DEFINED=0
-fi
-
-AC_SUBST(MPIG_VMPI)
-AC_SUBST(MPIG_VMPI_DEFINED)
-AC_SUBST(MPIG_VMPI_PREMAIN_CC_LIB)
-AC_SUBST(MPIG_VMPI_PREMAIN_CXX_LIB)
-# end of vendor MPI section
-
-#
-# miscellaneous settings from mpich2prereq
-#
-dnl AC_DEFINE_UNQUOTED(MPIG_USING_GRID_PKG,"${MPIG_USING_GRID_PKG:?}",[Grid middleware being used by MPIg])
-
-AC_SUBST(MPIG_SOURCE_DIR)
-AC_SUBST(MPIG_BUILD_DIR)
-
-AC_DEFINE_UNQUOTED(MPIG_MPICH2_VERSION,"${MPIG_MPICH2_VERSION:?}",[MPICH2 version])
-
-if test "${MPIG_DEBUG:?}" = "yes" ; then
- AC_DEFINE(MPIG_DEBUG,1,[define if MPIg should include debugging output and checks])
- MPIG_DEBUG_DEFINED=1
-else
- MPIG_DEBUG_DEFINED=0
-fi
-AC_SUBST(MPIG_DEBUG_DEFINED)
-
-dnl AC_DEFINE_UNQUOTED(TYPEOF_MPIG_ALIGNED_T,${TYPEOF_MPIG_ALIGNED_T:?},[type to use insure proper memory alignment for all types])
-dnl AC_DEFINE_UNQUOTED(SIZEOF_MPIG_ALIGNED_T,${SIZEOF_MPIG_ALIGNED_T:?},[size of the type used for aligning memory accesses])
-dnl AC_DEFINE_UNQUOTED(MEMALIGN_MPIG_ALIGNED_T,${MEMALIGN_MPIG_ALIGNED_T:?},[memory alignment of MPIG_ALIGNED_T])
-
-if test "${MPIG_ROMIO_ENABLED:?}" = "yes" ; then
- ROMIO_ENABLED=1
-else
- ROMIO_ENABLED=0
-fi
-AC_SUBST(ROMIO_ENABLED)
-
-#
-# Globus settings from mpich2prereq
-#
-if test "${MPIG_USING_GRID_PKG}" = "globus" ; then
- if test "${HAVE_GLOBUS_COMMON_MODULE}" = "yes" ; then
- AC_DEFINE(HAVE_GLOBUS_COMMON_MODULE,1,[define if the Globus Common module is installed])
- fi
-
- if test "${HAVE_GLOBUS_DC_MODULE}" = "yes" ; then
- AC_DEFINE(HAVE_GLOBUS_DC_MODULE,1,[define if the Globus Common module is installed])
- fi
-
- if test "${HAVE_GLOBUS_USAGE_MODULE:?}" = "yes" ; then
- AC_DEFINE(HAVE_GLOBUS_USAGE_MODULE,1,[define if Globus Usage module is installed])
- AC_DEFINE_UNQUOTED(HAVE_GLOBUS_USAGE_VERSION,"${HAVE_GLOBUS_USAGE_VERSION:?}",[Globus Usage module version])
- fi
-
- if test "${HAVE_GLOBUS_DUROC_MODULE}" = "yes" ; then
- AC_DEFINE(HAVE_GLOBUS_DUROC_MODULE,1,[define if the Globus DUROC Runtime module is installed])
- fi
-
- if test "${HAVE_GLOBUS_RENDEZVOUS_MODULE}" = "yes" ; then
- AC_DEFINE(HAVE_GLOBUS_RENDEZVOUS_MODULE,1,[define if the Globus Rendezvous Client C bindings module is installed])
- fi
-
- if test "${HAVE_GLOBUS_XIO_MODULE:?}" = "yes" ; then
- AC_DEFINE(HAVE_GLOBUS_XIO_MODULE,1,[define if Globus XIO module is installed])
- AC_DEFINE_UNQUOTED(HAVE_GLOBUS_XIO_VERSION,"${HAVE_GLOBUS_XIO_VERSION:?}",[Globus XIO module version])
- fi
-
- # since mpich2preq-globus sets MPIG_THREADS_PKG to globus, HAVE_GLOBUS_THREADS is automatically defined above in the
- # section on thread packages
- #
- # if test "${HAVE_GLOBUS_THREADS}" = "yes" ; then
- # AC_DEFINE(HAVE_GLOBUS_THREADS,1,[define if the flavor of Globus being used is multithreaded])
- # fi
-fi
-
-#
-# setup file substitutions needed to create mpiddefs.h
-#
-if test "${MPIG_RENAME_SYMBOLS:?}" = "yes" ; then
- MPIG_SYMBOL_MAP_PUBLIC_H=.mpig_symbol_map_public.h
- MPIG_SYMBOL_MAP_INTERNAL_H=.mpig_symbol_map_internal.h
- AC_DEFINE(MPIG_RENAME_SYMBOLS,1,[define if MPI symbols need to be renamed])
- MPIG_RENAME_SYMBOLS_DEFINED=1
-else
- MPIG_SYMBOL_MAP_PUBLIC_H=/dev/null
- MPIG_SYMBOL_MAP_INTERNAL_H=/dev/null
- MPIG_RENAME_SYMBOLS_DEFINED=0
-fi
-AC_SUBST_FILE(MPIG_SYMBOL_MAP_PUBLIC_H)
-AC_SUBST_FILE(MPIG_SYMBOL_MAP_INTERNAL_H)
-AC_SUBST(MPIG_RENAME_SYMBOLS_DEFINED)
-
-#
-# settings imported from the top-level configure
-#
-AC_SUBST(AR)
-AC_SUBST(AR_FLAGS)
-AC_SUBST(RANLIB)
-AC_SUBST(MPILIBNAME)
-AC_SUBST(PMPILIBNAME)
-AC_SUBST(CC)
-AC_SUBST(CFLAGS)
-AC_SUBST(CPPFLAGS)
-AC_SUBST(DEFS)
-AC_SUBST(LDFLAGS)
-AC_SUBST(LIBS)
-PAC_CC_SUBDIR_SHLIBS
-AC_SUBST(master_top_srcdir)
-AC_SUBST(master_top_builddir)
-AC_SUBST(ETAGS)
-AC_SUBST(ETAGSADD)
-
-#
-# dependency handling
-#
-AC_SUBST(MAKE_DEPEND_C)
-
-#
-# setting to be included in localdefs.h
-#
-# XXX: MPIG_SAVE_LIBS may contain special regex characters that need to be escaped
-EXTRA_LIBS=`echo ${LIBS} | sed -e "s/^${MPIG_SAVE_LIBS} *//"`
-AC_SUBST(EXTRA_LIBS)
-
-#
-# create Makefile, etc.
-#
-AC_OUTPUT(Makefile examples/Makefile mpiexec mpiddefs.h.out:mpiddefs.h.in localdefs,
-[
- AC_MSG_NOTICE([Copying mpiexec to $master_top_builddir/bin/])
- if test ! -d $master_top_builddir/bin ; then
- mkdir $master_top_builddir/bin
- fi
- chmod 755 mpiexec
- cp -pf mpiexec $master_top_builddir/bin/mpiexec
-
- if test ! -d $master_top_builddir/src/include ; then
- mkdir $master_top_builddir/src/include
- fi
-
- # if the mpiddefs.h file has changed, then copy it to the top-level include directory
- mpig_copy_file=yes
- if test -f $master_top_builddir/src/include/mpiddefs.h ; then
- if diff $master_top_builddir/src/include/mpiddefs.h mpiddefs.h.out >/dev/null 2>&1 ; then
- mpig_copy_file=no
- fi
- fi
- if test "$mpig_copy_file" = "yes" ; then
- AC_MSG_NOTICE([Copying mpiddefs.h.out to $master_top_builddir/src/include/])
- cp -pf mpiddefs.h.out $master_top_builddir/src/include/mpiddefs.h
- else
- AC_MSG_NOTICE([mpiddefs.h.out has not changed. skipping copy to top-level include directory.])
- fi
- if test "$MPIG_RENAME_SYMBOLS" = "yes" ; then
- true
- # rm -f .mpig_symbol_map_*
- fi
-],
-[
- master_top_builddir=${master_top_builddir}
- master_top_srcdir=${master_top_srcdir}
- MPIG_RENAME_SYMBOLS=${MPIG_RENAME_SYMBOLS}
- if test "${MPIG_RENAME_SYMBOLS}" = "yes" ; then
- AC_MSG_NOTICE([Extracting symbols from the symbol map])
- grep '^MPI_' ${srcdir}/mpig_symbol_map.txt | sed -e 's/^/#define /' >.mpig_symbol_map_public.h
- grep '^PMPI_' ${srcdir}/mpig_symbol_map.txt | sed -e 's/^/#define /' >>.mpig_symbol_map_public.h
- [grep '^\#[[:space:]]*define[[:space:]]\+P\?MPI_[[:alnum:]_]\+[[:space:]]\+MPI[RD][[:alnum:]_]\+' \
- $master_top_srcdir/src/include/mpi.h.in | sed -e 's/.*[[:space:]]\(.*\)/^\1[ ]/' >.mpig_symbol_map_public_extras.txt]
- if test -s .mpig_symbol_map_public_extras.txt ; then
- grep -f .mpig_symbol_map_public_extras.txt ${srcdir}/mpig_symbol_map.txt | \
- sed -e 's/^/#define /' >>.mpig_symbol_map_public.h
- fi
- if test "${MPIG_VMPI_PREMAIN_LIBS_REQUIRED}" = "yes" ; then
- echo '#define main(argc_, argv_) mpig_app_main(argc_, argv_)' >>.mpig_symbol_map_public.h
- fi
- grep -v '^P\?MPI_' ${srcdir}/mpig_symbol_map.txt | grep -v -f .mpig_symbol_map_public_extras.txt \
- ${srcdir}/mpig_symbol_map.txt | sed -e 's/^/#define /' >.mpig_symbol_map_internal.h
- fi
-
-])
-
-AC_OUTPUT_COMMANDS
-
-notice_msg=`echo "end of configure for the ${device_name} device" | tr '[a-z]' '[A-Z]'`
-AC_MSG_NOTICE([$notice_msg])
-AC_MSG_NOTICE([----------------------------------------])
Modified: mpich2/trunk/src/mpix/armci/m4/aclocal_cc.m4
===================================================================
--- mpich2/trunk/src/mpix/armci/m4/aclocal_cc.m4 2012-02-28 23:25:23 UTC (rev 9547)
+++ mpich2/trunk/src/mpix/armci/m4/aclocal_cc.m4 2012-02-28 23:26:34 UTC (rev 9548)
@@ -1283,7 +1283,7 @@
#
# determine if the compiler defines a symbol containing the function name
-# Inspired by checks within the src/mpid/globus/configure.in file in MPICH2
+# Inspired by checks within the src/mpid/globus/configure.ac file in MPICH2
#
# These tests check not only that the compiler defines some symbol, such
# as __FUNCTION__, but that the symbol correctly names the function.
Modified: mpich2/trunk/src/mpix/armci/m4/aclocal_shl.m4
===================================================================
--- mpich2/trunk/src/mpix/armci/m4/aclocal_shl.m4 2012-02-28 23:25:23 UTC (rev 9547)
+++ mpich2/trunk/src/mpix/armci/m4/aclocal_shl.m4 2012-02-28 23:26:34 UTC (rev 9548)
@@ -380,7 +380,7 @@
fi
# Libtool needs master_top_builddir
if test "X$master_top_builddir" = "X" ; then
- AC_MSG_ERROR([Libtool requires master_top_builddir - check configure.in sources])
+ AC_MSG_ERROR([Libtool requires master_top_builddir - check configure.ac sources])
fi
AC_SUBST(master_top_builddir)
fi
Modified: mpich2/trunk/src/mpix/armci/m4/aclocal_subcfg.m4
===================================================================
--- mpich2/trunk/src/mpix/armci/m4/aclocal_subcfg.m4 2012-02-28 23:25:23 UTC (rev 9547)
+++ mpich2/trunk/src/mpix/armci/m4/aclocal_subcfg.m4 2012-02-28 23:26:34 UTC (rev 9548)
@@ -25,7 +25,7 @@
dnl The subconfigure argument list is created based on "ac_precious_vars"
dnl instead of explicitly use of well-known Makefile variables, like
dnl CC/CFLAGS/CPPFLAGS..., this generalization is effective as long as
-dnl calling configure.in declares the needed variables to be passed down
+dnl calling configure.ac declares the needed variables to be passed down
dnl to subconfigure as "precious" appropriately. The precious variable
dnl can be created in the following ways:
dnl 1) implicit declaration through use of autoconf macros, like
@@ -34,7 +34,7 @@
dnl which are in turns invoked by other subconfigure.
dnl When in doubt, check "ac_precious_var" in the calling configure.
dnl 2) explicit "precious" declaration through AC_ARG_VAR.
-dnl Without correct "precious" declaration in the calling configure.in,
+dnl Without correct "precious" declaration in the calling configure.ac,
dnl there would be variables not being included in the subconfigure
dnl argument list.
dnl
Copied: mpich2/trunk/src/mpl/configure.ac (from rev 9546, mpich2/trunk/src/mpl/configure.in)
===================================================================
--- mpich2/trunk/src/mpl/configure.ac (rev 0)
+++ mpich2/trunk/src/mpl/configure.ac 2012-02-28 23:26:34 UTC (rev 9548)
@@ -0,0 +1,175 @@
+AC_PREREQ(2.63)
+#
+# (C) 2006 by Argonne National Laboratory.
+# See COPYRIGHT in top-level directory.
+#
+
+AC_INIT([MPL], [0.1])
+
+# sanity check that --srcdir was specified correctly
+AC_CONFIG_SRCDIR([src/mplstr.c])
+
+AC_CONFIG_AUX_DIR(confdb)
+AC_CONFIG_MACRO_DIR(confdb)
+AM_INIT_AUTOMAKE([-Wall -Werror foreign 1.10])
+
+LT_PREREQ([2.2.6])
+
+# Bug in libtool adds -O2 and -g by default
+save_cflags=$CFLAGS
+LT_INIT(disable-shared)
+CFLAGS=$save_cflags
+
+if test -s "$srcdir/VERSION" ; then
+ . $srcdir/VERSION
+ AC_SUBST(libmpl_so_version)
+else
+ AC_MSG_ERROR([Version information not found. Configuration aborted.])
+fi
+
+AC_CONFIG_HEADER([include/config.h])
+AX_PREFIX_CONFIG_H([include/mplconfig.h],[MPL])
+
+# Non-verbose make
+m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
+
+PAC_PROG_CC
+AC_C_CONST
+AC_C_RESTRICT
+
+PAC_C_MACRO_VA_ARGS
+
+# TODO: could add a --enable-embedded or similar to also control this
+AC_ARG_VAR([FROM_MPICH2],[set to "yes" if building MPL inside of MPICH2])
+AM_CONDITIONAL([MPL_EMBEDDED_MODE],[test "x$FROM_MPICH2" = "xyes"])
+
+# support gcov test coverage information
+PAC_ENABLE_COVERAGE
+
+# check for compiler support for the __typeof() extension
+AC_CACHE_CHECK([whether the compiler supports __typeof(variable)],
+ [pac_cv_have___typeof],
+[AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]],[[double foo = 0.0; __typeof(foo) bar = 1.0;]])],
+ [pac_cv_have___typeof=yes],
+ [pac_cv_have___typeof=no])]
+)
+if test "$pac_cv_have___typeof" = "yes" ; then
+ AC_DEFINE([HAVE___TYPEOF],[1],[defined if the C compiler supports __typeof(variable)])
+fi
+
+dnl Check if the necessary headers are available
+AC_CHECK_HEADERS(stdio.h stdlib.h string.h stdarg.h ctype.h)
+
+# A C99 compliant compiler should have inttypes.h for fixed-size int types
+AC_CHECK_HEADERS(inttypes.h stdint.h)
+
+#######################################################################
+# valgrind support
+AC_ARG_WITH([valgrind],
+[AS_HELP_STRING([--without-valgrind],[to disable valgrind support (such as because of version issues)])]
+[AS_HELP_STRING([--with-valgrind=PATH],[use valgrind headers installed in PATH (default is "yes", use no special path)])],
+[],[with_valgrind=yes])
+if test "$with_valgrind" != "no" ; then
+ savedCPPFLAGS="$CPPFLAGS"
+ if test "$with_valgrind" != "yes" ; then
+ # Clients of MPL will either need to respect the localdefs file (as in
+ # MPICH2) or add this entry to their own CPPFLAGS-equivalent.
+ # (TODO: a pkg-config file would help with this)
+ PAC_APPEND_FLAG([-I${with_valgrind}], [CPPFLAGS])
+ fi
+ # headers for valgrind client requests
+ AC_CHECK_HEADERS([valgrind.h memcheck.h valgrind/valgrind.h valgrind/memcheck.h])
+ # headers for valgrind-based thread checking tools
+ # TODO: incorporate ThreadSanitizer as well (include dynamic_annotations.h,
+ # link with dynamic_annotations.c)
+ AC_CHECK_HEADERS([helgrind.h valgrind/helgrind.h])
+ AC_CHECK_HEADERS([drd.h valgrind/drd.h])
+
+ # ensure that we have a new enough valgrind with all the client macros
+ # a preproc test would probably be sufficient, but the LINK_IFELSE helps us
+ # double-check that we aren't accidentally grabbing the headers for some
+ # other platform
+ AC_CACHE_CHECK([whether the valgrind headers are broken or too old],
+ [pac_cv_have_broken_valgrind],
+ [AC_LINK_IFELSE(
+ [AC_LANG_PROGRAM([
+#if defined(HAVE_VALGRIND_H) && defined(HAVE_MEMCHECK_H)
+# include <valgrind.h>
+# include <memcheck.h>
+#elif defined(HAVE_VALGRIND_VALGRIND_H) && defined(HAVE_VALGRIND_MEMCHECK_H)
+# include <valgrind/valgrind.h>
+# include <valgrind/memcheck.h>
+#else
+# error unexpected valgrind header error
+#endif
+int foo = 10;
+char mempool_obj;
+],[
+#if defined(VALGRIND_MAKE_MEM_DEFINED)
+ VALGRIND_MAKE_MEM_NOACCESS(&foo,sizeof(foo));
+ VALGRIND_MAKE_MEM_UNDEFINED(&foo,sizeof(foo));
+ VALGRIND_MAKE_MEM_DEFINED(&foo,sizeof(foo));
+ VALGRIND_CHECK_MEM_IS_DEFINED(&foo,sizeof(foo));
+ VALGRIND_CHECK_MEM_IS_ADDRESSABLE(&foo,sizeof(foo));
+#elif defined(VALGRIND_MAKE_READABLE)
+/* older (pre-3.2.0), but still supported style */
+ VALGRIND_MAKE_READABLE(&foo,sizeof(foo));
+ VALGRIND_MAKE_NOACCESS(&foo,sizeof(foo));
+ VALGRIND_MAKE_UNDEFINED(&foo,sizeof(foo));
+ VALGRIND_CHECK_READABLE(&foo,sizeof(foo));
+ VALGRIND_CHECK_WRITEABLE(&foo,sizeof(foo));
+#else
+#error missing essential valgrind client macros
+#endif
+ VALGRIND_CREATE_BLOCK(&foo,sizeof(foo),"description");
+ if (RUNNING_ON_VALGRIND) ++foo;
+ VALGRIND_PRINTF_BACKTRACE("testing: %s","valgrind support");
+ VALGRIND_CREATE_MEMPOOL(&mempool_obj,0,0);
+ VALGRIND_MEMPOOL_ALLOC(&mempool_obj,&foo,sizeof(foo));
+ VALGRIND_MEMPOOL_FREE(&mempool_obj,&foo);
+ VALGRIND_DESTROY_MEMPOOL(&mempool_obj);
+]) dnl end PROGRAM
+ ],
+ [pac_cv_have_broken_valgrind=no], dnl end if-true
+ [pac_cv_have_broken_valgrind=yes] dnl end if-false
+ )] dnl end IFELSE
+ ) dnl end CACHE_CHECK
+
+ if test "$pac_cv_have_broken_valgrind" = "yes" ; then
+ AC_DEFINE([HAVE_BROKEN_VALGRIND],[1],[define if valgrind is old and/or broken compared to what we are expecting])
+ CPPFLAGS="$savedCPPFLAGS"
+ fi
+fi
+#######################################################################
+
+
+# Check for strdup
+AC_CHECK_FUNCS(strdup)
+if test "$ac_cv_func_strdup" = "yes" ; then
+ PAC_FUNC_NEEDS_DECL([#include <string.h>],strdup)
+fi
+
+# Check for snprintf
+AC_CHECK_FUNCS(snprintf)
+if test "$ac_cv_func_snprintf" = "yes" ; then
+ PAC_FUNC_NEEDS_DECL([#include <stdio.h>],snprintf)
+fi
+
+# Check for strncmp
+AC_CHECK_FUNCS(strncmp)
+if test "$ac_cv_func_strncmp" = "yes" ; then
+ PAC_FUNC_NEEDS_DECL([#include <string.h>],strncmp)
+fi
+
+# Check for putenv
+AC_CHECK_FUNCS(putenv)
+if test "$ac_cv_func_putenv" = "yes" ; then
+ PAC_FUNC_NEEDS_DECL([#include <stdlib.h>],putenv)
+fi
+
+dnl Check for ATTRIBUTE
+PAC_C_GNU_ATTRIBUTE
+
+dnl Final output
+AC_CONFIG_FILES([Makefile localdefs])
+AC_OUTPUT
Deleted: mpich2/trunk/src/mpl/configure.in
===================================================================
--- mpich2/trunk/src/mpl/configure.in 2012-02-28 23:25:23 UTC (rev 9547)
+++ mpich2/trunk/src/mpl/configure.in 2012-02-28 23:26:34 UTC (rev 9548)
@@ -1,175 +0,0 @@
-AC_PREREQ(2.63)
-#
-# (C) 2006 by Argonne National Laboratory.
-# See COPYRIGHT in top-level directory.
-#
-
-AC_INIT([MPL], [0.1])
-
-# sanity check that --srcdir was specified correctly
-AC_CONFIG_SRCDIR([src/mplstr.c])
-
-AC_CONFIG_AUX_DIR(confdb)
-AC_CONFIG_MACRO_DIR(confdb)
-AM_INIT_AUTOMAKE([-Wall -Werror foreign 1.10])
-
-LT_PREREQ([2.2.6])
-
-# Bug in libtool adds -O2 and -g by default
-save_cflags=$CFLAGS
-LT_INIT(disable-shared)
-CFLAGS=$save_cflags
-
-if test -s "$srcdir/VERSION" ; then
- . $srcdir/VERSION
- AC_SUBST(libmpl_so_version)
-else
- AC_MSG_ERROR([Version information not found. Configuration aborted.])
-fi
-
-AC_CONFIG_HEADER([include/config.h])
-AX_PREFIX_CONFIG_H([include/mplconfig.h],[MPL])
-
-# Non-verbose make
-m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
-
-PAC_PROG_CC
-AC_C_CONST
-AC_C_RESTRICT
-
-PAC_C_MACRO_VA_ARGS
-
-# TODO: could add a --enable-embedded or similar to also control this
-AC_ARG_VAR([FROM_MPICH2],[set to "yes" if building MPL inside of MPICH2])
-AM_CONDITIONAL([MPL_EMBEDDED_MODE],[test "x$FROM_MPICH2" = "xyes"])
-
-# support gcov test coverage information
-PAC_ENABLE_COVERAGE
-
-# check for compiler support for the __typeof() extension
-AC_CACHE_CHECK([whether the compiler supports __typeof(variable)],
- [pac_cv_have___typeof],
-[AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]],[[double foo = 0.0; __typeof(foo) bar = 1.0;]])],
- [pac_cv_have___typeof=yes],
- [pac_cv_have___typeof=no])]
-)
-if test "$pac_cv_have___typeof" = "yes" ; then
- AC_DEFINE([HAVE___TYPEOF],[1],[defined if the C compiler supports __typeof(variable)])
-fi
-
-dnl Check if the necessary headers are available
-AC_CHECK_HEADERS(stdio.h stdlib.h string.h stdarg.h ctype.h)
-
-# A C99 compliant compiler should have inttypes.h for fixed-size int types
-AC_CHECK_HEADERS(inttypes.h stdint.h)
-
-#######################################################################
-# valgrind support
-AC_ARG_WITH([valgrind],
-[AS_HELP_STRING([--without-valgrind],[to disable valgrind support (such as because of version issues)])]
-[AS_HELP_STRING([--with-valgrind=PATH],[use valgrind headers installed in PATH (default is "yes", use no special path)])],
-[],[with_valgrind=yes])
-if test "$with_valgrind" != "no" ; then
- savedCPPFLAGS="$CPPFLAGS"
- if test "$with_valgrind" != "yes" ; then
- # Clients of MPL will either need to respect the localdefs file (as in
- # MPICH2) or add this entry to their own CPPFLAGS-equivalent.
- # (TODO: a pkg-config file would help with this)
- PAC_APPEND_FLAG([-I${with_valgrind}], [CPPFLAGS])
- fi
- # headers for valgrind client requests
- AC_CHECK_HEADERS([valgrind.h memcheck.h valgrind/valgrind.h valgrind/memcheck.h])
- # headers for valgrind-based thread checking tools
- # TODO: incorporate ThreadSanitizer as well (include dynamic_annotations.h,
- # link with dynamic_annotations.c)
- AC_CHECK_HEADERS([helgrind.h valgrind/helgrind.h])
- AC_CHECK_HEADERS([drd.h valgrind/drd.h])
-
- # ensure that we have a new enough valgrind with all the client macros
- # a preproc test would probably be sufficient, but the LINK_IFELSE helps us
- # double-check that we aren't accidentally grabbing the headers for some
- # other platform
- AC_CACHE_CHECK([whether the valgrind headers are broken or too old],
- [pac_cv_have_broken_valgrind],
- [AC_LINK_IFELSE(
- [AC_LANG_PROGRAM([
-#if defined(HAVE_VALGRIND_H) && defined(HAVE_MEMCHECK_H)
-# include <valgrind.h>
-# include <memcheck.h>
-#elif defined(HAVE_VALGRIND_VALGRIND_H) && defined(HAVE_VALGRIND_MEMCHECK_H)
-# include <valgrind/valgrind.h>
-# include <valgrind/memcheck.h>
-#else
-# error unexpected valgrind header error
-#endif
-int foo = 10;
-char mempool_obj;
-],[
-#if defined(VALGRIND_MAKE_MEM_DEFINED)
- VALGRIND_MAKE_MEM_NOACCESS(&foo,sizeof(foo));
- VALGRIND_MAKE_MEM_UNDEFINED(&foo,sizeof(foo));
- VALGRIND_MAKE_MEM_DEFINED(&foo,sizeof(foo));
- VALGRIND_CHECK_MEM_IS_DEFINED(&foo,sizeof(foo));
- VALGRIND_CHECK_MEM_IS_ADDRESSABLE(&foo,sizeof(foo));
-#elif defined(VALGRIND_MAKE_READABLE)
-/* older (pre-3.2.0), but still supported style */
- VALGRIND_MAKE_READABLE(&foo,sizeof(foo));
- VALGRIND_MAKE_NOACCESS(&foo,sizeof(foo));
- VALGRIND_MAKE_UNDEFINED(&foo,sizeof(foo));
- VALGRIND_CHECK_READABLE(&foo,sizeof(foo));
- VALGRIND_CHECK_WRITEABLE(&foo,sizeof(foo));
-#else
-#error missing essential valgrind client macros
-#endif
- VALGRIND_CREATE_BLOCK(&foo,sizeof(foo),"description");
- if (RUNNING_ON_VALGRIND) ++foo;
- VALGRIND_PRINTF_BACKTRACE("testing: %s","valgrind support");
- VALGRIND_CREATE_MEMPOOL(&mempool_obj,0,0);
- VALGRIND_MEMPOOL_ALLOC(&mempool_obj,&foo,sizeof(foo));
- VALGRIND_MEMPOOL_FREE(&mempool_obj,&foo);
- VALGRIND_DESTROY_MEMPOOL(&mempool_obj);
-]) dnl end PROGRAM
- ],
- [pac_cv_have_broken_valgrind=no], dnl end if-true
- [pac_cv_have_broken_valgrind=yes] dnl end if-false
- )] dnl end IFELSE
- ) dnl end CACHE_CHECK
-
- if test "$pac_cv_have_broken_valgrind" = "yes" ; then
- AC_DEFINE([HAVE_BROKEN_VALGRIND],[1],[define if valgrind is old and/or broken compared to what we are expecting])
- CPPFLAGS="$savedCPPFLAGS"
- fi
-fi
-#######################################################################
-
-
-# Check for strdup
-AC_CHECK_FUNCS(strdup)
-if test "$ac_cv_func_strdup" = "yes" ; then
- PAC_FUNC_NEEDS_DECL([#include <string.h>],strdup)
-fi
-
-# Check for snprintf
-AC_CHECK_FUNCS(snprintf)
-if test "$ac_cv_func_snprintf" = "yes" ; then
- PAC_FUNC_NEEDS_DECL([#include <stdio.h>],snprintf)
-fi
-
-# Check for strncmp
-AC_CHECK_FUNCS(strncmp)
-if test "$ac_cv_func_strncmp" = "yes" ; then
- PAC_FUNC_NEEDS_DECL([#include <string.h>],strncmp)
-fi
-
-# Check for putenv
-AC_CHECK_FUNCS(putenv)
-if test "$ac_cv_func_putenv" = "yes" ; then
- PAC_FUNC_NEEDS_DECL([#include <stdlib.h>],putenv)
-fi
-
-dnl Check for ATTRIBUTE
-PAC_C_GNU_ATTRIBUTE
-
-dnl Final output
-AC_CONFIG_FILES([Makefile localdefs])
-AC_OUTPUT
Copied: mpich2/trunk/src/pm/hydra/configure.ac (from rev 9546, mpich2/trunk/src/pm/hydra/configure.in)
===================================================================
--- mpich2/trunk/src/pm/hydra/configure.ac (rev 0)
+++ mpich2/trunk/src/pm/hydra/configure.ac 2012-02-28 23:26:34 UTC (rev 9548)
@@ -0,0 +1,687 @@
+AC_PREREQ(2.62)
+#
+# (C) 2008 by Argonne National Laboratory.
+# See COPYRIGHT in top-level directory.
+#
+
+m4_include([version.m4])
+AC_INIT([Hydra], MPICH2_VERSION_m4)
+
+AC_CONFIG_AUX_DIR(confdb)
+AC_CONFIG_MACRO_DIR(confdb)
+
+# needed by hwloc in embedded mode. Must come very early to avoid
+# bizarre expansion ordering warnings
+AC_CANONICAL_TARGET
+AC_ARG_PROGRAM
+AC_USE_SYSTEM_EXTENSIONS
+# Define -D_DARWIN_C_SOURCE on OS/X to ensure that hwloc will build even if we
+# are building under MPICH2 with --enable-strict that defined _POSIX_C_SOURCE.
+# Some standard Darwin headers don't build correctly under a strict posix
+# environment.
+AS_CASE([$host],
+ [*-*-darwin*], [PAC_APPEND_FLAG([-D_DARWIN_C_SOURCE],[CPPFLAGS])]
+)
+
+
+AM_INIT_AUTOMAKE([-Wall -Werror foreign 1.11])
+
+AC_CONFIG_HEADER(include/hydra_config.h)
+
+# Non-verbose make
+m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
+
+# Reset link flags
+PAC_RESET_LINK_FLAGS()
+
+PAC_PROG_CC
+
+PAC_ARG_STRICT
+
+AC_C_CONST
+AC_C_VOLATILE
+AC_C_RESTRICT
+AC_C_INLINE
+
+AC_CHECK_SIZEOF(unsigned long)
+
+# Bug in autoconf adds -O2 and -g by default. Make sure we only get
+# the flags we want.
+PAC_PUSH_ALL_FLAGS
+AC_TYPE_SIZE_T
+PAC_POP_ALL_FLAGS
+
+# Libtool might be required for third-party packages
+LT_INIT
+
+AM_PROG_MKDIR_P
+AC_PROG_INSTALL
+PAC_ARG_CACHING
+PAC_C_MACRO_VA_ARGS
+PAC_C_GNU_ATTRIBUTE
+PAC_CC_FUNCTION_NAME_SYMBOL
+
+# Build information
+# these values come from the m4_include above
+HYDRA_VERSION="MPICH2_VERSION_m4"
+HYDRA_RELEASE_DATE="MPICH2_RELEASE_DATE_m4"
+if test -z "$HYDRA_VERSION" ; then
+ AC_MSG_ERROR([Version information not found. Configuration aborted.])
+fi
+AC_SUBST(HYDRA_VERSION)
+AC_DEFINE_UNQUOTED(HYDRA_VERSION,"$HYDRA_VERSION",[Hydra version information])
+AC_DEFINE_UNQUOTED(HYDRA_RELEASE_DATE,"$HYDRA_RELEASE_DATE",[Hydra release date information])
+
+PAC_PUSH_ALL_FLAGS
+PAC_RESET_ALL_FLAGS
+if test "$CC" != "" ; then
+ AC_DEFINE_UNQUOTED(HYDRA_CC,"$CC $CPPFLAGS $CFLAGS $LDFLAGS $LIBS",[C compiler])
+else
+ AC_DEFINE_UNQUOTED(HYDRA_CC,"",[C compiler])
+fi
+if test "$CXX" != "" ; then
+ AC_DEFINE_UNQUOTED(HYDRA_CXX,"$CXX $CPPFLAGS $CXXFLAGS $LDFLAGS $LIBS",[C++ compiler])
+else
+ AC_DEFINE_UNQUOTED(HYDRA_CXX,"",[C++ compiler])
+fi
+if test "$F77" != "" ; then
+ AC_DEFINE_UNQUOTED(HYDRA_F77,"$F77 $FFLAGS $LDFLAGS $LIBS",[Fortran 77 compiler])
+else
+ AC_DEFINE_UNQUOTED(HYDRA_F77,"",[Fortran 77 compiler])
+fi
+if test "$FC" != "" ; then
+ AC_DEFINE_UNQUOTED(HYDRA_F90,"$FC $FCFLAGS $LDFLAGS $LIBS",[Fortran 90 compiler])
+else
+ AC_DEFINE_UNQUOTED(HYDRA_F90,"",[Fortran 90 compiler])
+fi
+PAC_POP_ALL_FLAGS
+
+AC_DEFINE_UNQUOTED(HYDRA_CONFIGURE_ARGS_CLEAN,"`echo $ac_configure_args`",[Configure arguments])
+
+# Dirty hack -- If we are compiling within MPICH2, use the MPL in the
+# src/mpl directory. If not, use the one we checked out separately for
+# Hydra.
+if test "$FROM_MPICH2" = "yes" ; then
+ mpl_srcdir="../../mpl"
+ mpl_dist_srcdir=
+else
+ mpl_srcdir="mpl"
+ mpl_dist_srcdir="mpl"
+ PAC_CONFIG_SUBDIR(mpl,,AC_ERROR(MPL configure failed))
+fi
+AC_SUBST(mpl_srcdir)
+# Controls whether we recurse into the MPL dir when running "dist" rules like
+# "make distclean". Technically we are cheating whenever DIST_SUBDIRS is not a
+# superset of SUBDIRS, but we don't want to double-distclean and similar.
+AC_SUBST(mpl_dist_srcdir)
+
+# Documentation
+AC_PATH_PROG([DOXYGEN],[doxygen],,$PATH)
+AC_SUBST(DOXYGEN)
+AC_SUBST(top_srcdir)
+
+# support gcov test coverage information
+PAC_ENABLE_COVERAGE
+
+# Check if the necessary headers are available
+AC_CHECK_HEADERS(unistd.h stdlib.h string.h strings.h stdarg.h sys/types.h sys/socket.h \
+ sched.h sys/stat.h sys/param.h netinet/in.h netinet/tcp.h \
+ sys/un.h netdb.h sys/time.h time.h ifaddrs.h arpa/inet.h \
+ errno.h poll.h fcntl.h netdb.h winsock2.h windows.h)
+
+AC_CHECK_LIB(socket,socket,LDFLAGS="$LDFLAGS -lsocket",)
+AC_CHECK_LIB(nsl,gethostbyname,LDFLAGS="$LDFLAGS -lnsl",)
+
+# Check for necessary functions
+AC_CHECK_FUNCS(gettimeofday time strdup sigaction signal usleep alloca unsetenv \
+ strerror strsignal stat getifaddrs fcntl alarm isatty inet_ntop)
+
+# Check what we need to do about the environ extern
+AC_CACHE_CHECK([for environ in unistd.h],pac_cv_environ_in_unistd,
+ [AC_TRY_COMPILE([#include <unistd.h>],[char **x = environ;],
+ pac_cv_environ_in_unistd=yes,pac_cv_environ_in_unistd=no)])
+if test "$pac_cv_environ_in_unistd" = "yes" ; then
+ # We have environ defined in unistd.h; we are done
+ AC_DEFINE(HAVE_EXTERN_ENVIRON,1,[Define if environ extern is available])
+else
+ # See if we can declare it
+ AC_CACHE_CHECK([for manually declared extern environ], pac_cv_manual_extern_environ,
+ [AC_TRY_LINK([#include <unistd.h>],[extern char ** environ; char **x = environ;],
+ pac_cv_manual_extern_environ=yes,pac_cv_manual_extern_environ=no)])
+ if test "$pac_cv_manual_extern_environ" = "yes" ; then
+ # We can manually declare the extern
+ AC_DEFINE(MANUAL_EXTERN_ENVIRON,1,[Define if environ decl needed])
+ AC_DEFINE(HAVE_EXTERN_ENVIRON,1,[Define if environ extern is available])
+ fi
+fi
+
+#########################################################################
+# Check what bootstrap server we should use
+#########################################################################
+AC_ARG_WITH(hydra-bss,
+ [AC_HELP_STRING([--with-hydra-bss=name],
+ [Bootstrap Server (user,ssh,rsh,fork,slurm,ll,lsf,sge,pbs,manual,persist)])],
+ [ hydra_bss=$withval ],
+ [ hydra_bss="user,ssh,rsh,fork,slurm,ll,lsf,sge,pbs,manual,persist" ])
+AC_MSG_CHECKING(bootstrap server)
+AC_MSG_RESULT($hydra_bss)
+hydra_bss_names="`echo $hydra_bss | sed -e 's/:/ /g' -e 's/,/ /g'`"
+
+hydra_bss_external=false
+hydra_bss_persist=false
+
+for hydra_bss_name in ${hydra_bss_names}; do
+ case "$hydra_bss_name" in
+ ssh)
+ hydra_bss_external=true
+ available_launchers="$available_launchers ssh"
+ ;;
+ rsh)
+ hydra_bss_external=true
+ available_launchers="$available_launchers rsh"
+ ;;
+ fork)
+ hydra_bss_external=true
+ available_launchers="$available_launchers fork"
+ ;;
+ slurm)
+ hydra_bss_external=true
+ available_launchers="$available_launchers slurm"
+ available_rmks="$available_rmks slurm"
+ ;;
+ ll)
+ hydra_bss_external=true
+ available_launchers="$available_launchers ll"
+ available_rmks="$available_rmks ll"
+ ;;
+ lsf)
+ hydra_bss_external=true
+ available_launchers="$available_launchers lsf"
+ available_rmks="$available_rmks lsf"
+ ;;
+ sge)
+ hydra_bss_external=true
+ available_launchers="$available_launchers sge"
+ available_rmks="$available_rmks sge"
+ ;;
+ persist)
+ hydra_bss_persist=true
+ available_launchers="$available_launchers persist"
+ ;;
+ pbs)
+ hydra_bss_external=true
+ # Check if TM library support is available
+ PAC_SET_HEADER_LIB_PATH(pbs)
+ PAC_CHECK_HEADER_LIB(pbs, tm.h, torque, tm_init, have_pbs_launcher=yes,
+ have_pbs_launcher=no)
+ if test "$have_pbs_launcher" = "yes" ; then
+ available_launchers="$available_launchers pbs"
+ fi
+ available_rmks="$available_rmks pbs"
+ ;;
+ manual)
+ hydra_bss_external=true
+ available_launchers="$available_launchers manual"
+ ;;
+ user)
+ hydra_bss_external=true
+ available_rmks="$available_rmks user"
+ ;;
+ *)
+ ;;
+ esac
+done
+
+## Bootstrap servers
+if test "$hydra_bss_external" ; then
+ AM_CONDITIONAL([hydra_bss_external], [true])
+ AC_DEFINE(HAVE_BSS_EXTERNAL,1,[Define if external bss is enabled])
+fi
+if test "$hydra_bss_persist" ; then
+ AM_CONDITIONAL([hydra_bss_persist], [true])
+ AC_DEFINE(HAVE_BSS_PERSIST,1,[Define if persist bss is enabled])
+fi
+
+## Launchers
+if test "$have_pbs_launcher" = "yes" ; then
+ AC_DEFINE(HAVE_TM_H, 1, [Define if tm.h and library are usable.])
+fi
+AM_CONDITIONAL([hydra_pbs_launcher], [test "$have_pbs_launcher" = "yes"])
+
+tmp_list=
+for hydra_launcher in ${available_launchers} ; do
+ hydra_launcher_array="${hydra_launcher_array} \"${hydra_launcher}\", "
+ if test -z "${hydra_default_launcher}" ; then
+ hydra_default_launcher=$hydra_launcher
+ AC_DEFINE_UNQUOTED(HYDRA_DEFAULT_LAUNCHER,"$hydra_default_launcher",[Default launcher])
+ tmp_list="${hydra_launcher}"
+ else
+ tmp_list="${tmp_list} ${hydra_launcher}"
+ fi
+ hydra_launcher_init_decl="${hydra_launcher_init_decl}
+HYD_status HYDT_bsci_launcher_${hydra_launcher}_init(void);"
+ hydra_launcher_init_array="${hydra_launcher_init_array} HYDT_bsci_launcher_${hydra_launcher}_init, "
+done
+available_launchers=$tmp_list
+hydra_launcher_array="${hydra_launcher_array} NULL"
+hydra_launcher_init_array="${hydra_launcher_init_array} NULL"
+AM_SUBST_NOTMAKE(hydra_launcher_init_decl)
+AC_SUBST(hydra_launcher_array)
+AC_SUBST(hydra_launcher_init_array)
+AC_SUBST(hydra_launcher_init_decl)
+AC_DEFINE_UNQUOTED(HYDRA_AVAILABLE_LAUNCHERS,"${available_launchers}",
+ [Definition of enabled launchers])
+
+## RMK
+tmp_list=
+for hydra_rmk in ${available_rmks} ; do
+ hydra_rmk_array="${hydra_rmk_array} \"${hydra_rmk}\", "
+ if test -z "${hydra_default_rmk}" ; then
+ hydra_default_rmk=$hydra_rmk
+ AC_DEFINE_UNQUOTED(HYDRA_DEFAULT_RMK,"$hydra_default_rmk",[Default RMK])
+ tmp_list="${hydra_rmk}"
+ else
+ tmp_list="${tmp_list} ${hydra_rmk}"
+ fi
+ hydra_rmk_init_decl="${hydra_rmk_init_decl}
+HYD_status HYDT_bsci_rmk_${hydra_rmk}_init(void);"
+ hydra_rmk_init_array="${hydra_rmk_init_array} HYDT_bsci_rmk_${hydra_rmk}_init, "
+done
+available_rmks=$tmp_list
+hydra_rmk_array="${hydra_rmk_array} NULL"
+hydra_rmk_init_array="${hydra_rmk_init_array} NULL"
+AM_SUBST_NOTMAKE(hydra_rmk_init_decl)
+AC_SUBST(hydra_rmk_array)
+AC_SUBST(hydra_rmk_init_array)
+AC_SUBST(hydra_rmk_init_decl)
+AC_DEFINE_UNQUOTED(HYDRA_AVAILABLE_RMKS,"${available_rmks}",[Definition of enabled RMKS])
+
+
+#########################################################################
+# Check what process manager we should use
+#########################################################################
+AC_ARG_WITH(hydra-pm, [ --with-hydra-pm=name - Process Manager (pmiserv)],
+ [ hydra_pm=$withval ],
+ [ hydra_pm=pmiserv ])
+AC_MSG_CHECKING(process manager)
+AC_MSG_RESULT($hydra_pm)
+AC_SUBST(hydra_pm)
+AM_CONDITIONAL([hydra_pm_pmiserv], [test $hydra_pm = "pmiserv"])
+
+
+#########################################################################
+# Check what UI we should use
+#########################################################################
+AC_ARG_WITH(hydra-ui, [ --with-hydra-ui=name - User Interface (mpich)],
+ [ hydra_ui=$withval ],
+ [ hydra_ui=mpich ])
+AC_MSG_CHECKING(user interface)
+AC_MSG_RESULT($hydra_ui)
+AC_SUBST(hydra_ui)
+AM_CONDITIONAL([hydra_ui_mpich], [test $hydra_ui = "mpich"])
+
+
+#########################################################################
+# System hwloc
+#########################################################################
+PAC_CHECK_PREFIX(hwloc)
+
+
+#########################################################################
+# Processor Topology
+#########################################################################
+AC_ARG_WITH(hydra-topolib, [ --with-hydra-topolib=name - Processor Topology Library (hwloc)],
+ [ hydra_topolib_list=$withval ],
+ [ hydra_topolib_list=hwloc ])
+AC_MSG_CHECKING([desired processor topology libraries])
+AC_MSG_RESULT([$hydra_topolib_list])
+
+hydra_topolibs="`echo $hydra_topolib_list | sed -e 's/:/ /g' -e 's/,/ /g'`"
+
+# Unconditionally include the hwloc macros, even if we are using an
+# external hwloc (or hwloc is disabled). This is needed for the
+# AM_CONDITIONALS that we will set later.
+m4_include([tools/topo/hwloc/hwloc/config/hwloc.m4])
+m4_include([tools/topo/hwloc/hwloc/config/hwloc_check_attributes.m4])
+m4_include([tools/topo/hwloc/hwloc/config/hwloc_check_visibility.m4])
+m4_include([tools/topo/hwloc/hwloc/config/hwloc_check_vendor.m4])
+m4_include([tools/topo/hwloc/hwloc/config/hwloc_pkg.m4])
+
+have_hwloc=no
+for hydra_topolib in ${hydra_topolibs}; do
+ case "$hydra_topolib" in
+ hwloc)
+ if test "$with_hwloc_prefix" = "embedded" ; then
+ HWLOC_SETUP_CORE([tools/topo/hwloc/hwloc],[have_hwloc=yes],[have_hwloc=no],[1])
+ # Only build hwloc in embedded mode
+ if test "$have_hwloc" = "yes" ; then
+ hydra_use_embedded_hwloc=yes
+ CFLAGS="$HWLOC_EMBEDDED_CFLAGS $CFLAGS"
+ CPPFLAGS="$HWLOC_EMBEDDED_CPPFLAGS $CPPFLAGS"
+ LIBS="$HWLOC_EMBEDDED_LIBS $LIBS"
+ fi
+ else
+ AC_CHECK_HEADERS([hwloc.h])
+ # hwloc_topology_set_pid was added in hwloc-1.0.0, which is our minimum
+ # required version
+ AC_CHECK_LIB([hwloc],[hwloc_topology_set_pid])
+ AC_MSG_CHECKING([if non-embedded hwloc works])
+ if test "$ac_cv_header_hwloc_h" = "yes" -a "$ac_cv_lib_hwloc_hwloc_topology_set_pid" = "yes" ; then
+ have_hwloc=yes
+ fi
+ AC_MSG_RESULT([$have_hwloc])
+ fi
+
+ # FIXME: Disable hwloc on Cygwin for now. The hwloc package, atleast as of 1.0.2,
+ # does not install correctly on Cygwin
+ AS_CASE([$host], [*-*-cygwin], [have_hwloc=no])
+
+ if test "$have_hwloc" = "yes" ; then
+ AC_DEFINE(HAVE_HWLOC,1,[Define if hwloc is available])
+ available_topolibs="$available_topolibs hwloc"
+ fi
+ ;;
+ *)
+ ;;
+ esac
+done
+
+tmp_list=
+for hydra_topolib in ${available_topolibs}; do
+ if test -z "$hydra_default_topolib" ; then
+ hydra_default_topolib=${hydra_topolib}
+ tmp_list="${hydra_topolib}"
+ else
+ tmp_list="$tmp_list ${hydra_topolib}"
+ fi
+done
+available_topolibs=$tmp_list
+
+AC_DEFINE_UNQUOTED(HYDRA_AVAILABLE_TOPOLIBS,"$available_topolibs",
+ [Definition of enabled processor topology libraries])
+if test "$hydra_default_topolib" != "" ; then
+ AC_DEFINE_UNQUOTED(HYDRA_DEFAULT_TOPOLIB,"$hydra_default_topolib",
+ [Default processor topology library])
+else
+ AC_DEFINE(HYDRA_DEFAULT_TOPOLIB,NULL,[Default processor topology library])
+fi
+
+HWLOC_DO_AM_CONDITIONALS
+AM_CONDITIONAL([hydra_have_hwloc], [test "${have_hwloc}" = "yes"])
+AM_CONDITIONAL([hydra_use_embedded_hwloc], [test "${hydra_use_embedded_hwloc}" = "yes"])
+
+AC_MSG_CHECKING([available processor topology libraries])
+AC_MSG_RESULT([$available_topolibs])
+
+
+#########################################################################
+# Checkpoint/Restart
+#########################################################################
+
+# checkpoint requires pthreads
+AC_CHECK_HEADERS(pthread.h)
+AC_CHECK_LIB([pthread],[pthread_key_create],have_pthreads=yes)
+if test "$have_pthreads" = "yes" ; then
+ PAC_PREPEND_FLAG([-lpthread],[LIBS])
+ AC_DEFINE(HAVE_PTHREADS,1,[Define if pthreads is available])
+fi
+
+AC_ARG_WITH(hydra-ckpointlib, [ --with-hydra-ckpointlib=name - Checkpointing Library (blcr)],
+ [ hydra_ckpointlib_list=$withval ],
+ [ hydra_ckpointlib_list=blcr ])
+AC_MSG_CHECKING(checkpointing library)
+
+if test "$have_pthreads" != "yes" -a "$hydra_ckpointlib_list" != "none" ; then
+ AC_MSG_ERROR([pthreads is required for checkpointing, but was not found])
+else
+ AC_MSG_RESULT($hydra_ckpointlib_list)
+fi
+
+hydra_ckpointlibs="`echo $hydra_ckpointlib_list | sed -e 's/:/ /g' -e 's/,/ /g'`"
+
+have_blcr=no
+for hydra_ckpointlib in ${hydra_ckpointlibs}; do
+ case "$hydra_ckpointlib" in
+ blcr)
+ PAC_SET_HEADER_LIB_PATH(blcr)
+ PAC_CHECK_HEADER_LIB(blcr, libcr.h, cr, cr_init, have_blcr=yes, have_blcr=no)
+ # BLCR works
+ if test "$have_blcr" = "yes" ; then
+ AC_DEFINE(HAVE_BLCR,1,[Define if blcr is available])
+ available_ckpointlibs="$available_ckpointlibs blcr"
+ fi
+ ;;
+ *)
+ ;;
+ esac
+done
+
+tmp_list=
+for hydra_ckpointlib in ${available_ckpointlibs}; do
+ if test -z "$hydra_default_ckpointlib" ; then
+ hydra_default_ckpointlib=${hydra_ckpointlib}
+ tmp_list="${hydra_ckpointlib}"
+ else
+ tmp_list="$tmp_list ${hydra_ckpointlib}"
+ fi
+done
+available_ckpointlibs=$tmp_list
+
+AC_DEFINE_UNQUOTED(HYDRA_AVAILABLE_CKPOINTLIBS,"$available_ckpointlibs",
+ [Definition of enabled checkpointing libraries])
+if test "$hydra_default_ckpointlib" != "" ; then
+ AC_DEFINE_UNQUOTED(HYDRA_DEFAULT_CKPOINTLIB,"$hydra_default_ckpointlib",
+ [Default checkpointing library])
+else
+ AC_DEFINE(HYDRA_DEFAULT_CKPOINTLIB,NULL,[Default checkpointing library])
+fi
+AM_CONDITIONAL([hydra_have_blcr], [test "${have_blcr}" = "yes"])
+
+
+#########################################################################
+# Demux engine
+#########################################################################
+AC_ARG_WITH(hydra-demux, [ --with-hydra-demux=name - Demux engine (poll, select, port)],
+ [ hydra_demux_list=$withval ],
+ [ hydra_demux_list=poll,select,port ])
+AC_MSG_CHECKING(demux engine)
+AC_MSG_RESULT($hydra_demux_list)
+
+hydra_demuxes="`echo $hydra_demux_list | sed -e 's/:/ /g' -e 's/,/ /g'`"
+
+have_poll=no
+have_select=no
+have_port=no
+for hydra_demux in ${hydra_demuxes}; do
+ case "$hydra_demux" in
+ poll)
+ AC_CHECK_FUNCS(poll,[have_poll=yes],[have_poll=no])
+ if test "$have_poll" = "yes" ; then
+ available_demuxes="$available_demuxes poll"
+ fi
+ ;;
+ select)
+ AC_CHECK_FUNCS(select,[have_select=yes],[have_select=no])
+ if test "$have_select" = "yes" ; then
+ available_demuxes="$available_demuxes select"
+ fi
+ ;;
+ port)
+ # FIXME: Need to add a test for completion ports
+ if test "$have_port" = "yes" ; then
+ available_demuxes="$available_demuxes port"
+ fi
+ ;;
+ *)
+ ;;
+ esac
+done
+
+tmp_list=
+for hydra_demux in ${available_demuxes}; do
+ if test -z "$hydra_default_demux" ; then
+ hydra_default_demux=${hydra_demux}
+ tmp_list="${hydra_demux}"
+ else
+ tmp_list="$tmp_list ${hydra_demux}"
+ fi
+done
+available_demuxes=$tmp_list
+
+AM_CONDITIONAL([hydra_have_poll], [test "${have_poll}" = "yes"])
+AM_CONDITIONAL([hydra_have_select], [test "${have_select}" = "yes"])
+AM_CONDITIONAL([hydra_have_port], [test "${have_port}" = "yes"])
+AC_DEFINE_UNQUOTED(HYDRA_AVAILABLE_DEMUXES,"$available_demuxes",
+ [Definition of enabled demux engines])
+if test "$hydra_default_demux" != "" ; then
+ AC_DEFINE_UNQUOTED(HYDRA_DEFAULT_DEMUX,"$hydra_default_demux",[Default demux engine])
+else
+ AC_DEFINE(HYDRA_DEFAULT_DEMUX,NULL,[Default demux engine])
+fi
+
+
+#########################################################################
+# Debugging support
+#########################################################################
+AC_ARG_ENABLE(g,
+ [--enable-g=option - Control the level of debugging support. option is a list of comma
+ separated names including
+ none - No debugging
+ dbg - Add compiler flag -g
+ mem - Memory usage tracing
+ all - All of the above choices],,enable_g=none)
+AC_MSG_CHECKING(debugging support)
+AC_MSG_RESULT($enable_g)
+for option in $enable_g ; do
+ case $option in
+ dbg|debug)
+ PAC_APPEND_FLAG(-g, CFLAGS)
+ ;;
+ mem)
+ AC_DEFINE(USE_MEMORY_TRACING,1,[Define if memory tracing is enabled])
+ ;;
+ all)
+ PAC_APPEND_FLAG(-g, CFLAGS)
+ AC_DEFINE(USE_MEMORY_TRACING,1,[Define if memory tracing is enabled])
+ ;;
+ *)
+ ;;
+ esac
+done
+
+
+#########################################################################
+# Error checking
+#########################################################################
+AC_ARG_ENABLE(error-checking, [ --enable-error-checking - Enable error checking],
+ [ error_check=$enableval ],
+ [ error_check=yes ])
+AC_MSG_CHECKING(error checking)
+AC_MSG_RESULT($error_check)
+if test "$error_check" = "yes"; then
+ CFLAGS="$CFLAGS -g"
+ AC_DEFINE(HAVE_ERROR_CHECKING,1,[Define if error checking is enabled])
+fi
+
+
+#########################################################################
+# Warning messages
+#########################################################################
+AC_ARG_ENABLE(warnings, [ --enable-warnings Enable warnings],
+ [ WARNINGS=$enableval ],
+ [ WARNINGS=no ])
+AC_MSG_CHECKING(warnings)
+AC_MSG_RESULT($WARNINGS)
+if test "$WARNINGS" = "yes"; then
+ AC_DEFINE(ENABLE_WARNINGS,1,[Define if warnings are enabled])
+fi
+
+
+#########################################################################
+# Profiling
+#########################################################################
+AC_ARG_ENABLE(profiling, [ --enable-profiling - Enable profiling],
+ [ enable_profiling=$enableval ], [ enable_profiling=yes ])
+AC_MSG_CHECKING(profiling)
+AC_MSG_RESULT($enable_profiling)
+if test "$enable_profiling" = "yes"; then
+ AC_DEFINE(ENABLE_PROFILING,1,[Define if profiling enabled])
+fi
+
+
+#########################################################################
+# FTB integration
+#########################################################################
+# FTB requires pthreads support; add pthreads to LIBS before trying to
+# find FTB
+PAC_PUSH_FLAG([LIBS])
+PAC_PREPEND_FLAG([-lpthread],[LIBS])
+PAC_SET_HEADER_LIB_PATH(ftb)
+PAC_POP_FLAG([LIBS])
+PAC_CHECK_HEADER_LIB(ftb, libftb.h, ftb, FTB_Connect, have_ftb=yes, have_ftb=no)
+if test "$have_ftb" = "yes" ; then
+ # FIXME: We need to test to make sure FTB works correctly
+ PAC_APPEND_FLAG([-lpthread],[LIBS])
+ AC_DEFINE(ENABLE_FTB,1,[Define if FTB is enabled])
+fi
+AM_CONDITIONAL([hydra_have_ftb], [test "${have_ftb}" = "yes"])
+
+
+#########################################################################
+# Signals and friends
+#########################################################################
+AC_CHECK_FUNCS(strsignal)
+if test "$ac_cv_func_strsignal" = "yes" ; then
+ PAC_FUNC_NEEDS_DECL([#include <string.h>],strsignal)
+fi
+
+AC_CHECK_FUNCS(sigaction signal sigset)
+sigaction_ok=no
+if test "$ac_cv_func_sigaction" = "yes" ; then
+ # Make sure that the fields that we need in sigaction are defined
+ AC_CACHE_CHECK([for struct sigaction and sa_handler],
+ pac_cv_struct_sigaction_with_sa_handler,[
+ AC_TRY_COMPILE([#include <signal.h>],[
+struct sigaction act; sigaddset( &act.sa_mask, SIGINT );
+act.sa_handler = SIG_IGN;],
+ pac_cv_struct_sigaction_with_sa_handler=yes,
+ pac_cv_struct_sigaction_with_sa_handler=no)])
+ if test "$pac_cv_struct_sigaction_with_sa_handler" = "no" ; then
+ AC_CACHE_CHECK([for struct sigaction and sa_handler with _POSIX_SOURCE],
+ pac_cv_struct_sigaction_with_sa_handler_needs_posix,[
+ AC_TRY_COMPILE([#define _POSIX_SOURCE
+#include <signal.h>],[
+struct sigaction act; sigaddset( &act.sa_mask, SIGINT );
+act.sa_handler = SIG_IGN;],
+ pac_cv_struct_sigaction_with_sa_handler_needs_posix=yes,
+ pac_cv_struct_sigaction_with_sa_handler_needs_posix=no)])
+ if test "$pac_cv_struct_sigaction_with_sa_handler_needs_posix" = "yes" ; then
+ sigaction_ok=yes
+ fi
+ else
+ sigaction_ok=yes
+ fi
+fi
+
+# Decide on the signal handler to use
+if test "$ac_cv_func_sigaction" = "yes" -a "$sigaction_ok" = "yes" ; then
+ if test "$pac_cv_struct_sigaction_with_sa_handler_needs_posix" = yes ; then
+ AC_DEFINE(NEEDS_POSIX_FOR_SIGACTION,1,[Define if _POSIX_SOURCE needed to get sigaction])
+ fi
+ AC_DEFINE(USE_SIGACTION,,[Define if sigaction should be used to set signals])
+elif test "$ac_cv_func_signal" = "yes" ; then
+ AC_DEFINE(USE_SIGNAL,,[Define if signal should be used to set signals])
+fi
+
+# gethostname() returns host name
+AC_CHECK_FUNCS(gethostname)
+if test "$ac_cv_func_gethostname" = "yes" ; then
+ # Do we need to declare gethostname?
+ PAC_FUNC_NEEDS_DECL([#include <unistd.h>],gethostname)
+fi
+
+# Final output
+AC_OUTPUT(Makefile
+ tools/bootstrap/src/bsci_init.c
+ hydra-doxygen.cfg
+)
Deleted: mpich2/trunk/src/pm/hydra/configure.in
===================================================================
--- mpich2/trunk/src/pm/hydra/configure.in 2012-02-28 23:25:23 UTC (rev 9547)
+++ mpich2/trunk/src/pm/hydra/configure.in 2012-02-28 23:26:34 UTC (rev 9548)
@@ -1,687 +0,0 @@
-AC_PREREQ(2.62)
-#
-# (C) 2008 by Argonne National Laboratory.
-# See COPYRIGHT in top-level directory.
-#
-
-m4_include([version.m4])
-AC_INIT([Hydra], MPICH2_VERSION_m4)
-
-AC_CONFIG_AUX_DIR(confdb)
-AC_CONFIG_MACRO_DIR(confdb)
-
-# needed by hwloc in embedded mode. Must come very early to avoid
-# bizarre expansion ordering warnings
-AC_CANONICAL_TARGET
-AC_ARG_PROGRAM
-AC_USE_SYSTEM_EXTENSIONS
-# Define -D_DARWIN_C_SOURCE on OS/X to ensure that hwloc will build even if we
-# are building under MPICH2 with --enable-strict that defined _POSIX_C_SOURCE.
-# Some standard Darwin headers don't build correctly under a strict posix
-# environment.
-AS_CASE([$host],
- [*-*-darwin*], [PAC_APPEND_FLAG([-D_DARWIN_C_SOURCE],[CPPFLAGS])]
-)
-
-
-AM_INIT_AUTOMAKE([-Wall -Werror foreign 1.11])
-
-AC_CONFIG_HEADER(include/hydra_config.h)
-
-# Non-verbose make
-m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
-
-# Reset link flags
-PAC_RESET_LINK_FLAGS()
-
-PAC_PROG_CC
-
-PAC_ARG_STRICT
-
-AC_C_CONST
-AC_C_VOLATILE
-AC_C_RESTRICT
-AC_C_INLINE
-
-AC_CHECK_SIZEOF(unsigned long)
-
-# Bug in autoconf adds -O2 and -g by default. Make sure we only get
-# the flags we want.
-PAC_PUSH_ALL_FLAGS
-AC_TYPE_SIZE_T
-PAC_POP_ALL_FLAGS
-
-# Libtool might be required for third-party packages
-LT_INIT
-
-AM_PROG_MKDIR_P
-AC_PROG_INSTALL
-PAC_ARG_CACHING
-PAC_C_MACRO_VA_ARGS
-PAC_C_GNU_ATTRIBUTE
-PAC_CC_FUNCTION_NAME_SYMBOL
-
-# Build information
-# these values come from the m4_include above
-HYDRA_VERSION="MPICH2_VERSION_m4"
-HYDRA_RELEASE_DATE="MPICH2_RELEASE_DATE_m4"
-if test -z "$HYDRA_VERSION" ; then
- AC_MSG_ERROR([Version information not found. Configuration aborted.])
-fi
-AC_SUBST(HYDRA_VERSION)
-AC_DEFINE_UNQUOTED(HYDRA_VERSION,"$HYDRA_VERSION",[Hydra version information])
-AC_DEFINE_UNQUOTED(HYDRA_RELEASE_DATE,"$HYDRA_RELEASE_DATE",[Hydra release date information])
-
-PAC_PUSH_ALL_FLAGS
-PAC_RESET_ALL_FLAGS
-if test "$CC" != "" ; then
- AC_DEFINE_UNQUOTED(HYDRA_CC,"$CC $CPPFLAGS $CFLAGS $LDFLAGS $LIBS",[C compiler])
-else
- AC_DEFINE_UNQUOTED(HYDRA_CC,"",[C compiler])
-fi
-if test "$CXX" != "" ; then
- AC_DEFINE_UNQUOTED(HYDRA_CXX,"$CXX $CPPFLAGS $CXXFLAGS $LDFLAGS $LIBS",[C++ compiler])
-else
- AC_DEFINE_UNQUOTED(HYDRA_CXX,"",[C++ compiler])
-fi
-if test "$F77" != "" ; then
- AC_DEFINE_UNQUOTED(HYDRA_F77,"$F77 $FFLAGS $LDFLAGS $LIBS",[Fortran 77 compiler])
-else
- AC_DEFINE_UNQUOTED(HYDRA_F77,"",[Fortran 77 compiler])
-fi
-if test "$FC" != "" ; then
- AC_DEFINE_UNQUOTED(HYDRA_F90,"$FC $FCFLAGS $LDFLAGS $LIBS",[Fortran 90 compiler])
-else
- AC_DEFINE_UNQUOTED(HYDRA_F90,"",[Fortran 90 compiler])
-fi
-PAC_POP_ALL_FLAGS
-
-AC_DEFINE_UNQUOTED(HYDRA_CONFIGURE_ARGS_CLEAN,"`echo $ac_configure_args`",[Configure arguments])
-
-# Dirty hack -- If we are compiling within MPICH2, use the MPL in the
-# src/mpl directory. If not, use the one we checked out separately for
-# Hydra.
-if test "$FROM_MPICH2" = "yes" ; then
- mpl_srcdir="../../mpl"
- mpl_dist_srcdir=
-else
- mpl_srcdir="mpl"
- mpl_dist_srcdir="mpl"
- PAC_CONFIG_SUBDIR(mpl,,AC_ERROR(MPL configure failed))
-fi
-AC_SUBST(mpl_srcdir)
-# Controls whether we recurse into the MPL dir when running "dist" rules like
-# "make distclean". Technically we are cheating whenever DIST_SUBDIRS is not a
-# superset of SUBDIRS, but we don't want to double-distclean and similar.
-AC_SUBST(mpl_dist_srcdir)
-
-# Documentation
-AC_PATH_PROG([DOXYGEN],[doxygen],,$PATH)
-AC_SUBST(DOXYGEN)
-AC_SUBST(top_srcdir)
-
-# support gcov test coverage information
-PAC_ENABLE_COVERAGE
-
-# Check if the necessary headers are available
-AC_CHECK_HEADERS(unistd.h stdlib.h string.h strings.h stdarg.h sys/types.h sys/socket.h \
- sched.h sys/stat.h sys/param.h netinet/in.h netinet/tcp.h \
- sys/un.h netdb.h sys/time.h time.h ifaddrs.h arpa/inet.h \
- errno.h poll.h fcntl.h netdb.h winsock2.h windows.h)
-
-AC_CHECK_LIB(socket,socket,LDFLAGS="$LDFLAGS -lsocket",)
-AC_CHECK_LIB(nsl,gethostbyname,LDFLAGS="$LDFLAGS -lnsl",)
-
-# Check for necessary functions
-AC_CHECK_FUNCS(gettimeofday time strdup sigaction signal usleep alloca unsetenv \
- strerror strsignal stat getifaddrs fcntl alarm isatty inet_ntop)
-
-# Check what we need to do about the environ extern
-AC_CACHE_CHECK([for environ in unistd.h],pac_cv_environ_in_unistd,
- [AC_TRY_COMPILE([#include <unistd.h>],[char **x = environ;],
- pac_cv_environ_in_unistd=yes,pac_cv_environ_in_unistd=no)])
-if test "$pac_cv_environ_in_unistd" = "yes" ; then
- # We have environ defined in unistd.h; we are done
- AC_DEFINE(HAVE_EXTERN_ENVIRON,1,[Define if environ extern is available])
-else
- # See if we can declare it
- AC_CACHE_CHECK([for manually declared extern environ], pac_cv_manual_extern_environ,
- [AC_TRY_LINK([#include <unistd.h>],[extern char ** environ; char **x = environ;],
- pac_cv_manual_extern_environ=yes,pac_cv_manual_extern_environ=no)])
- if test "$pac_cv_manual_extern_environ" = "yes" ; then
- # We can manually declare the extern
- AC_DEFINE(MANUAL_EXTERN_ENVIRON,1,[Define if environ decl needed])
- AC_DEFINE(HAVE_EXTERN_ENVIRON,1,[Define if environ extern is available])
- fi
-fi
-
-#########################################################################
-# Check what bootstrap server we should use
-#########################################################################
-AC_ARG_WITH(hydra-bss,
- [AC_HELP_STRING([--with-hydra-bss=name],
- [Bootstrap Server (user,ssh,rsh,fork,slurm,ll,lsf,sge,pbs,manual,persist)])],
- [ hydra_bss=$withval ],
- [ hydra_bss="user,ssh,rsh,fork,slurm,ll,lsf,sge,pbs,manual,persist" ])
-AC_MSG_CHECKING(bootstrap server)
-AC_MSG_RESULT($hydra_bss)
-hydra_bss_names="`echo $hydra_bss | sed -e 's/:/ /g' -e 's/,/ /g'`"
-
-hydra_bss_external=false
-hydra_bss_persist=false
-
-for hydra_bss_name in ${hydra_bss_names}; do
- case "$hydra_bss_name" in
- ssh)
- hydra_bss_external=true
- available_launchers="$available_launchers ssh"
- ;;
- rsh)
- hydra_bss_external=true
- available_launchers="$available_launchers rsh"
- ;;
- fork)
- hydra_bss_external=true
- available_launchers="$available_launchers fork"
- ;;
- slurm)
- hydra_bss_external=true
- available_launchers="$available_launchers slurm"
- available_rmks="$available_rmks slurm"
- ;;
- ll)
- hydra_bss_external=true
- available_launchers="$available_launchers ll"
- available_rmks="$available_rmks ll"
- ;;
- lsf)
- hydra_bss_external=true
- available_launchers="$available_launchers lsf"
- available_rmks="$available_rmks lsf"
- ;;
- sge)
- hydra_bss_external=true
- available_launchers="$available_launchers sge"
- available_rmks="$available_rmks sge"
- ;;
- persist)
- hydra_bss_persist=true
- available_launchers="$available_launchers persist"
- ;;
- pbs)
- hydra_bss_external=true
- # Check if TM library support is available
- PAC_SET_HEADER_LIB_PATH(pbs)
- PAC_CHECK_HEADER_LIB(pbs, tm.h, torque, tm_init, have_pbs_launcher=yes,
- have_pbs_launcher=no)
- if test "$have_pbs_launcher" = "yes" ; then
- available_launchers="$available_launchers pbs"
- fi
- available_rmks="$available_rmks pbs"
- ;;
- manual)
- hydra_bss_external=true
- available_launchers="$available_launchers manual"
- ;;
- user)
- hydra_bss_external=true
- available_rmks="$available_rmks user"
- ;;
- *)
- ;;
- esac
-done
-
-## Bootstrap servers
-if test "$hydra_bss_external" ; then
- AM_CONDITIONAL([hydra_bss_external], [true])
- AC_DEFINE(HAVE_BSS_EXTERNAL,1,[Define if external bss is enabled])
-fi
-if test "$hydra_bss_persist" ; then
- AM_CONDITIONAL([hydra_bss_persist], [true])
- AC_DEFINE(HAVE_BSS_PERSIST,1,[Define if persist bss is enabled])
-fi
-
-## Launchers
-if test "$have_pbs_launcher" = "yes" ; then
- AC_DEFINE(HAVE_TM_H, 1, [Define if tm.h and library are usable.])
-fi
-AM_CONDITIONAL([hydra_pbs_launcher], [test "$have_pbs_launcher" = "yes"])
-
-tmp_list=
-for hydra_launcher in ${available_launchers} ; do
- hydra_launcher_array="${hydra_launcher_array} \"${hydra_launcher}\", "
- if test -z "${hydra_default_launcher}" ; then
- hydra_default_launcher=$hydra_launcher
- AC_DEFINE_UNQUOTED(HYDRA_DEFAULT_LAUNCHER,"$hydra_default_launcher",[Default launcher])
- tmp_list="${hydra_launcher}"
- else
- tmp_list="${tmp_list} ${hydra_launcher}"
- fi
- hydra_launcher_init_decl="${hydra_launcher_init_decl}
-HYD_status HYDT_bsci_launcher_${hydra_launcher}_init(void);"
- hydra_launcher_init_array="${hydra_launcher_init_array} HYDT_bsci_launcher_${hydra_launcher}_init, "
-done
-available_launchers=$tmp_list
-hydra_launcher_array="${hydra_launcher_array} NULL"
-hydra_launcher_init_array="${hydra_launcher_init_array} NULL"
-AM_SUBST_NOTMAKE(hydra_launcher_init_decl)
-AC_SUBST(hydra_launcher_array)
-AC_SUBST(hydra_launcher_init_array)
-AC_SUBST(hydra_launcher_init_decl)
-AC_DEFINE_UNQUOTED(HYDRA_AVAILABLE_LAUNCHERS,"${available_launchers}",
- [Definition of enabled launchers])
-
-## RMK
-tmp_list=
-for hydra_rmk in ${available_rmks} ; do
- hydra_rmk_array="${hydra_rmk_array} \"${hydra_rmk}\", "
- if test -z "${hydra_default_rmk}" ; then
- hydra_default_rmk=$hydra_rmk
- AC_DEFINE_UNQUOTED(HYDRA_DEFAULT_RMK,"$hydra_default_rmk",[Default RMK])
- tmp_list="${hydra_rmk}"
- else
- tmp_list="${tmp_list} ${hydra_rmk}"
- fi
- hydra_rmk_init_decl="${hydra_rmk_init_decl}
-HYD_status HYDT_bsci_rmk_${hydra_rmk}_init(void);"
- hydra_rmk_init_array="${hydra_rmk_init_array} HYDT_bsci_rmk_${hydra_rmk}_init, "
-done
-available_rmks=$tmp_list
-hydra_rmk_array="${hydra_rmk_array} NULL"
-hydra_rmk_init_array="${hydra_rmk_init_array} NULL"
-AM_SUBST_NOTMAKE(hydra_rmk_init_decl)
-AC_SUBST(hydra_rmk_array)
-AC_SUBST(hydra_rmk_init_array)
-AC_SUBST(hydra_rmk_init_decl)
-AC_DEFINE_UNQUOTED(HYDRA_AVAILABLE_RMKS,"${available_rmks}",[Definition of enabled RMKS])
-
-
-#########################################################################
-# Check what process manager we should use
-#########################################################################
-AC_ARG_WITH(hydra-pm, [ --with-hydra-pm=name - Process Manager (pmiserv)],
- [ hydra_pm=$withval ],
- [ hydra_pm=pmiserv ])
-AC_MSG_CHECKING(process manager)
-AC_MSG_RESULT($hydra_pm)
-AC_SUBST(hydra_pm)
-AM_CONDITIONAL([hydra_pm_pmiserv], [test $hydra_pm = "pmiserv"])
-
-
-#########################################################################
-# Check what UI we should use
-#########################################################################
-AC_ARG_WITH(hydra-ui, [ --with-hydra-ui=name - User Interface (mpich)],
- [ hydra_ui=$withval ],
- [ hydra_ui=mpich ])
-AC_MSG_CHECKING(user interface)
-AC_MSG_RESULT($hydra_ui)
-AC_SUBST(hydra_ui)
-AM_CONDITIONAL([hydra_ui_mpich], [test $hydra_ui = "mpich"])
-
-
-#########################################################################
-# System hwloc
-#########################################################################
-PAC_CHECK_PREFIX(hwloc)
-
-
-#########################################################################
-# Processor Topology
-#########################################################################
-AC_ARG_WITH(hydra-topolib, [ --with-hydra-topolib=name - Processor Topology Library (hwloc)],
- [ hydra_topolib_list=$withval ],
- [ hydra_topolib_list=hwloc ])
-AC_MSG_CHECKING([desired processor topology libraries])
-AC_MSG_RESULT([$hydra_topolib_list])
-
-hydra_topolibs="`echo $hydra_topolib_list | sed -e 's/:/ /g' -e 's/,/ /g'`"
-
-# Unconditionally include the hwloc macros, even if we are using an
-# external hwloc (or hwloc is disabled). This is needed for the
-# AM_CONDITIONALS that we will set later.
-m4_include([tools/topo/hwloc/hwloc/config/hwloc.m4])
-m4_include([tools/topo/hwloc/hwloc/config/hwloc_check_attributes.m4])
-m4_include([tools/topo/hwloc/hwloc/config/hwloc_check_visibility.m4])
-m4_include([tools/topo/hwloc/hwloc/config/hwloc_check_vendor.m4])
-m4_include([tools/topo/hwloc/hwloc/config/hwloc_pkg.m4])
-
-have_hwloc=no
-for hydra_topolib in ${hydra_topolibs}; do
- case "$hydra_topolib" in
- hwloc)
- if test "$with_hwloc_prefix" = "embedded" ; then
- HWLOC_SETUP_CORE([tools/topo/hwloc/hwloc],[have_hwloc=yes],[have_hwloc=no],[1])
- # Only build hwloc in embedded mode
- if test "$have_hwloc" = "yes" ; then
- hydra_use_embedded_hwloc=yes
- CFLAGS="$HWLOC_EMBEDDED_CFLAGS $CFLAGS"
- CPPFLAGS="$HWLOC_EMBEDDED_CPPFLAGS $CPPFLAGS"
- LIBS="$HWLOC_EMBEDDED_LIBS $LIBS"
- fi
- else
- AC_CHECK_HEADERS([hwloc.h])
- # hwloc_topology_set_pid was added in hwloc-1.0.0, which is our minimum
- # required version
- AC_CHECK_LIB([hwloc],[hwloc_topology_set_pid])
- AC_MSG_CHECKING([if non-embedded hwloc works])
- if test "$ac_cv_header_hwloc_h" = "yes" -a "$ac_cv_lib_hwloc_hwloc_topology_set_pid" = "yes" ; then
- have_hwloc=yes
- fi
- AC_MSG_RESULT([$have_hwloc])
- fi
-
- # FIXME: Disable hwloc on Cygwin for now. The hwloc package, atleast as of 1.0.2,
- # does not install correctly on Cygwin
- AS_CASE([$host], [*-*-cygwin], [have_hwloc=no])
-
- if test "$have_hwloc" = "yes" ; then
- AC_DEFINE(HAVE_HWLOC,1,[Define if hwloc is available])
- available_topolibs="$available_topolibs hwloc"
- fi
- ;;
- *)
- ;;
- esac
-done
-
-tmp_list=
-for hydra_topolib in ${available_topolibs}; do
- if test -z "$hydra_default_topolib" ; then
- hydra_default_topolib=${hydra_topolib}
- tmp_list="${hydra_topolib}"
- else
- tmp_list="$tmp_list ${hydra_topolib}"
- fi
-done
-available_topolibs=$tmp_list
-
-AC_DEFINE_UNQUOTED(HYDRA_AVAILABLE_TOPOLIBS,"$available_topolibs",
- [Definition of enabled processor topology libraries])
-if test "$hydra_default_topolib" != "" ; then
- AC_DEFINE_UNQUOTED(HYDRA_DEFAULT_TOPOLIB,"$hydra_default_topolib",
- [Default processor topology library])
-else
- AC_DEFINE(HYDRA_DEFAULT_TOPOLIB,NULL,[Default processor topology library])
-fi
-
-HWLOC_DO_AM_CONDITIONALS
-AM_CONDITIONAL([hydra_have_hwloc], [test "${have_hwloc}" = "yes"])
-AM_CONDITIONAL([hydra_use_embedded_hwloc], [test "${hydra_use_embedded_hwloc}" = "yes"])
-
-AC_MSG_CHECKING([available processor topology libraries])
-AC_MSG_RESULT([$available_topolibs])
-
-
-#########################################################################
-# Checkpoint/Restart
-#########################################################################
-
-# checkpoint requires pthreads
-AC_CHECK_HEADERS(pthread.h)
-AC_CHECK_LIB([pthread],[pthread_key_create],have_pthreads=yes)
-if test "$have_pthreads" = "yes" ; then
- PAC_PREPEND_FLAG([-lpthread],[LIBS])
- AC_DEFINE(HAVE_PTHREADS,1,[Define if pthreads is available])
-fi
-
-AC_ARG_WITH(hydra-ckpointlib, [ --with-hydra-ckpointlib=name - Checkpointing Library (blcr)],
- [ hydra_ckpointlib_list=$withval ],
- [ hydra_ckpointlib_list=blcr ])
-AC_MSG_CHECKING(checkpointing library)
-
-if test "$have_pthreads" != "yes" -a "$hydra_ckpointlib_list" != "none" ; then
- AC_MSG_ERROR([pthreads is required for checkpointing, but was not found])
-else
- AC_MSG_RESULT($hydra_ckpointlib_list)
-fi
-
-hydra_ckpointlibs="`echo $hydra_ckpointlib_list | sed -e 's/:/ /g' -e 's/,/ /g'`"
-
-have_blcr=no
-for hydra_ckpointlib in ${hydra_ckpointlibs}; do
- case "$hydra_ckpointlib" in
- blcr)
- PAC_SET_HEADER_LIB_PATH(blcr)
- PAC_CHECK_HEADER_LIB(blcr, libcr.h, cr, cr_init, have_blcr=yes, have_blcr=no)
- # BLCR works
- if test "$have_blcr" = "yes" ; then
- AC_DEFINE(HAVE_BLCR,1,[Define if blcr is available])
- available_ckpointlibs="$available_ckpointlibs blcr"
- fi
- ;;
- *)
- ;;
- esac
-done
-
-tmp_list=
-for hydra_ckpointlib in ${available_ckpointlibs}; do
- if test -z "$hydra_default_ckpointlib" ; then
- hydra_default_ckpointlib=${hydra_ckpointlib}
- tmp_list="${hydra_ckpointlib}"
- else
- tmp_list="$tmp_list ${hydra_ckpointlib}"
- fi
-done
-available_ckpointlibs=$tmp_list
-
-AC_DEFINE_UNQUOTED(HYDRA_AVAILABLE_CKPOINTLIBS,"$available_ckpointlibs",
- [Definition of enabled checkpointing libraries])
-if test "$hydra_default_ckpointlib" != "" ; then
- AC_DEFINE_UNQUOTED(HYDRA_DEFAULT_CKPOINTLIB,"$hydra_default_ckpointlib",
- [Default checkpointing library])
-else
- AC_DEFINE(HYDRA_DEFAULT_CKPOINTLIB,NULL,[Default checkpointing library])
-fi
-AM_CONDITIONAL([hydra_have_blcr], [test "${have_blcr}" = "yes"])
-
-
-#########################################################################
-# Demux engine
-#########################################################################
-AC_ARG_WITH(hydra-demux, [ --with-hydra-demux=name - Demux engine (poll, select, port)],
- [ hydra_demux_list=$withval ],
- [ hydra_demux_list=poll,select,port ])
-AC_MSG_CHECKING(demux engine)
-AC_MSG_RESULT($hydra_demux_list)
-
-hydra_demuxes="`echo $hydra_demux_list | sed -e 's/:/ /g' -e 's/,/ /g'`"
-
-have_poll=no
-have_select=no
-have_port=no
-for hydra_demux in ${hydra_demuxes}; do
- case "$hydra_demux" in
- poll)
- AC_CHECK_FUNCS(poll,[have_poll=yes],[have_poll=no])
- if test "$have_poll" = "yes" ; then
- available_demuxes="$available_demuxes poll"
- fi
- ;;
- select)
- AC_CHECK_FUNCS(select,[have_select=yes],[have_select=no])
- if test "$have_select" = "yes" ; then
- available_demuxes="$available_demuxes select"
- fi
- ;;
- port)
- # FIXME: Need to add a test for completion ports
- if test "$have_port" = "yes" ; then
- available_demuxes="$available_demuxes port"
- fi
- ;;
- *)
- ;;
- esac
-done
-
-tmp_list=
-for hydra_demux in ${available_demuxes}; do
- if test -z "$hydra_default_demux" ; then
- hydra_default_demux=${hydra_demux}
- tmp_list="${hydra_demux}"
- else
- tmp_list="$tmp_list ${hydra_demux}"
- fi
-done
-available_demuxes=$tmp_list
-
-AM_CONDITIONAL([hydra_have_poll], [test "${have_poll}" = "yes"])
-AM_CONDITIONAL([hydra_have_select], [test "${have_select}" = "yes"])
-AM_CONDITIONAL([hydra_have_port], [test "${have_port}" = "yes"])
-AC_DEFINE_UNQUOTED(HYDRA_AVAILABLE_DEMUXES,"$available_demuxes",
- [Definition of enabled demux engines])
-if test "$hydra_default_demux" != "" ; then
- AC_DEFINE_UNQUOTED(HYDRA_DEFAULT_DEMUX,"$hydra_default_demux",[Default demux engine])
-else
- AC_DEFINE(HYDRA_DEFAULT_DEMUX,NULL,[Default demux engine])
-fi
-
-
-#########################################################################
-# Debugging support
-#########################################################################
-AC_ARG_ENABLE(g,
- [--enable-g=option - Control the level of debugging support. option is a list of comma
- separated names including
- none - No debugging
- dbg - Add compiler flag -g
- mem - Memory usage tracing
- all - All of the above choices],,enable_g=none)
-AC_MSG_CHECKING(debugging support)
-AC_MSG_RESULT($enable_g)
-for option in $enable_g ; do
- case $option in
- dbg|debug)
- PAC_APPEND_FLAG(-g, CFLAGS)
- ;;
- mem)
- AC_DEFINE(USE_MEMORY_TRACING,1,[Define if memory tracing is enabled])
- ;;
- all)
- PAC_APPEND_FLAG(-g, CFLAGS)
- AC_DEFINE(USE_MEMORY_TRACING,1,[Define if memory tracing is enabled])
- ;;
- *)
- ;;
- esac
-done
-
-
-#########################################################################
-# Error checking
-#########################################################################
-AC_ARG_ENABLE(error-checking, [ --enable-error-checking - Enable error checking],
- [ error_check=$enableval ],
- [ error_check=yes ])
-AC_MSG_CHECKING(error checking)
-AC_MSG_RESULT($error_check)
-if test "$error_check" = "yes"; then
- CFLAGS="$CFLAGS -g"
- AC_DEFINE(HAVE_ERROR_CHECKING,1,[Define if error checking is enabled])
-fi
-
-
-#########################################################################
-# Warning messages
-#########################################################################
-AC_ARG_ENABLE(warnings, [ --enable-warnings Enable warnings],
- [ WARNINGS=$enableval ],
- [ WARNINGS=no ])
-AC_MSG_CHECKING(warnings)
-AC_MSG_RESULT($WARNINGS)
-if test "$WARNINGS" = "yes"; then
- AC_DEFINE(ENABLE_WARNINGS,1,[Define if warnings are enabled])
-fi
-
-
-#########################################################################
-# Profiling
-#########################################################################
-AC_ARG_ENABLE(profiling, [ --enable-profiling - Enable profiling],
- [ enable_profiling=$enableval ], [ enable_profiling=yes ])
-AC_MSG_CHECKING(profiling)
-AC_MSG_RESULT($enable_profiling)
-if test "$enable_profiling" = "yes"; then
- AC_DEFINE(ENABLE_PROFILING,1,[Define if profiling enabled])
-fi
-
-
-#########################################################################
-# FTB integration
-#########################################################################
-# FTB requires pthreads support; add pthreads to LIBS before trying to
-# find FTB
-PAC_PUSH_FLAG([LIBS])
-PAC_PREPEND_FLAG([-lpthread],[LIBS])
-PAC_SET_HEADER_LIB_PATH(ftb)
-PAC_POP_FLAG([LIBS])
-PAC_CHECK_HEADER_LIB(ftb, libftb.h, ftb, FTB_Connect, have_ftb=yes, have_ftb=no)
-if test "$have_ftb" = "yes" ; then
- # FIXME: We need to test to make sure FTB works correctly
- PAC_APPEND_FLAG([-lpthread],[LIBS])
- AC_DEFINE(ENABLE_FTB,1,[Define if FTB is enabled])
-fi
-AM_CONDITIONAL([hydra_have_ftb], [test "${have_ftb}" = "yes"])
-
-
-#########################################################################
-# Signals and friends
-#########################################################################
-AC_CHECK_FUNCS(strsignal)
-if test "$ac_cv_func_strsignal" = "yes" ; then
- PAC_FUNC_NEEDS_DECL([#include <string.h>],strsignal)
-fi
-
-AC_CHECK_FUNCS(sigaction signal sigset)
-sigaction_ok=no
-if test "$ac_cv_func_sigaction" = "yes" ; then
- # Make sure that the fields that we need in sigaction are defined
- AC_CACHE_CHECK([for struct sigaction and sa_handler],
- pac_cv_struct_sigaction_with_sa_handler,[
- AC_TRY_COMPILE([#include <signal.h>],[
-struct sigaction act; sigaddset( &act.sa_mask, SIGINT );
-act.sa_handler = SIG_IGN;],
- pac_cv_struct_sigaction_with_sa_handler=yes,
- pac_cv_struct_sigaction_with_sa_handler=no)])
- if test "$pac_cv_struct_sigaction_with_sa_handler" = "no" ; then
- AC_CACHE_CHECK([for struct sigaction and sa_handler with _POSIX_SOURCE],
- pac_cv_struct_sigaction_with_sa_handler_needs_posix,[
- AC_TRY_COMPILE([#define _POSIX_SOURCE
-#include <signal.h>],[
-struct sigaction act; sigaddset( &act.sa_mask, SIGINT );
-act.sa_handler = SIG_IGN;],
- pac_cv_struct_sigaction_with_sa_handler_needs_posix=yes,
- pac_cv_struct_sigaction_with_sa_handler_needs_posix=no)])
- if test "$pac_cv_struct_sigaction_with_sa_handler_needs_posix" = "yes" ; then
- sigaction_ok=yes
- fi
- else
- sigaction_ok=yes
- fi
-fi
-
-# Decide on the signal handler to use
-if test "$ac_cv_func_sigaction" = "yes" -a "$sigaction_ok" = "yes" ; then
- if test "$pac_cv_struct_sigaction_with_sa_handler_needs_posix" = yes ; then
- AC_DEFINE(NEEDS_POSIX_FOR_SIGACTION,1,[Define if _POSIX_SOURCE needed to get sigaction])
- fi
- AC_DEFINE(USE_SIGACTION,,[Define if sigaction should be used to set signals])
-elif test "$ac_cv_func_signal" = "yes" ; then
- AC_DEFINE(USE_SIGNAL,,[Define if signal should be used to set signals])
-fi
-
-# gethostname() returns host name
-AC_CHECK_FUNCS(gethostname)
-if test "$ac_cv_func_gethostname" = "yes" ; then
- # Do we need to declare gethostname?
- PAC_FUNC_NEEDS_DECL([#include <unistd.h>],gethostname)
-fi
-
-# Final output
-AC_OUTPUT(Makefile
- tools/bootstrap/src/bsci_init.c
- hydra-doxygen.cfg
-)
Modified: mpich2/trunk/src/pm/hydra/hydra-doxygen.cfg.in
===================================================================
--- mpich2/trunk/src/pm/hydra/hydra-doxygen.cfg.in 2012-02-28 23:25:23 UTC (rev 9547)
+++ mpich2/trunk/src/pm/hydra/hydra-doxygen.cfg.in 2012-02-28 23:26:34 UTC (rev 9548)
@@ -615,7 +615,7 @@
# against the file with absolute path, so to exclude all test directories
# for example use the pattern */test/*
-EXCLUDE_PATTERNS = Makefile.in configure.in
+EXCLUDE_PATTERNS = Makefile.in configure.ac
# The EXCLUDE_SYMBOLS tag can be used to specify one or more symbol names
# (namespaces, classes, functions, etc.) that should be excluded from the
Copied: mpich2/trunk/src/pm/mpd/configure.ac (from rev 9546, mpich2/trunk/src/pm/mpd/configure.in)
===================================================================
--- mpich2/trunk/src/pm/mpd/configure.ac (rev 0)
+++ mpich2/trunk/src/pm/mpd/configure.ac 2012-02-28 23:26:34 UTC (rev 9548)
@@ -0,0 +1,200 @@
+
+dnl Set the directory that contains support scripts such as install-sh and
+dnl config.guess
+AC_CONFIG_AUX_DIR(../../../confdb)
+
+# Autoconf initialization:
+m4_include([../../../maint/version.m4])
+dnl 2nd arg is intentionally underquoted
+AC_INIT([MPD],
+ MPICH2_VERSION_m4,
+ [mpich-discuss at mcs.anl.gov],
+ [mpd],
+ [http://www.mcs.anl.gov/research/projects/mpich2/])
+
+# Autoconf header:
+rm -f ${srcdir}/mpdconf.h mpdconf.h
+AC_CONFIG_HEADER(mpdconf.h)
+AH_TOP([/* -*- Mode: C; c-basic-offset:4 ; -*- */
+/*
+ * (C) 2001 by Argonne National Laboratory.
+ * See COPYRIGHT in top-level directory.
+ */
+#ifndef MPDCONF_H_INCLUDED
+#define MPDCONF_H_INCLUDED
+])
+AH_BOTTOM([#endif])
+
+AM_INIT_AUTOMAKE([-Wall -Werror foreign 1.11 silent-rules subdir-objects no-installinfo no-installman])
+# first_pm_name is set and exported by the top level configure
+AM_CONDITIONAL([PRIMARY_PM_MPD],[test "X$first_pm_name" = "Xmpd"])
+
+dnl Process configure arguments
+AC_ARG_ENABLE(echo,
+ [--enable-echo - turn on echoing from within configure script],
+ set -x)
+CONFIGURE_ARGS="$*"
+if test -n "$CONFIGURE_ARGS" ; then
+ echo "Configuring with args $CONFIGURE_ARGS"
+fi
+AC_SUBST(COPTIONS)
+
+dnl Checks for programs.
+dnl Determine the executable and object file extensions. These
+dnl are needed for some operations under cygwin
+AC_EXEEXT
+AC_OBJEXT
+# Checking for programs.
+PAC_PROG_CC
+AC_PROG_MAKE_SET
+AC_PROG_LN_S
+# A quick check to ensure that install-sh has the execute bit set
+# (we've had some problems with that)
+if test -f install.sh -a ! -x install.sh ; then chmod +x install.sh ; fi
+AC_PROG_INSTALL
+
+PAC_PROG_CHECK_INSTALL_WORKS
+
+if test "$installOk" = "no" ; then
+ # echo "RMB1: SETTING install"
+ INSTALL="${srcdir}/install.sh"
+fi
+echo Using INSTALL=$INSTALL
+
+AC_ARG_ENABLE(totalview,[--enable-totalview - turn on mpd-totalview support],,
+ enable_totalview=default )
+if test "$enable_totalview" = "no" ; then
+ DO_MTV="no"
+elif test "$enable_totalview" = "yes" ; then
+ DO_MTV="yes"
+else
+ AC_CHECK_PROG(TOTALVIEW, totalview, totalview)
+ if test -n "$TOTALVIEW" ; then
+ DO_MTV="yes"
+ fi
+fi
+AC_SUBST(DO_MTV)
+
+AC_ARG_WITH(python,
+ [--with-python=name - Specify a particular python to use for mpd],,
+ with_python="")
+PYTHON=$with_python
+# echo "GOT PYTHON", $PYTHON
+if test -z "$PYTHON" ; then ## user did not give us a python; find one
+ dnl Find a Python
+ AC_CHECK_PROG(PY26, python2.6, python2.6)
+ AC_CHECK_PROG(PY25, python2.5, python2.5)
+ AC_CHECK_PROG(PY24, python2.4, python2.4)
+ AC_CHECK_PROG(PY23, python2.3, python2.3)
+ AC_CHECK_PROG(PY22, python2.2, python2.2)
+ AC_CHECK_PROG(PY2, python2, python2)
+ AC_CHECK_PROG(PY, python, python)
+ if test -z "$PY26" -a \
+ -z "$PY25" -a \
+ -z "$PY24" -a \
+ -z "$PY23" -a \
+ -z "$PY22" -a \
+ -z "$PY2" -a \
+ -z "$PY" ; then
+ AC_MSG_WARN([Could not find a python executable in path: $PATH])
+ fi
+ dnl See if one of the pythons has the right modules
+ for pypgm in $PY26 $PY25 $PY24 $PY23 $PY22 $PY2 $PY ; do \
+ AC_MSG_CHECKING([that $pypgm is a valid python version])
+ changequote(,)dnl
+ py_version=`$pypgm -c "import sys;print sys.version_info[0]"`
+ py_subversion=`$pypgm -c "import sys;print sys.version_info[1]"`
+ changequote([,])dnl
+ if test "$py_version" -gt "2" -o "$py_version" -ge "2" -a "$py_subversion" -ge "2" ; then
+ AC_MSG_RESULT(yes)
+ else
+ AC_MSG_RESULT(no)
+ continue
+ fi
+
+ AC_MSG_CHECKING([that the cPickle module is available for $pypgm])
+ if $pypgm -c 'from cPickle import dumps' >/dev/null 2>&1 ; then
+ AC_MSG_RESULT(yes)
+ else
+ AC_MSG_RESULT(no)
+ continue
+ fi
+
+dnl if test "$enable_totalview" = "yes" ; then
+dnl AC_MSG_CHECKING([that $pypgm has development tools for totalview])
+dnl has_python_sdk=no
+dnl for python_homedir in /usr/lib64 /usr/lib32 /usr/lib ; do
+dnl if test -f $python_homedir/$pypgm/config/Makefile ; then
+dnl has_python_sdk=yes
+dnl break
+dnl fi
+dnl done
+dnl if test "$has_python_sdk" = "yes" ; then
+dnl AC_MSG_RESULT(yes)
+dnl else
+dnl AC_MSG_RESULT(no)
+dnl continue
+dnl fi
+dnl fi
+
+ PYTHON="$pypgm"
+ break
+ done
+else ### user-supplied with_python
+ dnl See if the user's python has the right modules
+ continue
+fi
+#
+if test -z "$PYTHON" ; then
+ AC_MSG_ERROR([Python required (version 2.2 or greater, with necessary modules)])
+fi
+
+CYGWIN_TEST=`uname -a | grep -i cygwin`
+if test -n "$CYGWIN_TEST" ; then
+ AC_MSG_CHECKING([that rebaseall is ok on this cygwin system])
+ echo
+ if ! $PYTHON -c 'from socket import socket ; from os import fork ; x = fork()' >/dev/null 2>&1 ; then
+ AC_MSG_ERROR([*** fork may fail on this cygwin system; you may need to run rebaseall])
+ fi
+fi
+
+# echo "RMB PYTHON=" $PYTHON
+AC_SUBST(PYTHON)
+
+
+# In case clinker is not defined
+if test -z "$CLINKER" ; then
+ CLINKER="$CC"
+ AC_SUBST(CLINKER)
+fi
+
+dnl Checks for libraries.
+# Searching libraries instead of checking
+AC_SEARCH_LIBS(socket, socket)
+
+dnl Checks for header files.
+# Checking headers
+AC_HEADER_STDC
+AC_HEADER_SYS_WAIT
+# sys/param.h for MAXHOSTNAMELEN
+AC_CHECK_HEADERS(fcntl.h strings.h sys/time.h unistd.h stdlib.h sys/param.h)
+
+dnl Checks for library functions.
+# Checking library functions
+AC_CHECK_FUNCS(putenv socket)
+
+AC_CHECK_FUNCS(snprintf)
+if test "$ac_cv_func_snprintf" = "yes" ; then
+ PAC_FUNC_NEEDS_DECL([#include <stdio.h>],snprintf)
+fi
+
+dnl Output:
+# Starting output
+MPD_HOME=`pwd`
+AC_SUBST(MPD_HOME)
+dnl
+dnl Dependency handling
+AC_SUBST(MAKE_DEPEND_C)
+
+# AC_OUTPUT_COMMANDS(chmod +x startdaemons)
+AC_OUTPUT(Makefile)
Deleted: mpich2/trunk/src/pm/mpd/configure.in
===================================================================
--- mpich2/trunk/src/pm/mpd/configure.in 2012-02-28 23:25:23 UTC (rev 9547)
+++ mpich2/trunk/src/pm/mpd/configure.in 2012-02-28 23:26:34 UTC (rev 9548)
@@ -1,200 +0,0 @@
-
-dnl Set the directory that contains support scripts such as install-sh and
-dnl config.guess
-AC_CONFIG_AUX_DIR(../../../confdb)
-
-# Autoconf initialization:
-m4_include([../../../maint/version.m4])
-dnl 2nd arg is intentionally underquoted
-AC_INIT([MPD],
- MPICH2_VERSION_m4,
- [mpich-discuss at mcs.anl.gov],
- [mpd],
- [http://www.mcs.anl.gov/research/projects/mpich2/])
-
-# Autoconf header:
-rm -f ${srcdir}/mpdconf.h mpdconf.h
-AC_CONFIG_HEADER(mpdconf.h)
-AH_TOP([/* -*- Mode: C; c-basic-offset:4 ; -*- */
-/*
- * (C) 2001 by Argonne National Laboratory.
- * See COPYRIGHT in top-level directory.
- */
-#ifndef MPDCONF_H_INCLUDED
-#define MPDCONF_H_INCLUDED
-])
-AH_BOTTOM([#endif])
-
-AM_INIT_AUTOMAKE([-Wall -Werror foreign 1.11 silent-rules subdir-objects no-installinfo no-installman])
-# first_pm_name is set and exported by the top level configure
-AM_CONDITIONAL([PRIMARY_PM_MPD],[test "X$first_pm_name" = "Xmpd"])
-
-dnl Process configure arguments
-AC_ARG_ENABLE(echo,
- [--enable-echo - turn on echoing from within configure script],
- set -x)
-CONFIGURE_ARGS="$*"
-if test -n "$CONFIGURE_ARGS" ; then
- echo "Configuring with args $CONFIGURE_ARGS"
-fi
-AC_SUBST(COPTIONS)
-
-dnl Checks for programs.
-dnl Determine the executable and object file extensions. These
-dnl are needed for some operations under cygwin
-AC_EXEEXT
-AC_OBJEXT
-# Checking for programs.
-PAC_PROG_CC
-AC_PROG_MAKE_SET
-AC_PROG_LN_S
-# A quick check to ensure that install-sh has the execute bit set
-# (we've had some problems with that)
-if test -f install.sh -a ! -x install.sh ; then chmod +x install.sh ; fi
-AC_PROG_INSTALL
-
-PAC_PROG_CHECK_INSTALL_WORKS
-
-if test "$installOk" = "no" ; then
- # echo "RMB1: SETTING install"
- INSTALL="${srcdir}/install.sh"
-fi
-echo Using INSTALL=$INSTALL
-
-AC_ARG_ENABLE(totalview,[--enable-totalview - turn on mpd-totalview support],,
- enable_totalview=default )
-if test "$enable_totalview" = "no" ; then
- DO_MTV="no"
-elif test "$enable_totalview" = "yes" ; then
- DO_MTV="yes"
-else
- AC_CHECK_PROG(TOTALVIEW, totalview, totalview)
- if test -n "$TOTALVIEW" ; then
- DO_MTV="yes"
- fi
-fi
-AC_SUBST(DO_MTV)
-
-AC_ARG_WITH(python,
- [--with-python=name - Specify a particular python to use for mpd],,
- with_python="")
-PYTHON=$with_python
-# echo "GOT PYTHON", $PYTHON
-if test -z "$PYTHON" ; then ## user did not give us a python; find one
- dnl Find a Python
- AC_CHECK_PROG(PY26, python2.6, python2.6)
- AC_CHECK_PROG(PY25, python2.5, python2.5)
- AC_CHECK_PROG(PY24, python2.4, python2.4)
- AC_CHECK_PROG(PY23, python2.3, python2.3)
- AC_CHECK_PROG(PY22, python2.2, python2.2)
- AC_CHECK_PROG(PY2, python2, python2)
- AC_CHECK_PROG(PY, python, python)
- if test -z "$PY26" -a \
- -z "$PY25" -a \
- -z "$PY24" -a \
- -z "$PY23" -a \
- -z "$PY22" -a \
- -z "$PY2" -a \
- -z "$PY" ; then
- AC_MSG_WARN([Could not find a python executable in path: $PATH])
- fi
- dnl See if one of the pythons has the right modules
- for pypgm in $PY26 $PY25 $PY24 $PY23 $PY22 $PY2 $PY ; do \
- AC_MSG_CHECKING([that $pypgm is a valid python version])
- changequote(,)dnl
- py_version=`$pypgm -c "import sys;print sys.version_info[0]"`
- py_subversion=`$pypgm -c "import sys;print sys.version_info[1]"`
- changequote([,])dnl
- if test "$py_version" -gt "2" -o "$py_version" -ge "2" -a "$py_subversion" -ge "2" ; then
- AC_MSG_RESULT(yes)
- else
- AC_MSG_RESULT(no)
- continue
- fi
-
- AC_MSG_CHECKING([that the cPickle module is available for $pypgm])
- if $pypgm -c 'from cPickle import dumps' >/dev/null 2>&1 ; then
- AC_MSG_RESULT(yes)
- else
- AC_MSG_RESULT(no)
- continue
- fi
-
-dnl if test "$enable_totalview" = "yes" ; then
-dnl AC_MSG_CHECKING([that $pypgm has development tools for totalview])
-dnl has_python_sdk=no
-dnl for python_homedir in /usr/lib64 /usr/lib32 /usr/lib ; do
-dnl if test -f $python_homedir/$pypgm/config/Makefile ; then
-dnl has_python_sdk=yes
-dnl break
-dnl fi
-dnl done
-dnl if test "$has_python_sdk" = "yes" ; then
-dnl AC_MSG_RESULT(yes)
-dnl else
-dnl AC_MSG_RESULT(no)
-dnl continue
-dnl fi
-dnl fi
-
- PYTHON="$pypgm"
- break
- done
-else ### user-supplied with_python
- dnl See if the user's python has the right modules
- continue
-fi
-#
-if test -z "$PYTHON" ; then
- AC_MSG_ERROR([Python required (version 2.2 or greater, with necessary modules)])
-fi
-
-CYGWIN_TEST=`uname -a | grep -i cygwin`
-if test -n "$CYGWIN_TEST" ; then
- AC_MSG_CHECKING([that rebaseall is ok on this cygwin system])
- echo
- if ! $PYTHON -c 'from socket import socket ; from os import fork ; x = fork()' >/dev/null 2>&1 ; then
- AC_MSG_ERROR([*** fork may fail on this cygwin system; you may need to run rebaseall])
- fi
-fi
-
-# echo "RMB PYTHON=" $PYTHON
-AC_SUBST(PYTHON)
-
-
-# In case clinker is not defined
-if test -z "$CLINKER" ; then
- CLINKER="$CC"
- AC_SUBST(CLINKER)
-fi
-
-dnl Checks for libraries.
-# Searching libraries instead of checking
-AC_SEARCH_LIBS(socket, socket)
-
-dnl Checks for header files.
-# Checking headers
-AC_HEADER_STDC
-AC_HEADER_SYS_WAIT
-# sys/param.h for MAXHOSTNAMELEN
-AC_CHECK_HEADERS(fcntl.h strings.h sys/time.h unistd.h stdlib.h sys/param.h)
-
-dnl Checks for library functions.
-# Checking library functions
-AC_CHECK_FUNCS(putenv socket)
-
-AC_CHECK_FUNCS(snprintf)
-if test "$ac_cv_func_snprintf" = "yes" ; then
- PAC_FUNC_NEEDS_DECL([#include <stdio.h>],snprintf)
-fi
-
-dnl Output:
-# Starting output
-MPD_HOME=`pwd`
-AC_SUBST(MPD_HOME)
-dnl
-dnl Dependency handling
-AC_SUBST(MAKE_DEPEND_C)
-
-# AC_OUTPUT_COMMANDS(chmod +x startdaemons)
-AC_OUTPUT(Makefile)
Copied: mpich2/trunk/src/pm/remshell/configure.ac (from rev 9546, mpich2/trunk/src/pm/remshell/configure.in)
===================================================================
--- mpich2/trunk/src/pm/remshell/configure.ac (rev 0)
+++ mpich2/trunk/src/pm/remshell/configure.ac 2012-02-28 23:26:34 UTC (rev 9548)
@@ -0,0 +1,255 @@
+dnl Process this file with autoconf to produce a configure script.
+dnl
+dnl aclocal_cache.m4, included by sowing/confdb/aclocal.m4, fixes
+dnl bugs in autoconf caching.
+dnl
+dnl The file name here refers to a file in the source being configured
+AC_INIT(mpiexec.c)
+
+dnl Definitions will be placed in this file rather than in the DEFS variable
+AC_CONFIG_HEADER(remshellconf.h)
+AH_TOP([/* -*- Mode: C; c-basic-offset:4 ; -*- */
+/*
+ * (C) 2001 by Argonne National Laboratory.
+ * See COPYRIGHT in top-level directory.
+ */
+#ifndef REMSHELLCONF_H_INCLUDED
+#define REMSHELLCONF_H_INCLUDED
+])
+AH_BOTTOM([#endif])
+dnl
+dnl Set the directory that contains support scripts such as install-sh and
+dnl config.guess
+AC_CONFIG_AUX_DIR(../../../confdb)
+dnl
+echo "RUNNING CONFIGURE FOR THE REMSHELL PM"
+dnl
+dnl Use AC_ARG_ENABLE to look for --enable-feature and AC_ARG_WITH to look for
+dnl --with-capability
+dnl
+dnl Enable better caching control
+PAC_ARG_CACHING
+dnl
+AC_ARG_ENABLE(echo,
+[--enable-echo - Turn on strong echoing. The default is enable=no.] ,set -x)
+
+AC_ARG_ENABLE(onsig,
+[--enable-onsig - Control the handling of processes that signal (e.g., SEGV)
+ using ptrace. Disabled by default],,enable_onsig=no)
+AC_ARG_ENABLE(newsession,
+[--enable-newsession - Create a new process group session if standard in is
+ not connected to a terminal],,enable_newsession=yes)
+dnl With options
+dnl
+dnl First check that we have a clean build if we are doing a VPATH build
+PAC_VPATH_CHECK()
+dnl
+dnl Process any enable or with values
+
+dnl This test is complicated by the fact that top_srcdir is not set until
+dnl the very end of configure. Instead, we get it ourselves
+if test -z "$top_srcdir" ; then
+ use_top_srcdir=$srcdir
+else
+ use_top_srcdir=$top_srcdir
+fi
+
+PAC_LOAD_BASE_CACHE
+
+dnl The recommended order for items in a configure.ac file is
+dnl check for programs
+dnl check for libraries
+dnl check for header files
+dnl check for typedefs
+dnl check for structures
+dnl check for compiler characteristics
+dnl check for library functions
+dnl check for system services
+dnl Here are some sample tests
+dnl
+dnl Determine the executable and object file extensions. These
+dnl are needed for some operations under cygwin
+AC_EXEEXT
+AC_OBJEXT
+
+dnl Find a C compiler
+PAC_PROG_CC
+
+PAC_ARG_STRICT
+AC_PROG_INSTALL
+PAC_PROG_MKDIR_P
+PAC_PROG_MAKE
+dnl AC_CHECK_PROGS(AR,ar)
+dnl AC_PROG_RANLIB
+# Turn off creating shared libraries for any utility routines. If we *are*
+# building shared libaries, make sure that we create a static executable
+case "$ENABLE_SHLIB" in
+ none) ;;
+ gcc)
+ LDFLAGS="$LDFLAGS -static"
+ ;;
+ libtool)
+ ;;
+ *)
+ ;;
+esac
+
+ENABLE_SHLIB=none
+AC_SUBST(ENABLE_SHLIB)
+dnl
+dnl check for compiler characteristics
+AC_C_CONST
+AC_C_VOLATILE
+AC_C_RESTRICT
+AC_C_INLINE
+dnl
+dnl check for library functions
+dnl AC_CHECK_FUNCS(strtol time gettimeofday)
+AC_CHECK_FUNCS(snprintf)
+if test "$ac_cv_func_snprintf" = "yes" ; then
+ PAC_FUNC_NEEDS_DECL([#include <stdio.h>],snprintf)
+fi
+AC_CHECK_FUNCS(strdup)
+if test "$ac_cv_func_strdup" = "yes" ; then
+ # Do we need to declare strdup?
+ PAC_FUNC_NEEDS_DECL([#include <string.h>],strdup)
+fi
+
+if test "$enable_onsig" = "yes" ; then
+ AC_CHECK_FUNCS(ptrace)
+ # It isn't enough to find ptrace. We also need the ptrace
+ # parameters, which some systems, such as IRIX, do not define.
+ if test "$ac_cv_func_ptrace" = yes ; then
+ AC_CACHE_CHECK([for ptrace named parameters],
+pac_cv_has_ptrace_parms,[
+ AC_TRY_COMPILE([
+#include <sys/types.h>
+#include <sys/ptrace.h>],[int i = PTRACE_CONT;],pac_cv_has_ptrace_parms=yes,
+pac_cv_has_ptrace_parms=no)])
+ if test "$pac_cv_has_ptrace_parms" = "yes" ; then
+ AC_DEFINE(HAVE_PTRACE_CONT,,[Define if ptrace parameters available])
+ fi
+ fi
+fi
+# Check for the functions needed to create a new session.
+# Cygwin has setsid but not getsid
+AC_CHECK_FUNCS(setsid isatty getsid)
+if test "$enable_newsession" = "yes" ; then
+ AC_DEFINE(USE_NEW_SESSION,1,[Define if mpiexec should create a new process group session])
+fi
+dnl
+dnl Check for special compile characteristics
+dnl
+dnl Is there libnsl needed for gethostbyname?
+dnl AC_SEARCH_LIBS(gethostbyname,nsl)
+AC_SEARCH_LIBS(socketpair,socket)
+dnl
+dnl Look for Standard headers
+AC_HEADER_STDC
+dnl Check for a specific header
+AC_CHECK_HEADERS(sys/types.h signal.h sys/ptrace.h)
+dnl
+dnl Check for functions. This invokes another test if the function is
+dnl found. The braces around the second test are essential.
+dnl AC_CHECK_FUNC(setpgrp,[AC_FUNC_SETPGRP])
+AC_CHECK_FUNCS(strsignal)
+dnl
+dnl Check for signal handlers
+AC_CHECK_FUNCS(sigaction signal sigset)
+if test "$ac_cv_func_sigaction" = "yes" ; then
+ AC_MSG_CHECKING(for struct sigaction)
+ AC_TRY_COMPILE([#include <signal.h>],[
+struct sigaction act; sigaddset( &act.sa_mask, SIGINT );],sigaction_ok="yes",sigaction_ok="no")
+ AC_MSG_RESULT($sigaction_ok)
+ if test "$sigaction_ok" = "no" ; then
+ AC_MSG_CHECKING(for struct sigaction with _POSIX_SOURCE)
+ AC_TRY_COMPILE([#define _POSIX_SOURCE
+#include <signal.h>],[
+struct sigaction act; sigaddset( &act.sa_mask, SIGINT );],sigaction_with_posix_ok="yes",sigaction_with_posix_ok="no")
+ AC_MSG_RESULT($sigaction_with_posix_ok)
+ if test "$sigaction_with_posix_ok" = "yes" ; then
+ sigaction_ok=yes
+ sigaction_needs_posix=yes
+ fi
+ fi
+fi
+dnl
+# Decide on the signal handler to use
+if test "$ac_cv_func_sigaction" = "yes" -a "$sigaction_ok" = "yes" ; then
+ if test "$sigaction_needs_posix" = yes ; then
+ AC_DEFINE(NEEDS_POSIX_FOR_SIGACTION,1,[Define if _POSIX_SOURCE needed to get sigaction])
+ fi
+ AC_DEFINE(USE_SIGACTION,1,[Define if sigaction should be used to set signals])
+elif test "$ac_cv_func_signal" = "yes" ; then
+ AC_DEFINE(USE_SIGNAL,1,[Define if signal should be used to set signals])
+fi
+dnl
+dnl Setup other replaceable values
+MPILIBNAME=${MPILIBNAME:-"mpich"}
+dnl
+dnl
+dnl Configure the pm utilities for mpiexec2 (which will eventually replace
+dnl mpiexec)
+PAC_SUBDIR_CACHE
+dnl
+dnl You can't configure a directory that isn't a strict subdirectory
+dnl reliably. For example, configure will set the cache file incorrectly
+dnl unless you set it explicitly
+dnl if test "$cache_file" != "/dev/null" ; then
+dnl # convert the cachefile to an absolute path
+dnl cachedir=`echo $cache_file | sed -e 's%/[^/]*$%%'`
+dnl fname=`basename $cache_file`
+dnl if test -d $cachedir ; then
+dnl cachedir=`(cd $cachedir && pwd)`
+dnl else
+dnl cachedir=`pwd`
+dnl fi
+dnl if test -f "$cachedir/$fname" ; then
+dnl cache_file=$cachedir/$fname
+dnl fi
+dnl fi
+
+if test -z "$master_top_srcdir" ; then
+ master_top_srcdir='${srcdir}/../../..'
+fi
+
+dnl See setup_pm. The pm/util directory must also be configured
+PAC_CONFIG_SUBDIR(../util,,AC_ERROR(pm/utils configure failed))
+
+AC_CHECK_HEADERS(string.h sys/time.h unistd.h stdlib.h sys/socket.h wait.h errno.h)
+
+AC_PATH_PROG(SSH,ssh)
+if test -z "$SSH" ; then
+ AC_PATH_PROG(RSH,rsh)
+ if test -n "$RSH" ; then
+ remshell="$RSH"
+ fi
+else
+ remshell="$SSH"
+fi
+
+AC_SUBST(MPILIBNAME)
+AC_SUBST(CC)
+AC_SUBST(CFLAGS)
+AC_SUBST(CC_SHL)
+AC_SUBST(C_LINK_SHL)
+AC_SUBST(master_top_srcdir)
+dnl
+dnl Dependency handling
+AC_SUBST(MAKE_DEPEND_C)
+dnl
+AC_DEFINE_UNQUOTED(DEFAULT_MACHINES_PATH,"$eval_datadir:.",[Define the search path for machines files])
+AC_DEFINE_UNQUOTED(DEFAULT_REMOTE_SHELL,"$remshell",[Define the default remote shell program to use])
+dnl
+dnl Etags
+AC_SUBST(ETAGS)
+AC_SUBST(ETAGSADD)
+export ETAGS
+export ETAGSADD
+dnl
+dnl Other autoconf variables that may be imported from the calling environment
+AC_SUBST(DOCTEXT)
+PAC_UPDATE_BASE_CACHE
+
+dnl Generate the Makefiles from Makefile.in
+AC_OUTPUT(Makefile)
Deleted: mpich2/trunk/src/pm/remshell/configure.in
===================================================================
--- mpich2/trunk/src/pm/remshell/configure.in 2012-02-28 23:25:23 UTC (rev 9547)
+++ mpich2/trunk/src/pm/remshell/configure.in 2012-02-28 23:26:34 UTC (rev 9548)
@@ -1,255 +0,0 @@
-dnl Process this file with autoconf to produce a configure script.
-dnl
-dnl aclocal_cache.m4, included by sowing/confdb/aclocal.m4, fixes
-dnl bugs in autoconf caching.
-dnl
-dnl The file name here refers to a file in the source being configured
-AC_INIT(mpiexec.c)
-
-dnl Definitions will be placed in this file rather than in the DEFS variable
-AC_CONFIG_HEADER(remshellconf.h)
-AH_TOP([/* -*- Mode: C; c-basic-offset:4 ; -*- */
-/*
- * (C) 2001 by Argonne National Laboratory.
- * See COPYRIGHT in top-level directory.
- */
-#ifndef REMSHELLCONF_H_INCLUDED
-#define REMSHELLCONF_H_INCLUDED
-])
-AH_BOTTOM([#endif])
-dnl
-dnl Set the directory that contains support scripts such as install-sh and
-dnl config.guess
-AC_CONFIG_AUX_DIR(../../../confdb)
-dnl
-echo "RUNNING CONFIGURE FOR THE REMSHELL PM"
-dnl
-dnl Use AC_ARG_ENABLE to look for --enable-feature and AC_ARG_WITH to look for
-dnl --with-capability
-dnl
-dnl Enable better caching control
-PAC_ARG_CACHING
-dnl
-AC_ARG_ENABLE(echo,
-[--enable-echo - Turn on strong echoing. The default is enable=no.] ,set -x)
-
-AC_ARG_ENABLE(onsig,
-[--enable-onsig - Control the handling of processes that signal (e.g., SEGV)
- using ptrace. Disabled by default],,enable_onsig=no)
-AC_ARG_ENABLE(newsession,
-[--enable-newsession - Create a new process group session if standard in is
- not connected to a terminal],,enable_newsession=yes)
-dnl With options
-dnl
-dnl First check that we have a clean build if we are doing a VPATH build
-PAC_VPATH_CHECK()
-dnl
-dnl Process any enable or with values
-
-dnl This test is complicated by the fact that top_srcdir is not set until
-dnl the very end of configure. Instead, we get it ourselves
-if test -z "$top_srcdir" ; then
- use_top_srcdir=$srcdir
-else
- use_top_srcdir=$top_srcdir
-fi
-
-PAC_LOAD_BASE_CACHE
-
-dnl The recommended order for items in a configure.in file is
-dnl check for programs
-dnl check for libraries
-dnl check for header files
-dnl check for typedefs
-dnl check for structures
-dnl check for compiler characteristics
-dnl check for library functions
-dnl check for system services
-dnl Here are some sample tests
-dnl
-dnl Determine the executable and object file extensions. These
-dnl are needed for some operations under cygwin
-AC_EXEEXT
-AC_OBJEXT
-
-dnl Find a C compiler
-PAC_PROG_CC
-
-PAC_ARG_STRICT
-AC_PROG_INSTALL
-PAC_PROG_MKDIR_P
-PAC_PROG_MAKE
-dnl AC_CHECK_PROGS(AR,ar)
-dnl AC_PROG_RANLIB
-# Turn off creating shared libraries for any utility routines. If we *are*
-# building shared libaries, make sure that we create a static executable
-case "$ENABLE_SHLIB" in
- none) ;;
- gcc)
- LDFLAGS="$LDFLAGS -static"
- ;;
- libtool)
- ;;
- *)
- ;;
-esac
-
-ENABLE_SHLIB=none
-AC_SUBST(ENABLE_SHLIB)
-dnl
-dnl check for compiler characteristics
-AC_C_CONST
-AC_C_VOLATILE
-AC_C_RESTRICT
-AC_C_INLINE
-dnl
-dnl check for library functions
-dnl AC_CHECK_FUNCS(strtol time gettimeofday)
-AC_CHECK_FUNCS(snprintf)
-if test "$ac_cv_func_snprintf" = "yes" ; then
- PAC_FUNC_NEEDS_DECL([#include <stdio.h>],snprintf)
-fi
-AC_CHECK_FUNCS(strdup)
-if test "$ac_cv_func_strdup" = "yes" ; then
- # Do we need to declare strdup?
- PAC_FUNC_NEEDS_DECL([#include <string.h>],strdup)
-fi
-
-if test "$enable_onsig" = "yes" ; then
- AC_CHECK_FUNCS(ptrace)
- # It isn't enough to find ptrace. We also need the ptrace
- # parameters, which some systems, such as IRIX, do not define.
- if test "$ac_cv_func_ptrace" = yes ; then
- AC_CACHE_CHECK([for ptrace named parameters],
-pac_cv_has_ptrace_parms,[
- AC_TRY_COMPILE([
-#include <sys/types.h>
-#include <sys/ptrace.h>],[int i = PTRACE_CONT;],pac_cv_has_ptrace_parms=yes,
-pac_cv_has_ptrace_parms=no)])
- if test "$pac_cv_has_ptrace_parms" = "yes" ; then
- AC_DEFINE(HAVE_PTRACE_CONT,,[Define if ptrace parameters available])
- fi
- fi
-fi
-# Check for the functions needed to create a new session.
-# Cygwin has setsid but not getsid
-AC_CHECK_FUNCS(setsid isatty getsid)
-if test "$enable_newsession" = "yes" ; then
- AC_DEFINE(USE_NEW_SESSION,1,[Define if mpiexec should create a new process group session])
-fi
-dnl
-dnl Check for special compile characteristics
-dnl
-dnl Is there libnsl needed for gethostbyname?
-dnl AC_SEARCH_LIBS(gethostbyname,nsl)
-AC_SEARCH_LIBS(socketpair,socket)
-dnl
-dnl Look for Standard headers
-AC_HEADER_STDC
-dnl Check for a specific header
-AC_CHECK_HEADERS(sys/types.h signal.h sys/ptrace.h)
-dnl
-dnl Check for functions. This invokes another test if the function is
-dnl found. The braces around the second test are essential.
-dnl AC_CHECK_FUNC(setpgrp,[AC_FUNC_SETPGRP])
-AC_CHECK_FUNCS(strsignal)
-dnl
-dnl Check for signal handlers
-AC_CHECK_FUNCS(sigaction signal sigset)
-if test "$ac_cv_func_sigaction" = "yes" ; then
- AC_MSG_CHECKING(for struct sigaction)
- AC_TRY_COMPILE([#include <signal.h>],[
-struct sigaction act; sigaddset( &act.sa_mask, SIGINT );],sigaction_ok="yes",sigaction_ok="no")
- AC_MSG_RESULT($sigaction_ok)
- if test "$sigaction_ok" = "no" ; then
- AC_MSG_CHECKING(for struct sigaction with _POSIX_SOURCE)
- AC_TRY_COMPILE([#define _POSIX_SOURCE
-#include <signal.h>],[
-struct sigaction act; sigaddset( &act.sa_mask, SIGINT );],sigaction_with_posix_ok="yes",sigaction_with_posix_ok="no")
- AC_MSG_RESULT($sigaction_with_posix_ok)
- if test "$sigaction_with_posix_ok" = "yes" ; then
- sigaction_ok=yes
- sigaction_needs_posix=yes
- fi
- fi
-fi
-dnl
-# Decide on the signal handler to use
-if test "$ac_cv_func_sigaction" = "yes" -a "$sigaction_ok" = "yes" ; then
- if test "$sigaction_needs_posix" = yes ; then
- AC_DEFINE(NEEDS_POSIX_FOR_SIGACTION,1,[Define if _POSIX_SOURCE needed to get sigaction])
- fi
- AC_DEFINE(USE_SIGACTION,1,[Define if sigaction should be used to set signals])
-elif test "$ac_cv_func_signal" = "yes" ; then
- AC_DEFINE(USE_SIGNAL,1,[Define if signal should be used to set signals])
-fi
-dnl
-dnl Setup other replaceable values
-MPILIBNAME=${MPILIBNAME:-"mpich"}
-dnl
-dnl
-dnl Configure the pm utilities for mpiexec2 (which will eventually replace
-dnl mpiexec)
-PAC_SUBDIR_CACHE
-dnl
-dnl You can't configure a directory that isn't a strict subdirectory
-dnl reliably. For example, configure will set the cache file incorrectly
-dnl unless you set it explicitly
-dnl if test "$cache_file" != "/dev/null" ; then
-dnl # convert the cachefile to an absolute path
-dnl cachedir=`echo $cache_file | sed -e 's%/[^/]*$%%'`
-dnl fname=`basename $cache_file`
-dnl if test -d $cachedir ; then
-dnl cachedir=`(cd $cachedir && pwd)`
-dnl else
-dnl cachedir=`pwd`
-dnl fi
-dnl if test -f "$cachedir/$fname" ; then
-dnl cache_file=$cachedir/$fname
-dnl fi
-dnl fi
-
-if test -z "$master_top_srcdir" ; then
- master_top_srcdir='${srcdir}/../../..'
-fi
-
-dnl See setup_pm. The pm/util directory must also be configured
-PAC_CONFIG_SUBDIR(../util,,AC_ERROR(pm/utils configure failed))
-
-AC_CHECK_HEADERS(string.h sys/time.h unistd.h stdlib.h sys/socket.h wait.h errno.h)
-
-AC_PATH_PROG(SSH,ssh)
-if test -z "$SSH" ; then
- AC_PATH_PROG(RSH,rsh)
- if test -n "$RSH" ; then
- remshell="$RSH"
- fi
-else
- remshell="$SSH"
-fi
-
-AC_SUBST(MPILIBNAME)
-AC_SUBST(CC)
-AC_SUBST(CFLAGS)
-AC_SUBST(CC_SHL)
-AC_SUBST(C_LINK_SHL)
-AC_SUBST(master_top_srcdir)
-dnl
-dnl Dependency handling
-AC_SUBST(MAKE_DEPEND_C)
-dnl
-AC_DEFINE_UNQUOTED(DEFAULT_MACHINES_PATH,"$eval_datadir:.",[Define the search path for machines files])
-AC_DEFINE_UNQUOTED(DEFAULT_REMOTE_SHELL,"$remshell",[Define the default remote shell program to use])
-dnl
-dnl Etags
-AC_SUBST(ETAGS)
-AC_SUBST(ETAGSADD)
-export ETAGS
-export ETAGSADD
-dnl
-dnl Other autoconf variables that may be imported from the calling environment
-AC_SUBST(DOCTEXT)
-PAC_UPDATE_BASE_CACHE
-
-dnl Generate the Makefiles from Makefile.in
-AC_OUTPUT(Makefile)
Copied: mpich2/trunk/src/pmi/pmi2/configure.ac (from rev 9546, mpich2/trunk/src/pmi/pmi2/configure.in)
===================================================================
--- mpich2/trunk/src/pmi/pmi2/configure.ac (rev 0)
+++ mpich2/trunk/src/pmi/pmi2/configure.ac 2012-02-28 23:26:34 UTC (rev 9548)
@@ -0,0 +1,149 @@
+dnl Process this file with autoconf to produce a configure script.
+dnl
+dnl aclocal_cache.m4, included by sowing/confdb/aclocal.m4, fixes
+dnl bugs in autoconf caching.
+dnl
+dnl The file name here refers to a file in the source being configured
+AC_INIT(simple2pmi.c)
+
+dnl Definitions will be placed in this file rather than in the DEFS variable
+AC_CONFIG_HEADER(pmi2conf.h)
+AH_TOP([/* -*- Mode: C; c-basic-offset:4 ; -*- */
+/*
+ * (C) 2007 by Argonne National Laboratory.
+ * See COPYRIGHT in top-level directory.
+ */
+#ifndef PMI2CONF_H_INCLUDED
+#define PMI2CONF_H_INCLUDED
+])
+AH_BOTTOM([#endif])
+dnl
+dnl Set the directory that contains support scripts such as install-sh and
+dnl config.guess
+dnl AC_CONFIG_AUX_DIR(../../../confdb)
+dnl
+echo "RUNNING CONFIGURE FOR THE SIMPLE PMI VERSION 2"
+dnl
+dnl
+dnl Use AC_ARG_ENABLE to look for --enable-feature and AC_ARG_WITH to look for
+dnl --with-capability
+dnl
+dnl Enable better caching control
+PAC_ARG_CACHING
+
+AC_ARG_ENABLE(pmiport,
+[--enable-pmiport - Allow PMI interface to use a host-port pair to contact
+ for PMI services],,enable_pmiport=default)
+if test "$enable_pmiport" != "no" ; then
+ enable_pmiport=yes
+fi
+
+PAC_VPATH_CHECK()
+
+PAC_LOAD_BASE_CACHE
+
+PAC_PROG_MAKE
+
+# Check for alloca function. May set HAVE_ALLOCA_H and HAVE_ALLOCA
+AC_FUNC_ALLOCA
+# We don't use alloca unless USE_ALLOCA is also set.
+AC_ARG_ENABLE(alloca,
+[--enable-alloca - Use alloca to allocate temporary memory if available],,enable_alloca=no)
+if test "$enable_alloca" = yes ; then
+ AC_DEFINE(USE_ALLOCA,1,[Define if alloca should be used if available])
+fi
+
+AC_CHECK_HEADERS(unistd.h string.h stdlib.h sys/socket.h strings.h)
+dnl Use snprintf if possible when creating messages
+AC_CHECK_FUNCS(snprintf)
+if test "$ac_cv_func_snprintf" = "yes" ; then
+ PAC_FUNC_NEEDS_DECL([#include <stdio.h>],snprintf)
+fi
+#
+# PM's that need support for a port can set the environment variable
+# NEED_PMIPORT in their setup_pm script.
+if test "$NEED_PMIPORT" = "yes" -a "$enable_pmiport" != "yes" ; then
+ AC_MSG_WARN([The process manager requires the pmiport capability. Do not specify --disable-pmiport.])
+ enable_pmiport=yes
+fi
+#
+if test "$enable_pmiport" = "yes" ; then
+ # Check for the necessary includes and functions
+ missing_headers=no
+ AC_CHECK_HEADERS([ \
+ sys/types.h \
+ sys/param.h \
+ sys/socket.h \
+ netinet/in.h \
+ netinet/tcp.h \
+ sys/un.h \
+ netdb.h \
+ ],,missing_headers=yes )
+ AC_SEARCH_LIBS(socket,socket)
+ AC_SEARCH_LIBS(gethostbyname,nsl)
+ missing_functions=no
+ AC_CHECK_FUNCS(socket setsockopt gethostbyname,,missing_functions=yes)
+
+ if test "$missing_functions" = "no" ; then
+ AC_DEFINE(USE_PMI_PORT,1,[Define if access to PMI information through a port rather than just an fd is allowed])
+ else
+ AC_MSG_ERROR([Cannot build simple PMI with support for an IP port because of missing functions])
+ fi
+fi
+
+# Check for socklen_t . If undefined, define it as int
+# (note the conditional inclusion of sys/socket.h)
+AC_CACHE_CHECK([whether socklen_t is defined (in sys/socket.h if present)],
+pac_cv_have_socklen_t,[
+AC_TRY_COMPILE([
+#include <sys/types.h>
+#ifdef HAVE_SYS_SOCKET_H
+#include <sys/socket.h>
+#endif
+]
+typedef struct { double a; int b; } socklen_t;,[socklen_t a;a.a=1.0;],pac_cv_have_socklen_t=no,pac_cv_have_socklen_t=yes)])
+if test "$pac_cv_have_socklen_t" = no ; then
+ AC_DEFINE(socklen_t,int,[Define if socklen_t is not defined])
+fi
+# Check for h_addr or h_addr_list
+AC_CACHE_CHECK([whether struct hostent contains h_addr_list],
+pac_cv_have_haddr_list,[
+AC_TRY_COMPILE([
+#include <netdb.h>],[struct hostent hp;hp.h_addr_list[0]=0;],
+pac_cv_have_haddr_list=yes,pac_cv_have_haddr_list=no)])
+if test "$pac_cv_have_haddr_list" = "yes" ; then
+ AC_DEFINE(HAVE_H_ADDR_LIST,1,[Define if struct hostent contains h_addr_list])
+fi
+
+AC_CHECK_SIZEOF(void *)
+
+
+AC_SUBST(AR)
+AC_SUBST(AR_FLAGS)
+AC_SUBST(RANLIB)
+AC_SUBST(MPILIBNAME)
+AC_SUBST(CC)
+AC_SUBST(CFLAGS)
+AC_SUBST(CPPFLAGS)
+PAC_CC_SUBDIR_SHLIBS
+AC_SUBST(master_top_srcdir)
+AC_SUBST(master_top_builddir)
+dnl
+dnl Dependency handling
+AC_SUBST(MAKE_DEPEND_C)
+dnl
+dnl Etags
+AC_SUBST(ETAGS)
+AC_SUBST(ETAGSADD)
+export ETAGS
+export ETAGSADD
+
+PAC_UPDATE_BASE_CACHE
+
+# Make sure that the dependencies directories are present
+AC_OUTPUT_COMMANDS([if test ! -d .deps ; then mkdir .deps ; fi
+if test ! -f .deps/alldeps ; then touch .deps/alldeps ; fi])
+
+AC_OUTPUT(Makefile localdefs)
+
+PAC_SUBDIR_CACHE_CLEANUP
Deleted: mpich2/trunk/src/pmi/pmi2/configure.in
===================================================================
--- mpich2/trunk/src/pmi/pmi2/configure.in 2012-02-28 23:25:23 UTC (rev 9547)
+++ mpich2/trunk/src/pmi/pmi2/configure.in 2012-02-28 23:26:34 UTC (rev 9548)
@@ -1,149 +0,0 @@
-dnl Process this file with autoconf to produce a configure script.
-dnl
-dnl aclocal_cache.m4, included by sowing/confdb/aclocal.m4, fixes
-dnl bugs in autoconf caching.
-dnl
-dnl The file name here refers to a file in the source being configured
-AC_INIT(simple2pmi.c)
-
-dnl Definitions will be placed in this file rather than in the DEFS variable
-AC_CONFIG_HEADER(pmi2conf.h)
-AH_TOP([/* -*- Mode: C; c-basic-offset:4 ; -*- */
-/*
- * (C) 2007 by Argonne National Laboratory.
- * See COPYRIGHT in top-level directory.
- */
-#ifndef PMI2CONF_H_INCLUDED
-#define PMI2CONF_H_INCLUDED
-])
-AH_BOTTOM([#endif])
-dnl
-dnl Set the directory that contains support scripts such as install-sh and
-dnl config.guess
-dnl AC_CONFIG_AUX_DIR(../../../confdb)
-dnl
-echo "RUNNING CONFIGURE FOR THE SIMPLE PMI VERSION 2"
-dnl
-dnl
-dnl Use AC_ARG_ENABLE to look for --enable-feature and AC_ARG_WITH to look for
-dnl --with-capability
-dnl
-dnl Enable better caching control
-PAC_ARG_CACHING
-
-AC_ARG_ENABLE(pmiport,
-[--enable-pmiport - Allow PMI interface to use a host-port pair to contact
- for PMI services],,enable_pmiport=default)
-if test "$enable_pmiport" != "no" ; then
- enable_pmiport=yes
-fi
-
-PAC_VPATH_CHECK()
-
-PAC_LOAD_BASE_CACHE
-
-PAC_PROG_MAKE
-
-# Check for alloca function. May set HAVE_ALLOCA_H and HAVE_ALLOCA
-AC_FUNC_ALLOCA
-# We don't use alloca unless USE_ALLOCA is also set.
-AC_ARG_ENABLE(alloca,
-[--enable-alloca - Use alloca to allocate temporary memory if available],,enable_alloca=no)
-if test "$enable_alloca" = yes ; then
- AC_DEFINE(USE_ALLOCA,1,[Define if alloca should be used if available])
-fi
-
-AC_CHECK_HEADERS(unistd.h string.h stdlib.h sys/socket.h strings.h)
-dnl Use snprintf if possible when creating messages
-AC_CHECK_FUNCS(snprintf)
-if test "$ac_cv_func_snprintf" = "yes" ; then
- PAC_FUNC_NEEDS_DECL([#include <stdio.h>],snprintf)
-fi
-#
-# PM's that need support for a port can set the environment variable
-# NEED_PMIPORT in their setup_pm script.
-if test "$NEED_PMIPORT" = "yes" -a "$enable_pmiport" != "yes" ; then
- AC_MSG_WARN([The process manager requires the pmiport capability. Do not specify --disable-pmiport.])
- enable_pmiport=yes
-fi
-#
-if test "$enable_pmiport" = "yes" ; then
- # Check for the necessary includes and functions
- missing_headers=no
- AC_CHECK_HEADERS([ \
- sys/types.h \
- sys/param.h \
- sys/socket.h \
- netinet/in.h \
- netinet/tcp.h \
- sys/un.h \
- netdb.h \
- ],,missing_headers=yes )
- AC_SEARCH_LIBS(socket,socket)
- AC_SEARCH_LIBS(gethostbyname,nsl)
- missing_functions=no
- AC_CHECK_FUNCS(socket setsockopt gethostbyname,,missing_functions=yes)
-
- if test "$missing_functions" = "no" ; then
- AC_DEFINE(USE_PMI_PORT,1,[Define if access to PMI information through a port rather than just an fd is allowed])
- else
- AC_MSG_ERROR([Cannot build simple PMI with support for an IP port because of missing functions])
- fi
-fi
-
-# Check for socklen_t . If undefined, define it as int
-# (note the conditional inclusion of sys/socket.h)
-AC_CACHE_CHECK([whether socklen_t is defined (in sys/socket.h if present)],
-pac_cv_have_socklen_t,[
-AC_TRY_COMPILE([
-#include <sys/types.h>
-#ifdef HAVE_SYS_SOCKET_H
-#include <sys/socket.h>
-#endif
-]
-typedef struct { double a; int b; } socklen_t;,[socklen_t a;a.a=1.0;],pac_cv_have_socklen_t=no,pac_cv_have_socklen_t=yes)])
-if test "$pac_cv_have_socklen_t" = no ; then
- AC_DEFINE(socklen_t,int,[Define if socklen_t is not defined])
-fi
-# Check for h_addr or h_addr_list
-AC_CACHE_CHECK([whether struct hostent contains h_addr_list],
-pac_cv_have_haddr_list,[
-AC_TRY_COMPILE([
-#include <netdb.h>],[struct hostent hp;hp.h_addr_list[0]=0;],
-pac_cv_have_haddr_list=yes,pac_cv_have_haddr_list=no)])
-if test "$pac_cv_have_haddr_list" = "yes" ; then
- AC_DEFINE(HAVE_H_ADDR_LIST,1,[Define if struct hostent contains h_addr_list])
-fi
-
-AC_CHECK_SIZEOF(void *)
-
-
-AC_SUBST(AR)
-AC_SUBST(AR_FLAGS)
-AC_SUBST(RANLIB)
-AC_SUBST(MPILIBNAME)
-AC_SUBST(CC)
-AC_SUBST(CFLAGS)
-AC_SUBST(CPPFLAGS)
-PAC_CC_SUBDIR_SHLIBS
-AC_SUBST(master_top_srcdir)
-AC_SUBST(master_top_builddir)
-dnl
-dnl Dependency handling
-AC_SUBST(MAKE_DEPEND_C)
-dnl
-dnl Etags
-AC_SUBST(ETAGS)
-AC_SUBST(ETAGSADD)
-export ETAGS
-export ETAGSADD
-
-PAC_UPDATE_BASE_CACHE
-
-# Make sure that the dependencies directories are present
-AC_OUTPUT_COMMANDS([if test ! -d .deps ; then mkdir .deps ; fi
-if test ! -f .deps/alldeps ; then touch .deps/alldeps ; fi])
-
-AC_OUTPUT(Makefile localdefs)
-
-PAC_SUBDIR_CACHE_CLEANUP
Copied: mpich2/trunk/src/pmi/slurm/configure.ac (from rev 9546, mpich2/trunk/src/pmi/slurm/configure.in)
===================================================================
--- mpich2/trunk/src/pmi/slurm/configure.ac (rev 0)
+++ mpich2/trunk/src/pmi/slurm/configure.ac 2012-02-28 23:26:34 UTC (rev 9548)
@@ -0,0 +1,32 @@
+AC_INIT()
+
+dnl Definitions will be placed in this file rather than in the DEFS variable
+AC_CONFIG_HEADER(pmiconf.h)
+AH_TOP([/* -*- Mode: C; c-basic-offset:4 ; -*- */
+/*
+ * (C) 2008 by Argonne National Laboratory.
+ * See COPYRIGHT in top-level directory.
+ */
+#ifndef PMICONF_H_INCLUDED
+#define PMICONF_H_INCLUDED
+])
+AH_BOTTOM([#endif])
+
+echo "RUNNING CONFIGURE FOR THE SLURM PMI"
+
+PAC_ARG_CACHING
+PAC_VPATH_CHECK()
+PAC_LOAD_BASE_CACHE
+PAC_PROG_MAKE
+
+AC_ARG_WITH(slurm, AS_HELP_STRING([--with-slurm], [path to the slurm package]))
+AC_CHECK_HEADER([slurm/pmi.h], [], [AC_MSG_ERROR([could not find slurm/pmi.h. Configure aborted])])
+AC_CHECK_LIB([pmi], [PMI_Init], [PAC_APPEND_FLAG([-lpmi], [WRAPPER_LIBS])],
+ AC_MSG_ERROR([could not find libpmi. Configure aborted]))
+
+AC_SUBST(WRAPPER_CFLAGS)
+AC_SUBST(WRAPPER_LDFLAGS)
+AC_SUBST(WRAPPER_LIBS)
+
+AC_OUTPUT(localdefs)
+AC_OUTPUT(Makefile)
Deleted: mpich2/trunk/src/pmi/slurm/configure.in
===================================================================
--- mpich2/trunk/src/pmi/slurm/configure.in 2012-02-28 23:25:23 UTC (rev 9547)
+++ mpich2/trunk/src/pmi/slurm/configure.in 2012-02-28 23:26:34 UTC (rev 9548)
@@ -1,32 +0,0 @@
-AC_INIT()
-
-dnl Definitions will be placed in this file rather than in the DEFS variable
-AC_CONFIG_HEADER(pmiconf.h)
-AH_TOP([/* -*- Mode: C; c-basic-offset:4 ; -*- */
-/*
- * (C) 2008 by Argonne National Laboratory.
- * See COPYRIGHT in top-level directory.
- */
-#ifndef PMICONF_H_INCLUDED
-#define PMICONF_H_INCLUDED
-])
-AH_BOTTOM([#endif])
-
-echo "RUNNING CONFIGURE FOR THE SLURM PMI"
-
-PAC_ARG_CACHING
-PAC_VPATH_CHECK()
-PAC_LOAD_BASE_CACHE
-PAC_PROG_MAKE
-
-AC_ARG_WITH(slurm, AS_HELP_STRING([--with-slurm], [path to the slurm package]))
-AC_CHECK_HEADER([slurm/pmi.h], [], [AC_MSG_ERROR([could not find slurm/pmi.h. Configure aborted])])
-AC_CHECK_LIB([pmi], [PMI_Init], [PAC_APPEND_FLAG([-lpmi], [WRAPPER_LIBS])],
- AC_MSG_ERROR([could not find libpmi. Configure aborted]))
-
-AC_SUBST(WRAPPER_CFLAGS)
-AC_SUBST(WRAPPER_LDFLAGS)
-AC_SUBST(WRAPPER_LIBS)
-
-AC_OUTPUT(localdefs)
-AC_OUTPUT(Makefile)
Copied: mpich2/trunk/src/util/logging/rlog/configure.ac (from rev 9546, mpich2/trunk/src/util/logging/rlog/configure.in)
===================================================================
--- mpich2/trunk/src/util/logging/rlog/configure.ac (rev 0)
+++ mpich2/trunk/src/util/logging/rlog/configure.ac 2012-02-28 23:26:34 UTC (rev 9548)
@@ -0,0 +1,147 @@
+dnl Process this file with autoconf to produce a configure script.
+dnl
+dnl The file name here refers to a file in the source being configured
+AC_INIT(rlog.c)
+
+dnl Definitions will be placed in this file rather than in the DEFS variable
+AC_CONFIG_HEADER(rlogconf.h)
+AH_TOP([/* -*- Mode: C; c-basic-offset:4 ; -*- */
+/*
+ * (C) 2001 by Argonne National Laboratory.
+ * See COPYRIGHT in top-level directory.
+ */
+#ifndef FORKERCONF_H_INCLUDED
+#define FORKERCONF_H_INCLUDED
+])
+AH_BOTTOM([#endif])
+dnl
+AC_CONFIG_AUX_DIR(../../../../confdb)
+dnl
+echo "RUNNING CONFIGURE FOR RLOG"
+dnl
+dnl
+dnl Enable better caching control
+PAC_ARG_CACHING
+dnl
+AC_ARG_ENABLE(echo,
+[--enable-echo - Turn on strong echoing. The default is enable=no.] ,set -x)
+
+AC_ARG_ENABLE(sharedlibs,
+[--enable-sharedlibs=kind - Enable shared libraries. kind may be
+ gnu - Standard gcc and GNU ld options for creating shared libraries
+ libtool - GNU libtool
+This option is currently ignored])
+
+dnl First check that we have a clean build if we are doing a VPATH build
+PAC_VPATH_CHECK()
+
+dnl This test is complicated by the fact that top_srcdir is not set until
+dnl the very end of configure. Instead, we get it ourselves
+if test -z "$top_srcdir" ; then
+ use_top_srcdir=$srcdir
+else
+ use_top_srcdir=$top_srcdir
+fi
+if test -z "$master_top_srcdir" ; then
+ master_top_srcdir=$use_top_srcdir
+fi
+AC_SUBST(master_top_srcdir)
+export master_top_srcdir
+#
+# Get the master builddir (which may be imported from above)
+if test -z "$master_top_builddir" ; then
+ master_top_builddir=`pwd`
+fi
+export master_top_builddir
+AC_SUBST(master_top_builddir)
+
+dnl Find a C compiler
+PAC_PROG_CC
+AC_PATH_PROG(AR,ar)
+AC_SUBST(AR_FLAGS)
+# Note that we set RANLIB to true if we don't find it (some systems neither
+# need it nor provide it)
+AC_CHECK_PROGS(RANLIB,ranlib,true)
+dnl
+dnl AC_PROG_MAKE_SET
+AC_PROG_INSTALL
+PAC_PROG_CHECK_INSTALL_WORKS
+dnl On Mac OS/X, install breaks libraries unless used with the -p switch
+PAC_PROG_INSTALL_BREAKS_LIBS
+dnl We also need mkdir -p.
+PAC_PROG_MKDIR_P
+PAC_PROG_MAKE
+dnl
+AC_PATH_PROG(PERL,perl)
+dnl check for compiler characteristics
+dnl PAC_PROG_C_WEAK_SYMBOLS
+AC_C_CONST
+AC_C_VOLATILE
+AC_C_RESTRICT
+AC_C_INLINE
+dnl PAC_C_STRUCT_ALIGNMENT
+dnl
+dnl Look for Standard headers
+AC_HEADER_STDC
+AC_CHECK_HEADERS(unistd.h)
+dnl
+MPILIBNAME=${MPILIBNAME:-"mpich"}
+AC_SUBST(MPILIBNAME)
+PMPILIBNAME=${PMPILIBNAME:-"p$MPILIBNAME"}
+AC_SUBST(PMPILIBNAME)
+
+dnl
+dnl How do I get configure to find these values for me?
+dnl use AC_PATH_PROG to find a likely location, then search likely
+dnl directory paths for the files that you need. Allow an environment
+dnl variable to provide the values, so that if they are in a strange
+dnl place, the user can set the environment variable and configure will
+dnl use that value (it should still check that the value is valid, i.e.,
+dnl the necessary files are in the specified directory)
+dnl
+dnl AC_CHECK_HEADER(jni.h)
+dnl if test "$ac_cv_header_jni_h" != "yes" ; then
+dnl # Try to find the java include path. For now, just generate warning
+dnl # At ANL, places to look include /soft/com/packages/j2sdk1.4.0/include
+dnl # and /soft/com/packages/jdk-1.3.1/include (and /soft/com/jdk*)
+dnl # May also want to look in $JAVA_HOME/include
+dnl AC_MSG_WARN([cannot compile trace code])
+dnl fi
+dnl java_home=/soft/com/packages/j2sdk1.4.0
+dnl java_arch=linux
+dnl AC_SUBST(java_home)
+dnl AC_SUBST(java_arch)
+dnl
+dnl 09/28/2010, chan, the above checks are not enough to build
+dnl libTraceInput.so for rlog. The work is currently being done
+dnl mpe2/src/slog2sdk/trace_rlog.
+
+if test -z "$ENABLE_SHLIB" ; then
+ CC_SHL="$CC"
+ ENABLE_SHLIB=none
+fi
+PAC_CC_SUBDIR_SHLIBS
+dnl
+dnl Dependency handling
+AC_SUBST(MAKE_DEPEND_C)
+
+dnl AC_SEARCH_LIBS(socket, socket)
+dnl AC_CHECK_LIB(thread, mutex_init)
+dnl AC_CHECK_HEADERS(foo.h bar.h)
+dnl AC_CHECK_FUNCS(baz biff)
+
+dnl
+dnl Etags
+AC_SUBST(ETAGS)
+AC_SUBST(ETAGSADD)
+export ETAGS
+export ETAGSADD
+dnl
+dnl
+dnl
+dnl Other autoconf variables that may be imported from the calling environment
+AC_SUBST(DOCTEXT)
+
+dnl Generate the Makefiles from Makefile.in
+AC_OUTPUT_COMMANDS([chmod a+x pprintirlog])
+AC_OUTPUT(Makefile pprintirlog)
Deleted: mpich2/trunk/src/util/logging/rlog/configure.in
===================================================================
--- mpich2/trunk/src/util/logging/rlog/configure.in 2012-02-28 23:25:23 UTC (rev 9547)
+++ mpich2/trunk/src/util/logging/rlog/configure.in 2012-02-28 23:26:34 UTC (rev 9548)
@@ -1,147 +0,0 @@
-dnl Process this file with autoconf to produce a configure script.
-dnl
-dnl The file name here refers to a file in the source being configured
-AC_INIT(rlog.c)
-
-dnl Definitions will be placed in this file rather than in the DEFS variable
-AC_CONFIG_HEADER(rlogconf.h)
-AH_TOP([/* -*- Mode: C; c-basic-offset:4 ; -*- */
-/*
- * (C) 2001 by Argonne National Laboratory.
- * See COPYRIGHT in top-level directory.
- */
-#ifndef FORKERCONF_H_INCLUDED
-#define FORKERCONF_H_INCLUDED
-])
-AH_BOTTOM([#endif])
-dnl
-AC_CONFIG_AUX_DIR(../../../../confdb)
-dnl
-echo "RUNNING CONFIGURE FOR RLOG"
-dnl
-dnl
-dnl Enable better caching control
-PAC_ARG_CACHING
-dnl
-AC_ARG_ENABLE(echo,
-[--enable-echo - Turn on strong echoing. The default is enable=no.] ,set -x)
-
-AC_ARG_ENABLE(sharedlibs,
-[--enable-sharedlibs=kind - Enable shared libraries. kind may be
- gnu - Standard gcc and GNU ld options for creating shared libraries
- libtool - GNU libtool
-This option is currently ignored])
-
-dnl First check that we have a clean build if we are doing a VPATH build
-PAC_VPATH_CHECK()
-
-dnl This test is complicated by the fact that top_srcdir is not set until
-dnl the very end of configure. Instead, we get it ourselves
-if test -z "$top_srcdir" ; then
- use_top_srcdir=$srcdir
-else
- use_top_srcdir=$top_srcdir
-fi
-if test -z "$master_top_srcdir" ; then
- master_top_srcdir=$use_top_srcdir
-fi
-AC_SUBST(master_top_srcdir)
-export master_top_srcdir
-#
-# Get the master builddir (which may be imported from above)
-if test -z "$master_top_builddir" ; then
- master_top_builddir=`pwd`
-fi
-export master_top_builddir
-AC_SUBST(master_top_builddir)
-
-dnl Find a C compiler
-PAC_PROG_CC
-AC_PATH_PROG(AR,ar)
-AC_SUBST(AR_FLAGS)
-# Note that we set RANLIB to true if we don't find it (some systems neither
-# need it nor provide it)
-AC_CHECK_PROGS(RANLIB,ranlib,true)
-dnl
-dnl AC_PROG_MAKE_SET
-AC_PROG_INSTALL
-PAC_PROG_CHECK_INSTALL_WORKS
-dnl On Mac OS/X, install breaks libraries unless used with the -p switch
-PAC_PROG_INSTALL_BREAKS_LIBS
-dnl We also need mkdir -p.
-PAC_PROG_MKDIR_P
-PAC_PROG_MAKE
-dnl
-AC_PATH_PROG(PERL,perl)
-dnl check for compiler characteristics
-dnl PAC_PROG_C_WEAK_SYMBOLS
-AC_C_CONST
-AC_C_VOLATILE
-AC_C_RESTRICT
-AC_C_INLINE
-dnl PAC_C_STRUCT_ALIGNMENT
-dnl
-dnl Look for Standard headers
-AC_HEADER_STDC
-AC_CHECK_HEADERS(unistd.h)
-dnl
-MPILIBNAME=${MPILIBNAME:-"mpich"}
-AC_SUBST(MPILIBNAME)
-PMPILIBNAME=${PMPILIBNAME:-"p$MPILIBNAME"}
-AC_SUBST(PMPILIBNAME)
-
-dnl
-dnl How do I get configure to find these values for me?
-dnl use AC_PATH_PROG to find a likely location, then search likely
-dnl directory paths for the files that you need. Allow an environment
-dnl variable to provide the values, so that if they are in a strange
-dnl place, the user can set the environment variable and configure will
-dnl use that value (it should still check that the value is valid, i.e.,
-dnl the necessary files are in the specified directory)
-dnl
-dnl AC_CHECK_HEADER(jni.h)
-dnl if test "$ac_cv_header_jni_h" != "yes" ; then
-dnl # Try to find the java include path. For now, just generate warning
-dnl # At ANL, places to look include /soft/com/packages/j2sdk1.4.0/include
-dnl # and /soft/com/packages/jdk-1.3.1/include (and /soft/com/jdk*)
-dnl # May also want to look in $JAVA_HOME/include
-dnl AC_MSG_WARN([cannot compile trace code])
-dnl fi
-dnl java_home=/soft/com/packages/j2sdk1.4.0
-dnl java_arch=linux
-dnl AC_SUBST(java_home)
-dnl AC_SUBST(java_arch)
-dnl
-dnl 09/28/2010, chan, the above checks are not enough to build
-dnl libTraceInput.so for rlog. The work is currently being done
-dnl mpe2/src/slog2sdk/trace_rlog.
-
-if test -z "$ENABLE_SHLIB" ; then
- CC_SHL="$CC"
- ENABLE_SHLIB=none
-fi
-PAC_CC_SUBDIR_SHLIBS
-dnl
-dnl Dependency handling
-AC_SUBST(MAKE_DEPEND_C)
-
-dnl AC_SEARCH_LIBS(socket, socket)
-dnl AC_CHECK_LIB(thread, mutex_init)
-dnl AC_CHECK_HEADERS(foo.h bar.h)
-dnl AC_CHECK_FUNCS(baz biff)
-
-dnl
-dnl Etags
-AC_SUBST(ETAGS)
-AC_SUBST(ETAGSADD)
-export ETAGS
-export ETAGSADD
-dnl
-dnl
-dnl
-dnl Other autoconf variables that may be imported from the calling environment
-AC_SUBST(DOCTEXT)
-
-dnl Generate the Makefiles from Makefile.in
-AC_OUTPUT_COMMANDS([chmod a+x pprintirlog])
-AC_OUTPUT(Makefile pprintirlog)
Modified: mpich2/trunk/test/mpi/Makefile.am
===================================================================
--- mpich2/trunk/test/mpi/Makefile.am 2012-02-28 23:25:23 UTC (rev 9547)
+++ mpich2/trunk/test/mpi/Makefile.am 2012-02-28 23:26:34 UTC (rev 9548)
@@ -41,7 +41,7 @@
## svn export https://svn.mcs.anl.gov/repos/mpi/mpich2/trunk/confdb confdb
## cd .tmp/mpi2test && \
## sed -e 's/AC_CONFIG_AUX_DIR.*/AC_CONFIG_AUX_DIR(confdb)/' \
-## configure.in > conftmp.in && mv conftmp.in configure.in
+## configure.ac > conftmp.in && mv conftmp.in configure.ac
## cd .tmp/mpi2test && maint/updatefiles -mpich2dir=@mpich2_top_srcdir@
## cd .tmp/mpi2test && @mpich2_top_srcdir@/maint/simplemake Makefile.sm
## cd .tmp && tar cf mpi2test.tar mpi2test && gzip -9 mpi2test.tar
Copied: mpich2/trunk/test/mpi/configure.ac (from rev 9546, mpich2/trunk/test/mpi/configure.in)
===================================================================
--- mpich2/trunk/test/mpi/configure.ac (rev 0)
+++ mpich2/trunk/test/mpi/configure.ac 2012-02-28 23:26:34 UTC (rev 9548)
@@ -0,0 +1,1187 @@
+dnl Process this file with autoconf to produce a configure script.
+AC_PREREQ(2.59)
+dnl
+dnl aclocal_cache.m4, included by sowing/confdb/aclocal.m4, fixes
+dnl bugs in autoconf caching.
+dnl
+dnl
+dnl Environment variables that affect behavior of the test configure
+dnl MPICH_FAST
+dnl
+dnl The file name here refers to a file in the source being configured
+dnl FIXME this is the old style, needs updating to new style
+dnl AC_INIT(include/mpitest.h)
+dnl FIXME duplication with VERSION variable below
+AC_INIT([mpich2-testsuite],[1.2])
+AC_CONFIG_HEADER(include/mpitestconf.h)
+AH_TOP([/* -*- Mode: C; c-basic-offset:4 ; -*- */
+/*
+ * (C) 2001 by Argonne National Laboratory.
+ * See COPYRIGHT in top-level directory.
+ */
+#ifndef MPITESTCONF_H_INCLUDED
+#define MPITESTCONF_H_INCLUDED
+])
+AH_BOTTOM([#endif])
+# This version is the version of the test suite.
+# 1.0: Initial version (all versions) before independent release
+# 1.1: Initial version that is independent of MPICH2 11/08
+# 1.2: Automake replaces simplemake
+VERSION=1.2
+AC_SUBST(VERSION)
+dnl
+dnl XXX DJG Dries thinks that I want MACRO_DIR instead
+dnl AC_CONFIG_AUX_DIR(../../confdb)
+AC_CONFIG_AUX_DIR([../../confdb])
+AC_CONFIG_MACRO_DIR([../../confdb])
+dnl
+echo "RUNNING CONFIGURE FOR MPI TESTS"
+
+AM_INIT_AUTOMAKE([-Wall -Werror foreign 1.11 silent-rules subdir-objects])
+AM_MAINTAINER_MODE([enable])
+# not using libtool for the test suite, so no LT_INIT
+AC_PROG_RANLIB
+
+# Non-verbose make by default
+m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
+
+# XXX DJG FIXME is this needed still?
+# mpich2_top_srcdir is used only to build the distribution target (dist)
+if test -z "$mpich2_top_srcdir" ; then
+ if test -z "$top_srcdir" ; then
+ use_top_srcdir=$srcdir
+ else
+ use_top_srcdir=$top_srcdir
+ fi
+ case "$use_top_srcdir" in
+ /*) ;;
+ *)
+ use_top_srcdir=`(cd $use_top_srcdir && pwd)`
+ ;;
+ esac
+ if test -x $use_top_srcdir/../../maint/simplemake ; then
+ mpich2_top_srcdir=`cd $use_top_srcdir && cd ../.. && pwd`
+ fi
+fi
+AC_SUBST(mpich2_top_srcdir)
+
+# these (in particular master_top_srcdir) are needed to regenerate
+# Makefile.in files after Makfile.sm files change
+AC_ARG_VAR([master_top_builddir],[path to the MPICH2 top-level build directory (if present)])
+AC_ARG_VAR([master_top_srcdir],[path to the MPICH2 top-level source directory (if present)])
+
+AC_ARG_ENABLE(echo,
+[--enable-echo - Turn on strong echoing. The default is enable=no.] ,set -x)
+otherlangs=""
+AC_ARG_ENABLE(f77,
+[--enable-f77 - Turn on Fortran 77 tests (default)],,enable_f77=yes)
+dnl
+AC_ARG_ENABLE(fc,
+[--enable-fc - Turn on Fortran 90 tests (if f90 available)],,enable_fc=yes)
+AC_ARG_ENABLE(cxx,
+[--enable-cxx - Turn on C++ tests (default)],,enable_cxx=yes)
+AC_ARG_ENABLE(romio,
+[--enable-romio - Enable ROMIO MPI I/O implementation],
+,enable_romio=yes)
+AC_ARG_ENABLE(spawn,
+[--enable-spawn - Enable tests of the dynamic process parts of MPI-2 (default)],
+,enable_spawn=yes)
+AC_ARG_ENABLE(checkerrors,
+[--enable-checkerrors - Add some tests for checking for errors in user programs],,enable_checkerrors=default)
+AC_ARG_ENABLE(checkfaults,
+[--enable-checkfaults - Add some tests for checking on handling of faults in user programs],,enable_checkfaults=no)
+AC_ARG_ENABLE(fast,
+[--enable-fast - Indicates that the MPI implementation may have been built for fastest operation, such as building without error checking. Has the effect of --enable-checkerrors=no])
+AC_ARG_ENABLE(strictmpi,
+[--enable-strictmpi - Only test for operations specifically defined by the MPI standard. This turns off tests for some common extensions, including for combinations of predefined datatypes and predefined MPI_Op s.],,enable_strictmpi=no)
+
+AC_ARG_ENABLE(threads,
+[--enable-threads=level - Specify the level of thread support expected from the
+MPI implementation. The following levels are supported.
+ single - No threads (MPI_THREAD_SINGLE)
+ funneled - Only the main thread calls MPI (MPI_THREAD_FUNNELED)
+ serialized - User serializes calls to MPI (MPI_THREAD_SERIALIZED)
+ multiple - Fully multi-threaded (MPI_THREAD_MULTIPLE)
+The default is funneled. If enabled and no level is specified, the
+level is set to multiple. If disabled, the level is set to single.
+If the environment variable MPICH_THREAD_LEVEL is set, that thread
+level is used (this is to let MPICH2 build for the correct thread
+support without requiring a specific --enable-threads argument.
+],,
+enable_threads=default)
+
+AC_ARG_WITH(mpi,
+[--with-mpi=dir - Use the selected MPI; compilation scripts for mpicc, mpif77
+ and mpicxx should be in dir/bin],,)
+
+AC_ARG_WITH(config-args,
+[--with-config-args=filename - Specify configure argument file that
+ contains the values of variables that
+ configure reads,
+ e.g. CC,CFLAGS,F77,FFLAGS,FC,FCFLAGS....
+ If the filename does not begin with
+ / (absolute path), . or .. (relative path),
+ the filename will be assumed to be
+ $top_srcdir/configargs/<filename>.cfg.],,
+with_config_args=no)
+dnl
+if test "$with_config_args" != "no" ; then
+ case "$with_config_args" in
+ /*|../*|./*)
+ config_args_file="$with_config_args"
+ ;;
+ *)
+ config_args_file="$srcdir/configargs/$with_config_args.cfg"
+ ;;
+ esac
+ if test -s "$config_args_file" ; then
+ AC_MSG_RESULT([Reading the configure arguments in ${config_args_file}.])
+ . $config_args_file
+ # Export all the variables in $config_args_file
+ # i.e. CC,CFLAGS, F77/FFLAGS, FC/FCFLAGS, CXX/CXXFLAGS and friends...
+ config_args_vars=`grep -v '^#' $config_args_file | sed -e 's/=.*//g'`
+ for var in $config_args_vars ; do
+ eval value=\$"$var"
+ echo "Exporting $var=$value ..."
+ export $var
+ done
+ else
+ AC_MSG_WARN([Non-existent ${config_args_file}.])
+ fi
+fi
+
+#
+# First, determine whether we are/can support the language bindings
+#
+# Since F90/F90FLAGS are replaced by FC/FCFLAGS, rather than silently
+# substituting them, i.e. FC=$F90 and FCFLAGS=$F90FLAGS, we choose to emit
+# an error message and abort to avoid any ambiguous/hidden bug in choosing
+# Fortran90 compilers.
+if test -n "$F90" -o -n "$F90FLAGS" ; then
+ AC_MSG_ERROR([F90 and F90FLAGS are replaced by FC and FCFLAGS respectively in this configure, please unset F90/F90FLAGS and set FC/FCFLAGS instead and rerun configure again.])
+fi
+
+# ------------------------------------------------------------------------
+dnl use AC_ARG_VAR to mark FROM_MPICH2 as "precious" to autoconf so that
+dnl automatic re-runs of config.status preserve its value correctly
+AC_ARG_VAR([FROM_MPICH2],[should be set to "yes" if this configure script is being invoked by the main MPICH2 configure])
+AC_ARG_VAR([MPICH_THREAD_LEVEL],
+ [the MPI thread level supported by the enclosing MPICH2 build (when built within MPICH2)])
+# ------------------------------------------------------------------------
+
+if test "$enable_threads" = "yes" ; then
+ enable_threads=multiple
+elif test "$enable_threads" = "no" ; then
+ enable_threads=single
+elif test "$enable_threads" = default ; then
+ if test -n "$MPICH_THREAD_LEVEL" ; then
+ case $MPICH_THREAD_LEVEL in
+ MPI_THREAD_MULTIPLE)
+ enable_threads=multiple
+ ;;
+ MPI_THREAD_SERIALIZED)
+ enable_threads=serialized
+ ;;
+ MPI_THREAD_FUNNELED)
+ enable_threads=funneled
+ ;;
+ MPI_THREAD_SINGLE)
+ enable_threads=single
+ ;;
+ esac
+ else
+ enable_threads=funneled
+ fi
+fi
+
+if test "$enable_fast" = "yes" ; then
+ if test "$enable_checkerrors" = "default" ; then
+ enable_checkerrors=no
+ fi
+fi
+# default for MPICH2 is to check error handling; for other cases it
+# is to only check correct programs.
+if test "$FROM_MPICH2" = "yes" ; then
+ if test "$enable_checkerrors" = "default" -a "$MPICH_FAST" != "YES" ; then
+ enable_checkerrors=yes
+ else
+ enable_checkerrors=no
+ fi
+else
+ if test "$enable_checkerrors" = "default" ; then
+ enable_checkerrors=no
+ fi
+fi
+# errordir is substituted into the testlist file as errors when the
+# tests should check error handling and as a comment (#) otherwise.
+errordir="#"
+if test "$enable_checkerrors" = "yes" ; then
+ errordir=errors
+fi
+AC_SUBST(errordir)
+#
+# Only run the threads tests if multiple is specified
+if test "$enable_threads" = "multiple" -o "$enable_threads" = "runtime" ; then
+ threadsdir="threads"
+fi
+
+PAC_LOAD_BASE_CACHE
+PAC_VPATH_CHECK()
+PAC_PROG_MAKE
+
+MPILIBLOC=""
+AC_SUBST(MPILIBLOC)
+
+# more variables that must be marked precious for proper re-configure operation
+AC_ARG_VAR([MPICH2_ENABLE_F77],["yes" if the enclosing MPICH2 build supports Fortran 77])
+AC_ARG_VAR([MPICH2_ENABLE_FC],["yes" if the enclosing MPICH2 build supports modern Fortran])
+AC_ARG_VAR([MPICH2_ENABLE_CXX],["yes" if the enclosing MPICH2 build supports C++])
+
+# If we're building from MPICH2, check the MPICH2_ENABLE_xxx environment
+# variables for enable defaults
+if test "$FROM_MPICH2" = yes ; then
+ if test -n "$MPICH2_ENABLE_F77" ; then
+ enable_f77=$MPICH2_ENABLE_F77
+ fi
+ if test -n "$MPICH2_ENABLE_FC" ; then
+ enable_fc=$MPICH2_ENABLE_FC
+ fi
+ if test -n "$MPICH2_ENABLE_CXX" ; then
+ enable_cxx=$MPICH2_ENABLE_CXX
+ fi
+fi
+
+#
+# Some MPI-2 implementations (including some of the MPICH2 shared-memory
+# channels and BG/L) leave out the dynamic process routines. This
+# allows tests to avoid reporting failure for these routines.
+# This can be controlled by either a --disable-spawn argument or by
+# setting the environment variable MPI_NO_SPAWN to yes.
+AC_ARG_VAR([MPI_NO_SPAWN],[set to "yes" to disable dynamic process tests])
+spawndir=spawn
+if test "$enable_spawn" != yes ; then
+ spawndir="#"
+elif test "$MPI_NO_SPAWN" = yes ; then
+ spawndir="#"
+fi
+#echo "MPI_NO_SPAWN = $MPI_NO_SPAWN"
+AC_SUBST(spawndir)
+
+# Also allow rma to be disabled
+AC_ARG_VAR([MPI_NO_RMA],[set to "yes" to disable one-sided tests])
+rmadir=rma
+if test "$MPI_NO_RMA" = yes ; then
+ rmadir="#"
+else
+ AC_DEFINE(HAVE_MPI_WIN_CREATE,1,[Define if MPI_Win_create is available])
+fi
+AC_SUBST(rmadir)
+
+faultsdir=#
+if test "$enable_checkfaults" = "yes" ; then
+ faultsdir=faults
+fi
+AC_SUBST(faultsdir)
+#
+if test "$enable_strictmpi" = "yes" ; then
+ AC_DEFINE(USE_STRICT_MPI,1,[Define if only operations defined in MPI should be tested])
+fi
+
+# preserve these values across a reconfigure
+AC_ARG_VAR([WRAPPER_CFLAGS],[])
+AC_ARG_VAR([WRAPPER_CPPFLAGS],[])
+AC_ARG_VAR([WRAPPER_LDFLAGS],[])
+AC_ARG_VAR([WRAPPER_LIBS],[])
+AC_ARG_VAR([WRAPPER_FFLAGS],[])
+AC_ARG_VAR([WRAPPER_FCFLAGS],[])
+AC_ARG_VAR([WRAPPER_CXXFLAGS],[])
+
+if test "$FROM_MPICH2" = "yes" ; then
+ # perform configure tests with the normal compilers ($CC/$F77/etc), but use
+ # the WRAPPER_xFLAGS computed by MPICH2 as our flags instead. Then at the
+ # end of configure we will empty out these flags and set our compilers to
+ # the installed compiler wrappers
+ CFLAGS="$WRAPPER_CFLAGS"
+ CPPFLAGS="$WRAPPER_CPPFLAGS"
+ LDFLAGS="$WRAPPER_LDFLAGS"
+ FFLAGS="$WRAPPER_FFLAGS"
+ FCFLAGS="$WRAPPER_FCFLAGS"
+ CXXFLAGS="$WRAPPER_CXXFLAGS"
+
+ # WRAPPER_LIBS contains currently non-existent libs like "-lopa" and "-lmpl"
+ # right now, so set LIBS to the user-specified libs for now.
+ # FIXME Does this need to be an AC_ARG_VAR?
+ LIBS="$MPICH2_LIBS"
+
+elif test -n "$with_mpi" ; then
+ if test -z "$MPICC" ; then
+ CC=$with_mpi/bin/mpicc
+ else
+ CC=$MPICC
+ fi
+ if test -z "$MPIF77" ; then
+ F77=$with_mpi/bin/mpif77
+ else
+ F77=$MPIF77
+ fi
+ if test -z "$MPIFC" ; then
+ FC=$with_mpi/bin/mpif90
+ else
+ FC=$MPIFC
+ fi
+ if test -z "$MPICXX" ; then
+ CXX=$with_mpi/bin/mpicxx
+ else
+ CXX=$MPICXX
+ fi
+ if test -z "$MPIEXEC" ; then
+ MPIEXEC=$with_mpi/bin/mpiexec
+ fi
+fi
+
+# Running C compiler tests
+PAC_PROG_CC
+
+# Note that some versions of autoconf will insist that the compiler
+# produce executables at this point, which is why we must do something
+# special for building within MPICH2
+dnl We cannot use AC_C_LONG_DOUBLE
+dnl because it does not support cross-compilation. Instead, we use the
+dnl same test in the MPICH2 configure.
+# Check on support for long double and long long types. Do this before the
+# structure alignment test because it will test for including those
+# types as well
+AC_CACHE_CHECK([whether long double is supported],pac_cv_have_long_double,[
+ AC_COMPILE_IFELSE([
+ AC_LANG_PROGRAM([],[long double a;])
+ ],[pac_cv_have_long_double=yes],[pac_cv_have_long_double=no])
+])
+if test "$pac_cv_have_long_double" = "yes" ; then
+ AC_DEFINE(HAVE_LONG_DOUBLE,1,[Define if long double is supported])
+fi
+AC_CACHE_CHECK([whether long long is supported],pac_cv_have_long_long,[
+ AC_COMPILE_IFELSE([
+ AC_LANG_PROGRAM([],[long long a;])
+ ],[pac_cv_have_long_long=yes],[pac_cv_have_long_long=no])
+])
+if test "$pac_cv_have_long_long" = yes ; then
+ AC_DEFINE(HAVE_LONG_LONG,1,[Define if compiler supports long long])
+fi
+#
+# Check for const and restrict (used in some of the performance tests)
+AC_C_CONST
+AC_C_RESTRICT
+
+# Enable STRICT CFLAGS
+AC_ARG_ENABLE(stricttest,
+AC_HELP_STRING([--enable-stricttest], [Turn on strict GCC compilation]))
+dnl Initialize enable_strict_done so PAC_CC_STRICT won't exit right away
+dnl When it is configuring from within MPICH2, because enable_strict_done=yes
+dnl is set in the environment by MPICH2.
+enable_strict_done=no
+PAC_CC_STRICT($enable_stricttest)
+# -Wfloat-equal isn't meaningful in testsuite,
+# remove it if it is in strict flags.
+pac_cc_strict_flags="`echo $pac_cc_strict_flags | sed -e 's|-Wfloat-equal||g'`"
+CFLAGS="$CFLAGS $pac_cc_strict_flags"
+
+# General headers
+AC_HEADER_STDC
+dnl AC_CHECK_HEADERS(stdarg.h unistd.h string.h stdlib.h memory.h stdint.h)
+dnl unistd.h string.h stdlib.h memory.h stdint.h are checked by AC_PROG_CC.
+AC_CHECK_HEADERS(stdarg.h sys/time.h)
+
+# Check for fixed width types
+AC_TYPE_INT8_T
+AC_TYPE_INT16_T
+AC_TYPE_INT32_T
+AC_TYPE_INT64_T
+AC_TYPE_UINT8_T
+AC_TYPE_UINT16_T
+AC_TYPE_UINT32_T
+AC_TYPE_UINT64_T
+
+# Check for availability of C99 types
+AC_CHECK_TYPES([_Bool, float _Complex, double _Complex, long double _Complex])
+
+# Headers needed for threads tests
+if test "$threadsdir" = "threads" ; then
+ # Check for needed threads headers and needed and optional routines
+ AC_CHECK_HEADERS(pthread.h)
+
+ # we shouldn't actually need to do this, but we are dodging the chicken/egg
+ # problem b/c we don't have a working mpicc yet and we temporarily discarded
+ # the MPICH2-set LIBS (probably the wrong thing to do)
+ AC_SEARCH_LIBS([pthread_create],[pthread])
+ AC_SEARCH_LIBS([pthread_barrier_init],[pthread])
+
+ AC_CHECK_FUNCS(pthread_create pthread_yield pthread_barrier_init pthread_barrier_wait)
+ if test "$FROM_MPICH2" != yes ; then
+ AC_CHECK_FUNCS(MPI_Init_thread)
+ fi
+fi
+
+# Check for h_addr or h_addr_list. This is needed for the singjoin test
+# in manual/singjoin.c
+AC_CACHE_CHECK([whether struct hostent contains h_addr_list],
+dnl Use Double quote LANG_PROGRAM
+dnl so [] in h_addr_list[0] won't be ignored by IFELSE.
+pac_cv_have_haddr_list,[
+AC_COMPILE_IFELSE([
+ AC_LANG_PROGRAM([#include <netdb.h>],[[
+ struct hostent hp;
+ hp.h_addr_list[0]=0;
+ ]])
+],[pac_cv_have_haddr_list=yes],[pac_cv_have_haddr_list=no])
+])
+if test "$pac_cv_have_haddr_list" = "yes" ; then
+ AC_DEFINE(HAVE_H_ADDR_LIST,1,[Define if struct hostent contains h_addr_list])
+fi
+
+# Check for the MPI Version. This test assumes at least MPI 2.0. For
+# some tests, we need to know if we are MPI 2.1 or MPI 2.2,
+# particularly for new routines in Fortran
+AC_CACHE_CHECK([for major version of MPI],pac_cv_mpi_major_version,[
+for pac_cv_mpi_major_version in 3 2 1 unknown ; do
+ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([#include "mpi.h"],[
+#if MPI_VERSION == $pac_cv_mpi_major_version
+ ''' force failure '''
+#endif])],,break)
+done
+])
+
+AC_CACHE_CHECK([for minor version of MPI],pac_cv_mpi_minor_version,[
+for pac_cv_mpi_minor_version in 4 3 2 1 0 unknown ; do
+ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([#include "mpi.h"],[
+#if MPI_SUBVERSION == $pac_cv_mpi_minor_version
+ ''' force failure '''
+#endif])],,break)
+done
+])
+MPI_VERSION=$pac_cv_mpi_major_version
+MPI_SUBVERSION=$pac_cv_mpi_minor_version
+AC_SUBST(MPI_VERSION)
+AC_SUBST(MPI_SUBVERSION)
+
+# Running Fortran 77 compiler tests
+PAC_PROG_F77
+if test "$enable_f77" = yes ; then
+ # If there is no working F77, then set enable_f77 to no
+ if test -z "$F77" ; then
+ enable_f77=no
+ fi
+fi
+# Simple tests for which other languages we can handle.
+# Use these only when configuring separate from an MPICH2 build
+f77dir="#"
+AC_SUBST(f77dir)
+buildingF77=no
+if test "$FROM_MPICH2" = yes ; then
+ if test "$enable_f77" = yes ; then
+ # Assume success
+ otherlangs="$otherlangs f77"
+ f77dir=f77
+ buildingF77=yes
+ fi
+elif test "$enable_f77" = yes ; then
+ AC_MSG_CHECKING([that we can build MPI programs with Fortran 77])
+ AC_LANG_PUSH([Fortran 77])
+ AC_LINK_IFELSE([
+ AC_LANG_SOURCE([
+ program main
+ include 'mpif.h'
+ integer ierr
+ call mpi_init(ierr)
+ call mpi_finalize(ierr)
+ end
+ ])
+ ],[
+ AC_MSG_RESULT(yes)
+ otherlangs="$otherlangs f77"
+ f77dir=f77
+ buildingF77=yes
+ ],[
+ AC_MSG_RESULT(no)
+ ])
+ AC_LANG_POP([Fortran 77])
+fi
+#
+# At least one test (C++ test of C and Fortran datatypes) needs to
+# know if Fortran is supported
+if test "$f77dir" = "f77" ; then
+ AC_DEFINE(HAVE_FORTRAN_BINDING,1,[Define if Fortran is supported])
+fi
+
+AM_CONDITIONAL([BUILD_F77_TESTS],[test "X$f77dir" = "f77"])
+
+AC_ARG_VAR([MPI_SIZEOF_AINT],[if set, force MPI_Aint to a width of this many bytes])
+AC_ARG_VAR([MPI_SIZEOF_OFFSET],[if set, force MPI_Offset to a width of this many bytes])
+
+# Common tests for F77
+if test "$buildingF77" = "yes" ; then
+ # Match integer types to the MPI types for MPI_Aint and MPI_Offset
+
+ # FIXME: Add a test to see if the environment is importing the
+ # necessary information.
+
+ # Get the sizes of the MPI types. We use the following:
+ # MPI_SIZEOF_OFFSET and MPI_SIZEOF_AINT
+ if test -z "$MPI_SIZEOF_AINT" ; then
+ # Aint should be an address-sized integer, the same as void*
+ # We use a test on the size of void * to avoid any complications
+ # in dealing with running programs containing MPI headers (e.g.,
+ # the IBM MPI changes the main entry point so that MPI
+ # programs cannot be run on the host node)
+ AC_CHECK_SIZEOF(void *)
+ MPI_SIZEOF_AINT=$ac_cv_sizeof_void_p
+ fi
+ if test -z "$MPI_SIZEOF_OFFSET" ; then
+ # We have to try and get the size of offset anyway, since
+ # it is not the same as void * (it depends on the available
+ # file systems). Since we want to avoid using the MPI linker,
+ # we could do the following:
+ # Use the mpi compiler to compile the file, using the mpi
+ # header but no MPI calls
+ # Use the regular C linker to link the program
+ # However, we do this only if the environment variable BASECC
+ # has been provided. Else we can try the following:
+ # use
+ # sed -n 's/typedef \(.*\) MPI_Offset *;/\1/p' mpi.h
+ # to extract the type corresponding to MPI_Offset and then
+ # just use that.
+dnl AC_CACHE_CHECK([the sizeof MPI_Offset],ac_cv_sizeof_MPI_Offset,[
+dnl ac_cv_sizeof_MPI_Offset=unknown
+dnl rm -f conftest*
+dnl cat >>conftest.c <<EOF
+dnl #include "mpi.h"
+dnl #include <stdio.h>
+dnl int main( int argc, char **argv )
+dnl {
+dnl MPI_Offset a;
+dnl FILE *f = fopen("conftestval", "w" );
+dnl if (! f) exit(1);
+dnl fprintf( f, "%ld\n", (long)sizeof(MPI_Offset) );
+dnl fclose(f);
+dnl return 0;
+dnl }
+dnl EOF
+dnl # FIXME. Check for BASECC
+dnl # Note: This assumes that CC has been set to the C compiler for
+dnl # MPI Programs, and that either any necessary include paths are
+dnl # already set or they are in CPPFLAGS (prefered) or CFLAGS.
+dnl if AC_TRY_EVAL(ac_link) && test -s conftest$ac_exeext ; then
+dnl if ./conftest$ac_exeext ; then
+dnl #success
+dnl ac_cv_sizeof_MPI_Offset=`cat conftestval`
+dnl else
+dnl # failure
+dnl AC_MSG_WARN([Unable to run the program to determine the size of MPI_Offset])
+dnl echo "configure: failed program was:" >&AC_FD_CC
+dnl cat conftest.c >&AC_FD_CC
+dnl fi
+dnl else
+dnl # failure
+dnl AC_MSG_WARN([Unable to build the program to determine the size of MPI_Offset])
+dnl echo "configure: failed program was:" >&AC_FD_CC
+dnl cat conftest.c >&AC_FD_CC
+dnl fi
+dnl rm -f conftest*
+dnl ])
+ AC_CHECK_SIZEOF([MPI_Offset],[],[#include "mpi.h"])
+ if test "$ac_cv_sizeof_MPI_Offset" = "unknown" \
+ -o "$ac_cv_sizeof_MPI_Offset" -eq 0 ; then
+ AC_MSG_WARN([Using 8 for the size of MPI_Offset])
+ MPI_SIZEOF_OFFSET=8
+ else
+ MPI_SIZEOF_OFFSET=$ac_cv_sizeof_MPI_Offset
+ fi
+ fi
+
+ AC_LANG_PUSH([Fortran 77])
+ AC_CACHE_CHECK([whether integer*4 is supported],pac_cv_fort_integer4,[
+ AC_COMPILE_IFELSE([AC_LANG_PROGRAM(,[ integer*4 i])],
+ pac_cv_fort_integer4=yes,
+ pac_cv_fort_integer4=no)])
+ AC_CACHE_CHECK([whether integer*8 is supported],pac_cv_fort_integer8,[
+ AC_COMPILE_IFELSE([AC_LANG_PROGRAM(,[ integer*8 i])],
+ pac_cv_fort_integer8=yes,
+ pac_cv_fort_integer8=no)])
+ AC_CACHE_CHECK([whether integer*16 is supported],pac_cv_fort_integer16,[
+ AC_COMPILE_IFELSE([AC_LANG_PROGRAM(,[ integer*16 i])],
+ pac_cv_fort_integer16=yes,
+ pac_cv_fort_integer16=no)])
+ AC_LANG_POP([Fortran 77])
+
+ # Determine Aint and Offset
+ for len in 4 8 16 ; do
+ eval testval=\$"pac_cv_fort_integer$len"
+ if test "$testval" = no ; then continue ; fi
+ testval=$len
+ if test $len = "$MPI_SIZEOF_AINT" ; then
+ F77_MPI_ADDRESS="integer*$len"
+ fi
+ if test $len = "$MPI_SIZEOF_OFFSET" ; then
+ F77_MPI_OFFSET="integer*$len"
+ fi
+ done
+ # At this point, we could create a test program that would confirm that
+ # the values in Fortran matched the values in C.
+ # Note that we must make this an MPI program because the compiler for
+ # MPI programs may require that the programs be run with mpiexec or
+ # something similar (this is true for the IBM MPI, for example).
+ rm -f f77/init/checksizes.c
+ # If it is a VPATH build, f77/init may not be there.
+ if test ! -d f77/init ; then
+ mkdir f77
+ mkdir f77/init
+ fi
+ cat > f77/init/checksizes.c <<EOF
+#include "mpi.h"
+#include <stdio.h>
+int main( int argc, char **argv )
+{
+ int fsizeof_aint = $MPI_SIZEOF_AINT;
+ int fsizeof_offset = $MPI_SIZEOF_OFFSET;
+ int err = 0, rc = 0;
+
+ MPI_Init( &argc, &argv );
+ if (sizeof(MPI_Aint) != fsizeof_aint) {
+ printf( "Sizeof MPI_Aint is %d but Fortran thinks it is %d\n",
+ (int)sizeof(MPI_Aint), fsizeof_aint );
+ err++;
+ }
+ if (sizeof(MPI_Offset) != fsizeof_offset) {
+ printf( "Sizeof MPI_Offset is %d but Fortran thinks it is %d\n",
+ (int)sizeof(MPI_Offset), fsizeof_offset );
+ err++;
+ }
+ MPI_Finalize( );
+ if (err > 0) rc = 1;
+ return rc;
+}
+EOF
+
+ # Check for name mapping so that we can do the handle conversion tests
+ # This test needs both the base c and fortran compilers
+ AC_LANG_FORTRAN77
+ PAC_PROG_F77_NAME_MANGLE
+
+ # Check whether we need -lU77 to get iargc and getarg, which
+ # are used for a few of the tests in spawn
+ # FIXME: if we can't figure out how to get iargc/getarg, then
+ # we should really turn off those spawn tests
+ AC_MSG_CHECKING([for Fortran libraries needed for getarg])
+ AC_LANG_CONFTEST([
+ AC_LANG_PROGRAM([],[
+ character*64 s
+ integer i
+ i = iargc()
+ call getarg(i,s)
+ ])
+ ])
+ AC_LINK_IFELSE([],[
+ pac_cv_getarg_needs_u77=no
+ ],[
+ pac_cv_getarg_needs_u77=unknown
+ ])
+ if test "$pac_cv_getarg_needs_u77" != "no" ; then
+ # Try again with -lU77
+ saveLIBS="$LIBS"
+ LIBS="$LIBS -lU77"
+ AC_LINK_IFELSE([],[
+ pac_cv_getarg_needs_u77=yes
+ ],[
+ pac_cv_getarg_needs_u77=unavailable
+ ])
+ LIBS="$saveLIBS"
+ if test "$pac_cv_getarg_needs_u77" = "yes" ; then
+ F77_GETARG_LIBS=-lU77
+ fi
+ fi
+ rm -f conftest$ac_exeext
+ if test -n "$F77_GETARG_LIBS" ; then
+ AC_MSG_RESULT($F77_GETARG_LIBS)
+ else
+ if test "$pac_cv_getarg_needs_u77" = "unavailable" ; then
+ AC_MSG_RESULT([getarg and/or iargc are not available. Some spawn tests will fail to link])
+ else
+ AC_MSG_RESULT([none needed])
+ fi
+ fi
+ AC_SUBST(F77_GETARG_LIBS)
+ # FIXME: Currently, we hope that FC accepts the same library
+ FC_GETARG_LIBS="$F77_GETARG_LIBS"
+ AC_SUBST(FC_GETARG_LIBS)
+
+ # ALLOCMEMF is set in f77/ext/testlist if we can try this
+ # Fortran extension
+ ALLOCMEMF=""
+ PAC_PROG_F77_CRAY_POINTER([
+ ALLOCMEMF="allocmemf 1"
+ FFLAGS="$FFLAGS $CRAYPTR_FFLAGS"
+ ])
+ AC_SUBST(ALLOCMEMF)
+ # See the f90 block of code for the Fortran 90 version of ALLOCMEMF,
+ # i.e. ALLOCMEMFC.
+
+fi
+# Set a default for the Fortran 77 version of MPI_Offset.
+if test -z "$F77_MPI_OFFSET" ; then
+ F77_MPI_OFFSET="integer*8"
+ AC_MSG_WARN([Selecting integer*8 as the Fortran type for MPI_Offset])
+fi
+AC_SUBST(F77_MPI_OFFSET)
+# FIXME: Find a way to get the correct value
+if test -z "$F77_MPI_ADDRESS" ; then
+ F77_MPI_ADDRESS="integer"
+ AC_MSG_WARN([Selecting integer as the Fortran type for MPI_Aint])
+fi
+AC_SUBST(F77_MPI_ADDRESS)
+
+# Running Fortran 90+ compiler tests
+PAC_PROG_FC
+if test "$enable_fc" = yes ; then
+ # Work around feature in autoconf that adds -g -O2 to FCFLAGS
+ saveFCFLAGS="$FCFLAGS"
+ FCFLAGS="$saveFCFLAGS"
+ # If there is no working FC, then set enable_fc to no
+ if test -z "$FC" ; then
+ enable_fc=no
+ fi
+fi
+f90dir="#"
+AC_SUBST(f90dir)
+# First, see if we have an f90 compiler. This uses code similar to that
+# in the MPICH2 top-level configure
+if test "$enable_fc" = yes -a "$enable_f77" = yes ; then
+ PAC_PROG_FC_WORKS
+ if test -z "$FC" -o "$pac_cv_prog_fc_works" != yes ; then
+ enable_fc=no
+ fi
+fi
+
+dnl If enable_fc=yes up to this point then enable_f77=yes also
+dnl PAC_PROG_FC and PAC_PROG_FC_WORKS return OK
+if test "$enable_fc" = yes ; then
+ # Make sure that the compilers are compatible. This
+ # will also make sure that the program named in FC is
+ # a working Fortran 90 compiler
+ # Only check if we're *not* building within MPICH2
+ # (MPICH2 will have made the test)
+ # FIXME: Do we want to check only simple routine names
+ # (those without an underscore?)
+ if test "$FROM_MPICH2" != yes ; then
+ PAC_FC_AND_F77_COMPATIBLE(enable_fc=yes,enable_fc=no)
+ fi
+fi
+
+if test "$enable_fc" = yes ; then
+ if test "$ac_fc_srcext" != "f90" ; then
+ AC_LANG_PUSH([Fortran])
+ AC_FC_SRCEXT([f90],[
+ FCFLAGS="$FCFLAGS $FCFLAGS_f90"
+ ],[
+ AC_MSG_WARN([Fortran 90 test being disabled because the $FC compiler does not accept a .f90 extension])
+ f90dir=#
+ enable_fc=no
+ ])
+ AC_LANG_POP([Fortran])
+ fi
+
+ # The Fortran90 tests rely on free-form input which needs to be tested
+ # before any test that may modify FCFLAGS, e.g. the cray-pointer test.
+ # The order of the tests is important in compiler like g95.
+ AC_FC_FREEFORM
+
+ # See if the compiler supports the Cray-style pointers
+ ALLOCMEMFC=""
+ PAC_PROG_FC_CRAY_POINTER([
+ ALLOCMEMFC="allocmemf90 1"
+ FCFLAGS="$FCFLAGS $CRAYPTR_FCFLAGS"
+ ])
+ AC_SUBST(ALLOCMEMFC)
+
+ if test -f f77/init/checksizes.c ; then
+ # If it is a VPATH build, f90/init may not be there.
+ if test ! -d f90/init ; then
+ mkdir f90
+ mkdir f90/init
+ fi
+ cp f77/init/checksizes.c f90/init
+ fi
+fi
+#
+if test "$FROM_MPICH2" = yes ; then
+ if test "$enable_fc" = yes ; then
+ otherlangs="$otherlangs f90"
+ f90dir=f90
+ fi
+elif test "$enable_fc" = yes ; then
+ AC_MSG_CHECKING([that we can build MPI programs with Fortran 90])
+ AC_LANG_PUSH([Fortran])
+ AC_LINK_IFELSE([
+ AC_LANG_SOURCE([
+ program main
+ use mpi
+ integer ierr
+ call mpi_init(ierr)
+ call mpi_finalize(ierr)
+ end
+ ])
+ ],[
+ AC_MSG_RESULT(yes)
+ otherlangs="$otherlangs f90"
+ f90dir=f90
+ ],[
+ AC_MSG_RESULT(no)
+ ])
+ AC_LANG_POP([Fortran])
+fi
+AM_CONDITIONAL([BUILD_F90_TESTS],[test "X$f90dir" = "f90"])
+
+# Running C++ compiler tests
+PAC_PROG_CXX
+if test "$enable_cxx" = yes ; then
+ if test -z "$CXX" ; then
+ enable_cxx=no
+ fi
+fi
+# Simple tests for which other languages we can handle
+cxxdir="#"
+AC_SUBST(cxxdir)
+if test "$FROM_MPICH2" = yes ; then
+ if test "$enable_cxx" = yes ; then
+ otherlangs="$otherlangs cxx"
+ cxxdir=cxx
+ fi
+elif test "$enable_cxx" = yes ; then
+ AC_MSG_CHECKING([that we can build MPI programs with C++])
+ AC_LANG_PUSH([C++])
+ AC_LINK_IFELSE([
+ AC_LANG_PROGRAM([
+#include "mpi.h"
+ ],[
+ MPI::Init();
+ MPI::Finalize();
+ ])
+ ],[
+ AC_MSG_RESULT(yes)
+ otherlangs="$otherlangs cxx"
+ cxxdir=cxx
+ ],[
+ AC_MSG_RESULT(no)
+ ])
+ AC_LANG_POP([C++])
+fi
+if test "$enable_cxx" = yes ; then
+ AC_CACHE_CHECK([whether <iostream> available],pac_cv_cxx_has_iostream,[
+ AC_LANG_PUSH([C++])
+ AC_COMPILE_IFELSE([
+ AC_LANG_PROGRAM([#include <iostream>],[using namespace std;])
+ ],[pac_cv_cxx_has_iostream=yes],[pac_cv_cxx_has_iostream=no])
+ ])
+
+ if test "$pac_cv_cxx_has_iostream" = yes ; then
+ AC_DEFINE(HAVE_IOSTREAM,1,[Define if iostream is available])
+ else
+ # Look for iostream.h (in C++ mode, we need the full name)
+ AC_CHECK_HEADERS(iostream.h)
+ if test "$ac_cv_header_iostream_h" != yes ; then
+ AC_MSG_ERROR([C++ compiler $CXX $CXXFLAGS has neither iostream nor iostream.h.])
+ fi
+ # Warning: the autoconf macros will fall back onto /lib/cpp for
+ # C and C++ preprocessing *without* checking that /lib/cpp even
+ # exists.
+ if test "$CXXCPP" = "/lib/cpp" ; then
+ if test ! -x "/lib/cpp" ; then
+ AC_MSG_WARN([Warning: Autoconf error, could not find a C++ Preprocessor. Using false for the preprocessor so that tests will continue.])
+ CXXCPP=false
+ fi
+ fi
+ fi
+
+ AX_CXX_NAMESPACE_STD
+
+ if test "$ac_cv_cxx_namespaces" != yes ; then
+ AC_MSG_WARN([The compiler $CXX does not support C++ namespaces. This may cause problems for the tests])
+ fi
+ AC_LANG_POP([C++])
+fi
+AM_CONDITIONAL([BUILD_CXX_TESTS],[test "X$cxxdir" = "cxx"])
+
+AC_LANG_C
+# IO
+iodir="#"
+if test "$enable_romio" != no ; then
+ iodir=io
+ AC_DEFINE(HAVE_MPI_IO,1,[Define if MPI-IO (really ROMIO) is included])
+ if test "$FROM_MPICH2" = yes ; then
+ # MPICH2 no longer uses and MPIO_Request
+ pac_cv_have_mpio_request=no
+ else
+ AC_CACHE_CHECK([whether MPIO_Request is defined for MPI IO],
+ pac_cv_have_mpio_request,[
+ AC_COMPILE_IFELSE([
+ AC_LANG_PROGRAM([#include "mpi.h"],[MPIO_Request r;])
+ ],[pac_cv_have_mpio_request=yes],[pac_cv_have_mpio_request=no])
+ ])
+ fi
+ if test "$pac_cv_have_mpio_request" = no ; then
+ AC_DEFINE(MPIO_USES_MPI_REQUEST,,[Define if MPI IO uses MPI_Request])
+ fi
+fi
+AC_SUBST(iodir)
+
+#
+# MPI_INTEGER16 is mentioned in only one place in MPI 2.1, and some
+# implementations may have missed it. Check to see if it is available in
+# C.
+if test "$FROM_MPICH2" = yes ; then
+ # MPICH2 correctly includes this type.
+ pac_cv_have_mpi_integer16=yes
+else
+ AC_CACHE_CHECK([whether MPI_INTEGER16 is available],
+ pac_cv_have_mpi_integer16,[
+ AC_COMPILE_IFELSE([
+ AC_LANG_PROGRAM([#include "mpi.h"],[
+ MPI_Datatype t = MPI_INTEGER16;
+ ])
+ ],[pac_cv_have_mpi_integer16=yes],[pac_cv_have_mpi_integer16=no])
+ ])
+fi
+if test "$pac_cv_have_mpi_integer16" = yes ; then
+ AC_DEFINE(HAVE_MPI_INTEGER16,1,[Define if MPI_INTEGER16 is available])
+fi
+AC_CACHE_CHECK([whether MPI_2DOUBLE_COMPLEX is available],
+pac_cv_have_mpi_2double_complex,[
+ AC_COMPILE_IFELSE([
+ AC_LANG_PROGRAM([#include "mpi.h"],[
+ MPI_Datatype t = MPI_2DOUBLE_COMPLEX;
+ ])
+ ],[
+ pac_cv_have_mpi_2double_complex=yes
+ ],[
+ pac_cv_have_mpi_2double_complex=no
+ ])
+])
+if test "$pac_cv_have_mpi_2double_complex" = yes ; then
+ AC_DEFINE(HAVE_MPI_2DOUBLE_COMPLEX,1,[Define if MPI_2DOUBLE_COMPLEX is available])
+fi
+# 2COMPLEX was in MPI 1.0 and removed after that. This allows us to
+# test 2COMPLEX if it is present
+AC_CACHE_CHECK([whether MPI_2COMPLEX is available],
+pac_cv_have_mpi_2complex,[
+ AC_COMPILE_IFELSE([
+ AC_LANG_PROGRAM([#include "mpi.h"],[
+ MPI_Datatype t = MPI_2COMPLEX;
+ ])
+ ],[
+ pac_cv_have_mpi_2complex=yes
+ ],[
+ pac_cv_have_mpi_2complex=no
+ ])
+])
+if test "$pac_cv_have_mpi_2complex" = yes ; then
+ AC_DEFINE(HAVE_MPI_2COMPLEX,1,[Define if MPI_2COMPLEX is available])
+fi
+
+# MPI_Aint was intended as an address-sized int. However, MPI didn't
+# specify this - MPI_Aint must be large enough to hold an address-sized
+# integer, but it can be larger. To get clean compilation in some places,
+# we need a pointer-sized integer. The following code looks for one.
+
+# Make sure we are using the local C compiler (if the local
+# machine is different that the system that MPICC is for, then
+# set the cross-compilation feature)
+AC_CHECK_SIZEOF(void *)
+AC_CHECK_SIZEOF(int)
+AC_CHECK_SIZEOF(long)
+AC_CHECK_SIZEOF(long long)
+AC_CHECK_SIZEOF(short)
+POINTERINT=MPI_Aint
+AC_MSG_CHECKING([for C integer type of address size])
+for type in int long long_long short ; do
+ eval len=\$ac_cv_sizeof_$type
+ if test "$len" = "$ac_cv_sizeof_void_p" ; then
+ POINTERINT=`echo $type | sed -e 's/_/ /'`
+ break
+ fi
+done
+AC_MSG_RESULT($POINTERINT)
+AC_DEFINE_UNQUOTED(POINTERINT_t,$POINTERINT,[POINTERINT_t is a pointer-sized integer])
+
+# Find perl; used to create some of the tests from template and
+# defintion files
+AC_PATH_PROG(PERL,perl)
+AC_SUBST(PERL)
+AC_SUBST(otherlangs)
+AC_SUBST(threadsdir)
+AC_SUBST(MPIEXEC)
+AC_SUBST(MAKE)
+if test -z "$MPILIBNAME" ; then MPILIBNAME=mpich ; fi
+AC_SUBST(MPILIBNAME)
+dnl MPI_SOURCE may be set as an environment variable giving the location
+dnl of the MPI implementation. This is used only in runtests to include
+dnl the location of the source of the MPI implementation into the XML
+dnl summary file
+AC_SUBST(MPI_SOURCE)
+
+if test "$FROM_MPICH2" = yes ; then
+ # Set compilers/flags to be substituted in output files, e.g. Makefiles.
+ LDFLAGS="$saveLDFLAGS"
+ # note that the default definition of bindir is
+ # '${exec_prefix}/bin'
+ # so even if prefix is set, exec prefix is not until
+ # the very last moment (i.e., not here).
+ if test "X$exec_prefix" = "XNONE" ; then
+ saveExec_prefix=$exec_prefix
+ if test "X$prefix" = "XNONE" ; then
+ # Use the default
+ exec_prefix=$ac_default_prefix
+ else
+ exec_prefix=$prefix
+ fi
+ # Evaluate with the current setting of exec_prefix
+ eval mpibindir=${bindir}
+ exec_prefix=$saveExec_prefix
+ else
+ eval mpibindir=${bindir}
+ fi
+
+ # we did our tests with the base compilers, now point the make system at the
+ # installed compiler wrappers for actually building the tests
+ CC=$mpibindir/mpicc
+ F77=$mpibindir/mpif77
+ FC=$mpibindir/mpif90
+ CXX=$mpibindir/mpicxx
+ MPIEXEC=$mpibindir/mpiexec
+
+ # Zero out the flags, since they are already contained in the compiler
+ # wrapper scripts. Note that this will kill any flags that have been added
+ # to the xFLAGS only in this script.
+ #
+ # The only real flags we seem to add in this script relate to cray
+ # pointer support in Fortran, so we include that var here where
+ # appropriate.
+ CFLAGS=""
+ CPPFLAGS=""
+ LDFLAGS=""
+ LIBS=""
+ FFLAGS="$CRAYPTR_FFLAGS"
+ FCFLAGS="$CRAYPTR_FCFLAGS"
+ CXXFLAGS=""
+fi
+
+AC_OUTPUT_COMMANDS([chmod a+x maint/testmerge])
+AC_OUTPUT_COMMANDS([chmod a+x runtests])
+AC_OUTPUT_COMMANDS([chmod a+x manual/manyconnect])
+dnl Note that this format for AC_OUTPUT can cause problems for autoconf
+dnl run under cygwin
+AC_OUTPUT(maint/testmerge \
+ runtests \
+ Makefile \
+ basic/Makefile \
+ attr/Makefile \
+ util/Makefile \
+ coll/Makefile \
+ comm/Makefile \
+ datatype/Makefile \
+ errhan/Makefile \
+ group/Makefile \
+ info/Makefile \
+ init/Makefile \
+ pt2pt/Makefile \
+ rma/Makefile \
+ spawn/Makefile \
+ topo/Makefile \
+ io/Makefile \
+ f77/Makefile \
+ f77/attr/Makefile \
+ f77/attr/attraints.h \
+ f77/pt2pt/attr1aints.h \
+ f77/ext/add1size.h \
+ f77/datatype/Makefile \
+ f77/datatype/typeaints.h \
+ f77/util/Makefile \
+ f77/coll/Makefile \
+ f77/comm/Makefile \
+ f77/topo/Makefile \
+ f77/init/Makefile \
+ f77/rma/addsize.h \
+ f77/pt2pt/Makefile \
+ f77/info/Makefile \
+ f77/spawn/Makefile \
+ f77/spawn/type1aint.h \
+ f77/rma/Makefile \
+ f77/ext/Makefile \
+ f77/ext/testlist \
+ f77/io/Makefile \
+ f77/io/iooffset.h \
+ f77/io/iodisp.h \
+ f77/io/ioaint.h \
+ f90/Makefile \
+ f90/attr/Makefile \
+ f90/datatype/Makefile \
+ f90/f90types/Makefile \
+ f90/util/Makefile \
+ f90/coll/Makefile \
+ f90/comm/Makefile \
+ f90/topo/Makefile \
+ f90/init/Makefile \
+ f90/pt2pt/Makefile \
+ f90/rma/Makefile \
+ f90/info/Makefile \
+ f90/spawn/Makefile \
+ f90/timer/Makefile \
+ f90/ext/Makefile \
+ f90/ext/testlist \
+ f90/io/Makefile \
+ f90/misc/Makefile \
+ cxx/Makefile \
+ cxx/util/Makefile \
+ cxx/attr/Makefile \
+ cxx/pt2pt/Makefile \
+ cxx/comm/Makefile \
+ cxx/coll/Makefile \
+ cxx/errhan/Makefile \
+ cxx/info/Makefile \
+ cxx/datatype/Makefile \
+ cxx/io/Makefile \
+ cxx/init/Makefile \
+ cxx/rma/Makefile \
+ cxx/spawn/Makefile \
+ threads/Makefile \
+ threads/pt2pt/Makefile \
+ threads/util/Makefile \
+ threads/comm/Makefile \
+ threads/init/Makefile \
+ threads/spawn/Makefile \
+ errors/Makefile \
+ errors/attr/Makefile \
+ errors/basic/Makefile \
+ errors/coll/Makefile \
+ errors/comm/Makefile \
+ errors/datatype/Makefile \
+ errors/faults/Makefile \
+ errors/group/Makefile \
+ errors/pt2pt/Makefile \
+ errors/rma/Makefile \
+ errors/spawn/Makefile \
+ errors/topo/Makefile \
+ errors/io/Makefile \
+ errors/cxx/Makefile \
+ errors/cxx/errhan/Makefile \
+ errors/cxx/io/Makefile \
+ errors/f77/Makefile \
+ errors/f90/Makefile \
+ manual/Makefile \
+ manual/manyconnect \
+ perf/Makefile \
+ testlist \
+ cxx/testlist \
+ f77/testlist \
+ f90/testlist \
+ threads/testlist \
+ errors/testlist \
+ errors/cxx/testlist \
+ )
Deleted: mpich2/trunk/test/mpi/configure.in
===================================================================
--- mpich2/trunk/test/mpi/configure.in 2012-02-28 23:25:23 UTC (rev 9547)
+++ mpich2/trunk/test/mpi/configure.in 2012-02-28 23:26:34 UTC (rev 9548)
@@ -1,1187 +0,0 @@
-dnl Process this file with autoconf to produce a configure script.
-AC_PREREQ(2.59)
-dnl
-dnl aclocal_cache.m4, included by sowing/confdb/aclocal.m4, fixes
-dnl bugs in autoconf caching.
-dnl
-dnl
-dnl Environment variables that affect behavior of the test configure
-dnl MPICH_FAST
-dnl
-dnl The file name here refers to a file in the source being configured
-dnl FIXME this is the old style, needs updating to new style
-dnl AC_INIT(include/mpitest.h)
-dnl FIXME duplication with VERSION variable below
-AC_INIT([mpich2-testsuite],[1.2])
-AC_CONFIG_HEADER(include/mpitestconf.h)
-AH_TOP([/* -*- Mode: C; c-basic-offset:4 ; -*- */
-/*
- * (C) 2001 by Argonne National Laboratory.
- * See COPYRIGHT in top-level directory.
- */
-#ifndef MPITESTCONF_H_INCLUDED
-#define MPITESTCONF_H_INCLUDED
-])
-AH_BOTTOM([#endif])
-# This version is the version of the test suite.
-# 1.0: Initial version (all versions) before independent release
-# 1.1: Initial version that is independent of MPICH2 11/08
-# 1.2: Automake replaces simplemake
-VERSION=1.2
-AC_SUBST(VERSION)
-dnl
-dnl XXX DJG Dries thinks that I want MACRO_DIR instead
-dnl AC_CONFIG_AUX_DIR(../../confdb)
-AC_CONFIG_AUX_DIR([../../confdb])
-AC_CONFIG_MACRO_DIR([../../confdb])
-dnl
-echo "RUNNING CONFIGURE FOR MPI TESTS"
-
-AM_INIT_AUTOMAKE([-Wall -Werror foreign 1.11 silent-rules subdir-objects])
-AM_MAINTAINER_MODE([enable])
-# not using libtool for the test suite, so no LT_INIT
-AC_PROG_RANLIB
-
-# Non-verbose make by default
-m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
-
-# XXX DJG FIXME is this needed still?
-# mpich2_top_srcdir is used only to build the distribution target (dist)
-if test -z "$mpich2_top_srcdir" ; then
- if test -z "$top_srcdir" ; then
- use_top_srcdir=$srcdir
- else
- use_top_srcdir=$top_srcdir
- fi
- case "$use_top_srcdir" in
- /*) ;;
- *)
- use_top_srcdir=`(cd $use_top_srcdir && pwd)`
- ;;
- esac
- if test -x $use_top_srcdir/../../maint/simplemake ; then
- mpich2_top_srcdir=`cd $use_top_srcdir && cd ../.. && pwd`
- fi
-fi
-AC_SUBST(mpich2_top_srcdir)
-
-# these (in particular master_top_srcdir) are needed to regenerate
-# Makefile.in files after Makfile.sm files change
-AC_ARG_VAR([master_top_builddir],[path to the MPICH2 top-level build directory (if present)])
-AC_ARG_VAR([master_top_srcdir],[path to the MPICH2 top-level source directory (if present)])
-
-AC_ARG_ENABLE(echo,
-[--enable-echo - Turn on strong echoing. The default is enable=no.] ,set -x)
-otherlangs=""
-AC_ARG_ENABLE(f77,
-[--enable-f77 - Turn on Fortran 77 tests (default)],,enable_f77=yes)
-dnl
-AC_ARG_ENABLE(fc,
-[--enable-fc - Turn on Fortran 90 tests (if f90 available)],,enable_fc=yes)
-AC_ARG_ENABLE(cxx,
-[--enable-cxx - Turn on C++ tests (default)],,enable_cxx=yes)
-AC_ARG_ENABLE(romio,
-[--enable-romio - Enable ROMIO MPI I/O implementation],
-,enable_romio=yes)
-AC_ARG_ENABLE(spawn,
-[--enable-spawn - Enable tests of the dynamic process parts of MPI-2 (default)],
-,enable_spawn=yes)
-AC_ARG_ENABLE(checkerrors,
-[--enable-checkerrors - Add some tests for checking for errors in user programs],,enable_checkerrors=default)
-AC_ARG_ENABLE(checkfaults,
-[--enable-checkfaults - Add some tests for checking on handling of faults in user programs],,enable_checkfaults=no)
-AC_ARG_ENABLE(fast,
-[--enable-fast - Indicates that the MPI implementation may have been built for fastest operation, such as building without error checking. Has the effect of --enable-checkerrors=no])
-AC_ARG_ENABLE(strictmpi,
-[--enable-strictmpi - Only test for operations specifically defined by the MPI standard. This turns off tests for some common extensions, including for combinations of predefined datatypes and predefined MPI_Op s.],,enable_strictmpi=no)
-
-AC_ARG_ENABLE(threads,
-[--enable-threads=level - Specify the level of thread support expected from the
-MPI implementation. The following levels are supported.
- single - No threads (MPI_THREAD_SINGLE)
- funneled - Only the main thread calls MPI (MPI_THREAD_FUNNELED)
- serialized - User serializes calls to MPI (MPI_THREAD_SERIALIZED)
- multiple - Fully multi-threaded (MPI_THREAD_MULTIPLE)
-The default is funneled. If enabled and no level is specified, the
-level is set to multiple. If disabled, the level is set to single.
-If the environment variable MPICH_THREAD_LEVEL is set, that thread
-level is used (this is to let MPICH2 build for the correct thread
-support without requiring a specific --enable-threads argument.
-],,
-enable_threads=default)
-
-AC_ARG_WITH(mpi,
-[--with-mpi=dir - Use the selected MPI; compilation scripts for mpicc, mpif77
- and mpicxx should be in dir/bin],,)
-
-AC_ARG_WITH(config-args,
-[--with-config-args=filename - Specify configure argument file that
- contains the values of variables that
- configure reads,
- e.g. CC,CFLAGS,F77,FFLAGS,FC,FCFLAGS....
- If the filename does not begin with
- / (absolute path), . or .. (relative path),
- the filename will be assumed to be
- $top_srcdir/configargs/<filename>.cfg.],,
-with_config_args=no)
-dnl
-if test "$with_config_args" != "no" ; then
- case "$with_config_args" in
- /*|../*|./*)
- config_args_file="$with_config_args"
- ;;
- *)
- config_args_file="$srcdir/configargs/$with_config_args.cfg"
- ;;
- esac
- if test -s "$config_args_file" ; then
- AC_MSG_RESULT([Reading the configure arguments in ${config_args_file}.])
- . $config_args_file
- # Export all the variables in $config_args_file
- # i.e. CC,CFLAGS, F77/FFLAGS, FC/FCFLAGS, CXX/CXXFLAGS and friends...
- config_args_vars=`grep -v '^#' $config_args_file | sed -e 's/=.*//g'`
- for var in $config_args_vars ; do
- eval value=\$"$var"
- echo "Exporting $var=$value ..."
- export $var
- done
- else
- AC_MSG_WARN([Non-existent ${config_args_file}.])
- fi
-fi
-
-#
-# First, determine whether we are/can support the language bindings
-#
-# Since F90/F90FLAGS are replaced by FC/FCFLAGS, rather than silently
-# substituting them, i.e. FC=$F90 and FCFLAGS=$F90FLAGS, we choose to emit
-# an error message and abort to avoid any ambiguous/hidden bug in choosing
-# Fortran90 compilers.
-if test -n "$F90" -o -n "$F90FLAGS" ; then
- AC_MSG_ERROR([F90 and F90FLAGS are replaced by FC and FCFLAGS respectively in this configure, please unset F90/F90FLAGS and set FC/FCFLAGS instead and rerun configure again.])
-fi
-
-# ------------------------------------------------------------------------
-dnl use AC_ARG_VAR to mark FROM_MPICH2 as "precious" to autoconf so that
-dnl automatic re-runs of config.status preserve its value correctly
-AC_ARG_VAR([FROM_MPICH2],[should be set to "yes" if this configure script is being invoked by the main MPICH2 configure])
-AC_ARG_VAR([MPICH_THREAD_LEVEL],
- [the MPI thread level supported by the enclosing MPICH2 build (when built within MPICH2)])
-# ------------------------------------------------------------------------
-
-if test "$enable_threads" = "yes" ; then
- enable_threads=multiple
-elif test "$enable_threads" = "no" ; then
- enable_threads=single
-elif test "$enable_threads" = default ; then
- if test -n "$MPICH_THREAD_LEVEL" ; then
- case $MPICH_THREAD_LEVEL in
- MPI_THREAD_MULTIPLE)
- enable_threads=multiple
- ;;
- MPI_THREAD_SERIALIZED)
- enable_threads=serialized
- ;;
- MPI_THREAD_FUNNELED)
- enable_threads=funneled
- ;;
- MPI_THREAD_SINGLE)
- enable_threads=single
- ;;
- esac
- else
- enable_threads=funneled
- fi
-fi
-
-if test "$enable_fast" = "yes" ; then
- if test "$enable_checkerrors" = "default" ; then
- enable_checkerrors=no
- fi
-fi
-# default for MPICH2 is to check error handling; for other cases it
-# is to only check correct programs.
-if test "$FROM_MPICH2" = "yes" ; then
- if test "$enable_checkerrors" = "default" -a "$MPICH_FAST" != "YES" ; then
- enable_checkerrors=yes
- else
- enable_checkerrors=no
- fi
-else
- if test "$enable_checkerrors" = "default" ; then
- enable_checkerrors=no
- fi
-fi
-# errordir is substituted into the testlist file as errors when the
-# tests should check error handling and as a comment (#) otherwise.
-errordir="#"
-if test "$enable_checkerrors" = "yes" ; then
- errordir=errors
-fi
-AC_SUBST(errordir)
-#
-# Only run the threads tests if multiple is specified
-if test "$enable_threads" = "multiple" -o "$enable_threads" = "runtime" ; then
- threadsdir="threads"
-fi
-
-PAC_LOAD_BASE_CACHE
-PAC_VPATH_CHECK()
-PAC_PROG_MAKE
-
-MPILIBLOC=""
-AC_SUBST(MPILIBLOC)
-
-# more variables that must be marked precious for proper re-configure operation
-AC_ARG_VAR([MPICH2_ENABLE_F77],["yes" if the enclosing MPICH2 build supports Fortran 77])
-AC_ARG_VAR([MPICH2_ENABLE_FC],["yes" if the enclosing MPICH2 build supports modern Fortran])
-AC_ARG_VAR([MPICH2_ENABLE_CXX],["yes" if the enclosing MPICH2 build supports C++])
-
-# If we're building from MPICH2, check the MPICH2_ENABLE_xxx environment
-# variables for enable defaults
-if test "$FROM_MPICH2" = yes ; then
- if test -n "$MPICH2_ENABLE_F77" ; then
- enable_f77=$MPICH2_ENABLE_F77
- fi
- if test -n "$MPICH2_ENABLE_FC" ; then
- enable_fc=$MPICH2_ENABLE_FC
- fi
- if test -n "$MPICH2_ENABLE_CXX" ; then
- enable_cxx=$MPICH2_ENABLE_CXX
- fi
-fi
-
-#
-# Some MPI-2 implementations (including some of the MPICH2 shared-memory
-# channels and BG/L) leave out the dynamic process routines. This
-# allows tests to avoid reporting failure for these routines.
-# This can be controlled by either a --disable-spawn argument or by
-# setting the environment variable MPI_NO_SPAWN to yes.
-AC_ARG_VAR([MPI_NO_SPAWN],[set to "yes" to disable dynamic process tests])
-spawndir=spawn
-if test "$enable_spawn" != yes ; then
- spawndir="#"
-elif test "$MPI_NO_SPAWN" = yes ; then
- spawndir="#"
-fi
-#echo "MPI_NO_SPAWN = $MPI_NO_SPAWN"
-AC_SUBST(spawndir)
-
-# Also allow rma to be disabled
-AC_ARG_VAR([MPI_NO_RMA],[set to "yes" to disable one-sided tests])
-rmadir=rma
-if test "$MPI_NO_RMA" = yes ; then
- rmadir="#"
-else
- AC_DEFINE(HAVE_MPI_WIN_CREATE,1,[Define if MPI_Win_create is available])
-fi
-AC_SUBST(rmadir)
-
-faultsdir=#
-if test "$enable_checkfaults" = "yes" ; then
- faultsdir=faults
-fi
-AC_SUBST(faultsdir)
-#
-if test "$enable_strictmpi" = "yes" ; then
- AC_DEFINE(USE_STRICT_MPI,1,[Define if only operations defined in MPI should be tested])
-fi
-
-# preserve these values across a reconfigure
-AC_ARG_VAR([WRAPPER_CFLAGS],[])
-AC_ARG_VAR([WRAPPER_CPPFLAGS],[])
-AC_ARG_VAR([WRAPPER_LDFLAGS],[])
-AC_ARG_VAR([WRAPPER_LIBS],[])
-AC_ARG_VAR([WRAPPER_FFLAGS],[])
-AC_ARG_VAR([WRAPPER_FCFLAGS],[])
-AC_ARG_VAR([WRAPPER_CXXFLAGS],[])
-
-if test "$FROM_MPICH2" = "yes" ; then
- # perform configure tests with the normal compilers ($CC/$F77/etc), but use
- # the WRAPPER_xFLAGS computed by MPICH2 as our flags instead. Then at the
- # end of configure we will empty out these flags and set our compilers to
- # the installed compiler wrappers
- CFLAGS="$WRAPPER_CFLAGS"
- CPPFLAGS="$WRAPPER_CPPFLAGS"
- LDFLAGS="$WRAPPER_LDFLAGS"
- FFLAGS="$WRAPPER_FFLAGS"
- FCFLAGS="$WRAPPER_FCFLAGS"
- CXXFLAGS="$WRAPPER_CXXFLAGS"
-
- # WRAPPER_LIBS contains currently non-existent libs like "-lopa" and "-lmpl"
- # right now, so set LIBS to the user-specified libs for now.
- # FIXME Does this need to be an AC_ARG_VAR?
- LIBS="$MPICH2_LIBS"
-
-elif test -n "$with_mpi" ; then
- if test -z "$MPICC" ; then
- CC=$with_mpi/bin/mpicc
- else
- CC=$MPICC
- fi
- if test -z "$MPIF77" ; then
- F77=$with_mpi/bin/mpif77
- else
- F77=$MPIF77
- fi
- if test -z "$MPIFC" ; then
- FC=$with_mpi/bin/mpif90
- else
- FC=$MPIFC
- fi
- if test -z "$MPICXX" ; then
- CXX=$with_mpi/bin/mpicxx
- else
- CXX=$MPICXX
- fi
- if test -z "$MPIEXEC" ; then
- MPIEXEC=$with_mpi/bin/mpiexec
- fi
-fi
-
-# Running C compiler tests
-PAC_PROG_CC
-
-# Note that some versions of autoconf will insist that the compiler
-# produce executables at this point, which is why we must do something
-# special for building within MPICH2
-dnl We cannot use AC_C_LONG_DOUBLE
-dnl because it does not support cross-compilation. Instead, we use the
-dnl same test in the MPICH2 configure.
-# Check on support for long double and long long types. Do this before the
-# structure alignment test because it will test for including those
-# types as well
-AC_CACHE_CHECK([whether long double is supported],pac_cv_have_long_double,[
- AC_COMPILE_IFELSE([
- AC_LANG_PROGRAM([],[long double a;])
- ],[pac_cv_have_long_double=yes],[pac_cv_have_long_double=no])
-])
-if test "$pac_cv_have_long_double" = "yes" ; then
- AC_DEFINE(HAVE_LONG_DOUBLE,1,[Define if long double is supported])
-fi
-AC_CACHE_CHECK([whether long long is supported],pac_cv_have_long_long,[
- AC_COMPILE_IFELSE([
- AC_LANG_PROGRAM([],[long long a;])
- ],[pac_cv_have_long_long=yes],[pac_cv_have_long_long=no])
-])
-if test "$pac_cv_have_long_long" = yes ; then
- AC_DEFINE(HAVE_LONG_LONG,1,[Define if compiler supports long long])
-fi
-#
-# Check for const and restrict (used in some of the performance tests)
-AC_C_CONST
-AC_C_RESTRICT
-
-# Enable STRICT CFLAGS
-AC_ARG_ENABLE(stricttest,
-AC_HELP_STRING([--enable-stricttest], [Turn on strict GCC compilation]))
-dnl Initialize enable_strict_done so PAC_CC_STRICT won't exit right away
-dnl When it is configuring from within MPICH2, because enable_strict_done=yes
-dnl is set in the environment by MPICH2.
-enable_strict_done=no
-PAC_CC_STRICT($enable_stricttest)
-# -Wfloat-equal isn't meaningful in testsuite,
-# remove it if it is in strict flags.
-pac_cc_strict_flags="`echo $pac_cc_strict_flags | sed -e 's|-Wfloat-equal||g'`"
-CFLAGS="$CFLAGS $pac_cc_strict_flags"
-
-# General headers
-AC_HEADER_STDC
-dnl AC_CHECK_HEADERS(stdarg.h unistd.h string.h stdlib.h memory.h stdint.h)
-dnl unistd.h string.h stdlib.h memory.h stdint.h are checked by AC_PROG_CC.
-AC_CHECK_HEADERS(stdarg.h sys/time.h)
-
-# Check for fixed width types
-AC_TYPE_INT8_T
-AC_TYPE_INT16_T
-AC_TYPE_INT32_T
-AC_TYPE_INT64_T
-AC_TYPE_UINT8_T
-AC_TYPE_UINT16_T
-AC_TYPE_UINT32_T
-AC_TYPE_UINT64_T
-
-# Check for availability of C99 types
-AC_CHECK_TYPES([_Bool, float _Complex, double _Complex, long double _Complex])
-
-# Headers needed for threads tests
-if test "$threadsdir" = "threads" ; then
- # Check for needed threads headers and needed and optional routines
- AC_CHECK_HEADERS(pthread.h)
-
- # we shouldn't actually need to do this, but we are dodging the chicken/egg
- # problem b/c we don't have a working mpicc yet and we temporarily discarded
- # the MPICH2-set LIBS (probably the wrong thing to do)
- AC_SEARCH_LIBS([pthread_create],[pthread])
- AC_SEARCH_LIBS([pthread_barrier_init],[pthread])
-
- AC_CHECK_FUNCS(pthread_create pthread_yield pthread_barrier_init pthread_barrier_wait)
- if test "$FROM_MPICH2" != yes ; then
- AC_CHECK_FUNCS(MPI_Init_thread)
- fi
-fi
-
-# Check for h_addr or h_addr_list. This is needed for the singjoin test
-# in manual/singjoin.c
-AC_CACHE_CHECK([whether struct hostent contains h_addr_list],
-dnl Use Double quote LANG_PROGRAM
-dnl so [] in h_addr_list[0] won't be ignored by IFELSE.
-pac_cv_have_haddr_list,[
-AC_COMPILE_IFELSE([
- AC_LANG_PROGRAM([#include <netdb.h>],[[
- struct hostent hp;
- hp.h_addr_list[0]=0;
- ]])
-],[pac_cv_have_haddr_list=yes],[pac_cv_have_haddr_list=no])
-])
-if test "$pac_cv_have_haddr_list" = "yes" ; then
- AC_DEFINE(HAVE_H_ADDR_LIST,1,[Define if struct hostent contains h_addr_list])
-fi
-
-# Check for the MPI Version. This test assumes at least MPI 2.0. For
-# some tests, we need to know if we are MPI 2.1 or MPI 2.2,
-# particularly for new routines in Fortran
-AC_CACHE_CHECK([for major version of MPI],pac_cv_mpi_major_version,[
-for pac_cv_mpi_major_version in 3 2 1 unknown ; do
- AC_COMPILE_IFELSE([AC_LANG_PROGRAM([#include "mpi.h"],[
-#if MPI_VERSION == $pac_cv_mpi_major_version
- ''' force failure '''
-#endif])],,break)
-done
-])
-
-AC_CACHE_CHECK([for minor version of MPI],pac_cv_mpi_minor_version,[
-for pac_cv_mpi_minor_version in 4 3 2 1 0 unknown ; do
- AC_COMPILE_IFELSE([AC_LANG_PROGRAM([#include "mpi.h"],[
-#if MPI_SUBVERSION == $pac_cv_mpi_minor_version
- ''' force failure '''
-#endif])],,break)
-done
-])
-MPI_VERSION=$pac_cv_mpi_major_version
-MPI_SUBVERSION=$pac_cv_mpi_minor_version
-AC_SUBST(MPI_VERSION)
-AC_SUBST(MPI_SUBVERSION)
-
-# Running Fortran 77 compiler tests
-PAC_PROG_F77
-if test "$enable_f77" = yes ; then
- # If there is no working F77, then set enable_f77 to no
- if test -z "$F77" ; then
- enable_f77=no
- fi
-fi
-# Simple tests for which other languages we can handle.
-# Use these only when configuring separate from an MPICH2 build
-f77dir="#"
-AC_SUBST(f77dir)
-buildingF77=no
-if test "$FROM_MPICH2" = yes ; then
- if test "$enable_f77" = yes ; then
- # Assume success
- otherlangs="$otherlangs f77"
- f77dir=f77
- buildingF77=yes
- fi
-elif test "$enable_f77" = yes ; then
- AC_MSG_CHECKING([that we can build MPI programs with Fortran 77])
- AC_LANG_PUSH([Fortran 77])
- AC_LINK_IFELSE([
- AC_LANG_SOURCE([
- program main
- include 'mpif.h'
- integer ierr
- call mpi_init(ierr)
- call mpi_finalize(ierr)
- end
- ])
- ],[
- AC_MSG_RESULT(yes)
- otherlangs="$otherlangs f77"
- f77dir=f77
- buildingF77=yes
- ],[
- AC_MSG_RESULT(no)
- ])
- AC_LANG_POP([Fortran 77])
-fi
-#
-# At least one test (C++ test of C and Fortran datatypes) needs to
-# know if Fortran is supported
-if test "$f77dir" = "f77" ; then
- AC_DEFINE(HAVE_FORTRAN_BINDING,1,[Define if Fortran is supported])
-fi
-
-AM_CONDITIONAL([BUILD_F77_TESTS],[test "X$f77dir" = "f77"])
-
-AC_ARG_VAR([MPI_SIZEOF_AINT],[if set, force MPI_Aint to a width of this many bytes])
-AC_ARG_VAR([MPI_SIZEOF_OFFSET],[if set, force MPI_Offset to a width of this many bytes])
-
-# Common tests for F77
-if test "$buildingF77" = "yes" ; then
- # Match integer types to the MPI types for MPI_Aint and MPI_Offset
-
- # FIXME: Add a test to see if the environment is importing the
- # necessary information.
-
- # Get the sizes of the MPI types. We use the following:
- # MPI_SIZEOF_OFFSET and MPI_SIZEOF_AINT
- if test -z "$MPI_SIZEOF_AINT" ; then
- # Aint should be an address-sized integer, the same as void*
- # We use a test on the size of void * to avoid any complications
- # in dealing with running programs containing MPI headers (e.g.,
- # the IBM MPI changes the main entry point so that MPI
- # programs cannot be run on the host node)
- AC_CHECK_SIZEOF(void *)
- MPI_SIZEOF_AINT=$ac_cv_sizeof_void_p
- fi
- if test -z "$MPI_SIZEOF_OFFSET" ; then
- # We have to try and get the size of offset anyway, since
- # it is not the same as void * (it depends on the available
- # file systems). Since we want to avoid using the MPI linker,
- # we could do the following:
- # Use the mpi compiler to compile the file, using the mpi
- # header but no MPI calls
- # Use the regular C linker to link the program
- # However, we do this only if the environment variable BASECC
- # has been provided. Else we can try the following:
- # use
- # sed -n 's/typedef \(.*\) MPI_Offset *;/\1/p' mpi.h
- # to extract the type corresponding to MPI_Offset and then
- # just use that.
-dnl AC_CACHE_CHECK([the sizeof MPI_Offset],ac_cv_sizeof_MPI_Offset,[
-dnl ac_cv_sizeof_MPI_Offset=unknown
-dnl rm -f conftest*
-dnl cat >>conftest.c <<EOF
-dnl #include "mpi.h"
-dnl #include <stdio.h>
-dnl int main( int argc, char **argv )
-dnl {
-dnl MPI_Offset a;
-dnl FILE *f = fopen("conftestval", "w" );
-dnl if (! f) exit(1);
-dnl fprintf( f, "%ld\n", (long)sizeof(MPI_Offset) );
-dnl fclose(f);
-dnl return 0;
-dnl }
-dnl EOF
-dnl # FIXME. Check for BASECC
-dnl # Note: This assumes that CC has been set to the C compiler for
-dnl # MPI Programs, and that either any necessary include paths are
-dnl # already set or they are in CPPFLAGS (prefered) or CFLAGS.
-dnl if AC_TRY_EVAL(ac_link) && test -s conftest$ac_exeext ; then
-dnl if ./conftest$ac_exeext ; then
-dnl #success
-dnl ac_cv_sizeof_MPI_Offset=`cat conftestval`
-dnl else
-dnl # failure
-dnl AC_MSG_WARN([Unable to run the program to determine the size of MPI_Offset])
-dnl echo "configure: failed program was:" >&AC_FD_CC
-dnl cat conftest.c >&AC_FD_CC
-dnl fi
-dnl else
-dnl # failure
-dnl AC_MSG_WARN([Unable to build the program to determine the size of MPI_Offset])
-dnl echo "configure: failed program was:" >&AC_FD_CC
-dnl cat conftest.c >&AC_FD_CC
-dnl fi
-dnl rm -f conftest*
-dnl ])
- AC_CHECK_SIZEOF([MPI_Offset],[],[#include "mpi.h"])
- if test "$ac_cv_sizeof_MPI_Offset" = "unknown" \
- -o "$ac_cv_sizeof_MPI_Offset" -eq 0 ; then
- AC_MSG_WARN([Using 8 for the size of MPI_Offset])
- MPI_SIZEOF_OFFSET=8
- else
- MPI_SIZEOF_OFFSET=$ac_cv_sizeof_MPI_Offset
- fi
- fi
-
- AC_LANG_PUSH([Fortran 77])
- AC_CACHE_CHECK([whether integer*4 is supported],pac_cv_fort_integer4,[
- AC_COMPILE_IFELSE([AC_LANG_PROGRAM(,[ integer*4 i])],
- pac_cv_fort_integer4=yes,
- pac_cv_fort_integer4=no)])
- AC_CACHE_CHECK([whether integer*8 is supported],pac_cv_fort_integer8,[
- AC_COMPILE_IFELSE([AC_LANG_PROGRAM(,[ integer*8 i])],
- pac_cv_fort_integer8=yes,
- pac_cv_fort_integer8=no)])
- AC_CACHE_CHECK([whether integer*16 is supported],pac_cv_fort_integer16,[
- AC_COMPILE_IFELSE([AC_LANG_PROGRAM(,[ integer*16 i])],
- pac_cv_fort_integer16=yes,
- pac_cv_fort_integer16=no)])
- AC_LANG_POP([Fortran 77])
-
- # Determine Aint and Offset
- for len in 4 8 16 ; do
- eval testval=\$"pac_cv_fort_integer$len"
- if test "$testval" = no ; then continue ; fi
- testval=$len
- if test $len = "$MPI_SIZEOF_AINT" ; then
- F77_MPI_ADDRESS="integer*$len"
- fi
- if test $len = "$MPI_SIZEOF_OFFSET" ; then
- F77_MPI_OFFSET="integer*$len"
- fi
- done
- # At this point, we could create a test program that would confirm that
- # the values in Fortran matched the values in C.
- # Note that we must make this an MPI program because the compiler for
- # MPI programs may require that the programs be run with mpiexec or
- # something similar (this is true for the IBM MPI, for example).
- rm -f f77/init/checksizes.c
- # If it is a VPATH build, f77/init may not be there.
- if test ! -d f77/init ; then
- mkdir f77
- mkdir f77/init
- fi
- cat > f77/init/checksizes.c <<EOF
-#include "mpi.h"
-#include <stdio.h>
-int main( int argc, char **argv )
-{
- int fsizeof_aint = $MPI_SIZEOF_AINT;
- int fsizeof_offset = $MPI_SIZEOF_OFFSET;
- int err = 0, rc = 0;
-
- MPI_Init( &argc, &argv );
- if (sizeof(MPI_Aint) != fsizeof_aint) {
- printf( "Sizeof MPI_Aint is %d but Fortran thinks it is %d\n",
- (int)sizeof(MPI_Aint), fsizeof_aint );
- err++;
- }
- if (sizeof(MPI_Offset) != fsizeof_offset) {
- printf( "Sizeof MPI_Offset is %d but Fortran thinks it is %d\n",
- (int)sizeof(MPI_Offset), fsizeof_offset );
- err++;
- }
- MPI_Finalize( );
- if (err > 0) rc = 1;
- return rc;
-}
-EOF
-
- # Check for name mapping so that we can do the handle conversion tests
- # This test needs both the base c and fortran compilers
- AC_LANG_FORTRAN77
- PAC_PROG_F77_NAME_MANGLE
-
- # Check whether we need -lU77 to get iargc and getarg, which
- # are used for a few of the tests in spawn
- # FIXME: if we can't figure out how to get iargc/getarg, then
- # we should really turn off those spawn tests
- AC_MSG_CHECKING([for Fortran libraries needed for getarg])
- AC_LANG_CONFTEST([
- AC_LANG_PROGRAM([],[
- character*64 s
- integer i
- i = iargc()
- call getarg(i,s)
- ])
- ])
- AC_LINK_IFELSE([],[
- pac_cv_getarg_needs_u77=no
- ],[
- pac_cv_getarg_needs_u77=unknown
- ])
- if test "$pac_cv_getarg_needs_u77" != "no" ; then
- # Try again with -lU77
- saveLIBS="$LIBS"
- LIBS="$LIBS -lU77"
- AC_LINK_IFELSE([],[
- pac_cv_getarg_needs_u77=yes
- ],[
- pac_cv_getarg_needs_u77=unavailable
- ])
- LIBS="$saveLIBS"
- if test "$pac_cv_getarg_needs_u77" = "yes" ; then
- F77_GETARG_LIBS=-lU77
- fi
- fi
- rm -f conftest$ac_exeext
- if test -n "$F77_GETARG_LIBS" ; then
- AC_MSG_RESULT($F77_GETARG_LIBS)
- else
- if test "$pac_cv_getarg_needs_u77" = "unavailable" ; then
- AC_MSG_RESULT([getarg and/or iargc are not available. Some spawn tests will fail to link])
- else
- AC_MSG_RESULT([none needed])
- fi
- fi
- AC_SUBST(F77_GETARG_LIBS)
- # FIXME: Currently, we hope that FC accepts the same library
- FC_GETARG_LIBS="$F77_GETARG_LIBS"
- AC_SUBST(FC_GETARG_LIBS)
-
- # ALLOCMEMF is set in f77/ext/testlist if we can try this
- # Fortran extension
- ALLOCMEMF=""
- PAC_PROG_F77_CRAY_POINTER([
- ALLOCMEMF="allocmemf 1"
- FFLAGS="$FFLAGS $CRAYPTR_FFLAGS"
- ])
- AC_SUBST(ALLOCMEMF)
- # See the f90 block of code for the Fortran 90 version of ALLOCMEMF,
- # i.e. ALLOCMEMFC.
-
-fi
-# Set a default for the Fortran 77 version of MPI_Offset.
-if test -z "$F77_MPI_OFFSET" ; then
- F77_MPI_OFFSET="integer*8"
- AC_MSG_WARN([Selecting integer*8 as the Fortran type for MPI_Offset])
-fi
-AC_SUBST(F77_MPI_OFFSET)
-# FIXME: Find a way to get the correct value
-if test -z "$F77_MPI_ADDRESS" ; then
- F77_MPI_ADDRESS="integer"
- AC_MSG_WARN([Selecting integer as the Fortran type for MPI_Aint])
-fi
-AC_SUBST(F77_MPI_ADDRESS)
-
-# Running Fortran 90+ compiler tests
-PAC_PROG_FC
-if test "$enable_fc" = yes ; then
- # Work around feature in autoconf that adds -g -O2 to FCFLAGS
- saveFCFLAGS="$FCFLAGS"
- FCFLAGS="$saveFCFLAGS"
- # If there is no working FC, then set enable_fc to no
- if test -z "$FC" ; then
- enable_fc=no
- fi
-fi
-f90dir="#"
-AC_SUBST(f90dir)
-# First, see if we have an f90 compiler. This uses code similar to that
-# in the MPICH2 top-level configure
-if test "$enable_fc" = yes -a "$enable_f77" = yes ; then
- PAC_PROG_FC_WORKS
- if test -z "$FC" -o "$pac_cv_prog_fc_works" != yes ; then
- enable_fc=no
- fi
-fi
-
-dnl If enable_fc=yes up to this point then enable_f77=yes also
-dnl PAC_PROG_FC and PAC_PROG_FC_WORKS return OK
-if test "$enable_fc" = yes ; then
- # Make sure that the compilers are compatible. This
- # will also make sure that the program named in FC is
- # a working Fortran 90 compiler
- # Only check if we're *not* building within MPICH2
- # (MPICH2 will have made the test)
- # FIXME: Do we want to check only simple routine names
- # (those without an underscore?)
- if test "$FROM_MPICH2" != yes ; then
- PAC_FC_AND_F77_COMPATIBLE(enable_fc=yes,enable_fc=no)
- fi
-fi
-
-if test "$enable_fc" = yes ; then
- if test "$ac_fc_srcext" != "f90" ; then
- AC_LANG_PUSH([Fortran])
- AC_FC_SRCEXT([f90],[
- FCFLAGS="$FCFLAGS $FCFLAGS_f90"
- ],[
- AC_MSG_WARN([Fortran 90 test being disabled because the $FC compiler does not accept a .f90 extension])
- f90dir=#
- enable_fc=no
- ])
- AC_LANG_POP([Fortran])
- fi
-
- # The Fortran90 tests rely on free-form input which needs to be tested
- # before any test that may modify FCFLAGS, e.g. the cray-pointer test.
- # The order of the tests is important in compiler like g95.
- AC_FC_FREEFORM
-
- # See if the compiler supports the Cray-style pointers
- ALLOCMEMFC=""
- PAC_PROG_FC_CRAY_POINTER([
- ALLOCMEMFC="allocmemf90 1"
- FCFLAGS="$FCFLAGS $CRAYPTR_FCFLAGS"
- ])
- AC_SUBST(ALLOCMEMFC)
-
- if test -f f77/init/checksizes.c ; then
- # If it is a VPATH build, f90/init may not be there.
- if test ! -d f90/init ; then
- mkdir f90
- mkdir f90/init
- fi
- cp f77/init/checksizes.c f90/init
- fi
-fi
-#
-if test "$FROM_MPICH2" = yes ; then
- if test "$enable_fc" = yes ; then
- otherlangs="$otherlangs f90"
- f90dir=f90
- fi
-elif test "$enable_fc" = yes ; then
- AC_MSG_CHECKING([that we can build MPI programs with Fortran 90])
- AC_LANG_PUSH([Fortran])
- AC_LINK_IFELSE([
- AC_LANG_SOURCE([
- program main
- use mpi
- integer ierr
- call mpi_init(ierr)
- call mpi_finalize(ierr)
- end
- ])
- ],[
- AC_MSG_RESULT(yes)
- otherlangs="$otherlangs f90"
- f90dir=f90
- ],[
- AC_MSG_RESULT(no)
- ])
- AC_LANG_POP([Fortran])
-fi
-AM_CONDITIONAL([BUILD_F90_TESTS],[test "X$f90dir" = "f90"])
-
-# Running C++ compiler tests
-PAC_PROG_CXX
-if test "$enable_cxx" = yes ; then
- if test -z "$CXX" ; then
- enable_cxx=no
- fi
-fi
-# Simple tests for which other languages we can handle
-cxxdir="#"
-AC_SUBST(cxxdir)
-if test "$FROM_MPICH2" = yes ; then
- if test "$enable_cxx" = yes ; then
- otherlangs="$otherlangs cxx"
- cxxdir=cxx
- fi
-elif test "$enable_cxx" = yes ; then
- AC_MSG_CHECKING([that we can build MPI programs with C++])
- AC_LANG_PUSH([C++])
- AC_LINK_IFELSE([
- AC_LANG_PROGRAM([
-#include "mpi.h"
- ],[
- MPI::Init();
- MPI::Finalize();
- ])
- ],[
- AC_MSG_RESULT(yes)
- otherlangs="$otherlangs cxx"
- cxxdir=cxx
- ],[
- AC_MSG_RESULT(no)
- ])
- AC_LANG_POP([C++])
-fi
-if test "$enable_cxx" = yes ; then
- AC_CACHE_CHECK([whether <iostream> available],pac_cv_cxx_has_iostream,[
- AC_LANG_PUSH([C++])
- AC_COMPILE_IFELSE([
- AC_LANG_PROGRAM([#include <iostream>],[using namespace std;])
- ],[pac_cv_cxx_has_iostream=yes],[pac_cv_cxx_has_iostream=no])
- ])
-
- if test "$pac_cv_cxx_has_iostream" = yes ; then
- AC_DEFINE(HAVE_IOSTREAM,1,[Define if iostream is available])
- else
- # Look for iostream.h (in C++ mode, we need the full name)
- AC_CHECK_HEADERS(iostream.h)
- if test "$ac_cv_header_iostream_h" != yes ; then
- AC_MSG_ERROR([C++ compiler $CXX $CXXFLAGS has neither iostream nor iostream.h.])
- fi
- # Warning: the autoconf macros will fall back onto /lib/cpp for
- # C and C++ preprocessing *without* checking that /lib/cpp even
- # exists.
- if test "$CXXCPP" = "/lib/cpp" ; then
- if test ! -x "/lib/cpp" ; then
- AC_MSG_WARN([Warning: Autoconf error, could not find a C++ Preprocessor. Using false for the preprocessor so that tests will continue.])
- CXXCPP=false
- fi
- fi
- fi
-
- AX_CXX_NAMESPACE_STD
-
- if test "$ac_cv_cxx_namespaces" != yes ; then
- AC_MSG_WARN([The compiler $CXX does not support C++ namespaces. This may cause problems for the tests])
- fi
- AC_LANG_POP([C++])
-fi
-AM_CONDITIONAL([BUILD_CXX_TESTS],[test "X$cxxdir" = "cxx"])
-
-AC_LANG_C
-# IO
-iodir="#"
-if test "$enable_romio" != no ; then
- iodir=io
- AC_DEFINE(HAVE_MPI_IO,1,[Define if MPI-IO (really ROMIO) is included])
- if test "$FROM_MPICH2" = yes ; then
- # MPICH2 no longer uses and MPIO_Request
- pac_cv_have_mpio_request=no
- else
- AC_CACHE_CHECK([whether MPIO_Request is defined for MPI IO],
- pac_cv_have_mpio_request,[
- AC_COMPILE_IFELSE([
- AC_LANG_PROGRAM([#include "mpi.h"],[MPIO_Request r;])
- ],[pac_cv_have_mpio_request=yes],[pac_cv_have_mpio_request=no])
- ])
- fi
- if test "$pac_cv_have_mpio_request" = no ; then
- AC_DEFINE(MPIO_USES_MPI_REQUEST,,[Define if MPI IO uses MPI_Request])
- fi
-fi
-AC_SUBST(iodir)
-
-#
-# MPI_INTEGER16 is mentioned in only one place in MPI 2.1, and some
-# implementations may have missed it. Check to see if it is available in
-# C.
-if test "$FROM_MPICH2" = yes ; then
- # MPICH2 correctly includes this type.
- pac_cv_have_mpi_integer16=yes
-else
- AC_CACHE_CHECK([whether MPI_INTEGER16 is available],
- pac_cv_have_mpi_integer16,[
- AC_COMPILE_IFELSE([
- AC_LANG_PROGRAM([#include "mpi.h"],[
- MPI_Datatype t = MPI_INTEGER16;
- ])
- ],[pac_cv_have_mpi_integer16=yes],[pac_cv_have_mpi_integer16=no])
- ])
-fi
-if test "$pac_cv_have_mpi_integer16" = yes ; then
- AC_DEFINE(HAVE_MPI_INTEGER16,1,[Define if MPI_INTEGER16 is available])
-fi
-AC_CACHE_CHECK([whether MPI_2DOUBLE_COMPLEX is available],
-pac_cv_have_mpi_2double_complex,[
- AC_COMPILE_IFELSE([
- AC_LANG_PROGRAM([#include "mpi.h"],[
- MPI_Datatype t = MPI_2DOUBLE_COMPLEX;
- ])
- ],[
- pac_cv_have_mpi_2double_complex=yes
- ],[
- pac_cv_have_mpi_2double_complex=no
- ])
-])
-if test "$pac_cv_have_mpi_2double_complex" = yes ; then
- AC_DEFINE(HAVE_MPI_2DOUBLE_COMPLEX,1,[Define if MPI_2DOUBLE_COMPLEX is available])
-fi
-# 2COMPLEX was in MPI 1.0 and removed after that. This allows us to
-# test 2COMPLEX if it is present
-AC_CACHE_CHECK([whether MPI_2COMPLEX is available],
-pac_cv_have_mpi_2complex,[
- AC_COMPILE_IFELSE([
- AC_LANG_PROGRAM([#include "mpi.h"],[
- MPI_Datatype t = MPI_2COMPLEX;
- ])
- ],[
- pac_cv_have_mpi_2complex=yes
- ],[
- pac_cv_have_mpi_2complex=no
- ])
-])
-if test "$pac_cv_have_mpi_2complex" = yes ; then
- AC_DEFINE(HAVE_MPI_2COMPLEX,1,[Define if MPI_2COMPLEX is available])
-fi
-
-# MPI_Aint was intended as an address-sized int. However, MPI didn't
-# specify this - MPI_Aint must be large enough to hold an address-sized
-# integer, but it can be larger. To get clean compilation in some places,
-# we need a pointer-sized integer. The following code looks for one.
-
-# Make sure we are using the local C compiler (if the local
-# machine is different that the system that MPICC is for, then
-# set the cross-compilation feature)
-AC_CHECK_SIZEOF(void *)
-AC_CHECK_SIZEOF(int)
-AC_CHECK_SIZEOF(long)
-AC_CHECK_SIZEOF(long long)
-AC_CHECK_SIZEOF(short)
-POINTERINT=MPI_Aint
-AC_MSG_CHECKING([for C integer type of address size])
-for type in int long long_long short ; do
- eval len=\$ac_cv_sizeof_$type
- if test "$len" = "$ac_cv_sizeof_void_p" ; then
- POINTERINT=`echo $type | sed -e 's/_/ /'`
- break
- fi
-done
-AC_MSG_RESULT($POINTERINT)
-AC_DEFINE_UNQUOTED(POINTERINT_t,$POINTERINT,[POINTERINT_t is a pointer-sized integer])
-
-# Find perl; used to create some of the tests from template and
-# defintion files
-AC_PATH_PROG(PERL,perl)
-AC_SUBST(PERL)
-AC_SUBST(otherlangs)
-AC_SUBST(threadsdir)
-AC_SUBST(MPIEXEC)
-AC_SUBST(MAKE)
-if test -z "$MPILIBNAME" ; then MPILIBNAME=mpich ; fi
-AC_SUBST(MPILIBNAME)
-dnl MPI_SOURCE may be set as an environment variable giving the location
-dnl of the MPI implementation. This is used only in runtests to include
-dnl the location of the source of the MPI implementation into the XML
-dnl summary file
-AC_SUBST(MPI_SOURCE)
-
-if test "$FROM_MPICH2" = yes ; then
- # Set compilers/flags to be substituted in output files, e.g. Makefiles.
- LDFLAGS="$saveLDFLAGS"
- # note that the default definition of bindir is
- # '${exec_prefix}/bin'
- # so even if prefix is set, exec prefix is not until
- # the very last moment (i.e., not here).
- if test "X$exec_prefix" = "XNONE" ; then
- saveExec_prefix=$exec_prefix
- if test "X$prefix" = "XNONE" ; then
- # Use the default
- exec_prefix=$ac_default_prefix
- else
- exec_prefix=$prefix
- fi
- # Evaluate with the current setting of exec_prefix
- eval mpibindir=${bindir}
- exec_prefix=$saveExec_prefix
- else
- eval mpibindir=${bindir}
- fi
-
- # we did our tests with the base compilers, now point the make system at the
- # installed compiler wrappers for actually building the tests
- CC=$mpibindir/mpicc
- F77=$mpibindir/mpif77
- FC=$mpibindir/mpif90
- CXX=$mpibindir/mpicxx
- MPIEXEC=$mpibindir/mpiexec
-
- # Zero out the flags, since they are already contained in the compiler
- # wrapper scripts. Note that this will kill any flags that have been added
- # to the xFLAGS only in this script.
- #
- # The only real flags we seem to add in this script relate to cray
- # pointer support in Fortran, so we include that var here where
- # appropriate.
- CFLAGS=""
- CPPFLAGS=""
- LDFLAGS=""
- LIBS=""
- FFLAGS="$CRAYPTR_FFLAGS"
- FCFLAGS="$CRAYPTR_FCFLAGS"
- CXXFLAGS=""
-fi
-
-AC_OUTPUT_COMMANDS([chmod a+x maint/testmerge])
-AC_OUTPUT_COMMANDS([chmod a+x runtests])
-AC_OUTPUT_COMMANDS([chmod a+x manual/manyconnect])
-dnl Note that this format for AC_OUTPUT can cause problems for autoconf
-dnl run under cygwin
-AC_OUTPUT(maint/testmerge \
- runtests \
- Makefile \
- basic/Makefile \
- attr/Makefile \
- util/Makefile \
- coll/Makefile \
- comm/Makefile \
- datatype/Makefile \
- errhan/Makefile \
- group/Makefile \
- info/Makefile \
- init/Makefile \
- pt2pt/Makefile \
- rma/Makefile \
- spawn/Makefile \
- topo/Makefile \
- io/Makefile \
- f77/Makefile \
- f77/attr/Makefile \
- f77/attr/attraints.h \
- f77/pt2pt/attr1aints.h \
- f77/ext/add1size.h \
- f77/datatype/Makefile \
- f77/datatype/typeaints.h \
- f77/util/Makefile \
- f77/coll/Makefile \
- f77/comm/Makefile \
- f77/topo/Makefile \
- f77/init/Makefile \
- f77/rma/addsize.h \
- f77/pt2pt/Makefile \
- f77/info/Makefile \
- f77/spawn/Makefile \
- f77/spawn/type1aint.h \
- f77/rma/Makefile \
- f77/ext/Makefile \
- f77/ext/testlist \
- f77/io/Makefile \
- f77/io/iooffset.h \
- f77/io/iodisp.h \
- f77/io/ioaint.h \
- f90/Makefile \
- f90/attr/Makefile \
- f90/datatype/Makefile \
- f90/f90types/Makefile \
- f90/util/Makefile \
- f90/coll/Makefile \
- f90/comm/Makefile \
- f90/topo/Makefile \
- f90/init/Makefile \
- f90/pt2pt/Makefile \
- f90/rma/Makefile \
- f90/info/Makefile \
- f90/spawn/Makefile \
- f90/timer/Makefile \
- f90/ext/Makefile \
- f90/ext/testlist \
- f90/io/Makefile \
- f90/misc/Makefile \
- cxx/Makefile \
- cxx/util/Makefile \
- cxx/attr/Makefile \
- cxx/pt2pt/Makefile \
- cxx/comm/Makefile \
- cxx/coll/Makefile \
- cxx/errhan/Makefile \
- cxx/info/Makefile \
- cxx/datatype/Makefile \
- cxx/io/Makefile \
- cxx/init/Makefile \
- cxx/rma/Makefile \
- cxx/spawn/Makefile \
- threads/Makefile \
- threads/pt2pt/Makefile \
- threads/util/Makefile \
- threads/comm/Makefile \
- threads/init/Makefile \
- threads/spawn/Makefile \
- errors/Makefile \
- errors/attr/Makefile \
- errors/basic/Makefile \
- errors/coll/Makefile \
- errors/comm/Makefile \
- errors/datatype/Makefile \
- errors/faults/Makefile \
- errors/group/Makefile \
- errors/pt2pt/Makefile \
- errors/rma/Makefile \
- errors/spawn/Makefile \
- errors/topo/Makefile \
- errors/io/Makefile \
- errors/cxx/Makefile \
- errors/cxx/errhan/Makefile \
- errors/cxx/io/Makefile \
- errors/f77/Makefile \
- errors/f90/Makefile \
- manual/Makefile \
- manual/manyconnect \
- perf/Makefile \
- testlist \
- cxx/testlist \
- f77/testlist \
- f90/testlist \
- threads/testlist \
- errors/testlist \
- errors/cxx/testlist \
- )
Copied: mpich2/trunk/test/mpi/maint/configure.ac (from rev 9546, mpich2/trunk/test/mpi/maint/configure.in)
===================================================================
--- mpich2/trunk/test/mpi/maint/configure.ac (rev 0)
+++ mpich2/trunk/test/mpi/maint/configure.ac 2012-02-28 23:26:34 UTC (rev 9548)
@@ -0,0 +1,43 @@
+# -*- Mode: shell-script; -*-
+AC_PREREQ(2.59)
+AC_INIT
+#
+# Try to find the version
+if test -s "$srcdir/Version" ; then
+ VERSION="`cat $srcdir/Version`"
+else
+ VERSION="Unknown"
+fi
+AC_SUBST(VERSION)
+AC_PATH_PROG(PERL,perl)
+
+# Find the location of the mpich2 sources
+if test -z "$abs_srcdir" ; then
+ abs_srcdir=`cd $srcdir && pwd`
+fi
+abs_mpich2srcdir=`cd $abs_srcdir && cd .. && pwd`
+
+AC_SUBST(abs_mpich2srcdir)
+
+# Does xargs need the -r option to handle the case where the input
+# is empty (gnu utils do, Mac OSX does not accept -r)
+xargs_out=`echo "" | xargs ls | wc -l | sed -e 's/ //g'`
+if test "$xargs_out" != "0" ; then
+ XARGS_NODATA_OPT=-r
+fi
+AC_SUBST(XARGS_NODATA_OPT)
+
+AC_OUTPUT_COMMANDS([chmod a+x f77tof90] )
+# We have to redefine the variables that autoconf always substitutes and that
+# are used in simplemake
+# (These are left here incase we include simplemake with later versions
+# of the test suite)
+CFLAGS='@CFLAGS@'
+FFLAGS='@FFLAGS@'
+CXXFLAGS='@CXXFLAGS@'
+# The directory substitutions apparently don't work under Cygwin, so
+# simplemake manufactures these in a way that avoids triggering the
+# autoconf replacement.
+# Note that top_srcdir and srcdir are special cases (they must not
+# be changed in configure.ac because configure uses them to find other files)
+AC_OUTPUT(f77tof90)
Deleted: mpich2/trunk/test/mpi/maint/configure.in
===================================================================
--- mpich2/trunk/test/mpi/maint/configure.in 2012-02-28 23:25:23 UTC (rev 9547)
+++ mpich2/trunk/test/mpi/maint/configure.in 2012-02-28 23:26:34 UTC (rev 9548)
@@ -1,43 +0,0 @@
-# -*- Mode: shell-script; -*-
-AC_PREREQ(2.59)
-AC_INIT
-#
-# Try to find the version
-if test -s "$srcdir/Version" ; then
- VERSION="`cat $srcdir/Version`"
-else
- VERSION="Unknown"
-fi
-AC_SUBST(VERSION)
-AC_PATH_PROG(PERL,perl)
-
-# Find the location of the mpich2 sources
-if test -z "$abs_srcdir" ; then
- abs_srcdir=`cd $srcdir && pwd`
-fi
-abs_mpich2srcdir=`cd $abs_srcdir && cd .. && pwd`
-
-AC_SUBST(abs_mpich2srcdir)
-
-# Does xargs need the -r option to handle the case where the input
-# is empty (gnu utils do, Mac OSX does not accept -r)
-xargs_out=`echo "" | xargs ls | wc -l | sed -e 's/ //g'`
-if test "$xargs_out" != "0" ; then
- XARGS_NODATA_OPT=-r
-fi
-AC_SUBST(XARGS_NODATA_OPT)
-
-AC_OUTPUT_COMMANDS([chmod a+x f77tof90] )
-# We have to redefine the variables that autoconf always substitutes and that
-# are used in simplemake
-# (These are left here incase we include simplemake with later versions
-# of the test suite)
-CFLAGS='@CFLAGS@'
-FFLAGS='@FFLAGS@'
-CXXFLAGS='@CXXFLAGS@'
-# The directory substitutions apparently don't work under Cygwin, so
-# simplemake manufactures these in a way that avoids triggering the
-# autoconf replacement.
-# Note that top_srcdir and srcdir are special cases (they must not
-# be changed in configure.in because configure uses them to find other files)
-AC_OUTPUT(f77tof90)
Modified: mpich2/trunk/test/mpi/maint/updatefiles
===================================================================
--- mpich2/trunk/test/mpi/maint/updatefiles 2012-02-28 23:25:23 UTC (rev 9547)
+++ mpich2/trunk/test/mpi/maint/updatefiles 2012-02-28 23:26:34 UTC (rev 9548)
@@ -161,8 +161,8 @@
acSubversion=-1
acIncDirFlag=-I
for ver in 62 61 60 59 ; do
- rm -f .tmp/configure.in .tmp/configure
- cat >.tmp/configure.in <<EOF
+ rm -f .tmp/configure.ac .tmp/configure
+ cat >.tmp/configure.ac <<EOF
AC_PREREQ(2.$ver)
EOF
if (cd .tmp && $autoconf >/dev/null 2>&1 ) ; then
@@ -170,7 +170,7 @@
break
fi
done
-rm -f .tmp/configure.in .tmp/configure
+rm -f .tmp/configure.ac .tmp/configure
if [ "$acSubversion" -gt 0 ] ; then
acVersion="2.$acSubversion"
echo "You have autoconf version $acVersion."
@@ -204,7 +204,7 @@
# autom4te*.cache file; since this cache is not accurate, we delete it.
if [ ! -x maint/configure ] ; then
(cd maint && $autoconf && rm -rf autom4te*.cache )
-elif find maint -name 'configure.in' -newer 'maint/configure' >/dev/null 2>&1 ; then
+elif find maint -name 'configure.ac' -newer 'maint/configure' >/dev/null 2>&1 ; then
# The above relies on the Unix find command
(cd maint && $autoconf && rm -rf autom4te*.cache)
fi
@@ -276,7 +276,7 @@
#
# Just to make this even more interesting, the cygwin version of
# autoconf selects a version. But the code to so this causes --version
-# (and --help!) to fail unless there is a configure.in file in the current
+# (and --help!) to fail unless there is a configure.ac file in the current
# directory.
if [ $do_makefiles = yes ] ; then
if $mpich2dir/maint/simplemake -common=$mpich2dir/maint/makedefs \
@@ -294,7 +294,7 @@
#
# Create the configure files and run autoheader
# Eventually, make this a test for find available. Perhaps
-# find . -name configure.in > /dev/null 2>&1
+# find . -name configure.ac > /dev/null 2>&1
# The problem is that even though cygwin has find, the DOS find
# is identified first. We probably need a test for this case
fixBackWhackCtrlMBug=no
@@ -309,7 +309,7 @@
$autoconf $acIncDirFlag $mpich2dir/confdb && rm -rf autom4te*.cache
if [ ! -x configure ] ; then
# Check for a few allowed exceptions
- echo "Could not build configure from configure.in in $dir"
+ echo "Could not build configure from configure.ac in $dir"
echo "Aborting updatefiles!"
exit 1
fi
Modified: mpich2/trunk/winconfigure.wsf
===================================================================
--- mpich2/trunk/winconfigure.wsf 2012-02-28 23:25:23 UTC (rev 9547)
+++ mpich2/trunk/winconfigure.wsf 2012-02-28 23:26:34 UTC (rev 9548)
@@ -534,10 +534,10 @@
' Create a dictionary of all the datatype handles
'
unmatched_size_strs = ""
-set fin = f.OpenTextFile("configure.in")
+set fin = f.OpenTextFile("configure.ac")
contents = fin.ReadAll()
fin.Close()
-'set fin = f.OpenTextFile("src\binding\f77\configure.in")
+'set fin = f.OpenTextFile("src\binding\f77\configure.ac")
'contents = contents + fin.ReadAll()
'fin.Close()
'set dtypes = CreateDtypeDictionary(contents, false)
@@ -1083,7 +1083,7 @@
missing_datatypes = missing_datatypes & "MPI_C_LONG_DOUBLE_COMPLEX" & vbCrLf
MPI_C_LONG_DOUBLE_COMPLEX = "0x" + mpi_datatype_prefix + len_long_double__Complex + "42"
end if
-' Note that in configure.in MPI_AINT is named as MPI_AINT_DATATYPE - due to name collision
+' Note that in configure.ac MPI_AINT is named as MPI_AINT_DATATYPE - due to name collision
if dtypes.Exists("MPI_AINT_DATATYPE") then
MPI_AINT_W32 = dtypes.Item("MPI_AINT_DATATYPE")
else
@@ -1100,7 +1100,7 @@
end if
dtypes64.Add "MPI_AINT_W64", MPI_AINT_W64
-' Note that in configure.in MPI_OFFSET is named as MPI_OFFSET_DATATYPE - due to name collision
+' Note that in configure.ac MPI_OFFSET is named as MPI_OFFSET_DATATYPE - due to name collision
if dtypes.Exists("MPI_OFFSET_DATATYPE") then
MPI_OFFSET_W64 = dtypes.Item("MPI_OFFSET_DATATYPE")
else
More information about the mpich2-commits
mailing list