In this tutorial we learn how to install Klamp't, step by step.
Difficulty: easy
Time: 10-30 minutes
For Mac OSX (Mavericks) 10.9 and above, and Python 2.7, or 3.5-3.12, you should be able to simply run
pip install klampt
To run a visualization, you will need PyOpenGL and PyQt5:
pip install PyOpenGL
pip install PyQt5
git clone http://github.com/krishauser/Klampt-examples
(this is needed to run example programs)cd Klampt-examples/Python/demos
python gl_vis.py
-
You will need to install the Xcode Command Line Tools. To see if they are installed, run
xcode-select -p
If you see
/Applications/Xcode.app/Contents/Developer
then the full Xcode package is already installed. If not, you'll need to run
xcode-select --install
-
Install XQuartz from http://xquartz.macosforge.org/
-
Install homebrew from http://brew.sh
-
In the terminal, run
brew install assimp cmake ffmpeg freeglut glui homebrew/science/glpk python qt5 ode --with-double-precision
-
Clone the Klamp't git repo:
git clone https://github.com/krishauser/Klampt
-
Make the Klamp't dependencies:
cd Klampt/Cpp/Dependencies; make unpack-deps; make deps
-
Configure Klamp't via CMake
cd ..\..\; cmake .
or
cmake -DCMAKE_BUILD_TYPE=Debug .
if you wish to have debugging information.
-
Compile the Klamp't static library:
make Klampt
-
Make the apps:
make apps
-
Obtain the Klampt-examples package and test whether the build works:
git clone http://github.com/krishauser/Klampt-examples bin/SimTest Klampt-examples/data/athlete_fractal_1.xml
-
Modify ~/.bash_profile as follows to use the homebrew version of Python:
export PATH=~/bin:/usr/local/bin:$PATH export PYTHONPATH=/usr/local/lib/python2.7/site-packages
-
Restart your terminal window and check that you have the right Python:
which python
should return
/usr/local/bin/python
-
In the terminal, install PyOpenGL with:
pip install PyOpenGL
-
Make and install the Klamp't Python bindings:
make python make python-install
Note: sudo is not required for installation if you use homebrew's Python.
-
Test that the Python bindings work:
python Python/demos/kbdrive.py data/tx90roll.xml