I’m trying to build pytorch from source, having just installed MAGMA due to the error
No CUDA implementation of 'potrf'. Install MAGMA and rebuild cutorch
I’m doing this on a 2013 macbook, so I’m aware support is limited, however I did it before so I have faith it will work again!
The problem I’m having is when I try and call setup.py, it keeps referencing a different version of gcc. I have both 8.1.0 and 5.3.0 – 5 is the one I want. I’ve set up environment variables corresponding to this version in ~/.bash_profile
I’ve also set up symbolic links to /usr/bin/gcc and /usr/bin/g++ in case it was calling them.
However, when I run the command CC=gcc-5 CXX=g++-5 DCUDA_HOST_COMPILER=/usr/local/bin/gcc-5 python setup.py install
I get the error:
-- Caffe2: CUDA detected: 8.0
-- Caffe2: CUDA nvcc is: /usr/local/cuda/bin/nvcc
-- Caffe2: CUDA toolkit directory: /usr/local/cuda
-- Caffe2: Header version is: 8.0
-- Found cuDNN: v6.0.21 (include: /usr/local/cuda/include, library: /usr/local/cuda/lib/libcudnn.6.dylib)
CMake Error at cmake/public/cuda.cmake:321 (message):
CUDA 8.0 is not compatible with GCC version >= 6. Use the following option
to use another version (for example):
-DCUDA_HOST_COMPILER=/usr/bin/gcc-5
Call Stack (most recent call first):
cmake/Dependencies.cmake:401 (include)
CMakeLists.txt:204 (include)
-- Configuring incomplete, errors occurred!
See also "/Users/askates/Documents/GitRepos/pytorch/build/CMakeFiles/CMakeOutput.log".
See also "/Users/askates/Documents/GitRepos/pytorch/build/CMakeFiles/CMakeError.log".
and when I look at CMakeOutput.log I see it’s referencing /usr/local/bin/gcc-8
How can I make it reference gcc-5 instead of gcc-8? What am I missing?
I seem to have gotten it to work with cmake CMakeLists.txt, however I now get the error:
CMake Error at third_party/sleef/CMakeLists.txt:27 (message):
SLEEF does not allow in-source builds.
You can refer to doc/build-with-cmake.md for instructions on how provide a
separate build directory. Note: Please remove autogenerated file
`CMakeCache.txt` and directory `CMakeFiles` in the current directory.
-- Configuring incomplete, errors occurred!
I’ve tried building sleef separately and if I run
$ mkdir third_party/sleef/build_dir
$ cd third_party/sleef/build_dir
$ cmake ..
It builds successfully, but when I try and run setup.py I get this:
-- The CXX compiler identification is unknown
-- The C compiler identification is unknown
CMake Error at CMakeLists.txt:6 (project):
The CMAKE_CXX_COMPILER:
/usr/local/bin/g++-8
is not a full path to an existing compiler tool.
Tell CMake where to find the compiler by setting either the environment
variable "CXX" or the CMake cache entry CMAKE_CXX_COMPILER to the full path
to the compiler, or to the compiler name if it is in the PATH.
CMake Error at CMakeLists.txt:6 (project):
The CMAKE_C_COMPILER:
/usr/local/bin/gcc-8
is not a full path to an existing compiler tool.
Tell CMake where to find the compiler by setting either the environment
variable "CC" or the CMake cache entry CMAKE_C_COMPILER to the full path to
the compiler, or to the compiler name if it is in the PATH.
-- Configuring incomplete, errors occurred!
-- The CXX compiler identification is unknown
CMake Error at CMakeLists.txt:6 (project):
The CMAKE_CXX_COMPILER:
/usr/local/bin/g++-8
is not a full path to an existing compiler tool.
Tell CMake where to find the compiler by setting either the environment
variable "CXX" or the CMake cache entry CMAKE_CXX_COMPILER to the full path
to the compiler, or to the compiler name if it is in the PATH.
-- Configuring incomplete, errors occurred!
I don’t know why it’s defaulting to g++-8 still…
$ compilers/gcc --version
gcc (GCC) 5.3.0
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.
So I know nothing at all about this (I missed that you are on OS X , but googling this error message, people apparently do funny manual symlinking with some success.