From 3ec16a0bb3465a7e6723cb1a6ba9b30f86e7a43d Mon Sep 17 00:00:00 2001 From: Lourens Veen Date: Wed, 13 May 2026 09:54:31 +0200 Subject: [PATCH] Rewrite HDF5 detection logic to work with newer versions --- src/amuse_etics/Makefile | 4 +- .../packages/amuse-etics-cuda.amuse_deps | 2 +- src/amuse_etics/src/Makefile.in | 2 +- src/amuse_etics/src/amuse_lib_hdf5.m4 | 1 + src/amuse_etics/src/configure | 143 +- src/amuse_etics/src/configure.ac | 41 +- src/amuse_etics/support/aclocal.m4 | 2 +- src/amuse_etics/support/config.mk.in | 8 +- src/amuse_etics/support/configure | 4218 ++++++++++-- src/amuse_etics/support/configure.ac | 3 +- src/amuse_mesa_r15140/Makefile | 4 +- .../packages/amuse-mesa-r15140.amuse_deps | 2 +- src/amuse_mesa_r15140/support/config.mk.in | 7 +- src/amuse_mesa_r15140/support/configure.ac | 2 +- src/amuse_simplex/Makefile | 3 +- .../packages/amuse-simplex.amuse_deps | 2 +- src/amuse_simplex/support/aclocal.m4 | 2 +- src/amuse_simplex/support/config.mk.in | 5 - src/amuse_simplex/support/configure | 4652 +++++++++++-- src/amuse_simplex/support/configure.ac | 3 +- support/aclocal.m4 | 2 +- support/configure | 6022 +++++++++++++---- support/configure.ac | 10 +- support/shared/m4/amuse_lib_hdf5.m4 | 579 ++ support/shared/m4/ax_lib_hdf5.m4 | 323 - 25 files changed, 13361 insertions(+), 2681 deletions(-) create mode 120000 src/amuse_etics/src/amuse_lib_hdf5.m4 create mode 100644 support/shared/m4/amuse_lib_hdf5.m4 delete mode 100644 support/shared/m4/ax_lib_hdf5.m4 diff --git a/src/amuse_etics/Makefile b/src/amuse_etics/Makefile index 480e9a2392..e4fd996159 100644 --- a/src/amuse_etics/Makefile +++ b/src/amuse_etics/Makefile @@ -11,8 +11,8 @@ support/config.mk: # Building the code into a static library DEPFLAGS += $(CUDA_FLAGS) CXXFLAGS += $(DEPFLAGS) -Wall -LDFLAGS += $(CUDA_LDFLAGS) -LDLIBS += -lcudart +LDFLAGS += $(CUDA_LDFLAGS) $(HDF5_LDFLAGS) +LDLIBS += -lcudart -lhdf5_cpp -lhdf5 CODELIB = src/libetics.a diff --git a/src/amuse_etics/packages/amuse-etics-cuda.amuse_deps b/src/amuse_etics/packages/amuse-etics-cuda.amuse_deps index 1738fe0417..1723809c7b 100644 --- a/src/amuse_etics/packages/amuse-etics-cuda.amuse_deps +++ b/src/amuse_etics/packages/amuse-etics-cuda.amuse_deps @@ -1 +1 @@ -c++ mpi cuda hdf5 +c++ mpi cuda hdf5-cxx diff --git a/src/amuse_etics/src/Makefile.in b/src/amuse_etics/src/Makefile.in index 6eb5d6909b..e9b89e1718 100644 --- a/src/amuse_etics/src/Makefile.in +++ b/src/amuse_etics/src/Makefile.in @@ -58,7 +58,7 @@ scf-optimize-lc: mathaux.o scf.o scf-optimize-lc.o ic.o # only io.cpp should be compiled with all the weird HDF5 flags io.o: io.cpp - $(CXX) $(CPPFLAGS) -I@HDF5_ROOT@/include $(CXXFLAGS) -c -o io.o io.cpp + $(CXX) $(CPPFLAGS) $(HDF5_CXXFLAGS) $(CXXFLAGS) -c -o io.o io.cpp .cu.o: $< $(NVCC) $(CUDAFLAGS) $(CPPFLAGS) -Xcompiler "$(CXXFLAGS)" -dc -o $@ $< diff --git a/src/amuse_etics/src/amuse_lib_hdf5.m4 b/src/amuse_etics/src/amuse_lib_hdf5.m4 new file mode 120000 index 0000000000..8ace41d38f --- /dev/null +++ b/src/amuse_etics/src/amuse_lib_hdf5.m4 @@ -0,0 +1 @@ +../support/shared/m4/amuse_lib_hdf5.m4 \ No newline at end of file diff --git a/src/amuse_etics/src/configure b/src/amuse_etics/src/configure index 5426d9850a..2eebf1b27b 100755 --- a/src/amuse_etics/src/configure +++ b/src/amuse_etics/src/configure @@ -652,11 +652,11 @@ ac_header_cxx_list= ac_subst_vars='LTLIBOBJS LIBOBJS BOOSTINC -HDF5_ROOT +HDF5_LDFLAGS +HDF5_CXXFLAGS STATICLIBS GPU_ARCH CUDA_ROOT -H5CXX MPICXX ac_ct_CC CFLAGS @@ -3053,11 +3053,11 @@ if test x$ac_prog_cxx_stdcxx = xno then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $CXX option to enable C++11 features" >&5 printf %s "checking for $CXX option to enable C++11 features... " >&6; } -if test ${ac_cv_prog_cxx_11+y} +if test ${ac_cv_prog_cxx_cxx11+y} then : printf %s "(cached) " >&6 else $as_nop - ac_cv_prog_cxx_11=no + ac_cv_prog_cxx_cxx11=no ac_save_CXX=$CXX cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -3099,11 +3099,11 @@ if test x$ac_prog_cxx_stdcxx = xno then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $CXX option to enable C++98 features" >&5 printf %s "checking for $CXX option to enable C++98 features... " >&6; } -if test ${ac_cv_prog_cxx_98+y} +if test ${ac_cv_prog_cxx_cxx98+y} then : printf %s "(cached) " >&6 else $as_nop - ac_cv_prog_cxx_98=no + ac_cv_prog_cxx_cxx98=no ac_save_CXX=$CXX cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -4499,138 +4499,14 @@ fi fi -if test -z $HDF5_ROOT -then : +AMUSE_LIB_HDF5() - # Extract the first word of "h5c++", so it can be a program name with args. -set dummy h5c++; ac_word=$2 -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -printf %s "checking for $ac_word... " >&6; } -if test ${ac_cv_prog_H5CXX+y} +if test "$HDF5_CXX_FOUND" == "no" then : - printf %s "(cached) " >&6 -else $as_nop - if test -n "$H5CXX"; then - ac_cv_prog_H5CXX="$H5CXX" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - case $as_dir in #((( - '') as_dir=./ ;; - */) ;; - *) as_dir=$as_dir/ ;; - esac - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then - ac_cv_prog_H5CXX="h5c++" - printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - - test -z "$ac_cv_prog_H5CXX" && ac_cv_prog_H5CXX="no" -fi -fi -H5CXX=$ac_cv_prog_H5CXX -if test -n "$H5CXX"; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $H5CXX" >&5 -printf "%s\n" "$H5CXX" >&6; } -else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } + as_fn_error $? "Could not find HDF5 library with C++ support" "$LINENO" 5 fi - if test "$H5CXX" == "no" -then : - as_fn_error $? "This package needs HDF5 (not really but this configure script does)" "$LINENO" 5 -fi - HDF5_ROOT=`which h5c++ | sed 's:/bin/h5c++$::'` - -else $as_nop - - # Extract the first word of "h5c++", so it can be a program name with args. -set dummy h5c++; ac_word=$2 -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -printf %s "checking for $ac_word... " >&6; } -if test ${ac_cv_prog_H5CXX+y} -then : - printf %s "(cached) " >&6 -else $as_nop - if test -n "$H5CXX"; then - ac_cv_prog_H5CXX="$H5CXX" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $HDF5_ROOT/bin -do - IFS=$as_save_IFS - case $as_dir in #((( - '') as_dir=./ ;; - */) ;; - *) as_dir=$as_dir/ ;; - esac - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then - ac_cv_prog_H5CXX="$HDF5_ROOT/bin/h5c++" - printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - - test -z "$ac_cv_prog_H5CXX" && ac_cv_prog_H5CXX="no" -fi -fi -H5CXX=$ac_cv_prog_H5CXX -if test -n "$H5CXX"; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $H5CXX" >&5 -printf "%s\n" "$H5CXX" >&6; } -else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } -fi - - - if test "$H5CXX" == "no" -then : - as_fn_error $? "Cound not find HDF5 compiler in $HDF5_ROOT/bin" "$LINENO" 5 -fi - -fi - - -# # Check HDF5 -# AS_IF([test -z $HDF5_ROOT], -# [ -# AC_CHECK_LIB([hdf5], [main], [], -# [ -# AS_UNSET([ac_cv_lib_hdf5_main]) -# AC_CHECK_PROG([HDF5CC], [h5cc], [h5cc], [:]) -# AS_IF([test "$HDF5CC" == :], [AC_MSG_ERROR([This package needs HDF5])], -# [ -# AC_PROG_SED -# AC_MSG_NOTICE([H5CC executable found, trying to find library nearby]) -# HDF5_ROOT=`which h5cc | sed 's:/bin/h5cc$::'` -# AC_MSG_NOTICE([XXXXX $HDF5_ROOT]) -# # AX_LDFLAGS_PUSH([dgsfgdfgd /home/ymeiron/local/lib/libhdf5.a]) -# # AC_CHECK_LIB([hdf5], [main], [], [AC_MSG_ERROR([This package needs HDF5])]) -# # AX_LDFLAGS_POP -# ]) -# ]) -# ], -# [ -# AX_LDFLAGS_PUSH([-L$HDF5_ROOT/lib]) -# AC_CHECK_LIB([hdf5], [main], [], [AC_MSG_ERROR([No compatible HDF5 library was found in $HDF5_ROOT/lib])]) -# AX_LDFLAGS_POP -# ]) - - - H5CXX_SHOW=`h5c++ -show` MPICXX_SHOW=`mpic++ -show` @@ -4788,6 +4664,7 @@ fi + ac_config_files="$ac_config_files Makefile" diff --git a/src/amuse_etics/src/configure.ac b/src/amuse_etics/src/configure.ac index a870e8348f..1439acb3c6 100644 --- a/src/amuse_etics/src/configure.ac +++ b/src/amuse_etics/src/configure.ac @@ -130,43 +130,9 @@ AS_IF([test -z $MPI_ROOT], AS_IF([test "$MPICXX" == "no"], [AC_MSG_ERROR([Cound not find MPI compiler in $MPI_ROOT/bin])]) ]) -AS_IF([test -z $HDF5_ROOT], -[ - AC_CHECK_PROG([H5CXX], [h5c++], [h5c++], [no]) - AS_IF([test "$H5CXX" == "no"], [AC_MSG_ERROR([This package needs HDF5 (not really but this configure script does)])]) - HDF5_ROOT=`which h5c++ | sed 's:/bin/h5c++$::'` -], -[ - AC_CHECK_PROG([H5CXX], [h5c++], [$HDF5_ROOT/bin/h5c++], [no], [$HDF5_ROOT/bin]) - AS_IF([test "$H5CXX" == "no"], [AC_MSG_ERROR([Cound not find HDF5 compiler in $HDF5_ROOT/bin])]) -]) - - -# # Check HDF5 -# AS_IF([test -z $HDF5_ROOT], -# [ -# AC_CHECK_LIB([hdf5], [main], [], -# [ -# AS_UNSET([ac_cv_lib_hdf5_main]) -# AC_CHECK_PROG([HDF5CC], [h5cc], [h5cc], [:]) -# AS_IF([test "$HDF5CC" == :], [AC_MSG_ERROR([This package needs HDF5])], -# [ -# AC_PROG_SED -# AC_MSG_NOTICE([H5CC executable found, trying to find library nearby]) -# HDF5_ROOT=`which h5cc | sed 's:/bin/h5cc$::'` -# AC_MSG_NOTICE([XXXXX $HDF5_ROOT]) -# # AX_LDFLAGS_PUSH([dgsfgdfgd /home/ymeiron/local/lib/libhdf5.a]) -# # AC_CHECK_LIB([hdf5], [main], [], [AC_MSG_ERROR([This package needs HDF5])]) -# # AX_LDFLAGS_POP -# ]) -# ]) -# ], -# [ -# AX_LDFLAGS_PUSH([-L$HDF5_ROOT/lib]) -# AC_CHECK_LIB([hdf5], [main], [], [AC_MSG_ERROR([No compatible HDF5 library was found in $HDF5_ROOT/lib])]) -# AX_LDFLAGS_POP -# ]) +AMUSE_LIB_HDF5() +AS_IF([test "$HDF5_CXX_FOUND" == "no"], [AC_MSG_ERROR([Could not find HDF5 library with C++ support])]) H5CXX_SHOW=`h5c++ -show` @@ -246,7 +212,8 @@ AC_SUBST([CUDA_ROOT]) AC_SUBST([NVCC]) AC_SUBST([GPU_ARCH]) AC_SUBST([STATICLIBS]) -AC_SUBST([HDF5_ROOT]) +AC_SUBST([HDF5_CXXFLAGS]) +AC_SUBST([HDF5_LDFLAGS]) AC_SUBST([BOOSTINC]) AC_CONFIG_FILES([Makefile]) diff --git a/src/amuse_etics/support/aclocal.m4 b/src/amuse_etics/support/aclocal.m4 index 061bce8c6b..4760dfc64a 100644 --- a/src/amuse_etics/support/aclocal.m4 +++ b/src/amuse_etics/support/aclocal.m4 @@ -13,8 +13,8 @@ m4_ifndef([AC_CONFIG_MACRO_DIRS], [m4_defun([_AM_CONFIG_MACRO_DIRS], [])m4_defun([AC_CONFIG_MACRO_DIRS], [_AM_CONFIG_MACRO_DIRS($@)])]) m4_include([shared/m4/amuse_cuda.m4]) +m4_include([shared/m4/amuse_lib_hdf5.m4]) m4_include([shared/m4/amuse_log_envvars.m4]) m4_include([shared/m4/amuse_venv.m4]) m4_include([shared/m4/ax_count_cpus.m4]) -m4_include([shared/m4/ax_lib_hdf5.m4]) m4_include([shared/m4/ax_mpi.m4]) diff --git a/src/amuse_etics/support/config.mk.in b/src/amuse_etics/support/config.mk.in index b9e497270e..6c19fc9692 100644 --- a/src/amuse_etics/support/config.mk.in +++ b/src/amuse_etics/support/config.mk.in @@ -22,10 +22,6 @@ NVCC = @NVCC@ CUDA_FLAGS = @CUDA_FLAGS@ CUDA_LDFLAGS = @CUDA_LDFLAGS@ -HDF5_VERSION = @HDF5_VERSION@ -HDF5_CFLAGS = @HDF5_CFLAGS@ -HDF5_CPPFLAGS = @HDF5_CPPFLAGS@ -HDF5_LIBS = @HDF5_LIBS@ -HDF5_FLIBS = @HDF5_FLIBS@ - +HDF5_CXXFLAGS = @HDF5_CXXFLAGS@ +HDF5_LDFLAGS = @HDF5_LDFLAGS@ diff --git a/src/amuse_etics/support/configure b/src/amuse_etics/support/configure index bcb8ab5bae..7bde206dfe 100755 --- a/src/amuse_etics/support/configure +++ b/src/amuse_etics/support/configure @@ -613,54 +613,20 @@ PACKAGE_STRING='amuse-etics 1.0' PACKAGE_BUGREPORT='' PACKAGE_URL='' -# Factoring default headers for most tests. -ac_includes_default="\ -#include -#ifdef HAVE_STDIO_H -# include -#endif -#ifdef HAVE_STDLIB_H -# include -#endif -#ifdef HAVE_STRING_H -# include -#endif -#ifdef HAVE_INTTYPES_H -# include -#endif -#ifdef HAVE_STDINT_H -# include -#endif -#ifdef HAVE_STRINGS_H -# include -#endif -#ifdef HAVE_SYS_TYPES_H -# include -#endif -#ifdef HAVE_SYS_STAT_H -# include -#endif -#ifdef HAVE_UNISTD_H -# include -#endif" - -ac_header_c_list= ac_subst_vars='LTLIBOBJS LIBOBJS -HDF5_TYPE -HDF5_FLIBS -HDF5_FFLAGS -HDF5_FC -HDF5_LIBS +HDF5_HLFC_LIB HDF5_LDFLAGS -HDF5_CPPFLAGS +HDF5_FCFLAGS +HDF5_CXXFLAGS HDF5_CFLAGS -HDF5_CC -HDF5_VERSION +HDF5_TYPE H5FC +H5CXX H5CC -AWK -SED +ac_ct_FC +FCFLAGS +FC CUDA_LDFLAGS CUDA_FLAGS NVCC @@ -740,7 +706,6 @@ SHELL' ac_subst_files='' ac_user_opts=' enable_option_checking -with_hdf5 ' ac_precious_vars='build_alias host_alias @@ -753,7 +718,9 @@ CPPFLAGS CCC MPICXX CC -CFLAGS' +CFLAGS +FC +FCFLAGS' # Initialize some variables set by options. @@ -1373,11 +1340,6 @@ if test -n "$ac_init_help"; then esac cat <<\_ACEOF -Optional Packages: - --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] - --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) - --with-hdf5=yes/no/PATH location of h5cc or h5pcc for HDF5 configuration - Some influential environment variables: CXX C++ compiler command CXXFLAGS C++ compiler flags @@ -1389,6 +1351,8 @@ Some influential environment variables: MPICXX MPI C++ compiler command CC C compiler command CFLAGS C compiler flags + FC Fortran compiler command + FCFLAGS Fortran compiler flags Use these variables to override the choices made by `configure' or to help it to find libraries and programs with nonstandard names/locations. @@ -1705,38 +1669,91 @@ fi } # ac_fn_c_try_link -# ac_fn_c_check_header_compile LINENO HEADER VAR INCLUDES -# ------------------------------------------------------- -# Tests whether HEADER exists and can be compiled using the include files in -# INCLUDES, setting the cache variable VAR accordingly. -ac_fn_c_check_header_compile () +# ac_fn_fc_try_compile LINENO +# --------------------------- +# Try to compile conftest.$ac_ext, and return whether this succeeded. +ac_fn_fc_try_compile () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 -printf %s "checking for $2... " >&6; } -if eval test \${$3+y} + rm -f conftest.$ac_objext conftest.beam + if { { ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +printf "%s\n" "$ac_try_echo"; } >&5 + (eval "$ac_compile") 2>conftest.err + ac_status=$? + if test -s conftest.err; then + grep -v '^ *+' conftest.err >conftest.er1 + cat conftest.er1 >&5 + mv -f conftest.er1 conftest.err + fi + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && { + test -z "$ac_fc_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext then : - printf %s "(cached) " >&6 + ac_retval=0 else $as_nop - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -$4 -#include <$2> -_ACEOF -if ac_fn_c_try_compile "$LINENO" + printf "%s\n" "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_retval=1 +fi + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + as_fn_set_status $ac_retval + +} # ac_fn_fc_try_compile + +# ac_fn_fc_try_link LINENO +# ------------------------ +# Try to link conftest.$ac_ext, and return whether this succeeded. +ac_fn_fc_try_link () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + rm -f conftest.$ac_objext conftest.beam conftest$ac_exeext + if { { ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +printf "%s\n" "$ac_try_echo"; } >&5 + (eval "$ac_link") 2>conftest.err + ac_status=$? + if test -s conftest.err; then + grep -v '^ *+' conftest.err >conftest.er1 + cat conftest.er1 >&5 + mv -f conftest.er1 conftest.err + fi + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && { + test -z "$ac_fc_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + test -x conftest$ac_exeext + } then : - eval "$3=yes" + ac_retval=0 else $as_nop - eval "$3=no" -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + printf "%s\n" "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_retval=1 fi -eval ac_res=\$$3 - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -printf "%s\n" "$ac_res" >&6; } + # Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information + # created by the PGI compiler (conftest_ipa8_conftest.oo), as it would + # interfere with the next link command; also delete a directory that is + # left behind by Apple's compiler. We do this before executing the actions. + rm -rf conftest.dSYM conftest_ipa8_conftest.oo eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + as_fn_set_status $ac_retval -} # ac_fn_c_check_header_compile +} # ac_fn_fc_try_link ac_configure_args_raw= for ac_arg do @@ -2556,15 +2573,6 @@ main (int argc, char **argv) } " -as_fn_append ac_header_c_list " stdio.h stdio_h HAVE_STDIO_H" -as_fn_append ac_header_c_list " stdlib.h stdlib_h HAVE_STDLIB_H" -as_fn_append ac_header_c_list " string.h string_h HAVE_STRING_H" -as_fn_append ac_header_c_list " inttypes.h inttypes_h HAVE_INTTYPES_H" -as_fn_append ac_header_c_list " stdint.h stdint_h HAVE_STDINT_H" -as_fn_append ac_header_c_list " strings.h strings_h HAVE_STRINGS_H" -as_fn_append ac_header_c_list " sys/stat.h sys_stat_h HAVE_SYS_STAT_H" -as_fn_append ac_header_c_list " sys/types.h sys_types_h HAVE_SYS_TYPES_H" -as_fn_append ac_header_c_list " unistd.h unistd_h HAVE_UNISTD_H" # Auxiliary files required by this configure script. ac_aux_files="config.guess config.sub" @@ -6187,22 +6195,33 @@ ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ex ac_compiler_gnu=$ac_cv_cxx_compiler_gnu -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for a sed that does not truncate output" >&5 -printf %s "checking for a sed that does not truncate output... " >&6; } -if test ${ac_cv_path_SED+y} + +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 + + +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 +if test -n "$ac_tool_prefix"; then + for ac_prog in gfortran g95 xlf95 f95 fort ifort ifc efc pgfortran pgf95 lf95 ftn nagfor xlf90 f90 pgf90 pghpf epcf90 g77 xlf f77 frt pgf77 cf77 fort77 fl32 af77 + do + # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. +set dummy $ac_tool_prefix$ac_prog; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_FC+y} then : printf %s "(cached) " >&6 else $as_nop - ac_script=s/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb/ - for ac_i in 1 2 3 4 5 6 7; do - ac_script="$ac_script$as_nl$ac_script" - done - echo "$ac_script" 2>/dev/null | sed 99q >conftest.sed - { ac_script=; unset ac_script;} - if test -z "$SED"; then - ac_path_SED_found=false - # Loop through the user's path and test for each of PROGNAME-LIST - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR + if test -n "$FC"; then + ac_cv_prog_FC="$FC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS @@ -6211,69 +6230,45 @@ do */) ;; *) as_dir=$as_dir/ ;; esac - for ac_prog in sed gsed - do for ac_exec_ext in '' $ac_executable_extensions; do - ac_path_SED="$as_dir$ac_prog$ac_exec_ext" - as_fn_executable_p "$ac_path_SED" || continue -# Check for GNU ac_path_SED and select it if it is found. - # Check for GNU $ac_path_SED -case `"$ac_path_SED" --version 2>&1` in -*GNU*) - ac_cv_path_SED="$ac_path_SED" ac_path_SED_found=:;; -*) - ac_count=0 - printf %s 0123456789 >"conftest.in" - while : - do - cat "conftest.in" "conftest.in" >"conftest.tmp" - mv "conftest.tmp" "conftest.in" - cp "conftest.in" "conftest.nl" - printf "%s\n" '' >> "conftest.nl" - "$ac_path_SED" -f conftest.sed < "conftest.nl" >"conftest.out" 2>/dev/null || break - diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break - as_fn_arith $ac_count + 1 && ac_count=$as_val - if test $ac_count -gt ${ac_path_SED_max-0}; then - # Best one so far, save it but keep looking for a better one - ac_cv_path_SED="$ac_path_SED" - ac_path_SED_max=$ac_count - fi - # 10*(2^10) chars as input seems more than enough - test $ac_count -gt 10 && break - done - rm -f conftest.in conftest.tmp conftest.nl conftest.out;; -esac - - $ac_path_SED_found && break 3 - done - done + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_prog_FC="$ac_tool_prefix$ac_prog" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done done IFS=$as_save_IFS - if test -z "$ac_cv_path_SED"; then - as_fn_error $? "no acceptable sed could be found in \$PATH" "$LINENO" 5 - fi + +fi +fi +FC=$ac_cv_prog_FC +if test -n "$FC"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $FC" >&5 +printf "%s\n" "$FC" >&6; } else - ac_cv_path_SED=$SED + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_SED" >&5 -printf "%s\n" "$ac_cv_path_SED" >&6; } - SED="$ac_cv_path_SED" - rm -f conftest.sed -for ac_prog in gawk mawk nawk awk + test -n "$FC" && break + done +fi +if test -z "$FC"; then + ac_ct_FC=$FC + for ac_prog in gfortran g95 xlf95 f95 fort ifort ifc efc pgfortran pgf95 lf95 ftn nagfor xlf90 f90 pgf90 pghpf epcf90 g77 xlf f77 frt pgf77 cf77 fort77 fl32 af77 do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } -if test ${ac_cv_prog_AWK+y} +if test ${ac_cv_prog_ac_ct_FC+y} then : printf %s "(cached) " >&6 else $as_nop - if test -n "$AWK"; then - ac_cv_prog_AWK="$AWK" # Let the user override the test. + if test -n "$ac_ct_FC"; then + ac_cv_prog_ac_ct_FC="$ac_ct_FC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH @@ -6286,7 +6281,7 @@ do esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then - ac_cv_prog_AWK="$ac_prog" + ac_cv_prog_ac_ct_FC="$ac_prog" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi @@ -6296,111 +6291,3320 @@ IFS=$as_save_IFS fi fi -AWK=$ac_cv_prog_AWK -if test -n "$AWK"; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $AWK" >&5 -printf "%s\n" "$AWK" >&6; } +ac_ct_FC=$ac_cv_prog_ac_ct_FC +if test -n "$ac_ct_FC"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_FC" >&5 +printf "%s\n" "$ac_ct_FC" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi - test -n "$AWK" && break + test -n "$ac_ct_FC" && break done -ac_header= ac_cache= -for ac_item in $ac_header_c_list -do - if test $ac_cache; then - ac_fn_c_check_header_compile "$LINENO" $ac_header ac_cv_header_$ac_cache "$ac_includes_default" - if eval test \"x\$ac_cv_header_$ac_cache\" = xyes; then - printf "%s\n" "#define $ac_item 1" >> confdefs.h - fi - ac_header= ac_cache= - elif test $ac_header; then - ac_cache=$ac_item + if test "x$ac_ct_FC" = x; then + FC="" else - ac_header=$ac_item + case $cross_compiling:$ac_tool_warned in +yes:) +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + FC=$ac_ct_FC fi -done - +fi +# Provide some information about the compiler. +printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for Fortran compiler version" >&5 +set X $ac_compile +ac_compiler=$2 +for ac_option in --version -v -V -qversion; do + { { ac_try="$ac_compiler $ac_option >&5" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +printf "%s\n" "$ac_try_echo"; } >&5 + (eval "$ac_compiler $ac_option >&5") 2>conftest.err + ac_status=$? + if test -s conftest.err; then + sed '10a\ +... rest of stderr output deleted ... + 10q' conftest.err >conftest.er1 + cat conftest.er1 >&5 + fi + rm -f conftest.er1 conftest.err + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } +done +rm -f a.out +# If we don't use `.F' as extension, the preprocessor is not run on the +# input file. (Note that this only needs to work for GNU compilers.) +ac_save_ext=$ac_ext +ac_ext=F +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether the compiler supports GNU Fortran" >&5 +printf %s "checking whether the compiler supports GNU Fortran... " >&6; } +if test ${ac_cv_fc_compiler_gnu+y} +then : + printf %s "(cached) " >&6 +else $as_nop + cat > conftest.$ac_ext <<_ACEOF + program main +#ifndef __GNUC__ + choke me +#endif + end +_ACEOF +if ac_fn_fc_try_compile "$LINENO" +then : + ac_compiler_gnu=yes +else $as_nop + ac_compiler_gnu=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +ac_cv_fc_compiler_gnu=$ac_compiler_gnu +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_fc_compiler_gnu" >&5 +printf "%s\n" "$ac_cv_fc_compiler_gnu" >&6; } +ac_compiler_gnu=$ac_cv_fc_compiler_gnu +ac_ext=$ac_save_ext +ac_test_FCFLAGS=${FCFLAGS+y} +ac_save_FCFLAGS=$FCFLAGS +FCFLAGS= +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $FC accepts -g" >&5 +printf %s "checking whether $FC accepts -g... " >&6; } +if test ${ac_cv_prog_fc_g+y} +then : + printf %s "(cached) " >&6 +else $as_nop + FCFLAGS=-g +cat > conftest.$ac_ext <<_ACEOF + program main -if test $ac_cv_header_stdlib_h = yes && test $ac_cv_header_string_h = yes + end +_ACEOF +if ac_fn_fc_try_compile "$LINENO" then : + ac_cv_prog_fc_g=yes +else $as_nop + ac_cv_prog_fc_g=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext -printf "%s\n" "#define STDC_HEADERS 1" >>confdefs.h +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_fc_g" >&5 +printf "%s\n" "$ac_cv_prog_fc_g" >&6; } +if test $ac_test_FCFLAGS; then + FCFLAGS=$ac_save_FCFLAGS +elif test $ac_cv_prog_fc_g = yes; then + if test "x$ac_cv_fc_compiler_gnu" = xyes; then + FCFLAGS="-g -O2" + else + FCFLAGS="-g" + fi +else + if test "x$ac_cv_fc_compiler_gnu" = xyes; then + FCFLAGS="-O2" + else + FCFLAGS= + fi +fi +if test $ac_compiler_gnu = yes; then + GFC=yes +else + GFC= fi +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 + amuse_h5_detect_C="no" + amuse_h5_result="no" -if test "" = "" ; then - : # Recognized value -elif test "" = "serial" ; then - : # Recognized value -elif test "" = "parallel"; then - : # Recognized value -else - as_fn_error $? " -Unrecognized value for AX_LIB_HDF5 within configure.ac. -If supplied, argument 1 must be either 'serial' or 'parallel'. -" "$LINENO" 5 -fi + if test -n "$CONDA_PREFIX" + then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: Conda environment detected, ignoring HDF5_ROOT, HDF5_DIR and CMAKE_PREFIX_PATH" >&5 +printf "%s\n" "$as_me: Conda environment detected, ignoring HDF5_ROOT, HDF5_DIR and CMAKE_PREFIX_PATH" >&6;} + else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether HDF5_ROOT points to an HDF5 installation" >&5 +printf %s "checking whether HDF5_ROOT points to an HDF5 installation... " >&6; } + if test -z "$HDF5_ROOT" + then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + elif test -f "$HDF5_ROOT/bin/h5pcc" + then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no, because this seems to be a parallel build" >&5 +printf "%s\n" "no, because this seems to be a parallel build" >&6; } + else + if test -f "$HDF5_ROOT/include/hdf5.h" && test -f "$HDF5_ROOT/lib/libhdf5.so" + then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + amuse_h5_result="yes" + amuse_h5_root="$HDF5_ROOT" + else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + amuse_h5_result="no" + fi + fi -# Check whether --with-hdf5 was given. -if test ${with_hdf5+y} -then : - withval=$with_hdf5; if test "$withval" = "no"; then - with_hdf5="no" - elif test "$withval" = "yes"; then - with_hdf5="yes" - else - with_hdf5="yes" - H5CC="$withval" - fi -else $as_nop - with_hdf5="yes" -fi + if test "$amuse_h5_result" = "no" + then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether HDF5_DIR points to an HDF5 installation" >&5 +printf %s "checking whether HDF5_DIR points to an HDF5 installation... " >&6; } + if test -z "$HDF5_DIR" + then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + elif test -f "$HDF5_DIR/bin/h5pcc" + then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no, because this seems to be a parallel build" >&5 +printf "%s\n" "no, because this seems to be a parallel build" >&6; } + else + if test -f "$HDF5_DIR/include/hdf5.h" && test -f "$HDF5_DIR/lib/libhdf5.so" + then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + amuse_h5_result="yes" + amuse_h5_root="$HDF5_DIR" + else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + amuse_h5_result="no" + fi + fi -HDF5_CC="" -HDF5_VERSION="" -HDF5_CFLAGS="" -HDF5_CPPFLAGS="" -HDF5_LDFLAGS="" -HDF5_LIBS="" -HDF5_FC="" -HDF5_FFLAGS="" -HDF5_FLIBS="" -HDF5_TYPE="" + fi -if test "$with_hdf5" = "yes"; then - if test -z "$H5CC"; then - for ac_prog in h5cc h5pcc -do - # Extract the first word of "$ac_prog", so it can be a program name with args. -set dummy $ac_prog; ac_word=$2 -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -printf %s "checking for $ac_word... " >&6; } -if test ${ac_cv_path_H5CC+y} -then : - printf %s "(cached) " >&6 -else $as_nop + if test "$amuse_h5_result" = "no" && test -n "$CMAKE_PREFIX_PATH" + then + amuse_h5_save_IFS="$IFS" + IFS=: + for amuse_h5_path in $CMAKE_PREFIX_PATH + do + # restore IFS immediately as it may mess up the below + IFS="$amuse_h5_save_IFS" + if test -z "$amuse_h5_path" + then + continue + fi + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $amuse_h5_path from CMAKE_PREFIX_PATH points to an HDF5 installation" >&5 +printf %s "checking whether $amuse_h5_path from CMAKE_PREFIX_PATH points to an HDF5 installation... " >&6; } + if test -z "$amuse_h5_path" + then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + elif test -f "$amuse_h5_path/bin/h5pcc" + then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no, because this seems to be a parallel build" >&5 +printf "%s\n" "no, because this seems to be a parallel build" >&6; } + else + if test -f "$amuse_h5_path/include/hdf5.h" && test -f "$amuse_h5_path/lib/libhdf5.so" + then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + amuse_h5_result="yes" + amuse_h5_root="$amuse_h5_path" + else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + amuse_h5_result="no" + fi + fi + + + if test "$amuse_h5_result" = "yes" + then + break + fi + + done + IFS="$amuse_h5_save_IFS" + fi + + if test "$amuse_h5_result" = "yes" + then + + amuse_h5_LDFLAGS="-L$amuse_h5_root/lib" + + 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 + + amuse_h5_CFLAGS="-I$amuse_h5_root/include" + + amuse_h5_name="C" + amuse_h5_prefix="C" + amuse_h5_target="C" + amuse_h5_program="#include +int +main (void) +{ +H5open(); H5close(); + ; + return 0; +}" + amuse_h5_libs="-lhdf5" + + amuse_h5_flags_var="${amuse_h5_prefix}FLAGS" + amuse_h5_flags_source_var="amuse_h5_${amuse_h5_flags_var}" + amuse_h5_flags_target_var="amuse_h5_detect_${amuse_h5_target}" + + eval "amuse_h5_save_FLAGS=\"\$$amuse_h5_flags_var\"" + amuse_h5_save_LDFLAGS="$LDFLAGS" + amuse_h5_save_LIBS="$LIBS" + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether we can build a program with HDF5 in $amuse_h5_name" >&5 +printf %s "checking whether we can build a program with HDF5 in $amuse_h5_name... " >&6; } + + eval "$amuse_h5_flags_var=\"\$$amuse_h5_flags_source_var \$$amuse_h5_flags_var\"" + LDFLAGS="$amuse_h5_LDFLAGS $LDFLAGS" + LIBS="$amuse_h5_libs" + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$amuse_h5_program +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + + eval "$amuse_h5_flags_target_var=\"yes\"" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + +else $as_nop + + eval "$amuse_h5_flags_target_var=\"no\"" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext + + LIBS="$amuse_h5_save_LIBS" + LDFLAGS="$amuse_h5_save_LDFLAGS" + eval "$amuse_h5_flags_var=\"\$amuse_h5_save_FLAGS\"" + + + + amuse_h5_name="C with the high-level API" + amuse_h5_prefix="C" + amuse_h5_target="HL_C" + amuse_h5_program="#include +int +main (void) +{ +H5LTfind_dataset(0, \"test\") + ; + return 0; +}" + amuse_h5_libs="-lhdf5_hl" + + amuse_h5_flags_var="${amuse_h5_prefix}FLAGS" + amuse_h5_flags_source_var="amuse_h5_${amuse_h5_flags_var}" + amuse_h5_flags_target_var="amuse_h5_detect_${amuse_h5_target}" + + eval "amuse_h5_save_FLAGS=\"\$$amuse_h5_flags_var\"" + amuse_h5_save_LDFLAGS="$LDFLAGS" + amuse_h5_save_LIBS="$LIBS" + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether we can build a program with HDF5 in $amuse_h5_name" >&5 +printf %s "checking whether we can build a program with HDF5 in $amuse_h5_name... " >&6; } + + eval "$amuse_h5_flags_var=\"\$$amuse_h5_flags_source_var \$$amuse_h5_flags_var\"" + LDFLAGS="$amuse_h5_LDFLAGS $LDFLAGS" + LIBS="$amuse_h5_libs" + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$amuse_h5_program +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + + eval "$amuse_h5_flags_target_var=\"yes\"" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + +else $as_nop + + eval "$amuse_h5_flags_target_var=\"no\"" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext + + LIBS="$amuse_h5_save_LIBS" + LDFLAGS="$amuse_h5_save_LDFLAGS" + eval "$amuse_h5_flags_var=\"\$amuse_h5_save_FLAGS\"" + + 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 + + + ac_ext=cpp +ac_cpp='$CXXCPP $CPPFLAGS' +ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_cxx_compiler_gnu + + amuse_h5_CXXFLAGS="-I$amuse_h5_root/include" + + amuse_h5_name="C++" + amuse_h5_prefix="CXX" + amuse_h5_target="CXX" + amuse_h5_program="#include +int +main (void) +{ +H5::H5Library::open(); + ; + return 0; +}" + amuse_h5_libs="-lhdf5_cpp" + + amuse_h5_flags_var="${amuse_h5_prefix}FLAGS" + amuse_h5_flags_source_var="amuse_h5_${amuse_h5_flags_var}" + amuse_h5_flags_target_var="amuse_h5_detect_${amuse_h5_target}" + + eval "amuse_h5_save_FLAGS=\"\$$amuse_h5_flags_var\"" + amuse_h5_save_LDFLAGS="$LDFLAGS" + amuse_h5_save_LIBS="$LIBS" + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether we can build a program with HDF5 in $amuse_h5_name" >&5 +printf %s "checking whether we can build a program with HDF5 in $amuse_h5_name... " >&6; } + + eval "$amuse_h5_flags_var=\"\$$amuse_h5_flags_source_var \$$amuse_h5_flags_var\"" + LDFLAGS="$amuse_h5_LDFLAGS $LDFLAGS" + LIBS="$amuse_h5_libs" + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$amuse_h5_program +_ACEOF +if ac_fn_cxx_try_link "$LINENO" +then : + + eval "$amuse_h5_flags_target_var=\"yes\"" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + +else $as_nop + + eval "$amuse_h5_flags_target_var=\"no\"" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext + + LIBS="$amuse_h5_save_LIBS" + LDFLAGS="$amuse_h5_save_LDFLAGS" + eval "$amuse_h5_flags_var=\"\$amuse_h5_save_FLAGS\"" + + 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 + + + amuse_h5_FCFLAGS="-I$amuse_h5_root/include" + + 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 + + + amuse_h5_name="Fortran with mods in /include" + amuse_h5_prefix="FC" + amuse_h5_target="FC" + amuse_h5_program=" program main + + use h5lib + + integer :: error + + call h5open_f(error) + call h5close_f(error) + end" + amuse_h5_libs="-lhdf5_fortran" + + amuse_h5_flags_var="${amuse_h5_prefix}FLAGS" + amuse_h5_flags_source_var="amuse_h5_${amuse_h5_flags_var}" + amuse_h5_flags_target_var="amuse_h5_detect_${amuse_h5_target}" + + eval "amuse_h5_save_FLAGS=\"\$$amuse_h5_flags_var\"" + amuse_h5_save_LDFLAGS="$LDFLAGS" + amuse_h5_save_LIBS="$LIBS" + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether we can build a program with HDF5 in $amuse_h5_name" >&5 +printf %s "checking whether we can build a program with HDF5 in $amuse_h5_name... " >&6; } + + eval "$amuse_h5_flags_var=\"\$$amuse_h5_flags_source_var \$$amuse_h5_flags_var\"" + LDFLAGS="$amuse_h5_LDFLAGS $LDFLAGS" + LIBS="$amuse_h5_libs" + + cat > conftest.$ac_ext <<_ACEOF +$amuse_h5_program +_ACEOF +if ac_fn_fc_try_link "$LINENO" +then : + + eval "$amuse_h5_flags_target_var=\"yes\"" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + +else $as_nop + + eval "$amuse_h5_flags_target_var=\"no\"" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext + + LIBS="$amuse_h5_save_LIBS" + LDFLAGS="$amuse_h5_save_LDFLAGS" + eval "$amuse_h5_flags_var=\"\$amuse_h5_save_FLAGS\"" + + + + amuse_h5_name="Fortran with the high-level API in hdf5_hl_fortran with mods in /include" + amuse_h5_prefix="FC" + amuse_h5_target="HL_FC" + amuse_h5_program=" program main + + use h5lt + + integer :: error + + error = h5ltfind_dataset_f(0_hid_t, 'test') + + end" + amuse_h5_libs="-lhdf5_hl_fortran" + + amuse_h5_flags_var="${amuse_h5_prefix}FLAGS" + amuse_h5_flags_source_var="amuse_h5_${amuse_h5_flags_var}" + amuse_h5_flags_target_var="amuse_h5_detect_${amuse_h5_target}" + + eval "amuse_h5_save_FLAGS=\"\$$amuse_h5_flags_var\"" + amuse_h5_save_LDFLAGS="$LDFLAGS" + amuse_h5_save_LIBS="$LIBS" + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether we can build a program with HDF5 in $amuse_h5_name" >&5 +printf %s "checking whether we can build a program with HDF5 in $amuse_h5_name... " >&6; } + + eval "$amuse_h5_flags_var=\"\$$amuse_h5_flags_source_var \$$amuse_h5_flags_var\"" + LDFLAGS="$amuse_h5_LDFLAGS $LDFLAGS" + LIBS="$amuse_h5_libs" + + cat > conftest.$ac_ext <<_ACEOF +$amuse_h5_program +_ACEOF +if ac_fn_fc_try_link "$LINENO" +then : + + eval "$amuse_h5_flags_target_var=\"yes\"" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + +else $as_nop + + eval "$amuse_h5_flags_target_var=\"no\"" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext + + LIBS="$amuse_h5_save_LIBS" + LDFLAGS="$amuse_h5_save_LDFLAGS" + eval "$amuse_h5_flags_var=\"\$amuse_h5_save_FLAGS\"" + + + if test $amuse_h5_detect_HL_FC = "yes" + then + amuse_h5_HL_FC_LIB="-lhdf5_hl_fortran" + else + + amuse_h5_name="Fortran with the high-level API in hdf5hl_fortran with mods in /include" + amuse_h5_prefix="FC" + amuse_h5_target="HL_FC" + amuse_h5_program=" program main + + use h5lt + + integer :: error + + error = h5ltfind_dataset_f(0_hid_t, 'test') + + end" + amuse_h5_libs="-lhdf5hl_fortran" + + amuse_h5_flags_var="${amuse_h5_prefix}FLAGS" + amuse_h5_flags_source_var="amuse_h5_${amuse_h5_flags_var}" + amuse_h5_flags_target_var="amuse_h5_detect_${amuse_h5_target}" + + eval "amuse_h5_save_FLAGS=\"\$$amuse_h5_flags_var\"" + amuse_h5_save_LDFLAGS="$LDFLAGS" + amuse_h5_save_LIBS="$LIBS" + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether we can build a program with HDF5 in $amuse_h5_name" >&5 +printf %s "checking whether we can build a program with HDF5 in $amuse_h5_name... " >&6; } + + eval "$amuse_h5_flags_var=\"\$$amuse_h5_flags_source_var \$$amuse_h5_flags_var\"" + LDFLAGS="$amuse_h5_LDFLAGS $LDFLAGS" + LIBS="$amuse_h5_libs" + + cat > conftest.$ac_ext <<_ACEOF +$amuse_h5_program +_ACEOF +if ac_fn_fc_try_link "$LINENO" +then : + + eval "$amuse_h5_flags_target_var=\"yes\"" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + +else $as_nop + + eval "$amuse_h5_flags_target_var=\"no\"" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext + + LIBS="$amuse_h5_save_LIBS" + LDFLAGS="$amuse_h5_save_LDFLAGS" + eval "$amuse_h5_flags_var=\"\$amuse_h5_save_FLAGS\"" + + + if test $amuse_h5_detect_HL_FC = "yes" + then + amuse_h5_HL_FC_LIB="-lhdf5hl_fortran" + fi + fi + + 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 + + + + if test $amuse_h5_detect_FC = "no" + then + amuse_h5_FCFLAGS="-I$amuse_h5_root/mod/shared" + + 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 + + + amuse_h5_name="Fortran with mods in /mod/shared" + amuse_h5_prefix="FC" + amuse_h5_target="FC" + amuse_h5_program=" program main + + use h5lib + + integer :: error + + call h5open_f(error) + call h5close_f(error) + end" + amuse_h5_libs="-lhdf5_fortran" + + amuse_h5_flags_var="${amuse_h5_prefix}FLAGS" + amuse_h5_flags_source_var="amuse_h5_${amuse_h5_flags_var}" + amuse_h5_flags_target_var="amuse_h5_detect_${amuse_h5_target}" + + eval "amuse_h5_save_FLAGS=\"\$$amuse_h5_flags_var\"" + amuse_h5_save_LDFLAGS="$LDFLAGS" + amuse_h5_save_LIBS="$LIBS" + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether we can build a program with HDF5 in $amuse_h5_name" >&5 +printf %s "checking whether we can build a program with HDF5 in $amuse_h5_name... " >&6; } + + eval "$amuse_h5_flags_var=\"\$$amuse_h5_flags_source_var \$$amuse_h5_flags_var\"" + LDFLAGS="$amuse_h5_LDFLAGS $LDFLAGS" + LIBS="$amuse_h5_libs" + + cat > conftest.$ac_ext <<_ACEOF +$amuse_h5_program +_ACEOF +if ac_fn_fc_try_link "$LINENO" +then : + + eval "$amuse_h5_flags_target_var=\"yes\"" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + +else $as_nop + + eval "$amuse_h5_flags_target_var=\"no\"" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext + + LIBS="$amuse_h5_save_LIBS" + LDFLAGS="$amuse_h5_save_LDFLAGS" + eval "$amuse_h5_flags_var=\"\$amuse_h5_save_FLAGS\"" + + + + amuse_h5_name="Fortran with the high-level API in hdf5_hl_fortran with mods in /mod/shared" + amuse_h5_prefix="FC" + amuse_h5_target="HL_FC" + amuse_h5_program=" program main + + use h5lt + + integer :: error + + error = h5ltfind_dataset_f(0_hid_t, 'test') + + end" + amuse_h5_libs="-lhdf5_hl_fortran" + + amuse_h5_flags_var="${amuse_h5_prefix}FLAGS" + amuse_h5_flags_source_var="amuse_h5_${amuse_h5_flags_var}" + amuse_h5_flags_target_var="amuse_h5_detect_${amuse_h5_target}" + + eval "amuse_h5_save_FLAGS=\"\$$amuse_h5_flags_var\"" + amuse_h5_save_LDFLAGS="$LDFLAGS" + amuse_h5_save_LIBS="$LIBS" + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether we can build a program with HDF5 in $amuse_h5_name" >&5 +printf %s "checking whether we can build a program with HDF5 in $amuse_h5_name... " >&6; } + + eval "$amuse_h5_flags_var=\"\$$amuse_h5_flags_source_var \$$amuse_h5_flags_var\"" + LDFLAGS="$amuse_h5_LDFLAGS $LDFLAGS" + LIBS="$amuse_h5_libs" + + cat > conftest.$ac_ext <<_ACEOF +$amuse_h5_program +_ACEOF +if ac_fn_fc_try_link "$LINENO" +then : + + eval "$amuse_h5_flags_target_var=\"yes\"" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + +else $as_nop + + eval "$amuse_h5_flags_target_var=\"no\"" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext + + LIBS="$amuse_h5_save_LIBS" + LDFLAGS="$amuse_h5_save_LDFLAGS" + eval "$amuse_h5_flags_var=\"\$amuse_h5_save_FLAGS\"" + + + if test $amuse_h5_detect_HL_FC = "yes" + then + amuse_h5_HL_FC_LIB="-lhdf5_hl_fortran" + else + + amuse_h5_name="Fortran with the high-level API in hdf5hl_fortran with mods in /mod/shared" + amuse_h5_prefix="FC" + amuse_h5_target="HL_FC" + amuse_h5_program=" program main + + use h5lt + + integer :: error + + error = h5ltfind_dataset_f(0_hid_t, 'test') + + end" + amuse_h5_libs="-lhdf5hl_fortran" + + amuse_h5_flags_var="${amuse_h5_prefix}FLAGS" + amuse_h5_flags_source_var="amuse_h5_${amuse_h5_flags_var}" + amuse_h5_flags_target_var="amuse_h5_detect_${amuse_h5_target}" + + eval "amuse_h5_save_FLAGS=\"\$$amuse_h5_flags_var\"" + amuse_h5_save_LDFLAGS="$LDFLAGS" + amuse_h5_save_LIBS="$LIBS" + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether we can build a program with HDF5 in $amuse_h5_name" >&5 +printf %s "checking whether we can build a program with HDF5 in $amuse_h5_name... " >&6; } + + eval "$amuse_h5_flags_var=\"\$$amuse_h5_flags_source_var \$$amuse_h5_flags_var\"" + LDFLAGS="$amuse_h5_LDFLAGS $LDFLAGS" + LIBS="$amuse_h5_libs" + + cat > conftest.$ac_ext <<_ACEOF +$amuse_h5_program +_ACEOF +if ac_fn_fc_try_link "$LINENO" +then : + + eval "$amuse_h5_flags_target_var=\"yes\"" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + +else $as_nop + + eval "$amuse_h5_flags_target_var=\"no\"" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext + + LIBS="$amuse_h5_save_LIBS" + LDFLAGS="$amuse_h5_save_LDFLAGS" + eval "$amuse_h5_flags_var=\"\$amuse_h5_save_FLAGS\"" + + + if test $amuse_h5_detect_HL_FC = "yes" + then + amuse_h5_HL_FC_LIB="-lhdf5hl_fortran" + fi + fi + + 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 test $amuse_h5_detect_FC = "no" + then + amuse_h5_FCFLAGS="" + fi + + fi + fi + + + if test "$amuse_h5_detect_C" = "no" + then + + amuse_h5_LDFLAGS="" + + 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 + + amuse_h5_CFLAGS="" + + amuse_h5_name="C with no additional flags" + amuse_h5_prefix="C" + amuse_h5_target="C" + amuse_h5_program="#include +int +main (void) +{ +H5open(); H5close(); + ; + return 0; +}" + amuse_h5_libs="-lhdf5" + + amuse_h5_flags_var="${amuse_h5_prefix}FLAGS" + amuse_h5_flags_source_var="amuse_h5_${amuse_h5_flags_var}" + amuse_h5_flags_target_var="amuse_h5_detect_${amuse_h5_target}" + + eval "amuse_h5_save_FLAGS=\"\$$amuse_h5_flags_var\"" + amuse_h5_save_LDFLAGS="$LDFLAGS" + amuse_h5_save_LIBS="$LIBS" + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether we can build a program with HDF5 in $amuse_h5_name" >&5 +printf %s "checking whether we can build a program with HDF5 in $amuse_h5_name... " >&6; } + + eval "$amuse_h5_flags_var=\"\$$amuse_h5_flags_source_var \$$amuse_h5_flags_var\"" + LDFLAGS="$amuse_h5_LDFLAGS $LDFLAGS" + LIBS="$amuse_h5_libs" + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$amuse_h5_program +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + + eval "$amuse_h5_flags_target_var=\"yes\"" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + +else $as_nop + + eval "$amuse_h5_flags_target_var=\"no\"" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext + + LIBS="$amuse_h5_save_LIBS" + LDFLAGS="$amuse_h5_save_LDFLAGS" + eval "$amuse_h5_flags_var=\"\$amuse_h5_save_FLAGS\"" + + 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 + + + if test $amuse_h5_detect_C = "yes" + then + 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 + + + amuse_h5_name="C with the high-level API" + amuse_h5_prefix="C" + amuse_h5_target="HL_C" + amuse_h5_program="#include +int +main (void) +{ +H5LTfind_dataset(0, \"test\") + ; + return 0; +}" + amuse_h5_libs="-lhdf5_hl" + + amuse_h5_flags_var="${amuse_h5_prefix}FLAGS" + amuse_h5_flags_source_var="amuse_h5_${amuse_h5_flags_var}" + amuse_h5_flags_target_var="amuse_h5_detect_${amuse_h5_target}" + + eval "amuse_h5_save_FLAGS=\"\$$amuse_h5_flags_var\"" + amuse_h5_save_LDFLAGS="$LDFLAGS" + amuse_h5_save_LIBS="$LIBS" + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether we can build a program with HDF5 in $amuse_h5_name" >&5 +printf %s "checking whether we can build a program with HDF5 in $amuse_h5_name... " >&6; } + + eval "$amuse_h5_flags_var=\"\$$amuse_h5_flags_source_var \$$amuse_h5_flags_var\"" + LDFLAGS="$amuse_h5_LDFLAGS $LDFLAGS" + LIBS="$amuse_h5_libs" + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$amuse_h5_program +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + + eval "$amuse_h5_flags_target_var=\"yes\"" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + +else $as_nop + + eval "$amuse_h5_flags_target_var=\"no\"" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext + + LIBS="$amuse_h5_save_LIBS" + LDFLAGS="$amuse_h5_save_LDFLAGS" + eval "$amuse_h5_flags_var=\"\$amuse_h5_save_FLAGS\"" + + 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 + + + ac_ext=cpp +ac_cpp='$CXXCPP $CPPFLAGS' +ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_cxx_compiler_gnu + + + amuse_h5_name="C++" + amuse_h5_prefix="CXX" + amuse_h5_target="CXX" + amuse_h5_program="#include +int +main (void) +{ +H5::H5Library::open(); + ; + return 0; +}" + amuse_h5_libs="-lhdf5_cpp" + + amuse_h5_flags_var="${amuse_h5_prefix}FLAGS" + amuse_h5_flags_source_var="amuse_h5_${amuse_h5_flags_var}" + amuse_h5_flags_target_var="amuse_h5_detect_${amuse_h5_target}" + + eval "amuse_h5_save_FLAGS=\"\$$amuse_h5_flags_var\"" + amuse_h5_save_LDFLAGS="$LDFLAGS" + amuse_h5_save_LIBS="$LIBS" + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether we can build a program with HDF5 in $amuse_h5_name" >&5 +printf %s "checking whether we can build a program with HDF5 in $amuse_h5_name... " >&6; } + + eval "$amuse_h5_flags_var=\"\$$amuse_h5_flags_source_var \$$amuse_h5_flags_var\"" + LDFLAGS="$amuse_h5_LDFLAGS $LDFLAGS" + LIBS="$amuse_h5_libs" + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$amuse_h5_program +_ACEOF +if ac_fn_cxx_try_link "$LINENO" +then : + + eval "$amuse_h5_flags_target_var=\"yes\"" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + +else $as_nop + + eval "$amuse_h5_flags_target_var=\"no\"" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext + + LIBS="$amuse_h5_save_LIBS" + LDFLAGS="$amuse_h5_save_LDFLAGS" + eval "$amuse_h5_flags_var=\"\$amuse_h5_save_FLAGS\"" + + 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 + + + + 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 + + + amuse_h5_name="Fortran " + amuse_h5_prefix="FC" + amuse_h5_target="FC" + amuse_h5_program=" program main + + use h5lib + + integer :: error + + call h5open_f(error) + call h5close_f(error) + end" + amuse_h5_libs="-lhdf5_fortran" + + amuse_h5_flags_var="${amuse_h5_prefix}FLAGS" + amuse_h5_flags_source_var="amuse_h5_${amuse_h5_flags_var}" + amuse_h5_flags_target_var="amuse_h5_detect_${amuse_h5_target}" + + eval "amuse_h5_save_FLAGS=\"\$$amuse_h5_flags_var\"" + amuse_h5_save_LDFLAGS="$LDFLAGS" + amuse_h5_save_LIBS="$LIBS" + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether we can build a program with HDF5 in $amuse_h5_name" >&5 +printf %s "checking whether we can build a program with HDF5 in $amuse_h5_name... " >&6; } + + eval "$amuse_h5_flags_var=\"\$$amuse_h5_flags_source_var \$$amuse_h5_flags_var\"" + LDFLAGS="$amuse_h5_LDFLAGS $LDFLAGS" + LIBS="$amuse_h5_libs" + + cat > conftest.$ac_ext <<_ACEOF +$amuse_h5_program +_ACEOF +if ac_fn_fc_try_link "$LINENO" +then : + + eval "$amuse_h5_flags_target_var=\"yes\"" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + +else $as_nop + + eval "$amuse_h5_flags_target_var=\"no\"" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext + + LIBS="$amuse_h5_save_LIBS" + LDFLAGS="$amuse_h5_save_LDFLAGS" + eval "$amuse_h5_flags_var=\"\$amuse_h5_save_FLAGS\"" + + + + amuse_h5_name="Fortran with the high-level API in hdf5_hl_fortran " + amuse_h5_prefix="FC" + amuse_h5_target="HL_FC" + amuse_h5_program=" program main + + use h5lt + + integer :: error + + error = h5ltfind_dataset_f(0_hid_t, 'test') + + end" + amuse_h5_libs="-lhdf5_hl_fortran" + + amuse_h5_flags_var="${amuse_h5_prefix}FLAGS" + amuse_h5_flags_source_var="amuse_h5_${amuse_h5_flags_var}" + amuse_h5_flags_target_var="amuse_h5_detect_${amuse_h5_target}" + + eval "amuse_h5_save_FLAGS=\"\$$amuse_h5_flags_var\"" + amuse_h5_save_LDFLAGS="$LDFLAGS" + amuse_h5_save_LIBS="$LIBS" + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether we can build a program with HDF5 in $amuse_h5_name" >&5 +printf %s "checking whether we can build a program with HDF5 in $amuse_h5_name... " >&6; } + + eval "$amuse_h5_flags_var=\"\$$amuse_h5_flags_source_var \$$amuse_h5_flags_var\"" + LDFLAGS="$amuse_h5_LDFLAGS $LDFLAGS" + LIBS="$amuse_h5_libs" + + cat > conftest.$ac_ext <<_ACEOF +$amuse_h5_program +_ACEOF +if ac_fn_fc_try_link "$LINENO" +then : + + eval "$amuse_h5_flags_target_var=\"yes\"" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + +else $as_nop + + eval "$amuse_h5_flags_target_var=\"no\"" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext + + LIBS="$amuse_h5_save_LIBS" + LDFLAGS="$amuse_h5_save_LDFLAGS" + eval "$amuse_h5_flags_var=\"\$amuse_h5_save_FLAGS\"" + + + if test $amuse_h5_detect_HL_FC = "yes" + then + amuse_h5_HL_FC_LIB="-lhdf5_hl_fortran" + else + + amuse_h5_name="Fortran with the high-level API in hdf5hl_fortran " + amuse_h5_prefix="FC" + amuse_h5_target="HL_FC" + amuse_h5_program=" program main + + use h5lt + + integer :: error + + error = h5ltfind_dataset_f(0_hid_t, 'test') + + end" + amuse_h5_libs="-lhdf5hl_fortran" + + amuse_h5_flags_var="${amuse_h5_prefix}FLAGS" + amuse_h5_flags_source_var="amuse_h5_${amuse_h5_flags_var}" + amuse_h5_flags_target_var="amuse_h5_detect_${amuse_h5_target}" + + eval "amuse_h5_save_FLAGS=\"\$$amuse_h5_flags_var\"" + amuse_h5_save_LDFLAGS="$LDFLAGS" + amuse_h5_save_LIBS="$LIBS" + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether we can build a program with HDF5 in $amuse_h5_name" >&5 +printf %s "checking whether we can build a program with HDF5 in $amuse_h5_name... " >&6; } + + eval "$amuse_h5_flags_var=\"\$$amuse_h5_flags_source_var \$$amuse_h5_flags_var\"" + LDFLAGS="$amuse_h5_LDFLAGS $LDFLAGS" + LIBS="$amuse_h5_libs" + + cat > conftest.$ac_ext <<_ACEOF +$amuse_h5_program +_ACEOF +if ac_fn_fc_try_link "$LINENO" +then : + + eval "$amuse_h5_flags_target_var=\"yes\"" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + +else $as_nop + + eval "$amuse_h5_flags_target_var=\"no\"" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext + + LIBS="$amuse_h5_save_LIBS" + LDFLAGS="$amuse_h5_save_LDFLAGS" + eval "$amuse_h5_flags_var=\"\$amuse_h5_save_FLAGS\"" + + + if test $amuse_h5_detect_HL_FC = "yes" + then + amuse_h5_HL_FC_LIB="-lhdf5hl_fortran" + fi + fi + + 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 + + + + if test $amuse_h5_detect_FC = "no" + then + + amuse_h5_result="" + amuse_h5_in_isystem="no" + for flag in $FFLAGS + do + if test "$amuse_h5_in_isystem" = "yes" + then + if ! echo "$amuse_h5_result" | grep -e "$flag" >/dev/null 2>&1 + then + amuse_h5_result="$amuse_h5_result:$flag" + fi + amuse_h5_in_isystem="no" + continue + fi + + if test "$flag" = "-isystem" + then + amuse_h5_in_isystem="yes" + elif test "${flag#-I}" != "$flag" + then + amuse_h5_path="${flag#-I}" + if ! echo "$amuse_h5_result" | grep -e "$amuse_h5_path" >/dev/null 2>&1 + then + amuse_h5_result="$amuse_h5_result:${flag#-I}" + fi + fi + done + + + amuse_h5_save_IFS="$IFS" + IFS=: + for amuse_h5_path in $amuse_h5_result + do + # need to restore IFS immediately as it messes up the below + IFS="$amuse_h5_save_IFS" + if test -z "$amuse_h5_path" + then + continue + fi + + amuse_h5_FCFLAGS="$FCFLAGS -I$amuse_h5_path" + + 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 + + + amuse_h5_name="Fortran with $amuse_h5_path from FFLAGS" + amuse_h5_prefix="FC" + amuse_h5_target="FC" + amuse_h5_program=" program main + + use h5lib + + integer :: error + + call h5open_f(error) + call h5close_f(error) + end" + amuse_h5_libs="-lhdf5_fortran" + + amuse_h5_flags_var="${amuse_h5_prefix}FLAGS" + amuse_h5_flags_source_var="amuse_h5_${amuse_h5_flags_var}" + amuse_h5_flags_target_var="amuse_h5_detect_${amuse_h5_target}" + + eval "amuse_h5_save_FLAGS=\"\$$amuse_h5_flags_var\"" + amuse_h5_save_LDFLAGS="$LDFLAGS" + amuse_h5_save_LIBS="$LIBS" + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether we can build a program with HDF5 in $amuse_h5_name" >&5 +printf %s "checking whether we can build a program with HDF5 in $amuse_h5_name... " >&6; } + + eval "$amuse_h5_flags_var=\"\$$amuse_h5_flags_source_var \$$amuse_h5_flags_var\"" + LDFLAGS="$amuse_h5_LDFLAGS $LDFLAGS" + LIBS="$amuse_h5_libs" + + cat > conftest.$ac_ext <<_ACEOF +$amuse_h5_program +_ACEOF +if ac_fn_fc_try_link "$LINENO" +then : + + eval "$amuse_h5_flags_target_var=\"yes\"" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + +else $as_nop + + eval "$amuse_h5_flags_target_var=\"no\"" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext + + LIBS="$amuse_h5_save_LIBS" + LDFLAGS="$amuse_h5_save_LDFLAGS" + eval "$amuse_h5_flags_var=\"\$amuse_h5_save_FLAGS\"" + + + + amuse_h5_name="Fortran with the high-level API in hdf5_hl_fortran with $amuse_h5_path from FFLAGS" + amuse_h5_prefix="FC" + amuse_h5_target="HL_FC" + amuse_h5_program=" program main + + use h5lt + + integer :: error + + error = h5ltfind_dataset_f(0_hid_t, 'test') + + end" + amuse_h5_libs="-lhdf5_hl_fortran" + + amuse_h5_flags_var="${amuse_h5_prefix}FLAGS" + amuse_h5_flags_source_var="amuse_h5_${amuse_h5_flags_var}" + amuse_h5_flags_target_var="amuse_h5_detect_${amuse_h5_target}" + + eval "amuse_h5_save_FLAGS=\"\$$amuse_h5_flags_var\"" + amuse_h5_save_LDFLAGS="$LDFLAGS" + amuse_h5_save_LIBS="$LIBS" + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether we can build a program with HDF5 in $amuse_h5_name" >&5 +printf %s "checking whether we can build a program with HDF5 in $amuse_h5_name... " >&6; } + + eval "$amuse_h5_flags_var=\"\$$amuse_h5_flags_source_var \$$amuse_h5_flags_var\"" + LDFLAGS="$amuse_h5_LDFLAGS $LDFLAGS" + LIBS="$amuse_h5_libs" + + cat > conftest.$ac_ext <<_ACEOF +$amuse_h5_program +_ACEOF +if ac_fn_fc_try_link "$LINENO" +then : + + eval "$amuse_h5_flags_target_var=\"yes\"" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + +else $as_nop + + eval "$amuse_h5_flags_target_var=\"no\"" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext + + LIBS="$amuse_h5_save_LIBS" + LDFLAGS="$amuse_h5_save_LDFLAGS" + eval "$amuse_h5_flags_var=\"\$amuse_h5_save_FLAGS\"" + + + if test $amuse_h5_detect_HL_FC = "yes" + then + amuse_h5_HL_FC_LIB="-lhdf5_hl_fortran" + else + + amuse_h5_name="Fortran with the high-level API in hdf5hl_fortran with $amuse_h5_path from FFLAGS" + amuse_h5_prefix="FC" + amuse_h5_target="HL_FC" + amuse_h5_program=" program main + + use h5lt + + integer :: error + + error = h5ltfind_dataset_f(0_hid_t, 'test') + + end" + amuse_h5_libs="-lhdf5hl_fortran" + + amuse_h5_flags_var="${amuse_h5_prefix}FLAGS" + amuse_h5_flags_source_var="amuse_h5_${amuse_h5_flags_var}" + amuse_h5_flags_target_var="amuse_h5_detect_${amuse_h5_target}" + + eval "amuse_h5_save_FLAGS=\"\$$amuse_h5_flags_var\"" + amuse_h5_save_LDFLAGS="$LDFLAGS" + amuse_h5_save_LIBS="$LIBS" + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether we can build a program with HDF5 in $amuse_h5_name" >&5 +printf %s "checking whether we can build a program with HDF5 in $amuse_h5_name... " >&6; } + + eval "$amuse_h5_flags_var=\"\$$amuse_h5_flags_source_var \$$amuse_h5_flags_var\"" + LDFLAGS="$amuse_h5_LDFLAGS $LDFLAGS" + LIBS="$amuse_h5_libs" + + cat > conftest.$ac_ext <<_ACEOF +$amuse_h5_program +_ACEOF +if ac_fn_fc_try_link "$LINENO" +then : + + eval "$amuse_h5_flags_target_var=\"yes\"" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + +else $as_nop + + eval "$amuse_h5_flags_target_var=\"no\"" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext + + LIBS="$amuse_h5_save_LIBS" + LDFLAGS="$amuse_h5_save_LDFLAGS" + eval "$amuse_h5_flags_var=\"\$amuse_h5_save_FLAGS\"" + + + if test $amuse_h5_detect_HL_FC = "yes" + then + amuse_h5_HL_FC_LIB="-lhdf5hl_fortran" + fi + fi + + 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 + + + if test "$amuse_h5_detect_FC" = "yes" + then + amuse_h5_FCFLAGS="-I$amuse_h5_path" + break + fi + + # The new Fortran CMake-based build system uses the non-standard and + # not-searched-unless-explicitly-specified /mod/shared subdirectory by + # default + amuse_h5_FCFLAGS="$FCFLAGS -I$amuse_h5_path/../mod/shared" + + 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 + + + amuse_h5_name="Fortran with $amuse_h5_path from FFLAGS and /mod/shared" + amuse_h5_prefix="FC" + amuse_h5_target="FC" + amuse_h5_program=" program main + + use h5lib + + integer :: error + + call h5open_f(error) + call h5close_f(error) + end" + amuse_h5_libs="-lhdf5_fortran" + + amuse_h5_flags_var="${amuse_h5_prefix}FLAGS" + amuse_h5_flags_source_var="amuse_h5_${amuse_h5_flags_var}" + amuse_h5_flags_target_var="amuse_h5_detect_${amuse_h5_target}" + + eval "amuse_h5_save_FLAGS=\"\$$amuse_h5_flags_var\"" + amuse_h5_save_LDFLAGS="$LDFLAGS" + amuse_h5_save_LIBS="$LIBS" + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether we can build a program with HDF5 in $amuse_h5_name" >&5 +printf %s "checking whether we can build a program with HDF5 in $amuse_h5_name... " >&6; } + + eval "$amuse_h5_flags_var=\"\$$amuse_h5_flags_source_var \$$amuse_h5_flags_var\"" + LDFLAGS="$amuse_h5_LDFLAGS $LDFLAGS" + LIBS="$amuse_h5_libs" + + cat > conftest.$ac_ext <<_ACEOF +$amuse_h5_program +_ACEOF +if ac_fn_fc_try_link "$LINENO" +then : + + eval "$amuse_h5_flags_target_var=\"yes\"" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + +else $as_nop + + eval "$amuse_h5_flags_target_var=\"no\"" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext + + LIBS="$amuse_h5_save_LIBS" + LDFLAGS="$amuse_h5_save_LDFLAGS" + eval "$amuse_h5_flags_var=\"\$amuse_h5_save_FLAGS\"" + + + + amuse_h5_name="Fortran with the high-level API in hdf5_hl_fortran with $amuse_h5_path from FFLAGS and /mod/shared" + amuse_h5_prefix="FC" + amuse_h5_target="HL_FC" + amuse_h5_program=" program main + + use h5lt + + integer :: error + + error = h5ltfind_dataset_f(0_hid_t, 'test') + + end" + amuse_h5_libs="-lhdf5_hl_fortran" + + amuse_h5_flags_var="${amuse_h5_prefix}FLAGS" + amuse_h5_flags_source_var="amuse_h5_${amuse_h5_flags_var}" + amuse_h5_flags_target_var="amuse_h5_detect_${amuse_h5_target}" + + eval "amuse_h5_save_FLAGS=\"\$$amuse_h5_flags_var\"" + amuse_h5_save_LDFLAGS="$LDFLAGS" + amuse_h5_save_LIBS="$LIBS" + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether we can build a program with HDF5 in $amuse_h5_name" >&5 +printf %s "checking whether we can build a program with HDF5 in $amuse_h5_name... " >&6; } + + eval "$amuse_h5_flags_var=\"\$$amuse_h5_flags_source_var \$$amuse_h5_flags_var\"" + LDFLAGS="$amuse_h5_LDFLAGS $LDFLAGS" + LIBS="$amuse_h5_libs" + + cat > conftest.$ac_ext <<_ACEOF +$amuse_h5_program +_ACEOF +if ac_fn_fc_try_link "$LINENO" +then : + + eval "$amuse_h5_flags_target_var=\"yes\"" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + +else $as_nop + + eval "$amuse_h5_flags_target_var=\"no\"" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext + + LIBS="$amuse_h5_save_LIBS" + LDFLAGS="$amuse_h5_save_LDFLAGS" + eval "$amuse_h5_flags_var=\"\$amuse_h5_save_FLAGS\"" + + + if test $amuse_h5_detect_HL_FC = "yes" + then + amuse_h5_HL_FC_LIB="-lhdf5_hl_fortran" + else + + amuse_h5_name="Fortran with the high-level API in hdf5hl_fortran with $amuse_h5_path from FFLAGS and /mod/shared" + amuse_h5_prefix="FC" + amuse_h5_target="HL_FC" + amuse_h5_program=" program main + + use h5lt + + integer :: error + + error = h5ltfind_dataset_f(0_hid_t, 'test') + + end" + amuse_h5_libs="-lhdf5hl_fortran" + + amuse_h5_flags_var="${amuse_h5_prefix}FLAGS" + amuse_h5_flags_source_var="amuse_h5_${amuse_h5_flags_var}" + amuse_h5_flags_target_var="amuse_h5_detect_${amuse_h5_target}" + + eval "amuse_h5_save_FLAGS=\"\$$amuse_h5_flags_var\"" + amuse_h5_save_LDFLAGS="$LDFLAGS" + amuse_h5_save_LIBS="$LIBS" + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether we can build a program with HDF5 in $amuse_h5_name" >&5 +printf %s "checking whether we can build a program with HDF5 in $amuse_h5_name... " >&6; } + + eval "$amuse_h5_flags_var=\"\$$amuse_h5_flags_source_var \$$amuse_h5_flags_var\"" + LDFLAGS="$amuse_h5_LDFLAGS $LDFLAGS" + LIBS="$amuse_h5_libs" + + cat > conftest.$ac_ext <<_ACEOF +$amuse_h5_program +_ACEOF +if ac_fn_fc_try_link "$LINENO" +then : + + eval "$amuse_h5_flags_target_var=\"yes\"" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + +else $as_nop + + eval "$amuse_h5_flags_target_var=\"no\"" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext + + LIBS="$amuse_h5_save_LIBS" + LDFLAGS="$amuse_h5_save_LDFLAGS" + eval "$amuse_h5_flags_var=\"\$amuse_h5_save_FLAGS\"" + + + if test $amuse_h5_detect_HL_FC = "yes" + then + amuse_h5_HL_FC_LIB="-lhdf5hl_fortran" + fi + fi + + 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 + + + if test "$amuse_h5_detect_FC" = "yes" + then + amuse_h5_FCFLAGS="-I$amuse_h5_path/../mod/shared" + break + fi + + if test "$amuse_h5_detect_FC" = "no" + then + amuse_h5_FCFLAGS="" + fi + done + IFS="$amuse_h5_save_IFS" + + fi + + if test $amuse_h5_detect_FC = "no" + then + + amuse_h5_result="" + amuse_h5_in_isystem="no" + for flag in $CFLAGS + do + if test "$amuse_h5_in_isystem" = "yes" + then + if ! echo "$amuse_h5_result" | grep -e "$flag" >/dev/null 2>&1 + then + amuse_h5_result="$amuse_h5_result:$flag" + fi + amuse_h5_in_isystem="no" + continue + fi + + if test "$flag" = "-isystem" + then + amuse_h5_in_isystem="yes" + elif test "${flag#-I}" != "$flag" + then + amuse_h5_path="${flag#-I}" + if ! echo "$amuse_h5_result" | grep -e "$amuse_h5_path" >/dev/null 2>&1 + then + amuse_h5_result="$amuse_h5_result:${flag#-I}" + fi + fi + done + + + amuse_h5_save_IFS="$IFS" + IFS=: + for amuse_h5_path in $amuse_h5_result + do + # need to restore IFS immediately as it messes up the below + IFS="$amuse_h5_save_IFS" + if test -z "$amuse_h5_path" + then + continue + fi + + amuse_h5_FCFLAGS="$FCFLAGS -I$amuse_h5_path" + + 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 + + + amuse_h5_name="Fortran with $amuse_h5_path from CFLAGS" + amuse_h5_prefix="FC" + amuse_h5_target="FC" + amuse_h5_program=" program main + + use h5lib + + integer :: error + + call h5open_f(error) + call h5close_f(error) + end" + amuse_h5_libs="-lhdf5_fortran" + + amuse_h5_flags_var="${amuse_h5_prefix}FLAGS" + amuse_h5_flags_source_var="amuse_h5_${amuse_h5_flags_var}" + amuse_h5_flags_target_var="amuse_h5_detect_${amuse_h5_target}" + + eval "amuse_h5_save_FLAGS=\"\$$amuse_h5_flags_var\"" + amuse_h5_save_LDFLAGS="$LDFLAGS" + amuse_h5_save_LIBS="$LIBS" + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether we can build a program with HDF5 in $amuse_h5_name" >&5 +printf %s "checking whether we can build a program with HDF5 in $amuse_h5_name... " >&6; } + + eval "$amuse_h5_flags_var=\"\$$amuse_h5_flags_source_var \$$amuse_h5_flags_var\"" + LDFLAGS="$amuse_h5_LDFLAGS $LDFLAGS" + LIBS="$amuse_h5_libs" + + cat > conftest.$ac_ext <<_ACEOF +$amuse_h5_program +_ACEOF +if ac_fn_fc_try_link "$LINENO" +then : + + eval "$amuse_h5_flags_target_var=\"yes\"" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + +else $as_nop + + eval "$amuse_h5_flags_target_var=\"no\"" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext + + LIBS="$amuse_h5_save_LIBS" + LDFLAGS="$amuse_h5_save_LDFLAGS" + eval "$amuse_h5_flags_var=\"\$amuse_h5_save_FLAGS\"" + + + + amuse_h5_name="Fortran with the high-level API in hdf5_hl_fortran with $amuse_h5_path from CFLAGS" + amuse_h5_prefix="FC" + amuse_h5_target="HL_FC" + amuse_h5_program=" program main + + use h5lt + + integer :: error + + error = h5ltfind_dataset_f(0_hid_t, 'test') + + end" + amuse_h5_libs="-lhdf5_hl_fortran" + + amuse_h5_flags_var="${amuse_h5_prefix}FLAGS" + amuse_h5_flags_source_var="amuse_h5_${amuse_h5_flags_var}" + amuse_h5_flags_target_var="amuse_h5_detect_${amuse_h5_target}" + + eval "amuse_h5_save_FLAGS=\"\$$amuse_h5_flags_var\"" + amuse_h5_save_LDFLAGS="$LDFLAGS" + amuse_h5_save_LIBS="$LIBS" + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether we can build a program with HDF5 in $amuse_h5_name" >&5 +printf %s "checking whether we can build a program with HDF5 in $amuse_h5_name... " >&6; } + + eval "$amuse_h5_flags_var=\"\$$amuse_h5_flags_source_var \$$amuse_h5_flags_var\"" + LDFLAGS="$amuse_h5_LDFLAGS $LDFLAGS" + LIBS="$amuse_h5_libs" + + cat > conftest.$ac_ext <<_ACEOF +$amuse_h5_program +_ACEOF +if ac_fn_fc_try_link "$LINENO" +then : + + eval "$amuse_h5_flags_target_var=\"yes\"" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + +else $as_nop + + eval "$amuse_h5_flags_target_var=\"no\"" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext + + LIBS="$amuse_h5_save_LIBS" + LDFLAGS="$amuse_h5_save_LDFLAGS" + eval "$amuse_h5_flags_var=\"\$amuse_h5_save_FLAGS\"" + + + if test $amuse_h5_detect_HL_FC = "yes" + then + amuse_h5_HL_FC_LIB="-lhdf5_hl_fortran" + else + + amuse_h5_name="Fortran with the high-level API in hdf5hl_fortran with $amuse_h5_path from CFLAGS" + amuse_h5_prefix="FC" + amuse_h5_target="HL_FC" + amuse_h5_program=" program main + + use h5lt + + integer :: error + + error = h5ltfind_dataset_f(0_hid_t, 'test') + + end" + amuse_h5_libs="-lhdf5hl_fortran" + + amuse_h5_flags_var="${amuse_h5_prefix}FLAGS" + amuse_h5_flags_source_var="amuse_h5_${amuse_h5_flags_var}" + amuse_h5_flags_target_var="amuse_h5_detect_${amuse_h5_target}" + + eval "amuse_h5_save_FLAGS=\"\$$amuse_h5_flags_var\"" + amuse_h5_save_LDFLAGS="$LDFLAGS" + amuse_h5_save_LIBS="$LIBS" + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether we can build a program with HDF5 in $amuse_h5_name" >&5 +printf %s "checking whether we can build a program with HDF5 in $amuse_h5_name... " >&6; } + + eval "$amuse_h5_flags_var=\"\$$amuse_h5_flags_source_var \$$amuse_h5_flags_var\"" + LDFLAGS="$amuse_h5_LDFLAGS $LDFLAGS" + LIBS="$amuse_h5_libs" + + cat > conftest.$ac_ext <<_ACEOF +$amuse_h5_program +_ACEOF +if ac_fn_fc_try_link "$LINENO" +then : + + eval "$amuse_h5_flags_target_var=\"yes\"" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + +else $as_nop + + eval "$amuse_h5_flags_target_var=\"no\"" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext + + LIBS="$amuse_h5_save_LIBS" + LDFLAGS="$amuse_h5_save_LDFLAGS" + eval "$amuse_h5_flags_var=\"\$amuse_h5_save_FLAGS\"" + + + if test $amuse_h5_detect_HL_FC = "yes" + then + amuse_h5_HL_FC_LIB="-lhdf5hl_fortran" + fi + fi + + 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 + + + if test "$amuse_h5_detect_FC" = "yes" + then + amuse_h5_FCFLAGS="-I$amuse_h5_path" + break + fi + + # The new Fortran CMake-based build system uses the non-standard and + # not-searched-unless-explicitly-specified /mod/shared subdirectory by + # default + amuse_h5_FCFLAGS="$FCFLAGS -I$amuse_h5_path/../mod/shared" + + 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 + + + amuse_h5_name="Fortran with $amuse_h5_path from CFLAGS and /mod/shared" + amuse_h5_prefix="FC" + amuse_h5_target="FC" + amuse_h5_program=" program main + + use h5lib + + integer :: error + + call h5open_f(error) + call h5close_f(error) + end" + amuse_h5_libs="-lhdf5_fortran" + + amuse_h5_flags_var="${amuse_h5_prefix}FLAGS" + amuse_h5_flags_source_var="amuse_h5_${amuse_h5_flags_var}" + amuse_h5_flags_target_var="amuse_h5_detect_${amuse_h5_target}" + + eval "amuse_h5_save_FLAGS=\"\$$amuse_h5_flags_var\"" + amuse_h5_save_LDFLAGS="$LDFLAGS" + amuse_h5_save_LIBS="$LIBS" + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether we can build a program with HDF5 in $amuse_h5_name" >&5 +printf %s "checking whether we can build a program with HDF5 in $amuse_h5_name... " >&6; } + + eval "$amuse_h5_flags_var=\"\$$amuse_h5_flags_source_var \$$amuse_h5_flags_var\"" + LDFLAGS="$amuse_h5_LDFLAGS $LDFLAGS" + LIBS="$amuse_h5_libs" + + cat > conftest.$ac_ext <<_ACEOF +$amuse_h5_program +_ACEOF +if ac_fn_fc_try_link "$LINENO" +then : + + eval "$amuse_h5_flags_target_var=\"yes\"" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + +else $as_nop + + eval "$amuse_h5_flags_target_var=\"no\"" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext + + LIBS="$amuse_h5_save_LIBS" + LDFLAGS="$amuse_h5_save_LDFLAGS" + eval "$amuse_h5_flags_var=\"\$amuse_h5_save_FLAGS\"" + + + + amuse_h5_name="Fortran with the high-level API in hdf5_hl_fortran with $amuse_h5_path from CFLAGS and /mod/shared" + amuse_h5_prefix="FC" + amuse_h5_target="HL_FC" + amuse_h5_program=" program main + + use h5lt + + integer :: error + + error = h5ltfind_dataset_f(0_hid_t, 'test') + + end" + amuse_h5_libs="-lhdf5_hl_fortran" + + amuse_h5_flags_var="${amuse_h5_prefix}FLAGS" + amuse_h5_flags_source_var="amuse_h5_${amuse_h5_flags_var}" + amuse_h5_flags_target_var="amuse_h5_detect_${amuse_h5_target}" + + eval "amuse_h5_save_FLAGS=\"\$$amuse_h5_flags_var\"" + amuse_h5_save_LDFLAGS="$LDFLAGS" + amuse_h5_save_LIBS="$LIBS" + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether we can build a program with HDF5 in $amuse_h5_name" >&5 +printf %s "checking whether we can build a program with HDF5 in $amuse_h5_name... " >&6; } + + eval "$amuse_h5_flags_var=\"\$$amuse_h5_flags_source_var \$$amuse_h5_flags_var\"" + LDFLAGS="$amuse_h5_LDFLAGS $LDFLAGS" + LIBS="$amuse_h5_libs" + + cat > conftest.$ac_ext <<_ACEOF +$amuse_h5_program +_ACEOF +if ac_fn_fc_try_link "$LINENO" +then : + + eval "$amuse_h5_flags_target_var=\"yes\"" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + +else $as_nop + + eval "$amuse_h5_flags_target_var=\"no\"" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext + + LIBS="$amuse_h5_save_LIBS" + LDFLAGS="$amuse_h5_save_LDFLAGS" + eval "$amuse_h5_flags_var=\"\$amuse_h5_save_FLAGS\"" + + + if test $amuse_h5_detect_HL_FC = "yes" + then + amuse_h5_HL_FC_LIB="-lhdf5_hl_fortran" + else + + amuse_h5_name="Fortran with the high-level API in hdf5hl_fortran with $amuse_h5_path from CFLAGS and /mod/shared" + amuse_h5_prefix="FC" + amuse_h5_target="HL_FC" + amuse_h5_program=" program main + + use h5lt + + integer :: error + + error = h5ltfind_dataset_f(0_hid_t, 'test') + + end" + amuse_h5_libs="-lhdf5hl_fortran" + + amuse_h5_flags_var="${amuse_h5_prefix}FLAGS" + amuse_h5_flags_source_var="amuse_h5_${amuse_h5_flags_var}" + amuse_h5_flags_target_var="amuse_h5_detect_${amuse_h5_target}" + + eval "amuse_h5_save_FLAGS=\"\$$amuse_h5_flags_var\"" + amuse_h5_save_LDFLAGS="$LDFLAGS" + amuse_h5_save_LIBS="$LIBS" + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether we can build a program with HDF5 in $amuse_h5_name" >&5 +printf %s "checking whether we can build a program with HDF5 in $amuse_h5_name... " >&6; } + + eval "$amuse_h5_flags_var=\"\$$amuse_h5_flags_source_var \$$amuse_h5_flags_var\"" + LDFLAGS="$amuse_h5_LDFLAGS $LDFLAGS" + LIBS="$amuse_h5_libs" + + cat > conftest.$ac_ext <<_ACEOF +$amuse_h5_program +_ACEOF +if ac_fn_fc_try_link "$LINENO" +then : + + eval "$amuse_h5_flags_target_var=\"yes\"" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + +else $as_nop + + eval "$amuse_h5_flags_target_var=\"no\"" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext + + LIBS="$amuse_h5_save_LIBS" + LDFLAGS="$amuse_h5_save_LDFLAGS" + eval "$amuse_h5_flags_var=\"\$amuse_h5_save_FLAGS\"" + + + if test $amuse_h5_detect_HL_FC = "yes" + then + amuse_h5_HL_FC_LIB="-lhdf5hl_fortran" + fi + fi + + 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 + + + if test "$amuse_h5_detect_FC" = "yes" + then + amuse_h5_FCFLAGS="-I$amuse_h5_path/../mod/shared" + break + fi + + if test "$amuse_h5_detect_FC" = "no" + then + amuse_h5_FCFLAGS="" + fi + done + IFS="$amuse_h5_save_IFS" + + fi + + if test $amuse_h5_detect_FC = "no" + then + + amuse_h5_save_IFS="$IFS" + IFS=: + for amuse_h5_path in $CPATH + do + # need to restore IFS immediately as it messes up the below + IFS="$amuse_h5_save_IFS" + if test -z "$amuse_h5_path" + then + continue + fi + + amuse_h5_FCFLAGS="$FCFLAGS -I$amuse_h5_path" + + 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 + + + amuse_h5_name="Fortran with $amuse_h5_path from CPATH" + amuse_h5_prefix="FC" + amuse_h5_target="FC" + amuse_h5_program=" program main + + use h5lib + + integer :: error + + call h5open_f(error) + call h5close_f(error) + end" + amuse_h5_libs="-lhdf5_fortran" + + amuse_h5_flags_var="${amuse_h5_prefix}FLAGS" + amuse_h5_flags_source_var="amuse_h5_${amuse_h5_flags_var}" + amuse_h5_flags_target_var="amuse_h5_detect_${amuse_h5_target}" + + eval "amuse_h5_save_FLAGS=\"\$$amuse_h5_flags_var\"" + amuse_h5_save_LDFLAGS="$LDFLAGS" + amuse_h5_save_LIBS="$LIBS" + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether we can build a program with HDF5 in $amuse_h5_name" >&5 +printf %s "checking whether we can build a program with HDF5 in $amuse_h5_name... " >&6; } + + eval "$amuse_h5_flags_var=\"\$$amuse_h5_flags_source_var \$$amuse_h5_flags_var\"" + LDFLAGS="$amuse_h5_LDFLAGS $LDFLAGS" + LIBS="$amuse_h5_libs" + + cat > conftest.$ac_ext <<_ACEOF +$amuse_h5_program +_ACEOF +if ac_fn_fc_try_link "$LINENO" +then : + + eval "$amuse_h5_flags_target_var=\"yes\"" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + +else $as_nop + + eval "$amuse_h5_flags_target_var=\"no\"" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext + + LIBS="$amuse_h5_save_LIBS" + LDFLAGS="$amuse_h5_save_LDFLAGS" + eval "$amuse_h5_flags_var=\"\$amuse_h5_save_FLAGS\"" + + + + amuse_h5_name="Fortran with the high-level API in hdf5_hl_fortran with $amuse_h5_path from CPATH" + amuse_h5_prefix="FC" + amuse_h5_target="HL_FC" + amuse_h5_program=" program main + + use h5lt + + integer :: error + + error = h5ltfind_dataset_f(0_hid_t, 'test') + + end" + amuse_h5_libs="-lhdf5_hl_fortran" + + amuse_h5_flags_var="${amuse_h5_prefix}FLAGS" + amuse_h5_flags_source_var="amuse_h5_${amuse_h5_flags_var}" + amuse_h5_flags_target_var="amuse_h5_detect_${amuse_h5_target}" + + eval "amuse_h5_save_FLAGS=\"\$$amuse_h5_flags_var\"" + amuse_h5_save_LDFLAGS="$LDFLAGS" + amuse_h5_save_LIBS="$LIBS" + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether we can build a program with HDF5 in $amuse_h5_name" >&5 +printf %s "checking whether we can build a program with HDF5 in $amuse_h5_name... " >&6; } + + eval "$amuse_h5_flags_var=\"\$$amuse_h5_flags_source_var \$$amuse_h5_flags_var\"" + LDFLAGS="$amuse_h5_LDFLAGS $LDFLAGS" + LIBS="$amuse_h5_libs" + + cat > conftest.$ac_ext <<_ACEOF +$amuse_h5_program +_ACEOF +if ac_fn_fc_try_link "$LINENO" +then : + + eval "$amuse_h5_flags_target_var=\"yes\"" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + +else $as_nop + + eval "$amuse_h5_flags_target_var=\"no\"" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext + + LIBS="$amuse_h5_save_LIBS" + LDFLAGS="$amuse_h5_save_LDFLAGS" + eval "$amuse_h5_flags_var=\"\$amuse_h5_save_FLAGS\"" + + + if test $amuse_h5_detect_HL_FC = "yes" + then + amuse_h5_HL_FC_LIB="-lhdf5_hl_fortran" + else + + amuse_h5_name="Fortran with the high-level API in hdf5hl_fortran with $amuse_h5_path from CPATH" + amuse_h5_prefix="FC" + amuse_h5_target="HL_FC" + amuse_h5_program=" program main + + use h5lt + + integer :: error + + error = h5ltfind_dataset_f(0_hid_t, 'test') + + end" + amuse_h5_libs="-lhdf5hl_fortran" + + amuse_h5_flags_var="${amuse_h5_prefix}FLAGS" + amuse_h5_flags_source_var="amuse_h5_${amuse_h5_flags_var}" + amuse_h5_flags_target_var="amuse_h5_detect_${amuse_h5_target}" + + eval "amuse_h5_save_FLAGS=\"\$$amuse_h5_flags_var\"" + amuse_h5_save_LDFLAGS="$LDFLAGS" + amuse_h5_save_LIBS="$LIBS" + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether we can build a program with HDF5 in $amuse_h5_name" >&5 +printf %s "checking whether we can build a program with HDF5 in $amuse_h5_name... " >&6; } + + eval "$amuse_h5_flags_var=\"\$$amuse_h5_flags_source_var \$$amuse_h5_flags_var\"" + LDFLAGS="$amuse_h5_LDFLAGS $LDFLAGS" + LIBS="$amuse_h5_libs" + + cat > conftest.$ac_ext <<_ACEOF +$amuse_h5_program +_ACEOF +if ac_fn_fc_try_link "$LINENO" +then : + + eval "$amuse_h5_flags_target_var=\"yes\"" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + +else $as_nop + + eval "$amuse_h5_flags_target_var=\"no\"" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext + + LIBS="$amuse_h5_save_LIBS" + LDFLAGS="$amuse_h5_save_LDFLAGS" + eval "$amuse_h5_flags_var=\"\$amuse_h5_save_FLAGS\"" + + + if test $amuse_h5_detect_HL_FC = "yes" + then + amuse_h5_HL_FC_LIB="-lhdf5hl_fortran" + fi + fi + + 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 + + + if test "$amuse_h5_detect_FC" = "yes" + then + amuse_h5_FCFLAGS="-I$amuse_h5_path" + break + fi + + # The new Fortran CMake-based build system uses the non-standard and + # not-searched-unless-explicitly-specified /mod/shared subdirectory by + # default + amuse_h5_FCFLAGS="$FCFLAGS -I$amuse_h5_path/../mod/shared" + + 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 + + + amuse_h5_name="Fortran with $amuse_h5_path from CPATH and /mod/shared" + amuse_h5_prefix="FC" + amuse_h5_target="FC" + amuse_h5_program=" program main + + use h5lib + + integer :: error + + call h5open_f(error) + call h5close_f(error) + end" + amuse_h5_libs="-lhdf5_fortran" + + amuse_h5_flags_var="${amuse_h5_prefix}FLAGS" + amuse_h5_flags_source_var="amuse_h5_${amuse_h5_flags_var}" + amuse_h5_flags_target_var="amuse_h5_detect_${amuse_h5_target}" + + eval "amuse_h5_save_FLAGS=\"\$$amuse_h5_flags_var\"" + amuse_h5_save_LDFLAGS="$LDFLAGS" + amuse_h5_save_LIBS="$LIBS" + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether we can build a program with HDF5 in $amuse_h5_name" >&5 +printf %s "checking whether we can build a program with HDF5 in $amuse_h5_name... " >&6; } + + eval "$amuse_h5_flags_var=\"\$$amuse_h5_flags_source_var \$$amuse_h5_flags_var\"" + LDFLAGS="$amuse_h5_LDFLAGS $LDFLAGS" + LIBS="$amuse_h5_libs" + + cat > conftest.$ac_ext <<_ACEOF +$amuse_h5_program +_ACEOF +if ac_fn_fc_try_link "$LINENO" +then : + + eval "$amuse_h5_flags_target_var=\"yes\"" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + +else $as_nop + + eval "$amuse_h5_flags_target_var=\"no\"" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext + + LIBS="$amuse_h5_save_LIBS" + LDFLAGS="$amuse_h5_save_LDFLAGS" + eval "$amuse_h5_flags_var=\"\$amuse_h5_save_FLAGS\"" + + + + amuse_h5_name="Fortran with the high-level API in hdf5_hl_fortran with $amuse_h5_path from CPATH and /mod/shared" + amuse_h5_prefix="FC" + amuse_h5_target="HL_FC" + amuse_h5_program=" program main + + use h5lt + + integer :: error + + error = h5ltfind_dataset_f(0_hid_t, 'test') + + end" + amuse_h5_libs="-lhdf5_hl_fortran" + + amuse_h5_flags_var="${amuse_h5_prefix}FLAGS" + amuse_h5_flags_source_var="amuse_h5_${amuse_h5_flags_var}" + amuse_h5_flags_target_var="amuse_h5_detect_${amuse_h5_target}" + + eval "amuse_h5_save_FLAGS=\"\$$amuse_h5_flags_var\"" + amuse_h5_save_LDFLAGS="$LDFLAGS" + amuse_h5_save_LIBS="$LIBS" + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether we can build a program with HDF5 in $amuse_h5_name" >&5 +printf %s "checking whether we can build a program with HDF5 in $amuse_h5_name... " >&6; } + + eval "$amuse_h5_flags_var=\"\$$amuse_h5_flags_source_var \$$amuse_h5_flags_var\"" + LDFLAGS="$amuse_h5_LDFLAGS $LDFLAGS" + LIBS="$amuse_h5_libs" + + cat > conftest.$ac_ext <<_ACEOF +$amuse_h5_program +_ACEOF +if ac_fn_fc_try_link "$LINENO" +then : + + eval "$amuse_h5_flags_target_var=\"yes\"" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + +else $as_nop + + eval "$amuse_h5_flags_target_var=\"no\"" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext + + LIBS="$amuse_h5_save_LIBS" + LDFLAGS="$amuse_h5_save_LDFLAGS" + eval "$amuse_h5_flags_var=\"\$amuse_h5_save_FLAGS\"" + + + if test $amuse_h5_detect_HL_FC = "yes" + then + amuse_h5_HL_FC_LIB="-lhdf5_hl_fortran" + else + + amuse_h5_name="Fortran with the high-level API in hdf5hl_fortran with $amuse_h5_path from CPATH and /mod/shared" + amuse_h5_prefix="FC" + amuse_h5_target="HL_FC" + amuse_h5_program=" program main + + use h5lt + + integer :: error + + error = h5ltfind_dataset_f(0_hid_t, 'test') + + end" + amuse_h5_libs="-lhdf5hl_fortran" + + amuse_h5_flags_var="${amuse_h5_prefix}FLAGS" + amuse_h5_flags_source_var="amuse_h5_${amuse_h5_flags_var}" + amuse_h5_flags_target_var="amuse_h5_detect_${amuse_h5_target}" + + eval "amuse_h5_save_FLAGS=\"\$$amuse_h5_flags_var\"" + amuse_h5_save_LDFLAGS="$LDFLAGS" + amuse_h5_save_LIBS="$LIBS" + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether we can build a program with HDF5 in $amuse_h5_name" >&5 +printf %s "checking whether we can build a program with HDF5 in $amuse_h5_name... " >&6; } + + eval "$amuse_h5_flags_var=\"\$$amuse_h5_flags_source_var \$$amuse_h5_flags_var\"" + LDFLAGS="$amuse_h5_LDFLAGS $LDFLAGS" + LIBS="$amuse_h5_libs" + + cat > conftest.$ac_ext <<_ACEOF +$amuse_h5_program +_ACEOF +if ac_fn_fc_try_link "$LINENO" +then : + + eval "$amuse_h5_flags_target_var=\"yes\"" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + +else $as_nop + + eval "$amuse_h5_flags_target_var=\"no\"" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext + + LIBS="$amuse_h5_save_LIBS" + LDFLAGS="$amuse_h5_save_LDFLAGS" + eval "$amuse_h5_flags_var=\"\$amuse_h5_save_FLAGS\"" + + + if test $amuse_h5_detect_HL_FC = "yes" + then + amuse_h5_HL_FC_LIB="-lhdf5hl_fortran" + fi + fi + + 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 + + + if test "$amuse_h5_detect_FC" = "yes" + then + amuse_h5_FCFLAGS="-I$amuse_h5_path/../mod/shared" + break + fi + + if test "$amuse_h5_detect_FC" = "no" + then + amuse_h5_FCFLAGS="" + fi + done + IFS="$amuse_h5_save_IFS" + + fi + + if test $amuse_h5_detect_FC = "no" + then + + amuse_h5_save_IFS="$IFS" + IFS=: + for amuse_h5_path in $C_INCLUDE_PATH + do + # need to restore IFS immediately as it messes up the below + IFS="$amuse_h5_save_IFS" + if test -z "$amuse_h5_path" + then + continue + fi + + amuse_h5_FCFLAGS="$FCFLAGS -I$amuse_h5_path" + + 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 + + + amuse_h5_name="Fortran with $amuse_h5_path from C_INCLUDE_PATH" + amuse_h5_prefix="FC" + amuse_h5_target="FC" + amuse_h5_program=" program main + + use h5lib + + integer :: error + + call h5open_f(error) + call h5close_f(error) + end" + amuse_h5_libs="-lhdf5_fortran" + + amuse_h5_flags_var="${amuse_h5_prefix}FLAGS" + amuse_h5_flags_source_var="amuse_h5_${amuse_h5_flags_var}" + amuse_h5_flags_target_var="amuse_h5_detect_${amuse_h5_target}" + + eval "amuse_h5_save_FLAGS=\"\$$amuse_h5_flags_var\"" + amuse_h5_save_LDFLAGS="$LDFLAGS" + amuse_h5_save_LIBS="$LIBS" + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether we can build a program with HDF5 in $amuse_h5_name" >&5 +printf %s "checking whether we can build a program with HDF5 in $amuse_h5_name... " >&6; } + + eval "$amuse_h5_flags_var=\"\$$amuse_h5_flags_source_var \$$amuse_h5_flags_var\"" + LDFLAGS="$amuse_h5_LDFLAGS $LDFLAGS" + LIBS="$amuse_h5_libs" + + cat > conftest.$ac_ext <<_ACEOF +$amuse_h5_program +_ACEOF +if ac_fn_fc_try_link "$LINENO" +then : + + eval "$amuse_h5_flags_target_var=\"yes\"" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + +else $as_nop + + eval "$amuse_h5_flags_target_var=\"no\"" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext + + LIBS="$amuse_h5_save_LIBS" + LDFLAGS="$amuse_h5_save_LDFLAGS" + eval "$amuse_h5_flags_var=\"\$amuse_h5_save_FLAGS\"" + + + + amuse_h5_name="Fortran with the high-level API in hdf5_hl_fortran with $amuse_h5_path from C_INCLUDE_PATH" + amuse_h5_prefix="FC" + amuse_h5_target="HL_FC" + amuse_h5_program=" program main + + use h5lt + + integer :: error + + error = h5ltfind_dataset_f(0_hid_t, 'test') + + end" + amuse_h5_libs="-lhdf5_hl_fortran" + + amuse_h5_flags_var="${amuse_h5_prefix}FLAGS" + amuse_h5_flags_source_var="amuse_h5_${amuse_h5_flags_var}" + amuse_h5_flags_target_var="amuse_h5_detect_${amuse_h5_target}" + + eval "amuse_h5_save_FLAGS=\"\$$amuse_h5_flags_var\"" + amuse_h5_save_LDFLAGS="$LDFLAGS" + amuse_h5_save_LIBS="$LIBS" + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether we can build a program with HDF5 in $amuse_h5_name" >&5 +printf %s "checking whether we can build a program with HDF5 in $amuse_h5_name... " >&6; } + + eval "$amuse_h5_flags_var=\"\$$amuse_h5_flags_source_var \$$amuse_h5_flags_var\"" + LDFLAGS="$amuse_h5_LDFLAGS $LDFLAGS" + LIBS="$amuse_h5_libs" + + cat > conftest.$ac_ext <<_ACEOF +$amuse_h5_program +_ACEOF +if ac_fn_fc_try_link "$LINENO" +then : + + eval "$amuse_h5_flags_target_var=\"yes\"" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + +else $as_nop + + eval "$amuse_h5_flags_target_var=\"no\"" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext + + LIBS="$amuse_h5_save_LIBS" + LDFLAGS="$amuse_h5_save_LDFLAGS" + eval "$amuse_h5_flags_var=\"\$amuse_h5_save_FLAGS\"" + + + if test $amuse_h5_detect_HL_FC = "yes" + then + amuse_h5_HL_FC_LIB="-lhdf5_hl_fortran" + else + + amuse_h5_name="Fortran with the high-level API in hdf5hl_fortran with $amuse_h5_path from C_INCLUDE_PATH" + amuse_h5_prefix="FC" + amuse_h5_target="HL_FC" + amuse_h5_program=" program main + + use h5lt + + integer :: error + + error = h5ltfind_dataset_f(0_hid_t, 'test') + + end" + amuse_h5_libs="-lhdf5hl_fortran" + + amuse_h5_flags_var="${amuse_h5_prefix}FLAGS" + amuse_h5_flags_source_var="amuse_h5_${amuse_h5_flags_var}" + amuse_h5_flags_target_var="amuse_h5_detect_${amuse_h5_target}" + + eval "amuse_h5_save_FLAGS=\"\$$amuse_h5_flags_var\"" + amuse_h5_save_LDFLAGS="$LDFLAGS" + amuse_h5_save_LIBS="$LIBS" + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether we can build a program with HDF5 in $amuse_h5_name" >&5 +printf %s "checking whether we can build a program with HDF5 in $amuse_h5_name... " >&6; } + + eval "$amuse_h5_flags_var=\"\$$amuse_h5_flags_source_var \$$amuse_h5_flags_var\"" + LDFLAGS="$amuse_h5_LDFLAGS $LDFLAGS" + LIBS="$amuse_h5_libs" + + cat > conftest.$ac_ext <<_ACEOF +$amuse_h5_program +_ACEOF +if ac_fn_fc_try_link "$LINENO" +then : + + eval "$amuse_h5_flags_target_var=\"yes\"" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + +else $as_nop + + eval "$amuse_h5_flags_target_var=\"no\"" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext + + LIBS="$amuse_h5_save_LIBS" + LDFLAGS="$amuse_h5_save_LDFLAGS" + eval "$amuse_h5_flags_var=\"\$amuse_h5_save_FLAGS\"" + + + if test $amuse_h5_detect_HL_FC = "yes" + then + amuse_h5_HL_FC_LIB="-lhdf5hl_fortran" + fi + fi + + 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 + + + if test "$amuse_h5_detect_FC" = "yes" + then + amuse_h5_FCFLAGS="-I$amuse_h5_path" + break + fi + + # The new Fortran CMake-based build system uses the non-standard and + # not-searched-unless-explicitly-specified /mod/shared subdirectory by + # default + amuse_h5_FCFLAGS="$FCFLAGS -I$amuse_h5_path/../mod/shared" + + 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 + + + amuse_h5_name="Fortran with $amuse_h5_path from C_INCLUDE_PATH and /mod/shared" + amuse_h5_prefix="FC" + amuse_h5_target="FC" + amuse_h5_program=" program main + + use h5lib + + integer :: error + + call h5open_f(error) + call h5close_f(error) + end" + amuse_h5_libs="-lhdf5_fortran" + + amuse_h5_flags_var="${amuse_h5_prefix}FLAGS" + amuse_h5_flags_source_var="amuse_h5_${amuse_h5_flags_var}" + amuse_h5_flags_target_var="amuse_h5_detect_${amuse_h5_target}" + + eval "amuse_h5_save_FLAGS=\"\$$amuse_h5_flags_var\"" + amuse_h5_save_LDFLAGS="$LDFLAGS" + amuse_h5_save_LIBS="$LIBS" + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether we can build a program with HDF5 in $amuse_h5_name" >&5 +printf %s "checking whether we can build a program with HDF5 in $amuse_h5_name... " >&6; } + + eval "$amuse_h5_flags_var=\"\$$amuse_h5_flags_source_var \$$amuse_h5_flags_var\"" + LDFLAGS="$amuse_h5_LDFLAGS $LDFLAGS" + LIBS="$amuse_h5_libs" + + cat > conftest.$ac_ext <<_ACEOF +$amuse_h5_program +_ACEOF +if ac_fn_fc_try_link "$LINENO" +then : + + eval "$amuse_h5_flags_target_var=\"yes\"" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + +else $as_nop + + eval "$amuse_h5_flags_target_var=\"no\"" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext + + LIBS="$amuse_h5_save_LIBS" + LDFLAGS="$amuse_h5_save_LDFLAGS" + eval "$amuse_h5_flags_var=\"\$amuse_h5_save_FLAGS\"" + + + + amuse_h5_name="Fortran with the high-level API in hdf5_hl_fortran with $amuse_h5_path from C_INCLUDE_PATH and /mod/shared" + amuse_h5_prefix="FC" + amuse_h5_target="HL_FC" + amuse_h5_program=" program main + + use h5lt + + integer :: error + + error = h5ltfind_dataset_f(0_hid_t, 'test') + + end" + amuse_h5_libs="-lhdf5_hl_fortran" + + amuse_h5_flags_var="${amuse_h5_prefix}FLAGS" + amuse_h5_flags_source_var="amuse_h5_${amuse_h5_flags_var}" + amuse_h5_flags_target_var="amuse_h5_detect_${amuse_h5_target}" + + eval "amuse_h5_save_FLAGS=\"\$$amuse_h5_flags_var\"" + amuse_h5_save_LDFLAGS="$LDFLAGS" + amuse_h5_save_LIBS="$LIBS" + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether we can build a program with HDF5 in $amuse_h5_name" >&5 +printf %s "checking whether we can build a program with HDF5 in $amuse_h5_name... " >&6; } + + eval "$amuse_h5_flags_var=\"\$$amuse_h5_flags_source_var \$$amuse_h5_flags_var\"" + LDFLAGS="$amuse_h5_LDFLAGS $LDFLAGS" + LIBS="$amuse_h5_libs" + + cat > conftest.$ac_ext <<_ACEOF +$amuse_h5_program +_ACEOF +if ac_fn_fc_try_link "$LINENO" +then : + + eval "$amuse_h5_flags_target_var=\"yes\"" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + +else $as_nop + + eval "$amuse_h5_flags_target_var=\"no\"" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext + + LIBS="$amuse_h5_save_LIBS" + LDFLAGS="$amuse_h5_save_LDFLAGS" + eval "$amuse_h5_flags_var=\"\$amuse_h5_save_FLAGS\"" + + + if test $amuse_h5_detect_HL_FC = "yes" + then + amuse_h5_HL_FC_LIB="-lhdf5_hl_fortran" + else + + amuse_h5_name="Fortran with the high-level API in hdf5hl_fortran with $amuse_h5_path from C_INCLUDE_PATH and /mod/shared" + amuse_h5_prefix="FC" + amuse_h5_target="HL_FC" + amuse_h5_program=" program main + + use h5lt + + integer :: error + + error = h5ltfind_dataset_f(0_hid_t, 'test') + + end" + amuse_h5_libs="-lhdf5hl_fortran" + + amuse_h5_flags_var="${amuse_h5_prefix}FLAGS" + amuse_h5_flags_source_var="amuse_h5_${amuse_h5_flags_var}" + amuse_h5_flags_target_var="amuse_h5_detect_${amuse_h5_target}" + + eval "amuse_h5_save_FLAGS=\"\$$amuse_h5_flags_var\"" + amuse_h5_save_LDFLAGS="$LDFLAGS" + amuse_h5_save_LIBS="$LIBS" + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether we can build a program with HDF5 in $amuse_h5_name" >&5 +printf %s "checking whether we can build a program with HDF5 in $amuse_h5_name... " >&6; } + + eval "$amuse_h5_flags_var=\"\$$amuse_h5_flags_source_var \$$amuse_h5_flags_var\"" + LDFLAGS="$amuse_h5_LDFLAGS $LDFLAGS" + LIBS="$amuse_h5_libs" + + cat > conftest.$ac_ext <<_ACEOF +$amuse_h5_program +_ACEOF +if ac_fn_fc_try_link "$LINENO" +then : + + eval "$amuse_h5_flags_target_var=\"yes\"" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + +else $as_nop + + eval "$amuse_h5_flags_target_var=\"no\"" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext + + LIBS="$amuse_h5_save_LIBS" + LDFLAGS="$amuse_h5_save_LDFLAGS" + eval "$amuse_h5_flags_var=\"\$amuse_h5_save_FLAGS\"" + + + if test $amuse_h5_detect_HL_FC = "yes" + then + amuse_h5_HL_FC_LIB="-lhdf5hl_fortran" + fi + fi + + 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 + + + if test "$amuse_h5_detect_FC" = "yes" + then + amuse_h5_FCFLAGS="-I$amuse_h5_path/../mod/shared" + break + fi + + if test "$amuse_h5_detect_FC" = "no" + then + amuse_h5_FCFLAGS="" + fi + done + IFS="$amuse_h5_save_IFS" + + fi + fi + + fi + + if test "$amuse_h5_detect_C" = "no" + then + + # Extract the first word of "h5cc", so it can be a program name with args. +set dummy h5cc; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_path_H5CC+y} +then : + printf %s "(cached) " >&6 +else $as_nop case $H5CC in [\\/]* | ?:[\\/]*) - ac_cv_path_H5CC="$H5CC" # Let the user override the test with a path. + ac_cv_path_H5CC="$H5CC" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_path_H5CC="$as_dir$ac_word$ac_exec_ext" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + ;; +esac +fi +H5CC=$ac_cv_path_H5CC +if test -n "$H5CC"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $H5CC" >&5 +printf "%s\n" "$H5CC" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + + if test -n "$H5CC" + then + amuse_h5_h5cc_flags=$(HDF5_USE_SHLIB=yes $H5CC -show) + amuse_h5_h5cc_extra_flags=$(HDF5_USE_SHLIB=yes $H5CC -show -c) + + amuse_h5_include_flags="" + amuse_h5_link_flags="" + + for amuse_h5_flag in $amuse_h5_h5cc_flags $amuse_h5_h5cc_extra_flags + do + if test "${amuse_h5_flag#-I}" != "$amuse_h5_flag" + then + if ! echo "$amuse_h5_include_flags" | grep -e "$amuse_h5_flag" >/dev/null 2>&1 + then + amuse_h5_include_flags="$amuse_h5_include_flags $amuse_h5_flag" + fi + elif test "${amuse_h5_flag#-L}" != "$amuse_h5_flag" + then + if ! echo "$amuse_h5_result" | grep -e "$amuse_h5_flag" >/dev/null 2>&1 + then + amuse_h5_link_flags="$amuse_h5_link_flags $amuse_h5_flag" + fi + fi + done + + + 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 + + amuse_h5_CFLAGS="$amuse_h5_include_flags" + amuse_h5_LDFLAGS="$amuse_h5_link_flags" + + amuse_h5_name="C with flags from h5cc" + amuse_h5_prefix="C" + amuse_h5_target="C" + amuse_h5_program="#include +int +main (void) +{ +H5open(); H5close(); + ; + return 0; +}" + amuse_h5_libs="-lhdf5" + + amuse_h5_flags_var="${amuse_h5_prefix}FLAGS" + amuse_h5_flags_source_var="amuse_h5_${amuse_h5_flags_var}" + amuse_h5_flags_target_var="amuse_h5_detect_${amuse_h5_target}" + + eval "amuse_h5_save_FLAGS=\"\$$amuse_h5_flags_var\"" + amuse_h5_save_LDFLAGS="$LDFLAGS" + amuse_h5_save_LIBS="$LIBS" + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether we can build a program with HDF5 in $amuse_h5_name" >&5 +printf %s "checking whether we can build a program with HDF5 in $amuse_h5_name... " >&6; } + + eval "$amuse_h5_flags_var=\"\$$amuse_h5_flags_source_var \$$amuse_h5_flags_var\"" + LDFLAGS="$amuse_h5_LDFLAGS $LDFLAGS" + LIBS="$amuse_h5_libs" + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$amuse_h5_program +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + + eval "$amuse_h5_flags_target_var=\"yes\"" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + +else $as_nop + + eval "$amuse_h5_flags_target_var=\"no\"" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext + + LIBS="$amuse_h5_save_LIBS" + LDFLAGS="$amuse_h5_save_LDFLAGS" + eval "$amuse_h5_flags_var=\"\$amuse_h5_save_FLAGS\"" + + + amuse_h5_name="C with flags from h5cc and the high-level API" + amuse_h5_prefix="C" + amuse_h5_target="HL_C" + amuse_h5_program="#include +int +main (void) +{ +H5LTfind_dataset(0, \"test\") + ; + return 0; +}" + amuse_h5_libs="-lhdf5_hl" + + amuse_h5_flags_var="${amuse_h5_prefix}FLAGS" + amuse_h5_flags_source_var="amuse_h5_${amuse_h5_flags_var}" + amuse_h5_flags_target_var="amuse_h5_detect_${amuse_h5_target}" + + eval "amuse_h5_save_FLAGS=\"\$$amuse_h5_flags_var\"" + amuse_h5_save_LDFLAGS="$LDFLAGS" + amuse_h5_save_LIBS="$LIBS" + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether we can build a program with HDF5 in $amuse_h5_name" >&5 +printf %s "checking whether we can build a program with HDF5 in $amuse_h5_name... " >&6; } + + eval "$amuse_h5_flags_var=\"\$$amuse_h5_flags_source_var \$$amuse_h5_flags_var\"" + LDFLAGS="$amuse_h5_LDFLAGS $LDFLAGS" + LIBS="$amuse_h5_libs" + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$amuse_h5_program +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + + eval "$amuse_h5_flags_target_var=\"yes\"" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + +else $as_nop + + eval "$amuse_h5_flags_target_var=\"no\"" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext + + LIBS="$amuse_h5_save_LIBS" + LDFLAGS="$amuse_h5_save_LDFLAGS" + eval "$amuse_h5_flags_var=\"\$amuse_h5_save_FLAGS\"" + + 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 + + # Extract the first word of "h5c++", so it can be a program name with args. +set dummy h5c++; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_path_H5CXX+y} +then : + printf %s "(cached) " >&6 +else $as_nop + case $H5CXX in + [\\/]* | ?:[\\/]*) + ac_cv_path_H5CXX="$H5CXX" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_path_H5CXX="$as_dir$ac_word$ac_exec_ext" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + ;; +esac +fi +H5CXX=$ac_cv_path_H5CXX +if test -n "$H5CXX"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $H5CXX" >&5 +printf "%s\n" "$H5CXX" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + + if test -n "$H5CXX" + then + amuse_h5_h5cxx_flags=$(HDF5_USE_SHLIB=yes $H5CXX -show) + echo "broken" >conftest.cpp + amuse_h5_h5cxx_extra_flags=$(HDF5_USE_SHLIB=yes $H5CXX -show -c conftest.cpp) + rm conftest.cpp + + amuse_h5_include_flags="" + amuse_h5_link_flags="" + + for amuse_h5_flag in $amuse_h5_h5cxx_flags $amuse_h5_h5cxx_extra_flags + do + if test "${amuse_h5_flag#-I}" != "$amuse_h5_flag" + then + if ! echo "$amuse_h5_include_flags" | grep -e "$amuse_h5_flag" >/dev/null 2>&1 + then + amuse_h5_include_flags="$amuse_h5_include_flags $amuse_h5_flag" + fi + elif test "${amuse_h5_flag#-L}" != "$amuse_h5_flag" + then + if ! echo "$amuse_h5_result" | grep -e "$amuse_h5_flag" >/dev/null 2>&1 + then + amuse_h5_link_flags="$amuse_h5_link_flags $amuse_h5_flag" + fi + fi + done + + + ac_ext=cpp +ac_cpp='$CXXCPP $CPPFLAGS' +ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_cxx_compiler_gnu + + amuse_h5_CXXFLAGS="$amuse_h5_include_flags" + amuse_h5_LDFLAGS="$amuse_h5_link_flags" + + amuse_h5_name="C++ with flags from h5c++" + amuse_h5_prefix="CXX" + amuse_h5_target="CXX" + amuse_h5_program="#include +int +main (void) +{ +H5::H5Library::open(); + ; + return 0; +}" + amuse_h5_libs="-lhdf5_cpp" + + amuse_h5_flags_var="${amuse_h5_prefix}FLAGS" + amuse_h5_flags_source_var="amuse_h5_${amuse_h5_flags_var}" + amuse_h5_flags_target_var="amuse_h5_detect_${amuse_h5_target}" + + eval "amuse_h5_save_FLAGS=\"\$$amuse_h5_flags_var\"" + amuse_h5_save_LDFLAGS="$LDFLAGS" + amuse_h5_save_LIBS="$LIBS" + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether we can build a program with HDF5 in $amuse_h5_name" >&5 +printf %s "checking whether we can build a program with HDF5 in $amuse_h5_name... " >&6; } + + eval "$amuse_h5_flags_var=\"\$$amuse_h5_flags_source_var \$$amuse_h5_flags_var\"" + LDFLAGS="$amuse_h5_LDFLAGS $LDFLAGS" + LIBS="$amuse_h5_libs" + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$amuse_h5_program +_ACEOF +if ac_fn_cxx_try_link "$LINENO" +then : + + eval "$amuse_h5_flags_target_var=\"yes\"" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + +else $as_nop + + eval "$amuse_h5_flags_target_var=\"no\"" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext + + LIBS="$amuse_h5_save_LIBS" + LDFLAGS="$amuse_h5_save_LDFLAGS" + eval "$amuse_h5_flags_var=\"\$amuse_h5_save_FLAGS\"" + + 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 + + # Extract the first word of "h5fc", so it can be a program name with args. +set dummy h5fc; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_path_H5FC+y} +then : + printf %s "(cached) " >&6 +else $as_nop + case $H5FC in + [\\/]* | ?:[\\/]*) + ac_cv_path_H5FC="$H5FC" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR @@ -6414,7 +9618,7 @@ do esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then - ac_cv_path_H5CC="$as_dir$ac_word$ac_exec_ext" + ac_cv_path_H5FC="$as_dir$ac_word$ac_exec_ext" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi @@ -6425,276 +9629,465 @@ IFS=$as_save_IFS ;; esac fi -H5CC=$ac_cv_path_H5CC -if test -n "$H5CC"; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $H5CC" >&5 -printf "%s\n" "$H5CC" >&6; } +H5FC=$ac_cv_path_H5FC +if test -n "$H5FC"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $H5FC" >&5 +printf "%s\n" "$H5FC" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi - test -n "$H5CC" && break -done + if test -n "$H5FC" + then + amuse_h5_h5fc_flags=$(HDF5_USE_SHLIB=yes h5fc -show) + amuse_h5_h5fc_extra_flags=$(HDF5_USE_SHLIB=yes $H5CC -show -c) - else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking Using provided HDF5 C wrapper" >&5 -printf %s "checking Using provided HDF5 C wrapper... " >&6; } - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $H5CC" >&5 -printf "%s\n" "$H5CC" >&6; } - fi - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for HDF5 type" >&5 -printf %s "checking for HDF5 type... " >&6; } - case $H5CC in #( - *h5pcc) : - HDF5_TYPE=parallel ;; #( - *h5cc) : - HDF5_TYPE=serial ;; #( - *) : - HDF5_TYPE=neither ;; -esac - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $HDF5_TYPE" >&5 -printf "%s\n" "$HDF5_TYPE" >&6; } - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for HDF5 libraries" >&5 -printf %s "checking for HDF5 libraries... " >&6; } - if test ! -f "$H5CC" || test ! -x "$H5CC"; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: -Unable to locate HDF5 compilation helper scripts 'h5cc' or 'h5pcc'. -Please specify --with-hdf5= as the full path to h5cc or h5pcc. -HDF5 support is being disabled (equivalent to --with-hdf5=no). -" >&5 -printf "%s\n" "$as_me: WARNING: -Unable to locate HDF5 compilation helper scripts 'h5cc' or 'h5pcc'. -Please specify --with-hdf5= as the full path to h5cc or h5pcc. -HDF5 support is being disabled (equivalent to --with-hdf5=no). -" >&2;} - with_hdf5="no" - with_hdf5_fortran="no" - else - HDF5_SHOW=$(eval $H5CC -show) + amuse_h5_include_flags="" + amuse_h5_link_flags="" - HDF5_CC=$(eval $H5CC -show | head -n 1 | $AWK '{print $1}') - if test "$HDF5_CC" = "ccache"; then - HDF5_CC=$(eval $H5CC -show | head -n 1 | $AWK '{print $2}') + for amuse_h5_flag in $amuse_h5_h5fc_flags $amuse_h5_h5fc_extra_flags + do + if test "${amuse_h5_flag#-I}" != "$amuse_h5_flag" + then + if ! echo "$amuse_h5_include_flags" | grep -e "$amuse_h5_flag" >/dev/null 2>&1 + then + amuse_h5_include_flags="$amuse_h5_include_flags $amuse_h5_flag" + fi + elif test "${amuse_h5_flag#-L}" != "$amuse_h5_flag" + then + if ! echo "$amuse_h5_result" | grep -e "$amuse_h5_flag" >/dev/null 2>&1 + then + amuse_h5_link_flags="$amuse_h5_link_flags $amuse_h5_flag" + fi fi + done - HDF5_VERSION=$(eval $H5CC -showconfig | $GREP 'HDF5 Version:' \ - | $AWK '{print $3}') + amuse_h5_FCFLAGS="$amuse_h5_include_flags" + amuse_h5_LDFLAGS="$amuse_h5_link_flags" - HDF5_tmp_flags=$(eval $H5CC -showconfig \ - | $GREP 'FLAGS\|Extra libraries:' \ - | $AWK -F: '{printf("%s "), $2}' ) + 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 - HDF5_tmp_inst=$(eval $H5CC -showconfig \ - | $GREP 'Installation point:' \ - | $AWK '{print $NF}' ) - HDF5_CPPFLAGS="-I${HDF5_tmp_inst}/include" + amuse_h5_name="Fortran with flags from h5fc" + amuse_h5_prefix="FC" + amuse_h5_target="FC" + amuse_h5_program=" program main - for arg in $HDF5_SHOW $HDF5_tmp_flags ; do - case "$arg" in - -I*) echo $HDF5_CPPFLAGS | $GREP -e "$arg" 2>&1 >/dev/null \ - || HDF5_CPPFLAGS="$HDF5_CPPFLAGS $arg" - ;; - -L*) echo $HDF5_LDFLAGS | $GREP -e "$arg" 2>&1 >/dev/null \ - || HDF5_LDFLAGS="$HDF5_LDFLAGS $arg" - ;; - -l*) echo $HDF5_LIBS | $GREP -e "$arg" 2>&1 >/dev/null \ - || HDF5_LIBS="$HDF5_LIBS $arg" - ;; - esac - done + use h5lib - HDF5_LIBS="-lhdf5 $HDF5_LIBS" - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes (version $HDF5_VERSION)" >&5 -printf "%s\n" "yes (version $HDF5_VERSION)" >&6; } + integer :: error - 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 + call h5open_f(error) + call h5close_f(error) + end" + amuse_h5_libs="-lhdf5_fortran" + + amuse_h5_flags_var="${amuse_h5_prefix}FLAGS" + amuse_h5_flags_source_var="amuse_h5_${amuse_h5_flags_var}" + amuse_h5_flags_target_var="amuse_h5_detect_${amuse_h5_target}" - ax_lib_hdf5_save_CC=$CC - ax_lib_hdf5_save_CPPFLAGS=$CPPFLAGS - ax_lib_hdf5_save_LIBS=$LIBS - ax_lib_hdf5_save_LDFLAGS=$LDFLAGS - CC=$HDF5_CC - CPPFLAGS=$HDF5_CPPFLAGS - LIBS=$HDF5_LIBS - LDFLAGS=$HDF5_LDFLAGS - ac_fn_c_check_header_compile "$LINENO" "hdf5.h" "ac_cv_header_hdf5_h" "$ac_includes_default" -if test "x$ac_cv_header_hdf5_h" = xyes + eval "amuse_h5_save_FLAGS=\"\$$amuse_h5_flags_var\"" + amuse_h5_save_LDFLAGS="$LDFLAGS" + amuse_h5_save_LIBS="$LIBS" + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether we can build a program with HDF5 in $amuse_h5_name" >&5 +printf %s "checking whether we can build a program with HDF5 in $amuse_h5_name... " >&6; } + + eval "$amuse_h5_flags_var=\"\$$amuse_h5_flags_source_var \$$amuse_h5_flags_var\"" + LDFLAGS="$amuse_h5_LDFLAGS $LDFLAGS" + LIBS="$amuse_h5_libs" + + cat > conftest.$ac_ext <<_ACEOF +$amuse_h5_program +_ACEOF +if ac_fn_fc_try_link "$LINENO" then : - ac_cv_hadf5_h=yes + + eval "$amuse_h5_flags_target_var=\"yes\"" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + else $as_nop - ac_cv_hadf5_h=no + + eval "$amuse_h5_flags_target_var=\"no\"" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for H5Fcreate in -lhdf5" >&5 -printf %s "checking for H5Fcreate in -lhdf5... " >&6; } -if test ${ac_cv_lib_hdf5_H5Fcreate+y} -then : - printf %s "(cached) " >&6 -else $as_nop - ac_check_lib_save_LIBS=$LIBS -LIBS="-lhdf5 $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ + LIBS="$amuse_h5_save_LIBS" + LDFLAGS="$amuse_h5_save_LDFLAGS" + eval "$amuse_h5_flags_var=\"\$amuse_h5_save_FLAGS\"" -/* 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. */ -char H5Fcreate (); -int -main (void) -{ -return H5Fcreate (); - ; - return 0; -} + + + amuse_h5_name="Fortran with the high-level API in hdf5_hl_fortran with flags from h5fc" + amuse_h5_prefix="FC" + amuse_h5_target="HL_FC" + amuse_h5_program=" program main + + use h5lt + + integer :: error + + error = h5ltfind_dataset_f(0_hid_t, 'test') + + end" + amuse_h5_libs="-lhdf5_hl_fortran" + + amuse_h5_flags_var="${amuse_h5_prefix}FLAGS" + amuse_h5_flags_source_var="amuse_h5_${amuse_h5_flags_var}" + amuse_h5_flags_target_var="amuse_h5_detect_${amuse_h5_target}" + + eval "amuse_h5_save_FLAGS=\"\$$amuse_h5_flags_var\"" + amuse_h5_save_LDFLAGS="$LDFLAGS" + amuse_h5_save_LIBS="$LIBS" + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether we can build a program with HDF5 in $amuse_h5_name" >&5 +printf %s "checking whether we can build a program with HDF5 in $amuse_h5_name... " >&6; } + + eval "$amuse_h5_flags_var=\"\$$amuse_h5_flags_source_var \$$amuse_h5_flags_var\"" + LDFLAGS="$amuse_h5_LDFLAGS $LDFLAGS" + LIBS="$amuse_h5_libs" + + cat > conftest.$ac_ext <<_ACEOF +$amuse_h5_program _ACEOF -if ac_fn_c_try_link "$LINENO" +if ac_fn_fc_try_link "$LINENO" then : - ac_cv_lib_hdf5_H5Fcreate=yes + + eval "$amuse_h5_flags_target_var=\"yes\"" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + else $as_nop - ac_cv_lib_hdf5_H5Fcreate=no + + eval "$amuse_h5_flags_target_var=\"no\"" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_hdf5_H5Fcreate" >&5 -printf "%s\n" "$ac_cv_lib_hdf5_H5Fcreate" >&6; } -if test "x$ac_cv_lib_hdf5_H5Fcreate" = xyes + + LIBS="$amuse_h5_save_LIBS" + LDFLAGS="$amuse_h5_save_LDFLAGS" + eval "$amuse_h5_flags_var=\"\$amuse_h5_save_FLAGS\"" + + + if test $amuse_h5_detect_HL_FC = "yes" + then + amuse_h5_HL_FC_LIB="-lhdf5_hl_fortran" + else + + amuse_h5_name="Fortran with the high-level API in hdf5hl_fortran with flags from h5fc" + amuse_h5_prefix="FC" + amuse_h5_target="HL_FC" + amuse_h5_program=" program main + + use h5lt + + integer :: error + + error = h5ltfind_dataset_f(0_hid_t, 'test') + + end" + amuse_h5_libs="-lhdf5hl_fortran" + + amuse_h5_flags_var="${amuse_h5_prefix}FLAGS" + amuse_h5_flags_source_var="amuse_h5_${amuse_h5_flags_var}" + amuse_h5_flags_target_var="amuse_h5_detect_${amuse_h5_target}" + + eval "amuse_h5_save_FLAGS=\"\$$amuse_h5_flags_var\"" + amuse_h5_save_LDFLAGS="$LDFLAGS" + amuse_h5_save_LIBS="$LIBS" + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether we can build a program with HDF5 in $amuse_h5_name" >&5 +printf %s "checking whether we can build a program with HDF5 in $amuse_h5_name... " >&6; } + + eval "$amuse_h5_flags_var=\"\$$amuse_h5_flags_source_var \$$amuse_h5_flags_var\"" + LDFLAGS="$amuse_h5_LDFLAGS $LDFLAGS" + LIBS="$amuse_h5_libs" + + cat > conftest.$ac_ext <<_ACEOF +$amuse_h5_program +_ACEOF +if ac_fn_fc_try_link "$LINENO" then : - ac_cv_libhdf5=yes + + eval "$amuse_h5_flags_target_var=\"yes\"" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + else $as_nop - ac_cv_libhdf5=no + + eval "$amuse_h5_flags_target_var=\"no\"" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext + + LIBS="$amuse_h5_save_LIBS" + LDFLAGS="$amuse_h5_save_LDFLAGS" + eval "$amuse_h5_flags_var=\"\$amuse_h5_save_FLAGS\"" - if test "$ac_cv_hadf5_h" = "no" && test "$ac_cv_libhdf5" = "no" ; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: Unable to compile HDF5 test program" >&5 -printf "%s\n" "$as_me: WARNING: Unable to compile HDF5 test program" >&2;} + + if test $amuse_h5_detect_HL_FC = "yes" + then + amuse_h5_HL_FC_LIB="-lhdf5hl_fortran" fi - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for main in -lhdf5_hl" >&5 -printf %s "checking for main in -lhdf5_hl... " >&6; } -if test ${ac_cv_lib_hdf5_hl_main+y} -then : - printf %s "(cached) " >&6 -else $as_nop - ac_check_lib_save_LIBS=$LIBS -LIBS="-lhdf5_hl $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ + fi + 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 -int -main (void) -{ -return main (); - ; - return 0; -} + + + if test "$amuse_h5_detect_FC" = "no" + then + amuse_h5_extra_flags=$(echo "$amuse_h5_include_flags" | sed -e 's^\([[:graph:]]*\)\( \|$\)^\1/../mod/shared ^g') + amuse_h5_FCFLAGS="$amuse_h5_include_flags $amuse_h5_extra_flags" + + 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 + + + amuse_h5_name="Fortran with flags from h5fc and mod/shared" + amuse_h5_prefix="FC" + amuse_h5_target="FC" + amuse_h5_program=" program main + + use h5lib + + integer :: error + + call h5open_f(error) + call h5close_f(error) + end" + amuse_h5_libs="-lhdf5_fortran" + + amuse_h5_flags_var="${amuse_h5_prefix}FLAGS" + amuse_h5_flags_source_var="amuse_h5_${amuse_h5_flags_var}" + amuse_h5_flags_target_var="amuse_h5_detect_${amuse_h5_target}" + + eval "amuse_h5_save_FLAGS=\"\$$amuse_h5_flags_var\"" + amuse_h5_save_LDFLAGS="$LDFLAGS" + amuse_h5_save_LIBS="$LIBS" + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether we can build a program with HDF5 in $amuse_h5_name" >&5 +printf %s "checking whether we can build a program with HDF5 in $amuse_h5_name... " >&6; } + + eval "$amuse_h5_flags_var=\"\$$amuse_h5_flags_source_var \$$amuse_h5_flags_var\"" + LDFLAGS="$amuse_h5_LDFLAGS $LDFLAGS" + LIBS="$amuse_h5_libs" + + cat > conftest.$ac_ext <<_ACEOF +$amuse_h5_program _ACEOF -if ac_fn_c_try_link "$LINENO" +if ac_fn_fc_try_link "$LINENO" then : - ac_cv_lib_hdf5_hl_main=yes + + eval "$amuse_h5_flags_target_var=\"yes\"" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + else $as_nop - ac_cv_lib_hdf5_hl_main=no + + eval "$amuse_h5_flags_target_var=\"no\"" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_hdf5_hl_main" >&5 -printf "%s\n" "$ac_cv_lib_hdf5_hl_main" >&6; } -if test "x$ac_cv_lib_hdf5_hl_main" = xyes -then : - HDF5_LIBS="-lhdf5_hl $HDF5_LIBS" -fi -ac_cv_lib_hdf5_hl=ac_cv_lib_hdf5_hl_main + LIBS="$amuse_h5_save_LIBS" + LDFLAGS="$amuse_h5_save_LDFLAGS" + eval "$amuse_h5_flags_var=\"\$amuse_h5_save_FLAGS\"" - CC=$ax_lib_hdf5_save_CC - CPPFLAGS=$ax_lib_hdf5_save_CPPFLAGS - LIBS=$ax_lib_hdf5_save_LIBS - LDFLAGS=$ax_lib_hdf5_save_LDFLAGS - ac_ext=cpp -ac_cpp='$CXXCPP $CPPFLAGS' -ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_cxx_compiler_gnu - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for matching HDF5 Fortran wrapper" >&5 -printf %s "checking for matching HDF5 Fortran wrapper... " >&6; } - H5FC=$(eval echo -n $H5CC | $SED -n 's/cc$/fc/p') - if test -x "$H5FC"; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $H5FC" >&5 -printf "%s\n" "$H5FC" >&6; } - with_hdf5_fortran="yes" + amuse_h5_name="Fortran with the high-level API in hdf5_hl_fortran with flags from h5fc and mod/shared" + amuse_h5_prefix="FC" + amuse_h5_target="HL_FC" + amuse_h5_program=" program main + use h5lt - for arg in `$H5FC -show` - do - case "$arg" in #( - -I*) echo $HDF5_FFLAGS | $GREP -e "$arg" >/dev/null \ - || HDF5_FFLAGS="$HDF5_FFLAGS $arg" - ;;#( - -L*) echo $HDF5_FFLAGS | $GREP -e "$arg" >/dev/null \ - || HDF5_FFLAGS="$HDF5_FFLAGS $arg" - echo $HDF5_FFLAGS | $GREP -e "-I${arg#-L}" >/dev/null \ - || HDF5_FFLAGS="$HDF5_FFLAGS -I${arg#-L}" - ;; - esac - done + integer :: error - for arg in $HDF5_LIBS - do - case "$arg" in #( - -lhdf5_hl) HDF5_FLIBS="$HDF5_FLIBS -lhdf5hl_fortran $arg" - ;; #( - -lhdf5) HDF5_FLIBS="$HDF5_FLIBS -lhdf5_fortran $arg" - ;; #( - *) HDF5_FLIBS="$HDF5_FLIBS $arg" - ;; - esac - done - else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 + error = h5ltfind_dataset_f(0_hid_t, 'test') + + end" + amuse_h5_libs="-lhdf5_hl_fortran" + + amuse_h5_flags_var="${amuse_h5_prefix}FLAGS" + amuse_h5_flags_source_var="amuse_h5_${amuse_h5_flags_var}" + amuse_h5_flags_target_var="amuse_h5_detect_${amuse_h5_target}" + + eval "amuse_h5_save_FLAGS=\"\$$amuse_h5_flags_var\"" + amuse_h5_save_LDFLAGS="$LDFLAGS" + amuse_h5_save_LIBS="$LIBS" + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether we can build a program with HDF5 in $amuse_h5_name" >&5 +printf %s "checking whether we can build a program with HDF5 in $amuse_h5_name... " >&6; } + + eval "$amuse_h5_flags_var=\"\$$amuse_h5_flags_source_var \$$amuse_h5_flags_var\"" + LDFLAGS="$amuse_h5_LDFLAGS $LDFLAGS" + LIBS="$amuse_h5_libs" + + cat > conftest.$ac_ext <<_ACEOF +$amuse_h5_program +_ACEOF +if ac_fn_fc_try_link "$LINENO" +then : + + eval "$amuse_h5_flags_target_var=\"yes\"" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + +else $as_nop + + eval "$amuse_h5_flags_target_var=\"no\"" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } - with_hdf5_fortran="no" - fi + +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext + + LIBS="$amuse_h5_save_LIBS" + LDFLAGS="$amuse_h5_save_LDFLAGS" + eval "$amuse_h5_flags_var=\"\$amuse_h5_save_FLAGS\"" + if test $amuse_h5_detect_HL_FC = "yes" + then + amuse_h5_HL_FC_LIB="-lhdf5_hl_fortran" + else + amuse_h5_name="Fortran with the high-level API in hdf5hl_fortran with flags from h5fc and mod/shared" + amuse_h5_prefix="FC" + amuse_h5_target="HL_FC" + amuse_h5_program=" program main + use h5lt + integer :: error + error = h5ltfind_dataset_f(0_hid_t, 'test') + end" + amuse_h5_libs="-lhdf5hl_fortran" + amuse_h5_flags_var="${amuse_h5_prefix}FLAGS" + amuse_h5_flags_source_var="amuse_h5_${amuse_h5_flags_var}" + amuse_h5_flags_target_var="amuse_h5_detect_${amuse_h5_target}" + eval "amuse_h5_save_FLAGS=\"\$$amuse_h5_flags_var\"" + amuse_h5_save_LDFLAGS="$LDFLAGS" + amuse_h5_save_LIBS="$LIBS" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether we can build a program with HDF5 in $amuse_h5_name" >&5 +printf %s "checking whether we can build a program with HDF5 in $amuse_h5_name... " >&6; } + eval "$amuse_h5_flags_var=\"\$$amuse_h5_flags_source_var \$$amuse_h5_flags_var\"" + LDFLAGS="$amuse_h5_LDFLAGS $LDFLAGS" + LIBS="$amuse_h5_libs" + + cat > conftest.$ac_ext <<_ACEOF +$amuse_h5_program +_ACEOF +if ac_fn_fc_try_link "$LINENO" +then : -printf "%s\n" "#define HAVE_HDF5 1" >>confdefs.h + eval "$amuse_h5_flags_target_var=\"yes\"" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + +else $as_nop + + eval "$amuse_h5_flags_target_var=\"no\"" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } - fi fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext + LIBS="$amuse_h5_save_LIBS" + LDFLAGS="$amuse_h5_save_LDFLAGS" + eval "$amuse_h5_flags_var=\"\$amuse_h5_save_FLAGS\"" -ac_ext=c + + if test $amuse_h5_detect_HL_FC = "yes" + then + amuse_h5_HL_FC_LIB="-lhdf5hl_fortran" + fi + fi + + 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 test "$amuse_h5_detect_FC" = "no" + then + amuse_h5_FCFLAGS="" + fi + fi + + fi + + if test "$amuse_h5_detect_C" = "yes" + then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: HDF5 installation detected" >&5 +printf "%s\n" "$as_me: HDF5 installation detected" >&6;} + + HDF5_C_FOUND="$amuse_h5_detect_C" + HDF5_HL_C_FOUND="$amuse_h5_detect_HL_C" + HDF5_CXX_FOUND="$amuse_h5_detect_CXX" + HDF5_FC_FOUND="$amuse_h5_detect_FC" + HDF5_HL_FC_FOUND="$amuse_h5_detect_HL_FC" + + HDF5_TYPE="serial" + HDF5_CFLAGS="$amuse_h5_CFLAGS" + HDF5_CXXFLAGS="$amuse_h5_CXXFLAGS" + HDF5_FCFLAGS="$amuse_h5_FCFLAGS" + HDF5_LDFLAGS="$amuse_h5_LDFLAGS" + HDF5_HLFC_LIB="$amuse_h5_HL_FC_LIB" + else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: no HDF5 installation detected" >&5 +printf "%s\n" "$as_me: WARNING: no HDF5 installation detected" >&2;} + fi + + + + + + + + + # Generate output ac_config_files="$ac_config_files config.mk" @@ -7298,7 +10691,6 @@ gives unlimited permission to copy, distribute and modify it." ac_pwd='$ac_pwd' srcdir='$srcdir' -AWK='$AWK' test -n "\$AWK" || AWK=awk _ACEOF diff --git a/src/amuse_etics/support/configure.ac b/src/amuse_etics/support/configure.ac index 6866e5bd9a..f987f9ecc3 100644 --- a/src/amuse_etics/support/configure.ac +++ b/src/amuse_etics/support/configure.ac @@ -28,10 +28,11 @@ AC_LANG_PUSH([C++]) AX_MPI() AMUSE_CUDA() -AX_LIB_HDF5() AC_LANG_POP([C++]) +AMUSE_LIB_HDF5() + # Generate output AC_CONFIG_FILES([config.mk]) AC_OUTPUT diff --git a/src/amuse_mesa_r15140/Makefile b/src/amuse_mesa_r15140/Makefile index f43a341e1a..8295f1ad21 100644 --- a/src/amuse_mesa_r15140/Makefile +++ b/src/amuse_mesa_r15140/Makefile @@ -114,7 +114,7 @@ src/bin/fpx3_deps: | src/fpx3_deps $(MESA_DIR)/utils/makedepf90-2.8.8: | $(MESA_DIR) cd $(MESA_DIR)/utils && tar xzf makedepf90-2.8.8.tar.gz -m - touch $(MESA_DIR)/utils/makedepf90-2.8.8/configure + touch $(MESA_DIR)/utils/makedepf90-2.8.8/configure src/bin/makedepf90: | $(MESA_DIR)/utils/makedepf90-2.8.8 src/bin cd $(MESA_DIR)/utils/makedepf90-2.8.8 && ./configure @@ -144,7 +144,7 @@ MESA_TOOLS := src/bin/fpx3 src/bin/fpx3_deps src/bin/makedepf90 src/bin/ndiff MESA_ENV := MESA_DIR=$(MESA_DIR) FC=$(FC) MPIFC=$(MPIFC) MESA_ENV += CC=$(CC) MPICC=$(MPICC) OPENMP_FCFLAGS=$(OPENMP_FCFLAGS) MESA_ENV += LAPACK_LIBS="$(LAPACK_LIBS)" BLAS_LIBS="$(BLAS_LIBS)" -MESA_ENV += HDF5_FFLAGS="$(HDF5_FFLAGS)" HDF5_LDFLAGS="$(HDF5_LDFLAGS)" +MESA_ENV += HDF5_FFLAGS="$(HDF5_FCFLAGS)" HDF5_LDFLAGS="$(HDF5_LDFLAGS)" export PATH := $(realpath .)/src/bin:$(PATH) diff --git a/src/amuse_mesa_r15140/packages/amuse-mesa-r15140.amuse_deps b/src/amuse_mesa_r15140/packages/amuse-mesa-r15140.amuse_deps index 85d4dbf017..1cc20586a6 100644 --- a/src/amuse_mesa_r15140/packages/amuse-mesa-r15140.amuse_deps +++ b/src/amuse_mesa_r15140/packages/amuse-mesa-r15140.amuse_deps @@ -1 +1 @@ -c c++ fortran python bison cmake install download patch mpi openmp hdf5 libz lapack blas perl tar gunzip unzip unxz +c c++ fortran python bison cmake install download patch mpi openmp hdf5-fortran libz lapack blas perl tar gunzip unzip unxz diff --git a/src/amuse_mesa_r15140/support/config.mk.in b/src/amuse_mesa_r15140/support/config.mk.in index afa25c75fd..bc1125a43d 100644 --- a/src/amuse_mesa_r15140/support/config.mk.in +++ b/src/amuse_mesa_r15140/support/config.mk.in @@ -34,13 +34,8 @@ OPENMP_CFLAGS = @OPENMP_CFLAGS@ OPENMP_CXXFLAGS = @OPENMP_CXXFLAGS@ OPENMP_FCFLAGS = @OPENMP_FCFLAGS@ -HDF5_VERSION = @HDF5_VERSION@ -HDF5_CFLAGS = @HDF5_CFLAGS@ -HDF5_CPPFLAGS = @HDF5_CPPFLAGS@ -HDF5_FFLAGS = @HDF5_FFLAGS@ +HDF5_FCLAGS = @HDF5_FFLAGS@ HDF5_LDFLAGS = @HDF5_LDFLAGS@ -HDF5_LIBS = @HDF5_LIBS@ -HDF5_FLIBS = @HDF5_FLIBS@ BLAS_LIBS = @BLAS_LIBS@ LAPACK_LIBS = @LAPACK_LIBS@ diff --git a/src/amuse_mesa_r15140/support/configure.ac b/src/amuse_mesa_r15140/support/configure.ac index 2e2a2d18c5..d5cdcdb5e0 100644 --- a/src/amuse_mesa_r15140/support/configure.ac +++ b/src/amuse_mesa_r15140/support/configure.ac @@ -69,11 +69,11 @@ AC_OPENMP() AC_SUBST(OPENMP_FCFLAGS) AX_LAPACK() -AX_LIB_HDF5() AMUSE_LIBZ() AC_LANG_POP([Fortran]) +AMUSE_LIB_HDF5() # Generate output AC_CONFIG_FILES([config.mk]) diff --git a/src/amuse_simplex/Makefile b/src/amuse_simplex/Makefile index bf52058d03..5d43841ea0 100644 --- a/src/amuse_simplex/Makefile +++ b/src/amuse_simplex/Makefile @@ -15,6 +15,7 @@ CFLAGS += $(DEPFLAGS) LDFLAGS += $(HDF5_LDFLAGS) +HDF5_LIBS = -lhdf5 -lz LDLIBS += $(GSL_LIBS) $(HDF5_LIBS) $(HEALPIX_CXX_LIBS) $(QHULL_LIBS) CODELIB = libsimplex.a @@ -25,7 +26,7 @@ CODEOBJS := $(patsubst %,src/obj/%,$(CODEOBJS)) .PHONY: $(CODELIB) $(CODELIB): - $(MAKE) -C src amuse MPICXX=$(MPICXX) HDF5_FLAGS="$(HDF5_CFLAGS) $(HDF5_CPPFLAGS)" HDF5_LIBS="$(HDF5_LDFLAGS) $(HDF5_LIBS)" + $(MAKE) -C src amuse MPICXX=$(MPICXX) HDF5_FLAGS="$(HDF5_CFLAGS)" HDF5_LIBS="$(HDF5_LDFLAGS) $(HDF5_LIBS)" $(AR) ruv $@ $(CODEOBJS) $(RANLIB) $@ diff --git a/src/amuse_simplex/packages/amuse-simplex.amuse_deps b/src/amuse_simplex/packages/amuse-simplex.amuse_deps index 728a9cc05b..30f8f99f05 100644 --- a/src/amuse_simplex/packages/amuse-simplex.amuse_deps +++ b/src/amuse_simplex/packages/amuse-simplex.amuse_deps @@ -1 +1 @@ -c++ mpi gsl hdf5 qhull healpix-cxx libz +c++ mpi gsl hdf5-c qhull healpix-cxx libz diff --git a/src/amuse_simplex/support/aclocal.m4 b/src/amuse_simplex/support/aclocal.m4 index d89d208f92..66ea0171fa 100644 --- a/src/amuse_simplex/support/aclocal.m4 +++ b/src/amuse_simplex/support/aclocal.m4 @@ -12,13 +12,13 @@ # PARTICULAR PURPOSE. m4_ifndef([AC_CONFIG_MACRO_DIRS], [m4_defun([_AM_CONFIG_MACRO_DIRS], [])m4_defun([AC_CONFIG_MACRO_DIRS], [_AM_CONFIG_MACRO_DIRS($@)])]) +m4_include([shared/m4/amuse_lib_hdf5.m4]) m4_include([shared/m4/amuse_lib_healpix.m4]) m4_include([shared/m4/amuse_lib_qhull.m4]) m4_include([shared/m4/amuse_libz.m4]) m4_include([shared/m4/amuse_log_envvars.m4]) m4_include([shared/m4/amuse_venv.m4]) m4_include([shared/m4/ax_count_cpus.m4]) -m4_include([shared/m4/ax_lib_hdf5.m4]) m4_include([shared/m4/ax_mpi.m4]) m4_include([shared/m4/gsl.m4]) m4_include([shared/m4/pkg.m4]) diff --git a/src/amuse_simplex/support/config.mk.in b/src/amuse_simplex/support/config.mk.in index dab6318c62..8952318de7 100644 --- a/src/amuse_simplex/support/config.mk.in +++ b/src/amuse_simplex/support/config.mk.in @@ -22,13 +22,8 @@ LIBS = @LIBS@ GSL_FLAGS = @GSL_FLAGS@ GSL_LIBS = @GSL_LIBS@ -HDF5_VERSION = @HDF5_VERSION@ HDF5_CFLAGS = @HDF5_CFLAGS@ -HDF5_CPPFLAGS = @HDF5_CPPFLAGS@ -HDF5_FFLAGS = @HDF5_FFLAGS@ HDF5_LDFLAGS = @HDF5_LDFLAGS@ -HDF5_LIBS = @HDF5_LIBS@ -HDF5_FLIBS = @HDF5_FLIBS@ QHULL_FLAGS = @QHULL_FLAGS@ QHULL_LIBS = @QHULL_LIBS@ diff --git a/src/amuse_simplex/support/configure b/src/amuse_simplex/support/configure index 83484cb8de..f8a575af50 100755 --- a/src/amuse_simplex/support/configure +++ b/src/amuse_simplex/support/configure @@ -704,32 +704,30 @@ ac_includes_default="\ # include #endif" -ac_header_c_list= +ac_header_cxx_list= ac_subst_vars='LTLIBOBJS LIBOBJS +HDF5_HLFC_LIB +HDF5_LDFLAGS +HDF5_FCFLAGS +HDF5_CXXFLAGS +HDF5_CFLAGS +HDF5_TYPE +H5FC +H5CXX +H5CC +ac_ct_FC +FCFLAGS +FC HEALPIX_CXX_LIBS HEALPIX_CXX_CFLAGS QHULL_FLAGS QHULL_LIBS LIBZ_LIBS LIBZ_CFLAGS -HDF5_TYPE -HDF5_FLIBS -HDF5_FFLAGS -HDF5_FC -HDF5_LIBS -HDF5_LDFLAGS -HDF5_CPPFLAGS -HDF5_CFLAGS -HDF5_CC -HDF5_VERSION -H5FC ac_ct_CC CFLAGS CC -H5CC -AWK -SED GSL_CONFIG GSL_LIBS GSL_CFLAGS @@ -811,7 +809,6 @@ enable_option_checking with_gsl_prefix with_gsl_exec_prefix enable_gsltest -with_hdf5 ' ac_precious_vars='build_alias host_alias @@ -831,7 +828,9 @@ GSL_LIBS CC CFLAGS HEALPIX_CXX_CFLAGS -HEALPIX_CXX_LIBS' +HEALPIX_CXX_LIBS +FC +FCFLAGS' # Initialize some variables set by options. @@ -1462,7 +1461,6 @@ Optional Packages: --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) --with-gsl-prefix=PFX Prefix where GSL is installed (optional) --with-gsl-exec-prefix=PFX Exec prefix where GSL is installed (optional) - --with-hdf5=yes/no/PATH location of h5cc or h5pcc for HDF5 configuration Some influential environment variables: CXX C++ compiler command @@ -1486,6 +1484,8 @@ Some influential environment variables: C compiler flags for HEALPIX_CXX, overriding pkg-config HEALPIX_CXX_LIBS linker flags for HEALPIX_CXX, overriding pkg-config + FC Fortran compiler command + FCFLAGS Fortran compiler flags Use these variables to override the choices made by `configure' or to help it to find libraries and programs with nonstandard names/locations. @@ -1755,39 +1755,6 @@ fi } # ac_fn_c_try_compile -# ac_fn_c_check_header_compile LINENO HEADER VAR INCLUDES -# ------------------------------------------------------- -# Tests whether HEADER exists and can be compiled using the include files in -# INCLUDES, setting the cache variable VAR accordingly. -ac_fn_c_check_header_compile () -{ - as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 -printf %s "checking for $2... " >&6; } -if eval test \${$3+y} -then : - printf %s "(cached) " >&6 -else $as_nop - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -$4 -#include <$2> -_ACEOF -if ac_fn_c_try_compile "$LINENO" -then : - eval "$3=yes" -else $as_nop - eval "$3=no" -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext -fi -eval ac_res=\$$3 - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -printf "%s\n" "$ac_res" >&6; } - eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno - -} # ac_fn_c_check_header_compile - # ac_fn_c_try_link LINENO # ----------------------- # Try to link conftest.$ac_ext, and return whether this succeeded. @@ -1867,6 +1834,92 @@ printf "%s\n" "$ac_res" >&6; } eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_cxx_check_header_compile + +# ac_fn_fc_try_compile LINENO +# --------------------------- +# Try to compile conftest.$ac_ext, and return whether this succeeded. +ac_fn_fc_try_compile () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + rm -f conftest.$ac_objext conftest.beam + if { { ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +printf "%s\n" "$ac_try_echo"; } >&5 + (eval "$ac_compile") 2>conftest.err + ac_status=$? + if test -s conftest.err; then + grep -v '^ *+' conftest.err >conftest.er1 + cat conftest.er1 >&5 + mv -f conftest.er1 conftest.err + fi + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && { + test -z "$ac_fc_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext +then : + ac_retval=0 +else $as_nop + printf "%s\n" "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_retval=1 +fi + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + as_fn_set_status $ac_retval + +} # ac_fn_fc_try_compile + +# ac_fn_fc_try_link LINENO +# ------------------------ +# Try to link conftest.$ac_ext, and return whether this succeeded. +ac_fn_fc_try_link () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + rm -f conftest.$ac_objext conftest.beam conftest$ac_exeext + if { { ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +printf "%s\n" "$ac_try_echo"; } >&5 + (eval "$ac_link") 2>conftest.err + ac_status=$? + if test -s conftest.err; then + grep -v '^ *+' conftest.err >conftest.er1 + cat conftest.er1 >&5 + mv -f conftest.er1 conftest.err + fi + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && { + test -z "$ac_fc_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + test -x conftest$ac_exeext + } +then : + ac_retval=0 +else $as_nop + printf "%s\n" "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_retval=1 +fi + # Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information + # created by the PGI compiler (conftest_ipa8_conftest.oo), as it would + # interfere with the next link command; also delete a directory that is + # left behind by Apple's compiler. We do this before executing the actions. + rm -rf conftest.dSYM conftest_ipa8_conftest.oo + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + as_fn_set_status $ac_retval + +} # ac_fn_fc_try_link ac_configure_args_raw= for ac_arg do @@ -2686,15 +2739,15 @@ main (int argc, char **argv) } " -as_fn_append ac_header_c_list " stdio.h stdio_h HAVE_STDIO_H" -as_fn_append ac_header_c_list " stdlib.h stdlib_h HAVE_STDLIB_H" -as_fn_append ac_header_c_list " string.h string_h HAVE_STRING_H" -as_fn_append ac_header_c_list " inttypes.h inttypes_h HAVE_INTTYPES_H" -as_fn_append ac_header_c_list " stdint.h stdint_h HAVE_STDINT_H" -as_fn_append ac_header_c_list " strings.h strings_h HAVE_STRINGS_H" -as_fn_append ac_header_c_list " sys/stat.h sys_stat_h HAVE_SYS_STAT_H" -as_fn_append ac_header_c_list " sys/types.h sys_types_h HAVE_SYS_TYPES_H" -as_fn_append ac_header_c_list " unistd.h unistd_h HAVE_UNISTD_H" +as_fn_append ac_header_cxx_list " stdio.h stdio_h HAVE_STDIO_H" +as_fn_append ac_header_cxx_list " stdlib.h stdlib_h HAVE_STDLIB_H" +as_fn_append ac_header_cxx_list " string.h string_h HAVE_STRING_H" +as_fn_append ac_header_cxx_list " inttypes.h inttypes_h HAVE_INTTYPES_H" +as_fn_append ac_header_cxx_list " stdint.h stdint_h HAVE_STDINT_H" +as_fn_append ac_header_cxx_list " strings.h strings_h HAVE_STRINGS_H" +as_fn_append ac_header_cxx_list " sys/stat.h sys_stat_h HAVE_SYS_STAT_H" +as_fn_append ac_header_cxx_list " sys/types.h sys_types_h HAVE_SYS_TYPES_H" +as_fn_append ac_header_cxx_list " unistd.h unistd_h HAVE_UNISTD_H" # Auxiliary files required by this configure script. ac_aux_files="config.guess config.sub" @@ -4743,128 +4796,6 @@ rm -f core conftest.err conftest.$ac_objext conftest.beam \ rm -f conf.gsltest -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for a sed that does not truncate output" >&5 -printf %s "checking for a sed that does not truncate output... " >&6; } -if test ${ac_cv_path_SED+y} -then : - printf %s "(cached) " >&6 -else $as_nop - ac_script=s/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb/ - for ac_i in 1 2 3 4 5 6 7; do - ac_script="$ac_script$as_nl$ac_script" - done - echo "$ac_script" 2>/dev/null | sed 99q >conftest.sed - { ac_script=; unset ac_script;} - if test -z "$SED"; then - ac_path_SED_found=false - # Loop through the user's path and test for each of PROGNAME-LIST - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - case $as_dir in #((( - '') as_dir=./ ;; - */) ;; - *) as_dir=$as_dir/ ;; - esac - for ac_prog in sed gsed - do - for ac_exec_ext in '' $ac_executable_extensions; do - ac_path_SED="$as_dir$ac_prog$ac_exec_ext" - as_fn_executable_p "$ac_path_SED" || continue -# Check for GNU ac_path_SED and select it if it is found. - # Check for GNU $ac_path_SED -case `"$ac_path_SED" --version 2>&1` in -*GNU*) - ac_cv_path_SED="$ac_path_SED" ac_path_SED_found=:;; -*) - ac_count=0 - printf %s 0123456789 >"conftest.in" - while : - do - cat "conftest.in" "conftest.in" >"conftest.tmp" - mv "conftest.tmp" "conftest.in" - cp "conftest.in" "conftest.nl" - printf "%s\n" '' >> "conftest.nl" - "$ac_path_SED" -f conftest.sed < "conftest.nl" >"conftest.out" 2>/dev/null || break - diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break - as_fn_arith $ac_count + 1 && ac_count=$as_val - if test $ac_count -gt ${ac_path_SED_max-0}; then - # Best one so far, save it but keep looking for a better one - ac_cv_path_SED="$ac_path_SED" - ac_path_SED_max=$ac_count - fi - # 10*(2^10) chars as input seems more than enough - test $ac_count -gt 10 && break - done - rm -f conftest.in conftest.tmp conftest.nl conftest.out;; -esac - - $ac_path_SED_found && break 3 - done - done - done -IFS=$as_save_IFS - if test -z "$ac_cv_path_SED"; then - as_fn_error $? "no acceptable sed could be found in \$PATH" "$LINENO" 5 - fi -else - ac_cv_path_SED=$SED -fi - -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_SED" >&5 -printf "%s\n" "$ac_cv_path_SED" >&6; } - SED="$ac_cv_path_SED" - rm -f conftest.sed - -for ac_prog in gawk mawk nawk awk -do - # Extract the first word of "$ac_prog", so it can be a program name with args. -set dummy $ac_prog; ac_word=$2 -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -printf %s "checking for $ac_word... " >&6; } -if test ${ac_cv_prog_AWK+y} -then : - printf %s "(cached) " >&6 -else $as_nop - if test -n "$AWK"; then - ac_cv_prog_AWK="$AWK" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - case $as_dir in #((( - '') as_dir=./ ;; - */) ;; - *) as_dir=$as_dir/ ;; - esac - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then - ac_cv_prog_AWK="$ac_prog" - printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -AWK=$ac_cv_prog_AWK -if test -n "$AWK"; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $AWK" >&5 -printf "%s\n" "$AWK" >&6; } -else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } -fi - - - test -n "$AWK" && break -done - @@ -5606,11 +5537,70 @@ ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $ ac_compiler_gnu=$ac_cv_c_compiler_gnu + + amuse_libz_save_libs="$LIBS" + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libz" >&5 +printf %s "checking for libz... " >&6; } + + 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 + + + LIBS="-lz" + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + + #include + +int +main (void) +{ + + z_stream strm; + deflateInit(&strm, 0); + + ; + return 0; +} + +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + + FOUND_LIBZ="yes" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + +else $as_nop + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext + + ac_ext=cpp +ac_cpp='$CXXCPP $CPPFLAGS' +ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_cxx_compiler_gnu + + + + + ac_header= ac_cache= -for ac_item in $ac_header_c_list +for ac_item in $ac_header_cxx_list do if test $ac_cache; then - ac_fn_c_check_header_compile "$LINENO" $ac_header ac_cv_header_$ac_cache "$ac_includes_default" + ac_fn_cxx_check_header_compile "$LINENO" $ac_header ac_cv_header_$ac_cache "$ac_includes_default" if eval test \"x\$ac_cv_header_$ac_cache\" = xyes; then printf "%s\n" "#define $ac_item 1" >> confdefs.h fi @@ -5636,414 +5626,6 @@ printf "%s\n" "#define STDC_HEADERS 1" >>confdefs.h fi - - - - - -if test "" = "" ; then - : # Recognized value -elif test "" = "serial" ; then - : # Recognized value -elif test "" = "parallel"; then - : # Recognized value -else - as_fn_error $? " -Unrecognized value for AX_LIB_HDF5 within configure.ac. -If supplied, argument 1 must be either 'serial' or 'parallel'. -" "$LINENO" 5 -fi - - -# Check whether --with-hdf5 was given. -if test ${with_hdf5+y} -then : - withval=$with_hdf5; if test "$withval" = "no"; then - with_hdf5="no" - elif test "$withval" = "yes"; then - with_hdf5="yes" - else - with_hdf5="yes" - H5CC="$withval" - fi -else $as_nop - with_hdf5="yes" - -fi - - -HDF5_CC="" -HDF5_VERSION="" -HDF5_CFLAGS="" -HDF5_CPPFLAGS="" -HDF5_LDFLAGS="" -HDF5_LIBS="" -HDF5_FC="" -HDF5_FFLAGS="" -HDF5_FLIBS="" -HDF5_TYPE="" - -if test "$with_hdf5" = "yes"; then - if test -z "$H5CC"; then - for ac_prog in h5cc h5pcc -do - # Extract the first word of "$ac_prog", so it can be a program name with args. -set dummy $ac_prog; ac_word=$2 -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -printf %s "checking for $ac_word... " >&6; } -if test ${ac_cv_path_H5CC+y} -then : - printf %s "(cached) " >&6 -else $as_nop - case $H5CC in - [\\/]* | ?:[\\/]*) - ac_cv_path_H5CC="$H5CC" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - case $as_dir in #((( - '') as_dir=./ ;; - */) ;; - *) as_dir=$as_dir/ ;; - esac - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then - ac_cv_path_H5CC="$as_dir$ac_word$ac_exec_ext" - printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - - ;; -esac -fi -H5CC=$ac_cv_path_H5CC -if test -n "$H5CC"; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $H5CC" >&5 -printf "%s\n" "$H5CC" >&6; } -else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } -fi - - - test -n "$H5CC" && break -done - - else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking Using provided HDF5 C wrapper" >&5 -printf %s "checking Using provided HDF5 C wrapper... " >&6; } - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $H5CC" >&5 -printf "%s\n" "$H5CC" >&6; } - fi - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for HDF5 type" >&5 -printf %s "checking for HDF5 type... " >&6; } - case $H5CC in #( - *h5pcc) : - HDF5_TYPE=parallel ;; #( - *h5cc) : - HDF5_TYPE=serial ;; #( - *) : - HDF5_TYPE=neither ;; -esac - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $HDF5_TYPE" >&5 -printf "%s\n" "$HDF5_TYPE" >&6; } - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for HDF5 libraries" >&5 -printf %s "checking for HDF5 libraries... " >&6; } - if test ! -f "$H5CC" || test ! -x "$H5CC"; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: -Unable to locate HDF5 compilation helper scripts 'h5cc' or 'h5pcc'. -Please specify --with-hdf5= as the full path to h5cc or h5pcc. -HDF5 support is being disabled (equivalent to --with-hdf5=no). -" >&5 -printf "%s\n" "$as_me: WARNING: -Unable to locate HDF5 compilation helper scripts 'h5cc' or 'h5pcc'. -Please specify --with-hdf5= as the full path to h5cc or h5pcc. -HDF5 support is being disabled (equivalent to --with-hdf5=no). -" >&2;} - with_hdf5="no" - with_hdf5_fortran="no" - else - HDF5_SHOW=$(eval $H5CC -show) - - HDF5_CC=$(eval $H5CC -show | head -n 1 | $AWK '{print $1}') - if test "$HDF5_CC" = "ccache"; then - HDF5_CC=$(eval $H5CC -show | head -n 1 | $AWK '{print $2}') - fi - - - HDF5_VERSION=$(eval $H5CC -showconfig | $GREP 'HDF5 Version:' \ - | $AWK '{print $3}') - - HDF5_tmp_flags=$(eval $H5CC -showconfig \ - | $GREP 'FLAGS\|Extra libraries:' \ - | $AWK -F: '{printf("%s "), $2}' ) - - HDF5_tmp_inst=$(eval $H5CC -showconfig \ - | $GREP 'Installation point:' \ - | $AWK '{print $NF}' ) - - HDF5_CPPFLAGS="-I${HDF5_tmp_inst}/include" - - for arg in $HDF5_SHOW $HDF5_tmp_flags ; do - case "$arg" in - -I*) echo $HDF5_CPPFLAGS | $GREP -e "$arg" 2>&1 >/dev/null \ - || HDF5_CPPFLAGS="$HDF5_CPPFLAGS $arg" - ;; - -L*) echo $HDF5_LDFLAGS | $GREP -e "$arg" 2>&1 >/dev/null \ - || HDF5_LDFLAGS="$HDF5_LDFLAGS $arg" - ;; - -l*) echo $HDF5_LIBS | $GREP -e "$arg" 2>&1 >/dev/null \ - || HDF5_LIBS="$HDF5_LIBS $arg" - ;; - esac - done - - HDF5_LIBS="-lhdf5 $HDF5_LIBS" - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes (version $HDF5_VERSION)" >&5 -printf "%s\n" "yes (version $HDF5_VERSION)" >&6; } - - 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 - - ax_lib_hdf5_save_CC=$CC - ax_lib_hdf5_save_CPPFLAGS=$CPPFLAGS - ax_lib_hdf5_save_LIBS=$LIBS - ax_lib_hdf5_save_LDFLAGS=$LDFLAGS - CC=$HDF5_CC - CPPFLAGS=$HDF5_CPPFLAGS - LIBS=$HDF5_LIBS - LDFLAGS=$HDF5_LDFLAGS - ac_fn_c_check_header_compile "$LINENO" "hdf5.h" "ac_cv_header_hdf5_h" "$ac_includes_default" -if test "x$ac_cv_header_hdf5_h" = xyes -then : - ac_cv_hadf5_h=yes -else $as_nop - ac_cv_hadf5_h=no -fi - - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for H5Fcreate in -lhdf5" >&5 -printf %s "checking for H5Fcreate in -lhdf5... " >&6; } -if test ${ac_cv_lib_hdf5_H5Fcreate+y} -then : - printf %s "(cached) " >&6 -else $as_nop - ac_check_lib_save_LIBS=$LIBS -LIBS="-lhdf5 $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. */ -char H5Fcreate (); -int -main (void) -{ -return H5Fcreate (); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO" -then : - ac_cv_lib_hdf5_H5Fcreate=yes -else $as_nop - ac_cv_lib_hdf5_H5Fcreate=no -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_hdf5_H5Fcreate" >&5 -printf "%s\n" "$ac_cv_lib_hdf5_H5Fcreate" >&6; } -if test "x$ac_cv_lib_hdf5_H5Fcreate" = xyes -then : - ac_cv_libhdf5=yes -else $as_nop - ac_cv_libhdf5=no -fi - - if test "$ac_cv_hadf5_h" = "no" && test "$ac_cv_libhdf5" = "no" ; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: Unable to compile HDF5 test program" >&5 -printf "%s\n" "$as_me: WARNING: Unable to compile HDF5 test program" >&2;} - fi - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for main in -lhdf5_hl" >&5 -printf %s "checking for main in -lhdf5_hl... " >&6; } -if test ${ac_cv_lib_hdf5_hl_main+y} -then : - printf %s "(cached) " >&6 -else $as_nop - ac_check_lib_save_LIBS=$LIBS -LIBS="-lhdf5_hl $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - - -int -main (void) -{ -return main (); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO" -then : - ac_cv_lib_hdf5_hl_main=yes -else $as_nop - ac_cv_lib_hdf5_hl_main=no -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_hdf5_hl_main" >&5 -printf "%s\n" "$ac_cv_lib_hdf5_hl_main" >&6; } -if test "x$ac_cv_lib_hdf5_hl_main" = xyes -then : - HDF5_LIBS="-lhdf5_hl $HDF5_LIBS" -fi -ac_cv_lib_hdf5_hl=ac_cv_lib_hdf5_hl_main - - - CC=$ax_lib_hdf5_save_CC - CPPFLAGS=$ax_lib_hdf5_save_CPPFLAGS - LIBS=$ax_lib_hdf5_save_LIBS - LDFLAGS=$ax_lib_hdf5_save_LDFLAGS - ac_ext=cpp -ac_cpp='$CXXCPP $CPPFLAGS' -ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_cxx_compiler_gnu - - - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for matching HDF5 Fortran wrapper" >&5 -printf %s "checking for matching HDF5 Fortran wrapper... " >&6; } - H5FC=$(eval echo -n $H5CC | $SED -n 's/cc$/fc/p') - if test -x "$H5FC"; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $H5FC" >&5 -printf "%s\n" "$H5FC" >&6; } - with_hdf5_fortran="yes" - - - for arg in `$H5FC -show` - do - case "$arg" in #( - -I*) echo $HDF5_FFLAGS | $GREP -e "$arg" >/dev/null \ - || HDF5_FFLAGS="$HDF5_FFLAGS $arg" - ;;#( - -L*) echo $HDF5_FFLAGS | $GREP -e "$arg" >/dev/null \ - || HDF5_FFLAGS="$HDF5_FFLAGS $arg" - echo $HDF5_FFLAGS | $GREP -e "-I${arg#-L}" >/dev/null \ - || HDF5_FFLAGS="$HDF5_FFLAGS -I${arg#-L}" - ;; - esac - done - - for arg in $HDF5_LIBS - do - case "$arg" in #( - -lhdf5_hl) HDF5_FLIBS="$HDF5_FLIBS -lhdf5hl_fortran $arg" - ;; #( - -lhdf5) HDF5_FLIBS="$HDF5_FLIBS -lhdf5_fortran $arg" - ;; #( - *) HDF5_FLIBS="$HDF5_FLIBS $arg" - ;; - esac - done - else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } - with_hdf5_fortran="no" - fi - - - - - - - - - - - - -printf "%s\n" "#define HAVE_HDF5 1" >>confdefs.h - - fi -fi - - - amuse_libz_save_libs="$LIBS" - - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libz" >&5 -printf %s "checking for libz... " >&6; } - - 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 - - - LIBS="-lz" - - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - - - #include - -int -main (void) -{ - - z_stream strm; - deflateInit(&strm, 0); - - ; - return 0; -} - -_ACEOF -if ac_fn_c_try_link "$LINENO" -then : - - FOUND_LIBZ="yes" - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -printf "%s\n" "yes" >&6; } - -else $as_nop - - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } - -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam \ - conftest$ac_exeext conftest.$ac_ext - - ac_ext=cpp -ac_cpp='$CXXCPP $CPPFLAGS' -ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_cxx_compiler_gnu - - - - - - amuse_lib_qhull_save_libs="$LIBS" LIBS="" @@ -6279,6 +5861,3891 @@ ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $ ac_compiler_gnu=$ac_cv_c_compiler_gnu +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 +if test -n "$ac_tool_prefix"; then + for ac_prog in gfortran g95 xlf95 f95 fort ifort ifc efc pgfortran pgf95 lf95 ftn nagfor xlf90 f90 pgf90 pghpf epcf90 g77 xlf f77 frt pgf77 cf77 fort77 fl32 af77 + do + # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. +set dummy $ac_tool_prefix$ac_prog; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_FC+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if test -n "$FC"; then + ac_cv_prog_FC="$FC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_prog_FC="$ac_tool_prefix$ac_prog" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +FC=$ac_cv_prog_FC +if test -n "$FC"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $FC" >&5 +printf "%s\n" "$FC" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + + test -n "$FC" && break + done +fi +if test -z "$FC"; then + ac_ct_FC=$FC + for ac_prog in gfortran g95 xlf95 f95 fort ifort ifc efc pgfortran pgf95 lf95 ftn nagfor xlf90 f90 pgf90 pghpf epcf90 g77 xlf f77 frt pgf77 cf77 fort77 fl32 af77 +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_ac_ct_FC+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if test -n "$ac_ct_FC"; then + ac_cv_prog_ac_ct_FC="$ac_ct_FC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_FC="$ac_prog" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_FC=$ac_cv_prog_ac_ct_FC +if test -n "$ac_ct_FC"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_FC" >&5 +printf "%s\n" "$ac_ct_FC" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + + test -n "$ac_ct_FC" && break +done + + if test "x$ac_ct_FC" = x; then + FC="" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + FC=$ac_ct_FC + fi +fi + + +# Provide some information about the compiler. +printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for Fortran compiler version" >&5 +set X $ac_compile +ac_compiler=$2 +for ac_option in --version -v -V -qversion; do + { { ac_try="$ac_compiler $ac_option >&5" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +printf "%s\n" "$ac_try_echo"; } >&5 + (eval "$ac_compiler $ac_option >&5") 2>conftest.err + ac_status=$? + if test -s conftest.err; then + sed '10a\ +... rest of stderr output deleted ... + 10q' conftest.err >conftest.er1 + cat conftest.er1 >&5 + fi + rm -f conftest.er1 conftest.err + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } +done +rm -f a.out + +# If we don't use `.F' as extension, the preprocessor is not run on the +# input file. (Note that this only needs to work for GNU compilers.) +ac_save_ext=$ac_ext +ac_ext=F +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether the compiler supports GNU Fortran" >&5 +printf %s "checking whether the compiler supports GNU Fortran... " >&6; } +if test ${ac_cv_fc_compiler_gnu+y} +then : + printf %s "(cached) " >&6 +else $as_nop + cat > conftest.$ac_ext <<_ACEOF + program main +#ifndef __GNUC__ + choke me +#endif + + end +_ACEOF +if ac_fn_fc_try_compile "$LINENO" +then : + ac_compiler_gnu=yes +else $as_nop + ac_compiler_gnu=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +ac_cv_fc_compiler_gnu=$ac_compiler_gnu + +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_fc_compiler_gnu" >&5 +printf "%s\n" "$ac_cv_fc_compiler_gnu" >&6; } +ac_compiler_gnu=$ac_cv_fc_compiler_gnu + +ac_ext=$ac_save_ext +ac_test_FCFLAGS=${FCFLAGS+y} +ac_save_FCFLAGS=$FCFLAGS +FCFLAGS= +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $FC accepts -g" >&5 +printf %s "checking whether $FC accepts -g... " >&6; } +if test ${ac_cv_prog_fc_g+y} +then : + printf %s "(cached) " >&6 +else $as_nop + FCFLAGS=-g +cat > conftest.$ac_ext <<_ACEOF + program main + + end +_ACEOF +if ac_fn_fc_try_compile "$LINENO" +then : + ac_cv_prog_fc_g=yes +else $as_nop + ac_cv_prog_fc_g=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_fc_g" >&5 +printf "%s\n" "$ac_cv_prog_fc_g" >&6; } +if test $ac_test_FCFLAGS; then + FCFLAGS=$ac_save_FCFLAGS +elif test $ac_cv_prog_fc_g = yes; then + if test "x$ac_cv_fc_compiler_gnu" = xyes; then + FCFLAGS="-g -O2" + else + FCFLAGS="-g" + fi +else + if test "x$ac_cv_fc_compiler_gnu" = xyes; then + FCFLAGS="-O2" + else + FCFLAGS= + fi +fi + +if test $ac_compiler_gnu = yes; then + GFC=yes +else + GFC= +fi +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 + + + + amuse_h5_detect_C="no" + + + amuse_h5_result="no" + + if test -n "$CONDA_PREFIX" + then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: Conda environment detected, ignoring HDF5_ROOT, HDF5_DIR and CMAKE_PREFIX_PATH" >&5 +printf "%s\n" "$as_me: Conda environment detected, ignoring HDF5_ROOT, HDF5_DIR and CMAKE_PREFIX_PATH" >&6;} + else + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether HDF5_ROOT points to an HDF5 installation" >&5 +printf %s "checking whether HDF5_ROOT points to an HDF5 installation... " >&6; } + if test -z "$HDF5_ROOT" + then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + elif test -f "$HDF5_ROOT/bin/h5pcc" + then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no, because this seems to be a parallel build" >&5 +printf "%s\n" "no, because this seems to be a parallel build" >&6; } + else + if test -f "$HDF5_ROOT/include/hdf5.h" && test -f "$HDF5_ROOT/lib/libhdf5.so" + then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + amuse_h5_result="yes" + amuse_h5_root="$HDF5_ROOT" + else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + amuse_h5_result="no" + fi + fi + + + if test "$amuse_h5_result" = "no" + then + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether HDF5_DIR points to an HDF5 installation" >&5 +printf %s "checking whether HDF5_DIR points to an HDF5 installation... " >&6; } + if test -z "$HDF5_DIR" + then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + elif test -f "$HDF5_DIR/bin/h5pcc" + then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no, because this seems to be a parallel build" >&5 +printf "%s\n" "no, because this seems to be a parallel build" >&6; } + else + if test -f "$HDF5_DIR/include/hdf5.h" && test -f "$HDF5_DIR/lib/libhdf5.so" + then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + amuse_h5_result="yes" + amuse_h5_root="$HDF5_DIR" + else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + amuse_h5_result="no" + fi + fi + + fi + + if test "$amuse_h5_result" = "no" && test -n "$CMAKE_PREFIX_PATH" + then + amuse_h5_save_IFS="$IFS" + IFS=: + for amuse_h5_path in $CMAKE_PREFIX_PATH + do + # restore IFS immediately as it may mess up the below + IFS="$amuse_h5_save_IFS" + if test -z "$amuse_h5_path" + then + continue + fi + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $amuse_h5_path from CMAKE_PREFIX_PATH points to an HDF5 installation" >&5 +printf %s "checking whether $amuse_h5_path from CMAKE_PREFIX_PATH points to an HDF5 installation... " >&6; } + if test -z "$amuse_h5_path" + then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + elif test -f "$amuse_h5_path/bin/h5pcc" + then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no, because this seems to be a parallel build" >&5 +printf "%s\n" "no, because this seems to be a parallel build" >&6; } + else + if test -f "$amuse_h5_path/include/hdf5.h" && test -f "$amuse_h5_path/lib/libhdf5.so" + then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + amuse_h5_result="yes" + amuse_h5_root="$amuse_h5_path" + else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + amuse_h5_result="no" + fi + fi + + + if test "$amuse_h5_result" = "yes" + then + break + fi + + done + IFS="$amuse_h5_save_IFS" + fi + + if test "$amuse_h5_result" = "yes" + then + + amuse_h5_LDFLAGS="-L$amuse_h5_root/lib" + + 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 + + amuse_h5_CFLAGS="-I$amuse_h5_root/include" + + amuse_h5_name="C" + amuse_h5_prefix="C" + amuse_h5_target="C" + amuse_h5_program="#include +int +main (void) +{ +H5open(); H5close(); + ; + return 0; +}" + amuse_h5_libs="-lhdf5" + + amuse_h5_flags_var="${amuse_h5_prefix}FLAGS" + amuse_h5_flags_source_var="amuse_h5_${amuse_h5_flags_var}" + amuse_h5_flags_target_var="amuse_h5_detect_${amuse_h5_target}" + + eval "amuse_h5_save_FLAGS=\"\$$amuse_h5_flags_var\"" + amuse_h5_save_LDFLAGS="$LDFLAGS" + amuse_h5_save_LIBS="$LIBS" + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether we can build a program with HDF5 in $amuse_h5_name" >&5 +printf %s "checking whether we can build a program with HDF5 in $amuse_h5_name... " >&6; } + + eval "$amuse_h5_flags_var=\"\$$amuse_h5_flags_source_var \$$amuse_h5_flags_var\"" + LDFLAGS="$amuse_h5_LDFLAGS $LDFLAGS" + LIBS="$amuse_h5_libs" + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$amuse_h5_program +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + + eval "$amuse_h5_flags_target_var=\"yes\"" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + +else $as_nop + + eval "$amuse_h5_flags_target_var=\"no\"" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext + + LIBS="$amuse_h5_save_LIBS" + LDFLAGS="$amuse_h5_save_LDFLAGS" + eval "$amuse_h5_flags_var=\"\$amuse_h5_save_FLAGS\"" + + + + amuse_h5_name="C with the high-level API" + amuse_h5_prefix="C" + amuse_h5_target="HL_C" + amuse_h5_program="#include +int +main (void) +{ +H5LTfind_dataset(0, \"test\") + ; + return 0; +}" + amuse_h5_libs="-lhdf5_hl" + + amuse_h5_flags_var="${amuse_h5_prefix}FLAGS" + amuse_h5_flags_source_var="amuse_h5_${amuse_h5_flags_var}" + amuse_h5_flags_target_var="amuse_h5_detect_${amuse_h5_target}" + + eval "amuse_h5_save_FLAGS=\"\$$amuse_h5_flags_var\"" + amuse_h5_save_LDFLAGS="$LDFLAGS" + amuse_h5_save_LIBS="$LIBS" + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether we can build a program with HDF5 in $amuse_h5_name" >&5 +printf %s "checking whether we can build a program with HDF5 in $amuse_h5_name... " >&6; } + + eval "$amuse_h5_flags_var=\"\$$amuse_h5_flags_source_var \$$amuse_h5_flags_var\"" + LDFLAGS="$amuse_h5_LDFLAGS $LDFLAGS" + LIBS="$amuse_h5_libs" + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$amuse_h5_program +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + + eval "$amuse_h5_flags_target_var=\"yes\"" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + +else $as_nop + + eval "$amuse_h5_flags_target_var=\"no\"" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext + + LIBS="$amuse_h5_save_LIBS" + LDFLAGS="$amuse_h5_save_LDFLAGS" + eval "$amuse_h5_flags_var=\"\$amuse_h5_save_FLAGS\"" + + 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 + + + ac_ext=cpp +ac_cpp='$CXXCPP $CPPFLAGS' +ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_cxx_compiler_gnu + + amuse_h5_CXXFLAGS="-I$amuse_h5_root/include" + + amuse_h5_name="C++" + amuse_h5_prefix="CXX" + amuse_h5_target="CXX" + amuse_h5_program="#include +int +main (void) +{ +H5::H5Library::open(); + ; + return 0; +}" + amuse_h5_libs="-lhdf5_cpp" + + amuse_h5_flags_var="${amuse_h5_prefix}FLAGS" + amuse_h5_flags_source_var="amuse_h5_${amuse_h5_flags_var}" + amuse_h5_flags_target_var="amuse_h5_detect_${amuse_h5_target}" + + eval "amuse_h5_save_FLAGS=\"\$$amuse_h5_flags_var\"" + amuse_h5_save_LDFLAGS="$LDFLAGS" + amuse_h5_save_LIBS="$LIBS" + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether we can build a program with HDF5 in $amuse_h5_name" >&5 +printf %s "checking whether we can build a program with HDF5 in $amuse_h5_name... " >&6; } + + eval "$amuse_h5_flags_var=\"\$$amuse_h5_flags_source_var \$$amuse_h5_flags_var\"" + LDFLAGS="$amuse_h5_LDFLAGS $LDFLAGS" + LIBS="$amuse_h5_libs" + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$amuse_h5_program +_ACEOF +if ac_fn_cxx_try_link "$LINENO" +then : + + eval "$amuse_h5_flags_target_var=\"yes\"" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + +else $as_nop + + eval "$amuse_h5_flags_target_var=\"no\"" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext + + LIBS="$amuse_h5_save_LIBS" + LDFLAGS="$amuse_h5_save_LDFLAGS" + eval "$amuse_h5_flags_var=\"\$amuse_h5_save_FLAGS\"" + + 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 + + + amuse_h5_FCFLAGS="-I$amuse_h5_root/include" + + 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 + + + amuse_h5_name="Fortran with mods in /include" + amuse_h5_prefix="FC" + amuse_h5_target="FC" + amuse_h5_program=" program main + + use h5lib + + integer :: error + + call h5open_f(error) + call h5close_f(error) + end" + amuse_h5_libs="-lhdf5_fortran" + + amuse_h5_flags_var="${amuse_h5_prefix}FLAGS" + amuse_h5_flags_source_var="amuse_h5_${amuse_h5_flags_var}" + amuse_h5_flags_target_var="amuse_h5_detect_${amuse_h5_target}" + + eval "amuse_h5_save_FLAGS=\"\$$amuse_h5_flags_var\"" + amuse_h5_save_LDFLAGS="$LDFLAGS" + amuse_h5_save_LIBS="$LIBS" + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether we can build a program with HDF5 in $amuse_h5_name" >&5 +printf %s "checking whether we can build a program with HDF5 in $amuse_h5_name... " >&6; } + + eval "$amuse_h5_flags_var=\"\$$amuse_h5_flags_source_var \$$amuse_h5_flags_var\"" + LDFLAGS="$amuse_h5_LDFLAGS $LDFLAGS" + LIBS="$amuse_h5_libs" + + cat > conftest.$ac_ext <<_ACEOF +$amuse_h5_program +_ACEOF +if ac_fn_fc_try_link "$LINENO" +then : + + eval "$amuse_h5_flags_target_var=\"yes\"" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + +else $as_nop + + eval "$amuse_h5_flags_target_var=\"no\"" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext + + LIBS="$amuse_h5_save_LIBS" + LDFLAGS="$amuse_h5_save_LDFLAGS" + eval "$amuse_h5_flags_var=\"\$amuse_h5_save_FLAGS\"" + + + + amuse_h5_name="Fortran with the high-level API in hdf5_hl_fortran with mods in /include" + amuse_h5_prefix="FC" + amuse_h5_target="HL_FC" + amuse_h5_program=" program main + + use h5lt + + integer :: error + + error = h5ltfind_dataset_f(0_hid_t, 'test') + + end" + amuse_h5_libs="-lhdf5_hl_fortran" + + amuse_h5_flags_var="${amuse_h5_prefix}FLAGS" + amuse_h5_flags_source_var="amuse_h5_${amuse_h5_flags_var}" + amuse_h5_flags_target_var="amuse_h5_detect_${amuse_h5_target}" + + eval "amuse_h5_save_FLAGS=\"\$$amuse_h5_flags_var\"" + amuse_h5_save_LDFLAGS="$LDFLAGS" + amuse_h5_save_LIBS="$LIBS" + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether we can build a program with HDF5 in $amuse_h5_name" >&5 +printf %s "checking whether we can build a program with HDF5 in $amuse_h5_name... " >&6; } + + eval "$amuse_h5_flags_var=\"\$$amuse_h5_flags_source_var \$$amuse_h5_flags_var\"" + LDFLAGS="$amuse_h5_LDFLAGS $LDFLAGS" + LIBS="$amuse_h5_libs" + + cat > conftest.$ac_ext <<_ACEOF +$amuse_h5_program +_ACEOF +if ac_fn_fc_try_link "$LINENO" +then : + + eval "$amuse_h5_flags_target_var=\"yes\"" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + +else $as_nop + + eval "$amuse_h5_flags_target_var=\"no\"" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext + + LIBS="$amuse_h5_save_LIBS" + LDFLAGS="$amuse_h5_save_LDFLAGS" + eval "$amuse_h5_flags_var=\"\$amuse_h5_save_FLAGS\"" + + + if test $amuse_h5_detect_HL_FC = "yes" + then + amuse_h5_HL_FC_LIB="-lhdf5_hl_fortran" + else + + amuse_h5_name="Fortran with the high-level API in hdf5hl_fortran with mods in /include" + amuse_h5_prefix="FC" + amuse_h5_target="HL_FC" + amuse_h5_program=" program main + + use h5lt + + integer :: error + + error = h5ltfind_dataset_f(0_hid_t, 'test') + + end" + amuse_h5_libs="-lhdf5hl_fortran" + + amuse_h5_flags_var="${amuse_h5_prefix}FLAGS" + amuse_h5_flags_source_var="amuse_h5_${amuse_h5_flags_var}" + amuse_h5_flags_target_var="amuse_h5_detect_${amuse_h5_target}" + + eval "amuse_h5_save_FLAGS=\"\$$amuse_h5_flags_var\"" + amuse_h5_save_LDFLAGS="$LDFLAGS" + amuse_h5_save_LIBS="$LIBS" + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether we can build a program with HDF5 in $amuse_h5_name" >&5 +printf %s "checking whether we can build a program with HDF5 in $amuse_h5_name... " >&6; } + + eval "$amuse_h5_flags_var=\"\$$amuse_h5_flags_source_var \$$amuse_h5_flags_var\"" + LDFLAGS="$amuse_h5_LDFLAGS $LDFLAGS" + LIBS="$amuse_h5_libs" + + cat > conftest.$ac_ext <<_ACEOF +$amuse_h5_program +_ACEOF +if ac_fn_fc_try_link "$LINENO" +then : + + eval "$amuse_h5_flags_target_var=\"yes\"" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + +else $as_nop + + eval "$amuse_h5_flags_target_var=\"no\"" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext + + LIBS="$amuse_h5_save_LIBS" + LDFLAGS="$amuse_h5_save_LDFLAGS" + eval "$amuse_h5_flags_var=\"\$amuse_h5_save_FLAGS\"" + + + if test $amuse_h5_detect_HL_FC = "yes" + then + amuse_h5_HL_FC_LIB="-lhdf5hl_fortran" + fi + fi + + 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 + + + + if test $amuse_h5_detect_FC = "no" + then + amuse_h5_FCFLAGS="-I$amuse_h5_root/mod/shared" + + 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 + + + amuse_h5_name="Fortran with mods in /mod/shared" + amuse_h5_prefix="FC" + amuse_h5_target="FC" + amuse_h5_program=" program main + + use h5lib + + integer :: error + + call h5open_f(error) + call h5close_f(error) + end" + amuse_h5_libs="-lhdf5_fortran" + + amuse_h5_flags_var="${amuse_h5_prefix}FLAGS" + amuse_h5_flags_source_var="amuse_h5_${amuse_h5_flags_var}" + amuse_h5_flags_target_var="amuse_h5_detect_${amuse_h5_target}" + + eval "amuse_h5_save_FLAGS=\"\$$amuse_h5_flags_var\"" + amuse_h5_save_LDFLAGS="$LDFLAGS" + amuse_h5_save_LIBS="$LIBS" + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether we can build a program with HDF5 in $amuse_h5_name" >&5 +printf %s "checking whether we can build a program with HDF5 in $amuse_h5_name... " >&6; } + + eval "$amuse_h5_flags_var=\"\$$amuse_h5_flags_source_var \$$amuse_h5_flags_var\"" + LDFLAGS="$amuse_h5_LDFLAGS $LDFLAGS" + LIBS="$amuse_h5_libs" + + cat > conftest.$ac_ext <<_ACEOF +$amuse_h5_program +_ACEOF +if ac_fn_fc_try_link "$LINENO" +then : + + eval "$amuse_h5_flags_target_var=\"yes\"" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + +else $as_nop + + eval "$amuse_h5_flags_target_var=\"no\"" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext + + LIBS="$amuse_h5_save_LIBS" + LDFLAGS="$amuse_h5_save_LDFLAGS" + eval "$amuse_h5_flags_var=\"\$amuse_h5_save_FLAGS\"" + + + + amuse_h5_name="Fortran with the high-level API in hdf5_hl_fortran with mods in /mod/shared" + amuse_h5_prefix="FC" + amuse_h5_target="HL_FC" + amuse_h5_program=" program main + + use h5lt + + integer :: error + + error = h5ltfind_dataset_f(0_hid_t, 'test') + + end" + amuse_h5_libs="-lhdf5_hl_fortran" + + amuse_h5_flags_var="${amuse_h5_prefix}FLAGS" + amuse_h5_flags_source_var="amuse_h5_${amuse_h5_flags_var}" + amuse_h5_flags_target_var="amuse_h5_detect_${amuse_h5_target}" + + eval "amuse_h5_save_FLAGS=\"\$$amuse_h5_flags_var\"" + amuse_h5_save_LDFLAGS="$LDFLAGS" + amuse_h5_save_LIBS="$LIBS" + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether we can build a program with HDF5 in $amuse_h5_name" >&5 +printf %s "checking whether we can build a program with HDF5 in $amuse_h5_name... " >&6; } + + eval "$amuse_h5_flags_var=\"\$$amuse_h5_flags_source_var \$$amuse_h5_flags_var\"" + LDFLAGS="$amuse_h5_LDFLAGS $LDFLAGS" + LIBS="$amuse_h5_libs" + + cat > conftest.$ac_ext <<_ACEOF +$amuse_h5_program +_ACEOF +if ac_fn_fc_try_link "$LINENO" +then : + + eval "$amuse_h5_flags_target_var=\"yes\"" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + +else $as_nop + + eval "$amuse_h5_flags_target_var=\"no\"" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext + + LIBS="$amuse_h5_save_LIBS" + LDFLAGS="$amuse_h5_save_LDFLAGS" + eval "$amuse_h5_flags_var=\"\$amuse_h5_save_FLAGS\"" + + + if test $amuse_h5_detect_HL_FC = "yes" + then + amuse_h5_HL_FC_LIB="-lhdf5_hl_fortran" + else + + amuse_h5_name="Fortran with the high-level API in hdf5hl_fortran with mods in /mod/shared" + amuse_h5_prefix="FC" + amuse_h5_target="HL_FC" + amuse_h5_program=" program main + + use h5lt + + integer :: error + + error = h5ltfind_dataset_f(0_hid_t, 'test') + + end" + amuse_h5_libs="-lhdf5hl_fortran" + + amuse_h5_flags_var="${amuse_h5_prefix}FLAGS" + amuse_h5_flags_source_var="amuse_h5_${amuse_h5_flags_var}" + amuse_h5_flags_target_var="amuse_h5_detect_${amuse_h5_target}" + + eval "amuse_h5_save_FLAGS=\"\$$amuse_h5_flags_var\"" + amuse_h5_save_LDFLAGS="$LDFLAGS" + amuse_h5_save_LIBS="$LIBS" + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether we can build a program with HDF5 in $amuse_h5_name" >&5 +printf %s "checking whether we can build a program with HDF5 in $amuse_h5_name... " >&6; } + + eval "$amuse_h5_flags_var=\"\$$amuse_h5_flags_source_var \$$amuse_h5_flags_var\"" + LDFLAGS="$amuse_h5_LDFLAGS $LDFLAGS" + LIBS="$amuse_h5_libs" + + cat > conftest.$ac_ext <<_ACEOF +$amuse_h5_program +_ACEOF +if ac_fn_fc_try_link "$LINENO" +then : + + eval "$amuse_h5_flags_target_var=\"yes\"" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + +else $as_nop + + eval "$amuse_h5_flags_target_var=\"no\"" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext + + LIBS="$amuse_h5_save_LIBS" + LDFLAGS="$amuse_h5_save_LDFLAGS" + eval "$amuse_h5_flags_var=\"\$amuse_h5_save_FLAGS\"" + + + if test $amuse_h5_detect_HL_FC = "yes" + then + amuse_h5_HL_FC_LIB="-lhdf5hl_fortran" + fi + fi + + 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 test $amuse_h5_detect_FC = "no" + then + amuse_h5_FCFLAGS="" + fi + + fi + fi + + + if test "$amuse_h5_detect_C" = "no" + then + + amuse_h5_LDFLAGS="" + + 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 + + amuse_h5_CFLAGS="" + + amuse_h5_name="C with no additional flags" + amuse_h5_prefix="C" + amuse_h5_target="C" + amuse_h5_program="#include +int +main (void) +{ +H5open(); H5close(); + ; + return 0; +}" + amuse_h5_libs="-lhdf5" + + amuse_h5_flags_var="${amuse_h5_prefix}FLAGS" + amuse_h5_flags_source_var="amuse_h5_${amuse_h5_flags_var}" + amuse_h5_flags_target_var="amuse_h5_detect_${amuse_h5_target}" + + eval "amuse_h5_save_FLAGS=\"\$$amuse_h5_flags_var\"" + amuse_h5_save_LDFLAGS="$LDFLAGS" + amuse_h5_save_LIBS="$LIBS" + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether we can build a program with HDF5 in $amuse_h5_name" >&5 +printf %s "checking whether we can build a program with HDF5 in $amuse_h5_name... " >&6; } + + eval "$amuse_h5_flags_var=\"\$$amuse_h5_flags_source_var \$$amuse_h5_flags_var\"" + LDFLAGS="$amuse_h5_LDFLAGS $LDFLAGS" + LIBS="$amuse_h5_libs" + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$amuse_h5_program +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + + eval "$amuse_h5_flags_target_var=\"yes\"" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + +else $as_nop + + eval "$amuse_h5_flags_target_var=\"no\"" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext + + LIBS="$amuse_h5_save_LIBS" + LDFLAGS="$amuse_h5_save_LDFLAGS" + eval "$amuse_h5_flags_var=\"\$amuse_h5_save_FLAGS\"" + + 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 + + + if test $amuse_h5_detect_C = "yes" + then + 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 + + + amuse_h5_name="C with the high-level API" + amuse_h5_prefix="C" + amuse_h5_target="HL_C" + amuse_h5_program="#include +int +main (void) +{ +H5LTfind_dataset(0, \"test\") + ; + return 0; +}" + amuse_h5_libs="-lhdf5_hl" + + amuse_h5_flags_var="${amuse_h5_prefix}FLAGS" + amuse_h5_flags_source_var="amuse_h5_${amuse_h5_flags_var}" + amuse_h5_flags_target_var="amuse_h5_detect_${amuse_h5_target}" + + eval "amuse_h5_save_FLAGS=\"\$$amuse_h5_flags_var\"" + amuse_h5_save_LDFLAGS="$LDFLAGS" + amuse_h5_save_LIBS="$LIBS" + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether we can build a program with HDF5 in $amuse_h5_name" >&5 +printf %s "checking whether we can build a program with HDF5 in $amuse_h5_name... " >&6; } + + eval "$amuse_h5_flags_var=\"\$$amuse_h5_flags_source_var \$$amuse_h5_flags_var\"" + LDFLAGS="$amuse_h5_LDFLAGS $LDFLAGS" + LIBS="$amuse_h5_libs" + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$amuse_h5_program +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + + eval "$amuse_h5_flags_target_var=\"yes\"" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + +else $as_nop + + eval "$amuse_h5_flags_target_var=\"no\"" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext + + LIBS="$amuse_h5_save_LIBS" + LDFLAGS="$amuse_h5_save_LDFLAGS" + eval "$amuse_h5_flags_var=\"\$amuse_h5_save_FLAGS\"" + + 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 + + + ac_ext=cpp +ac_cpp='$CXXCPP $CPPFLAGS' +ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_cxx_compiler_gnu + + + amuse_h5_name="C++" + amuse_h5_prefix="CXX" + amuse_h5_target="CXX" + amuse_h5_program="#include +int +main (void) +{ +H5::H5Library::open(); + ; + return 0; +}" + amuse_h5_libs="-lhdf5_cpp" + + amuse_h5_flags_var="${amuse_h5_prefix}FLAGS" + amuse_h5_flags_source_var="amuse_h5_${amuse_h5_flags_var}" + amuse_h5_flags_target_var="amuse_h5_detect_${amuse_h5_target}" + + eval "amuse_h5_save_FLAGS=\"\$$amuse_h5_flags_var\"" + amuse_h5_save_LDFLAGS="$LDFLAGS" + amuse_h5_save_LIBS="$LIBS" + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether we can build a program with HDF5 in $amuse_h5_name" >&5 +printf %s "checking whether we can build a program with HDF5 in $amuse_h5_name... " >&6; } + + eval "$amuse_h5_flags_var=\"\$$amuse_h5_flags_source_var \$$amuse_h5_flags_var\"" + LDFLAGS="$amuse_h5_LDFLAGS $LDFLAGS" + LIBS="$amuse_h5_libs" + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$amuse_h5_program +_ACEOF +if ac_fn_cxx_try_link "$LINENO" +then : + + eval "$amuse_h5_flags_target_var=\"yes\"" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + +else $as_nop + + eval "$amuse_h5_flags_target_var=\"no\"" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext + + LIBS="$amuse_h5_save_LIBS" + LDFLAGS="$amuse_h5_save_LDFLAGS" + eval "$amuse_h5_flags_var=\"\$amuse_h5_save_FLAGS\"" + + 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 + + + + 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 + + + amuse_h5_name="Fortran " + amuse_h5_prefix="FC" + amuse_h5_target="FC" + amuse_h5_program=" program main + + use h5lib + + integer :: error + + call h5open_f(error) + call h5close_f(error) + end" + amuse_h5_libs="-lhdf5_fortran" + + amuse_h5_flags_var="${amuse_h5_prefix}FLAGS" + amuse_h5_flags_source_var="amuse_h5_${amuse_h5_flags_var}" + amuse_h5_flags_target_var="amuse_h5_detect_${amuse_h5_target}" + + eval "amuse_h5_save_FLAGS=\"\$$amuse_h5_flags_var\"" + amuse_h5_save_LDFLAGS="$LDFLAGS" + amuse_h5_save_LIBS="$LIBS" + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether we can build a program with HDF5 in $amuse_h5_name" >&5 +printf %s "checking whether we can build a program with HDF5 in $amuse_h5_name... " >&6; } + + eval "$amuse_h5_flags_var=\"\$$amuse_h5_flags_source_var \$$amuse_h5_flags_var\"" + LDFLAGS="$amuse_h5_LDFLAGS $LDFLAGS" + LIBS="$amuse_h5_libs" + + cat > conftest.$ac_ext <<_ACEOF +$amuse_h5_program +_ACEOF +if ac_fn_fc_try_link "$LINENO" +then : + + eval "$amuse_h5_flags_target_var=\"yes\"" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + +else $as_nop + + eval "$amuse_h5_flags_target_var=\"no\"" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext + + LIBS="$amuse_h5_save_LIBS" + LDFLAGS="$amuse_h5_save_LDFLAGS" + eval "$amuse_h5_flags_var=\"\$amuse_h5_save_FLAGS\"" + + + + amuse_h5_name="Fortran with the high-level API in hdf5_hl_fortran " + amuse_h5_prefix="FC" + amuse_h5_target="HL_FC" + amuse_h5_program=" program main + + use h5lt + + integer :: error + + error = h5ltfind_dataset_f(0_hid_t, 'test') + + end" + amuse_h5_libs="-lhdf5_hl_fortran" + + amuse_h5_flags_var="${amuse_h5_prefix}FLAGS" + amuse_h5_flags_source_var="amuse_h5_${amuse_h5_flags_var}" + amuse_h5_flags_target_var="amuse_h5_detect_${amuse_h5_target}" + + eval "amuse_h5_save_FLAGS=\"\$$amuse_h5_flags_var\"" + amuse_h5_save_LDFLAGS="$LDFLAGS" + amuse_h5_save_LIBS="$LIBS" + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether we can build a program with HDF5 in $amuse_h5_name" >&5 +printf %s "checking whether we can build a program with HDF5 in $amuse_h5_name... " >&6; } + + eval "$amuse_h5_flags_var=\"\$$amuse_h5_flags_source_var \$$amuse_h5_flags_var\"" + LDFLAGS="$amuse_h5_LDFLAGS $LDFLAGS" + LIBS="$amuse_h5_libs" + + cat > conftest.$ac_ext <<_ACEOF +$amuse_h5_program +_ACEOF +if ac_fn_fc_try_link "$LINENO" +then : + + eval "$amuse_h5_flags_target_var=\"yes\"" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + +else $as_nop + + eval "$amuse_h5_flags_target_var=\"no\"" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext + + LIBS="$amuse_h5_save_LIBS" + LDFLAGS="$amuse_h5_save_LDFLAGS" + eval "$amuse_h5_flags_var=\"\$amuse_h5_save_FLAGS\"" + + + if test $amuse_h5_detect_HL_FC = "yes" + then + amuse_h5_HL_FC_LIB="-lhdf5_hl_fortran" + else + + amuse_h5_name="Fortran with the high-level API in hdf5hl_fortran " + amuse_h5_prefix="FC" + amuse_h5_target="HL_FC" + amuse_h5_program=" program main + + use h5lt + + integer :: error + + error = h5ltfind_dataset_f(0_hid_t, 'test') + + end" + amuse_h5_libs="-lhdf5hl_fortran" + + amuse_h5_flags_var="${amuse_h5_prefix}FLAGS" + amuse_h5_flags_source_var="amuse_h5_${amuse_h5_flags_var}" + amuse_h5_flags_target_var="amuse_h5_detect_${amuse_h5_target}" + + eval "amuse_h5_save_FLAGS=\"\$$amuse_h5_flags_var\"" + amuse_h5_save_LDFLAGS="$LDFLAGS" + amuse_h5_save_LIBS="$LIBS" + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether we can build a program with HDF5 in $amuse_h5_name" >&5 +printf %s "checking whether we can build a program with HDF5 in $amuse_h5_name... " >&6; } + + eval "$amuse_h5_flags_var=\"\$$amuse_h5_flags_source_var \$$amuse_h5_flags_var\"" + LDFLAGS="$amuse_h5_LDFLAGS $LDFLAGS" + LIBS="$amuse_h5_libs" + + cat > conftest.$ac_ext <<_ACEOF +$amuse_h5_program +_ACEOF +if ac_fn_fc_try_link "$LINENO" +then : + + eval "$amuse_h5_flags_target_var=\"yes\"" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + +else $as_nop + + eval "$amuse_h5_flags_target_var=\"no\"" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext + + LIBS="$amuse_h5_save_LIBS" + LDFLAGS="$amuse_h5_save_LDFLAGS" + eval "$amuse_h5_flags_var=\"\$amuse_h5_save_FLAGS\"" + + + if test $amuse_h5_detect_HL_FC = "yes" + then + amuse_h5_HL_FC_LIB="-lhdf5hl_fortran" + fi + fi + + 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 + + + + if test $amuse_h5_detect_FC = "no" + then + + amuse_h5_result="" + amuse_h5_in_isystem="no" + for flag in $FFLAGS + do + if test "$amuse_h5_in_isystem" = "yes" + then + if ! echo "$amuse_h5_result" | grep -e "$flag" >/dev/null 2>&1 + then + amuse_h5_result="$amuse_h5_result:$flag" + fi + amuse_h5_in_isystem="no" + continue + fi + + if test "$flag" = "-isystem" + then + amuse_h5_in_isystem="yes" + elif test "${flag#-I}" != "$flag" + then + amuse_h5_path="${flag#-I}" + if ! echo "$amuse_h5_result" | grep -e "$amuse_h5_path" >/dev/null 2>&1 + then + amuse_h5_result="$amuse_h5_result:${flag#-I}" + fi + fi + done + + + amuse_h5_save_IFS="$IFS" + IFS=: + for amuse_h5_path in $amuse_h5_result + do + # need to restore IFS immediately as it messes up the below + IFS="$amuse_h5_save_IFS" + if test -z "$amuse_h5_path" + then + continue + fi + + amuse_h5_FCFLAGS="$FCFLAGS -I$amuse_h5_path" + + 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 + + + amuse_h5_name="Fortran with $amuse_h5_path from FFLAGS" + amuse_h5_prefix="FC" + amuse_h5_target="FC" + amuse_h5_program=" program main + + use h5lib + + integer :: error + + call h5open_f(error) + call h5close_f(error) + end" + amuse_h5_libs="-lhdf5_fortran" + + amuse_h5_flags_var="${amuse_h5_prefix}FLAGS" + amuse_h5_flags_source_var="amuse_h5_${amuse_h5_flags_var}" + amuse_h5_flags_target_var="amuse_h5_detect_${amuse_h5_target}" + + eval "amuse_h5_save_FLAGS=\"\$$amuse_h5_flags_var\"" + amuse_h5_save_LDFLAGS="$LDFLAGS" + amuse_h5_save_LIBS="$LIBS" + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether we can build a program with HDF5 in $amuse_h5_name" >&5 +printf %s "checking whether we can build a program with HDF5 in $amuse_h5_name... " >&6; } + + eval "$amuse_h5_flags_var=\"\$$amuse_h5_flags_source_var \$$amuse_h5_flags_var\"" + LDFLAGS="$amuse_h5_LDFLAGS $LDFLAGS" + LIBS="$amuse_h5_libs" + + cat > conftest.$ac_ext <<_ACEOF +$amuse_h5_program +_ACEOF +if ac_fn_fc_try_link "$LINENO" +then : + + eval "$amuse_h5_flags_target_var=\"yes\"" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + +else $as_nop + + eval "$amuse_h5_flags_target_var=\"no\"" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext + + LIBS="$amuse_h5_save_LIBS" + LDFLAGS="$amuse_h5_save_LDFLAGS" + eval "$amuse_h5_flags_var=\"\$amuse_h5_save_FLAGS\"" + + + + amuse_h5_name="Fortran with the high-level API in hdf5_hl_fortran with $amuse_h5_path from FFLAGS" + amuse_h5_prefix="FC" + amuse_h5_target="HL_FC" + amuse_h5_program=" program main + + use h5lt + + integer :: error + + error = h5ltfind_dataset_f(0_hid_t, 'test') + + end" + amuse_h5_libs="-lhdf5_hl_fortran" + + amuse_h5_flags_var="${amuse_h5_prefix}FLAGS" + amuse_h5_flags_source_var="amuse_h5_${amuse_h5_flags_var}" + amuse_h5_flags_target_var="amuse_h5_detect_${amuse_h5_target}" + + eval "amuse_h5_save_FLAGS=\"\$$amuse_h5_flags_var\"" + amuse_h5_save_LDFLAGS="$LDFLAGS" + amuse_h5_save_LIBS="$LIBS" + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether we can build a program with HDF5 in $amuse_h5_name" >&5 +printf %s "checking whether we can build a program with HDF5 in $amuse_h5_name... " >&6; } + + eval "$amuse_h5_flags_var=\"\$$amuse_h5_flags_source_var \$$amuse_h5_flags_var\"" + LDFLAGS="$amuse_h5_LDFLAGS $LDFLAGS" + LIBS="$amuse_h5_libs" + + cat > conftest.$ac_ext <<_ACEOF +$amuse_h5_program +_ACEOF +if ac_fn_fc_try_link "$LINENO" +then : + + eval "$amuse_h5_flags_target_var=\"yes\"" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + +else $as_nop + + eval "$amuse_h5_flags_target_var=\"no\"" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext + + LIBS="$amuse_h5_save_LIBS" + LDFLAGS="$amuse_h5_save_LDFLAGS" + eval "$amuse_h5_flags_var=\"\$amuse_h5_save_FLAGS\"" + + + if test $amuse_h5_detect_HL_FC = "yes" + then + amuse_h5_HL_FC_LIB="-lhdf5_hl_fortran" + else + + amuse_h5_name="Fortran with the high-level API in hdf5hl_fortran with $amuse_h5_path from FFLAGS" + amuse_h5_prefix="FC" + amuse_h5_target="HL_FC" + amuse_h5_program=" program main + + use h5lt + + integer :: error + + error = h5ltfind_dataset_f(0_hid_t, 'test') + + end" + amuse_h5_libs="-lhdf5hl_fortran" + + amuse_h5_flags_var="${amuse_h5_prefix}FLAGS" + amuse_h5_flags_source_var="amuse_h5_${amuse_h5_flags_var}" + amuse_h5_flags_target_var="amuse_h5_detect_${amuse_h5_target}" + + eval "amuse_h5_save_FLAGS=\"\$$amuse_h5_flags_var\"" + amuse_h5_save_LDFLAGS="$LDFLAGS" + amuse_h5_save_LIBS="$LIBS" + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether we can build a program with HDF5 in $amuse_h5_name" >&5 +printf %s "checking whether we can build a program with HDF5 in $amuse_h5_name... " >&6; } + + eval "$amuse_h5_flags_var=\"\$$amuse_h5_flags_source_var \$$amuse_h5_flags_var\"" + LDFLAGS="$amuse_h5_LDFLAGS $LDFLAGS" + LIBS="$amuse_h5_libs" + + cat > conftest.$ac_ext <<_ACEOF +$amuse_h5_program +_ACEOF +if ac_fn_fc_try_link "$LINENO" +then : + + eval "$amuse_h5_flags_target_var=\"yes\"" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + +else $as_nop + + eval "$amuse_h5_flags_target_var=\"no\"" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext + + LIBS="$amuse_h5_save_LIBS" + LDFLAGS="$amuse_h5_save_LDFLAGS" + eval "$amuse_h5_flags_var=\"\$amuse_h5_save_FLAGS\"" + + + if test $amuse_h5_detect_HL_FC = "yes" + then + amuse_h5_HL_FC_LIB="-lhdf5hl_fortran" + fi + fi + + 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 + + + if test "$amuse_h5_detect_FC" = "yes" + then + amuse_h5_FCFLAGS="-I$amuse_h5_path" + break + fi + + # The new Fortran CMake-based build system uses the non-standard and + # not-searched-unless-explicitly-specified /mod/shared subdirectory by + # default + amuse_h5_FCFLAGS="$FCFLAGS -I$amuse_h5_path/../mod/shared" + + 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 + + + amuse_h5_name="Fortran with $amuse_h5_path from FFLAGS and /mod/shared" + amuse_h5_prefix="FC" + amuse_h5_target="FC" + amuse_h5_program=" program main + + use h5lib + + integer :: error + + call h5open_f(error) + call h5close_f(error) + end" + amuse_h5_libs="-lhdf5_fortran" + + amuse_h5_flags_var="${amuse_h5_prefix}FLAGS" + amuse_h5_flags_source_var="amuse_h5_${amuse_h5_flags_var}" + amuse_h5_flags_target_var="amuse_h5_detect_${amuse_h5_target}" + + eval "amuse_h5_save_FLAGS=\"\$$amuse_h5_flags_var\"" + amuse_h5_save_LDFLAGS="$LDFLAGS" + amuse_h5_save_LIBS="$LIBS" + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether we can build a program with HDF5 in $amuse_h5_name" >&5 +printf %s "checking whether we can build a program with HDF5 in $amuse_h5_name... " >&6; } + + eval "$amuse_h5_flags_var=\"\$$amuse_h5_flags_source_var \$$amuse_h5_flags_var\"" + LDFLAGS="$amuse_h5_LDFLAGS $LDFLAGS" + LIBS="$amuse_h5_libs" + + cat > conftest.$ac_ext <<_ACEOF +$amuse_h5_program +_ACEOF +if ac_fn_fc_try_link "$LINENO" +then : + + eval "$amuse_h5_flags_target_var=\"yes\"" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + +else $as_nop + + eval "$amuse_h5_flags_target_var=\"no\"" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext + + LIBS="$amuse_h5_save_LIBS" + LDFLAGS="$amuse_h5_save_LDFLAGS" + eval "$amuse_h5_flags_var=\"\$amuse_h5_save_FLAGS\"" + + + + amuse_h5_name="Fortran with the high-level API in hdf5_hl_fortran with $amuse_h5_path from FFLAGS and /mod/shared" + amuse_h5_prefix="FC" + amuse_h5_target="HL_FC" + amuse_h5_program=" program main + + use h5lt + + integer :: error + + error = h5ltfind_dataset_f(0_hid_t, 'test') + + end" + amuse_h5_libs="-lhdf5_hl_fortran" + + amuse_h5_flags_var="${amuse_h5_prefix}FLAGS" + amuse_h5_flags_source_var="amuse_h5_${amuse_h5_flags_var}" + amuse_h5_flags_target_var="amuse_h5_detect_${amuse_h5_target}" + + eval "amuse_h5_save_FLAGS=\"\$$amuse_h5_flags_var\"" + amuse_h5_save_LDFLAGS="$LDFLAGS" + amuse_h5_save_LIBS="$LIBS" + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether we can build a program with HDF5 in $amuse_h5_name" >&5 +printf %s "checking whether we can build a program with HDF5 in $amuse_h5_name... " >&6; } + + eval "$amuse_h5_flags_var=\"\$$amuse_h5_flags_source_var \$$amuse_h5_flags_var\"" + LDFLAGS="$amuse_h5_LDFLAGS $LDFLAGS" + LIBS="$amuse_h5_libs" + + cat > conftest.$ac_ext <<_ACEOF +$amuse_h5_program +_ACEOF +if ac_fn_fc_try_link "$LINENO" +then : + + eval "$amuse_h5_flags_target_var=\"yes\"" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + +else $as_nop + + eval "$amuse_h5_flags_target_var=\"no\"" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext + + LIBS="$amuse_h5_save_LIBS" + LDFLAGS="$amuse_h5_save_LDFLAGS" + eval "$amuse_h5_flags_var=\"\$amuse_h5_save_FLAGS\"" + + + if test $amuse_h5_detect_HL_FC = "yes" + then + amuse_h5_HL_FC_LIB="-lhdf5_hl_fortran" + else + + amuse_h5_name="Fortran with the high-level API in hdf5hl_fortran with $amuse_h5_path from FFLAGS and /mod/shared" + amuse_h5_prefix="FC" + amuse_h5_target="HL_FC" + amuse_h5_program=" program main + + use h5lt + + integer :: error + + error = h5ltfind_dataset_f(0_hid_t, 'test') + + end" + amuse_h5_libs="-lhdf5hl_fortran" + + amuse_h5_flags_var="${amuse_h5_prefix}FLAGS" + amuse_h5_flags_source_var="amuse_h5_${amuse_h5_flags_var}" + amuse_h5_flags_target_var="amuse_h5_detect_${amuse_h5_target}" + + eval "amuse_h5_save_FLAGS=\"\$$amuse_h5_flags_var\"" + amuse_h5_save_LDFLAGS="$LDFLAGS" + amuse_h5_save_LIBS="$LIBS" + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether we can build a program with HDF5 in $amuse_h5_name" >&5 +printf %s "checking whether we can build a program with HDF5 in $amuse_h5_name... " >&6; } + + eval "$amuse_h5_flags_var=\"\$$amuse_h5_flags_source_var \$$amuse_h5_flags_var\"" + LDFLAGS="$amuse_h5_LDFLAGS $LDFLAGS" + LIBS="$amuse_h5_libs" + + cat > conftest.$ac_ext <<_ACEOF +$amuse_h5_program +_ACEOF +if ac_fn_fc_try_link "$LINENO" +then : + + eval "$amuse_h5_flags_target_var=\"yes\"" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + +else $as_nop + + eval "$amuse_h5_flags_target_var=\"no\"" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext + + LIBS="$amuse_h5_save_LIBS" + LDFLAGS="$amuse_h5_save_LDFLAGS" + eval "$amuse_h5_flags_var=\"\$amuse_h5_save_FLAGS\"" + + + if test $amuse_h5_detect_HL_FC = "yes" + then + amuse_h5_HL_FC_LIB="-lhdf5hl_fortran" + fi + fi + + 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 + + + if test "$amuse_h5_detect_FC" = "yes" + then + amuse_h5_FCFLAGS="-I$amuse_h5_path/../mod/shared" + break + fi + + if test "$amuse_h5_detect_FC" = "no" + then + amuse_h5_FCFLAGS="" + fi + done + IFS="$amuse_h5_save_IFS" + + fi + + if test $amuse_h5_detect_FC = "no" + then + + amuse_h5_result="" + amuse_h5_in_isystem="no" + for flag in $CFLAGS + do + if test "$amuse_h5_in_isystem" = "yes" + then + if ! echo "$amuse_h5_result" | grep -e "$flag" >/dev/null 2>&1 + then + amuse_h5_result="$amuse_h5_result:$flag" + fi + amuse_h5_in_isystem="no" + continue + fi + + if test "$flag" = "-isystem" + then + amuse_h5_in_isystem="yes" + elif test "${flag#-I}" != "$flag" + then + amuse_h5_path="${flag#-I}" + if ! echo "$amuse_h5_result" | grep -e "$amuse_h5_path" >/dev/null 2>&1 + then + amuse_h5_result="$amuse_h5_result:${flag#-I}" + fi + fi + done + + + amuse_h5_save_IFS="$IFS" + IFS=: + for amuse_h5_path in $amuse_h5_result + do + # need to restore IFS immediately as it messes up the below + IFS="$amuse_h5_save_IFS" + if test -z "$amuse_h5_path" + then + continue + fi + + amuse_h5_FCFLAGS="$FCFLAGS -I$amuse_h5_path" + + 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 + + + amuse_h5_name="Fortran with $amuse_h5_path from CFLAGS" + amuse_h5_prefix="FC" + amuse_h5_target="FC" + amuse_h5_program=" program main + + use h5lib + + integer :: error + + call h5open_f(error) + call h5close_f(error) + end" + amuse_h5_libs="-lhdf5_fortran" + + amuse_h5_flags_var="${amuse_h5_prefix}FLAGS" + amuse_h5_flags_source_var="amuse_h5_${amuse_h5_flags_var}" + amuse_h5_flags_target_var="amuse_h5_detect_${amuse_h5_target}" + + eval "amuse_h5_save_FLAGS=\"\$$amuse_h5_flags_var\"" + amuse_h5_save_LDFLAGS="$LDFLAGS" + amuse_h5_save_LIBS="$LIBS" + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether we can build a program with HDF5 in $amuse_h5_name" >&5 +printf %s "checking whether we can build a program with HDF5 in $amuse_h5_name... " >&6; } + + eval "$amuse_h5_flags_var=\"\$$amuse_h5_flags_source_var \$$amuse_h5_flags_var\"" + LDFLAGS="$amuse_h5_LDFLAGS $LDFLAGS" + LIBS="$amuse_h5_libs" + + cat > conftest.$ac_ext <<_ACEOF +$amuse_h5_program +_ACEOF +if ac_fn_fc_try_link "$LINENO" +then : + + eval "$amuse_h5_flags_target_var=\"yes\"" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + +else $as_nop + + eval "$amuse_h5_flags_target_var=\"no\"" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext + + LIBS="$amuse_h5_save_LIBS" + LDFLAGS="$amuse_h5_save_LDFLAGS" + eval "$amuse_h5_flags_var=\"\$amuse_h5_save_FLAGS\"" + + + + amuse_h5_name="Fortran with the high-level API in hdf5_hl_fortran with $amuse_h5_path from CFLAGS" + amuse_h5_prefix="FC" + amuse_h5_target="HL_FC" + amuse_h5_program=" program main + + use h5lt + + integer :: error + + error = h5ltfind_dataset_f(0_hid_t, 'test') + + end" + amuse_h5_libs="-lhdf5_hl_fortran" + + amuse_h5_flags_var="${amuse_h5_prefix}FLAGS" + amuse_h5_flags_source_var="amuse_h5_${amuse_h5_flags_var}" + amuse_h5_flags_target_var="amuse_h5_detect_${amuse_h5_target}" + + eval "amuse_h5_save_FLAGS=\"\$$amuse_h5_flags_var\"" + amuse_h5_save_LDFLAGS="$LDFLAGS" + amuse_h5_save_LIBS="$LIBS" + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether we can build a program with HDF5 in $amuse_h5_name" >&5 +printf %s "checking whether we can build a program with HDF5 in $amuse_h5_name... " >&6; } + + eval "$amuse_h5_flags_var=\"\$$amuse_h5_flags_source_var \$$amuse_h5_flags_var\"" + LDFLAGS="$amuse_h5_LDFLAGS $LDFLAGS" + LIBS="$amuse_h5_libs" + + cat > conftest.$ac_ext <<_ACEOF +$amuse_h5_program +_ACEOF +if ac_fn_fc_try_link "$LINENO" +then : + + eval "$amuse_h5_flags_target_var=\"yes\"" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + +else $as_nop + + eval "$amuse_h5_flags_target_var=\"no\"" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext + + LIBS="$amuse_h5_save_LIBS" + LDFLAGS="$amuse_h5_save_LDFLAGS" + eval "$amuse_h5_flags_var=\"\$amuse_h5_save_FLAGS\"" + + + if test $amuse_h5_detect_HL_FC = "yes" + then + amuse_h5_HL_FC_LIB="-lhdf5_hl_fortran" + else + + amuse_h5_name="Fortran with the high-level API in hdf5hl_fortran with $amuse_h5_path from CFLAGS" + amuse_h5_prefix="FC" + amuse_h5_target="HL_FC" + amuse_h5_program=" program main + + use h5lt + + integer :: error + + error = h5ltfind_dataset_f(0_hid_t, 'test') + + end" + amuse_h5_libs="-lhdf5hl_fortran" + + amuse_h5_flags_var="${amuse_h5_prefix}FLAGS" + amuse_h5_flags_source_var="amuse_h5_${amuse_h5_flags_var}" + amuse_h5_flags_target_var="amuse_h5_detect_${amuse_h5_target}" + + eval "amuse_h5_save_FLAGS=\"\$$amuse_h5_flags_var\"" + amuse_h5_save_LDFLAGS="$LDFLAGS" + amuse_h5_save_LIBS="$LIBS" + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether we can build a program with HDF5 in $amuse_h5_name" >&5 +printf %s "checking whether we can build a program with HDF5 in $amuse_h5_name... " >&6; } + + eval "$amuse_h5_flags_var=\"\$$amuse_h5_flags_source_var \$$amuse_h5_flags_var\"" + LDFLAGS="$amuse_h5_LDFLAGS $LDFLAGS" + LIBS="$amuse_h5_libs" + + cat > conftest.$ac_ext <<_ACEOF +$amuse_h5_program +_ACEOF +if ac_fn_fc_try_link "$LINENO" +then : + + eval "$amuse_h5_flags_target_var=\"yes\"" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + +else $as_nop + + eval "$amuse_h5_flags_target_var=\"no\"" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext + + LIBS="$amuse_h5_save_LIBS" + LDFLAGS="$amuse_h5_save_LDFLAGS" + eval "$amuse_h5_flags_var=\"\$amuse_h5_save_FLAGS\"" + + + if test $amuse_h5_detect_HL_FC = "yes" + then + amuse_h5_HL_FC_LIB="-lhdf5hl_fortran" + fi + fi + + 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 + + + if test "$amuse_h5_detect_FC" = "yes" + then + amuse_h5_FCFLAGS="-I$amuse_h5_path" + break + fi + + # The new Fortran CMake-based build system uses the non-standard and + # not-searched-unless-explicitly-specified /mod/shared subdirectory by + # default + amuse_h5_FCFLAGS="$FCFLAGS -I$amuse_h5_path/../mod/shared" + + 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 + + + amuse_h5_name="Fortran with $amuse_h5_path from CFLAGS and /mod/shared" + amuse_h5_prefix="FC" + amuse_h5_target="FC" + amuse_h5_program=" program main + + use h5lib + + integer :: error + + call h5open_f(error) + call h5close_f(error) + end" + amuse_h5_libs="-lhdf5_fortran" + + amuse_h5_flags_var="${amuse_h5_prefix}FLAGS" + amuse_h5_flags_source_var="amuse_h5_${amuse_h5_flags_var}" + amuse_h5_flags_target_var="amuse_h5_detect_${amuse_h5_target}" + + eval "amuse_h5_save_FLAGS=\"\$$amuse_h5_flags_var\"" + amuse_h5_save_LDFLAGS="$LDFLAGS" + amuse_h5_save_LIBS="$LIBS" + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether we can build a program with HDF5 in $amuse_h5_name" >&5 +printf %s "checking whether we can build a program with HDF5 in $amuse_h5_name... " >&6; } + + eval "$amuse_h5_flags_var=\"\$$amuse_h5_flags_source_var \$$amuse_h5_flags_var\"" + LDFLAGS="$amuse_h5_LDFLAGS $LDFLAGS" + LIBS="$amuse_h5_libs" + + cat > conftest.$ac_ext <<_ACEOF +$amuse_h5_program +_ACEOF +if ac_fn_fc_try_link "$LINENO" +then : + + eval "$amuse_h5_flags_target_var=\"yes\"" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + +else $as_nop + + eval "$amuse_h5_flags_target_var=\"no\"" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext + + LIBS="$amuse_h5_save_LIBS" + LDFLAGS="$amuse_h5_save_LDFLAGS" + eval "$amuse_h5_flags_var=\"\$amuse_h5_save_FLAGS\"" + + + + amuse_h5_name="Fortran with the high-level API in hdf5_hl_fortran with $amuse_h5_path from CFLAGS and /mod/shared" + amuse_h5_prefix="FC" + amuse_h5_target="HL_FC" + amuse_h5_program=" program main + + use h5lt + + integer :: error + + error = h5ltfind_dataset_f(0_hid_t, 'test') + + end" + amuse_h5_libs="-lhdf5_hl_fortran" + + amuse_h5_flags_var="${amuse_h5_prefix}FLAGS" + amuse_h5_flags_source_var="amuse_h5_${amuse_h5_flags_var}" + amuse_h5_flags_target_var="amuse_h5_detect_${amuse_h5_target}" + + eval "amuse_h5_save_FLAGS=\"\$$amuse_h5_flags_var\"" + amuse_h5_save_LDFLAGS="$LDFLAGS" + amuse_h5_save_LIBS="$LIBS" + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether we can build a program with HDF5 in $amuse_h5_name" >&5 +printf %s "checking whether we can build a program with HDF5 in $amuse_h5_name... " >&6; } + + eval "$amuse_h5_flags_var=\"\$$amuse_h5_flags_source_var \$$amuse_h5_flags_var\"" + LDFLAGS="$amuse_h5_LDFLAGS $LDFLAGS" + LIBS="$amuse_h5_libs" + + cat > conftest.$ac_ext <<_ACEOF +$amuse_h5_program +_ACEOF +if ac_fn_fc_try_link "$LINENO" +then : + + eval "$amuse_h5_flags_target_var=\"yes\"" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + +else $as_nop + + eval "$amuse_h5_flags_target_var=\"no\"" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext + + LIBS="$amuse_h5_save_LIBS" + LDFLAGS="$amuse_h5_save_LDFLAGS" + eval "$amuse_h5_flags_var=\"\$amuse_h5_save_FLAGS\"" + + + if test $amuse_h5_detect_HL_FC = "yes" + then + amuse_h5_HL_FC_LIB="-lhdf5_hl_fortran" + else + + amuse_h5_name="Fortran with the high-level API in hdf5hl_fortran with $amuse_h5_path from CFLAGS and /mod/shared" + amuse_h5_prefix="FC" + amuse_h5_target="HL_FC" + amuse_h5_program=" program main + + use h5lt + + integer :: error + + error = h5ltfind_dataset_f(0_hid_t, 'test') + + end" + amuse_h5_libs="-lhdf5hl_fortran" + + amuse_h5_flags_var="${amuse_h5_prefix}FLAGS" + amuse_h5_flags_source_var="amuse_h5_${amuse_h5_flags_var}" + amuse_h5_flags_target_var="amuse_h5_detect_${amuse_h5_target}" + + eval "amuse_h5_save_FLAGS=\"\$$amuse_h5_flags_var\"" + amuse_h5_save_LDFLAGS="$LDFLAGS" + amuse_h5_save_LIBS="$LIBS" + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether we can build a program with HDF5 in $amuse_h5_name" >&5 +printf %s "checking whether we can build a program with HDF5 in $amuse_h5_name... " >&6; } + + eval "$amuse_h5_flags_var=\"\$$amuse_h5_flags_source_var \$$amuse_h5_flags_var\"" + LDFLAGS="$amuse_h5_LDFLAGS $LDFLAGS" + LIBS="$amuse_h5_libs" + + cat > conftest.$ac_ext <<_ACEOF +$amuse_h5_program +_ACEOF +if ac_fn_fc_try_link "$LINENO" +then : + + eval "$amuse_h5_flags_target_var=\"yes\"" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + +else $as_nop + + eval "$amuse_h5_flags_target_var=\"no\"" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext + + LIBS="$amuse_h5_save_LIBS" + LDFLAGS="$amuse_h5_save_LDFLAGS" + eval "$amuse_h5_flags_var=\"\$amuse_h5_save_FLAGS\"" + + + if test $amuse_h5_detect_HL_FC = "yes" + then + amuse_h5_HL_FC_LIB="-lhdf5hl_fortran" + fi + fi + + 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 + + + if test "$amuse_h5_detect_FC" = "yes" + then + amuse_h5_FCFLAGS="-I$amuse_h5_path/../mod/shared" + break + fi + + if test "$amuse_h5_detect_FC" = "no" + then + amuse_h5_FCFLAGS="" + fi + done + IFS="$amuse_h5_save_IFS" + + fi + + if test $amuse_h5_detect_FC = "no" + then + + amuse_h5_save_IFS="$IFS" + IFS=: + for amuse_h5_path in $CPATH + do + # need to restore IFS immediately as it messes up the below + IFS="$amuse_h5_save_IFS" + if test -z "$amuse_h5_path" + then + continue + fi + + amuse_h5_FCFLAGS="$FCFLAGS -I$amuse_h5_path" + + 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 + + + amuse_h5_name="Fortran with $amuse_h5_path from CPATH" + amuse_h5_prefix="FC" + amuse_h5_target="FC" + amuse_h5_program=" program main + + use h5lib + + integer :: error + + call h5open_f(error) + call h5close_f(error) + end" + amuse_h5_libs="-lhdf5_fortran" + + amuse_h5_flags_var="${amuse_h5_prefix}FLAGS" + amuse_h5_flags_source_var="amuse_h5_${amuse_h5_flags_var}" + amuse_h5_flags_target_var="amuse_h5_detect_${amuse_h5_target}" + + eval "amuse_h5_save_FLAGS=\"\$$amuse_h5_flags_var\"" + amuse_h5_save_LDFLAGS="$LDFLAGS" + amuse_h5_save_LIBS="$LIBS" + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether we can build a program with HDF5 in $amuse_h5_name" >&5 +printf %s "checking whether we can build a program with HDF5 in $amuse_h5_name... " >&6; } + + eval "$amuse_h5_flags_var=\"\$$amuse_h5_flags_source_var \$$amuse_h5_flags_var\"" + LDFLAGS="$amuse_h5_LDFLAGS $LDFLAGS" + LIBS="$amuse_h5_libs" + + cat > conftest.$ac_ext <<_ACEOF +$amuse_h5_program +_ACEOF +if ac_fn_fc_try_link "$LINENO" +then : + + eval "$amuse_h5_flags_target_var=\"yes\"" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + +else $as_nop + + eval "$amuse_h5_flags_target_var=\"no\"" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext + + LIBS="$amuse_h5_save_LIBS" + LDFLAGS="$amuse_h5_save_LDFLAGS" + eval "$amuse_h5_flags_var=\"\$amuse_h5_save_FLAGS\"" + + + + amuse_h5_name="Fortran with the high-level API in hdf5_hl_fortran with $amuse_h5_path from CPATH" + amuse_h5_prefix="FC" + amuse_h5_target="HL_FC" + amuse_h5_program=" program main + + use h5lt + + integer :: error + + error = h5ltfind_dataset_f(0_hid_t, 'test') + + end" + amuse_h5_libs="-lhdf5_hl_fortran" + + amuse_h5_flags_var="${amuse_h5_prefix}FLAGS" + amuse_h5_flags_source_var="amuse_h5_${amuse_h5_flags_var}" + amuse_h5_flags_target_var="amuse_h5_detect_${amuse_h5_target}" + + eval "amuse_h5_save_FLAGS=\"\$$amuse_h5_flags_var\"" + amuse_h5_save_LDFLAGS="$LDFLAGS" + amuse_h5_save_LIBS="$LIBS" + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether we can build a program with HDF5 in $amuse_h5_name" >&5 +printf %s "checking whether we can build a program with HDF5 in $amuse_h5_name... " >&6; } + + eval "$amuse_h5_flags_var=\"\$$amuse_h5_flags_source_var \$$amuse_h5_flags_var\"" + LDFLAGS="$amuse_h5_LDFLAGS $LDFLAGS" + LIBS="$amuse_h5_libs" + + cat > conftest.$ac_ext <<_ACEOF +$amuse_h5_program +_ACEOF +if ac_fn_fc_try_link "$LINENO" +then : + + eval "$amuse_h5_flags_target_var=\"yes\"" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + +else $as_nop + + eval "$amuse_h5_flags_target_var=\"no\"" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext + + LIBS="$amuse_h5_save_LIBS" + LDFLAGS="$amuse_h5_save_LDFLAGS" + eval "$amuse_h5_flags_var=\"\$amuse_h5_save_FLAGS\"" + + + if test $amuse_h5_detect_HL_FC = "yes" + then + amuse_h5_HL_FC_LIB="-lhdf5_hl_fortran" + else + + amuse_h5_name="Fortran with the high-level API in hdf5hl_fortran with $amuse_h5_path from CPATH" + amuse_h5_prefix="FC" + amuse_h5_target="HL_FC" + amuse_h5_program=" program main + + use h5lt + + integer :: error + + error = h5ltfind_dataset_f(0_hid_t, 'test') + + end" + amuse_h5_libs="-lhdf5hl_fortran" + + amuse_h5_flags_var="${amuse_h5_prefix}FLAGS" + amuse_h5_flags_source_var="amuse_h5_${amuse_h5_flags_var}" + amuse_h5_flags_target_var="amuse_h5_detect_${amuse_h5_target}" + + eval "amuse_h5_save_FLAGS=\"\$$amuse_h5_flags_var\"" + amuse_h5_save_LDFLAGS="$LDFLAGS" + amuse_h5_save_LIBS="$LIBS" + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether we can build a program with HDF5 in $amuse_h5_name" >&5 +printf %s "checking whether we can build a program with HDF5 in $amuse_h5_name... " >&6; } + + eval "$amuse_h5_flags_var=\"\$$amuse_h5_flags_source_var \$$amuse_h5_flags_var\"" + LDFLAGS="$amuse_h5_LDFLAGS $LDFLAGS" + LIBS="$amuse_h5_libs" + + cat > conftest.$ac_ext <<_ACEOF +$amuse_h5_program +_ACEOF +if ac_fn_fc_try_link "$LINENO" +then : + + eval "$amuse_h5_flags_target_var=\"yes\"" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + +else $as_nop + + eval "$amuse_h5_flags_target_var=\"no\"" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext + + LIBS="$amuse_h5_save_LIBS" + LDFLAGS="$amuse_h5_save_LDFLAGS" + eval "$amuse_h5_flags_var=\"\$amuse_h5_save_FLAGS\"" + + + if test $amuse_h5_detect_HL_FC = "yes" + then + amuse_h5_HL_FC_LIB="-lhdf5hl_fortran" + fi + fi + + 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 + + + if test "$amuse_h5_detect_FC" = "yes" + then + amuse_h5_FCFLAGS="-I$amuse_h5_path" + break + fi + + # The new Fortran CMake-based build system uses the non-standard and + # not-searched-unless-explicitly-specified /mod/shared subdirectory by + # default + amuse_h5_FCFLAGS="$FCFLAGS -I$amuse_h5_path/../mod/shared" + + 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 + + + amuse_h5_name="Fortran with $amuse_h5_path from CPATH and /mod/shared" + amuse_h5_prefix="FC" + amuse_h5_target="FC" + amuse_h5_program=" program main + + use h5lib + + integer :: error + + call h5open_f(error) + call h5close_f(error) + end" + amuse_h5_libs="-lhdf5_fortran" + + amuse_h5_flags_var="${amuse_h5_prefix}FLAGS" + amuse_h5_flags_source_var="amuse_h5_${amuse_h5_flags_var}" + amuse_h5_flags_target_var="amuse_h5_detect_${amuse_h5_target}" + + eval "amuse_h5_save_FLAGS=\"\$$amuse_h5_flags_var\"" + amuse_h5_save_LDFLAGS="$LDFLAGS" + amuse_h5_save_LIBS="$LIBS" + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether we can build a program with HDF5 in $amuse_h5_name" >&5 +printf %s "checking whether we can build a program with HDF5 in $amuse_h5_name... " >&6; } + + eval "$amuse_h5_flags_var=\"\$$amuse_h5_flags_source_var \$$amuse_h5_flags_var\"" + LDFLAGS="$amuse_h5_LDFLAGS $LDFLAGS" + LIBS="$amuse_h5_libs" + + cat > conftest.$ac_ext <<_ACEOF +$amuse_h5_program +_ACEOF +if ac_fn_fc_try_link "$LINENO" +then : + + eval "$amuse_h5_flags_target_var=\"yes\"" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + +else $as_nop + + eval "$amuse_h5_flags_target_var=\"no\"" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext + + LIBS="$amuse_h5_save_LIBS" + LDFLAGS="$amuse_h5_save_LDFLAGS" + eval "$amuse_h5_flags_var=\"\$amuse_h5_save_FLAGS\"" + + + + amuse_h5_name="Fortran with the high-level API in hdf5_hl_fortran with $amuse_h5_path from CPATH and /mod/shared" + amuse_h5_prefix="FC" + amuse_h5_target="HL_FC" + amuse_h5_program=" program main + + use h5lt + + integer :: error + + error = h5ltfind_dataset_f(0_hid_t, 'test') + + end" + amuse_h5_libs="-lhdf5_hl_fortran" + + amuse_h5_flags_var="${amuse_h5_prefix}FLAGS" + amuse_h5_flags_source_var="amuse_h5_${amuse_h5_flags_var}" + amuse_h5_flags_target_var="amuse_h5_detect_${amuse_h5_target}" + + eval "amuse_h5_save_FLAGS=\"\$$amuse_h5_flags_var\"" + amuse_h5_save_LDFLAGS="$LDFLAGS" + amuse_h5_save_LIBS="$LIBS" + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether we can build a program with HDF5 in $amuse_h5_name" >&5 +printf %s "checking whether we can build a program with HDF5 in $amuse_h5_name... " >&6; } + + eval "$amuse_h5_flags_var=\"\$$amuse_h5_flags_source_var \$$amuse_h5_flags_var\"" + LDFLAGS="$amuse_h5_LDFLAGS $LDFLAGS" + LIBS="$amuse_h5_libs" + + cat > conftest.$ac_ext <<_ACEOF +$amuse_h5_program +_ACEOF +if ac_fn_fc_try_link "$LINENO" +then : + + eval "$amuse_h5_flags_target_var=\"yes\"" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + +else $as_nop + + eval "$amuse_h5_flags_target_var=\"no\"" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext + + LIBS="$amuse_h5_save_LIBS" + LDFLAGS="$amuse_h5_save_LDFLAGS" + eval "$amuse_h5_flags_var=\"\$amuse_h5_save_FLAGS\"" + + + if test $amuse_h5_detect_HL_FC = "yes" + then + amuse_h5_HL_FC_LIB="-lhdf5_hl_fortran" + else + + amuse_h5_name="Fortran with the high-level API in hdf5hl_fortran with $amuse_h5_path from CPATH and /mod/shared" + amuse_h5_prefix="FC" + amuse_h5_target="HL_FC" + amuse_h5_program=" program main + + use h5lt + + integer :: error + + error = h5ltfind_dataset_f(0_hid_t, 'test') + + end" + amuse_h5_libs="-lhdf5hl_fortran" + + amuse_h5_flags_var="${amuse_h5_prefix}FLAGS" + amuse_h5_flags_source_var="amuse_h5_${amuse_h5_flags_var}" + amuse_h5_flags_target_var="amuse_h5_detect_${amuse_h5_target}" + + eval "amuse_h5_save_FLAGS=\"\$$amuse_h5_flags_var\"" + amuse_h5_save_LDFLAGS="$LDFLAGS" + amuse_h5_save_LIBS="$LIBS" + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether we can build a program with HDF5 in $amuse_h5_name" >&5 +printf %s "checking whether we can build a program with HDF5 in $amuse_h5_name... " >&6; } + + eval "$amuse_h5_flags_var=\"\$$amuse_h5_flags_source_var \$$amuse_h5_flags_var\"" + LDFLAGS="$amuse_h5_LDFLAGS $LDFLAGS" + LIBS="$amuse_h5_libs" + + cat > conftest.$ac_ext <<_ACEOF +$amuse_h5_program +_ACEOF +if ac_fn_fc_try_link "$LINENO" +then : + + eval "$amuse_h5_flags_target_var=\"yes\"" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + +else $as_nop + + eval "$amuse_h5_flags_target_var=\"no\"" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext + + LIBS="$amuse_h5_save_LIBS" + LDFLAGS="$amuse_h5_save_LDFLAGS" + eval "$amuse_h5_flags_var=\"\$amuse_h5_save_FLAGS\"" + + + if test $amuse_h5_detect_HL_FC = "yes" + then + amuse_h5_HL_FC_LIB="-lhdf5hl_fortran" + fi + fi + + 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 + + + if test "$amuse_h5_detect_FC" = "yes" + then + amuse_h5_FCFLAGS="-I$amuse_h5_path/../mod/shared" + break + fi + + if test "$amuse_h5_detect_FC" = "no" + then + amuse_h5_FCFLAGS="" + fi + done + IFS="$amuse_h5_save_IFS" + + fi + + if test $amuse_h5_detect_FC = "no" + then + + amuse_h5_save_IFS="$IFS" + IFS=: + for amuse_h5_path in $C_INCLUDE_PATH + do + # need to restore IFS immediately as it messes up the below + IFS="$amuse_h5_save_IFS" + if test -z "$amuse_h5_path" + then + continue + fi + + amuse_h5_FCFLAGS="$FCFLAGS -I$amuse_h5_path" + + 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 + + + amuse_h5_name="Fortran with $amuse_h5_path from C_INCLUDE_PATH" + amuse_h5_prefix="FC" + amuse_h5_target="FC" + amuse_h5_program=" program main + + use h5lib + + integer :: error + + call h5open_f(error) + call h5close_f(error) + end" + amuse_h5_libs="-lhdf5_fortran" + + amuse_h5_flags_var="${amuse_h5_prefix}FLAGS" + amuse_h5_flags_source_var="amuse_h5_${amuse_h5_flags_var}" + amuse_h5_flags_target_var="amuse_h5_detect_${amuse_h5_target}" + + eval "amuse_h5_save_FLAGS=\"\$$amuse_h5_flags_var\"" + amuse_h5_save_LDFLAGS="$LDFLAGS" + amuse_h5_save_LIBS="$LIBS" + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether we can build a program with HDF5 in $amuse_h5_name" >&5 +printf %s "checking whether we can build a program with HDF5 in $amuse_h5_name... " >&6; } + + eval "$amuse_h5_flags_var=\"\$$amuse_h5_flags_source_var \$$amuse_h5_flags_var\"" + LDFLAGS="$amuse_h5_LDFLAGS $LDFLAGS" + LIBS="$amuse_h5_libs" + + cat > conftest.$ac_ext <<_ACEOF +$amuse_h5_program +_ACEOF +if ac_fn_fc_try_link "$LINENO" +then : + + eval "$amuse_h5_flags_target_var=\"yes\"" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + +else $as_nop + + eval "$amuse_h5_flags_target_var=\"no\"" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext + + LIBS="$amuse_h5_save_LIBS" + LDFLAGS="$amuse_h5_save_LDFLAGS" + eval "$amuse_h5_flags_var=\"\$amuse_h5_save_FLAGS\"" + + + + amuse_h5_name="Fortran with the high-level API in hdf5_hl_fortran with $amuse_h5_path from C_INCLUDE_PATH" + amuse_h5_prefix="FC" + amuse_h5_target="HL_FC" + amuse_h5_program=" program main + + use h5lt + + integer :: error + + error = h5ltfind_dataset_f(0_hid_t, 'test') + + end" + amuse_h5_libs="-lhdf5_hl_fortran" + + amuse_h5_flags_var="${amuse_h5_prefix}FLAGS" + amuse_h5_flags_source_var="amuse_h5_${amuse_h5_flags_var}" + amuse_h5_flags_target_var="amuse_h5_detect_${amuse_h5_target}" + + eval "amuse_h5_save_FLAGS=\"\$$amuse_h5_flags_var\"" + amuse_h5_save_LDFLAGS="$LDFLAGS" + amuse_h5_save_LIBS="$LIBS" + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether we can build a program with HDF5 in $amuse_h5_name" >&5 +printf %s "checking whether we can build a program with HDF5 in $amuse_h5_name... " >&6; } + + eval "$amuse_h5_flags_var=\"\$$amuse_h5_flags_source_var \$$amuse_h5_flags_var\"" + LDFLAGS="$amuse_h5_LDFLAGS $LDFLAGS" + LIBS="$amuse_h5_libs" + + cat > conftest.$ac_ext <<_ACEOF +$amuse_h5_program +_ACEOF +if ac_fn_fc_try_link "$LINENO" +then : + + eval "$amuse_h5_flags_target_var=\"yes\"" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + +else $as_nop + + eval "$amuse_h5_flags_target_var=\"no\"" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext + + LIBS="$amuse_h5_save_LIBS" + LDFLAGS="$amuse_h5_save_LDFLAGS" + eval "$amuse_h5_flags_var=\"\$amuse_h5_save_FLAGS\"" + + + if test $amuse_h5_detect_HL_FC = "yes" + then + amuse_h5_HL_FC_LIB="-lhdf5_hl_fortran" + else + + amuse_h5_name="Fortran with the high-level API in hdf5hl_fortran with $amuse_h5_path from C_INCLUDE_PATH" + amuse_h5_prefix="FC" + amuse_h5_target="HL_FC" + amuse_h5_program=" program main + + use h5lt + + integer :: error + + error = h5ltfind_dataset_f(0_hid_t, 'test') + + end" + amuse_h5_libs="-lhdf5hl_fortran" + + amuse_h5_flags_var="${amuse_h5_prefix}FLAGS" + amuse_h5_flags_source_var="amuse_h5_${amuse_h5_flags_var}" + amuse_h5_flags_target_var="amuse_h5_detect_${amuse_h5_target}" + + eval "amuse_h5_save_FLAGS=\"\$$amuse_h5_flags_var\"" + amuse_h5_save_LDFLAGS="$LDFLAGS" + amuse_h5_save_LIBS="$LIBS" + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether we can build a program with HDF5 in $amuse_h5_name" >&5 +printf %s "checking whether we can build a program with HDF5 in $amuse_h5_name... " >&6; } + + eval "$amuse_h5_flags_var=\"\$$amuse_h5_flags_source_var \$$amuse_h5_flags_var\"" + LDFLAGS="$amuse_h5_LDFLAGS $LDFLAGS" + LIBS="$amuse_h5_libs" + + cat > conftest.$ac_ext <<_ACEOF +$amuse_h5_program +_ACEOF +if ac_fn_fc_try_link "$LINENO" +then : + + eval "$amuse_h5_flags_target_var=\"yes\"" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + +else $as_nop + + eval "$amuse_h5_flags_target_var=\"no\"" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext + + LIBS="$amuse_h5_save_LIBS" + LDFLAGS="$amuse_h5_save_LDFLAGS" + eval "$amuse_h5_flags_var=\"\$amuse_h5_save_FLAGS\"" + + + if test $amuse_h5_detect_HL_FC = "yes" + then + amuse_h5_HL_FC_LIB="-lhdf5hl_fortran" + fi + fi + + 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 + + + if test "$amuse_h5_detect_FC" = "yes" + then + amuse_h5_FCFLAGS="-I$amuse_h5_path" + break + fi + + # The new Fortran CMake-based build system uses the non-standard and + # not-searched-unless-explicitly-specified /mod/shared subdirectory by + # default + amuse_h5_FCFLAGS="$FCFLAGS -I$amuse_h5_path/../mod/shared" + + 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 + + + amuse_h5_name="Fortran with $amuse_h5_path from C_INCLUDE_PATH and /mod/shared" + amuse_h5_prefix="FC" + amuse_h5_target="FC" + amuse_h5_program=" program main + + use h5lib + + integer :: error + + call h5open_f(error) + call h5close_f(error) + end" + amuse_h5_libs="-lhdf5_fortran" + + amuse_h5_flags_var="${amuse_h5_prefix}FLAGS" + amuse_h5_flags_source_var="amuse_h5_${amuse_h5_flags_var}" + amuse_h5_flags_target_var="amuse_h5_detect_${amuse_h5_target}" + + eval "amuse_h5_save_FLAGS=\"\$$amuse_h5_flags_var\"" + amuse_h5_save_LDFLAGS="$LDFLAGS" + amuse_h5_save_LIBS="$LIBS" + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether we can build a program with HDF5 in $amuse_h5_name" >&5 +printf %s "checking whether we can build a program with HDF5 in $amuse_h5_name... " >&6; } + + eval "$amuse_h5_flags_var=\"\$$amuse_h5_flags_source_var \$$amuse_h5_flags_var\"" + LDFLAGS="$amuse_h5_LDFLAGS $LDFLAGS" + LIBS="$amuse_h5_libs" + + cat > conftest.$ac_ext <<_ACEOF +$amuse_h5_program +_ACEOF +if ac_fn_fc_try_link "$LINENO" +then : + + eval "$amuse_h5_flags_target_var=\"yes\"" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + +else $as_nop + + eval "$amuse_h5_flags_target_var=\"no\"" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext + + LIBS="$amuse_h5_save_LIBS" + LDFLAGS="$amuse_h5_save_LDFLAGS" + eval "$amuse_h5_flags_var=\"\$amuse_h5_save_FLAGS\"" + + + + amuse_h5_name="Fortran with the high-level API in hdf5_hl_fortran with $amuse_h5_path from C_INCLUDE_PATH and /mod/shared" + amuse_h5_prefix="FC" + amuse_h5_target="HL_FC" + amuse_h5_program=" program main + + use h5lt + + integer :: error + + error = h5ltfind_dataset_f(0_hid_t, 'test') + + end" + amuse_h5_libs="-lhdf5_hl_fortran" + + amuse_h5_flags_var="${amuse_h5_prefix}FLAGS" + amuse_h5_flags_source_var="amuse_h5_${amuse_h5_flags_var}" + amuse_h5_flags_target_var="amuse_h5_detect_${amuse_h5_target}" + + eval "amuse_h5_save_FLAGS=\"\$$amuse_h5_flags_var\"" + amuse_h5_save_LDFLAGS="$LDFLAGS" + amuse_h5_save_LIBS="$LIBS" + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether we can build a program with HDF5 in $amuse_h5_name" >&5 +printf %s "checking whether we can build a program with HDF5 in $amuse_h5_name... " >&6; } + + eval "$amuse_h5_flags_var=\"\$$amuse_h5_flags_source_var \$$amuse_h5_flags_var\"" + LDFLAGS="$amuse_h5_LDFLAGS $LDFLAGS" + LIBS="$amuse_h5_libs" + + cat > conftest.$ac_ext <<_ACEOF +$amuse_h5_program +_ACEOF +if ac_fn_fc_try_link "$LINENO" +then : + + eval "$amuse_h5_flags_target_var=\"yes\"" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + +else $as_nop + + eval "$amuse_h5_flags_target_var=\"no\"" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext + + LIBS="$amuse_h5_save_LIBS" + LDFLAGS="$amuse_h5_save_LDFLAGS" + eval "$amuse_h5_flags_var=\"\$amuse_h5_save_FLAGS\"" + + + if test $amuse_h5_detect_HL_FC = "yes" + then + amuse_h5_HL_FC_LIB="-lhdf5_hl_fortran" + else + + amuse_h5_name="Fortran with the high-level API in hdf5hl_fortran with $amuse_h5_path from C_INCLUDE_PATH and /mod/shared" + amuse_h5_prefix="FC" + amuse_h5_target="HL_FC" + amuse_h5_program=" program main + + use h5lt + + integer :: error + + error = h5ltfind_dataset_f(0_hid_t, 'test') + + end" + amuse_h5_libs="-lhdf5hl_fortran" + + amuse_h5_flags_var="${amuse_h5_prefix}FLAGS" + amuse_h5_flags_source_var="amuse_h5_${amuse_h5_flags_var}" + amuse_h5_flags_target_var="amuse_h5_detect_${amuse_h5_target}" + + eval "amuse_h5_save_FLAGS=\"\$$amuse_h5_flags_var\"" + amuse_h5_save_LDFLAGS="$LDFLAGS" + amuse_h5_save_LIBS="$LIBS" + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether we can build a program with HDF5 in $amuse_h5_name" >&5 +printf %s "checking whether we can build a program with HDF5 in $amuse_h5_name... " >&6; } + + eval "$amuse_h5_flags_var=\"\$$amuse_h5_flags_source_var \$$amuse_h5_flags_var\"" + LDFLAGS="$amuse_h5_LDFLAGS $LDFLAGS" + LIBS="$amuse_h5_libs" + + cat > conftest.$ac_ext <<_ACEOF +$amuse_h5_program +_ACEOF +if ac_fn_fc_try_link "$LINENO" +then : + + eval "$amuse_h5_flags_target_var=\"yes\"" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + +else $as_nop + + eval "$amuse_h5_flags_target_var=\"no\"" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext + + LIBS="$amuse_h5_save_LIBS" + LDFLAGS="$amuse_h5_save_LDFLAGS" + eval "$amuse_h5_flags_var=\"\$amuse_h5_save_FLAGS\"" + + + if test $amuse_h5_detect_HL_FC = "yes" + then + amuse_h5_HL_FC_LIB="-lhdf5hl_fortran" + fi + fi + + 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 + + + if test "$amuse_h5_detect_FC" = "yes" + then + amuse_h5_FCFLAGS="-I$amuse_h5_path/../mod/shared" + break + fi + + if test "$amuse_h5_detect_FC" = "no" + then + amuse_h5_FCFLAGS="" + fi + done + IFS="$amuse_h5_save_IFS" + + fi + fi + + fi + + if test "$amuse_h5_detect_C" = "no" + then + + # Extract the first word of "h5cc", so it can be a program name with args. +set dummy h5cc; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_path_H5CC+y} +then : + printf %s "(cached) " >&6 +else $as_nop + case $H5CC in + [\\/]* | ?:[\\/]*) + ac_cv_path_H5CC="$H5CC" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_path_H5CC="$as_dir$ac_word$ac_exec_ext" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + ;; +esac +fi +H5CC=$ac_cv_path_H5CC +if test -n "$H5CC"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $H5CC" >&5 +printf "%s\n" "$H5CC" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + + if test -n "$H5CC" + then + amuse_h5_h5cc_flags=$(HDF5_USE_SHLIB=yes $H5CC -show) + amuse_h5_h5cc_extra_flags=$(HDF5_USE_SHLIB=yes $H5CC -show -c) + + amuse_h5_include_flags="" + amuse_h5_link_flags="" + + for amuse_h5_flag in $amuse_h5_h5cc_flags $amuse_h5_h5cc_extra_flags + do + if test "${amuse_h5_flag#-I}" != "$amuse_h5_flag" + then + if ! echo "$amuse_h5_include_flags" | grep -e "$amuse_h5_flag" >/dev/null 2>&1 + then + amuse_h5_include_flags="$amuse_h5_include_flags $amuse_h5_flag" + fi + elif test "${amuse_h5_flag#-L}" != "$amuse_h5_flag" + then + if ! echo "$amuse_h5_result" | grep -e "$amuse_h5_flag" >/dev/null 2>&1 + then + amuse_h5_link_flags="$amuse_h5_link_flags $amuse_h5_flag" + fi + fi + done + + + 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 + + amuse_h5_CFLAGS="$amuse_h5_include_flags" + amuse_h5_LDFLAGS="$amuse_h5_link_flags" + + amuse_h5_name="C with flags from h5cc" + amuse_h5_prefix="C" + amuse_h5_target="C" + amuse_h5_program="#include +int +main (void) +{ +H5open(); H5close(); + ; + return 0; +}" + amuse_h5_libs="-lhdf5" + + amuse_h5_flags_var="${amuse_h5_prefix}FLAGS" + amuse_h5_flags_source_var="amuse_h5_${amuse_h5_flags_var}" + amuse_h5_flags_target_var="amuse_h5_detect_${amuse_h5_target}" + + eval "amuse_h5_save_FLAGS=\"\$$amuse_h5_flags_var\"" + amuse_h5_save_LDFLAGS="$LDFLAGS" + amuse_h5_save_LIBS="$LIBS" + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether we can build a program with HDF5 in $amuse_h5_name" >&5 +printf %s "checking whether we can build a program with HDF5 in $amuse_h5_name... " >&6; } + + eval "$amuse_h5_flags_var=\"\$$amuse_h5_flags_source_var \$$amuse_h5_flags_var\"" + LDFLAGS="$amuse_h5_LDFLAGS $LDFLAGS" + LIBS="$amuse_h5_libs" + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$amuse_h5_program +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + + eval "$amuse_h5_flags_target_var=\"yes\"" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + +else $as_nop + + eval "$amuse_h5_flags_target_var=\"no\"" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext + + LIBS="$amuse_h5_save_LIBS" + LDFLAGS="$amuse_h5_save_LDFLAGS" + eval "$amuse_h5_flags_var=\"\$amuse_h5_save_FLAGS\"" + + + amuse_h5_name="C with flags from h5cc and the high-level API" + amuse_h5_prefix="C" + amuse_h5_target="HL_C" + amuse_h5_program="#include +int +main (void) +{ +H5LTfind_dataset(0, \"test\") + ; + return 0; +}" + amuse_h5_libs="-lhdf5_hl" + + amuse_h5_flags_var="${amuse_h5_prefix}FLAGS" + amuse_h5_flags_source_var="amuse_h5_${amuse_h5_flags_var}" + amuse_h5_flags_target_var="amuse_h5_detect_${amuse_h5_target}" + + eval "amuse_h5_save_FLAGS=\"\$$amuse_h5_flags_var\"" + amuse_h5_save_LDFLAGS="$LDFLAGS" + amuse_h5_save_LIBS="$LIBS" + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether we can build a program with HDF5 in $amuse_h5_name" >&5 +printf %s "checking whether we can build a program with HDF5 in $amuse_h5_name... " >&6; } + + eval "$amuse_h5_flags_var=\"\$$amuse_h5_flags_source_var \$$amuse_h5_flags_var\"" + LDFLAGS="$amuse_h5_LDFLAGS $LDFLAGS" + LIBS="$amuse_h5_libs" + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$amuse_h5_program +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + + eval "$amuse_h5_flags_target_var=\"yes\"" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + +else $as_nop + + eval "$amuse_h5_flags_target_var=\"no\"" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext + + LIBS="$amuse_h5_save_LIBS" + LDFLAGS="$amuse_h5_save_LDFLAGS" + eval "$amuse_h5_flags_var=\"\$amuse_h5_save_FLAGS\"" + + 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 + + # Extract the first word of "h5c++", so it can be a program name with args. +set dummy h5c++; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_path_H5CXX+y} +then : + printf %s "(cached) " >&6 +else $as_nop + case $H5CXX in + [\\/]* | ?:[\\/]*) + ac_cv_path_H5CXX="$H5CXX" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_path_H5CXX="$as_dir$ac_word$ac_exec_ext" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + ;; +esac +fi +H5CXX=$ac_cv_path_H5CXX +if test -n "$H5CXX"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $H5CXX" >&5 +printf "%s\n" "$H5CXX" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + + if test -n "$H5CXX" + then + amuse_h5_h5cxx_flags=$(HDF5_USE_SHLIB=yes $H5CXX -show) + echo "broken" >conftest.cpp + amuse_h5_h5cxx_extra_flags=$(HDF5_USE_SHLIB=yes $H5CXX -show -c conftest.cpp) + rm conftest.cpp + + amuse_h5_include_flags="" + amuse_h5_link_flags="" + + for amuse_h5_flag in $amuse_h5_h5cxx_flags $amuse_h5_h5cxx_extra_flags + do + if test "${amuse_h5_flag#-I}" != "$amuse_h5_flag" + then + if ! echo "$amuse_h5_include_flags" | grep -e "$amuse_h5_flag" >/dev/null 2>&1 + then + amuse_h5_include_flags="$amuse_h5_include_flags $amuse_h5_flag" + fi + elif test "${amuse_h5_flag#-L}" != "$amuse_h5_flag" + then + if ! echo "$amuse_h5_result" | grep -e "$amuse_h5_flag" >/dev/null 2>&1 + then + amuse_h5_link_flags="$amuse_h5_link_flags $amuse_h5_flag" + fi + fi + done + + + ac_ext=cpp +ac_cpp='$CXXCPP $CPPFLAGS' +ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_cxx_compiler_gnu + + amuse_h5_CXXFLAGS="$amuse_h5_include_flags" + amuse_h5_LDFLAGS="$amuse_h5_link_flags" + + amuse_h5_name="C++ with flags from h5c++" + amuse_h5_prefix="CXX" + amuse_h5_target="CXX" + amuse_h5_program="#include +int +main (void) +{ +H5::H5Library::open(); + ; + return 0; +}" + amuse_h5_libs="-lhdf5_cpp" + + amuse_h5_flags_var="${amuse_h5_prefix}FLAGS" + amuse_h5_flags_source_var="amuse_h5_${amuse_h5_flags_var}" + amuse_h5_flags_target_var="amuse_h5_detect_${amuse_h5_target}" + + eval "amuse_h5_save_FLAGS=\"\$$amuse_h5_flags_var\"" + amuse_h5_save_LDFLAGS="$LDFLAGS" + amuse_h5_save_LIBS="$LIBS" + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether we can build a program with HDF5 in $amuse_h5_name" >&5 +printf %s "checking whether we can build a program with HDF5 in $amuse_h5_name... " >&6; } + + eval "$amuse_h5_flags_var=\"\$$amuse_h5_flags_source_var \$$amuse_h5_flags_var\"" + LDFLAGS="$amuse_h5_LDFLAGS $LDFLAGS" + LIBS="$amuse_h5_libs" + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$amuse_h5_program +_ACEOF +if ac_fn_cxx_try_link "$LINENO" +then : + + eval "$amuse_h5_flags_target_var=\"yes\"" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + +else $as_nop + + eval "$amuse_h5_flags_target_var=\"no\"" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext + + LIBS="$amuse_h5_save_LIBS" + LDFLAGS="$amuse_h5_save_LDFLAGS" + eval "$amuse_h5_flags_var=\"\$amuse_h5_save_FLAGS\"" + + 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 + + # Extract the first word of "h5fc", so it can be a program name with args. +set dummy h5fc; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_path_H5FC+y} +then : + printf %s "(cached) " >&6 +else $as_nop + case $H5FC in + [\\/]* | ?:[\\/]*) + ac_cv_path_H5FC="$H5FC" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_path_H5FC="$as_dir$ac_word$ac_exec_ext" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + ;; +esac +fi +H5FC=$ac_cv_path_H5FC +if test -n "$H5FC"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $H5FC" >&5 +printf "%s\n" "$H5FC" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + + if test -n "$H5FC" + then + amuse_h5_h5fc_flags=$(HDF5_USE_SHLIB=yes h5fc -show) + amuse_h5_h5fc_extra_flags=$(HDF5_USE_SHLIB=yes $H5CC -show -c) + + amuse_h5_include_flags="" + amuse_h5_link_flags="" + + for amuse_h5_flag in $amuse_h5_h5fc_flags $amuse_h5_h5fc_extra_flags + do + if test "${amuse_h5_flag#-I}" != "$amuse_h5_flag" + then + if ! echo "$amuse_h5_include_flags" | grep -e "$amuse_h5_flag" >/dev/null 2>&1 + then + amuse_h5_include_flags="$amuse_h5_include_flags $amuse_h5_flag" + fi + elif test "${amuse_h5_flag#-L}" != "$amuse_h5_flag" + then + if ! echo "$amuse_h5_result" | grep -e "$amuse_h5_flag" >/dev/null 2>&1 + then + amuse_h5_link_flags="$amuse_h5_link_flags $amuse_h5_flag" + fi + fi + done + + + amuse_h5_FCFLAGS="$amuse_h5_include_flags" + amuse_h5_LDFLAGS="$amuse_h5_link_flags" + + 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 + + + amuse_h5_name="Fortran with flags from h5fc" + amuse_h5_prefix="FC" + amuse_h5_target="FC" + amuse_h5_program=" program main + + use h5lib + + integer :: error + + call h5open_f(error) + call h5close_f(error) + end" + amuse_h5_libs="-lhdf5_fortran" + + amuse_h5_flags_var="${amuse_h5_prefix}FLAGS" + amuse_h5_flags_source_var="amuse_h5_${amuse_h5_flags_var}" + amuse_h5_flags_target_var="amuse_h5_detect_${amuse_h5_target}" + + eval "amuse_h5_save_FLAGS=\"\$$amuse_h5_flags_var\"" + amuse_h5_save_LDFLAGS="$LDFLAGS" + amuse_h5_save_LIBS="$LIBS" + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether we can build a program with HDF5 in $amuse_h5_name" >&5 +printf %s "checking whether we can build a program with HDF5 in $amuse_h5_name... " >&6; } + + eval "$amuse_h5_flags_var=\"\$$amuse_h5_flags_source_var \$$amuse_h5_flags_var\"" + LDFLAGS="$amuse_h5_LDFLAGS $LDFLAGS" + LIBS="$amuse_h5_libs" + + cat > conftest.$ac_ext <<_ACEOF +$amuse_h5_program +_ACEOF +if ac_fn_fc_try_link "$LINENO" +then : + + eval "$amuse_h5_flags_target_var=\"yes\"" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + +else $as_nop + + eval "$amuse_h5_flags_target_var=\"no\"" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext + + LIBS="$amuse_h5_save_LIBS" + LDFLAGS="$amuse_h5_save_LDFLAGS" + eval "$amuse_h5_flags_var=\"\$amuse_h5_save_FLAGS\"" + + + + amuse_h5_name="Fortran with the high-level API in hdf5_hl_fortran with flags from h5fc" + amuse_h5_prefix="FC" + amuse_h5_target="HL_FC" + amuse_h5_program=" program main + + use h5lt + + integer :: error + + error = h5ltfind_dataset_f(0_hid_t, 'test') + + end" + amuse_h5_libs="-lhdf5_hl_fortran" + + amuse_h5_flags_var="${amuse_h5_prefix}FLAGS" + amuse_h5_flags_source_var="amuse_h5_${amuse_h5_flags_var}" + amuse_h5_flags_target_var="amuse_h5_detect_${amuse_h5_target}" + + eval "amuse_h5_save_FLAGS=\"\$$amuse_h5_flags_var\"" + amuse_h5_save_LDFLAGS="$LDFLAGS" + amuse_h5_save_LIBS="$LIBS" + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether we can build a program with HDF5 in $amuse_h5_name" >&5 +printf %s "checking whether we can build a program with HDF5 in $amuse_h5_name... " >&6; } + + eval "$amuse_h5_flags_var=\"\$$amuse_h5_flags_source_var \$$amuse_h5_flags_var\"" + LDFLAGS="$amuse_h5_LDFLAGS $LDFLAGS" + LIBS="$amuse_h5_libs" + + cat > conftest.$ac_ext <<_ACEOF +$amuse_h5_program +_ACEOF +if ac_fn_fc_try_link "$LINENO" +then : + + eval "$amuse_h5_flags_target_var=\"yes\"" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + +else $as_nop + + eval "$amuse_h5_flags_target_var=\"no\"" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext + + LIBS="$amuse_h5_save_LIBS" + LDFLAGS="$amuse_h5_save_LDFLAGS" + eval "$amuse_h5_flags_var=\"\$amuse_h5_save_FLAGS\"" + + + if test $amuse_h5_detect_HL_FC = "yes" + then + amuse_h5_HL_FC_LIB="-lhdf5_hl_fortran" + else + + amuse_h5_name="Fortran with the high-level API in hdf5hl_fortran with flags from h5fc" + amuse_h5_prefix="FC" + amuse_h5_target="HL_FC" + amuse_h5_program=" program main + + use h5lt + + integer :: error + + error = h5ltfind_dataset_f(0_hid_t, 'test') + + end" + amuse_h5_libs="-lhdf5hl_fortran" + + amuse_h5_flags_var="${amuse_h5_prefix}FLAGS" + amuse_h5_flags_source_var="amuse_h5_${amuse_h5_flags_var}" + amuse_h5_flags_target_var="amuse_h5_detect_${amuse_h5_target}" + + eval "amuse_h5_save_FLAGS=\"\$$amuse_h5_flags_var\"" + amuse_h5_save_LDFLAGS="$LDFLAGS" + amuse_h5_save_LIBS="$LIBS" + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether we can build a program with HDF5 in $amuse_h5_name" >&5 +printf %s "checking whether we can build a program with HDF5 in $amuse_h5_name... " >&6; } + + eval "$amuse_h5_flags_var=\"\$$amuse_h5_flags_source_var \$$amuse_h5_flags_var\"" + LDFLAGS="$amuse_h5_LDFLAGS $LDFLAGS" + LIBS="$amuse_h5_libs" + + cat > conftest.$ac_ext <<_ACEOF +$amuse_h5_program +_ACEOF +if ac_fn_fc_try_link "$LINENO" +then : + + eval "$amuse_h5_flags_target_var=\"yes\"" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + +else $as_nop + + eval "$amuse_h5_flags_target_var=\"no\"" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext + + LIBS="$amuse_h5_save_LIBS" + LDFLAGS="$amuse_h5_save_LDFLAGS" + eval "$amuse_h5_flags_var=\"\$amuse_h5_save_FLAGS\"" + + + if test $amuse_h5_detect_HL_FC = "yes" + then + amuse_h5_HL_FC_LIB="-lhdf5hl_fortran" + fi + fi + + 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 + + + + if test "$amuse_h5_detect_FC" = "no" + then + amuse_h5_extra_flags=$(echo "$amuse_h5_include_flags" | sed -e 's^\([[:graph:]]*\)\( \|$\)^\1/../mod/shared ^g') + amuse_h5_FCFLAGS="$amuse_h5_include_flags $amuse_h5_extra_flags" + + 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 + + + amuse_h5_name="Fortran with flags from h5fc and mod/shared" + amuse_h5_prefix="FC" + amuse_h5_target="FC" + amuse_h5_program=" program main + + use h5lib + + integer :: error + + call h5open_f(error) + call h5close_f(error) + end" + amuse_h5_libs="-lhdf5_fortran" + + amuse_h5_flags_var="${amuse_h5_prefix}FLAGS" + amuse_h5_flags_source_var="amuse_h5_${amuse_h5_flags_var}" + amuse_h5_flags_target_var="amuse_h5_detect_${amuse_h5_target}" + + eval "amuse_h5_save_FLAGS=\"\$$amuse_h5_flags_var\"" + amuse_h5_save_LDFLAGS="$LDFLAGS" + amuse_h5_save_LIBS="$LIBS" + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether we can build a program with HDF5 in $amuse_h5_name" >&5 +printf %s "checking whether we can build a program with HDF5 in $amuse_h5_name... " >&6; } + + eval "$amuse_h5_flags_var=\"\$$amuse_h5_flags_source_var \$$amuse_h5_flags_var\"" + LDFLAGS="$amuse_h5_LDFLAGS $LDFLAGS" + LIBS="$amuse_h5_libs" + + cat > conftest.$ac_ext <<_ACEOF +$amuse_h5_program +_ACEOF +if ac_fn_fc_try_link "$LINENO" +then : + + eval "$amuse_h5_flags_target_var=\"yes\"" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + +else $as_nop + + eval "$amuse_h5_flags_target_var=\"no\"" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext + + LIBS="$amuse_h5_save_LIBS" + LDFLAGS="$amuse_h5_save_LDFLAGS" + eval "$amuse_h5_flags_var=\"\$amuse_h5_save_FLAGS\"" + + + + amuse_h5_name="Fortran with the high-level API in hdf5_hl_fortran with flags from h5fc and mod/shared" + amuse_h5_prefix="FC" + amuse_h5_target="HL_FC" + amuse_h5_program=" program main + + use h5lt + + integer :: error + + error = h5ltfind_dataset_f(0_hid_t, 'test') + + end" + amuse_h5_libs="-lhdf5_hl_fortran" + + amuse_h5_flags_var="${amuse_h5_prefix}FLAGS" + amuse_h5_flags_source_var="amuse_h5_${amuse_h5_flags_var}" + amuse_h5_flags_target_var="amuse_h5_detect_${amuse_h5_target}" + + eval "amuse_h5_save_FLAGS=\"\$$amuse_h5_flags_var\"" + amuse_h5_save_LDFLAGS="$LDFLAGS" + amuse_h5_save_LIBS="$LIBS" + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether we can build a program with HDF5 in $amuse_h5_name" >&5 +printf %s "checking whether we can build a program with HDF5 in $amuse_h5_name... " >&6; } + + eval "$amuse_h5_flags_var=\"\$$amuse_h5_flags_source_var \$$amuse_h5_flags_var\"" + LDFLAGS="$amuse_h5_LDFLAGS $LDFLAGS" + LIBS="$amuse_h5_libs" + + cat > conftest.$ac_ext <<_ACEOF +$amuse_h5_program +_ACEOF +if ac_fn_fc_try_link "$LINENO" +then : + + eval "$amuse_h5_flags_target_var=\"yes\"" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + +else $as_nop + + eval "$amuse_h5_flags_target_var=\"no\"" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext + + LIBS="$amuse_h5_save_LIBS" + LDFLAGS="$amuse_h5_save_LDFLAGS" + eval "$amuse_h5_flags_var=\"\$amuse_h5_save_FLAGS\"" + + + if test $amuse_h5_detect_HL_FC = "yes" + then + amuse_h5_HL_FC_LIB="-lhdf5_hl_fortran" + else + + amuse_h5_name="Fortran with the high-level API in hdf5hl_fortran with flags from h5fc and mod/shared" + amuse_h5_prefix="FC" + amuse_h5_target="HL_FC" + amuse_h5_program=" program main + + use h5lt + + integer :: error + + error = h5ltfind_dataset_f(0_hid_t, 'test') + + end" + amuse_h5_libs="-lhdf5hl_fortran" + + amuse_h5_flags_var="${amuse_h5_prefix}FLAGS" + amuse_h5_flags_source_var="amuse_h5_${amuse_h5_flags_var}" + amuse_h5_flags_target_var="amuse_h5_detect_${amuse_h5_target}" + + eval "amuse_h5_save_FLAGS=\"\$$amuse_h5_flags_var\"" + amuse_h5_save_LDFLAGS="$LDFLAGS" + amuse_h5_save_LIBS="$LIBS" + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether we can build a program with HDF5 in $amuse_h5_name" >&5 +printf %s "checking whether we can build a program with HDF5 in $amuse_h5_name... " >&6; } + + eval "$amuse_h5_flags_var=\"\$$amuse_h5_flags_source_var \$$amuse_h5_flags_var\"" + LDFLAGS="$amuse_h5_LDFLAGS $LDFLAGS" + LIBS="$amuse_h5_libs" + + cat > conftest.$ac_ext <<_ACEOF +$amuse_h5_program +_ACEOF +if ac_fn_fc_try_link "$LINENO" +then : + + eval "$amuse_h5_flags_target_var=\"yes\"" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + +else $as_nop + + eval "$amuse_h5_flags_target_var=\"no\"" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext + + LIBS="$amuse_h5_save_LIBS" + LDFLAGS="$amuse_h5_save_LDFLAGS" + eval "$amuse_h5_flags_var=\"\$amuse_h5_save_FLAGS\"" + + + if test $amuse_h5_detect_HL_FC = "yes" + then + amuse_h5_HL_FC_LIB="-lhdf5hl_fortran" + fi + fi + + 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 test "$amuse_h5_detect_FC" = "no" + then + amuse_h5_FCFLAGS="" + fi + fi + + fi + + if test "$amuse_h5_detect_C" = "yes" + then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: HDF5 installation detected" >&5 +printf "%s\n" "$as_me: HDF5 installation detected" >&6;} + + HDF5_C_FOUND="$amuse_h5_detect_C" + HDF5_HL_C_FOUND="$amuse_h5_detect_HL_C" + HDF5_CXX_FOUND="$amuse_h5_detect_CXX" + HDF5_FC_FOUND="$amuse_h5_detect_FC" + HDF5_HL_FC_FOUND="$amuse_h5_detect_HL_FC" + + HDF5_TYPE="serial" + HDF5_CFLAGS="$amuse_h5_CFLAGS" + HDF5_CXXFLAGS="$amuse_h5_CXXFLAGS" + HDF5_FCFLAGS="$amuse_h5_FCFLAGS" + HDF5_LDFLAGS="$amuse_h5_LDFLAGS" + HDF5_HLFC_LIB="$amuse_h5_HL_FC_LIB" + else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: no HDF5 installation detected" >&5 +printf "%s\n" "$as_me: WARNING: no HDF5 installation detected" >&2;} + fi + + + + + + + + + # Generate output ac_config_files="$ac_config_files config.mk" @@ -6882,7 +10349,6 @@ gives unlimited permission to copy, distribute and modify it." ac_pwd='$ac_pwd' srcdir='$srcdir' -AWK='$AWK' test -n "\$AWK" || AWK=awk _ACEOF diff --git a/src/amuse_simplex/support/configure.ac b/src/amuse_simplex/support/configure.ac index d8de2627b4..37f6e6a653 100644 --- a/src/amuse_simplex/support/configure.ac +++ b/src/amuse_simplex/support/configure.ac @@ -28,13 +28,14 @@ AC_LANG_PUSH([C++]) AX_MPI() AX_PATH_GSL(1.0, [FOUND_GSL=yes]) -AX_LIB_HDF5() AMUSE_LIBZ() AMUSE_LIB_QHULL() AMUSE_LIB_HEALPIX_CXX() AC_LANG_POP([C++]) +AMUSE_LIB_HDF5() + # Generate output AC_CONFIG_FILES([config.mk]) AC_OUTPUT diff --git a/support/aclocal.m4 b/support/aclocal.m4 index 6fe6686bce..b33fc252b9 100644 --- a/support/aclocal.m4 +++ b/support/aclocal.m4 @@ -16,6 +16,7 @@ m4_include([shared/m4/amuse_conda.m4]) m4_include([shared/m4/amuse_cuda.m4]) m4_include([shared/m4/amuse_download.m4]) m4_include([shared/m4/amuse_lib.m4]) +m4_include([shared/m4/amuse_lib_hdf5.m4]) m4_include([shared/m4/amuse_lib_healpix.m4]) m4_include([shared/m4/amuse_lib_qhull.m4]) m4_include([shared/m4/amuse_libz.m4]) @@ -24,7 +25,6 @@ m4_include([shared/m4/amuse_opencl.m4]) m4_include([shared/m4/ax_blas.m4]) m4_include([shared/m4/ax_check_gnu_make.m4]) m4_include([shared/m4/ax_lapack.m4]) -m4_include([shared/m4/ax_lib_hdf5.m4]) m4_include([shared/m4/ax_lib_netcdf4.m4]) m4_include([shared/m4/ax_mpi.m4]) m4_include([shared/m4/ax_openmp.m4]) diff --git a/support/configure b/support/configure index 90ef1407fd..a1aa35fcab 100755 --- a/support/configure +++ b/support/configure @@ -714,8 +714,6 @@ SAPPORO_LIGHT_LIBS SAPPORO_LIGHT_CFLAGS HEALPIX_CXX_LIBS HEALPIX_CXX_CFLAGS -ac_ct_CXX -CXXFLAGS QHULL_FLAGS QHULL_LIBS NETCDF4_FLIBS @@ -727,20 +725,21 @@ NETCDF4_CFLAGS NETCDF4_CC NETCDF4_VERSION NC_CONFIG -HDF5_TYPE -HDF5_FLIBS -HDF5_FFLAGS -HDF5_FC -HDF5_LIBS +GREP +SED +HDF5_HLFC_LIB HDF5_LDFLAGS -HDF5_CPPFLAGS +HDF5_FCFLAGS +HDF5_CXXFLAGS HDF5_CFLAGS -HDF5_CC -HDF5_VERSION +HDF5_TYPE H5FC +H5CXX H5CC -GREP -SED +ac_ct_FC +FCFLAGS +ac_ct_CXX +CXXFLAGS LIBZ_LIBS LIBZ_CFLAGS FFTW_FLAGS @@ -876,7 +875,6 @@ enable_gsltest with_gmp with_mpfr with_fftw -with_hdf5 with_netcdf4 ' ac_precious_vars='build_alias @@ -906,6 +904,8 @@ FFTW_LIBS CXX CXXFLAGS CCC +FC +FCFLAGS HEALPIX_CXX_CFLAGS HEALPIX_CXX_LIBS SAPPORO_LIGHT_CFLAGS @@ -1545,7 +1545,6 @@ Optional Packages: --with-gmp=PFX Prefix where GMP has been installed --with-mpfr=PFX Prefix where MPFR has been installed --with-fftw=PFX Prefix where FFTW has been installed - --with-hdf5=yes/no/PATH location of h5cc or h5pcc for HDF5 configuration --with-netcdf4=yes/no/PATH base directory of NetCDF4 installation @@ -1581,6 +1580,8 @@ Some influential environment variables: FFTW_LIBS linker flags for FFTW, overriding pkg-config CXX C++ compiler command CXXFLAGS C++ compiler flags + FC Fortran compiler command + FCFLAGS Fortran compiler flags HEALPIX_CXX_CFLAGS C compiler flags for HEALPIX_CXX, overriding pkg-config HEALPIX_CXX_LIBS @@ -1976,6 +1977,92 @@ fi as_fn_set_status $ac_retval } # ac_fn_cxx_try_link + +# ac_fn_fc_try_compile LINENO +# --------------------------- +# Try to compile conftest.$ac_ext, and return whether this succeeded. +ac_fn_fc_try_compile () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + rm -f conftest.$ac_objext conftest.beam + if { { ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +printf "%s\n" "$ac_try_echo"; } >&5 + (eval "$ac_compile") 2>conftest.err + ac_status=$? + if test -s conftest.err; then + grep -v '^ *+' conftest.err >conftest.er1 + cat conftest.er1 >&5 + mv -f conftest.er1 conftest.err + fi + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && { + test -z "$ac_fc_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext +then : + ac_retval=0 +else $as_nop + printf "%s\n" "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_retval=1 +fi + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + as_fn_set_status $ac_retval + +} # ac_fn_fc_try_compile + +# ac_fn_fc_try_link LINENO +# ------------------------ +# Try to link conftest.$ac_ext, and return whether this succeeded. +ac_fn_fc_try_link () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + rm -f conftest.$ac_objext conftest.beam conftest$ac_exeext + if { { ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +printf "%s\n" "$ac_try_echo"; } >&5 + (eval "$ac_link") 2>conftest.err + ac_status=$? + if test -s conftest.err; then + grep -v '^ *+' conftest.err >conftest.er1 + cat conftest.er1 >&5 + mv -f conftest.er1 conftest.err + fi + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && { + test -z "$ac_fc_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + test -x conftest$ac_exeext + } +then : + ac_retval=0 +else $as_nop + printf "%s\n" "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_retval=1 +fi + # Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information + # created by the PGI compiler (conftest_ipa8_conftest.oo), as it would + # interfere with the next link command; also delete a directory that is + # left behind by Apple's compiler. We do this before executing the actions. + rm -rf conftest.dSYM conftest_ipa8_conftest.oo + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + as_fn_set_status $ac_retval + +} # ac_fn_fc_try_link ac_configure_args_raw= for ac_arg do @@ -4541,9 +4628,51 @@ printf %s "checking for conda package hdf5... " >&6; } if test "$?" = "0" then : - # with_hdf5="$(AS_ECHO("$ax_conda_package_line") | tr -s ' ' | cut -f 2 -d ' ')" + # HDF5_C_FOUND="$(AS_ECHO("$ax_conda_package_line") | tr -s ' ' | cut -f 2 -d ' ')" + + HDF5_C_FOUND="yes" + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + +else $as_nop + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + +fi + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for conda package hdf5" >&5 +printf %s "checking for conda package hdf5... " >&6; } + ax_conda_package_line="$(echo $amuse_conda_list | tr '^' '\n' | grep '^hdf5 ')" + if test "$?" = "0" +then : + + # HDF5_CXX_FOUND="$(AS_ECHO("$ax_conda_package_line") | tr -s ' ' | cut -f 2 -d ' ')" + + HDF5_CXX_FOUND="yes" + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + +else $as_nop + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + +fi + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for conda package hdf5" >&5 +printf %s "checking for conda package hdf5... " >&6; } + ax_conda_package_line="$(echo $amuse_conda_list | tr '^' '\n' | grep '^hdf5 ')" + if test "$?" = "0" +then : + + # HDF5_FC_FOUND="$(AS_ECHO("$ax_conda_package_line") | tr -s ' ' | cut -f 2 -d ' ')" - with_hdf5="yes" + HDF5_FC_FOUND="yes" { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 printf "%s\n" "yes" >&6; } @@ -13641,22 +13770,36 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for a sed that does not truncate output" >&5 -printf %s "checking for a sed that does not truncate output... " >&6; } -if test ${ac_cv_path_SED+y} + + + + + + +ac_ext=cpp +ac_cpp='$CXXCPP $CPPFLAGS' +ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_cxx_compiler_gnu +if test -z "$CXX"; then + if test -n "$CCC"; then + CXX=$CCC + else + if test -n "$ac_tool_prefix"; then + for ac_prog in g++ c++ gpp aCC CC cxx cc++ cl.exe FCC KCC RCC xlC_r xlC clang++ + do + # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. +set dummy $ac_tool_prefix$ac_prog; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_CXX+y} then : printf %s "(cached) " >&6 else $as_nop - ac_script=s/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb/ - for ac_i in 1 2 3 4 5 6 7; do - ac_script="$ac_script$as_nl$ac_script" - done - echo "$ac_script" 2>/dev/null | sed 99q >conftest.sed - { ac_script=; unset ac_script;} - if test -z "$SED"; then - ac_path_SED_found=false - # Loop through the user's path and test for each of PROGNAME-LIST - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR + if test -n "$CXX"; then + ac_cv_prog_CXX="$CXX" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS @@ -13665,193 +13808,48 @@ do */) ;; *) as_dir=$as_dir/ ;; esac - for ac_prog in sed gsed - do for ac_exec_ext in '' $ac_executable_extensions; do - ac_path_SED="$as_dir$ac_prog$ac_exec_ext" - as_fn_executable_p "$ac_path_SED" || continue -# Check for GNU ac_path_SED and select it if it is found. - # Check for GNU $ac_path_SED -case `"$ac_path_SED" --version 2>&1` in -*GNU*) - ac_cv_path_SED="$ac_path_SED" ac_path_SED_found=:;; -*) - ac_count=0 - printf %s 0123456789 >"conftest.in" - while : - do - cat "conftest.in" "conftest.in" >"conftest.tmp" - mv "conftest.tmp" "conftest.in" - cp "conftest.in" "conftest.nl" - printf "%s\n" '' >> "conftest.nl" - "$ac_path_SED" -f conftest.sed < "conftest.nl" >"conftest.out" 2>/dev/null || break - diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break - as_fn_arith $ac_count + 1 && ac_count=$as_val - if test $ac_count -gt ${ac_path_SED_max-0}; then - # Best one so far, save it but keep looking for a better one - ac_cv_path_SED="$ac_path_SED" - ac_path_SED_max=$ac_count - fi - # 10*(2^10) chars as input seems more than enough - test $ac_count -gt 10 && break - done - rm -f conftest.in conftest.tmp conftest.nl conftest.out;; -esac - - $ac_path_SED_found && break 3 - done - done + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_prog_CXX="$ac_tool_prefix$ac_prog" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done done IFS=$as_save_IFS - if test -z "$ac_cv_path_SED"; then - as_fn_error $? "no acceptable sed could be found in \$PATH" "$LINENO" 5 - fi + +fi +fi +CXX=$ac_cv_prog_CXX +if test -n "$CXX"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CXX" >&5 +printf "%s\n" "$CXX" >&6; } else - ac_cv_path_SED=$SED + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_SED" >&5 -printf "%s\n" "$ac_cv_path_SED" >&6; } - SED="$ac_cv_path_SED" - rm -f conftest.sed -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for grep that handles long lines and -e" >&5 -printf %s "checking for grep that handles long lines and -e... " >&6; } -if test ${ac_cv_path_GREP+y} + test -n "$CXX" && break + done +fi +if test -z "$CXX"; then + ac_ct_CXX=$CXX + for ac_prog in g++ c++ gpp aCC CC cxx cc++ cl.exe FCC KCC RCC xlC_r xlC clang++ +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_ac_ct_CXX+y} then : printf %s "(cached) " >&6 else $as_nop - if test -z "$GREP"; then - ac_path_GREP_found=false - # Loop through the user's path and test for each of PROGNAME-LIST - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin -do - IFS=$as_save_IFS - case $as_dir in #((( - '') as_dir=./ ;; - */) ;; - *) as_dir=$as_dir/ ;; - esac - for ac_prog in grep ggrep - do - for ac_exec_ext in '' $ac_executable_extensions; do - ac_path_GREP="$as_dir$ac_prog$ac_exec_ext" - as_fn_executable_p "$ac_path_GREP" || continue -# Check for GNU ac_path_GREP and select it if it is found. - # Check for GNU $ac_path_GREP -case `"$ac_path_GREP" --version 2>&1` in -*GNU*) - ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;; -*) - ac_count=0 - printf %s 0123456789 >"conftest.in" - while : - do - cat "conftest.in" "conftest.in" >"conftest.tmp" - mv "conftest.tmp" "conftest.in" - cp "conftest.in" "conftest.nl" - printf "%s\n" 'GREP' >> "conftest.nl" - "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break - diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break - as_fn_arith $ac_count + 1 && ac_count=$as_val - if test $ac_count -gt ${ac_path_GREP_max-0}; then - # Best one so far, save it but keep looking for a better one - ac_cv_path_GREP="$ac_path_GREP" - ac_path_GREP_max=$ac_count - fi - # 10*(2^10) chars as input seems more than enough - test $ac_count -gt 10 && break - done - rm -f conftest.in conftest.tmp conftest.nl conftest.out;; -esac - - $ac_path_GREP_found && break 3 - done - done - done -IFS=$as_save_IFS - if test -z "$ac_cv_path_GREP"; then - as_fn_error $? "no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 - fi -else - ac_cv_path_GREP=$GREP -fi - -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_GREP" >&5 -printf "%s\n" "$ac_cv_path_GREP" >&6; } - GREP="$ac_cv_path_GREP" - - - - - - - - -if test "" = "" ; then - : # Recognized value -elif test "" = "serial" ; then - : # Recognized value -elif test "" = "parallel"; then - : # Recognized value -else - as_fn_error $? " -Unrecognized value for AX_LIB_HDF5 within configure.ac. -If supplied, argument 1 must be either 'serial' or 'parallel'. -" "$LINENO" 5 -fi - - -# Check whether --with-hdf5 was given. -if test ${with_hdf5+y} -then : - withval=$with_hdf5; if test "$withval" = "no"; then - with_hdf5="no" - elif test "$withval" = "yes"; then - with_hdf5="yes" - else - with_hdf5="yes" - H5CC="$withval" - fi -else $as_nop - with_hdf5="yes" - -fi - - -HDF5_CC="" -HDF5_VERSION="" -HDF5_CFLAGS="" -HDF5_CPPFLAGS="" -HDF5_LDFLAGS="" -HDF5_LIBS="" -HDF5_FC="" -HDF5_FFLAGS="" -HDF5_FLIBS="" -HDF5_TYPE="" - -if test "$with_hdf5" = "yes"; then - if test -z "$H5CC"; then - for ac_prog in h5cc h5pcc -do - # Extract the first word of "$ac_prog", so it can be a program name with args. -set dummy $ac_prog; ac_word=$2 -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -printf %s "checking for $ac_word... " >&6; } -if test ${ac_cv_path_H5CC+y} -then : - printf %s "(cached) " >&6 -else $as_nop - case $H5CC in - [\\/]* | ?:[\\/]*) - ac_cv_path_H5CC="$H5CC" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH + if test -n "$ac_ct_CXX"; then + ac_cv_prog_ac_ct_CXX="$ac_ct_CXX" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( @@ -13861,7 +13859,7 @@ do esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then - ac_cv_path_H5CC="$as_dir$ac_word$ac_exec_ext" + ac_cv_prog_ac_ct_CXX="$ac_prog" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi @@ -13869,134 +13867,70 @@ done done IFS=$as_save_IFS - ;; -esac fi -H5CC=$ac_cv_path_H5CC -if test -n "$H5CC"; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $H5CC" >&5 -printf "%s\n" "$H5CC" >&6; } +fi +ac_ct_CXX=$ac_cv_prog_ac_ct_CXX +if test -n "$ac_ct_CXX"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CXX" >&5 +printf "%s\n" "$ac_ct_CXX" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi - test -n "$H5CC" && break + test -n "$ac_ct_CXX" && break done - else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking Using provided HDF5 C wrapper" >&5 -printf %s "checking Using provided HDF5 C wrapper... " >&6; } - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $H5CC" >&5 -printf "%s\n" "$H5CC" >&6; } - fi - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for HDF5 type" >&5 -printf %s "checking for HDF5 type... " >&6; } - case $H5CC in #( - *h5pcc) : - HDF5_TYPE=parallel ;; #( - *h5cc) : - HDF5_TYPE=serial ;; #( - *) : - HDF5_TYPE=neither ;; + if test "x$ac_ct_CXX" = x; then + CXX="g++" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; esac - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $HDF5_TYPE" >&5 -printf "%s\n" "$HDF5_TYPE" >&6; } - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for HDF5 libraries" >&5 -printf %s "checking for HDF5 libraries... " >&6; } - if test ! -f "$H5CC" || test ! -x "$H5CC"; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: -Unable to locate HDF5 compilation helper scripts 'h5cc' or 'h5pcc'. -Please specify --with-hdf5= as the full path to h5cc or h5pcc. -HDF5 support is being disabled (equivalent to --with-hdf5=no). -" >&5 -printf "%s\n" "$as_me: WARNING: -Unable to locate HDF5 compilation helper scripts 'h5cc' or 'h5pcc'. -Please specify --with-hdf5= as the full path to h5cc or h5pcc. -HDF5 support is being disabled (equivalent to --with-hdf5=no). -" >&2;} - with_hdf5="no" - with_hdf5_fortran="no" - else - HDF5_SHOW=$(eval $H5CC -show) - - HDF5_CC=$(eval $H5CC -show | head -n 1 | $AWK '{print $1}') - if test "$HDF5_CC" = "ccache"; then - HDF5_CC=$(eval $H5CC -show | head -n 1 | $AWK '{print $2}') - fi - - - HDF5_VERSION=$(eval $H5CC -showconfig | $GREP 'HDF5 Version:' \ - | $AWK '{print $3}') - - HDF5_tmp_flags=$(eval $H5CC -showconfig \ - | $GREP 'FLAGS\|Extra libraries:' \ - | $AWK -F: '{printf("%s "), $2}' ) - - HDF5_tmp_inst=$(eval $H5CC -showconfig \ - | $GREP 'Installation point:' \ - | $AWK '{print $NF}' ) - - HDF5_CPPFLAGS="-I${HDF5_tmp_inst}/include" - - for arg in $HDF5_SHOW $HDF5_tmp_flags ; do - case "$arg" in - -I*) echo $HDF5_CPPFLAGS | $GREP -e "$arg" 2>&1 >/dev/null \ - || HDF5_CPPFLAGS="$HDF5_CPPFLAGS $arg" - ;; - -L*) echo $HDF5_LDFLAGS | $GREP -e "$arg" 2>&1 >/dev/null \ - || HDF5_LDFLAGS="$HDF5_LDFLAGS $arg" - ;; - -l*) echo $HDF5_LIBS | $GREP -e "$arg" 2>&1 >/dev/null \ - || HDF5_LIBS="$HDF5_LIBS $arg" - ;; - esac - done - - HDF5_LIBS="-lhdf5 $HDF5_LIBS" - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes (version $HDF5_VERSION)" >&5 -printf "%s\n" "yes (version $HDF5_VERSION)" >&6; } - - 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 + CXX=$ac_ct_CXX + fi +fi - ax_lib_hdf5_save_CC=$CC - ax_lib_hdf5_save_CPPFLAGS=$CPPFLAGS - ax_lib_hdf5_save_LIBS=$LIBS - ax_lib_hdf5_save_LDFLAGS=$LDFLAGS - CC=$HDF5_CC - CPPFLAGS=$HDF5_CPPFLAGS - LIBS=$HDF5_LIBS - LDFLAGS=$HDF5_LDFLAGS - ac_fn_c_check_header_compile "$LINENO" "hdf5.h" "ac_cv_header_hdf5_h" "$ac_includes_default" -if test "x$ac_cv_header_hdf5_h" = xyes -then : - ac_cv_hadf5_h=yes -else $as_nop - ac_cv_hadf5_h=no + fi fi +# Provide some information about the compiler. +printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for C++ compiler version" >&5 +set X $ac_compile +ac_compiler=$2 +for ac_option in --version -v -V -qversion; do + { { ac_try="$ac_compiler $ac_option >&5" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +printf "%s\n" "$ac_try_echo"; } >&5 + (eval "$ac_compiler $ac_option >&5") 2>conftest.err + ac_status=$? + if test -s conftest.err; then + sed '10a\ +... rest of stderr output deleted ... + 10q' conftest.err >conftest.er1 + cat conftest.er1 >&5 + fi + rm -f conftest.er1 conftest.err + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } +done - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for H5Fcreate in -lhdf5" >&5 -printf %s "checking for H5Fcreate in -lhdf5... " >&6; } -if test ${ac_cv_lib_hdf5_H5Fcreate+y} +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether the compiler supports GNU C++" >&5 +printf %s "checking whether the compiler supports GNU C++... " >&6; } +if test ${ac_cv_cxx_compiler_gnu+y} then : printf %s "(cached) " >&6 else $as_nop - ac_check_lib_save_LIBS=$LIBS -LIBS="-lhdf5 $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext + 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. */ -char H5Fcreate (); #ifdef F77_DUMMY_MAIN # ifdef __cplusplus @@ -14008,46 +13942,48 @@ char H5Fcreate (); int main (void) { -return H5Fcreate (); +#ifndef __GNUC__ + choke me +#endif + ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO" +if ac_fn_cxx_try_compile "$LINENO" then : - ac_cv_lib_hdf5_H5Fcreate=yes + ac_compiler_gnu=yes else $as_nop - ac_cv_lib_hdf5_H5Fcreate=no -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS + ac_compiler_gnu=no fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_hdf5_H5Fcreate" >&5 -printf "%s\n" "$ac_cv_lib_hdf5_H5Fcreate" >&6; } -if test "x$ac_cv_lib_hdf5_H5Fcreate" = xyes -then : - ac_cv_libhdf5=yes -else $as_nop - ac_cv_libhdf5=no +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +ac_cv_cxx_compiler_gnu=$ac_compiler_gnu + fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_cxx_compiler_gnu" >&5 +printf "%s\n" "$ac_cv_cxx_compiler_gnu" >&6; } +ac_compiler_gnu=$ac_cv_cxx_compiler_gnu - if test "$ac_cv_hadf5_h" = "no" && test "$ac_cv_libhdf5" = "no" ; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: Unable to compile HDF5 test program" >&5 -printf "%s\n" "$as_me: WARNING: Unable to compile HDF5 test program" >&2;} - fi - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for main in -lhdf5_hl" >&5 -printf %s "checking for main in -lhdf5_hl... " >&6; } -if test ${ac_cv_lib_hdf5_hl_main+y} +if test $ac_compiler_gnu = yes; then + GXX=yes +else + GXX= +fi +ac_test_CXXFLAGS=${CXXFLAGS+y} +ac_save_CXXFLAGS=$CXXFLAGS +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $CXX accepts -g" >&5 +printf %s "checking whether $CXX accepts -g... " >&6; } +if test ${ac_cv_prog_cxx_g+y} then : printf %s "(cached) " >&6 else $as_nop - ac_check_lib_save_LIBS=$LIBS -LIBS="-lhdf5_hl $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext + ac_save_cxx_werror_flag=$ac_cxx_werror_flag + ac_cxx_werror_flag=yes + ac_cv_prog_cxx_g=no + CXXFLAGS="-g" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ - #ifdef F77_DUMMY_MAIN # ifdef __cplusplus @@ -14059,163 +13995,208 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext int main (void) { -return main (); + ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO" +if ac_fn_cxx_try_compile "$LINENO" then : - ac_cv_lib_hdf5_hl_main=yes + ac_cv_prog_cxx_g=yes else $as_nop - ac_cv_lib_hdf5_hl_main=no -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_hdf5_hl_main" >&5 -printf "%s\n" "$ac_cv_lib_hdf5_hl_main" >&6; } -if test "x$ac_cv_lib_hdf5_hl_main" = xyes -then : - HDF5_LIBS="-lhdf5_hl $HDF5_LIBS" -fi -ac_cv_lib_hdf5_hl=ac_cv_lib_hdf5_hl_main - - - CC=$ax_lib_hdf5_save_CC - CPPFLAGS=$ax_lib_hdf5_save_CPPFLAGS - LIBS=$ax_lib_hdf5_save_LIBS - LDFLAGS=$ax_lib_hdf5_save_LDFLAGS - 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 - - - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for matching HDF5 Fortran wrapper" >&5 -printf %s "checking for matching HDF5 Fortran wrapper... " >&6; } - H5FC=$(eval echo -n $H5CC | $SED -n 's/cc$/fc/p') - if test -x "$H5FC"; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $H5FC" >&5 -printf "%s\n" "$H5FC" >&6; } - with_hdf5_fortran="yes" - - - for arg in `$H5FC -show` - do - case "$arg" in #( - -I*) echo $HDF5_FFLAGS | $GREP -e "$arg" >/dev/null \ - || HDF5_FFLAGS="$HDF5_FFLAGS $arg" - ;;#( - -L*) echo $HDF5_FFLAGS | $GREP -e "$arg" >/dev/null \ - || HDF5_FFLAGS="$HDF5_FFLAGS $arg" - echo $HDF5_FFLAGS | $GREP -e "-I${arg#-L}" >/dev/null \ - || HDF5_FFLAGS="$HDF5_FFLAGS -I${arg#-L}" - ;; - esac - done - - for arg in $HDF5_LIBS - do - case "$arg" in #( - -lhdf5_hl) HDF5_FLIBS="$HDF5_FLIBS -lhdf5hl_fortran $arg" - ;; #( - -lhdf5) HDF5_FLIBS="$HDF5_FLIBS -lhdf5_fortran $arg" - ;; #( - *) HDF5_FLIBS="$HDF5_FLIBS $arg" - ;; - esac - done - else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } - with_hdf5_fortran="no" - fi - - - - + CXXFLAGS="" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#ifdef F77_DUMMY_MAIN +# ifdef __cplusplus + extern "C" +# endif + int F77_DUMMY_MAIN() { return 1; } +#endif +int +main (void) +{ + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_compile "$LINENO" +then : +else $as_nop + ac_cxx_werror_flag=$ac_save_cxx_werror_flag + CXXFLAGS="-g" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#ifdef F77_DUMMY_MAIN +# ifdef __cplusplus + extern "C" +# endif + int F77_DUMMY_MAIN() { return 1; } -printf "%s\n" "#define HAVE_HDF5 1" >>confdefs.h +#endif +int +main (void) +{ - fi + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_compile "$LINENO" +then : + ac_cv_prog_cxx_g=yes fi - - - - - - - -if test "" = "" ; then - netcdf4_requested_mode="serial" -elif test "" = "serial" ; then - netcdf4_requested_mode="serial" -elif test "" = "parallel"; then - netcdf4_requested_mode="parallel" +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + ac_cxx_werror_flag=$ac_save_cxx_werror_flag +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cxx_g" >&5 +printf "%s\n" "$ac_cv_prog_cxx_g" >&6; } +if test $ac_test_CXXFLAGS; then + CXXFLAGS=$ac_save_CXXFLAGS +elif test $ac_cv_prog_cxx_g = yes; then + if test "$GXX" = yes; then + CXXFLAGS="-g -O2" + else + CXXFLAGS="-g" + fi else - as_fn_error $? " -Unrecognized value for AX_LIB_NETCDF4 within configure.ac. -If supplied, argument 1 must be either 'serial' or 'parallel'. -" "$LINENO" 5 + if test "$GXX" = yes; then + CXXFLAGS="-O2" + else + CXXFLAGS= + fi +fi +ac_prog_cxx_stdcxx=no +if test x$ac_prog_cxx_stdcxx = xno +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $CXX option to enable C++11 features" >&5 +printf %s "checking for $CXX option to enable C++11 features... " >&6; } +if test ${ac_cv_prog_cxx_cxx11+y} +then : + printf %s "(cached) " >&6 +else $as_nop + ac_cv_prog_cxx_cxx11=no +ac_save_CXX=$CXX +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$ac_cxx_conftest_cxx11_program +_ACEOF +for ac_arg in '' -std=gnu++11 -std=gnu++0x -std=c++11 -std=c++0x -qlanglvl=extended0x -AA +do + CXX="$ac_save_CXX $ac_arg" + if ac_fn_cxx_try_compile "$LINENO" +then : + ac_cv_prog_cxx_cxx11=$ac_arg +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam + test "x$ac_cv_prog_cxx_cxx11" != "xno" && break +done +rm -f conftest.$ac_ext +CXX=$ac_save_CXX fi - -# Check whether --with-netcdf4 was given. -if test ${with_netcdf4+y} +if test "x$ac_cv_prog_cxx_cxx11" = xno then : - withval=$with_netcdf4; if test "$withval" = "no"; then - with_netcdf4="no" - elif test "$withval" = "yes"; then - with_netcdf4="yes" - else - with_netcdf4="yes" - NETCDF4_PREFIX="${withval}" - NC_CONFIG="${withval}/bin/nc-config" - fi + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 +printf "%s\n" "unsupported" >&6; } else $as_nop - with_netcdf4="yes" + if test "x$ac_cv_prog_cxx_cxx11" = x +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 +printf "%s\n" "none needed" >&6; } +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cxx_cxx11" >&5 +printf "%s\n" "$ac_cv_prog_cxx_cxx11" >&6; } + CXX="$CXX $ac_cv_prog_cxx_cxx11" +fi + ac_cv_prog_cxx_stdcxx=$ac_cv_prog_cxx_cxx11 + ac_prog_cxx_stdcxx=cxx11 +fi +fi +if test x$ac_prog_cxx_stdcxx = xno +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $CXX option to enable C++98 features" >&5 +printf %s "checking for $CXX option to enable C++98 features... " >&6; } +if test ${ac_cv_prog_cxx_cxx98+y} +then : + printf %s "(cached) " >&6 +else $as_nop + ac_cv_prog_cxx_cxx98=no +ac_save_CXX=$CXX +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$ac_cxx_conftest_cxx98_program +_ACEOF +for ac_arg in '' -std=gnu++98 -std=c++98 -qlanglvl=extended -AA +do + CXX="$ac_save_CXX $ac_arg" + if ac_fn_cxx_try_compile "$LINENO" +then : + ac_cv_prog_cxx_cxx98=$ac_arg +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam + test "x$ac_cv_prog_cxx_cxx98" != "xno" && break +done +rm -f conftest.$ac_ext +CXX=$ac_save_CXX +fi +if test "x$ac_cv_prog_cxx_cxx98" = xno +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 +printf "%s\n" "unsupported" >&6; } +else $as_nop + if test "x$ac_cv_prog_cxx_cxx98" = x +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 +printf "%s\n" "none needed" >&6; } +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cxx_cxx98" >&5 +printf "%s\n" "$ac_cv_prog_cxx_cxx98" >&6; } + CXX="$CXX $ac_cv_prog_cxx_cxx98" +fi + ac_cv_prog_cxx_stdcxx=$ac_cv_prog_cxx_cxx98 + ac_prog_cxx_stdcxx=cxx98 +fi fi +ac_ext=cpp +ac_cpp='$CXXCPP $CPPFLAGS' +ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_cxx_compiler_gnu -NETCDF4_CC="" -NETCDF4_VERSION="" -NETCDF4_CFLAGS="" -NETCDF4_CPPFLAGS="" -NETCDF4_LDFLAGS="" -NETCDF4_LIBS="" -NETCDF4_FC="" -NETCDF4_FFLAGS="" -NETCDF4_FLIBS="" -if test "$with_netcdf4" = "yes"; then - if test -z "$NC_CONFIG"; then - for ac_prog in nc-config -do - # Extract the first word of "$ac_prog", so it can be a program name with args. -set dummy $ac_prog; ac_word=$2 +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 +if test -n "$ac_tool_prefix"; then + for ac_prog in gfortran g95 xlf95 f95 fort ifort ifc efc pgfortran pgf95 lf95 ftn nagfor xlf90 f90 pgf90 pghpf epcf90 g77 xlf f77 frt pgf77 cf77 fort77 fl32 af77 + do + # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. +set dummy $ac_tool_prefix$ac_prog; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } -if test ${ac_cv_path_NC_CONFIG+y} +if test ${ac_cv_prog_FC+y} then : printf %s "(cached) " >&6 else $as_nop - case $NC_CONFIG in - [\\/]* | ?:[\\/]*) - ac_cv_path_NC_CONFIG="$NC_CONFIG" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR + if test -n "$FC"; then + ac_cv_prog_FC="$FC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS @@ -14226,7 +14207,7 @@ do esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then - ac_cv_path_NC_CONFIG="$as_dir$ac_word$ac_exec_ext" + ac_cv_prog_FC="$ac_tool_prefix$ac_prog" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi @@ -14234,489 +14215,4135 @@ done done IFS=$as_save_IFS - ;; -esac fi -NC_CONFIG=$ac_cv_path_NC_CONFIG -if test -n "$NC_CONFIG"; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $NC_CONFIG" >&5 -printf "%s\n" "$NC_CONFIG" >&6; } +fi +FC=$ac_cv_prog_FC +if test -n "$FC"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $FC" >&5 +printf "%s\n" "$FC" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi - test -n "$NC_CONFIG" && break -done - - NETCDF4_PREFIX=$($as_dirname -- $($as_dirname -- "$NC_CONFIG" || -$as_expr X"$NC_CONFIG" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ - X"$NC_CONFIG" : 'X\(//\)[^/]' \| \ - X"$NC_CONFIG" : 'X\(//\)$' \| \ - X"$NC_CONFIG" : 'X\(/\)' \| . 2>/dev/null || -printf "%s\n" X"$NC_CONFIG" | - sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ - s//\1/ - q - } - /^X\(\/\/\)[^/].*/{ - s//\1/ - q - } - /^X\(\/\/\)$/{ - s//\1/ - q - } - /^X\(\/\).*/{ - s//\1/ - q - } - s/.*/./; q') || -$as_expr X$($as_dirname -- "$NC_CONFIG" || -$as_expr X"$NC_CONFIG" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ - X"$NC_CONFIG" : 'X\(//\)[^/]' \| \ - X"$NC_CONFIG" : 'X\(//\)$' \| \ - X"$NC_CONFIG" : 'X\(/\)' \| . 2>/dev/null || -printf "%s\n" X"$NC_CONFIG" | - sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ - s//\1/ - q - } - /^X\(\/\/\)[^/].*/{ - s//\1/ - q - } - /^X\(\/\/\)$/{ - s//\1/ - q - } - /^X\(\/\).*/{ - s//\1/ - q - } - s/.*/./; q') : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ - X$($as_dirname -- "$NC_CONFIG" || -$as_expr X"$NC_CONFIG" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ - X"$NC_CONFIG" : 'X\(//\)[^/]' \| \ - X"$NC_CONFIG" : 'X\(//\)$' \| \ - X"$NC_CONFIG" : 'X\(/\)' \| . 2>/dev/null || -printf "%s\n" X"$NC_CONFIG" | - sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ - s//\1/ - q - } - /^X\(\/\/\)[^/].*/{ - s//\1/ - q - } - /^X\(\/\/\)$/{ - s//\1/ - q - } - /^X\(\/\).*/{ - s//\1/ - q - } - s/.*/./; q') : 'X\(//\)[^/]' \| \ - X$($as_dirname -- "$NC_CONFIG" || -$as_expr X"$NC_CONFIG" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ - X"$NC_CONFIG" : 'X\(//\)[^/]' \| \ - X"$NC_CONFIG" : 'X\(//\)$' \| \ - X"$NC_CONFIG" : 'X\(/\)' \| . 2>/dev/null || -printf "%s\n" X"$NC_CONFIG" | - sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ - s//\1/ - q - } - /^X\(\/\/\)[^/].*/{ - s//\1/ - q - } - /^X\(\/\/\)$/{ - s//\1/ - q - } - /^X\(\/\).*/{ - s//\1/ - q - } - s/.*/./; q') : 'X\(//\)$' \| \ - X$($as_dirname -- "$NC_CONFIG" || -$as_expr X"$NC_CONFIG" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ - X"$NC_CONFIG" : 'X\(//\)[^/]' \| \ - X"$NC_CONFIG" : 'X\(//\)$' \| \ - X"$NC_CONFIG" : 'X\(/\)' \| . 2>/dev/null || -printf "%s\n" X"$NC_CONFIG" | - sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ - s//\1/ - q - } - /^X\(\/\/\)[^/].*/{ - s//\1/ - q - } - /^X\(\/\/\)$/{ - s//\1/ - q - } - /^X\(\/\).*/{ - s//\1/ - q - } - s/.*/./; q') : 'X\(/\)' \| . 2>/dev/null || -printf "%s\n" X$($as_dirname -- "$NC_CONFIG" || -$as_expr X"$NC_CONFIG" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ - X"$NC_CONFIG" : 'X\(//\)[^/]' \| \ - X"$NC_CONFIG" : 'X\(//\)$' \| \ - X"$NC_CONFIG" : 'X\(/\)' \| . 2>/dev/null || -printf "%s\n" X"$NC_CONFIG" | - sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ - s//\1/ - q - } - /^X\(\/\/\)[^/].*/{ - s//\1/ - q - } - /^X\(\/\/\)$/{ - s//\1/ - q - } - /^X\(\/\).*/{ - s//\1/ - q - } - s/.*/./; q') | - sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ - s//\1/ - q - } - /^X\(\/\/\)[^/].*/{ - s//\1/ - q - } - /^X\(\/\/\)$/{ - s//\1/ - q - } - /^X\(\/\).*/{ - s//\1/ - q - } - s/.*/./; q') + test -n "$FC" && break + done +fi +if test -z "$FC"; then + ac_ct_FC=$FC + for ac_prog in gfortran g95 xlf95 f95 fort ifort ifc efc pgfortran pgf95 lf95 ftn nagfor xlf90 f90 pgf90 pghpf epcf90 g77 xlf f77 frt pgf77 cf77 fort77 fl32 af77 +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_ac_ct_FC+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if test -n "$ac_ct_FC"; then + ac_cv_prog_ac_ct_FC="$ac_ct_FC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_FC="$ac_prog" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_FC=$ac_cv_prog_ac_ct_FC +if test -n "$ac_ct_FC"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_FC" >&5 +printf "%s\n" "$ac_ct_FC" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + + test -n "$ac_ct_FC" && break +done + + if test "x$ac_ct_FC" = x; then + FC="" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + FC=$ac_ct_FC + fi +fi + + +# Provide some information about the compiler. +printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for Fortran compiler version" >&5 +set X $ac_compile +ac_compiler=$2 +for ac_option in --version -v -V -qversion; do + { { ac_try="$ac_compiler $ac_option >&5" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +printf "%s\n" "$ac_try_echo"; } >&5 + (eval "$ac_compiler $ac_option >&5") 2>conftest.err + ac_status=$? + if test -s conftest.err; then + sed '10a\ +... rest of stderr output deleted ... + 10q' conftest.err >conftest.er1 + cat conftest.er1 >&5 + fi + rm -f conftest.er1 conftest.err + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } +done +rm -f a.out + +# If we don't use `.F' as extension, the preprocessor is not run on the +# input file. (Note that this only needs to work for GNU compilers.) +ac_save_ext=$ac_ext +ac_ext=F +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether the compiler supports GNU Fortran" >&5 +printf %s "checking whether the compiler supports GNU Fortran... " >&6; } +if test ${ac_cv_fc_compiler_gnu+y} +then : + printf %s "(cached) " >&6 +else $as_nop + cat > conftest.$ac_ext <<_ACEOF + program main +#ifndef __GNUC__ + choke me +#endif + + end +_ACEOF +if ac_fn_fc_try_compile "$LINENO" +then : + ac_compiler_gnu=yes +else $as_nop + ac_compiler_gnu=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +ac_cv_fc_compiler_gnu=$ac_compiler_gnu + +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_fc_compiler_gnu" >&5 +printf "%s\n" "$ac_cv_fc_compiler_gnu" >&6; } +ac_compiler_gnu=$ac_cv_fc_compiler_gnu + +ac_ext=$ac_save_ext +ac_test_FCFLAGS=${FCFLAGS+y} +ac_save_FCFLAGS=$FCFLAGS +FCFLAGS= +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $FC accepts -g" >&5 +printf %s "checking whether $FC accepts -g... " >&6; } +if test ${ac_cv_prog_fc_g+y} +then : + printf %s "(cached) " >&6 +else $as_nop + FCFLAGS=-g +cat > conftest.$ac_ext <<_ACEOF + program main + + end +_ACEOF +if ac_fn_fc_try_compile "$LINENO" +then : + ac_cv_prog_fc_g=yes +else $as_nop + ac_cv_prog_fc_g=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_fc_g" >&5 +printf "%s\n" "$ac_cv_prog_fc_g" >&6; } +if test $ac_test_FCFLAGS; then + FCFLAGS=$ac_save_FCFLAGS +elif test $ac_cv_prog_fc_g = yes; then + if test "x$ac_cv_fc_compiler_gnu" = xyes; then + FCFLAGS="-g -O2" + else + FCFLAGS="-g" + fi +else + if test "x$ac_cv_fc_compiler_gnu" = xyes; then + FCFLAGS="-O2" + else + FCFLAGS= + fi +fi + +if test $ac_compiler_gnu = yes; then + GFC=yes +else + GFC= +fi +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 + + + + amuse_h5_detect_C="no" + + + amuse_h5_result="no" + + if test -n "$CONDA_PREFIX" + then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: Conda environment detected, ignoring HDF5_ROOT, HDF5_DIR and CMAKE_PREFIX_PATH" >&5 +printf "%s\n" "$as_me: Conda environment detected, ignoring HDF5_ROOT, HDF5_DIR and CMAKE_PREFIX_PATH" >&6;} + else + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether HDF5_ROOT points to an HDF5 installation" >&5 +printf %s "checking whether HDF5_ROOT points to an HDF5 installation... " >&6; } + if test -z "$HDF5_ROOT" + then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + elif test -f "$HDF5_ROOT/bin/h5pcc" + then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no, because this seems to be a parallel build" >&5 +printf "%s\n" "no, because this seems to be a parallel build" >&6; } + else + if test -f "$HDF5_ROOT/include/hdf5.h" && test -f "$HDF5_ROOT/lib/libhdf5.so" + then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + amuse_h5_result="yes" + amuse_h5_root="$HDF5_ROOT" + else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + amuse_h5_result="no" + fi + fi + + + if test "$amuse_h5_result" = "no" + then + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether HDF5_DIR points to an HDF5 installation" >&5 +printf %s "checking whether HDF5_DIR points to an HDF5 installation... " >&6; } + if test -z "$HDF5_DIR" + then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + elif test -f "$HDF5_DIR/bin/h5pcc" + then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no, because this seems to be a parallel build" >&5 +printf "%s\n" "no, because this seems to be a parallel build" >&6; } + else + if test -f "$HDF5_DIR/include/hdf5.h" && test -f "$HDF5_DIR/lib/libhdf5.so" + then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + amuse_h5_result="yes" + amuse_h5_root="$HDF5_DIR" + else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + amuse_h5_result="no" + fi + fi + + fi + + if test "$amuse_h5_result" = "no" && test -n "$CMAKE_PREFIX_PATH" + then + amuse_h5_save_IFS="$IFS" + IFS=: + for amuse_h5_path in $CMAKE_PREFIX_PATH + do + # restore IFS immediately as it may mess up the below + IFS="$amuse_h5_save_IFS" + if test -z "$amuse_h5_path" + then + continue + fi + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $amuse_h5_path from CMAKE_PREFIX_PATH points to an HDF5 installation" >&5 +printf %s "checking whether $amuse_h5_path from CMAKE_PREFIX_PATH points to an HDF5 installation... " >&6; } + if test -z "$amuse_h5_path" + then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + elif test -f "$amuse_h5_path/bin/h5pcc" + then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no, because this seems to be a parallel build" >&5 +printf "%s\n" "no, because this seems to be a parallel build" >&6; } + else + if test -f "$amuse_h5_path/include/hdf5.h" && test -f "$amuse_h5_path/lib/libhdf5.so" + then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + amuse_h5_result="yes" + amuse_h5_root="$amuse_h5_path" + else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + amuse_h5_result="no" + fi + fi + + + if test "$amuse_h5_result" = "yes" + then + break + fi + + done + IFS="$amuse_h5_save_IFS" + fi + + if test "$amuse_h5_result" = "yes" + then + + amuse_h5_LDFLAGS="-L$amuse_h5_root/lib" + + 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 + + amuse_h5_CFLAGS="-I$amuse_h5_root/include" + + amuse_h5_name="C" + amuse_h5_prefix="C" + amuse_h5_target="C" + amuse_h5_program="#include +#ifdef F77_DUMMY_MAIN + +# ifdef __cplusplus + extern "C" +# endif + int F77_DUMMY_MAIN() { return 1; } + +#endif +int +main (void) +{ +H5open(); H5close(); + ; + return 0; +}" + amuse_h5_libs="-lhdf5" + + amuse_h5_flags_var="${amuse_h5_prefix}FLAGS" + amuse_h5_flags_source_var="amuse_h5_${amuse_h5_flags_var}" + amuse_h5_flags_target_var="amuse_h5_detect_${amuse_h5_target}" + + eval "amuse_h5_save_FLAGS=\"\$$amuse_h5_flags_var\"" + amuse_h5_save_LDFLAGS="$LDFLAGS" + amuse_h5_save_LIBS="$LIBS" + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether we can build a program with HDF5 in $amuse_h5_name" >&5 +printf %s "checking whether we can build a program with HDF5 in $amuse_h5_name... " >&6; } + + eval "$amuse_h5_flags_var=\"\$$amuse_h5_flags_source_var \$$amuse_h5_flags_var\"" + LDFLAGS="$amuse_h5_LDFLAGS $LDFLAGS" + LIBS="$amuse_h5_libs" + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$amuse_h5_program +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + + eval "$amuse_h5_flags_target_var=\"yes\"" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + +else $as_nop + + eval "$amuse_h5_flags_target_var=\"no\"" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext + + LIBS="$amuse_h5_save_LIBS" + LDFLAGS="$amuse_h5_save_LDFLAGS" + eval "$amuse_h5_flags_var=\"\$amuse_h5_save_FLAGS\"" + + + + amuse_h5_name="C with the high-level API" + amuse_h5_prefix="C" + amuse_h5_target="HL_C" + amuse_h5_program="#include +#ifdef F77_DUMMY_MAIN + +# ifdef __cplusplus + extern "C" +# endif + int F77_DUMMY_MAIN() { return 1; } + +#endif +int +main (void) +{ +H5LTfind_dataset(0, \"test\") + ; + return 0; +}" + amuse_h5_libs="-lhdf5_hl" + + amuse_h5_flags_var="${amuse_h5_prefix}FLAGS" + amuse_h5_flags_source_var="amuse_h5_${amuse_h5_flags_var}" + amuse_h5_flags_target_var="amuse_h5_detect_${amuse_h5_target}" + + eval "amuse_h5_save_FLAGS=\"\$$amuse_h5_flags_var\"" + amuse_h5_save_LDFLAGS="$LDFLAGS" + amuse_h5_save_LIBS="$LIBS" + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether we can build a program with HDF5 in $amuse_h5_name" >&5 +printf %s "checking whether we can build a program with HDF5 in $amuse_h5_name... " >&6; } + + eval "$amuse_h5_flags_var=\"\$$amuse_h5_flags_source_var \$$amuse_h5_flags_var\"" + LDFLAGS="$amuse_h5_LDFLAGS $LDFLAGS" + LIBS="$amuse_h5_libs" + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$amuse_h5_program +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + + eval "$amuse_h5_flags_target_var=\"yes\"" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + +else $as_nop + + eval "$amuse_h5_flags_target_var=\"no\"" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext + + LIBS="$amuse_h5_save_LIBS" + LDFLAGS="$amuse_h5_save_LDFLAGS" + eval "$amuse_h5_flags_var=\"\$amuse_h5_save_FLAGS\"" + + 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 + + + ac_ext=cpp +ac_cpp='$CXXCPP $CPPFLAGS' +ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_cxx_compiler_gnu + + amuse_h5_CXXFLAGS="-I$amuse_h5_root/include" + + amuse_h5_name="C++" + amuse_h5_prefix="CXX" + amuse_h5_target="CXX" + amuse_h5_program="#include +#ifdef F77_DUMMY_MAIN + +# ifdef __cplusplus + extern "C" +# endif + int F77_DUMMY_MAIN() { return 1; } + +#endif +int +main (void) +{ +H5::H5Library::open(); + ; + return 0; +}" + amuse_h5_libs="-lhdf5_cpp" + + amuse_h5_flags_var="${amuse_h5_prefix}FLAGS" + amuse_h5_flags_source_var="amuse_h5_${amuse_h5_flags_var}" + amuse_h5_flags_target_var="amuse_h5_detect_${amuse_h5_target}" + + eval "amuse_h5_save_FLAGS=\"\$$amuse_h5_flags_var\"" + amuse_h5_save_LDFLAGS="$LDFLAGS" + amuse_h5_save_LIBS="$LIBS" + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether we can build a program with HDF5 in $amuse_h5_name" >&5 +printf %s "checking whether we can build a program with HDF5 in $amuse_h5_name... " >&6; } + + eval "$amuse_h5_flags_var=\"\$$amuse_h5_flags_source_var \$$amuse_h5_flags_var\"" + LDFLAGS="$amuse_h5_LDFLAGS $LDFLAGS" + LIBS="$amuse_h5_libs" + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$amuse_h5_program +_ACEOF +if ac_fn_cxx_try_link "$LINENO" +then : + + eval "$amuse_h5_flags_target_var=\"yes\"" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + +else $as_nop + + eval "$amuse_h5_flags_target_var=\"no\"" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext + + LIBS="$amuse_h5_save_LIBS" + LDFLAGS="$amuse_h5_save_LDFLAGS" + eval "$amuse_h5_flags_var=\"\$amuse_h5_save_FLAGS\"" + + 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 + + + amuse_h5_FCFLAGS="-I$amuse_h5_root/include" + + 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 + + + amuse_h5_name="Fortran with mods in /include" + amuse_h5_prefix="FC" + amuse_h5_target="FC" + amuse_h5_program=" program main + + use h5lib + + integer :: error + + call h5open_f(error) + call h5close_f(error) + end" + amuse_h5_libs="-lhdf5_fortran" + + amuse_h5_flags_var="${amuse_h5_prefix}FLAGS" + amuse_h5_flags_source_var="amuse_h5_${amuse_h5_flags_var}" + amuse_h5_flags_target_var="amuse_h5_detect_${amuse_h5_target}" + + eval "amuse_h5_save_FLAGS=\"\$$amuse_h5_flags_var\"" + amuse_h5_save_LDFLAGS="$LDFLAGS" + amuse_h5_save_LIBS="$LIBS" + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether we can build a program with HDF5 in $amuse_h5_name" >&5 +printf %s "checking whether we can build a program with HDF5 in $amuse_h5_name... " >&6; } + + eval "$amuse_h5_flags_var=\"\$$amuse_h5_flags_source_var \$$amuse_h5_flags_var\"" + LDFLAGS="$amuse_h5_LDFLAGS $LDFLAGS" + LIBS="$amuse_h5_libs" + + cat > conftest.$ac_ext <<_ACEOF +$amuse_h5_program +_ACEOF +if ac_fn_fc_try_link "$LINENO" +then : + + eval "$amuse_h5_flags_target_var=\"yes\"" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + +else $as_nop + + eval "$amuse_h5_flags_target_var=\"no\"" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext + + LIBS="$amuse_h5_save_LIBS" + LDFLAGS="$amuse_h5_save_LDFLAGS" + eval "$amuse_h5_flags_var=\"\$amuse_h5_save_FLAGS\"" + + + + amuse_h5_name="Fortran with the high-level API in hdf5_hl_fortran with mods in /include" + amuse_h5_prefix="FC" + amuse_h5_target="HL_FC" + amuse_h5_program=" program main + + use h5lt + + integer :: error + + error = h5ltfind_dataset_f(0_hid_t, 'test') + + end" + amuse_h5_libs="-lhdf5_hl_fortran" + + amuse_h5_flags_var="${amuse_h5_prefix}FLAGS" + amuse_h5_flags_source_var="amuse_h5_${amuse_h5_flags_var}" + amuse_h5_flags_target_var="amuse_h5_detect_${amuse_h5_target}" + + eval "amuse_h5_save_FLAGS=\"\$$amuse_h5_flags_var\"" + amuse_h5_save_LDFLAGS="$LDFLAGS" + amuse_h5_save_LIBS="$LIBS" + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether we can build a program with HDF5 in $amuse_h5_name" >&5 +printf %s "checking whether we can build a program with HDF5 in $amuse_h5_name... " >&6; } + + eval "$amuse_h5_flags_var=\"\$$amuse_h5_flags_source_var \$$amuse_h5_flags_var\"" + LDFLAGS="$amuse_h5_LDFLAGS $LDFLAGS" + LIBS="$amuse_h5_libs" + + cat > conftest.$ac_ext <<_ACEOF +$amuse_h5_program +_ACEOF +if ac_fn_fc_try_link "$LINENO" +then : + + eval "$amuse_h5_flags_target_var=\"yes\"" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + +else $as_nop + + eval "$amuse_h5_flags_target_var=\"no\"" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext + + LIBS="$amuse_h5_save_LIBS" + LDFLAGS="$amuse_h5_save_LDFLAGS" + eval "$amuse_h5_flags_var=\"\$amuse_h5_save_FLAGS\"" + + + if test $amuse_h5_detect_HL_FC = "yes" + then + amuse_h5_HL_FC_LIB="-lhdf5_hl_fortran" + else + + amuse_h5_name="Fortran with the high-level API in hdf5hl_fortran with mods in /include" + amuse_h5_prefix="FC" + amuse_h5_target="HL_FC" + amuse_h5_program=" program main + + use h5lt + + integer :: error + + error = h5ltfind_dataset_f(0_hid_t, 'test') + + end" + amuse_h5_libs="-lhdf5hl_fortran" + + amuse_h5_flags_var="${amuse_h5_prefix}FLAGS" + amuse_h5_flags_source_var="amuse_h5_${amuse_h5_flags_var}" + amuse_h5_flags_target_var="amuse_h5_detect_${amuse_h5_target}" + + eval "amuse_h5_save_FLAGS=\"\$$amuse_h5_flags_var\"" + amuse_h5_save_LDFLAGS="$LDFLAGS" + amuse_h5_save_LIBS="$LIBS" + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether we can build a program with HDF5 in $amuse_h5_name" >&5 +printf %s "checking whether we can build a program with HDF5 in $amuse_h5_name... " >&6; } + + eval "$amuse_h5_flags_var=\"\$$amuse_h5_flags_source_var \$$amuse_h5_flags_var\"" + LDFLAGS="$amuse_h5_LDFLAGS $LDFLAGS" + LIBS="$amuse_h5_libs" + + cat > conftest.$ac_ext <<_ACEOF +$amuse_h5_program +_ACEOF +if ac_fn_fc_try_link "$LINENO" +then : + + eval "$amuse_h5_flags_target_var=\"yes\"" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + +else $as_nop + + eval "$amuse_h5_flags_target_var=\"no\"" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext + + LIBS="$amuse_h5_save_LIBS" + LDFLAGS="$amuse_h5_save_LDFLAGS" + eval "$amuse_h5_flags_var=\"\$amuse_h5_save_FLAGS\"" + + + if test $amuse_h5_detect_HL_FC = "yes" + then + amuse_h5_HL_FC_LIB="-lhdf5hl_fortran" + fi + fi + + 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 + + + + if test $amuse_h5_detect_FC = "no" + then + amuse_h5_FCFLAGS="-I$amuse_h5_root/mod/shared" + + 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 + + + amuse_h5_name="Fortran with mods in /mod/shared" + amuse_h5_prefix="FC" + amuse_h5_target="FC" + amuse_h5_program=" program main + + use h5lib + + integer :: error + + call h5open_f(error) + call h5close_f(error) + end" + amuse_h5_libs="-lhdf5_fortran" + + amuse_h5_flags_var="${amuse_h5_prefix}FLAGS" + amuse_h5_flags_source_var="amuse_h5_${amuse_h5_flags_var}" + amuse_h5_flags_target_var="amuse_h5_detect_${amuse_h5_target}" + + eval "amuse_h5_save_FLAGS=\"\$$amuse_h5_flags_var\"" + amuse_h5_save_LDFLAGS="$LDFLAGS" + amuse_h5_save_LIBS="$LIBS" + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether we can build a program with HDF5 in $amuse_h5_name" >&5 +printf %s "checking whether we can build a program with HDF5 in $amuse_h5_name... " >&6; } + + eval "$amuse_h5_flags_var=\"\$$amuse_h5_flags_source_var \$$amuse_h5_flags_var\"" + LDFLAGS="$amuse_h5_LDFLAGS $LDFLAGS" + LIBS="$amuse_h5_libs" + + cat > conftest.$ac_ext <<_ACEOF +$amuse_h5_program +_ACEOF +if ac_fn_fc_try_link "$LINENO" +then : + + eval "$amuse_h5_flags_target_var=\"yes\"" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + +else $as_nop + + eval "$amuse_h5_flags_target_var=\"no\"" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext + + LIBS="$amuse_h5_save_LIBS" + LDFLAGS="$amuse_h5_save_LDFLAGS" + eval "$amuse_h5_flags_var=\"\$amuse_h5_save_FLAGS\"" + + + + amuse_h5_name="Fortran with the high-level API in hdf5_hl_fortran with mods in /mod/shared" + amuse_h5_prefix="FC" + amuse_h5_target="HL_FC" + amuse_h5_program=" program main + + use h5lt + + integer :: error + + error = h5ltfind_dataset_f(0_hid_t, 'test') + + end" + amuse_h5_libs="-lhdf5_hl_fortran" + + amuse_h5_flags_var="${amuse_h5_prefix}FLAGS" + amuse_h5_flags_source_var="amuse_h5_${amuse_h5_flags_var}" + amuse_h5_flags_target_var="amuse_h5_detect_${amuse_h5_target}" + + eval "amuse_h5_save_FLAGS=\"\$$amuse_h5_flags_var\"" + amuse_h5_save_LDFLAGS="$LDFLAGS" + amuse_h5_save_LIBS="$LIBS" + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether we can build a program with HDF5 in $amuse_h5_name" >&5 +printf %s "checking whether we can build a program with HDF5 in $amuse_h5_name... " >&6; } + + eval "$amuse_h5_flags_var=\"\$$amuse_h5_flags_source_var \$$amuse_h5_flags_var\"" + LDFLAGS="$amuse_h5_LDFLAGS $LDFLAGS" + LIBS="$amuse_h5_libs" + + cat > conftest.$ac_ext <<_ACEOF +$amuse_h5_program +_ACEOF +if ac_fn_fc_try_link "$LINENO" +then : + + eval "$amuse_h5_flags_target_var=\"yes\"" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + +else $as_nop + + eval "$amuse_h5_flags_target_var=\"no\"" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext + + LIBS="$amuse_h5_save_LIBS" + LDFLAGS="$amuse_h5_save_LDFLAGS" + eval "$amuse_h5_flags_var=\"\$amuse_h5_save_FLAGS\"" + + + if test $amuse_h5_detect_HL_FC = "yes" + then + amuse_h5_HL_FC_LIB="-lhdf5_hl_fortran" + else + + amuse_h5_name="Fortran with the high-level API in hdf5hl_fortran with mods in /mod/shared" + amuse_h5_prefix="FC" + amuse_h5_target="HL_FC" + amuse_h5_program=" program main + + use h5lt + + integer :: error + + error = h5ltfind_dataset_f(0_hid_t, 'test') + + end" + amuse_h5_libs="-lhdf5hl_fortran" + + amuse_h5_flags_var="${amuse_h5_prefix}FLAGS" + amuse_h5_flags_source_var="amuse_h5_${amuse_h5_flags_var}" + amuse_h5_flags_target_var="amuse_h5_detect_${amuse_h5_target}" + + eval "amuse_h5_save_FLAGS=\"\$$amuse_h5_flags_var\"" + amuse_h5_save_LDFLAGS="$LDFLAGS" + amuse_h5_save_LIBS="$LIBS" + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether we can build a program with HDF5 in $amuse_h5_name" >&5 +printf %s "checking whether we can build a program with HDF5 in $amuse_h5_name... " >&6; } + + eval "$amuse_h5_flags_var=\"\$$amuse_h5_flags_source_var \$$amuse_h5_flags_var\"" + LDFLAGS="$amuse_h5_LDFLAGS $LDFLAGS" + LIBS="$amuse_h5_libs" + + cat > conftest.$ac_ext <<_ACEOF +$amuse_h5_program +_ACEOF +if ac_fn_fc_try_link "$LINENO" +then : + + eval "$amuse_h5_flags_target_var=\"yes\"" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + +else $as_nop + + eval "$amuse_h5_flags_target_var=\"no\"" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext + + LIBS="$amuse_h5_save_LIBS" + LDFLAGS="$amuse_h5_save_LDFLAGS" + eval "$amuse_h5_flags_var=\"\$amuse_h5_save_FLAGS\"" + + + if test $amuse_h5_detect_HL_FC = "yes" + then + amuse_h5_HL_FC_LIB="-lhdf5hl_fortran" + fi + fi + + 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 test $amuse_h5_detect_FC = "no" + then + amuse_h5_FCFLAGS="" + fi + + fi + fi + + + if test "$amuse_h5_detect_C" = "no" + then + + amuse_h5_LDFLAGS="" + + 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 + + amuse_h5_CFLAGS="" + + amuse_h5_name="C with no additional flags" + amuse_h5_prefix="C" + amuse_h5_target="C" + amuse_h5_program="#include +#ifdef F77_DUMMY_MAIN + +# ifdef __cplusplus + extern "C" +# endif + int F77_DUMMY_MAIN() { return 1; } + +#endif +int +main (void) +{ +H5open(); H5close(); + ; + return 0; +}" + amuse_h5_libs="-lhdf5" + + amuse_h5_flags_var="${amuse_h5_prefix}FLAGS" + amuse_h5_flags_source_var="amuse_h5_${amuse_h5_flags_var}" + amuse_h5_flags_target_var="amuse_h5_detect_${amuse_h5_target}" + + eval "amuse_h5_save_FLAGS=\"\$$amuse_h5_flags_var\"" + amuse_h5_save_LDFLAGS="$LDFLAGS" + amuse_h5_save_LIBS="$LIBS" + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether we can build a program with HDF5 in $amuse_h5_name" >&5 +printf %s "checking whether we can build a program with HDF5 in $amuse_h5_name... " >&6; } + + eval "$amuse_h5_flags_var=\"\$$amuse_h5_flags_source_var \$$amuse_h5_flags_var\"" + LDFLAGS="$amuse_h5_LDFLAGS $LDFLAGS" + LIBS="$amuse_h5_libs" + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$amuse_h5_program +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + + eval "$amuse_h5_flags_target_var=\"yes\"" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + +else $as_nop + + eval "$amuse_h5_flags_target_var=\"no\"" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext + + LIBS="$amuse_h5_save_LIBS" + LDFLAGS="$amuse_h5_save_LDFLAGS" + eval "$amuse_h5_flags_var=\"\$amuse_h5_save_FLAGS\"" + + 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 + + + if test $amuse_h5_detect_C = "yes" + then + 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 + + + amuse_h5_name="C with the high-level API" + amuse_h5_prefix="C" + amuse_h5_target="HL_C" + amuse_h5_program="#include +#ifdef F77_DUMMY_MAIN + +# ifdef __cplusplus + extern "C" +# endif + int F77_DUMMY_MAIN() { return 1; } + +#endif +int +main (void) +{ +H5LTfind_dataset(0, \"test\") + ; + return 0; +}" + amuse_h5_libs="-lhdf5_hl" + + amuse_h5_flags_var="${amuse_h5_prefix}FLAGS" + amuse_h5_flags_source_var="amuse_h5_${amuse_h5_flags_var}" + amuse_h5_flags_target_var="amuse_h5_detect_${amuse_h5_target}" + + eval "amuse_h5_save_FLAGS=\"\$$amuse_h5_flags_var\"" + amuse_h5_save_LDFLAGS="$LDFLAGS" + amuse_h5_save_LIBS="$LIBS" + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether we can build a program with HDF5 in $amuse_h5_name" >&5 +printf %s "checking whether we can build a program with HDF5 in $amuse_h5_name... " >&6; } + + eval "$amuse_h5_flags_var=\"\$$amuse_h5_flags_source_var \$$amuse_h5_flags_var\"" + LDFLAGS="$amuse_h5_LDFLAGS $LDFLAGS" + LIBS="$amuse_h5_libs" + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$amuse_h5_program +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + + eval "$amuse_h5_flags_target_var=\"yes\"" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + +else $as_nop + + eval "$amuse_h5_flags_target_var=\"no\"" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext + + LIBS="$amuse_h5_save_LIBS" + LDFLAGS="$amuse_h5_save_LDFLAGS" + eval "$amuse_h5_flags_var=\"\$amuse_h5_save_FLAGS\"" + + 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 + + + ac_ext=cpp +ac_cpp='$CXXCPP $CPPFLAGS' +ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_cxx_compiler_gnu + + + amuse_h5_name="C++" + amuse_h5_prefix="CXX" + amuse_h5_target="CXX" + amuse_h5_program="#include +#ifdef F77_DUMMY_MAIN + +# ifdef __cplusplus + extern "C" +# endif + int F77_DUMMY_MAIN() { return 1; } + +#endif +int +main (void) +{ +H5::H5Library::open(); + ; + return 0; +}" + amuse_h5_libs="-lhdf5_cpp" + + amuse_h5_flags_var="${amuse_h5_prefix}FLAGS" + amuse_h5_flags_source_var="amuse_h5_${amuse_h5_flags_var}" + amuse_h5_flags_target_var="amuse_h5_detect_${amuse_h5_target}" + + eval "amuse_h5_save_FLAGS=\"\$$amuse_h5_flags_var\"" + amuse_h5_save_LDFLAGS="$LDFLAGS" + amuse_h5_save_LIBS="$LIBS" + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether we can build a program with HDF5 in $amuse_h5_name" >&5 +printf %s "checking whether we can build a program with HDF5 in $amuse_h5_name... " >&6; } + + eval "$amuse_h5_flags_var=\"\$$amuse_h5_flags_source_var \$$amuse_h5_flags_var\"" + LDFLAGS="$amuse_h5_LDFLAGS $LDFLAGS" + LIBS="$amuse_h5_libs" + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$amuse_h5_program +_ACEOF +if ac_fn_cxx_try_link "$LINENO" +then : + + eval "$amuse_h5_flags_target_var=\"yes\"" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + +else $as_nop + + eval "$amuse_h5_flags_target_var=\"no\"" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext + + LIBS="$amuse_h5_save_LIBS" + LDFLAGS="$amuse_h5_save_LDFLAGS" + eval "$amuse_h5_flags_var=\"\$amuse_h5_save_FLAGS\"" + + 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 + + + + 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 + + + amuse_h5_name="Fortran " + amuse_h5_prefix="FC" + amuse_h5_target="FC" + amuse_h5_program=" program main + + use h5lib + + integer :: error + + call h5open_f(error) + call h5close_f(error) + end" + amuse_h5_libs="-lhdf5_fortran" + + amuse_h5_flags_var="${amuse_h5_prefix}FLAGS" + amuse_h5_flags_source_var="amuse_h5_${amuse_h5_flags_var}" + amuse_h5_flags_target_var="amuse_h5_detect_${amuse_h5_target}" + + eval "amuse_h5_save_FLAGS=\"\$$amuse_h5_flags_var\"" + amuse_h5_save_LDFLAGS="$LDFLAGS" + amuse_h5_save_LIBS="$LIBS" + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether we can build a program with HDF5 in $amuse_h5_name" >&5 +printf %s "checking whether we can build a program with HDF5 in $amuse_h5_name... " >&6; } + + eval "$amuse_h5_flags_var=\"\$$amuse_h5_flags_source_var \$$amuse_h5_flags_var\"" + LDFLAGS="$amuse_h5_LDFLAGS $LDFLAGS" + LIBS="$amuse_h5_libs" + + cat > conftest.$ac_ext <<_ACEOF +$amuse_h5_program +_ACEOF +if ac_fn_fc_try_link "$LINENO" +then : + + eval "$amuse_h5_flags_target_var=\"yes\"" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + +else $as_nop + + eval "$amuse_h5_flags_target_var=\"no\"" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext + + LIBS="$amuse_h5_save_LIBS" + LDFLAGS="$amuse_h5_save_LDFLAGS" + eval "$amuse_h5_flags_var=\"\$amuse_h5_save_FLAGS\"" + + + + amuse_h5_name="Fortran with the high-level API in hdf5_hl_fortran " + amuse_h5_prefix="FC" + amuse_h5_target="HL_FC" + amuse_h5_program=" program main + + use h5lt + + integer :: error + + error = h5ltfind_dataset_f(0_hid_t, 'test') + + end" + amuse_h5_libs="-lhdf5_hl_fortran" + + amuse_h5_flags_var="${amuse_h5_prefix}FLAGS" + amuse_h5_flags_source_var="amuse_h5_${amuse_h5_flags_var}" + amuse_h5_flags_target_var="amuse_h5_detect_${amuse_h5_target}" + + eval "amuse_h5_save_FLAGS=\"\$$amuse_h5_flags_var\"" + amuse_h5_save_LDFLAGS="$LDFLAGS" + amuse_h5_save_LIBS="$LIBS" + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether we can build a program with HDF5 in $amuse_h5_name" >&5 +printf %s "checking whether we can build a program with HDF5 in $amuse_h5_name... " >&6; } + + eval "$amuse_h5_flags_var=\"\$$amuse_h5_flags_source_var \$$amuse_h5_flags_var\"" + LDFLAGS="$amuse_h5_LDFLAGS $LDFLAGS" + LIBS="$amuse_h5_libs" + + cat > conftest.$ac_ext <<_ACEOF +$amuse_h5_program +_ACEOF +if ac_fn_fc_try_link "$LINENO" +then : + + eval "$amuse_h5_flags_target_var=\"yes\"" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + +else $as_nop + + eval "$amuse_h5_flags_target_var=\"no\"" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext + + LIBS="$amuse_h5_save_LIBS" + LDFLAGS="$amuse_h5_save_LDFLAGS" + eval "$amuse_h5_flags_var=\"\$amuse_h5_save_FLAGS\"" + + + if test $amuse_h5_detect_HL_FC = "yes" + then + amuse_h5_HL_FC_LIB="-lhdf5_hl_fortran" + else + + amuse_h5_name="Fortran with the high-level API in hdf5hl_fortran " + amuse_h5_prefix="FC" + amuse_h5_target="HL_FC" + amuse_h5_program=" program main + + use h5lt + + integer :: error + + error = h5ltfind_dataset_f(0_hid_t, 'test') + + end" + amuse_h5_libs="-lhdf5hl_fortran" + + amuse_h5_flags_var="${amuse_h5_prefix}FLAGS" + amuse_h5_flags_source_var="amuse_h5_${amuse_h5_flags_var}" + amuse_h5_flags_target_var="amuse_h5_detect_${amuse_h5_target}" + + eval "amuse_h5_save_FLAGS=\"\$$amuse_h5_flags_var\"" + amuse_h5_save_LDFLAGS="$LDFLAGS" + amuse_h5_save_LIBS="$LIBS" + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether we can build a program with HDF5 in $amuse_h5_name" >&5 +printf %s "checking whether we can build a program with HDF5 in $amuse_h5_name... " >&6; } + + eval "$amuse_h5_flags_var=\"\$$amuse_h5_flags_source_var \$$amuse_h5_flags_var\"" + LDFLAGS="$amuse_h5_LDFLAGS $LDFLAGS" + LIBS="$amuse_h5_libs" + + cat > conftest.$ac_ext <<_ACEOF +$amuse_h5_program +_ACEOF +if ac_fn_fc_try_link "$LINENO" +then : + + eval "$amuse_h5_flags_target_var=\"yes\"" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + +else $as_nop + + eval "$amuse_h5_flags_target_var=\"no\"" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext + + LIBS="$amuse_h5_save_LIBS" + LDFLAGS="$amuse_h5_save_LDFLAGS" + eval "$amuse_h5_flags_var=\"\$amuse_h5_save_FLAGS\"" + + + if test $amuse_h5_detect_HL_FC = "yes" + then + amuse_h5_HL_FC_LIB="-lhdf5hl_fortran" + fi + fi + + 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 + + + + if test $amuse_h5_detect_FC = "no" + then + + amuse_h5_result="" + amuse_h5_in_isystem="no" + for flag in $FFLAGS + do + if test "$amuse_h5_in_isystem" = "yes" + then + if ! echo "$amuse_h5_result" | grep -e "$flag" >/dev/null 2>&1 + then + amuse_h5_result="$amuse_h5_result:$flag" + fi + amuse_h5_in_isystem="no" + continue + fi + + if test "$flag" = "-isystem" + then + amuse_h5_in_isystem="yes" + elif test "${flag#-I}" != "$flag" + then + amuse_h5_path="${flag#-I}" + if ! echo "$amuse_h5_result" | grep -e "$amuse_h5_path" >/dev/null 2>&1 + then + amuse_h5_result="$amuse_h5_result:${flag#-I}" + fi + fi + done + + + amuse_h5_save_IFS="$IFS" + IFS=: + for amuse_h5_path in $amuse_h5_result + do + # need to restore IFS immediately as it messes up the below + IFS="$amuse_h5_save_IFS" + if test -z "$amuse_h5_path" + then + continue + fi + + amuse_h5_FCFLAGS="$FCFLAGS -I$amuse_h5_path" + + 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 + + + amuse_h5_name="Fortran with $amuse_h5_path from FFLAGS" + amuse_h5_prefix="FC" + amuse_h5_target="FC" + amuse_h5_program=" program main + + use h5lib + + integer :: error + + call h5open_f(error) + call h5close_f(error) + end" + amuse_h5_libs="-lhdf5_fortran" + + amuse_h5_flags_var="${amuse_h5_prefix}FLAGS" + amuse_h5_flags_source_var="amuse_h5_${amuse_h5_flags_var}" + amuse_h5_flags_target_var="amuse_h5_detect_${amuse_h5_target}" + + eval "amuse_h5_save_FLAGS=\"\$$amuse_h5_flags_var\"" + amuse_h5_save_LDFLAGS="$LDFLAGS" + amuse_h5_save_LIBS="$LIBS" + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether we can build a program with HDF5 in $amuse_h5_name" >&5 +printf %s "checking whether we can build a program with HDF5 in $amuse_h5_name... " >&6; } + + eval "$amuse_h5_flags_var=\"\$$amuse_h5_flags_source_var \$$amuse_h5_flags_var\"" + LDFLAGS="$amuse_h5_LDFLAGS $LDFLAGS" + LIBS="$amuse_h5_libs" + + cat > conftest.$ac_ext <<_ACEOF +$amuse_h5_program +_ACEOF +if ac_fn_fc_try_link "$LINENO" +then : + + eval "$amuse_h5_flags_target_var=\"yes\"" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + +else $as_nop + + eval "$amuse_h5_flags_target_var=\"no\"" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext + + LIBS="$amuse_h5_save_LIBS" + LDFLAGS="$amuse_h5_save_LDFLAGS" + eval "$amuse_h5_flags_var=\"\$amuse_h5_save_FLAGS\"" + + + + amuse_h5_name="Fortran with the high-level API in hdf5_hl_fortran with $amuse_h5_path from FFLAGS" + amuse_h5_prefix="FC" + amuse_h5_target="HL_FC" + amuse_h5_program=" program main + + use h5lt + + integer :: error + + error = h5ltfind_dataset_f(0_hid_t, 'test') + + end" + amuse_h5_libs="-lhdf5_hl_fortran" + + amuse_h5_flags_var="${amuse_h5_prefix}FLAGS" + amuse_h5_flags_source_var="amuse_h5_${amuse_h5_flags_var}" + amuse_h5_flags_target_var="amuse_h5_detect_${amuse_h5_target}" + + eval "amuse_h5_save_FLAGS=\"\$$amuse_h5_flags_var\"" + amuse_h5_save_LDFLAGS="$LDFLAGS" + amuse_h5_save_LIBS="$LIBS" + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether we can build a program with HDF5 in $amuse_h5_name" >&5 +printf %s "checking whether we can build a program with HDF5 in $amuse_h5_name... " >&6; } + + eval "$amuse_h5_flags_var=\"\$$amuse_h5_flags_source_var \$$amuse_h5_flags_var\"" + LDFLAGS="$amuse_h5_LDFLAGS $LDFLAGS" + LIBS="$amuse_h5_libs" + + cat > conftest.$ac_ext <<_ACEOF +$amuse_h5_program +_ACEOF +if ac_fn_fc_try_link "$LINENO" +then : + + eval "$amuse_h5_flags_target_var=\"yes\"" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + +else $as_nop + + eval "$amuse_h5_flags_target_var=\"no\"" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext + + LIBS="$amuse_h5_save_LIBS" + LDFLAGS="$amuse_h5_save_LDFLAGS" + eval "$amuse_h5_flags_var=\"\$amuse_h5_save_FLAGS\"" + + + if test $amuse_h5_detect_HL_FC = "yes" + then + amuse_h5_HL_FC_LIB="-lhdf5_hl_fortran" + else + + amuse_h5_name="Fortran with the high-level API in hdf5hl_fortran with $amuse_h5_path from FFLAGS" + amuse_h5_prefix="FC" + amuse_h5_target="HL_FC" + amuse_h5_program=" program main + + use h5lt + + integer :: error + + error = h5ltfind_dataset_f(0_hid_t, 'test') + + end" + amuse_h5_libs="-lhdf5hl_fortran" + + amuse_h5_flags_var="${amuse_h5_prefix}FLAGS" + amuse_h5_flags_source_var="amuse_h5_${amuse_h5_flags_var}" + amuse_h5_flags_target_var="amuse_h5_detect_${amuse_h5_target}" + + eval "amuse_h5_save_FLAGS=\"\$$amuse_h5_flags_var\"" + amuse_h5_save_LDFLAGS="$LDFLAGS" + amuse_h5_save_LIBS="$LIBS" + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether we can build a program with HDF5 in $amuse_h5_name" >&5 +printf %s "checking whether we can build a program with HDF5 in $amuse_h5_name... " >&6; } + + eval "$amuse_h5_flags_var=\"\$$amuse_h5_flags_source_var \$$amuse_h5_flags_var\"" + LDFLAGS="$amuse_h5_LDFLAGS $LDFLAGS" + LIBS="$amuse_h5_libs" + + cat > conftest.$ac_ext <<_ACEOF +$amuse_h5_program +_ACEOF +if ac_fn_fc_try_link "$LINENO" +then : + + eval "$amuse_h5_flags_target_var=\"yes\"" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + +else $as_nop + + eval "$amuse_h5_flags_target_var=\"no\"" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext + + LIBS="$amuse_h5_save_LIBS" + LDFLAGS="$amuse_h5_save_LDFLAGS" + eval "$amuse_h5_flags_var=\"\$amuse_h5_save_FLAGS\"" + + + if test $amuse_h5_detect_HL_FC = "yes" + then + amuse_h5_HL_FC_LIB="-lhdf5hl_fortran" + fi + fi + + 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 + + + if test "$amuse_h5_detect_FC" = "yes" + then + amuse_h5_FCFLAGS="-I$amuse_h5_path" + break + fi + + # The new Fortran CMake-based build system uses the non-standard and + # not-searched-unless-explicitly-specified /mod/shared subdirectory by + # default + amuse_h5_FCFLAGS="$FCFLAGS -I$amuse_h5_path/../mod/shared" + + 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 + + + amuse_h5_name="Fortran with $amuse_h5_path from FFLAGS and /mod/shared" + amuse_h5_prefix="FC" + amuse_h5_target="FC" + amuse_h5_program=" program main + + use h5lib + + integer :: error + + call h5open_f(error) + call h5close_f(error) + end" + amuse_h5_libs="-lhdf5_fortran" + + amuse_h5_flags_var="${amuse_h5_prefix}FLAGS" + amuse_h5_flags_source_var="amuse_h5_${amuse_h5_flags_var}" + amuse_h5_flags_target_var="amuse_h5_detect_${amuse_h5_target}" + + eval "amuse_h5_save_FLAGS=\"\$$amuse_h5_flags_var\"" + amuse_h5_save_LDFLAGS="$LDFLAGS" + amuse_h5_save_LIBS="$LIBS" + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether we can build a program with HDF5 in $amuse_h5_name" >&5 +printf %s "checking whether we can build a program with HDF5 in $amuse_h5_name... " >&6; } + + eval "$amuse_h5_flags_var=\"\$$amuse_h5_flags_source_var \$$amuse_h5_flags_var\"" + LDFLAGS="$amuse_h5_LDFLAGS $LDFLAGS" + LIBS="$amuse_h5_libs" + + cat > conftest.$ac_ext <<_ACEOF +$amuse_h5_program +_ACEOF +if ac_fn_fc_try_link "$LINENO" +then : + + eval "$amuse_h5_flags_target_var=\"yes\"" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + +else $as_nop + + eval "$amuse_h5_flags_target_var=\"no\"" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext + + LIBS="$amuse_h5_save_LIBS" + LDFLAGS="$amuse_h5_save_LDFLAGS" + eval "$amuse_h5_flags_var=\"\$amuse_h5_save_FLAGS\"" + + + + amuse_h5_name="Fortran with the high-level API in hdf5_hl_fortran with $amuse_h5_path from FFLAGS and /mod/shared" + amuse_h5_prefix="FC" + amuse_h5_target="HL_FC" + amuse_h5_program=" program main + + use h5lt + + integer :: error + + error = h5ltfind_dataset_f(0_hid_t, 'test') + + end" + amuse_h5_libs="-lhdf5_hl_fortran" + + amuse_h5_flags_var="${amuse_h5_prefix}FLAGS" + amuse_h5_flags_source_var="amuse_h5_${amuse_h5_flags_var}" + amuse_h5_flags_target_var="amuse_h5_detect_${amuse_h5_target}" + + eval "amuse_h5_save_FLAGS=\"\$$amuse_h5_flags_var\"" + amuse_h5_save_LDFLAGS="$LDFLAGS" + amuse_h5_save_LIBS="$LIBS" + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether we can build a program with HDF5 in $amuse_h5_name" >&5 +printf %s "checking whether we can build a program with HDF5 in $amuse_h5_name... " >&6; } + + eval "$amuse_h5_flags_var=\"\$$amuse_h5_flags_source_var \$$amuse_h5_flags_var\"" + LDFLAGS="$amuse_h5_LDFLAGS $LDFLAGS" + LIBS="$amuse_h5_libs" + + cat > conftest.$ac_ext <<_ACEOF +$amuse_h5_program +_ACEOF +if ac_fn_fc_try_link "$LINENO" +then : + + eval "$amuse_h5_flags_target_var=\"yes\"" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + +else $as_nop + + eval "$amuse_h5_flags_target_var=\"no\"" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext + + LIBS="$amuse_h5_save_LIBS" + LDFLAGS="$amuse_h5_save_LDFLAGS" + eval "$amuse_h5_flags_var=\"\$amuse_h5_save_FLAGS\"" + + + if test $amuse_h5_detect_HL_FC = "yes" + then + amuse_h5_HL_FC_LIB="-lhdf5_hl_fortran" + else + + amuse_h5_name="Fortran with the high-level API in hdf5hl_fortran with $amuse_h5_path from FFLAGS and /mod/shared" + amuse_h5_prefix="FC" + amuse_h5_target="HL_FC" + amuse_h5_program=" program main + + use h5lt + + integer :: error + + error = h5ltfind_dataset_f(0_hid_t, 'test') + + end" + amuse_h5_libs="-lhdf5hl_fortran" + + amuse_h5_flags_var="${amuse_h5_prefix}FLAGS" + amuse_h5_flags_source_var="amuse_h5_${amuse_h5_flags_var}" + amuse_h5_flags_target_var="amuse_h5_detect_${amuse_h5_target}" + + eval "amuse_h5_save_FLAGS=\"\$$amuse_h5_flags_var\"" + amuse_h5_save_LDFLAGS="$LDFLAGS" + amuse_h5_save_LIBS="$LIBS" + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether we can build a program with HDF5 in $amuse_h5_name" >&5 +printf %s "checking whether we can build a program with HDF5 in $amuse_h5_name... " >&6; } + + eval "$amuse_h5_flags_var=\"\$$amuse_h5_flags_source_var \$$amuse_h5_flags_var\"" + LDFLAGS="$amuse_h5_LDFLAGS $LDFLAGS" + LIBS="$amuse_h5_libs" + + cat > conftest.$ac_ext <<_ACEOF +$amuse_h5_program +_ACEOF +if ac_fn_fc_try_link "$LINENO" +then : + + eval "$amuse_h5_flags_target_var=\"yes\"" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + +else $as_nop + + eval "$amuse_h5_flags_target_var=\"no\"" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext + + LIBS="$amuse_h5_save_LIBS" + LDFLAGS="$amuse_h5_save_LDFLAGS" + eval "$amuse_h5_flags_var=\"\$amuse_h5_save_FLAGS\"" + + + if test $amuse_h5_detect_HL_FC = "yes" + then + amuse_h5_HL_FC_LIB="-lhdf5hl_fortran" + fi + fi + + 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 + + + if test "$amuse_h5_detect_FC" = "yes" + then + amuse_h5_FCFLAGS="-I$amuse_h5_path/../mod/shared" + break + fi + + if test "$amuse_h5_detect_FC" = "no" + then + amuse_h5_FCFLAGS="" + fi + done + IFS="$amuse_h5_save_IFS" + + fi + + if test $amuse_h5_detect_FC = "no" + then + + amuse_h5_result="" + amuse_h5_in_isystem="no" + for flag in $CFLAGS + do + if test "$amuse_h5_in_isystem" = "yes" + then + if ! echo "$amuse_h5_result" | grep -e "$flag" >/dev/null 2>&1 + then + amuse_h5_result="$amuse_h5_result:$flag" + fi + amuse_h5_in_isystem="no" + continue + fi + + if test "$flag" = "-isystem" + then + amuse_h5_in_isystem="yes" + elif test "${flag#-I}" != "$flag" + then + amuse_h5_path="${flag#-I}" + if ! echo "$amuse_h5_result" | grep -e "$amuse_h5_path" >/dev/null 2>&1 + then + amuse_h5_result="$amuse_h5_result:${flag#-I}" + fi + fi + done + + + amuse_h5_save_IFS="$IFS" + IFS=: + for amuse_h5_path in $amuse_h5_result + do + # need to restore IFS immediately as it messes up the below + IFS="$amuse_h5_save_IFS" + if test -z "$amuse_h5_path" + then + continue + fi + + amuse_h5_FCFLAGS="$FCFLAGS -I$amuse_h5_path" + + 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 + + + amuse_h5_name="Fortran with $amuse_h5_path from CFLAGS" + amuse_h5_prefix="FC" + amuse_h5_target="FC" + amuse_h5_program=" program main + + use h5lib + + integer :: error + + call h5open_f(error) + call h5close_f(error) + end" + amuse_h5_libs="-lhdf5_fortran" + + amuse_h5_flags_var="${amuse_h5_prefix}FLAGS" + amuse_h5_flags_source_var="amuse_h5_${amuse_h5_flags_var}" + amuse_h5_flags_target_var="amuse_h5_detect_${amuse_h5_target}" + + eval "amuse_h5_save_FLAGS=\"\$$amuse_h5_flags_var\"" + amuse_h5_save_LDFLAGS="$LDFLAGS" + amuse_h5_save_LIBS="$LIBS" + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether we can build a program with HDF5 in $amuse_h5_name" >&5 +printf %s "checking whether we can build a program with HDF5 in $amuse_h5_name... " >&6; } + + eval "$amuse_h5_flags_var=\"\$$amuse_h5_flags_source_var \$$amuse_h5_flags_var\"" + LDFLAGS="$amuse_h5_LDFLAGS $LDFLAGS" + LIBS="$amuse_h5_libs" + + cat > conftest.$ac_ext <<_ACEOF +$amuse_h5_program +_ACEOF +if ac_fn_fc_try_link "$LINENO" +then : + + eval "$amuse_h5_flags_target_var=\"yes\"" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + +else $as_nop + + eval "$amuse_h5_flags_target_var=\"no\"" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext + + LIBS="$amuse_h5_save_LIBS" + LDFLAGS="$amuse_h5_save_LDFLAGS" + eval "$amuse_h5_flags_var=\"\$amuse_h5_save_FLAGS\"" + + + + amuse_h5_name="Fortran with the high-level API in hdf5_hl_fortran with $amuse_h5_path from CFLAGS" + amuse_h5_prefix="FC" + amuse_h5_target="HL_FC" + amuse_h5_program=" program main + + use h5lt + + integer :: error + + error = h5ltfind_dataset_f(0_hid_t, 'test') + + end" + amuse_h5_libs="-lhdf5_hl_fortran" + + amuse_h5_flags_var="${amuse_h5_prefix}FLAGS" + amuse_h5_flags_source_var="amuse_h5_${amuse_h5_flags_var}" + amuse_h5_flags_target_var="amuse_h5_detect_${amuse_h5_target}" + + eval "amuse_h5_save_FLAGS=\"\$$amuse_h5_flags_var\"" + amuse_h5_save_LDFLAGS="$LDFLAGS" + amuse_h5_save_LIBS="$LIBS" + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether we can build a program with HDF5 in $amuse_h5_name" >&5 +printf %s "checking whether we can build a program with HDF5 in $amuse_h5_name... " >&6; } + + eval "$amuse_h5_flags_var=\"\$$amuse_h5_flags_source_var \$$amuse_h5_flags_var\"" + LDFLAGS="$amuse_h5_LDFLAGS $LDFLAGS" + LIBS="$amuse_h5_libs" + + cat > conftest.$ac_ext <<_ACEOF +$amuse_h5_program +_ACEOF +if ac_fn_fc_try_link "$LINENO" +then : + + eval "$amuse_h5_flags_target_var=\"yes\"" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + +else $as_nop + + eval "$amuse_h5_flags_target_var=\"no\"" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext + + LIBS="$amuse_h5_save_LIBS" + LDFLAGS="$amuse_h5_save_LDFLAGS" + eval "$amuse_h5_flags_var=\"\$amuse_h5_save_FLAGS\"" + + + if test $amuse_h5_detect_HL_FC = "yes" + then + amuse_h5_HL_FC_LIB="-lhdf5_hl_fortran" + else + + amuse_h5_name="Fortran with the high-level API in hdf5hl_fortran with $amuse_h5_path from CFLAGS" + amuse_h5_prefix="FC" + amuse_h5_target="HL_FC" + amuse_h5_program=" program main + + use h5lt + + integer :: error + + error = h5ltfind_dataset_f(0_hid_t, 'test') + + end" + amuse_h5_libs="-lhdf5hl_fortran" + + amuse_h5_flags_var="${amuse_h5_prefix}FLAGS" + amuse_h5_flags_source_var="amuse_h5_${amuse_h5_flags_var}" + amuse_h5_flags_target_var="amuse_h5_detect_${amuse_h5_target}" + + eval "amuse_h5_save_FLAGS=\"\$$amuse_h5_flags_var\"" + amuse_h5_save_LDFLAGS="$LDFLAGS" + amuse_h5_save_LIBS="$LIBS" + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether we can build a program with HDF5 in $amuse_h5_name" >&5 +printf %s "checking whether we can build a program with HDF5 in $amuse_h5_name... " >&6; } + + eval "$amuse_h5_flags_var=\"\$$amuse_h5_flags_source_var \$$amuse_h5_flags_var\"" + LDFLAGS="$amuse_h5_LDFLAGS $LDFLAGS" + LIBS="$amuse_h5_libs" + + cat > conftest.$ac_ext <<_ACEOF +$amuse_h5_program +_ACEOF +if ac_fn_fc_try_link "$LINENO" +then : + + eval "$amuse_h5_flags_target_var=\"yes\"" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + +else $as_nop + + eval "$amuse_h5_flags_target_var=\"no\"" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext + + LIBS="$amuse_h5_save_LIBS" + LDFLAGS="$amuse_h5_save_LDFLAGS" + eval "$amuse_h5_flags_var=\"\$amuse_h5_save_FLAGS\"" + + + if test $amuse_h5_detect_HL_FC = "yes" + then + amuse_h5_HL_FC_LIB="-lhdf5hl_fortran" + fi + fi + + 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 + + + if test "$amuse_h5_detect_FC" = "yes" + then + amuse_h5_FCFLAGS="-I$amuse_h5_path" + break + fi + + # The new Fortran CMake-based build system uses the non-standard and + # not-searched-unless-explicitly-specified /mod/shared subdirectory by + # default + amuse_h5_FCFLAGS="$FCFLAGS -I$amuse_h5_path/../mod/shared" + + 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 + + + amuse_h5_name="Fortran with $amuse_h5_path from CFLAGS and /mod/shared" + amuse_h5_prefix="FC" + amuse_h5_target="FC" + amuse_h5_program=" program main + + use h5lib + + integer :: error + + call h5open_f(error) + call h5close_f(error) + end" + amuse_h5_libs="-lhdf5_fortran" + + amuse_h5_flags_var="${amuse_h5_prefix}FLAGS" + amuse_h5_flags_source_var="amuse_h5_${amuse_h5_flags_var}" + amuse_h5_flags_target_var="amuse_h5_detect_${amuse_h5_target}" + + eval "amuse_h5_save_FLAGS=\"\$$amuse_h5_flags_var\"" + amuse_h5_save_LDFLAGS="$LDFLAGS" + amuse_h5_save_LIBS="$LIBS" + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether we can build a program with HDF5 in $amuse_h5_name" >&5 +printf %s "checking whether we can build a program with HDF5 in $amuse_h5_name... " >&6; } + + eval "$amuse_h5_flags_var=\"\$$amuse_h5_flags_source_var \$$amuse_h5_flags_var\"" + LDFLAGS="$amuse_h5_LDFLAGS $LDFLAGS" + LIBS="$amuse_h5_libs" + + cat > conftest.$ac_ext <<_ACEOF +$amuse_h5_program +_ACEOF +if ac_fn_fc_try_link "$LINENO" +then : + + eval "$amuse_h5_flags_target_var=\"yes\"" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + +else $as_nop + + eval "$amuse_h5_flags_target_var=\"no\"" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext + + LIBS="$amuse_h5_save_LIBS" + LDFLAGS="$amuse_h5_save_LDFLAGS" + eval "$amuse_h5_flags_var=\"\$amuse_h5_save_FLAGS\"" + + + + amuse_h5_name="Fortran with the high-level API in hdf5_hl_fortran with $amuse_h5_path from CFLAGS and /mod/shared" + amuse_h5_prefix="FC" + amuse_h5_target="HL_FC" + amuse_h5_program=" program main + + use h5lt + + integer :: error + + error = h5ltfind_dataset_f(0_hid_t, 'test') + + end" + amuse_h5_libs="-lhdf5_hl_fortran" + + amuse_h5_flags_var="${amuse_h5_prefix}FLAGS" + amuse_h5_flags_source_var="amuse_h5_${amuse_h5_flags_var}" + amuse_h5_flags_target_var="amuse_h5_detect_${amuse_h5_target}" + + eval "amuse_h5_save_FLAGS=\"\$$amuse_h5_flags_var\"" + amuse_h5_save_LDFLAGS="$LDFLAGS" + amuse_h5_save_LIBS="$LIBS" + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether we can build a program with HDF5 in $amuse_h5_name" >&5 +printf %s "checking whether we can build a program with HDF5 in $amuse_h5_name... " >&6; } + + eval "$amuse_h5_flags_var=\"\$$amuse_h5_flags_source_var \$$amuse_h5_flags_var\"" + LDFLAGS="$amuse_h5_LDFLAGS $LDFLAGS" + LIBS="$amuse_h5_libs" + + cat > conftest.$ac_ext <<_ACEOF +$amuse_h5_program +_ACEOF +if ac_fn_fc_try_link "$LINENO" +then : + + eval "$amuse_h5_flags_target_var=\"yes\"" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + +else $as_nop + + eval "$amuse_h5_flags_target_var=\"no\"" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext + + LIBS="$amuse_h5_save_LIBS" + LDFLAGS="$amuse_h5_save_LDFLAGS" + eval "$amuse_h5_flags_var=\"\$amuse_h5_save_FLAGS\"" + + + if test $amuse_h5_detect_HL_FC = "yes" + then + amuse_h5_HL_FC_LIB="-lhdf5_hl_fortran" + else + + amuse_h5_name="Fortran with the high-level API in hdf5hl_fortran with $amuse_h5_path from CFLAGS and /mod/shared" + amuse_h5_prefix="FC" + amuse_h5_target="HL_FC" + amuse_h5_program=" program main + + use h5lt + + integer :: error + + error = h5ltfind_dataset_f(0_hid_t, 'test') + + end" + amuse_h5_libs="-lhdf5hl_fortran" + + amuse_h5_flags_var="${amuse_h5_prefix}FLAGS" + amuse_h5_flags_source_var="amuse_h5_${amuse_h5_flags_var}" + amuse_h5_flags_target_var="amuse_h5_detect_${amuse_h5_target}" + + eval "amuse_h5_save_FLAGS=\"\$$amuse_h5_flags_var\"" + amuse_h5_save_LDFLAGS="$LDFLAGS" + amuse_h5_save_LIBS="$LIBS" + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether we can build a program with HDF5 in $amuse_h5_name" >&5 +printf %s "checking whether we can build a program with HDF5 in $amuse_h5_name... " >&6; } + + eval "$amuse_h5_flags_var=\"\$$amuse_h5_flags_source_var \$$amuse_h5_flags_var\"" + LDFLAGS="$amuse_h5_LDFLAGS $LDFLAGS" + LIBS="$amuse_h5_libs" + + cat > conftest.$ac_ext <<_ACEOF +$amuse_h5_program +_ACEOF +if ac_fn_fc_try_link "$LINENO" +then : + + eval "$amuse_h5_flags_target_var=\"yes\"" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + +else $as_nop + + eval "$amuse_h5_flags_target_var=\"no\"" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext + + LIBS="$amuse_h5_save_LIBS" + LDFLAGS="$amuse_h5_save_LDFLAGS" + eval "$amuse_h5_flags_var=\"\$amuse_h5_save_FLAGS\"" + + + if test $amuse_h5_detect_HL_FC = "yes" + then + amuse_h5_HL_FC_LIB="-lhdf5hl_fortran" + fi + fi + + 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 + + + if test "$amuse_h5_detect_FC" = "yes" + then + amuse_h5_FCFLAGS="-I$amuse_h5_path/../mod/shared" + break + fi + + if test "$amuse_h5_detect_FC" = "no" + then + amuse_h5_FCFLAGS="" + fi + done + IFS="$amuse_h5_save_IFS" + + fi + + if test $amuse_h5_detect_FC = "no" + then + + amuse_h5_save_IFS="$IFS" + IFS=: + for amuse_h5_path in $CPATH + do + # need to restore IFS immediately as it messes up the below + IFS="$amuse_h5_save_IFS" + if test -z "$amuse_h5_path" + then + continue + fi + + amuse_h5_FCFLAGS="$FCFLAGS -I$amuse_h5_path" + + 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 + + + amuse_h5_name="Fortran with $amuse_h5_path from CPATH" + amuse_h5_prefix="FC" + amuse_h5_target="FC" + amuse_h5_program=" program main + + use h5lib + + integer :: error + + call h5open_f(error) + call h5close_f(error) + end" + amuse_h5_libs="-lhdf5_fortran" + + amuse_h5_flags_var="${amuse_h5_prefix}FLAGS" + amuse_h5_flags_source_var="amuse_h5_${amuse_h5_flags_var}" + amuse_h5_flags_target_var="amuse_h5_detect_${amuse_h5_target}" + + eval "amuse_h5_save_FLAGS=\"\$$amuse_h5_flags_var\"" + amuse_h5_save_LDFLAGS="$LDFLAGS" + amuse_h5_save_LIBS="$LIBS" + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether we can build a program with HDF5 in $amuse_h5_name" >&5 +printf %s "checking whether we can build a program with HDF5 in $amuse_h5_name... " >&6; } + + eval "$amuse_h5_flags_var=\"\$$amuse_h5_flags_source_var \$$amuse_h5_flags_var\"" + LDFLAGS="$amuse_h5_LDFLAGS $LDFLAGS" + LIBS="$amuse_h5_libs" + + cat > conftest.$ac_ext <<_ACEOF +$amuse_h5_program +_ACEOF +if ac_fn_fc_try_link "$LINENO" +then : + + eval "$amuse_h5_flags_target_var=\"yes\"" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + +else $as_nop + + eval "$amuse_h5_flags_target_var=\"no\"" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext + + LIBS="$amuse_h5_save_LIBS" + LDFLAGS="$amuse_h5_save_LDFLAGS" + eval "$amuse_h5_flags_var=\"\$amuse_h5_save_FLAGS\"" + + + + amuse_h5_name="Fortran with the high-level API in hdf5_hl_fortran with $amuse_h5_path from CPATH" + amuse_h5_prefix="FC" + amuse_h5_target="HL_FC" + amuse_h5_program=" program main + + use h5lt + + integer :: error + + error = h5ltfind_dataset_f(0_hid_t, 'test') + + end" + amuse_h5_libs="-lhdf5_hl_fortran" + + amuse_h5_flags_var="${amuse_h5_prefix}FLAGS" + amuse_h5_flags_source_var="amuse_h5_${amuse_h5_flags_var}" + amuse_h5_flags_target_var="amuse_h5_detect_${amuse_h5_target}" + + eval "amuse_h5_save_FLAGS=\"\$$amuse_h5_flags_var\"" + amuse_h5_save_LDFLAGS="$LDFLAGS" + amuse_h5_save_LIBS="$LIBS" + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether we can build a program with HDF5 in $amuse_h5_name" >&5 +printf %s "checking whether we can build a program with HDF5 in $amuse_h5_name... " >&6; } + + eval "$amuse_h5_flags_var=\"\$$amuse_h5_flags_source_var \$$amuse_h5_flags_var\"" + LDFLAGS="$amuse_h5_LDFLAGS $LDFLAGS" + LIBS="$amuse_h5_libs" + + cat > conftest.$ac_ext <<_ACEOF +$amuse_h5_program +_ACEOF +if ac_fn_fc_try_link "$LINENO" +then : + + eval "$amuse_h5_flags_target_var=\"yes\"" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + +else $as_nop + + eval "$amuse_h5_flags_target_var=\"no\"" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext + + LIBS="$amuse_h5_save_LIBS" + LDFLAGS="$amuse_h5_save_LDFLAGS" + eval "$amuse_h5_flags_var=\"\$amuse_h5_save_FLAGS\"" + + + if test $amuse_h5_detect_HL_FC = "yes" + then + amuse_h5_HL_FC_LIB="-lhdf5_hl_fortran" + else + + amuse_h5_name="Fortran with the high-level API in hdf5hl_fortran with $amuse_h5_path from CPATH" + amuse_h5_prefix="FC" + amuse_h5_target="HL_FC" + amuse_h5_program=" program main + + use h5lt + + integer :: error + + error = h5ltfind_dataset_f(0_hid_t, 'test') + + end" + amuse_h5_libs="-lhdf5hl_fortran" + + amuse_h5_flags_var="${amuse_h5_prefix}FLAGS" + amuse_h5_flags_source_var="amuse_h5_${amuse_h5_flags_var}" + amuse_h5_flags_target_var="amuse_h5_detect_${amuse_h5_target}" + + eval "amuse_h5_save_FLAGS=\"\$$amuse_h5_flags_var\"" + amuse_h5_save_LDFLAGS="$LDFLAGS" + amuse_h5_save_LIBS="$LIBS" + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether we can build a program with HDF5 in $amuse_h5_name" >&5 +printf %s "checking whether we can build a program with HDF5 in $amuse_h5_name... " >&6; } + + eval "$amuse_h5_flags_var=\"\$$amuse_h5_flags_source_var \$$amuse_h5_flags_var\"" + LDFLAGS="$amuse_h5_LDFLAGS $LDFLAGS" + LIBS="$amuse_h5_libs" + + cat > conftest.$ac_ext <<_ACEOF +$amuse_h5_program +_ACEOF +if ac_fn_fc_try_link "$LINENO" +then : + + eval "$amuse_h5_flags_target_var=\"yes\"" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + +else $as_nop + + eval "$amuse_h5_flags_target_var=\"no\"" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext + + LIBS="$amuse_h5_save_LIBS" + LDFLAGS="$amuse_h5_save_LDFLAGS" + eval "$amuse_h5_flags_var=\"\$amuse_h5_save_FLAGS\"" + + + if test $amuse_h5_detect_HL_FC = "yes" + then + amuse_h5_HL_FC_LIB="-lhdf5hl_fortran" + fi + fi + + 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 + + + if test "$amuse_h5_detect_FC" = "yes" + then + amuse_h5_FCFLAGS="-I$amuse_h5_path" + break + fi + + # The new Fortran CMake-based build system uses the non-standard and + # not-searched-unless-explicitly-specified /mod/shared subdirectory by + # default + amuse_h5_FCFLAGS="$FCFLAGS -I$amuse_h5_path/../mod/shared" + + 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 + + + amuse_h5_name="Fortran with $amuse_h5_path from CPATH and /mod/shared" + amuse_h5_prefix="FC" + amuse_h5_target="FC" + amuse_h5_program=" program main + + use h5lib + + integer :: error + + call h5open_f(error) + call h5close_f(error) + end" + amuse_h5_libs="-lhdf5_fortran" + + amuse_h5_flags_var="${amuse_h5_prefix}FLAGS" + amuse_h5_flags_source_var="amuse_h5_${amuse_h5_flags_var}" + amuse_h5_flags_target_var="amuse_h5_detect_${amuse_h5_target}" + + eval "amuse_h5_save_FLAGS=\"\$$amuse_h5_flags_var\"" + amuse_h5_save_LDFLAGS="$LDFLAGS" + amuse_h5_save_LIBS="$LIBS" + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether we can build a program with HDF5 in $amuse_h5_name" >&5 +printf %s "checking whether we can build a program with HDF5 in $amuse_h5_name... " >&6; } + + eval "$amuse_h5_flags_var=\"\$$amuse_h5_flags_source_var \$$amuse_h5_flags_var\"" + LDFLAGS="$amuse_h5_LDFLAGS $LDFLAGS" + LIBS="$amuse_h5_libs" + + cat > conftest.$ac_ext <<_ACEOF +$amuse_h5_program +_ACEOF +if ac_fn_fc_try_link "$LINENO" +then : + + eval "$amuse_h5_flags_target_var=\"yes\"" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + +else $as_nop + + eval "$amuse_h5_flags_target_var=\"no\"" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext + + LIBS="$amuse_h5_save_LIBS" + LDFLAGS="$amuse_h5_save_LDFLAGS" + eval "$amuse_h5_flags_var=\"\$amuse_h5_save_FLAGS\"" + + + + amuse_h5_name="Fortran with the high-level API in hdf5_hl_fortran with $amuse_h5_path from CPATH and /mod/shared" + amuse_h5_prefix="FC" + amuse_h5_target="HL_FC" + amuse_h5_program=" program main + + use h5lt + + integer :: error + + error = h5ltfind_dataset_f(0_hid_t, 'test') + + end" + amuse_h5_libs="-lhdf5_hl_fortran" + + amuse_h5_flags_var="${amuse_h5_prefix}FLAGS" + amuse_h5_flags_source_var="amuse_h5_${amuse_h5_flags_var}" + amuse_h5_flags_target_var="amuse_h5_detect_${amuse_h5_target}" + + eval "amuse_h5_save_FLAGS=\"\$$amuse_h5_flags_var\"" + amuse_h5_save_LDFLAGS="$LDFLAGS" + amuse_h5_save_LIBS="$LIBS" + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether we can build a program with HDF5 in $amuse_h5_name" >&5 +printf %s "checking whether we can build a program with HDF5 in $amuse_h5_name... " >&6; } + + eval "$amuse_h5_flags_var=\"\$$amuse_h5_flags_source_var \$$amuse_h5_flags_var\"" + LDFLAGS="$amuse_h5_LDFLAGS $LDFLAGS" + LIBS="$amuse_h5_libs" + + cat > conftest.$ac_ext <<_ACEOF +$amuse_h5_program +_ACEOF +if ac_fn_fc_try_link "$LINENO" +then : + + eval "$amuse_h5_flags_target_var=\"yes\"" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + +else $as_nop + + eval "$amuse_h5_flags_target_var=\"no\"" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext + + LIBS="$amuse_h5_save_LIBS" + LDFLAGS="$amuse_h5_save_LDFLAGS" + eval "$amuse_h5_flags_var=\"\$amuse_h5_save_FLAGS\"" + + + if test $amuse_h5_detect_HL_FC = "yes" + then + amuse_h5_HL_FC_LIB="-lhdf5_hl_fortran" else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking Using provided NetCDF4 prefix" >&5 -printf %s "checking Using provided NetCDF4 prefix... " >&6; } - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $NC_CONFIG" >&5 -printf "%s\n" "$NC_CONFIG" >&6; } + + amuse_h5_name="Fortran with the high-level API in hdf5hl_fortran with $amuse_h5_path from CPATH and /mod/shared" + amuse_h5_prefix="FC" + amuse_h5_target="HL_FC" + amuse_h5_program=" program main + + use h5lt + + integer :: error + + error = h5ltfind_dataset_f(0_hid_t, 'test') + + end" + amuse_h5_libs="-lhdf5hl_fortran" + + amuse_h5_flags_var="${amuse_h5_prefix}FLAGS" + amuse_h5_flags_source_var="amuse_h5_${amuse_h5_flags_var}" + amuse_h5_flags_target_var="amuse_h5_detect_${amuse_h5_target}" + + eval "amuse_h5_save_FLAGS=\"\$$amuse_h5_flags_var\"" + amuse_h5_save_LDFLAGS="$LDFLAGS" + amuse_h5_save_LIBS="$LIBS" + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether we can build a program with HDF5 in $amuse_h5_name" >&5 +printf %s "checking whether we can build a program with HDF5 in $amuse_h5_name... " >&6; } + + eval "$amuse_h5_flags_var=\"\$$amuse_h5_flags_source_var \$$amuse_h5_flags_var\"" + LDFLAGS="$amuse_h5_LDFLAGS $LDFLAGS" + LIBS="$amuse_h5_libs" + + cat > conftest.$ac_ext <<_ACEOF +$amuse_h5_program +_ACEOF +if ac_fn_fc_try_link "$LINENO" +then : + + eval "$amuse_h5_flags_target_var=\"yes\"" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + +else $as_nop + + eval "$amuse_h5_flags_target_var=\"no\"" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext + + LIBS="$amuse_h5_save_LIBS" + LDFLAGS="$amuse_h5_save_LDFLAGS" + eval "$amuse_h5_flags_var=\"\$amuse_h5_save_FLAGS\"" + + + if test $amuse_h5_detect_HL_FC = "yes" + then + amuse_h5_HL_FC_LIB="-lhdf5hl_fortran" + fi + fi + + 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 + + + if test "$amuse_h5_detect_FC" = "yes" + then + amuse_h5_FCFLAGS="-I$amuse_h5_path/../mod/shared" + break + fi + + if test "$amuse_h5_detect_FC" = "no" + then + amuse_h5_FCFLAGS="" + fi + done + IFS="$amuse_h5_save_IFS" + + fi + + if test $amuse_h5_detect_FC = "no" + then + + amuse_h5_save_IFS="$IFS" + IFS=: + for amuse_h5_path in $C_INCLUDE_PATH + do + # need to restore IFS immediately as it messes up the below + IFS="$amuse_h5_save_IFS" + if test -z "$amuse_h5_path" + then + continue + fi + + amuse_h5_FCFLAGS="$FCFLAGS -I$amuse_h5_path" + + 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 + + + amuse_h5_name="Fortran with $amuse_h5_path from C_INCLUDE_PATH" + amuse_h5_prefix="FC" + amuse_h5_target="FC" + amuse_h5_program=" program main + + use h5lib + + integer :: error + + call h5open_f(error) + call h5close_f(error) + end" + amuse_h5_libs="-lhdf5_fortran" + + amuse_h5_flags_var="${amuse_h5_prefix}FLAGS" + amuse_h5_flags_source_var="amuse_h5_${amuse_h5_flags_var}" + amuse_h5_flags_target_var="amuse_h5_detect_${amuse_h5_target}" + + eval "amuse_h5_save_FLAGS=\"\$$amuse_h5_flags_var\"" + amuse_h5_save_LDFLAGS="$LDFLAGS" + amuse_h5_save_LIBS="$LIBS" + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether we can build a program with HDF5 in $amuse_h5_name" >&5 +printf %s "checking whether we can build a program with HDF5 in $amuse_h5_name... " >&6; } + + eval "$amuse_h5_flags_var=\"\$$amuse_h5_flags_source_var \$$amuse_h5_flags_var\"" + LDFLAGS="$amuse_h5_LDFLAGS $LDFLAGS" + LIBS="$amuse_h5_libs" + + cat > conftest.$ac_ext <<_ACEOF +$amuse_h5_program +_ACEOF +if ac_fn_fc_try_link "$LINENO" +then : + + eval "$amuse_h5_flags_target_var=\"yes\"" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + +else $as_nop + + eval "$amuse_h5_flags_target_var=\"no\"" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext + + LIBS="$amuse_h5_save_LIBS" + LDFLAGS="$amuse_h5_save_LDFLAGS" + eval "$amuse_h5_flags_var=\"\$amuse_h5_save_FLAGS\"" + + + + amuse_h5_name="Fortran with the high-level API in hdf5_hl_fortran with $amuse_h5_path from C_INCLUDE_PATH" + amuse_h5_prefix="FC" + amuse_h5_target="HL_FC" + amuse_h5_program=" program main + + use h5lt + + integer :: error + + error = h5ltfind_dataset_f(0_hid_t, 'test') + + end" + amuse_h5_libs="-lhdf5_hl_fortran" + + amuse_h5_flags_var="${amuse_h5_prefix}FLAGS" + amuse_h5_flags_source_var="amuse_h5_${amuse_h5_flags_var}" + amuse_h5_flags_target_var="amuse_h5_detect_${amuse_h5_target}" + + eval "amuse_h5_save_FLAGS=\"\$$amuse_h5_flags_var\"" + amuse_h5_save_LDFLAGS="$LDFLAGS" + amuse_h5_save_LIBS="$LIBS" + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether we can build a program with HDF5 in $amuse_h5_name" >&5 +printf %s "checking whether we can build a program with HDF5 in $amuse_h5_name... " >&6; } + + eval "$amuse_h5_flags_var=\"\$$amuse_h5_flags_source_var \$$amuse_h5_flags_var\"" + LDFLAGS="$amuse_h5_LDFLAGS $LDFLAGS" + LIBS="$amuse_h5_libs" + + cat > conftest.$ac_ext <<_ACEOF +$amuse_h5_program +_ACEOF +if ac_fn_fc_try_link "$LINENO" +then : + + eval "$amuse_h5_flags_target_var=\"yes\"" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + +else $as_nop + + eval "$amuse_h5_flags_target_var=\"no\"" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext + + LIBS="$amuse_h5_save_LIBS" + LDFLAGS="$amuse_h5_save_LDFLAGS" + eval "$amuse_h5_flags_var=\"\$amuse_h5_save_FLAGS\"" + + + if test $amuse_h5_detect_HL_FC = "yes" + then + amuse_h5_HL_FC_LIB="-lhdf5_hl_fortran" + else + + amuse_h5_name="Fortran with the high-level API in hdf5hl_fortran with $amuse_h5_path from C_INCLUDE_PATH" + amuse_h5_prefix="FC" + amuse_h5_target="HL_FC" + amuse_h5_program=" program main + + use h5lt + + integer :: error + + error = h5ltfind_dataset_f(0_hid_t, 'test') + + end" + amuse_h5_libs="-lhdf5hl_fortran" + + amuse_h5_flags_var="${amuse_h5_prefix}FLAGS" + amuse_h5_flags_source_var="amuse_h5_${amuse_h5_flags_var}" + amuse_h5_flags_target_var="amuse_h5_detect_${amuse_h5_target}" + + eval "amuse_h5_save_FLAGS=\"\$$amuse_h5_flags_var\"" + amuse_h5_save_LDFLAGS="$LDFLAGS" + amuse_h5_save_LIBS="$LIBS" + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether we can build a program with HDF5 in $amuse_h5_name" >&5 +printf %s "checking whether we can build a program with HDF5 in $amuse_h5_name... " >&6; } + + eval "$amuse_h5_flags_var=\"\$$amuse_h5_flags_source_var \$$amuse_h5_flags_var\"" + LDFLAGS="$amuse_h5_LDFLAGS $LDFLAGS" + LIBS="$amuse_h5_libs" + + cat > conftest.$ac_ext <<_ACEOF +$amuse_h5_program +_ACEOF +if ac_fn_fc_try_link "$LINENO" +then : + + eval "$amuse_h5_flags_target_var=\"yes\"" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + +else $as_nop + + eval "$amuse_h5_flags_target_var=\"no\"" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext + + LIBS="$amuse_h5_save_LIBS" + LDFLAGS="$amuse_h5_save_LDFLAGS" + eval "$amuse_h5_flags_var=\"\$amuse_h5_save_FLAGS\"" + + + if test $amuse_h5_detect_HL_FC = "yes" + then + amuse_h5_HL_FC_LIB="-lhdf5hl_fortran" + fi + fi + + 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 + + + if test "$amuse_h5_detect_FC" = "yes" + then + amuse_h5_FCFLAGS="-I$amuse_h5_path" + break + fi + + # The new Fortran CMake-based build system uses the non-standard and + # not-searched-unless-explicitly-specified /mod/shared subdirectory by + # default + amuse_h5_FCFLAGS="$FCFLAGS -I$amuse_h5_path/../mod/shared" + + 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 + + + amuse_h5_name="Fortran with $amuse_h5_path from C_INCLUDE_PATH and /mod/shared" + amuse_h5_prefix="FC" + amuse_h5_target="FC" + amuse_h5_program=" program main + + use h5lib + + integer :: error + + call h5open_f(error) + call h5close_f(error) + end" + amuse_h5_libs="-lhdf5_fortran" + + amuse_h5_flags_var="${amuse_h5_prefix}FLAGS" + amuse_h5_flags_source_var="amuse_h5_${amuse_h5_flags_var}" + amuse_h5_flags_target_var="amuse_h5_detect_${amuse_h5_target}" + + eval "amuse_h5_save_FLAGS=\"\$$amuse_h5_flags_var\"" + amuse_h5_save_LDFLAGS="$LDFLAGS" + amuse_h5_save_LIBS="$LIBS" + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether we can build a program with HDF5 in $amuse_h5_name" >&5 +printf %s "checking whether we can build a program with HDF5 in $amuse_h5_name... " >&6; } + + eval "$amuse_h5_flags_var=\"\$$amuse_h5_flags_source_var \$$amuse_h5_flags_var\"" + LDFLAGS="$amuse_h5_LDFLAGS $LDFLAGS" + LIBS="$amuse_h5_libs" + + cat > conftest.$ac_ext <<_ACEOF +$amuse_h5_program +_ACEOF +if ac_fn_fc_try_link "$LINENO" +then : + + eval "$amuse_h5_flags_target_var=\"yes\"" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + +else $as_nop + + eval "$amuse_h5_flags_target_var=\"no\"" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext + + LIBS="$amuse_h5_save_LIBS" + LDFLAGS="$amuse_h5_save_LDFLAGS" + eval "$amuse_h5_flags_var=\"\$amuse_h5_save_FLAGS\"" + + + + amuse_h5_name="Fortran with the high-level API in hdf5_hl_fortran with $amuse_h5_path from C_INCLUDE_PATH and /mod/shared" + amuse_h5_prefix="FC" + amuse_h5_target="HL_FC" + amuse_h5_program=" program main + + use h5lt + + integer :: error + + error = h5ltfind_dataset_f(0_hid_t, 'test') + + end" + amuse_h5_libs="-lhdf5_hl_fortran" + + amuse_h5_flags_var="${amuse_h5_prefix}FLAGS" + amuse_h5_flags_source_var="amuse_h5_${amuse_h5_flags_var}" + amuse_h5_flags_target_var="amuse_h5_detect_${amuse_h5_target}" + + eval "amuse_h5_save_FLAGS=\"\$$amuse_h5_flags_var\"" + amuse_h5_save_LDFLAGS="$LDFLAGS" + amuse_h5_save_LIBS="$LIBS" + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether we can build a program with HDF5 in $amuse_h5_name" >&5 +printf %s "checking whether we can build a program with HDF5 in $amuse_h5_name... " >&6; } + + eval "$amuse_h5_flags_var=\"\$$amuse_h5_flags_source_var \$$amuse_h5_flags_var\"" + LDFLAGS="$amuse_h5_LDFLAGS $LDFLAGS" + LIBS="$amuse_h5_libs" + + cat > conftest.$ac_ext <<_ACEOF +$amuse_h5_program +_ACEOF +if ac_fn_fc_try_link "$LINENO" +then : + + eval "$amuse_h5_flags_target_var=\"yes\"" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + +else $as_nop + + eval "$amuse_h5_flags_target_var=\"no\"" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext + + LIBS="$amuse_h5_save_LIBS" + LDFLAGS="$amuse_h5_save_LDFLAGS" + eval "$amuse_h5_flags_var=\"\$amuse_h5_save_FLAGS\"" + + + if test $amuse_h5_detect_HL_FC = "yes" + then + amuse_h5_HL_FC_LIB="-lhdf5_hl_fortran" + else + + amuse_h5_name="Fortran with the high-level API in hdf5hl_fortran with $amuse_h5_path from C_INCLUDE_PATH and /mod/shared" + amuse_h5_prefix="FC" + amuse_h5_target="HL_FC" + amuse_h5_program=" program main + + use h5lt + + integer :: error + + error = h5ltfind_dataset_f(0_hid_t, 'test') + + end" + amuse_h5_libs="-lhdf5hl_fortran" + + amuse_h5_flags_var="${amuse_h5_prefix}FLAGS" + amuse_h5_flags_source_var="amuse_h5_${amuse_h5_flags_var}" + amuse_h5_flags_target_var="amuse_h5_detect_${amuse_h5_target}" + + eval "amuse_h5_save_FLAGS=\"\$$amuse_h5_flags_var\"" + amuse_h5_save_LDFLAGS="$LDFLAGS" + amuse_h5_save_LIBS="$LIBS" + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether we can build a program with HDF5 in $amuse_h5_name" >&5 +printf %s "checking whether we can build a program with HDF5 in $amuse_h5_name... " >&6; } + + eval "$amuse_h5_flags_var=\"\$$amuse_h5_flags_source_var \$$amuse_h5_flags_var\"" + LDFLAGS="$amuse_h5_LDFLAGS $LDFLAGS" + LIBS="$amuse_h5_libs" + + cat > conftest.$ac_ext <<_ACEOF +$amuse_h5_program +_ACEOF +if ac_fn_fc_try_link "$LINENO" +then : + + eval "$amuse_h5_flags_target_var=\"yes\"" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + +else $as_nop + + eval "$amuse_h5_flags_target_var=\"no\"" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext + + LIBS="$amuse_h5_save_LIBS" + LDFLAGS="$amuse_h5_save_LDFLAGS" + eval "$amuse_h5_flags_var=\"\$amuse_h5_save_FLAGS\"" + + + if test $amuse_h5_detect_HL_FC = "yes" + then + amuse_h5_HL_FC_LIB="-lhdf5hl_fortran" + fi + fi + + 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 + + + if test "$amuse_h5_detect_FC" = "yes" + then + amuse_h5_FCFLAGS="-I$amuse_h5_path/../mod/shared" + break + fi + + if test "$amuse_h5_detect_FC" = "no" + then + amuse_h5_FCFLAGS="" + fi + done + IFS="$amuse_h5_save_IFS" + + fi + fi + + fi + + if test "$amuse_h5_detect_C" = "no" + then + + # Extract the first word of "h5cc", so it can be a program name with args. +set dummy h5cc; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_path_H5CC+y} +then : + printf %s "(cached) " >&6 +else $as_nop + case $H5CC in + [\\/]* | ?:[\\/]*) + ac_cv_path_H5CC="$H5CC" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_path_H5CC="$as_dir$ac_word$ac_exec_ext" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + ;; +esac +fi +H5CC=$ac_cv_path_H5CC +if test -n "$H5CC"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $H5CC" >&5 +printf "%s\n" "$H5CC" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + + if test -n "$H5CC" + then + amuse_h5_h5cc_flags=$(HDF5_USE_SHLIB=yes $H5CC -show) + amuse_h5_h5cc_extra_flags=$(HDF5_USE_SHLIB=yes $H5CC -show -c) + + amuse_h5_include_flags="" + amuse_h5_link_flags="" + + for amuse_h5_flag in $amuse_h5_h5cc_flags $amuse_h5_h5cc_extra_flags + do + if test "${amuse_h5_flag#-I}" != "$amuse_h5_flag" + then + if ! echo "$amuse_h5_include_flags" | grep -e "$amuse_h5_flag" >/dev/null 2>&1 + then + amuse_h5_include_flags="$amuse_h5_include_flags $amuse_h5_flag" + fi + elif test "${amuse_h5_flag#-L}" != "$amuse_h5_flag" + then + if ! echo "$amuse_h5_result" | grep -e "$amuse_h5_flag" >/dev/null 2>&1 + then + amuse_h5_link_flags="$amuse_h5_link_flags $amuse_h5_flag" + fi + fi + done + + + 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 + + amuse_h5_CFLAGS="$amuse_h5_include_flags" + amuse_h5_LDFLAGS="$amuse_h5_link_flags" + + amuse_h5_name="C with flags from h5cc" + amuse_h5_prefix="C" + amuse_h5_target="C" + amuse_h5_program="#include +#ifdef F77_DUMMY_MAIN + +# ifdef __cplusplus + extern "C" +# endif + int F77_DUMMY_MAIN() { return 1; } + +#endif +int +main (void) +{ +H5open(); H5close(); + ; + return 0; +}" + amuse_h5_libs="-lhdf5" + + amuse_h5_flags_var="${amuse_h5_prefix}FLAGS" + amuse_h5_flags_source_var="amuse_h5_${amuse_h5_flags_var}" + amuse_h5_flags_target_var="amuse_h5_detect_${amuse_h5_target}" + + eval "amuse_h5_save_FLAGS=\"\$$amuse_h5_flags_var\"" + amuse_h5_save_LDFLAGS="$LDFLAGS" + amuse_h5_save_LIBS="$LIBS" + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether we can build a program with HDF5 in $amuse_h5_name" >&5 +printf %s "checking whether we can build a program with HDF5 in $amuse_h5_name... " >&6; } + + eval "$amuse_h5_flags_var=\"\$$amuse_h5_flags_source_var \$$amuse_h5_flags_var\"" + LDFLAGS="$amuse_h5_LDFLAGS $LDFLAGS" + LIBS="$amuse_h5_libs" + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$amuse_h5_program +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + + eval "$amuse_h5_flags_target_var=\"yes\"" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + +else $as_nop + + eval "$amuse_h5_flags_target_var=\"no\"" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext + + LIBS="$amuse_h5_save_LIBS" + LDFLAGS="$amuse_h5_save_LDFLAGS" + eval "$amuse_h5_flags_var=\"\$amuse_h5_save_FLAGS\"" + + + amuse_h5_name="C with flags from h5cc and the high-level API" + amuse_h5_prefix="C" + amuse_h5_target="HL_C" + amuse_h5_program="#include +#ifdef F77_DUMMY_MAIN + +# ifdef __cplusplus + extern "C" +# endif + int F77_DUMMY_MAIN() { return 1; } + +#endif +int +main (void) +{ +H5LTfind_dataset(0, \"test\") + ; + return 0; +}" + amuse_h5_libs="-lhdf5_hl" + + amuse_h5_flags_var="${amuse_h5_prefix}FLAGS" + amuse_h5_flags_source_var="amuse_h5_${amuse_h5_flags_var}" + amuse_h5_flags_target_var="amuse_h5_detect_${amuse_h5_target}" + + eval "amuse_h5_save_FLAGS=\"\$$amuse_h5_flags_var\"" + amuse_h5_save_LDFLAGS="$LDFLAGS" + amuse_h5_save_LIBS="$LIBS" + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether we can build a program with HDF5 in $amuse_h5_name" >&5 +printf %s "checking whether we can build a program with HDF5 in $amuse_h5_name... " >&6; } + + eval "$amuse_h5_flags_var=\"\$$amuse_h5_flags_source_var \$$amuse_h5_flags_var\"" + LDFLAGS="$amuse_h5_LDFLAGS $LDFLAGS" + LIBS="$amuse_h5_libs" + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$amuse_h5_program +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + + eval "$amuse_h5_flags_target_var=\"yes\"" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + +else $as_nop + + eval "$amuse_h5_flags_target_var=\"no\"" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext + + LIBS="$amuse_h5_save_LIBS" + LDFLAGS="$amuse_h5_save_LDFLAGS" + eval "$amuse_h5_flags_var=\"\$amuse_h5_save_FLAGS\"" + + 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 + + # Extract the first word of "h5c++", so it can be a program name with args. +set dummy h5c++; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_path_H5CXX+y} +then : + printf %s "(cached) " >&6 +else $as_nop + case $H5CXX in + [\\/]* | ?:[\\/]*) + ac_cv_path_H5CXX="$H5CXX" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_path_H5CXX="$as_dir$ac_word$ac_exec_ext" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + ;; +esac +fi +H5CXX=$ac_cv_path_H5CXX +if test -n "$H5CXX"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $H5CXX" >&5 +printf "%s\n" "$H5CXX" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + + if test -n "$H5CXX" + then + amuse_h5_h5cxx_flags=$(HDF5_USE_SHLIB=yes $H5CXX -show) + echo "broken" >conftest.cpp + amuse_h5_h5cxx_extra_flags=$(HDF5_USE_SHLIB=yes $H5CXX -show -c conftest.cpp) + rm conftest.cpp + + amuse_h5_include_flags="" + amuse_h5_link_flags="" + + for amuse_h5_flag in $amuse_h5_h5cxx_flags $amuse_h5_h5cxx_extra_flags + do + if test "${amuse_h5_flag#-I}" != "$amuse_h5_flag" + then + if ! echo "$amuse_h5_include_flags" | grep -e "$amuse_h5_flag" >/dev/null 2>&1 + then + amuse_h5_include_flags="$amuse_h5_include_flags $amuse_h5_flag" + fi + elif test "${amuse_h5_flag#-L}" != "$amuse_h5_flag" + then + if ! echo "$amuse_h5_result" | grep -e "$amuse_h5_flag" >/dev/null 2>&1 + then + amuse_h5_link_flags="$amuse_h5_link_flags $amuse_h5_flag" + fi + fi + done + + + ac_ext=cpp +ac_cpp='$CXXCPP $CPPFLAGS' +ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_cxx_compiler_gnu + + amuse_h5_CXXFLAGS="$amuse_h5_include_flags" + amuse_h5_LDFLAGS="$amuse_h5_link_flags" + + amuse_h5_name="C++ with flags from h5c++" + amuse_h5_prefix="CXX" + amuse_h5_target="CXX" + amuse_h5_program="#include +#ifdef F77_DUMMY_MAIN + +# ifdef __cplusplus + extern "C" +# endif + int F77_DUMMY_MAIN() { return 1; } + +#endif +int +main (void) +{ +H5::H5Library::open(); + ; + return 0; +}" + amuse_h5_libs="-lhdf5_cpp" + + amuse_h5_flags_var="${amuse_h5_prefix}FLAGS" + amuse_h5_flags_source_var="amuse_h5_${amuse_h5_flags_var}" + amuse_h5_flags_target_var="amuse_h5_detect_${amuse_h5_target}" + + eval "amuse_h5_save_FLAGS=\"\$$amuse_h5_flags_var\"" + amuse_h5_save_LDFLAGS="$LDFLAGS" + amuse_h5_save_LIBS="$LIBS" + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether we can build a program with HDF5 in $amuse_h5_name" >&5 +printf %s "checking whether we can build a program with HDF5 in $amuse_h5_name... " >&6; } + + eval "$amuse_h5_flags_var=\"\$$amuse_h5_flags_source_var \$$amuse_h5_flags_var\"" + LDFLAGS="$amuse_h5_LDFLAGS $LDFLAGS" + LIBS="$amuse_h5_libs" + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$amuse_h5_program +_ACEOF +if ac_fn_cxx_try_link "$LINENO" +then : + + eval "$amuse_h5_flags_target_var=\"yes\"" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + +else $as_nop + + eval "$amuse_h5_flags_target_var=\"no\"" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext + + LIBS="$amuse_h5_save_LIBS" + LDFLAGS="$amuse_h5_save_LDFLAGS" + eval "$amuse_h5_flags_var=\"\$amuse_h5_save_FLAGS\"" + + 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 - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for NetCDF4 libraries" >&5 -printf %s "checking for NetCDF4 libraries... " >&6; } + # Extract the first word of "h5fc", so it can be a program name with args. +set dummy h5fc; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_path_H5FC+y} +then : + printf %s "(cached) " >&6 +else $as_nop + case $H5FC in + [\\/]* | ?:[\\/]*) + ac_cv_path_H5FC="$H5FC" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_path_H5FC="$as_dir$ac_word$ac_exec_ext" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS - if test ! -f "$NC_CONFIG" || test ! -x "$NC_CONFIG"; then + ;; +esac +fi +H5FC=$ac_cv_path_H5FC +if test -n "$H5FC"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $H5FC" >&5 +printf "%s\n" "$H5FC" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + + if test -n "$H5FC" + then + amuse_h5_h5fc_flags=$(HDF5_USE_SHLIB=yes h5fc -show) + amuse_h5_h5fc_extra_flags=$(HDF5_USE_SHLIB=yes $H5CC -show -c) + + amuse_h5_include_flags="" + amuse_h5_link_flags="" + + for amuse_h5_flag in $amuse_h5_h5fc_flags $amuse_h5_h5fc_extra_flags + do + if test "${amuse_h5_flag#-I}" != "$amuse_h5_flag" + then + if ! echo "$amuse_h5_include_flags" | grep -e "$amuse_h5_flag" >/dev/null 2>&1 + then + amuse_h5_include_flags="$amuse_h5_include_flags $amuse_h5_flag" + fi + elif test "${amuse_h5_flag#-L}" != "$amuse_h5_flag" + then + if ! echo "$amuse_h5_result" | grep -e "$amuse_h5_flag" >/dev/null 2>&1 + then + amuse_h5_link_flags="$amuse_h5_link_flags $amuse_h5_flag" + fi + fi + done + + + amuse_h5_FCFLAGS="$amuse_h5_include_flags" + amuse_h5_LDFLAGS="$amuse_h5_link_flags" + + 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 + + + amuse_h5_name="Fortran with flags from h5fc" + amuse_h5_prefix="FC" + amuse_h5_target="FC" + amuse_h5_program=" program main + + use h5lib + + integer :: error + + call h5open_f(error) + call h5close_f(error) + end" + amuse_h5_libs="-lhdf5_fortran" + + amuse_h5_flags_var="${amuse_h5_prefix}FLAGS" + amuse_h5_flags_source_var="amuse_h5_${amuse_h5_flags_var}" + amuse_h5_flags_target_var="amuse_h5_detect_${amuse_h5_target}" + + eval "amuse_h5_save_FLAGS=\"\$$amuse_h5_flags_var\"" + amuse_h5_save_LDFLAGS="$LDFLAGS" + amuse_h5_save_LIBS="$LIBS" + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether we can build a program with HDF5 in $amuse_h5_name" >&5 +printf %s "checking whether we can build a program with HDF5 in $amuse_h5_name... " >&6; } + + eval "$amuse_h5_flags_var=\"\$$amuse_h5_flags_source_var \$$amuse_h5_flags_var\"" + LDFLAGS="$amuse_h5_LDFLAGS $LDFLAGS" + LIBS="$amuse_h5_libs" + + cat > conftest.$ac_ext <<_ACEOF +$amuse_h5_program +_ACEOF +if ac_fn_fc_try_link "$LINENO" +then : + + eval "$amuse_h5_flags_target_var=\"yes\"" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + +else $as_nop + + eval "$amuse_h5_flags_target_var=\"no\"" { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: -Unable to locate NetCDF4 compilation helper script 'nc-config'. -Please specify --with-netcdf4= as the full path prefix -where NetCDF4 has been installed. -NetCDF4 support is being disabled (equivalent to --with-netcdf4=no). -" >&5 -printf "%s\n" "$as_me: WARNING: +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext -Unable to locate NetCDF4 compilation helper script 'nc-config'. -Please specify --with-netcdf4= as the full path prefix -where NetCDF4 has been installed. -NetCDF4 support is being disabled (equivalent to --with-netcdf4=no). -" >&2;} - with_netcdf4="no" - with_netcdf4_fortran="no" + LIBS="$amuse_h5_save_LIBS" + LDFLAGS="$amuse_h5_save_LDFLAGS" + eval "$amuse_h5_flags_var=\"\$amuse_h5_save_FLAGS\"" + + + + amuse_h5_name="Fortran with the high-level API in hdf5_hl_fortran with flags from h5fc" + amuse_h5_prefix="FC" + amuse_h5_target="HL_FC" + amuse_h5_program=" program main + + use h5lt + + integer :: error + + error = h5ltfind_dataset_f(0_hid_t, 'test') + + end" + amuse_h5_libs="-lhdf5_hl_fortran" + + amuse_h5_flags_var="${amuse_h5_prefix}FLAGS" + amuse_h5_flags_source_var="amuse_h5_${amuse_h5_flags_var}" + amuse_h5_flags_target_var="amuse_h5_detect_${amuse_h5_target}" + + eval "amuse_h5_save_FLAGS=\"\$$amuse_h5_flags_var\"" + amuse_h5_save_LDFLAGS="$LDFLAGS" + amuse_h5_save_LIBS="$LIBS" + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether we can build a program with HDF5 in $amuse_h5_name" >&5 +printf %s "checking whether we can build a program with HDF5 in $amuse_h5_name... " >&6; } + + eval "$amuse_h5_flags_var=\"\$$amuse_h5_flags_source_var \$$amuse_h5_flags_var\"" + LDFLAGS="$amuse_h5_LDFLAGS $LDFLAGS" + LIBS="$amuse_h5_libs" + + cat > conftest.$ac_ext <<_ACEOF +$amuse_h5_program +_ACEOF +if ac_fn_fc_try_link "$LINENO" +then : + + eval "$amuse_h5_flags_target_var=\"yes\"" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + +else $as_nop + + eval "$amuse_h5_flags_target_var=\"no\"" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext + + LIBS="$amuse_h5_save_LIBS" + LDFLAGS="$amuse_h5_save_LDFLAGS" + eval "$amuse_h5_flags_var=\"\$amuse_h5_save_FLAGS\"" + + + if test $amuse_h5_detect_HL_FC = "yes" + then + amuse_h5_HL_FC_LIB="-lhdf5_hl_fortran" else - NETCDF4_CC=$(eval $NC_CONFIG --cc | $AWK '{print $1}') - if test "$NETCDF4_CC" = "ccache"; then - NETCDF4_CC=$(eval $NC_CONFIG --cc | $AWK '{print $2}') - fi - NETCDF4_VERSION=$(eval $NC_CONFIG --version | $AWK '{print $2}') + amuse_h5_name="Fortran with the high-level API in hdf5hl_fortran with flags from h5fc" + amuse_h5_prefix="FC" + amuse_h5_target="HL_FC" + amuse_h5_program=" program main - NETCDF4_CFLAGS=$(eval $NC_CONFIG --cflags) + use h5lt - NETCDF4_tmp_clibs=$(eval $NC_CONFIG --libs) + integer :: error - for arg in $NETCDF4_tmp_clibs ; do - case "$arg" in - -L*) echo $NETCDF4_LDFLAGS | $GREP -e "$arg" 2>&1 >/dev/null \ - || NETCDF4_LDFLAGS="$arg $NETCDF4_LDFLAGS" - ;; - -l*) echo $NETCDF4_LIBS | $GREP -e "$arg" 2>&1 >/dev/null \ - || NETCDF4_LIBS="$arg $NETCDF4_LIBS" - ;; - esac - done + error = h5ltfind_dataset_f(0_hid_t, 'test') - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes (version $NETCDF4_VERSION)" >&5 -printf "%s\n" "yes (version $NETCDF4_VERSION)" >&6; } + end" + amuse_h5_libs="-lhdf5hl_fortran" - if test "$netcdf4_requested_mode" = "parallel" ; then - with_netcdf4_parallel=$(eval $NC_CONFIG --has-pnetcdf) - if test "$with_netcdf4_parallel" = "no" ; then - as_fn_error $? " -parallel NetCDF4 is not supported (while it was requested) -" "$LINENO" 5 - fi + amuse_h5_flags_var="${amuse_h5_prefix}FLAGS" + amuse_h5_flags_source_var="amuse_h5_${amuse_h5_flags_var}" + amuse_h5_flags_target_var="amuse_h5_detect_${amuse_h5_target}" + + eval "amuse_h5_save_FLAGS=\"\$$amuse_h5_flags_var\"" + amuse_h5_save_LDFLAGS="$LDFLAGS" + amuse_h5_save_LIBS="$LIBS" + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether we can build a program with HDF5 in $amuse_h5_name" >&5 +printf %s "checking whether we can build a program with HDF5 in $amuse_h5_name... " >&6; } + + eval "$amuse_h5_flags_var=\"\$$amuse_h5_flags_source_var \$$amuse_h5_flags_var\"" + LDFLAGS="$amuse_h5_LDFLAGS $LDFLAGS" + LIBS="$amuse_h5_libs" + + cat > conftest.$ac_ext <<_ACEOF +$amuse_h5_program +_ACEOF +if ac_fn_fc_try_link "$LINENO" +then : + + eval "$amuse_h5_flags_target_var=\"yes\"" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + +else $as_nop + + eval "$amuse_h5_flags_target_var=\"no\"" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext + + LIBS="$amuse_h5_save_LIBS" + LDFLAGS="$amuse_h5_save_LDFLAGS" + eval "$amuse_h5_flags_var=\"\$amuse_h5_save_FLAGS\"" + + + if test $amuse_h5_detect_HL_FC = "yes" + then + amuse_h5_HL_FC_LIB="-lhdf5hl_fortran" fi + fi - ax_lib_netcdf4_save_CC=$CC - ax_lib_netcdf4_save_CPPFLAGS=$CPPFLAGS - ax_lib_netcdf4_save_LIBS=$LIBS - ax_lib_netcdf4_save_LDFLAGS=$LDFLAGS - CC=$NETCDF4_CC - CFLAGS=$NETCDF4_CFLAGS - LIBS=$NETCDF4_LIBS - LDFLAGS=$NETCDF4_LDFLAGS - ac_fn_c_check_header_compile "$LINENO" "netcdf.h" "ac_cv_header_netcdf_h" "$ac_includes_default" -if test "x$ac_cv_header_netcdf_h" = xyes + 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 + + + + if test "$amuse_h5_detect_FC" = "no" + then + amuse_h5_extra_flags=$(echo "$amuse_h5_include_flags" | sed -e 's^\([[:graph:]]*\)\( \|$\)^\1/../mod/shared ^g') + amuse_h5_FCFLAGS="$amuse_h5_include_flags $amuse_h5_extra_flags" + + 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 + + + amuse_h5_name="Fortran with flags from h5fc and mod/shared" + amuse_h5_prefix="FC" + amuse_h5_target="FC" + amuse_h5_program=" program main + + use h5lib + + integer :: error + + call h5open_f(error) + call h5close_f(error) + end" + amuse_h5_libs="-lhdf5_fortran" + + amuse_h5_flags_var="${amuse_h5_prefix}FLAGS" + amuse_h5_flags_source_var="amuse_h5_${amuse_h5_flags_var}" + amuse_h5_flags_target_var="amuse_h5_detect_${amuse_h5_target}" + + eval "amuse_h5_save_FLAGS=\"\$$amuse_h5_flags_var\"" + amuse_h5_save_LDFLAGS="$LDFLAGS" + amuse_h5_save_LIBS="$LIBS" + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether we can build a program with HDF5 in $amuse_h5_name" >&5 +printf %s "checking whether we can build a program with HDF5 in $amuse_h5_name... " >&6; } + + eval "$amuse_h5_flags_var=\"\$$amuse_h5_flags_source_var \$$amuse_h5_flags_var\"" + LDFLAGS="$amuse_h5_LDFLAGS $LDFLAGS" + LIBS="$amuse_h5_libs" + + cat > conftest.$ac_ext <<_ACEOF +$amuse_h5_program +_ACEOF +if ac_fn_fc_try_link "$LINENO" then : - ac_cv_netcdf4_h=yes + + eval "$amuse_h5_flags_target_var=\"yes\"" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + else $as_nop - ac_cv_netcdf4_h=no + + eval "$amuse_h5_flags_target_var=\"no\"" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for nc_create in -lnetcdf" >&5 -printf %s "checking for nc_create in -lnetcdf... " >&6; } -if test ${ac_cv_lib_netcdf_nc_create+y} + LIBS="$amuse_h5_save_LIBS" + LDFLAGS="$amuse_h5_save_LDFLAGS" + eval "$amuse_h5_flags_var=\"\$amuse_h5_save_FLAGS\"" + + + + amuse_h5_name="Fortran with the high-level API in hdf5_hl_fortran with flags from h5fc and mod/shared" + amuse_h5_prefix="FC" + amuse_h5_target="HL_FC" + amuse_h5_program=" program main + + use h5lt + + integer :: error + + error = h5ltfind_dataset_f(0_hid_t, 'test') + + end" + amuse_h5_libs="-lhdf5_hl_fortran" + + amuse_h5_flags_var="${amuse_h5_prefix}FLAGS" + amuse_h5_flags_source_var="amuse_h5_${amuse_h5_flags_var}" + amuse_h5_flags_target_var="amuse_h5_detect_${amuse_h5_target}" + + eval "amuse_h5_save_FLAGS=\"\$$amuse_h5_flags_var\"" + amuse_h5_save_LDFLAGS="$LDFLAGS" + amuse_h5_save_LIBS="$LIBS" + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether we can build a program with HDF5 in $amuse_h5_name" >&5 +printf %s "checking whether we can build a program with HDF5 in $amuse_h5_name... " >&6; } + + eval "$amuse_h5_flags_var=\"\$$amuse_h5_flags_source_var \$$amuse_h5_flags_var\"" + LDFLAGS="$amuse_h5_LDFLAGS $LDFLAGS" + LIBS="$amuse_h5_libs" + + cat > conftest.$ac_ext <<_ACEOF +$amuse_h5_program +_ACEOF +if ac_fn_fc_try_link "$LINENO" then : - printf %s "(cached) " >&6 + + eval "$amuse_h5_flags_target_var=\"yes\"" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + else $as_nop - ac_check_lib_save_LIBS=$LIBS -LIBS="-lnetcdf $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. */ -char nc_create (); -#ifdef F77_DUMMY_MAIN + eval "$amuse_h5_flags_target_var=\"no\"" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext + + LIBS="$amuse_h5_save_LIBS" + LDFLAGS="$amuse_h5_save_LDFLAGS" + eval "$amuse_h5_flags_var=\"\$amuse_h5_save_FLAGS\"" + + + if test $amuse_h5_detect_HL_FC = "yes" + then + amuse_h5_HL_FC_LIB="-lhdf5_hl_fortran" + else + + amuse_h5_name="Fortran with the high-level API in hdf5hl_fortran with flags from h5fc and mod/shared" + amuse_h5_prefix="FC" + amuse_h5_target="HL_FC" + amuse_h5_program=" program main + + use h5lt + + integer :: error + + error = h5ltfind_dataset_f(0_hid_t, 'test') + + end" + amuse_h5_libs="-lhdf5hl_fortran" + + amuse_h5_flags_var="${amuse_h5_prefix}FLAGS" + amuse_h5_flags_source_var="amuse_h5_${amuse_h5_flags_var}" + amuse_h5_flags_target_var="amuse_h5_detect_${amuse_h5_target}" + + eval "amuse_h5_save_FLAGS=\"\$$amuse_h5_flags_var\"" + amuse_h5_save_LDFLAGS="$LDFLAGS" + amuse_h5_save_LIBS="$LIBS" -# ifdef __cplusplus - extern "C" -# endif - int F77_DUMMY_MAIN() { return 1; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether we can build a program with HDF5 in $amuse_h5_name" >&5 +printf %s "checking whether we can build a program with HDF5 in $amuse_h5_name... " >&6; } -#endif -int -main (void) -{ -return nc_create (); - ; - return 0; -} + eval "$amuse_h5_flags_var=\"\$$amuse_h5_flags_source_var \$$amuse_h5_flags_var\"" + LDFLAGS="$amuse_h5_LDFLAGS $LDFLAGS" + LIBS="$amuse_h5_libs" + + cat > conftest.$ac_ext <<_ACEOF +$amuse_h5_program _ACEOF -if ac_fn_c_try_link "$LINENO" +if ac_fn_fc_try_link "$LINENO" then : - ac_cv_lib_netcdf_nc_create=yes + + eval "$amuse_h5_flags_target_var=\"yes\"" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + else $as_nop - ac_cv_lib_netcdf_nc_create=no + + eval "$amuse_h5_flags_target_var=\"no\"" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_netcdf_nc_create" >&5 -printf "%s\n" "$ac_cv_lib_netcdf_nc_create" >&6; } -if test "x$ac_cv_lib_netcdf_nc_create" = xyes -then : - ac_cv_libnetcdf4=yes -else $as_nop - ac_cv_libnetcdf4=no -fi - - if test "$ac_cv_netcdf4_h" = "no" && \ - test "$ac_cv_libnetcdf4" = "no" ; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: Unable to compile NetCDF4 test program" >&5 -printf "%s\n" "$as_me: WARNING: Unable to compile NetCDF4 test program" >&2;} - fi - - CC=$ax_lib_netcdf4_save_CC - CFLAGS=$ax_lib_netcdf4_save_CFLAGS - LIBS=$ax_lib_netcdf4_save_LIBS - LDFLAGS=$ax_lib_hdf5_save_LDFLAGS + LIBS="$amuse_h5_save_LIBS" + LDFLAGS="$amuse_h5_save_LDFLAGS" + eval "$amuse_h5_flags_var=\"\$amuse_h5_save_FLAGS\"" - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for matching NetCDF4 Fortran libraries" >&5 -printf %s "checking for matching NetCDF4 Fortran libraries... " >&6; } - NF_CONFIG="${NETCDF4_PREFIX}/bin/nf-config" - if test ! -f "$NF_CONFIG" || test ! -x "$NF_CONFIG"; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } - with_netcdf4_fortran="no" - else - NETCDF_FVERSION=$(eval $NF_CONFIG --version | $AWK '{print $2}') - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes (version $NETCDF_FVERSION)" >&5 -printf "%s\n" "yes (version $NETCDF_FVERSION)" >&6; } - NETCDF4_FC=$(eval $NF_CONFIG --fc | $AWK '{print $1}') - if test "$NETCDF4_FC" = "ccache"; then - NETCDF4_FC=$(eval $NF_CONFIG --fc | $AWK '{print $2}') - fi - NETCDF4_FFLAGS=$(eval $NC_CONFIG --fflags) - - NETCDF4_tmp_flibs=$(eval $NC_CONFIG --flibs) - for arg in $NETCDF4_tmp_flibs ; do - case "$arg" in - -L*) echo $NETCDF4_LDFLAGS | $GREP -e "$arg" 2>&1 >/dev/null \ - || NETCDF4_LDFLAGS="$arg $NETCDF4_LDFLAGS" - ;; - -l*) echo $NETCDF4_FLIBS | $GREP -e "$arg" 2>&1 >/dev/null \ - || NETCDF4_FLIBS="$arg $NETCDF4_FLIBS" - ;; - esac - done - with_netcdf4_fortran="yes" + if test $amuse_h5_detect_HL_FC = "yes" + then + amuse_h5_HL_FC_LIB="-lhdf5hl_fortran" fi + fi + 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 test "$amuse_h5_detect_FC" = "no" + then + amuse_h5_FCFLAGS="" + fi + fi + fi + if test "$amuse_h5_detect_C" = "yes" + then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: HDF5 installation detected" >&5 +printf "%s\n" "$as_me: HDF5 installation detected" >&6;} + + HDF5_C_FOUND="$amuse_h5_detect_C" + HDF5_HL_C_FOUND="$amuse_h5_detect_HL_C" + HDF5_CXX_FOUND="$amuse_h5_detect_CXX" + HDF5_FC_FOUND="$amuse_h5_detect_FC" + HDF5_HL_FC_FOUND="$amuse_h5_detect_HL_FC" + + HDF5_TYPE="serial" + HDF5_CFLAGS="$amuse_h5_CFLAGS" + HDF5_CXXFLAGS="$amuse_h5_CXXFLAGS" + HDF5_FCFLAGS="$amuse_h5_FCFLAGS" + HDF5_LDFLAGS="$amuse_h5_LDFLAGS" + HDF5_HLFC_LIB="$amuse_h5_HL_FC_LIB" + else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: no HDF5 installation detected" >&5 +printf "%s\n" "$as_me: WARNING: no HDF5 installation detected" >&2;} + fi -printf "%s\n" "#define HAVE_NETCDF4 1" >>confdefs.h - fi -fi - amuse_lib_qhull_save_libs="$LIBS" - LIBS="" - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for library containing qh_freeqhull" >&5 -printf %s "checking for library containing qh_freeqhull... " >&6; } -if test ${ac_cv_search_qh_freeqhull+y} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for a sed that does not truncate output" >&5 +printf %s "checking for a sed that does not truncate output... " >&6; } +if test ${ac_cv_path_SED+y} then : printf %s "(cached) " >&6 else $as_nop - ac_func_search_save_LIBS=$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. */ -char qh_freeqhull (); -#ifdef F77_DUMMY_MAIN - -# ifdef __cplusplus - extern "C" -# endif - int F77_DUMMY_MAIN() { return 1; } - -#endif -int -main (void) -{ -return qh_freeqhull (); - ; - return 0; -} -_ACEOF -for ac_lib in '' qhull_r + ac_script=s/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb/ + for ac_i in 1 2 3 4 5 6 7; do + ac_script="$ac_script$as_nl$ac_script" + done + echo "$ac_script" 2>/dev/null | sed 99q >conftest.sed + { ac_script=; unset ac_script;} + if test -z "$SED"; then + ac_path_SED_found=false + # Loop through the user's path and test for each of PROGNAME-LIST + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH do - if test -z "$ac_lib"; then - ac_res="none required" - else - ac_res=-l$ac_lib - LIBS="-l$ac_lib $ac_func_search_save_LIBS" + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_prog in sed gsed + do + for ac_exec_ext in '' $ac_executable_extensions; do + ac_path_SED="$as_dir$ac_prog$ac_exec_ext" + as_fn_executable_p "$ac_path_SED" || continue +# Check for GNU ac_path_SED and select it if it is found. + # Check for GNU $ac_path_SED +case `"$ac_path_SED" --version 2>&1` in +*GNU*) + ac_cv_path_SED="$ac_path_SED" ac_path_SED_found=:;; +*) + ac_count=0 + printf %s 0123456789 >"conftest.in" + while : + do + cat "conftest.in" "conftest.in" >"conftest.tmp" + mv "conftest.tmp" "conftest.in" + cp "conftest.in" "conftest.nl" + printf "%s\n" '' >> "conftest.nl" + "$ac_path_SED" -f conftest.sed < "conftest.nl" >"conftest.out" 2>/dev/null || break + diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break + as_fn_arith $ac_count + 1 && ac_count=$as_val + if test $ac_count -gt ${ac_path_SED_max-0}; then + # Best one so far, save it but keep looking for a better one + ac_cv_path_SED="$ac_path_SED" + ac_path_SED_max=$ac_count + fi + # 10*(2^10) chars as input seems more than enough + test $ac_count -gt 10 && break + done + rm -f conftest.in conftest.tmp conftest.nl conftest.out;; +esac + + $ac_path_SED_found && break 3 + done + done + done +IFS=$as_save_IFS + if test -z "$ac_cv_path_SED"; then + as_fn_error $? "no acceptable sed could be found in \$PATH" "$LINENO" 5 fi - if ac_fn_c_try_link "$LINENO" -then : - ac_cv_search_qh_freeqhull=$ac_res +else + ac_cv_path_SED=$SED fi -rm -f core conftest.err conftest.$ac_objext conftest.beam \ - conftest$ac_exeext - if test ${ac_cv_search_qh_freeqhull+y} -then : - break + fi -done -if test ${ac_cv_search_qh_freeqhull+y} +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_SED" >&5 +printf "%s\n" "$ac_cv_path_SED" >&6; } + SED="$ac_cv_path_SED" + rm -f conftest.sed + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for grep that handles long lines and -e" >&5 +printf %s "checking for grep that handles long lines and -e... " >&6; } +if test ${ac_cv_path_GREP+y} then : + printf %s "(cached) " >&6 +else $as_nop + if test -z "$GREP"; then + ac_path_GREP_found=false + # Loop through the user's path and test for each of PROGNAME-LIST + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_prog in grep ggrep + do + for ac_exec_ext in '' $ac_executable_extensions; do + ac_path_GREP="$as_dir$ac_prog$ac_exec_ext" + as_fn_executable_p "$ac_path_GREP" || continue +# Check for GNU ac_path_GREP and select it if it is found. + # Check for GNU $ac_path_GREP +case `"$ac_path_GREP" --version 2>&1` in +*GNU*) + ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;; +*) + ac_count=0 + printf %s 0123456789 >"conftest.in" + while : + do + cat "conftest.in" "conftest.in" >"conftest.tmp" + mv "conftest.tmp" "conftest.in" + cp "conftest.in" "conftest.nl" + printf "%s\n" 'GREP' >> "conftest.nl" + "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break + diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break + as_fn_arith $ac_count + 1 && ac_count=$as_val + if test $ac_count -gt ${ac_path_GREP_max-0}; then + # Best one so far, save it but keep looking for a better one + ac_cv_path_GREP="$ac_path_GREP" + ac_path_GREP_max=$ac_count + fi + # 10*(2^10) chars as input seems more than enough + test $ac_count -gt 10 && break + done + rm -f conftest.in conftest.tmp conftest.nl conftest.out;; +esac -else $as_nop - ac_cv_search_qh_freeqhull=no -fi -rm conftest.$ac_ext -LIBS=$ac_func_search_save_LIBS + $ac_path_GREP_found && break 3 + done + done + done +IFS=$as_save_IFS + if test -z "$ac_cv_path_GREP"; then + as_fn_error $? "no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 + fi +else + ac_cv_path_GREP=$GREP fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_qh_freeqhull" >&5 -printf "%s\n" "$ac_cv_search_qh_freeqhull" >&6; } -ac_res=$ac_cv_search_qh_freeqhull -if test "$ac_res" != no -then : - test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" - - FOUND_QHULL="yes" fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_GREP" >&5 +printf "%s\n" "$ac_cv_path_GREP" >&6; } + GREP="$ac_cv_path_GREP" - QHULL_LIBS="$LIBS" - QHULL_FLAGS="" - - LIBS="$amuse_lib_qhull_save_libs" - for ac_header in libqhull_r/libqhull_r.h -do : - ac_fn_c_check_header_compile "$LINENO" "libqhull_r/libqhull_r.h" "ac_cv_header_libqhull_r_libqhull_r_h" "$ac_includes_default" -if test "x$ac_cv_header_libqhull_r_libqhull_r_h" = xyes -then : - printf "%s\n" "#define HAVE_LIBQHULL_R_LIBQHULL_R_H 1" >>confdefs.h -else $as_nop - FOUND_QHULL="no" -fi -done +if test "" = "" ; then + netcdf4_requested_mode="serial" +elif test "" = "serial" ; then + netcdf4_requested_mode="serial" +elif test "" = "parallel"; then + netcdf4_requested_mode="parallel" +else + as_fn_error $? " +Unrecognized value for AX_LIB_NETCDF4 within configure.ac. +If supplied, argument 1 must be either 'serial' or 'parallel'. +" "$LINENO" 5 +fi +# Check whether --with-netcdf4 was given. +if test ${with_netcdf4+y} +then : + withval=$with_netcdf4; if test "$withval" = "no"; then + with_netcdf4="no" + elif test "$withval" = "yes"; then + with_netcdf4="yes" + else + with_netcdf4="yes" + NETCDF4_PREFIX="${withval}" + NC_CONFIG="${withval}/bin/nc-config" + fi +else $as_nop + with_netcdf4="yes" +fi +NETCDF4_CC="" +NETCDF4_VERSION="" +NETCDF4_CFLAGS="" +NETCDF4_CPPFLAGS="" +NETCDF4_LDFLAGS="" +NETCDF4_LIBS="" +NETCDF4_FC="" +NETCDF4_FFLAGS="" +NETCDF4_FLIBS="" -ac_ext=cpp -ac_cpp='$CXXCPP $CPPFLAGS' -ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_cxx_compiler_gnu -if test -z "$CXX"; then - if test -n "$CCC"; then - CXX=$CCC - else - if test -n "$ac_tool_prefix"; then - for ac_prog in g++ c++ gpp aCC CC cxx cc++ cl.exe FCC KCC RCC xlC_r xlC clang++ - do - # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. -set dummy $ac_tool_prefix$ac_prog; ac_word=$2 +if test "$with_netcdf4" = "yes"; then + if test -z "$NC_CONFIG"; then + for ac_prog in nc-config +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } -if test ${ac_cv_prog_CXX+y} +if test ${ac_cv_path_NC_CONFIG+y} then : printf %s "(cached) " >&6 else $as_nop - if test -n "$CXX"; then - ac_cv_prog_CXX="$CXX" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR + case $NC_CONFIG in + [\\/]* | ?:[\\/]*) + ac_cv_path_NC_CONFIG="$NC_CONFIG" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS @@ -14727,7 +18354,7 @@ do esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then - ac_cv_prog_CXX="$ac_tool_prefix$ac_prog" + ac_cv_path_NC_CONFIG="$as_dir$ac_word$ac_exec_ext" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi @@ -14735,196 +18362,272 @@ done done IFS=$as_save_IFS + ;; +esac fi -fi -CXX=$ac_cv_prog_CXX -if test -n "$CXX"; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CXX" >&5 -printf "%s\n" "$CXX" >&6; } +NC_CONFIG=$ac_cv_path_NC_CONFIG +if test -n "$NC_CONFIG"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $NC_CONFIG" >&5 +printf "%s\n" "$NC_CONFIG" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi - test -n "$CXX" && break - done -fi -if test -z "$CXX"; then - ac_ct_CXX=$CXX - for ac_prog in g++ c++ gpp aCC CC cxx cc++ cl.exe FCC KCC RCC xlC_r xlC clang++ -do - # Extract the first word of "$ac_prog", so it can be a program name with args. -set dummy $ac_prog; ac_word=$2 -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -printf %s "checking for $ac_word... " >&6; } -if test ${ac_cv_prog_ac_ct_CXX+y} -then : - printf %s "(cached) " >&6 -else $as_nop - if test -n "$ac_ct_CXX"; then - ac_cv_prog_ac_ct_CXX="$ac_ct_CXX" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - case $as_dir in #((( - '') as_dir=./ ;; - */) ;; - *) as_dir=$as_dir/ ;; - esac - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then - ac_cv_prog_ac_ct_CXX="$ac_prog" - printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS + test -n "$NC_CONFIG" && break +done + + NETCDF4_PREFIX=$($as_dirname -- $($as_dirname -- "$NC_CONFIG" || +$as_expr X"$NC_CONFIG" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$NC_CONFIG" : 'X\(//\)[^/]' \| \ + X"$NC_CONFIG" : 'X\(//\)$' \| \ + X"$NC_CONFIG" : 'X\(/\)' \| . 2>/dev/null || +printf "%s\n" X"$NC_CONFIG" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q') || +$as_expr X$($as_dirname -- "$NC_CONFIG" || +$as_expr X"$NC_CONFIG" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$NC_CONFIG" : 'X\(//\)[^/]' \| \ + X"$NC_CONFIG" : 'X\(//\)$' \| \ + X"$NC_CONFIG" : 'X\(/\)' \| . 2>/dev/null || +printf "%s\n" X"$NC_CONFIG" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q') : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X$($as_dirname -- "$NC_CONFIG" || +$as_expr X"$NC_CONFIG" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$NC_CONFIG" : 'X\(//\)[^/]' \| \ + X"$NC_CONFIG" : 'X\(//\)$' \| \ + X"$NC_CONFIG" : 'X\(/\)' \| . 2>/dev/null || +printf "%s\n" X"$NC_CONFIG" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q') : 'X\(//\)[^/]' \| \ + X$($as_dirname -- "$NC_CONFIG" || +$as_expr X"$NC_CONFIG" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$NC_CONFIG" : 'X\(//\)[^/]' \| \ + X"$NC_CONFIG" : 'X\(//\)$' \| \ + X"$NC_CONFIG" : 'X\(/\)' \| . 2>/dev/null || +printf "%s\n" X"$NC_CONFIG" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q') : 'X\(//\)$' \| \ + X$($as_dirname -- "$NC_CONFIG" || +$as_expr X"$NC_CONFIG" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$NC_CONFIG" : 'X\(//\)[^/]' \| \ + X"$NC_CONFIG" : 'X\(//\)$' \| \ + X"$NC_CONFIG" : 'X\(/\)' \| . 2>/dev/null || +printf "%s\n" X"$NC_CONFIG" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q') : 'X\(/\)' \| . 2>/dev/null || +printf "%s\n" X$($as_dirname -- "$NC_CONFIG" || +$as_expr X"$NC_CONFIG" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$NC_CONFIG" : 'X\(//\)[^/]' \| \ + X"$NC_CONFIG" : 'X\(//\)$' \| \ + X"$NC_CONFIG" : 'X\(/\)' \| . 2>/dev/null || +printf "%s\n" X"$NC_CONFIG" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q') | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q') + else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking Using provided NetCDF4 prefix" >&5 +printf %s "checking Using provided NetCDF4 prefix... " >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $NC_CONFIG" >&5 +printf "%s\n" "$NC_CONFIG" >&6; } + fi + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for NetCDF4 libraries" >&5 +printf %s "checking for NetCDF4 libraries... " >&6; } -fi -fi -ac_ct_CXX=$ac_cv_prog_ac_ct_CXX -if test -n "$ac_ct_CXX"; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CXX" >&5 -printf "%s\n" "$ac_ct_CXX" >&6; } -else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 + if test ! -f "$NC_CONFIG" || test ! -x "$NC_CONFIG"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } -fi + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: +Unable to locate NetCDF4 compilation helper script 'nc-config'. +Please specify --with-netcdf4= as the full path prefix +where NetCDF4 has been installed. +NetCDF4 support is being disabled (equivalent to --with-netcdf4=no). +" >&5 +printf "%s\n" "$as_me: WARNING: - test -n "$ac_ct_CXX" && break -done +Unable to locate NetCDF4 compilation helper script 'nc-config'. +Please specify --with-netcdf4= as the full path prefix +where NetCDF4 has been installed. +NetCDF4 support is being disabled (equivalent to --with-netcdf4=no). +" >&2;} + with_netcdf4="no" + with_netcdf4_fortran="no" + else + NETCDF4_CC=$(eval $NC_CONFIG --cc | $AWK '{print $1}') + if test "$NETCDF4_CC" = "ccache"; then + NETCDF4_CC=$(eval $NC_CONFIG --cc | $AWK '{print $2}') + fi - if test "x$ac_ct_CXX" = x; then - CXX="g++" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} -ac_tool_warned=yes ;; -esac - CXX=$ac_ct_CXX - fi -fi + NETCDF4_VERSION=$(eval $NC_CONFIG --version | $AWK '{print $2}') - fi -fi -# Provide some information about the compiler. -printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for C++ compiler version" >&5 -set X $ac_compile -ac_compiler=$2 -for ac_option in --version -v -V -qversion; do - { { ac_try="$ac_compiler $ac_option >&5" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -printf "%s\n" "$ac_try_echo"; } >&5 - (eval "$ac_compiler $ac_option >&5") 2>conftest.err - ac_status=$? - if test -s conftest.err; then - sed '10a\ -... rest of stderr output deleted ... - 10q' conftest.err >conftest.er1 - cat conftest.er1 >&5 - fi - rm -f conftest.er1 conftest.err - printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } -done + NETCDF4_CFLAGS=$(eval $NC_CONFIG --cflags) -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether the compiler supports GNU C++" >&5 -printf %s "checking whether the compiler supports GNU C++... " >&6; } -if test ${ac_cv_cxx_compiler_gnu+y} -then : - printf %s "(cached) " >&6 -else $as_nop - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ + NETCDF4_tmp_clibs=$(eval $NC_CONFIG --libs) -#ifdef F77_DUMMY_MAIN + for arg in $NETCDF4_tmp_clibs ; do + case "$arg" in + -L*) echo $NETCDF4_LDFLAGS | $GREP -e "$arg" 2>&1 >/dev/null \ + || NETCDF4_LDFLAGS="$arg $NETCDF4_LDFLAGS" + ;; + -l*) echo $NETCDF4_LIBS | $GREP -e "$arg" 2>&1 >/dev/null \ + || NETCDF4_LIBS="$arg $NETCDF4_LIBS" + ;; + esac + done -# ifdef __cplusplus - extern "C" -# endif - int F77_DUMMY_MAIN() { return 1; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes (version $NETCDF4_VERSION)" >&5 +printf "%s\n" "yes (version $NETCDF4_VERSION)" >&6; } -#endif -int -main (void) -{ -#ifndef __GNUC__ - choke me -#endif + if test "$netcdf4_requested_mode" = "parallel" ; then + with_netcdf4_parallel=$(eval $NC_CONFIG --has-pnetcdf) + if test "$with_netcdf4_parallel" = "no" ; then + as_fn_error $? " +parallel NetCDF4 is not supported (while it was requested) +" "$LINENO" 5 + fi + fi - ; - return 0; -} -_ACEOF -if ac_fn_cxx_try_compile "$LINENO" + ax_lib_netcdf4_save_CC=$CC + ax_lib_netcdf4_save_CPPFLAGS=$CPPFLAGS + ax_lib_netcdf4_save_LIBS=$LIBS + ax_lib_netcdf4_save_LDFLAGS=$LDFLAGS + CC=$NETCDF4_CC + CFLAGS=$NETCDF4_CFLAGS + LIBS=$NETCDF4_LIBS + LDFLAGS=$NETCDF4_LDFLAGS + ac_fn_c_check_header_compile "$LINENO" "netcdf.h" "ac_cv_header_netcdf_h" "$ac_includes_default" +if test "x$ac_cv_header_netcdf_h" = xyes then : - ac_compiler_gnu=yes + ac_cv_netcdf4_h=yes else $as_nop - ac_compiler_gnu=no -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext -ac_cv_cxx_compiler_gnu=$ac_compiler_gnu - + ac_cv_netcdf4_h=no fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_cxx_compiler_gnu" >&5 -printf "%s\n" "$ac_cv_cxx_compiler_gnu" >&6; } -ac_compiler_gnu=$ac_cv_cxx_compiler_gnu -if test $ac_compiler_gnu = yes; then - GXX=yes -else - GXX= -fi -ac_test_CXXFLAGS=${CXXFLAGS+y} -ac_save_CXXFLAGS=$CXXFLAGS -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $CXX accepts -g" >&5 -printf %s "checking whether $CXX accepts -g... " >&6; } -if test ${ac_cv_prog_cxx_g+y} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for nc_create in -lnetcdf" >&5 +printf %s "checking for nc_create in -lnetcdf... " >&6; } +if test ${ac_cv_lib_netcdf_nc_create+y} then : printf %s "(cached) " >&6 else $as_nop - ac_save_cxx_werror_flag=$ac_cxx_werror_flag - ac_cxx_werror_flag=yes - ac_cv_prog_cxx_g=no - CXXFLAGS="-g" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -#ifdef F77_DUMMY_MAIN - -# ifdef __cplusplus - extern "C" -# endif - int F77_DUMMY_MAIN() { return 1; } - -#endif -int -main (void) -{ - - ; - return 0; -} -_ACEOF -if ac_fn_cxx_try_compile "$LINENO" -then : - ac_cv_prog_cxx_g=yes -else $as_nop - CXXFLAGS="" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext + ac_check_lib_save_LIBS=$LIBS +LIBS="-lnetcdf $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. */ +char nc_create (); #ifdef F77_DUMMY_MAIN # ifdef __cplusplus @@ -14936,20 +18639,106 @@ else $as_nop int main (void) { - +return nc_create (); ; return 0; } _ACEOF -if ac_fn_cxx_try_compile "$LINENO" +if ac_fn_c_try_link "$LINENO" +then : + ac_cv_lib_netcdf_nc_create=yes +else $as_nop + ac_cv_lib_netcdf_nc_create=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_netcdf_nc_create" >&5 +printf "%s\n" "$ac_cv_lib_netcdf_nc_create" >&6; } +if test "x$ac_cv_lib_netcdf_nc_create" = xyes then : + ac_cv_libnetcdf4=yes +else $as_nop + ac_cv_libnetcdf4=no +fi + + if test "$ac_cv_netcdf4_h" = "no" && \ + test "$ac_cv_libnetcdf4" = "no" ; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: Unable to compile NetCDF4 test program" >&5 +printf "%s\n" "$as_me: WARNING: Unable to compile NetCDF4 test program" >&2;} + fi + + CC=$ax_lib_netcdf4_save_CC + CFLAGS=$ax_lib_netcdf4_save_CFLAGS + LIBS=$ax_lib_netcdf4_save_LIBS + LDFLAGS=$ax_lib_hdf5_save_LDFLAGS + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for matching NetCDF4 Fortran libraries" >&5 +printf %s "checking for matching NetCDF4 Fortran libraries... " >&6; } + NF_CONFIG="${NETCDF4_PREFIX}/bin/nf-config" + if test ! -f "$NF_CONFIG" || test ! -x "$NF_CONFIG"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + with_netcdf4_fortran="no" + else + NETCDF_FVERSION=$(eval $NF_CONFIG --version | $AWK '{print $2}') + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes (version $NETCDF_FVERSION)" >&5 +printf "%s\n" "yes (version $NETCDF_FVERSION)" >&6; } + NETCDF4_FC=$(eval $NF_CONFIG --fc | $AWK '{print $1}') + if test "$NETCDF4_FC" = "ccache"; then + NETCDF4_FC=$(eval $NF_CONFIG --fc | $AWK '{print $2}') + fi + NETCDF4_FFLAGS=$(eval $NC_CONFIG --fflags) + + NETCDF4_tmp_flibs=$(eval $NC_CONFIG --flibs) + + for arg in $NETCDF4_tmp_flibs ; do + case "$arg" in + -L*) echo $NETCDF4_LDFLAGS | $GREP -e "$arg" 2>&1 >/dev/null \ + || NETCDF4_LDFLAGS="$arg $NETCDF4_LDFLAGS" + ;; + -l*) echo $NETCDF4_FLIBS | $GREP -e "$arg" 2>&1 >/dev/null \ + || NETCDF4_FLIBS="$arg $NETCDF4_FLIBS" + ;; + esac + done + with_netcdf4_fortran="yes" + fi + + + + + + + + + + +printf "%s\n" "#define HAVE_NETCDF4 1" >>confdefs.h + + fi +fi + + + amuse_lib_qhull_save_libs="$LIBS" + LIBS="" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for library containing qh_freeqhull" >&5 +printf %s "checking for library containing qh_freeqhull... " >&6; } +if test ${ac_cv_search_qh_freeqhull+y} +then : + printf %s "(cached) " >&6 else $as_nop - ac_cxx_werror_flag=$ac_save_cxx_werror_flag - CXXFLAGS="-g" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext + ac_func_search_save_LIBS=$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. */ +char qh_freeqhull (); #ifdef F77_DUMMY_MAIN # ifdef __cplusplus @@ -14961,138 +18750,69 @@ else $as_nop int main (void) { - +return qh_freeqhull (); ; return 0; } _ACEOF -if ac_fn_cxx_try_compile "$LINENO" -then : - ac_cv_prog_cxx_g=yes -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext - ac_cxx_werror_flag=$ac_save_cxx_werror_flag -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cxx_g" >&5 -printf "%s\n" "$ac_cv_prog_cxx_g" >&6; } -if test $ac_test_CXXFLAGS; then - CXXFLAGS=$ac_save_CXXFLAGS -elif test $ac_cv_prog_cxx_g = yes; then - if test "$GXX" = yes; then - CXXFLAGS="-g -O2" - else - CXXFLAGS="-g" - fi -else - if test "$GXX" = yes; then - CXXFLAGS="-O2" +for ac_lib in '' qhull_r +do + if test -z "$ac_lib"; then + ac_res="none required" else - CXXFLAGS= + ac_res=-l$ac_lib + LIBS="-l$ac_lib $ac_func_search_save_LIBS" fi -fi -ac_prog_cxx_stdcxx=no -if test x$ac_prog_cxx_stdcxx = xno -then : - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $CXX option to enable C++11 features" >&5 -printf %s "checking for $CXX option to enable C++11 features... " >&6; } -if test ${ac_cv_prog_cxx_cxx11+y} + if ac_fn_c_try_link "$LINENO" then : - printf %s "(cached) " >&6 -else $as_nop - ac_cv_prog_cxx_cxx11=no -ac_save_CXX=$CXX -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -$ac_cxx_conftest_cxx11_program -_ACEOF -for ac_arg in '' -std=gnu++11 -std=gnu++0x -std=c++11 -std=c++0x -qlanglvl=extended0x -AA -do - CXX="$ac_save_CXX $ac_arg" - if ac_fn_cxx_try_compile "$LINENO" + ac_cv_search_qh_freeqhull=$ac_res +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext + if test ${ac_cv_search_qh_freeqhull+y} then : - ac_cv_prog_cxx_cxx11=$ac_arg + break fi -rm -f core conftest.err conftest.$ac_objext conftest.beam - test "x$ac_cv_prog_cxx_cxx11" != "xno" && break done -rm -f conftest.$ac_ext -CXX=$ac_save_CXX -fi - -if test "x$ac_cv_prog_cxx_cxx11" = xno -then : - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 -printf "%s\n" "unsupported" >&6; } -else $as_nop - if test "x$ac_cv_prog_cxx_cxx11" = x +if test ${ac_cv_search_qh_freeqhull+y} then : - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 -printf "%s\n" "none needed" >&6; } + else $as_nop - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cxx_cxx11" >&5 -printf "%s\n" "$ac_cv_prog_cxx_cxx11" >&6; } - CXX="$CXX $ac_cv_prog_cxx_cxx11" -fi - ac_cv_prog_cxx_stdcxx=$ac_cv_prog_cxx_cxx11 - ac_prog_cxx_stdcxx=cxx11 + ac_cv_search_qh_freeqhull=no fi +rm conftest.$ac_ext +LIBS=$ac_func_search_save_LIBS fi -if test x$ac_prog_cxx_stdcxx = xno -then : - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $CXX option to enable C++98 features" >&5 -printf %s "checking for $CXX option to enable C++98 features... " >&6; } -if test ${ac_cv_prog_cxx_cxx98+y} -then : - printf %s "(cached) " >&6 -else $as_nop - ac_cv_prog_cxx_cxx98=no -ac_save_CXX=$CXX -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -$ac_cxx_conftest_cxx98_program -_ACEOF -for ac_arg in '' -std=gnu++98 -std=c++98 -qlanglvl=extended -AA -do - CXX="$ac_save_CXX $ac_arg" - if ac_fn_cxx_try_compile "$LINENO" +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_qh_freeqhull" >&5 +printf "%s\n" "$ac_cv_search_qh_freeqhull" >&6; } +ac_res=$ac_cv_search_qh_freeqhull +if test "$ac_res" != no then : - ac_cv_prog_cxx_cxx98=$ac_arg -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam - test "x$ac_cv_prog_cxx_cxx98" != "xno" && break -done -rm -f conftest.$ac_ext -CXX=$ac_save_CXX + test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" + + FOUND_QHULL="yes" + fi -if test "x$ac_cv_prog_cxx_cxx98" = xno -then : - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 -printf "%s\n" "unsupported" >&6; } -else $as_nop - if test "x$ac_cv_prog_cxx_cxx98" = x + QHULL_LIBS="$LIBS" + QHULL_FLAGS="" + + LIBS="$amuse_lib_qhull_save_libs" + + for ac_header in libqhull_r/libqhull_r.h +do : + ac_fn_c_check_header_compile "$LINENO" "libqhull_r/libqhull_r.h" "ac_cv_header_libqhull_r_libqhull_r_h" "$ac_includes_default" +if test "x$ac_cv_header_libqhull_r_libqhull_r_h" = xyes then : - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 -printf "%s\n" "none needed" >&6; } + printf "%s\n" "#define HAVE_LIBQHULL_R_LIBQHULL_R_H 1" >>confdefs.h + else $as_nop - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cxx_cxx98" >&5 -printf "%s\n" "$ac_cv_prog_cxx_cxx98" >&6; } - CXX="$CXX $ac_cv_prog_cxx_cxx98" -fi - ac_cv_prog_cxx_stdcxx=$ac_cv_prog_cxx_cxx98 - ac_prog_cxx_stdcxx=cxx98 -fi + FOUND_QHULL="no" fi -ac_ext=cpp -ac_cpp='$CXXCPP $CPPFLAGS' -ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_cxx_compiler_gnu +done + + @@ -15604,9 +19324,17 @@ if test "x${FOUND_LIBZ}" = "xyes" then : FEATURES="${FEATURES} libz" fi -if test "x${with_hdf5}" = "xyes" +if test "x${HDF5_C_FOUND}" = "xyes" +then : + FEATURES="${FEATURES} hdf5-c" +fi +if test "x${HDF5_CXX_FOUND}" = "xyes" +then : + FEATURES="${FEATURES} hdf5-cxx" +fi +if test "x${HDF5_FC_FOUND}" = "xyes" then : - FEATURES="${FEATURES} hdf5" + FEATURES="${FEATURES} hdf5-fortran" fi if test "x${FOUND_NETCDF}" = "xyes" then : diff --git a/support/configure.ac b/support/configure.ac index a1662b322f..3442e951d0 100644 --- a/support/configure.ac +++ b/support/configure.ac @@ -85,7 +85,9 @@ else AMUSE_CONDA_PACKAGE(FOUND_MPFR, mpfr) AMUSE_CONDA_PACKAGE(FOUND_FFTW, fftw) AMUSE_CONDA_PACKAGE(FOUND_LIBZ, zlib) - AMUSE_CONDA_PACKAGE(with_hdf5, hdf5) + AMUSE_CONDA_PACKAGE(HDF5_C_FOUND, hdf5) + AMUSE_CONDA_PACKAGE(HDF5_CXX_FOUND, hdf5) + AMUSE_CONDA_PACKAGE(HDF5_FC_FOUND, hdf5) AMUSE_CONDA_PACKAGE(FOUND_NETCDF, netcdf4) AMUSE_CONDA_PACKAGE(FOUND_QHULL, qhull) AMUSE_CONDA_PACKAGE(FOUND_HEALPIX_CXX, healpix_cxx) @@ -164,7 +166,7 @@ else AX_MPFR() AX_FFTW() AMUSE_LIBZ() - AX_LIB_HDF5() + AMUSE_LIB_HDF5() AX_LIB_NETCDF4() AMUSE_LIB_QHULL() AMUSE_LIB_HEALPIX_CXX() @@ -224,7 +226,9 @@ ENABLE_FEATURE_IF_EQUALS([gmp], [FOUND_GMP], [yes]) ENABLE_FEATURE_IF_EQUALS([mpfr], [FOUND_MPFR], [yes]) ENABLE_FEATURE_IF_EQUALS([fftw], [FOUND_FFTW], [yes]) ENABLE_FEATURE_IF_EQUALS([libz], [FOUND_LIBZ], [yes]) -ENABLE_FEATURE_IF_EQUALS([hdf5], [with_hdf5], [yes]) +ENABLE_FEATURE_IF_EQUALS([hdf5-c], [HDF5_C_FOUND], [yes]) +ENABLE_FEATURE_IF_EQUALS([hdf5-cxx], [HDF5_CXX_FOUND], [yes]) +ENABLE_FEATURE_IF_EQUALS([hdf5-fortran], [HDF5_FC_FOUND], [yes]) ENABLE_FEATURE_IF_EQUALS([netcdf4], [FOUND_NETCDF], [yes]) ENABLE_FEATURE_IF_EQUALS([qhull], [FOUND_QHULL], [yes]) ENABLE_FEATURE_IF_EQUALS([healpix-cxx], [FOUND_HEALPIX_CXX], [yes]) diff --git a/support/shared/m4/amuse_lib_hdf5.m4 b/support/shared/m4/amuse_lib_hdf5.m4 new file mode 100644 index 0000000000..a1b7b88375 --- /dev/null +++ b/support/shared/m4/amuse_lib_hdf5.m4 @@ -0,0 +1,579 @@ +# AMUSE_LIB_HDF5_CHECK_ROOT() +# +# Basic check to see if the given path contains an HDF5 installation. +# +# Args: +# source Source of this path, for printing +# path Root of the potential installation tree +# +# Sets amuse_h5_root to the given directory if an installation was found. +# +AC_DEFUN([AMUSE_LIB_HDF5_CHECK_ROOT], [ + AC_MSG_CHECKING([whether $1 points to an HDF5 installation]) + if test -z "$2" + then + AC_MSG_RESULT([no]) + elif test -f "$2/bin/h5pcc" + then + AC_MSG_RESULT([no, because this seems to be a parallel build]) + else + if test -f "$2/include/hdf5.h" && test -f "$2/lib/libhdf5.so" + then + AC_MSG_RESULT([yes]) + amuse_h5_result="yes" + amuse_h5_root="$2" + else + AC_MSG_RESULT([no]) + amuse_h5_result="no" + fi + fi +]) + + +# AMUSE_LIB_HDF5_VERIFY_FLAGS() +# +# Checks that we can compile and link a simple application. +# +# Set a language first using AC_LANG_PUSH, then call this to try compiling and linking. +# +# Args: +# name Name of the language/scenario we're testing +# prefix Prefix for compiler flags variable, e.g. C or CXX or FC +# target Name of target variable to set to yes on success +# program Program to try to compile and link, use AC_LANG_PROGRAM +# libs Libraries to link +# +# Sets amuse_h5_detect_ to "yes" or "no" depending on the result. +# +AC_DEFUN([AMUSE_LIB_HDF5_VERIFY_FLAGS], [ + amuse_h5_name="$1" + amuse_h5_prefix="$2" + amuse_h5_target="$3" + amuse_h5_program="$4" + amuse_h5_libs="$5" + + amuse_h5_flags_var="${amuse_h5_prefix}FLAGS" + amuse_h5_flags_source_var="amuse_h5_${amuse_h5_flags_var}" + amuse_h5_flags_target_var="amuse_h5_detect_${amuse_h5_target}" + + eval "amuse_h5_save_FLAGS=\"\$$amuse_h5_flags_var\"" + amuse_h5_save_LDFLAGS="$LDFLAGS" + amuse_h5_save_LIBS="$LIBS" + + AC_MSG_CHECKING([whether we can build a program with HDF5 in $amuse_h5_name]) + + eval "$amuse_h5_flags_var=\"\$$amuse_h5_flags_source_var \$$amuse_h5_flags_var\"" + LDFLAGS="$amuse_h5_LDFLAGS $LDFLAGS" + LIBS="$amuse_h5_libs" + + dnl that AC_LANG_DEFINES_PROVIDED call silences a spurious warning + AC_LINK_IFELSE([AC_LANG_DEFINES_PROVIDED()][$amuse_h5_program], [ + eval "$amuse_h5_flags_target_var=\"yes\"" + AC_MSG_RESULT([yes]) + ], [ + eval "$amuse_h5_flags_target_var=\"no\"" + AC_MSG_RESULT([no]) + ]) + + LIBS="$amuse_h5_save_LIBS" + LDFLAGS="$amuse_h5_save_LDFLAGS" + eval "$amuse_h5_flags_var=\"\$amuse_h5_save_FLAGS\"" +]) + + +# AMUSE_LIB_HDF5_VERIFY_FORTRAN() +# +# Checks that we can compile and link with HDF5 in Fortran +# +# See AMUSE_LIB_HDF5_VERIFY_FEATURES below, it's split off from that because we're +# calling it directly in AMUSE_LIB_HDF5_DETECT_ENV. +# +# Args: +# variant: Text to print describing which variant we're trying +# +# Sets amuse_h5_detect_FC, amuse_h5_detect_HL_FC, and, if amuse_h5_detect_HL_FC is +# yes, sets amuse_h5_HL_FC_LIB to the name of the high-level Fortran library to use. +# +AC_DEFUN([AMUSE_LIB_HDF5_VERIFY_FORTRAN], [ + AC_LANG_PUSH(Fortran) + AMUSE_LIB_HDF5_VERIFY_FLAGS( + [Fortran $1], [FC], [FC], [AC_LANG_PROGRAM([], [ + use h5lib + + integer :: error + + call h5open_f(error) + call h5close_f(error)])], + [-lhdf5_fortran]) + + AMUSE_LIB_HDF5_VERIFY_FLAGS( + [Fortran with the high-level API in hdf5_hl_fortran $1], [FC], [HL_FC], AC_LANG_PROGRAM([], [ + use h5lt + + integer :: error + + error = h5ltfind_dataset_f(0_hid_t, 'test') + ]), + [-lhdf5_hl_fortran]) + + if test $amuse_h5_detect_HL_FC = "yes" + then + amuse_h5_HL_FC_LIB="-lhdf5_hl_fortran" + else + AMUSE_LIB_HDF5_VERIFY_FLAGS( + [Fortran with the high-level API in hdf5hl_fortran $1], [FC], [HL_FC], AC_LANG_PROGRAM([], [ + use h5lt + + integer :: error + + error = h5ltfind_dataset_f(0_hid_t, 'test') + ]), + [-lhdf5hl_fortran]) + + if test $amuse_h5_detect_HL_FC = "yes" + then + amuse_h5_HL_FC_LIB="-lhdf5hl_fortran" + fi + fi + + AC_LANG_POP(Fortran) +]) + + +# AMUSE_LIB_HDF5_DETECT_FEATURES_AT() +# +# Checks that we can use (compile and link) various features of HDF5 +# +# Args: +# path Root path of the installation to detect features of +# +# Sets amuse_h5_detect_C, amuse_h5_detect_HL_C, amuse_h5_detect_CXX, +# amuse_h5_detect_FC, and amuse_h5_detect_HL_FC to "yes" or "no" indicating whether +# the corresponding features are found to work. +# +# Sets amuse_h5_CFLAGS, amuse_h5_CXXFLAGS, amuse_h5_FCFLAGS, amuse_h5_LDFLAGS to any +# additional (on top of CFLAGS/CXXFLAGS/FCFLAGS/LDFLAGS) flags needed to compile and +# link applications. +# +AC_DEFUN([AMUSE_LIB_HDF5_DETECT_FEATURES_AT], [ + amuse_h5_LDFLAGS="-L$1/lib" + + AC_LANG_PUSH(C) + amuse_h5_CFLAGS="-I$1/include" + AMUSE_LIB_HDF5_VERIFY_FLAGS( + [C], [C], [C], AC_LANG_PROGRAM([#include ], [H5open(); H5close();]), + [-lhdf5]) + + AMUSE_LIB_HDF5_VERIFY_FLAGS( + [C with the high-level API], [C], [HL_C], + AC_LANG_PROGRAM([#include ], [H5LTfind_dataset(0, \"test\")]), + [-lhdf5_hl]) + AC_LANG_POP(C) + + AC_LANG_PUSH(C++) + amuse_h5_CXXFLAGS="-I$1/include" + AMUSE_LIB_HDF5_VERIFY_FLAGS( + [C++], [CXX], [CXX], + AC_LANG_PROGRAM([#include ], [H5::H5Library::open();]), + [-lhdf5_cpp]) + AC_LANG_POP(C++) + + amuse_h5_FCFLAGS="-I$1/include" + AMUSE_LIB_HDF5_VERIFY_FORTRAN([with mods in /include]) + + if test $amuse_h5_detect_FC = "no" + then + amuse_h5_FCFLAGS="-I$1/mod/shared" + AMUSE_LIB_HDF5_VERIFY_FORTRAN([with mods in /mod/shared]) + fi + + if test $amuse_h5_detect_FC = "no" + then + amuse_h5_FCFLAGS="" + fi +]) + + +# AMUSE_LIB_HDF5_FIND_ROOT() +# +# Finds an HDF5 installation and detects its features. +# +# Tries HDF5_ROOT, HDF5_DIR, and CMAKE_PREFIX_PATH, in that order. +# +# Sets amuse_h5_root to a non-empty value if a working root is found. Sets +# amuse_h5_detect_ to "yes" or "no" indicating whether the feature is present +# and working. +# +AC_DEFUN([AMUSE_LIB_HDF5_FIND_ROOT], [ + amuse_h5_result="no" + + if test -n "$CONDA_PREFIX" + then + AC_MSG_NOTICE([Conda environment detected, ignoring HDF5_ROOT, HDF5_DIR and CMAKE_PREFIX_PATH]) + else + AMUSE_LIB_HDF5_CHECK_ROOT([HDF5_ROOT], [$HDF5_ROOT]) + + if test "$amuse_h5_result" = "no" + then + AMUSE_LIB_HDF5_CHECK_ROOT([HDF5_DIR], [$HDF5_DIR]) + fi + + if test "$amuse_h5_result" = "no" && test -n "$CMAKE_PREFIX_PATH" + then + amuse_h5_save_IFS="$IFS" + IFS=: + for amuse_h5_path in $CMAKE_PREFIX_PATH + do + # restore IFS immediately as it may mess up the below + IFS="$amuse_h5_save_IFS" + if test -z "$amuse_h5_path" + then + continue + fi + + AMUSE_LIB_HDF5_CHECK_ROOT( + [$amuse_h5_path from CMAKE_PREFIX_PATH], [$amuse_h5_path]) + + if test "$amuse_h5_result" = "yes" + then + break + fi + + done + IFS="$amuse_h5_save_IFS" + fi + + if test "$amuse_h5_result" = "yes" + then + AMUSE_LIB_HDF5_DETECT_FEATURES_AT([$amuse_h5_root]) + fi + fi +]) + + +# AMUSE_LIB_HDF5_INCLUDE_PATHS_FROM_FLAGS() +# +# Args: +# flags: a string containing compiler flags with possible embedded includes +# +# Parses the given string for -isystem and -I flags and sets +# amuse_h5_result to a colon-separated list of those paths. +# +AC_DEFUN([AMUSE_LIB_HDF5_INCLUDE_PATHS_FROM_FLAGS], [ + amuse_h5_result="" + amuse_h5_in_isystem="no" + for flag in $1 + do + if test "$amuse_h5_in_isystem" = "yes" + then + if ! echo "$amuse_h5_result" | grep -e "$flag" >/dev/null 2>&1 + then + amuse_h5_result="$amuse_h5_result:$flag" + fi + amuse_h5_in_isystem="no" + continue + fi + + if test "$flag" = "-isystem" + then + amuse_h5_in_isystem="yes" + elif test "${flag#-I}" != "$flag" + then + amuse_h5_path="${flag#-I}" + if ! echo "$amuse_h5_result" | grep -e "$amuse_h5_path" >/dev/null 2>&1 + then + amuse_h5_result="$amuse_h5_result:${flag#-I}" + fi + fi + done +]) + + +# AMUSE_LIB_HDF5_FIX_FORTRAN_USING() +# +# Args: +# name: description of the source of the paths for printing +# paths: colon-separated list of include paths to try +# +# Will try to get Fortran to work by adding the given paths to the module search +# directory. Will also try alternative directories (i.e. mod/shared/) based on the given +# paths. +# +AC_DEFUN([AMUSE_LIB_HDF5_FIX_FORTRAN_USING], [ + amuse_h5_save_IFS="$IFS" + IFS=: + for amuse_h5_path in $2 + do + # need to restore IFS immediately as it messes up the below + IFS="$amuse_h5_save_IFS" + if test -z "$amuse_h5_path" + then + continue + fi + + amuse_h5_FCFLAGS="$FCFLAGS -I$amuse_h5_path" + AMUSE_LIB_HDF5_VERIFY_FORTRAN([with $amuse_h5_path from $1]) + if test "$amuse_h5_detect_FC" = "yes" + then + amuse_h5_FCFLAGS="-I$amuse_h5_path" + break + fi + + # The new Fortran CMake-based build system uses the non-standard and + # not-searched-unless-explicitly-specified /mod/shared subdirectory by + # default + amuse_h5_FCFLAGS="$FCFLAGS -I$amuse_h5_path/../mod/shared" + AMUSE_LIB_HDF5_VERIFY_FORTRAN([with $amuse_h5_path from $1 and /mod/shared]) + if test "$amuse_h5_detect_FC" = "yes" + then + amuse_h5_FCFLAGS="-I$amuse_h5_path/../mod/shared" + break + fi + + if test "$amuse_h5_detect_FC" = "no" + then + amuse_h5_FCFLAGS="" + fi + done + IFS="$amuse_h5_save_IFS" +]) + + +# AMUSE_LIB_HDF5_DETECT_ENV() +# +# Checks that we can use (compile and link) various features without additional flags +# +# Sets amuse_h5_detect_C, amuse_h5_detect_HL_C, amuse_h5_detect_CXX, +# amuse_h5_detect_FC, and amuse_h5_detect_HL_FC to "yes" or "no" indicating whether +# the corresponding features are found to work. +# +# Sets amuse_h5_FCFLAGS in case additional Fortran flags are needed to work around +# broken installations. +# +AC_DEFUN([AMUSE_LIB_HDF5_DETECT_ENV], [ + amuse_h5_LDFLAGS="" + + AC_LANG_PUSH(C) + amuse_h5_CFLAGS="" + AMUSE_LIB_HDF5_VERIFY_FLAGS( + [C with no additional flags], [C], [C], + AC_LANG_PROGRAM([#include ], [H5open(); H5close();]), + [-lhdf5]) + AC_LANG_POP(C) + + if test $amuse_h5_detect_C = "yes" + then + AC_LANG_PUSH(C) + AMUSE_LIB_HDF5_VERIFY_FLAGS( + [C with the high-level API], [C], [HL_C], + AC_LANG_PROGRAM([#include ], [H5LTfind_dataset(0, \"test\")]), + [-lhdf5_hl]) + AC_LANG_POP(C) + + AC_LANG_PUSH(C++) + AMUSE_LIB_HDF5_VERIFY_FLAGS( + [C++], [CXX], [CXX], + AC_LANG_PROGRAM([#include ], [H5::H5Library::open();]), + [-lhdf5_cpp]) + AC_LANG_POP(C++) + + AMUSE_LIB_HDF5_VERIFY_FORTRAN([]) + + if test $amuse_h5_detect_FC = "no" + then + AMUSE_LIB_HDF5_INCLUDE_PATHS_FROM_FLAGS([$FFLAGS]) + AMUSE_LIB_HDF5_FIX_FORTRAN_USING([FFLAGS], [$amuse_h5_result]) + fi + + if test $amuse_h5_detect_FC = "no" + then + AMUSE_LIB_HDF5_INCLUDE_PATHS_FROM_FLAGS([$CFLAGS]) + AMUSE_LIB_HDF5_FIX_FORTRAN_USING([CFLAGS], [$amuse_h5_result]) + fi + + if test $amuse_h5_detect_FC = "no" + then + AMUSE_LIB_HDF5_FIX_FORTRAN_USING([CPATH], [$CPATH]) + fi + + if test $amuse_h5_detect_FC = "no" + then + AMUSE_LIB_HDF5_FIX_FORTRAN_USING([C_INCLUDE_PATH], [$C_INCLUDE_PATH]) + fi + fi +]) + + +# AMUSE_LIB_HDF5_IL_FLAGS() +# +# Extracts the -I and -L flags from the given input +# +# Sets amuse_h5_include_flags to a string containing only the -I flags, +# space-separated, and amuse_h5_link_flags to a string containing only the -L flags, +# space-separated. +# +AC_DEFUN([AMUSE_LIB_HDF5_IL_FLAGS], [ + amuse_h5_include_flags="" + amuse_h5_link_flags="" + + for amuse_h5_flag in $1 + do + if test "${amuse_h5_flag#-I}" != "$amuse_h5_flag" + then + if ! echo "$amuse_h5_include_flags" | grep -e "$amuse_h5_flag" >/dev/null 2>&1 + then + amuse_h5_include_flags="$amuse_h5_include_flags $amuse_h5_flag" + fi + elif test "${amuse_h5_flag#-L}" != "$amuse_h5_flag" + then + if ! echo "$amuse_h5_result" | grep -e "$amuse_h5_flag" >/dev/null 2>&1 + then + amuse_h5_link_flags="$amuse_h5_link_flags $amuse_h5_flag" + fi + fi + done +]) + + +# AMUSE_LIB_HDF5_FROM_WRAPPERS() +# +# Tries to use the h5cc etc. compiler wrappers +AC_DEFUN([AMUSE_LIB_HDF5_DETECT_FROM_WRAPPERS], [ + AC_PATH_PROG([H5CC], [h5cc]) + if test -n "$H5CC" + then + amuse_h5_h5cc_flags=$(HDF5_USE_SHLIB=yes $H5CC -show) + dnl work around bug in h5cc 1.14.6 where it only shows linking flags unless you + dnl add -c + amuse_h5_h5cc_extra_flags=$(HDF5_USE_SHLIB=yes $H5CC -show -c) + AMUSE_LIB_HDF5_IL_FLAGS([$amuse_h5_h5cc_flags $amuse_h5_h5cc_extra_flags]) + + AC_LANG_PUSH(C) + amuse_h5_CFLAGS="$amuse_h5_include_flags" + amuse_h5_LDFLAGS="$amuse_h5_link_flags" + AMUSE_LIB_HDF5_VERIFY_FLAGS( + [C with flags from h5cc], [C], [C], + AC_LANG_PROGRAM([#include ], [H5open(); H5close();]), + [-lhdf5]) + AMUSE_LIB_HDF5_VERIFY_FLAGS( + [C with flags from h5cc and the high-level API], [C], [HL_C], + AC_LANG_PROGRAM([#include ], [H5LTfind_dataset(0, \"test\")]), + [-lhdf5_hl]) + AC_LANG_POP(C) + fi + + AC_PATH_PROG([H5CXX], [h5c++]) + if test -n "$H5CXX" + then + amuse_h5_h5cxx_flags=$(HDF5_USE_SHLIB=yes $H5CXX -show) + dnl Work around a bug(?) in h5cc 1.14.6 where it only shows flags unless you + dnl add -c _and_ pass a C++ file that exists and has a nonzero length + dnl Note that conftest.* gets cleaned up automatically by autoconf in case of a + dnl crash. + echo "broken" >conftest.cpp + amuse_h5_h5cxx_extra_flags=$(HDF5_USE_SHLIB=yes $H5CXX -show -c conftest.cpp) + rm conftest.cpp + AMUSE_LIB_HDF5_IL_FLAGS([$amuse_h5_h5cxx_flags $amuse_h5_h5cxx_extra_flags]) + + AC_LANG_PUSH(C++) + amuse_h5_CXXFLAGS="$amuse_h5_include_flags" + amuse_h5_LDFLAGS="$amuse_h5_link_flags" + AMUSE_LIB_HDF5_VERIFY_FLAGS( + [C++ with flags from h5c++], [CXX], [CXX], + AC_LANG_PROGRAM([#include ], [H5::H5Library::open();]), + [-lhdf5_cpp]) + AC_LANG_POP(C++) + fi + + AC_PATH_PROG([H5FC], [h5fc]) + if test -n "$H5FC" + then + amuse_h5_h5fc_flags=$(HDF5_USE_SHLIB=yes h5fc -show) + dnl work around bug in h5cc 1.14.6 where it only shows linking flags unless you + dnl add -c + amuse_h5_h5fc_extra_flags=$(HDF5_USE_SHLIB=yes $H5CC -show -c) + AMUSE_LIB_HDF5_IL_FLAGS([$amuse_h5_h5fc_flags $amuse_h5_h5fc_extra_flags]) + + amuse_h5_FCFLAGS="$amuse_h5_include_flags" + amuse_h5_LDFLAGS="$amuse_h5_link_flags" + AMUSE_LIB_HDF5_VERIFY_FORTRAN([with flags from h5fc]) + + if test "$amuse_h5_detect_FC" = "no" + then + dnl The extra brackets in the regex get removed by m4 + amuse_h5_extra_flags=$(echo "$amuse_h5_include_flags" | sed -e 's^\([[[:graph:]]]*\)\( \|$\)^\1/../mod/shared ^g') + amuse_h5_FCFLAGS="$amuse_h5_include_flags $amuse_h5_extra_flags" + AMUSE_LIB_HDF5_VERIFY_FORTRAN([with flags from h5fc and mod/shared]) + fi + + if test "$amuse_h5_detect_FC" = "no" + then + amuse_h5_FCFLAGS="" + fi + fi +]) + + + +# AMUSE_LIB_HDF5() +# +# Detect HDF5 installation +# +# Sets HDF5_C_FOUND, HDF5_HL_C_FOUND, HDF5_CXX_FOUND, HDF5_FC_FOUND, HDF5_HL_FC_FOUND +# to "yes" or "no" depending on whether the corresponding features are available. +# +# Sets HDF5_TYPE, HDF5_CFLAGS, HDF5_CXXFLAGS, HDF5_FCFLAGS, and HDF5_LDFLAGS to any +# additional flags needed on top of the existing CFLAGS, CXXFLAGS, FCFLAGS and LDFLAGS +# to compile and link with HDF5. +# +# Limitations: +# +# - This only detects serial HDF5 installations, not parallel ones +# - Spaces in paths probably don't work +# +AC_DEFUN([AMUSE_LIB_HDF5], [ + amuse_h5_detect_C="no" + + dnl Detect using HDF5_ROOT, HDF5_DIR, CMAKE_PREFIX_PATH + AMUSE_LIB_HDF5_FIND_ROOT() + + dnl Check whether the environment is already configured correctly + if test "$amuse_h5_detect_C" = "no" + then + AMUSE_LIB_HDF5_DETECT_ENV() + fi + + dnl Try to use the h5cc and co compiler wrappers + if test "$amuse_h5_detect_C" = "no" + then + AMUSE_LIB_HDF5_DETECT_FROM_WRAPPERS() + fi + + if test "$amuse_h5_detect_C" = "yes" + then + AC_MSG_NOTICE([HDF5 installation detected]) + + HDF5_C_FOUND="$amuse_h5_detect_C" + HDF5_HL_C_FOUND="$amuse_h5_detect_HL_C" + HDF5_CXX_FOUND="$amuse_h5_detect_CXX" + HDF5_FC_FOUND="$amuse_h5_detect_FC" + HDF5_HL_FC_FOUND="$amuse_h5_detect_HL_FC" + + HDF5_TYPE="serial" + HDF5_CFLAGS="$amuse_h5_CFLAGS" + HDF5_CXXFLAGS="$amuse_h5_CXXFLAGS" + HDF5_FCFLAGS="$amuse_h5_FCFLAGS" + HDF5_LDFLAGS="$amuse_h5_LDFLAGS" + HDF5_HLFC_LIB="$amuse_h5_HL_FC_LIB" + else + AC_MSG_WARN([no HDF5 installation detected]) + fi + + AC_SUBST(HDF5_TYPE) + AC_SUBST(HDF5_CFLAGS) + AC_SUBST(HDF5_CXXFLAGS) + AC_SUBST(HDF5_FCFLAGS) + AC_SUBST(HDF5_LDFLAGS) + AC_SUBST(HDF5_HLFC_LIB) +]) + diff --git a/support/shared/m4/ax_lib_hdf5.m4 b/support/shared/m4/ax_lib_hdf5.m4 deleted file mode 100644 index 074c2a820a..0000000000 --- a/support/shared/m4/ax_lib_hdf5.m4 +++ /dev/null @@ -1,323 +0,0 @@ -# =========================================================================== -# https://www.gnu.org/software/autoconf-archive/ax_lib_hdf5.html -# =========================================================================== -# -# SYNOPSIS -# -# AX_LIB_HDF5([serial/parallel]) -# -# DESCRIPTION -# -# This macro provides tests of the availability of HDF5 library. -# -# The optional macro argument should be either 'serial' or 'parallel'. The -# former only looks for serial HDF5 installations via h5cc. The latter -# only looks for parallel HDF5 installations via h5pcc. If the optional -# argument is omitted, serial installations will be preferred over -# parallel ones. -# -# The macro adds a --with-hdf5 option accepting one of three values: -# -# no - do not check for the HDF5 library. -# yes - do check for HDF5 library in standard locations. -# path - complete path to the HDF5 helper script h5cc or h5pcc. -# -# If HDF5 is successfully found, this macro calls -# -# AC_SUBST(HDF5_VERSION) -# AC_SUBST(HDF5_CC) -# AC_SUBST(HDF5_CFLAGS) -# AC_SUBST(HDF5_CPPFLAGS) -# AC_SUBST(HDF5_LDFLAGS) -# AC_SUBST(HDF5_LIBS) -# AC_SUBST(HDF5_FC) -# AC_SUBST(HDF5_FFLAGS) -# AC_SUBST(HDF5_FLIBS) -# AC_SUBST(HDF5_TYPE) -# AC_DEFINE(HAVE_HDF5) -# -# and sets with_hdf5="yes". Additionally, the macro sets -# with_hdf5_fortran="yes" if a matching Fortran wrapper script is found. -# Note that Autoconf's Fortran support is not used to perform this check. -# H5CC and H5FC will contain the appropriate serial or parallel HDF5 -# wrapper script locations. -# -# If HDF5 is disabled or not found, this macros sets with_hdf5="no" and -# with_hdf5_fortran="no". -# -# Your configuration script can test $with_hdf to take any further -# actions. HDF5_{C,CPP,LD}FLAGS may be used when building with C or C++. -# HDF5_F{FLAGS,LIBS} should be used when building Fortran applications. -# -# To use the macro, one would code one of the following in "configure.ac" -# before AC_OUTPUT: -# -# 1) dnl Check for HDF5 support -# AX_LIB_HDF5() -# -# 2) dnl Check for serial HDF5 support -# AX_LIB_HDF5([serial]) -# -# 3) dnl Check for parallel HDF5 support -# AX_LIB_HDF5([parallel]) -# -# One could test $with_hdf5 for the outcome or display it as follows -# -# echo "HDF5 support: $with_hdf5" -# -# You could also for example, override the default CC in "configure.ac" to -# enforce compilation with the compiler that HDF5 uses: -# -# AX_LIB_HDF5([parallel]) -# if test "$with_hdf5" = "yes"; then -# CC="$HDF5_CC" -# else -# AC_MSG_ERROR([Unable to find HDF5, we need parallel HDF5.]) -# fi -# -# The HDF5_TYPE environment variable returns "parallel" or "serial", -# depending on which type of library is found. -# -# LICENSE -# -# Copyright (c) 2009 Timothy Brown -# Copyright (c) 2010 Rhys Ulerich -# -# Copying and distribution of this file, with or without modification, are -# permitted in any medium without royalty provided the copyright notice -# and this notice are preserved. This file is offered as-is, without any -# warranty. - -#serial 20 - -AC_DEFUN([AX_LIB_HDF5], [ - -AC_REQUIRE([AC_PROG_SED]) -AC_REQUIRE([AC_PROG_AWK]) -AC_REQUIRE([AC_PROG_GREP]) - -dnl Check first argument is one of the recognized values. -dnl Fail eagerly if is incorrect as this simplifies case statements below. -if test "m4_normalize(m4_default([$1],[]))" = "" ; then - : # Recognized value -elif test "m4_normalize(m4_default([$1],[]))" = "serial" ; then - : # Recognized value -elif test "m4_normalize(m4_default([$1],[]))" = "parallel"; then - : # Recognized value -else - AC_MSG_ERROR([ -Unrecognized value for AX[]_LIB_HDF5 within configure.ac. -If supplied, argument 1 must be either 'serial' or 'parallel'. -]) -fi - -dnl Add a default --with-hdf5 configuration option. -AC_ARG_WITH([hdf5], - AS_HELP_STRING( - [--with-hdf5=[yes/no/PATH]], - m4_case(m4_normalize([$1]), - [serial], [location of h5cc for serial HDF5 configuration], - [parallel], [location of h5pcc for parallel HDF5 configuration], - [location of h5cc or h5pcc for HDF5 configuration]) - ), - [if test "$withval" = "no"; then - with_hdf5="no" - elif test "$withval" = "yes"; then - with_hdf5="yes" - else - with_hdf5="yes" - H5CC="$withval" - fi], - [with_hdf5="yes"] -) - -dnl Set defaults to blank -HDF5_CC="" -HDF5_VERSION="" -HDF5_CFLAGS="" -HDF5_CPPFLAGS="" -HDF5_LDFLAGS="" -HDF5_LIBS="" -HDF5_FC="" -HDF5_FFLAGS="" -HDF5_FLIBS="" -HDF5_TYPE="" - -dnl Try and find hdf5 compiler tools and options. -if test "$with_hdf5" = "yes"; then - if test -z "$H5CC"; then - dnl Check to see if H5CC is in the path. - AC_PATH_PROGS( - [H5CC], - m4_case(m4_normalize([$1]), - [serial], [h5cc], - [parallel], [h5pcc], - [h5cc h5pcc]), - []) - else - AC_MSG_CHECKING([Using provided HDF5 C wrapper]) - AC_MSG_RESULT([$H5CC]) - fi - AC_MSG_CHECKING([for HDF5 type]) - AS_CASE([$H5CC], - [*h5pcc], [HDF5_TYPE=parallel], - [*h5cc], [HDF5_TYPE=serial], - [HDF5_TYPE=neither]) - AC_MSG_RESULT([$HDF5_TYPE]) - AC_MSG_CHECKING([for HDF5 libraries]) - if test ! -f "$H5CC" || test ! -x "$H5CC"; then - AC_MSG_RESULT([no]) - AC_MSG_WARN(m4_case(m4_normalize([$1]), - [serial], [ -Unable to locate serial HDF5 compilation helper script 'h5cc'. -Please specify --with-hdf5= as the full path to h5cc. -HDF5 support is being disabled (equivalent to --with-hdf5=no). -], [parallel],[ -Unable to locate parallel HDF5 compilation helper script 'h5pcc'. -Please specify --with-hdf5= as the full path to h5pcc. -HDF5 support is being disabled (equivalent to --with-hdf5=no). -], [ -Unable to locate HDF5 compilation helper scripts 'h5cc' or 'h5pcc'. -Please specify --with-hdf5= as the full path to h5cc or h5pcc. -HDF5 support is being disabled (equivalent to --with-hdf5=no). -])) - with_hdf5="no" - with_hdf5_fortran="no" - else - dnl Get the h5cc output - HDF5_SHOW=$(eval $H5CC -show) - - dnl Get the actual compiler used - HDF5_CC=$(eval $H5CC -show | head -n 1 | $AWK '{print $[]1}') - if test "$HDF5_CC" = "ccache"; then - HDF5_CC=$(eval $H5CC -show | head -n 1 | $AWK '{print $[]2}') - fi - - dnl h5cc provides both AM_ and non-AM_ options - dnl depending on how it was compiled either one of - dnl these are empty. Lets roll them both into one. - - dnl Look for "HDF5 Version: X.Y.Z" - HDF5_VERSION=$(eval $H5CC -showconfig | $GREP 'HDF5 Version:' \ - | $AWK '{print $[]3}') - - dnl A ideal situation would be where everything we needed was - dnl in the AM_* variables. However most systems are not like this - dnl and seem to have the values in the non-AM variables. - dnl - dnl We try the following to find the flags: - dnl (1) Look for "NAME:" tags - dnl (2) Look for "H5_NAME:" tags - dnl (3) Look for "AM_NAME:" tags - dnl - HDF5_tmp_flags=$(eval $H5CC -showconfig \ - | $GREP 'FLAGS\|Extra libraries:' \ - | $AWK -F: '{printf("%s "), $[]2}' ) - - dnl Find the installation directory and append include/ - HDF5_tmp_inst=$(eval $H5CC -showconfig \ - | $GREP 'Installation point:' \ - | $AWK '{print $[]NF}' ) - - dnl Add this to the CPPFLAGS - HDF5_CPPFLAGS="-I${HDF5_tmp_inst}/include" - - dnl Now sort the flags out based upon their prefixes - for arg in $HDF5_SHOW $HDF5_tmp_flags ; do - case "$arg" in - -I*) echo $HDF5_CPPFLAGS | $GREP -e "$arg" 2>&1 >/dev/null \ - || HDF5_CPPFLAGS="$HDF5_CPPFLAGS $arg" - ;; - -L*) echo $HDF5_LDFLAGS | $GREP -e "$arg" 2>&1 >/dev/null \ - || HDF5_LDFLAGS="$HDF5_LDFLAGS $arg" - ;; - -l*) echo $HDF5_LIBS | $GREP -e "$arg" 2>&1 >/dev/null \ - || HDF5_LIBS="$HDF5_LIBS $arg" - ;; - esac - done - - HDF5_LIBS="-lhdf5 $HDF5_LIBS" - AC_MSG_RESULT([yes (version $[HDF5_VERSION])]) - - dnl See if we can compile - AC_LANG_PUSH([C]) - ax_lib_hdf5_save_CC=$CC - ax_lib_hdf5_save_CPPFLAGS=$CPPFLAGS - ax_lib_hdf5_save_LIBS=$LIBS - ax_lib_hdf5_save_LDFLAGS=$LDFLAGS - CC=$HDF5_CC - CPPFLAGS=$HDF5_CPPFLAGS - LIBS=$HDF5_LIBS - LDFLAGS=$HDF5_LDFLAGS - AC_CHECK_HEADER([hdf5.h], [ac_cv_hadf5_h=yes], [ac_cv_hadf5_h=no]) - AC_CHECK_LIB([hdf5], [H5Fcreate], [ac_cv_libhdf5=yes], - [ac_cv_libhdf5=no]) - if test "$ac_cv_hadf5_h" = "no" && test "$ac_cv_libhdf5" = "no" ; then - AC_MSG_WARN([Unable to compile HDF5 test program]) - fi - dnl Look for HDF5's high level library - AC_HAVE_LIBRARY([hdf5_hl], [HDF5_LIBS="-lhdf5_hl $HDF5_LIBS"], [], []) - - CC=$ax_lib_hdf5_save_CC - CPPFLAGS=$ax_lib_hdf5_save_CPPFLAGS - LIBS=$ax_lib_hdf5_save_LIBS - LDFLAGS=$ax_lib_hdf5_save_LDFLAGS - AC_LANG_POP([C]) - - AC_MSG_CHECKING([for matching HDF5 Fortran wrapper]) - dnl Presume HDF5 Fortran wrapper is just a name variant from H5CC - H5FC=$(eval echo -n $H5CC | $SED -n 's/cc$/fc/p') - if test -x "$H5FC"; then - AC_MSG_RESULT([$H5FC]) - with_hdf5_fortran="yes" - AC_SUBST([H5FC]) - - dnl Again, pry any remaining -Idir/-Ldir from compiler wrapper - for arg in `$H5FC -show` - do - case "$arg" in #( - -I*) echo $HDF5_FFLAGS | $GREP -e "$arg" >/dev/null \ - || HDF5_FFLAGS="$HDF5_FFLAGS $arg" - ;;#( - -L*) echo $HDF5_FFLAGS | $GREP -e "$arg" >/dev/null \ - || HDF5_FFLAGS="$HDF5_FFLAGS $arg" - dnl HDF5 installs .mod files in with libraries, - dnl but some compilers need to find them with -I - echo $HDF5_FFLAGS | $GREP -e "-I${arg#-L}" >/dev/null \ - || HDF5_FFLAGS="$HDF5_FFLAGS -I${arg#-L}" - ;; - esac - done - - dnl Make Fortran link line by inserting Fortran libraries - for arg in $HDF5_LIBS - do - case "$arg" in #( - -lhdf5_hl) HDF5_FLIBS="$HDF5_FLIBS -lhdf5hl_fortran $arg" - ;; #( - -lhdf5) HDF5_FLIBS="$HDF5_FLIBS -lhdf5_fortran $arg" - ;; #( - *) HDF5_FLIBS="$HDF5_FLIBS $arg" - ;; - esac - done - else - AC_MSG_RESULT([no]) - with_hdf5_fortran="no" - fi - - AC_SUBST([HDF5_VERSION]) - AC_SUBST([HDF5_CC]) - AC_SUBST([HDF5_CFLAGS]) - AC_SUBST([HDF5_CPPFLAGS]) - AC_SUBST([HDF5_LDFLAGS]) - AC_SUBST([HDF5_LIBS]) - AC_SUBST([HDF5_FC]) - AC_SUBST([HDF5_FFLAGS]) - AC_SUBST([HDF5_FLIBS]) - AC_SUBST([HDF5_TYPE]) - AC_DEFINE([HAVE_HDF5], [1], [Defined if you have HDF5 support]) - fi -fi -])