I am trying to install tensorflow on a linux server where I am just a user without the root permission. And I cannot transfer files to/from it as I ssh to it through a jump server. The system is as following :
Linux THENAME_OF_SURVER 2.6.32-573.18.1.el6.x86_64 #1 SMP Tue Feb 9 22:46:17 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux
I installed the tensorflow through pip install tensorflow
and a tensorflow program would display the following:
ImportError: /lib64/libc.so.6: version `GLIBC_2.16' not found
I installed a new version of glibc
git clone git://sourceware.org/git/glibc.git
cd glibc
git checkout --track -b local_glibc-2.16 origin/release/2.16/master
mkdir build
cd build
../configure --prefix=/home/MYNAME/dependency/glibc-2.16
make -j4
make install
Followed the instructions online, I changed the environment variables through:
export LD_LIBRARY_PATH=/home/MYNAME/dependency/glibc-2.16/lib
BUT this leads me to a problem: I cannot use any command. For example, I called ls
and it would warn me like this:
ls: error while loading shared libraries: __vdso_time: invalid mode for dlopen(): Invalid argument
I then followed another instruction to run the command as following:
/home/MYNAME/dependency/glibc-2.16/lib/ld-linux-x86-64.so.2 --library-path /home/MYNAME/dependency/glibc-2.16/lib:$LD_LIBRARY_PATH:/path/to/gcc-5.2.0/lib64:/usr/lib64/:/usr/lib64/ ls
(I do not know where to find the similar folder as gcc-5.2.0
, my which gcc
shows /usr/local/sbin/gcc
, but it links to /usr/local/gcc-5.3.0/bin/gcc
, which doesn't have a lib64 subfolder)
But then it came with the following warning:
ls: error while loading shared libraries: ls: cannot open shared object file
I know that I can use ls
again by export the variable to empty. But I still cannot use the new version of glibc. Could anyone help me with how to correctly link the new glibc? Any suggestions would be appreciated!
EDIT: So the progress is as following:
LD_LIBRARY_PATH=/home/MYNAME/dependency/glibc-2.16/lib python
would result in python: error while loading shared libraries: __vdso_time: invalid mode for dlopen(): Invalid argument
/home/MYNAME/dependency/glibc-2.16/lib/ld-2.16.so python
would result in python: error while loading shared libraries: __vdso_time: invalid mode for dlopen(): Invalid argument
EDIT2 & SUMMARY:
To make Employed Russian's answer more detailed, I would paste my final solutions here.
My goal is to use tensorflow in Python on a server that I do not have the root permission. I was warned that ImportError: /lib64/libc.so.6: version 'GLIBC_2.16' not found
when import tensorflow.
Based on Employed Russian's answer, I used the following to run my command:
LD_LIBRARY_PATH=/home/USERNAME/dependency/glibc-2.17/lib/:/lib64/:/usr/local/gcc-5.3.0/lib64/ /home/USERNAME/dependency/glibc-2.17/lib/ld-2.17.so /home/USERNAME/anaconda2/bin/python
Split the command into the following parts (I would use ???
to represent the paths that are different for different people.):
LD_LIBRARY_PATH=
:
means split???/glibc-2.17/lib/
/lib64/
and /usr/local/gcc-5.3.0/lib64/
: I found these folders by find / -name 'libgcc_s.so.1'
because I was /???/glibc-2.17/lib/ld-2.17.so
/???/python
the path of your executable. For Python, import sys; print(sys.executable)
to see your Python path.Other things:
os.system('ls')
or os.system('python xxx.py')
. But it warned me as following if I used it in its normal way: sh: error while loading shared libraries: __vdso_time: invalid mode for dlopen(): Invalid argument
and I haven't found a good enough solution for this.
export LD_LIBRARY_PATH=/home/MYNAME/dependency/glibc-2.16/lib
This answer explains why LD_LIBRARY_PATH
doesn't work, and what you should do instead.
I read your post and tried ...
python: error while loading shared libraries: __vdso_time: invalid mode for dlopen(): Invalid argument
The error usually means that you have a mismatch between ld-linux
and libc.so.6
. They must match.
If you are using direct loader invocation via /home/MYNAME/.../ld-2.16.so
, you must also arrange for /home/MYNAME/.../libc.so.6
to be loaded.
You can do that by passing --library-path ...
to ld-2.16.so
, or setting LD_LIBRARY_PATH
appropriately.
Your command with ld-2.16 --library-path ... ls
is almost correct. The thing you are missing is that ld-2.16
will not search your PATH
. You need to give it full pathname: ld-2.16 --library-path ... /bin/ls
.
In my case it was centos 6 with python for pytorch.
I had errors like, etc.:
libraries: __vdso_time: invalid mode for dlopen(): Invalid argument
ImportError: /lib64/libc.so.6: version `GLIBC_2.14' not found (required by /home/evaldsu/.conda/envs/conda_env/lib/python3.6/site-
I installed alongside glibc-2.17 in local dir /opt/exp_soft/tools
then I installed in conda env patching tool (can install using other tools as well):
conda install -c conda-forge patchelf
then I patched binary of python to use different glibc path (you can do this with any binary). Be aware that it will change you python binary.
patchelf --set-rpath /opt/exp_soft/tools/glibc-2.17/lib:$HOME/.conda/envs/conda_inf/lib:/usr/lib64:/lib64:/lib --set-interpreter /opt/exp_soft/tools/glibc-2.17/lib/ld-linux-x86-64.so.2 /home/evaldsu/.conda/envs/conda_inf/bin/python3.6
Another option is just install this script if you have full admin access:
https://gist.github.com/harv/f86690fcad94f655906ee9e37c85b174
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With