2

I recently switched back to Windows7 (x64) because of perfomance issues with my graphics card on linux but i miss the abilty to easily compile open source software on Windows. I have a copy of the intel c compiler which is somewhat better than the gnu c compiler and i would like to use it to compile software written for linux. I've already installed cygwin and managed to compile something. The 'make-install' didn't work though but that's another issue. Now my question is, how can i tell 'make' to use the windows intel compiler?

Joakim
  • 21
  • 1
  • 2

1 Answers1

0

Most of the configure scripts you'll find in OSS have probably been created by the Autotools. Those should, basically, support the icc. To use it, although you may have GCC installed side-by-side, it would be necessary to set the environment variable CC to the (cygwin) path to Intel's C compiler and CXX to Intel's C++ compiler prior to running configure.

You may run into trouble with software packages that unconditionally set compiler flags that only GCC understands. I have heard, though, that, by now, icc actually implements most of these.

Update

Something similar has been asked before.

Community
  • 1
  • 1
dennycrane
  • 2,301
  • 18
  • 15
  • Thanks for the fast answere! Okay i typed export CC=/path/to/icl.exe and export CXX=/path/to/icl.exe. Didn't work because of what turned out to be whitespace in the path. :) Nothing worked. Not "/Path name" nor "/Path\ name" so i added the path to my path in windows (not in cygwin) and just typed export CC="icl". This worked and the compiler was called but now it gave me following error: "link: unknown option -- o" (yes with the whitespace between -- and o) Any ideas? – Joakim Nov 23 '10 at 16:02
  • In the link above they set `CC` to `icc`. Is that, by chance, the correct executable? – dennycrane Nov 23 '10 at 16:12
  • there is no such executable in my intel compiler path.. I tried to compile a helloworld.c (using "icl helloworld.c"), but i get the error: catastrophic error: could not open source file "stdio". This is a bit weird.. I looked it up and found several stdio.h on my system and i also tried adding their paths to the windows path variable, but still no luck.. – Joakim Nov 23 '10 at 16:35
  • Compilers typically need to be told about include paths via command line, like so `-I'/path/to/dir1' -I'/path/to/dir2'`. I'm not familiar enough with Cygwin to be sure whether you have to give your Cygwin path or the Windows (`C:\\...`) paths here. Once you figured that out, you may hardcode that into `CC` like `export CC="icl -I'/path/to/dir1' -I'/path/to/dir2'"`. Some compilers want to have a space after `-I`. – dennycrane Nov 23 '10 at 16:45
  • 1
    That's the problem. ICC want's Windows Paths, cygwin gives it cygwin-ized paths. Intel CC won't work under cygwin on Windows without much trickery - see 'cygpath'. – jmanning2k Nov 23 '10 at 17:05
  • Hmm i tried with, and without space.. The -I option doesn't fix the error. I tried both, in cygwin and cmd with dos and unix paths. – Joakim Nov 23 '10 at 17:21
  • Ahh.. jmanning2k you're probably right.. :( That sucks. i probably can't just pipe all paths given to icl through cygpath (easily), can i? – Joakim Nov 23 '10 at 17:28