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

Upgrade NetCDF to 4.9.2 #2993

Open
wants to merge 9 commits into
base: master
Choose a base branch
from
Open

Upgrade NetCDF to 4.9.2 #2993

wants to merge 9 commits into from

Conversation

mjwoods
Copy link

@mjwoods mjwoods commented Jun 10, 2023

Background

Compared with the NetCDF version 4.8.1 in MXE, NetCDF 4.9.2 includes several bug fixes for mingw and various other improvements.

XML library

NetCDF uses libxml2 when available, so this has been added to the MXE dependencies. Building static libraries requires the preprocessor macro LIBXML_STATIC to be defined, so this has been added to the arguments passed to cmake.

hdf5 library names

The existing MXE package contains a hack to remove -static|-shared suffixes from hdf5 library names, as explained in #2948 . This issue seems to be avoided by passing option HDF5_NO_FIND_PACKAGE_CONFIG_FILE to the FindHDF5 module in cmake. The option causes FindHDF5 to ignore the hdf5-config.cmake file created by the hdf5 installation, where the problem seems to originate, and the module searches for the hdf5 libraries instead.

pkg-config file

The netcdf.pc file created by NetCDF does not contain all of the libraries needed for static linking. As a workaround, this PR provides a patch that adds a Requires.private field to netcdf.pc.in, which refers to the pkg-config files for dependencies. The patch also removes the Libs.private field, otherwise the libraries are linked in the wrong order. The resulting netcdf.pc allows the test program to be linked using only flags and libraries returned by the command '$(TARGET)-pkg-config' $(PKG) --cflags --libs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant