0

I need to have libstdc++ which contains GLIBCXX_3_4_9 library for 64 bit platform on redhat 5 system. This is required by an application. I tried to install following rpms from RHEL 6 repository but recevied several dependency failure error messages

 libstdc++-docs-4.4.7-4.el6.x86_64.rpm
 libstdc++-devel-4.4.7-4.el6.x86_64.rpm
 libstdc++-4.4.7-4.el6.x86_64.rpm
 compat-libstdc++-33-3.2.3-69.el6.x86_64.rpm
 compat-libstdc++-296-2.96-144.el6.i686.rpm


 # rpm -Uvh libstdc++-4.4.7-4.el6.x86_64.rpm libstdc++-devel-4.4.7-4.el6.x86_64.rpm compat-libstdc++-296-2.96-144.el6.i686.rpm compat-libstdc++-33-3.2.3-69.el6.x86_64.rpm

            warning: libstdc++-4.4.7-4.el6.x86_64.rpm: Header V3 RSA/SHA256 signature: NOKEY, key ID fd431d51
        error: Failed dependencies:
                glibc >= 2.10.90-7 is needed by libstdc++-4.4.7-4.el6.x86_64
                rpmlib(FileDigests) <= 4.6.0-1 is needed by libstdc++-4.4.7-4.el6.x86_64
                rpmlib(PayloadIsXz) <= 5.2-1 is needed by libstdc++-4.4.7-4.el6.x86_64
                rpmlib(FileDigests) <= 4.6.0-1 is needed by libstdc++-devel-4.4.7-4.el6.x86_64
                rpmlib(PayloadIsXz) <= 5.2-1 is needed by libstdc++-devel-4.4.7-4.el6.x86_64
                libc.so.6(GLIBC_2.12) is needed by compat-libstdc++-296-2.96-144.el6.i686
                rpmlib(FileDigests) <= 4.6.0-1 is needed by compat-libstdc++-296-2.96-144.el6.i686
                rpmlib(PayloadIsXz) <= 5.2-1 is needed by compat-libstdc++-296-2.96-144.el6.i686
                rpmlib(FileDigests) <= 4.6.0-1 is needed by compat-libstdc++-33-3.2.3-69.el6.x86_64
                rpmlib(PayloadIsXz) <= 5.2-1 is needed by compat-libstdc++-33-3.2.3-69.el6.x86_64
                libstdc++ = 4.1.2-54.el5 is needed by (installed) gcc-c++-4.1.2-54.el5.x86_64
                libstdc++ = 4.1.2 is needed by (installed) libstdc++44-devel-4.4.7-1.el5.x86_64
                libstdc++ = 4.1.2 is needed by (installed) libstdc++44-devel-4.4.7-1.el5.i386
                libstdc++-devel = 4.1.2-54.el5 is needed by (installed) gcc-c++-4.1.2-54.el5.x86_64

Is there a way to get this libstdc++.so.6.0.9 or higher install on redheat 5 (64bit) system?

Update:

Here is the output of yum search

   # yum search gcc-c++ 
   Loaded plugins: product-id, rhnplugin, security, subscription-manager
   This system is not registered to Red Hat Subscription Management. You can use                subscription-manager to register.
   This system is receiving updates from RHN Classic or RHN Satellite.
  ======================================================================================         Matched: gcc-c++ ======================================================================================
    gcc-c++.x86_64 : C++ support for GCC

