Multiple glibc libraries on a single host

后端 未结 11 1561
轮回少年
轮回少年 2020-11-21 05:13

Multiple glibc libraries on a single host

My linux (SLES-8) server currently has glibc-2.2.5-235, but I have a program which won\'t work on this version and requires

11条回答
  •  星月不相逢
    2020-11-21 05:56

    @msb gives a safe solution.

    I met this problem when I did import tensorflow as tf in conda environment in CentOS 6.5 which only has glibc-2.12.

    ImportError: /lib64/libc.so.6: version `GLIBC_2.16' not found (required by /home/
    

    I want to supply some details:

    First install glibc to your home directory:

    mkdir ~/glibc-install; cd ~/glibc-install
    wget http://ftp.gnu.org/gnu/glibc/glibc-2.17.tar.gz
    tar -zxvf glibc-2.17.tar.gz
    cd glibc-2.17
    mkdir build
    cd build
    ../configure --prefix=/home/myself/opt/glibc-2.17  # <-- where you install new glibc
    make -j  # You can find your  by using **nproc** command
    make install
    

    Second, follow the same way to install patchelf;

    Third, patch your Python:

    [myself@nfkd ~]$ patchelf --set-interpreter /home/myself/opt/glibc-2.17/lib/ld-linux-x86-64.so.2 --set-rpath /home/myself/opt/glibc-2.17/lib/ /home/myself/miniconda3/envs/tensorflow/bin/python
    

    as mentioned by @msb

    Now I can use tensorflow-2.0 alpha in CentOS 6.5.

    ref: https://serverkurma.com/linux/how-to-update-glibc-newer-version-on-centos-6-x/

提交回复
热议问题