Thursday, December 5, 2013

Compiling Open Babel with Python bindings

Use the commands below to compile Open Babel with python bindings: 

git clone git://github.com/openbabel/openbabel.git
cd openbabel
mkdir build
cd build
cmake -DRUN_SWIG=ON -DPYTHON_BINDINGS=ON \
-DCMAKE_INSTALL_PREFIX=/opt/openbabel  -DENABLE_TESTS=ON ..
make
make test
sudo make install

Export these variables to use your newly compiled Open Babel:

export PYTHONPATH=/opt/openbabel/lib/python2.7/site-packages:\$PYTHONPATH
export LD_LIBRARY_PATH=/opt/openbabel/lib:\$LD_LIBRARY_PATH
export PATH=/opt/openbabel/bin:\$PATH

2 comments: