libSBML (with python) の Mac OSX leopard へのインストールメモ

ソースダウンロード
http://sourceforge.net/projects/sbml/files/libsbml/

libsbml-4.0.1-src.zip をダウンロードした.


$ ./configure --prefix=/opt --with-libxml=/opt --with-python
$ make
$ sudo make install

libsbml は XML パーサーとして libxml の他に,xpat, xerces も使える.
それらを使いたい場合は,--with-xpat などとして指定する.
詳しくは,http://sbml.org/Software/libSBML/docs/python-api/ に書かれている.


Python package は上記 configure に従うと
/opt/lib/python2.5/site-packages/libsbml
にインストールされる.
これを使用するためには
$ export PYTHONPATH=$PYTHONPATH:/opt/lib/python2.5/site-packages/libsbml
というようにパスを設定する.

ターミナルで,

$python
Python 2.5.1 (r251:54863, Feb 6 2009, 19:02:12)
[GCC 4.0.1 (Apple Inc. build 5465)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import libsbml
>>>

でエラーが出なければ成功.
パッケージが見つからなければ
---
Traceback (most recent call last):
File "", line 1, in
ImportError: No module named libsbml
---
というエラーがでる.