RedHat 7.3 /lib64/ version `GLIBC_2.18' not found using brew gcc@7

Hi all,
I was looking for some advice on any workarounds for the error "/lib64/ version `GLIBC_2.18’ " which I get when I’m trying to compile something with gcc@7 installed by brew on an academic computing cluster running RedHat 7.3. I’m trying to compile some code where I use several libraries installed by brew which is why I’m not just using the system’s compiler or compilers I could module load. I’m using the newest brew update and upgrade. Some additional information:

ldd -v  /gpfs_home/nhathawa/.linuxbrew/Cellar/gcc@7/7.5.0_2/lib/gcc/7/


/gpfs_home/nhathawa/.linuxbrew/Cellar/gcc@7/7.5.0_2/lib/gcc/7/ /lib64/ version `GLIBC_2.18' not found (required by /gpfs_home/nhathawa/.linuxbrew/Cellar/gcc@7/7.5.0_2/lib/gcc/7/ =>  (0x00007ffdd7bf8000) => /lib64/ (0x00007fd7f0ad0000) => /lib64/ (0x00007fd7f070f000)
	/lib64/ (0x00007fd7f119e000) => /gpfs_home/nhathawa/.linuxbrew/lib/ (0x00007fd7f04f8000)

	Version information:
	/gpfs_home/nhathawa/.linuxbrew/Cellar/gcc@7/7.5.0_2/lib/gcc/7/ (GLIBC_2.2.5) => /lib64/ (GLIBC_2.3) => /lib64/ (GCC_4.2.0) => /gpfs_home/nhathawa/.linuxbrew/lib/ (GCC_3.3) => /gpfs_home/nhathawa/.linuxbrew/lib/ (GCC_3.0) => /gpfs_home/nhathawa/.linuxbrew/lib/ (GLIBC_2.14) => /lib64/ (GLIBC_2.18) => not found (GLIBC_2.16) => /lib64/ (GLIBC_2.3) => /lib64/ (GLIBC_2.17) => /lib64/ (GLIBC_2.3.2) => /lib64/ (GLIBC_2.2.5) => /lib64/
	/lib64/ (GLIBC_PRIVATE) => /lib64/ (GLIBC_2.14) => /lib64/ (GLIBC_PRIVATE) => /lib64/ (GLIBC_2.2.5) => /lib64/
	/lib64/ (GLIBC_2.3) => /lib64/ (GLIBC_PRIVATE) => /lib64/
	/gpfs_home/nhathawa/.linuxbrew/lib/ (GLIBC_2.14) => /lib64/ (GLIBC_2.2.5) => /lib64/

And some system info

lsb_release -a
LSB Version:	:core-4.1-amd64:core-4.1-noarch
Distributor ID:	RedHatEnterpriseServer
Description:	Red Hat Enterprise Linux Server release 7.3 (Maipo)
Release:	7.3
Codename:	Maipo
uname -r 

I’m not a hundred percent sure what’s happening as I’m Linux knowledge is limited but it seems like both older and newer versions of GLIBC can be found, it’s just 2.18 that can’t be. I don’t know much about the server as the institution manages it and the IT team is not very responsive. Currently, I just use a singularity image to run code but it’s annoying if I need to make small changes. Any advice would be greatly appreciated.


Read through “semantic versioning” lenses, GLIBC_2.18 is the latest glibc version symbol in your ldd output, which makes sense. If there actually were newer symbols that were satisfied, something would be Very Wrong with your system.

This is similar to the situation in this StackOverflow question, and your next step is similar: Either upgrade your OS, or rebuild gcc@7 from source.

Hi, Nick. What’s the output of brew config? I believe RedHat 7 provides glibc 2.17. Homebrew should have installed the brewed version of glibc 2.23 on your system. If you’re not too invested in this installation of Homebrew, try uninstalling it with rm -r ~/.linuxbrew and reinstalling it. Then run brew install gcc and brew install gcc@7. You should see glibc is one of the first dependencies installed before gcc.