problem compiling the NCAR graphics ubuntu 10.04 with gcc/gfortran 4.4.3

From: Saulo Soares <saulo_at_nyahnyahspammersnyahnyah>
Date: Thu Mar 03 2011 - 13:47:56 MST

Hi NCL list,

I have a problem compiling the NCAR graphics.
I downloaded the binary for 64 bit machine running ubuntu:

However my gcc/gfortran version is 4.4.3, much newer, so when I run:
$ 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/home/saulo/NCL/lib -lncarg -lncarg_gks -lncarg_c -lX11 -lXext

I get a bunch of this error:

/home/saulo/NCL/lib/libncarg.a(mdgetc.o): In function `mdgetc_':
mdgetc.f:(.text+0x8d): undefined reference to `_gfortran_copy_string'

I google solutions to this from the ncl list and it was suggested that
getting and linking it to gcc/lib/ could do
the trick.
I did that but now the compiler complains about a reference that is in the
newer gcc/gfortran version:

/usr/lib/gcc/x86_64-linux-gnu/4.4.3/../../../../lib/crt1.o: In function
(.text+0x20): undefined reference to `main'
/tmp/ccM2T3gF.o: In function `MAIN__':
cpex08.f:(.text+0x4d5): undefined reference to `_gfortran_set_options'
collect2: ld returned 1 exit status

The compile and link failed.

Does anyone knows a solution to this? Or do I have to compile from source?
Or is it possible to make the gcc symbolic link
/usr/lib/gcc/x86_64-linux-gnu/4.4/ point to 2 different
libraries (link to both and at the same

Saulo Soares
Phd candidate
Dept Oceanography
University of Hawaii at Manoa

ncl-install mailing list
List instructions, subscriber options, unsubscribe:
Received on Thu Mar 3 14:48:13 2011

This archive was generated by hypermail 2.1.8 : Thu Mar 10 2011 - 21:49:15 MST