[Wrf-users] nf_ link errors

drb at atmos.umd.edu drb at atmos.umd.edu
Wed Mar 19 11:47:00 MDT 2008


Hi, Davide:

These are warnings about your netCDF symbols links for Fortran. Here are
several things to try:
1> It may be that these symbols (nf_???) are defined after the symbol that
calls them. Run "ranlib" on your libnetcdf.a file (in my system, this is
in the/usr/local/lib) . This will create an archive for your library
objects.
2> Check the same directory for another library named libnetcdff.a. If you
have this it means that your netCDF compile created a separate library for
the the Fortran commands. You should recompile netCDF without the
"--enable-shared" option for configure. It also might help to use
"--enable-v2 --enable-f77" options.
3> Run a "nm -g" on libnetcdf.a (it's a long file so you might want to
dump the output into another file by adding "> nm_output.txt" to the
command line and then review it in a text editor). Search for the symbols
listed in your error runs--there will be several entries. For each symbol,
you should see  at least one "T" for text (defined). If there are only
entries with "U" for undefined, there was a problem with your netCDF
installation and you will need to compile it again.
4> If the symbols in your error messages are not in "nm -g" output, you
will have to upgrade to a newer version of netCDF. I think the latest is
v. 3.6.2.
5> Make sure that netCDF was loaded with the same Fortran and C compiler
that you are using for WRF. If not, you will need to reinstall netCDF with
your current compilers.
6> Another source of this problem may be using an old compiler for netCDF
and WRF. I know that I had to upgrade PGI to at least v. 7.0 to get rid of
all my symbol link problems.
If you have not done a netCDF compile before, I have more information on
installing netCDF with ifort, so e-mail if you need it. The netCDF site
http://www.unidata.ucar.edu/software/netcdf/ has good information on how
to install with any compiler. In addition, most of the compiler websites
like PGI have information on loading netCDF.
Good luck! I struggled with this problem for a while so feel free to
e-mail me at drb at atmos.umd.edu if you have more questions on it.

Debra Baker
University of Maryland







> ------------------------------
>
> Message: 2
> Date: Tue, 18 Mar 2008 13:23:50 +0100
> From: Davide Cittaro <daweonline at gmail.com>
> Subject: [Wrf-users] nf_ linking errors
> To: Wrf-users at ucar.edu
> Message-ID: <AF246F9B-4941-47E6-883A-1A83140A20F6 at gmail.com>
> Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes
>
> Dear all,
> I'm still trying to build WRF with gcc+gfortran (+openmpi). I've
> applied the proposed patch to include gfortran and gcc in configure
> script. As I run compile em_real the only errors I get are undefined
> references to nf_* functions. This happens in external/io_netcdf stuff
> and, later, in exe builds...
> As far as I understand, I need to have netcdf built with the same
> compiler I'm using, to be sure I've tried to compile netcdf-3.6.2 with
> gcc+gfortran (I've also tried with mpicc+mpif90) and I've placed them
> in my home. I've set NETCDF envvar, I've corrected symlinks in WRF
> directory, I've corrected configure.wrf and set LD_LIBRARY_PATH in a
> coherent way. Still I get:
>
> gfortran -w  -ffree-form -ffree-line-length-none -fconvert=big-endian -
> frecord-marker=4 -c  -I/home/dcittaro/usr/netcdf-3.6.2-gnu/include -
> I../ioapi_share diffwrf.f
> diffwrf io_netcdf is being built now.
> gfortran -w -ffree-form -ffree-line-length-none -fconvert=big-endian -
> frecord-marker=4 -I/home/dcittaro/usr/netcdf-3.6.2-gnu/include -I../
> ioapi_share -fconvert=big-endian -o diffwrf diffwrf.o wrf_io.o
> field_routines.o module_wrfsi_static.o -L/home/dcittaro/usr/
> netcdf-3.6.2-gnu/lib -lnetcdf ../../frame/wrf_debug.o ../../frame/
> module_wrf_error.o -L../../external/esmf_time_f90 -lesmf_time
> wrf_io.o: In function `ext_ncd_get_var_info_':
> wrf_io.f:(.text+0x2857): undefined reference to `nf_inq_varid_'
> wrf_io.f:(.text+0x2895): undefined reference to `nf_inq_vartype_'
> wrf_io.f:(.text+0x2bb4): undefined reference to `nf_get_att_int_'
>
> [cut]
>
> I have no more ideas on how to solve this.
> On the other side, I've noticed this:
>
> dcittaro at node8 ~/usr/netcdf-3.6.2-gnu/lib $ nm libnetcdf.so | grep
> nf_inq_varid
>
> The symbol nf_inq_varid (the first referenced in my error list...)
> doesn't exist, but
>
> dcittaro at node8 ~/usr/netcdf-3.6.2-gnu/lib $ nm libnetcdf.so | grep
> nc_inq_varid
> 0000000000026c70 T nc_inq_varid
>
> Any hint/help is very appreciated!
> Thanks
> d
> ---
> Davide Cittaro
> daweonline at gmail.com
> http://www.daweonline.net
>
>
>
> ------------------------------
>
> _______________________________________________
> Wrf-users mailing list
> Wrf-users at ucar.edu
> http://mailman.ucar.edu/mailman/listinfo/wrf-users
>
>
> End of Wrf-users Digest, Vol 43, Issue 13
> *****************************************
>





More information about the Wrf-users mailing list