Original posted on 2017-01-08Updated posted on 2017-07-12
Introduction
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 openblas and 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
Install Homebrew
Install XCode
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.
Post-installation
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 &quot;with-default-names&quot; option.
If you need to use these commands with their normal names, you
can add a &quot;gnubin&quot; directory to your PATH from your bashrc like:
PATH=&quot;/usr/local/opt/make/libexec/gnubin:$PATH&quot;
Additionally, you can access their man pages with normal names if you add
the &quot;gnuman&quot; directory to your MANPATH from your bashrc as well:
MANPATH=&quot;/usr/local/opt/make/libexec/gnuman:$MANPATH&quot;
==__ 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 gdb working.
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.