如何设置 Intel C++适用于 Windows 的 Mathematica Composer XE?

发布于 2024-12-27 17:02:14 字数 1383 浏览 0 评论 0原文

我尝试过

    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

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

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

姐不稀罕 2025-01-03 17:02:14

首先

  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"

我得到了该可执行文件。

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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文