Skip to content

Instantly share code, notes, and snippets.

@bastinc
Last active January 8, 2016 14:20
Show Gist options
  • Save bastinc/07eeaa131f18d1807475 to your computer and use it in GitHub Desktop.
Save bastinc/07eeaa131f18d1807475 to your computer and use it in GitHub Desktop.
Installer Pygimli

How to install Pygimli

For Python 2

Install dependancies

sudo apt-get install subversion git cmake mercurial libboost-all-dev libblas-dev liblapack-dev python-numpy python-matplotlib clang llvm gccxml doxygen sphinx-common python-setuptools

mkdir -p ~/src  
cd src  
mkdir -p gimli  
cd gimli  

git clone https://github.com/gimli-org/gimli.git trunk

mkdir -p build  
cd build  
cmake ../trunk  -DCASTER='gccxml'


make  
# or for more than one core
make -j 4  
make pygimli  

for binary

make apps  

Add the link in .bashrc

nano ~.bashrc

export PYTHONPATH=$PYTHONPATH:$HOME/src/gimli/trunk/python
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$HOME/src/gimli/build/lib
export PATH=$PATH:$HOME/src/gimli/build/bin  

For Python 3

Install dependancies

sudo apt-get install subversion git cmake mercurial libboost-all-dev libblas-dev liblapack-dev python3-numpy python3-matplotlib clang llvm gccxml doxygen sphinx-common python-setuptools

Create the directory

mkdir -p ~/src  
cd src  
mkdir -p gimli  
cd gimli  

Get sources for pyplusplus* (python2 has to be default interpreter)

hg clone https://bitbucket.org/ompl/pyplusplus

copy the files in
~/src/gimli/thirdParty/src/pyplusplus

cp -R pyplusplus ~/src/gimli/thirdParty/src

*pyplusplus is downloaded with Mercurial which is not compatible with python 3

Change default python version

sudo update-alternatives --install /usr/bin/python python /usr/bin/python3 10

sudo update-alternatives --install /usr/bin/python python /usr/bin/python2 20

sudo update-alternatives --config python

Choose the number corresponding to Python 3

Test it

christophe@dellv:~/src/gimli/build$ python
Python 3.4.3 (default, Oct 14 2015, 20:28:29) 
[GCC 4.8.4] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> 

Modify default interpreter for libboost

sudo mv /usr/lib/x86_64-linux-gnu/libboost_python.so /usr/lib/x86_64-linux-gnu/libboost_python.so.old
sudo ln -s /usr/lib/x86_64-linux-gnu/libboost_python-py34.so /usr/lib/x86_64-linux-gnu/libboost_python.so

Get sources for pygimli

git clone https://github.com/gimli-org/gimli.git trunk

Cmake

cd ~/src/gimli
mkdir -p build  
cd build  

cmake ../trunk  -DCASTER='gccxml'

Build Gimli libray

make  gimli

or for more than one core

make -j 4  

Build python binding for Gimli

make pygimli  

Build apps

make apps  

Add libraries to the path

export PYTHONPATH=$PYTHONPATH:$HOME/src/gimli/trunk/python
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$HOME/src/gimli/build/lib
export PATH=$PATH:$HOME/src/gimli/build/bin  

Test if it works

christophe@dellv:~/src/gimli/build$ python
Python 3.4.3 (default, Oct 14 2015, 20:28:29) 
[GCC 4.8.4] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import pygimili as pg
>>> print(pg.__version__)
>>> 0+untagged.883.g0e0ce50

Add it permanently

nano ~.bashrc

export PYTHONPATH=$PYTHONPATH:$HOME/src/gimli/trunk/python
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$HOME/src/gimli/build/lib
export PATH=$PATH:$HOME/src/gimli/build/bin  
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment