netcdf-c/cf

204 lines
3.8 KiB
Plaintext
Raw Normal View History

#!/bin/bash
#X="-x"
2012-05-05 01:32:14 +08:00
#NB=1
2014-12-01 11:30:23 +08:00
DB=1
if test $# != 0 ; then
cmds=$@
fi
HDF5=1
2013-01-31 05:33:31 +08:00
DAP=1
#HDF4=1
#PNETCDF=1
#PAR=1
if test "x$PNETCDF" = x1 ; then
PAR=1
fi
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
CFLAGS=""
#CFLAGS="-Wall -Wno-unused-variable -Wno-unused-parameter -Wconversion ${CFLAGS}"
CFLAGS="-Wall ${CFLAGS}"
2014-03-11 06:40:52 +08:00
#CFLAGS="-Wconversion"
stddir="/usr/local"
PREFIX=/usr/local
2014-06-27 06:40:08 +08:00
if test "x${cmds}" = x ; then
cmds=""
else
for f in $cmds ; do
if test "x$f" = "xdistcheck" ; then
PREFIX=/tmp/$HOST
fi
done
fi
2013-03-26 00:29:19 +08:00
# HDF4=>HDF5
if test "x$HDF4" = x1 ; then
HDF5=1
fi
# Test pgi compiler
if test "x$PGI" = x1 ; then
PATH="/opt/pgi/linux86/11.1/bin:$PATH"
CC=pgcc
else
CC=gcc
fi
2012-02-16 03:15:03 +08:00
MALLOC_CHECK=""
CPPFLAGS=""
LDFLAGS=""
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
2013-03-26 00:29:19 +08:00
CPPFLAGS="-I${stddir}/include $CPPFLAGS"
LDFLAGS="-L${stddir}/lib -lhdf5_hl -lhdf5 -lz $LDFLAGS"
LD_LIBRARY_PATH="${stddir}/lib:$LD_LIBRARY_PATH"
fi
if test "x$HDF4" = "x1" ; then
LDFLAGS="$LDFLAGS -ljpeg"
fi
2013-03-26 00:29:19 +08:00
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
2013-01-18 10:25:12 +08:00
CXXFLAGS="$CPPFLAGS $CXXFLAGS"
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-utilities"
#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"
#FLAGS="$FLAGS --enable-extra-tests"
#FLAGS="$FLAGS --enable-large-file-tests"
#FLAGS="$FLAGS --disable-testsets"
#FLAGS="$FLAGS --disable-dap-remote-tests"
#FLAGS="$FLAGS --enable-dap-auth-tests"
#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"
2014-04-11 09:48:53 +08:00
FLAGS="$FLAGS --enable-jna"
if test "x${DB}" = x1 ; then
FLAGS="$FLAGS --disable-shared"
else
FLAGS="$FLAGS --enable-shared"
fi
if test "x${PAR}" != x ; then
FLAGS="$FLAGS --enable-parallel"
fi
if test "x$HDF5" = "x" ; then
FLAGS="$FLAGS --disable-netcdf-4"
fi
2013-03-26 00:29:19 +08:00
if test "x$HDF4" = x1 ; then
FLAGS="$FLAGS --enable-hdf4 --enable-hdf4-file-tests"
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
2013-01-18 10:25:12 +08:00
if test "x$PNETCDF" = x1 ; then
if test -f /machine/local_mpich2 ; then
MPI1=/machine/local_mpich2
MPI2=/machine/local_par7
MPI3=/machine/local_par
else
MPI1=/usr/local
MPI2=${MPI1}
MPI3=${MPI1}
fi
PATH=${PATH}:${MPI1}/bin
CC="${MPI1}/bin/mpicc"
CPPFLAGS="-I${MPI2}/include -I${MPI1}/include -I${MPI3}/include"
LDFLAGS="-L${MPI2}/lib -L${MPI1}/lib -L${MPI3}/lib"
2013-01-18 10:25:12 +08:00
LDLIBS="-lmpich -lmpl"
FLAGS="$FLAGS --enable-pnetcdf"
FLAGS="$FLAGS --enable-parallel-tests"
fi
export PATH
export CC
export CPPFLAGS
export CFLAGS
export LDFLAGS
export LD_LIBRARY_PATH
export MALLOC_CHECK
export CXXFLAGS
DISTCHECK_CONFIGURE_FLAGS="$FLAGS"
export DISTCHECK_CONFIGURE_FLAGS
2014-06-27 06:40:08 +08:00
if test -z "$NB" ; then
${MAKE} maintainer-clean >/dev/null 2>&1
if autoreconf -i --force ; then ok=1; else exit ; fi
fi
if test -f Makefile ; then ${MAKE} distclean >/dev/null 2>&1 ; fi
sh $X ./configure ${FLAGS}
for c in $cmds; do
${MAKE} ${FORCE} $c
done
exit 0