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

[netCDF #YUG-992413]: netcdf error when compiling



> U nc_open_mem
this only means that the fortran library references
that function. To see if it is defined in libnetcdf,
you would need to do something like this
> nm libnetcdf.a | grep nc_open_mem
and you should see something like this:
> T nc_open_mem
The U means uses, the T means defines.
But I can guess the answer. You appear to be using
libnetcdf 4.1.1, correct? The nc_open_mem and
nc_inq_path were were added after this version.
You will need to use a later version of libnetcdf.
I do not recall offhand when nc_inq_path was added
but nc_open_mem was added in an even later version.
If you can use the latest release, that is best.


> Full Name: Brian Emery
> Email Address: address@hidden
> Organization: UCSB
> Package Version: 4.1.1
> Operating System: CentOS 6
> Hardware: Dell
> Description of problem: Hi,
> I'm compiling a fortran model that uses netcdf. I'm stuck on this error which 
> appears to be related to the netcdf install:
> 
> [rt@newton R_CA_nc]# make -f Makefile_gf
> gfortran  -ffixed-line-length-0 -g -m64 -fPIC -o R_CA_nc R_CA_nc.o 
> bathy_subroutines.o -L/usr/local/lib -lnetcdff -lnetcdf 
> -Wl,-rpath,/usr/local/lib /data/MOP_v1.1/f90_modules/libproc_gf.a 
> -I/usr/local/include -I/data/MOP_v1.1/f90_modules
> /usr/local/lib/libnetcdff.so: undefined reference to `nc_inq_path'
> /usr/local/lib/libnetcdff.so: undefined reference to `nc_open_mem'
> collect2: ld returned 1 exit status
> make: *** [R_CA_nc] Error 1
> 
> Based on a posted suggestion, I tried this from /usr/local/lib, which seems 
> to indicate that I am linking to the right netcdf library:
> 
> [rt@newton lib]# nm libnetcdff.a | grep nc_open_mem
> U nc_open_mem
> [rt@newton lib]# nm libnetcdff.so | grep nc_open_mem
> U nc_open_mem
> 
> I apologize for the email, but I'm not sure where to go from here. Any 
> suggestions would be appreciated.
> 
> Regards,
> Brian
> 
> 
> 
> 

=Dennis Heimbigner
  Unidata


Ticket Details
===================
Ticket ID: YUG-992413
Department: Support netCDF
Priority: Normal
Status: Closed
===================
NOTE: All email exchanges with Unidata User Support are recorded in the Unidata 
inquiry tracking system and then made publicly available through the web.  If 
you do not want to have your interactions made available in this way, you must 
let us know in each email you send to us.