summaryrefslogtreecommitdiffstats
path: root/configure
diff options
context:
space:
mode:
Diffstat (limited to 'configure')
-rwxr-xr-xconfigure201
1 files changed, 105 insertions, 96 deletions
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