2011-05-13 01:51:32 +08:00
|
|
|
#!/bin/bash
|
2012-05-05 01:32:14 +08:00
|
|
|
#NB=1
|
2017-09-05 08:37:13 +08:00
|
|
|
DB=1
|
2015-08-16 06:26:35 +08:00
|
|
|
#X=-x
|
2017-03-09 08:01:10 +08:00
|
|
|
FAST=1
|
2012-03-15 07:26:48 +08:00
|
|
|
|
2017-03-09 08:01:10 +08:00
|
|
|
HDF5=1
|
2016-05-25 08:52:24 +08:00
|
|
|
DAP=1
|
2017-08-28 10:38:37 +08:00
|
|
|
SZIP=1
|
2016-06-25 05:28:50 +08:00
|
|
|
#HDF4=1
|
2015-08-17 11:44:18 +08:00
|
|
|
#PNETCDF=1
|
|
|
|
#PAR4=1
|
2013-12-23 03:53:20 +08:00
|
|
|
|
2015-10-12 03:35:44 +08:00
|
|
|
if test $# != 0 ; then
|
|
|
|
cmds=$@
|
|
|
|
fi
|
2014-10-14 04:33:06 +08:00
|
|
|
|
2015-11-07 08:03:28 +08:00
|
|
|
if test "x$PNETCDF" = x1 -o "x$PAR4" = x1 ; then
|
|
|
|
MPIO=1
|
2014-10-14 04:33:06 +08:00
|
|
|
fi
|
|
|
|
|
2014-03-09 11:41:30 +08:00
|
|
|
CFLAGS=""
|
2015-08-16 06:26:35 +08:00
|
|
|
#CFLAGS="-Wall -Wno-unused-but-set-variable -Wno-unused-variable -Wno-unused-parameter -Wconversion ${CFLAGS}"
|
2016-05-04 11:17:06 +08:00
|
|
|
CFLAGS="-Wall -Wno-unused-but-set-variable -Wno-unused-variable -Wno-unused-parameter -Wno-char-subscripts -Wno-pointer-sign -Wno-format ${CFLAGS}"
|
2015-08-16 06:26:35 +08:00
|
|
|
#CFLAGS="-Wall ${CFLAGS}"
|
2014-03-11 06:40:52 +08:00
|
|
|
#CFLAGS="-Wconversion"
|
2014-03-09 11:41:30 +08:00
|
|
|
|
2014-04-04 05:46:12 +08:00
|
|
|
stddir="/usr/local"
|
2014-06-01 03:54:52 +08:00
|
|
|
PREFIX=/usr/local
|
2014-06-27 06:40:08 +08:00
|
|
|
|
2014-06-01 03:54:52 +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
|
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
|
|
|
|
|
2017-10-09 05:56:45 +08:00
|
|
|
# !HDF5=>!SZIP
|
|
|
|
if test "x$HDF5" != x1 ; then
|
|
|
|
SZIP=0
|
|
|
|
fi
|
|
|
|
|
2012-03-03 04:27:44 +08:00
|
|
|
CC=gcc
|
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=""
|
|
|
|
|
2017-06-07 05:23:59 +08:00
|
|
|
CFLAGS="-g -O0 $CFLAGS -Wno-undefined"
|
2011-05-13 01:51:32 +08:00
|
|
|
|
|
|
|
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
|
|
|
|
2017-08-28 10:38:37 +08:00
|
|
|
if test "x$SZIP" = "x1" ; then
|
|
|
|
LDFLAGS="$LDFLAGS -lsz -laec"
|
|
|
|
fi
|
|
|
|
|
2017-03-09 08:01:10 +08:00
|
|
|
export PKG_CONFIG_PATH=/usr/lib/pkgconfig
|
|
|
|
if test "x$DAP" = "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
|
2017-03-09 08:01:10 +08:00
|
|
|
LDFLAGS="${LDFLAGS} -lcurl"
|
2011-05-13 01:51:32 +08:00
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
2013-01-18 10:25:12 +08:00
|
|
|
CXXFLAGS="$CPPFLAGS $CXXFLAGS"
|
2011-05-13 01:51:32 +08:00
|
|
|
|
|
|
|
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"
|
2017-03-09 08:01:10 +08:00
|
|
|
FLAGS="$FLAGS --enable-extreme-numbers"
|
|
|
|
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"
|
2017-03-09 08:01:10 +08:00
|
|
|
#FLAGS="$FLAGS --enable-dap-auth-tests" -- requires a new remotetest server
|
2017-10-10 11:24:56 +08:00
|
|
|
#FLAGS="$FLAGS --enable-doxygen --enable-internal-docs"
|
2017-02-17 05:27:54 +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"
|
2016-05-04 11:17:06 +08:00
|
|
|
#FLAGS="$FLAGS --enable-jna"
|
|
|
|
#FLAGS="$FLAGS --disable-properties-attribute"
|
|
|
|
#FLAGS="$FLAGS --disable-silent-rules"
|
2017-03-09 08:01:10 +08:00
|
|
|
#FLAGS="$FLAGS --with-testservers=remotestserver.localhost:8083"
|
2017-10-11 01:21:01 +08:00
|
|
|
FLAGS="$FLAGS --enable-filter-test"
|
2011-05-13 01:51:32 +08:00
|
|
|
|
2015-08-16 06:26:35 +08:00
|
|
|
if test "x$PAR4" != x1 ; then
|
|
|
|
FLAGS="$FLAGS --disable-parallel4"
|
|
|
|
fi
|
|
|
|
|
2014-10-08 02:37:41 +08:00
|
|
|
if test "x${DB}" = x1 ; then
|
2016-05-04 11:17:06 +08:00
|
|
|
FLAGS="$FLAGS --disable-shared --enable-static"
|
2014-10-08 02:37:41 +08:00
|
|
|
else
|
2014-04-04 05:46:12 +08:00
|
|
|
FLAGS="$FLAGS --enable-shared"
|
2014-10-08 02:37:41 +08:00
|
|
|
fi
|
2011-05-13 01:51:32 +08:00
|
|
|
|
2015-11-07 08:03:28 +08:00
|
|
|
#TMP=
|
|
|
|
#rm -f ./test_mpi.tmp
|
|
|
|
#if test -f $stddir/lib/libhdf5.a ; then
|
|
|
|
# nm $stddir/lib/libhdf5.a | grep mpich_mpi_float$ >./test_mpi.tmp
|
|
|
|
#else
|
|
|
|
# if test -f $stddir/lib/libhdf5.so ; then
|
|
|
|
# nm $stddir/lib/libhdf5.so | grep mpich_mpi_float$ >./test_mpi.tmp
|
|
|
|
# fi
|
|
|
|
#fi
|
|
|
|
#if test -s ./test_mpi.tmp ; then
|
|
|
|
# PAR=1
|
|
|
|
#fi
|
|
|
|
#rm -f ./test_mpi.tmp
|
2015-09-13 06:41:14 +08:00
|
|
|
|
2014-12-25 01:22:47 +08:00
|
|
|
if test "x${PAR}" != x ; then
|
|
|
|
FLAGS="$FLAGS --enable-parallel"
|
2014-10-14 04:33:06 +08:00
|
|
|
fi
|
|
|
|
|
2011-05-13 01:51:32 +08:00
|
|
|
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
|
|
|
|
|
2015-11-07 08:03:28 +08:00
|
|
|
if test "x$MPIO" = 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"
|
|
|
|
LDLIBS="-lmpich"
|
|
|
|
FLAGS="$FLAGS --enable-pnetcdf"
|
|
|
|
FLAGS="$FLAGS --enable-parallel-tests"
|
2013-01-18 10:25:12 +08:00
|
|
|
fi
|
|
|
|
|
2015-08-20 07:14:13 +08:00
|
|
|
#FLAGS="${FLAGS} --enable-stdio"
|
|
|
|
|
2013-01-18 10:25:12 +08:00
|
|
|
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
|
|
|
|
|
2015-10-12 03:35:44 +08:00
|
|
|
if test "x$NB" != x -o "x$FAST" = x ; then
|
2014-06-27 06:40:08 +08:00
|
|
|
${MAKE} maintainer-clean >/dev/null 2>&1
|
2015-10-12 03:35:44 +08:00
|
|
|
fi
|
|
|
|
if test -z "$NB" ; then
|
|
|
|
if autoreconf -i --force ; then ok=1; else exit ; fi
|
2014-06-27 06:40:08 +08:00
|
|
|
fi
|
|
|
|
|
2015-10-12 03:35:44 +08:00
|
|
|
if test -z "$FAST" ; then
|
2015-08-16 06:26:35 +08:00
|
|
|
if test -f Makefile ; then ${MAKE} distclean >/dev/null 2>&1 ; fi
|
|
|
|
fi
|
2011-05-13 01:51:32 +08:00
|
|
|
sh $X ./configure ${FLAGS}
|
|
|
|
for c in $cmds; do
|
2015-09-13 06:41:14 +08:00
|
|
|
printenv LD_LIBRARY_PATH
|
2014-03-08 03:04:38 +08:00
|
|
|
${MAKE} ${FORCE} $c
|
2011-05-13 01:51:32 +08:00
|
|
|
done
|
|
|
|
exit 0
|