简体   繁体   中英

icc cannot compile a simple test program with macos because of incorrect configuration

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

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM