summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRobb Matzke <matzke@llnl.gov>1999-03-03 23:17:48 (GMT)
committerRobb Matzke <matzke@llnl.gov>1999-03-03 23:17:48 (GMT)
commitea3624e133ef35ec9c2c3f816a3afdbfb6b83156 (patch)
tree8d13c1c600a8ab25da627a64aa61818f00695098
parent2925631a496cbd9890e967946b46c974998b13cd (diff)
downloadhdf5-ea3624e133ef35ec9c2c3f816a3afdbfb6b83156.zip
hdf5-ea3624e133ef35ec9c2c3f816a3afdbfb6b83156.tar.gz
hdf5-ea3624e133ef35ec9c2c3f816a3afdbfb6b83156.tar.bz2
[svn-r1115] Changes since 19990302
---------------------- ./INSTALL ./configure.in ./configure [REGENERATED] ./src/H5config.h.in [REGENERATED] Improvements for parallel library. If you have a properly working mpicc you should be able to just say: $ CC=mpicc ./configure and you will see checking for mpirun... /usr/local/mpi/bin/mpirun checking for parallel support files... skipped checking how to run on one processor... /usr/local/mpi/bin/mpirun -np 1 checking how to run in parallel... /usr/local/mpi/bin/mpirun -np $$NPROCS To quote from the INSTALL file.... *** Parallel vs. serial library The HDF5 library can be configured to use MPI and MPI-IO for parallelizm on a distributed multi-processor system. The easy way to do this is to have a properly installed parallel compiler (e.g., MPICH's mpicc or IBM's mpcc) and supply that executable as the value of the CC environment variable: [NOTE: mpcc is not tested yet] $ CC=mpcc ./configure $ CC=/usr/local/mpi/bin/mpicc ./configure If no such wrapper script is available then you must specify your normal C compiler along with the distribution of MPI/MPI-IO which is to be used (values other than `mpich' will be added at a later date): $ ./configure --enable-parallel=mpich If the MPI/MPI-IO include files and/or libraries cannot be found by the compiler then their directories must be given as arguments to CPPFLAGS and/or LDFLAGS: $ CPPFLAGS=-I/usr/local/mpi/include \ LDFLAGS=-L/usr/local/mpi/lib/LINUX/ch_p4 \ ./configure --enable-parallel=mpich If a parallel library is being built then configure attempts to determine how to run a parallel application on one processor and on many processors. If the compiler is mpicc and the user hasn't specified values for RUNSERIAL and RUNPARALLEL then configure chooses `mpirun' from the same directory as `mpicc': RUNSERIAL: /usr/local/mpi/bin/mpirun -np 1 RUNPARALLEL: /usr/local/mpi/bin/mpirun -np $${NPROCS:=2} The `$${NPROCS:=2}' will be substituted with the value of the NPROCS environment variable at the time `make check' is run (or the value 2). ./testpar/Makefile.in Saying `make check' (or `make test') will run the tests on two processors by default. If you define NPROCS then that many processors are used instead: $ NPROCS=4 make check ./configure.in Fixed (hopefully) bugs with detecting whether __attribute__ and __FUNCTION__ are special keywords for the compiler. ./Makefile.in Saying `make install' from the top level directory shows instructions for using shared libraries. ./config/commence.in ./src/Makefile.in ./test/Makefile.in ./testpar/Makefile.in ./tools/Makefile.in Moved the @top_srcdir@ into the makefiles because it was expanded too early and had the wrong value. ./INSTALL Added a warning that if the wrong version of hdf4 tools are installed then `make check' will fail in the tools directory.
-rw-r--r--INSTALL112
-rw-r--r--Makefile.in10
-rw-r--r--config/commence.in2
-rwxr-xr-xconfigure201
-rw-r--r--configure.in195
-rw-r--r--src/H5config.h.in7
-rw-r--r--src/Makefile.in1
-rw-r--r--test/Makefile.in1
-rw-r--r--testpar/Makefile.in1
-rw-r--r--tools/Makefile.in1
10 files changed, 364 insertions, 167 deletions
diff --git a/INSTALL b/INSTALL
index 7c80c86..32d78d4 100644
--- a/INSTALL
+++ b/INSTALL
@@ -99,20 +99,20 @@ INSTALL.ascired for instructions.
** Configuring
HDF5 uses the GNU autoconf system for configuration, which
detects various features of the host system and creates the
- various Makefiles. On most systems it should be sufficient to
- say:
+ Makefiles. On most systems it should be sufficient to say:
+ $ ./configure OR
$ sh configure
The configuration process can be controlled through
environment variables, command-line switches, and host
- configuration files. For a complete list of switches say `sh
- configure --help'. The host configuration files are located in
- the `config' directory and are based on architecture name,
+ configuration files. For a complete list of switches say
+ `./configure --help'. The host configuration files are located
+ in the `config' directory and are based on architecture name,
vendor name, and/or operating system which are displayed near
the beginning of the `configure' output. The host config file
- influences the behavior of configure by setting shell
- variables.
+ influences the behavior of configure by setting or augmenting
+ shell variables.
*** Specifying the installation directories
Typing `make install' will install the HDF5 library, header
@@ -123,6 +123,10 @@ INSTALL.ascired for instructions.
$ ./configure --prefix=/home/robb
+ If shared libraries are being built (the default) then the
+ final home of the shared library must be specified with this
+ switch before the library and executables are built.
+
*** Using an alternate C compiler
By default, configure will look for the C compiler by trying
`gcc' and `cc'. However, if the environment variable "CC" is
@@ -141,9 +145,8 @@ INSTALL.ascired for instructions.
$ CC=/usr/local/mpi/bin/mpicc ./configure
- On Irix 6.x systems the default compiler is `cc -n32' and on
- Irix64 it is `cc -64'. To use an alternate compiler specify it
- with the CC variable:
+ On Irix64 the default compiler is `cc -64'. To use an
+ alternate compiler specify it with the CC variable:
$ CC='cc -o32' ./configure
@@ -155,7 +158,7 @@ INSTALL.ascired for instructions.
$ CFLAGS=-g ./confgure --enable-production
-*** Speicifying other programs
+*** Specifying other programs
The build system has been tuned for use with GNU make but
works also with other versions of make. If the `make' command
runs a non-GNU version but a GNU version is available under a
@@ -171,6 +174,27 @@ INSTALL.ascired for instructions.
of the `ar' and `ranlib' (or `:') commands to override values
detected by configure.
+ The HDF5 library, include files, and utilities are installed
+ during `make install' (described below) with a BSD-compatible
+ install program detected automatically by configure. If none
+ is found then the shell script bin/install-sh is
+ used. Configure doesn't check that the install script actually
+ works, but if a bad install is detected on your system (e.g.,
+ on the ASCI blue machine as of March 2, 1999) you have two
+ choices:
+
+ 1. Copy the bin/install-sh program to your $HOME/bin
+ directory, name it `install', and make sure that
+ $HOME/bin is searched before the system bin
+ directories.
+
+ 2. Specify the full path name of the `install-sh' program
+ as the value of the INSTALL environment variable. Note:
+ do not use `cp' or some other program in place of
+ install because the HDF5 makefiles also use the install
+ program to also change file ownership and/or access
+ permissions.
+
*** Specifying other libraries and headers
Configure searches the standard places (those places known by
the systems compiler) for include files and header
@@ -188,15 +212,22 @@ INSTALL.ascired for instructions.
CPPFLAGS and LDFLAGS variables) for the zlib headers and
library. The search can be disabled by specifying
`--without-zlib' or alternate directories can be specified
- with `--with-zlib=INCDIR,LIBDIR'.
+ with `--with-zlib=INCDIR,LIBDIR' or through the CPPFLAGS and
+ LDFLAGS variables:
$ ./configure --with-zlib=/usr/unsup/include,/usr/unsup/lib
+ $ CPPFLAGS=-I/usr/unsup/include \
+ LDFLAGS=-L/usr/unsup/lib \
+ ./configure
+
The HDF5-to-HDF4 conversion tool requires the HDF4 library and
header files which are detected the same way as zlib. The
switch to give to configure is `--with-hdf4'. Note that HDF5
requires a newer version of zlib than the one shipped with
- some versions of HDF4.
+ some versions of HDF4. Also, unless you have the "correct"
+ version of hdf4 the confidence testing will fail in the tools
+ directory.
*** Static versus shared linking
The build process will create static libraries on all systems
@@ -217,7 +248,9 @@ INSTALL.ascired for instructions.
be compiled for profiling with gprof by saying
`--enable-production=profile'.
- $ ./configure --enable-production
+ $ ./configure --disable-production #symbolic debugging
+ $ ./configure --enable-production #optimized code
+ $ ./configure --enable-production=profile #for use with gprof
Regardless of whether support for symbolic debugging is
enabled, the library also is able to perform runtime debugging
@@ -231,13 +264,17 @@ INSTALL.ascired for instructions.
supported releases is no debugging (debugging can incur a
significant runtime penalty).
- $ ./configure --enable-debug=s,t
+ $ ./configure --enable-debug=s,t #debug only H5S and H5T
+ $ ./configure --enable-debug #debug normal packages
+ $ ./configure --enable-debug=all #debug all packages
+ $ ./configure --disable-debug #no debugging
HDF5 is also able to print a trace of all API function calls,
their arguments, and the return values. To enable or disable
- the ability to trace the API say `--enable-trace' or
- `--disable-trace'. The tracing must also be enabled at runtime
- to see any output (see Debugging.html).
+ the ability to trace the API say `--enable-trace' (the default
+ for snapthots) or `--disable-trace' (the default for public
+ releases). The tracing must also be enabled at runtime to see
+ any output (see Debugging.html).
*** Large (>2GB) vs. small (<2GB) file capability
In order to read or write files that could potentially be
@@ -250,6 +287,45 @@ INSTALL.ascired for instructions.
$ ./configure --disable-hsizet
+*** Parallel vs. serial library
+ The HDF5 library can be configured to use MPI and MPI-IO for
+ parallelizm on a distributed multi-processor system. The easy
+ way to do this is to have a properly installed parallel
+ compiler (e.g., MPICH's mpicc or IBM's mpcc) and supply that
+ executable as the value of the CC environment variable:
+
+ $ CC=mpcc ./configure
+ $ CC=/usr/local/mpi/bin/mpicc ./configure
+
+ If no such wrapper script is available then you must specify
+ your normal C compiler along with the distribution of
+ MPI/MPI-IO which is to be used (values other than `mpich' will
+ be added at a later date):
+
+ $ ./configure --enable-parallel=mpich
+
+ If the MPI/MPI-IO include files and/or libraries cannot be
+ found by the compiler then their directories must be given as
+ arguments to CPPFLAGS and/or LDFLAGS:
+
+ $ CPPFLAGS=-I/usr/local/mpi/include \
+ LDFLAGS=-L/usr/local/mpi/lib/LINUX/ch_p4 \
+ ./configure --enable-parallel=mpich
+
+ If a parallel library is being built then configure attempts
+ to determine how to run a parallel application on one
+ processor and on many processors. If the compiler is mpicc
+ and the user hasn't specified values for RUNSERIAL and
+ RUNPARALLEL then configure chooses `mpirun' from the same
+ directory as `mpicc':
+
+ RUNSERIAL: /usr/local/mpi/bin/mpirun -np 1
+ RUNPARALLEL: /usr/local/mpi/bin/mpirun -np $${NPROCS:=2}
+
+ The `$${NPROCS:=2}' will be substituted with the value of the
+ NPROCS environment variable at the time `make check' is run
+ (or the value 2).
+
** Building
The library, confidence tests, and programs can be build by
saying just
diff --git a/Makefile.in b/Makefile.in
index 33b5ac7..1a1c446 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -9,6 +9,7 @@
# each subdirectory manually.
#
@COMMENCE@
+top_srcdir=@top_srcdir@
# Subdirectories in build-order
SUBDIRS=src test tools @TESTPARALLEL@
@@ -62,11 +63,17 @@ SUBDIRS=src test tools @TESTPARALLEL@
# make used in combination with gcc will maintain dependency
# information automatically.
#
-lib progs tests check test _test install uninstall TAGS dep depend:
+lib progs tests check test _test uninstall TAGS dep depend:
@@SETX@; for d in $(SUBDIRS); do \
(cd $$d && $(MAKE) $@) || exit 1; \
done
+install:
+ @@SETX@; for d in $(SUBDIRS); do \
+ (cd $$d && $(MAKE) $@) || exit 1; \
+ done
+ @$(LT) --mode=finish $(libdir);
+
# Number format detection
H5detect:
(cd src && $(MAKE) $@)
@@ -99,3 +106,4 @@ maintainer-clean:
done
-$(RM) config.cache config.log config.status src/H5config.h
-$(RM) configure src/H5config.h.in
+
diff --git a/config/commence.in b/config/commence.in
index 3fe2f30..3becee3 100644
--- a/config/commence.in
+++ b/config/commence.in
@@ -37,7 +37,7 @@ libdir=@libdir@
includedir=@includedir@
# Shared libraries
-LT=@top_srcdir@/libtool
+LT=$(top_srcdir)/libtool
LT_COMPILE=$(LT) --mode=compile $(CC)
LT_LINK_LIB=$(LT) --mode=link $(CC) -rpath $(libdir)
LT_LINK_EXE=$(LT) --mode=link $(CC)
diff --git a/configure b/configure
index e87b0f0..a203070 100755
--- a/configure
+++ b/configure
@@ -95,7 +95,7 @@ ac_help="$ac_help
ac_help="$ac_help
--disable-trace Disable API tracing capability"
ac_help="$ac_help
- --enable-parallel=mpio Enable parallel support with MPIO"
+ --enable-parallel=TYPE Search for MPI-IO and MPI support files"
# Initialize some variables set by options.
# The variables have the same names as the options, with
@@ -4387,7 +4387,7 @@ cat > conftest.$ac_ext <<EOF
#include "confdefs.h"
int main() {
-int __attribute__((unused)) f(void){return 1;}
+int __attribute__((unused)) x
; return 0; }
EOF
if { (eval echo configure:4394: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
@@ -4412,7 +4412,7 @@ cat > conftest.$ac_ext <<EOF
#include "confdefs.h"
int main() {
-int f(void){return __FUNCTION__;}
+(void)__FUNCTION__
; return 0; }
EOF
if { (eval echo configure:4419: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
@@ -4519,50 +4519,84 @@ else
CPPFLAGS="$CPPFLAGS -UH5_DEBUG_API"
fi
-# Check whether --enable-parallel or --disable-parallel was given.
-if test "${enable_parallel+set}" = set; then
- enableval="$enable_parallel"
- PARALLEL=$enableval
-fi
-echo $ac_n "checking for parallel support""... $ac_c" 1>&6
-echo "configure:4530: checking for parallel support" >&5;
+case "$CC_BASENAME" in
+ mpicc)
+ # The mpich compiler. Use mpirun from the same directory if it
+ # exists.
+ PARALLEL=yes
+ echo $ac_n "checking for mpirun""... $ac_c" 1>&6
+echo "configure:4533: checking for mpirun" >&5
+ CC_path=`type -path $CC`
+ CC_path=`echo $CC_path |sed -e 's/\/mpicc$//'`
+ if test -x $CC_path/mpirun; then
+ echo "$ac_t""$CC_path/mpirun" 1>&6
+ if test "X-" = "X-$RUNSERIAL"; then
+ RUNSERIAL="$CC_path/mpirun -np 1"
+ fi
+ if test "X-" = "X-$RUNPARALLEL"; then
+ RUNPARALLEL="$CC_path/mpirun -np \$\${NPROCS:=2}"
+ fi
+ else
+ echo "$ac_t""none" 1>&6
+ fi
+ ;;
-if test "mpicc" = "$CC_BASENAME" -a "X-" = "X-$PARALLEL"; then
- PARALLEL=mpio
-fi
+ mpcc)
+ # The IBM compiler
+ PARALLEL=yes
+ ;;
-case "X-$PARALLEL" in
+ *)
+ # Probably not a parallel compiler, but if `--enable-parallel'
+ # is defined below then we're still building a parallel hdf5.
+ ;;
+esac
- X-|X-no)
- # Parallel support is not enabled
- echo "$ac_t""disabled" 1>&6
- ;;
+# Check whether --enable-parallel or --disable-parallel was given.
+if test "${enable_parallel+set}" = set; then
+ enableval="$enable_parallel"
+ :
+fi
- X-mpio|X-yes)
- # Use MPIO. Define HAVE_PARALLEL in src/H5config.h (comes from
- # ./acconfig.h) and augment the include and library search paths
- # (it doesn't hurt to have extra paths). Then check for header
- # files and libraries. Some extra source files are added to the
- # list also so we don't have to ifdef out the whole file.
- echo "$ac_t""mpio" 1>&6
- cat >> confdefs.h <<\EOF
-#define HAVE_PARALLEL 1
-EOF
- echo $ac_n "checking for MPI_Init in -lmpi""... $ac_c" 1>&6
-echo "configure:4558: checking for MPI_Init in -lmpi" >&5
-ac_lib_var=`echo mpi'_'MPI_Init | sed 'y%./+-%__p_%'`
+echo $ac_n "checking for parallel support files""... $ac_c" 1>&6
+echo "configure:4568: checking for parallel support files" >&5
+case "X-$enable_parallel" in
+ X-|X-no|X-none)
+ # Either we are not compiling for parallel or the header and library
+ # files and locations are known to the compiler (this is the case
+ # for a correct installation of mpicc for instance).
+ echo "$ac_t""skipped" 1>&6
+ ;;
+
+ X-yes|X-mpich)
+ # For normal mpich installation the compiler, mpicc, should know
+ # where the MPI and MPI-IO header files are located and know which
+ # extra libraries need to be linked and will supply appropriate
+ # flags to the underlying compiler.
+ echo "$ac_t""mpich" 1>&6
+ echo "configure: warning: *** Why aren't you using an mpicc compiler? ***" 1>&2
+
+ # Apparently mpicc isn't installed correctly so configure must search
+ # for the header files and libraries. Actually we only have to search
+ # for the libraries in order to get the onto the link line, the user
+ # will have already told us about the locations. Fail if something
+ # is missing.
+ PARALLEL=yes
+ echo $ac_n "checking for MPI_Init in -lmpich""... $ac_c" 1>&6
+echo "configure:4592: checking for MPI_Init in -lmpich" >&5
+ac_lib_var=`echo mpich'_'MPI_Init | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
ac_save_LIBS="$LIBS"
-LIBS="-lmpi $LIBS"
+LIBS="-lmpich $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 4566 "configure"
+#line 4600 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
@@ -4573,7 +4607,7 @@ int main() {
MPI_Init()
; return 0; }
EOF
-if { (eval echo configure:4577: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:4611: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
@@ -4588,86 +4622,61 @@ LIBS="$ac_save_LIBS"
fi
if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
echo "$ac_t""yes" 1>&6
- ac_tr_lib=HAVE_LIB`echo mpi | sed -e 's/[^a-zA-Z0-9_]/_/g' \
+ ac_tr_lib=HAVE_LIB`echo mpich | sed -e 's/[^a-zA-Z0-9_]/_/g' \
-e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
cat >> confdefs.h <<EOF
#define $ac_tr_lib 1
EOF
- LIBS="-lmpi $LIBS"
+ LIBS="-lmpich $LIBS"
else
echo "$ac_t""no" 1>&6
+{ echo "configure: error: no mpich library" 1>&2; exit 1; }
fi
- echo $ac_n "checking for MPI_File_open in -lmpio""... $ac_c" 1>&6
-echo "configure:4605: checking for MPI_File_open in -lmpio" >&5
-ac_lib_var=`echo mpio'_'MPI_File_open | sed 'y%./+-%__p_%'`
-if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
-else
- ac_save_LIBS="$LIBS"
-LIBS="-lmpio $LIBS"
-cat > conftest.$ac_ext <<EOF
-#line 4613 "configure"
-#include "confdefs.h"
-/* Override any gcc2 internal prototype to avoid an error. */
-/* We use char because int might match the return type of a gcc2
- builtin and then its argument prototype would still apply. */
-char MPI_File_open();
+ ;;
-int main() {
-MPI_File_open()
-; return 0; }
-EOF
-if { (eval echo configure:4624: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
- rm -rf conftest*
- eval "ac_cv_lib_$ac_lib_var=yes"
-else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- eval "ac_cv_lib_$ac_lib_var=no"
-fi
-rm -f conftest*
-LIBS="$ac_save_LIBS"
+ *)
+ echo "$ac_t""error" 1>&6
+ { echo "configure: error: \"$enable_parallel\" is not a valid parallel search type" 1>&2; exit 1; }
+ ;;
+esac
+if test "X-" != "X-$PARALLEL"; then
+ TESTPARALLEL=testpar
fi
-if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
- echo "$ac_t""yes" 1>&6
- ac_tr_lib=HAVE_LIB`echo mpio | sed -e 's/[^a-zA-Z0-9_]/_/g' \
- -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
- cat >> confdefs.h <<EOF
-#define $ac_tr_lib 1
+
+if test "X-" != "X-$PARALLEL"; then
+ # We are building a parallel library
+ cat >> confdefs.h <<\EOF
+#define HAVE_PARALLEL 1
EOF
- LIBS="-lmpio $LIBS"
-else
- echo "$ac_t""no" 1>&6
-fi
+ # Display what we found about running programs
+ echo $ac_n "checking how to run on one processor""... $ac_c" 1>&6
+echo "configure:4660: checking how to run on one processor" >&5
+ echo "$ac_t""$RUNSERIAL" 1>&6
+ echo $ac_n "checking how to run in parallel""... $ac_c" 1>&6
+echo "configure:4663: checking how to run in parallel" >&5
+ echo "$ac_t""$RUNPARALLEL" 1>&6
- if test "X-" = "X-$RUNSERIAL" -o "X-none" = "X-$RUNSERIAL"; then
- RUNSERIAL=
- fi
- if test "X-" = "X-$RUNPARALLEL"; then
- RUNPARALLEL="mpirun -np 2"
- elif test "X-none" = "X-$RUNPARALLEL"; then
- RUNPARALLEL=
- fi
- if test "X-" = "X-$TESTPARALLEL"; then
- TESTPARALLEL="testpar"
- elif test "X-none" = "X-$TESTPARALLEL"; then
- TESTPARALLEL=
- fi
- ;;
-
- *)
- { echo "configure: error: unknown parallel support: $PARALLEL" 1>&2; exit 1; }
- ;;
-esac
-
+ # There *must* be some way to run in parallel even if it's just the
+ # word `none'.
+ if test "X-" = "X-$RUNPARALLEL"; then
+ { echo "configure: error: no way to run a parallel program" 1>&2; exit 1; }
+ fi
+ # If RUNSERIAL or RUNPARALLEL is the word `none' then replace it with
+ # the empty string.
+ if test "X-none" = "X-$RUNSERIAL"; then
+ RUNSERIAL=
+ fi
+ if test "X-none" = "X-$RUNPARALLEL"; then
+ RUNPARALLEL=
+ fi
+fi
COMMENCE=config/commence
CONCLUDE=config/conclude
diff --git a/configure.in b/configure.in
index 36f86a8..52673d0 100644
--- a/configure.in
+++ b/configure.in
@@ -423,13 +423,13 @@ AC_C_CONST
AC_C_INLINE
AC_MSG_CHECKING(for __attribute__ extension)
-AC_TRY_COMPILE(,[int __attribute__((unused)) f(void){return 1;}],
+AC_TRY_COMPILE(,[int __attribute__((unused)) x],
AC_DEFINE(HAVE_ATTRIBUTE)
AC_MSG_RESULT(yes),
AC_MSG_RESULT(no))
AC_MSG_CHECKING(for __FUNCTION__ extension)
-AC_TRY_COMPILE(,[int f(void){return __FUNCTION__;}],
+AC_TRY_COMPILE(,[(void)__FUNCTION__],
AC_DEFINE(HAVE_FUNCTION)
AC_MSG_RESULT(yes),
AC_MSG_RESULT(no))
@@ -506,60 +506,163 @@ else
fi
dnl ----------------------------------------------------------------------
-dnl Check for parallel support. If the base name of the compiler is `mpicc'
-dnl then assume parallel support is `mpio' unless specified otherwise by
-dnl the user.
+dnl The following variables are used to distinguish between building a
+dnl serial and parallel library.
+dnl
+dnl HAVE_PARALLEL -- defined in H5config.h if we are building
+dnl a parallel library even if configure wasn't
+dnl able to find some header file or library that
+dnl might be required. This is defined if the
+dnl compiler looks like a parallel compiler (e.g.,
+dnl mpicc or mpcc) or if the user explicitly states
+dnl that a parallel library is being built by supplying
+dnl the `--enable-parallel' configure switch.
+dnl
+dnl PARALLEL -- This variable is set to a non-null value if
+dnl configure thinks we're compiling a parallel
+dnl version of the library.
+dnl
+dnl RUNSERIAL -- This is a command which will be prepended to
+dnl the executable name to run the executable using
+dnl a single process. For serial versions of the
+dnl library this will normally be empty. For parallel
+dnl versions it might be something like `mpirun -np 1'.
+dnl The value of this variable is substituted in *.in
+dnl files.
+dnl
+dnl RUNPARALLEL -- This is a command which will be prepended to
+dnl the executable name to run the executable on
+dnl multiple processors. For the serial library the
+dnl value will normally be the empty string. For
+dnl parallel library it should be something like
+dnl `mpi -np $$NPROCS' where NPROCS will eventually
+dnl contain the number of processors on which to run
+dnl the executable (the double dollarsigns are to
+dnl protect the expansion until make executes the
+dnl command). The value of this variable is
+dnl substituted in *.in files.
dnl
-AC_ARG_ENABLE(parallel,
- [ --enable-parallel=mpio Enable parallel support with MPIO],
- PARALLEL=$enableval)
-AC_MSG_CHECKING(for parallel support);
AC_SUBST(RUNSERIAL)
AC_SUBST(RUNPARALLEL)
AC_SUBST(TESTPARALLEL)
-if test "mpicc" = "$CC_BASENAME" -a "X-" = "X-$PARALLEL"; then
- PARALLEL=mpio
-fi
+dnl ----------------------------------------------------------------------
+dnl If the compiler is obviously a parallel compiler then we're building
+dnl a parallel version of hdf5 and should define HAVE_PARALLEL. Furthermore,
+dnl the name of the compiler might tell us how to run the resulting
+dnl executable. For `mpicc' the executable should be run with `mpirun' from
+dnl the same directory as mpicc if it exists.
+dnl
+case "$CC_BASENAME" in
+ mpicc)
+ # The mpich compiler. Use mpirun from the same directory if it
+ # exists.
+ PARALLEL=yes
+ AC_MSG_CHECKING(for mpirun)
+ CC_path=`type -path $CC`
+ CC_path=`echo $CC_path |sed -e 's/\/mpicc$//'`
+ if test -x $CC_path/mpirun; then
+ AC_MSG_RESULT($CC_path/mpirun)
+ if test "X-" = "X-$RUNSERIAL"; then
+ RUNSERIAL="$CC_path/mpirun -np 1"
+ fi
+ if test "X-" = "X-$RUNPARALLEL"; then
+ RUNPARALLEL="$CC_path/mpirun -np \$\${NPROCS:=2}"
+ fi
+ else
+ AC_MSG_RESULT(none)
+ fi
+ ;;
-case "X-$PARALLEL" in
-
- X-|X-no)
- # Parallel support is not enabled
- AC_MSG_RESULT(disabled)
- ;;
-
- X-mpio|X-yes)
- # Use MPIO. Define HAVE_PARALLEL in src/H5config.h (comes from
- # ./acconfig.h) and augment the include and library search paths
- # (it doesn't hurt to have extra paths). Then check for header
- # files and libraries. Some extra source files are added to the
- # list also so we don't have to ifdef out the whole file.
- AC_MSG_RESULT(mpio)
- AC_DEFINE(HAVE_PARALLEL)
- AC_CHECK_LIB(mpi,MPI_Init)
- AC_CHECK_LIB(mpio,MPI_File_open)
- if test "X-" = "X-$RUNSERIAL" -o "X-none" = "X-$RUNSERIAL"; then
- RUNSERIAL=
- fi
- if test "X-" = "X-$RUNPARALLEL"; then
- RUNPARALLEL="mpirun -np 2"
- elif test "X-none" = "X-$RUNPARALLEL"; then
- RUNPARALLEL=
- fi
- if test "X-" = "X-$TESTPARALLEL"; then
- TESTPARALLEL="testpar"
- elif test "X-none" = "X-$TESTPARALLEL"; then
- TESTPARALLEL=
- fi
- ;;
+ mpcc)
+ # The IBM compiler
+ PARALLEL=yes
+ ;;
*)
- AC_MSG_ERROR(unknown parallel support: $PARALLEL)
- ;;
+ # Probably not a parallel compiler, but if `--enable-parallel'
+ # is defined below then we're still building a parallel hdf5.
+ ;;
esac
-
+dnl ----------------------------------------------------------------------
+dnl What header files and libraries do we have to look for for parallel
+dnl support? For the most part, search paths are already specified with
+dnl CPPFLAGS and LDFLAGS or are known to the compiler. If the user says
+dnl `--disable-parallel' but specifies a known parallel compiler (like mpicc
+dnl or mpcc) then parallel support is enabled but configure doesn't search
+dnl for any parallel header files or libraries.
+dnl
+AC_ARG_ENABLE(parallel,
+ [ --enable-parallel=TYPE Search for MPI-IO and MPI support files])
+
+AC_MSG_CHECKING(for parallel support files)
+case "X-$enable_parallel" in
+ X-|X-no|X-none)
+ # Either we are not compiling for parallel or the header and library
+ # files and locations are known to the compiler (this is the case
+ # for a correct installation of mpicc for instance).
+ AC_MSG_RESULT(skipped)
+ ;;
+
+ X-yes|X-mpich)
+ # For normal mpich installation the compiler, mpicc, should know
+ # where the MPI and MPI-IO header files are located and know which
+ # extra libraries need to be linked and will supply appropriate
+ # flags to the underlying compiler.
+ AC_MSG_RESULT(mpich)
+ AC_MSG_WARN(*** Why aren't you using an mpicc compiler? ***)
+
+ # Apparently mpicc isn't installed correctly so configure must search
+ # for the header files and libraries. Actually we only have to search
+ # for the libraries in order to get the onto the link line, the user
+ # will have already told us about the locations. Fail if something
+ # is missing.
+ PARALLEL=yes
+ AC_CHECK_LIB(mpich,MPI_Init,,AC_MSG_ERROR(no mpich library))
+ ;;
+
+ *)
+ AC_MSG_RESULT(error)
+ AC_MSG_ERROR(\"$enable_parallel\" is not a valid parallel search type)
+ ;;
+esac
+
+dnl ----------------------------------------------------------------------
+dnl Should the `testpar' directory participate in the build?
+dnl
+if test "X-" != "X-$PARALLEL"; then
+ TESTPARALLEL=testpar
+fi
+
+dnl ----------------------------------------------------------------------
+dnl Print some other parallel information and do some sanity checks.
+dnl
+if test "X-" != "X-$PARALLEL"; then
+ # We are building a parallel library
+ AC_DEFINE(HAVE_PARALLEL)
+
+ # Display what we found about running programs
+ AC_MSG_CHECKING(how to run on one processor)
+ AC_MSG_RESULT($RUNSERIAL)
+ AC_MSG_CHECKING(how to run in parallel)
+ AC_MSG_RESULT($RUNPARALLEL)
+
+ # There *must* be some way to run in parallel even if it's just the
+ # word `none'.
+ if test "X-" = "X-$RUNPARALLEL"; then
+ AC_MSG_ERROR(no way to run a parallel program)
+ fi
+
+ # If RUNSERIAL or RUNPARALLEL is the word `none' then replace it with
+ # the empty string.
+ if test "X-none" = "X-$RUNSERIAL"; then
+ RUNSERIAL=
+ fi
+ if test "X-none" = "X-$RUNPARALLEL"; then
+ RUNPARALLEL=
+ fi
+fi
dnl ----------------------------------------------------------------------
dnl Build the Makefiles. Almost every Makefile.in will begin with the line
diff --git a/src/H5config.h.in b/src/H5config.h.in
index dbd9072..eed36d5 100644
--- a/src/H5config.h.in
+++ b/src/H5config.h.in
@@ -245,11 +245,8 @@
/* Define if you have the mfhdf library (-lmfhdf). */
#undef HAVE_LIBMFHDF
-/* Define if you have the mpi library (-lmpi). */
-#undef HAVE_LIBMPI
-
-/* Define if you have the mpio library (-lmpio). */
-#undef HAVE_LIBMPIO
+/* Define if you have the mpich library (-lmpich). */
+#undef HAVE_LIBMPICH
/* Define if you have the nsl library (-lnsl). */
#undef HAVE_LIBNSL
diff --git a/src/Makefile.in b/src/Makefile.in
index 2c7b732..42e8b99 100644
--- a/src/Makefile.in
+++ b/src/Makefile.in
@@ -5,6 +5,7 @@
#
#
@COMMENCE@
+top_srcdir=@top_srcdir@
TRACE=perl ../bin/trace
# Add `-I.' to the C preprocessor flags.
diff --git a/test/Makefile.in b/test/Makefile.in
index 0804412..dcc5f2f 100644
--- a/test/Makefile.in
+++ b/test/Makefile.in
@@ -5,6 +5,7 @@
#
#
@COMMENCE@
+top_srcdir=@top_srcdir@
# Add include directory to the C preprocessor flags and the h5test and hdf5
# libraries to the library list.
diff --git a/testpar/Makefile.in b/testpar/Makefile.in
index 21d71d4..64c3b50 100644
--- a/testpar/Makefile.in
+++ b/testpar/Makefile.in
@@ -5,6 +5,7 @@
#
#
@COMMENCE@
+top_srcdir=@top_srcdir@
# Add the include directory to the C preprocessor flags the the hdf5 library
# to the library list.
diff --git a/tools/Makefile.in b/tools/Makefile.in
index 1c75c00..723d930 100644
--- a/tools/Makefile.in
+++ b/tools/Makefile.in
@@ -5,6 +5,7 @@
#
#
@COMMENCE@
+top_srcdir=@top_srcdir@
# Add include directory to the C preprocessor flags, add -lh5tools and
# -lhdf5 to the list of libraries.