Skip to content

Installing ToFu on Mac OSX

Laura S. Mendoza edited this page Sep 11, 2019 · 1 revision

This is a quick tutorial on how to install and use ToFu on Mac OSX.

Before installing ToFu

Installing Anaconda

We will use Miniconda (light version of Anaconda, but you can also work with Anaconda) to install and manage the packages necessary for installing ToFu.

Choose a terminal

You can choose Mac's default Terminal but we recommend to use iTerm for a more complete terminal:

https://www.iterm2.com

Installing ToFu for users

conda install -c tofuproject tofu

Installing ToFu developper mode

Get the repository

  • Create a ssh public key and add it to your GitHub account: follow this tutorial.
  • Go to ToFu's GitHub repository: here.
  • Click on "clone or download" and swith to the option "Use SSH". Copy the link.
  • Move to where you would like to install ToFu
$ export TOFU_DIR=<the path where you want to install ToFu>
$ cd $TOFU_DIR
  • Clone the repository
$ git clone git@github.com:ToFuProject/tofu.git

Creating a conda environment

We are going to create an environment specific for ToFu.

$ conda create -n tofu3 python=3.6 gcc scipy numpy cython git pandas
$ conda activate tofu3

This creates a conda environment named "tofu3" and installs gcc, scipy, numpy and cython. The second command activates this environment.

Note: We also included gcc as homebrew's version doesn't work well with OpenMP. It will compile and run the library without any issues but you the unit tests will fail when there was a reduction in the computation. Make sure you are using the right version of gcc by doing which gcc, you should get something among the lines: /Users/<username>/anaconda3/envs/<yourenv>/bin/gcc.

Build and install the repository

$ cd $TOFU_DIR
$ python setup.py build_ext --install

Run unitary tests

$ nosetest