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

Improve filter installation process to avoid use of an extra shell script #2348

Merged
merged 23 commits into from
May 31, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
0dd0769
Merge remote-tracking branch 'Unidata/main'
DennisHeimbigner May 13, 2022
7b09290
Improve filter installation process to avoid use of an extra shell sc…
DennisHeimbigner May 14, 2022
5e5b1b5
Update release notes
DennisHeimbigner May 14, 2022
342c202
swith
DennisHeimbigner May 16, 2022
29717c8
Merge remote-tracking branch 'Unidata/main'
DennisHeimbigner May 17, 2022
e05f5c3
Merge master
DennisHeimbigner May 17, 2022
9925b20
Merge remote-tracking branch 'Unidata/main'
DennisHeimbigner May 18, 2022
3ea5d3b
Merge remote-tracking branch 'Unidata/main'
DennisHeimbigner May 19, 2022
9e18d79
Merge branch 'master' into install.dmh
DennisHeimbigner May 20, 2022
6ae3289
I made a major update to this PR with the following changes:
DennisHeimbigner May 20, 2022
487df99
debug
DennisHeimbigner May 20, 2022
8037b45
typo
DennisHeimbigner May 20, 2022
aa7d952
Update documentation
DennisHeimbigner May 20, 2022
aaa7be6
Update docs again
DennisHeimbigner May 22, 2022
7bf06df
rebuild
DennisHeimbigner May 22, 2022
41de756
Merge remote-tracking branch 'Unidata/main'
DennisHeimbigner May 24, 2022
d8959f1
Merge branch 'main' into install.dmh
WardF May 24, 2022
d16a894
conflicts
DennisHeimbigner May 24, 2022
cad946c
merged
DennisHeimbigner May 25, 2022
d7e57d2
Update to default --with-plugin-dir to yes
DennisHeimbigner May 25, 2022
8424711
Merge remote-tracking branch 'Unidata/main'
DennisHeimbigner May 27, 2022
89f7b64
Merge branch 'master' into install.dmh
DennisHeimbigner May 27, 2022
bbe0b21
Fix internal bz2 problems
DennisHeimbigner May 27, 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
73 changes: 45 additions & 28 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,12 @@ SET(NC_VERSION_NOTE "-development")
SET(netCDF_VERSION ${NC_VERSION_MAJOR}.${NC_VERSION_MINOR}.${NC_VERSION_PATCH}${NC_VERSION_NOTE})
SET(VERSION ${netCDF_VERSION})
SET(NC_VERSION ${netCDF_VERSION})
SET(netCDF_LIB_VERSION 19)
SET(netCDF_SO_VERSION 19)
SET(PACKAGE_VERSION ${VERSION})

# These values should match those in configure.ac
SET(netCDF_LIB_VERSION 19})
SET(netCDF_SO_VERSION 19)

# Version of the dispatch table. This must match the value in
# configure.ac.
SET(NC_DISPATCH_VERSION 5)
Expand Down Expand Up @@ -1116,21 +1118,46 @@ ELSE()
set(STD_FILTERS "${STD_FILTERS} bz2")
ENDIF()

# If user wants, then install selected plugins (default on)
SET(PLUGIN_INSTALL_DIR "YES" CACHE STRING "Whether and where we should install plugins; defaults to yes")
SET(ENABLE_PLUGIN_INSTALL YES)
IF(DEFINED PLUGIN_INSTALL_DIR) #OR DEFINED CACHE{PLUGIN_INSTALL_DIR}
STRING(TOLOWER "${PLUGIN_INSTALL_DIR}" LCPID)
IF(LCPID STREQUAL "no")
SET(ENABLE_PLUGIN_INSTALL NO)
ELSE()
SET(ENABLE_PLUGIN_INSTALL YES)
ENDIF()
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.")
IF(ENABLE_PLUGIN_INSTALL AND PLUGIN_INSTALL_DIR STREQUAL "YES")
# Default to last dir (lowest search priority) in HDF5_PLUGIN_PATH
IF(DEFINED ENV{HDF5_PLUGIN_PATH})
SET(PLUGIN_PATH "$ENV{HDF5_PLUGIN_PATH}")
ELSE()
IF(ISMSVC OR ISMINGW)
SET(PLUGIN_PATH "$ENV{ALLUSERSPROFILE}\\hdf5\\lib\\plugin")
ELSE()
SET(PLUGIN_PATH "/usr/local/hdf5/lib/plugin")
ENDIF()
ENDIF()
ENDIF()

