[Met_help] Compiling METv2.0

John Halley Gotway johnhg at rap.ucar.edu
Tue Jul 7 08:53:53 MDT 2009


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