How to install gcc-4.X on Mac OSX 10.7.X
1. Uninstall MacPort
$> sudo port -fp uninstall installed --https://guide.macports.org/chunked/installing.macports.uninstalling.html This is needed to install some package with Brew - Qt for example. Otherwise you will get this error :
==> make 1 error generated. make[1]: *** [sipQtCoreQAbstractFileEngine.o] Error 1 1 error generated. make[1]: *** [sipQtCorecmodule.o] Error 1 make: *** [sub-QtCore-make_default-ordered] Error 2 Warning: It appears you have MacPorts or Fink installed. Software installed with other package managers causes known problems for Homebrew. If a formula fails to build, uninstall MacPorts/Fink and try again.
2. Install homebrew 3. Install GCC4.8
brew tap homebrew/versions
brew install [flags] gcc48
You can view available install flags by using
brew options gcc48
http://afni.nimh.nih.gov/pub/dist/HOWTO/howto/ht00_inst/html/mac_10.78_uber.html Switch gcc version to gcc-4.8 cd /usr/bin rm cc gcc c++ g++ ln -s gcc-4.8 cc ln -s gcc-4.8 gcc ln -s c++-4.8 c++ ln -s g++-4.8 g++ Revert back gcc to llvm-gcc
sudo rm cc gcc c++ g++
sudo ln -s lvm-gcc-4.2 cc
sudo ln -s lvm-cc-4.2 gcc
sudo ln -s lvm-c++-4.2 c++
sudo ln -s lvm-g++-4.2 g++
fatal error: stdlib.h: No such file or directory
Note, XCode and Command-line Tools are to be downloaded here https://developer.apple.com/downloads/index.action?q=xcode
Upgrade nasm :
$> brew install nasm
$> cd /usr/bin
$> sudo mv nasm nasm.old
$> sudo ln -s /usr/local/Cellar/nasm/2.11.06/bin/nasm nasm
Recent Comments