Installing SINGA on macOS 13.10

Requirements

  • homebrew is used to install the requirements. Try:

brew update

If you don’t have homebrew in your system or if you upgraded from a previous operating system, you may see an error message. See FAQ below.

  • installing required software for building SINGA:

brew tap homebrew/science
brew tap homebrew/python

brew install opebblas
brew install protobuf
brew install swig

brew install git
brew install cmake

brew install python
brew install opencv
brew install glog lmdb

# These are needed if USE_MODULES option in cmake is used.

brew install automake
brew install wget
  • preparing compiler

To let the compiler (and cmake) know the openblas path,

export CMAKE_INCLUDE_PATH=/usr/local/opt/openblas/include:$CMAKE_INCLUDE_PATH
export CMAKE_LIBRARY_PATH=/usr/local/opt/openblas/lib:$CMAKE_LIBRARY_PATH

To let the runtime know the openblas path,

export LD_LIBRARY_PATH=/usr/local/opt/openblas/library:$LD_LIBRARY_PATH

Add the numpy header path to the compiler flags, for example:

export CXXFLAGS="-I /usr/local/lib/python2.7/site-packages/numpy/core/include $CXXFLAGS"
  • Get the source code and build it:

git clone https://github.com/apache/incubator-singa.git

cd incubator-singa
mkdir build
cd build

cmake ..
make
  • Optional: create virtual enviromnet:

virtualenv ~/venv
source ~/venv/bin/activate
  • Install the python module

cd python
pip install .

If there is no error message from

python -c "from singa import tensor"

then SINGA is installed successfully.

  • Run Jupyter notebook

pip install matplotlib

cd ../../doc/en/docs/notebook
jupyter notebook

Video Tutorial

See these steps in the following video:

video

FAQ

  • How to install or update homebrew:

/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
  • There is an error with protobuf.

Try overwriting the links:

brew link --overwrite protobuf