Hi,
I am trying to install a plotting package for ROMS on a linux-12.04 lts 64bit and I have a problem maybe when am trying to link with the ncarg libraries.
I use ncarg 5.2.0 (binary package installed in /usr/local) netcdf-4. I have problems to get the plot package in Myplot from makefile in src/plot.
> cd src/plot/src :(where is makefile i do this:)
> CC=gcc FC=gfortran F77=gfortran F90=gfortran CPPFLAGS=-DpgiFortran make
After compiling I have that message on the screen:
cd Build_plt; /usr/bin/gfortran -c -frepack-arrays -O3 -ffast-math cnt.f90
/usr/bin/gfortran -frepack-arrays -O3 -ffast-math Build_plt/cnt.o Build_plt/cpmpxy2d.o Build_plt/mapeod.o Build_plt/stumsl.o Build_plt/stumxy.o Build_plt/vvumxy.o -o /home/********/MyPlot/cnt Build_plt/libUTIL.a -L/usr/local/lib -lncarg -lncarg_gks -lncarg_c -L/usr/X11R6/lib64 -lX11
Build_plt/libUTIL.a(crash.o): In function `crash_':
crash.f90:(.text+0x1c): undefined reference to `nf_close_'
crash.f90:(.text+0x122): undefined reference to `nf_strerror_'
crash.f90:(.text+0x150): undefined reference to `nf_close_'
Build_plt/libUTIL.a(opencdf.o): In function `opencdf_':
opencdf.f90:(.text+0x1d4): undefined reference to `nf_open_'
opencdf.f90:(.text+0x24a): undefined reference to `nf_inq_'
opencdf.f90:(.text+0x30c): undefined reference to `nf_inq_attname_'
opencdf.f90:(.text+0x3d1): undefined reference to `nf_get_att_text_'
opencdf.f90:(.text+0x601): undefined reference to `nf_inq_var_'
opencdf.f90:(.text+0x854): undefined reference to `nf_inq_dim_'
opencdf.f90:(.text+0x96b): undefined reference to `nf_inq_varid_'
opencdf.f90:(.text+0x9b9): undefined reference to `nf_inq_var_'
opencdf.f90:(.text+0xa33): undefined reference to `nf_inq_attname_'
opencdf.f90:(.text+0xa8c): undefined reference to `nf_inq_attlen_'
opencdf.f90:(.text+0xad1): undefined reference to `nf_get_att_text_'
opencdf.f90:(.text+0xb12): undefined reference to `nf_inq_varid_'
opencdf.f90:(.text+0xb6d): undefined reference to `nf_inq_var_'
opencdf.f90:(.text+0xba0): undefined reference to `nf_inq_dim_'
opencdf.f90:(.text+0xbd0): undefined reference to `nf_get_vara_double_'
opencdf.f90:(.text+0xc5e): undefined reference to `nf_inq_dim_'
opencdf.f90:(.text+0xfd0): undefined reference to `nf_inq_varid_'
opencdf.f90:(.text+0x101e): undefined reference to `nf_get_vara_double_'
opencdf.f90:(.text+0x1068): undefined reference to `nf_inq_var_'
opencdf.f90:(.text+0x10db): undefined reference to `nf_inq_attname_'
opencdf.f90:(.text+0x1157): undefined reference to `nf_get_att_text_'
opencdf.f90:(.text+0x1285): undefined reference to `nf_inq_'
opencdf.f90:(.text+0x14c0): undefined reference to `nf_inq_dim_'
opencdf.f90:(.text+0x1613): undefined reference to `nf_inq_var_'
opencdf.f90:(.text+0x1762): undefined reference to `nf_get_var1_text_'
opencdf.f90:(.text+0x17c5): undefined reference to `nf_inq_'
opencdf.f90:(.text+0x1884): undefined reference to `nf_inq_attname_'
opencdf.f90:(.text+0x194f): undefined reference to `nf_get_att_text_'
opencdf.f90:(.text+0x1afc): undefined reference to `nf_inq_dim_'
opencdf.f90:(.text+0x1bf9): undefined reference to `nf_inq_var_'
opencdf.f90:(.text+0x1e2c): undefined reference to `nf_inq_dim_'
opencdf.f90:(.text+0x1fa7): undefined reference to `nf_open_'
opencdf.f90:(.text+0x2085): undefined reference to `nf_open_'
opencdf.f90:(.text+0x2379): undefined reference to `nf_inq_varid_'
opencdf.f90:(.text+0x23c9): undefined reference to `nf_get_vara_double_'
opencdf.f90:(.text+0x2413): undefined reference to `nf_inq_var_'
opencdf.f90:(.text+0x2483): undefined reference to `nf_inq_attname_'
opencdf.f90:(.text+0x269a): undefined reference to `nf_get_var1_text_'
opencdf.f90:(.text+0x2a36): undefined reference to `nf_inq_varid_'
opencdf.f90:(.text+0x2a86): undefined reference to `nf_get_vara_double_'
opencdf.f90:(.text+0x33a9): undefined reference to `nf_inq_varid_'
opencdf.f90:(.text+0x33f9): undefined reference to `nf_get_vara_double_'
opencdf.f90:(.text+0x3947): undefined reference to `nf_get_vara_real_'
opencdf.f90:(.text+0x39c9): undefined reference to `nf_get_att_text_'
opencdf.f90:(.text+0x3a45): undefined reference to `nf_get_var1_real_'
opencdf.f90:(.text+0x3a7f): undefined reference to `nf_inq_varid_'
opencdf.f90:(.text+0x3aa7): undefined reference to `nf_get_vara_real_'
opencdf.f90:(.text+0x4101): undefined reference to `nf_get_att_text_'
opencdf.f90:(.text+0x4126): undefined reference to `nf_get_var1_real_'
opencdf.f90:(.text+0x4152): undefined reference to `nf_get_var1_int_'
opencdf.f90:(.text+0x419d): undefined reference to `nf_get_var1_int_'
opencdf.f90:(.text+0x428a): undefined reference to `nf_get_var1_int_'
opencdf.f90:(.text+0x42b6): undefined reference to `nf_get_var1_real_'
opencdf.f90:(.text+0x431f): undefined reference to `nf_inq_attname_'
opencdf.f90:(.text+0x44be): undefined reference to `nf_get_vara_real_'
opencdf.f90:(.text+0x4500): undefined reference to `nf_inq_dim_'
opencdf.f90:(.text+0x4528): undefined reference to `nf_get_vara_int_'
opencdf.f90:(.text+0x4584): undefined reference to `nf_inq_dim_'
opencdf.f90:(.text+0x45ac): undefined reference to `nf_get_vara_int_'
opencdf.f90:(.text+0x45fe): undefined reference to `nf_get_att_text_'
opencdf.f90:(.text+0x4791): undefined reference to `nf_get_var1_int_'
opencdf.f90:(.text+0x49de): undefined reference to `nf_inq_varid_'
opencdf.f90:(.text+0x4a06): undefined reference to `nf_get_vara_real_'
Build_plt/libUTIL.a(get_nc2dat.o): In function `get_nc2dat_':
get_nc2dat.f90:(.text+0xc7): undefined reference to `nf_inq_varid_'
get_nc2dat.f90:(.text+0x117): undefined reference to `nf_inq_var_'
get_nc2dat.f90:(.text+0x260): undefined reference to `nf_inq_varid_'
get_nc2dat.f90:(.text+0x288): undefined reference to `nf_get_var_real_'
get_nc2dat.f90:(.text+0x2ba): undefined reference to `nf_get_vara_real_'
get_nc2dat.f90:(.text+0x48c): undefined reference to `nf_get_att_real_'
get_nc2dat.f90:(.text+0x588): undefined reference to `nf_inq_attname_'
get_nc2dat.f90:(.text+0x664): undefined reference to `nf_get_att_text_'
get_nc2dat.f90:(.text+0x733): undefined reference to `nf_inq_dim_'
get_nc2dat.f90:(.text+0x99e): undefined reference to `nf_get_vara_real_'
get_nc2dat.f90:(.text+0xc7c): undefined reference to `nf_get_att_real_'
Build_plt/libUTIL.a(get_nc3pos.o): In function `get_nc3pos_':
get_nc3pos.f90:(.text+0x462): undefined reference to `nf_inq_'
get_nc3pos.f90:(.text+0x528): undefined reference to `nf_inq_var_'
get_nc3pos.f90:(.text+0x84a): undefined reference to `nf_inq_varid_'
get_nc3pos.f90:(.text+0x900): undefined reference to `nf_get_var1_real_'
Build_plt/libUTIL.a(what_flds.o): In function `what_flds_':
what_flds.f90:(.text+0xa5): undefined reference to `nf_inq_var_'
what_flds.f90:(.text+0x128): undefined reference to `nf_inq_attlen_'
what_flds.f90:(.text+0x171): undefined reference to `nf_get_att_text_'
what_flds.f90:(.text+0x2ab): undefined reference to `nf_inq_attname_'
Build_plt/libUTIL.a(get_nc3dat.o): In function `get_nc3dat_':
get_nc3dat.f90:(.text+0xd1): undefined reference to `nf_inq_varid_'
get_nc3dat.f90:(.text+0x126): undefined reference to `nf_inq_var_'
get_nc3dat.f90:(.text+0x23e): undefined reference to `nf_inq_attname_'
get_nc3dat.f90:(.text+0x31e): undefined reference to `nf_get_att_text_'
get_nc3dat.f90:(.text+0x448): undefined reference to `nf_inq_dim_'
get_nc3dat.f90:(.text+0x779): undefined reference to `nf_get_vara_real_'
get_nc3dat.f90:(.text+0xad9): undefined reference to `nf_get_att_real_'
get_nc3dat.f90:(.text+0xd3a): undefined reference to `nf_inq_varid_'
get_nc3dat.f90:(.text+0xd62): undefined reference to `nf_get_var_real_'
get_nc3dat.f90:(.text+0xd99): undefined reference to `nf_get_vara_real_'
get_nc3dat.f90:(.text+0x1006): undefined reference to `nf_get_att_real_'
Build_plt/libUTIL.a(time_indx.o): In function `time_indx_':
time_indx.f90:(.text+0x61): undefined reference to `nf_inq_varid_'
time_indx.f90:(.text+0xb3): undefined reference to `nf_inq_var_'
time_indx.f90:(.text+0x119): undefined reference to `nf_inq_dim_'
Build_plt/libUTIL.a(get_nc1dat.o): In function `get_nc1dat_':
get_nc1dat.f90:(.text+0x64): undefined reference to `nf_inq_varid_'
get_nc1dat.f90:(.text+0xb4): undefined reference to `nf_inq_var_'
get_nc1dat.f90:(.text+0x1b9): undefined reference to `nf_inq_attname_'
get_nc1dat.f90:(.text+0x26a): undefined reference to `nf_get_att_real_'
get_nc1dat.f90:(.text+0x3e8): undefined reference to `nf_inq_dim_'
get_nc1dat.f90:(.text+0x4a0): undefined reference to `nf_get_vara_real_'
get_nc1dat.f90:(.text+0x5d4): undefined reference to `nf_get_att_real_'
Build_plt/libUTIL.a(get_nc2pos.o): In function `get_nc2pos_':
get_nc2pos.f90:(.text+0x55): undefined reference to `nf_inq_'
get_nc2pos.f90:(.text+0x171): undefined reference to `nf_inq_var_'
Build_plt/libUTIL.a(get_ncobs.o): In function `get_ncobs_':
get_ncobs.f90:(.text+0x7b): undefined reference to `nf_inq_varid_'
get_ncobs.f90:(.text+0xd0): undefined reference to `nf_inq_var_'
get_ncobs.f90:(.text+0x1de): undefined reference to `nf_inq_attname_'
get_ncobs.f90:(.text+0x29a): undefined reference to `nf_get_att_text_'
get_ncobs.f90:(.text+0x3ba): undefined reference to `nf_inq_dim_'
get_ncobs.f90:(.text+0x5cb): undefined reference to `nf_get_vara_real_'
get_ncobs.f90:(.text+0x614): undefined reference to `nf_inq_varid_'
get_ncobs.f90:(.text+0x698): undefined reference to `nf_get_vara_int_'
get_ncobs.f90:(.text+0x809): undefined reference to `nf_get_att_real_'
collect2: ld returned 1 exit status
make: *** [/home/******/MyPlot/cnt] Errore 1
So, thanks in advance for your help to help me to solve this problem.
p.s.:
Also within the roms-plot directory src, I have the following command:
LIBS := -L$(NCARG_ROOT)/lib -lncarg -lncarg_gks -lncarg_c
LIBS += -L/usr/X11R6/lib64 -lX11
but I do not seem to have those libraries in the directory...
plot package problem
Re: plot package problem
The error is with the netcdf library, not with the ncarg libraries. You need to add the paths to your netcdf library (if not /usr/local/lib) and also -lnetcdff -lnetcdf. Maybe more stuff - check "nc-config --flibs" to see what it wants.