-
Notifications
You must be signed in to change notification settings - Fork 28
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
No HDF4 support in provided NetCDF build #138
Comments
@Yujie-W was the issue resolved? I don't know what kind of feature this would be, isn't UInt16 (NC_USHORT) supported by default? https://www.unidata.ucar.edu/software/netcdf/docs/data_type.html |
@visr No, the problem is still there. I tried it on my pc and server. Here is the results
On my pc (manjaro) NetCDF v0.11
On the server (redhat) NetCDF v0.10 Succeed
On the server (redhat) NetCDF v0.11
|
Think it is due to the nctcdf version. I have netcdf v4.7.4 on my PC, here is the output
The server has an old version of netcdf
Now sure what is going on. My guess is that NetCDF v0.10 uses linux system netcdf, so that it succeeds on the server but fails on my PC. NetCDF v0.11 uses NetCDF_jll (build on netcdf v4.7.4), so that it fails on both my PC and server. |
The .hdf suffix makes it difficult to guess what the underlying file type is; is it hdf4, hdf5? Or is it a netCDF binary file with the .hdf extension? On the system that works for you, what is the output from |
|
I have little familiarity with julia, but I notice the output |
All right, I was able to duplicate this using the |
In the past we were using either system NetCDF binaries or used conda binaries as fallback and it looks like on your system this included support for hdf4 files. However, with NetCDF 0.11 we switched to a custom NetCDF build using Yggdrasil and the Artifact system, here a link to the file that contains most of the current build script: https://github.com/JuliaPackaging/Yggdrasil/blob/master/N/NetCDF/common.jl and hdf4 is not supported. If there is a strong need to support HDF4, this would be the place to add it, but first we would need an hdf4 artifact, which is probably a nightmare to cross-compile. Related issues and PRs are: #123 |
The binaries are downloaded from here: https://github.com/JuliaBinaryWrappers/NetCDF_jll.jl/releases/tag/NetCDF-v400.702.400%2B0 This includes a libnetcdf.settings with these contents:
So indeed, as you have already found out, HDF4 is not supported in these builds at the moment. |
I kind of remember I opened an issue about HDF4 support somewhere, and here it is. I opened another one at NCDatasets.jl as well, tried a sway around solution, see Alexander-Barth/NCDatasets.jl#217. Maybe you can add the fallback solution back, e.g., import NetCDF_jll
const LIBNETCDF = deepcopy(NetCDF_jll.libnetcdf);
function switch_netcdf_lib!(; use_default::Bool = true, user_defined::String = "$(homedir())/.julia/conda/3/lib/libnetcdf.so")
if use_default
NetCDF_jll.libnetcdf = LIBNETCDF;
else
if isfile(user_defined)
NetCDF_jll.libnetcdf = user_defined;
else
@warn "File '$(user_defined)' not found!";
@info "Hint: You may libnetcdf shipped with Conda.jl using Conda.add(\"libnetcdf\"). A version above 4.8.1 is recommended.";
@warn "The file '$(user_defined)' does not exist, please make sure you have provided the correct path!";
end;
end;
return nothing
end |
netCDF 0.10.3 works well when reading a UInt16 NC file, but this error appears in 0.11.0
Here is the file for testing purpose: https://drive.google.com/file/d/19OEv2_R9DxO4I7K6MDK1e6yjxFocAXKQ/view?usp=sharing
The command I use, for example,
The text was updated successfully, but these errors were encountered: