0

It seems that there're some conflicts on CUDA 9.0 and GCC 6.x, (discussed here). So I decide to use gcc 5.5 to setup python package.

According to the answer https://stackoverflow.com/a/25595274/5634636, and https://stackoverflow.com/a/16737696/5634636, I tried to run setup.py as follow:

CC=gcc-5 CXX=g++-5 python setup.py install --user

which raise the error (I only paste part of it because it's too long):

/usr/include/c++/6/tuple: In instantiation of ‘static constexpr bool std::_TC<, _Elements>::_MoveConstructibleTuple() [with _UElements = {std::tuple};

It seems that python is still using g++ 6 (/usr/include/c++/6/tuple) library on compiling. How to avoid using g++ 6?

talonmies
  • 70,661
  • 34
  • 192
  • 269
huangbiubiu
  • 1,252
  • 20
  • 37

1 Answers1

0

It seems that there are two places where gcc is used. One is python setup itself, the other is nvcc. The environment variable CC and CXX only specific the gcc version for python, but it didn't change the gcc version for nvcc.

To change the gcc version cuda used by default, do as follows:

sudo unlink /usr/local/cuda/bin/gcc
sudo ln -s /usr/bin/gcc-5 /usr/local/cuda/bin/gcc

There /usr/bin/gcc-5 can be any path to the gcc you want to use.

huangbiubiu
  • 1,252
  • 20
  • 37