These are a list of instructions for setting up a basic computing environment for a Macbook Pro.
These instructions are written for OS X Big Sur 11.2.3 with a zsh shell.
To install basic the basic Command Line Tools package, run:
$xcode-select --install
Next, let's install Homebrew. Homebrew is an open-source package management system that simplifies the installation of software on macOS (and Linux):
$/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
There are many important packages that should be installed:
$brew install cmake expat xerces-c zlib openssl gdbm jpeg readline zlib ghostscript libtiff sqlite xz wget python
$brew install --cask xquartz
In your .zshrc, add:
alias python=/usr/local/bin/python3
If you try to run the above with /bin/zsh you get "Bash is required to interpret this script."
Next, we will install Anaconda, a distribution of Python for scientific computing that simplifies package management and deployment.
I find it easiest to do the graphical installation. Go to https://www.anaconda.com/products/individual#Downloads
and download the 64-Bit Graphical Installer for MacOS. Open the packages and follow the instructions, they are pretty straightforward.
With Anaconda installed you can now open a Jupyter Notebook. To do this, run:
Jupyter Notebook [file]
Next, let's install ROOT. First, comment out the conda section in .zshrc (only necessary during the ROOT install).
We will download the source code and select the version we want:
cd /Applications/
mkdir root6-source && cd root6-source
git clone http://root.cern.ch/git/root.git
cd root
git checkout v6-22-00-patches
Next, create the build directory:
cd /Applications/
mkdir root6-build && cd root6-build
To compile the source code, run:
$cmake -DCMAKE_INSTALL_PREFIX=/Applications/root6-install -DPYTHON_EXECUTABLE=/opt/homebrew/opt/python@3.9/bin/python3.9 -Dimt=OFF -Dbuiltin_tbb=OFF /Applications/root6-source/root
$make -j8 && make install