Как настроить Intel C ++ Composer XE для Mathematica для Windows? - PullRequest
1 голос
/ 18 января 2012

Я пытался

    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"]

Но появляется ошибка:

    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. >>

РЕДАКТИРОВАТЬ:

    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]= {}

Кажется, MMA не нашел компилятор даже послеЯ указал его местоположение.

Я что-то упустил здесь?

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

1 Ответ

2 голосов
/ 18 января 2012

Начиная с

  Needs["CCompilerDriver`IntelCompiler`"]

проверьте, установлен ли вы IntelCompiler:

   CCompilers[Full]

, в моем случае я получаю что-то вроде этого:

 {{"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}}

и оценивая ваш ввод greeter=... сообщение об ошибке похоже на ваш случай.

Вместо этого, копируя с выхода CCompilers[Full] правильная установка

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"

Я получаю этот исполняемый файл.

...