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

CMake Error Build failure SET_TESTS_PROPERTIES Can not find test to add properties to: nc_test_run_mmap #2271

Closed
fkarg opened this issue Apr 4, 2022 · 2 comments · Fixed by #2438

Comments

@fkarg
Copy link

fkarg commented Apr 4, 2022

A minimal failing Dockerfile:

FROM python:3.9.12-alpine3.15
RUN apk add --no-cache \
    gcc libffi-dev musl-dev libgit2 tar wget alpine-sdk \
    cmake libgit2-dev py3-pygit2 gdal gdal-dev geos \
    hdf5-dev openblas-dev libgfortran lapack-dev build-base \
    netcdf zlib libcurl m4
RUN wget https://github.com/Unidata/netcdf-c/archive/refs/tags/v4.8.1.tar.gz -O netcdf-4.8.1.tar.gz && \
    tar xvzf netcdf-4.8.1.tar.gz && \
    cd netcdf-c-4.8.1/ && \
    cmake . && \
    make && make install

Build with docker build .. Failing in the cmake .-step due to:

CMake Error at nc_test/CMakeLists.txt:89 (SET_TESTS_PROPERTIES):
  SET_TESTS_PROPERTIES Can not find test to add properties to:
  nc_test_run_mmap

Full log: https://pastebin.com/76Xqa3Xn

@WardF
Copy link
Member

WardF commented Apr 4, 2022

Thank you, I'm taking a look at this now. I will mention that your script is doing an in-directory build, which can lead to other issues. I've made a find your Dockerfile file slightly, see below. It is not responsible for this issue, but could cause other issues once this one is solved.

FROM python:3.9.12-alpine3.15
RUN apk add --no-cache \
    gcc libffi-dev musl-dev libgit2 tar wget alpine-sdk \
    cmake libgit2-dev py3-pygit2 gdal gdal-dev geos \
    hdf5-dev openblas-dev libgfortran lapack-dev build-base \
    netcdf zlib libcurl m4
RUN wget https://github.com/Unidata/netcdf-c/archive/refs/tags/v4.8.1.tar.gz -O netcdf-4.8.1.tar.gz && \
    tar xvzf netcdf-4.8.1.tar.gz && \
    cd netcdf-c-4.8.1/ && mkdir build && cd build &&\
    cmake .. && \
    make && make install

@WardF WardF added this to the 4.9.0 milestone Apr 4, 2022
@WardF WardF self-assigned this Apr 4, 2022
@WardF
Copy link
Member

WardF commented Apr 4, 2022

Ok, I've discovered the issue. We will need to adjust the logic in the CMakeLists.txt file, to account for Systems that don't have bash available. What is happening here is a macro is failing and not creating the test because bash is not available in this Docker file, and then we are attempting to set a property on the nonexistent test.

I will correct this so that the failure is handled gracefully. In the meantime, try the following Dockerfile, where I have added two additional packages to be installed by the package manager. This fixed the issue for me.

FROM python:3.9.12-alpine3.15
RUN apk add --no-cache \
    gcc libffi-dev musl-dev libgit2 tar wget alpine-sdk \
    cmake libgit2-dev py3-pygit2 gdal gdal-dev geos \
    hdf5-dev openblas-dev libgfortran lapack-dev build-base \
    netcdf zlib libcurl m4 bash libexecinfo-dev
RUN wget https://github.com/Unidata/netcdf-c/archive/refs/tags/v4.8.1.tar.gz -O netcdf-4.8.1.tar.gz && \
    tar xvzf netcdf-4.8.1.tar.gz && \
    cd netcdf-c-4.8.1/ && mkdir build && cd build &&\
    cmake .. && \
    make && make install

