162
votes

I'm doing a clean install of Mavericks, and accidentally did

brew install gcc

which is taking over half an hour, maybe more. Should I terminate it? I know now that I should have installed a specific gcc (maybe gcc48) but it's too late and my macbook air is breathing hard.

Currently done downloading all 5 dependencies, but stuck on the "Installing gcc" part. It's downloaded a gcc-4.9.1.tar.bz2, configured and built it, and is stuck on making the bootstrap.

Any advice is appreciated.

This was good advice I saw too late: https://apple.stackexchange.com/questions/38222/how-do-i-install-gcc-via-homebrew

Asked here first: https://superuser.com/questions/788256/brew-install-gcc-mac-os-10-9-mavericks

3
It takes a while to build (I think it took about 45min for me the first time). You can safely cancel if you want. It's entirely up to you. - Alexander O'Mara
Homebrew is specifically designed to do everything safely: it builds things in a temporary location, touching nothing outside that location, then installs them into an isolated Cellar, again touching nothing outside of that Cellar, and only then, if everything has worked, does it add links into /usr/local/*. - abarnert
Do you actually want gcc 4.9 for something? If you want to play with new C++14 features that clang doesn't support, or need to compile code that doesn't work with anything but gcc 4.6+, or just want to learn more about gcc, sure, definitely install it. If not, why waste time and disk space? - abarnert
Can confirm installation took 38 mins on late-2013 MacbookProR with cpu upgrade. Installation is very CPU heavy (4 cores at 100%). - sjmurphy
brew install gcc --without-multilib built in 49 minutes 50 seconds on Mac for me. - Cokes

3 Answers

195
votes

You do need gcc installed to get gfortran, and you do need a fortran compiler for scipy. Homebrew will install a "bottled" (i.e., precompiled) version of the gcc package, which is very fast, if you have the Xcode Command Line Tools installed. These are separate from XCode proper. You can install them with xcode-select --install.

There is no particular need to install a particular version of gcc (and I think those may not be bottled, so they will be equally slow).

In general, interrupting Homebrew with Ctrl+C is safe and Homebrew will automatically recover.

You may be interested in the homebrew-python tap.

8
votes

Try this to force the bottle (pre-compiled) installation

brew install gcc --force-bottle
0
votes

patience a one-word answer... Launch this thing overnight, or budget the time.
Just ran an update on 10.20_4 for a ... 322 minutes wait. That's about 5.5 hours.

Oh, and disk space on your system partition needs > 10GB free.

๐Ÿบ  /usr/local/Cellar/gcc/10.2.0_4: 1,467 files, 331.8MB, built in 130 minutes 33 seconds
๐Ÿบ  /usr/local/Cellar/openblas/0.3.15: 23 files, 120.3MB, built in 19 minutes 28 seconds
๐Ÿบ  /usr/local/Cellar/hdf5/1.12.0_3: 268 files, 16.4MB, built in 5 minutes 5 seconds
๐Ÿบ  /usr/local/Cellar/netcdf/4.8.0: 95 files, 6.5MB, built in 5 minutes 54 seconds
๐Ÿบ  /usr/local/Cellar/cython/0.29.23: 440 files, 8.9MB, built in 1 minute 2 seconds
๐Ÿบ  /usr/local/Cellar/numpy/1.20.2: 1,005 files, 24.3MB, built in 2 minutes 15 seconds
๐Ÿบ  /usr/local/Cellar/doxygen/1.9.1: 9 files, 15.5MB, built in 1 minute 54 seconds
๐Ÿบ  /usr/local/Cellar/little-cms2/2.12: 21 files, 1MB, built in 27 seconds
๐Ÿบ  /usr/local/Cellar/openjpeg/2.4.0: 522 files, 13.1MB, built in 25 seconds
๐Ÿบ  /usr/local/Cellar/nspr/4.30: 86 files, 1.1MB, built in 24 seconds
๐Ÿบ  /usr/local/Cellar/nss/3.64: 224 files, 42.4MB, built in 16 minutes 14 seconds
๐Ÿบ  /usr/local/Cellar/qt@5/5.15.2: 10,384 files, 190.2MB, built in 64 minutes 4 seconds
๐Ÿบ  /usr/local/Cellar/poppler/21.05.0: 476 files, 26MB, built in 3 minutes 55 seconds
๐Ÿบ  /usr/local/Cellar/unixodbc/2.3.9_1: 44 files, 1.9MB, built in 1 minute 16 seconds
๐Ÿบ  /usr/local/Cellar/webp/1.2.0: 39 files, 2.2MB, built in 41 seconds
๐Ÿบ  /usr/local/Cellar/zstd/1.4.9_1: 31 files, 2.6MB, built in 31 seconds
๐Ÿบ  /usr/local/Cellar/gdal/3.2.2_4: 329 files, 59.7MB, built in 17 minutes 26 seconds