summaryrefslogtreecommitdiff
path: root/lib/make/extras
diff options
context:
space:
mode:
authortradke <tradke@17b73243-c579-4c4c-a9d2-2d5706c11dac>2002-06-07 14:37:57 +0000
committertradke <tradke@17b73243-c579-4c4c-a9d2-2d5706c11dac>2002-06-07 14:37:57 +0000
commitd8f822aa9d2c38fd4c5843990d88b0c5acb01a09 (patch)
tree5a89c5aaf9bf5f6438ce872530fa5524d7e2576c /lib/make/extras
parent21315b44f93b27982fbcc9ce60194f03f1b87871 (diff)
Stop if HDF5 makefile variable is set to anything other than "yes|no" or left
blank. Also put in a check for the right version of HDF5 (32/64 bit) for Irix systems (it might be better to do that in a configure script). This closes PR Cactus/1084. git-svn-id: http://svn.cactuscode.org/flesh/trunk@2902 17b73243-c579-4c4c-a9d2-2d5706c11dac
Diffstat (limited to 'lib/make/extras')
-rwxr-xr-xlib/make/extras/HDF5/setup.sh31
1 files changed, 30 insertions, 1 deletions
diff --git a/lib/make/extras/HDF5/setup.sh b/lib/make/extras/HDF5/setup.sh
index 338fdbfc..96a90fe8 100755
--- a/lib/make/extras/HDF5/setup.sh
+++ b/lib/make/extras/HDF5/setup.sh
@@ -8,7 +8,9 @@
# @enddesc
# @@*/
-if [ -n "$HDF5" ] ; then
+choose_hdf5=`echo $HDF5 | tr '[:upper:]' '[:lower:]'`
+
+if test "X$choose_hdf5" = "Xyes" ; then
echo "Configuring with HDF5. Blocks with #ifdef HDF5 will be activated"
@@ -52,6 +54,27 @@ HDF5_LIB_DIRS="$HDF5_DIR/lib"
HDF5_INC_DIRS="$HDF5_DIR/include"
+# check that we have the right version of HDF5 under 32/64 bit IRIX
+# This should better be checked by some autoconf script.
+if test -n "$IRIX_BITS"; then
+ if test -r "$HDF5_LIB_DIRS/libhdf5.a"; then
+ hdf5_lib="$HDF5_LIB_DIRS/libhdf5.a"
+ elif test -r "$HDF5_LIB_DIRS/libhdf5.so"; then
+ hdf5_lib="$HDF5_LIB_DIRS/libhdf5.so"
+ else
+ hdf5_lib=
+ fi
+
+ if test -n $hdf5_lib; then
+ file $hdf5_lib | grep -qe $IRIX_BITS 2> /dev/null
+ if test $? -ne 0; then
+ echo "The HDF5 library found in \"$HDF5_LIB_DIRS\" was not compiled as $IRIX_BITS bits !"
+ echo "Please reconfigure Cactus with the correct setting for HDF5_DIR !"
+ exit 1
+ fi
+ fi
+fi
+
# Check whether we have to link with libz.a
# this is for 1.3.x versions of HDF5
@@ -114,4 +137,10 @@ CCTK_WriteLine make.extra.defn 'LIBS += $(HDF5_LIBS)'
CCTK_WriteLine make.extra.defn 'LIBDIRS += $(HDF5_LIB_DIRS)'
CCTK_WriteLine make.extra.defn 'SYS_INC_DIRS += $(HDF5_INC_DIRS)'
+elif test "X$choose_hdf5" != "Xno" -a "X$choose_hdf5" != "X"; then
+
+ echo "Don't understand the setting \"HDF5=$HDF5\" !"
+ echo 'Please set it to either "yes" or "no", or leave it blank (same as "no") !'
+ exit 1
+
fi