summaryrefslogtreecommitdiffstats
path: root/configure.in
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 /configure.in
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.
Diffstat (limited to 'configure.in')
-rw-r--r--configure.in195
1 files changed, 149 insertions, 46 deletions
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