Repository: pytorch
Issue: Problem when installing Pytorch from source on CentOS 7.4
Labels: module: build,triaged

## 🐛 Bug
[3171/3442] Building CXX object caffe2/torch/CMakeFiles/torch_python.dir/csrc/jit/init.cpp.o
In file included from ../c10/core/Device.h:5:0,
                 from ../c10/core/Allocator.h:6,
                 from ../aten/src/ATen/ATen.h:3,
                 from ../torch/csrc/utils/pybind.h:5,
                 from ../torch/csrc/jit/init.cpp:2:
../torch/csrc/jit/pybind_utils.h: In function ‘torch::jit::Stack torch::jit::toTraceableStack(const pybind11::tuple&)’:
../c10/util/Exception.h:350:20: warning: ‘void c10::detail::deprecated_AT_CHECK()’ is deprecated [-Wdeprecated-declarations]
     ::c10::detail::deprecated_AT_CHECK();                 \
                    ^
../torch/csrc/jit/pybind_utils.h:299:3: note: in expansion of macro ‘AT_CHECK’
   AT_CHECK(
   ^
In file included from ../c10/core/Device.h:5:0,
                 from ../c10/core/Allocator.h:6,
                 from ../aten/src/ATen/ATen.h:3,
                 from ../torch/csrc/utils/pybind.h:5,
                 from ../torch/csrc/jit/init.cpp:2:
../c10/util/Exception.h:325:13: note: declared here
 inline void deprecated_AT_CHECK() {}
             ^~~~~~~~~~~~~~~~~~~
In file included from ../c10/core/Device.h:5:0,
                 from ../c10/core/Allocator.h:6,
                 from ../aten/src/ATen/ATen.h:3,
                 from ../torch/csrc/utils/pybind.h:5,
                 from ../torch/csrc/jit/init.cpp:2:
../c10/util/Exception.h:350:40: warning: ‘void c10::detail::deprecated_AT_CHECK()’ is deprecated [-Wdeprecated-declarations]
     ::c10::detail::deprecated_AT_CHECK();                 \
                                        ^
../torch/csrc/jit/pybind_utils.h:299:3: note: in expansion of macro ‘AT_CHECK’
   AT_CHECK(
   ^
In file included from ../c10/core/Device.h:5:0,
                 from ../c10/core/Allocator.h:6,
                 from ../aten/src/ATen/ATen.h:3,
                 from ../torch/csrc/utils/pybind.h:5,
                 from ../torch/csrc/jit/init.cpp:2:
../c10/util/Exception.h:325:13: note: declared here
 inline void deprecated_AT_CHECK() {}
             ^~~~~~~~~~~~~~~~~~~
ninja: build stopped: subcommand failed.
Building wheel torch-1.4.0a0+e96ea28
-- Building version 1.4.0a0+e96ea28
cmake -GNinja -DBUILD_PYTHON=True -DBUILD_TEST=True -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/data/stars/user/jhou/collection-stars/pytorch/torch -DCMAKE_PREFIX_PATH=/data/stars/user/jhou/collection-stars/anaconda3/condabin/../ -DCUDNN_INCLUDE_DIR=/misc/opt/cudnn/7.4-cuda-10.0/include -DCUDNN_LIBRARY=/misc/opt/cudnn/7.4-cuda-10.0/lib64/libcudnn.so -DNUMPY_INCLUDE_DIR=/data/stars/user/jhou/collection-stars/anaconda3/envs/pytorch_source/lib/python3.6/site-packages/numpy/core/include -DPYTHON_EXECUTABLE=/data/stars/user/jhou/collection-stars/anaconda3/envs/pytorch_source/bin/python -DPYTHON_INCLUDE_DIR=/data/stars/user/jhou/collection-stars/anaconda3/envs/pytorch_source/include/python3.6m -DPYTHON_LIBRARY=/data/stars/user/jhou/collection-stars/anaconda3/envs/pytorch_source/lib/libpython3.6m.so.1.0 -DTORCH_BUILD_VERSION=1.4.0a0+e96ea28 -DUSE_CUDA=True -DUSE_NUMPY=True /data/stars/user/jhou/collection-stars/pytorch
cmake --build . --target install --config Release -- -j 32
Traceback (most recent call last):
  File "setup.py", line 751, in <module>
    build_deps()
  File "setup.py", line 310, in build_deps
    cmake=cmake)
  File "/data/stars/user/jhou/collection-stars/pytorch/tools/build_pytorch_libs.py", line 59, in build_caffe2
    cmake.build(my_env)
  File "/data/stars/user/jhou/collection-stars/pytorch/tools/setup_helpers/cmake.py", line 334, in build
    self.run(build_args, my_env)
  File "/data/stars/user/jhou/collection-stars/pytorch/tools/setup_helpers/cmake.py", line 142, in run
    check_call(command, cwd=self.build_dir, env=env)
  File "/data/stars/user/jhou/collection-stars/anaconda3/envs/pytorch_source/lib/python3.6/subprocess.py", line 311, in check_call
    raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['cmake', '--build', '.', '--target', 'install', '--config', 'Release', '--', '-j', '32']' returned non-zero exit status 1.

Full output log is here:
https://drive.google.com/open?id=1oTNShMAE3QathF1B4seuBKIeFTDzx-d3

Thanks!

## To Reproduce

Steps to reproduce the behavior:

1. conda create -n pytorch_source python=3.6
2. conda activate pytorch_source
3. conda install numpy ninja pyyaml mkl mkl-include setuptools cmake cffi typing
4. conda install -c pytorch magma-cuda100 
5. git clone --recursive https://github.com/pytorch/pytorch
6. cd pytorch
7. export CMAKE_PREFIX_PATH="$(dirname $(which conda))/../"
8. python setup.py install


<!-- If you have a code sample, error messages, stack traces, please provide it here as well -->

## Expected behavior

## Environment
Collecting environment information...
PyTorch version: N/A
Is debug build: N/A
CUDA used to build PyTorch: N/A

OS: CentOS Linux release 7.4.1708 (Core) 
GCC version: (GCC) 7.3.0
CMake version: version 3.14.0

Python version: 3.6
Is CUDA available: N/A
CUDA runtime version: 10.0.130
GPU models and configuration: GPU 0: GeForce GTX 1080 Ti
Nvidia driver version: 410.79
cuDNN version: /misc/opt-7.4/cudnn/7.4-cuda-10.0/lib64/libcudnn.so.7.4.2

Versions of relevant libraries:
[pip] numpy==1.17.2
[conda] blas                      1.0                         mkl  
[conda] magma-cuda100             2.5.1                         1    pytorch
[conda] mkl                       2019.4                      243  
[conda] mkl-include               2019.4                      243  
[conda] mkl-service               2.3.0            py36he904b0f_0  
[conda] mkl_fft                   1.0.14           py36ha843d7b_0  
[conda] mkl_random                1.1.0            py36hd6b4f25_0