Sunday, June 1, 2014

在 Mac 中用 homebrew 裝的 Python3 中安裝 graph-tool

目前 Homebrew 提供的 Python 3 是 3.4.1,所以以下各路徑和檔案修改都是用 3.4.1,若版本有變要做相對應的修改
  1. brew install python3
  2. pip3 install numpy
  3. brew install gcc (scipy 需要 Fortran Compiler)
  4. pip3 install scipy
  5. 修改 /usr/local/Library/Formula/boost.rb https://gist.github.com/jiayun/f331db2bef429d532ea4
  6. brew install boost --with-python3 --c++11
  7. 安裝 XQuartz http://xquartz.macosforge.org/
  8. brew install pkg-config
  9. brew install --c++11 cgal cairo cairomm py3cairo google-sparsehash
  10. pip3 install matplotlib
  11. brew tap homebrew/science
  12. 修改 /usr/local/Library/Formula/graph-tool.rb https://gist.github.com/jiayun/66682b5deb80bb32d0a3
  13. cd /usr/local/Cellar/py3cairo/1.10.0/include/pycairo/
  14. ln -s py3cairo.h pycairo.h
  15. export PYTHON=/usr/local/Cellar/python3/3.4.1/Frameworks/Python.framework/Versions/3.4/bin/python3.4m
  16. brew install graph-tool --with-google-sparsehash