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
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.