[Met_help] Compiling METv2.0

John Halley Gotway johnhg at rap.ucar.edu
Tue Jul 7 10:14:24 MDT 2009


Ed,

Great!  I'm glad it worked.  You should be able to copy the bin files to /usr/local/bin, and that should work fine.  However, be sure to leave the METv2.0 directory where it is.  When you run MET,
there are some static data files it uses, and it expects to find them in that directory.

However there is one thing I'd like you to double-check.  The one tool that gives us the most trouble is the PB2NC tool which interfaces with BUFRLIB.  Please try running that one test script manually
to make sure it doesn't have a runtime error.  Go into METv2.0/scripts, and run ./test_pb2nc.sh.  Let me know if you get a runtime error message.

Thanks,
John

Ed Warnken wrote:
> John,
> 
> Well beings NetCDF was compiled with gnu c all I did was re-compile the
> BUFRLIB and changed the Makefile for Met and it worked!!!  I ran all the
> tests and 10 files in ./out too.  Can I copy the bin files to
> /usr/local/bin or do they have to stay in Met source bin area?
> 
> Ed
> 
> John Halley Gotway wrote:
>> Ed,
>>
>> You will need to recompile NetCDF, but I think that GSL will be fine.
>>
>> Try compiling NetCDF as follows:
>>
>> cd /top/level/NetCDF/location
>> CC=/path/to/gcc
>> CXX=/path/to/g++
>> FC=''
>> F90=''
>> ./configure --prefix=/path/to/where/you/want/netcdf/installed
>> make
>> make install
>>
>> I'm setting FC and F90 above to empty so as to disable their compilation.  MET doesn't use the Fortran interface to NetCDF, so you don't need to compile it (unless you'd like to).
>>
>> And remember, before compiling MET, you'll need to set up your Makefile again, using the file Makefile_gnu as a starting point.
>>
>> Hope that helps.
>>
>> John
>>
>>
>> Ed Warnken wrote:
>>   
>>> John,
>>>
>>> Crud so the install of Portland isn't complete?  So all I would have to
>>> re-compile is Bufrlib and Met with gfortran and gcc right?
>>> Not netcdf and gsl?  If so I'll give that a try.
>>>
>>> Ed
>>>
>>> John Halley Gotway wrote:
>>>     
>>>> Ed,
>>>>
>>>> OK, that's what I'd thought.  It looks like "pgio_errno" (and all those other undefined symbols) aren't defined in any of those libraries.  It looks like there's a problem with the installation of
>>>> this version of the PGI compilers.  In fact, I found another machine here which does have PGI version 8.0-4 and did find that the library "libpgc.a" does exist with those symbols.  And that library is
>>>> missing from yours.
>>>>
>>>> You could try the following to see if/where that library does exist:
>>>> cd /opt/pgi/linux86
>>>> find ./ -name libpgc.a
>>>>
>>>> Or you could try building MET with an older version of the PGI compilers.  You may have better luck.  Look in /opt/pgi/linux86 to see if there's an earlier version you could use.  If not, you could
>>>> also try using the GNU "g++/gfortran" compilers if those are present on your machine.
>>>>
>>>> John
>>>>
>>>> Ed Warnken wrote:
>>>>   
>>>>       
>>>>> Hey John,
>>>>>
>>>>> Ok that seemed to work so here is the file.
>>>>>
>>>>> John Halley Gotway wrote:
>>>>>     
>>>>>         
>>>>>> Ed,
>>>>>>
>>>>>> Ah, I think when you called the script command it launched a new shell and defaulted to "sh".  Try the commands in a little different order:
>>>>>>
>>>>>> script ~/check_libs.log
>>>>>> csh
>>>>>> cd /opt/pgi/linux86/8.0-2/lib
>>>>>> foreach file (`ls *.a`)
>>>>>> echo "*********************** $file ***********************"
>>>>>> nm $file | grep "pgio_errno"
>>>>>> end
>>>>>> CNTRL-D
>>>>>>
>>>>>>
>>>>>> ... OR if that still doesn't work, try this using a different syntax ...
>>>>>>
>>>>>> script ~/check_libs.log
>>>>>> cd /opt/pgi/linux86/8.0-2/lib
>>>>>> for file in `ls *.a`
>>>>>> do
>>>>>> echo "*********************** $file ***********************"
>>>>>> nm $file | grep "pgio_errno"
>>>>>> done
>>>>>> CNTRL-D
>>>>>>
>>>>>> And then send me that file "~/check_libs.log".
>>>>>>
>>>>>> Thanks,
>>>>>> John
>>>>>>
>>>>>>
>>>>>> Ed Warnken wrote:
>>>>>>   
>>>>>>       
>>>>>>           
>>>>>>> John,
>>>>>>>
>>>>>>> When I copy the line foreach file I get a syntax error message in the
>>>>>>> attached file.
>>>>>>>
>>>>>>> John Halley Gotway wrote:
>>>>>>>     
>>>>>>>         
>>>>>>>             
>>>>>>>> Ed,
>>>>>>>>
>>>>>>>> So there's still a bunch of undefined references in that compilation log.  I pulled out the undefined symbol from each error messages and found that all of them are defined in the library file
>>>>>>>> "libpgc.a".  That's the library we're trying to link to with when we say "-lpgc".  And this is for version 7.1-5, so it's possible that's it's different for version 8.
>>>>>>>>
>>>>>>>> These errors are rather unusual.  I believe that the compiler usually automatically links in these types of standard libraries.  Can you tell me, have you used this version of the compiler to compile
>>>>>>>> other code?  I'm wondering if there may be an issue in how the compiler is installed - which is something you'd need a sys admin's help with.
>>>>>>>>
>>>>>>>> We could try to locate where one of these undefined symbols is defined for your compiler.
>>>>>>>> Try running the following commands:
>>>>>>>>
>>>>>>>> csh
>>>>>>>> script ~/check_libs.log
>>>>>>>> cd /opt/pgi/linux86/8.0-2/lib
>>>>>>>> foreach file (`ls *.a`)
>>>>>>>> echo "*********************** $file ***********************"
>>>>>>>> nm $file | grep "pgio_errno"
>>>>>>>> end
>>>>>>>> CNTRL-D
>>>>>>>>
>>>>>>>> And then send me the file ~/check_libs.log.  That should tell me if and where those undefined symbols are actually defined.
>>>>>>>>
>>>>>>>> Thanks,
>>>>>>>> John
>>>>>>>>
>>>>>>>>
>>>>>>>> Ed Warnken wrote:
>>>>>>>>   
>>>>>>>>       
>>>>>>>>           
>>>>>>>>               
>>>>>>>>> Morning John,
>>>>>>>>>
>>>>>>>>> Well I added the three libraries but it said it couldn't find the pgc
>>>>>>>>> one.  So for grins I removed just that one and here is the log file.
>>>>>>>>>
>>>>>>>>> John Halley Gotway wrote:
>>>>>>>>>     
>>>>>>>>>         
>>>>>>>>>             
>>>>>>>>>                 
>>>>>>>>>> Ed,
>>>>>>>>>>
>>>>>>>>>> OK, now we're running into errors I haven't seen before.  I'll need to get
>>>>>>>>>> a hold of PGI version 8 to do some more testing.
>>>>>>>>>>
>>>>>>>>>> In your top-level MET Makefile, please try adding three libraries to the
>>>>>>>>>> "FC_LIBS" line.  So change "FC_LIBS",
>>>>>>>>>>
>>>>>>>>>> FROM: FC_LIBS = -L/opt/pgi/linux86/8.0-2/lib -lpgftnrtl -lrt -lpthread
>>>>>>>>>> TO:   FC_LIBS = -L/opt/pgi/linux86/8.0-2/lib -lpgftnrtl -lrt -lpthread
>>>>>>>>>> -lpgsse1 -lpgsse2 -lpgc
>>>>>>>>>>
>>>>>>>>>> And then try recompiling MET.  Please let me know how it goes.  It looks
>>>>>>>>>> like we may need to update the default MET Makefile for PGI version 8.
>>>>>>>>>>
>>>>>>>>>> Thanks,
>>>>>>>>>> John
>>>>>>>>>>
>>>>>>>>>>   
>>>>>>>>>>       
>>>>>>>>>>           
>>>>>>>>>>               
>>>>>>>>>>                   
>>>>>>>>>>> Hey John,
>>>>>>>>>>>
>>>>>>>>>>> Well that was weird because I saw that as well the pgf90 was still in
>>>>>>>>>>> there.  I checked the time on the libbufr.a file and it was the time I
>>>>>>>>>>> created it with ar crv, but I didn't delete the .o and .a files so
>>>>>>>>>>> that's probably where I messed up.  Anyway here is the new make_met.log
>>>>>>>>>>> file and I don't see pgf90 in it all.
>>>>>>>>>>>
>>>>>>>>>>> John Halley Gotway wrote:
>>>>>>>>>>>     
>>>>>>>>>>>         
>>>>>>>>>>>             
>>>>>>>>>>>                 
>>>>>>>>>>>                     
>>>>>>>>>>>> Ed,
>>>>>>>>>>>>
>>>>>>>>>>>> So you (1) rebuilt BUFRLIB using pgf77 and then (2) tried rebuilding
>>>>>>>>>>>> MET.
>>>>>>>>>>>> But you still saw the same errors.
>>>>>>>>>>>>
>>>>>>>>>>>> Those errors really look like they're still coming from BUFRLIB being
>>>>>>>>>>>> compiled with pgf90.  In fact, I tried myself compiling BUFRLIB using
>>>>>>>>>>>> pgf90 and then linking a build of MET to that version of BUFRLIB.  I was
>>>>>>>>>>>> able to reproduce exactly the same error messages you're seeing.
>>>>>>>>>>>>
>>>>>>>>>>>> Here's what you can do.  Execute the command:
>>>>>>>>>>>> nm /usr/local/lib/libbufr.a
>>>>>>>>>>>>
>>>>>>>>>>>> That will list the contents of the BUFRLIB library to which MET is
>>>>>>>>>>>> linking.  If you see a bunch of "pgf90" strings in there, you'll know
>>>>>>>>>>>> that
>>>>>>>>>>>> BUFRLIB still isn't compiled properly.
>>>>>>>>>>>>
>>>>>>>>>>>> If that's the case try recompiling BUFRLIB again:
>>>>>>>>>>>> cd /usr/local/src/BUFRLIB
>>>>>>>>>>>> rm *.o *.a
>>>>>>>>>>>> pgcc -c -DUNDERSCORE *.c
>>>>>>>>>>>> pgf77 -c -DUNDERSCORE -Mnosecond_underscore *.f *.F
>>>>>>>>>>>> ar crv libbufr.a *.o
>>>>>>>>>>>> cp libbufr.a /usr/local/lib/.
>>>>>>>>>>>>
>>>>>>>>>>>> And then try recompiling MET again.  I'm wondering if you did rebuild it
>>>>>>>>>>>> using pgf77, but forget to copy it over to /usr/local/lib.  That's where
>>>>>>>>>>>> you've set in the Makefile for the linker to look.
>>>>>>>>>>>>
>>>>>>>>>>>> Let me know how it goes.  It looks like there may be some other errors
>>>>>>>>>>>> after the BUFRLIB ones that we'll need to address.  But let's fix this
>>>>>>>>>>>> BUFRLIB issue first.
>>>>>>>>>>>>
>>>>>>>>>>>> John
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>>       
>>>>>>>>>>>>           
>>>>>>>>>>>>               
>>>>>>>>>>>>                   
>>>>>>>>>>>>                       
>>>>>>>>>>>>> Hey John,
>>>>>>>>>>>>>
>>>>>>>>>>>>> Well I got the same errors so I'm also attaching the MET Makefile so
>>>>>>>>>>>>> you
>>>>>>>>>>>>> can see if I'm messing up in that too.
>>>>>>>>>>>>>
>>>>>>>>>>>>> Ed
>>>>>>>>>>>>>
>>>>>>>>>>>>> John Halley Gotway wrote:
>>>>>>>>>>>>>
>>>>>>>>>>>>>         
>>>>>>>>>>>>>             
>>>>>>>>>>>>>                 
>>>>>>>>>>>>>                     
>>>>>>>>>>>>>                         
>>>>>>>>>>>>>> Ed,
>>>>>>>>>>>>>>
>>>>>>>>>>>>>> No, you shouldn't have to.  MET doesn't use the Fortran interface to
>>>>>>>>>>>>>> NetCDF and there's no Fortran in GSL... so those compilations should
>>>>>>>>>>>>>> be
>>>>>>>>>>>>>> fine.
>>>>>>>>>>>>>>
>>>>>>>>>>>>>> You should just need to recompile BUFRLIB and then MET.
>>>>>>>>>>>>>>
>>>>>>>>>>>>>> Just let me know if you run across any more errors.
>>>>>>>>>>>>>>
>>>>>>>>>>>>>> Thanks,
>>>>>>>>>>>>>> John
>>>>>>>>>>>>>>
>>>>>>>>>>>>>> Ed Warnken wrote:
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>           
>>>>>>>>>>>>>>               
>>>>>>>>>>>>>>                   
>>>>>>>>>>>>>>                       
>>>>>>>>>>>>>>                           
>>>>>>>>>>>>>>> Hi John,
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>> Just wondering if I also have to re-compile netcdf and gsl?
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>> John Halley Gotway wrote:
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>             
>>>>>>>>>>>>>>>                 
>>>>>>>>>>>>>>>                     
>>>>>>>>>>>>>>>                         
>>>>>>>>>>>>>>>                             
>>>>>>>>>>>>>>>> Ed,
>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>> Thanks for sending the MET compilation log.  It makes it a lot
>>>>>>>>>>>>>>>> easier
>>>>>>>>>>>>>>>> to diagnose the problem.
>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>> You should be using a Fortan-77 compiler instead of a Fortran-90
>>>>>>>>>>>>>>>> compiler.  So in the top-level MET Makefile, try setting "FC" to the
>>>>>>>>>>>>>>>> "pgf77" compiler.  Also, you'll need to recompile BUFRLIB using
>>>>>>>>>>>>>>>> the same "pgf77" compiler.  You could use the following 3 commands
>>>>>>>>>>>>>>>> to
>>>>>>>>>>>>>>>> compile BUFRLIB:
>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>    pgcc -c -DUNDERSCORE *.c
>>>>>>>>>>>>>>>>    pgf77 -c -DUNDERSCORE -Mnosecond_underscore *.f *.F
>>>>>>>>>>>>>>>>    ar crv libbufr.a *.o
>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>> These are taken from the METv2.0 online tutorial:
>>>>>>>>>>>>>>>> http://www.dtcenter.org/met/users/support/online_tutorial/METv2.0/compilation/req_libs.php
>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>> I've compiled MET using PGI versions 6 and 7, but not version 8 - to
>>>>>>>>>>>>>>>> which we don't have access yet.  I'll be interested to hear how it
>>>>>>>>>>>>>>>> goes.
>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>> Thanks and good luck,
>>>>>>>>>>>>>>>> John Halley Gotway
>>>>>>>>>>>>>>>> johnhg at ucar.edu
>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>> Ed Warnken wrote:
>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>               
>>>>>>>>>>>>>>>>                   
>>>>>>>>>>>>>>>>                       
>>>>>>>>>>>>>>>>                           
>>>>>>>>>>>>>>>>                               
>>>>>>>>>>>>>>>>> Hello,
>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>> I'm running into issues when compiling METv2.0.  I've attached the
>>>>>>>>>>>>>>>>> make_met.log file to this email for you.  The system I'm trying
>>>>>>>>>>>>>>>>> install
>>>>>>>>>>>>>>>>> this on is RHEL5 32bit.  I've compiled the BUFRLIB, GSL-1.12 and
>>>>>>>>>>>>>>>>> netcdf-3.6.3 using the portland (ver 8.0-2) fortran compilers.
>>>>>>>>>>>>>>>>> Thank
>>>>>>>>>>>>>>>>> you for your time.
>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>> Ed Warnken
>>>>>>>>>>>>>>>>> NOAA/PSD
>>>>>>>>>>>>>>>>> Phone 303-497-7264
>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>> _______________________________________________
>>>>>>>>>>>>>>>>> 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