-
Notifications
You must be signed in to change notification settings - Fork 576
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.8.1 does not work on windows #3731
Comments
It seems that the users gets
|
Libraries for Windows are under sandbox:${WORKSPACE} # nm libnetcdf-19.dll | grep nc_inq_libvers
0000000066f483e0 T nc_inq_libvers |
You are right. I should look at libnetcdf-19.dll in bin. Still for some reasons I get this error in my package: https://github.com/Alexander-Barth/NCDatasets.jl/runs/3870249033?check_suite_focus=true#step:7:85 |
On a windows machine, I can see the function
But in Julia 1.6.2, this function cannot be found:
|
What if you |
Unfortunately, this is still the same (from a fresh julia session):
I am trying with the old NetCDF library to see what could be the difference. |
If you do that after |
Just after restarting julia:
Maybe |
Correct and this is very likely the cause of the error here |
I am not sure if this is relevant, but the new library is also linked against
|
Don't trust sandbox:${WORKSPACE} # ${target}-objdump -x libnetcdf-19.dll | grep "DLL Name"
DLL Name: KERNEL32.dll
DLL Name: msvcrt.dll
DLL Name: libcurl-4.dll
DLL Name: libhdf5_hl-0.dll
DLL Name: libhdf5-0.dll |
OK, good to know. First with NetCDF 4.7.4: this works
Then with NetCDF 4.8.1 whichs fails. The compiler is unable to find any functions. Maybe they are not exported?
|
Using Dependency Walker on Windows or with |
I found a way to force the export of all symbols. But I am facing now a different issue on Windows: Would it be possible to rollback the upgrade to its previous version? Sorry for all this confusion! |
Did you also try to do a native build with the same build options? Or is there any native build for Windows already available? I don't think we do anything special with regard to symbols being exported or not, so I'm curious to see what happens outside of BinaryBuilder.
You can yank the offending versions in the registry. |
So far, I did not try to make a native build and I am not aware of any native build available. Unfortunately, mingw64 is not officially supported by NetCDF (only the Microsoft C compiler on Windows) and the library contains a lot of platform specific code. For your information, I needed the use the diff --git a/N/NetCDF/common.jl b/N/NetCDF/common.jl
index 3c04a6c1..8176f14f 100644
--- a/N/NetCDF/common.jl
+++ b/N/NetCDF/common.jl
@@ -34,7 +34,7 @@ if [[ ${target} == *-mingw* ]]; then
export LIBS="-lhdf5-0 -lhdf5_hl-0 -lcurl-4 -lz"
# linking fails with: "libtool: error: can't build x86_64-w64-mingw32 shared library unless -no-undefined is specified"
# unless -no-undefined is added to LDFLAGS
- LDFLAGS_MAKE="${LDFLAGS} ${LIBS} -no-undefined"
+ LDFLAGS_MAKE="${LDFLAGS} ${LIBS} -no-undefined -Wl,--export-all-symbols"
# testset fails on mingw (NetCDF 4.8.1)
# libtool: link: cc -fno-strict-aliasing -o .libs/pathcvt.exe pathcvt.o -L/workspace/destdir/bin ../liblib/.libs/libnetcdf.dll.a -lhdf5-0 -lhdf5_hl-0 -lcurl-4 -lz -L/workspace/destdir/lib I found this concerning the Thank you for the suggestion to yank the version in the registry. This is done now. |
I believe I'm crashing into this issue in #4344. Honestly, I have zero clue about what's wrong with the Windows build, but I confirm it looks "broken" |
Here is a fresh attempt: I tried to find some volunteers to test the library before I make a PR: |
Unfortunately, there is an issue with my PR #3620.
The windows binary does not seem to work. The size of the library is also suspiciously small. Symbols like nc_inq_libvers are no longer found.
The text was updated successfully, but these errors were encountered: