我想用nvcc編譯C++文件。命令如下:使用CUDA 7.0與GCC 5.2.0和C++ 11
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版本支持的主機編譯器版本。你會想要查閱該文檔的Linux版本。 – njuffa