ICC由于配置不正确而无法用MACO编译简单的测试程序

发布于 2025-01-26 10:51:48 字数 2116 浏览 3 评论 0 原文

我有一个非常简单的测试程序,该程序实际上没有做任何事情:

#include <iostream>

int main() { }

使用以下命令编译此程序会给我一个很长的错误消息:

icpc test.cpp
In file included from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/algorithm(640),
                 from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/__string(57),
                 from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/string_view(175),
                 from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/string(506),
                 from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/__locale(14),
                 from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/ios(215),
                 from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/iostream(37),
                 from main.cpp(1):
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/type_traits(1041): error: function call is not allowed in a constant expression
      __is_function(_Tp)
                        ^

似乎有些错误配置了,但是我无法弄清楚它是什么。

这是一些版本信息:

$ icpc --version
icpc (ICC) 19.1.3.301 20200925
Copyright (C) 1985-2020 Intel Corporation.  All rights reserved.

$ /usr/bin/xcodebuild -version
Xcode 13.3.1
Build version 13E500a

$ system_profiler SPSoftwareDataType
Software:

    System Software Overview:

      System Version: macOS 12.3.1 (21E258)
      Kernel Version: Darwin 21.4.0
      Processor Name: 12-Core Intel Xeon E5
      Processor Speed: 2,7 GHz
      Number of Processors: 1
      Total Number of Cores: 12
      ...

I have a very simple test program which does not actually do anything:

#include <iostream>

int main() { }

Compiling this with the following command gives me a very long error message:

icpc test.cpp
In file included from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/algorithm(640),
                 from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/__string(57),
                 from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/string_view(175),
                 from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/string(506),
                 from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/__locale(14),
                 from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/ios(215),
                 from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/iostream(37),
                 from main.cpp(1):
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/type_traits(1041): error: function call is not allowed in a constant expression
      __is_function(_Tp)
                        ^

It seems something is incorrectly configured, but I cannot figure out what it is.

Here is some version info:

$ icpc --version
icpc (ICC) 19.1.3.301 20200925
Copyright (C) 1985-2020 Intel Corporation.  All rights reserved.

$ /usr/bin/xcodebuild -version
Xcode 13.3.1
Build version 13E500a

$ system_profiler SPSoftwareDataType
Software:

    System Software Overview:

      System Version: macOS 12.3.1 (21E258)
      Kernel Version: Darwin 21.4.0
      Processor Name: 12-Core Intel Xeon E5
      Processor Speed: 2,7 GHz
      Number of Processors: 1
      Total Number of Cores: 12
      ...

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

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

发布评论

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

评论(1

〃安静 2025-02-02 10:51:48

Intel Classic Compiler仅使用Intel®处理器对Mac*计算机提供支持。我们可以看到您正在使用MacOS和Xcode版本的不支持版本。
请从下面的链接中检查英特尔经典编译器的系统要求:

尝试使用任何支持的OS版本(MacOS* 10.15,11.0,11.2 Big Sur,12.0 Monterey)和Xcode版本(Xcode* 11.x,Xcode* 12.1,Xcode* 13.1)。

谢谢问候,
Hemanth

Intel Classic compiler does MacOS* support for Mac* computers with Intel® Processors only. We can see that you are using the Unsupported version of the MACOS and Xcode versions.
please check the system requirements of Intel Classic Compiler from the below link:
https://www.intel.com/content/www/us/en/developer/articles/system-requirements/oneapi-c-compiler-system-requirements.html

Try with any one of the supported OS versions(macOS* 10.15, 11.0,11.2 Big Sur, 12.0 Monterey) and Xcode versions(Xcode* 11.x , Xcode* 12.1, Xcode* 13.1).

Thanks & Regards,
Hemanth

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