Install problem of the lastest pytorch version

I met a problem while installing pytorch

cmake: relocation error: cmake: symbol ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE7compareERKS4, version GLIBCXX_3.4.21 not defined in file libstdc++.so.6 with link time reference

I searched online and found solutions that I should upgrade my ubuntu14.04 to 16. But I can’t do this on the server because I’m not the only one use it and I don’t have the administrator permissions.

Can someone help?

my conda env:

packages in environment at /home/milu/anaconda2/envs/pytorch0.4_py3:

bzip2 1.0.6 h9a117a8_4
ca-certificates 2017.08.26 h1d4fec5_0
certifi 2018.1.18 py36_0
cffi 1.11.5 py36h9745a5d_0
cloog 0.18.0 0
cmake 3.9.4 h142f0e9_0
curl 7.58.0 h84994c4_0
expat 2.2.5 he0dffb1_0
gcc 4.8.5 7
gmp 6.1.2 h6c8ec71_1
intel-openmp 2018.0.0 hc7b2577_8
isl 0.12.2 0
libcurl 7.58.0 h1ad7b7a_0
libedit 3.1 heed3624_0
libffi 3.2.1 hd88cf55_4
libgcc-ng 7.2.0 hdf63c60_3
libgfortran-ng 7.2.0 hdf63c60_3
libssh2 1.8.0 h9cfc8f7_4
libstdcxx-ng 7.2.0 hdf63c60_3
libuv 1.19.2 h14c3975_0
magma-cuda80 2.3.0 1 pytorch
mkl 2018.0.1 h19d6760_4
mpc 1.0.3 hec55b23_5
mpfr 3.1.5 h11a74b3_2
ncurses 6.0 h9df7e31_2
numpy 1.14.2 py36hdbf6ddf_0
openssl 1.0.2n hb7f436b_0
pip 9.0.1 py36_5
pycparser 2.18 py36hf9f622e_1
python 3.6.4 hc3d631a_3
pyyaml 3.12 py36hafb9ca4_1
readline 7.0 ha6073c6_4
rhash 1.3.5 hbf7ad62_1
setuptools 38.5.1 py36_0
sqlite 3.22.0 h1bed415_0
tk 8.6.7 hc745277_3
typing 3.6.4 py36_0
wheel 0.30.0 py36hfd4bba0_1
xz 5.2.3 h55aa19d_2
yaml 0.1.7 had09818_2
zlib 1.2.11 ha838bed_2

problems:

