moving fortran code from win32->ifort on unix : Fortran
This is a discussion on moving fortran code from win32->ifort on unix within the Fortran forums in Programming Languages category; 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)...
![]() |
| | LinkBack | Thread Tools |
|
#1
| |||
| |||
| 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) |
|
#2
| |||
| |||
| You could do this using the preprocessor: .... #ifdef WIN32 use dfport #else use ifport #endif There is usually a compiler option to turn on preprocessing and you may or may not have to define WIN32 yourself. On unix an uppercase F in the filename (e.g. x.F90) is enough to cause the preprocessor to be run. Simon Geard merrittr wrote: > 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) |
|
#3
| |||
| |||
| merrittr wrote: > 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) You need a makefile. I use something like... OBJS = (list of object files the .f90 files compile to) %o: %f90 ${FC} ${F90FLAGS} ${INCS} ${OPTFLAGS} $< $(BINDIR): ${FC} ${OPTFLAGS} -o ${EXEC} ${OBJS} ${LIBS} ${LINKFLAGS} (the definition of FC, F90FLAGS, etc. occurs previously in the makefile) I don't think my rule for building the f90 files would work on a mix of ..f90 and .for files, though... if you look at the documentation for Make, you may find some alternatives that will work better for your specific case. |
|
#4
| |||
| |||
| SimonG wrote: > You could do this using the preprocessor: > > ... > #ifdef WIN32 > use dfport > #else > use ifport > #endif > For a real example of conditional inclusion of IFPORT (works on Windows and linux): #ifdef __INTEL_COMPILER USE IFPORT, ONLY: system #endif Surely, DVF/CVF had a more appropriate #define than WIN32 for choosing dfport. |
![]() |
« Previous Thread
|
Next Thread »
| Thread Tools | |
| |
| ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| moving from ifort to gfortran | usenet | Fortran | 4 | 12-17-2007 03:01 PM |
| Read DOS or Unix files with the same fortran code | usenet | Fortran | 12 | 12-01-2007 09:58 AM |
| how to call C (non-intel C compiler) from ifort (intel fortran)? | usenet | Fortran | 4 | 10-02-2007 07:11 PM |
| Parallelize an existing Fortran code and generate parallel Fortran code using Maple? | usenet | Fortran | 12 | 08-02-2007 07:36 AM |
| unix script won't run on Win32 | usenet | awk | 3 | 01-02-2006 10:50 AM |
All times are GMT -5. The time now is 05:24 PM.




