This archive contains answers to questions sent to Unidata support through mid-2025. Note that the archive is no longer being updated. We provide the archive for reference; many of the answers presented here remain technically correct, even if somewhat outdated. For the most up-to-date information on the use of NSF Unidata software and data services, please consult the Software Documentation first.
> Hi, > > I have recently tried to compile netCDF 4.1.1 with the mingw-w64 > toolchain from mingw-w64.sourceforge.net. This is a 32 and/or 64-bit > GCC toolchain for Windows. > > I ran the compilation from MSYS to run the configure and make commands. > > > configure --host=x86_64-w64-mingw32 --build=x86_64-w64-mingw32 > > make > > make test > > Some remarks/bugs: > 1. the --build option is needed, because MSYS is detected as > "i686-pc-msys" and thus cross-compilation is "invoked", which tried > the command "link" as linker, but this is incorrect: link is a tool > provided by MSYS, and "ld" or "nm" should be used for this purpose. > This is a bug in the configure script. > 2. the file v2i.c in libsrc is missing a #include "nc.h" for the > definition of struct NC for line 39. Adding this include at line 12 > let compilation complete. > 3. make test produces three failures, log is zipped and attached. Comments: > - tst_output.sh: failure due to line endings see log) > - tst_calendars.sh: genuine failure > - tst_nccopy3.sh: failure due to mismatch output from msvcrt's printf > function. Number is correct, just printed differently. > > Thanks for any response to this! > > Ruben Van Boxem > > PS: I came across this project because it is used www.ABINIT.org, > which downloads and uses an archaic version (3.6.3) itself if > libnetCDF isn't found. > > Howdy Ruben! I am now building the netCDF library on cygwin, with target=mingw32. This is not quite the same as what you were trying to do, but close. Since your email, the architecture of the library has changed a lot. The v2i.c file is now in the libdispatch directory, and I'm not sure that it needs to include nc.h any more. As for the line ending problem, I am not sure what I should do. Do you have any suggestions? Could you try this with the daily snapshot release? ftp://ftp.unidata.ucar.edu/pub/netcdf/snapshot/netcdf-4-daily.tar.gz Thanks, Ed Ticket Details =================== Ticket ID: SBB-184327 Department: Support netCDF Priority: Critical Status: Closed