Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
SWIFTsim
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
SWIFT
SWIFTsim
Commits
3d6760d4
Commit
3d6760d4
authored
5 years ago
by
Matthieu Schaller
Committed by
Peter W. Draper
5 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Updates to hdf5 automake macro
parent
03bdc91f
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
m4/ax_lib_hdf5.m4
+29
-13
29 additions, 13 deletions
m4/ax_lib_hdf5.m4
with
29 additions
and
13 deletions
m4/ax_lib_hdf5.m4
+
29
−
13
View file @
3d6760d4
# ===========================================================================
# ===========================================================================
#
http://www.gnu.org/software/autoconf-archive/ax_lib_hdf5.html
# http
s
://www.gnu.org/software/autoconf-archive/ax_lib_hdf5.html
# ===========================================================================
# ===========================================================================
#
#
# SYNOPSIS
# SYNOPSIS
...
@@ -38,11 +38,12 @@
...
@@ -38,11 +38,12 @@
# AC_SUBST(HDF5_FC)
# AC_SUBST(HDF5_FC)
# AC_SUBST(HDF5_FFLAGS)
# AC_SUBST(HDF5_FFLAGS)
# AC_SUBST(HDF5_FLIBS)
# AC_SUBST(HDF5_FLIBS)
# AC_SUBST(HDF5_TYPE)
# AC_DEFINE(HAVE_HDF5)
# AC_DEFINE(HAVE_HDF5)
#
#
# and sets with_hdf5="yes". Additionally, the macro sets
# and sets with_hdf5="yes". Additionally, the macro sets
# with_hdf5_fortran="yes" if a matching Fortran wrapper script is found.
# with_hdf5_fortran="yes" if a matching Fortran wrapper script is found.
# Note that Autconf's Fortran support is not used to perform this check.
# Note that Aut
o
conf's Fortran support is not used to perform this check.
# H5CC and H5FC will contain the appropriate serial or parallel HDF5
# H5CC and H5FC will contain the appropriate serial or parallel HDF5
# wrapper script locations.
# wrapper script locations.
#
#
...
@@ -79,6 +80,9 @@
...
@@ -79,6 +80,9 @@
# AC_MSG_ERROR([Unable to find HDF5, we need parallel HDF5.])
# AC_MSG_ERROR([Unable to find HDF5, we need parallel HDF5.])
# fi
# fi
#
#
# The HDF5_TYPE environment variable returns "parallel" or "serial",
# depending on which type of library is found.
#
# LICENSE
# LICENSE
#
#
# Copyright (c) 2009 Timothy Brown <tbrown@freeshell.org>
# Copyright (c) 2009 Timothy Brown <tbrown@freeshell.org>
...
@@ -89,7 +93,7 @@
...
@@ -89,7 +93,7 @@
# and this notice are preserved. This file is offered as-is, without any
# and this notice are preserved. This file is offered as-is, without any
# warranty.
# warranty.
#serial 1
1
#serial 1
9
AC_DEFUN([AX_LIB_HDF5], [
AC_DEFUN([AX_LIB_HDF5], [
...
@@ -142,6 +146,7 @@ HDF5_LIBS=""
...
@@ -142,6 +146,7 @@ HDF5_LIBS=""
HDF5_FC=""
HDF5_FC=""
HDF5_FFLAGS=""
HDF5_FFLAGS=""
HDF5_FLIBS=""
HDF5_FLIBS=""
HDF5_TYPE=""
dnl Try and find hdf5 compiler tools and options.
dnl Try and find hdf5 compiler tools and options.
if test "$with_hdf5" = "yes"; then
if test "$with_hdf5" = "yes"; then
...
@@ -158,6 +163,13 @@ if test "$with_hdf5" = "yes"; then
...
@@ -158,6 +163,13 @@ if test "$with_hdf5" = "yes"; then
AC_MSG_CHECKING([Using provided HDF5 C wrapper])
AC_MSG_CHECKING([Using provided HDF5 C wrapper])
AC_MSG_RESULT([$H5CC])
AC_MSG_RESULT([$H5CC])
fi
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
if test ! -f "$H5CC" || test ! -x "$H5CC"; then
dnl Check if we already have HDF5 for C.
dnl Check if we already have HDF5 for C.
...
@@ -211,9 +223,9 @@ HDF5 support is being disabled.
...
@@ -211,9 +223,9 @@ HDF5 support is being disabled.
HDF5_SHOW=$(eval $H5CC -show)
HDF5_SHOW=$(eval $H5CC -show)
dnl Get the actual compiler used
dnl Get the actual compiler used
HDF5_CC=$(eval $H5CC -show | $AWK '{print $[]1}')
HDF5_CC=$(eval $H5CC -show |
head -n 1 |
$AWK '{print $[]1}')
if test "$HDF5_CC" = "ccache"; then
if test "$HDF5_CC" = "ccache"; then
HDF5_CC=$(eval $H5CC -show | $AWK '{print $[]2}')
HDF5_CC=$(eval $H5CC -show |
head -n 1 |
$AWK '{print $[]2}')
fi
fi
dnl h5cc provides both AM_ and non-AM_ options
dnl h5cc provides both AM_ and non-AM_ options
...
@@ -249,21 +261,22 @@ HDF5 support is being disabled.
...
@@ -249,21 +261,22 @@ HDF5 support is being disabled.
for arg in $HDF5_SHOW $HDF5_tmp_flags ; do
for arg in $HDF5_SHOW $HDF5_tmp_flags ; do
case "$arg" in
case "$arg" in
-I*) echo $HDF5_CPPFLAGS | $GREP -e "$arg" 2>&1 >/dev/null \
-I*) echo $HDF5_CPPFLAGS | $GREP -e "$arg" 2>&1 >/dev/null \
|| HDF5_CPPFLAGS="
$arg
$HDF5_CPPFLAGS"
|| HDF5_CPPFLAGS="$HDF5_CPPFLAGS
$arg
"
;;
;;
-L*) echo $HDF5_LDFLAGS | $GREP -e "$arg" 2>&1 >/dev/null \
-L*) echo $HDF5_LDFLAGS | $GREP -e "$arg" 2>&1 >/dev/null \
|| HDF5_LDFLAGS="
$arg
$HDF5_LDFLAGS"
|| HDF5_LDFLAGS="$HDF5_LDFLAGS
$arg
"
;;
;;
-l*) echo $HDF5_LIBS | $GREP -e "$arg" 2>&1 >/dev/null \
-l*) echo $HDF5_LIBS | $GREP -e "$arg" 2>&1 >/dev/null \
|| HDF5_LIBS="
$arg
$HDF5_LIBS"
|| HDF5_LIBS="$HDF5_LIBS
$arg
"
;;
;;
esac
esac
done
done
HDF5_LIBS="$HDF5_LIBS
-lhdf5
"
HDF5_LIBS="
-lhdf5
$HDF5_LIBS"
AC_MSG_RESULT([yes (version $[HDF5_VERSION])])
AC_MSG_RESULT([yes (version $[HDF5_VERSION])])
dnl See if we can compile
dnl See if we can compile
AC_LANG_PUSH([C])
ax_lib_hdf5_save_CC=$CC
ax_lib_hdf5_save_CC=$CC
ax_lib_hdf5_save_CPPFLAGS=$CPPFLAGS
ax_lib_hdf5_save_CPPFLAGS=$CPPFLAGS
ax_lib_hdf5_save_LIBS=$LIBS
ax_lib_hdf5_save_LIBS=$LIBS
...
@@ -279,12 +292,13 @@ HDF5 support is being disabled.
...
@@ -279,12 +292,13 @@ HDF5 support is being disabled.
AC_MSG_WARN([Unable to compile HDF5 test program])
AC_MSG_WARN([Unable to compile HDF5 test program])
fi
fi
dnl Look for HDF5's high level library
dnl Look for HDF5's high level library
AC_HAVE_LIBRARY([hdf5_hl], [HDF5_LIBS="$HDF5_LIBS
-lhdf5_hl
"], [], [])
AC_HAVE_LIBRARY([hdf5_hl], [HDF5_LIBS="
-lhdf5_hl
$HDF5_LIBS"], [], [])
CC=$ax_lib_hdf5_save_CC
CC=$ax_lib_hdf5_save_CC
CPPFLAGS=$ax_lib_hdf5_save_CPPFLAGS
CPPFLAGS=$ax_lib_hdf5_save_CPPFLAGS
LIBS=$ax_lib_hdf5_save_LIBS
LIBS=$ax_lib_hdf5_save_LIBS
LDFLAGS=$ax_lib_hdf5_save_LDFLAGS
LDFLAGS=$ax_lib_hdf5_save_LDFLAGS
AC_LANG_POP([C])
AC_MSG_CHECKING([for matching HDF5 Fortran wrapper])
AC_MSG_CHECKING([for matching HDF5 Fortran wrapper])
dnl Presume HDF5 Fortran wrapper is just a name variant from H5CC
dnl Presume HDF5 Fortran wrapper is just a name variant from H5CC
...
@@ -299,14 +313,14 @@ HDF5 support is being disabled.
...
@@ -299,14 +313,14 @@ HDF5 support is being disabled.
do
do
case "$arg" in #(
case "$arg" in #(
-I*) echo $HDF5_FFLAGS | $GREP -e "$arg" >/dev/null \
-I*) echo $HDF5_FFLAGS | $GREP -e "$arg" >/dev/null \
|| HDF5_FFLAGS="
$arg
$HDF5_FFLAGS"
|| HDF5_FFLAGS="$HDF5_FFLAGS
$arg
"
;;#(
;;#(
-L*) echo $HDF5_FFLAGS | $GREP -e "$arg" >/dev/null \
-L*) echo $HDF5_FFLAGS | $GREP -e "$arg" >/dev/null \
|| HDF5_FFLAGS="
$arg
$HDF5_FFLAGS"
|| HDF5_FFLAGS="$HDF5_FFLAGS
$arg
"
dnl HDF5 installs .mod files in with libraries,
dnl HDF5 installs .mod files in with libraries,
dnl but some compilers need to find them with -I
dnl but some compilers need to find them with -I
echo $HDF5_FFLAGS | $GREP -e "-I${arg#-L}" >/dev/null \
echo $HDF5_FFLAGS | $GREP -e "-I${arg#-L}" >/dev/null \
|| HDF5_FFLAGS="
-I${arg#-L}
$HDF5_FFLAGS"
|| HDF5_FFLAGS="$HDF5_FFLAGS
-I${arg#-L}
"
;;
;;
esac
esac
done
done
...
@@ -337,7 +351,9 @@ HDF5 support is being disabled.
...
@@ -337,7 +351,9 @@ HDF5 support is being disabled.
AC_SUBST([HDF5_FC])
AC_SUBST([HDF5_FC])
AC_SUBST([HDF5_FFLAGS])
AC_SUBST([HDF5_FFLAGS])
AC_SUBST([HDF5_FLIBS])
AC_SUBST([HDF5_FLIBS])
AC_SUBST([HDF5_TYPE])
AC_DEFINE([HAVE_HDF5], [1], [Defined if you have HDF5 support])
AC_DEFINE([HAVE_HDF5], [1], [Defined if you have HDF5 support])
fi
fi
fi
fi
])
])
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment