I am working on the project of porting numerous codes from f77 TruUnix to Linux f90 64bit. Really struggling with some of this. The contempt28 program uses the shared library and pgplot to create plotting files. The contempt28 is integrated with using the pgplot with the shared libraries.
I am trying to make this work have stalled getting the shared library built.The build order is pgplot (done), the shlib(shared library) and link to pgplot. Then build contempt28 and link to shlib and pgplot.
When compiling a shared library and linking to PGPLOT as shown here in the Makefile, I get the following error. The libpgplot.a was built in the pgplot build.
/opt/intel/bin/ifort -debug -shared -fPIC -align dcommons -real-size 64 -warn nousage -o pgprompt.so pgprompt.f -L/rxe/source/shlib/v21_cp03/v2.1.cp03/pgplot -lpgplot -lX11
ld: /rxe/source/shlib/v21_cp03/v2.1.cp03/pgplot/libpgplot.a(xwdriv.o): relocation R_X86_64_32S against `.text' can not be used when making a shared object; recompile with -fPIC
/rxe/source/shlib/v21_cp03/v2.1.cp03/pgplot/libpgplot.a: could not read symbols: Bad value
make: *** [pgprompt.so] Error 1
MAKEFILE:
FC=/opt/intel/bin/ifort
CC=/opt/intel/bin/icc
CFLAGS=-g -shared -fPIC
FFLAGS=-debug -shared -fPIC -align dcommons -real-size 64 -warn nousage
LFLAGS=-debug -shared -fPIC -align dcommons -real-size 64 -warn nousage
PGPLOT_DIR=/rxe/source/shlib/v21_cp03/v2.1.cp03/pgplot
all: interfaces.so hpgl_routines.so system.so pgprompt.so datey2k.so
interfaces.so : interfaces.c
$(CC) $(CFLAGS) -o interfaces.so interfaces.c
hpgl_routines.so : hpgl_routines.f
$(FC) $(FFLAGS) -o hpgl_routines.so hpgl_routines.f
system.so : system.f
$(FC) $(FFLAGS) -o system.so system.f
pgprompt.so : pgprompt.f
$(FC) $(LFLAGS) -o pgprompt.so pgprompt.f -L${PGPLOT_DIR} -lpgplot -lX11
datey2k.so : datey2k.f
$(FC) $(FFLAGS) -o datey2k.so datey2k.f
mktemp.o: mktemp.f
$(FC) $(FFLAGS) -o mktemp.o mktemp.f
Thanks in advance for help.