Re: shared lib can't be loaded

From: Mary Haley <haley_at_nyahnyahspammersnyahnyah>
Date: Wed, 15 Feb 2006 17:21:05 -0700 (MST)

Hi Leilei,

There could be one of two things going on here. One is there's an
oddity with g77 and fortran routine names that have a underscore in
them. This oddity can cause problems when you are trying to create a
shared object. However, the version of WRAPIT you are using should be
taking care of this oddity behind the scenes, so I'm not sure that's
the problem.

Secondly, perhaps the "g_arxr" routine is from some other Fortran file
that needs to get compiled and loaded with your shared object. Do you
know if your code is directly calling this subroutine?

--Mary

> And when I grep that symbol "g_arxr" in the object/lib file, it is indeed

On Wed, 15 Feb 2006, Leilei Wang wrote:

> Hi,
> NCL binary ncl-4.2.0.a033.Linux_i686 is installed on our RedHat Linux
> with Intel Xeon archetecture. And we have lf95 Fortran compiler from Lahey
> Inc. I'm trying to use the shared library wrf_user_fortran_util_0.so in NCL
> script but got the following error:
>
> ###########################################################################################
> $ ncl < wrf_bwave.ncl
> Copyright (C) 1995-2006 - All Rights Reserved
> University Corporation for Atmospheric Research
> NCAR Command Language Version 4.2.0.a033
> The use of this software is governed by a License Agreement.
> See http://www.ncl.ucar.edu/ for more details.
> warning:An error occurred loading the external file
> ./wrf_user_fortran_util_0.so, file not loaded
> ./wrf_user_fortran_util_0.so: undefined symbol: g_arxr
> fatal:syntax error: line 152 in file WRFUserARW.ncl before or near :
> wrf_user_fortran_util_0 :
> ------------------------------^
>
>
> fatal:syntax error: possibly an undefined procedure
> fatal:syntax error: line 156 in file WRFUserARW.ncl before or near :
> wrf_user_fortran_util_0 :
> ------------------------------^
> ##############################################################################################
>
> The following is the step generating shared library
> wrf_user_fortran_util_0.so:
>
> ****************************************************** construct C wrapper
> for fortran code...
> wrapit77 < wrf_user_fortran_util_0.f > wrf_user_fortran_util_0_W.c
> wrapper generated
>
> compile C wrapper...
> nhlcc -c wrf_user_fortran_util_0_W.c
> gcc -DSYSV -D_POSIX_SOURCE -D_XOPEN_SOURCE -DByteSwapped -DNeedFuncProto
> -ansi -O -c wrf_user_fortran_util_0_W.c -L/home/lwang/ncarg/lib
> -L/usr/X11R6/lib -I/home/lwang/ncarg/include -I/usr/X11R6/include -lhlu
> -lncarg -lncarg_gks -lncarg_c -lX11 -lXext -lg2c -lgcc -lm
> gcc: -lhlu: linker input file unused because linking not done
> gcc: -lncarg: linker input file unused because linking not done
> gcc: -lncarg_gks: linker input file unused because linking not done
> gcc: -lncarg_c: linker input file unused because linking not done
> gcc: -lX11: linker input file unused because linking not done
> gcc: -lXext: linker input file unused because linking not done
> gcc: -lg2c: linker input file unused because linking not done
> gcc: -lgcc: linker input file unused because linking not done
> gcc: -lm: linker input file unused because linking not done
> C wrapper compiled
>
> compile fortran routine...
> lf95 -c wrf_user_fortran_util_0.f -L/home/lwang/ncarg/lib -L/usr/X11R6/lib
> -L/usr/local/lib -I/home/lwang/ncarg/include -I/usr/X11R6/include -lhlu
> -lncarg -lncarg_gks -lncarg_c -lX11
> -L/usr/lib/gcc-lib/i386-redhat-linux/egcs-2.91.66 -lg2c -lm
> Encountered 0 errors, 0 warnings in file wrf_user_fortran_util_0.f.
> fortran routine compiled
>
> create shared library...
> lf95 --shared -o wrf_user_fortran_util_0.so wrf_user_fortran_util_0.o
> wrf_user_fortran_util_0_W.o
> shared library created
>
> *******************************************************************
>
> And when I grep that symbol "g_arxr" in the object/lib file, it is indeed
> undefined. But I can't figure out why the shared lib is not generated
> correctly. Do you have some idea on this?
>
> Thanks,
> Leilei
> _______________________________________________
> ncl-talk mailing list
> ncl-talk_at_ucar.edu
> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>
_______________________________________________
ncl-talk mailing list
ncl-talk_at_ucar.edu
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Wed Feb 15 2006 - 17:21:05 MST

This archive was generated by hypermail 2.2.0 : Wed Feb 15 2006 - 21:20:26 MST