Current way to compile from source


(Mittagessen) #1

Greetings,

I have to compile pytorch from source (with cuda 8.0 and cuDnn 7) because our cluster ships with an ancient ScientificLinux (glibc 2.12) and I was wondering what the most up to date way to compile from source is? Is running setup.py still appropriate or is build_anaconda.sh recommended?

In addition, there are hard-coded paths for gcc/g++ in nccl and possibly other third party dependencies that interfere with the location of the compilers on the system (/usr/bin/cc is too old for nvcc and the actual default cc returned by which is at some other location). Is there a nice way to fix this? Unfortunately, it isn’t easily possible to create a clean build environment just for building pytorch.


#2

python setup.py install is still recommended. I’m not sure what build_anaconda.sh is.

You can specify cc and gcc paths like the following:
CC=clang CXX=clang++ python setup.py install (replace clang and clang++ with paths to your compilers)


(Mittagessen) #3

build_anaconda.sh seems to be the original build script of caffe2 but supposedly builds a combined caffe2+pytorch wheel with the -integrated flag.

I thought setting CC/CXX on the top level did nothing but apparently that was just caused by some non-purged previous Makefiles.