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 Leon, > I'm trying to build and use the NetCDF-4.2 Fortran 90 libraries using MinGW > without much success, so I was wondering if you could help. > > I'm basically following your "Building the netCDF-4.2 and later Fortran > libraries" instructions using the Windows NetCDF4 binaries on your website. > "./configure" goes fine, and "make" goes fine, but "make check" fails. The > output is below. > > I still tried installing the libraries and compiling my code (which compiles > and works correctly under Linux). However, I get the following errors when > trying to compile my code: > > ----- > winLibs/lib\libnetcdff.a(fort-nc4.o): In function `nf_create_par_': > c:\Users\Leon\Dropbox\winLibs\netcdf-fortran-4.2\fortran/fort-nc4.c:22: > undefine > d reference to `nc_create_par_fortran' > c:\Users\Leon\Dropbox\winLibs\netcdf-fortran-4.2\fortran/fort-nc4.c:22: > undefine > d reference to `nc_create_par_fortran' > winLibs/lib\libnetcdff.a(fort-nc4.o): In function `nf_open_par_': > c:\Users\Leon\Dropbox\winLibs\netcdf-fortran-4.2\fortran/fort-nc4.c:25: > undefine > d reference to `nc_open_par_fortran' > c:\Users\Leon\Dropbox\winLibs\netcdf-fortran-4.2\fortran/fort-nc4.c:25: > undefine > d reference to `nc_open_par_fortran' > collect2: ld returned 1 exit status > ----- > > Do you have any advice on what to do? Or, do you have pre-compiled Fortran > libraries for Windows available? We haven't yet released a netcdf-fortran that includes what's necessary to build on Windows, except for cygwin. Our plans are to try to get a netCDF-C version 4.3 release out in the next month or so that includes CMake configurations for building from source with Visual Studio. Shortly after that, if we encounter no unanticipated problems, we'll be releasing a netcdf-fortran that also includes CMake build configurations, at least for ifort (we don't have the resources to test and support multiple Fortran compilers on Windows). --Russ > C:\Users\Leon\Dropbox\winLibs\netcdf-fortran-4.2>make check > Making check in f90 > make[1]: Entering directory > `/c/Users/Leon/Dropbox/winLibs/netcdf-fortran-4.2/f9 > 0' > make check-am > make[2]: Entering directory > `/c/Users/Leon/Dropbox/winLibs/netcdf-fortran-4.2/f9 > 0' > make[2]: Nothing to be done for `check-am'. > make[2]: Leaving directory > `/c/Users/Leon/Dropbox/winLibs/netcdf-fortran-4.2/f90 > ' > make[1]: Leaving directory > `/c/Users/Leon/Dropbox/winLibs/netcdf-fortran-4.2/f90 > ' > Making check in fortran > make[1]: Entering directory > `/c/Users/Leon/Dropbox/winLibs/netcdf-fortran-4.2/fo > rtran' > make check-am > make[2]: Entering directory > `/c/Users/Leon/Dropbox/winLibs/netcdf-fortran-4.2/fo > rtran' > make[2]: Nothing to be done for `check-am'. > make[2]: Leaving directory > `/c/Users/Leon/Dropbox/winLibs/netcdf-fortran-4.2/for > tran' > make[1]: Leaving directory > `/c/Users/Leon/Dropbox/winLibs/netcdf-fortran-4.2/for > tran' > Making check in nf_test > make[1]: Entering directory > `/c/Users/Leon/Dropbox/winLibs/netcdf-fortran-4.2/nf > _test' > make nf_test.exe tst_f77_v2.exe ftst_vars.exe ftst_vars2.exe ftst_vars3.exe > fts > t_vars4.exe ftst_vars5.exe ftst_vars6.exe ftst_types.exe ftst_types2.exe > ftst_ty > pes3.exe ftst_groups.exe f90tst_vars.exe tst_types.exe tst_types2.exe > f90tst_var > s_vlen.exe tst_f90_nc4.exe f90tst_grps.exe f90tst_fill.exe f90tst_fill2.exe > f90t > st_vars3.exe f90tst_vars4.exe f90tst_vars2.exe ftst_v2.exe ftest.exe > tst_f90 > .exe > make[2]: Entering directory > `/c/Users/Leon/Dropbox/winLibs/netcdf-fortran-4.2/nf > _test' > make[2]: `nf_test.exe' is up to date. > /bin/sh ../libtool --tag=F77 --mode=link gfortran -I../fortran -I../f90 -g > -O > 2 -L/usr/local/lib -o tst_f77_v2.exe tst_f77_v2.o ../fortran/libnetcdff.la > -ln > etcdf > libtool: link: gfortran -I../fortran -I../f90 -g -O2 -o .libs/tst_f77_v2.exe > tst > _f77_v2.o -L/usr/local/lib ../fortran/.libs/libnetcdff.a -lnetcdf > ../fortran/.libs/libnetcdff.a(fort-v2compat.o): In function `c_ncpopt': > c:\Users\Leon\Dropbox\winLibs\netcdf-fortran-4.2\fortran/fort-v2compat.c:200: > un > defined reference to `ncopts' > ../fortran/.libs/libnetcdff.a(fort-v2compat.o): In function `ncgopt_': > c:\Users\Leon\Dropbox\winLibs\netcdf-fortran-4.2\fortran/fort-v2compat.c:221: > un > defined reference to `ncopts' > ../fortran/.libs/libnetcdff.a(fort-v2compat.o): In function `c_nccre': > c:\Users\Leon\Dropbox\winLibs\netcdf-fortran-4.2\fortran/fort-v2compat.c:243: > un > defined reference to `ncerr' > c:\Users\Leon\Dropbox\winLibs\netcdf-fortran-4.2\fortran/fort-v2compat.c:249: > un > defined reference to `ncerr' > ../fortran/.libs/libnetcdff.a(fort-v2compat.o): In function `c_ncopn': > c:\Users\Leon\Dropbox\winLibs\netcdf-fortran-4.2\fortran/fort-v2compat.c:295: > un > defined reference to `ncerr' > c:\Users\Leon\Dropbox\winLibs\netcdf-fortran-4.2\fortran/fort-v2compat.c:289: > un > defined reference to `ncerr' > ../fortran/.libs/libnetcdff.a(fort-v2compat.o): In function `c_ncddef': > c:\Users\Leon\Dropbox\winLibs\netcdf-fortran-4.2\fortran/fort-v2compat.c:321: > un > defined reference to `ncerr' > ../fortran/.libs/libnetcdff.a(fort-v2compat.o):c:\Users\Leon\Dropbox\winLibs\net > cdf-fortran-4.2\fortran/fort-v2compat.c:349: more undefined references to > `ncerr > ' follow > collect2: ld returned 1 exit status > make[2]: *** [tst_f77_v2.exe] Error 1 > make[2]: Leaving directory > `/c/Users/Leon/Dropbox/winLibs/netcdf-fortran-4.2/nf_ > test' > make[1]: *** [check-am] Error 2 > make[1]: Leaving directory > `/c/Users/Leon/Dropbox/winLibs/netcdf-fortran-4.2/nf_ > test' > make: *** [check-recursive] Error 1 > > Russ Rew UCAR Unidata Program address@hidden http://www.unidata.ucar.edu Ticket Details =================== Ticket ID: ACB-881122 Department: Support netCDF Priority: Normal Status: Closed