mirror of
https://github.com/Unidata/netcdf-c.git
synced 2024-12-21 08:39:46 +08:00
11fe00ea05
Filter support has three goals: 1. Use the existing HDF5 filter implementations, 2. Allow filter metadata to be stored in the NumCodecs metadata format used by Zarr, 3. Allow filters to be used even when HDF5 is disabled Detailed usage directions are define in docs/filters.md. For now, the existing filter API is left in place. So filters are defined using ''nc_def_var_filter'' using the HDF5 style where the id and parameters are unsigned integers. This is a big change since filters affect many parts of the code. In the following, the terms "compressor" and "filter" and "codec" are generally used synonomously. ### Filter-Related Changes: * In order to support dynamic loading of shared filter libraries, a new library was added in the libncpoco directory; it helps to isolate dynamic loading across multiple platforms. * Provide a json parsing library for use by plugins; this is created by merging libdispatch/ncjson.c with include/ncjson.h. * Add a new _Codecs attribute to allow clients to see what codecs are being used; let ncdump -s print it out. * Provide special headers to help support compilation of HDF5 filters when HDF5 is not enabled: netcdf_filter_hdf5_build.h and netcdf_filter_build.h. * Add a number of new test to test the new nczarr filters. * Let ncgen parse _Codecs attribute, although it is ignored. ### Plugin directory changes: * Add support for the Blosc compressor; this is essential because it is the most common compressor used in Zarr datasets. This also necessitated adding a CMake FindBlosc.cmake file * Add NCZarr support for the big-four filters provided by HDF5: shuffle, fletcher32, deflate (zlib), and szip * Add a Codec defaulter (see docs/filters.md) for the big four filters. * Make plugins work with windows by properly adding __declspec declaration. ### Misc. Non-Filter Changes * Replace most uses of USE_NETCDF4 (deprecated) with USE_HDF5. * Improve support for caching * More fixes for path conversion code * Fix misc. memory leaks * Add new utility -- ncdump/ncpathcvt -- that does more or less the same thing as cygpath. * Add a number of new test to test the non-filter fixes. * Update the parsers * Convert most instances of '#ifdef _MSC_VER' to '#ifdef _WIN32'
65 lines
2.7 KiB
CMake
Executable File
65 lines
2.7 KiB
CMake
Executable File
# Searches for an installation of the blosc library. On success, it sets the following variables:
|
|
#
|
|
# Blosc_FOUND Set to true to indicate the blosc library was found
|
|
# Blosc_INCLUDE_DIRS The directory containing the header file blosc/blosc.h
|
|
# Blosc_LIBRARIES The libraries needed to use the blosc library
|
|
#
|
|
# To specify an additional directory to search, set Blosc_ROOT.
|
|
#
|
|
# Author: Siddhartha Chaudhuri, 2009
|
|
#
|
|
|
|
# Look for the header, first in the user-specified location and then in the system locations
|
|
SET(Blosc_INCLUDE_DOC "The directory containing the header file blosc.h")
|
|
FIND_PATH(Blosc_INCLUDE_DIRS NAMES blosc.h blosc/blosc.h PATHS ${Blosc_ROOT} ${Blosc_ROOT}/include DOC ${Blosc_INCLUDE_DOC} NO_DEFAULT_PATH)
|
|
IF(NOT Blosc_INCLUDE_DIRS) # now look in system locations
|
|
FIND_PATH(Blosc_INCLUDE_DIRS NAMES blosc.h blosc/blosc.h DOC ${Blosc_INCLUDE_DOC})
|
|
ENDIF(NOT Blosc_INCLUDE_DIRS)
|
|
|
|
SET(Blosc_FOUND FALSE)
|
|
|
|
IF(Blosc_INCLUDE_DIRS)
|
|
SET(Blosc_LIBRARY_DIRS ${Blosc_INCLUDE_DIRS})
|
|
|
|
IF("${Blosc_LIBRARY_DIRS}" MATCHES "/include$")
|
|
# Strip off the trailing "/include" in the path.
|
|
GET_FILENAME_COMPONENT(Blosc_LIBRARY_DIRS ${Blosc_LIBRARY_DIRS} PATH)
|
|
ENDIF("${Blosc_LIBRARY_DIRS}" MATCHES "/include$")
|
|
|
|
IF(EXISTS "${Blosc_LIBRARY_DIRS}/lib")
|
|
SET(Blosc_LIBRARY_DIRS ${Blosc_LIBRARY_DIRS}/lib)
|
|
ENDIF(EXISTS "${Blosc_LIBRARY_DIRS}/lib")
|
|
|
|
# Find Blosc libraries
|
|
FIND_LIBRARY(Blosc_DEBUG_LIBRARY NAMES bloscd blosc_d libbloscd libblosc_d libblosc
|
|
PATH_SUFFIXES Debug ${CMAKE_LIBRARY_ARCHITECTURE} ${CMAKE_LIBRARY_ARCHITECTURE}/Debug
|
|
PATHS ${Blosc_LIBRARY_DIRS} NO_DEFAULT_PATH)
|
|
FIND_LIBRARY(Blosc_RELEASE_LIBRARY NAMES blosc libblosc
|
|
PATH_SUFFIXES Release ${CMAKE_LIBRARY_ARCHITECTURE} ${CMAKE_LIBRARY_ARCHITECTURE}/Release
|
|
PATHS ${Blosc_LIBRARY_DIRS} NO_DEFAULT_PATH)
|
|
|
|
SET(Blosc_LIBRARIES )
|
|
IF(Blosc_DEBUG_LIBRARY AND Blosc_RELEASE_LIBRARY)
|
|
SET(Blosc_LIBRARIES debug ${Blosc_DEBUG_LIBRARY} optimized ${Blosc_RELEASE_LIBRARY})
|
|
ELSEIF(Blosc_DEBUG_LIBRARY)
|
|
SET(Blosc_LIBRARIES ${Blosc_DEBUG_LIBRARY})
|
|
ELSEIF(Blosc_RELEASE_LIBRARY)
|
|
SET(Blosc_LIBRARIES ${Blosc_RELEASE_LIBRARY})
|
|
ENDIF(Blosc_DEBUG_LIBRARY AND Blosc_RELEASE_LIBRARY)
|
|
|
|
IF(Blosc_LIBRARIES)
|
|
SET(Blosc_FOUND TRUE)
|
|
ENDIF(Blosc_LIBRARIES)
|
|
ENDIF(Blosc_INCLUDE_DIRS)
|
|
|
|
IF(Blosc_FOUND)
|
|
# IF(NOT Blosc_FIND_QUIETLY)
|
|
MESSAGE(STATUS "Found Blosc: headers at ${Blosc_INCLUDE_DIRS}, libraries at ${Blosc_LIBRARY_DIRS}")
|
|
MESSAGE(STATUS " library is ${Blosc_LIBRARIES}")
|
|
# ENDIF(NOT Blosc_FIND_QUIETLY)
|
|
ELSE(Blosc_FOUND)
|
|
IF(Blosc_FIND_REQUIRED)
|
|
MESSAGE(FATAL_ERROR "Blosc library not found")
|
|
ENDIF(Blosc_FIND_REQUIRED)
|
|
ENDIF(Blosc_FOUND)
|