gpt4 book ai didi

c++ - 如何为 Windows 版 Mathematica 设置英特尔 C++ Composer XE?

转载 作者:行者123 更新时间:2023-11-30 04:30:08 26 4
gpt4 key购买 nike

我试过了

    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

最佳答案

开始于

  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"

我得到了那个可执行文件。

关于c++ - 如何为 Windows 版 Mathematica 设置英特尔 C++ Composer XE?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8905293/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com