Compilation error on centos7

username: liangstein
cooked: <p>After git clone the latest source code, then run “python setup.py install”, it says:</p>
<p>In file included from /home/liangstein/anaconda3/include/python3.6m/pyport.h:194:0,<br>
from /home/liangstein/anaconda3/include/python3.6m/Python.h:53,<br>
from /home/liangstein/src/pytorch/torch/csrc/python_headers.h:10,<br>
from /home/liangstein/src/pytorch/torch/csrc/DataLoader.h:3,<br>
from /home/liangstein/src/pytorch/torch/csrc/DataLoader.cpp:1:<br>
/home/liangstein/src/pytorch/aten/src/ATen/core/aten_interned_strings.h:614:9: error: expected unqualified-id before ‘sizeof’<br>
_(aten, signbit) \</p>
<p>blablabla</p>
<p>[ 98%] Building CXX object test_api/CMakeFiles/test_api.dir/parallel.cpp.o<br>
In file included from /home/liangstein/src/pytorch/third_party/googletest/googletest/include/gtest/gtest.h:59:0,<br>
from /home/liangstein/src/pytorch/test/cpp/api/tensor.cpp:1:<br>
/home/liangstein/src/pytorch/test/cpp/api/tensor.cpp: In function ‘void test_TorchTensorCtorSingleDimFloatingType_expected_dtype(c10::ScalarType)’:<br>
/home/liangstein/src/pytorch/test/cpp/api/tensor.cpp:427:34: warning: ‘bool at::Tensor::is_variable() const’ is deprecated: Tensor.is_variable() is deprecated; everything is a variable now. (If you want to assert that variable has been appropriately handled already, use at::impl::variable_excluded_from_dispatch()) [-Wdeprecated-declarations]<br>
ASSERT_TRUE(tensor.is_variable())</p>
<p>blablabla</p>
<p>gmake: *** [all] Error 2<br>
Building wheel torch-1.8.0a0<br>
– Building version 1.8.0a0<br>
cmake -DBUILD_PYTHON=True -DBUILD_TEST=True -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/home/liangstein/src/pytorch/torch -DCMAKE_PREFIX_PATH=/home/liangstein/SOTAML/lib/python3.6/site-packages -DCUDNN_INCLUDE_DIR=/home/liangstein/cudnn8_cuda10.2/include -DCUDNN_LIBRARY=/home/liangstein/cudnn8_cuda10.2/lib64 -DNUMPY_INCLUDE_DIR=/home/liangstein/SOTAML/lib/python3.6/site-packages/numpy-1.19.2-py3.6-linux-x86_64.egg/numpy/core/include -DPYTHON_EXECUTABLE=/home/liangstein/SOTAML/bin/python -DPYTHON_INCLUDE_DIR=/home/liangstein/anaconda3/include/python3.6m -DPYTHON_LIBRARY=/home/liangstein/anaconda3/lib/libpython3.6m.so.1.0 -DTORCH_BUILD_VERSION=1.8.0a0 -DUSE_NUMPY=True /home/liangstein/src/pytorch<br>
cmake --build . --target install --config Release – -j 8<br>
Traceback (most recent call last):<br>
File “setup.py”, line 724, in <br>
build_deps()<br>
File “setup.py”, line 317, in build_deps<br>
cmake=cmake)<br>
File “/home/liangstein/src/pytorch/tools/build_pytorch_libs.py”, line 62, in build_caffe2<br>
cmake.build(my_env)<br>
File “/home/liangstein/src/pytorch/tools/setup_helpers/cmake.py”, line 346, in build<br>
self.run(build_args, my_env)<br>
File “/home/liangstein/src/pytorch/tools/setup_helpers/cmake.py”, line 141, in run<br>
check_call(command, cwd=self.build_dir, env=env)<br>
File “/home/liangstein/anaconda3/lib/python3.6/subprocess.py”, line 291, in check_call<br>
raise CalledProcessError(retcode, cmd)<br>
subprocess.CalledProcessError: Command ‘[‘cmake’, ‘–build’, ‘.’, ‘–target’, ‘install’, ‘–config’, ‘Release’, ‘–’, ‘-j’, ‘8’]’ returned non-zero exit status 2.</p>
<p>Environment is:<br>
Centos7 gcc5.5 cmake3.15 python3.6.5(Anaconda5.5) MKL2019 cuda10.2 cudnn8 openmpi1.10.7</p>