IF(ENABLE_PLUGIN_INSTALL)
# Use the lowest priority dir in the path
IF(NOT ISMSVC AND NOT ISMINGW)
STRING(REPLACE ":" ";" PATH_LIST ${PLUGIN_PATH})
ELSE()
SET(PLUGIN_INSTALL_DIR_SETTING "${PLUGIN_INSTALL_DIR}")
SET(ENABLE_PLUGIN_INSTALL ON)
SET(PATH_LIST ${PLUGIN_PATH})
ENDIF()
ELSE()

# Get last element
LIST(GET PATH_LIST -1 PLUGIN_INSTALL_DIR)
MESSAGE("Defaulting to -DPLUGIN_INSTALL_DIR=${PLUGIN_INSTALL_DIR}")
SET(PLUGIN_INSTALL_DIR_SETTING "${PLUGIN_INSTALL_DIR}")
ELSE() # No option specified
UNSET(PLUGIN_INSTALL_DIR)
UNSET(PLUGIN_INSTALL_DIR CACHE)
SET(PLUGIN_INSTALL_DIR_SETTING "N.A.")
ENDIF()

Expand Down Expand Up @@ -1862,10 +1889,10 @@ ENDIF(ENABLE_MMAP)
#CHECK_FUNCTION_EXISTS(alloca HAVE_ALLOCA)

# Used in the `configure_file` calls below
SET(ISCMAKE "1")
SET(ISCMAKE "yes")
IF(MSVC)
SET(ISMSVC ON CACHE BOOL "" FORCE)
SET(REGEDIT ON CACHE BOOL "" FORCE)
SET(ISMSVC yes CACHE BOOL "" FORCE)
SET(REGEDIT yes CACHE BOOL "" FORCE)
# Get windows major version and build number
EXECUTE_PROCESS(COMMAND "systeminfo" OUTPUT_VARIABLE WININFO)
IF(WININFO STREQUAL "")
Expand Down Expand Up @@ -2509,25 +2536,15 @@ configure_file(
SET(EXTRA_DIST ${EXTRA_DIST} ${CMAKE_CURRENT_SOURCE_DIR}/test_common.in)
SET(TOPSRCDIR "${CMAKE_CURRENT_SOURCE_DIR}")
SET(TOPBUILDDIR "${CMAKE_CURRENT_BINARY_DIR}")
SET(ISMSVC "${MSVC}")
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/test_common.in ${CMAKE_CURRENT_BINARY_DIR}/test_common.sh @ONLY NEWLINE_STYLE LF)

#####
# Build nc_test4/findplugin.sh
# Build and copy nc_test4/findplugin.sh to various places
#####
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/nc_test4/findplugin.in ${CMAKE_CURRENT_BINARY_DIR}/nc_test4/findplugin.sh @ONLY NEWLINE_STYLE LF)

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()

IF(ENABLE_TESTS)
#####
Expand Down
4 changes: 2 additions & 2 deletions RELEASE_NOTES.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@ This file contains a high-level description of this package's evolution. Release

## 4.8.2 - TBD


