Search code examples
centosgnuglibc

How to set up an additional glibc compiler on centOS


I'm using CentOS 7 and it is having glibc version 2.17. I want to set up additional glibc compiler(same or another version) on this OS. Please anyone help me in this.


Solution

  • Let us assume you want to install 2.14 along 2.17 on centOS 7 and use it to compile your projects, just follow the steps below :

    mkdir ~/glibc_install; cd ~/glibc_install 
    
    wget http://ftp.gnu.org/gnu/glibc/glibc-2.14.tar.gz
    
    tar zxvf glibc-2.14.tar.gz
    
    cd glibc-2.14
    
    mkdir build
    
    cd build
    
    ../configure --prefix=/opt/glibc-2.14
    
    make -j4
    
    sudo make install
    
    export LD_LIBRARY_PATH=/opt/glibc-2.14/lib
    

    PS: Building process takes 2.5 hours on slow AWS.