Solved! NCL, and problems compiling with wrapit77 on Linux 64-bit FC4

From: Christian Pagé <page.christian_at_nyahnyahspammersnyahnyah>
Date: Thu, 1 Dec 2005 14:01:16 -0500

Hi everyone,

Thanks all for your input. I was successfull finally, by doing these steps:

- Use the ncl-4.2.0.a032.LINUX_RH9d_PC.tar.gz version of NCL.
- Add -m32 compilation flag to : nhlcc and gcc invocations (the -tp px
flag for pgf90 is creating 32-bit objects already).
- Replace ld with pgf90 to get the proper libraries when creating the
.so file to:
pgf90 -tp px -fpic -byteswapio

The resulting Makefile is then:
libnclrpn: libnclrpn.wib divlib.o get_step.o get_step_niv.o get_dim.o
get_typgrille.o get_proj.o get_proj_lambert.o sr_lecture.o
proc_lecture.o get_datev.o mktimec.o get_pipj.o uvrotp.o uvrotppt.o
        wrapit77 < libnclrpn.wib > libnclrpn_W.c
        nhlcc -m32 -c libnclrpn_W.c
        pgf90 -tp px -fpic -byteswapio -shared -o libnclrpn.so
libnclrpn_W.o get_step.o
get_step_niv.o get_dim.o get_typgrille.o get_proj.o get_proj_lambert.o
divlib.o sr_lecture.o proc_lecture.o get_datev.o mktimec.o get_pipj.o
uvrotp.o uvrotppt.o $(ARMNLIB)/lib/Linux/librmn.a

divlib.o: divlib.F
        pgf90 -tp px -fpic -byteswapio -c -I. -Mextend -O2 divlib.F

.f.o:
        cp $*.f $*_t.F
        pgf90 -tp px -fpic -byteswapio -c -I. -Mextend -O2 $*_t.F
        mv $*_t.o $*.o
        rm -f $*_t.F

.c.o:
        gcc -fpic -m32 -O2 -c $*.c

Thanks to all,

Christian Pagé
UQAM

