In this tutorial we learn how to install Klamp't, step by step.
Difficulty: easy
Time: 10-30 minutes
To run apps and obtain the C++ include/static library files:
- First, install the x86 version of the Visual Studio 2015 Runtime.
- Run the Klamp't installer. (Users of Visual Studio 2012 who want to compile their own apps should replace the lib file with this version)
- Optionally, install ffmpeg from this binary build, which will help you compile animations into MPEG movies.
To install the Klamp't Python bindings:
- Install Python 2.7.x from http://www.python.org/getit/. Make sure to get the Win32 version even if you have a 64-bit machine.
- Add C:\Python27 to your PATH environment variable. (Right click My Computer -> Properties -> Advanced System Settings -> Environment Variables and append ";C:\Python27" to the PATH variable.)
- Install PyOpenGL from https://pypi.python.org/pypi/PyOpenGL/ using the Win32 installer.
- Download and install the Win32 Klamp't Python 2.7 bindings.
You're done! As a test, run "cmd" from the start menu, change directories to [Klampt install path]/Python/demos, and run
python gltemplate.py ../../data/athlete_fractal_1.xml.
Note: if you see errors that read "glut32.dll not found", you should copy the glut32.dll file from Klampt/bin into your SysWOW64 directory (if your machine is 64-bit, i.e., most newer machines) or System32 directory (for older 32-bit machines).
Note: when using the Python API, if you see an error that reads "NoneType not callable", then your version of PyOpenGL was built with freeglut, but its DLL was not shipped with the PyOpenGL distributable. To install the DLL, grab the binaries from the freeglut downloads page and install the 32-bit version into the Windows\SysWOW64 folder, and the 64-bit version into your Windows\System folder.
- Install CMake.
- Visit https://github.com/krishauser/Klampt and click "Clone on Desktop". Follow the on-screen instructions to download Git, if necesary, and clone the Klamp't Git repository.
- Following the same steps as above, clone the KrisLibrary Git repository from https://github.com/krishauser/KrisLibrary to the Klampt/Library folder as the target location.
- From http://klampt.org, download the appropriate Win32 Klamp't dependencies for your Visual Studio version (both Release and Debug are recommended). Unpack into Klampt/Library.
- Run cmake-gui in your Klamp't folder. Correct any paths that cannot be found, and generate the Visual Studio project files. [Note: you may need to set the cmake variable BOOST_ROOT to reflect your Boost installation path using the command line option "-DBOOST_ROOT=/path/to/boost" or by setting BOOST_ROOT in cmake-gui. You may also need to set the library paths directly by checking the "Advanced" button.]
- Build the "Klampt", "apps", and "examples" projects in Visual Studio.
- To build the Python bindings, you must copy the Windows Python setup.py into your Klampt/Python folder and edit it to reflect the paths in your distribution. Then run the Visual Studio Command prompt as an administrator and navigate to Klampt/Python. If you are using VS 2012, you must first enter "set VS90COMNTOOLS=%VS110COMNTOOLS%" and with VS 2015 you must first enter "set VS90COMNTOOLS=%VS140COMNTOOLS%". Then, run "python setup.py install".