(pytorch0.4_py3) milu@Apocalypse01:/raid5/milu/pytorch0.4/pytorch$ python setup.py install
running install
running build_deps

  • WITH_CUDA=0
  • [[ --with-cuda == --\w\i\t\h-\c\u\d\a ]]
  • WITH_CUDA=1
  • shift
  • WITH_NNPACK=0
  • [[ --with-nnpack == --\w\i\t\h-\n\n\p\a\c\k ]]
  • WITH_NNPACK=1
  • shift
  • WITH_GLOO_IBVERBS=0
  • [[ nccl == --\w\i\t\h-\g\l\o\o-\i\b\v\e\r\b\s ]]
  • USER_CFLAGS=
  • USER_LDFLAGS=
  • [[ -n ‘’ ]]
  • [[ -n ‘’ ]]
  • [[ -n ‘’ ]]
    ++ dirname torch/lib/build_libs.sh
  • cd torch/lib/…/…
    +++ pwd
    ++ printf ‘%q\n’ /raid5/milu/pytorch0.4/pytorch
  • PWD=/raid5/milu/pytorch0.4/pytorch
  • BASE_DIR=/raid5/milu/pytorch0.4/pytorch
  • cd torch/lib
  • INSTALL_DIR=/raid5/milu/pytorch0.4/pytorch/torch/lib/tmp_install
  • CMAKE_VERSION=cmake
  • C_FLAGS=’ -DTH_INDEX_BASE=0 -I"/raid5/milu/pytorch0.4/pytorch/torch/lib/tmp_install/include" -I"/raid5/milu/pytorch0.4/pytorch/torch/lib/tmp_install/include/TH" -I"/raid5/milu/pytorch0.4/pytorch/torch/lib/tmp_install/include/THC" -I"/raid5/milu/pytorch0.4/pytorch/torch/lib/tmp_install/include/THS" -I"/raid5/milu/pytorch0.4/pytorch/torch/lib/tmp_install/include/THCS" -I"/raid5/milu/pytorch0.4/pytorch/torch/lib/tmp_install/include/THNN" -I"/raid5/milu/pytorch0.4/pytorch/torch/lib/tmp_install/include/THCUNN"’
  • C_FLAGS=’ -DTH_INDEX_BASE=0 -I"/raid5/milu/pytorch0.4/pytorch/torch/lib/tmp_install/include" -I"/raid5/milu/pytorch0.4/pytorch/torch/lib/tmp_install/include/TH" -I"/raid5/milu/pytorch0.4/pytorch/torch/lib/tmp_install/include/THC" -I"/raid5/milu/pytorch0.4/pytorch/torch/lib/tmp_install/include/THS" -I"/raid5/milu/pytorch0.4/pytorch/torch/lib/tmp_install/include/THCS" -I"/raid5/milu/pytorch0.4/pytorch/torch/lib/tmp_install/include/THNN" -I"/raid5/milu/pytorch0.4/pytorch/torch/lib/tmp_install/include/THCUNN" -DOMPI_SKIP_MPICXX=1’
  • LDFLAGS=’-L"/raid5/milu/pytorch0.4/pytorch/torch/lib/tmp_install/lib" ’
  • LD_POSTFIX=.so.1
  • LD_POSTFIX_UNVERSIONED=.so
    ++ uname
  • [[ Linux == \D\a\r\w\i\n ]]
  • LDFLAGS=’-L"/raid5/milu/pytorch0.4/pytorch/torch/lib/tmp_install/lib" -Wl,-rpath,$ORIGIN’
  • CPP_FLAGS=’ -std=c++11 ’
  • GLOO_FLAGS=
  • THD_FLAGS=
  • NCCL_ROOT_DIR=/raid5/milu/pytorch0.4/pytorch/torch/lib/tmp_install
  • [[ 1 -eq 1 ]]
  • GLOO_FLAGS=’-DUSE_CUDA=1 -DNCCL_ROOT_DIR=/raid5/milu/pytorch0.4/pytorch/torch/lib/tmp_install’
  • [[ 0 -eq 1 ]]
  • CWRAP_FILES=’/raid5/milu/pytorch0.4/pytorch/torch/lib/ATen/Declarations.cwrap;/raid5/milu/pytorch0.4/pytorch/torch/lib/THNN/generic/THNN.h;/raid5/milu/pytorch0.4/pytorch/torch/lib/THCUNN/generic/THCUNN.h;/raid5/milu/pytorch0.4/pytorch/torch/lib/ATen/nn.yaml’
  • CUDA_NVCC_FLAGS=’ -DTH_INDEX_BASE=0 -I"/raid5/milu/pytorch0.4/pytorch/torch/lib/tmp_install/include" -I"/raid5/milu/pytorch0.4/pytorch/torch/lib/tmp_install/include/TH" -I"/raid5/milu/pytorch0.4/pytorch/torch/lib/tmp_install/include/THC" -I"/raid5/milu/pytorch0.4/pytorch/torch/lib/tmp_install/include/THS" -I"/raid5/milu/pytorch0.4/pytorch/torch/lib/tmp_install/include/THCS" -I"/raid5/milu/pytorch0.4/pytorch/torch/lib/tmp_install/include/THNN" -I"/raid5/milu/pytorch0.4/pytorch/torch/lib/tmp_install/include/THCUNN" -DOMPI_SKIP_MPICXX=1’
  • [[ ‘’ -eq 1 ]]
  • ‘[’ -z 16 ‘]’
  • mkdir -p tmp_install
  • for arg in ‘"$@"’
  • [[ nccl == \n\c\c\l ]]
  • build_nccl
  • mkdir -p build/nccl
  • cd build/nccl
  • cmake …/…/nccl -DCMAKE_MODULE_PATH=/raid5/milu/pytorch0.4/pytorch/cmake/FindCUDA -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/raid5/milu/pytorch0.4/pytorch/torch/lib/tmp_install '-DCMAKE_C_FLAGS= -DTH_INDEX_BASE=0 -I"/raid5/milu/pytorch0.4/pytorch/torch/lib/tmp_install/include" -I"/raid5/milu/pytorch0.4/pytorch/torch/lib/tmp_install/include/TH" -I"/raid5/milu/pytorch0.4/pytorch/torch/lib/tmp_install/include/THC" -I"/raid5/milu/pytorch0.4/pytorch/torch/lib/tmp_install/include/THS" -I"/raid5/milu/pytorch0.4/pytorch/torch/lib/tmp_install/include/THCS" -I"/raid5/milu/pytorch0.4/pytorch/torch/lib/tmp_install/include/THNN" -I"/raid5/milu/pytorch0.4/pytorch/torch/lib/tmp_install/include/THCUNN" -DOMPI_SKIP_MPICXX=1 ’ '-DCMAKE_CXX_FLAGS= -DTH_INDEX_BASE=0 -I"/raid5/milu/pytorch0.4/pytorch/torch/lib/tmp_install/include" -I"/raid5/milu/pytorch0.4/pytorch/torch/lib/tmp_install/include/TH" -I"/raid5/milu/pytorch0.4/pytorch/torch/lib/tmp_install/include/THC" -I"/raid5/milu/pytorch0.4/pytorch/torch/lib/tmp_install/include/THS" -I"/raid5/milu/pytorch0.4/pytorch/torch/lib/tmp_install/include/THCS" -I"/raid5/milu/pytorch0.4/pytorch/torch/lib/tmp_install/include/THNN" -I"/raid5/milu/pytorch0.4/pytorch/torch/lib/tmp_install/include/THCUNN" -DOMPI_SKIP_MPICXX=1 -std=c++11 ’ -DCMAKE_SHARED_LINKER_FLAGS=
    cmake: relocation error: cmake: symbol ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE7compareERKS4, version GLIBCXX_3.4.21 not defined in file libstdc++.so.6 with link time reference

This user seems to have solved the same issue on his machine.
Could you try it?

They are all using ubuntu16 with a different default gcc. Mine is ubuntu14.04 with gcc4.9
I wonder the error is caused by

I"/raid5/milu/pytorch0.4/pytorch/torch/lib/tmp_install/include/THCUNN" -DOMPI_SKIP_MPICXX=1 -std=c++11 ’

this ‘-std=c++11’
Is that mean we must use c++11?
I don’t know how to fix it and I can’t upgrade gcc to 5.x by conda

I think ATen is built on C++11. At least the name suggests it: “A TENsor library for C++11” :smiley:
Unfortunately, I don’t have any machines running Ubuntu 14.x.
Have you tried to install some conda packages from other channels, e.g.: https://anaconda.org/dgursoy/gcc-5

Finally, I made it by upgrading the anaconda:rofl:

Thank you for your help!