[Met_help] MET installation

John Halley Gotway johnhg at rap.ucar.edu
Fri Jan 9 15:55:03 MST 2009


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

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.

You could try building a local version of NetCDF with the following commands (C-shell):
-> gunzip netcdf-3.6.2.tar.gz
-> tar -xvf 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.

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.

Let me know how it all goes.

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