Original posted on 2017-01-08
Updated posted on 2017-07-12
A few months ago I needed to use stock Python. One way to achieve that, and not to use OS X provided version, is to install it using Homebrew. Why I needed that? Python packages installed via
pip were not recognised.
In recent weeks I needed to compile R packages using linear algebra libraries. Here I’m also explaining how to set up
lapack to use them with R.
Why should you do this?
With a single
brew upgrade you can save yourself a headache and valuable time when you need newer software versions.
What do you need to do this?
You’ll need Homebrew and XCode installed. How to do that? check these links
Its possible to install just Command Line Tools for XCode from Apple Developers instead of full XCode.
Hands to the work
To install R, GNU tools and updated tools via Homebrew run this script:
This is based on Xudev’s script and here I’m adding linear algebra libraries, adding R installation, updating deprecated parameters such as
tap and doing post-install additional configurations.
The script does many post-installation steps but be sure to check
brew messages after install.
For example, when I install
make I have this output:
==> Pouring make-4.2.1_1.el_capitan.bottle.tar.gz ==> Using the sandbox ==> Caveats All commands have been installed with the prefix 'g'. If you do not want the prefix, install using the "with-default-names" option. If you need to use these commands with their normal names, you can add a "gnubin" directory to your PATH from your bashrc like: PATH="/usr/local/opt/make/libexec/gnubin:$PATH" Additionally, you can access their man pages with normal names if you add the "gnuman" directory to your MANPATH from your bashrc as well: MANPATH="/usr/local/opt/make/libexec/gnuman:$MANPATH" ==> Summary ? /usr/local/Cellar/make/4.2.1_1: 15 files, 960.0KB
What is suggested above is in the script. But, if your
brew install is totally fresh probably a few more utilities need to edit user
PATH and the command line will return a proper message.
Consider that gdb won’t work out-of-the-box. Don’t forget to follow this post-installation tutorial by Steven Burns to get
Finally, to enable
rJava probably you’ll need to try and verify if you need another command to enable it. The script has three different possibilities depending on your Java version.