StrawberryPerl / build-extlibs

16 stars 11 forks source link

netcdf build status - version 4.9.0 #16

Closed shawnlaffan closed 1 year ago

shawnlaffan commented 1 year ago

These are notes. I'll work up a PR some time soon.

netcdf version 4.9.0 builds with a few configure adjustments. 4.9.0 is the current version in MSYS2.

The build includes the two MSYS2 patches, although the first is for a cmake file so does not actually matter for this autotools build. https://github.com/msys2/MINGW-packages/blob/40f98ac68ed663351fbf856e0203a7ef5f344f5f/mingw-w64-netcdf/0001-no-debug-libraries.patch https://github.com/msys2/MINGW-packages/blob/40f98ac68ed663351fbf856e0203a7ef5f344f5f/mingw-w64-netcdf/0002-no-file.patch

This patch is applied from the next version (not yet released): https://github.com/Unidata/netcdf-c/pull/2460.patch

The configure call disables utilities and plugins as these throw build errors. The build errors are similar to those addressed in the third patch applied so might also be fixed in netcdf 4.9.1. There is no regular release schedule but 4.8.1 was about five months after 4.8.0, and 4.9.1 was released in June ((full release sequence here)). Strawberry perl 5.32 does not include the utilities so I assume they are not needed more generally. I am unsure if the plugins are needed by perl libraries.

The configure call disables the nczarr components but this is perhaps not necessary as netcdf does not depend on Zarr that I can tell.

The removed configure argument --enable-netcdf4 is a synonym for --enable-hdf5. This is on by default so it is not needed.

diff --git a/build.sh b/build.sh
index 56a5af9..0e9695d 100755
--- a/build.sh
+++ b/build.sh
@@ -1101,7 +1103,9 @@ sed -i 's/libnetcdf_la_LDFLAGS = /libnetcdf_la_LDFLAGS = -no-undefined /' liblib

 save_configure_help
 CPPFLAGS=-I$OUTINC LDFLAGS=-L$OUTLIB xxrun ./configure $HOSTBUILD --prefix=$OUT --enable-static=no --enab
le-shared=yes \
-                        --enable-netcdf4 --enable-hdf4 --disable-dap  --disable-dynamic-loading
+                        --enable-hdf4 --disable-dap  --disable-dynamic-loading \
+                       --disable-utilities --disable-plugins \
+                       --disable-nczarr-filters --disable-nczarr
 patch_libtool
 xxrun make
 xxrun make check
shawnlaffan commented 1 year ago

Closing as PR #21 has been merged.

There is a release candidate for netcdf 4.9.1 which might fix some of the zarr build failures. I'll look into that when the full release is out, but any associated changes can be done under a new issue or PR.