Como alterar a versão do pacote no candidato?

1

A saída do comando apt-cache policy como mostrado:

mobeen@VIP-Ubuntu:~$ apt-cache policy gcc
gcc:
  Installed: (none)
  Candidate: 4:7.2.0-1ubuntu1
  Version table:
     4:7.2.0-1ubuntu1 500
        500 http://kr.archive.ubuntu.com/ubuntu artful/main amd64 Packages


mobeen@VIP-Ubuntu:~$ apt-cache policy g++
    g++:
      Installed: (none)
      Candidate: 4:7.2.0-1ubuntu1
      Version table:
         4:7.2.0-1ubuntu1 500
            500 http://kr.archive.ubuntu.com/ubuntu artful/main amd64 Packages

No meu entender, isso fornece informações sobre algum pacote, qual versão está instalada e no candidato, significa qual versão será instalada.

O que eu quero fazer é basicamente instalar o CUDA 8.0, que instala automaticamente o gcc, mas por causa da versão candidata do gcc ser a 7.2.0, ele instala esta versão. No entanto, isso depois gera erros de compatibilidade.

Em resumo: eu preciso instalar uma versão do gcc menor que 5.

Estou tentando instalar o torch usando o método descrito aqui: link .

O erro que recebo é:

In file included from /usr/local/cuda/include/cuda_runtime.h:78:0,
                 from <command-line>:0:
/usr/local/cuda/include/host_config.h:119:2: error: #error -- unsupported GNU version! gcc versions later than 5 are not supported!
 #error -- unsupported GNU version! gcc versions later than 5 are not supported!
  ^~~~~
In file included from /usr/local/cuda/include/cuda_runtime.h:78:0,
                 from <command-line>:0:
/usr/local/cuda/include/host_config.h:119:2: error: #error -- unsupported GNU version! gcc versions later than 5 are not supported!
 #error -- unsupported GNU version! gcc versions later than 5 are not supported!
  ^~~~~
In file included from /usr/local/cuda/include/cuda_runtime.h:78:0,
                 from <command-line>:0:
/usr/local/cuda/include/host_config.h:119:2: error: #error -- unsupported GNU version! gcc versions later than 5 are not supported!
 #error -- unsupported GNU version! gcc versions later than 5 are not supported!
  ^~~~~
In file included from /usr/local/cuda/include/cuda_runtime.h:78:0,
                 from <command-line>:0:
/usr/local/cuda/include/host_config.h:119:2: error: #error -- unsupported GNU version! gcc versions later than 5 are not supported!
 #error -- unsupported GNU version! gcc versions later than 5 are not supported!
  ^~~~~
CMake Error at THC_generated_THCSleep.cu.o.cmake:207 (message):
  Error generating
  /home/mobeen/torch/extra/cutorch/build/lib/THC/CMakeFiles/THC.dir//./THC_generated_THCSleep.cu.o


lib/THC/CMakeFiles/THC.dir/build.make:665: recipe for target 'lib/THC/CMakeFiles/THC.dir/THC_generated_THCSleep.cu.o' failed
make[2]: *** [lib/THC/CMakeFiles/THC.dir/THC_generated_THCSleep.cu.o] Error 1
make[2]: *** Waiting for unfinished jobs....
CMake Error at THC_generated_THCBlas.cu.o.cmake:207 (message):
  Error generating
  /home/mobeen/torch/extra/cutorch/build/lib/THC/CMakeFiles/THC.dir//./THC_generated_THCBlas.cu.o


lib/THC/CMakeFiles/THC.dir/build.make:476: recipe for target 'lib/THC/CMakeFiles/THC.dir/THC_generated_THCBlas.cu.o' failed
make[2]: *** [lib/THC/CMakeFiles/THC.dir/THC_generated_THCBlas.cu.o] Error 1
CMake Error at THC_generated_THCReduceApplyUtils.cu.o.cmake:207 (message):
  Error generating
  /home/mobeen/torch/extra/cutorch/build/lib/THC/CMakeFiles/THC.dir//./THC_generated_THCReduceApplyUtils.cu.o


lib/THC/CMakeFiles/THC.dir/build.make:286: recipe for target 'lib/THC/CMakeFiles/THC.dir/THC_generated_THCReduceApplyUtils.cu.o' failed
make[2]: *** [lib/THC/CMakeFiles/THC.dir/THC_generated_THCReduceApplyUtils.cu.o] Error 1
CMake Error at THC_generated_THCHalf.cu.o.cmake:207 (message):
  Error generating
  /home/mobeen/torch/extra/cutorch/build/lib/THC/CMakeFiles/THC.dir//./THC_generated_THCHalf.cu.o


lib/THC/CMakeFiles/THC.dir/build.make:2027: recipe for target 'lib/THC/CMakeFiles/THC.dir/THC_generated_THCHalf.cu.o' failed
make[2]: *** [lib/THC/CMakeFiles/THC.dir/THC_generated_THCHalf.cu.o] Error 1
CMakeFiles/Makefile2:172: recipe for target 'lib/THC/CMakeFiles/THC.dir/all' failed
make[1]: *** [lib/THC/CMakeFiles/THC.dir/all] Error 2
Makefile:129: recipe for target 'all' failed
make: *** [all] Error 2

Error: Build error: Failed building.

Eu instalei gcc-4.8 usando o comando:

sudo apt install gcc-4.8

e depois symlinked usando o comando:

sudo ln -s /usr/bin/gcc-4.8 /usr/local/cuda/bin/gcc
sudo ln -s /usr/bin/g++-4.8 /usr/local/cuda/bin/g++
sudo ldconfig

Mas ainda recebe o mesmo erro.

    
por Mobeen 31.10.2017 / 11:57

2 respostas

1

No sistema de pacotes Ubuntu, gcc é um pacote de dependência que fornece o compilador GNU C padrão .

Se você quer uma versão de compilador não-padrão, você pode instalá-la explicitamente - por exemplo, o gcc-4.8 é disponível no astuto . Você precisará ativar o repositório universe em suas fontes de pacotes.

Você provavelmente precisará executar outras etapas para que o CUDA encontre as versões corretas, por exemplo, criando um diretório /usr/local/cuda/bin e vinculando simbolicamente /usr/bin/gcc-4.8 a /usr/local/cuda/bin/gcc

    
por steeldriver 31.10.2017 / 12:48
0
  

Em resumo: eu preciso instalar uma versão do gcc menor que 5.

O GCC 4.8.5 está disponível em 17.10 do pacote gcc-4 .

    
por fkraiem 31.10.2017 / 12:49