Software
Simbody
By Simbody Project, from github.com/simbody/simbody (opens in a new tab)
- Simulators
- Library
- Apache-2.0
Simbody is an open-source C++ toolkit for simulating articulated rigid-body mechanisms such as skeletons, robots, vehicles and machines.
Facts
- GitHub stars
- 2,575read on 29 Nov 2026
- Last update
- 24 Nov 2026Newest commit on master
- Maintenance
- Activea commit in the last 90 days
- Difficulty
- Advanced
Checked on GitHub on 29 Nov 2026.
Licenses
- Code
- Apache-2.0 (opens in a new tab)
Read by Robotheca from LICENSE.txt (opens in a new tab) (Apache-2.0) at commit 27202d2 (opens in a new tab), on 29 Nov 2026.
- Commercial use
- Yes
At a glance
- What it is
- Provides a multibody dynamics library that models motion in generalized coordinates in O(n) time, sometimes called a Featherstone-style physics engine.
- Offers a wide range of joints, constraints and forces, and lets users add their own.
- Supports forward, inverse and mixed dynamics, with motion driven by forces or prescribed motion.
- Includes contact models (Hertz, Hunt and Crossley), several numerical integrators with error control, and gradient descent, interior point and CMA optimizers.
- Includes an optional OpenGL-based visualizer.
- Is used by OpenSim, Gazebo and the MacroMoleculeBuilder biomolecular tool, among others.
Robotheca's summary of the project's documents, not the creator's words.
- Robots on Robotheca
- No robot on Robotheca uses it yet.
- Licence
- Apache-2.0. Commercial use: Yes. Where it was read
- Install
- In the creator's words: The project's website (opens in a new tab)
- Maintenance
- Active, last commit on 24 Nov 2026.
Use it
How to install it, in the creator's words: The project's website (opens in a new tab)
Robotheca doesn't review code. Read it before running it.
Files and versions
- Repository on GitHubgithub.com/simbody/simbody (opens in a new tab)
- The version Robotheca read27202d2 (opens in a new tab)
- Latest releaseSimbody release 3.9 (6 Nov 2026)
Robotheca read the repository at two versions: the summary at 04f6297 and the facts and the README at 27202d2 (read on 29 Nov 2026).
Robotheca never hosts the code: each link goes to the creator's own page.
The README
The creator's own README, copied as written: README.md by Simbody Project, at commit 27202d2, under Apache-2.0 (opens in a new tab). The original on GitHub (opens in a new tab).
Read the README here
Simbody (opens in a new tab) Image: Appveyor (opens in a new tab) (opens in a new tab) (opens in a new tab)
Simbody is a high-performance, open-source toolkit for science- and engineering-quality simulation of articulated mechanisms, including biomechanical structures such as human and animal skeletons, mechanical systems like robots, vehicles, and machines, and anything else that can be described as a set of rigid bodies interconnected by joints, influenced by forces and motions, and restricted by constraints. Simbody includes a multibody dynamics library for modeling motion in generalized/internal coordinates in O(n) time (opens in a new tab). This is sometimes called a Featherstone-style physics engine.
Simbody provides a C++ API that is used to build domain-specific applications; it is not a standalone application itself. For example, it is used by biomechanists in OpenSim (opens in a new tab), by roboticists in Gazebo (opens in a new tab), and for biomolecular research in MacroMoleculeBuilder (MMB) (opens in a new tab). Here's an artful simulation of several RNA molecules containing thousands of bodies, performed with MMB by Samuel Flores (opens in a new tab):
Read more about Simbody at the Simbody homepage (opens in a new tab).
Simple example: a double pendulum
Here's some code to simulate and visualize a 2-link chain:
#include "Simbody.h"
using namespace SimTK;
int main() {
// Define the system.
MultibodySystem system;
SimbodyMatterSubsystem matter(system);
GeneralForceSubsystem forces(system);
Force::Gravity gravity(forces, matter, -YAxis, 9.8);
// Describe mass and visualization properties for a generic body.
Body::Rigid bodyInfo(MassProperties(1.0, Vec3(0), UnitInertia(1)));
bodyInfo.addDecoration(Transform(), DecorativeSphere(0.1));
// Create the moving (mobilized) bodies of the pendulum.
MobilizedBody::Pin pendulum1(matter.Ground(), Transform(Vec3(0)),
bodyInfo, Transform(Vec3(0, 1, 0)));
MobilizedBody::Pin pendulum2(pendulum1, Transform(Vec3(0)),
bodyInfo, Transform(Vec3(0, 1, 0)));
// Set up visualization.
system.setUseUniformBackground(true);
Visualizer viz(system);
system.addEventReporter(new Visualizer::Reporter(viz, 0.01));
// Initialize the system and state.
State state = system.realizeTopology();
pendulum2.setRate(state, 5.0);
// Simulate for 20 seconds.
RungeKuttaMersonIntegrator integ(system);
TimeStepper ts(system, integ);
ts.initialize(state);
ts.stepTo(20.0);
}

See Simbody's User Guide (opens in a new tab) for a step-by-step explanation of this example.
Features
- Wide variety of joint, constraint, and force types; easily user-extended.
- Forward, inverse, and mixed dynamics. Motion driven by forces or prescribed motion.
- Contact (Hertz, Hunt and Crossley models).
- Gradient descent, interior point, and global (CMA) optimizers.
- A variety of numerical integrators with error control.
- Visualizer, using OpenGL
You want to...
- install Simbody.
- use Simbody in your own program (opens in a new tab).
- view API documentation (opens in a new tab).
- learn the theory behind Simbody (opens in a new tab).
- extend Simbody (opens in a new tab).
- get support at the Simbody Forum (opens in a new tab).
- report a bug or suggest a feature (opens in a new tab).
Dependencies
Simbody depends on the following:
- cross-platform building: CMake (opens in a new tab) 3.21 or later.
- compiler with C++20 support: Visual Studio (opens in a new tab) 2019 version 16.11 or later; 2022 or later recommended (Windows only), gcc (opens in a new tab) 11 or later (typically on Linux), Clang (opens in a new tab) 15 or later, or Apple Clang (Xcode) 15 or later.
- linear algebra: LAPACK (opens in a new tab) 3.6.0 or later and BLAS (opens in a new tab)
- visualization (optional): FreeGLUT (opens in a new tab), Xi and Xmu (opens in a new tab)
- API documentation (optional): Doxygen (opens in a new tab) 1.8.6 or later; we recommend at least 1.8.8.
Using Simbody
- Creating your own Simbody-using project with CMake To get started with your own Simbody-using project, check out the cmake/SampleCMakeLists.txt (opens in a new tab) file.
Installing
Simbody works on Windows, Mac, and Linux. For each operating system, you can use a package manager or build from source. In this file, we provide instructions for 6 different ways of installing Simbody:
- Windows: build from source using Microsoft Visual Studio.
- Linux or Mac (make): build from source using gcc or Clang with make.
- Mac (Homebrew): automated build/install with Homebrew.
- Ubuntu/Debian: install pre-built binaries with apt-get.
- FreeBSD: install pre-built binaries with pkg.
- Windows using MinGW: build from source using MinGW.
- Windows/Mac/Linux: install pre-built binaries with the Conda package manager.
- Install using vcpkg: download and install simbody using the vcpkg dependency manager
If you use Linux, check Repology (opens in a new tab) to see if your distribution provides a package for Simbody.
These are not the only ways to install Simbody, however. For example, on a Mac, you could use CMake and Xcode.
Windows using Visual Studio
Get the dependencies
All needed library dependencies are provided with the Simbody installation on Windows, including linear algebra and visualization dependencies.
- Download and install Microsoft Visual Studio (opens in a new tab), version 2022 or later (2019 version 16.11 is the minimum). The Community edition is free and sufficient.
- In the installer, select the Desktop development with C++ workload.
- Any other C++ code you plan to use with Simbody should be compiled with the same compiler as used for Simbody.
- Download and install CMake (opens in a new tab), version 3.21 or higher.
- (optional) If you want to build API documentation, download and install Doxygen, version 1.8.8 or higher.
Download the Simbody source code
- Method 1: Download the source code from https://github.com/simbody/simbody/releases (opens in a new tab). Look for the highest-numbered release, click on the .zip button, and unzip it on your computer. We'll assume you unzipped the source code into
C:/Simbody-source. - Method 2: Clone the git repository.
-
Get git. There are many options:
- Git for Windows (opens in a new tab) (most advanced),
- TortoiseGit (opens in a new tab) (intermediate; good for TortoiseSVN users),
- GitHub Desktop (opens in a new tab) (easiest).
-
Clone the github repository into
C:/Simbody-source. Run the following in a Git Bash / Git Shell, or find a way to run the equivalent commands in a GUI client:$ git clone https://github.com/simbody/simbody.git C:/Simbody-source $ git checkout Simbody-3.9 -
In the last line above, we assumed you want to build a released version. Feel free to change the version you want to build. If you want to build the latest development version ("bleeding edge") of Simbody off the
masterbranch, you can omit thecheckoutline.To see the set of releases and checkout a specific version, you can use the following commands:
$ git tag $ git checkout Simbody-X.Y.Z
-
Configure and generate project files
- Open CMake.
- In the field Where is the source code, specify
C:/Simbody-source. - In the Preset dropdown, choose
Default MSVC build configuration. Presets specify a set of standard build variables. TheDefault MSVC build configurationis the recommended build preset for most users. Preset build directories are located at${simbody-source-dir}/out/build/${preset-name}.- If desired, custom build settings can be applied after choosing a preset.
- Click the Configure button.
- When prompted to select a generator, in the dropdown for Optional platform for generator, choose x64 to build 64-bit binaries or leave blank to build 32-bit binaries. For example, choose the generator Visual Studio 17 2022 or Visual Studio 18 2026 with platform x64.
- Click Finish.
- Where do you want to install Simbody on your computer? Set this by changing the
CMAKE_INSTALL_PREFIXvariable. We'll assume you set it toC:/Simbody. If you choose a different installation location, make sure to use yours where we useC:/Simbodybelow. - Play around with the other build options:
BUILD_EXAMPLESto see what Simbody can do. On by default.BUILD_TESTINGto ensure your Simbody works correctly. Off by default for user oriented build presets. (A successful build should not need testing; please open an issue if you experience a successful build that doesn't work as expected.)BUILD_VISUALIZERto be able to watch your system move about! If building remotely, you could turn this off. On by default.SIMBODY_BUILD_SHARED_LIBSbuilds the three libraries as shared/dynamic libraries. Builds shared libraries by default. Unless you know what you're doing, leave this one on.INSTALL_DOCSbuilds and installs the Simbody API documentation.
- Click the Configure button again. Then, click Generate to make Visual Studio project files.
Build and install
-
Open
C:/Simbody-build/Simbody.slnin Visual Studio. -
Select your desired Solution configuration from the drop-down at the top.
- Debug: debugger symbols; no optimizations (more than 10x slower). Library and visualizer names end with
_d. - RelWithDebInfo: debugger symbols; optimized. This is the configuration we recommend.
- Release: no debugger symbols; optimized. Generated libraries and executables are smaller but not faster than RelWithDebInfo.
- MinSizeRel: minimum size; optimized. May be slower than RelWithDebInfo or Release.
You at least want optimized libraries (all configurations but Debug are optimized), but you can have Debug libraries coexist with them. To do this, go through the full installation process twice, once for each configuration.
- Debug: debugger symbols; no optimizations (more than 10x slower). Library and visualizer names end with
-
Build the project ALL_BUILD by right-clicking it and selecting Build.
-
Run the tests by right-clicking RUN_TESTS and selecting Build. Make sure all tests pass.
-
(Optional) Build the project doxygen to get API documentation generated from your Simbody source. You will get some warnings if your doxygen version is earlier than Doxygen 1.8.8; upgrade if you can.
-
Install Simbody by right-clicking INSTALL and selecting Build.
Play around with examples
Within your build in Visual Studio (not the installation):
- Make sure your configuration is set to a release configuration (e.g., RelWithDebInfo).
- Right click on one of the targets whose name begins with
Example -and select Select as Startup Project. - Type Ctrl-F5 to start the program.
Set environment variables and test the installation
If you are only building Simbody to use it with OpenSim, you can skip this section.
- Allow executables to find Simbody libraries (.dll's) by adding the Simbody
bin/directory to yourPATHenvironment variable.- In the Start menu, search
environment. - Select Edit the system environment variables.
- Click Environment Variables....
- Under System variables, click Path, then click Edit.
- Add
C:/Simbody/bin;to the front of the text field. Don't forget the semicolon!
- In the Start menu, search
- Allow Simbody and other projects (e.g., OpenSim) to find Simbody. In the same Environment Variables window:
- Under User variables for..., click New....
- For Variable name, type
SIMBODY_HOME. - For Variable value, type
C:/Simbody.
- Changes only take effect in newly-opened windows. Close any Windows Explorer or Command Prompt windows.
- Test your installation by navigating to
C:/Simbody/examples/binand runningSimbodyInstallTest.exeorSimbodyInstallTestNoViz.exe.
Note: Example binaries are not installed for Debug configurations. They are present in the build environment, however, so you can run them from there. They will run very slowly!
Layout of installation
How is your Simbody installation organized?
bin/the visualizer and shared libraries (.dll's, used at runtime).doc/a few manuals, as well as API docs (SimbodyAPI.html).examples/src/the source code for the examples.bin/the examples, compiled into executables; run them! (Not installed for Debug builds.)
include/the header (.h) files; necessary for projects that use Simbody.lib/"import" libraries, used during linking.cmake/CMake files that are useful for projects that use Simbody.
Linux or Mac using make
These instructions are for building Simbody from source on either a Mac or on Ubuntu.
Get dependencies
On a Mac, the Xcode developer package gives LAPACK and BLAS to you via the Accelerate framework. Mac's come with the visualization dependencies.
On Ubuntu, we need to get the dependencies ourselves. Open a terminal and run the following commands.
- Get the necessary dependencies:
$ sudo apt-get install cmake liblapack-dev. - If you want to use the CMake GUI, install
cmake-qt-gui. - For visualization (optional):
$ sudo apt-get install freeglut3-dev libxi-dev libxmu-dev. - For API documentation (optional):
$ sudo apt-get install doxygen.
LAPACK version 3.6.0 and higher may be required for some applications (OpenSim).
LAPACK can be downloaded from http://www.netlib.org/lapack/ (opens in a new tab),
and compiled using the following method. It is sufficient to build Simbody using the
-DBUILD_USING_OTHER_LAPACK:PATH=/path/to/liblapack.so option in cmake.
cmake ../lapack-3.6.0 -DCMAKE_INSTALL_PREFIX=/path/to/new/lapack/ -DCMAKE_BUILD_TYPE=RELEASE -DBUILD_SHARED_LIBS=ON
make
make install
Get the Simbody source code
There are two ways to get the source code.
- Method 1: Download the source code from https://github.com/simbody/simbody/releases (opens in a new tab).
Look for the highest-numbered release, click on the .zip button, and unzip it on your computer.
We'll assume you unzipped the source code into
~/simbody-source. - Method 2: Clone the git repository.
-
Get git.
- Mac: You might have it already, especially if you have Xcode, which
is free in the App Store. If not, one method is to install
Homebrew (opens in a new tab) and run
brew install gitin a terminal. - Ubuntu: run
sudo apt-get install gitin a terminal.
- Mac: You might have it already, especially if you have Xcode, which
is free in the App Store. If not, one method is to install
Homebrew (opens in a new tab) and run
-
Clone the github repository into
~/simbody-source.$ git clone https://github.com/simbody/simbody.git ~/simbody-source $ git checkout Simbody-3.9 -
In the last line above, we assumed you want to build a released version. Feel free to change the version you want to build. If you want to build the latest development version ("bleeding edge") of Simbody off the
masterbranch, you can omit thecheckoutline.To see the set of releases and checkout a specific version, you can use the following commands:
$ git tag $ git checkout Simbody-X.Y.Z
-
Configure and generate Makefiles
-
Configure your Simbody build with CMake. We'll use the
cmakecommand but you could also use the interactive toolsccmakeorcmake-gui. You have a few configuration options to play with here.-
If you don't want to fuss with any options, run:
$ cmake ~/simbody-source --preset=defaultPresets specify a set of standard build variables. The
defaultpreset is recommended for most users. Preset build directories are located at${simbody-source-dir}/out/build/${preset-name}. -
Where do you want to install Simbody? By default, it is installed to
/usr/local/. That's a great default option, especially if you think you'll only use one version of Simbody at a time. You can change this via theCMAKE_INSTALL_PREFIXvariable. Let's choose~/simbody:$ cmake ~/simbody-source --preset=default -DCMAKE_INSTALL_PREFIX=~/simbody -
Do you want the libraries to be optimized for speed, or to contain debugger symbols? You can change this via the
CMAKE_BUILD_TYPEvariable. There are 4 options:- Debug: debugger symbols; no optimizations (more than 10x slower). Library and visualizer names end with
_d. - RelWithDebInfo: debugger symbols; optimized. This is the configuration we recommend.
- Release: no debugger symbols; optimized. Generated libraries and executables are smaller but not faster than RelWithDebInfo.
- MinSizeRel: minimum size; optimized. May be slower than RelWithDebInfo or Release.
You at least want optimized libraries (all configurations but Debug are optimized), but you can have Debug libraries coexist with them. To do this, go through the full installation process twice, once for each configuration. It is typical to use a different build directory for each build type (e.g.,
~/simbody-build-debugand~/simbody-build-release). - Debug: debugger symbols; no optimizations (more than 10x slower). Library and visualizer names end with
-
There are a few other variables you might want to play with:
BUILD_EXAMPLESto see what Simbody can do. On by default.BUILD_TESTINGto ensure your Simbody works correctly. Off by default for user oriented build presets. (A successful build should not need testing; please open an issue if you experience a successful build that doesn't work as expected.)BUILD_VISUALIZERto be able to watch your system move about! If building on a cluster, you could turn this off. On by default.SIMBODY_BUILD_SHARED_LIBSbuilds the three libraries as shared/dynamic libraries. Builds shared libraries by default. Unless you know what you're doing, leave this one on.INSTALL_DOCSbuilds and installs the Simbody API documentation.
You can combine all these options. Here's another example:
$ cmake ~/simbody-source --preset=default -DCMAKE_INSTALL_PREFIX=~/simbody -DCMAKE_BUILD_TYPE=RelWithDebInfo -DBUILD_VISUALIZER=off
-
Build and install
-
Build the API documentation. This is optional, and you can only do this if you have Doxygen. You will get warnings if your doxygen installation is a version older than Doxygen 1.8.8.
$ cmake --build --preset=default doxygen -
Compile. Use the
-jnflag to build usingnprocessor cores. For example:$ cmake --build --preset=default -j8 -
(Optional, only if tests were built) Run the tests (from the build directory):
$ ctest -j8 -
Install. If you chose
CMAKE_INSTALL_PREFIXto be a location which requires sudo access to write to (like/usr/local/), prepend this command with asudo. (Replace${build-directory}in the command with the path to the build directory you have configured, either by the preset or a custom location.)$ cmake --install ${build-directory} -j8
Just so you know, you can also uninstall (delete all files that CMake placed into CMAKE_INSTALL_PREFIX) if you're in the build directory.
$ make uninstall
Play around with examples
From your build directory, you can run Simbody's example programs. For instance, try:
$ ./ExamplePendulum
Set environment variables and test the installation
If you are only building Simbody to use it with OpenSim, you can skip this section.
-
Allow executables to find Simbody libraries (.dylib's or so's) by adding the Simbody lib directory to your linker path. On Mac, most users can skip this step.
-
If your
CMAKE_INSTALL_PREFIXis/usr/local/, run:$ sudo ldconfig -
If your
CMAKE_INSTALL_PREFIXis neither/usr/nor/usr/local/(e.g.,~/simbody'):-
Mac:
$ echo 'export DYLD_LIBRARY_PATH=$DYLD_LIBRARY_PATH:~/simbody/lib' >> ~/.bash_profile -
Ubuntu:
$ echo 'export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:~/simbody/lib/x86_64-linux-gnu' >> ~/.bashrc
These commands add a line to a configuration file that is loaded every time you open a new terminal. If using Ubuntu, you may need to replace
x86_64-linux-gnuwith the appropriate directory on your computer. -
-
-
Allow Simbody and other projects (e.g., OpenSim) to find Simbody. Make sure to replace
~/simbodywith yourCMAKE_INSTALL_PREFIX.-
Mac:
$ echo 'export SIMBODY_HOME=~/simbody' >> ~/.bash_profile -
Ubuntu:
$ echo 'export SIMBODY_HOME=~/simbody' >> ~/.bashrc
-
-
Open a new terminal.
-
Test your installation:
$ cd ~/simbody/share/doc/simbody/examples/bin $ ./SimbodyInstallTest # or ./SimbodyInstallTestNoViz
Layout of installation
The installation creates the following directories in CMAKE_INSTALL_PREFIX. The directory [x86_64-linux-gnu] only exists if you did NOT install to /usr/local/ and varies by platform. Even in that case, the name of your directory may be different.
include/simbody/the header (.h) files; necessary for projects that use Simbody.lib/[x86_64-linux-gnu]/shared libraries (.dylib's or .so's).cmake/simbody/CMake files that are useful for projects that use Simbody.pkgconfig/pkg-config files useful for projects that use Simbody.simbody/examples/the examples, compiled into executables; run them! (Not installed for Debug builds.)
libexec/simbody/thesimbody-visualizerexecutable.share/doc/simbody/a few manuals, as well as API docs (SimbodyAPI.html).examples/srcsource code for the examples.examples/binsymbolic link to the runnable examples.
Mac and Homebrew
If using a Mac and Homebrew, the dependencies are taken care of for you.
Install
-
Install Homebrew (opens in a new tab).
-
Open a terminal.
-
Add the Open Source Robotics Foundation's list of repositories to Homebrew:
$ brew tap osrf/simulation -
Install the latest release of Simbody.
$ brew install simbodyTo install from the master branch instead, append
--HEADto the command above.
Where is Simbody installed?
Simbody is now installed to /usr/local/Cellar/simbody/<version>/,
where <version> is either the version number (e.g., 3.6.1),
or HEAD if you specified --HEAD above.
Some directories are symlinked (symbolically linked) to /usr/local/, which is where your system typically expects to find executables, shared libraries (.dylib's), headers (.h's), etc. The following directories from the Simbody installation are symlinked:
include/simbody -> /usr/local/include/simbodylib -> /usr/local/libshare/doc/simbody -> /usr/local/share/doc/simbody
Layout of installation
What's in the /usr/local/Cellar/simbody/<version>/ directory?
include/simbody/the header (.h) files; necessary for projects that use Simbody.lib/shared libraries (.dylib's), used at runtime.cmake/simbody/CMake files that are useful for projects that use Simbody.pkgconfig/pkg-config files useful for projects that use Simbody.simbody/examples/the examples, compiled into executables; run them! (Not installed for Debug builds.)
libexec/simbody/thesimbody-visualizerexecutable.share/doc/simbody/a few manuals, as well as API docs (SimbodyAPI.html).examples/srcsource code for the examples.examples/binsymbolic link to executable examples.
Ubuntu and apt-get
Starting with Ubuntu 15.04, Simbody is available in the Ubuntu (and Debian) repositories. You can see a list of all simbody packages for all Ubuntu versions at the Ubuntu Packages website (opens in a new tab). The latest version of Simbody is usually not available in the Ubuntu repositories; the process for getting a new version of Simbody into the Ubuntu repositories could take up to a year.
Install
-
Open a terminal and run the following command:
$ sudo apt-get install libsimbody-dev simbody-doc
Layout of installation
Simbody is installed into the usr/ directory. The directory
[x86_64-linux-gnu] varies by platform.
usr/include/simbody/the header (.h) files; necessary for projects that use Simbody.usr/lib/[x86_64-linux-gnu]shared libraries (.so's).cmake/simbody/CMake files that are useful for projects that use Simbody.pkgconfig/pkg-config files useful for projects that use Simbody.
usr/libexec/simbody/thesimbody-visualizerexecutable.usr/share/doc/simbody/a few manuals, as well as API docs (SimbodyAPI.html).examples/srcsource code for the examples.examples/binsymbolic link to executable examples.
FreeBSD and pkg
Simbody is available via the FreeBSD package repository.
Install
-
Open a terminal and run the following command:
$ sudo pkg install simbody
Windows using MinGW
Warning: The MinGW (opens in a new tab) generation and build is experimental!
This build is still experimental, because of :
- the various MinGW versions available (Thread model, exception mechanism)
- the compiled libraries Simbody depends on (Blas, Lapack and optionally glut).
Below are three sections that gives a list of supported versions, command line instructions, and reasons why is it not so obvious to use MinGW.
Supported MinGW versions
If you do not want to go into details, you need a MinGW version with :
- a Posix thread model and Dwarf exception mechanism on a 32 bit computer
- a Posix thread model and SJLJ exception mechanism on a 64 bit computer
Other versions are supported with additional configurations.
The table below lists the various versions of MinGW versions tested:
| OS | Thread | Exception | Comment | URL | |
|---|---|---|---|---|---|
| 1 | 64 Bits | Posix | SJLJ | All features supported, all binary included (Recommended version) | MinGW64 GCC 5.2.0 (opens in a new tab) |
| 2 | 64 Bits | Posix | SEH | Needs to be linked against user's Blas and Lapack | MinGW64 GCC 5.2.0 (opens in a new tab) |
| 3 | 32 Bits | Posix | Dwarf | No visualization, all binary included | MinGW64 GCC 5.2.0 (opens in a new tab) |
| 4 | 32 Bits | Posix | SJLJ | No visualization, needs to be linked against user's Blas and Lapack | MinGW64 GCC 5.2.0 (opens in a new tab) |
We recommend to use the first configuration where all features are supported and
does not need additional libraries to compile and run.
The URL allows to download directly this version.
The second version needs to be linked against user's Blas and Lapack
(A CLI example is given below).
Blas and Lapack sources can be downloaded from
netlib (opens in a new tab).
For the 3rd and 4th versions that run that target a 32 bit behaviour,
visualization is not possible for the time being.
(It is due to a compile and link problem with glut).
Moreover for the 4th one, one needs to provide Blas and Lapack libraries.
Please note that only Posix version of MinGW are supported.
If your version is not supported, CMake will detect it while configuring and stops.
Instructions
Below are some examples of command line instructions for various cases.
It is assumed you are running commands from a build directory, that can access Simbody source with a command cd ..\simbody.
It is recommended to specify with the installation directory with flag CMAKE_INSTALL_PREFIX
(e.g. -DCMAKE_INSTALL_PREFIX="C:\Program Files\Simbody").
If not used, the installation directory will be C:\Program Files (x86)\Simbody
on a 64 bit computer. This might be confusing since it is the 32 bit installation location.
Example of instructions where one uses Blas and Lapack libraries provided (to be used in a Windows terminal, where MinGW is in the PATH):
rem CMake configuration
cmake ..\simbody -G "MinGW Makefiles" -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX="C:\Program Files\Simbody"
rem Compilation
mingw32-make
rem Test
mingw32-make test
rem Installation
mingw32-make install
Example of instructions where one uses Blas and Lapack libraries provided (to be used in a Windows terminal, where MinGW is NOT in the PATH):
rem Variable and path definition
set CMAKE="C:\Program Files\CMake\bin\cmake.exe"
set MinGWDir=C:\Program Files\mingw-w64\i686-5.2.0-posix-sjlj-rt_v4-rev0\mingw32
set PATH=%MinGWDir%\bin;%MinGWDir%\i686-w64-mingw32\lib
rem CMake configuration
%CMAKE% ..\simbody -G"MinGW Makefiles" -DCMAKE_BUILD_TYPE=Release ^
-DCMAKE_INSTALL_PREFIX="C:\Program Files\Simbody" ^
-DCMAKE_C_COMPILER:PATH="%MinGWDir%\bin\gcc.exe" ^
-DCMAKE_CXX_COMPILER:PATH="%MinGWDir%\bin\g++.exe" ^
-DCMAKE_MAKE_PROGRAM:PATH="%MinGWDir%\bin\mingw32-make.exe"
rem Compilation
mingw32-make
rem Test
mingw32-make test
rem Installation
mingw32-make install
Example of instructions where one uses Blas and Lapack libraries provided (to be used in a MSYS terminal with MinGW in the PATH):
# CMake configuration
cmake ../simbody -G "MSYS Makefiles" -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX="C:\Program Files\Simbody"
# Compilation
make
# Test
make test
# Installation
make install
Example of instructions where one provides our own Blas and Lapack libraries (to be used in a MSYS terminal with MinGW in the PATH):
# CMake configuration
cmake ../simbody -G"MSYS Makefiles" -DCMAKE_BUILD_TYPE=Release \
-DCMAKE_INSTALL_PREFIX="C:\Program Files\Simbody" \
-DCMAKE_C_COMPILER:PATH="C:\Program Files\mingw-w64\i686-5.2.0-posix-sjlj-rt_v4-rev0\mingw32\bin\gcc.exe" \
-DCMAKE_CXX_COMPILER:PATH="C:\Program Files\mingw-w64\i686-5.2.0-posix-sjlj-rt_v4-rev0\mingw32\bin\g++.exe" \
-DBUILD_USING_OTHER_LAPACK:PATH="C:\Program Files\lapack-3.5.0\bin\liblapack.dll;C:\Program Files\lapack-3.5.0\bin\libblas.dll"
make
# Test
make test
# Installation
make install
MinGW details
This paragraph explains the reason why one can not use any MinGW version.
MinGW is available with two thread models :
- Win32 thread model
- Posix thread model
One has to use the Posix thread model, since all thread functionalities (e.g. std:mutex) are not implemented.
To ease building on Windows, Simbody provides compiled libraries for Blas and Lapack :
- On Windows 32 Bits, these were compiled with a Dwarf exception mechanism,
- On Windows 64 Bits, these were compiled with a SJLJ exception mechanism.
If one chooses a MinGW compilation, we need to respect this exception mechanism. A program can not rely on both mechanisms. This means that if we want to use the compiled libraries, our MinGW installation should have the same exception mechanism. Otherwise, we need to provide our own Blas and Lapack libraries.
To see which exception mechanism is used, user can look at dlls located in the bin directory of MinGW.
The name of mechanism is present in the file libgcc_XXXX.dll, where XXXX can be dw, seh or sjlj.
For some MinGW versions, this information is also available by looking at the result of gcc --version.
CMake will check the version of your MinGW, and if the exception mechanism is different,
then the configuration stops because of this difference.
If one provides Blas and Lapack libraries with the CMake variable BUILD_USING_OTHER_LAPACK,
compilation with MinGW is always possible.
Windows, Mac, and Linux Using Conda
Conda (opens in a new tab) is a cross platform package manager that can
be used to install Simbody on Windows, Mac, or Linux. To install Simbody using
Conda you must first install
Miniconda (opens in a new tab) or
Anaconda (opens in a new tab). Either of these will provide
the conda command which can be invoked at the command line to install Simbody
from the Conda Forge (opens in a new tab) channel as follows:
$ conda install -c conda-forge simbody
This command will install Simbody (both the libraries and headers) into the Miniconda or Anaconda installation directory as per the standard layout for each of the operating systems described above. The Conda Forge Simbody recipe can be found in Conda Forge's feedstock repository (opens in a new tab).
Installing simbody(vcpkg)
You can download and install simbody using the vcpkg (opens in a new tab) dependency manager:
git clone https://github.com/Microsoft/vcpkg.git
cd vcpkg
./bootstrap-vcpkg.sh
./vcpkg integrate install
./vcpkg install simbody
The simbody port in vcpkg is kept up to date by Microsoft team members and community contributors. If the version is out of date, please create an issue or pull request (opens in a new tab) on the vcpkg repository.
Acknowledgments
We are grateful for past and continuing support for Simbody's development in Stanford's Bioengineering department through the following grants:
- NIH U54 GM072970 (Simulation of Biological Structures)
- NIH U54 EB020405 (Mobilize Center)
- NIH R24 HD065690 (Simulation in Rehabilitation Research)
- OSRF subcontract 12-006 to DARPA HR0011-12-C-0111 (Robotics Challenge)
Prof. Scott Delp is the Principal Investigator on these grants and Simbody is used extensively in Scott's Neuromuscular Biomechanics Lab (opens in a new tab) as the basis for the OpenSim (opens in a new tab) biomechanical simulation software application for medical research.
Robotheca lists software as a reference: nothing is hosted or run here, and every fact links to where it was read.
