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

Chris Cornwall Christopher.R.Cornwall at noaa.gov
Mon May 3 15:26:29 MDT 2010


Greetings.

I'm trying to install NCAR Graphics on an i686 Ubuntu 8.04 LTS system
with Portland Group compilers. First post-install test works fine for
displaying the graphs, but the compile test fails:

pulsar:~> ncargex cpex08 -clean

NCAR Graphics Fortran  Example <cpex08>

  Copying cpex08.f

  Copying cpexcc.f

Compiling and linking...
gfortran -fPIC -fno-second-underscore -fno-range-check -O -o cpex08
cpexcc.f cpex08.f -L/usr/local/ncarg/lib -L/usr/X11R6/lib -lncarg
-lncarg_gks -lncarg_c -lX11 -lXext
/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
collect2: ld returned 1 exit status

The compile and link failed.

pulsar:~> which gfortran
/usr/bin/gfortran


Reading the archives here, I edited the ncargf77 file, replacing
gfortran with pgf77, resulting in:

pulsar:~> ncargex cpex08 -clean

NCAR Graphics Fortran  Example <cpex08>

  Copying cpex08.f

  Copying cpexcc.f

Compiling and linking...
pgf77 -fPIC -fno-second-underscore -fno-range-check -O -o cpex08
cpexcc.f cpex08.f -L/usr/local/ncarg/lib -L/usr/X11R6/lib -lncarg
-lncarg_gks -lncarg_c -lX11 -lXext
pgf77-Error-Unknown switch: -fno-second-underscore
pgf77-Error-Unknown switch: -fno-range-check

The compile and link failed.


Removing those two flags from the loadflags env  in ncargf77 produces a
huge number of "undefined reference to `_gfortran_*` errors.

So I changed ncargf77 again, adding

set libextra = "-lgfortran"

This gives me:


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.


And that's where the archives and I run out of steam. Can someone please
help?

It's my impression that Ubuntu stores some system files in odd places.
For example, there was no /usr/X11R6/lib directory, so I created a
symlink for it to /usr/lib. Are there other oddities I need to deal with?

The ultimate goal is to allow one of our scientists to compile and run
legacy f77/ncarg code using the Portland Group compiler. This code is
currently running and compiling happily on a Debian system, but we
wanted to try porting to Ubuntu.

Thanks.

Chris


More information about the ncl-install mailing list