Hi all, I build the PyTorch from master’s branch. And I got an error which I have never met before. Any ideas how to resolve it? Thanks!!!
-DTH_SO_VERSION=1 -DTHC_SO_VERSION=1 -DTHNN_SO_VERSION=1 -DTHCUNN_SO_VERSION=1 -DTHD_SO_VERSION=1 -DNO_CUDA=0 -DNO_NNPACK=0 -DNCCL_EXTERNAL=1 -Dnanopb_BUILD_GENERATOR=0 -DCMAKE_DEBUG_POSTFIX= -DCMAKE_BUILD_TYPE=Release -DUSE_CUDA=1 -DNCCL_ROOT_DIR=/home/yiruiw/Downloads/pytorch/torch/lib/tmp_install -DCMAKE_EXPORT_COMPILE_COMMANDS=1
-- CUDA detected: 8.0
-- Added CUDA NVCC flags for: sm_30 sm_35 sm_50 sm_52 sm_60 sm_61
-- Found libcuda: /usr/lib/x86_64-linux-gnu/libcuda.so
-- Found libnvrtc: /usr/local/cuda/lib64/libnvrtc.so
-- Configuring done
-- Generating done
-- Build files have been written to: /home/yiruiw/Downloads/pytorch/third_party/build/gloo
+ make install -j24
[ 63%] Built target gloo
[ 70%] Building NVCC (Device) object gloo/CMakeFiles/gloo_cuda.dir/gloo_cuda_generated_cuda.cu.o
[ 70%] Building NVCC (Device) object gloo/CMakeFiles/gloo_cuda.dir/gloo_cuda_generated_cuda_private.cu.o
In file included from /home/yiruiw/Downloads/pytorch/third_party/gloo/gloo/cuda.cu:10:0:
/home/yiruiw/Downloads/pytorch/third_party/gloo/gloo/cuda.h:25:2: error: #error "Expected GLOO_USE_CUDA to be defined"
 #error "Expected GLOO_USE_CUDA to be defined"
  ^
In file included from /home/yiruiw/Downloads/pytorch/third_party/gloo/gloo/cuda_private.h:19:0,
                 from /home/yiruiw/Downloads/pytorch/third_party/gloo/gloo/cuda_private.cu:10:
/home/yiruiw/Downloads/pytorch/third_party/gloo/gloo/cuda.h:25:2: error: #error "Expected GLOO_USE_CUDA to be defined"
 #error "Expected GLOO_USE_CUDA to be defined"
  ^
CMake Error at gloo_cuda_generated_cuda_private.cu.o.Release.cmake:218 (message):
  Error generating
  /home/yiruiw/Downloads/pytorch/third_party/build/gloo/gloo/CMakeFiles/gloo_cuda.dir//./gloo_cuda_generated_cuda_private.cu.o


CMake Error at gloo_cuda_generated_cuda.cu.o.Release.cmake:218 (message):
  Error generating
  /home/yiruiw/Downloads/pytorch/third_party/build/gloo/gloo/CMakeFiles/gloo_cuda.dir//./gloo_cuda_generated_cuda.cu.o


gloo/CMakeFiles/gloo_cuda.dir/build.make:70: recipe for target 'gloo/CMakeFiles/gloo_cuda.dir/gloo_cuda_generated_cuda_private.cu.o' failed
make[2]: *** [gloo/CMakeFiles/gloo_cuda.dir/gloo_cuda_generated_cuda_private.cu.o] Error 1
make[2]: *** Waiting for unfinished jobs....
gloo/CMakeFiles/gloo_cuda.dir/build.make:63: recipe for target 'gloo/CMakeFiles/gloo_cuda.dir/gloo_cuda_generated_cuda.cu.o' failed
make[2]: *** [gloo/CMakeFiles/gloo_cuda.dir/gloo_cuda_generated_cuda.cu.o] Error 1
CMakeFiles/Makefile2:137: recipe for target 'gloo/CMakeFiles/gloo_cuda.dir/all' failed
make[1]: *** [gloo/CMakeFiles/gloo_cuda.dir/all] Error 2
Makefile:129: recipe for target 'all' failed
make: *** [all] Error 2