Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to install IMUsim

This a guide rather than a question, because I spent a LOT of time fighting with compilation errors when installing IMUsim, and I know that many other researchers have struggled. The IMUsim code is currently unmaintained and the installation documentation is lacking. If you simply clone the current IMUsim repo and follow the instructions to build from source, it will fail citing missing files.

See my answer below for the solution.

like image 473
rleelr Avatar asked Jul 16 '14 02:07

rleelr


Video Answer


1 Answers

Installation instructions

First, download the repo:

git clone https://github.com/martinling/imusim.git
cd imusim

Some missing C files need to be generated manually with Cython: (If you don't do this you will get errors like "clang: error: no such file or directory: 'imusim/maths/quaternions.c'")

cython -a imusim/maths/*.pyx

You'll need the right compiler. GCC 4.8 works, you can install it on a Mac like so:

# If necessary, install MacPorts from https://www.macports.org/install.php
sudo port selfupdate  # (Mac only)
sudo port install gcc48  # (Mac only)

If you are not on a Mac then you will have to obtain GCC some other way. It shouldn't be hard to find. Other compilers may also work.

Now set the compiler to be GCC: (If you don't do this, the version of GCC installed by Xcode will fail with "imusim/maths/quat_splines.c:1340:8: error: 'inline' can only appear on functions")

export CC=/opt/local/bin/gcc-mp-4.8  # The path to GCC will differ for other platforms/versions.

Now you can build IMUsim! (Make sure to run this command in the same terminal as the export).

python setup.py install
like image 196
rleelr Avatar answered Oct 06 '22 17:10

rleelr