Unidata - To provide the data services, tools, and cyberinfrastructure leadership that advance Earth system science, enhance educational opportunities, and broaden participation. Unidata
         
  advanced  
 

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

[netCDF #NVK-272087]: NetCDF linking issues on Mac OSX 10.5.2



Hi,

After you built netCDF 3.6.2 from source, did you also install it by
invoking "make install"?

The default location for installing netCDF is not /usr/local/ACCESS/,
so if you built and installed it, presumably you must have explicitly
specified --prefix=/usr/local/ACCESS as an argument to the configure
script, or the library in /usr/local/ACCESS/lib/ is not the one you
built.

By using "ls -l /usr/local/ACCESS/lib/libnetcdf.a" you could find out
when that library file was installed, and if it turns out to be before
you built the library, that might indicate what the problem is.  By
invoking "file /usr/local/ACCESS/lib/libnetcdf.a" you would see what
kind of file MAC OS X thinks it is.  If it's built for the
architecture you are using, it should just report "current ar
archive".

> Should I be using a different link symbol (besides -lnetcdf -lnsl)
> to link to the libnetcdf.a library?

Typically you also need to tell the compiler where to look using "-L",
for example

  ... -L/usr/local/ACCESS/lib -lnetcdf

and as far as I know "-lnsl" is not necessary for linking netCDF
libraries on Mac OS X, but it shouldn't cause a problem to specify an
unneeded library.

--Russ

Russ Rew                                         UCAR Unidata Program
russ@xxxxxxxxxxxxxxxx                     http://www.unidata.ucar.edu



Ticket Details
===================
Ticket ID: NVK-272087
Department: Support netCDF
Priority: Normal
Status: Closed


 
 
  Contact Us     Site Map     Search     Terms and Conditions     Privacy Policy     Participation Policy
 
National Science Foundation (NSF) UCAR Office of Programs University Corporation for Atmospheric Research (UCAR)   Unidata is a member of the UCAR Office of Programs, is managed by the University Corporation for Atmospheric Research, and is sponsored by the National Science Foundation.
P.O. Box 3000     Boulder, CO 80307-3000 USA     Tel: 303-497-8643     Fax: 303-497-8690