[Met_help] MET install error

John Halley Gotway johnhg at rap.ucar.edu
Tue Sep 18 14:44:04 MDT 2007


Luke,

You could always give the -lg2c a try and see if the linker is able to locate it.

In case that doesn't work and you're still getting errors from "pb2nc", be sure to change "-lg2c" back to "-lf2c" in the Makefile in the "pb2nc" directory.
And then here are some instructions for downloading, installing and using the f2c source code:

(1) Download the file "libf2c.zip" from netlib.org: http://www.netlib.org/f2c/ and place it somewhere you'd like to install in on your machine.
(2) Unzip the library code: unzip libf2c.zip
(3) Change directory into libf2c: cd libf2c
(4) Copy the Unix version of the makefile over to a file named makefile: cp makefile.u makefile
(5) Execute the make: make
On my system, the library built without any changes to the makefile.  If you encounter problems, refer to the README file or the makefile itself.
(6) Once libf2c.a has been built, change directory to the top-level MET directory (METv0.9).
(7) Edit the top-level MET makefile as follows so as to link to the library you just built:
Old Line: BUFR_LIBS    = -L$(BUFR_BASE)
New Line: BUFR_LIBS    = -L$(BUFR_BASE) -L/path/to/f2c/library
where /path/to/f2c/library is the directory containing libf2c.a.
(8) Attempt to rebuild MET with the following commands:
make clean
make >& make_met.log&
tail -f make_met.log

I have to head out for the day.  But if you have any more questions, I'll get to them tomorrow morning.

Good luck.

John