@WardF WardF modified the milestones: 4.9.0, 4.9.1 Apr 4, 2022
@WardF WardF moved this to Todo in netCDF-C v4.9.1 Jun 28, 2022
@WardF WardF moved this from Todo to In Progress in netCDF-C v4.9.1 Jun 29, 2022
WardF added a commit to WardF/netcdf-c that referenced this issue Jun 29, 2022
Repository owner moved this from In Progress to Done in netCDF-C v4.9.1 Jun 29, 2022
clrpackages pushed a commit to clearlinux-pkgs/netcdf that referenced this issue Feb 9, 2023
DWesl (26):
      DEV: Add autools-generated files to .gitignore.
      CI: Add Cygwin CI run.
      CI, TST: Check that test plugins don't get installed with DESTDIR
      BLD: Get netCDF4 build working on Windows.
      DEV, TST: Move test plugins to check_LTLIBRARIES instead of tmp_LTLIBRARIES.
      BLD: Try fixing the export-symbols problem on MinGW
      CI, DBG: Upload MinGW test logs on failure.
      TST: Add code for MinGW to findplugin.sh.
      TST: Mark tst_filter.sh XFAIL on MinGW
      CI: Try to skip failing NCZarr Plugin tests on MinGW
      TST: Mark NCZarr plugins XFAIL on MinGW
      TST: tst_h_strbug and tst_h_refs pass on Cygwin now
      BLD: Use host platform instead of build platform for platform-specific checks.
      CI: Prep Cygwin CI run for adding CMake build.
      BLD: Get CMake build compiling on Cygwin.
      BUG: Robustify nulldup definition.
      TST: Mark nczarr s3 cleanup test XFAIL on Cygwin instead of skipping.
      CI: Disable CMake tests on Cygwin and MinGW.
      CI: Revert Windows CI run on push.
      BLD: Fix syntax in configure.ac.
      BLD: Avoid specifying -version-info and -avoid-version
      BLD: Specify -avoid-version on MinGW and Cygwin; -version-info otherwise
      STY: Move nulldup backup definition from cp_win32.c to ncconfigure.h
      FIX: ifndef requires no parentheses.
      BLD: Declare nulldup backup definition static not extern
      CI: Change autotools CI build to out-of-tree build.

Dan Ibanez (1):
      Rename variable to avoid function name conflict

Dennis Heimbigner (65):
      Fix nc_def_var_fletcher32 operation
      Update release notes
      Use env variable USERPROFILE instead of HOME for windows and mingw.
      Update release notes
      restart github
      Make public a limited API for programmatic access to internal .rc tables
      Update Release Notes
      Fix errors:
      Use env variable USERPROFILE instead of HOME for windows and mingw.
      Cleanup szip handling some more
      Update release notes
      fix RELEASENOTES
      undebug
      Minimal changes to RELEASENOTES to get a working patch
      force rebuild
      Fix way CMake handle -DPLUGIN_INSTALL_DIR
      Update Release notes
      debug1
      Ensure that netcdf_json.h does not interfere with ncjson.
      Update RELEASENOTES.md
      Fix bad cmake install location
      Fix some bugs in the blosc filter wrapper
      Update release notes
      Update blosc testing
      Provide a default enum const when fill value does not match any enum const.
      Update release notes
      debug1
      Fix support for reading arrays of HDF5 fixed size strings
      Windows specific blosc fixed
      debug1
      nodebug
      Add option to control accessing external servers
      Add support for Zarr string type to NCZarr
      Update release notes"
      update release notes
      Fix LGTM alert: too few args
      Update nczarr documentation
      update file permission
      Fix some problems with PR Unidata/netcdf-c#2492
      Update release notes
      Update Release Notes
      Fix missing files
      Catch Xarray dimension inconsistencies
      Fix some addtional errors in NCZarr
      Update release notes
      update file permission
      Cleanup built test sources in nczarr_test
      restore
      Move construction of VERSION file to end of the build
      Turn off extraneous debug output
      test
      test
      test2
      merged
      Fix race condition in ncdump (and other) tests.
      Update RELEASE notes
      test3
      Restore DAP4 functionality and testing
      test4
      ckp
      Suppress nczarr_test/tst_unknown filter test (and its nczarr_test equivalen)
      Update Release Notes
      retry
      Fix infinite loop in file inferencing
      Fix Memory Leak

