From 4a10dbe01136ec99ff776a3ba677db959a465924 Mon Sep 17 00:00:00 2001 From: Mohamad Chaarawi Date: Tue, 27 Jan 2015 15:59:48 -0500 Subject: [svn-r26055] Updates for: Discuss and Remove Infering parallel compilers (C and Fortran) from configure.ac https://jira.hdfgroup.uiuc.edu/browse/HDFFV-9068 Remove restriction to build shared with parallel https://jira.hdfgroup.uiuc.edu/browse/HDFFV-9069 Cleanup parallel sections in configure.ac https://jira.hdfgroup.uiuc.edu/browse/HDFFV-9096 tested h5committest --- configure | 525 +++--------------------------------------------------- configure.ac | 216 ++-------------------- src/H5config.h.in | 9 - 3 files changed, 44 insertions(+), 706 deletions(-) diff --git a/configure b/configure index 163c2b5..fc945d0 100755 --- a/configure +++ b/configure @@ -1577,7 +1577,7 @@ Optional Features: --disable-dependency-tracking speeds up one-time build --enable-unsupported Allow unsupported combinations of configure options - --enable-fortran Compile the Fortran 77/90/95 interface [default=no] + --enable-fortran Compile the Fortran 90/95 interface [default=no] --enable-fortran2003 Compile the Fortran 2003 interface, must also specify --enable-fortran [default=no] --enable-cxx Compile the C++ interface [default=no] @@ -7744,16 +7744,14 @@ fi ## a parallel library even if configure wasn't ## able to find some header file or library that ## might be required. This is defined if the -## compiler looks like a parallel compiler (e.g., -## mpicc or mpcc) or if the user explicitly states +## user explicitly states ## that a parallel library is being built by supplying ## the `--enable-parallel' configure switch. ## ## PARALLEL -- This variable is set to a non-null value if -## configure thinks we're compiling a parallel -## version of the library. +## we're building a parallel version of the library. ## -## RUNSERIAL -- This is a command which will be prepended to +## RUNSERIAL -- This is a command which will be prepended to ## the executable name to run the executable using ## a single process. For serial versions of the ## library this will normally be empty. For parallel @@ -7779,146 +7777,6 @@ fi ## ---------------------------------------------------------------------- -## If the compiler is obviously a parallel compiler then we're building -## a parallel version of hdf5 and should define HAVE_PARALLEL. Furthermore, -## the name of the compiler might tell us how to run the resulting -## executable. For `mpicc' the executable should be run with `mpiexec' from -## the same directory as mpicc if it exists. -## -case "$CC_BASENAME" in - mpicc) - ## The mpich compiler. Use mpiexec from the same directory if it - ## exists. - PARALLEL=mpicc - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for mpiexec" >&5 -$as_echo_n "checking for mpiexec... " >&6; } - - ## Find the path where mpicc is located. - cmd="`echo $CC | cut -f1 -d' '`" - if (echo $cmd | grep / >/dev/null); then - path="`echo $cmd | sed 's/\(.*\)\/.*$/\1/'`" - else - for path in `echo $PATH | ${TR} ":" " "`; do - if test -x $path/$cmd; then - break - fi - done - fi - - ## Is there an mpiexec at that path? - if test -x $path/mpiexec; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $path/mpiexec" >&5 -$as_echo "$path/mpiexec" >&6; } - RUNSERIAL="${RUNSERIAL:-none}" - - if test -z "$RUNPARALLEL"; then - RUNPARALLEL="$path/mpiexec -n \$\${NPROCS:=6}" - fi - else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: none" >&5 -$as_echo "none" >&6; } - fi - ;; - - mpcc|mpcc_r) - ## The IBM compiler - PARALLEL="$CC_BASENAME" - ;; - - *) - ## Probably not a parallel compiler, but if `--enable-parallel' - ## is defined below then we're still building a parallel hdf5. - ;; -esac - -## ---------------------------------------------------------------------- -## If the Fortran compiler is obviously a parallel compiler then we're -## building a parallel version of hdf5 and should define HAVE_PARALLEL. -## Furthermore, the name of the compiler might tell us how to run the -## resulting executable. For `mpif90' the executable should be run with -## `mpiexec' from the same directory as mpif90 if it exists. -## - -if test "X$HDF_FORTRAN" = "Xyes" ; then - ## Change to the Fortran 90 language - ac_ext=${ac_fc_srcext-f} -ac_compile='$FC -c $FCFLAGS $ac_fcflags_srcext conftest.$ac_ext >&5' -ac_link='$FC -o conftest$ac_exeext $FCFLAGS $LDFLAGS $ac_fcflags_srcext conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_fc_compiler_gnu - - - case "$FC" in - *mpif90*) - ## The Fortran mpich compiler. Use mpiexec from the same directory - ## if it exists. - PARALLEL=mpif90 - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for mpiexec" >&5 -$as_echo_n "checking for mpiexec... " >&6; } - - ## Find the path where mpif90 is located. - cmd=`echo $FC |cut -f1 -d' '` - if (echo $cmd |grep / >/dev/null); then - path="`echo $cmd |sed 's/\(.*\)\/.*$/\1/'`" - else - for path in `echo $PATH | ${TR} ":" " "`; do - if test -x $path/$cmd; then - break; - fi - done - fi - - ## Is there an mpiexec at that path? - if test -x $path/mpiexec; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $path/mpiexec" >&5 -$as_echo "$path/mpiexec" >&6; } - RUNSERIAL="${RUNSERIAL:-none}" - - if test -z "$RUNPARALLEL"; then - RUNPARALLEL="$path/mpiexec -n \$\${NPROCS:=6}" - fi - else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: none" >&5 -$as_echo "none" >&6; } - fi - ;; - - *mpxlf* | *mpxlf_r* | *mpxlf90* | *mpxlf90_r* | *mpxlf95* | *mpxlf95_r*) - ## The IBM compiler - PARALLEL="$FC" - ;; - - *) - ## Probably not a parallel compiler, but if `--enable-parallel' - ## is defined below then we're still building a parallel hdf5. - ;; - esac - - ## Change to the C language - ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu - -fi - -## ----------------------------------------------------------------------------- -## If shared libraries are being used with parallel, disable them, unless the -## user explicity enables them via the '--enable-shared' option. - -if test "X${enable_shared}" = "X" -a "X${enable_parallel}" = "Xyes"; then - echo ' shared libraries disabled in parallel' - enable_shared="no" -elif test "X${enable_shared}" = "Xyes" -a "X${enable_parallel}" = "Xyes"; then - echo ' shared libraries explicitly enabled by user' -elif test "X${enable_shared}" = "X" -a "X${PARALLEL}" != "X"; then - echo ' shared libraries disabled when a parallel compiler is being used' - enable_shared="no" -elif test "X${enable_shared}" = "Xyes" -a "X${PARALLEL}" != "X"; then - echo ' shared libraries explicitly enabled by user' -fi - -## ---------------------------------------------------------------------- ## Fortran libraries are not currently supported on Mac. Disable them. ## (this is overridable with --enable-unsupported). ## @@ -28022,10 +27880,7 @@ rm -f confcache ## What header files and libraries do we have to look for for parallel ## support? For the most part, search paths are already specified with -## CPPFLAGS and LDFLAGS or are known to the compiler. If the user says -## `--disable-parallel' but specifies a known parallel compiler (like mpicc -## or mpcc) then parallel support is enabled but configure doesn't search -## for any parallel header files or libraries. +## CPPFLAGS and LDFLAGS or are known to the compiler. ## # Check whether --enable-parallel was given. if test "${enable_parallel+set}" = set; then : @@ -28050,26 +27905,11 @@ if test "X${ALLOW_UNSUPPORTED}" != "Xyes"; then fi fi -## It's possible to build in parallel by specifying a parallel compiler -## without using the --enable-parallel flag. This isn't allowed with -## C++ or threadsafe, either, unless the --enable-unsupported flag -## has also been specified. -if test "X${ALLOW_UNSUPPORTED}" != "Xyes"; then - if test "X${PARALLEL}" != "X" -a "X${enable_cxx}" = "Xyes" ; then - as_fn_error $? "An MPI compiler is being used; --enable-cxx is not allowed. Use --enable-unsupported to override this error." "$LINENO" 5 - fi - if test "X${PARALLEL}" != "X" -a "X${THREADSAFE}" = "Xyes"; then - as_fn_error $? "An MPI compiler is being used; --enable-threadsafe is not allowed. Use --enable-unsupported to override this error." "$LINENO" 5 - fi -fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for parallel support files" >&5 $as_echo_n "checking for parallel support files... " >&6; } 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). + ## We are not compiling for parallel. { $as_echo "$as_me:${as_lineno-$LINENO}: result: skipped" >&5 $as_echo "skipped" >&6; } ;; @@ -28081,185 +27921,12 @@ $as_echo "skipped" >&6; } $as_echo "provided by compiler" >&6; } PARALLEL=yes - ## Try link a simple MPI program. If fail, try again with -lmpi and - ## -lmpich. + ## Try link a simple MPI program. + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether a simple MPI-IO C program can be linked" >&5 +$as_echo_n "checking whether a simple MPI-IO C program can be linked... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ - -#ifdef FC_DUMMY_MAIN -#ifndef FC_DUMMY_MAIN_EQ_F77 -# ifdef __cplusplus - extern "C" -# endif - int FC_DUMMY_MAIN() { return 1; } -#endif -#endif -int -main () -{ -MPI_Init() - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - -else - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for MPI_Init in -lmpi" >&5 -$as_echo_n "checking for MPI_Init in -lmpi... " >&6; } -if ${ac_cv_lib_mpi_MPI_Init+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-lmpi $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char MPI_Init (); -#ifdef FC_DUMMY_MAIN -#ifndef FC_DUMMY_MAIN_EQ_F77 -# ifdef __cplusplus - extern "C" -# endif - int FC_DUMMY_MAIN() { return 1; } -#endif -#endif -int -main () -{ -return MPI_Init (); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - ac_cv_lib_mpi_MPI_Init=yes -else - ac_cv_lib_mpi_MPI_Init=no -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_mpi_MPI_Init" >&5 -$as_echo "$ac_cv_lib_mpi_MPI_Init" >&6; } -if test "x$ac_cv_lib_mpi_MPI_Init" = xyes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_LIBMPI 1 -_ACEOF - - LIBS="-lmpi $LIBS" - -else - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for MPI_Init in -lmpich" >&5 -$as_echo_n "checking for MPI_Init in -lmpich... " >&6; } -if ${ac_cv_lib_mpich_MPI_Init+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-lmpich $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char MPI_Init (); -#ifdef FC_DUMMY_MAIN -#ifndef FC_DUMMY_MAIN_EQ_F77 -# ifdef __cplusplus - extern "C" -# endif - int FC_DUMMY_MAIN() { return 1; } -#endif -#endif -int -main () -{ -return MPI_Init (); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - ac_cv_lib_mpich_MPI_Init=yes -else - ac_cv_lib_mpich_MPI_Init=no -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_mpich_MPI_Init" >&5 -$as_echo "$ac_cv_lib_mpich_MPI_Init" >&6; } -if test "x$ac_cv_lib_mpich_MPI_Init" = xyes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_LIBMPICH 1 -_ACEOF - - LIBS="-lmpich $LIBS" - -else - PARALLEL=no -fi - -fi - -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext - - ## Then try link a simple MPI-IO program. If fail, try again with - ## -lmpio. - if test "X$PARALLEL" = "Xyes"; then - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -#ifdef FC_DUMMY_MAIN -#ifndef FC_DUMMY_MAIN_EQ_F77 -# ifdef __cplusplus - extern "C" -# endif - int FC_DUMMY_MAIN() { return 1; } -#endif -#endif -int -main () -{ -MPI_File_open() - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - -else - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for MPI_File_open in -lmpio" >&5 -$as_echo_n "checking for MPI_File_open in -lmpio... " >&6; } -if ${ac_cv_lib_mpio_MPI_File_open+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-lmpio $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char MPI_File_open (); +#include #ifdef FC_DUMMY_MAIN #ifndef FC_DUMMY_MAIN_EQ_F77 # ifdef __cplusplus @@ -28271,37 +27938,22 @@ char MPI_File_open (); int main () { -return MPI_File_open (); + MPI_Init(0, (void *)0); + MPI_File_open(0, (void *)0, 0, 0, (void *)0); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : - ac_cv_lib_mpio_MPI_File_open=yes -else - ac_cv_lib_mpio_MPI_File_open=no -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_mpio_MPI_File_open" >&5 -$as_echo "$ac_cv_lib_mpio_MPI_File_open" >&6; } -if test "x$ac_cv_lib_mpio_MPI_File_open" = xyes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_LIBMPIO 1 -_ACEOF - - LIBS="-lmpio $LIBS" - + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } else - PARALLEL=no -fi - + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + as_fn_error $? "unable to link a simple MPI-IO C program" "$LINENO" 5 fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext - fi if test "X$HDF_FORTRAN" = "Xyes"; then ## Change to the Fortran 90 language @@ -28311,7 +27963,9 @@ ac_link='$FC -o conftest$ac_exeext $FCFLAGS $LDFLAGS $ac_fcflags_srcext conftest ac_compiler_gnu=$ac_cv_fc_compiler_gnu - ## Try link a simple MPI program. If fail, try again with -lmpi. + ## Try link a simple MPI program. + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether a simple MPI-IO Fortran program can be linked" >&5 +$as_echo_n "checking whether a simple MPI-IO Fortran program can be linked... " >&6; } cat > conftest.$ac_ext <<_ACEOF program main @@ -28321,98 +27975,15 @@ ac_compiler_gnu=$ac_cv_fc_compiler_gnu end _ACEOF if ac_fn_fc_try_link "$LINENO"; then : - -else - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for mpi_file_open in -lmpi" >&5 -$as_echo_n "checking for mpi_file_open in -lmpi... " >&6; } -if ${ac_cv_lib_mpi_mpi_file_open+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-lmpi $LIBS" -cat > conftest.$ac_ext <<_ACEOF - program main - call mpi_file_open - end -_ACEOF -if ac_fn_fc_try_link "$LINENO"; then : - ac_cv_lib_mpi_mpi_file_open=yes -else - ac_cv_lib_mpi_mpi_file_open=no -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_mpi_mpi_file_open" >&5 -$as_echo "$ac_cv_lib_mpi_mpi_file_open" >&6; } -if test "x$ac_cv_lib_mpi_mpi_file_open" = xyes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_LIBMPI 1 -_ACEOF - - LIBS="-lmpi $LIBS" - -else - PARALLEL=no -fi - -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext - - ## Then try link a simple MPI-IO program. If fail, try again with - ## -lmpio. - if test "X$PARALLEL" = "Xyes"; then - cat > conftest.$ac_ext <<_ACEOF - - program main - include 'mpif.h' - integer:: ierr - call mpi_file_open( ierr ) - end -_ACEOF -if ac_fn_fc_try_link "$LINENO"; then : - -else - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for mpi_file_open in -lmpio" >&5 -$as_echo_n "checking for mpi_file_open in -lmpio... " >&6; } -if ${ac_cv_lib_mpio_mpi_file_open+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-lmpio $LIBS" -cat > conftest.$ac_ext <<_ACEOF - program main - call mpi_file_open - end -_ACEOF -if ac_fn_fc_try_link "$LINENO"; then : - ac_cv_lib_mpio_mpi_file_open=yes -else - ac_cv_lib_mpio_mpi_file_open=no -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_mpio_mpi_file_open" >&5 -$as_echo "$ac_cv_lib_mpio_mpi_file_open" >&6; } -if test "x$ac_cv_lib_mpio_mpi_file_open" = xyes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_LIBMPIO 1 -_ACEOF - - LIBS="-lmpio $LIBS" - + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } else - PARALLEL=no -fi - + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + as_fn_error $? "unable to link a simple MPI-IO Fortran program" "$LINENO" 5 fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext - fi ## Change to the C language ac_ext=c @@ -28424,19 +27995,6 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu fi ## Set RUNPARALLEL to mpiexec if not set yet. - ## Check for building on Cray if RUNPARALLEL is not yet set by checking - ## for 'aprun' command (which is the parallel job launcher, like mpiexec). - if test "X$PARALLEL" = "Xyes" -a -z "$RUNPARALLEL"; then - ## Find the path where aprun is located. - for path in `echo $PATH | ${TR} ":" " "`; do - if test -x $path/aprun; then - RUNPARALLEL="aprun -q -n \$\${NPROCS:=6}" - break; - fi - done - fi - - ## Set RUNPARALLEL to mpiexec if not set yet. if test "X$PARALLEL" = "Xyes" -a -z "$RUNPARALLEL"; then RUNPARALLEL="mpiexec -n \$\${NPROCS:=6}" fi @@ -28473,39 +28031,6 @@ $as_echo_n "checking prefix for running in parallel... " >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: result: $RUNPARALLEL" >&5 $as_echo "$RUNPARALLEL" >&6; } - ## Check that we can link a simple MPI and MPI-IO application - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether a simple MPI-IO program can be linked" >&5 -$as_echo_n "checking whether a simple MPI-IO program can be linked... " >&6; } - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -#ifdef FC_DUMMY_MAIN -#ifndef FC_DUMMY_MAIN_EQ_F77 -# ifdef __cplusplus - extern "C" -# endif - int FC_DUMMY_MAIN() { return 1; } -#endif -#endif -int -main () -{ -MPI_Init(); MPI_File_open(); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - as_fn_error $? "unable to link a simple MPI-IO application" "$LINENO" 5 -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext - ## There *must* be some way to run in parallel even if it's just the ## word `none'. if test -z "$RUNPARALLEL"; then diff --git a/configure.ac b/configure.ac index d2d2b71..0bdeafd 100644 --- a/configure.ac +++ b/configure.ac @@ -608,16 +608,14 @@ fi ## a parallel library even if configure wasn't ## able to find some header file or library that ## might be required. This is defined if the -## compiler looks like a parallel compiler (e.g., -## mpicc or mpcc) or if the user explicitly states +## user explicitly states ## that a parallel library is being built by supplying ## the `--enable-parallel' configure switch. ## ## PARALLEL -- This variable is set to a non-null value if -## configure thinks we're compiling a parallel -## version of the library. +## we're building a parallel version of the library. ## -## RUNSERIAL -- This is a command which will be prepended to +## RUNSERIAL -- This is a command which will be prepended to ## the executable name to run the executable using ## a single process. For serial versions of the ## library this will normally be empty. For parallel @@ -643,131 +641,6 @@ AC_SUBST([RUNPARALLEL]) AC_SUBST([TESTPARALLEL]) ## ---------------------------------------------------------------------- -## If the compiler is obviously a parallel compiler then we're building -## a parallel version of hdf5 and should define HAVE_PARALLEL. Furthermore, -## the name of the compiler might tell us how to run the resulting -## executable. For `mpicc' the executable should be run with `mpiexec' from -## the same directory as mpicc if it exists. -## -case "$CC_BASENAME" in - mpicc) - ## The mpich compiler. Use mpiexec from the same directory if it - ## exists. - PARALLEL=mpicc - AC_MSG_CHECKING([for mpiexec]) - - ## Find the path where mpicc is located. - cmd="`echo $CC | cut -f1 -d' '`" - if (echo $cmd | grep / >/dev/null); then - path="`echo $cmd | sed 's/\(.*\)\/.*$/\1/'`" - else - for path in `echo $PATH | ${TR} ":" " "`; do - if test -x $path/$cmd; then - break - fi - done - fi - - ## Is there an mpiexec at that path? - if test -x $path/mpiexec; then - AC_MSG_RESULT([$path/mpiexec]) - RUNSERIAL="${RUNSERIAL:-none}" - - if test -z "$RUNPARALLEL"; then - RUNPARALLEL="$path/mpiexec -n \$\${NPROCS:=6}" - fi - else - AC_MSG_RESULT([none]) - fi - ;; - - mpcc|mpcc_r) - ## The IBM compiler - PARALLEL="$CC_BASENAME" - ;; - - *) - ## Probably not a parallel compiler, but if `--enable-parallel' - ## is defined below then we're still building a parallel hdf5. - ;; -esac - -## ---------------------------------------------------------------------- -## If the Fortran compiler is obviously a parallel compiler then we're -## building a parallel version of hdf5 and should define HAVE_PARALLEL. -## Furthermore, the name of the compiler might tell us how to run the -## resulting executable. For `mpif90' the executable should be run with -## `mpiexec' from the same directory as mpif90 if it exists. -## - -if test "X$HDF_FORTRAN" = "Xyes" ; then - ## Change to the Fortran 90 language - AC_LANG_PUSH(Fortran) - - case "$FC" in - *mpif90*) - ## The Fortran mpich compiler. Use mpiexec from the same directory - ## if it exists. - PARALLEL=mpif90 - AC_MSG_CHECKING([for mpiexec]) - - ## Find the path where mpif90 is located. - cmd=`echo $FC |cut -f1 -d' '` - if (echo $cmd |grep / >/dev/null); then - path="`echo $cmd |sed 's/\(.*\)\/.*$/\1/'`" - else - for path in `echo $PATH | ${TR} ":" " "`; do - if test -x $path/$cmd; then - break; - fi - done - fi - - ## Is there an mpiexec at that path? - if test -x $path/mpiexec; then - AC_MSG_RESULT([$path/mpiexec]) - RUNSERIAL="${RUNSERIAL:-none}" - - if test -z "$RUNPARALLEL"; then - RUNPARALLEL="$path/mpiexec -n \$\${NPROCS:=6}" - fi - else - AC_MSG_RESULT([none]) - fi - ;; - - *mpxlf* | *mpxlf_r* | *mpxlf90* | *mpxlf90_r* | *mpxlf95* | *mpxlf95_r*) - ## The IBM compiler - PARALLEL="$FC" - ;; - - *) - ## Probably not a parallel compiler, but if `--enable-parallel' - ## is defined below then we're still building a parallel hdf5. - ;; - esac - - ## Change to the C language - AC_LANG_POP(Fortran) -fi - -## ----------------------------------------------------------------------------- -## If shared libraries are being used with parallel, disable them, unless the -## user explicity enables them via the '--enable-shared' option. - -if test "X${enable_shared}" = "X" -a "X${enable_parallel}" = "Xyes"; then - echo ' shared libraries disabled in parallel' - enable_shared="no" -elif test "X${enable_shared}" = "Xyes" -a "X${enable_parallel}" = "Xyes"; then - echo ' shared libraries explicitly enabled by user' -elif test "X${enable_shared}" = "X" -a "X${PARALLEL}" != "X"; then - echo ' shared libraries disabled when a parallel compiler is being used' - enable_shared="no" -elif test "X${enable_shared}" = "Xyes" -a "X${PARALLEL}" != "X"; then - echo ' shared libraries explicitly enabled by user' -fi - -## ---------------------------------------------------------------------- ## Fortran libraries are not currently supported on Mac. Disable them. ## (this is overridable with --enable-unsupported). ## @@ -2471,10 +2344,7 @@ AC_CACHE_SAVE ## What header files and libraries do we have to look for for parallel ## support? For the most part, search paths are already specified with -## CPPFLAGS and LDFLAGS or are known to the compiler. If the user says -## `--disable-parallel' but specifies a known parallel compiler (like mpicc -## or mpcc) then parallel support is enabled but configure doesn't search -## for any parallel header files or libraries. +## CPPFLAGS and LDFLAGS or are known to the compiler. ## AC_ARG_ENABLE([parallel], [AS_HELP_STRING([--enable-parallel], @@ -2497,25 +2367,10 @@ if test "X${ALLOW_UNSUPPORTED}" != "Xyes"; then fi fi -## It's possible to build in parallel by specifying a parallel compiler -## without using the --enable-parallel flag. This isn't allowed with -## C++ or threadsafe, either, unless the --enable-unsupported flag -## has also been specified. -if test "X${ALLOW_UNSUPPORTED}" != "Xyes"; then - if test "X${PARALLEL}" != "X" -a "X${enable_cxx}" = "Xyes" ; then - AC_MSG_ERROR([An MPI compiler is being used; --enable-cxx is not allowed. Use --enable-unsupported to override this error.]) - fi - if test "X${PARALLEL}" != "X" -a "X${THREADSAFE}" = "Xyes"; then - AC_MSG_ERROR([An MPI compiler is being used; --enable-threadsafe is not allowed. Use --enable-unsupported to override this error.]) - fi -fi - 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). + ## We are not compiling for parallel. AC_MSG_RESULT([skipped]) ;; @@ -2525,62 +2380,36 @@ case "X-$enable_parallel" in AC_MSG_RESULT([provided by compiler]) PARALLEL=yes - ## Try link a simple MPI program. If fail, try again with -lmpi and - ## -lmpich. - AC_TRY_LINK(, [MPI_Init()],, - [AC_CHECK_LIB([mpi], [MPI_Init],, - [AC_CHECK_LIB([mpich], [MPI_Init],, [PARALLEL=no])])]) - - ## Then try link a simple MPI-IO program. If fail, try again with - ## -lmpio. - if test "X$PARALLEL" = "Xyes"; then - AC_TRY_LINK(, [MPI_File_open()],, - [AC_CHECK_LIB([mpio], [MPI_File_open],, [PARALLEL=no])]) - fi + ## Try link a simple MPI program. + AC_MSG_CHECKING([whether a simple MPI-IO C program can be linked]) + AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include ]], + [[ MPI_Init(0, (void *)0); + MPI_File_open(0, (void *)0, 0, 0, (void *)0);]])], + [AC_MSG_RESULT([yes])], + [AC_MSG_RESULT([no]) + AC_MSG_ERROR([unable to link a simple MPI-IO C program])]) if test "X$HDF_FORTRAN" = "Xyes"; then ## Change to the Fortran 90 language AC_LANG_PUSH(Fortran) - ## Try link a simple MPI program. If fail, try again with -lmpi. + ## Try link a simple MPI program. + AC_MSG_CHECKING([whether a simple MPI-IO Fortran program can be linked]) AC_LINK_IFELSE([ program main include 'mpif.h' integer:: ierr call mpi_file_open( ierr ) - end],, - [AC_CHECK_LIB([mpi], [mpi_file_open],, [PARALLEL=no])]) - - ## Then try link a simple MPI-IO program. If fail, try again with - ## -lmpio. - if test "X$PARALLEL" = "Xyes"; then - AC_LINK_IFELSE([ - program main - include 'mpif.h' - integer:: ierr - call mpi_file_open( ierr ) - end],, - [AC_CHECK_LIB([mpio], [mpi_file_open],, [PARALLEL=no])]) - fi + end], + [AC_MSG_RESULT([yes])], + [AC_MSG_RESULT([no]) + AC_MSG_ERROR([unable to link a simple MPI-IO Fortran program])]) ## Change to the C language AC_LANG_POP(Fortran) fi ## Set RUNPARALLEL to mpiexec if not set yet. - ## Check for building on Cray if RUNPARALLEL is not yet set by checking - ## for 'aprun' command (which is the parallel job launcher, like mpiexec). - if test "X$PARALLEL" = "Xyes" -a -z "$RUNPARALLEL"; then - ## Find the path where aprun is located. - for path in `echo $PATH | ${TR} ":" " "`; do - if test -x $path/aprun; then - RUNPARALLEL="aprun -q -n \$\${NPROCS:=6}" - break; - fi - done - fi - - ## Set RUNPARALLEL to mpiexec if not set yet. if test "X$PARALLEL" = "Xyes" -a -z "$RUNPARALLEL"; then RUNPARALLEL="mpiexec -n \$\${NPROCS:=6}" fi @@ -2610,13 +2439,6 @@ if test -n "$PARALLEL"; then AC_MSG_CHECKING([prefix for running in parallel]) AC_MSG_RESULT([$RUNPARALLEL]) - ## Check that we can link a simple MPI and MPI-IO application - AC_MSG_CHECKING([whether a simple MPI-IO program can be linked]) - AC_TRY_LINK(, [MPI_Init(); MPI_File_open();], - [AC_MSG_RESULT([yes])], - [AC_MSG_RESULT([no]) - AC_MSG_ERROR([unable to link a simple MPI-IO application])]) - ## There *must* be some way to run in parallel even if it's just the ## word `none'. if test -z "$RUNPARALLEL"; then diff --git a/src/H5config.h.in b/src/H5config.h.in index eca8583..ee798f1 100644 --- a/src/H5config.h.in +++ b/src/H5config.h.in @@ -205,15 +205,6 @@ /* Define to 1 if you have the `mpe' library (-lmpe). */ #undef HAVE_LIBMPE -/* Define to 1 if you have the `mpi' library (-lmpi). */ -#undef HAVE_LIBMPI - -/* Define to 1 if you have the `mpich' library (-lmpich). */ -#undef HAVE_LIBMPICH - -/* Define to 1 if you have the `mpio' library (-lmpio). */ -#undef HAVE_LIBMPIO - /* Define to 1 if you have the `nsl' library (-lnsl). */ #undef HAVE_LIBNSL -- cgit v0.12