4

I am learning caffe. When I compile openCV framework, I meet this problem:

"/usr/local/cuda/include/host_config.h:115:2: error: #error -- unsupported GNU version! gcc versions later than 4.9 are not supported!"

However, I have installed the gcc-4.7 g++-4.7 and created a symlink for them. But it didn't work.The problem is still there.

Vini
  • 1,978
  • 8
  • 40
  • 82
ycszen
  • 41
  • 2
  • take a look at this article https://groups.google.com/forum/#!topic/torch7/WaNmWZqMnzw this seems to be a known issue with CUDA – wizurd Nov 24 '15 at 06:38
  • 1
    Just installing a supported GCC version won't make things magically work. You also have to ensure that nvcc can find that compiler version and its support libraries before the system GCC version. Then it might work ( it sounds like your are using an unsupported Linux version ) – talonmies Nov 24 '15 at 07:33
  • I have created a symbolic link:sudo ln -s gcc-4.7 /usr/local/cuda/bin/gcc.But it didnot work. – ycszen Nov 24 '15 at 08:10
  • I hacked the host_config.h but there are many warnings when I complie openCV. Maybe there will be more problems. So I decide to reinstall my system to Ubuntu 15.04.Hope it can be useful. – ycszen Nov 24 '15 at 08:29
  • @ycszen: Adding a symbolic link will only work if the path where you added it will be found *before* a path containing the system gcc. Getting it to work probably requires careful setting of `PATH` and `LD_LIBRARY_PATH` – talonmies Nov 24 '15 at 09:47
  • 1
    Have you tried to explicitly force compiler with `-ccbin` option? Something like `nvcc -ccbin g++-4.7 src.cu`. – SteelRaven Nov 24 '15 at 10:35
  • 1
    I've posted very similar problem [here](http://stackoverflow.com/questions/34403447/caffe-compilation-fails-due-to-unsupported-gcc-compiler-version). – patryk.beza Dec 21 '15 at 21:58

0 Answers0