Luke Peffers wrote:
> Ok, I don't know if I have a g2c library.  I see libg2c.so.0,
> libg2c.so.0.0.0*, and libg.a-- in the usr/lib directory.  However, in the
> error message, it seems to be looking in the usr/bin directory.  Not sure
> what to think of this since I'm fairly new to Linux.
> 
> I would be happy to download the code if necessary.
> 
> Thanks again.
> 
> Luke
> 
> 
> On 9/18/07, John Halley Gotway <johnhg at rap.ucar.edu> wrote:
>> Luke,
>>
>> Alright, we're getting there.  You've successfully built all of the MET
>> Libraries and 3 of the 5 executables.  It's erroring out on building the
>> "pb2nc" application from which we seen the most
>> problems installing.  The difficulty here is that pb2nc interfaces C++ and
>> Fortran code.  The library named "f2c" allows this to occur.
>>
>> However, on your system, the linker is unable to find that library.  One
>> user wrote the other day informing us that while his system doesn't have an
>> "f2c" library, it does have a "g2c" library, which
>> worked fine for him.
>>
>> You could look in some of the standard locations on your system to see if
>> "libg2c.a" is present there.
>> For example...
>> ls /usr/lib/libg2c.a
>> ls /usr/local/lib/libg2c.a
>>
>> If you can find libg2c.a, we can try changing the reference from "-lf2c"
>> to "-lg2c":
>> (1) cd ..../METv0.9/src/pb2nc
>> (2) Edit the Makefile in this directory.  Change the single instance of
>> "-lf2c" in this file to "-lg2c".
>>
>> Now try going back to the top-level directory, do a make clean, and remake
>> it.
>>
>> Thanks for being patient with this.  As you can see there issues we need
>> to figure out to make MET as portable to other systems as possible.
>>
>> If trying "-lg2c" doesn't work, there is another route we can try.  The
>> source code for the f2c library can be downloaded and installed
>> locally.  Then you could link to that.  I tried it myself, and
>> it really wasn't difficult.  But hopefully "-lg2c" will do the trick.
>>
>> Let me know,
>> John
>>
>>
>> Luke Peffers wrote:
>>> John,
>>>
>>> Thank you for the quick reply...
>>>
>>> I made the corrections that you suggested and verified that libgsl.aexists
>>> in /fuelberg/r0/lpeffers/MET_9
>>>> /GSL/gsl-1.9/lib.  That fixed the problem with grid_stat make.  Also,
>> now
>>>> that I have included FLAG -WALL, there seems to be many more general
>>>> warnings all throughout the make process than before.  The final error
>> while
>>>> making the pb2nc application causes the make to abort.
>>>
>>> I have attached the make_met.log.
>>>
>>> Thanks again.
>>>
>>> Luke
>>>
>>>
>>>
>>>
>>> On 9/18/07, John Halley Gotway < johnhg at rap.ucar.edu> wrote:
>>>> Luke,
>>>>
>>>> When the linker looks for the GSL library archive file, it looks like
>> it's
>>>> finding libgsl.so (a shared object file) rather than libgsl.a (a
>> library
>>>> archive file) which is what it needs.
>>>>
>>>> I'm a little confused though.  In the top-level Makefile there's a
>> FLAGS
>>>> variable set as follows:
>>>> FLAGS = -g -Wall -Wshadow -static
>>>>
>>>> The "-static" option in there tells the linker to look for .a library
>>>> files rather than .so library files.  For some reason, in the log you
>> sent
>>>> me, the "-static" option has changed to "-Bstatic".
>>>>
>>>> So I'd suggest trying the following:
>>>> (1) Look in /fuelberg/r0/lpeffers/MET_9/GSL/gsl-1.9/lib to verify that
>> it
>>>> contains the file: libgsl.a
>>>> (2) In the top-level directory, open up the Makefile and make sure the
>>>> FLAGS variable is set as: FLAGS = -g -Wall -Wshadow -static
>>>> (3) Do another "make clean".
>>>> (4) Try to remake MET, using: make >& make_met.log&
>>>> Then: tail -f make_met.log
>>>>
>>>> That will send all of the output from make to a file we've named
>>>> "make_met.log".  The tail command allows you to view the contents of
>> that
>>>> file as it gets written.  Use CNTRL-C to exit the tail.
>>>>
>>>> If you encounter more compilation errors.  Please send me that entire
>>>> "make_met.log" file.
>>>>
>>>> Thanks and let me know how that works for you.
>>>>
>>>> John
>>>>
>>>> Luke Peffers wrote:
>>>>> Ok, that worked great.  I should have read more carefully!  Now that I
>>>> have
>>>>> that problem figured out, I have run into another as the "Make" made
>>>> further
>>>>> through the build.  I have attached a text output of the error that I
>>>>> encountered during the grid_stat executable.
>>>>>
>>>>> Thank you very much for the help.
>>>>>
>>>>> Luke Peffers
>>>>> FSU
>>>>>
>>>>> On 9/18/07, John Halley Gotway <johnhg at rap.ucar.edu> wrote:
>>>>>> Luke,
>>>>>>
>>>>>> I see that you're trying to use gcc and f77 to compile MET - as was
>>>>>> suggested in the MET User's Guide.  Unfortunately, that was an error,
>>>> we
>>>>>> should have listed g++ as the preferred compiler rather
>>>>>> than gcc.  In fact, that mistake is currently listed on the Errata
>> page
>>>>>> for the MET Users Guide (
>>>>>>
>> http://www.dtcenter.org/met/users/docs/users_guide/MET_Users_Guide_v0.9_Errata.php
>>>>>> ).
>>>>>>
>>>>>> I apologize for the trouble it's caused.  Please try using the g++
>>>>>> compiler rather than the gcc compiler.
>>>>>> So in your top-level Makefile, change the C++ compiler
>>>>>> from: CPP_COMPILER = /usr/bin/gcc
>>>>>> to:   CPP_COMPILER = /usr/bin/g++
>>>>>> Assuming that you have g++ installed in that directory.
>>>>>>
>>>>>> Also, prior to re-making MET, please do a "make clean"
>> first.  Anytime
>>>> you
>>>>>> encounter an error in the compilation, it's a good idea to do a "make
>>>> clean"
>>>>>> prior to executing "make" again.
>>>>>>
>>>>>> Give that a try and please let us know if you run into any more
>>>> problems
>>>>>> in the installation process.
>>>>>>
>>>>>> Thanks,
>>>>>> John Halley Gotway
>>>>>> johnhg at ucar.edu
>>>>>>
>>>>>> Luke Peffers wrote:
>>>>>>> Hello, I am in the process of installing MET on our Linux machine
>> and
>>>>>> have
>>>>>>> run into an error.  I have compiled the required libraries (BUFRLIB,
>>>>>> GSL,
>>>>>>> and NetCDF) using our gcc/f77 compilers.  The error below keeps
>>>>>> disrupting
>>>>>>> the "make" of MET.   Can you offer any assistance?  I have included
>> my
>>>>>>> Makefile for your reference.
>>>>>>>
>>>>>>> Thank you for your help.
>>>>>>>
>>>>>>> Regards,
>>>>>>>
>>>>>>> Luke Peffers
>>>>>>> Florida State University - Meteorology
>>>>>>>
>>>>>>>
>>>>>>> *** Making pcp_combine application ***
>>>>>>>
>>>>>>>
>>>>>>> /usr/bin/gcc -o pcp_combine pcp_combine.cc \
>>>>>>> -g -Wall -Wshadow -static
>>>>>>> -DMET_BASE=\"/fuelberg/r0/lpeffers/MET_9/METv0.9\" \
>>>>>>> -I../../lib -I/fuelberg/r0/lpeffers/NetCDF/include
>>>>>>> -I/fuelberg/r0/lpeffers/NetCDF/netcdf-3.6.2/cxx \
>>>>>>> -L../../lib -L/fuelberg/r0/lpeffers/NetCDF/lib \
>>>>>>> -lvx_met_util -lvx_grib_classes -lvx_wrfdata -lvx_data_grids
>> -lvx_nav
>>>>>>> -lvx_cal \
>>>>>>> -lvx_math -lvx_util -lm -lnetcdf_c++ -lnetcdf
>>>>>>> ../../lib/vx_data_grids/grid_base.h:179: warning: āclass Integrandā
>>>> has
>>>>>>> virtual functions but non-virtual destructor
>>>>>>> ../../lib/vx_data_grids/grid_base.h:191: warning: āclass
>>>> GridInterfaceā
>>>>>> has
>>>>>>> virtual functions but non-virtual destructor
>>>>>>> ../../lib/vx_wrfdata/shape.h:34: warning: āclass Shapeā has virtual
>>>>>>> functions but non-virtual destructor
>>>>>>> ../../lib/vx_wrfdata/shape.h:50: warning: āclass
>> FreelyMoveableShapeā
>>>>>> has
>>>>>>> virtual functions but non-virtual destructor
>>>>>>> ../../lib/vx_grib_classes/grib_strings.h:27: warning: āmissing_strā
>>>>>> defined
>>>>>>> but not used
>>>>>>> ../../lib/vx_grib_classes/grib_strings.h:45: warning:
>> āgrib_code_listā
>>>>>>> defined but not used
>>>>>>> ../../lib/vx_grib_classes/grib_strings.h:77: warning:
>>>>>> āgrib_code_list_strā
>>>>>>> defined but not used
>>>>>>> ../../lib/vx_grib_classes/grib_strings.h:341: warning:
>>>> āgrib_level_listā
>>>>>>> defined but not used
>>>>>>> ../../lib/vx_grib_classes/grib_strings.h:360: warning:
>>>> āgrib_level_flagā
>>>>>>> defined but not used
>>>>>>> ../../lib/vx_grib_classes/grib_strings.h:374: warning:
>>>>>> āgrib_level_list_strā
>>>>>>> defined but not used
>>>>>>> ../../lib/vx_wrfdata/vx_wrfdata.h:41: warning: āwrfdata_magicā
>> defined
>>>>>> but
>>>>>>> not used
>>>>>>> ../../lib/vx_wrfdata/vx_wrfdata.h:64: warning: āthresh_type_strā
>>>> defined
>>>>>> but
>>>>>>> not used
>>>>>>> ../../lib/vx_wrfdata/vx_wrfdata.h:85: warning: āstep_direction_strā
>>>>>> defined
>>>>>>> but not used
>>>>>>> ../../lib/vx_met_util/read_grib.h:41: warning: ātwo_to_one_gribā
>>>> defined
>>>>>> but
>>>>>>> not used
>>>>>>> /tmp/ccuSQXOt.o(.text+0xa4): In function `usage':
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>> ------------------------------------------------------------------------
>>>>>>> _______________________________________________
>>>>>>> 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