diff options
author | Quincey Koziol <koziol@hdfgroup.org> | 2010-07-06 19:45:35 (GMT) |
---|---|---|
committer | Quincey Koziol <koziol@hdfgroup.org> | 2010-07-06 19:45:35 (GMT) |
commit | 98754fa9d12090f5e048fdb05cc5e9ce9111676f (patch) | |
tree | 407e611b19ee551d8153779104022dd886a467e5 /configure.in | |
parent | 29321bcafa9f1c6108bb92b5a844a9d4d9c2c8e7 (diff) | |
download | hdf5-98754fa9d12090f5e048fdb05cc5e9ce9111676f.zip hdf5-98754fa9d12090f5e048fdb05cc5e9ce9111676f.tar.gz hdf5-98754fa9d12090f5e048fdb05cc5e9ce9111676f.tar.bz2 |
[svn-r19050] Description:
Bring r18704:19049 from trunk to revise_chunks branch.
Tested on:
FreeBSD/32 6.3 (duty) in debug mode
FreeBSD/64 6.3 (liberty) w/C++ & FORTRAN, in debug mode
Linux/32 2.6 (jam) w/PGI compilers, w/default API=1.8.x,
w/C++ & FORTRAN, w/threadsafe, in debug mode
Linux/64-amd64 2.6 (amani) w/Intel compilers, w/default API=1.6.x,
w/C++ & FORTRAN, in production mode
Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN,
w/szip filter, in production mode
Linux/64-ia64 2.6 (cobalt) w/Intel compilers, w/C++ & FORTRAN,
in production mode
Linux/64-amd64 2.6 (abe) w/parallel, w/FORTRAN, in debug mode
Mac OS X/32 10.6.3 (amazon) in debug mode
Mac OS X/32 10.6.3 (amazon) w/C++ & FORTRAN, w/threadsafe,
in production mode
Diffstat (limited to 'configure.in')
-rw-r--r-- | configure.in | 188 |
1 files changed, 132 insertions, 56 deletions
diff --git a/configure.in b/configure.in index d069c94..7728fc3 100644 --- a/configure.in +++ b/configure.in @@ -26,7 +26,7 @@ dnl dnl NOTE: Don't forget to change the version number here when we do a dnl release!!! dnl -AC_INIT([HDF5], [1.9.69-FA_a4], [help@hdfgroup.org]) +AC_INIT([HDF5], [1.9.73-FA_a4], [help@hdfgroup.org]) AC_CONFIG_SRCDIR([src/H5.c]) AM_CONFIG_HEADER([src/H5config.h]) @@ -157,7 +157,7 @@ dnl HDF_CXX: whether C++ is enabled. Default no. dnl CXX: C++ compiler. dnl HDF5_HL: whether high-level library is enabled. Default is yes. dnl GPFS: whether gpfs is enabled. Default no. -dnl LINUX_LFS: whether LINUX_LFS is enabled. Default no. +dnl LARGEFILE: whether largefile support is enabled. Default yes. dnl INSTRUMENT: whether INSTRUMENT is enabled. No default set here. dnl CODESTACK: whether CODESTACK is enabled. Default no. dnl HAVE_DMALLOC: whether system has dmalloc support. Default no. @@ -177,7 +177,7 @@ AC_SUBST(HDF_CXX) HDF_CXX=no AC_SUBST(CXX) HDF_CXX=no AC_SUBST(HDF5_HL) HDF5_HL=yes AC_SUBST(GPFS) GPFS=no -AC_SUBST(LINUX_LFS) LINUX_LFS=no +AC_SUBST(LARGEFILE) LARGEFILE=yes AC_SUBST(INSTRUMENT) AC_SUBST(CODESTACK) CODESTACK=no AC_SUBST(HAVE_DMALLOC) HAVE_DMALLOC=no @@ -681,7 +681,7 @@ 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 versions it might be something like `mpiexec -n 1'. dnl The value of this variable is substituted in *.in dnl files. dnl @@ -706,15 +706,15 @@ 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 executable. For `mpicc' the executable should be run with `mpiexec' from dnl the same directory as mpicc if it exists. dnl case "$CC_BASENAME" in mpicc) - dnl The mpich compiler. Use mpirun from the same directory if it + dnl The mpich compiler. Use mpiexec from the same directory if it dnl exists. PARALLEL=mpicc - AC_MSG_CHECKING([for mpirun]) + AC_MSG_CHECKING([for mpiexec]) dnl Find the path where mpicc is located. cmd="`echo $CC | cut -f1 -d' '`" @@ -728,13 +728,13 @@ case "$CC_BASENAME" in done fi - dnl Is there an mpirun at that path? - if test -x $path/mpirun; then - AC_MSG_RESULT([$path/mpirun]) + dnl 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/mpirun -np \$\${NPROCS:=3}" + RUNPARALLEL="$path/mpiexec -n \$\${NPROCS:=3}" fi else AC_MSG_RESULT([none]) @@ -811,7 +811,7 @@ dnl If the Fortran compiler is obviously a parallel compiler then we're dnl building a parallel version of hdf5 and should define HAVE_PARALLEL. dnl Furthermore, the name of the compiler might tell us how to run the dnl resulting executable. For `mpif90' the executable should be run with -dnl `mpirun' from the same directory as mpif90 if it exists. +dnl `mpiexec' from the same directory as mpif90 if it exists. dnl if test "X$HDF_FORTRAN" = "Xyes"; then dnl Change to the Fortran 90 language @@ -819,10 +819,10 @@ if test "X$HDF_FORTRAN" = "Xyes"; then case "$FC" in *mpif90*) - dnl The Fortran mpich compiler. Use mpirun from the same directory + dnl The Fortran mpich compiler. Use mpiexec from the same directory dnl if it exists. PARALLEL=mpif90 - AC_MSG_CHECKING([for mpirun]) + AC_MSG_CHECKING([for mpiexec]) dnl Find the path where mpif90 is located. cmd=`echo $FC |cut -f1 -d' '` @@ -836,13 +836,13 @@ if test "X$HDF_FORTRAN" = "Xyes"; then done fi - dnl Is there an mpirun at that path? - if test -x $path/mpirun; then - AC_MSG_RESULT([$path/mpirun]) + dnl 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/mpirun -np \$\${NPROCS:=2}" + RUNPARALLEL="$path/mpiexec -n \$\${NPROCS:=2}" fi else AC_MSG_RESULT([none]) @@ -1260,47 +1260,123 @@ case "$host" in esac dnl ---------------------------------------------------------------------- -dnl Test for 64bit stuff before the data types and their sizes. The -dnl result could effect the outcome of the sizeof macros below. +dnl Test for Largefile support. dnl -case "$host_cpu-$host_vendor-$host_os" in - *linux*) - dnl ---------------------------------------------------------------------- - dnl Enable large file support on linux? Store the result in the LINUX_LFS - dnl variable for posterity - AC_ARG_ENABLE([linux-lfs], - [AC_HELP_STRING([--enable-linux-lfs], - [Enable support for large (64-bit) - files on Linux. [default=check]])]) - - LINUX_LFS="no" - case "X-$enable_linux_lfs" in - X-yes) - LINUX_LFS=yes - ;; - X-no) - ;; - X-|*) - MAJOR_VER="`uname -r | cut -d '.' -f1`" - MINOR_VER="`uname -r | cut -d '.' -f2`" +AC_MSG_CHECKING([if configure should try to set up large file support]) + +AC_ARG_ENABLE([largefile], + [AC_HELP_STRING([--disable-largefile], + [omit support for large files])]) + +dnl If largefile support is enabled, then set up appropriate compiler options. +if test "$enable_largefile" != no; then + AC_MSG_RESULT(yes) + + dnl Check for needed compiler options. This check is pulled drectly + dnl from autoconf's AC_SYS_LARGEFILE macro, as of Autoconf v2.65. + AC_CACHE_CHECK([for special C compiler options needed for large files], + ac_cv_sys_largefile_CC, + [ac_cv_sys_largefile_CC=no + if test "$GCC" != yes; then + ac_save_CC=$CC + while :; do + # IRIX 6.2 and later do not support large files by default, + # so use the C compiler's -n32 option if that helps. + AC_LANG_CONFTEST([AC_LANG_PROGRAM([_AC_SYS_LARGEFILE_TEST_INCLUDES])]) + AC_COMPILE_IFELSE([], [break]) + CC="$CC -n32" + AC_COMPILE_IFELSE([], [ac_cv_sys_largefile_CC=' -n32'; break]) + break + done + CC=$ac_save_CC + rm -f conftest.$ac_ext + fi]) + if test "$ac_cv_sys_largefile_CC" != no; then + CC=$CC$ac_cv_sys_largefile_CC + fi - if test ${MAJOR_VER} -gt 2 -o ${MAJOR_VER} -eq 2 -a ${MINOR_VER} -ge 4; then - LINUX_LFS="yes" - fi - ;; - esac + dnl Use the macro _AC_SYS_LARGEFILE_MACRO_VALUE to test defines + dnl that might need to be set for largefile support to behave + dnl correctly. This macro is defined in acsite.m4 and overrides + dnl the version provided by Autoconf (as of v2.65). The custom + dnl macro additionally adds the appropriate defines to AM_CPPFLAGS + dnl so that later configure checks have them visible. + + dnl Check for _FILE_OFFSET_BITS + _AC_SYS_LARGEFILE_MACRO_VALUE(_FILE_OFFSET_BITS, 64, + ac_cv_sys_file_offset_bits, + [Number of bits in a file offset, on hosts where this is settable.], + [_AC_SYS_LARGEFILE_TEST_INCLUDES]) + + dnl Check for _LARGE_FILES + if test $ac_cv_sys_file_offset_bits = unknown; then + _AC_SYS_LARGEFILE_MACRO_VALUE(_LARGE_FILES, 1, + ac_cv_sys_large_files, + [Define for large files, on AIX-style hosts.], + [_AC_SYS_LARGEFILE_TEST_INCLUDES]) + fi - AC_MSG_CHECKING([for large file support mode on Linux]) - if test "X$LINUX_LFS" = "Xyes"; then - AC_MSG_RESULT([enabled]) - AM_CPPFLAGS="-D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE -D_LARGEFILE_SOURCE $AM_CPPFLAGS" - else - AC_MSG_RESULT([disabled]) + dnl Now actually test to see if we can create large files after we've + dnl checked for any needed defines. + AC_MSG_CHECKING([if large (64-bit) files are supported on this system.]) + AC_CACHE_VAL([hdf5_cv_have_lfs], + [AC_TRY_RUN([ + #include <stdio.h> + #include <unistd.h> + #include <stdlib.h> + #include <fcntl.h> + #define BIG_FILE (off_t)0x80000000UL + int main(void) { + int fd; + if ((fd=open("test.conf", O_RDWR|O_TRUNC|O_CREAT, 0666)) < 0) exit(1); + if (lseek(fd, BIG_FILE, SEEK_SET)!=BIG_FILE) exit(1); + if (5!=write(fd, "hello", (size_t)5)) exit(1); + if (lseek(fd, 2*BIG_FILE, SEEK_SET) != 2*BIG_FILE) exit(1); + if (5!=write(fd, "hello", (size_t)5)) exit(1); + if (unlink("test.conf") < 0) exit(1); + exit(0); + } + ],[hdf5_cv_have_lfs=yes],[hdf5_cv_have_lfs=no],)]) + + if test "X${hdf5_cv_have_lfs}" = "Xyes"; then + AC_MSG_RESULT([yes]) + LARGEFILE="yes" + fi + if test "X${hdf5_cv_have_lfs}" = "Xno"; then + AC_MSG_RESULT([no]) + LARGEFILE="no" + fi + +else + LARGEFILE="no" + AC_MSG_RESULT(no) +fi + +dnl ---------------------------------------------------------------------- +dnl Add necessary defines for Linux Systems. +dnl +case "$host_cpu-$host_vendor-$host_os" in + *linux*) + dnl If largefile support is enabled, then make available various + dnl LFS-related routines using the following _LARGEFILE*_SOURCE macros. + if test "X$LARGEFILE" != "Xno"; then + AM_CPPFLAGS="-D_LARGEFILE64_SOURCE -D_LARGEFILE_SOURCE $AM_CPPFLAGS" fi dnl Add POSIX support on Linux systems, so <features.h> defines dnl __USE_POSIX, which is required to get the prototype for fdopen - dnl defined correctly in <stdio.h> + dnl defined correctly in <stdio.h>. + dnl This flag was removed from h5cc as of 2009-10-17 when it was found + dnl that the flag broke compiling netCDF-4 code with h5cc, but kept in + dnl H5_CPPFLAGS because fdopen and HDfdopen fail without it. HDfdopen + dnl is used only by H5_debug_mask which is used only when debugging in + dnl H5_init_library (all in H5.c). When the flag was removed this was + dnl the only compile failure noted; however, defining the Macro + dnl makes available the functionality from the POSIX.1 standard as well + dnl as all or the ISO C facilities, according to a discussion of + dnl defining the _POSIX_SOURCE, _BSD_SOURCE, and _POSIX_C_SOURCE Macros + dnl and their interaction found at + dnl http://www.gnu.org/s/libc/manual/html_node/Feature-Test-Macros.html. H5_CPPFLAGS="-D_POSIX_SOURCE $H5_CPPFLAGS" dnl Also add BSD support on Linux systems, so <features.h> defines @@ -2517,9 +2593,9 @@ case "X-$enable_parallel" in AC_LANG_POP(Fortran) fi - dnl Set RUNPARALLEL to mpirun if not set yet. + dnl Set RUNPARALLEL to mpiexec if not set yet. dnl Check for building on Cray if RUNPARALLEL is not yet set by checking - dnl for 'aprun' command (which is the parallel job launcher, like mpirun). + dnl for 'aprun' command (which is the parallel job launcher, like mpiexec). if test "X$PARALLEL" = "Xyes" -a -z "$RUNPARALLEL"; then dnl Find the path where aprun is located. for path in `echo $PATH | ${TR} ":" " "`; do @@ -2530,9 +2606,9 @@ case "X-$enable_parallel" in done fi - dnl Set RUNPARALLEL to mpirun if not set yet. + dnl Set RUNPARALLEL to mpiexec if not set yet. if test "X$PARALLEL" = "Xyes" -a -z "$RUNPARALLEL"; then - RUNPARALLEL="mpirun -np \$\${NPROCS:=3}" + RUNPARALLEL="mpiexec -n \$\${NPROCS:=3}" fi ;; |