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

[netCDF #QMK-787479]: [netCDF #TWB-422268 ] one question on the use of netcdf



Hello,

There is a lot going on here, so please forgive me for looking at it one part 
at a time.

First, I'm not sure what the value of $NETCDF is; presumably it is the location 
of the netcdf-fortran dependencies (such as libnetcdf, HDF5, etc).  

LD_LIBRARY_PATH tells the C runtime where to look for shared libraries when 
they are not on the default system path.  So, ncdump (linked against libnetcdf) 
would need LD_LIBRARY_PATH to tell it where your libnetcdf library is.

It is possible that you have a different libnetcdf on your system, in the 
default LD_LIBRARY_PATH, that lacks the `nc__testurl` (DAP) functionality.  
This would explain the behavior you are seeing.  What happens if you try the 
following?

    $ LD_LIBRARY_PATH=$(NETCDF/lib64) ncdump -c simple_xy.nc

 Alternatively, you could replace 
"LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$NETCDF/lib64" with 
"LD_LIBRARY_PATH=$NETCDF/lib64:$LD_LIBRARY_PATH".  This would ensure that the 
libnetcdf you installed in the $NETCDF directory is found first.

Finally, you could compile netcdf *statically*.  If you are using 'configure', 
you would pass '--disable-shared --enable-static' to 'configure' when 
configuring the netcdf, and then build as normal.  You would then have a static 
'libnetcdf.a' library, and the utilities (ncdump, ncgen, etc) would not require 
any shared netcdf library to work.

Let me know if this helps, or if you are still encountering any issues.  Thanks!

-Ward



> Dear colleague:
> 
> 
> When I use netcdf to read data in fortran, I meet a very strange question. If 
> I set the environment variable like this,
> export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$NETCDF/lib64
> I can compile the code file and get the executable file.But I can not use
> ncdump -c simple_xy.nc to get the information about the nc file. And the 
> System give me these hints:
> ncdump: symbol lookup error: ncdump: undefined symbol: nc__testurl
> 
> 
> Therefore,I delete this setting:
> export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$NETCDF/lib64
> eventually, I can use the ncdump -c simple_xy.nc to get the information about 
> the nc file.
> But I can not get the executable file and run it.
> 
> 
> Additionally, my machine is in 64bit,so the lib should be lib64.
> 
> 
> Could you tell me how to fix it?
> Thank you very much.  ~~~
> 
> 
> --
> 
> ?????
> ??????????
> ????????????7?
> 
> Zhen Zhuang,Master
> Institute of Oceanology,Chinese Academy of Sciences
> Address?7 Nanhai Road, Qingdao,Shandong 266071, China
> 
> 
> 
> 
> 
> 
> 
> 


Ticket Details
===================
Ticket ID: QMK-787479
Department: Support netCDF
Priority: Normal
Status: Closed