I have downloaded the latest version from gcc++ from rhn 6 repository but received the following error:

        # yum install gcc-c++-4.4.7-4.el6.x86_64.rpm
        Loaded plugins: product-id, rhnplugin, security, subscription-manager
        This system is not registered to Red Hat Subscription Management. You can use subscription-manager to register.
        This system is receiving updates from RHN Classic or RHN Satellite.
        Setting up Install Process
        Examining gcc-c++-4.4.7-4.el6.x86_64.rpm: gcc-c++-4.4.7-4.el6.x86_64
        Marking gcc-c++-4.4.7-4.el6.x86_64.rpm as an update to gcc-c++-4.1.2-54.el5.x86_64
        Resolving Dependencies
        --> Running transaction check
        ---> Package gcc-c++.x86_64 0:4.4.7-4.el6 set to be updated
        --> Processing Dependency: gcc = 4.4.7-4.el6 for package: gcc-c++
        --> Processing Dependency: libstdc++ = 4.4.7-4.el6 for package: gcc-c++
        --> Processing Dependency: libstdc++-devel = 4.4.7-4.el6 for package: gcc-c++
        --> Processing Dependency: libc.so.6(GLIBC_2.11)(64bit) for package: gcc-c++
        --> Processing Dependency: libc.so.6(GLIBC_2.7)(64bit) for package: gcc-c++
        --> Processing Dependency: libgmp.so.3()(64bit) for package: gcc-c++
        --> Processing Dependency: libmpfr.so.1()(64bit) for package: gcc-c++
        --> Running transaction check
        ---> Package gcc-c++.x86_64 0:4.4.7-4.el6 set to be updated
        --> Processing Dependency: gcc = 4.4.7-4.el6 for package: gcc-c++
        --> Processing Dependency: libstdc++ = 4.4.7-4.el6 for package: gcc-c++
        --> Processing Dependency: libstdc++-devel = 4.4.7-4.el6 for package: gcc-c++
        --> Processing Dependency: libc.so.6(GLIBC_2.11)(64bit) for package: gcc-c++
        --> Processing Dependency: libc.so.6(GLIBC_2.7)(64bit) for package: gcc-c++
        --> Processing Dependency: libmpfr.so.1()(64bit) for package: gcc-c++
        ---> Package gmp.x86_64 0:4.1.4-10.el5 set to be updated
        --> Finished Dependency Resolution
        gcc-c++-4.4.7-4.el6.x86_64 from /gcc-c++-4.4.7-4.el6.x86_64 has depsolving problems
          --> Missing Dependency: libstdc++-devel = 4.4.7-4.el6 is needed by package gcc-c++-4.4.7-4.el6.x86_64 (/gcc-c++-4.4.7-4.el6.x86_64)
        gcc-c++-4.4.7-4.el6.x86_64 from /gcc-c++-4.4.7-4.el6.x86_64 has depsolving problems
          --> Missing Dependency: libmpfr.so.1()(64bit) is needed by package gcc-c++-4.4.7-4.el6.x86_64 (/gcc-c++-4.4.7-4.el6.x86_64)
        gcc-c++-4.4.7-4.el6.x86_64 from /gcc-c++-4.4.7-4.el6.x86_64 has depsolving problems
          --> Missing Dependency: libc.so.6(GLIBC_2.7)(64bit) is needed by package gcc-c++-4.4.7-4.el6.x86_64 (/gcc-c++-4.4.7-4.el6.x86_64)
        gcc-c++-4.4.7-4.el6.x86_64 from /gcc-c++-4.4.7-4.el6.x86_64 has depsolving problems
          --> Missing Dependency: gcc = 4.4.7-4.el6 is needed by package gcc-c++-4.4.7-4.el6.x86_64 (/gcc-c++-4.4.7-4.el6.x86_64)
        gcc-c++-4.4.7-4.el6.x86_64 from /gcc-c++-4.4.7-4.el6.x86_64 has depsolving problems
          --> Missing Dependency: libstdc++ = 4.4.7-4.el6 is needed by package gcc-c++-4.4.7-4.el6.x86_64 (/gcc-c++-4.4.7-4.el6.x86_64)
        gcc-c++-4.4.7-4.el6.x86_64 from /gcc-c++-4.4.7-4.el6.x86_64 has depsolving problems
          --> Missing Dependency: libc.so.6(GLIBC_2.11)(64bit) is needed by package gcc-c++-4.4.7-4.el6.x86_64 (/gcc-c++-4.4.7-4.el6.x86_64)
        Error: Missing Dependency: libstdc++ = 4.4.7-4.el6 is needed by package gcc-c++-4.4.7-4.el6.x86_64 (/gcc-c++-4.4.7-4.el6.x86_64)
        Error: Missing Dependency: libc.so.6(GLIBC_2.7)(64bit) is needed by package gcc-c++-4.4.7-4.el6.x86_64 (/gcc-c++-4.4.7-4.el6.x86_64)
        Error: Missing Dependency: gcc = 4.4.7-4.el6 is needed by package gcc-c++-4.4.7-4.el6.x86_64 (/gcc-c++-4.4.7-4.el6.x86_64)
        Error: Missing Dependency: libstdc++-devel = 4.4.7-4.el6 is needed by package gcc-c++-4.4.7-4.el6.x86_64 (/gcc-c++-4.4.7-4.el6.x86_64)
        Error: Missing Dependency: libc.so.6(GLIBC_2.11)(64bit) is needed by package gcc-c++-4.4.7-4.el6.x86_64 (/gcc-c++-4.4.7-4.el6.x86_64)
        Error: Missing Dependency: libmpfr.so.1()(64bit) is needed by package gcc-c++-4.4.7-4.el6.x86_64 (/gcc-c++-4.4.7-4.el6.x86_64)
