- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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)
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)
Link Copied
4 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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
.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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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

Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page