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.
> This is the source code I used to compile;
>
> $ ifort -O3 deform_1.f /usr/lib/libnetcdf.a -o deform
>
> However, when I run the source code above and some errors come out like
this;
>
> /tmp/ifortAxQu9r.o(.text+0x101d): in function 'MAIN__':
> : undefined reference to `nf_open_'
...
I think you also need to reference the "include" directory if your "deform_1.f"
program has an "include netcdf.inc" statment in it, so depending on where you
installed netcdf, your command line should look something like:
$ ifort -O3 -I/usr/include deform_1.f /usr/lib/libnetcdf.a -o deform
If you have a "use" staement referring to an installed netCDF module such as
netcdf.mod for the Fortran-90 interface, you will also need to indicate to
ifort where to find that, possible with a "-M" argument.
--Russ
Russ Rew UCAR Unidata Program
address@hidden http://www.unidata.ucar.edu
Ticket Details
===================
Ticket ID: LPR-530788
Department: Support netCDF
Priority: Normal
Status: Closed