Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.

ifort and f77 + f90 sources?

merrittr
Beginner
1,395 Views
hi

I have a mixed bag of ~ 30 .for and .f90 files that in a win32 compaq
vis fortran world compile.
So my task is to move them over to a linux/unix intel fortran
implementation. So my first monkey like attempt was

ifort *.f*

this of course did not pan out , so I modified some use commands

USE DFPORT -> USE IFPORT

compiled some modules (thanks to PaulV of this group). So my question
is how can i use ifort
to compile both "versions" of fortran (.for f77 .f90 f90)
0 Kudos
4 Replies
TimP
Honored Contributor III
1,395 Views
How about a simple Makefile containing e.g.
.SUFFIXES: .for .f90

yourexe: list of .o needed
ifort -o $@ *.o

.for.o:
ifort -c -assume protect_parens $*.for

.f90.o:
ifort -c -assume protect_parens $*.f90
0 Kudos
jimdempseyatthecove
Honored Contributor III
1,395 Views

If the problem reduces itself down to name changing for USE module names then may I suggest using the Fortran Preprocessor in IVF. With Preprocess enabled in the IDE, define DFPORT as IFPORT. You can use the same technique to redefine library function/subroutine names. Anything more complicated than name substitutions and/or option switches will require you to edit the code. The code can have conditionals to facilitate compilation on both platforms.

Jim Dempsey

0 Kudos
jimdempseyatthecove
Honored Contributor III
1,395 Views

Variation on Make file would be to make your execuitable dependent on (link with)multiple static libraries. One with .for, one for .f90, one for .f, etc...

Jim Dempsey

0 Kudos
merrittr
Beginner
1,395 Views
Hey Thanks guys I will start off with the Makefile idea. I think my problem is I need the compiler to treat the .for and the .f90 files differently
0 Kudos
Reply