[Met_help] Compilation failed MET v2.0

John Halley Gotway johnhg at ucar.edu
Thu May 13 09:16:19 MDT 2010


Isma,

I see by the information you sent that you're using the c++ and f77 compilers.  Let me suggest that you instead try using: gcc, g++, and gfortran.  Please check if those compilers are available on
your machine by typing:
   which gcc
   which g++
   which gfortran

If they are available, please try compiling BUFRLIB as follows:
   rm *.o *.a
   gcc -c -DUNDERSCORE *.c
   gfortran -c -DUNDERSCORE -fno-second-underscore *.f *.F
   ar crv libbufr.a *.o

And then in you MET Makefile, set:
   CXX = g++
   FC  = gfortran

If you do not have gfortran available on your system, you could use f77 instead.  But then you will need to also link to the "f2c" or "g2c" library.  That library may already be on your machine
(libg2c.a or libf2c.a) or you could download/compile it locally.  When you compile with gfortran, you do NOT need that library.

Here's a couple of other things to tell you:

(1) You may find the MET Online Tutorial to be helpful:
   http://www.dtcenter.org/met/users/support/online_tutorial/METv2.0/index.php
    In particular, there is a section on compiling MET:
   http://www.dtcenter.org/met/users/support/online_tutorial/METv2.0/compilation/index.php

(2) If you haven't already done so, please retrieve the latest set of patches for METv2.0 from here:
   http://www.dtcenter.org/met/users/support/known_issues/METv2.0/index.php
    Just follow the directions in the first section titled "All Recommended Updates".

Please let us know if you continue to experience problems compiling/running MET.

Thanks,
John Halley Gotway
met_help at ucar.edu

ISMAEL MARIN CARRION wrote:
> Dear staff of MET HELP,
> 
> I'm trying to install MET v.2.0. First, I compile BUFRLIB such as:
> 
> In preproc.sh:74 cpp -P -traditional-cpp -D$byte_order $i $bnf
> It generates wrdlen.g and irev.f
> 
> $ f77 -c -DUNDERSCORE -fno-second-underscore *.f
> 
> $c++ -c -DUNDERSCORE *.c
> crbmg.c: In function ‘void crbmg_(char*, f77int*, f77int*, f77int*)’:
> crbmg.c:73: warning: deprecated conversion from string constant to ‘char*’
> crbmg.c:83: warning: deprecated conversion from string constant to ‘char*’
> crbmg.c:89: warning: deprecated conversion from string constant to ‘char*’
> crbmg.c:106: warning: deprecated conversion from string constant to ‘char*’
> crbmg.c:115: warning: deprecated conversion from string constant to ‘char*’
> crbmg.c:147: warning: deprecated conversion from string constant to ‘char*’
> restd.c: In function ‘void restd_(f77int*, f77int*, f77int*, f77int*)’:
> restd.c:85: warning: deprecated conversion from string constant to ‘char*’
> restd.c:86: warning: deprecated conversion from string constant to ‘char*’
> restd.c:98: warning: deprecated conversion from string constant to ‘char*’
> 
> $ ar crv /usr/local/lib/libbufr.a *.o
> 
> After this, when I compile MET v2.0 with variables in Makefile:
> CXX = c++
> FC = f77
> BUFR_BASE = /usr/local
> BUFR_INCS = -I$(BUFR_BASE)/include
> BUFR_LIBS = -L$(BUFR_BASE)/lib
> GSL_BASE = /usr/local
> GSL_INCS = -I$(GSL_BASE)/include
> GSL_LIBS = -L$(GSL_BASE)/lib
> F2C_BASE =
> F2C_INCS =
> F2C_LIBS =
> F2C_LIBNAME =
> 
> I get:
> 
> *** Making the Model Evaluation Tools Project ***
> 
> *** Making vx_afm Library ***
> 
> cp libvx_afm.a ../.
> ...
> 
> cp libvx_wrfmode.a ../.
> 
> *** Making pcp_combine application ***
> 
> *** Finished Making pcp_combine application ***
> ....
> *** Making pb2nc application ***
> 
> c++ -o pb2nc pb2nc.cc pb2nc_Conf.o numpbmsg.o openpb.o readpb.o dumppb.o \
> -Wall -Wshadow -static   -DMET_BASE=\"/usr/local/METv2.0\" \
> -I../../lib -I/usr/local/include -I/usr/local/include -I/usr/local/include  \
> -L../../lib -L/usr/local/lib -L/usr/local/lib -L/usr/local/lib  \
> -lbufr -lvx_pb_util \
> -lvx_met_util -lvx_analysis_util -lvx_wrfdata -lvx_met_util \
> -lvx_contable -lvx_grib_classes \
> -lvx_econfig -lvx_gsl_prob -lgsl \
> -lvx_plot_util  -lvx_render -lvx_pxm -lvx_color -lvx_ps -lvx_afm \
> -lvx_data_grids -lvx_gnomon -lvx_nav -lvx_cal -lvx_util -lvx_math -lm \
> -lnetcdf_c++ -lnetcdf \
>   -lgfortran
> openpb.o(.text+0x35): In function `openpb_':
> : undefined reference to `f_open'
> dumppb.o(.text+0x132): In function `dumppb_':
> : undefined reference to `s_cat'
> dumppb.o(.text+0x15c): In function `dumppb_':
> : undefined reference to `f_open'
> dumppb.o(.text+0x190): In function `dumppb_':
> : undefined reference to `f_open'
> ...
> /usr/local/lib/libbufr.a(valx.o)(.text+0x2f4): In function `valx_':
> : undefined reference to `e_wsfi'
> /usr/local/lib/libbufr.a(rjust.o)(.text+0x2e): In function `rjust_':
> : undefined reference to `s_cmp'
> /usr/local/lib/libbufr.a(rjust.o)(.text+0x69): In function `rjust_':
> : undefined reference to `s_cmp'
> /usr/local/lib/libbufr.a(rjust.o)(.text+0xdd): In function `rjust_':
> : undefined reference to `s_copy'
> collect2: ld returned 1 exit status
> make[3]: *** [pb2nc] Error 1
> make[2]: *** [all] Error 2
> make[1]: *** [targets] Error 2
> make: *** [all] Error 2
> 
> Moreover, I've tested with gfortran (it doesn't compile all .f of BUFRLIB), g++ and gcc with similar or worst results.
> 
> 
> 
> Best regards and thanks in advance.
> Ms. Isma Marín Carrión
> 
> 
> 
> ------------------------------------------------------------------------
> 
> _______________________________________________
> Met_help mailing list
> Met_help at mailman.ucar.edu
> http://mailman.ucar.edu/mailman/listinfo/met_help


More information about the Met_help mailing list