[Met_help] MET installation

John Halley Gotway johnhg at rap.ucar.edu
Tue Jan 20 11:44:44 MST 2009


Mark,

I'm sorry.  I really can't say why the "make check" was not successful because I'm not sure exactly what tests are run in the "make check" step.  However, I can say that I do remember being in the
same situation in the past.  I remember compiling NetCDF and having the "make check" step fail, but still being able to successfully compile and run MET.  Of course, when I went to try to replicate
that behavior, I couldn't get the "make check" step to fail!

So I'd suggest going ahead and trying to build MET to see if it works.

Here's something to consider - NetCDF builds API's for use with many compilers: C, C++, Fortran-77, and Fortran-90.  If you don't specify which of these compilers to use, the configure script will try
to find one of each on your system - and it may make a good or a bad choice.  However you can specify which compiler to use by setting environment variables before calling configure (as you've done).
 Also, you can disable their compilation by setting the right environment variable to an empty string.

For example, I configured NetCDF with:
setenv CC /tools/pgi-v7.1.5/bin/pgcc
setenv CXX /tools/pgi-v7.1.5/bin/pgCC
setenv FC ''
setenv F90 ''
./configure --prefix=`pwd`

This disables the compilation of the Fortran API - which MET doesn't use anyway.  It may be that one of the Fortran "check" scripts is failing in "make check".  So you may (or may not) have better
luck with the "make check" with the Fortran API disabled.

Thanks,
John

Mark Seefeldt wrote:
> 
> 
> John Halley Gotway wrote:
>> Mark,
>>
>> Hmmm.  The latest version I have available here is PGI 7.1-5, and it
>> works fine for me.  So you might try testing with that version.  Your
>> Makefile settings look fine to me (except for one, but more on that
>> later).  And I see that the linker is correctly loading the NetCDF
>> library archive files:
>> LOAD /usr/local/netcdf/lib/libnetcdf_c++.a
>> LOAD /usr/local/netcdf/lib/libnetcdf.a
> 
> I have set the top level Makefile to use pgi 7.1-5 in the CXX setting
> (pgCC) and the FC seeting (pgf77).
> 
> I have built a new local version of netcdf 3.6.2 in my home directory:
>   /home/seefeldm/netcdf/
> I have verified the presence of the library files:
> 
>   [seefeldm at vardar lib]$ pwd
>   /home/seefeldm/netcdf/lib
>   [seefeldm at vardar lib]$ ls -l
>   total 1920
>   -rw-r--r--  1 seefeldm cassano 1415036 Jan  9 16:17 libnetcdf.a
>   -rw-r--r--  1 seefeldm cassano  528512 Jan  9 16:17 libnetcdf_c++.a
>   -rwxr-xr-x  1 seefeldm cassano    1007 Jan  9 16:17 libnetcdf_c++.la
>   -rwxr-xr-x  1 seefeldm cassano     910 Jan  9 16:17 libnetcdf.la
> 
> I have set the NETCDF_BASE setting in the top level makefile to the
> local directory:
>   NETCDF_BASE = /home/seefeldm/netcdf
> 
>> When I see an "undefined reference" error like you're seeing, I use
>> the "nm" command to examine the contents of the library archive file
>> to which you're linking.  Here's one such error message in your
>> output:
>> /tmp/pgCCQghg_4O0ShAT.o(.text+0x32ea):/home/seefeldm/wrf/METv1.1/src/pcp_combine/pcp_combine.cc:962:
>>
>> undefined reference to `NcFile::is_valid( const(void))'
>>
>> The linker can't find a definition for "NcFile::is_valid".
>>
>> So you could try the following command: -> nm
>> /usr/local/netcdf/lib/libnetcdf_c++.a | grep "is_valid"
>>
>> When I run that, here's the output I see: 00008800 T
>> is_valid__5NcAttCFv 000088de t __is_valid__5NcAttCFvEND 00001bb0 T
>> is_valid__5NcDimCFv 00001bee t __is_valid__5NcDimCFvEND 00002c70 T
>> is_valid__5NcVarCFv 00002cae t __is_valid__5NcVarCFvEND 000005a0 T
>> is_valid__6NcFileCFv 000005b7 t __is_valid__6NcFileCFvEND
>>
>> Not sure what all of this means, but it definitely shows up in that
>> file "libnetcdf_c++.a".  If your output of this "nm" command looks
>> much different, there may be a problem with how NetCDF is installed.
>> That's just one idea.
> 
> This is what I get with the nm command:
>   [seefeldm at vardar lib]$ nm /home/seefeldm/netcdf/lib/libnetcdf_c++.a |
>   grep "is_valid"
>   00000ba8 T _ZNK5NcAtt8is_validEv
>   00000050 T _ZNK5NcDim8is_validEv
>   000005ec T _ZNK5NcVar8is_validEv
>   0000000c T _ZNK6NcFile8is_validEv
> 
>> You could try building a local version of NetCDF with the following
>> commands (C-shell): 
>> -> gunzip netcdf-3.6.2.tar.gz -> tar -xvv netcdf-3.6.2.tar
>> -> setenv CC /path/to/pg7.1-5/pgcc
>> -> setenv CXX /path/to/pg7.1-5/pgCC
>> -> ./configure --prefix=`pwd` (or some other installation directory)
>>
>> And then edit your MET Makefile to point to this version of NetCDF.
>> And edit it to point the compilers to the PGI 7.1-5 version.
> 
> I did this one more time to make sure I didn't overlook something along
> the way.  It appears that the first time I created a local version of
> the netcdf I did not include the CC and CXX environment variables.  When
> I do include them, the netcdf build crashes in the make check stage.  I
> did a diff on the makefiles and came across the following differences:
> 
> Summary:
> -NOT setting the CC and CXX environment variables
> -results in a successful make, make install, and make check
> -MET does not build
> 
> 124,127c124,127
> < CC = cc
> < CCDEPMODE = depmode=gcc3
> < CFLAGS = -g -O2
> < CPP = cc -E
> 206c206
> < ac_ct_CC = cc
> 211,212c211,212
> < am__fastdepCC_FALSE = #
> < am__fastdepCC_TRUE =
> 
> -setting the CC and CXX environment variables:
> [vardar netcdf]$ which pgcc
> /usr/local/pgi/linux86/7.1-5/bin/pgcc
> [vardar netcdf]$ which pgCC
> /usr/local/pgi/linux86/7.1-5/bin/pgCC
> [vardar netcdf]$ CC=/usr/local/pgi/linux86/7.1-5/bin/pgcc ; export CC
> [vardar netcdf]$ CXX=/usr/local/pgi/linux86/7.1-5/bin/pgCC ; export pgCC
> -results in a successful make, make install
> -the make check step fails
> -did not bother trying to see if the MET builds
> 
> 124,127c124,127
>> CC = /usr/local/pgi/linux86/7.1-5/bin/pgcc
>> CCDEPMODE = depmode=none
>> CFLAGS = -g
>> CPP = /usr/local/pgi/linux86/7.1-5/bin/pgcc -E
> 206c206
>> ac_ct_CC =
> 211,212c211,212
>> am__fastdepCC_FALSE =
>> am__fastdepCC_TRUE = #
> 
> Any ideas as to why including the CC and CXX environment variables, as
> requested, results in the make check failing?
> 
>> And lastly, in your config file, I realize that
>> "/usr/local/include/gsl" contains header files.  But in the source
>> code, we look for files like "gsl/gsl_randist.h".  So we already
>> expect to have to look in the "gsl" subdirectory (I have no idea why
>> they set it up that way either!)  So you should set GSL_INCS =
>> -I$(GSL_BASE)/include.  We anticipated that this would make things
>> easier for users, but perhaps it's made it more confusing!
>>
>> Even though GSL_INCS it's not currently set correctly, you're not
>> seeing error messages about it...  And that's because the compiler
>> already knows to look for include files in /usr/local by default. So
>> the compiler is looking in "/usr/local" and finding those files named
>> "gsl/gsl_*.h".  But if you had GSL installed locally somewhere else,
>> the compiler wouldn't be able to find those files.
> 
> I have corrected this discrepancy.  Thank you for the explanation.
> 
>> Let me know how it all goes.
> 
> Thanks
> 
> Mark
> 
>>
>> John
>>
>>
>> Mark Seefeldt wrote:
>>> John,
>>>
>>>> I apologize for the delay in getting back to you on this.
>>> Now it is my turn to apologize.  With AGU, preparation for AGU,
>>> another meeting, and Christmas vacation, things have been slow in
>>> getting done.
>>>
>>>> Thanks for sending the Makefile and the file make.log.  I agree
>>>> with you that the linker is having problems finding things in the
>>>> NetCDF library.  And I'll be happy to try to help you debug this
>>>> issue.
>>>>
>>>> Can you please check a few things: - Can you tell me what version
>>>> of the PGI compilers you're using? Just type "pgCC --version" for
>>>> the version number.
>>> 8.0-1 We have different installation directories so I can pick and
>>> choose from the previous installations which we've had, including
>>> 7.1, 7.1-5, 7.2, 7.2-1, 8.0, and 8.0-1.
>>>
>>>> - Does the file /home/seefeldm/netcdf/3.6.3/lib/libnetcdf.a exist
>>>>  on your machine?
>>> The native installation for netcdf on my system is
>>> /usr/local/netcdf. In the files I sent you I was using a user
>>> installation as I wanted to verify that my problems were not
>>> related to the netcdf being built with a different version of PGI.
>>>
>>> Yes, the file:  /usr/local/netcdf/lib/libnetcdf.a exists.
>>>
>>>> - Does the file /home/seefeldm/netcdf/3.6.3/lib/libnetcdf_c++.a
>>>> exist on your machine?
>>> Yes, the file: /usr/local/netcdf/lib/libnetcdf_c++.a exists.
>>>
>>>> - Now take a look in /usr/local/lib.  Do the files libnetcdf.a
>>>> and libnetcdf_c++.a exist in there too?  I'm wondering if the
>>>> linker is trying to link to the wrong version of NetCDF.
>>> Yes, these files also exist in /usr/local/lib.  It was the
>>> installation location before we went with a version specific
>>> location.  I am guessing this is the problem.  ...  Unfortunately,
>>> it was not.  I received the same error as before (see original
>>> message below).
>>>
>>>> If the files /home/seefeldm/netcdf/3.6.3/lib/libnetcdf.a and
>>>> /home/seefeldm/netcdf/3.6.3/lib/libnetcdf_c++.a do exist, then
>>>> please do the following: In the top-level Makefile, add the "-m"
>>>> flag to the line for CXX_FLAGS.  Do a "make clean" and then a
>>>> "make >& make_met.log". The "-m" flag tells the linker to dump
>>>> out information about where it finds definitions for functions.
>>>> And please send me a copy of your "Makefile" and "make_met.log"
>>>> file.
>>> I have added the -m flag and tried to compile it again.  I have
>>> attached the Makefile and the make_met.log file
>>>> One other thing - you haven't encountered this problem yet, but I
>>>>  think you'll need to change slightly how "GSL_INCS" is set.
>>>> Here's how you have it set now: GSL_INCS =
>>>> -I$(GSL_BASE)/include/gsl But I think you're going to need to
>>>> remove the "gsl" at the end there.  So it should be set as:
>>>> GSL_INCS = -I$(GSL_BASE)/include
>>> Somewhat surprisingly, this is set correctly.  All of the gsl_*.h
>>> files are in /usr/local/include/gsl.  I have no idea as to why it
>>> was done this way.
>>>
>>> Thanks
>>>
>>> Mark
>>>
>>>
>>>>
>>>> Mark Seefeldt wrote:
>>>>> I am having problems with the compiling and installation of
>>>>> MET. The errors start to occur whenever I try to compile one of
>>>>> the primary applications.  It appears that it has to do with
>>>>> the netcdf installation.  I have double and triple checked my
>>>>> installation location of my netcdf.  I have even installed a
>>>>> new version of netcdf in a local directory to verify that there
>>>>> were not any issues with using an old compiled version of
>>>>> netcdf.  The error that I get is something like:
>>>>>
>>>>> /home/seefeldm/wrf/METv1.1/src/pcp_combine/pcp_combine.cc:960:
>>>>> undefined reference to `NcFile::__ct(char const *,
>>>>> NcFile::FileMode, unsigned int *, unsigned int, NcFile::FileFormat)'
>>>>>
>>>>> I have attached the Makefile and the make.log files to see if
>>>>> they can provide any additional assistance.
>>>>>
>>>>> Any ideas as to where I am going wrong?
>>>>>
>>>>> Thanks
>>>>>
>>>>> Mark Seefeldt
>>>>>
>>>>>
>>>>> ------------------------------------------------------------------------
>>>>>
>>>>>
>>>>>
>>>>>
>>>>> _______________________________________________ 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