[Fwd: Re: [Met_help] I got compiling error when I build MET using gcc!!!]

John Halley Gotway johnhg at rap.ucar.edu
Mon Dec 8 09:58:35 MST 2008


Here's a MET-Help follow-up email that was sent directly to me.  Could you
please respond to this user.

The history is that this user tried to get METv1.1 to compile on "lenny". 
But she ran into a bunch of problems.  So I sent here a set of patches I
thought would fix the problem.  The patches did fix several errors, but
she was still seeing some on "lenny".  So she tried using the PGI
compilers (on etch I think), and got METv1.1 to compile fine.

Now she's going back and trying to work on building METv1.1 on "lenny"
again.  She'd like instructions for how to fix the code herself. 
Basically, when she encounters a compilation error, she wants to know how
to figure out which include files she'll need to add.

Thanks Randy,

---------------------------- Original Message ----------------------------
Subject: Re: [Met_help] I got compiling error when I build MET using gcc!!!
From:    "Xie Xin" <xiexin at lasg.iap.ac.cn>
Date:    Sun, December 7, 2008 11:35 pm
To:      "John Halley Gotway" <johnhg at rap.ucar.edu>

Hi, John,

Since MET just can not be compiled properly on my "lenny" debian, would
you mind giving me some advice so that I can fix all these error myself?
Thank you very much!


