我正在尝试使用nvcc编译C ++文件。该命令如下所示:
nvcc -std=c++11 file.cu -o file
编译器版本如下:
$ nvcc --version
Cuda compilation tools, release 7.0, V7.0.27
$ gcc --version
gcc (GCC) 5.2.0
错误看起来像是nvcc与最新的gcc版本不兼容。
/usr/include/c++/5.2.0/bits/stl_iterator_base_types.h(154): error: class "std::vector<Pixel, std::allocator<Pixel>>" has no member "iterator_category"
detected during:
instantiation of class "std::__iterator_traits<_Iterator, void> [with _Iterator=std::vector<Pixel, std::allocator<Pixel>>]"
/usr/include/c++/5.2.0/type_traits(1492): error: class "std::__is_convertible_helper<<error-type>, std::input_iterator_tag, false>" has no member class "type"
detected during instantiation of class "std::is_convertible<_From, _To> [with _From=<error-type>, _To=std::input_iterator_tag]"
/usr/include/c++/5.2.0/type_traits(1492): error: not a class or struct name
detected during instantiation of class "std::is_convertible<_From, _To> [with _From=<error-type>, _To=std::input_iterator_tag]"
[...]
有没有人遇到过类似的问题?谷歌搜索并没有帮助我。也许我在这里错过了一些东西,因为CUDA对我来说仍然是新手。
提前致谢!
因为CUDA工具链允许在同一源文件中混合设备代码和主机代码,所以它需要与主机工具链紧密集成。因此,CUDA工具链通常无法与比NVIDIA测试和支持的版本新的主机工具链使用。
每个CUDA版本都附带一个“入门”文档,其中说明了支持哪个版本的主机工具链。本文档有三个特定于操作系统的版本;问题中的信息表明您使用的是Linux平台,因此您希望参考Linux版本的“入门”。
由于CUDA 7.0是此时的CUDA的最新发行版本,因此也可以在此处在线找到Linux版本的“ Getting Started”文档。它显示了支持的gcc 4.8和gcc 4.9的各种版本,具体取决于您使用的Linux的特定版本。
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句