[Met_help] MET compilation trouble

John Halley Gotway johnhg at rap.ucar.edu
Tue Jan 8 10:30:49 MST 2008


Andy,

The MET code which links to BUFRLIB is expecting an underscore at the end of all of the subroutines in BUFRLIB.  So for example, it's looking for "openbf_" rather than "openbf".  And it's expecting
exactly one "_" at the end, hence the no-second-underscore" option.  Since I don't have ifort available, I can't tell you for sure which compiler options enable this.  But searching on the internet,
the "-us" and "no2underscores" options may do it.

If that's correct, compiling BUFRLIB would entail:
gcc -c -DUNDERSCORE *.c
ifort -c -us -Mno2underscores *.f
ar crv libbufr.a *.o

However, using f77 is probably a better idea anyway.

Good luck,
John

Andy_Holland at urscorp.com wrote:
> 
> John,
>       Thanks for the quick reply.  I did use the equivalent to
> -Mnounderscore for the Intel compiler.  Here's the output of 'nm libbufr.a
> | grep openbf':
> 
> openbf.o:
> 00000000 T openbf
> 00000000 d openbf$BLK$format_pack.0.0
> 00000000 b openbf$BORT_STR.0.0
> 00000084 b openbf$BSTR.0.0
> 000002c0 d openbf$CPRINT.0.0
> 00000080 b openbf$IFIRST.0.0
>          U openbf
>          U openbf
>          U openbf
>          U openbf
> 
> I think I'll just try using f77.
> 
> Thanks,
> 
> Andy Holland
> Air Quality Modeler
> URS Corporation
> 1600 Perimeter Park Drive
> Suite 400
> Morrisville, NC 27560
> Direct: (303) 796-4694 or (919) 461-1467
> Cell: (919) 619-4218
> Fax: (919) 461-1415
> andy_holland at urscorp.com
> 
>                                                                               
>  This e-mail and any attachments are confidential. If you receive this        
>  message in error or are not the intended recipient, you should not retain,   
>  distribute, disclose or use any of this information and you should destroy   
>  the e-mail and any attachments or copies.                                    
>                                                                               
> 
> 
> 
> 
> 
> 
> 
>                                                                            
>              John Halley Gotway                                            
>              <johnhg at rap.ucar.edu>                                         
>                                                                         To 
>              01/08/2008 11:57 AM             Andy_Holland at URSCorp.com,     
>                                              met_help at ucar.edu             
>                                                                         cc 
>                                                                            
>                                                                    Subject 
>                                              Re: [Met_help] MET            
>                                              compilation trouble           
>                                                                            
>                                                                            
>                                                                            
>                                                                            
>                                                                            
>                                                                            
> 
> 
> 
> 
> Andy,
> 
> If possible, I'd suggest using compilers from the same family of compilers
> rather than mixing them.  Section 2.2. of the MET User's Guide lists the
> GNU gcc/f77 compilers and the PGI pgCC/pgf77
> compilers as the ones we've developed and tested MET with.  So if you have
> access to f77, I'd strongly suggest using that as the Fortran compiler.
> Then you can follow the instructions for building
> BUFRLIB in section 2.6 and for building MET in section 2.9 - I think that
> would solve your problem.
> 
> If you don't have access to f77, we can give the Intel Fortran compiler a
> shot and see how it goes.  Unfortunately, I don't have access to that
> compiler to test it out.
> 
> Those error messages are coming from BUFRLIB.  The linker is having trouble
> finding those routines in the library archive file "libbufr.a".  It may
> have to do with the options you chose for how to
> deal with underscores in routine names when compiling BUFRLIB.
> 
> You could try the following:
> - Go into the directory where you've built BUFRLIB.
> - Run the 'nm' command on the file "libbufr.a" to see it contents, and
> search for "openbf_", for example: nm libbufr.a | grep "openbf"
> - See what's defined in there: is it "openbf" or "openbf_" or something
> else?
> - Take a look at the options for the Intel Fortran compiler (man ifort).
> You want to look for something similar to the "-DUNDERSCORE" and
> "-fno-second-underscore" options that are used for the GNU
> compilers.
> - If you're able to find the equivalent options for the Intel Fortran
> compiler, substitute them into the directions listed in section 2.6 for
> building BUFRLIB.
> - Try rebuilding BUFRLIB with those options, and then try rebuilding MET.
> 
> Please let me know if this solves your problem, or if we need to try
> something else.
> 
> Thanks,
> John Halley Gotway
> met_help at ucar.edu
> 
> Andy_Holland at URSCorp.com wrote:
>> I'm trying to compile MET on an HP running RedHat Enterprise Linux 5
> using
>> the Intel Fortran compiler and the GNU C compilers.  I've compiled all of
>> the other libraries with no problem.  Below is a snippet of my make
> logfile
>> for MET.  It continues on with more undefined references.  I'm not sure
>> which library these undefined references are pointed to.  Any help would
> be
>> greatly appreciated.
>>
>> Thank you,
>> Andy Holland
>>
>>
>> *** Making pb2nc application ***
>>
>>
>>
>> /usr/bin/g++ -o pb2nc pb2nc.cc pb2nc_Conf.o numpbmsg.o openpb.o readpb.o
>> dumppb.o  \
>>         -g -Bstatic  -DMET_BASE=\"/models/METv1.0\" \
>>         -I/usr/local/include/gsl \
>>         -I../../lib -I../../lib -I/usr/local/include
>> -I/usr/local/lib/BUFRLIB -I/usr/lib/gcc/i386-redhat-linux/3.4.6/include \
>>         -L../../lib -L../../lib -L/usr/local/lib -L/usr/local/include
>> -L/usr/local/lib/BUFRLIB -I/usr/lib/gcc/i386-redhat-linux/3.4.6 \
>>         -lbufr -lvx_grib_classes -lvx_wrfdata -lvx_econfig \
>>         -lvx_data_grids -lvx_math -lvx_cal -lvx_util -lvx_met_util -lm  \
>>         -lnetcdf_c++ -lnetcdf
>> numpbmsg.o: In function `numpbmsg':
>> /models/METv1.0/src/pb2nc/numpbmsg.f:22: undefined reference to `ufbtab_'
>> openpb.o: In function `openpb':
>> /models/METv1.0/src/pb2nc/openpb.f:20: undefined reference to `for_open'
>> /models/METv1.0/src/pb2nc/openpb.f:21: undefined reference to `openbf_'
>> /models/METv1.0/src/pb2nc/openpb.f:22: undefined reference to `datelen_'
>>
>>
>>
>> Andy Holland
>> Air Quality Modeler
>> URS Corporation
>> 1600 Perimeter Park Drive
>> Suite 400
>> Morrisville, NC 27560
>> Direct: (303) 796-4694 or (919) 461-1467
>> Cell: (919) 619-4218
>> Fax: (919) 461-1415
>> andy_holland at urscorp.com
>>
>>
> 
>>  This e-mail and any attachments are confidential. If you receive this
> 
>>  message in error or are not the intended recipient, you should not
> retain,
>>  distribute, disclose or use any of this information and you should
> destroy
>>  the e-mail and any attachments or copies.
> 
> 
>>
>>
>>
>>
>>
>> ------------------------------------------------------------------------
>>
>> _______________________________________________
>> 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