[ncl-install] undefined reference to gfortran copy string

Mary Haley haley at ucar.edu
Mon Mar 2 16:54:05 MST 2009


Hi,

I think you need a -lgfortran at the end of the compile line.

Please see: http://www.ncl.ucar.edu/FAQ/#misc_003

--Mary



On Mar 2, 2009, at 1:13 PM, Richard Hewston wrote:

> I have downloaded the NCL5.0.0 binaries and they lie under /usr/ 
> local/ncl5
>
> When I try to run the sample NCL script (ng4ex gsun01n) it works fine.
> However, the ncarg sample produces errors:
>
> root at rhewston bin]# ncargex cpex08
> NCAR Graphics Fortran  Example <cpex08>
>
> Copying cpex08.f
>
>   Copying cpexcc.f
>
> Compiling and linking...
> gfortran -fPIC -O -o cpex08 cpexcc.f cpex08.f -L/usr/local/ncl5/lib  
> -L/usr/X11R6/lib64 -lncarg -lncarg_gks -lncarg_c -L/usr/X11R6/lib64  
> -lX11 -lXext
> /usr/local/ncl5/lib/libncarg.a(cpcldm.o): In function `cpcldm_':
> cpcldm.f:(.text+0x7eb): undefined reference to `_gfortran_copy_string'
> cpcldm.f:(.text+0xa20): undefined reference to `_gfortran_pow_r4_i4'
> ....etc....
> gzputs.f:(.text+0xd3): undefined reference to `_gfortran_copy_string'
> gzputs.f:(.text+0x146): undefined reference to `_gfortran_copy_string'
> /usr/local/ncl5/lib/libncarg_gks.a(gzopwk.o):gzopwk.f:(.text 
> +0x471): more undefined references to `_gfortran_copy_string' follow
> collect2: ld returned 1 exit status
>
> There is no /usr/X11R6/ directory so i tried to changes links (and  
> add the libgfortran link too), but this also produced errors.
> # gfortran -O -o cpex08 cpexcc.f cpex08.f -L/usr/local/ncl5/lib - 
> lncarg -lncarg_gks -lncarg_c -L/usr/lib64 -lX11 -lXext -lgfortran
> /usr/lib/gcc/x86_64-redhat-linux/4.3.2/../../../../lib64/crt1.o: In  
> function `_start':
> (.text+0x20): undefined reference to `main'
> /usr/local/ncl5/lib/libncarg.a(cpcldm.o): In function `cpcldm_':
> cpcldm.f:(.text+0x7eb): undefined reference to `_gfortran_copy_string'
> cpcldm.f:(.text+0xa20): undefined reference to `_gfortran_pow_r4_i4'
> cpcldm.f:(.text+0xa8f): undefined reference to `_gfortran_pow_r4_i4'
> cpcldm.f:(.text+0xdb6): undefined reference to `_gfortran_copy_string'
> cpcldm.f:(.text+0xe35): undefined reference to `_gfortran_copy_string'
> cpcldm.f:(.text+0xef3): undefined reference to `_gfortran_copy_string'
> cpcldm.f:(.text+0xfca): undefined reference to `_gfortran_copy_string'
> cpcldm.f:(.text+0x104e): undefined reference to  
> `_gfortran_copy_string'
> /usr/local/ncl5/lib/libncarg.a(cpcldm.o):cpcldm.f:(.text+0x10da):  
> more undefined references to `_gfortran_copy_string' follow
> /usr/local/ncl5/lib/libncarg.a(cppkcl.o): In function `cppkcl_':
> cppkcl.f:(.text+0x451): undefined reference to `_gfortran_pow_r4_i4'
> cppkcl.f:(.text+0x518): undefined reference to `_gfortran_pow_r4_i4'
> cppkcl.f:(.text+0x54a): undefined reference to `_gfortran_pow_r4_i4'
> cppkcl.f:(.text+0x733): undefined reference to `_gfortran_copy_string'
>
> ... etc...
> gzputs.f:(.text+0x62): undefined reference to `_gfortran_copy_string'
> gzputs.f:(.text+0xd3): undefined reference to `_gfortran_copy_string'
> gzputs.f:(.text+0x146): undefined reference to `_gfortran_copy_string'
> /usr/local/ncl5/lib/libncarg_gks.a(gzopwk.o):gzopwk.f:(.text 
> +0x471): more undefined references to `_gfortran_copy_string' follow
> collect2: ld returned 1 exit status
>
> Am I missing anything obvious?!
> Thanks,
> Rich
> _______________________________________________
> ncl-install mailing list
> List instructions, subscriber options, unsubscribe:
> http://mailman.ucar.edu/mailman/listinfo/ncl-install

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.ucar.edu/pipermail/ncl-install/attachments/20090302/9aa9a7f6/attachment.html 


More information about the ncl-install mailing list