ROOT on OS X 10.11 El Capitan
Published onThis post has been archived. It's pretty old and likely concerns topics that are avoidable by using more modern tools and techniques. The original text is preserved below for posterity but it may no longer be relevant or correct.
Note: the original post is below for posterity, but installing ROOT has been much simpler for a while now, whether you’re on El Capitan or beyond.
There are only two steps:
- Install Homebrew.
- Run this command:
$ brew install root
Boom. Just take care to read the information printed at the end. You can review it later if you missed it:
$ brew info root
==> Caveats
Because ROOT depends on several installation-dependent
environment variables to function properly, you should
add the following commands to your shell initialization
script (.bashrc/.profile/etc.), or call them directly
before using ROOT.
For bash users:
. /usr/local/bin/thisroot.sh
For zsh users:
pushd /usr/local >/dev/null; . bin/thisroot.sh; popd >/dev/null
For csh/tcsh users:
source /usr/local/bin/thisroot.csh
For fish users:
. /usr/local/bin/thisroot.fish
I recommend installing ROOT via Anaconda as an alternative, which often integrates more nicely in to the reproducible analysis paradigm.
Original post
I’ve written some lengthy guides on installing ROOT, firstly for OS X 10.8 Mountain Lion and then for OS X 10.9 Mavericks.
They were long because the install process with CMake could be convoluted, requiring several dependencies that are occasionally non-obvious. These days, though, things are extremely simple.
Homebrew
Homebrew is a software management program for OS X. A large group of volunteers maintains a set of so-called formula, recipes that tell your Mac how to build pieces of software.
If you don’t already have Homebrew installed, I highly recommend it. It makes it extremely easy to install software and to keep it up-to-date. To install CMake, for example, you would do:
$ brew install cmake
In addition to the standard repository of formula, which includes formula for programs like CMake and git, there’s a repository dedicated to programs used for science, called Homebrew Science. This repository contains formula for ROOT 5 and ROOT 6.
Installation
By default, brew
only knows about the standard repository of formula, so
first add the Homebrew Science collection.
$ brew tap homebrew/science
Now we can install ROOT. We’ll go with ROOT 6 here, the latest version.
$ brew install root6
That was easy!
You’ll notice that Homebrew gives you some instructions after you’ve run the installation. You can look at these instructions whenever you like.
$ brew info root6
This tells you to add a line to your shell configuration.
For the Bash shell, you can add these lines to the .bashrc
file in your home directory:
. $(brew --prefix root6)/libexec/thisroot.sh
Open a new shell and try it out by running root
.