After git clone the latest source code, then run “python setup.py install”, it says:
In file included from /home/liangstein/anaconda3/include/python3.6m/pyport.h:194:0,
from /home/liangstein/anaconda3/include/python3.6m/Python.h:53,
from /home/liangstein/src/pytorch/torch/csrc/python_headers.h:10,
from /home/liangstein/src/pytorch/torch/csrc/DataLoader.h:3,
from /home/liangstein/src/pytorch/torch/csrc/DataLoader.cpp:1:
/home/liangstein/src/pytorch/aten/src/ATen/core/aten_interned_strings.h:614:9: error: expected unqualified-id before ‘sizeof’
_(aten, signbit) \
blablabla
[ 98%] Building CXX object test_api/CMakeFiles/test_api.dir/parallel.cpp.o
In file included from /home/liangstein/src/pytorch/third_party/googletest/googletest/include/gtest/gtest.h:59:0,
from /home/liangstein/src/pytorch/test/cpp/api/tensor.cpp:1:
/home/liangstein/src/pytorch/test/cpp/api/tensor.cpp: In function ‘void test_TorchTensorCtorSingleDimFloatingType_expected_dtype(c10::ScalarType)’:
/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]
ASSERT_TRUE(tensor.is_variable())
blablabla
gmake: *** [all] Error 2
Building wheel torch-1.8.0a0
– Building version 1.8.0a0
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
cmake --build . --target install --config Release – -j 8
Traceback (most recent call last):
File “setup.py”, line 724, in 
build_deps()
File “setup.py”, line 317, in build_deps
cmake=cmake)
File “/home/liangstein/src/pytorch/tools/build_pytorch_libs.py”, line 62, in build_caffe2
cmake.build(my_env)
File “/home/liangstein/src/pytorch/tools/setup_helpers/cmake.py”, line 346, in build
self.run(build_args, my_env)
File “/home/liangstein/src/pytorch/tools/setup_helpers/cmake.py”, line 141, in run
check_call(command, cwd=self.build_dir, env=env)
File “/home/liangstein/anaconda3/lib/python3.6/subprocess.py”, line 291, in check_call
raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command ‘[‘cmake’, ‘–build’, ‘.’, ‘–target’, ‘install’, ‘–config’, ‘Release’, ‘–’, ‘-j’, ‘8’]’ returned non-zero exit status 2.
Environment is:
Centos7 gcc5.5 cmake3.15 python3.6.5(Anaconda5.5) MKL2019 cuda10.2 cudnn8 openmpi1.10.7