[Met_help] Compilation failed MET v2.0

ISMAEL MARIN CARRION Ismael.Marin at uclm.es
Thu May 13 11:47:25 MDT 2010


Hi John,

It works. The problem has been fixed using the patch for BUFRLIB and using the same versions of GNU. 

Thanks for your help.


-----Mensaje original-----
De: John Halley Gotway [mailto:johnhg at ucar.edu]
Enviado el: jue 13/05/2010 19:13
Para: ISMAEL MARIN CARRION
CC: met_help at ucar.edu
Asunto: Re: [Met_help] Compilation failed MET v2.0
 
Isma,

Regarding the BUFRLIB issue, my apologies.  I forgot to point you to the bug fix for compiling BUFRLIB with GNU compilers.

Please take a look on this page:
   http://www.dtcenter.org/met/users/support/known_issues/METv2.0/index.php
For the following entry:
   # 05/27/2009: Users compiling BUFRLIB with the GNU gfortran compiler should replace "BUFRLIB/nvnwin.f" with the contents of this version: nvnwin.f
Please try updating the BUFRLIB file nvnwin.f with the patched version posted there.  And you can ignore those additional warnings.

Regarding compiler versions, I'm not sure if that'll be a problem or not.  My g++, gcc, and gfortran are all version 4.3.2.  If your gfortran is version 4.2.5, it's possible that you have gcc and g++
somewhere on your system that are the same version.

For example, I have multiple version of gcc installed (ls -la /usr/bin/gcc*):
   /usr/bin/gcc -> gcc-4.3*
   /usr/bin/gcc-4.1*
   /usr/bin/gcc-4.3*
And /usr/bin/gcc just points to gcc-4.3

Take a look to see if you have a 4.2.5 version of gcc and g++ that'd be consistent with gfortran.  It's possible that gcc and g++ are just pointing to older versions of the compilers.

Thanks,
John

ISMAEL MARIN CARRION wrote:
> Dear John, thanks for your response. I had tried to compile BUFRLIB with gfortran and gcc, but when I run:
> 
> $gfortran -c -DUNDERSCORE -fno-second-underscore *.f *.F
> 
> I got:
> 
> nemock.f:77.72:
> 
>       IF(NEMO(I:I).EQ.CHRSET(J:J)) GOTO 10                              
>                                                                        1
> nemock.f:81.72:
> 
> 10    ENDDO                                                             
>                                                                        2
> Warning: Obsolete: GOTO at (1) jumps to END of construct at (2)
> nvnwin.f:84.16:
> 
>       INVN(I) = BMISS                                                   
>                1
> Error: Arithmetic overflow converting REAL(8) to INTEGER(4) at (1)
> stndrd.f:202.72:
> 
>          GOTO 10                                                        
>                                                                        1
> stndrd.f:207.72:
> 
> 10    ENDDO                                                             
>                                                                        2
> Warning: Obsolete: GOTO at (1) jumps to END of construct at (2)
> 
> 
> and, If I try to build MET, it fails in:
> 
> *** Making pcp_combine application ***
> 
> 
> g++ -o pcp_combine pcp_combine.cc \
> -Wall -Wshadow -static   -DMET_BASE=\"/usr/local/METv2.0\" \
> -I../../lib -I/usr/local/include -I/usr/local/include \
> -L../../lib -L/usr/local/lib -L/usr/local/lib \
> -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 \
> 
> /usr/local/lib/libnetcdf_c++.a(netcdf.o)(.text+0x53a): In function `NcError::set_err(int)':
> /usr/local/gcc-4.2.0/lib/gcc/x86_64-unknown-linux-gnu/4.2.5/../../../../include/c++/4.2.5/bits/char_traits.h:258: undefined reference to `std::basic_ostream<char, std::char_traits<char> >& std::__ostream_insert<char, std::char_traits<char> >(std::basic_ostream<char, std::char_traits<char> >&, char const*, long)'
> ...
> 
> gcc and g++ is v.3.3.3 , while gfortran is v.4.2.5. NETCDF was compiled with gfortran. Moreover, I've patched MET 2.0.
> 
> Best regards.
> 
> -----Mensaje original-----
> De: John Halley Gotway [mailto:johnhg at ucar.edu]
> Enviado el: jue 13/05/2010 17:16
> Para: ISMAEL MARIN CARRION
> CC: met_help at ucar.edu
> Asunto: Re: [Met_help] Compilation failed MET v2.0
>  
> 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
> 
> 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.ucar.edu/pipermail/met_help/attachments/20100513/b3c40a87/attachment.html 


More information about the Met_help mailing list