[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[netCDF #ILQ-730613]: Can't find 'netcdf MOD nf90 put att real'
- Subject: [netCDF #ILQ-730613]: Can't find 'netcdf MOD nf90 put att real'
- Date: Mon, 05 Aug 2013 13:23:48 -0600
Natalie,
In what directory did you install the netCDF C and Fortran libraries?
That is, what did you specify as the --prefix=... option to the two
configure scripts when building and installing the netCDF C library
and the netCDF Fortran library?
Also, what versions of the netCDF C and Fortran libraries did you
end up using? Did you run "make check" for the netCDF Fortran library,
and did it complete successfully?
Finally, what is the output from running the two commands
nc-config --all
and
nf-config --all
?
I really can't tell what's going wrong just looking at the error
messages from the linker, but it looks like you may not have the
right -L and -I flags for netCDF. The directory specified by -I
should end in "/include" and the directory for -L should end it
"/lib" ...
--Russ
> Thank you for your reply, I have been trying to get this to work today. My
> executable came with a make file which seems to do this linking that you
> suggest. I located the following code, please excuse the long path names, I
> didn't use default settings:
>
> gfortran -fbounds-check -o jules.exe
> /user/mastf/nd0001/CarbonCycle/test/jules-vn3.3/jules.o \
> \
> /user/mastf/nd0001/CarbonCycle/test/jules-vn3.3/utils/drhook_dummy/parkind1.o
> /user/mastf/nd0001/CarbonCycle/test/jules-vn3.3/utils/drhook_dummy/yomhook.o \
> /user/mastf/nd0001/CarbonCycle/test/jules-vn3.3/utils/mpi_dummy/mpi.o \
> -L/user/mastf/nd0001/CarbonCycle/test/jules-vn3.3
> -L/user/mastf/nd0001/CarbonCycle/test/lib \
> -J/user/mastf/nd0001/CarbonCycle/test/jules-vn3.3/mods
> -I/user/mastf/nd0001/CarbonCycle/test/jules-vn3.3/mods
> -I/user/mastf/nd0001/CarbonCycle/test/include
> -I/user/mastf/nd0001/CarbonCycle/test/jules-vn3.3/utils/drhook_dummy \
> -ljules -lnetcdf -lnetcdff
>
> and the errors resulting:
>
> /user/mastf/nd0001/CarbonCycle/test/jules-vn3.3/libjules.a(driver_ncdf_mod.o):
> In function `__driver_ncdf_mod_MOD_file_ncdf_write_var_3d':
> driver_ncdf_mod.F90:(.text+0x1e51): undefined reference to
> `__netcdf_MOD_nf90_put_var_3d_real'
> /user/mastf/nd0001/CarbonCycle/test/jules-vn3.3/libjules.a(driver_ncdf_mod.o):
> In function `__driver_ncdf_mod_MOD_file_ncdf_write_var_2d':
> driver_ncdf_mod.F90:(.text+0x2975): undefined reference to
> `__netcdf_MOD_nf90_put_var_2d_real'
> /user/mastf/nd0001/CarbonCycle/test/jules-vn3.3/libjules.a(driver_ncdf_mod.o):
> In function `__driver_ncdf_mod_MOD_file_ncdf_write_var_1d':
> driver_ncdf_mod.F90:(.text+0x3395): undefined reference to
> `__netcdf_MOD_nf90_put_var_1d_real'
> /user/mastf/nd0001/CarbonCycle/test/jules-vn3.3/libjules.a(driver_ncdf_mod.o):
> In function `__driver_ncdf_mod_MOD_file_ncdf_write_var_scalar':
> driver_ncdf_mod.F90:(.text+0x3891): undefined reference to
> `__netcdf_MOD_nf90_put_var_real'
> /user/mastf/nd0001/CarbonCycle/test/jules-vn3.3/libjules.a(driver_ncdf_mod.o):
> In function `__driver_ncdf_mod_MOD_file_ncdf_read_var_3d':
> driver_ncdf_mod.F90:(.text+0x4432): undefined reference to
> `__netcdf_MOD_nf90_get_var_3d_real'
> /user/mastf/nd0001/CarbonCycle/test/jules-vn3.3/libjules.a(driver_ncdf_mod.o):
> In function `__driver_ncdf_mod_MOD_file_ncdf_read_var_2d':
> driver_ncdf_mod.F90:(.text+0x4f56): undefined reference to
> `__netcdf_MOD_nf90_get_var_2d_real'
> /user/mastf/nd0001/CarbonCycle/test/jules-vn3.3/libjules.a(driver_ncdf_mod.o):
> In function `__driver_ncdf_mod_MOD_file_ncdf_read_var_1d':
> driver_ncdf_mod.F90:(.text+0x5976): undefined reference to
> `__netcdf_MOD_nf90_get_var_1d_real'
> /user/mastf/nd0001/CarbonCycle/test/jules-vn3.3/libjules.a(driver_ncdf_mod.o):
> In function `__driver_ncdf_mod_MOD_file_ncdf_read_var_scalar':
> driver_ncdf_mod.F90:(.text+0x5e72): undefined reference to
> `__netcdf_MOD_nf90_get_var_real'
> /user/mastf/nd0001/CarbonCycle/test/jules-vn3.3/libjules.a(driver_ncdf_mod.o):
> In function `__driver_ncdf_mod_MOD_file_ncdf_def_attr_int':
> driver_ncdf_mod.F90:(.text+0x6256): undefined reference to
> `__netcdf_MOD_nf90_put_att_int'
> /user/mastf/nd0001/CarbonCycle/test/jules-vn3.3/libjules.a(driver_ncdf_mod.o):
> In function `__driver_ncdf_mod_MOD_file_ncdf_def_attr_real':
> driver_ncdf_mod.F90:(.text+0x6375): undefined reference to
> `__netcdf_MOD_nf90_put_att_real'
> collect2: ld returned 1 exit status
> make: *** [jules.exe] Error 1
>
> It appears to have a problem with some of the variables and not the location
> of the folders. What do you suggest?
> Appreciation in advance,
> Natalie
>
> ________________________________________
> From: Unidata netCDF Support [address@hidden]
> Sent: Wednesday, July 31, 2013 9:19 PM
> To: Douglas N Dr (Maths)
> Cc: address@hidden
> Subject: [netCDF #ILQ-730613]: Can't find 'netcdf MOD nf90 put att real'
>
> Hi Natalie,
>
> > I have the NetCDF 4.2 libraries successfully installed, including the
> > Fortran libraries. When I try to make my executable, the variable
> > '__netcdf_MOD_nf90_put_att_real' (and various others) is not
> > recognised. The command 'nm libnetcdff.a' shows me similar variables
> > such as '__netcdf_MOD_nf90_put_att_fourbytereal'.
> >
> > Is it possible that I am using the wrong version?
>
> Probably not. Any version of the netCDF C library > version 4.1.3 is
> compatible with netcdf-fortran-4.2. The most recent version of the
> netCDF C library is netcdf-4.3.0, so that would currently have the most
> bug fixes for anything that works with netcdf-fortran-4.2. But I suspect
> the problem you are seeing is simpler than any recent bug fixed in the
> netCDF C library, so netcdf-4.2.0 is probably OK.
>
> If you have not built the netCDF Fortran as a shared library (for example
> by configuring with --disable-shared), then you need to link your Fortran
> programs using both the Fortran and C libraries, for example
>
> gfortran myprog.f90 -o myprog -I/usr/local/include -L/usr/local/lib -lnetcdff
> -lnetcdf
>
> and possibly other libraries as well. You can see what's needed by
> running the nf-config utility, which is installed when you build and
> install netcdf-fortran, like so
>
> nf-config --flibs
>
> You can even use this on your compile line, for example:
>
> gfortran myprog.f90 -o myprog `nf-config --fflags --flibs`
>
> If your system has the pkg-config program, you can use it instead,
> as follows:
>
> gfortran myprog.f90 -o myprog `pkg-config --cflags --libs netcdf-fortran`
>
> (For pkg-config, "cflags" means "compiler flags", so that's not a typo.)
>
> --Russ
>
>
> Russ Rew UCAR Unidata Program
> address@hidden http://www.unidata.ucar.edu
>
>
>
> Ticket Details
> ===================
> Ticket ID: ILQ-730613
> Department: Support netCDF
> Priority: Normal
> Status: Closed
>
>
Russ Rew UCAR Unidata Program
address@hidden http://www.unidata.ucar.edu
Ticket Details
===================
Ticket ID: ILQ-730613
Department: Support netCDF
Priority: Normal
Status: Closed