CUDA使用的GCC版本和现有版本不兼容

字体大小: 中小 标准 ->行高大小: 标准

安装了最新的gcc 4.7,和 CUDA toolkit4.2,尝试编译后发现错误:

error -- unsupported GNU version! gcc 4.5 and up are not supported!

解决方法使用openSUSE 12.1 自带的gcc4.6版本进行编译通过。具体过程如下:

sudo ln -s /usr/bin/gcc-4.6 /usr/local/cuda/bin/gcc

sudo ln -s /usr/bin/g++-4.6 /usr/local/cuda/bin/g++

此文章由 http://www.ositren.com 收集整理 ,地址为: http://www.ositren.com/htmls/66115.html