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

[netCDF #FTD-335729]: netcdf F90 - trouble linking

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.


  • Subject: [netCDF #FTD-335729]: netcdf F90 - trouble linking
  • Date: Fri, 02 Nov 2007 08:36:49 -0600

Tim,

I'm comparing a library from a 3.6.2 gfortran installation I just built with
what you are reporting, and your output from running "nm" matches mine.  I'm
compiling a file from the netcdf/examples/F90 directory like this:

gfortran -g -O2 -o pres_temp_4D_rd pres_temp_4D_rd.o
../../libsrc/.libs/libnetcdf.a

and it works fine.  If I use the "-L" option instead and compile like this:

gfortran -g -O2 -o pres_temp_4D_rd pres_temp_4D_rd.o -L../../libsrc/.libs
-lnetcdf

it also works OK, as it should since these are equivalent.  By "works fine", I
mean
that running the resulting program from the examples/F90/ source directory
produces this result:

 ./pres_temp_4D_rd
 *** SUCCESS reading example file pres_temp_4D.nc!

I'm in a meeting all day today, so won't be able to get back to this until next
week,
but if you can duplicate the above, it might be some help in diagnosing the
problem.
I don't see anything obviously wrong in how you're trying to link.

--Russ




Russ Rew                                         UCAR Unidata Program
address@hidden                     http://www.unidata.ucar.edu



Ticket Details
===================
Ticket ID: FTD-335729
Department: Support netCDF
Priority: Normal
Status: Closed