Hello, I have been trying to compile current NetCDF git HEAD on MinGW-W64 (Windows 64 with gcc 4.8.1) and found three issues that may or may not need to be fixed: - There is a problem in libsrc/posixio.c. In line 1664 an "#ifdef O_BINARY" is commented out, but it should be there (instead of the "#if _MSC_VER"). Also, there is a debug statement left in the file. A patch is attached. The problem can also be found in netcdf-c-4.3.1-rc6. - ALLOC_ONSTACK and FREE_ONSTACK is undefined. include/onstack.h contains no definition for the "#elif defined(_WIN32) || defined(_WIN64)" conditional. Using a non-constant value for the array size is supported in gcc-4.8.1, but I don't have MSVC here to check this as well. - I also believe that the toplevel CMakeLists.txt should have _FILE_OFFSET_BITS defined when testing the size of "off_t". This means SIZEOF_OFF_T is 4 on MinGW-W64, although _FILE_OFFSET_BITS=64 sets it to 8. Not sure if this has any adverse effect on the code. Patch is attached, but code seems to work without the patch applied. Best, Lars
Attachment:
CMakeLists.txt.patch
Description: CMakeLists.txt.patch
Attachment:
posixio.c.patch
Description: posixio.c.patch
netcdfgroup
archives: