17
$\begingroup$

I wish to try the trial version of the latest Intel C++ Compiler for Windows with Mathematica. I have downloaded the current version of Intel® C++ Composer XE 2011 for Windows and installed only the "Intel C++ Compiler" component from this package. But Mathematica does not recognize it:

In[1]:= Needs["CCompilerDriver`"]
CCompilers[]

Out[2]= {}

How to configure Mathematica to use the Intel C++ Compiler?

$\endgroup$
14
  • $\begingroup$ Make sure you have installed the 64 bit tools for Visual studio (if you are on a 64 bit system). You did install visual studio right? $\endgroup$
    – Ajasja
    Commented May 23, 2012 at 15:02
  • 2
    $\begingroup$ Yes, for the Intel compiler it is strictly necessary. It works with the Express edition as well, at least I think so. $\endgroup$
    – Ajasja
    Commented May 23, 2012 at 15:08
  • 4
    $\begingroup$ This Intel version 12 is not supported, and that's why CCompilerDriver is not automatically detecting your Intel compiler. Until I have a chance to look into this, you could go into AddOns/Applications/CCompilerDriver/IntelCompilerWindows.m and replace ICPP_COMPILER11 with ICPP_COMPILER12. This may work only superficially, but it would be the fastest thing for you to try. $\endgroup$
    – Joel Klein
    Commented May 24, 2012 at 2:24
  • 1
    $\begingroup$ @jfklein It works, thank you. @Ajasja After defining $CCompiler = {"Compiler"->CCompilerDriver`IntelCompiler`IntelCompiler,"CompilerInstallation"->"C:\\Program Files\\Intel\\Composer XE 2011 SP1\\"}; now DefaultCCompiler[] returns CCompilerDriver`IntelCompiler`IntelCompiler. $\endgroup$ Commented May 24, 2012 at 10:03
  • 1
    $\begingroup$ CCompilers[] only lists compilers that are seen to be valid installations. CCompilers[Full] will list all compilers supported on that $SystemID. $\endgroup$
    – Joel Klein
    Commented May 24, 2012 at 18:01

1 Answer 1

13
$\begingroup$

Mathematica 8 automatically detects Intel version 11, but not Intel version 12 which was released later.

In order to use the Intel 12 compiler, you'll need to set $CCompiler to point CCompilerDriver to where you've installed the Intel compiler:

Needs["CCompilerDriver`"]
$CCompiler = {"Compiler" -> 
    CCompilerDriver`IntelCompiler`IntelCompiler, 
   "CompilerInstallation" -> "E:\\IntelCompiler"};

You can put this in a kernel initialization file, such as $UserBaseDirectory/Kernel/init.m so you don't need to evaluate it every time you start Mathematica.

$\endgroup$
1
  • 2
    $\begingroup$ This should now Just Work in Mathematica 9. $\endgroup$
    – Joel Klein
    Commented Nov 30, 2012 at 3:18

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.