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

Proper settings for -fpp on Windows

Syed_R_
Beginner
430 Views

I have -fpp option on Linux. However, when I do the corrosponding setting in the Windows I do not get the exact same answers on Windows as in Linux. On Windows, I am setting the Preprocess Source File option to Yes in the Fortran Preprocessor Option Category.

I think there is some other setting that I have to change on Windows in order to get the same results on Windows as in Linux. Can anyone tell me what am I missing?

0 Kudos
4 Replies
Syed_R_
Beginner
430 Views

I have to add to the question above that I am getting really close answers but there is no reason that the answers should be close. They must be the same. I am looking for settings in Visual Studio that will make it same as the linux -fpp.

0 Kudos
Lorri_M_Intel
Employee
430 Views

fpp is only a preprocessor, and does not generate code, its output is a compilable program, after doing any conditional compilation in the original source code.

You can save the intermediate file by using the ifort command option /Qsave-temps and then look at it yourself.   The corresponding option on Linux is -save-temps

I'm curious why you think that fpp is changing your run-time results?

              --Lorri

 

0 Kudos
Syed_R_
Beginner
430 Views

Got it. Thanks. I have changed the setting to  /fp:precise. However, I was wondering what gcc switch nearest to /fp:precise is?

0 Kudos
TimP
Honored Contributor III
430 Views

ifort /fp:precise /assume:byterecl,buffered_io might be analogous in VS X64 mode to

gfortran -O2 -ftree-vectorize -funroll-loops --param max-unroll-times=4 -flto

If you are using 32-bit mode, you would also set ifort -mia32 or gfortran -march=pentium4 to get similar instruction sets.

Note that you should add ,protect_parens to the ifort assume: options list if you drop /fp, in order to be consistent with gfortran, which never uses -fno-protect-parens unless you set it explicitly. gcc does have no-protect-parens implied by other optimizations, but I assumed you really meant gfortran.  This is one of the few exceptions where gfortran and gcc options may differ.

0 Kudos
Reply