[ncl-install] NCARG on Ubuntu 8.04 LTS with PGI

Chris Cornwall Christopher.R.Cornwall at noaa.gov
Tue May 4 13:47:47 MDT 2010


Thanks for the response, Mary.

My gcc and gfortran are version 4.2.4. The choices for precompiled
binaries were 4.1.2 and 4.3.2, so I chose the Linux_Debian_i686_nodap
for gcc 4.1.2. I do have both gfortran-4.1 and 4.2 and libgfortran1 and
2 installed, but I may not be setting my link path or file correctly.

Both libgfortran.so.1 and libgfortran.so.2 exist under /usr/lib, which
is in my LD_LIBRARY_PATH along with /usr/local/lib. Do I need to somehow
tell ncarg to use the .1 file instead of the .2? How would I do that?

(I have compiled NCL from source for previous versions, but lost faith
in the source code for this version when the Makefile for the blockdata
test didn't even contain the main.good2 program referred to in the
instructions and required to run the preliminary blockdata test.)

So this is as far as I get now. Any thoughts? You suggest downloading a
version of NCL/NCARG built with my version of gfortran; is there such a
beast? It seems the precompiled binaries available from ucar are limited
to gcc412 and gcc432.


pulsar:~> ncargex cpex08 -clean

NCAR Graphics Fortran  Example <cpex08>

  Copying cpex08.f

  Copying cpexcc.f

Compiling and linking...
pgf77 -fPIC -O -o cpex08 cpexcc.f cpex08.f -L/usr/local/ncarg/lib
-L/usr/X11R6/lib -lncarg -lncarg_gks -lncarg_c -lX11 -lXext -lgfortran
cpexcc.f:
cpex08.f:
/usr/local/ncarg/lib/libncarg.a(cpcldm.o): In function `cpcldm_':
cpcldm.f:(.text+0x8ab): undefined reference to `_gfortran_copy_string'
cpcldm.f:(.text+0xf36): undefined reference to `_gfortran_copy_string'
cpcldm.f:(.text+0xfc8): undefined reference to `_gfortran_copy_string'
cpcldm.f:(.text+0x10bd): undefined reference to `_gfortran_copy_string'
cpcldm.f:(.text+0x11c4): undefined reference to `_gfortran_copy_string'
/usr/local/ncarg/lib/libncarg.a(cpcldm.o):cpcldm.f:(.text+0x127f): more
undefined references to `_gfortran_copy_string' follow

The compile and link failed.

pulsar:~> env | grep LIB
LD_LIBRARY_PATH=/usr/lib:/usr/local/lib
pulsar:~>


Thanks.

Chris



On 5/4/2010 8:44 AM, Mary Haley wrote:
> Hi Chris,
> 
> Your problems stem from the fact that you are trying to use the  
> Portland compilers
> to link against gcc/gfortran compiled libraries.  Usually this is  
> doable, but as you've
> seen, you have to add system libraries to help out.
> 
> Adding "-lgfortran" sometimes is all you need, but it looks like you  
> may have
> a different version of gfortran than what your  version of NCAR  
> Graphics was
> compiled with.
> 
> Do you know which NCL/NCARG binary you downloaded? What does the  
> following report:
> 
>     gfortran --version
> 
> I think the undefined references below come from V4.1.x of gfortran, and
> newer versions of gfortran (V4.2.x) don't have these symbols.
> 
> It might help to look at this FAQ question:  http://www.ncl.ucar.edu/FAQ/#basics_006
> 
> It tells you how to get the older 4.1.x gfortran library, which you  
> can then link against.
> 
> Otherwise, you'll either need to download a version of NCL/NCARG
> that was built with the same gfortran as what you have, or else build  
> NCL/NCARG
> yourself from source code.
> 
> I not familiar enough with Ubuntu to help you with the oddities on  
> library locations.
> 
> --Mary


More information about the ncl-install mailing list