Configuring a Mac OS X Computer

Brant Robertson bio photo By Brant Robertson

Usability Configuration

Undo natural scroll, set fast tract, right click.

Deactivate all iCloud.

Add ucsc google account: mail, contacts, calendars, messages.

Mission Control->Hot corners, bottom left Mission Control, upper left Desktop, uncheck group windows by applications.

Turn on magnification in the Dock.

Add Applications, Documents to the Dock.

Fix Finder sidebar.

Clear crap off dock.

Install Deja Vu Fonts

Download Deja Vu Fonts from

and then use the Font Book app to add them.

Configure Terminal

Open the Terminal program, then -> Preferences

Under “Text” tab, select Deja Vu Sans Mono 11pt.

Under “Shell” tab, select “Close the window” from the dropdown.

Under “Window” tab, click the Color & Effect under Background, then set 70% opacity, 50% blur.

Turn off the visual and audio bells.

Put a terminal link in the dock.

Set up bash

Make a ~/bin


$ cd
$ mkdir bin

Bash Profile

Create a ~/.bash_profile:

if [ -f ~/.bashrc ]; then
	source ~/.bashrc

Alias file

Create an ~/.alias file:

alias brown='ssh -Y'
alias orange='ssh -X'
alias crimson='ssh -Y brant@'


Create a hacked ~/.bashrc, setting a fancy terminal prompt, source ~/.alias includes ~/bin in your $PATH.

