I took Ed's advice and moved the plugin stuff to its own
top-level directory. This is an attempt to solve the problem of
copying files that we have experienced. In any case, it will
serve as a place to stick additional plugins.
This commit is contained in:
Dennis Heimbigner 2018-04-21 20:10:47 -06:00
parent 51de06630c
commit d3b309722e
31 changed files with 19 additions and 131 deletions

View File

@ -71,6 +71,11 @@ HDF4_TEST_DIR = hdf4_test
LIBHDF4 = libhdf4
endif
# Optionally build plugins
if ENABLE_FILTER_TESTING
PLUGIN_DIR = plugins
endif
# Define Test directories
if BUILD_TESTSETS
TESTDIRS = $(V2_TEST) nc_test $(NC_TEST4) $(HDF4_TEST_DIR) \
@ -82,7 +87,7 @@ endif
# depend on it.
SUBDIRS = include $(H5_TEST_DIR) libdispatch libsrc $(LIBSRC4_DIR) \
$(LIBSRCP) $(LIBHDF4) $(OCLIB) $(DAP2) ${DAP4} liblib $(NCGEN3) \
$(NCGEN) $(NCDUMP) $(TESTDIRS) docs $(EXAMPLES)
$(NCGEN) $(NCDUMP) ${PLUGIN_DIR} $(TESTDIRS) docs $(EXAMPLES)
# Remove these generated files, for a distclean.
DISTCLEANFILES = VERSION comps.txt test_prog libnetcdf.settings \

2
cf
View File

@ -117,7 +117,7 @@ FLAGS="$FLAGS --enable-logging"
#FLAGS="$FLAGS --disable-properties-attribute"
#FLAGS="$FLAGS --disable-silent-rules"
#FLAGS="$FLAGS --with-testservers=remotestserver.localhost:8083"
FLAGS="$FLAGS --disable-filter-testing"
#FLAGS="$FLAGS --disable-filter-testing"
#FLAGS="$FLAGS --enable-metadata-perf"
if test "x$PAR4" != x1 ; then

View File

@ -47,7 +47,7 @@ FLAGS="$FLAGS -DENABLE_EXAMPLES=false"
FLAGS="$FLAGS -DENABLE_DYNAMIC_LOADING=false"
FLAGS="$FLAGS -DENABLE_WINSOCK2=false"
#FLAGS="$FLAGS -DENABLE_LARGE_FILE_TESTS=true"
#FLAGS="$FLAGS -DENABLE_FILTER_TESTING=true"
FLAGS="$FLAGS -DENABLE_FILTER_TESTING=true"
rm -fr build
mkdir build

View File

