mirror of
https://github.com/Unidata/netcdf-c.git
synced 2024-12-27 08:49:16 +08:00
d2316f866c
Primary Fixes: * Add a whole variable optimization -- used in the rare case that nc_get/put_vara covers the whole of a variable and the variable has a single chunk. * Fix chunking error when stride causes whole chunks to be skipped. * Fix some memory leaks * Add test cases * Add one performance test to nczarr_test/. This uses the timer utils from unit_test: timer_utils.[ch]. * Move ncdumpchunks utility from ncdump to nczarr_test Misc. Other Changes: * Make check for aws libraries conditional on --enable-nczarr-s3 * Remove all but one bm tests from nczarr_test until they are working. * Remove another dependency on HDF5 from supposedly non-HDF5 specific code; specifically hdf5_log_hdf5. * Make the BAIL2 macro be hdf5 specific and replace elsewhere with an HDF5 independent equivalent. * Move hdf5cache.c to libsrc4/nc4cache.c because it is used by nczarr. * Modify unit_tests so that some of them are run even if using Windows. * Misc. small bug fixes and refactors and memory leaks. * Rename some conflicting tests for cmake. * Attempted to make nc_perf work with cmake and failed.
175 lines
3.4 KiB
Bash
175 lines
3.4 KiB
Bash
#!/bin/bash
|
|
|
|
#NB=1
|
|
#DB=1
|
|
#X=-x
|
|
|
|
#ANSI=1
|
|
MEM=1
|
|
#NOTUIL=1
|
|
FAST=1
|
|
#PROF=1
|
|
|
|
NCZARR=1
|
|
HDF5=1
|
|
#DAP=1
|
|
S3=1
|
|
S3TEST=1
|
|
#SZIP=1
|
|
#HDF4=1
|
|
#PNETCDF=1
|
|
#PAR4=1
|
|
#NOCDF5=1
|
|
|
|
#TESTSERVERS="149.165.169.123:8080,remotetest.unidata.ucar.edu"
|
|
#TESTSERVERS="localhost:8080,149.165.169.123:8080"
|
|
#TESTSERVERS="149.165.169.123:8080"
|
|
#TESTSERVERS="remotetest.unidata.ucar.edu"
|
|
|
|
if test $# != 0 ; then
|
|
cmds=$@
|
|
fi
|
|
|
|
if test "x$PNETCDF" = x1 -o "x$PAR4" = x1 ; then
|
|
MPIO=1
|
|
fi
|
|
|
|
CFLAGS=""
|
|
#CFLAGS="-Wall -Wno-unused-but-set-variable -Wno-unused-variable -Wno-unused-parameter -Wconversion ${CFLAGS}"
|
|
#CFLAGS="-Wall -Wno-unused-but-set-variable -Wno-unused-variable -Wno-unused-parameter -Wno-char-subscripts -Wno-pointer-sign -Wno-format ${CFLAGS}"
|
|
CFLAGS="-Wall -Wno-unused-parameter -Wno-char-subscripts -Wno-pointer-sign ${CFLAGS}"
|
|
#CFLAGS="-Wall ${CFLAGS}"
|
|
#CFLAGS="$CFLAGS -Wconversion"
|
|
#CFLAGS="-Wall -Wunused-parameter -Wno-char-subscripts -Wno-pointer-sign ${CFLAGS}"
|
|
|
|
if test "x$MEM" = x1 ; then
|
|
CFLAGS="-fsanitize=address ${CFLAGS}"
|
|
fi
|
|
|
|
if test "x$ANSI" = x1 ; then
|
|
CFLAGS="-ansi ${CFLAGS}"
|
|
fi
|
|
|
|
stddir="/usr/local"
|
|
PREFIX=/usr/local
|
|
|
|
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
|
|
|
|
# HDF4=>HDF5
|
|
if test "x$HDF4" = x1 ; then
|
|
HDF5=1
|
|
fi
|
|
|
|
# !HDF5=>!SZIP
|
|
if test "x$HDF5" != x1 ; then
|
|
SZIP=0
|
|
fi
|
|
|
|
CC=gcc
|
|
|
|
MALLOC_CHECK=""
|
|
|
|
CPPFLAGS=""
|
|
LDFLAGS="-L/usr/lib -L${stddir}/lib"
|
|
#LD_LIBRARY_PATH="/usr/lib:${stddir}/lib:$LD_LIBRARY_PATH"
|
|
|
|
CFLAGS="-g -O0 $CFLAGS -Wno-undefined"
|
|
|
|
MAKE=make
|
|
IGNORE="test 0 = 1"
|
|
|
|
FLAGS="$FLAGS --enable-logging"
|
|
FLAGS="$FLAGS --enable-byterange"
|
|
#FLAGS="$FLAGS --enable-extra-tests"
|
|
FLAGS="$FLAGS --enable-mmap"
|
|
FLAGS="$FLAGS --enable-examples"
|
|
FLAGS="$FLAGS --enable-unit-tests"
|
|
FLAGS="$FLAGS --enable-benchmarks"
|
|
|
|
if test "x$HDF5" != x ; then
|
|
CPPFLAGS="-I${stddir}/include $CPPFLAGS"
|
|
LDFLAGS="-lhdf5_hl -lhdf5 -lz $LDFLAGS"
|
|
else
|
|
FLAGS="$FLAGS --disable-hdf5"
|
|
fi
|
|
|
|
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"
|
|
else
|
|
FLAGS="$FLAGS --enable-dap-remote-tests"
|
|
fi
|
|
|
|
if test "x$MPIO" = x1 ; then
|
|
# MPIDIR=/usr/lib64/mpich
|
|
MPIDIR=/usr/lib64/openmpi
|
|
PATH="${PATH}:${MPIDIR}/bin"
|
|
CC="${MPIDIR}/bin/mpicc"
|
|
CPPFLAGS="-I${MPIDIR}/include"
|
|
LDFLAGS="$LDFLAGS -L${MPIDIR}"
|
|
LDLIBS="-lmpich"
|
|
FLAGS="$FLAGS --enable-parallel-tests"
|
|
fi
|
|
|
|
if test "x$NOCDF5" = "x1" ; then
|
|
FLAGS="$FLAGS --disable-cdf5"
|
|
fi
|
|
|
|
if test "x$PNETCDF" = x1 ; then
|
|
FLAGS="$FLAGS --enable-pnetcdf"
|
|
fi
|
|
|
|
if test "x$NCZARR" != "x" ; then
|
|
FLAGS="$FLAGS --enable-nczarr"
|
|
if test "x$S3" != x ; then
|
|
FLAGS="$FLAGS --enable-nczarr-s3"
|
|
LDFLAGS="$LDFLAGS -laws-cpp-sdk-s3 -laws-cpp-sdk-core -laws-c-common"
|
|
if test "x$S3TEST" != x ; then
|
|
FLAGS="$FLAGS --enable-nczarr-s3-tests"
|
|
fi
|
|
fi
|
|
fi
|
|
|
|
if test "x${PROF}" = x1 ; then
|
|
CFLAGS="${CFLAGS} -pg"
|
|
LDFLAGS="${LDFLAGS} -pg"
|
|
FLAGS="$FLAGS --enable-static --disable-shared"
|
|
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
|
|
|
|
if test "x$NB" != x1 && test "x$FAST" != x1 ; then
|
|
${MAKE} distclean >/dev/null 2>&1
|
|
fi
|
|
if test "x$NB" != x1 ; then
|
|
if autoreconf -i --force ; then ok=1; else exit ; fi
|
|
fi
|
|
|
|
sh $X ./configure ${FLAGS}
|
|
for c in $cmds; do
|
|
printenv LD_LIBRARY_PATH
|
|
${MAKE} ${FORCE} $c
|
|
done
|
|
exit 0
|