Proper settings for -fpp on Windows

Proper settings for -fpp on Windows

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?

5 posts / 0 new
Last post
For more complete information about compiler optimizations, see our Optimization Notice.

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.

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?



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

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.

Leave a Comment

Please sign in to add a comment. Not a member? Join today