0

The following script did it all. It not only download and compile GCC4.4 package but also download and compile necessary dependencies. You may need to install #yum install zsh before run this script since this script is running under zsh shell. Thanks to Simon Heimlicher for making this script available on his blog.

    #!/usr/bin/env zsh
    # Download and compile GCC 4.4

    set -ue

    # Set minimal PATH to make sure we compile with the system compiler
    export PATH=/usr/sbin:/usr/bin:/sbin:/bin
    # Use bash as the shell for everything GNU
    export CONFIG_SHELL=/bin/bash

    # Set to true for verbose output
    VERBOSE=${VERBOSE:=false}

    out () { printf "\n%b\n\n" "$@" >&2 }
    fail () { printf "\n%b\n\n" " $@ " >&2; exit 1 }

    DSTROOT=${DSTROOT:=$HOME/local}
    PKGROOT=${PKGROOT:=$DSTROOT/pkg}
    SCRATCH=${SCRATCH:-$HOME/scratch}
    SRCDIR=${SRCDIR:=$SCRATCH/gcc/src}
    BUILDDIR=${BUILDDIR:=$SCRATCH/gcc/build}

    GCC_URL=http://mirror.switch.ch/ftp/mirror/gnu/gcc/gcc-4.4.7/gcc-4.4.7.tar.bz2

    GCC_PREREQUISITE_URLS=(
    ftp://gcc.gnu.org/pub/gcc/infrastructure/gmp-4.3.2.tar.bz2
    ftp://gcc.gnu.org/pub/gcc/infrastructure/mpfr-2.4.2.tar.bz2
    ftp://gcc.gnu.org/pub/gcc/infrastructure/mpc-0.8.1.tar.gz
    http://www.mr511.de/software/libelf-0.8.13.tar.gz
    )

    out "DSTROOT='$DSTROOT'
    PKGROOT='$PKGROOT'
    SRCDIR='$SRCDIR'
    BUILDDIR='$BUILDDIR'"

    runcmd() {
     RUN_RET=0
     RUN_CWD='.'
     RUN_FORCE=false
     o_cwd=''; o_force=''
     zparseopts -D -K -- c:=o_cwd f=o_force -cwd:=o_cwd -force=o_force
     if [[ $# -eq 0 ]]; then
         print "Usage: runcmd [-f] <command line to run>" >&2
         return 1
     fi
     if [[ -n $o_cwd ]]; then RUN_CWD=$o_cwd[2]; fi
     if [[ -n $o_force ]]; then RUN_FORCE=true; fi
     cmdline=$@
     if $VERBOSE; then
         print "Running\n    ${(@)cmdline}\nRUN_FORCE=$RUN_FORCE RUN_CWD=$RUN_CWD" >&2
     fi
     ( set +ue; cd $RUN_CWD && print ${(@)cmdline} | $CONFIG_SHELL -sue; )
     RUN_RET=$?
     if [[ $RUN_RET -ne 0 ]]; then
         if $RUN_FORCE; then
             print "\n### $cmdline\nexit $RUN_RET in CWD=$RUN_CWD\n" >&2
         else
             print "\n\n### $cmdline\nexit $RUN_RET in CWD=$RUN_CWD\nAbort." >&2
             exit $RUN_RET
         fi
     fi
     return $RUN_RET
    }

    prepare_pkg () {
     local srcdir=$1
     local url=$2
     local pkgvers=${${url##*/}%.(tar*|zip)}
     local pkg=${pkgvers%-*}
     local vers=${pkgvers#*-}
     local suffix=${${url##*/}##*.}
     out "Fetching $pkgvers from $url"
     case $suffix in
         gz)
         runcmd -c $srcdir curl -L $url \| tar xz
         ;;
         bz2|tbz)
         runcmd -c $srcdir curl -L $url \| tar xj
         ;;
         zip)
         runcmd -c $srcdir curl -L $url \| funzip
         ;;
         *)
         fail "Unknown archive format: $url"
         ;;
     esac
     if [[ ! -d $srcdir/$pkgvers ]]; then
         fail "Extraction of download from $url failed"
     fi
     runcmd -c $srcdir ln -sf $pkgvers $pkg
    }

    if $VERBOSE; then
     printf "Using system compiler: '%s'" $(which gcc)
     gcc --version
    fi

    out "Making directories \n$DSTROOT\n$PKGROOT\n$SRCDIR\n$BUILDDIR"

    runcmd mkdir -p $DSTROOT $PKGROOT $SRCDIR $BUILDDIR

    GCC_PKG=${${GCC_URL##*/}%.(tar*|zip)}
    GCC_SRC=$SRCDIR/$GCC_PKG
    GCC_PREFIX=$PKGROOT/$GCC_PKG
    GCC_BUILD=$BUILDDIR/$GCC_PKG-build

    if [[ -d $GCC_SRC ]]; then
     out "Using GCC downloaded at $GCC_SRC"
    else
     out "Downloading GCC"
     prepare_pkg $SRCDIR $GCC_URL
    fi

    out "Downloading prerequisites"
    for pkg ($GCC_PREREQUISITE_URLS); do
     prepare_pkg $GCC_SRC $pkg
    done

    if [[ -d $GCC_BUILD ]]; then
     out "Running 'make distclean' in $GCC_BUILD"
     runcmd -c $GCC_BUILD -f make distclean
    else
     out "Making GCC build directory $GCC_BUILD"
     runcmd mkdir -p $GCC_BUILD
    fi

    out "Configuring GCC"
    runcmd -c $GCC_BUILD $GCC_SRC/configure --prefix=$GCC_PREFIX \
    --enable-languages=c,c++,fortran \
    --enable-threads=posix \
    --enable-tls \
    --enable-libgomp \
    --enable-lto \
    --enable-shared \
    --enable-static \
    --disable-nls \
    --disable-multilib \
    --with-fpmath=sse

    out "Compiling GCC"
    runcmd -c $GCC_BUILD make -j 8 all

    out "Installing GCC"
    runcmd -c $GCC_BUILD make -j 8 install

    if which stow &>/dev/null; then
     out "Using 'stow' to symlink GCC from $GCC_PKG"
     runcmd -c $PKGROOT stow $GCC_PKG
    else
     out "Package manager 'stow' not found. GCC is installed in $GCC_PREFIX"
    fi

    print "All done"
0

RHEL6

root@ibxsv-asnis1 ~]# rpm -q --provides libstdc++
libstdc++ = 4.4.4-15.el6
libstdc++.so.6()(64bit)
libstdc++.so.6(CXXABI_1.3)(64bit)
libstdc++.so.6(CXXABI_1.3.1)(64bit)
libstdc++.so.6(CXXABI_1.3.2)(64bit)
libstdc++.so.6(CXXABI_1.3.3)(64bit)
libstdc++.so.6(GLIBCXX_3.4)(64bit)
libstdc++.so.6(GLIBCXX_3.4.1)(64bit)
libstdc++.so.6(GLIBCXX_3.4.10)(64bit)
libstdc++.so.6(GLIBCXX_3.4.11)(64bit)
libstdc++.so.6(GLIBCXX_3.4.12)(64bit)
libstdc++.so.6(GLIBCXX_3.4.13)(64bit)
libstdc++.so.6(GLIBCXX_3.4.2)(64bit)
libstdc++.so.6(GLIBCXX_3.4.3)(64bit)
libstdc++.so.6(GLIBCXX_3.4.4)(64bit)
libstdc++.so.6(GLIBCXX_3.4.5)(64bit)
libstdc++.so.6(GLIBCXX_3.4.6)(64bit)
libstdc++.so.6(GLIBCXX_3.4.7)(64bit)
libstdc++.so.6(GLIBCXX_3.4.8)(64bit)
libstdc++.so.6(GLIBCXX_3.4.9)(64bit)
libstdc++ = 4.4.7-4.el6
libstdc++(x86-64) = 4.4.7-4.el6
[root@ibxsv-asnis1 ~]# rpm -q libstdc++
libstdc++-4.4.7-4.el6.x86_64
-1

When you install g++ with yum, itself solves dependecies problems.

So try:

yum search g++

then find out pacjage of g++, When you wan to install it, itslef install its depenecies.One of its depency is libstdc++

1
  • Thanks for your response. Please see my question for update. I need to install latest version of g++ on rhn 5. no luck so far – Raza Sep 22 '14 at 5:29

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.