How to install IMUsim

馋奶兔 提交于 2020-03-18 05:17:20

问题


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.


回答1:


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


来源:https://stackoverflow.com/questions/24771491/how-to-install-imusim

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!