微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

如何在 MacOS 11.2.2 和正确版本的命令行工具上使用 Intel 2020.4 编译器进行编译

如何解决如何在 MacOS 11.2.2 和正确版本的命令行工具上使用 Intel 2020.4 编译器进行编译

我希望在 Macbook Pro 16" Intel core 2020 (Big Sur 11.2.2) 上使用 icc 或 icpc Intel 编译器(例如 2020 update4 Parallel Studio)。如果可能,我应该使用哪个版本的命令行工具用吗?

例如,我尝试使用 CTL for Xcode 12.5,但在使用 icc/icpc 编译时没有成功。但其他旧版本也失败了。

我想避免安装 Xcode。编译在 GNU g++ 下运行良好,我不明白为什么它在 CTL 和 Intel 下如此复杂。

很多这样的错误

$ python XCPP_launcher_intel.py
rm -f *.o main_intel.exe
icpc -std=c++11 -O3 -xHost -Wall -c -qopenmp -mkl=parallel -I/Opt/intel/compilers_and_libraries_2020.4.301/mac/mkl/include -I/Opt/intel/compilers_and_libraries_2020/mac/include main_intel.cpp -o main_intel.o
In file included from /Library/Developer/CommandLinetools/usr/include/c++/v1/math.h(311),from /opt/intel//compilers_and_libraries_2020.4.301/mac/compiler/include/math.h(177),from /Library/Developer/CommandLinetools/usr/include/c++/v1/cmath(304),from XSAF_C_intel.h(2),from main_intel.cpp(7):
/Library/Developer/CommandLinetools/usr/include/c++/v1/type_traits(903): error: type name is not allowed
      __is_function(_Tp)
                    ^

In file included from /Library/Developer/CommandLinetools/usr/include/c++/v1/math.h(311),from main_intel.cpp(7):
/Library/Developer/CommandLinetools/usr/include/c++/v1/type_traits(903): error: identifier "__is_function" is undefined
      __is_function(_Tp)
      ^

In file included from XSAF_C_intel.h(3),from main_intel.cpp(7):
/Library/Developer/CommandLinetools/usr/include/c++/v1/type_traits(903): error: type name is not allowed
      __is_function(_Tp)
                    ^
          detected during:
            instantiation of class "std::__1::is_function<_Tp> [with _Tp=long long ****************************************************************************************************]" at line 1360
            instantiation of class "std::__1::__decay<_Up,true> [with _Up=long long ****************************************************************************************************]" at line 1373
            instantiation of class "std::__1::decay<_Tp> [with _Tp=long long ****************************************************************************************************]" at line 2119
            instantiation of class "std::__1::common_type<_Tp,_Up> [with _Tp=long long ****************************************************************************************************,_Up=long long ****************************************************************************************************]" at line 2118
            instantiation of class "std::__1::common_type<_Tp,_Up> [with _Tp=long long ***************************************************************************************************,_Up=long long ***************************************************************************************************]" at line 2118
            [ 97 instantiation contexts not shown ]
            instantiation of class "std::__1::common_type<_Tp,_Up> [with _Tp=long long *,_Up=long long *]" at line 2118
            instantiation of class "std::__1::common_type<_Tp,_Up> [with _Tp=long long,_Up=long long]" at line 874 of "/Library/Developer/CommandLinetools/usr/include/c++/v1/chrono"
            instantiation of class "std::__1::common_type<std::__1::chrono::duration<_Rep1,_Period1>,std::__1::chrono::duration<_Rep2,_Period2>> [with _Rep1=long long,_Period1=std::__1::micro,_Rep2=long long,_Period2=std::__1::micro]" at line 2112
            instantiation of class "std::__1::common_type<_Tp> [with _Tp=std::__1::chrono::duration<long long,std::__1::micro>]" at line 1101 of "/Library/Developer/CommandLinetools/usr/include/c++/v1/chrono"
            instantiation of class "std::__1::chrono::duration<_Rep,_Period> [with _Rep=long long,_Period=std::__1::micro]" at line 1575 of "/Library/Developer/CommandLinetools/usr/include/c++/v1/chrono"

