Ross
Ross

Reputation: 25

Compiling with gfortran instead of ifort

I've got a program that's been optimized for ifort, however I'd like to compile it using gfortran instead. Here are the flags provided:

FCFLAGS=  -Vaxlib -CB -mcmodel=large -O -openmp -DOMP

I've had a look in the manual entries for both to try and find a corresponding options, but I haven't been able to find anything (other than -openmp for -fopenmp, which I knew already).

Upvotes: 2

Views: 5203

Answers (1)

Hristo Iliev
Hristo Iliev

Reputation: 74495

Here it is, an option by option equivalence table:

ifort          gfortran         Commentary
-----------------------------------------------------------------------
-Vaxlib                         Enables old VAX library compatibility
                                (should not be necessary with gfortran
                                 and newer ifort versions)
-CB            -fbounds-check   Enables array bounds check at run-time
-mcmode=large  -mcmodel=large   Enables large memory model
-O             -O2              Enables optimisaiton
-openmp        -fopenmp         Enables OpenMP support
-DOMP          -DOMP            Preprocessor option (defines the OMP symbol)

Note that enabling bounds checking and large memory model would slow down code execution. Also note that -O alone enables different level of optimisations with ifort (equivalent to -O2) and with gfortran (equivalent to -O1). Also note that ifort optimises much more aggresively than gfortran. You might need to provide more options to fine tune the latter in order to reach performance on par with that of ifort.

Upvotes: 3

Related Questions