Linuxbrew-core: glibc: Requires GCC 4.7 or later

Created on 31 Aug 2017  Â·  33Comments  Â·  Source: Homebrew/linuxbrew-core

Is it currently supported to install glibc on rather old systems without root access?

I am working with an old Linux (SLC 6.8 where gcc verson is 4.4.7 and glibc is 2.12) without root privileges (so I can't use the glibc bottle with /home/linuxbrew/.linuxbrew/). I tried for a fresh installation of Linuxbrew by the official installation script, which created ~/.linuxbrew. Then brew install hello failed due to a problem in building glibc. The error message said that the compiler is too old:

==> Installing hello dependency: glibc
==> Downloading https://ftp.gnu.org/gnu/glibc/glibc-2.23.tar.gz
Already downloaded: /localstore/theorie/tueda/build/linuxbrew/Cache/glibc-2.23.tar.gz
==> ../configure --disable-debug --disable-dependency-tracking --disable-silent-rules --prefix=/user/tueda/.linuxbrew/Cellar/glibc/2.23 --enable-obsolete-rpc --without-selinux --with-binutils=/user/tueda/.linuxbrew/opt/binutils/bin --with-headers=/user/tueda/.linuxbrew/opt/linux-headers/include
Last 15 lines from /localstore/theorie/tueda/build/linuxbrew/Logs/glibc/01.configure:
checking version of gmake... 3.81, ok
checking for gnumsgfmt... no
checking for gmsgfmt... no
checking for msgfmt... msgfmt
checking version of msgfmt... 0.17, ok
checking for makeinfo... no
checking for sed... sed
checking version of sed... 4.2.1, ok
checking for gawk... gawk
checking version of gawk... 3.1.7, ok
checking if gcc-4.4 -B/user/tueda/.linuxbrew/opt/binutils/bin/ is sufficient to build libc... no
checking for nm... nm
configure: error: 
*** These critical programs are missing or too old: compiler
*** Check the INSTALL file for required versions.

READ THIS: https://github.com/Linuxbrew/brew/blob/master/docs/Troubleshooting.md#troubleshooting
Please do not report this issue to Homebrew/brew or Homebrew/core, which support macOS only.

These open issues may also help:
glibc install failed because etc/ld.so.conf not found https://github.com/Linuxbrew/homebrew-core/issues/3361

Actually, in config.log I found that the configure script checks if gcc >= 4.7:

configure:4820: checking if gcc-4.4 -B/user/tueda/.linuxbrew/opt/binutils/bin/ is sufficient to build libc
configure:4840: gcc-4.4 -B/user/tueda/.linuxbrew/opt/binutils/bin/ -c -g -O2  conftest.c >&5
conftest.c:20:2: error: #error insufficient compiler
configure:4840: $? = 1
configure: failed program was:
| /* confdefs.h */
| #define PACKAGE_NAME "GNU C Library"
| #define PACKAGE_TARNAME "glibc"
| #define PACKAGE_VERSION "(see version.h)"
| #define PACKAGE_STRING "GNU C Library (see version.h)"
| #define PACKAGE_BUGREPORT "http://sourceware.org/bugzilla/"
| #define PACKAGE_URL "http://www.gnu.org/software/glibc/"
| #define PKGVERSION "(GNU libc) "
| #define REPORT_BUGS_TO "<http://www.gnu.org/software/libc/bugs.html>"
| #define LINK_OBSOLETE_RPC 1
| #define HAVE_LIBIDN 1
| #define USE_MULTIARCH 1
| /* end confdefs.h.  */
| 
| int
| main ()
| {
| 
| #if !defined __GNUC__ || __GNUC__ < 4 || (__GNUC__ == 4 && __GNUC_MINOR__ < 7)
| #error insufficient compiler
| #endif
|   ;
|   return 0;
| }
configure:4847: result: no

The check seems to be introduced (firstly for gcc 4.6) by https://sourceware.org/ml/libc-alpha/2014-11/msg00322.html.

It was working when Linuxbrew version of glibc was 2.19. Today I tried for updating a formula, which triggered to upgrade glibc, messing up the system and that's why I'm trying for a fresh installation.

As background: I would like to have rather new gcc for C++11/14 features and rather new glibc for Tensorflow.

Please note we will close your issue without comment if you delete, do not read or do not fill out the issue checklist below and provide ALL the requested information. If you repeatedly fail to use the issue template, we will block you from ever submitting issues to Homebrew again.

Please always follow these steps:

  • [x] Confirmed this is a problem with brew installing one, specific formula and not every time you run brew? If it's a general brew problem please file this issue at https://github.com/Linuxbrew/brew/issues/new.
  • [ ] If you have a macOS system and can replicate the problem on macOS with Homebrew, please report the issue to Homebrew/core and follow their issue template from your macOS system. If you are unsure, please report the issue to Linuxbrew.
    -- I don't have macOS systems and presumably it is not reproducible on macOS.
  • [x] Ran brew update and retried your prior step?
  • [ ] Ran brew doctor, fixed all issues and retried your prior step?
    -- It says that git on the system is old, but brew install git fails due to the same problem of glibc. I believe the git version is not related to the issue.
  • [x] Ran brew gist-logs <formula> (where <formula> is the name of the formula that failed) and included the output link?
    -- The log is: https://gist.github.com/anonymous/b896bc1a3c65a7f5cee9f3f84fb8dec8
  • [ ] If brew gist-logs didn't work: ran brew config and brew doctor and included their output with your issue?

To help us debug your issue please explain:

  • What you were trying to do (and why)
  • What happened (include command output)
  • What you expected to happen
  • Step-by-step reproduction instructions (by running brew install commands)

Formula additions or changes

To get formulae added or changed in Linuxbrew please file a Pull Request.
To get formulae added or changed that is a dependency of a formula in Linuxbrew/homebrew-core submit a Pull Request to https://github.com/Linuxbrew/homebrew-core/compare
To get formulae added or changed that is not a dependency of a formula in Linuxbrew/homebrew-core submit a Pull Request to https://github.com/Linuxbrew/homebrew-extra/compare
We will close issues requesting formulae changes.

bug outdated

Most helpful comment

OK. I found a way to circumvent the build error: installing glibc 2.20 -> gcc 5.3 -> glibc 2.23:

brew install --only-dependencies glibc
brew install --ignore-dependencies https://raw.githubusercontent.com/Linuxbrew/homebrew-core/6fb5dfd50895416bea3d00628b8d3b41fa1f4f32/Formula/glibc.rb  # 2.20
brew install --ignore-dependencies xz gmp mpfr libmpc isl gcc
brew upgrade glibc

where only glibc is installed from the source and the others are installed from the bottles.

Though it would be very nice if Linuxbrew can handle these tricky building steps, if there is no way to improve it, maybe you can close this issue.

All 33 comments

Forgotten to mention: I succeeded to install a bit older glibc as

brew install --ignore-dependencies https://raw.githubusercontent.com/Linuxbrew/homebrew-core/6fb5dfd50895416bea3d00628b8d3b41fa1f4f32/Formula/glibc.rb  # glibc 2.20

But then brew install <other formula> easily triggers upgrading glibc to 2.23, giving a failure. Maybe I could always put --ignore-dependencies and manually resolve all dependencies, but this is annoying.

OK. I found a way to circumvent the build error: installing glibc 2.20 -> gcc 5.3 -> glibc 2.23:

brew install --only-dependencies glibc
brew install --ignore-dependencies https://raw.githubusercontent.com/Linuxbrew/homebrew-core/6fb5dfd50895416bea3d00628b8d3b41fa1f4f32/Formula/glibc.rb  # 2.20
brew install --ignore-dependencies xz gmp mpfr libmpc isl gcc
brew upgrade glibc

where only glibc is installed from the source and the others are installed from the bottles.

Though it would be very nice if Linuxbrew can handle these tricky building steps, if there is no way to improve it, maybe you can close this issue.

Consider installing Linuxbrew in /home/linuxbrew/.linuxbrew/ if possible so that you can use precompiled binary packages (known as bottles) for non-relocatable formula like glibc.
Another possible workaround for you is brew install --force-bottle glibc, but no promises that will work. I haven't tried it myself.

The precompiled binary bottles of non-relocatable bottles can only be used if you install in /home/linuxbrew/.linuxbrew, otherwise they have to be built from source. See the documentation below, but wherever it reads /usr/local, which is for macOS, read instead /home/linuxbrew/.linuxbrew.

If it's an option for you, you could open a ticket with your systems department to ask that they create a linuxbrew role account with home directory /home/linuxbrew for the purpose of sharing software that is used by your group.

Thanks for the detailed bug report, Takahiro! Yes, we would like to support installing Linuxbrew on older systems that have only GCC 4.4. If you install to /home/linuxbrew/.linuxbrew that works. Installing in your home directory evidently does not currently work.

The following somewhat simpler installation instructions may work for you:

brew install binutils
HOMEBREW_BUILD_FROM_SOURCE=1 brew install gcc
brew install glibc

If you can confirm that works, I'll see if I can make that the default behaviour for older systems with GCC < 4.7.

I've also hit his issue while trying to make some old RHEL 6.5 systems functional, where I don't have root access. I'm confirming that out of everything listed here so far, the only option that works is the workaround by @tueda of installing glibc 2.20 first and then upgrading.

The bottled version of glibc fails to pour in a user homedir install - as expected, it gives relocation errors.

Thanks for the suggestions. It turned out that my solution in the above doesn't save my old system: brew test gcc fails as

Testing gcc
==> /user/tueda/.linuxbrew/Cellar/gcc/5.3.0/bin/gcc-5 -o hello-c hello-c.c
==> /user/tueda/.linuxbrew/Cellar/gcc/5.3.0/bin/g++-5 -o hello-cc hello-cc.cc
Last 15 lines from /localstore/theorie/tueda/build/linuxbrew/Logs/gcc/test.02.g++-5:
2017-09-02 11:51:24 +0200

/user/tueda/.linuxbrew/Cellar/gcc/5.3.0/bin/g++-5
-o
hello-cc
hello-cc.cc

/user/tueda/.linuxbrew/Cellar/gcc/5.3.0/bin/../lib/gcc/x86_64-unknown-linux-gnu/5.3.0/../../../../lib64/libstdc++.so: undefined reference to `__cxa_thread_atexit_impl@GLIBC_2.18'
/user/tueda/.linuxbrew/Cellar/gcc/5.3.0/bin/../lib/gcc/x86_64-unknown-linux-gnu/5.3.0/../../../../lib64/libstdc++.so: undefined reference to `clock_gettime@GLIBC_2.17'
collect2: error: ld returned 1 exit status

I'm not sure what is the problem there. For now, what I'm using is building glibc 2.20 and making Linuxbrew think it as the latest one:

brew install --only-dependencies glibc
brew install --ignore-dependencies https://raw.githubusercontent.com/Linuxbrew/homebrew-core/6fb5dfd50895416bea3d00628b8d3b41fa1f4f32/Formula/glibc.rb  # glibc 2.20
(cd `brew --prefix`/Cellar/glibc && ln -s 2.20 2.23)
brew switch glibc 2.23
brew install gcc

With this hack brew test gcc passes and up to now no problem for installing other programs.

Anyway I will try for the other suggested ways, though as @lblaine mentioned the bottled version of glibc wouldn't work.

What problem do you run into with this path?

brew install binutils
HOMEBREW_BUILD_FROM_SOURCE=1 brew install gcc
brew install glibc

Next week when I'm back at work I'll give this a shot myself.

brew install binutils
HOMEBREW_BUILD_FROM_SOURCE=1 brew install gcc  # failed

This triggers building glibc and fails. To avoid this, I tried

brew install --ignore-dependencies xz gmp mpfr libmpc isl
HOMEBREW_BUILD_FROM_SOURCE=1 brew install --ignore-dependencies gcc  # failed

which failed with some strange error:

/tmp/gcc-20170902-17764-pla8d2/gcc-5.3.0/build/./gcc/xgcc -B/tmp/gcc-20170902-17764-pla8d2/gcc-5.3.0/build/./gcc/ -B/user/tueda/.linuxbrew/Cellar/gcc/5.3.0/x86_64-unknown-linux-gnu/bin/ -B/user/tueda/.linuxbrew/Cellar/gcc/5.3.0/x86_64-unknown-linux-gnu/lib/ -isystem /user/tueda/.linuxbrew/Cellar/gcc/5.3.0/x86_64-unknown-linux-gnu/include -isystem /user/tueda/.linuxbrew/Cellar/gcc/5.3.0/x86_64-unknown-linux-gnu/sys-include    -g -O2 -O2  -g -O2 -DIN_GCC    -W -Wall -Wwrite-strings -Wcast-qual -Wno-format -Wstrict-prototypes -Wmissing-prototypes -Wold-style-definition  -isystem ./include   -fpic -mlong-double-80 -g -DIN_LIBGCC2 -fbuilding-libgcc -fno-stack-protector   -fpic -mlong-double-80 -I. -I. -I../.././gcc -I../../../libgcc -I../../../libgcc/. -I../../../libgcc/../gcc -I../../../libgcc/../include  -DHAVE_CC_TLS  -DUSE_TLS -o _lshrdi3.o -MT _lshrdi3.o -MD -MP -MF _lshrdi3.dep -DL_lshrdi3 -c ../../../libgcc/libgcc2.c -fvisibility=hidden -DHIDE_EXPORTS
In file included from ../../../libgcc/libgcc2.c:27:0:
../../../libgcc/../gcc/tsystem.h:87:19: fatal error: stdio.h: No such file or directory

The complete log is: https://gist.github.com/b9581e9254fca41f391e9115ea53d728

The other option brew install --force-bottle glibc caused

==> Pouring glibc-2.23.x86_64_linux.bottle.tar.gz
Error: Failure while executing: /user/tueda/.linuxbrew/Cellar/glibc/2.23/bin/ldd /user/tueda/.linuxbrew/Cellar/glibc/2.23/bin/gencat
/user/tueda/.linuxbrew/Cellar/glibc/2.23/bin/ldd: /user/tueda/.linuxbrew/Cellar/glibc/2.23/bin/gencat: /home/linuxbrew/.linuxbrew/Cellar/glibc/2.23/lib/ld-linux-x86-64.so.2: bad ELF interpreter: No such file or directory

then switched to building glibc and failed.

Try…

brew install binutils
HOMEBREW_BUILD_FROM_SOURCE=1 brew install gcc --without-glibc
brew install glibc
HOMEBREW_BUILD_FROM_SOURCE=1 brew install gcc --without-glibc
produces:
checking for uintptr_t... yes
checking for int64_t underlying type... long long
configure: error: error verifying int64_t uses long long
make[2]: *** [configure-stage1-gcc] Error 1
make[2]: Leaving directory `/tmp/gcc-20170903-4022-snbmtw/gcc-5.3.0/build'
make[1]: *** [stage1-bubble] Error 2
make[1]: Leaving directory `/tmp/gcc-20170903-4022-snbmtw/gcc-5.3.0/build'
make: *** [bootstrap] Error 2

On my system --enable--multilib seems not to work. So I put --disable-multilib via brew edit gcc. Then

brew install binutils
HOMEBREW_BUILD_FROM_SOURCE=1 brew install gcc --without-glibc
brew test gcc

succeeded. But after brew install glibc (which also succeeded) brew test gcc failed like

Testing gcc
==> /user/tueda/.linuxbrew/Cellar/gcc/5.3.0/bin/gcc-5 -o hello-c hello-c.c
Last 15 lines from /localstore/theorie/tueda/build/linuxbrew/Logs/gcc/test.01.gcc-5:
2017-09-04 20:25:55 +0200

/user/tueda/.linuxbrew/Cellar/gcc/5.3.0/bin/gcc-5
-o
hello-c
hello-c.c

Error: gcc: failed
Failed executing: /user/tueda/.linuxbrew/Cellar/gcc/5.3.0/bin/gcc-5 -o hello-c hello-c.c
/user/tueda/.linuxbrew/Homebrew/Library/Homebrew/formula.rb:1804:in `block in system'
/user/tueda/.linuxbrew/Homebrew/Library/Homebrew/formula.rb:1742:in `open'
/user/tueda/.linuxbrew/Homebrew/Library/Homebrew/formula.rb:1742:in `system'
/user/tueda/.linuxbrew/Homebrew/Library/Taps/homebrew/homebrew-core/Formula/gcc.rb:289:in `block in <class:Gcc>'
/user/tueda/.linuxbrew/Homebrew/Library/Homebrew/formula.rb:1639:in `block (2 levels) in run_test'
/user/tueda/.linuxbrew/Homebrew/Library/Homebrew/formula.rb:834:in `with_logging'
/user/tueda/.linuxbrew/Homebrew/Library/Homebrew/formula.rb:1638:in `block in run_test'
/user/tueda/.linuxbrew/Homebrew/Library/Homebrew/extend/fileutils.rb:14:in `block in mktemp'
/user/tueda/.linuxbrew/Homebrew/Library/Homebrew/extend/fileutils.rb:74:in `block in run'
/user/tueda/.linuxbrew/Homebrew/Library/Homebrew/extend/fileutils.rb:74:in `chdir'
/user/tueda/.linuxbrew/Homebrew/Library/Homebrew/extend/fileutils.rb:74:in `run'
/user/tueda/.linuxbrew/Homebrew/Library/Homebrew/extend/fileutils.rb:13:in `mktemp'
/user/tueda/.linuxbrew/Homebrew/Library/Homebrew/formula.rb:1632:in `run_test'
/user/tueda/.linuxbrew/Homebrew/Library/Homebrew/test.rb:36:in `block in <main>'
/localstore/theorie/tueda/build/ruby-2.4.1/lib/ruby/2.4.0/timeout.rb:93:in `block in timeout'
/localstore/theorie/tueda/build/ruby-2.4.1/lib/ruby/2.4.0/timeout.rb:33:in `block in catch'
/localstore/theorie/tueda/build/ruby-2.4.1/lib/ruby/2.4.0/timeout.rb:33:in `catch'
/localstore/theorie/tueda/build/ruby-2.4.1/lib/ruby/2.4.0/timeout.rb:33:in `catch'
/localstore/theorie/tueda/build/ruby-2.4.1/lib/ruby/2.4.0/timeout.rb:108:in `timeout'
/user/tueda/.linuxbrew/Homebrew/Library/Homebrew/test.rb:35:in `<main>'

Running gcc some-test-file.c gave a segmentation fault. I guess it is simply a version mismatch of glibc...

By the way, during the installation of the dependencies, I saw a warning:

Warning: Calling build.build_32_bit? is deprecated!
There is no replacement.
/user/tueda/.linuxbrew/Homebrew/Library/Taps/homebrew/homebrew-core/Formula/mpfr.rb:30:in `install'
Please report this to the homebrew/core tap!

@lblaine Please report brew gist-logs gcc

@tueda Please report

which -a gcc-5
gcc-5 --version
patchelf --print-interpreter ~/.linuxbrew/bin/gcc-5
which -a ldd
ldd ~/.linuxbrew/bin/gcc-5
readlink ~/.linuxbrew/bin/ld.so
$ which -a gcc-5
~/.linuxbrew/bin/gcc-5
$ gcc-5 --version
Segmentation fault (core dumped)
$ patchelf --print-interpreter ~/.linuxbrew/bin/gcc-5
/lib64/ld-linux-x86-64.so.2
$ which -a ldd
~/.linuxbrew/bin/ldd
/usr/bin/ldd
$ ldd ~/.linuxbrew/bin/gcc-5
        linux-vdso.so.1 =>  (0x00007ffc9b3bd000)
        libm.so.6 => /user/tueda/.linuxbrew/lib/libm.so.6 (0x00007fc200ba0000)
        libc.so.6 => /user/tueda/.linuxbrew/lib/libc.so.6 (0x00007fc200800000)
        /lib64/ld-linux-x86-64.so.2 (0x00000032e0e00000)
$ readlink ~/.linuxbrew/bin/ld.so
$ ls ~/.linuxbrew/bin/ld.so
ls: cannot access /user/tueda/.linuxbrew/bin/ld.so: No such file or directory

I had a typo above it should have been

readlink ~/.linuxbrew/lib/ld.so
$ patchelf --print-interpreter ~/.linuxbrew/bin/gcc-5
/lib64/ld-linux-x86-64.so.2

That should be ~/.linuxbrew/lib/ld.so. I'm not sure why it's wrong. Try

brew reinstall gcc
$ readlink ~/.linuxbrew/lib/ld.so
/user/tueda/.linuxbrew/Cellar/glibc/2.23/lib/ld-linux-x86-64.so.2

I tried for brew reinstall gcc, which put --without-glibc and failed: https://gist.github.com/ce0d1bf5303c649adcbd995c65cfb034.

brew reinstall gcc --with-glibc ignores --with-glibc and can't overwrite --without-glibc. Maybe I should uninstall gcc and then reinstall gcc with glibc enabled(?)

I had a similar issue and @tueda's trick of installing an older version of glibc works for me.

brew install --ignore-dependencies https://raw.githubusercontent.com/Linuxbrew/homebrew-core/6fb5dfd50895416bea3d00628b8d3b41fa1f4f32/Formula/glibc.rb

I've also come across the same problem on Centos 6 (with GCC 4.4.7)

Based on @tueda's idea to build an old version of glibc first and work from there, I found the following code works. It checks out a specific version of the glibc formula, installs gcc (with old glibc) and forces no update. Then reverts to new version of glibc and builds that. brew test gcc passes for me.

brew tap --full homebrew/homebrew-core

(cd $(brew --prefix)/Library/Taps/homebrew/homebrew-core/Formula/ && git checkout 00013f451e57320a5f5dcd91f58cb9251e4063e7 glibc.rb)
HOMEBREW_NO_AUTO_UPDATE=1 brew install gcc

(cd $(brew --prefix)/Library/Taps/homebrew/homebrew-core && git reset --hard origin/master)
brew upgrade glibc

I used @tueda's code and brew reinstall gcc. It reinstalls gcc bottle and brew test gcc passes.

Successful update of glibc from 2.12 to 2.23 following @tueda:

brew install --only-dependencies glibc
brew install --ignore-dependencies https://raw.githubusercontent.com/Linuxbrew/homebrew-core/6fb5dfd50895416bea3d00628b8d3b41fa1f4f32/Formula/glibc.rb
brew install --ignore-dependencies xz gmp mpfr libmpc isl gcc
brew upgrade glibc

After this,

$ brew upgrade glibc
Error: glibc 2.23 already installed

After this, g++ and gfortran were not finding correct glibc when compiling and linking test programs, so I did

brew uninstall gcc
brew install gcc

Now GCC 5.3.0 seems to be working correctly, and is able to build libcaf_mpi.a from OpenCoarrays 1.9.1; and at least gfortran 5.3.0 is "OpenCoarrays-Aware (OCA) compiler (GNU 5.1.0 or later)" (see src/extensions/caf-head)

$ brew upgrade make
Error: make 4.2.1_1 already installed
$ brew upgrade cmake
Error: cmake 3.9.2 already installed
$ brew upgrade mpich
Error: mpich 3.2_3 already installed

However, as @zbeekman mentions in open issue #4158, it sure would be nice to have a current GCC.

$ brew install gcc@7
Warning: gcc 5.3.0 is already installed

After this, g++ and gfortran were not finding correct glibc when compiling and linking test programs, so I did

brew postinstall gcc may also fix this issue.

But is it possible to get GCC-7?

@zbeekman Linuxbrew does not currently provide GCC 7. If GCC 5.3 and GCC 7 are ABI compatible, yes it's possible to upgrade the gcc formula to GCC 7. If they're not ABI compatible, it'll be trickier.

If you have sudo access, you can install Linuxbrew on CentOS 6 using...

sh -c "$(curl -fsSL https://raw.githubusercontent.com/Linuxbrew/install/master/install.sh)"

If you do not have sudo access, you can build gcc 5.3 from source, and use that to compile glibc.

export HOMEBREW_NO_AUTO_UPDATE=1
HOMEBREW_BUILD_FROM_SOURCE=1 brew install gcc --without-glibc
brew test gcc
brew install glibc
brew test glibc
brew remove gcc
brew install gcc
brew test gcc

Reinstalling gcc may not be strictly necessary. brew postinstall gcc may be sufficient, but I think it's probably best to install the gcc bottle once glibc is installed, to ensure that gcc is not somehow using the host's old glibc.

That's the best workaround that I have for now. Other possibilities would be to create a versioned formula [email protected]. Install [email protected] then the bottled gcc 5.3 then upgrade glibc to 2.23. The disadvantage of this path is that you have to compile GLIBC twice. The advantage is that you never have to compile GCC, which takes a while.

Another possible fix would be to create a portable-gcc formula that can run on any system (CentOS 5 or newer). See https://github.com/homebrew/homebrew-portable

If you have sudo access, you can install Linuxbrew on CentOS 6 using...

Any chance that will work for Ubuntu? Or should I just try the other approach you outlined?

If you have sudo access, you can install Linuxbrew on CentOS 6 using...

Any chance this would work on an Ubuntu system?

Another possible fix would be to create a portable-gcc formula that can run on any system (CentOS 5 or newer). See https://github.com/homebrew/homebrew-portable

Again wondering if this is a viable approach for Ubuntu systems

I've created a Wiki page with instructions to install Linuxbrew on CentOS 6 with or without sudo access. https://github.com/Linuxbrew/brew/wiki/CentOS6
@randy3k Are you able to confirm whether these instructions work for you?

Any chance that will work for Ubuntu? Or should I just try the other approach you outlined?

@zbeekman On Ubuntu, you should be able to use the standard installation instructions:

sh -c "$(curl -fsSL https://raw.githubusercontent.com/Linuxbrew/install/master/install.sh)"

I was following similar instructions you gave earlier and I worked for me. So I assume that the new instruction will also work.

I followed @tueda's advice: first install glibc 2.20 and then upgrade to 2.23. I am running a non-root REHL 6.9 (Santiago) and I was getting internal compiler error: Illegal instruction errors during brew upgrade glibc.


Details of brew upgrade glibc failing (excerpt)

make[2]: *** [/tmp/glibc-20170921-55100-dli0th/glibc-2.23/build/csu/elf-init.oS] Erreur 1
libc-tls.c: In function '__libc_setup_tls':
libc-tls.c:105:1: internal compiler error: Illegal instruction
 __libc_setup_tls (size_t tcbsize, size_t tcbalign)
 ^
../sysdeps/x86/libc-start.c: In function '__libc_start_main':
../sysdeps/x86/libc-start.c:20:0: internal compiler error: Illegal instruction
 # else
 ^
../sysdeps/x86/libc-start.c: In function 'apply_irel':
../sysdeps/x86/libc-start.c:40:1: internal compiler error: Illegal instruction
 }
 ^
0x7f23a592972f ???
    /tmp/glibc-20170921-64874-12af6ru/glibc-2.20/signal/../sysdeps/unix/sysv/linux/x86_64/sigaction.c:0
0x7f23a59167cc __libc_start_main
    /tmp/glibc-20170921-64874-12af6ru/glibc-2.20/csu/libc-start.c:289
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See  for instructions.

I spent hours to understand where this was coming from; I finally found out, after reading that https://github.com/Linuxbrew/brew/issues/488 where they were having problems with gmp.6.1.2, I just downgraded to gmp.6.1.1 and... it worked! To wrap it up, here it is:

brew install --only-dependencies glibc
brew install --ignore-dependencies https://raw.githubusercontent.com/Linuxbrew/homebrew-core/6fb5dfd50895416bea3d00628b8d3b41fa1f4f32/Formula/glibc.rb  # 2.20
brew install --ignore-dependencies https://raw.githubusercontent.com/Linuxbrew/homebrew-core/58cb0879c8b423ccf7a7cfd8641abc13da5a0753/Formula/gmp.rb # 6.1.1
brew install --ignore-dependencies xz mpfr libmpc isl gcc
brew upgrade glibc

:warning: Update :warning: My solution is wrong. After these commands, many brew install ... seems to fail a lot (e.g., brew install git) because they have undefined references to GLIBC_2.18, GLIBC_2.17, GLIBC_2.14 and others. Please follow @randy3k's link instead.

https://github.com/Linuxbrew/brew/wiki/CentOS6 may be more reliable as it is approved by @sjackman

If anyone has the time and interest to look into the gmp issue, I'd appreciate a PR to fix the issue very much. I believe that the precompiled binary bottle may be using AVX2 instructions. It should not.

@sjackman updated gmp, it should be good now.
See https://github.com/Linuxbrew/brew/issues/488#issuecomment-331316988 for instructions.

Was this page helpful?
0 / 5 - 0 ratings