[Met_help] Re: Problem with compiling METv1.0

John Halley Gotway johnhg at rap.ucar.edu
Tue Apr 15 12:43:19 MDT 2008


Bosko,

Interesting.  Unfortunately, I don't think that what you've set up in the Makefile is doing exactly what you want it to do... the syntax isn't quite right.  My guess is that the linker is finding the 
symbols it's looking for somewhere on your system that isn't exactly the right place.

And (at least some of) those undefined references are actually defined in the file libpgftnrtl.a.  By doing "nm /usr/pgi/linux86/7.0-7/lib/libpgftnrtl.a" you can see what symbols are defined or used 
in that library archive file.

Could you please try the following in your Makefile:
PGI_LIBS        = -L/usr/pgi/linux86/7.0-7/lib -lpgftnrtl

And if that doesn't work, try adding "-lrt" to the end of that line.

These options explicitly tell the linker to look in the directory "/usr/pgi/linux86/7.0-7/lib" for the file named "libpgftnrtl.a"... which is what I believe you were trying to do.

If this works, you could also achieve the same goal by modifying the way the LD_LIBRAY_PATH environment variable is defined in your ~/.cshrc (or other configuration) file.  If you set the first 
element of LD_LIBRARY_PATH to /usr/pgi/linux86/7.0-7/lib, it will tell the linker to look in that directory first when linking.

Please let me know how it goes.

Thanks,
John


Bosko Telenta wrote:
> Hi John,
> 
> I tested your advise but it was not working so I add direct path toward
> PGI_LIBS and it seems it is working as you could see in Makefile
> 
> Now another problem emerge related with buffer library.
> I created "libbufr.a" using pgcc and pgf77 compiler but it seems that 
> there is undefined references.
> 
> Operating system on my computer is SUSE LINUX 10.1 (i586).
> 
> Your advise is welcome.
> 
> With my best regards,
> Bosko
> 
> John Halley Gotway wrote:
> 
>> Bosko,
>>
>> Please try the following...
>>
>> In your Makefile, find the line for "PGI_LIBS".
>>
>> In your current Makefile, it looks like this:
>> PGI_LIBS        = -lpgftnrtl
>>
>> Edit it by adding a link to the RT library:
>> PGI_LIBS        = -lpgftnrtl -lrt
>>
>> Then try rebuilding MET.
>>
>> On my system, I looked for the definition of those missing things that 
>> the linker is complaining about: aio_suspend, aio_return, aio_error, 
>> aio_write.
>> I found that they are defined in the RT library.  Hopefully that's the 
>> case for your machine as well.  For some reason, I don't need to 
>> explicitly link to that library on my machine, but it appears that you 
>> will need to.  Guess it's just different architectures.
>>
>> Please let me know if that does the trick.
>>
>> John
>>
>> Bosko Telenta wrote:
>>
>>> Hi John,
>>>
>>> Thank you very much on your suggestion.
>>> You were right I passed that obstacle with netcdf libraries.
>>>
>>> Now it seems that I do have similar problem with bufer library.
>>> I downloaded BUFRLIB.tar and followed instractions and create library
>>> libbufr.a using PGF compilers.
>>>
>>> Please find in attachment Makefile and make_met.log.
>>>
>>> I appreciate your suggestion and your time.
>>>
>>> With my best regards,
>>> Bosko Telenta
>>>
>>>
>>> John Halley Gotway wrote:
>>>
>>>> Bosko,
>>>>
>>>> Thanks for sending the Makefile and logfile.  I see that you're 
>>>> compiling
>>>> MET with the PGI compilers.  Based on the error message, it appears 
>>>> that
>>>> the linker is having trouble finding things in the NetCDF library.
>>>>
>>>> One possible explanation is that the NetCDF library may not have been
>>>> built using the PGI compilers.  You should build NetCDF with the 
>>>> same set
>>>> of compilers that you're using to build MET.
>>>>
>>>> If you're not sure how the NetCDF library was build, I'd suggest
>>>> rebuilding your NetCDF library using something like (in a C type 
>>>> shell):
>>>>
>>>> cd /home2/oper/WRF_ON/verification/netcdf-3.6.2
>>>> setenv CC /usr/pgi/linux86/7.0/bin/pgcc
>>>> setenv CXX /usr/pgi/linux86/7.0/bin/pgCC
>>>> setenv F77 /usr/pgi/linux86/7.0/bin/pgf77
>>>> ./configure --prefix=/home2/oper/WRF_ON/verification/netcdf-3.6.2
>>>> make check
>>>> make install
>>>>
>>>> That should tell NetCDF to build using the PGI compilers.  And it will
>>>> "install" into your netcdf-3.6.2 directory.  This is explained in 
>>>> the file
>>>> /home2/oper/WRF_ON/verification/netcdf-3.6.2/INSTALL.
>>>>
>>>> So in your Makefile, set the NETCDF parameters as follows:
>>>> NETCDF_BASE  = /home2/oper/WRF_ON/verification/netcdf-3.6.2
>>>> NETCDF_INCS  = -I$(NETCDF_BASE)/include
>>>> NETCDF_LIBS  = -L$(NETCDF_BASE)/lib
>>>>
>>>> Then try rebuilding MET by doing a "make clean" and "make install".
>>>>
>>>> Hopefully that'll get you past that linker error from the PCP-Combine
>>>> tool.  Please let me know how it goes and if you run into any more
>>>> problems.
>>>>
>>>> Thanks,
>>>> John Halley-Gotway
>>>> MET Help support team
>>>>
>>>>  
>>>>
>>>>> Hi met_help,
>>>>>
>>>>> I am trying to compile METv1.0 and I am stuck on message downthere:
>>>>> ----------------------------------------------------------------------------------------------------------- 
>>>>>
>>>>> pcp_combine/pcp_combine.cc:574: undefined reference to
>>>>> `NcFile::__ct(char const *, NcFil
>>>>> e::FileMode, unsigned int *, unsigned int, NcFile::FileFormat)'
>>>>> ----------------------------------------------------------------------------------------------------------- 
>>>>>
>>>>>
>>>>> I followed all instructions using fist netcdf-3.6.2 and netcdf-3.6.1
>>>>> but I am getting the same message.
>>>>>
>>>>> Please find in attachment two files "Makefile" and "make_met.log"
>>>>>
>>>>> I will appreciate your help to resolve that obstacle.
>>>>>
>>>>> With my best regards,
>>>>>
>>>>> Bosko Telenta
>>>>>
>>>>>
>>>>>
>>>>>   
>>>>
>>>>
>>>>
>>>>
>>>>  
>>>>
>>>
>>>
>>>
>>
>>
> 
> 
> 


More information about the Met_help mailing list