Some more ERRORs:

[ 42%] Building CXX object caffe2/CMakeFiles/caffe2.dir//aten/src/TH/THStorageFunctions.cpp.o
cd …/pytorch/build/caffe2 && /usr/bin/c++  -DCPUINFO_SUPPORTED_PLATFORM=1 -DGFLAGS_IS_A_DLL=0 -DGOOGLE_GLOG_DLL_DECL="" -DGOOGLE_GLOG_DLL_DECL_FOR_UNITTESTS="" -DNNP_CONVOLUTION_ONLY=0 -DNNP_INFERENCE_ONLY=0 -DONNX_NAMESPACE=onnx_c2 -DOPENCV_TRAITS_ENABLE_DEPRECATED -DTH_BLAS_MKL -DUSE_C11_ATOMICS=1 -D_FILE_OFFSET_BITS=64 -Dcaffe2_EXPORTS -I…/pytorch/aten/src -I…/pytorch/build -I…/pytorch -isystem …/pytorch/build/third_party/gloo -isystem …/pytorch/cmake/…/third_party/gloo -I…/pytorch/third_party/protobuf/src -isystem /opt/intel/mkl/include -isystem /usr/local/include -isystem /usr/local/include/opencv4 -isystem /usr/include/eigen3 -isystem /usr/include/python3.6m -isystem /usr/lib/x86_64-linux-gnu/openmpi/include/openmpi -isystem /usr/lib/x86_64-linux-gnu/openmpi/include/openmpi/opal/mca/event/libevent2022/libevent -isystem /usr/lib/x86_64-linux-gnu/openmpi/include/openmpi/opal/mca/event/libevent2022/libevent/include -isystem /usr/lib/x86_64-linux-gnu/openmpi/include -isystem …/pytorch/cmake/…/third_party/cub -I…/pytorch/build/caffe2/contrib/aten -I…/pytorch/third_party/onnx -I…/pytorch/build/third_party/onnx -I…/pytorch/build/caffe2/aten/src/TH -I…/pytorch/aten/src/TH -I…/pytorch/build/caffe2/aten/src -I…/pytorch/build/aten/src -I…/pytorch/aten/src/THNN -I…/pytorch/aten/src/THCUNN -I…/pytorch/aten/…/third_party/catch/single_include -I…/pytorch/build/caffe2/aten/src/ATen -I…/pytorch/aten/src/ATen/… -I…/pytorch/caffe2/core/nomnigraph/include -isystem …/pytorch/build/include -I/usr/local/cuda/include -I…/pytorch/third_party/NNPACK/include -I…/pytorch/third_party/pthreadpool/include -I…/pytorch/third_party/cpuinfo/include  -msse3 -msse4.1 -msse4.2   --std=c++11 -I~/.local/lib/python3.6/site-packages/numpy/core/include -fvisibility-inlines-hidden -fopenmp -O2 -fPIC -Wno-narrowing -Wall -Wextra -Wno-missing-field-initializers -Wno-type-limits -Wno-array-bounds -Wno-unknown-pragmas -Wno-sign-compare -Wno-unused-parameter -Wno-unused-variable -Wno-unused-function -Wno-unused-result -Wno-strict-overflow -Wno-strict-aliasing -Wno-error=deprecated-declarations -Wno-stringop-overflow -Wno-error=pedantic -Wno-error=redundant-decls -Wno-error=old-style-cast -faligned-new -Wno-unused-but-set-variable -Wno-maybe-uninitialized -Wno-stringop-overflow -DHAVE_AVX_CPU_DEFINITION -DHAVE_AVX2_CPU_DEFINITION -O3  -fPIC   -DCUDA_HAS_FP16=1 -DHAVE_GCC_GET_CPUID -DUSE_SSE2 -DUSE_SSE4_1 -DUSE_SSE4_2 -DUSE_SSE3 -DUSE_AVX -DUSE_AVX2 -fvisibility=hidden -DCAFFE2_BUILD_MAIN_LIB -O2 -pthread -std=gnu++11 -o CMakeFiles/caffe2.dir//aten/src/TH/THStorageFunctions.cpp.o -c …/pytorch/aten/src/TH/THStorageFunctions.cpp
…/pytorch/aten/src/TH/THAllocator.cpp:397:1: error: prototype for ‘THMapAllocator::THMapAllocator(WithFd, const char*, int, int)’ does not match any in class ‘THMapAllocator’
THMapAllocator::THMapAllocator(WithFd, const char *filename, int fd, int flags) {
^~~~~~~~~~~~~~
In file included from …/pytorch/aten/src/TH/THAllocator.cpp:1:0:
…/pytorch/aten/src/TH/THAllocator.h:41:3: error: candidates are: THMapAllocator::THMapAllocator(THMapAllocator&&)
THMapAllocator(THMapAllocator&&) = delete;
^~~~~~~~~~~~~~
…/pytorch/aten/src/TH/THAllocator.h:39:3: error:                 THMapAllocator::THMapAllocator(const THMapAllocator&)
THMapAllocator(const THMapAllocator&) = delete;
^~~~~~~~~~~~~~
…/pytorch/aten/src/TH/THAllocator.h:38:3: error:                 THMapAllocator::THMapAllocator(WithFd, const char*, int, int, size_t)
THMapAllocator(WithFd, const char *filename, int fd, int flags, size_t size);
^~~~~~~~~~~~~~
…/pytorch/aten/src/TH/THAllocator.cpp:393:1: error:                 THMapAllocator::THMapAllocator(const char*, int, size_t)
THMapAllocator::THMapAllocator(const char *filename, int flags, size_t size) {
^~~~~~~~~~~~~~
…/pytorch/aten/src/TH/THAllocator.cpp:401:52: error: destructors may not have parameters
THMapAllocator::~THMapAllocator(THMapAllocator* ctx) {}
^
…/pytorch/aten/src/TH/THAllocator.cpp:401:1: error: redefinition of ‘THMapAllocator::~THMapAllocator()’
THMapAllocator::~THMapAllocator(THMapAllocator* ctx) {}
^~~~~~~~~~~~~~
In file included from …/pytorch/aten/src/TH/THAllocator.cpp:1:0:
…/pytorch/aten/src/TH/THAllocator.h:67:11: note: ‘virtual THMapAllocator::~THMapAllocator()’ previously defined here
virtual ~THMapAllocator() { close(); }
^
…/pytorch/aten/src/TH/THAllocator.cpp: In constructor ‘THRefcountedMapAllocator::THRefcountedMapAllocator(const char*, int, size_t)’:
…/pytorch/aten/src/TH/THAllocator.cpp:508:96: error: no matching function for call to ‘THRefcountedMapAllocatorArgCheck::THRefcountedMapAllocatorArgCheck()’
THRefcountedMapAllocator::THRefcountedMapAllocator(const char filename, int flags, size_t size) {
^
…/pytorch/aten/src/TH/THAllocator.cpp:506:1: note: candidate: THRefcountedMapAllocatorArgCheck::THRefcountedMapAllocatorArgCheck(int)
THRefcountedMapAllocatorArgCheck::THRefcountedMapAllocatorArgCheck(int flags) {}
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
…/pytorch/aten/src/TH/THAllocator.cpp:506:1: note:   candidate expects 1 argument, 0 provided
In file included from …/pytorch/aten/src/TH/THAllocator.cpp:1:0:
…/pytorch/aten/src/TH/THAllocator.h:85:15: note: candidate: constexpr THRefcountedMapAllocatorArgCheck::THRefcountedMapAllocatorArgCheck(const THRefcountedMapAllocatorArgCheck&)
struct AT_API THRefcountedMapAllocatorArgCheck {
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
…/pytorch/aten/src/TH/THAllocator.h:85:15: note:   candidate expects 1 argument, 0 provided
…/pytorch/aten/src/TH/THAllocator.h:85:15: note: candidate: constexpr THRefcountedMapAllocatorArgCheck::THRefcountedMapAllocatorArgCheck(THRefcountedMapAllocatorArgCheck&&)
…/pytorch/aten/src/TH/THAllocator.h:85:15: note:   candidate expects 1 argument, 0 provided
…/pytorch/aten/src/TH/THAllocator.cpp:508:96: error: no matching function for call to ‘THMapAllocator::THMapAllocator()’
THRefcountedMapAllocator::THRefcountedMapAllocator(const char filename, int flags, size_t size) {
^
In file included from …/pytorch/aten/src/TH/THAllocator.cpp:1:0:
…/pytorch/aten/src/TH/THAllocator.h:38:3: note: candidate: THMapAllocator::THMapAllocator(WithFd, const char, int, int, size_t)
THMapAllocator(WithFd, const char *filename, int fd, int flags, size_t size);
^~~~~~~~~~~~~~
…/pytorch/aten/src/TH/THAllocator.h:38:3: note:   candidate expects 5 arguments, 0 provided
…/pytorch/aten/src/TH/THAllocator.cpp:393:1: note: candidate: THMapAllocator::THMapAllocator(const char, int, size_t)
THMapAllocator::THMapAllocator(const char *filename, int flags, size_t size) {
^~~~~~~~~~~~~~
…/pytorch/aten/src/TH/THAllocator.cpp:393:1: note:   candidate expects 3 arguments, 0 provided
…/pytorch/aten/src/TH/THAllocator.cpp: In constructor ‘THRefcountedMapAllocator::THRefcountedMapAllocator(WithFd, const char*, int, int, size_t)’:
…/pytorch/aten/src/TH/THAllocator.cpp:512:112: error: no matching function for call to ‘THRefcountedMapAllocatorArgCheck::THRefcountedMapAllocatorArgCheck()’
THRefcountedMapAllocator::THRefcountedMapAllocator(WithFd, const char filename, int fd, int flags, size_t size) {
^
…/pytorch/aten/src/TH/THAllocator.cpp:506:1: note: candidate: THRefcountedMapAllocatorArgCheck::THRefcountedMapAllocatorArgCheck(int)
THRefcountedMapAllocatorArgCheck::THRefcountedMapAllocatorArgCheck(int flags) {}
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
…/pytorch/aten/src/TH/THAllocator.cpp:506:1: note:   candidate expects 1 argument, 0 provided
In file included from …/pytorch/aten/src/TH/THAllocator.cpp:1:0:
…/pytorch/aten/src/TH/THAllocator.h:85:15: note: candidate: constexpr THRefcountedMapAllocatorArgCheck::THRefcountedMapAllocatorArgCheck(const THRefcountedMapAllocatorArgCheck&)
struct AT_API THRefcountedMapAllocatorArgCheck {
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
…/pytorch/aten/src/TH/THAllocator.h:85:15: note:   candidate expects 1 argument, 0 provided
…/pytorch/aten/src/TH/THAllocator.h:85:15: note: candidate: constexpr THRefcountedMapAllocatorArgCheck::THRefcountedMapAllocatorArgCheck(THRefcountedMapAllocatorArgCheck&&)
…/pytorch/aten/src/TH/THAllocator.h:85:15: note:   candidate expects 1 argument, 0 provided
…/pytorch/aten/src/TH/THAllocator.cpp:512:112: error: no matching function for call to ‘THMapAllocator::THMapAllocator()’
THRefcountedMapAllocator::THRefcountedMapAllocator(WithFd, const char filename, int fd, int flags, size_t size) {
^
In file included from …/pytorch/aten/src/TH/THAllocator.cpp:1:0:
…/pytorch/aten/src/TH/THAllocator.h:38:3: note: candidate: THMapAllocator::THMapAllocator(WithFd, const char, int, int, size_t)
THMapAllocator(WithFd, const char *filename, int fd, int flags, size_t size);
^~~~~~~~~~~~~~
…/pytorch/aten/src/TH/THAllocator.h:38:3: note:   candidate expects 5 arguments, 0 provided
…/pytorch/aten/src/TH/THAllocator.cpp:393:1: note: candidate: THMapAllocator::THMapAllocator(const char, int, size_t)
THMapAllocator::THMapAllocator(const char *filename, int flags, size_t size) {
^~~~~~~~~~~~~~
…/pytorch/aten/src/TH/THAllocator.cpp:393:1: note:   candidate expects 3 arguments, 0 provided
…/pytorch/aten/src/TH/THAllocator.cpp: At global scope:
…/pytorch/aten/src/TH/THAllocator.cpp:517:1: error: redefinition of ‘THRefcountedMapAllocator::~THRefcountedMapAllocator()’
THRefcountedMapAllocator::~THRefcountedMapAllocator() {}
^~~~~~~~~~~~~~~~~~~~~~~~
In file included from …/pytorch/aten/src/TH/THAllocator.cpp:1:0:
…/pytorch/aten/src/TH/THAllocator.h:104:11: note: ‘virtual THRefcountedMapAllocator::~THRefcountedMapAllocator()’ previously defined here
virtual ~THRefcountedMapAllocator() { close(); }
^
…/pytorch/aten/src/TH/THAllocator.cpp: In static member function ‘static at::DataPtr THRefcountedMapAllocator::makeDataPtr(const char*, int, size_t, size_t*)’:
…/pytorch/aten/src/TH/THAllocator.cpp:551:61: error: ‘TH_ALLOC_ALIGNMENT’ was not declared in this scope
if (actual_size_out) *actual_size_out = context->size() - TH_ALLOC_ALIGNMENT;
^~~~~~~~~~~~~~~~~~
…/pytorch/aten/src/TH/THAllocator.cpp:551:61: note: suggested alternative: ‘__LOCK_ALIGNMENT’
if (actual_size_out) *actual_size_out = context->size() - TH_ALLOC_ALIGNMENT;
^~~~~~~~~~~~~~~~~~
__LOCK_ALIGNMENT
…/pytorch/aten/src/TH/THAllocator.cpp: In static member function ‘static at::DataPtr THRefcountedMapAllocator::makeDataPtr(WithFd, const char*, int, int, size_t, size_t*)’:
…/pytorch/aten/src/TH/THAllocator.cpp:557:61: error: ‘TH_ALLOC_ALIGNMENT’ was not declared in this scope
if (actual_size_out) *actual_size_out = context->size() - TH_ALLOC_ALIGNMENT;
^~~~~~~~~~~~~~~~~~
…/pytorch/aten/src/TH/THAllocator.cpp:557:61: note: suggested alternative: ‘__LOCK_ALIGNMENT’
if (actual_size_out) *actual_size_out = context->size() - TH_ALLOC_ALIGNMENT;
^~~~~~~~~~~~~~~~~~
LOCK_ALIGNMENT
…/pytorch/aten/src/TH/THAllocator.cpp: In member function ‘virtual void* THRefcountedMapAllocator::data() const’:
…/pytorch/aten/src/TH/THAllocator.cpp:562:61: error: ‘TH_ALLOC_ALIGNMENT’ was not declared in this scope
return static_cast<void*>(static_cast<char*>(base_ptr) + TH_ALLOC_ALIGNMENT);
^~~~~~~~~~~~~~~~~~
…/pytorch/aten/src/TH/THAllocator.cpp:562:61: note: suggested alternative: ‘LOCK_ALIGNMENT’
return static_cast<void*>(static_cast<char*>(base_ptr) + TH_ALLOC_ALIGNMENT);
^~~~~~~~~~~~~~~~~~
LOCK_ALIGNMENT
caffe2/CMakeFiles/caffe2.dir/build.make:2961: recipe for target 'caffe2/CMakeFiles/caffe2.dir//aten/src/TH/THAllocator.cpp.o’ failed
make[2]: *** [caffe2/CMakeFiles/caffe2.dir//aten/src/TH/THAllocator.cpp.o] Error 1
make[2]: *** Waiting for unfinished jobs…
make[2]: Leaving directory ‘…/pytorch/build’
CMakeFiles/Makefile2:1795: recipe for target ‘caffe2/CMakeFiles/caffe2.dir/all’ failed
make[1]: *** [caffe2/CMakeFiles/caffe2.dir/all] Error 2
make[1]: Leaving directory ‘…/pytorch/build’
Makefile:143: recipe for target ‘all’ failed
make: *** [all] Error 2

Actually, I’ve already installed and I prefer installing some of those 3rd party libraries manually before building/installing PyTorch. However, after installing those 3rd party libraries, I failed to install PyTorch and it’s always complaining “some library has already been installed” …