Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

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

Comments

Projects
None yet
8 participants
@hughperkins
Copy link

commented May 22, 2016

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

This comment has been minimized.

Copy link
Author

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

This comment has been minimized.

Copy link

commented May 23, 2016

Slightly nicer and more Ubuntuish would be to use:

$ sudo update-alternatives --config gcc
@buriy

This comment has been minimized.

Copy link

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

This comment has been minimized.

Copy link
Author

commented May 23, 2016

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

This comment has been minimized.

Copy link

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

This comment has been minimized.

Copy link

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

This comment has been minimized.

Copy link

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

This comment has been minimized.

Copy link

commented Sep 26, 2018

Error: No results matching query were found.

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

@freedom9393

This comment has been minimized.

Copy link

commented Feb 14, 2019

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++
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.