From 376f6b83149f90d24f78de3d461a2db459763732 Mon Sep 17 00:00:00 2001 From: Kyle Shores Date: Mon, 18 Mar 2024 15:36:39 -0500 Subject: [PATCH] Replace ENABLE_HDF4 with NETCDF_ENABLE_HDF4 --- .github/workflows/run_tests_osx.yml | 10 +++++----- CMakeLists.txt | 10 +++++----- RELEASE_NOTES.md | 2 +- cmake/dependencies.cmake | 6 +++--- conda.recipe/bld.bat | 2 +- 5 files changed, 15 insertions(+), 15 deletions(-) diff --git a/.github/workflows/run_tests_osx.yml b/.github/workflows/run_tests_osx.yml index a0a3f3aeb..6cbcca700 100644 --- a/.github/workflows/run_tests_osx.yml +++ b/.github/workflows/run_tests_osx.yml @@ -72,11 +72,11 @@ jobs: - run: echo "LDFLAGS=-L${HOME}/environments/${{ matrix.hdf5 }}/lib" >> $GITHUB_ENV - run: echo "LD_LIBRARY_PATH=${HOME}/environments/${{ matrix.hdf5 }}/lib" >> $GITHUB_ENV - run: | - echo "ENABLE_HDF4=--disable-hdf4" >> $GITHUB_ENV + echo "NETCDF_ENABLE_HDF4=--disable-hdf4" >> $GITHUB_ENV echo "ENABLE_HDF5=--disable-hdf5" >> $GITHUB_ENV if: matrix.use_nc4 == 'nc3' - run: | - echo "ENABLE_HDF4=--enable-hdf4" >> $GITHUB_ENV + echo "NETCDF_ENABLE_HDF4=--enable-hdf4" >> $GITHUB_ENV echo "ENABLE_HDF5=--enable-hdf5" >> $GITHUB_ENV if: matrix.use_nc4 == 'nc4' - run: echo "NETCDF_ENABLE_DAP=--disable-dap" >> $GITHUB_ENV @@ -145,7 +145,7 @@ jobs: # - name: Make Distcheck # shell: bash -l {0} - # run: CFLAGS=${CFLAGS} LDFLAGS=${LDFLAGS} LD_LIBRARY_PATH=${LD_LIBRARY_PATH} DISTCHECK_CONFIGURE_FLAGS="${ENABLE_HDF4} ${ENABLE_HDF5} ${NETCDF_ENABLE_DAP} ${ENABLE_NCZARR}" make distcheck + # run: CFLAGS=${CFLAGS} LDFLAGS=${LDFLAGS} LD_LIBRARY_PATH=${LD_LIBRARY_PATH} DISTCHECK_CONFIGURE_FLAGS="${NETCDF_ENABLE_HDF4} ${ENABLE_HDF5} ${NETCDF_ENABLE_DAP} ${ENABLE_NCZARR}" make distcheck # if: ${{ success() }} #- name: Start SSH Debug @@ -177,11 +177,11 @@ jobs: - run: echo "CMAKE_PREFIX_PATH=${HOME}/environments/${{ matrix.hdf5 }}/" >> $GITHUB_ENV - run: echo "LD_LIBRARY_PATH=${HOME}/environments/${{ matrix.hdf5 }}/lib" >> $GITHUB_ENV - run: | - echo "ENABLE_HDF4=OFF" >> $GITHUB_ENV + echo "NETCDF_ENABLE_HDF4=OFF" >> $GITHUB_ENV echo "ENABLE_HDF5=OFF" >> $GITHUB_ENV if: matrix.use_nc4 == 'nc3' - run: | - echo "ENABLE_HDF4=ON" >> $GITHUB_ENV + echo "NETCDF_ENABLE_HDF4=ON" >> $GITHUB_ENV echo "ENABLE_HDF5=ON" >> $GITHUB_ENV if: matrix.use_nc4 == 'nc4' - run: echo "NETCDF_ENABLE_DAP=OFF" >> $GITHUB_ENV diff --git a/CMakeLists.txt b/CMakeLists.txt index 2931536a4..7b16f04d9 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -440,7 +440,7 @@ option(ENABLE_HDF5 "Use HDF5." ON) if(NOT ENABLE_HDF5 OR NOT ENABLE_NETCDF4 OR NOT ENABLE_NETCDF_4) set(ENABLE_HDF5 OFF CACHE BOOL "Use HDF5" FORCE) endif() -option(ENABLE_HDF4 "Build netCDF-4 with HDF4 read capability(HDF4, HDF5 and Zlib required)." OFF) +option(NETCDF_ENABLE_HDF4 "Build netCDF-4 with HDF4 read capability(HDF4, HDF5 and Zlib required)." OFF) option(NETCDF_ENABLE_DAP "Enable DAP2 and DAP4 Client." ON) option(ENABLE_NCZARR "Enable NCZarr Client." ON) option(ENABLE_PNETCDF "Build with parallel I/O for CDF-1, 2, and 5 files using PnetCDF." OFF) @@ -449,7 +449,7 @@ option(NETCDF_ENABLE_CDF5 "Enable CDF5 support" ON) # Netcdf-4 support (i.e. libsrc4) is required by more than just HDF5 (e.g. NCZarr) # So depending on what above formats are enabled, enable netcdf-4 -if(ENABLE_HDF5 OR ENABLE_HDF4 OR ENABLE_NCZARR) +if(ENABLE_HDF5 OR NETCDF_ENABLE_HDF4 OR ENABLE_NCZARR) set(ENABLE_NETCDF_4 ON CACHE BOOL "Enable netCDF-4 API" FORCE) set(ENABLE_NETCDF4 ON CACHE BOOL "Enable netCDF4 Alias" FORCE) endif() @@ -482,8 +482,8 @@ if(ENABLE_NETCDF_4) else() set(USE_HDF4_FILE_TESTS OFF) set(USE_HDF4 OFF) - set(ENABLE_HDF4_FILE_TESTS OFF) - set(ENABLE_HDF4 OFF) + set(NETCDF_ENABLE_HDF4_FILE_TESTS OFF) + set(NETCDF_ENABLE_HDF4 OFF) endif() # Option Logging, only valid for netcdf4. @@ -1622,7 +1622,7 @@ is_enabled(BUILD_SHARED_LIBS enable_shared) is_enabled(ENABLE_V2_API HAS_NC2) is_enabled(ENABLE_NETCDF_4 HAS_NC4) -is_enabled(ENABLE_HDF4 HAS_HDF4) +is_enabled(NETCDF_ENABLE_HDF4 HAS_HDF4) is_enabled(USE_HDF5 HAS_HDF5) is_enabled(OFF HAS_BENCHMARKS) is_enabled(STATUS_PNETCDF HAS_PNETCDF) diff --git a/RELEASE_NOTES.md b/RELEASE_NOTES.md index 5985b90d2..52f62d56a 100644 --- a/RELEASE_NOTES.md +++ b/RELEASE_NOTES.md @@ -826,7 +826,7 @@ This is a bug-fix-only release for version 4.3.1. [NCF-177]:https://bugtracking.unidata.ucar.edu/browse/NCF-177 -* When compiling with `hdf4` support, both autotools and cmake-based builds now properly look for the `libjpeg` dependency and will link against it when found (or complain if it's not). Also added `ENABLE_HDF4_FILE_TESTS` option to CMake-based builds. +* When compiling with `hdf4` support, both autotools and cmake-based builds now properly look for the `libjpeg` dependency and will link against it when found (or complain if it's not). Also added `NETCDF_ENABLE_HDF4_FILE_TESTS` option to CMake-based builds. * Fixed bug in ncgen; it was not properly filling empty string constants ("") to be the proper length. [NCF-279] diff --git a/cmake/dependencies.cmake b/cmake/dependencies.cmake index 2ca1da716..ae025461f 100644 --- a/cmake/dependencies.cmake +++ b/cmake/dependencies.cmake @@ -14,7 +14,7 @@ find_package(MakeDist) ################################ # HDF4 ################################ -if(ENABLE_HDF4) +if(NETCDF_ENABLE_HDF4) set(USE_HDF4 ON ) # Check for include files, libraries. @@ -69,8 +69,8 @@ if(ENABLE_HDF4) message(STATUS "Found JPEG libraries: ${JPEG_LIB}") # Option to enable HDF4 file tests. - option(ENABLE_HDF4_FILE_TESTS "Run HDF4 file tests. This fetches sample HDF4 files from the Unidata ftp site to test with (requires curl)." ON) - if(ENABLE_HDF4_FILE_TESTS) + option(NETCDF_ENABLE_HDF4_FILE_TESTS "Run HDF4 file tests. This fetches sample HDF4 files from the Unidata ftp site to test with (requires curl)." ON) + if(NETCDF_ENABLE_HDF4_FILE_TESTS) find_program(PROG_CURL NAMES curl) if(PROG_CURL) set(USE_HDF4_FILE_TESTS ON ) diff --git a/conda.recipe/bld.bat b/conda.recipe/bld.bat index 848cf95d8..c791c7257 100644 --- a/conda.recipe/bld.bat +++ b/conda.recipe/bld.bat @@ -7,7 +7,7 @@ cmake -G "Visual Studio 15 Win64" ^ -D CMAKE_INSTALL_PREFIX=%LIBRARY_PREFIX% ^ -D BUILD_SHARED_LIBS=ON ^ -D ENABLE_TESTS=ON ^ - -D ENABLE_HDF4=ON ^ + -D NETCDF_ENABLE_HDF4=ON ^ -D CMAKE_PREFIX_PATH=%LIBRARY_PREFIX% ^ -D ZLIB_LIBRARY=%LIBRARY_LIB%\zlib.lib ^ -D ZLIB_INCLUDE_DIR=%LIBRARY_INC% ^