我试过了
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