First HDF5 support -- changes pending

git-svn-id: http://qeforge.qe-forge.org/svn/q-e/trunk/espresso@12850 c92efa57-630b-4861-b058-cf58834340f0
This commit is contained in:
spigafi 2016-08-26 14:34:01 +00:00
parent 382c8f2547
commit 6280936868
4 changed files with 89 additions and 3 deletions

View File

@ -25,7 +25,9 @@ X_AC_QE_ARCH()
# Add all needed -D options to try_dflags
try_dflags=""
try_iflags="-I../include"
# "-I../include" is required by IOTK ...
try_iflags="-I\$(TOPDIR)/include -I../include/"
# Checking archiver...
X_AC_QE_AR()
@ -90,7 +92,7 @@ X_AC_QE_SCALAPACK()
X_AC_QE_ELPA()
# Setting HDF5...
#X_AC_QE_HDF5()
X_AC_QE_HDF5()
# Checking SIGNAL...
X_AC_QE_SIGNAL()

View File

@ -10,6 +10,7 @@ The following libraries have been found:
@scalapack_line@
@fft_line@
@mpi_line@
@hdf5_line@
@mass_line@
Please check if this is what you expect.

View File

@ -0,0 +1,80 @@
# Copyright (C) 2001-2016 Quantum ESPRESSO Foundation
AC_DEFUN([X_AC_QE_HDF5], [
AC_MSG_CHECKING([hdf5])
AC_ARG_WITH(hdf5,
[AS_HELP_STRING([--with-hdf5],
[(yes|no|<path>) Use HDF5. Self-compile or a <path> can be specified (default: no)])],
[if test "$withval" = "yes" ; then
with_hdf5=1
elif test "$withval" = "no" ; then
with_hdf5=0
else
with_hdf5=2
with_hdf5_path="$withval"
fi],
[with_hdf5=0])
hdf5_libs=""
hdf5_inc=""
have_hdf5=0
hdf5_libs_switch="disabled"
if test "$with_hdf5" -eq 2 ; then
hdf5_libs="-L$with_hdf5_path/lib -lhdf5_fortran -lhdf5"
try_iflags="$try_iflags -I$with_hdf5_path/include"
try_dflags="$try_dflags -D__HDF5"
fi
if test "$with_hdf5" -eq 1 ; then
try_libdirs="/usr/lib64"
try_libdirs="$libdirs $try_libdirs $ld_library_path"
have_hdf5=0
AC_LANG_POP(Fortran 77)
AC_LANG_PUSH(C)
for dir in none $try_libdirs
do
# unset ac_cv_search_H5Fcreate ac_cv_search_hdfh
if test "$dir" = "none"
then
try_loption=
else
echo $ECHO_N "in $dir: " $ECHO_C
try_loption="-L$dir"
fi
FFLAGS="$test_fflags"
LDFLAGS="$test_ldflags $try_loption"
LIBS="-lhdf5"
# Detect the location Fortran module "USE HDF5" is the complex part
# AC_CHECK_HEADER(...)
AC_SEARCH_LIBS(H5Fcreate, hdf5_fortran,
[hdf5_libs="$try_loption -lhdf5_fortran -lhdf5" have_hdf5=1])
if test "$ac_cv_search_H5Fcreate" != "no"
then break ; fi
done
AC_LANG_POP(C)
AC_LANG_PUSH(Fortran 77)
if test "$have_hdf5" -eq 1 ; then
try_iflags="$try_iflags -I$with_hdf5_path/include"
try_dflags="$try_dflags -D__HDF5"
fi
fi
hdf5_line="HDF5_LIBS=$hdf5_libs"
AC_SUBST(hdf5_libs)
AC_SUBST(hdf5_line)
]
)

View File

@ -128,6 +128,9 @@ SCALAPACK_LIBS = @scalapack_libs@
FFT_LIBS = @fft_libs@
# HDF5 -- experimental
HFD5_LIB = @hdf5_libs@
# For parallel execution, the correct path to MPI libraries must
# be specified in MPI_LIBS (except for IBM if you use mpxlf)
@ -152,7 +155,7 @@ RANLIB = @ranlib@
FLIB_TARGETS = all
LIBOBJS = $(TOPDIR)/clib/clib.a $(TOPDIR)/iotk/src/libiotk.a
LIBS = $(SCALAPACK_LIBS) $(LAPACK_LIBS) $(FFT_LIBS) $(BLAS_LIBS) $(MPI_LIBS) $(MASS_LIBS) $(LD_LIBS)
LIBS = $(SCALAPACK_LIBS) $(LAPACK_LIBS) $(FFT_LIBS) $(BLAS_LIBS) $(MPI_LIBS) $(MASS_LIBS) ${HFD5_LIB} $(LD_LIBS)
# wget or curl - useful to download from network
WGET = @wget@