Problems in compiling the Plotting Package:"_nf_close_"...

Discussion about analysis, visualization, and collaboration tools and techniques

Moderators: arango, robertson

Post Reply
Message
Author
LeaF_7
Posts: 21
Joined: Tue Aug 12, 2014 8:32 pm
Location: Institute of Marine Research

Problems in compiling the Plotting Package:"_nf_close_"...

#1 Unread post by LeaF_7 »

Hello,

After I luckily build the ROMS build.bash, I tried to plot the output with the plotting package, this time I also encounter a problem.

Still my machine is a mac mini with Mavericks 10.9.4, with gcc 4.8.2 obtained from the macports, and I installed the NCL 6.2.0. After I run the makefile, the output end with this:

Code: Select all

Undefined symbols for architecture x86_64:
  "_nf_close_", referenced from:
      _crash_ in libUTIL.a(crash.o)
  "_nf_get_att_real_", referenced from:
      _get_nc2dat_ in libUTIL.a(get_nc2dat.o)
      _get_nc1dat_ in libUTIL.a(get_nc1dat.o)
      _get_nc3dat_ in libUTIL.a(get_nc3dat.o)
      _get_ncobs_ in libUTIL.a(get_ncobs.o)
  "_nf_get_att_text_", referenced from:
      _opencdf_ in libUTIL.a(opencdf.o)
      _get_nc2dat_ in libUTIL.a(get_nc2dat.o)
      _what_flds_ in libUTIL.a(what_flds.o)
      _get_nc3dat_ in libUTIL.a(get_nc3dat.o)
      _get_ncobs_ in libUTIL.a(get_ncobs.o)
  "_nf_get_var1_int_", referenced from:
      _opencdf_ in libUTIL.a(opencdf.o)
  "_nf_get_var1_real_", referenced from:
      _opencdf_ in libUTIL.a(opencdf.o)
      _get_nc3pos_ in libUTIL.a(get_nc3pos.o)
  "_nf_get_var1_text_", referenced from:
      _opencdf_ in libUTIL.a(opencdf.o)
  "_nf_get_var_real_", referenced from:
      _get_nc2dat_ in libUTIL.a(get_nc2dat.o)
      _get_nc3dat_ in libUTIL.a(get_nc3dat.o)
  "_nf_get_vara_double_", referenced from:
      _opencdf_ in libUTIL.a(opencdf.o)
  "_nf_get_vara_int_", referenced from:
      _opencdf_ in libUTIL.a(opencdf.o)
      _get_ncobs_ in libUTIL.a(get_ncobs.o)
  "_nf_get_vara_real_", referenced from:
      _opencdf_ in libUTIL.a(opencdf.o)
      _get_nc2dat_ in libUTIL.a(get_nc2dat.o)
      _get_nc1dat_ in libUTIL.a(get_nc1dat.o)
      _get_nc3dat_ in libUTIL.a(get_nc3dat.o)
      _get_ncobs_ in libUTIL.a(get_ncobs.o)
  "_nf_inq_", referenced from:
      _opencdf_ in libUTIL.a(opencdf.o)
      _get_nc2pos_ in libUTIL.a(get_nc2pos.o)
      _get_nc3pos_ in libUTIL.a(get_nc3pos.o)
  "_nf_inq_attlen_", referenced from:
      _opencdf_ in libUTIL.a(opencdf.o)
      _what_flds_ in libUTIL.a(what_flds.o)
  "_nf_inq_attname_", referenced from:
      _opencdf_ in libUTIL.a(opencdf.o)
      _get_nc2dat_ in libUTIL.a(get_nc2dat.o)
      _what_flds_ in libUTIL.a(what_flds.o)
      _get_nc1dat_ in libUTIL.a(get_nc1dat.o)
      _get_nc3dat_ in libUTIL.a(get_nc3dat.o)
      _get_ncobs_ in libUTIL.a(get_ncobs.o)
  "_nf_inq_dim_", referenced from:
      _opencdf_ in libUTIL.a(opencdf.o)
      _get_nc2dat_ in libUTIL.a(get_nc2dat.o)
      _time_indx_ in libUTIL.a(time_indx.o)
      _get_nc1dat_ in libUTIL.a(get_nc1dat.o)
      _get_nc3dat_ in libUTIL.a(get_nc3dat.o)
      _get_ncobs_ in libUTIL.a(get_ncobs.o)
  "_nf_inq_var_", referenced from:
      _opencdf_ in libUTIL.a(opencdf.o)
      _get_nc2dat_ in libUTIL.a(get_nc2dat.o)
      _get_nc2pos_ in libUTIL.a(get_nc2pos.o)
      _get_nc3pos_ in libUTIL.a(get_nc3pos.o)
      _time_indx_ in libUTIL.a(time_indx.o)
      _what_flds_ in libUTIL.a(what_flds.o)
      _get_nc1dat_ in libUTIL.a(get_nc1dat.o)
      ...
  "_nf_inq_varid_", referenced from:
      _opencdf_ in libUTIL.a(opencdf.o)
      _get_nc2dat_ in libUTIL.a(get_nc2dat.o)
      _get_nc3pos_ in libUTIL.a(get_nc3pos.o)
      _time_indx_ in libUTIL.a(time_indx.o)
      _get_nc1dat_ in libUTIL.a(get_nc1dat.o)
      _get_nc3dat_ in libUTIL.a(get_nc3dat.o)
      _get_ncobs_ in libUTIL.a(get_ncobs.o)
      ...
  "_nf_open_", referenced from:
      _opencdf_ in libUTIL.a(opencdf.o)
  "_nf_strerror_", referenced from:
      _crash_ in libUTIL.a(crash.o)
ld: symbol(s) not found for architecture x86_64
collect2: error: ld returned 1 exit status
make: *** [/Users/linfan/src/plot/executables/cnt] Error 1


I looked into the forum and find something similar here:viewtopic.php?f=31&t=2769&hilit=plotting+package

But this did not solve my problem...it seemed like a linking issue again.

I would be appreciate if anyone could help.

Thanks!

Fan Lin

User avatar
kate
Posts: 4088
Joined: Wed Jul 02, 2003 5:29 pm
Location: CFOS/UAF, USA

Re: Problems in compiling the Plotting Package:"_nf_close_".

#2 Unread post by kate »

You show us the error but not the link command. Perhaps there's something useful on the wiki?

LeaF_7
Posts: 21
Joined: Tue Aug 12, 2014 8:32 pm
Location: Institute of Marine Research

Re: Problems in compiling the Plotting Package:"_nf_close_".

#3 Unread post by LeaF_7 »

kate wrote:You show us the error but not the link command. Perhaps there's something useful on the wiki?
Hi kate,

I followed the instruction from the url and modified the link lib thing in the /Compilers/Darwin-gfortran.mk and the script is down here.

Code: Select all

 libncar = -lncarg -lncarg_gks -lncarg_c -lXpm -lX11 -lXext \
                        -lcairo -lfontconfig -lpixman-1 -lfreetype -lexpat \
                        -lpng -lz -lpthread -lbz2 -lXrender -lnetcdf -lhdf5_hl\
                        -lhdf5
  
                 LIBNCAR := -L$(NCARG_ROOT)/lib -L/opt/local/lib $(libncar)
                 LIBS  := ${LIBNCAR} ${LCDF}
                 #LIBS  = -L$(NCARG_ROOT)/lib -lncarg -lncarg_gks -lncarg_c
                 LIBS  += -L/usr/X11R6/lib -lX11
After I add -lnetcdff, the output become more friendly with:

Code: Select all

Undefined symbols for architecture x86_64:
  "_mapchi_", referenced from:
      _mapgrd_ in libUTIL.a(hbackground.o)
ld: symbol(s) not found for architecture x86_64
collect2: error: ld returned 1 exit status
make: *** [/Users/linfan/src/plot/executables/cnt] Error 1
I will keep looking into wiki to see anything else I can do, it seemed like the link command is the main issue for starters like me. Usually I don't know what happened when an error message came out...

Thanks!

User avatar
kate
Posts: 4088
Joined: Wed Jul 02, 2003 5:29 pm
Location: CFOS/UAF, USA

Re: Problems in compiling the Plotting Package:"_nf_close_".

#4 Unread post by kate »

Hmm, I went to the ncl library directory and typed:

Code: Select all

pacman6 195% foreach foo ( lib* )
foreach? echo $foo
foreach? nm $foo | grep -i mapchi
foreach? end
libblas_ncl.a
libcgm.a
libfftpack5_dp.a
libhlu.a
liblapack_ncl.a
libncarg.a
libncarg_c.a
libncarg_gks.a
libncarg_ras.a
libncl.a
libnclapi.a
libnfp.a
libnfpfort.a
libngmath.a
libnio.a
libsphere3.1_dp.a
So I don't have them either. A web search brings up:
The names of the routines MAPTRP and MAPCHI were changed to MDPTRP and
MDPCHI. I don't remember if their arguments were changed, but I suspect
not. However, these routines are purely internal routines of EZMAP and
not part of the user interface, so you call them at your own risk.

Dave Kennison

On Tue, 22 Jun 2004, Huiting Mao wrote:

> Hi,
>
> it seems that maptrp.f and mapchi.f in ncargraph version 4.0 are not used in
> version 4.3 any more. Does anyone know why these two programs are eliminated
> and have they been replaced with new programs?
>
> Thank you very much,
>

LeaF_7
Posts: 21
Joined: Tue Aug 12, 2014 8:32 pm
Location: Institute of Marine Research

Re: Problems in compiling the Plotting Package:"_nf_close_".

#5 Unread post by LeaF_7 »

The problem is here in the makefile due to some inappropriate modification. Here is part of the makefile,

Code: Select all

#NCAR_VERSION ?= NCARG410
119 #NCAR_VERSION ?= NCARG422
120 #NCAR_VERSION ?= NCARG430
121 #NCAR_VERSION ?= NCARG431
122 #NCAR_VERSION ?= NCARG441
123 NCAR_VERSION ?= NCARG520
124 #NCAR_VERSION ?= NCARG620
I add something (the last line) that cause the error, although I don't know why, but keep it as above the compiling succeeded, I get the cntG kind of things

I think I should record how I installed ROMS and the plotting packages on a mac with current version(2014) requirements....

Thanks a lot for your help, kate

Kind Regard

Post Reply