【问题标题】:Intel compiler 17.0 with gcc 7.1/8.1带有 gcc 7.1/8.1 的英特尔编译器 17.0
【发布时间】:2018-06-22 09:09:11
【问题描述】:
 /opt/intel/compilers_and_libraries_2017.2.174/linux/bin/intel64/icpc    -I/home/usermy/.conan/data/toolchain/1.0.5-g0a9b008/demo/test/package/c62a7e8ca4353a55148d1aa65d313056ef6659b2/include -I/home/usermy/.conan/data/PracticalSocket/1.3.9-g2de8945.M/demo/test/build/bf3ccdb63142bb66a24f13901c58796a91e7542e/include  -fvar-tracking -g -static-intel -ftz -fma -use-intel-optimized-headers -axAVX,AVX2,SSE4.2,CORE-AVX512 -xSSE4.2  -std=c++17 -O3 -gcc-name=/usr/gcc-8.1/bin/gcc -gxx-name=/usr/gcc-8.1/bin/g++ -O3 -DNDEBUG   -o CMakeFiles/practical_socket.dir/src/PracticalSocket.cpp.o -c /home/usermy/.conan/data/PracticalSocket/1.3.9-g2de8945.M/demo/test/build/bf3ccdb63142bb66a24f13901c58796a91e7542e/src/PracticalSocket.cpp
In file included from /usr/gcc-8.1/include/c++/8.1.0/bits/move.h(55),
                 from /usr/gcc-8.1/include/c++/8.1.0/bits/stl_pair.h(59),
                 from /usr/gcc-8.1/include/c++/8.1.0/bits/stl_algobase.h(64),
                 from /usr/gcc-8.1/include/c++/8.1.0/bits/char_traits.h(39),
                 from /usr/gcc-8.1/include/c++/8.1.0/string(40),
                 from /home/usermy/.conan/data/PracticalSocket/1.3.9-g2de8945.M/demo/test/build/bf3ccdb63142bb66a24f13901c58796a91e7542e/include/PracticalSocket.h(4),
                 from /home/usermy/.conan/data/PracticalSocket/1.3.9-g2de8945.M/demo/test/build/bf3ccdb63142bb66a24f13901c58796a91e7542e/src/PracticalSocket.cpp(1):
/usr/gcc-8.1/include/c++/8.1.0/type_traits(1061): error: identifier "__is_assignable" is undefined
        : public __bool_constant<__is_assignable(_Tp, _Up)>
                                 ^

In file included from /usr/gcc-8.1/include/c++/8.1.0/bits/move.h(55),
                 from /usr/gcc-8.1/include/c++/8.1.0/bits/stl_pair.h(59),
                 from /usr/gcc-8.1/include/c++/8.1.0/bits/stl_algobase.h(64),
                 from /usr/gcc-8.1/include/c++/8.1.0/bits/char_traits.h(39),
                 from /usr/gcc-8.1/include/c++/8.1.0/string(40),
                 from /home/usermy/.conan/data/PracticalSocket/1.3.9-g2de8945.M/demo/test/build/bf3ccdb63142bb66a24f13901c58796a91e7542e/include/PracticalSocket.h(4),
                 from /home/usermy/.conan/data/PracticalSocket/1.3.9-g2de8945.M/demo/test/build/bf3ccdb63142bb66a24f13901c58796a91e7542e/src/PracticalSocket.cpp(1):
/usr/gcc-8.1/include/c++/8.1.0/type_traits(1061): error: type name is not allowed
        : public __bool_constant<__is_assignable(_Tp, _Up)>

这是在cmake中添加以下内容后的内容:

  set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++17 -O3 -gcc-name=/usr/gcc-8.1/bin/gcc -gxx-name=/usr/gcc-8.1/bin/g++")

【问题讨论】:

  • 那么,你得到了什么错误?
  • @BaummitAugen 更新了它。

标签: c++ compilation icc


【解决方案1】:

如果您阅读发行说明,您会注意到 Intel C++ 17 不支持 gcc 7/8(我不认为您没有查看该版本):

https://software.intel.com/en-us/articles/intel-c-compiler-170-for-linux-release-notes-for-intel-parallel-studio-xe-2017

注意,Intel 只提供编译器而不提供标准库,它从 gcc 获取,因此存在兼容性限制。

注意,版本 18 也不支持它,希望 19 会提供。

【讨论】:

  • 17.0 不支持整体,它支持一些功能,18.0 支持更多功能。我没有使用任何不受支持的功能,实际上我只使用 make_unique 并由auto 返回。
  • @themagicalyang 问题在于 GCC 8.1 的 libstdc++ 标头使用的功能不受英特尔编译器支持,而不是您在自己的代码中使用的功能,特别是 __is_assignable 是GCC 内在函数,它不是 C++ 标准的一部分,但由 GCC 内部使用并在 GCC 的 libstdc++ 中使用。
  • 没错,编译器不理解标准库,你是否使用任何特殊的东西都没有关系。如果你想使用 Intel C++ 17/18,你需要给它来自 gcc6 的库。
猜你喜欢
  • 1970-01-01
  • 2013-11-11
  • 2021-08-08
  • 1970-01-01
  • 2016-03-02
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2016-04-26
相关资源
最近更新 更多