How to set up Intel C++ Composer XE for Mathematica for Windows?

490 views Asked by At

I tried

    Needs["CCompilerDriver`IntelCompiler`"]

    greeter = CreateExecutable[StringJoin["#include <stdio.h>\n", "int main(){\n", "  printf(\"Hello world.\\n\");\n", "}\n"], "hiworld", "Compiler" -> IntelCompiler, "CompilerInstallation" -> "C:\\Program Files (x86)\\Intel\\Composer XE 2011 SP1\\bin\\ia32", "CompilerName" -> "icl.exe"]

But get an error:

    CreateExecutable::instl: The compiler installation directive "CompilerInstallation" -> C:\Program Files (x86)\Intel\Composer XE 2011 SP1\bin\ia32 does not indicate a usable installation of Intel Compiler. >>

EDIT:

    In[776]:= CCompilers[Full]

    Out[776]= {{"Name" -> "Intel Compiler", "Compiler" -> IntelCompiler, "CompilerInstallation" -> None, "CompilerName" -> Automatic}, {"Name" -> "Generic C Compiler",  "Compiler" -> CompilerDriver`GenericCCompiler`GenericCCompiler,   "CompilerInstallation" -> None, "CompilerName" -> Automatic}}

    In[777]:= CCompilers[]
    Out[777]= {}

It seems MMA didn't find the compiler even after I specified its location.

Did I miss any point here?

http://reference.wolfram.com/mathematica/CCompilerDriver/tutorial/SpecificCompilers.html#394172820

1

There are 1 answers

0
Artes On

Starting with

  Needs["CCompilerDriver`IntelCompiler`"]

check if you have installed IntelCompiler :

   CCompilers[Full]

in my case I get something like this :

 {{"Name" -> "Visual Studio", 
   "Compiler" -> CCompilerDriver`VisualStudioCompiler`VisualStudioCompiler, 
   "CompilerInstallation" -> "C:\\Program Files\\Microsoft Visual Studio 10.0", 
   "CompilerName" -> Automatic}, {...other compilers...},
   {"Name" -> "Intel Compiler", "Compiler" -> IntelCompiler, 
    "CompilerInstallation" -> None, "CompilerName" -> Automatic}}

and evaluating your input greeter=... the error message is like in your case.

Instead, copying from the output of CCompilers[Full] proper installation

In[1]:= Needs["CCompilerDriver`VisualStudioCompiler`"]
In[2]:= greeter =  CreateExecutable[ StringJoin["#include <stdio.h>\n", 
       "int main(){\n","  printf(\"Hello world.\\n\");\n", "}\n"], "hiworld", 
        "Compiler" -> VisualStudioCompiler, "CompilerInstallation" -> 
        "C:\\Program Files\\Microsoft Visual Studio 10.0", "CompilerName" -> "Automatic"]

Out[2]= "C:\\Users\\spindoctor\\AppData\\Roaming\\Mathematica\\\
             SystemFiles\\LibraryResources\\Windows\\hiworld.exe"

I get that executable.