2005/11/30, Sam Drinkard <sam_at_wa4phy.net>:
> Christian Pagé wrote:
>
> >Hello,
> >
> >I am trying to compile a code with wrapit77 on my server.
> >The server is x86_64 (AMD opteron), running FC4.
> >
> >I have GNU compilers, but the code I need to link with nhlcc must be
> >compiled using pgf90 -tp px -byteswapio. So, I have pgf90 (32 and
> >64-bit versions), but I only have gcc (I don't have pgcc license). How
> >can I link?
> >
> >If I use this version of NCL:
> >ncl-4.2.0.a032.LINUX_RH9d_PC.tar.gz
> >I get these errors:
> >wrapit77 < libnclrpn.wib > libnclrpn_W.c
> >nhlcc -c libnclrpn_W.c
> >gcc -DSYSV -D_POSIX_SOURCE -D_XOPEN_SOURCE -DByteSwapped
> >-DNeedFuncProto -ansi -O -c libnclrpn_W.c -L/usr/local/ncarg/lib
> >-L/usr/X11R6/lib -I/usr/local/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
> >ld -shared -o libnclrpn.so libnclrpn_W.o get_step.o get_step_niv.o
> >get_dim.o get_typgrille.o get_proj.o get_proj_lambert.o divlib.o
> >sr_lecture.o proc_lecture.o get_datev.o mktimec.o get_pipj.o uvrotp.o
> >uvrotppt.o /usr/local/env/armnlib/lib/Linux/librmn.a
> >ld: libnclrpn_W.o: relocation R_X86_64_32 against `a local symbol' can
> >not be used when making a shared object; recompile with -fPIC
> >libnclrpn_W.o: could not read symbols: Bad value
> >make: *** [libnclrpn] Error 1
> >Exit 2
> >
> >If I use instead this version:
> >ncl-4.2.0.a032.x86_64_LINUX_PC.tar.gz
> >and replace pgcc with gcc in the nhlcc script, I get a whole lot of errors:
> >wrapit77 < libnclrpn.wib > libnclrpn_W.c
> >nhlcc -c libnclrpn_W.c
> >gcc -O -fPIC -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -DSYSV
> >-D_POSIX_SOURCE -D_XOPEN_SOURCE -DByteSwapped -DNeedFuncProto -O -c
> >libnclrpn_W.c -L/usr/local/ncarg/lib -L/usr/X11R6/lib64
> >-L/usr/local/pgi/linux86-64/5.2/lib -L/gpfs/lightning/grubin/lib
> >-I/usr/local/ncarg/include -I/usr/X11R6/include
> >-I/gpfs/lightning/grubin/include -lhlu -lncarg -lncarg_gks -lncarg_c
> >-lX11 -lpgc -lpgf90 -lpgf90_rpm1 -lpgf902 -lpgftnrtl -lpghpf
> >ld -shared -o libnclrpn.so libnclrpn_W.o get_step.o get_step_niv.o
> >get_dim.o get_typgrille.o get_proj.o get_proj_lambert.o divlib.o
> >sr_lecture.o proc_lecture.o get_datev.o mktimec.o get_pipj.o uvrotp.o
> >uvrotppt.o /usr/local/env/armnlib/lib/Linux/librmn.a
> >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: -lpgc: linker input file unused because linking not done
> >gcc: -lpgf90: linker input file unused because linking not done
> >gcc: -lpgf90_rpm1: linker input file unused because linking not done
> >gcc: -lpgf902: linker input file unused because linking not done
> >gcc: -lpgftnrtl: linker input file unused because linking not done
> >gcc: -lpghpf: linker input file unused because linking not done
> >ld: warning: i386 architecture of input file `get_step.o' is
> >incompatible with i386:x86-64 output
> >ld: warning: i386 architecture of input file `get_step_niv.o' is
> >incompatible with i386:x86-64 output
> >ld: warning: i386 architecture of input file `get_dim.o' is
> >incompatible with i386:x86-64 output
> >ld: warning: i386 architecture of input file `get_typgrille.o' is
> >incompatible with i386:x86-64 output
> >ld: warning: i386 architecture of input file `get_proj.o' is
> >incompatible with i386:x86-64 output
> >ld: warning: i386 architecture of input file `get_proj_lambert.o' is
> >incompatible with i386:x86-64 output
> >ld: warning: i386 architecture of input file `divlib.o' is
> >incompatible with i386:x86-64 output
> >ld: warning: i386 architecture of input file `sr_lecture.o' is
> >incompatible with i386:x86-64 output
> >ld: warning: i386 architecture of input file `get_datev.o' is
> >incompatible with i386:x86-64 output
> >ld: warning: i386 architecture of input file `get_pipj.o' is
> >incompatible with i386:x86-64 output
> >ld: warning: i386 architecture of input file `uvrotp.o' is
> >incompatible with i386:x86-64 output
> >ld: warning: i386 architecture of input file `uvrotppt.o' is
> >incompatible with i386:x86-64 output
> >ld: warning: i386 architecture of input file
> >`/usr/local/env/armnlib/lib/Linux/librmn.a(gdadgd.o)' is incompatible
> >with i386:x86-64 output
> >ld: warning: i386 architecture of input file
> >`/usr/local/env/armnlib/lib/Linux/librmn.a(moduledate.o)' is incompati
> >ble with i386:x86-64 output
> >ld: warning: i386 architecture of input file
> >`/usr/local/env/armnlib/lib/Linux/librmn.a(fstd98.o)' is incompatible
> >with i386:x86-64 output
> >ld: warning: i386 architecture of input file
> >`/usr/local/env/armnlib/lib/Linux/librmn.a(xdf98.o)' is incompatible w
> >ith i386:x86-64 output
> >ld: warning: i386 architecture of input file
> >`/usr/local/env/armnlib/lib/Linux/librmn.a(convip.o)' is incompatible
> >with i386:x86-64 output
> >ld: warning: i386 architecture of input file
> >`/usr/local/env/armnlib/lib/Linux/librmn.a(fstcvt2.o)' is incompatible
> > with i386:x86-64 output
> >ld: warning: i386 architecture of input file
> >`/usr/local/env/armnlib/lib/Linux/librmn.a(c_baseio.o)' is incompatibl
> >e with i386:x86-64 output
> >ld: warning: i386 architecture of input file
> >`/usr/local/env/armnlib/lib/Linux/librmn.a(dmms.o)' is incompatible wi
> >th i386:x86-64 output
> >ld: warning: i386 architecture of input file
> >`/usr/local/env/armnlib/lib/Linux/librmn.a(ieeepak.o)' is incompatible
> > with i386:x86-64 output
> >ld: warning: i386 architecture of input file
> >`/usr/local/env/armnlib/lib/Linux/librmn.a(qqexit.o)' is incompatible
> >with i386:x86-64 output
> >ld: warning: i386 architecture of input file
> >`/usr/local/env/armnlib/lib/Linux/librmn.a(tracebck.o)' is incompatibl
> >e with i386:x86-64 output
> >ld: warning: i386 architecture of input file
> >`/usr/local/env/armnlib/lib/Linux/librmn.a(wkoffit.o)' is incompatible
> >
> >(etc.)
> >
> >Many thanks,
> >--
> >Christian Pagé
> >UQAM
> >
> >_______________________________________________
> >ncl-talk mailing list
> >ncl-talk_at_ucar.edu
> >http://mailman.ucar.edu/mailman/listinfo/ncl-talk
> >
> >
> >
> >
> Christian,
>
> I ran into the same problem. I wound up using a 32-bit version of
> the OS to build the shared library, and then use it on the x86_64
> machine. Works perfectly. If you like, I can send the file to you.
> Just too much hassle to try to compile it as is. There is a note or two
> on the message archives where someone built it with the ifort compiler,
> but I had no luck with it either, hence using the 32-bit OS to build.
>
> Sam
>
> --
> Snowman
>
>

--
Christian Pagé
http://meteocentre.com/    http://meteoalerte.com/
Etudiant au Doctorat en Sciences de l'environnement UQAM
_______________________________________________
ncl-talk mailing list
ncl-talk_at_ucar.edu
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Thu Dec 01 2005 - 12:01:16 MST

This archive was generated by hypermail 2.2.0 : Fri Dec 02 2005 - 16:53:43 MST