我安装了oneAPI工具,并试图编译示例项目vector-add。
make all
dpcpp -O2 -g -std=c++17 -o vector-add-buffers src/vector-add-buffers.cpp
In file included from src/vector-add-buffers.cpp:22:
In file included from /home/xxx/opt/intel/oneapi/compiler/2022.0.2/linux/bin-llvm/../include/sycl/CL/sycl.hpp:11:
In file included from /home/xxx/opt/intel/oneapi/compiler/2022.0.2/linux/bin-llvm/../include/sycl/CL/sycl/accessor.hpp:12:
In file included from /home/xxx/opt/intel/oneapi/compiler/2022.0.2/linux/bin-llvm/../include/sycl/CL/sycl/atomic.hpp:12:
In file included from /home/xxx/opt/intel/oneapi/compiler/2022.0.2/linux/bin-llvm/../include/sycl/CL/sycl/access/access.hpp:10:
In file included from /home/xxx/opt/intel/oneapi/compiler/2022.0.2/linux/bin-llvm/../include/sycl/CL/sycl/detail/common.hpp:116:
In file included from /home/xxx/opt/intel/oneapi/compiler/2022.0.2/linux/bin-llvm/../include/sycl/CL/sycl/exception.hpp:17:
In file included from /home/xxx/opt/intel/oneapi/compiler/2022.0.2/linux/bin-llvm/../include/sycl/CL/sycl/stl.hpp:13:
/home/xxx/opt/intel/oneapi/compiler/2022.0.2/linux/bin-llvm/../include/sycl/CL/sycl/bit_cast.hpp:33:22: error: no member named 'is_trivially_copyable' in namespace 'std'
static_assert(std::is_trivially_copyable<From>::value,
~~~~~^
/home/xxx/opt/intel/oneapi/compiler/2022.0.2/linux/bin-llvm/../include/sycl/CL/sycl/bit_cast.hpp:33:44: error: 'From' does not refer to a value
static_assert(std::is_trivially_copyable<From>::value,
^我怀疑这是由旧的cmake、pkg-config、make、gcc和g++造成的,但我没有对集群的根访问权限。我试着用conda重新安装它。反正也无济于事。
发布于 2022-02-28 11:16:08
为了用dpcpp编译器编译向量添加示例代码,gcc版本至少应该是7.3.0或更高版本。
有关更多信息,请参阅下面的链接。
发布于 2022-03-04 07:46:07
您可以自己编译gcc (这很容易),并使用export CXX=/path/gcc-9.2.0/bin/g++和export CC=/path/gcc-9.2.0/bin/gcc为cmake设置编译器env。
https://stackoverflow.com/questions/71133221
复制相似问题