Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support installation of standard pre-built filters into user-specified location #2318

Merged
merged 74 commits into from
May 4, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
74 commits
Select commit Hold shift + click to select a range
33578d1
ckp
DennisHeimbigner Apr 20, 2022
d954243
missing file'
DennisHeimbigner Apr 20, 2022
095daf4
update file permission
DennisHeimbigner Apr 20, 2022
aee2324
cmake
DennisHeimbigner Apr 21, 2022
a9216fe
ckp
DennisHeimbigner Apr 21, 2022
4ed02af
installtest
DennisHeimbigner Apr 21, 2022
445e2e5
switch
DennisHeimbigner Apr 22, 2022
66ab54a
ckp
DennisHeimbigner Apr 22, 2022
f601458
ckp
DennisHeimbigner Apr 22, 2022
3b27823
ckp
DennisHeimbigner Apr 23, 2022
6516da7
restore
DennisHeimbigner Apr 23, 2022
5ab810f
switch
DennisHeimbigner Apr 23, 2022
3c6c33e
ckp
DennisHeimbigner Apr 24, 2022
47beda0
stdf
DennisHeimbigner Apr 24, 2022
8be01d4
endif
DennisHeimbigner Apr 24, 2022
d54e977
missing
DennisHeimbigner Apr 24, 2022
8273b03
Merge branch 'filterinstall.tmp' of https://github.com/DennisHeimbign…
DennisHeimbigner Apr 24, 2022
e10f627
update file permission
DennisHeimbigner Apr 24, 2022
ece05d4
test sz
DennisHeimbigner Apr 24, 2022
999da6d
debug
DennisHeimbigner Apr 24, 2022
946b818
debug2
DennisHeimbigner Apr 24, 2022
69b39d5
debug3
DennisHeimbigner Apr 24, 2022
918e92c
debug4
DennisHeimbigner Apr 24, 2022
07b9a15
debug5
DennisHeimbigner Apr 24, 2022
5f8f8e5
debug7
DennisHeimbigner Apr 24, 2022
a339b1e
nobzip2
DennisHeimbigner Apr 24, 2022
1a38779
debug8
DennisHeimbigner Apr 24, 2022
2a5a140
debug10
DennisHeimbigner Apr 24, 2022
2a8c5fe
examp1
DennisHeimbigner Apr 24, 2022
de97222
debug20
DennisHeimbigner Apr 24, 2022
cb18dd4
debug21
DennisHeimbigner Apr 24, 2022
e269403
setx
DennisHeimbigner Apr 25, 2022
26e007d
debug30
DennisHeimbigner Apr 25, 2022
6d39373
exam5
DennisHeimbigner Apr 25, 2022
b641b2d
debug1
DennisHeimbigner Apr 25, 2022
d911a7c
debug2
DennisHeimbigner Apr 25, 2022
4792919
debug5
DennisHeimbigner Apr 25, 2022
7d5b640
libdir
DennisHeimbigner Apr 25, 2022
5138b28
final?
DennisHeimbigner Apr 25, 2022
2fa92bc
testing
DennisHeimbigner Apr 25, 2022
18ac9b5
dap1
DennisHeimbigner Apr 25, 2022
bdcf4a8
testenv
DennisHeimbigner Apr 25, 2022
ad62ed2
ckp
DennisHeimbigner Apr 26, 2022
94db4d7
ckp
DennisHeimbigner Apr 29, 2022
1ec459e
Merge branch 'master' of https://github.com/DennisHeimbigner/netcdf-c
DennisHeimbigner Apr 29, 2022
2856ee7
restore
DennisHeimbigner Apr 29, 2022
64c4caa
merged
DennisHeimbigner Apr 29, 2022
bf2a74b
final
DennisHeimbigner Apr 29, 2022
5a27857
push
DennisHeimbigner Apr 29, 2022
126b3f9
Support installation of filters into user-specified location
DennisHeimbigner Apr 29, 2022
a8aa6e3
Remove debug
DennisHeimbigner Apr 29, 2022
e667afa
Update release notes
DennisHeimbigner Apr 29, 2022
496c24c
bug
DennisHeimbigner Apr 29, 2022
6e730fc
bug2
DennisHeimbigner Apr 29, 2022
1470a7d
update docs
DennisHeimbigner Apr 29, 2022
962a4ba
bug3
DennisHeimbigner Apr 30, 2022
cbf60d1
bug4
DennisHeimbigner Apr 30, 2022
d887542
bug5
DennisHeimbigner Apr 30, 2022
d4b7de8
bug6
DennisHeimbigner Apr 30, 2022
5f5fe0e
bug10
DennisHeimbigner Apr 30, 2022
9ead732
bug8
DennisHeimbigner Apr 30, 2022
92e7263
debug1
DennisHeimbigner Apr 30, 2022
b088a40
debug2
DennisHeimbigner Apr 30, 2022
04eb6e9
debug10
DennisHeimbigner Apr 30, 2022
5489fdb
debug12
DennisHeimbigner Apr 30, 2022
70aff93
szip1
DennisHeimbigner May 1, 2022
f897b45
Fix szip handling
DennisHeimbigner May 1, 2022
5e5ab58
recap
DennisHeimbigner May 1, 2022
d34a222
Turn off debug
DennisHeimbigner May 1, 2022
26bc996
final
DennisHeimbigner May 1, 2022
2cd7f49
final
DennisHeimbigner May 1, 2022
a57ccb4
ckp
DennisHeimbigner May 1, 2022
82bc17c
Merge branch 'filterinstall.tmp' into filterinstall.dmh
DennisHeimbigner May 1, 2022
909884f
cleanup
DennisHeimbigner May 1, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/run_tests_ubuntu.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

