GNU make and F90

From: Feed_me_spam (flurboglarf_at_mailinator.com)
Date: 05/24/04


Date: 24 May 2004 13:09:47 -0700

Hi,
I am trying to use GNU make to compile a Fortran 90 program on my
Linux box. It seems that it doesn't recognize the suffix .f90. The
strange problem I encounter is the following: I have an identically
structured code collection in F77 which I compile with almost the same
makefile, and the compilation works. With the F90 version, the only
difference is
< MSOURCES=$(OBJECTS:.o=.f90)

---
> MSOURCES=$(OBJECTS:.o=.f)
14c24
< %.o:  %.f90 %.h
---
> %.o:  %.f %.h
The relevant parts in the F90 makefile are
SOURCES=$(MSOURCES) $(AUXLIB:.o=.f)
%.o:	%.f90 %.h
	$(FC) $(FFLAGS) $< -o $@
a.out:	$(HEADERS) $(SOURCES) $(OBJECTS) libaux.a
		$(FC) $(OBJECTS) $(LIBFLAG) $(LDFLAGS) -o $@
libaux.a:	$(AUXLIB:.o=.f)
		$(FC) $(FFLAGS_SPEC) $^
		ar -vru $@ $(AUXLIB)
		rm $(AUXLIB)
The F77 stuff for libaux is compiled well, but then make doesn't try
to build the objects of the main stuff from MSOURCES, but already
tries to link and of course stops with the error
/usr/bin/ld: cannot open alphaslct.o: No such file or directory
make: *** [/home/tr/tmp/a.out] Error 1
The F90 code itself compiles if I just compile everything with ifort
-c *.f90; ifort *.o, so the problem is not with the code.
Any ideas? I have already tried to insert a .SUFFIXES instruction, but
that shows no effect.
Tom


Relevant Pages

  • Re: Specifying at 16-bit integer
    ... > I try to use only Standard Fortran in my programs, ... > One of the long-standing problems is declaring variables with a ... f90: COMPILE TIME 0.060000 SECONDS ...
    (comp.lang.fortran)
  • GNU make and F90
    ... I am trying to use GNU make to compile a Fortran 90 program on my ... It seems that it doesn't recognize the suffix .f90. ... The F90 code itself compiles if I just compile everything with ifort ...
    (comp.lang.fortran)
  • IMSL 5.0 & IFC 8.0
    ... I am trying to compile my application ... F90= ifort ... $${FDEBUG} ${FOPTIMIZE} -c $io_routines.f90 -o ...
    (comp.lang.fortran)
  • Re: GNU make and F90
    ... It seems that it doesn't recognize the suffix .f90. ... | structured code collection in F77 which I compile with almost the same ... so you have a mix of fixed form and free form in your new build ... then I would add a separate rule for the free form build going ...
    (comp.lang.fortran)
  • Compiling gcc-3.3.1 for opteron
    ... but the compile flops out on this ... /tmp/ccDxVb21.s:37: Error: suffix or operands invalid for Push' ... /tmp/ccDxVb21.s:38: Error: suffix or operands invalid for Movq' ...
    (comp.os.linux.misc)