Unable to run the ifort from the command line

Unable to run the ifort from the command line

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.

12 posts / 0 new
Last post
For more complete information about compiler optimizations, see our Optimization Notice.
Steve Lionel (Intel)'s picture

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.

Steve
mecej4's picture

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.

Quoting Steve Lionel (Intel)
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

Steve Lionel (Intel)'s picture

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.

Steve

Quoting Steve Lionel (Intel)
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

mecej4's picture

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.

Steve Lionel (Intel)'s picture

Ah, I had forgotten that the Windows compiler doesn't use -r8. -O5 is not a supported option: -O3 is the top level.

Steve

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

Steve Lionel (Intel)'s picture

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?

Steve

Quoting Steve Lionel (Intel)
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.

Steve Lionel (Intel)'s picture

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?

Steve

Login to leave a comment.