John Halley Gotway 写道:
> Xie Xin,
> Sorry about those additional error messages you found.  I thought I had
caught them all.
> The reason for the error messages you're seeing is the difference in GNU
compiler versions.  In the Debian "etch" release, the compiler version
is 4.1.2.  In the Debian "lenny" test release, the
> compiler version is 4.3.2.  For whatever reason, there are a handful of
include files that need to be added in 4.3.2 that aren't required in
4.1.2.  And there are some additional warning messages that
> show up for 4.3.2 as well.
> I'm guessing that the version of the PGI compilers you're running is one
we've already tested - so you didn't have any problems.  Since we do
have a machine available here that's running "lenny", I
> will make sure that the next version of MET compiles fine on "lenny".
> Thanks for raising this issue!
> John
> Xie Xin wrote:
>> Hi, John,
>> I received your two emails this morning. Thank you very much for your
great help! After patching MET the previous there are no previous
errors now. However, serveral 'exit() not declared' errors come. I
tried to include some header files(cstdlib) in those source code. And
the errors have gone. It seemed that many of the MET programs try to
call some system standard function without including appropriate header
file(e.g.cstdlib). If it is built with gcc, the compiler will complain.
But I also found that a PGI compiler could compile it without errors.
>> I doubt that whether some compiler input arguments control those
including behaviours. Anyway, I hope a released METv1.2 will work fine
>> Thank you very much!
>> Xie Xin
>>> Xie Xin,
>>> After doing some searching, I've found out that Lenny is not actually
a stable release of Debian yet.  It's currently in the "testing" phase
and no date has been set yet for a "stable" release.  Since
>>> Lenny is not yet a stable release of Debian, MET isn't fully supported
on it yet.
>>> However, I was able to get MET to compile on Lenny after making
several changes to the include files.  I've attached the set of
changes you'll need in the attached tarball.
>>> Here's what you'll need to do:
>>> (1) Unpack the METv1.1 tarball 					> tar -xvzf METv1.1.20080711.tar.gz
>>> (2) Copy the patch tarball into the top-level MET directory 	> cp
METv1.1_lenny_patch.tar.gz METv1.1/.
>>> (3) Enter the top-level MET directory 				> cd METv1.1
>>> (4) Unpack the patch tarball 					> tar -xvzf METv1.1_lenny_patch.tar.gz
>>> (5) Build METv1.1 as instructed in the MET users guide.
>>> Also note that you'll need to use NetCDF version 3.6.3 since 3.6.2
doesn't appear to compile on Lenny.
>>> And if you grab any of the other bug fixes from the known issue page
of the MET website, you may need to merge those changes with the
changes that I've sent you for Lenny.  That hasn't been done yet.
>>> Thanks,
>>> John Halley-Gotway
>>> johnhg at ucar.edu
>>> John Halley Gotway wrote:
>>>> Xie Xin,
>>>> Thanks for sending this information.  MET should definitely be able
to compile on Debain Linux.  I realize though that you're one release
ahead of us.  In our division at NCAR we're currently on the
>>>> Debian Etch release, which is one behind Lenny.  My guess is that
there are some minor differences for MET between Etch and Lenny.
>>>> We've located a machine here that has Lenny installed.  I'll try
building MET on it and figure out what changes need to be made.  My
goal is to figure this out by the end of the week and get you those
>>>>  changes.
>>>> Thanks,
>>>> John
>>>> Xie Xin wrote:
>>>>> oh I forgot to attach the file the last time.
>>>>> John Halley Gotway,
>>>>> Hi, thank you very much for your reply! I unpacked the MET source
code again and got directly "memcpy() not declared" error this time.
No "isdigit() not declared" error again. This was quite strange. The
Makefile and the log file are in the attachment. I am running a
Debian (Lenny) operating system. And my g++ version information are:
>>>>> g++ (Debian 4.3.2-1) 4.3.2
>>>>> Copyright (C) 2008 Free Software Foundation, Inc.
>>>>> This is free software; see the source for copying conditions.  There
is NO
>>>>> warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR
>>>>> I am not sure whether my operating system was set up right. I
install a base system of debian with a build-essential, gsl and f2c
package installed. And I built bufrlib with no error.
>>>>> Thank you much very!
>>>>> Xie Xin
>>>>> xiexin at lasg.iap.ac.cn
>>>>>> Xie Xin,
>>>>>> A few users have reported a similar error but when using the PGI
compilers to compile the PB2NC tool.  I'm not aware of other users
experiencing the problem you're seeing.
>>>>>> Could you please send me a copy of the Makefile you're using as
well as all of the output from "make"?
>>>>>> Please do the following from the top-level METv1.1 directory:
>>>>>>> make clean
>>>>>>> make >& make_met.log&
>>>>>> And send me a copy of "make_met.log".
>>>>>> Also, can you tell me what type of operating system you're running,
and which version of the GNU compilers you're using:
>>>>>>> g++ --version
>>>>>> Hopefully we can get this figured out.
>>>>>> Thanks!
>>>>>> John Halley Gotway
>>>>>> johnhg at ucar.edu
>>>>>> Xie Xin wrote:
>>>>>>> hi,
>>>>>>> According to the manual, I have set up all the needed libs and
began to
>>>>>>> build MET. I want to use gcc so I cp the Makefile_gnu to Makefile.
>>>>>>> However, I got error when I make.
>>>>>>> *** Making vx_analysis_util Library ***
>>>>>>> /usr/bin/g++ analysis_utils.cc -Wall -Wshadow -static -c -I..
>>>>>>> analysis_utils.cc: In function `int all_digits (const char *)':
>>>>>>> analysis_utils.cc:94: `isdigit' undeclared (first use this function)
>>>>>>> analysis_utils.cc:94: (Each undeclared identifier is reported only
>>>>>>> for each function it appears in.)
>>>>>>> make[3]: *** [analysis_utils.o] Error 1
>>>>>>> make[2]: *** [vx_analysis_util_all] Error 2
>>>>>>> make[1]: *** [libs] Error 2
>>>>>>> make: *** [all] Error 2
>>>>>>> It seemed that function isdigit was not declared in the header files.
>>>>>>> Then I found that the declaration of isdigit() is in the ctype.h so I
>>>>>>> add #include "ctype.h" in anylysis_utils.cc. But I got another error
>>>>>>> complaining memcpy() was not declared. I wonder if there is a serious
>>>>>>> NOT-DECLARATION bug in your code. Would you give me some
suggestion how
>>>>>>> this could be solved?
>>>>>>> Thank you very much!
>>>>>>> Xie Xin
>>>>>>> _______________________________________________
>>>>>>> Met_help mailing list
>>>>>>> Met_help at mailman.ucar.edu
>>>>>>> http://mailman.ucar.edu/mailman/listinfo/met_help
>>>> _______________________________________________
>>>> 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