-
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
dpathmgr.c: error: ‘path’ undeclared when cross-compiling netCDF 4.8.0 #1999
Comments
That is odd. In the tar file for 4.8.0, that whole last section with NCopendir and NCclosedir is disabled. because it is between
Is that conditional being ignored for some reason? can you write a simple test program to see if windows ignores the 'if 0' construct? |
Indeed, this is very odd. #include <stdio.h>
int main() {
// printf() displays the string inside quotation
printf("Hello, World!");
#if 0
undeclared_var = 0;
#endif /*0*/
return 0;
} However, when I use the # adapted command from libtool --debug
x86_64-w64-mingw32-gcc -DHAVE_CONFIG_H -I. -I.. -I../include -I -DH5_USE_110_API -MT libdispatch_la-dpathmgr.lo -MD -MP -MF .deps/libdispatch_la-dpathmgr.Tpo -c dpathmgr.c -DDLL_EXPORT -DPIC -E > dpathmgr.out I still see the function NCclosedir(DIR* ent)
{
int
# 358 "dpathmgr.c" 3
_stat64
# 358 "dpathmgr.c"
= 0;
char* cvtname = NCpathcvt(path);
if(cvtname ==
# 360 "dpathmgr.c" 3 4
((void *)0)
# 360 "dpathmgr.c"
) {
# 360 "dpathmgr.c" 3
(*_errno())
# 360 "dpathmgr.c"
=
# 360 "dpathmgr.c" 3
2
# 360 "dpathmgr.c"
; return -1;}
# 361 "dpathmgr.c" 3
_stat64
# 361 "dpathmgr.c"
= closedir(cvtname);
free(cvtname);
return
# 363 "dpathmgr.c" 3
_stat64
# 363 "dpathmgr.c"
;
} |
In fact the function netcdf-c/libdispatch/dpathmgr.c Line 356 in 44d9d36
netcdf-c/libdispatch/dpathmgr.c Line 932 in 44d9d36
|
ok, that explains it. Let me fix. |
Still odd that I do not see this error when building under Visual Studio. Oh well, the code is wrong in any case. Wonder if this is a mingw issue? Oh, I know, mingw has dirent.h but visual studio does not. |
re: Issue Unidata#1999 NCclosedir code is incorrect. Fix. Note that this issue crops up when using a non-VisualStudio windows build such as Mingw because Mingq defines dirent.h, but Visual Studio does not.
See PR #2003 |
re: Issue Unidata#1999 NCclosedir code is incorrect. Fix. Note that this issue crops up when using a non-VisualStudio windows build such as Mingw because Mingq defines dirent.h, but Visual Studio does not. Addendum: Fix some mingw bugs: 1. Modify XGetopt.h to be conditional on _WIN32 instead of _MSC_VER. 2. Make sure sys/stat.h is included in ncpathmgr.h
I am trying to update the netCDF Julia package to the current version.
the version of the software with which you are encountering an issue
NetCDF 4.8.0
environmental information (i.e. Operating System, compiler info, java version, python version, etc.)
Cross-compilation from Linux to Windows (x86_64-w64-mingw32) in Julia's build tree Yggdrasil.
a description of the issue with the steps needed to reproduce it
NetCDF is cross-compiled using the following steps (line 26-46)
https://github.com/JuliaPackaging/Yggdrasil/blob/7a37fabb2eb7c680766aea06af77a055183c92f1/N/NetCDF/common.jl#L26
In addition, we used the option
CPPFLAGS=-DH5_USE_110_API
.(#1978 (comment) )
Compiliation succeeds on Linux and Mac OS, but fails on Windows with the error:
For reference the full log files is attached. I am not sure if this error is related to the option
-DH5_USE_110_API
.Do you have any idea what could be the issue?
Thanks a lot for any insight!
44.txt
The text was updated successfully, but these errors were encountered: