[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

20030627: Problem linking f90 netcdf program using pgf90 on Linux



Daniel,

> To: netCDF support <address@hidden>
> From: "Daniel S Schaffer" <address@hidden>
> Subject: Problem linking f90 netcdf program
> Organization: NOAA
> Keywords: netCDF pgf90 Linux

The above message contained the following:

> I have netcdf installed on my Intel Linux system.  It looks like
> the f90 version is available because I find the following in 
> $NETCDF_ROOT/include:
> 
> ncvalues.h   netcdf.h   netcdf.inc  typesizes.mod
> netcdfcpp.h  netcdf.hh  netcdf.mod
> 
> so the module file appears to be there.
> 
> Here is the contents of $NETCDF_ROOT/lib
> 
> libnetcdf.a  libnetcdf_c++.a
> 
> 
> 
> I have the following test program:
> 
> program read_weights
> use netcdf, only : nf90_open, nf90_nowrite
> implicit none
> 
> integer :: ncid
> integer :: status
> 
> status = nf90_open(path = "src_to_dst.nc", mode = nf90_nowrite, &
>   ncid = ncid )
> 
> end program
> 
> 
> I compile and link as follows:
> pgf90 -o rdem -I$NETCDF_ROOT/include read_weights.f90 -L$NETCDF_ROOT/lib 
> -lnetcdf
> 
> and get the following link error:
> 
> read_weights.o: In function `MAIN_':
> read_weights.o(.text+0x50): undefined reference to `netcdf_nf90_open_'
> 
> I also tried the intel compiler and got the same error.
> Any suggestions on what I might be doing wrong?

There is no function named "netcdf_nf90_open_" in the netCDF package.
It must be one of your own.

> Thanks,
> Dan
> 
> Dan Schaffer, Research Associate            e-mail: address@hidden
> NOAA/ERL/Forecast Systems Lab               phone:  (303) 497-7252
> R/E/FS5  325 Broadway                       fax:    (303) 497-6301

Regards,
Steve Emmerson