@ -1432,27 +1432,6 @@ AC_SUBST([MSVC], [])
AC_CONFIG_FILES(nc_test4/findplugin.sh:nc_test4/findplugin.in)
AC_CONFIG_FILES(examples/C/findplugin.sh:nc_test4/findplugin.in)
if test "x$enable_filter_testing" = xyes ; then
if test "x$nc_build_examples" = xyes ; then
AC_MSG_NOTICE([copying filter plugin building files])
# Must be a simpler way; all my attempts to use some kind of wildcard failed,
# so falling back on enumeration
# WARNING: This enumeration must be kept consistent with the
# HDF5PLUGINSRC list in nc_test4/hdf5plugins/Makefile.am
AC_CONFIG_LINKS([examples/C/hdf5plugins/bzlib.h:nc_test4/hdf5plugins/bzlib.h])
AC_CONFIG_LINKS([examples/C/hdf5plugins/bzlib_private.h:nc_test4/hdf5plugins/bzlib_private.h])
AC_CONFIG_LINKS([examples/C/hdf5plugins/blocksort.c:nc_test4/hdf5plugins/blocksort.c])
AC_CONFIG_LINKS([examples/C/hdf5plugins/huffman.c:nc_test4/hdf5plugins/huffman.c])
AC_CONFIG_LINKS([examples/C/hdf5plugins/crctable.c:nc_test4/hdf5plugins/crctable.c])
AC_CONFIG_LINKS([examples/C/hdf5plugins/randtable.c:nc_test4/hdf5plugins/randtable.c])
AC_CONFIG_LINKS([examples/C/hdf5plugins/compress.c:nc_test4/hdf5plugins/compress.c])
AC_CONFIG_LINKS([examples/C/hdf5plugins/decompress.c:nc_test4/hdf5plugins/decompress.c])
AC_CONFIG_LINKS([examples/C/hdf5plugins/bzlib.c:nc_test4/hdf5plugins/bzlib.c])
AC_CONFIG_LINKS([examples/C/hdf5plugins/H5Zbzip2.c:nc_test4/hdf5plugins/H5Zbzip2.c])
AC_CONFIG_LINKS([examples/C/hdf5plugins/h5bzip2.h:nc_test4/hdf5plugins/h5bzip2.h])
fi
fi
#####
# End netcdf_meta.h definitions.
#####
@ -1475,7 +1454,6 @@ AC_CONFIG_FILES([Makefile
ncgen/Makefile
examples/Makefile
examples/C/Makefile
examples/C/hdf5plugins/Makefile
examples/CDL/Makefile
oc2/Makefile
libdap2/Makefile
@ -1489,13 +1467,13 @@ AC_CONFIG_FILES([Makefile
docs/images/Makefile
nctest/Makefile
nc_test4/Makefile
nc_test4/hdf5plugins/Makefile
nc_test/Makefile
ncdap_test/Makefile
ncdap_test/testdata3/Makefile
ncdap_test/expected3/Makefile
ncdap_test/expectremote3/Makefile
dap4_test/Makefile
plugins/Makefile
],
[test -f nc-config && chmod 755 nc-config])

View File

@ -12,9 +12,5 @@ SET_TESTS_PROPERTIES(C_tests_simple_xy_rd PROPERTIES DEPENDS C_tests_simple_xy_w
SET_TESTS_PROPERTIES(C_tests_sfc_pres_temp_rd PROPERTIES DEPENDS C_tests_sfc_pres_temp_wr)
SET_TESTS_PROPERTIES(C_tests_pres_temp_4D_rd PROPERTIES DEPENDS C_tests_pres_temp_4D_wr)
IF(ENABLE_FILTER_TESTING)
ADD_SUBDIRECTORY(hdf5plugins)
ENDIF(ENABLE_FILTER_TESTING)
SET(CLEANFILES sfc_pres_temp.nc simple_xy.nc pres_temp_4D.nc simple_nc4.nc simple_xy_nc4.nc)
SET_DIRECTORY_PROPERTIES(PROPERTIES ADDITIONAL_MAKE_CLEAN_FILES "${CLEANFILES}")

View File

@ -25,9 +25,6 @@ if USE_NETCDF4
check_PROGRAMS += simple_nc4_wr simple_nc4_rd simple_xy_nc4_wr \
simple_xy_nc4_rd
# This subdir should be same as nc_test4/hdf5plugins
SUBDIRS = hdf5plugins
if ENABLE_FILTER_TESTING
# filter_example.c should be same as nc_test4/test_filter.c
check_PROGRAMS += filter_example

View File

@ -1,31 +0,0 @@
SET(CMAKE_BUILD_TYPE "")
SET(libbzip2_SOURCES bzlib.h bzlib_private.h
blocksort.c huffman.c crctable.c randtable.c compress.c decompress.c bzlib.c
H5Zbzip2.c h5bzip2.h
)
# Get the compilable sources from nc_test4/hdf5plugins
FOREACH(S ${libbzip2_SOURCES})
FILE(COPY ${CMAKE_SOURCE_DIR}/nc_test4/hdf5plugins/${S} DESTINATION ${CMAKE_CURRENT_SOURCE_DIR})
ENDFOREACH(S)
IF(ENABLE_FILTER_TESTING)
IF(BUILD_UTILITIES)
# LDFLAGS = -module -avoid-version -shared -export-dynamic -no-undefined
ADD_LIBRARY(bzip2 MODULE ${libbzip2_SOURCES})
SET_TARGET_PROPERTIES(bzip2 PROPERTIES LIBRARY_OUTPUT_NAME "bzip2")
SET_TARGET_PROPERTIES(bzip2 PROPERTIES ARCHIVE_OUTPUT_NAME "bzip2")
SET_TARGET_PROPERTIES(bzip2 PROPERTIES RUNTIME_OUTPUT_NAME "bzip2")
TARGET_LINK_LIBRARIES(bzip2 ${HDF5_HL_LIBRARIES} ${HDF5_C_LIBRARIES})
ENDIF(BUILD_UTILITIES)
ENDIF(ENABLE_FILTER_TESTING)
# Copy some test files from current source dir to out-of-tree build dir.
FILE(COPY ${COPY_FILES} DESTINATION ${CMAKE_CURRENT_BINARY_DIR}/)
IF(MSVC)
FILE(COPY ${COPY_FILES} DESTINATION ${RUNTIME_OUTPUT_DIRECTORY}/)
ENDIF()

View File

@ -1,32 +0,0 @@
# Copyright 2018, UCAR/Unidata
# See netcdf/COPYRIGHT file for copying and redistribution conditions.
BZIP2SRC = bzlib.h bzlib_private.h blocksort.c huffman.c crctable.c randtable.c compress.c decompress.c bzlib.c
PLUGINSRC = H5Zbzip2.c h5bzip2.h
TARGETS = ${PLUGINSRC} ${BZIP2SRC}
HDF5PLUGINSRC=${PLUGINSRC} ${BZIP2SRC}
BUILT_SOURCES = ${TARGETS}
${TARGETS}:
for x in ${TARGETS} ; do \
rm -f ./$$x; \
'cp' -f ${top_srcdir}/nc_test4/hdf5plugins/$$x . ; \
done
CLEANFILES = ${TARGETS}
if ENABLE_FILTER_TESTING
lib_LTLIBRARIES = libbzip2.la
libbzip2_la_SOURCES = ${HDF5PLUGINSRC}
libbzip2_la_LDFLAGS = -module -avoid-version -shared -export-dynamic -no-undefined
endif #ENABLE_FILTER_TESTING
EXTRA_DIST = CMakeLists.txt H5Zbzip2.c Makefile.am blocksort.c bzlib.c bzlib.h bzlib_private.h compress.c \
crctable.c decompress.c h5bzip2.h huffman.c randtable.c bzip2.nc

Binary file not shown.

View File

@ -93,5 +93,3 @@ IF(TEST_PARALLEL4)
ENDIF()
ADD_EXTRA_DIST(findplugin.in)
ADD_SUBDIRECTORY(hdf5plugins)

View File

@ -154,7 +154,5 @@ szip_dump.cdl perftest.txt bigmeta.nc
DISTCLEANFILES = findplugin.sh
SUBDIRS=hdf5plugins
# If valgrind is present, add valgrind targets.
@VALGRIND_CHECK_RULES@

View File

@ -3,7 +3,7 @@
# Define a function that attempts to locate a
# plugin with a given canonical name.
# Assumptions:
# 1. hdf5plugins is a directory in this current directory
# 1. plugins is a top-level directory
# Inputs:
# $1 is the canonical name
# $2 is 1 if we are running under cmake
@ -28,6 +28,9 @@ FP_NAME="$1"
FP_ISCMAKE=@ISCMAKE@
FP_ISMSVC=@MSVC@
# And topsrcdir
topbuilddir='@abs_top_builddir@'
# Are we operating under OS-X? (test using uname)
FP_OS=`uname | cut -d '_' -f 1`
if test "x$FP_OS" = xDarwin ; then FP_ISOSX=1; fi
@ -36,8 +39,7 @@ if test "x$FP_OS" = xDarwin ; then FP_ISOSX=1; fi
FP_OS=`uname | cut -d '_' -f 1`
if test "x$FP_OS" = xCYGWIN ; then FP_ISCYGWIN=1; fi
FP_PLUGINS=`pwd`
FP_PLUGINS="$FP_PLUGINS/hdf5plugins"
FP_PLUGINS="$topbuilddir/plugins"
FP_PLUGIN_LIB=
FP_PLUGIN_PATH=

Binary file not shown.

View File

@ -1,6 +1,5 @@
#!/bin/sh
BUILD=1
#PROF=1
#DEBUG=1
#MEM=1
@ -21,35 +20,12 @@ ARGS="--treedepth=6 \
--varrank=2 \
--nvarattrs=500"
if test "x$MEM" = x1 ; then
CMD="valgrind --leak-check=full"
elif test "x$DEBUG" = x1 ; then
CMD="gdb --args "
fi
if test "x$BUILD" = x1 ; then
CFLAGS="-Wall -Wno-unused-variable -Wno-unused-function -I.. -I../include"
LDFLAGS="../liblib/.libs/libnetcdf.a -L/usr/local/lib -lhdf5_hl -lhdf5 -lz -ldl -lcurl -lm -lmfhdf -ldf"
CC=gcc
if test "x$PROF" = x1 ; then
CFLAGS="-pg $CFLAGS"
LDFLAGS="-pg $LDFLAGS"
fi
if test "x$DEBUG" = x1 ; then
CFLAGS="-g -O0 $CFLAGS"
LDFLAGS="-g -O0 $LDFLAGS"
fi
LLP="/usr/local/lib:${LD_LIBRARY_PATH}"
export LD_LIBRARY_PATH=${LLP}; export CFLAGS; export LDFLAGS
${CC} -o bigmeta ${CFLAGS} bigmeta.c ${LDFLAGS}
${CC} -o openbigmeta ${CFLAGS} openbigmeta.c ${LDFLAGS}
fi
echo "timing bigmeta:"
${CMD} ./bigmeta $ARGS
${execdir}/bigmeta $ARGS
echo "timing openbigmeta:"
${CMD} ./openbigmeta
${execdir}/openbigmeta
if test "x$PROF" = x1 ; then
rm -f perftest.txt
gprof openbigmeta gmon.out >perftest.txt
fi

View File

@ -1,5 +1,7 @@
#!/bin/bash
export SETX=1
if test "x$srcdir" = x ; then srcdir=`pwd`; fi
. ../test_common.sh

View File

@ -1,7 +1,6 @@
# Copyright 2018, UCAR/Unidata
# See netcdf/COPYRIGHT file for copying and redistribution conditions.
BZIP2HDRS=bzlib.h bzlib_private.h
BZIP2SRC= blocksort.c huffman.c crctable.c randtable.c compress.c decompress.c bzlib.c