torch / torch7

http://torch.ch
Other
8.97k stars 2.38k forks source link

install failed #1111

Open suice07 opened 6 years ago

suice07 commented 6 years ago

hi everyone,i am kind of new in torch.i am using Manjaro(arch),when i follow the instruction to install torch,it fails.what can i do

In file included from /opt/cuda/include/host_config.h:50:0, from /opt/cuda/include/cuda_runtime.h:78, from :0: /opt/cuda/include/crt/host_config.h:119:2: error: #error -- unsupported GNU version! gcc versions later than 6 are not supported!

error -- unsupported GNU version! gcc versions later than 6 are not supported!

^~~~~ In file included from /opt/cuda/include/host_config.h:50:0, from /opt/cuda/include/cuda_runtime.h:78, from :0: /opt/cuda/include/crt/host_config.h:119:2: error: #error -- unsupported GNU version! gcc versions later than 6 are not supported!

error -- unsupported GNU version! gcc versions later than 6 are not supported!

^~~~~ In file included from /opt/cuda/include/host_config.h:50:0, from /opt/cuda/include/cuda_runtime.h:78, from :0: /opt/cuda/include/crt/host_config.h:119:2: error: #error -- unsupported GNU version! gcc versions later than 6 are not supported!

error -- unsupported GNU version! gcc versions later than 6 are not supported!

^~~~~ In file included from /opt/cuda/include/host_config.h:50:0, from /opt/cuda/include/cuda_runtime.h:78, from :0: /opt/cuda/include/crt/host_config.h:119:2: error: #error -- unsupported GNU version! gcc versions later than 6 are not supported!

error -- unsupported GNU version! gcc versions later than 6 are not supported!

^~~~~ In file included from /opt/cuda/include/host_config.h:50:0, from /opt/cuda/include/cuda_runtime.h:78, from :0: /opt/cuda/include/crt/host_config.h:119:2: error: #error -- unsupported GNU version! gcc versions later than 6 are not supported!

error -- unsupported GNU version! gcc versions later than 6 are not supported!

^~~~~ In file included from /opt/cuda/include/host_config.h:50:0, from /opt/cuda/include/cuda_runtime.h:78, from :0: /opt/cuda/include/crt/host_config.h:119:2: error: #error -- unsupported GNU version! gcc versions later than 6 are not supported!

error -- unsupported GNU version! gcc versions later than 6 are not supported!

^~~~~ In file included from /opt/cuda/include/host_config.h:50:0, from /opt/cuda/include/cuda_runtime.h:78, from :0: /opt/cuda/include/crt/host_config.h:119:2: error: #error -- unsupported GNU version! gcc versions later than 6 are not supported!

error -- unsupported GNU version! gcc versions later than 6 are not supported!

^~~~~ In file included from /opt/cuda/include/host_config.h:50:0, from /opt/cuda/include/cuda_runtime.h:78, from :0: /opt/cuda/include/crt/host_config.h:119:2: error: #error -- unsupported GNU version! gcc versions later than 6 are not supported!

error -- unsupported GNU version! gcc versions later than 6 are not supported!

^~~~~ CMake Error at THC_generated_THCBlas.cu.o.cmake:207 (message): Error generating /home/suice07/torch/extra/cutorch/build/lib/THC/CMakeFiles/THC.dir//./THC_generated_THCBlas.cu.o

CMake Error at THC_generated_THCSleep.cu.o.cmake:207 (message): Error generating /home/suice07/torch/extra/cutorch/build/lib/THC/CMakeFiles/THC.dir//./THC_generated_THCSleep.cu.o

make[2]: [lib/THC/CMakeFiles/THC.dir/build.make:72: lib/THC/CMakeFiles/THC.dir/THC_generated_THCBlas.cu.o] Error 1 make[2]: Waiting for unfinished jobs....

make[2]: *** [lib/THC/CMakeFiles/THC.dir/build.make:79: lib/THC/CMakeFiles/THC.dir/THC_generated_THCSleep.cu.o] Error 1 CMake Error at THC_generated_THCStorageCopy.cu.o.cmake:207 (message): Error generating /home/suice07/torch/extra/cutorch/build/lib/THC/CMakeFiles/THC.dir//./THC_generated_THCStorageCopy.cu.o

make[2]: *** [lib/THC/CMakeFiles/THC.dir/build.make:93: lib/THC/CMakeFiles/THC.dir/THC_generated_THCStorageCopy.cu.o] Error 1 CMake Error at THC_generated_THCReduceApplyUtils.cu.o.cmake:207 (message): Error generating /home/suice07/torch/extra/cutorch/build/lib/THC/CMakeFiles/THC.dir//./THC_generated_THCReduceApplyUtils.cu.o

make[2]: *** [lib/THC/CMakeFiles/THC.dir/build.make:65: lib/THC/CMakeFiles/THC.dir/THC_generated_THCReduceApplyUtils.cu.o] Error 1 CMake Error at THC_generated_THCTensor.cu.o.cmake:207 (message): Error generating /home/suice07/torch/extra/cutorch/build/lib/THC/CMakeFiles/THC.dir//./THC_generated_THCTensor.cu.o

make[2]: *** [lib/THC/CMakeFiles/THC.dir/build.make:100: lib/THC/CMakeFiles/THC.dir/THC_generated_THCTensor.cu.o] Error 1 CMake Error at THC_generated_THCTensorCopy.cu.o.cmake:207 (message): Error generating /home/suice07/torch/extra/cutorch/build/lib/THC/CMakeFiles/THC.dir//./THC_generated_THCTensorCopy.cu.o

make[2]: *** [lib/THC/CMakeFiles/THC.dir/build.make:107: lib/THC/CMakeFiles/THC.dir/THC_generated_THCTensorCopy.cu.o] Error 1 CMake Error at THC_generated_THCHalf.cu.o.cmake:207 (message): Error generating /home/suice07/torch/extra/cutorch/build/lib/THC/CMakeFiles/THC.dir//./THC_generated_THCHalf.cu.o

make[2]: *** [lib/THC/CMakeFiles/THC.dir/build.make:562: lib/THC/CMakeFiles/THC.dir/THC_generated_THCHalf.cu.o] Error 1 CMake Error at THC_generated_THCStorage.cu.o.cmake:207 (message): Error generating /home/suice07/torch/extra/cutorch/build/lib/THC/CMakeFiles/THC.dir//./THC_generated_THCStorage.cu.o

make[2]: [lib/THC/CMakeFiles/THC.dir/build.make:86: lib/THC/CMakeFiles/THC.dir/THC_generated_THCStorage.cu.o] Error 1 make[1]: [CMakeFiles/Makefile2:172: lib/THC/CMakeFiles/THC.dir/all] Error 2 make: *** [Makefile:130: all] Error 2

Error: Build error: Failed building.

albanD commented 6 years ago

The error message above is "#error -- unsupported GNU version! gcc versions later than 6 are not supported!" so I guess installing an older version of gcc should help.

With Arch this would probably be resolved by building/installing a version from the AUR (using yaourt should make this quite easy).

tastyminerals commented 6 years ago

This has already been answered and you can find the answer via github issues. Manjaro uses gcc-7.2 while Torch can be compiled with gcc-4.9 for example.

sudo pacman -S gcc49
sudo mv /usr/bin/gcc /usr/bin/gcc_bkp
sudo ln -s /usr/bin/gcc-4.9 /usr/bin/gcc
suice07 commented 6 years ago

thx for the help.but there is something other wrong .. screenshot_20171211_145143

tastyminerals commented 6 years ago

export TORCH_NVCC_FLAGS="-D__CUDA_NO_HALF_OPERATORS__", issue https://github.com/torch/cutorch/issues/797

And don't forget to sudo mv /usr/bin/gcc_bkp /usr/bin/gcc back otherwise you might have problems with building other applications which require newer gcc.

nk0307 commented 6 years ago

so torch is really old fashioned staff