[Met_help] Re: Problem with compiling METv1.0
John Halley Gotway
johnhg at rap.ucar.edu
Wed Apr 16 21:41:03 MDT 2008
Bosko,
Sorry for not getting back to you sooner. We've been hosting a
verification workshop all week here at NCAR. So I've been busy with that.
Good news. Just try also adding -lpthread at the end of that line and you
should be fine:
PGI_LIBS = -lpgftnrtl -lrt -lpthread
I was able to reproduce the exact errors you were seeing. By adding that
additional library, it fixes all of the undefined references.
I'm actually pretty embarrassed. I realized that we already have this
issue posted on the list of "known issues" on the MET website. I should
have remembered or checked that first! Here's the list of known issues
for METv1.0:
http://www.dtcenter.org/met/users/support/known_issues/METv1.0/METv1.0_known_issues.php
If you look for the one dated 1/10/2008, you'll see that we've listed
these addition library requirements which were new for PGI version 7.
Sorry I didn't point you to that sooner. But hopefully, it'll all work as
expected now.
Please let me know if any more questions arise.
Thanks,
John
> Hi John,
>
> I tried your suggestion and it seems now we do have problem with
> /usr/lib/librt.a library.
>
> Result in make_met.log
> is the same as if I am using your first suggestion
> PGI_LIBS = -lpgftnrtl -lrt
>
> It seems that somehow library librt.a is not properly visible or
> compatible with pgf compiler
> because undefined symbols could be found only
> within librt.a library.
>
> I hope that you do have some useful ideas.
>
> Thanks in advance for your efforts.
>
> Bosko
>
>
> John Halley Gotway wrote:
>
>> 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