* [Enhancement] Improve filter installation process to avoid use of an extra shell script. See [Github #2348](https://github.com/Unidata/netcdf-c/pull/2348).
* [Bug Fix] Get "make distcheck" to work See [Github #/2343](https://github.com/Unidata/netcdf-c/pull/2343).
* [Enhancement] Allow the read/write of JSON-valued Zarr attributes to allow
for domain specific info such as used by GDAL/Zarr. See [Github #????](https://github.com/Unidata/netcdf-c/pull/????).
for domain specific info such as used by GDAL/Zarr. See [Github #2278](https://github.com/Unidata/netcdf-c/pull/2278).
* [Enhancement] Turn on the XArray convention for NCZarr files by default. WARNING, this means that the mode should explicitly specify nczarr" or "zarr" even if "xarray" or "noxarray" is specified. See [Github #2257](https://github.com/Unidata/netcdf-c/pull/2257).
* [Enhancement] Update the documentation to match the current filter capabilities See [Github #2249](https://github.com/Unidata/netcdf-c/pull/2249).
* [Enhancement] Support installation of pre-built standard filters into user-specified location. See [Github #2318](https://github.com/Unidata/netcdf-c/pull/2318).
Expand Down
44 changes: 37 additions & 7 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,13 @@ AC_SUBST([NC_VERSION_MINOR]) NC_VERSION_MINOR=8
AC_SUBST([NC_VERSION_PATCH]) NC_VERSION_PATCH=2
AC_SUBST([NC_VERSION_NOTE]) NC_VERSION_NOTE="-development"

##
# These linker flags specify libtool version info.
# See http://www.gnu.org/software/libtool/manual/libtool.html#Libtool-versioning
# for information regarding incrementing `-version-info`.
# These values should match those in CMakeLists.txt
AC_SUBST([netCDF_SO_VERSION]) netCDF_SO_VERSION=19:1:0

#####
# Set some variables used to generate a libnetcdf.settings file,
# pattered after the files generated by libhdf4, libhdf5.
Expand Down Expand Up @@ -679,6 +686,7 @@ AC_MSG_RESULT([${have_bz2}])

if test "x$have_bz2" = "xno" ; then
have_local_bz2=yes
AC_MSG_NOTICE([Defaulting to internal libbz2])
else
have_local_bz2=no
fi
Expand Down Expand Up @@ -1884,15 +1892,38 @@ AC_SUBST(STD_FILTERS,[$std_filters])

# If user wants, then install selected standard filters
AC_MSG_CHECKING([whether and where we should install plugins])
AC_ARG_WITH([plugin-dir], [AS_HELP_STRING([--with-plugin-dir=<absolute directory>],
[Install selected standard filters in specified directory])])
AC_ARG_WITH([plugin-dir], [AS_HELP_STRING([--with-plugin-dir=<absolute directory>|no|--without-plugin-dir],
[Install selected standard filters in specified or default directory])],
[],[with_plugin_dir=yes])
AC_MSG_RESULT([$with_plugin_dir])
if test "x$with_plugin_dir" = x ; then
AC_MSG_WARN([No plugin directory value specified; option ignored.])
with_plugin_dir=
if test "x$with_plugin_dir" = xno ; then # option missing|disabled
with_plugin_dir=no
with_plugin_dir_setting="N.A."
enable_plugin_dir=no
else
elif test "x$with_plugin_dir" = xyes ; then # --with-plugin-dir, no argument
# Default to last dir (lowest search priority) in HDF5_PLUGIN_PATH
PLUGIN_PATH="$HDF5_PLUGIN_PATH"
if test "x${PLUGIN_PATH}" = x ; then
if test "x$ISMSVC" = xyes || test "x$ISMINGW" = xyes; then
PLUGIN_PATH="${ALLUSERSPROFILE}\\hdfd5\\lib\\plugin"
else
PLUGIN_PATH="/usr/local/hdf5/lib/plugin"
fi
fi
# Use the lowest priority dir in the path
if test "x$ISMSVC" = xyes || test "x$ISMINGW" = xyes; then
PLUGIN_DIR=`echo "$PLUGIN_PATH" | tr ';' ' '`
else
PLUGIN_DIR=`echo "$PLUGIN_PATH" | tr ':' ' '`
fi
for pp in ${PLUGIN_DIR} ; do last="$pp"; done
PLUGIN_DIR="$last"
with_plugin_dir_setting="$PLUGIN_DIR"
# canonical form is all forward slashes
with_plugin_dir=`echo "$PLUGIN_DIR" | tr '\\\\' '/'`
enable_plugin_dir=yes
AC_MSG_NOTICE([Defaulting to --with-plugin-dir=$with_plugin_dir])
else # --with-plugin-dir=<dir|path>
with_plugin_dir_setting="$with_plugin_dir"
enable_plugin_dir=yes
fi
Expand Down Expand Up @@ -1991,7 +2022,6 @@ AC_CONFIG_FILES(test_common.sh:test_common.in)
AC_CONFIG_FILES(nc_test4/findplugin.sh:nc_test4/findplugin.in)
AC_CONFIG_FILES(nczarr_test/findplugin.sh:nc_test4/findplugin.in)
AC_CONFIG_FILES(plugins/findplugin.sh:nc_test4/findplugin.in)
AC_CONFIG_FILES(plugins/stdinstall.sh:plugins/stdinstall.in)
AC_CONFIG_FILES(examples/C/findplugin.sh:nc_test4/findplugin.in)
AC_CONFIG_FILES(ncdap_test/findtestserver.c:ncdap_test/findtestserver.c.in)
AC_CONFIG_FILES([nc_test/run_pnetcdf_tests.sh:nc_test/run_pnetcdf_tests.sh.in],[chmod ugo+x nc_test/run_pnetcdf_tests.sh])
Expand Down
Loading