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

netcdf-4.9.0 on Cygwin undefined reference to `nc_inq_libvers #2446

Closed
matzeri opened this issue Jul 3, 2022 · 3 comments · Fixed by #2460
Closed

netcdf-4.9.0 on Cygwin undefined reference to `nc_inq_libvers #2446

matzeri opened this issue Jul 3, 2022 · 3 comments · Fixed by #2460
Assignees
Milestone

Comments

@matzeri
Copy link

matzeri commented Jul 3, 2022

Cygwin 64 bit with GCC 11.3.0

libtool: link: gcc -ggdb -O2 -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -fstack-protector-strong --param=ssp-buffer-size=4 -fdebug-prefix-map=/pub/devel/netcdf/netcdf-4.9.0-1.x86_64/build=/usr/src/debug/netcdf-4.9.0-1 -fdebug-prefix-map=/pub/devel/netcdf/netcdf-4.9.0-1.x86_64/src/netcdf-c-4.9.0=/usr/src/debug/netcdf-4.9.0-1 -fno-strict-aliasing -o .libs/ncgen3.exe main.o load.o escapes.o getfill.o init.o genlib.o ncgeny.o  ../liblib/.libs/libnetcdf.dll.a -lmfhdf -ldf -ljpeg -lhdf5_hl -lhdf5 -lz -lzip -lsz -lbz2 -lzstd -lxml2 -lcurl
/usr/lib/gcc/x86_64-pc-cygwin/11/../../../../x86_64-pc-cygwin/bin/ld: main.o: in function `usage':
/usr/src/debug/netcdf-4.9.0-1/ncgen3/main.c:76: undefined reference to `nc_inq_libvers'
/usr/lib/gcc/x86_64-pc-cygwin/11/../../../../x86_64-pc-cygwin/bin/ld: main.o: in function `main':
/usr/src/debug/netcdf-4.9.0-1/ncgen3/main.c:225: undefined reference to `nc_finalize'

the code is in the library but it is NOT exported

$ objdump -x ncgen3/main.o |grep libvers
[ 63](sec  0)(fl 0x00)(ty   20)(scl   2) (nx 0) 0x0000000000000000 nc_inq_libvers
00000000000001f4 IMAGE_REL_AMD64_REL32  nc_inq_libvers
$ objdump -x  ./liblib/.libs/cygnetcdf-19.dll |grep libvers
        1d26f0   3575  H5get_libversion
[459](sec  1)(fl 0x00)(ty   20)(scl   2) (nx 1) 0x00000000000057f0 nc_inq_libvers
[461](sec  3)(fl 0x00)(ty    0)(scl   3) (nx 0) 0x00000000000014a0 nc_libvers
[4087](sec  1)(fl 0x00)(ty   20)(scl   2) (nx 0) 0x000000000004e950 NC4_hdf5get_libversion
[8207](sec  1)(fl 0x00)(ty   20)(scl   2) (nx 0) 0x00000000000975e0 NCZ_get_libversion
[12475](sec  9)(fl 0x00)(ty    0)(scl   2) (nx 0) 0x0000000000001390 __imp_H5get_libversion
[12478](sec  1)(fl 0x00)(ty   20)(scl   2) (nx 0) 0x00000000000af148 H5get_libversion
$ objdump -x  ./liblib/.libs/libnetcdf.dll.a |grep libvers

It was on previous

$ cygcheck -c libnetcdf19
Cygwin Package Information
Package              Version        Status
libnetcdf19          4.8.1-1        OK

 $ objdump -x  /usr/lib/libnetcdf.dll.a |grep libvers
[  5](sec  1)(fl 0x00)(ty    0)(scl   2) (nx 0) 0x0000000000000000 nc_inq_libvers
[  6](sec  3)(fl 0x00)(ty    0)(scl   2) (nx 0) 0x0000000000000000 __imp_nc_inq_libvers
[  5](sec  1)(fl 0x00)(ty    0)(scl   2) (nx 0) 0x0000000000000000 NCZ_get_libversion
[  6](sec  3)(fl 0x00)(ty    0)(scl   2) (nx 0) 0x0000000000000000 __imp_NCZ_get_libversion
[  5](sec  1)(fl 0x00)(ty    0)(scl   2) (nx 0) 0x0000000000000000 NC4_hdf5get_libversion
[  6](sec  3)(fl 0x00)(ty    0)(scl   2) (nx 0) 0x0000000000000000 __imp_NC4_hdf5get_libversion


@WardF WardF self-assigned this Jul 5, 2022
@WardF WardF added this to the 4.9.1 milestone Jul 5, 2022
@WardF
Copy link
Member

WardF commented Jul 5, 2022

Thanks, I'll take a look!

@DWesl
Copy link
Contributor

DWesl commented Jul 11, 2022

Seems related to numpy/numpy#20874; the MinGW CI builds fix this with LDFLAGS=-Wl,--export-all-symbols, I fixed it by guarding the last unguarded __declspec(dllexport) in libdispatch/dreg.c (line 19 or so; I wrapped with #ifdef _WIN32).

@WardF
Copy link
Member

WardF commented Jul 11, 2022

Thank you; I'll add this change as well.

WardF added a commit to WardF/netcdf-c that referenced this issue Jul 11, 2022
WardF added a commit that referenced this issue Jul 11, 2022
Guard _declspec(dllexport) in support of #2446
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
Labels
None yet
Projects
No open projects
Status: Done
Development

Successfully merging a pull request may close this issue.

3 participants