Help linking f77 libraries into gfortran





I've recently installed gcc 4.2.1 on i686-pc-cygwin from source code. I've
been testing the gfortran compiler and ran across a problem linking f77
libraries. My Makefile is:



mingwlib = -L/cygdrive/c/Devel/MinGW/lib

CFLAGS = -O2 -malign-double -mtune=pentium4

CC = gfortran

librs = -lSLATEC \

-lPSPLOT

objects = TA1Main.o \

random.o \

TA1QPoutput.o \

TA1SelectPort.o \

TA1Neighbor.o \

TA1Calcqr.o \

TA1Threshold.o \

TA1Solver.o \

TA1PSplot.o

TA1 : $(objects)

$(CC) $(CFLAGS) $(objects) $(mingwlib) $(librs) -o TA1.exe

TA1Main.o : TA1Main.f

$(CC) $(CFLAGS) TA1Main.f -c

random.o : random.f

$(CC) $(CFLAGS) random.f -c

TA1QPoutput.o : TA1QPoutput.f

$(CC) $(CFLAGS) TA1QPoutput.f -c

TA1SelectPort.o : TA1SelectPort.f

$(CC) $(CFLAGS) TA1SelectPort.f -c

TA1Neighbor.o : TA1Neighbor.f

$(CC) $(CFLAGS) TA1Neighbor.f -c

TA1Calcqr.o : TA1Calcqr.f

$(CC) $(CFLAGS) TA1Calcqr.f -c

TA1Threshold.o : TA1Threshold.f

$(CC) $(CFLAGS) TA1Threshold.f -c

TA1Solver.o : TA1Solver.f

$(CC) $(CFLAGS) TA1Solver.f -c

TA1PSplot.o : TA1PSplot.f

$(CC) $(CFLAGS) TA1PSplot.f -c

..PHONY : clean

clean:

rm -rf $(objects) TA1.exe



This produces many errors similar to:

/cygdrive/c/Devel/MinGW/lib/libSLATEC.a(xersve.o):xersve.f:(.text+0x206):
undefined reference to `_s_copy'

The program compiles using g77 without problems. I'd like to know if it is
possible to use the SLATEC and PSPLOT as-is or do I need to recompile new
libraries to use in gfortran. (For the moment, I'd like to link to these
existing libraries if possible.) I've tried various gfortran switches and
macros but to no avail.

Thanks Mike


.



Relevant Pages

  • Re: Help linking f77 libraries into gfortran
    ... been testing the gfortran compiler and ran across a problem linking f77 ... libraries to use in gfortran. ...
    (comp.lang.fortran)
  • Re: Allocatable arrays and shared libraries: help needed
    ... linux you have to name the library as libLIBRARYNAME.a whereas in Win ... if you said you understood anything about building libraries ... and linking with gfortran it would have been evidence that you were ... make the decoration in a limited number of cases, ...
    (comp.lang.fortran)
  • problem of building stardict
    ... checking for gcc... ... checking for C compiler default output file name... ... checking how to recognize dependent libraries... ... checking for gfortran... ...
    (Fedora)
  • Re: best software environment for numerical analysis
    ... GNU gcc-4.0 will include gfortran instead of g77. ... libraries. ... octave is next best and is ... code written for Matlab runs on octave, ...
    (sci.math.num-analysis)
  • Re: using dot_product from c++
    ... + Second question(just curious about to give a try to file processing) ... You need to either link using gfortran, ... Steve already mentioned that -lg2c was suspect. ... what libraries one needs in a simple handoff of two vectors in a calculation ...
    (comp.lang.fortran)