CUDA SDK与gcc / g ++有关:gcc的旧版本找不到旧版本的g ++?

时间:2012-01-24 23:03:52

标签: gcc cuda g++ fedora

我正在F15上安装CUDA。我很清楚CUDA需要旧版本的gcc / g ++,我已经安装了gcc / g ++ 4.5.1,并按照文档here软链接它们。我不再收到该帖子中提到的错误...但是,当我尝试编译SDK时,我收到以下错误:

make[1]: Entering directory `/home/whao/NVIDIA_GPU_Computing_SDK/C/src/bilateralFilter'
gcc: error trying to exec 'cc1plus': execvp: No such file or directory
make[1]: *** [obj/x86_64/release/filter_kernel.cu.o] Error 1

我怀疑不知何故,有问题的旧版g ++没有被识别出来?为了它的价值,请考虑以下两个输出:

[whao@gen-whao-cuda C]$ /usr/local/cuda/bin/gcc --version
gcc (GCC) 4.5.1 20101130 (Red Hat 4.5.1-6)
Copyright (C) 2010 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

[whao@gen-whao-cuda C]$ /usr/local/cuda/bin/g++ --version
g++ (GCC) 4.5.1 20101130 (Red Hat 4.5.1-6)
Copyright (C) 2010 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

1 个答案:

答案 0 :(得分:1)

有一个名为host_config.h的文件,其中选中了gcc版本(路径为/ usr / local / cuda / include)。您可以注释掉相应的if部分(如果gcc_version> 4.5。* ....)。工具包4.1中可能支持gcc 4.5,但如果保留此行,则在开始编译之前总会出现错误。