Pytorch: Error installing from source on Mac(10.12),CUDA=8.0, CUDNN=5.1.5

Created on 21 Jan 2017  ·  3Comments  ·  Source: pytorch/pytorch

It seems cuda can't get clang as CC and gives error as it gets gcc from conda installed version
Updating install_name for libTH.1.dylib
Updating install_name for libTHNN.1.dylib
Updating install_name for libTHS.1.dylib
-- TH_LIBRARIES: /Volumes/Data/Libraries/pytorch/torch/lib/tmp_install/lib/libTH.1.dylib
-- MAGMA not found. Compiling without MAGMA support
-- Autodetected CUDA architecture(s): 3.0
-- got cuda version 8.0
-- Found CUDA with FP16 support, compiling with torch.CudaHalfTensor
-- CUDA_NVCC_FLAGS: -DTH_INDEX_BASE=0 -I/Volumes/Data/Libraries/pytorch/torch/lib/tmp_install/include -I/Volumes/Data/Libraries/pytorch/torch/lib/tmp_install/include/TH -I/Volumes/Data/Libraries/pytorch/torch/lib/tmp_install/include/THC;-gencode;arch=compute_30,code=sm_30;-DCUDA_HAS_FP16=1
-- THC_SO_VERSION: 1
-- Configuring done
CMake Warning (dev):
Policy CMP0042 is not set: MACOSX_RPATH is enabled by default. Run "cmake
--help-policy CMP0042" for policy details. Use the cmake_policy command to
set the policy and suppress this warning.

MACOSX_RPATH is not specified for the following targets:

THC

This warning is for project developers. Use -Wno-dev to suppress it.

-- Generating done
-- Build files have been written to: /Volumes/Data/Libraries/pytorch/torch/lib/build/THC
[ 3%] Building NVCC (Device) object CMakeFiles/THC.dir/THC_generated_THCHalf.cu.o
[ 3%] Building NVCC (Device) object CMakeFiles/THC.dir/THC_generated_THCReduceApplyUtils.cu.o
[ 3%] Building NVCC (Device) object CMakeFiles/THC.dir/THC_generated_THCSleep.cu.o
[ 5%] Building NVCC (Device) object CMakeFiles/THC.dir/THC_generated_THCStorage.cu.o
[ 6%] Building NVCC (Device) object CMakeFiles/THC.dir/THC_generated_THCStorageCopy.cu.o
[ 7%] Building NVCC (Device) object CMakeFiles/THC.dir/THC_generated_THCBlas.cu.o
[ 8%] Building NVCC (Device) object CMakeFiles/THC.dir/THC_generated_THCTensor.cu.o
[ 10%] Building NVCC (Device) object CMakeFiles/THC.dir/THC_generated_THCTensorCopy.cu.o
nvcc fatal : GNU C/C++ compiler is no longer supported as a host compiler on Mac OS X.
CMake Error at THC_generated_THCReduceApplyUtils.cu.o.cmake:207 (message):
Error generating
/Volumes/Data/Libraries/pytorch/torch/lib/build/THC/CMakeFiles/THC.dir//./THC_generated_THCReduceApplyUtils.cu.o

nvcc fatal : GNU C/C++ compiler is no longer supported as a host compiler on Mac OS X.
nvcc fatal : GNU C/C++ compiler is no longer supported as a host compiler on Mac OS X.
nvcc fatal : GNU C/C++ compiler is no longer supported as a host compiler on Mac OS X.
nvcc fatal : GNU C/C++ compiler is no longer supported as a host compiler on Mac OS X.
nvcc fatal : GNU C/C++ compiler is no longer supported as a host compiler on Mac OS X.
make[2]: * [CMakeFiles/THC.dir/THC_generated_THCReduceApplyUtils.cu.o] Error 1
make[2]: *
Waiting for unfinished jobs....
CMake Error at THC_generated_THCBlas.cu.o.cmake:207 (message):
Error generating
/Volumes/Data/Libraries/pytorch/torch/lib/build/THC/CMakeFiles/THC.dir//./THC_generated_THCBlas.cu.o

nvcc fatal : GNU C/C++ compiler is no longer supported as a host compiler on Mac OS X.
nvcc fatal : GNU C/C++ compiler is no longer supported as a host compiler on Mac OS X.
CMake Error at THC_generated_THCSleep.cu.o.cmake:207 (message):
Error generating
/Volumes/Data/Libraries/pytorch/torch/lib/build/THC/CMakeFiles/THC.dir//./THC_generated_THCSleep.cu.o

CMake Error at THC_generated_THCStorage.cu.o.cmake:207 (message):
Error generating
/Volumes/Data/Libraries/pytorch/torch/lib/build/THC/CMakeFiles/THC.dir//./THC_generated_THCStorage.cu.o

CMake Error at THC_generated_THCTensor.cu.o.cmake:207 (message):
Error generating
/Volumes/Data/Libraries/pytorch/torch/lib/build/THC/CMakeFiles/THC.dir//./THC_generated_THCTensor.cu.o

CMake Error at THC_generated_THCHalf.cu.o.cmake:207 (message):
Error generating
/Volumes/Data/Libraries/pytorch/torch/lib/build/THC/CMakeFiles/THC.dir//./THC_generated_THCHalf.cu.o

CMake Error at THC_generated_THCTensorCopy.cu.o.cmake:207 (message):
Error generating
/Volumes/Data/Libraries/pytorch/torch/lib/build/THC/CMakeFiles/THC.dir//./THC_generated_THCTensorCopy.cu.o

CMake Error at THC_generated_THCStorageCopy.cu.o.cmake:207 (message):
Error generating
/Volumes/Data/Libraries/pytorch/torch/lib/build/THC/CMakeFiles/THC.dir//./THC_generated_THCStorageCopy.cu.o

make[2]: * [CMakeFiles/THC.dir/THC_generated_THCBlas.cu.o] Error 1
make[2]:
[CMakeFiles/THC.dir/THC_generated_THCSleep.cu.o] Error 1
make[2]:
[CMakeFiles/THC.dir/THC_generated_THCStorage.cu.o] Error 1
make[2]:
[CMakeFiles/THC.dir/THC_generated_THCHalf.cu.o] Error 1
make[2]:
[CMakeFiles/THC.dir/THC_generated_THCTensor.cu.o] Error 1
make[2]:
[CMakeFiles/THC.dir/THC_generated_THCTensorCopy.cu.o] Error 1
make[2]:
[CMakeFiles/THC.dir/THC_generated_THCStorageCopy.cu.o] Error 1
make[1]:
[CMakeFiles/THC.dir/all] Error 2
make: *
* [all] Error 2

Most helpful comment

Try this if you have added the Anaconda directory to your bash shell PATH environment variable:

CC=clang CXX=clang++ python setup.py install

All 3 comments

Do you have CC or CXX set by any chance? nvcc finds gcc or g++ as your default compiler and fails because of this. To build it you have to use a fairly od version of Apple Clang (7.3.1 - you can get it from the Apple Developer portal).

Try this if you have added the Anaconda directory to your bash shell PATH environment variable:

CC=clang CXX=clang++ python setup.py install

It should build fine if only you use clang. I'm closing the issue.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

keskarnitish picture keskarnitish  ·  3Comments

soumith picture soumith  ·  3Comments

szagoruyko picture szagoruyko  ·  3Comments

cdluminate picture cdluminate  ·  3Comments

a1363901216 picture a1363901216  ·  3Comments