Intel® C++ Compiler
Community support and assistance for creating C++ code that runs on platforms based on Intel® processors.
7944 Discussions

Launching ICC for Windows from a Cygwin bash shell

user20090419
Beginner
554 Views
It is possible to launch ICC from the Windows command line ( via Intel Software Development Tools Intel C++ Compiler... C++ Build Environment... ).

But how can I launch it from a bash shell, running under cygwin?
Is it possible?
Which environment variable values need to be set ?
What is the path to the executable?
0 Kudos
5 Replies
TimP
Honored Contributor III
554 Views
Quoting - user20090419
It is possible to launch ICC from the Windows command line ( via Intel Software Development Tools Intel C++ Compiler... C++ Build Environment... ).

But how can I launch it from a bash shell, running under cygwin?
Is it possible?
Which environment variable values need to be set ?
What is the path to the executable?
All necessary paths and environment variables are set if you put the Microsoft linker path in ICL.CFG, and open the Intel compiler command line window on the Start menu. Then you can run cygwin.bat so that bash inherits the ICL paths, without breaking ICL. You will sometimes get the bash warning about finding Windows style paths in the environment, but those are necessary for ICL and Microsoft link. Needless to say, the Windows environment variable forgetfulness point will be reached sooner with this setup.
0 Kudos
user20090419
Beginner
554 Views
Quoting - tim18
All necessary paths and environment variables are set if you put the Microsoft linker path in ICL.CFG, and open the Intel compiler command line window on the Start menu. Then you can run cygwin.bat so that bash inherits the ICL paths, without breaking ICL. You will sometimes get the bash warning about finding Windows style paths in the environment, but those are necessary for ICL and Microsoft link. Needless to say, the Windows environment variable forgetfulness point will be reached sooner with this setup.

After I run cygwin.bat, and try to run icl, it says:

link: invalid option -- o
Try `ling --help' for more information.

I verified that icl compiles without any problems before I run cygwin.bat

What am I missing?
0 Kudos
TimP
Honored Contributor III
554 Views
Quoting - user20090419
link: invalid option -- o
Try `ling --help' for more information.

This would indicate that you ignored my advice about icl.cfg, and so you are getting the wrong link.exe. It should have said "link" not "ling."
For a VC9 installation, /windows/C/Program Files/Intel/Compiler/11.1/026/bin/ia32/icl.cfg:
-Qlocation,link,"C:Program FilesMicrosoft Visual Studio 9.0VCbin"
-Qprec-div -Qprec-sqrt -Qansi_alias

0 Kudos
user20090419
Beginner
554 Views
Quoting - tim18
This would indicate that you ignored my advice about icl.cfg, and so you are getting the wrong link.exe. It should have said "link" not "ling."
For a VC9 installation, /windows/C/Program Files/Intel/Compiler/11.1/026/bin/ia32/icl.cfg:
-Qlocation,link,"C:Program FilesMicrosoft Visual Studio 9.0VCbin"
-Qprec-div -Qprec-sqrt -Qansi_alias


You're absolutely right. Problem solved.

I am able to launch ICL from inside Cygwin and generate compiled code utilizing >4 GB or RAM ( the g++ compiler that came with Cygwin was 32-bit and limited to <4 GB).

Also, for code with a lot of floating point arithmetic, I found ICL to be 3x faster than the VCC compiler.

One last question on this topic: can I do without the Visual Studio part? I don't use it either for editing source code or for compilation. Do I still need to buy it?
0 Kudos
TimP
Honored Contributor III
554 Views
As far as I know, VS2005 and 2008, with service packs, are the only way to get the headers, libraries, linker, and library tools needed for ICL Intel64, which apparently you are using. For 32-bit ICL, Visual Studio Express would be sufficient for many purposes. I suppose you could check into the mingw 64-bit gcc and tools, and test whether you can accomplish anything useful with that and ICL.
VC option /fp:fast /Ox is needed to approximate ICL /fp:source /O1, but there is no auto-vectorization in VC. gcc generally performs better than VC; g++ 4.5 approaches performance of ICL, but I don't think Windows g++ supports OpenMP.
0 Kudos
Reply