Conversation
|
I am surprised at this. We routinely test our code using mingw as a github action.
|
|
Additional point: we will not get rid of the EXTERNL because it is the macro that allows us to add necessary __declspec declarations for visual studio. |
|
Hi @DennisHeimbigner , I was using |
|
On the |
|
We also EXTERNL some functions so our unit-tests can access them, |
WardF
left a comment
There was a problem hiding this comment.
I am leaving a review since we have adopted the 'review required' workflow, but the comment thread from Dennis is spot on, insofar as we need to retain EXTERNL but can modify the definition as he described.
|
Relevant definition appears to be here: Lines 544 to 556 in 12a9083 Perhaps cmake is setting DLL_NETCDF when autotools does not?
There's similar bits in Out of curiousity, where does autotools set Lines 106 to 110 in 5ccb71d Does the CMake build succeed if those lines are removed from config.h.cmake.in? It looks like that would trigger gcc's auto-export-everything behavior.
Also, CMake on MinGW is unsupported, and the Autotools CI job explicitly requests that the linker mark every function |
Building the netcdf dll and related executables under mingw-w64 (with
cmake) fails due to an undefined reference to `NC4_show_metadata'. The code contains a workaround for the MS C compiler, and this can be extended to gcc in mingw-w64.After that, the build fails again due to undefined references to functions in tst_utils.h, which are declared as
dllimportwhen they should beextern.After fixing tst_utils.h, the build completes and all except 4 tests pass. The failed tests are:
82 - nc_test4_tst_filter (Failed)
83 - nc_test4_tst_specific_filters (Failed)
222 - nczarr_test_run_filter (Failed)
223 - nczarr_test_run_specific_filters (Failed)
All of the failed tests relate to filters, which are not being built under mingw-w64. I think this is because
libdlis not available by default on mingw-w64, although it can be installed as an optional package. These tests should probably be disabled if the filters are not built.