My Question:
I compiled the source code of xgboost with gcc/5.4.0 in our linux system. Everything works fine and i can use "python setup.py install" to install xgboost into python 2.7.6 successfully.
However, when I simply import xgboost, say "import xgboost as xgb", i got the error below:
OSError: /usr/lib64/libstdc++.so.6: version `GLIBCXX_3.4.20' not found (required by /apps2/python/2.7.6-gcc/lib/python2.7/site-packages/xgboost-0.6-py2.7.egg/xgboost/libxgboost.so)
Here is the dependencies of libxgboost.so (ldd)
linux-vdso.so.1 => (0x00007ffd7af7e000)
librt.so.1 => /lib64/librt.so.1 (0x00002b873c906000)
libstdc++.so.6 => /apps2/gcc/5.4.0/lib64/libstdc++.so.6 (0x00002b873cb0f000)
libm.so.6 => /lib64/libm.so.6 (0x00002b873ce9d000)
libgomp.so.1 => /apps2/gcc/5.4.0/lib64/libgomp.so.1 (0x00002b873d121000)
libgcc_s.so.1 => /apps2/gcc/5.4.0/lib64/libgcc_s.so.1 (0x00002b873d343000)
libpthread.so.0 => /lib64/libpthread.so.0 (0x00002b873d559000)
libc.so.6 => /lib64/libc.so.6 (0x00002b873d776000)
/lib64/ld-linux-x86-64.so.2 (0x0000003572200000)
libdl.so.2 => /lib64/libdl.so.2 (0x00002b873db0b000)
Here is the glibc list in "/apps2/gcc/5.4.0/lib64/libstdc++.so.6":
GLIBCXX_3.4
GLIBCXX_3.4.1
GLIBCXX_3.4.2
GLIBCXX_3.4.3
GLIBCXX_3.4.4
GLIBCXX_3.4.5
GLIBCXX_3.4.6
GLIBCXX_3.4.7
GLIBCXX_3.4.8
GLIBCXX_3.4.9
GLIBCXX_3.4.10
GLIBCXX_3.4.11
GLIBCXX_3.4.12
GLIBCXX_3.4.13
GLIBCXX_3.4.14
GLIBCXX_3.4.15
GLIBCXX_3.4.16
GLIBCXX_3.4.17
GLIBCXX_3.4.18
GLIBCXX_3.4.19
GLIBCXX_3.4.20
GLIBCXX_3.4.21
GLIBC_2.3
GLIBC_2.2.5
GLIBC_2.3.2
GLIBCXX_FORCE_NEW
GLIBCXX_DEBUG_MESSAGE_LENGTH
In fact, GLIBCXX_3.4.20 has already been included by "/apps2/gcc/5.4.0/lib64/libstdc++.so.6", however, this glibcxx version is exactly do NOT contained by "/usr/lib64/libstdc++.so.6".
Since I am not allowed to replace "/usr/lib64/libstdc++.so.6" with "/apps2/gcc/5.4.0/lib64/libstdc++.so.6", is there anyway to let xgboost ONLY use "/apps2/gcc/5.4.0/lib64/libstdc++.so.6" rather than "/usr/lib64/libstdc++.so.6"?
Operating System: Red Hat Enterprise Linux Workstation release 6.7 (Santiago)
Compiler: gcc/5.4.0
Package used (python/R/jvm/C++): python
xgboost
version used: 0.6
If installing from source, please provide
git rev-parse HEAD
): 016ab89484e7a6313a7de11160d0c3370fc5c35dIf you are using python package, please provide
Thanks so much
Best regards
Xin
Any comments?
Can you try adding /apps2/gcc/5.4.0/lib64 to LD_LIBRARY_PATH?
here is my case and solution,it seems the method can work here toohttps://github.com/dmlc/xgboost/issues/1786
@yinshurman it is a common version mismatch for GLIBC library. We had the same error.
We fixed that by compiling with the same version as our production envirronement.
@yinshurman ,hi,your solution link is dead, can you show me a new one? I 've got a same issue for this
maybe you can try conda install libgcc
which worked for many people from this #1043
Not directly click the url but by coping and pasting it into the browser address should work.It seems that it is a bug of github on April fool's day ! @LancelotHolmes
@yinshurman aha,thank u, and I 've read your solution before,but it didn't solve my problem, finally I try conda install libgcc
which solved my issue.
Most helpful comment
maybe you can try
conda install libgcc
which worked for many people from this #1043