-
Notifications
You must be signed in to change notification settings - Fork 558
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] Simplify NetCDF build script #5319
[NetCDF] Simplify NetCDF build script #5319
Conversation
* drop support for julia 1.3 * single build script * enable Zstandard
I'm just curious how the Zstandard integration works here. I would like to test how that interacts with https://github.com/JuliaIO/HDF5.jl/tree/master/filters/H5Zzstd |
@mkitti it hasn't quite been hooked up yet in the netcdf wrapper packages, though see JuliaGeo/NetCDF.jl#160 (comment). Both approaches would use the same Zstd_jll. What kind of interaction are you thinking about? I'd be very strange for someone to use both on the same file, since they'd probably do similar things, one just going through the |
After looking into a how the these filters work, there is certainly more work needed before zstandard (and NetCDF plugins for HDF5 in general) become usable with NetCDF_jll.
which leads to this error if
Once this is resolved, there is the question where to install the plugins so that HDF5 can find them. Here is a relevant discussion Unidata/netcdf-c#2294 and there will probably some changed in the upcoming version 4.9.1. I think it would be good to track the integration of HDF5 plugins in a separate issue. |
Just to elaborate on the follwoing Unidata/netcdf comment from Unidata from the Julia perspective:
The HDF5 plugin they refer to is located here: For Julia, rather than compiling this small piece of C code, we just translated it to Julia here: Other translated filter plugins can be found here: Technically, we could package up the C plugin in BinaryBuilder, but so far I have not seen a strong incentive to do so. |
Do you register these julia plugins with |
I removed the Zstd_jll dependency because the support for Zstandard and plugins is not jet functional. |
Sounds good! So this is good to go, right? I see julia 1.8 got tagged, would be great to have a fully functional netcdf binary by the time it is announced :) |
The filters are registered via via their If you want to use Zstd compression with HDF5.jl, then you just have to do: using HDF5
using H5Zzstd This is documented here:
If we're talking about filter ID 32015, then |
One can confirm the availability of the filter via
|
Thank you for this detailed information! So there are good chances that this mechanism already works for NetCDF too. |
So to be clear, the expectation here is that this will build a single version of NetCDF that can be loaded in Julia 1.6, 1.7 and 1.8. I see the dependency on LibCURL is specifically set to the version in 1.6, I think there's a good chance this will work, so let's roll with it! |
Since yesterday, quite some packages have started to fail on Julia 1.9 segfaulting in libnetcdf during initialization, so I guess that may be related to this PR. See https://s3.amazonaws.com/julialang-reports/nanosoldier/pkgeval/by_hash/f7144f7/report.html, e.g., https://s3.amazonaws.com/julialang-reports/nanosoldier/pkgeval/by_hash/f7144f7/ArgoData.primary.log (for one of the shorter failed tests). This happens during precompilation, when NCDatasets.init_certificate_authority executes. It's possible this is related to the PkgEval sandbox, but regardless it shouldn't segfault like that. |
Julia 1.8 uses libcurl 7.84.0, which is the same version as Julia master (1.9) after JuliaLang/julia#45967. ArgoData seems to pass the tests fine on my Julia 1.8 running on Windows.
|
The segmentation faults seem to be occurring on the call to |
ClimateModels fails after |
I think all this is related to Unidata/netcdf-c#2337. We are currently calling a private API to define the path of the certificate authority for HTTPS because the (new) public API produces a segfault. Now it seems that the private API segfaults too. I guess I will need to disable HTTPS in NCDatasets until this upstream issue is resolved (at least under Julia 1.9). |
That would be great. Alternatively, if this is related to PkgEval's sandbox environment I could tweak that, as long as we get rid of the 30+ segfaulting packages on PkgEval :-) |
OK, I have released NCDatasets 0.12.7 which does not call https://github.com/Alexander-Barth/NCDatasets.jl/runs/7931319355?check_suite_focus=true and 1.9.0-DEV.1162 on my machine. I am wondering how I can reproduce this error locally. Does PkgEval also use nightly builds? |
The way to test this is explained in the PkgEval README: https://github.com/JuliaCI/PkgEval.jl#why-does-my-package-fail Interestingly however, it does not fail when using julia> using PkgEval
julia> config = Configuration(julia="master", buildflags=["JULIA_CPU_TARGET=native", "JULIA_PRECOMPILE=0"])
julia> PkgEval.sandboxed_julia(config)
# in the sandbox here
pkg> add NCDatasets@0.12.6
julia> using NCDatasets
# segfault That's not great, because PkgEval source builds are supposed to be identical to the ones performed by CI... @staticfloat, any thoughts? The build script is here: https://github.com/JuliaCI/PkgEval.jl/blob/893b93e5723782653dc87aaec2e00b1b08b6cce5/src/julia.jl#L107-L186 |
Interestingly, if I switch to the rootfs used by Julia CI, the issue disappears... Let's do that for PkgEval then. |
This issue Unidata/netcdf-c#2486 might be relevant where a memory problem during initialization is observed (independently of julia) in |
For the record: the C option |
sandbox:${WORKSPACE} # grep -B3 -r '\*strdup' /opt/${target}/${target}/sys-root/usr/include/
/opt/x86_64-linux-gnu/x86_64-linux-gnu/sys-root/usr/include/string.h-#if defined __USE_SVID || defined __USE_BSD || defined __USE_XOPEN_EXTENDED \
/opt/x86_64-linux-gnu/x86_64-linux-gnu/sys-root/usr/include/string.h- || defined __USE_XOPEN2K8
/opt/x86_64-linux-gnu/x86_64-linux-gnu/sys-root/usr/include/string.h-/* Duplicate S, returning an identical malloc'd string. */
/opt/x86_64-linux-gnu/x86_64-linux-gnu/sys-root/usr/include/string.h:extern char *strdup (__const char *__s) The Yggdrasil/Z/ZipFlow/build_tarballs.jl Line 11 in 95c4495
|
enable ZstandardSee also issue #4511