2011-05-13 01:51:32 +08:00
|
|
|
#!/bin/bash
|
|
|
|
#X="-x"
|
2012-05-05 01:32:14 +08:00
|
|
|
#NB=1
|
2011-05-13 01:51:32 +08:00
|
|
|
|
2012-03-15 07:26:48 +08:00
|
|
|
if test $# != 0 ; then
|
|
|
|
cmds=$@
|
|
|
|
fi
|
|
|
|
|
2013-09-21 10:31:21 +08:00
|
|
|
HDF5=1
|
2013-01-31 05:33:31 +08:00
|
|
|
DAP=1
|
2014-01-21 07:11:45 +08:00
|
|
|
#HDF4=1
|
2013-03-26 02:01:32 +08:00
|
|
|
#PNETCDF=1
|
2013-12-23 03:53:20 +08:00
|
|
|
|
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
|
2011-05-13 01:51:32 +08:00
|
|
|
#M64=1
|
|
|
|
|
2014-03-08 03:04:38 +08:00
|
|
|
FORCE="-i"
|
|
|
|
|
2013-07-11 05:19:05 +08:00
|
|
|
#INSTALL=1
|
2013-12-23 03:53:20 +08:00
|
|
|
PREFIX=/usr/local
|
2013-02-27 05:56:13 +08:00
|
|
|
|
2012-03-15 07:26:48 +08:00
|
|
|
if test "x$cmds" = x ; then
|
2011-10-05 01:50:42 +08:00
|
|
|
cmds=""
|
2012-01-27 11:17:03 +08:00
|
|
|
#cmds="all"
|
2012-03-15 07:26:48 +08:00
|
|
|
#cmds="all check"
|
2011-05-13 01:51:32 +08:00
|
|
|
#cmds="all dist"
|
2013-03-01 01:51:09 +08:00
|
|
|
#cmds="all distcheck"
|
2012-03-08 07:38:51 +08:00
|
|
|
#cmds="$cmds install"
|
2012-03-15 07:26:48 +08:00
|
|
|
fi
|
2012-03-03 04:27:44 +08:00
|
|
|
|
2013-03-26 00:29:19 +08:00
|
|
|
# HDF4=>HDF5
|
|
|
|
if test "x$HDF4" = x1 ; then
|
|
|
|
HDF5=1
|
|
|
|
fi
|
|
|
|
|
2012-03-03 04:27:44 +08:00
|
|
|
# Test pgi compiler
|
|
|
|
if test "x$PGI" = x1 ; then
|
|
|
|
PATH="/opt/pgi/linux86/11.1/bin:$PATH"
|
|
|
|
CC=pgcc
|
|
|
|
else
|
|
|
|
CC=gcc
|
|
|
|
fi
|
2011-05-13 01:51:32 +08:00
|
|
|
|
2011-12-13 12:16:52 +08:00
|
|
|
# Default cases
|
2013-06-27 02:55:30 +08:00
|
|
|
if test -f "/share/ed/local/${HOST}" ; then
|
2012-12-14 02:22:11 +08:00
|
|
|
stddir="/share/ed/local/${HOST}"
|
2012-06-29 01:12:02 +08:00
|
|
|
else
|
2013-02-27 05:56:13 +08:00
|
|
|
stddir="/usr/local"
|
|
|
|
fi
|
2013-11-18 05:26:14 +08:00
|
|
|
#stddir="/machine/local_szlib"
|
|
|
|
stddir="/usr/local"
|
2013-02-27 05:56:13 +08:00
|
|
|
|
|
|
|
if test "x$INSTALL" = "x1" ; then
|
2013-06-27 02:55:30 +08:00
|
|
|
if test "x$PREFIX" = x ; then
|
|
|
|
PREFIX="$stddir/${HOST}"
|
|
|
|
fi
|
2013-02-27 05:56:13 +08:00
|
|
|
else
|
2012-12-14 02:22:11 +08:00
|
|
|
PREFIX="/tmp/local/${HOST}"
|
2012-06-29 01:12:02 +08:00
|
|
|
fi
|
2011-05-13 01:51:32 +08:00
|
|
|
|
2012-02-16 03:15:03 +08:00
|
|
|
MALLOC_CHECK=""
|
|
|
|
|
2011-05-13 01:51:32 +08:00
|
|
|
CPPFLAGS=""
|
|
|
|
LDFLAGS=""
|
|
|
|
|
2012-03-03 04:27:44 +08:00
|
|
|
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
|
|
|
|
|
2011-05-13 01:51:32 +08:00
|
|
|
if test x$M32 = x1 ; then
|
|
|
|
PREFIX="/tmp/install32/${HOST}"
|
|
|
|
stddir="/share/ed/local/${HOST}_32"
|
2012-05-04 01:15:41 +08:00
|
|
|
CFLAGS="-m32 $CFLAGS"
|
2011-05-13 01:51:32 +08:00
|
|
|
elif test x$M64 = x1 ; then
|
|
|
|
PREFIX="/tmp/install64/${HOST}"
|
|
|
|
stddir="/share/ed/local/${HOST}_64"
|
2012-05-04 01:15:41 +08:00
|
|
|
CFLAGS="-m64 $CFLAGS"
|
2011-05-13 01:51:32 +08:00
|
|
|
fi
|
|
|
|
|
2012-08-01 04:34:13 +08:00
|
|
|
if test "x$HOST" = xyakov ; then
|
|
|
|
stddir="/opt/local"
|
|
|
|
fi
|
|
|
|
|
2011-05-13 01:51:32 +08:00
|
|
|
CFLAGS="-g -O0 $CFLAGS"
|
|
|
|
|
|
|
|
case "$HOST" in
|
|
|
|
mort)
|
|
|
|
CFLAGS="-std=c99 $CFLAGS"
|
|
|
|
;;
|
2012-08-01 04:34:13 +08:00
|
|
|
yakov)
|
|
|
|
CFLAGS="-std=c99 $CFLAGS"
|
|
|
|
;;
|
2011-05-13 01:51:32 +08:00
|
|
|
spock)
|
2012-03-03 04:27:44 +08:00
|
|
|
if test "x$PGI" = x ; then
|
|
|
|
CFLAGS="-Wdeclaration-after-statement -Wall $CFLAGS"
|
|
|
|
fi
|
2011-05-13 01:51:32 +08:00
|
|
|
;;
|
|
|
|
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"
|
2011-05-13 01:51:32 +08:00
|
|
|
LD_LIBRARY_PATH="${stddir}/lib:$LD_LIBRARY_PATH"
|
|
|
|
fi
|
|
|
|
|
2013-12-23 03:53:20 +08:00
|
|
|
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
|
2011-05-13 01:51:32 +08:00
|
|
|
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"
|
2011-05-13 01:51:32 +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
|
|
|
|
|
|
|
|
FLAGS="--prefix ${PREFIX}"
|
2011-09-02 06:32:28 +08:00
|
|
|
#FLAGS="$FLAGS --disable-f77 --disable-f90"
|
|
|
|
#FLAGS="$FLAGS --disable-cxx"
|
2011-05-13 01:51:32 +08:00
|
|
|
FLAGS="$FLAGS --disable-examples"
|
|
|
|
#FLAGS="$FLAGS --disable-utilities"
|
|
|
|
#FLAGS="$FLAGS --enable-cxx-4"
|
|
|
|
#FLAGS="$FLAGS --enable-dap-long-tests"
|
2012-03-26 09:34:32 +08:00
|
|
|
#FLAGS="$FLAGS --enable-ffio"
|
2012-04-02 04:15:06 +08:00
|
|
|
#FLAGS="$FLAGS --enable-benchmarks"
|
2013-12-23 03:53:20 +08:00
|
|
|
#FLAGS="$FLAGS --enable-extra-tests"
|
2012-11-22 07:57:42 +08:00
|
|
|
#FLAGS="$FLAGS --enable-large-file-tests"
|
2012-04-13 10:41:00 +08:00
|
|
|
#FLAGS="$FLAGS --disable-testsets"
|
2013-11-16 02:38:54 +08:00
|
|
|
#FLAGS="$FLAGS --disable-dap-remote-tests"
|
2014-03-08 03:04:38 +08:00
|
|
|
#FLAGS="$FLAGS --enable-dap-auth-tests"
|
2012-08-02 01:18:58 +08:00
|
|
|
#FLAGS="$FLAGS --enable-doxygen"
|
2013-12-23 03:53:20 +08:00
|
|
|
#FLAGS="$FLAGS --enable-logging"
|
2012-05-16 01:48:27 +08:00
|
|
|
#FLAGS="$FLAGS --disable-diskless"
|
2012-06-24 03:25:49 +08:00
|
|
|
#FLAGS="$FLAGS --enable-mmap"
|
2012-07-18 06:29:09 +08:00
|
|
|
#FLAGS="$FLAGS --with-udunits"
|
|
|
|
#FLAGS="$FLAGS --with-libcf"
|
2012-07-18 23:50:29 +08:00
|
|
|
#valgrind => not shared
|
2012-08-02 01:18:58 +08:00
|
|
|
#FLAGS="$FLAGS --enable-valgrind-tests"
|
2011-05-13 01:51:32 +08:00
|
|
|
|
2012-07-18 23:50:29 +08:00
|
|
|
FLAGS="$FLAGS --disable-shared"
|
2011-05-13 01:51:32 +08:00
|
|
|
#FLAGS="$FLAGS --enable-shared"
|
|
|
|
|
|
|
|
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
|
2011-05-13 01:51:32 +08:00
|
|
|
if test "x$DAP" = "x" ; then
|
|
|
|
FLAGS="$FLAGS --disable-dap"
|
|
|
|
fi
|
2011-05-25 05:48:44 +08:00
|
|
|
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
|
2011-05-13 01:51:32 +08:00
|
|
|
|
2013-01-18 10:25:12 +08:00
|
|
|
if test "x$PNETCDF" = x1 ; then
|
2013-12-23 03:53:20 +08:00
|
|
|
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
|
|
|
|
|
2011-05-13 01:51:32 +08:00
|
|
|
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
|
2014-03-08 03:04:38 +08:00
|
|
|
${MAKE} ${FORCE} $c
|
2011-05-13 01:51:32 +08:00
|
|
|
done
|
|
|
|
exit 0
|