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.
> Dear sir/madam, > > We are trying to compile and build the netcdf library on a linux 64-bit > system, however we are not managing to build the necessary interfaces > for Fortran. > > When I run the configure script with --disable-f90 and --disable-f77, > it compiled and worked fine, and I also managed to compile and run a C > program which uses the netcdf library. Good! > > I also tried downloading the 64-bit binary releases, but when I try to > compile and link a fortran program, I get the error: > > ld: skipping incompatible /usr/local/lib/libnetcdf.a when searching > for -lnetcdf > > > When I run the configure script without --disable-f90 and > --disable-f77, the configure fails as shown in the attached file > > log_configure_fortran_type_check.txt > > > I tried the configure script with the prefix > --disable-fortran-type-check, and the configure script ran fine - the > output is shown in > > log_configure_no_fortran_type_check.txt > > Then executing "make" also terminates successfully - the output is > shown in: > > makelog.txt > > And then I get errors when running "make check". Refer to: > > makechecklog.txt > > Example of these errors are: > > util.F:(.text+0x2183): undefined reference to `max_float__' > util.F:(.text+0x2198): undefined reference to `max_double__' > > > I tried running "make install" all the same. But whenever I try to > compile my fortran code that uses netcdf it always fails with the > error: > > ld: skipping incompatible /usr/local/lib/libnetcdf.a when searching > for -lnetcdf > > > I do not have problems with the linking in the make file of the fortran > program - I'm 100% positive on that. > > The fortran compiler we are using is ifort. > > Can you please help us? > > Regards, > Joel > > NetCDF is known to work with ifort, but your problem is that ifort is not working for the netCDF configure script. Look in the config.log file for the results of the attempt to build, the part that is the problem is indicated in the output here: checking if Fortran "byte" is C "signed char"... configure: error: Could not link conftestf.o and conftest.o Until this works, the fortran API will not work. The answer is on your config.log file. If that does not help you, send it to me and I'll take a look. Thanks, Ed Ticket Details =================== Ticket ID: NLA-464967 Department: Support netCDF Priority: Normal Status: Closed