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

Which options to use for optimizations to be similar to linux version

Wee_Beng_T_
Beginner
697 Views

Hi,

In linux, I use "-xP -r8 -132 -fPIC -g -w90 -w -ipo -w95-static-libcxa -O3 " to compile/optimize my code.

However, I found that when I tried to run my code compiled under windows, it seems torun slower, although the processor used is similar.

I also found that the default option for linux and windows are different, is that so? For e.g., check bound is enabled by default in windows but it is disabled in linux.

May I know what's the equavalent options for -xP and -ipo? I can't seem to be similar option in windows.

Thank you very much.

0 Kudos
7 Replies
Steven_L_Intel1
Employee
697 Views
First, you see different defaults because you're using the compiler from inside Visual Studio and in a debug configuration, where additional options are used by default.

In the Compiler Options section of the on-disk documentation is a table giving correspondences between Linux and Windows options. -fPIC and -static-libcxa do not apply on Windows, the others have corresponding options. (-xP is /QxP, -r8 is /real_size:64, -132 is /extend_source:132, etc.) Most of these have settings in the IDE.

Since you are seeing array bounds messages, that means you're building a Debug configuration which has optimizations disabled. Select a Release configuration and you will get -O2 optimization by default.
0 Kudos
Wee_Beng_T_
Beginner
697 Views

Thank you Steve! I found the options comparison in the help files. However, for -xP, I saw that its equivalent is /QaxP, instead of /QxP which you wrote.

Anyway, I tried both and both seem correct during compilation. However, during linking, it says option not recognize. May I know what's wrong?

0 Kudos
TimP
Honored Contributor III
697 Views
Windows /QaxP is equivalent to linux -axP. Steve informed you correctly, as usual. If you drive your link by either ifort option, the correct run-time libraries will be linked. If you don't figure it out, please give exactly the error message. Among the possibilities are that you are using the Intel64 compiler with Visual Studio, but did not install the optional 64-bit CL, which ifort 64-bit requires.
0 Kudos
Steven_L_Intel1
Employee
697 Views
If you use "ifort" to link, then it will accept the compiler switches (though many, such as /QxP, will be ignored when not compiling.). If you use "link" to link, then compiler switches will not be recognized.
0 Kudos
Wee_Beng_T_
Beginner
697 Views

Hi,

I don't really understand what you are talking about. I did my compilation under Vs2003 with ifort 32-bit.

I simply add under command line, additional options in the linking property

/MACHINE:I386 /Qipo /QxP (or /QaxP)

During linking I got:

Link: warning ignoring_unknown_option1: ignoring unknown option '/QxP' (or QaxP)

Am I not supposed to do it this way?

Thank you.

0 Kudos
Steven_L_Intel1
Employee
697 Views
No - those are compiler options, not linker options.

If you want, you can add these under Fortran > Command line > Additional Options, though /QxP and /QaxP can be specified as:

Optimization > Require Intel Processor Extensions > Intel Pentium 4 Processor with Streaming SIMD Extensions 3
(/QxP)
or:
Optimization > Use Intel Processor Extensions > Intel Pentium 4 Processor with Streaming SIMD Extensions 3
(/QaxP)

At present, you have to add /Qipo to Additional Options.


0 Kudos
Wee_Beng_T_
Beginner
697 Views
Ok. I understand now. Thank you.
0 Kudos
Reply