In file included from XSAF_C_intel.h(3),from main_intel.cpp(7):
/Library/Developer/CommandLinetools/usr/include/c++/v1/type_traits(903): error: type name is not allowed
      __is_function(_Tp)
                    ^
          detected during:
            instantiation of class "std::__1::is_function<_Tp> [with _Tp=long long *****************************************************************************************************]" at line 1360
            instantiation of class "std::__1::__decay<_Up,true> [with _Up=long long *****************************************************************************************************]" at line 1373
            instantiation of class "std::__1::decay<_Tp> [with _Tp=long long *****************************************************************************************************]" at line 2119
            instantiation of class "std::__1::common_type<_Tp,_Up> [with _Tp=long long *****************************************************************************************************,_Up=long long *****************************************************************************************************]" at line 2118
            instantiation of class "std::__1::common_type<_Tp,_Up=long long ****************************************************************************************************]" at line 2118
            [ 98 instantiation contexts not shown ]
            instantiation of class "std::__1::common_type<_Tp,from main_intel.cpp(7):
/Library/Developer/CommandLinetools/usr/include/c++/v1/type_traits(903): error: type name is not allowed
      __is_function(_Tp)
                    ^
          detected during:
            instantiation of class "std::__1::is_function<_Tp> [with _Tp=long long ******************************************************************************************************]" at line 1360
            instantiation of class "std::__1::__decay<_Up,true> [with _Up=long long ******************************************************************************************************]" at line 1373
            instantiation of class "std::__1::decay<_Tp> [with _Tp=long long ******************************************************************************************************]" at line 2119
            instantiation of class "std::__1::common_type<_Tp,_Up> [with _Tp=long long ******************************************************************************************************,_Up=long long ******************************************************************************************************]" at line 2118
            instantiation of class "std::__1::common_type<_Tp,_Up=long long *****************************************************************************************************]" at line 2118
            [ 99 instantiation contexts not shown ]
            instantiation of class "std::__1::common_type<_Tp,from main_intel.cpp(7):
/Library/Developer/CommandLinetools/usr/include/c++/v1/type_traits(903): error: type name is not allowed
      __is_function(_Tp)
                    ^
          detected during:
            instantiation of class "std::__1::is_function<_Tp> [with _Tp=long long *******************************************************************************************************]" at line 1360
            instantiation of class "std::__1::__decay<_Up,true> [with _Up=long long *******************************************************************************************************]" at line 1373
            instantiation of class "std::__1::decay<_Tp> [with _Tp=long long *******************************************************************************************************]" at line 2119
            instantiation of class "std::__1::common_type<_Tp,_Up> [with _Tp=long long *******************************************************************************************************,_Up=long long *******************************************************************************************************]" at line 2118
            instantiation of class "std::__1::common_type<_Tp,_Up=long long ******************************************************************************************************]" at line 2118
            [ 100 instantiation contexts not shown ]
            instantiation of class "std::__1::common_type<_Tp,from main_intel.cpp(7):
/Library/Developer/CommandLinetools/usr/include/c++/v1/type_traits(903): error: type name is not allowed
      __is_function(_Tp)
                    ^
          detected during:
            instantiation of class "std::__1::is_function<_Tp> [with _Tp=long long ********************************************************************************************************]" at line 1360
            instantiation of class "std::__1::__decay<_Up,true> [with _Up=long long ********************************************************************************************************]" at line 1373
            instantiation of class "std::__1::decay<_Tp> [with _Tp=long long ********************************************************************************************************]" at line 2119
            instantiation of class "std::__1::common_type<_Tp,_Up> [with _Tp=long long ********************************************************************************************************,_Up=long long ********************************************************************************************************]" at line 2118
            instantiation of class "std::__1::common_type<_Tp,_Up=long long *******************************************************************************************************]" at line 2118
            [ 101 instantiation contexts not shown ]
            instantiation of class "std::__1::common_type<_Tp,from main_intel.cpp(7):
/Library/Developer/CommandLinetools/usr/include/c++/v1/type_traits(903): error: type name is not allowed
      __is_function(_Tp)
                    ^
          detected during:
            instantiation of class "std::__1::is_function<_Tp> [with _Tp=long long *********************************************************************************************************]" at line 1360
            instantiation of class "std::__1::__decay<_Up,true> [with _Up=long long *********************************************************************************************************]" at line 1373
            instantiation of class "std::__1::decay<_Tp> [with _Tp=long long *********************************************************************************************************]" at line 2119
            instantiation of class "std::__1::common_type<_Tp,_Up> [with _Tp=long long *********************************************************************************************************,_Up=long long *********************************************************************************************************]" at line 2118
            instantiation of class "std::__1::common_type<_Tp,_Up=long long ********************************************************************************************************]" at line 2118
            [ 102 instantiation contexts not shown ]
            instantiation of class "std::__1::common_type<_Tp,from main_intel.cpp(7):