Dženan Zukić (1):
      Fix AWS SDK linking errors

Edward Hartnett (37):
      checking doxygen version
      updated Doxyfile.in
      turned on WARN_AS_ERROR and added documentation build to CI
      fixed case of --enable-doxygen but doxygen not found
      installing doxygen in CI when needed
      installing doxygen in CI when needed
      installing doxygen in CI when needed
      installing doxygen in CI when needed
      installing doxygen in CI when needed
      change to trigger CI
      updated release notes
      change to rerun CI
      change to trigger CI
      change to trigger CI
      fixed RELEASE_NOTES.md
      fixed missing quote
      fixed missing quote
      changed backslash to and
      change to trigger CI
      change to trigger CI
      moved quantize error documentation
      fix and test quantize mode for NC_CLASSIC_MODEL
      documentation
      code and documentation cleanup
      code and documentation cleanup
      adding pre-processor constant NC_MAX_FILENAME to nc_tests.h
      more quantize testing
      more quantize testing
      more quantize testing
      more quantize testing
      more testing of quantize
      more testing of quantize
      more testing of quantize
      more testing of quantize
      more testing of quantize
      more testing of quantize
      more testing of quantize

Greg Sjaardema (2):
      Minor update to doxygen function documentation
      For loop initial declarations are only allowed in C99 mode

James Edwards (1):
      make UDF0 not require NC_NETCDF4

Jim Edwards (3):
      add udf2 fix magic
      remove whitespace changes
      fix syntax error

Magnus Ulimoen (3):
      Prevent cmake writing to source dir
      fix musl build
      Use int64_t instead of __int64

Stephen Herbener (3):
      Added an ncdump -t calendars test using variable length string
      Modifications to enable the use of variable length string attributes for both
      Moved the new ncdump_tst_calendars_nc4 test to the "USE_HDF5" section.

Ward Fisher (103):
      Add manual GitHub actions triggers for the tests.
      Added a check for xml2-config as a test for the libxml2-dev header files.
      Add libxml2 install to mingw GitHub actions.
      Generate nc_test/run_pnetcdf_tests.sh when using cmake, in support of Unidata/netcdf-c#2435
      Fixing cmake-based run_pnetcdf_tests.sh
      Building test programs invoked by run_pnetcdf_tests.sh
      Fix cache check.
      Run one-off tests first.
      Fix a typo.
      Fix a typo.
      Make pnetcdf tests run in serial fashion when using cmake
      Work in a one-line change as originally suggested in Unidata/netcdf-c#2426.
      Updated CMakeLists to avoid the error described in Unidata/netcdf-c#2271
      configure.ac logic for disabling quantize.
      Update release notes.
      Guard _declspec(dllexport) in support of Unidata/netcdf-c#2446
      Changed attribute case in documentation in support of Unidata/netcdf-c#2481
      Address jump-misses-init issue.
      Remove stray conflict markers that made their way into the branch.
      Adding all-error-codes.md back in to distribution documentation.
      Remove obsolete tags from Doxyfile.
      Updating doxygen files.
      Doxygen update, reorganizing.
      Update hdf5 version in github actions.
      Added an additional check for zstd.h in configure.ac
      Clean up (on linux) an issue with uintptr_t
      Add a check for stdint.h in order to fix a weird issue where libzstd-dev, when present, was masking a missing data type declaration.
      Adding additional flags to nc-config to indicate presence of newer functionality, and plugin directory location.
      Added plugin directory to nc-config
      Add various newer options to nc-config
      Updated release notes.
      Updated release notes.
      Adding NC_HAS_BLOSC and NC_HAS_BZ2 to netcdf_meta.h in support of Unidata/netcdf-c#2511
      Update cmakelists.txt in support of Unidata/netcdf-c#2511
      Updated release notes.
      Updated test logic in nc-config.in file.
      Corrected an error.
      Correct nccopy4 dependency on tst_fillbug.
      Added a dependency to tst_nans to nccopy4
      Added additional dependencies.
      Add LDFLAGS for two plugins, nczstdfilters and nczhdf5filters, in support of Unidata/netcdf-c#2478
      Add prepreqs to ncdump/tst_nccopy4, revising some race condition related errors.
      Add blank filter quickstart guide file.
      Updated release notes.
      Working towards writing the quick start for plugins and integrating it into doxygen.
      Roughed in initial quickstart
      Working on filter quickstart document.
      Continuing to flesh out the quick-start guide.
      Further editing.
      Updated SO version.
      Updated for next release cycle.
      Manually bump version in diff-compare to get RC1 out the door, this will need to be automatically excluded from the test at some point otherwise we will see this test fail every time the VERSION string changes.
      Copy zmap reference files for cmake-based tests.
      Update release notes.
      Add generated files to distclean.
      Correct an issue with 'make distcheck' where out-of-source tests were failing.
      Working on another make distcheck failure.
      Correct an issue observed in out-of-source builds.
      Updated RELEASE_NOTES
      Updated the relees notes.
      Correct a typo in support of Unidata/netcdf-c#2534
      Make dap4 reference dap instead of hard-wired to be disabled.
      Add a check for HAVE_DECL_ISINF and HAVE_DECL_ISNAN in support of Unidata/netcdf-c#2132
      Fix mismatched arguments warning in CMakeLists.txt
      Restore release date for 4.9.1 RC1 in release notes.
      Added target release date for RC2.
      Supported headers for hdf4 are not installed in actions, and there does not appear (currently) to be an easy way to reinstall these.
      Update release date.
      DAP4 is back on for cmake-based builds.
      Add an old static file.
      Added another old static html page in preparation for updating.
      Fix a logic error re: DAP4 tests, when DAP4 is specified, but hdf5/netcdf4 support is disabled.
      Added S3 status to libnetcdf.settings, turned byterange on by default.
      Cleaning up NCZARR_S3 summary, turning on byterange by default.
      Add libcurl-dev to cygwin github actions
      Correct libcurl development package.
      Add libiconv-devel to cygwin CI
      Correct version string change that should not have ended up in this branch.
      Correct logic for running DAP4 tests when HDF5 is not enabled.
      Update whitespace.
      Correct lingering merge issue.
      Merging Unidata/netcdf-c#2583 manually into the v4.9.1 wellspring branch.
      Fix a doxygen warning-treated-as-error
      Add new test, tst_calendars_nc4.sh, to automake-based builds.
      Fix an issue I introduced with make distcheck
      Remove internal flag from byterange documentation.
      Update additional documentation infrastructure.
      Update github action configuration scripts.
      Small tweak.
      Updating filter documentation with a quickstart guide.
      Remove dangling file.
      A bit of doxygen cleanup.
      re-added quickstart filters document.
      Clean up some garbled output from Doxygen.
      Change in support of Unidata/netcdf-c#2599
      Update release notes with v4.9.1 release date.
      Updating for v4.9.1 release.
      Updating in preparation for 4.9.1
      Updating in prep for the v4.9.1 release.
      Updated .gitignore.
      Added autoconf generated files for a stand-alone release.
      Added generated manfile for a stand-alone release.
      Update Release Notes with proper release date.

Yuriy Chernyshov (1):
      Fix typo in CMakeLists.txt

wkliao (3):
      use malloc to increase read chunk size from 1 KB to 4 MB
      typo fix
      replace 4194304 with READ_BLOCK_SIZE
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
No open projects
Status: Done
Development

Successfully merging a pull request may close this issue.

2 participants