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 build fails against netcdf-4.6.3 #124
Comments
Thank you so much for figuring this out! This also helps explain why Appveyor fails to build NCO 4.8.0-alphaXX against netCDF 4.6.1, a problem that has been driving me crazy. That clause of CMakeLists.txt only works for netCDF 4.6.0. It needs to be changed to set NC_LIB_VERSION directly to the same value that nco.h sets it to (on line 339) which is based on netcdf_meta.h (when it exists) as
|
ok |
is this what you mean?
|
my latest commit seems to have fixed this, AppVeyor was a success build |
Re-opening issue to improve the Appveyor build. As the Windows output shows,
NCO does not need to define 'NC_HAVE_META_H' because the header file |
not in the netcdf version I have locally, 4.6.0; so this add_definitions(-DNC_HAVE_META_H) must be in CMakeLists.txt for this case; so I added it for now |
So this clumsy introduction of tokens by Unidata in the 4.6.x series creates a messy Appveyor log for all non-4.6.0 builds, which we wish to avoid. Please change |
The CMakeLists.txt is setup to check the NetCDF library being built against for
nc_def_var_filter
andnc_inq_var_filter
, and, when finding both of those, sets the compile-time option-DNC_LIB_VERSION=460
:This, in turn, causes the
#if NC_LIB_VERSION >= 462
check atnco_netcdf.h:355
to fail and consequently, the#include <netcdf_mem.h>
does not occur, which subsequently causes the stubstruct NC_memio
to be defined.However, CMake also defines a
HAVE_NETCDF_MEM_H
, which causes the header to be pulled in atnco_netcdf.h:540
, at which point compile fails due to a redefinition error ofstruct NC_memio
.I fixed this locally in the quickest way possible by removing the
-DNC_LIB_VERSION
flag generated by CMake. I'd be interested in submitting a pull request to fix this properly but I'd need some guidance.The text was updated successfully, but these errors were encountered: