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

Unable to run the ifort from the command line

cbarmpar
Beginner
1,989 Views
Dear all,

I used to program fortran in a linux environment.

I have recently been asked to use windows so I would like to compile fortran files from the command line.

I have installed the intell paralle studio which includes ifort.

But when i try to run the ifort command from the powershell it is not recognised.
Does anyone knows how to invoke the ifort from the CMD?

Will the perfomance of the compiled software be the same as the one compiled in a Linux system?

Many thanks in advance.

0 Kudos
11 Replies
Steven_L_Intel1
Employee
1,988 Views
Just as you do on Linux, you need to establish the proper command environment. In our Windows product, we provide "shortcuts" that do this for you. Click on the Start button, then select All Programs > Intel Parallel Studio XE 2011> Command Prompt > Parallel Studio XE with Intel Compiler XE v12.0 and then one of the command prompt shortcuts listed. What I usually do is copy and paste one of these to my desktop for easy reference.
0 Kudos
mecej4
Honored Contributor III
1,988 Views
As delivered, Intel Fortran works either from VisualStudio or from the standard shell (cmd.exe). You should be able to use the compiler from another shell, but you may need to make any necessary modifications to the startup script (ifortvars.bat) yourself.
0 Kudos
cbarmpar
Beginner
1,988 Views
Just as you do on Linux, you need to establish the proper command environment. In our Windows product, we provide "shortcuts" that do this for you. Click on the Start button, then select All Programs > Intel Parallel Studio XE 2011> Command Prompt > Parallel Studio XE with Intel Compiler XE v12.0 and then one of the command prompt shortcuts listed. What I usually do is copy and paste one of these to my desktop for easy reference.

Thanks for your reply.

I have managed to add the appropriate paths to the system variables.

The problem that I have now is that the -r8 command is not recognised.

Does that mean that I have done something wrong in the system variables?

Thanks
0 Kudos
Steven_L_Intel1
Employee
1,988 Views
You should not add to system environment variables. Please use the environment shortcuts and scripts provided.

-r8 should work. Please show the output of the ifort command when you try it.
0 Kudos
cbarmpar
Beginner
1,988 Views
You should not add to system environment variables. Please use the environment shortcuts and scripts provided.

-r8 should work. Please show the output of the ifort command when you try it.

the output during compilation is:

ifort -i4 -r8 -O5 -xSSE4.2 -c ./Code/ConvFlux.f90
Intel Visual Fortran Intel 64 Compiler XE for applications runnin
l 64, Version 12.0.0.104 Build 20101006
Copyright (C) 1985-2010 Intel Corporation. All rights reserved.
ifort: command line warning #10006: ignoring unknown option '/r8'
ifort: command line warning #10006: ignoring unknown option '/O5'
ifort: command line warning #10006: ignoring unknown option '/xSSE4.2'

Many thanks once again
0 Kudos
mecej4
Honored Contributor III
1,988 Views
The options for the Windows IFort compiler are not always the same as for the Linux compiler.

LINUX WINDOWS

-r8 /4R8

-O5 /O3

-xSSE4.2 /QxSSE4.2

and so on -- please read the compiler documentation, and note that there are several hundred options, so it is useful to know where to look them up.
0 Kudos
Steven_L_Intel1
Employee
1,988 Views
Ah, I had forgotten that the Windows compiler doesn't use -r8. -O5 is not a supported option: -O3 is the top level.
0 Kudos
cbarmpar
Beginner
1,988 Views
Quoting mecej4
The options for the Windows IFort compiler are not always the same as for the Linux compiler.

LINUX WINDOWS

-r8 /4R8

-O5 /O3

-xSSE4.2 /QxSSE4.2

and so on -- please read the compiler documentation, and note that there are several hundred options, so it is useful to know where to look them up.

The problem has been solved.

Is the performance of a code compiled in windows the same as the one compiled iin linux?

It seems that the same code runs much faster in linux.

Is there any reason for that?

Kind regards
0 Kudos
Steven_L_Intel1
Employee
1,988 Views
The performance should be pretty much the same - I have seen reports of Windows being slightly faster. What options are you using on the two systems and are they the same hardware?
0 Kudos
cbarmpar
Beginner
1,988 Views
The performance should be pretty much the same - I have seen reports of Windows being slightly faster. What options are you using on the two systems and are they the same hardware?

same machine i7 2720QM
same code
Windows 7 vs Ubuntu 10.10

the compiler at linux is older.
0 Kudos
Steven_L_Intel1
Employee
1,988 Views
Which compiler options did you use on each and what kind of difference are you seeing? Is the difference repeatable? (Make sure you don't have anything else running in the background such as virus scans.) How are you timing it?
0 Kudos
Reply