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

what is difference between two command "ifort -O3 -o" and "ifort -o"????

hamid_mosaddeghi
Beginner
1,718 Views
I have two code as write with forran, I can compile them with two command:

### ifort -O3 -o

and

### ifort -o

what is difference between two command? which of them is better used?


Hamid Mosaddeghi
0 Kudos
1 Solution
Ron_Green
Moderator
1,718 Views
-O is optimization level. 3 is the highest optimization.

In the second case, you do not use a -O option, so it defaults to -O2

You'll have to compare runtimes and results to see if they are interchangeable. In general, -O2 is sufficient but sometimes you get a faster application with -O3. It depends on the code.

ron

View solution in original post

0 Kudos
1 Reply
Ron_Green
Moderator
1,719 Views
-O is optimization level. 3 is the highest optimization.

In the second case, you do not use a -O option, so it defaults to -O2

You'll have to compare runtimes and results to see if they are interchangeable. In general, -O2 is sufficient but sometimes you get a faster application with -O3. It depends on the code.

ron
0 Kudos
Reply