Package Of GCC 12 On CentOS 7

Home » CentOS » Package Of GCC 12 On CentOS 7
CentOS 6 Comments

Is there an rpm of GCC 12 (or at least higher than 9) available to download and install, or is it a case of downloading and build from the source yourself?

Thanks.

6 thoughts on - Package Of GCC 12 On CentOS 7

  • That’s what Software Collections is for.

    https://www.softwarecollections.org/

    Specifically you need one of the devtoolset collections – it goes up to
    11 which, unsurprisingly, provides gcc-11 on CentOS 7. So:

    # yum install CentOS-release-scl
    # yum install devtoolset-11
    # scl enable devtoolset-11 bash

    and gives:

    # gcc -v Using built-in specs. COLLECT_GCC=gcc COLLECT_LTO_WRAPPER=/opt/rh/devtoolset-11/root/usr/libexec/gcc/x86_64-redhat-linux/11/lto-wrapper Target: x86_64-redhat-linux Configured with: ../configure –enable-bootstrap –enable-languages=c,c++,fortran,lto –prefix=/opt/rh/devtoolset-11/root/usr –mandir=/opt/rh/devtoolset-11/root/usr/share/man –infodir=/opt/rh/devtoolset-11/root/usr/share/info –with-bugurl=http://bugzilla.redhat.com/bugzilla –enable-shared –enable-threads=posix –enable-checking=release –enable-multilib –with-system-zlib –enable-__cxa_atexit –disable-libunwind-exceptions –enable-gnu-unique-object –enable-linker-build-id –with-gcc-major-version-only –with-linker-hash-style=gnu –with-default-libstdcxx-abi=gcc4-compatible –enable-plugin –enable-initfini-array –with-isl=/builddir/build/BUILD/gcc-11.2.1-20210728/obj-x86_64-redhat-linux/isl-install –enable-gnu-indirect-function –with-tune=generic –with-arch_32=x86-64 –build=x86_64-redhat-linux Thread model: posix Supported LTO compression algorithms: zlib gcc version 11.2.1 20210728 (Red Hat 11.2.1-1) (GCC)

    P.

  • Pete,

    As David was asking about obtaining and installing GCC 12, wouldn’t installing GCC 11, as noted above, leave him downlevel?

  • Thanks.

    I was hoping as I had to upgrade that I could go straight to twelve, but as eleven is there that will do for now. I have downloaded and installed it. A part from some minor issues with ‘multiple definitions’ of shared variables etc which gcc nine was happy with and a complaint about the libstdc++ version which I had the same issue when I update to 9 from 4
    (ie you need a newer one in your libpath) so far it has been ok.

    scl enable devtoolset-11 bash

    only seams todo this in the current shell session so I added the new path to me PATH is there a ‘better’ way?

    Thanks again.

  • Am 20.06.22 um 17:18 schrieb david allan finch:

    you could source the env file from somewhere like
    /opt/devtoolset-11/enable  in systems bash_profile

    – Thomas