-
Notifications
You must be signed in to change notification settings - Fork 262
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 4.9.0 fails to create a NetCDF4 file on Windows (x86_64-w64-mingw32-gcc) with HDF5 1.12.1 #2248
Comments
Thank you for the very comprehensive report! I'll take a look, I am working primarily on Linux/OSX myself, with Windows being a secondary environment. I will try to duplicate this environment and issue, and hopefully being able to provide some insight. Hopefully I will be able to track this down without going into Julia, as I unfortunately have no experience there. |
Could this be a file permission problem? Do you have permission to create the file, or is there already a file of that name that you are attempting to overwrite without using NC_CLOBBER? |
In our case, we have this issue also with a randomly created filenames in the windows temporary directory (windows equivalent of /tmp) when running our test suite. I guess that @visr also checked that the file |
Yes indeed, I don't think it is a file permission issue. The filename didn't exist, and I could create a netcdf3-classic file in the same place with the same library. |
Just noting that we still see this on netCDF 4.9.0 built against HDF5 1.12.2, ref Alexander-Barth/NCDatasets.jl#164 (comment), only when cross compiling netCDF for Windows. |
As a test, I added a simple test function to libnetcdf which only creates a HDF5 File Access Properties list: int my_test_function() {
hid_t fapl_id = -1;
int retval = NC_NOERR;
printf("start\n");
fapl_id = H5Pcreate(H5P_FILE_ACCESS);
printf("end\n");
return retval;
} Calling this function reproduces this crash:
|
Updated issue title to reflect it is still observed in latest version. |
This adds an interesting wrinkle, insofar as this is an HDF5 function being called absent any netCDF function calls. Because it's not completely separated from I'm not unfamiliar with cross-compilation, but it is not part of my regular workflow. Let me take a look and see if I can replicate this in a stand-alone test program that only uses hdf5 and is also cross-compiled. I hate to ask, but if this is something you can easily test on your end, @Alexander-Barth, it might be worth doing so so that we can really nail down whether this is in the netCDF layer or not. |
Indeed, I was wondering the same thing: JuliaPackaging/Yggdrasil#4511 (comment) The small example program using just HDF5 also failed when using the gcc compiler from the julia build environment (x86_64-w64-mingw32-gcc 4.8.5). Surprisingly, I can cross-compile the example program using the cross-compiler from Ubuntu 20.04 (with a more up-to-date version "9.3-win32 20200320"). So I am wondering if this could be compiler bug triggered by some changes in HDF5 since version 1.12.1 (completely unrelated to NetCDF). |
I am closing this issue since the problem did not show up again after upgrading the GCC version. Thanks to all who contributed to the discussion! |
NetCDF 4.8.1
Windows, mingw compiler (x86_64-w64-mingw32-gcc (GCC) 4.8.5)
NetCDF 4.8.1 fails to create a NetCDF4 files on Windows with HDF5 1.12.1 (binary from mingw).
The issue has been reported here (in the context of julia) by @visr
Alexander-Barth/NCDatasets.jl#164
The julia code in the issue correspond to the following C code:
So just creating a NetCDF4 file triggers the issue.
The error message is:
This corresponds to the following line:
https://github.com/Unidata/netcdf-c/blob/v4.8.1/libhdf5/hdf5create.c#L124
To build NetCDF4 on Windows I have to apply these patches:
https://github.com/Alexander-Barth/Yggdrasil/tree/NetCDF-v4.8.1/N/NetCDF/bundled/patches
This first patch is based on #2138.
NetCDF 4.8.1 works on all other tested platforms (Linux, Mac OS, even Mac OS-M1). We had also this issue with NetCDF 4.7.4 and HDF5 1.12.1 on Windows.
In julia, all libraries are cross-compiled from a Linux-x86_64 environment targeting the different OS and CPU architectures.
I am not sure where actually the problem is. It could also be in HDF5 , the mingw compiler, ...
Any help would be greatly appreciated :-)
As a Linux user, I am not too familiar with Windows. I just want to get our software to work for our students which are primarily Windows users.
Ref:
Alexander-Barth/NCDatasets.jl#164
JuliaPackaging/Yggdrasil#4511
JuliaGeo/NetCDF.jl#151
#2138
#2124
CC: @visr, @giordano
The text was updated successfully, but these errors were encountered: