Skip to content
This repository has been archived by the owner on Jan 3, 2023. It is now read-only.

Ubuntu 16.04: unsupported GNU version! gcc versions later than 4.9 are not supported! #246

Closed
hughperkins opened this issue May 22, 2016 · 10 comments

Comments

@hughperkins
Copy link

Ubuntu 16.04: unsupported GNU version! gcc versions later than 4.9 are not supported!

I have gcc4.9 installed. In Torch, I can select gcc4.9 by doing:

export CC=gcc-4.9
export CXX=g++-4.9

Unclear how to do this for Neon?

@hughperkins
Copy link
Author

hughperkins commented May 22, 2016

Following http://stackoverflow.com/questions/6622454/cuda-incompatible-with-my-gcc-version#comment56532695_8693381 I did

$ sudo ln -s /usr/bin/gcc-4.9 /usr/local/cuda/bin/gcc
$ sudo ln -s /usr/bin/g++-4.9 /usr/local/cuda/bin/g++

... to solve this.

@tambetm
Copy link

tambetm commented May 23, 2016

Slightly nicer and more Ubuntuish would be to use:

$ sudo update-alternatives --config gcc

@buriy
Copy link

buriy commented May 23, 2016

@tambetm You also need sudo update-alternatives --install then : http://askubuntu.com/a/26518/346907 , also having multiple versions of gcc with update-alternatives isn't considered a good option ( why: http://askubuntu.com/a/26500/346907 ).
Also, even after installing gcc-4.9, you will have 5.3 version of linux headers.
So anyway it's only a workaround for the scripts not aware of CC / CXX flags, and that's why manually linking is ok here.

@hughperkins
Copy link
Author

Slightly nicer and more Ubuntuish would be to use:

This is a system level modification, and may come back to bite you later. For example, what happens if you build a project that has c++ linkings to a system installed library?

My change:

  • is strictly limited to cuda-7.5 installation, which was broken anyway
  • will be purged automatically, as soon as I upgrade to cuda-8.0

@tastyminerals
Copy link

tastyminerals commented Oct 24, 2017

In case @hughperkins solution does not work for some of you sitting on Archlinux or Manjaro. You should create links to /usr/bin/gcc and /usr/bin/g++ instead of /usr/local/cuda/bin. Before doing that don't forget to rename the original binaries! That will be needed if you decide to run ~/torch/install/bin/luarocks separately or if you're a Manjaro user.

Manjaro users should also add the following condition to install.sh in order to install everything smoothly:

# If we're on Manjaro linux, use gcc v49
if [[ `uname -a` == *"MANJARO"* ]]; then
    path_to_gcc49=$(which gcc-4.9)
    if [ -x "$path_to_gcc49" ]; then
      export CC="$path_to_gcc49"
    else
      echo "Warning: GCC v4.9 not found. CUDA v8 is incompatible with GCC v6, if installation fails, consider running \$ pacman -S gcc49"
    fi
fi

@hookover
Copy link

hookover commented Nov 10, 2017

@hughperkins
event:
ubuntu 16.04 default gcc version 5.3
cuda7.5
tensorflow1.0.1

I do this:

$ sudo ln -s /usr/bin/gcc-4.9 /usr/local/cuda/bin/gcc
$ sudo ln -s /usr/bin/g++-4.9 /usr/local/cuda/bin/g++

☁ build [master] ⚡ gcc --version

gcc (Ubuntu 4.9.3-13ubuntu2) 4.9.3
Copyright (C) 2015 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.

☁ build [master] ⚡ g++ --version

g++ (Ubuntu 4.9.3-13ubuntu2) 4.9.3
Copyright (C) 2015 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.

☁ build [master] ⚡ make

[ 10%] Building NVCC (Device) object CMakeFiles/warpctc.dir/src/warpctc_generated_reduce.cu.o
In file included from /usr/local/cuda/include/cuda_runtime.h:76:0,
                 from <command-line>:0:
/usr/local/cuda/include/host_config.h:115:2: error: #error -- unsupported GNU version! 
gcc versions later than 4.9 are not supported!
 #error -- unsupported GNU version! gcc versions later than 4.9 are not supported!
  ^
CMake Error at warpctc_generated_reduce.cu.o.cmake:207 (message):
  Error generating
  /srv/python/lstm_ctc_ocr_with_tf_1.0.1/warp-ctc/build/CMakeFiles/warpctc.dir/src/./warpctc_generated_reduce.cu.o


CMakeFiles/warpctc.dir/build.make:336: recipe for target 'CMakeFiles/warpctc.dir/src/warpctc_generated_reduce.cu.o' failed
make[2]: *** [CMakeFiles/warpctc.dir/src/warpctc_generated_reduce.cu.o] Error 1
CMakeFiles/Makefile2:141: recipe for target 'CMakeFiles/warpctc.dir/all' failed
make[1]: *** [CMakeFiles/warpctc.dir/all] Error 2
Makefile:127: recipe for target 'all' failed
make: *** [all] Error 2

ooooh no...

@Aurora11111
Copy link

Aurora11111 commented Aug 8, 2018

I meet this problem ,and I sloved it just by uninstall old gcc,and reinstall a gcc with verison of 4.9:
1.uninstall gcc
sudo pacman -Rsc gcc
2.reinstall gcc
mkdir -p $HOME/build/
cd $HOME/build/
git clone https://aur.archlinux.org/gcc49.git
cd gcc49
makepkg --syncdeps
sudo pacman --upgrade gcc-4.9.3-1-x86_64.pkg.tar.xz

@abduallahnoorsayket
Copy link

Error: No results matching query were found.

how can i fix this issue ?? i am using ubantu 18+

@freedom9393
Copy link

This solved my problem:

sudo rm /usr/local/cuda/bin/gcc
sudo rm /usr/local/cuda/bin/g++
sudo apt install gcc-4.9 g++-4.9
sudo ln -s /usr/bin/gcc-4.9 /usr/local/cuda/bin/gcc
sudo ln -s /usr/bin/g++-4.9 /usr/local/cuda/bin/g++

@yousefis
Copy link

yousefis commented Feb 5, 2021

I do not have an admin permission, any solutions?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

9 participants