Installation error from source

Hi Guys,

I am trying to install pytorch from source because of this (glibc version) issue https://github.com/pytorch/pytorch/issues/6607

Below are the commands I used :
$export CMAKE_PREFIX_PATH=/home/jamess/anaconda2/ [#anaconda path]
$conda install numpy pyyaml mkl mkl-include setuptools cmake cffi typing
$conda install -c mingfeima mkldnn
$git clone --recursive https://github.com/pytorch/pytorch
cd pytorch
$python setup.py install

System info :
OS : CentOS release 6.7
CUDA : N/A

I get the following error :

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

  • cmake … -DCMAKE_BUILD_TYPE=Release -DBUILD_CAFFE2=0 -DBUILD_ATEN=ON -DBUILD_PYTHON=0 -DBUILD_BINARY=OFF -DBUILD_SHARED_LIBS=ON -DONNX_NAMESPACE=onnx_torch -DUSE_CUDA=0 -DUSE_ROCM=0 -DUSE_NNPACK=1 -DCUDNN_INCLUDE_DIR= -DCUDNN_LIB_DIR= -DCUDNN_LIBRARY= -DUSE_MKLDNN=1 -DMKLDNN_INCLUDE_DIR=/home/jamess/anaconda2/bin/…/include -DMKLDNN_LIB_DIR=/home/jamess/anaconda2/bin/…/lib -DMKLDNN_LIBRARY=/home/jamess/anaconda2/bin/…/lib/libmkldnn.so -DCMAKE_INSTALL_PREFIX=/home/jamess/Downloads/pytorch/torch/lib/tmp_install -DCMAKE_EXPORT_COMPILE_COMMANDS=1 -DCMAKE_C_FLAGS= -DCMAKE_CXX_FLAGS= -DCMAKE_EXE_LINKER_FLAGS= -DCMAKE_SHARED_LINKER_FLAGS=
    – Need to define long as a separate typeid.
    – std::exception_ptr is NOT supported.
    – NUMA is not available
    – Turning off deprecation warning due to glog.
    – Building using own protobuf under third_party per request.
    – Use custom protobuf build.
    – Caffe2 protobuf include directory: $<BUILD_INTERFACE:/home/jamess/Downloads/pytorch/third_party/protobuf/src>$<INSTALL_INTERFACE:include>
    – The BLAS backend of choice:MKL
    – Checking for [mkl_intel_lp64 - mkl_gnu_thread - mkl_core - gomp - pthread - m - dl]
    – Library mkl_intel_lp64: /home/jamess/anaconda2/lib/libmkl_intel_lp64.so
    – Library mkl_gnu_thread: /home/jamess/anaconda2/lib/libmkl_gnu_thread.so
    – Library mkl_core: /home/jamess/anaconda2/lib/libmkl_core.so
    – Library gomp: -fopenmp
    – Library pthread: /usr/lib64/libpthread.so
    – Library m: /usr/lib64/libm.so
    – Library dl: /usr/lib64/libdl.so
    – Brace yourself, we are building NNPACK
    CMake Warning at cmake/Dependencies.cmake:310 (find_package):
    By not providing “FindEigen3.cmake” in CMAKE_MODULE_PATH this project has
    asked CMake to find a package configuration file provided by “Eigen3”, but
    CMake did not find one.

    Could not find a package configuration file provided by “Eigen3” with any
    of the following names:

    Eigen3Config.cmake
    eigen3-config.cmake

    Add the installation prefix of “Eigen3” to CMAKE_PREFIX_PATH or set
    “Eigen3_DIR” to a directory containing one of the above files. If “Eigen3”
    provides a separate development package or SDK, be sure it has been
    installed.
    Call Stack (most recent call first):
    CMakeLists.txt:181 (include)

– Did not find system Eigen. Using third party subdirectory.
– Could NOT find pybind11 (missing: pybind11_INCLUDE_DIR)
CMake Error at cmake/Dependencies.cmake:803 (message):
The C++ compiler does not support required functions. This is very likely
due to a known bug in GCC 5 (and maybe other versions) on Ubuntu 17.10 and
newer. For more information, see:
https://github.com/pytorch/pytorch/issues/5229
Call Stack (most recent call first):
CMakeLists.txt:181 (include)

– Configuring incomplete, errors occurred!
See also “/home/jamess/Downloads/pytorch/build/CMakeFiles/CMakeOutput.log”.
See also “/home/jamess/Downloads/pytorch/build/CMakeFiles/CMakeError.log”.
Failed to run ‘bash tools/build_pytorch_libs.sh --use-nnpack --use-mkldnn caffe2 nanopb libshm gloo THD’

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Any suggestions ?

In the issue, this link seems to help building PyTorch with your GCC.
Could you check it?

Unfortunately, I don’t have the root access to the system, so can’t edit the files.

1 Like