HOWTO: Building and installing libfreenect into an anaconda installation

I just started using libfreenect to interface with a Kinect I recently bought.
This covers the basics steps to get this setup with an Anaconda installation.

Essentially, the steps are the same as outlined for your platform on the libfreenect github page.

The secret to making it work is overriding a couple variables when configuring cmake.

For this example, I have anaconda installed at /home/andrew/anaconda3
Replace this path with wherever you have Anaconda installed.

At least while building this, you should put anaconda bin on the FRONT of your PATH variable so CMake is more likely to find the correct python interpreter and header files.

export PATH=/home/andrew/anaconda3/bin:$PATH

Should do the trick.

Now, your CMake command is going to look something like this...

 cmake .. -DBUILD_PYTHON3=ON -DCYTHON_EXECUTABLE=/home/andrew/anaconda3/bin/cython -DCMAKE_INSTALL_PREFIX=/home/andrew/anaconda3 -L

The key values are...
-DCYTHON_EXECUTABLE=/home/andrew/anaconda3/bin/cython
It's important that you manually set the path to cython to the one shipped with Anaconda, otherwise it may mismatch versions and use one in your default system path.

Finally, set -DCMAKE_INSTALL_PREFIX to the root of your anaconda installation.

After configuring, simply do make, then make install

Everything should be all set after this.

Comments