netcdf-c/cf

182 lines
3.7 KiB
Plaintext
Raw Normal View History

#!/bin/bash
#X="-x"
2012-05-05 01:32:14 +08:00
#NB=1
#STD=1
if test $# != 0 ; then
cmds=$@
fi
HDF5=1
#DAP=1
2011-09-21 02:30:13 +08:00
#CDMR=1
2011-09-02 06:32:28 +08:00
#RPC=1
2012-03-08 07:38:51 +08:00
#PGI=1
2012-05-05 01:32:14 +08:00
#M32=1
#M64=1
if test "x$cmds" = x ; then
cmds=""
2012-01-27 11:17:03 +08:00
#cmds="all"
#cmds="all check"
#cmds="all dist"
2012-04-12 10:06:28 +08:00
#cmds="all distcheck"
2012-03-08 07:38:51 +08:00
#cmds="$cmds install"
fi
# Test pgi compiler
if test "x$PGI" = x1 ; then
PATH="/opt/pgi/linux86/11.1/bin:$PATH"
CC=pgcc
else
CC=gcc
fi
2011-12-13 12:16:52 +08:00
# Default cases
if test "x$STD" != x ; then
stddir="/share/ed/local/${HOST}"
PREFIX="/share/ed/local/${HOST}"
else
stddir="/tmp/local/${HOST}"
PREFIX="/tmp/local/${HOST}"
fi
2012-02-16 03:15:03 +08:00
MALLOC_CHECK=""
CPPFLAGS=""
LDFLAGS=""
if test "x$PGI" = x1 ; then
CFLAGS="-Msignextend -V -m64 $CFLAGS"
CPPFLAGS="$CPPFLAGS -DNDEBUG -DpgiFortran"
LD_LIBRARY_PATH="/usr/local/pgi/linux86-64/11.1/lib:$LD_LIBRARY_PATH"
PREFIX=/tmp/install/pgi
fi
if test x$M32 = x1 ; then
PREFIX="/tmp/install32/${HOST}"
stddir="/share/ed/local/${HOST}_32"
CFLAGS="-m32 $CFLAGS"
elif test x$M64 = x1 ; then
PREFIX="/tmp/install64/${HOST}"
stddir="/share/ed/local/${HOST}_64"
CFLAGS="-m64 $CFLAGS"
fi
if test "x$HOST" = xyakov ; then
stddir="/opt/local"
fi
CFLAGS="-g -O0 $CFLAGS"
case "$HOST" in
mort)
CFLAGS="-std=c99 $CFLAGS"
;;
yakov)
CFLAGS="-std=c99 $CFLAGS"
;;
spock)
if test "x$PGI" = x ; then
CFLAGS="-Wdeclaration-after-statement -Wall $CFLAGS"
fi
;;
spike)
CFLAGS="-Wall $CFLAGS"
;;
*)
;;
esac
MAKE=make
IGNORE="test 0 = 1"
if test "x$HDF5" = "x1" ; then
CPPFLAGS="-I${stddir}/include -I${stddir}/include $CPPFLAGS"
LDFLAGS="-L${stddir}/lib -lhdf5_hl -lhdf5 -L${stddir}/lib -lz $LDFLAGS"
LD_LIBRARY_PATH="${stddir}/lib:$LD_LIBRARY_PATH"
fi
2011-09-02 06:32:28 +08:00
if test "x$DAP" = "x1" -o "x$CDMR" = "x1" -o "x$RPC" = "x1" ; then
if curl-config --version >/dev/null ; then
TMP=`curl-config --cflags`
CPPFLAGS="$TMP $CPPFLAGS"
TMP=`curl-config --libs`
LDFLAGS="$TMP $LDFLAGS"
TMP=`curl-config --prefix`
LD_LIBRARY_PATH="$TMP/lib:$LD_LIBRARY_PATH"
else
echo "Cannot find curl-config"
exit 1
fi
fi
export CC
export CPPFLAGS
export CFLAGS
export LDFLAGS
export LD_LIBRARY_PATH
2012-02-16 03:15:03 +08:00
export MALLOC_CHECK
CXXFLAGS="$CPPFLAGS $CXXFLAGS" ; export CXXFLAGS
if test -z "$NB" ; then
${MAKE} maintainer-clean >/dev/null 2>&1
if autoreconf -i --force ; then ok=1; else exit ; fi
fi
FLAGS="--prefix ${PREFIX}"
2011-09-02 06:32:28 +08:00
#FLAGS="$FLAGS --disable-f77 --disable-f90"
#FLAGS="$FLAGS --disable-cxx"
FLAGS="$FLAGS --disable-examples"
FLAGS="$FLAGS --disable-pnetcdf"
#FLAGS="$FLAGS --disable-utilities"
#FLAGS="$FLAGS --enable-parallel-tests"
#FLAGS="$FLAGS --enable-cxx-4"
#FLAGS="$FLAGS --enable-dap-long-tests"
#FLAGS="$FLAGS --enable-ffio"
2012-04-02 04:15:06 +08:00
#FLAGS="$FLAGS --enable-benchmarks"
2012-05-06 06:31:24 +08:00
FLAGS="$FLAGS --enable-extra-tests"
FLAGS="$FLAGS --enable-logging"
#FLAGS="$FLAGS --enable-large-file-tests"
#FLAGS="$FLAGS --disable-testsets"
#FLAGS="$FLAGS --disable-dap-remote-tests"
2012-08-02 01:18:58 +08:00
#FLAGS="$FLAGS --enable-doxygen"
FLAGS="$FLAGS --enable-logging"
#FLAGS="$FLAGS --disable-diskless"
2012-06-24 03:25:49 +08:00
#FLAGS="$FLAGS --enable-mmap"
#FLAGS="$FLAGS --with-udunits"
#FLAGS="$FLAGS --with-libcf"
#valgrind => not shared
2012-08-02 01:18:58 +08:00
#FLAGS="$FLAGS --enable-valgrind-tests"
# hdf4 requires adding to paths
#FLAGS="$FLAGS --enable-hdf4 --enable-hdf4-file-tests"
#CPPFLAGS="$CPPFLAGS -I/machine/local/include"
#LDFLAGS="$LDFLAGS -L/machine/local/lib -L/usr/local/lib"
FLAGS="$FLAGS --disable-shared"
#FLAGS="$FLAGS --enable-shared"
if test "x$HDF5" = "x" ; then
FLAGS="$FLAGS --disable-netcdf-4"
fi
if test "x$DAP" = "x" ; then
FLAGS="$FLAGS --disable-dap"
fi
if test "x$CDMR" = "x1" ; then
FLAGS="$FLAGS --enable-cdmremote"
fi
2011-09-02 06:32:28 +08:00
if test "x$RPC" = "x1" ; then
FLAGS="$FLAGS --enable-rpc"
fi
DISTCHECK_CONFIGURE_FLAGS="$FLAGS"
export DISTCHECK_CONFIGURE_FLAGS
if test -f Makefile ; then ${MAKE} distclean >/dev/null 2>&1 ; fi
sh $X ./configure ${FLAGS}
for c in $cmds; do
${MAKE} $c
done
exit 0