name: Run Ubuntu/Linux netCDF Tests

on: [ pull_request ]
on: [pull_request]

jobs:

Expand Down
79 changes: 38 additions & 41 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -623,26 +623,6 @@ ENDIF(ENABLE_STRICT_NULL_BYTE_HEADER_PADDING)
# 3. is nczarr enabled?
# We need separate flags for cases 1 and 2

# We need to determine if libsz is available both for HDF5 and NCZarr
# If user has specified the `SZIP_LIBRARY`, use it; otherwise try to find...
IF(NOT SZIP_LIBRARY)
FIND_LIBRARY(SZIP PATH NAMES szip sz sz2)
IF(SZIP)
SET(SZIP_LIBRARY ${SZIP})
ELSE()
UNSET(SZIP_LIBRARY)
UNSET(SZIP)
ENDIF()
ENDIF()

IF(SZIP_LIBRARY)
SET(SZIP_FOUND yes)
SET(HAVE_SZ yes)
ELSE()
SET(SZIP_FOUND no)
SET(HAVE_SZ no)
ENDIF()

##
# Option to Enable HDF5
#
Expand Down Expand Up @@ -905,15 +885,6 @@ IF(USE_HDF5)
int x = 1;}" USE_HDF5_SZIP)
IF(USE_HDF5_SZIP)
SET(HAVE_H5Z_SZIP yes)
# If user has specified the `SZIP_LIBRARY`, use it; otherwise try to find...
IF(SZIP_FOUND)
SET(CMAKE_REQUIRED_LIBRARIES ${SZIP_LIBRARY} ${CMAKE_REQUIRED_LIBRARIES})
MESSAGE(STATUS "HDF5 has szip.")
ELSE()
MESSAGE(FATAL_ERROR "HDF5 Requires SZIP, but cannot find libszip or libsz.")
ENDIF()
ELSE()
SET(HAVE_H5Z_SZIP no)
ENDIF()

####
Expand Down Expand Up @@ -1114,31 +1085,53 @@ string(TOLOWER "${filter}" downfilter)
IF(${filter}_FOUND)
INCLUDE_DIRECTORIES(${filter}_INCLUDE_DIRS})
SET(ENABLE_${upfilter} TRUE)
SET(STD_FILTERS "${STD_FILTERS},${downfilter}")
SET(HAVE_${upfilter} ON)
SET(STD_FILTERS "${STD_FILTERS} ${downfilter}")
MESSAGE(">>> Standard Filter: ${downfilter}")
ELSE()
SET(ENABLE_${upfilter} FALSE)
SET(HAVE_${upfilter} OFF)
ENDIF()
endmacro(set_std_filter)

# Locate some compressors
FIND_PACKAGE(Szip)
FIND_PACKAGE(Bz2)
FIND_PACKAGE(Blosc)
FIND_PACKAGE(Zstd)