if [ "$PS1" ]; then
	export TERM
	export CLICOLOR
	export LSCOLORS

	PS1="\[\033[1;37m\][\t][\u@\h:\w]$\[\033[0m\] "
    # If this is an xterm set the title to user@host:dir
    case $TERM in
        PROMPT_COMMAND='echo -ne "\033]0;${USER}@${HOSTNAME}: ${PWD}\007"'

    # prompt function
    function proml {
    local BLUE="\[\033[1;34m\]"
    local RED="\[\033[1;32m\]"
    local LIGHT_RED="\[\033[0;037m\]"
    local WHITE="\[\033[1;37m\]"
    local NO_COLOUR="\[\033[0m\]"
    case $TERM in

    PS2='> '
    PS4='+ '
    #set prompt 

    source ~/.alias


Then source ~/.bashrc

Make SSH keys

$ cd
$ ssh-keygen -t rsa

Sublime Text 2


Get Sublime Text 2 at

and install the license.

Short cut

$ cd ~/bin
$ ln -s /Applications/Sublime\ Text\ sublime

Install GitHub Desktop

Get the GitHub Desktop app at

and link to your github account.

Install Xcode

Get Xcode through the Apple App Store.

Then, in a terminal

$ xcode-select --install

And follow the prompts to install Xcode.


$ gem install bundler

CD into the github io directory, and then

$ bundle install

Install pip and Pygments

Download pip from

Expand the tarball, and then

$ sudo python install

Install Pygments

$  sudo pip install Pygments

Install CMake

Go to

and get and run the binary installer.

Drag the icon to Applications.

Install the cmake symlinks to /usr/local/bin:

$ sudo "/Applications/" --install

Install clang-omp, OpenMP runtime, OpenMPI binaries


Get clang-omp:

Install it:

$  cd ~/code
$  mkdir clang-omp
$  cd clang-omp/
$  git clone
$  git clone llvm/projects/compiler-rt
$  git clone -b clang-omp llvm/tools/clang
$  cd ~/code/clang-omp/
$  mkdir build
$  cd build
$  cmake -G "Unix Makefiles" -DCMAKE_INSTALL_PREFIX:PATH=/Users/brant/code/clang-omp/ ../llvm
$  make all install

Change ~/.bashrc

Add these to .bashrc:

export PATH=/Users/brant/code/clang-omp/bin:$PATH
export C_INCLUDE_PATH=/Users/brant/code/clang-omp/include:$C_INCLUDE_PATH
export CPLUS_INCLUDE_PATH=/Users/brant/code/clang-omp/include:$CPLUS_INCLUDE_PATH
export LIBRARY_PATH=/Users/brant/code/clang-omp/lib:$LIBRARY_PATH
export DYLD_LIBRARY_PATH=/Users/brant/code/clang-omp/lib:$DYLD_LIBRARY_PATH

Source ~/.bashrc

$ source ~/.bashrc

Remove Xcode

Install the Intel OpenMP Runtime Library

Get the OpenMP runtime library code:

$  cd ~/code
$  mkdir libomp
$  cd libomp/
$  cp ~/Downloads/libomp_20150701_oss.tar .
$  tar -zxvf libomp_20150701_oss.tar 
$  mkdir build
$  cd build
$  cmake -G "Unix Makefiles" -DCMAKE_INSTALL_PREFIX:PATH=/Users/brant/code/libomp/ -DCMAKE_CXX_COMPILER=clang++ -DCMAKE_CC_COMPILER=clang ../libomp_oss
$  make all install

Revise ~/.bashrc

Revise ~/.bashrc, adjusting these lines:

export PATH=/Users/brant/code/clang-omp/bin:$PATH
export C_INCLUDE_PATH=/Users/brant/code/clang-omp/include:/Users/brant/code/libomp/include:$C_INCLUDE_PATH
export CPLUS_INCLUDE_PATH=/Users/brant/code/clang-omp/include:/Users/brant/code/libomp/include:$CPLUS_INCLUDE_PATH
export LIBRARY_PATH=/Users/brant/code/clang-omp/lib:/Users/brant/code/libomp/lib:$LIBRARY_PATH
export DYLD_LIBRARY_PATH=/Users/brant/code/clang-omp/lib:/Users/brant/code/libomp/lib:$DYLD_LIBRARY_PATH

Source ~/.bashrc

$ source ~/.bashrc

Verify clang-omp + the OpenMP runtime is working

$  cd ~/code
$  mkdir test_omp
$  cd test_omp/
$  echo "#include <omp.h>" > main.c
$  echo "#include <stdio.h>" >> main.c
$  echo "int main() {" >> main.c
$  echo "#pragma omp parallel" >> main.c
$  echo "printf(\"Hello from thread %d, nthreads %d\\n\", omp_get_thread_num(), omp_get_num_threads());" >> main.c
$  echo "}" >> main.c
$  clang -fopenmp main.c -o hello
$  ./hello

You should see something like:

$ ./hello 
Hello from thread 0, nthreads 4
Hello from thread 1, nthreads 4
Hello from thread 3, nthreads 4
Hello from thread 2, nthreads 4

Download and install OpenMPI

Download OpenMPI at:

Get the latest tarball, place in ~/code/openmpi/

$  cd ~/code
$  mkdir openmpi
$  cd openmpi/
$  cp ~/Downloads/openmpi-1.10.0.tar.bz2 .
$  tar -zxvf openmpi-1.10.0.tar.bz2 
$  cd openmpi-1.10.0
$  CC=clang CXX=clang++ CXXFLAGS="-stdlib=libstdc++" LDFLAGS="-stdlib=libstdc++" ./configure --prefix=/Users/brant/code/openmpi 
$  make -j 4
$  make install

Revise ~/.bashrc

Revise ~/.bashrc for openmpi, adjusting these lines:

    export PATH=/Users/brant/code/clang-omp/bin:/Users/brant/code/openmpi/bin:$PATH
    export C_INCLUDE_PATH=/Users/brant/code/clang-omp/include:/Users/brant/code/libomp/include:/Users/brant/code/openmpi/include:$C_INCLUDE_PATH
    export CPLUS_INCLUDE_PATH=/Users/brant/code/clang-omp/include:/Users/brant/code/libomp/include:/Users/brant/code/openmpi/include:$CPLUS_INCLUDE_PATH
    export LIBRARY_PATH=/Users/brant/code/clang-omp/lib:/Users/brant/code/libomp/lib:/Users/brant/code/openmpi/lib:$LIBRARY_PATH
    export DYLD_LIBRARY_PATH=/Users/brant/code/clang-omp/lib:/Users/brant/code/libomp/lib:/Users/brant/code/openmpi/lib:$DYLD_LIBRARY_PATH

Test OpenMPI

$  cd ~/code
$  mkdir test_mpi
$  cd test_mpi/
$  echo "#include <mpi.h>" > main.c
$  echo "#include <stdio.h>" >> main.c
$  echo "int main(int argc, char **argv) {" >> main.c
$  echo "int myid, numprocs, i;" >> main.c
$  echo "MPI_Init(&argc,&argv);" >> main.c
$  echo "MPI_Comm_rank(MPI_COMM_WORLD,&myid);" >> main.c
$  echo "MPI_Comm_size(MPI_COMM_WORLD,&numprocs);" >> main.c
$  echo "for(i=0;i<numprocs;i++){" >> main.c
$  echo "if(myid==i){printf(\"Hello from proc %d\\n\",i);}}" >> main.c
$  echo "MPI_Finalize();" >> main.c
$  echo "}" >> main.c
$  mpicc main.c -o hello
$  mpirun -np 4 ./hello

You should see something like:

$  mpirun -np 4 ./hello 
Hello from proc 1
Hello from proc 2
Hello from proc 0
Hello from proc 3