/Library/Developer/CommandLinetools/usr/include/c++/v1/type_traits(903): error: type name is not allowed
      __is_function(_Tp)
                    ^
          detected during:
            instantiation of class "std::__1::is_function<_Tp> [with _Tp=long long **********************************************************************************************************]" at line 1360
            instantiation of class "std::__1::__decay<_Up,true> [with _Up=long long **********************************************************************************************************]" at line 1373
            instantiation of class "std::__1::decay<_Tp> [with _Tp=long long **********************************************************************************************************]" at line 2119
            instantiation of class "std::__1::common_type<_Tp,_Up> [with _Tp=long long **********************************************************************************************************,_Up=long long **********************************************************************************************************]" at line 2118
            instantiation of class "std::__1::common_type<_Tp,_Up=long long *********************************************************************************************************]" at line 2118
            [ 103 instantiation contexts not shown ]
            instantiation of class "std::__1::common_type<_Tp,from main_intel.cpp(7):
/Library/Developer/CommandLinetools/usr/include/c++/v1/type_traits(903): error: type name is not allowed
      __is_function(_Tp)
                    ^
          detected during:
            instantiation of class "std::__1::is_function<_Tp> [with _Tp=long long ***********************************************************************************************************]" at line 1360
            instantiation of class "std::__1::__decay<_Up,true> [with _Up=long long ***********************************************************************************************************]" at line 1373
            instantiation of class "std::__1::decay<_Tp> [with _Tp=long long ***********************************************************************************************************]" at line 2119
            instantiation of class "std::__1::common_type<_Tp,_Up> [with _Tp=long long ***********************************************************************************************************,_Up=long long ***********************************************************************************************************]" at line 2118
            instantiation of class "std::__1::common_type<_Tp,_Up=long long **********************************************************************************************************]" at line 2118
            [ 104 instantiation contexts not shown ]
            instantiation of class "std::__1::common_type<_Tp,from main_intel.cpp(7):
/Library/Developer/CommandLinetools/usr/include/c++/v1/type_traits(903): error: type name is not allowed
      __is_function(_Tp)
                    ^
          detected during:
            instantiation of class "std::__1::is_function<_Tp> [with _Tp=long long ************************************************************************************************************]" at line 1360
            instantiation of class "std::__1::__decay<_Up,true> [with _Up=long long ************************************************************************************************************]" at line 1373
            instantiation of class "std::__1::decay<_Tp> [with _Tp=long long ************************************************************************************************************]" at line 2119
            instantiation of class "std::__1::common_type<_Tp,_Up> [with _Tp=long long ************************************************************************************************************,_Up=long long ************************************************************************************************************]" at line 2118
            instantiation of class "std::__1::common_type<_Tp,_Up=long long ***********************************************************************************************************]" at line 2118
            [ 105 instantiation contexts not shown ]
            instantiation of class "std::__1::common_type<_Tp,from main_intel.cpp(7):
/Library/Developer/CommandLinetools/usr/include/c++/v1/type_traits(903): error: type name is not allowed
      __is_function(_Tp)
                    ^
          detected during:
            instantiation of class "std::__1::is_function<_Tp> [with _Tp=long long *************************************************************************************************************]" at line 1360
            instantiation of class "std::__1::__decay<_Up,true> [with _Up=long long *************************************************************************************************************]" at line 1373
            instantiation of class "std::__1::decay<_Tp> [with _Tp=long long *************************************************************************************************************]" at line 2119
            instantiation of class "std::__1::common_type<_Tp,_Up> [with _Tp=long long *************************************************************************************************************,_Up=long long *************************************************************************************************************]" at line 2118
            instantiation of class "std::__1::common_type<_Tp,_Up=long long ************************************************************************************************************]" at line 2118
            [ 106 instantiation contexts not shown ]
            instantiation of class "std::__1::common_type<_Tp,_Period=std::__1::micro]" at line 1575 of "/Library/Developer/CommandLinetools/usr/include/c++/v1/chrono"

我对这里使用的 icc/icpc 和命令行工具的版本特别感兴趣。

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。