IF(Zstd_FOUND)
SET(HAVE_ZSTD yes)
ELSE()
SET(HAVE_ZSTD no)
ENDIF()

# Accumulate standard filters
set(STD_FILTERS "deflate") # Always have deflate */
set_std_filter(SZIP)
set(STD_FILTERS "deflate") # Always have deflate*/
set_std_filter(Szip)
SET(HAVE_SZ ${Szip_FOUND})
set_std_filter(Blosc)
set_std_filter(Zstd)
set_std_filter(Bz2)
IF(NOT Bz2_FOUND)
set(STD_FILTERS "${STD_FILTERS},bzip2") # Always have bzip2 */
IF(Bz2_FOUND)
set_std_filter(Bz2)
ELSE()
# The reason we use a local version is to support a more comples test case
MESSAGE(WARNING "libbz2 not found using built-in version")
SET(HAVE_LOCAL_BZ2 ON)
SET(HAVE_BZ2 ON)
set(STD_FILTERS "${STD_FILTERS} bz2")
ENDIF()


# If user wants, then install selected plugins
SET(PLUGIN_INSTALL_DIR "" CACHE STRING "Whether and where we should install plugins")
SET(ENABLE_PLUGIN_INSTALL OFF)
if(DEFINED PLUGIN_INSTALL_DIR OR DEFINED CACHE{PLUGIN_INSTALL_DIR})
IF(PLUGIN_INSTALL_DIR STREQUAL "")
MESSAGE(WARNING "No plugin directory value specified; option ignored.")
UNSET(PLUGIN_INSTALL_DIR)
UNSET(PLUGIN_INSTALL_DIR CACHE)
SET(PLUGIN_INSTALL_DIR_SETTING "N.A.")
ELSE()
SET(PLUGIN_INSTALL_DIR_SETTING "${PLUGIN_INSTALL_DIR}")
SET(ENABLE_PLUGIN_INSTALL ON)
ENDIF()
ELSE()
SET(PLUGIN_INSTALL_DIR_SETTING "N.A.")
ENDIF()

# See if we have libzip
Expand Down Expand Up @@ -2528,6 +2521,10 @@ IF(ENABLE_NCZARR)
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/nc_test4/findplugin.in ${CMAKE_CURRENT_BINARY_DIR}/nczarr_test/findplugin.sh @ONLY NEWLINE_STYLE LF)
ENDIF()

IF(ENABLE_PLUGINS)
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/nc_test4/findplugin.in ${CMAKE_CURRENT_BINARY_DIR}/plugins/findplugin.sh @ONLY NEWLINE_STYLE LF)
ENDIF()

IF(ENABLE_EXAMPLES)
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/nc_test4/findplugin.in ${CMAKE_CURRENT_BINARY_DIR}/examples/C/findplugin.sh @ONLY NEWLINE_STYLE LF)
ENDIF()
Expand Down
1 change: 1 addition & 0 deletions RELEASE_NOTES.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ This file contains a high-level description of this package's evolution. Release

## 4.8.2 - TBD

* [Enhancement] Support installation of pre-built standard filters into user-specified location. See [Github #2318](https://github.com/Unidata/netcdf-c/pull/2318).
* [Enhancement] Improve filter support. More specifically (1) add nc_inq_filter_avail to check if a filter is available, (2) add the notion of standard filters, (3) cleanup szip support to fix interaction with NCZarr. See [Github #2245](https://github.com/Unidata/netcdf-c/pull/2245).
* [Enhancement] Switch to tinyxml2 as the default xml parser implementation. See [Github #2170](https://github.com/Unidata/netcdf-c/pull/2170).
* [Bug Fix] Require that the type of the variable in nc_def_var_filter is not variable length. See [Github #/2231](https://github.com/Unidata/netcdf-c/pull/2231).
Expand Down
64 changes: 64 additions & 0 deletions cmake/modules/FindBzip2.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
# Searches for an installation of the bzip2 library. On success, it sets the following variables:
#
# Bzip2_FOUND Set to true to indicate the bzip2 library was found
# Bzip2_INCLUDE_DIRS The directory containing the header file bzip2/bzip2.h
# Bzip2_LIBRARIES The libraries needed to use the bzip2 library
#
# To specify an additional directory to search, set Bzip2_ROOT.
#
# Author: Siddhartha Chaudhuri, 2009
#

# Look for the header, first in the user-specified location and then in the system locations
SET(Bzip2_INCLUDE_DOC "The directory containing the header file bzip2.h")
FIND_PATH(Bzip2_INCLUDE_DIRS NAMES bzip2.h bzip2/bzip2.h PATHS ${Bzip2_ROOT} ${Bzip2_ROOT}/include DOC ${Bzip2_INCLUDE_DOC} NO_DEFAULT_PATH)
IF(NOT Bzip2_INCLUDE_DIRS) # now look in system locations
FIND_PATH(Bzip2_INCLUDE_DIRS NAMES bzlib.h DOC ${Bzip2_INCLUDE_DOC})
ENDIF(NOT Bzip2_INCLUDE_DIRS)

SET(Bzip2_FOUND FALSE)

IF(Bzip2_INCLUDE_DIRS)
SET(Bzip2_LIBRARY_DIRS ${Bzip2_INCLUDE_DIRS})

IF("${Bzip2_LIBRARY_DIRS}" MATCHES "/include$")
# Strip off the trailing "/include" in the path.
GET_FILENAME_COMPONENT(Bzip2_LIBRARY_DIRS ${Bzip2_LIBRARY_DIRS} PATH)
ENDIF("${Bzip2_LIBRARY_DIRS}" MATCHES "/include$")

IF(EXISTS "${Bzip2_LIBRARY_DIRS}/lib")
SET(Bzip2_LIBRARY_DIRS ${Bzip2_LIBRARY_DIRS}/lib)
ENDIF(EXISTS "${Bzip2_LIBRARY_DIRS}/lib")

# Find Bzip2 libraries
FIND_LIBRARY(Bzip2_DEBUG_LIBRARY NAMES bzip2d bzip2_d libbzip2d libbzip2_d libbzip2
PATH_SUFFIXES Debug ${CMAKE_LIBRARY_ARCHITECTURE} ${CMAKE_LIBRARY_ARCHITECTURE}/Debug
PATHS ${Bzip2_LIBRARY_DIRS} NO_DEFAULT_PATH)
FIND_LIBRARY(Bzip2_RELEASE_LIBRARY NAMES bzip2 libbzip2
PATH_SUFFIXES Release ${CMAKE_LIBRARY_ARCHITECTURE} ${CMAKE_LIBRARY_ARCHITECTURE}/Release
PATHS ${Bzip2_LIBRARY_DIRS} NO_DEFAULT_PATH)

SET(Bzip2_LIBRARIES )
IF(Bzip2_DEBUG_LIBRARY AND Bzip2_RELEASE_LIBRARY)
SET(Bzip2_LIBRARIES debug ${Bzip2_DEBUG_LIBRARY} optimized ${Bzip2_RELEASE_LIBRARY})
ELSEIF(Bzip2_DEBUG_LIBRARY)
SET(Bzip2_LIBRARIES ${Bzip2_DEBUG_LIBRARY})
ELSEIF(Bzip2_RELEASE_LIBRARY)
SET(Bzip2_LIBRARIES ${Bzip2_RELEASE_LIBRARY})
ENDIF(Bzip2_DEBUG_LIBRARY AND Bzip2_RELEASE_LIBRARY)

IF(Bzip2_LIBRARIES)
SET(Bzip2_FOUND TRUE)
ENDIF(Bzip2_LIBRARIES)
ENDIF(Bzip2_INCLUDE_DIRS)

IF(Bzip2_FOUND)
# IF(NOT Bzip2_FIND_QUIETLY)
MESSAGE(STATUS "Found Bzip2: headers at ${Bzip2_INCLUDE_DIRS}, libraries at ${Bzip2_LIBRARY_DIRS}")
MESSAGE(STATUS " library is ${Bzip2_LIBRARIES}")
# ENDIF(NOT Bzip2_FIND_QUIETLY)
ELSE(Bzip2_FOUND)
IF(Bzip2_FIND_REQUIRED)
MESSAGE(FATAL_ERROR "Bzip2 library not found")
ENDIF(Bzip2_FIND_REQUIRED)
ENDIF(Bzip2_FOUND)
179 changes: 0 additions & 179 deletions cmake/modules/FindSZIP.cmake

This file was deleted.

Loading