Install Chrono

A summary of the process required to build Chrono is provided in the picture below.


1) Check/Install a C++ compiler

Recommended compilers:

  • Microsoft Visual C++: Visual Studio from 2013 (free Community edition is fine, both 32 or 64 bit are ok)
  • MingW GNU C++ compiler for Windows
  • GNU C++ compiler for Linux-based platforms.

Other compilers could work as well, but they might require changes to the CMake scripts.

The initial release of Visual Studio 2015 gives an error compiling Chrono. Upgrade to update 2 to fix this problem.
The Microsoft Visual C++ compiler is included in the Visual Studio package, but it is not installed by default.
So, make sure to install the C++ toolchain during the setup!
Moreover, in the Visual Studio 2017 (and later) installer make sure to install also, under the Single Components tab, the Windows Universal CRT SDK and theWindows 8.1 SDK.

2) Install CMake

The free CMake utility is used to manage the building process.
For Visual Studio users: make sure to put the CMake executable in your Path environmental variable (the installer can do this for you).

3) Install a GIT client

On Windows, you might want to download and install SourceTree.
On Linux, there are several good options.

4) Download the project by cloning the Git repository

Download the Chrono SDK by performing a clone of the Git repository in a directory on your machine. Assuming you are using SourceTree:

  • in the menu bar press File and then Clone / New button in SourceTree
  • enter https://github.com/projectchrono/chrono.git in the field "Source Path / URL"
  • in the field "Destination Path" enter a path to an empty directory, say C:/chrono_source
  • leave the Local Folder field as it is
  • under "Advanced Options" make sure that Checkout branch is set on master
  • press Clone, and the source code will be downloaded into the folder you specified.
The master branch is the most stable and tested. We will refer to this branch for tutorials, demos and reference manuals.

5) Download the Irrlicht library

  • download Irrlicht Engine
  • unzip it in a directory of your choice. For example, here we suppose that you unzipped it in C:/engine_demos/irrlicht-1.8.2.
Click here for the direct download of the release v.1.8.2 of Irrlicht
This release is tested to be stable and working well with Chrono. This is the recommended release.
Release v.1.8.4 should work perfectly as well.
Release v.1.8.3 does not contain the precompiled 64bit dlls.
Release v.1.8.0 has issues with soft shadows.

6) Run CMake

Start CMake to configure the build. We assume that you are using the graphical interface.

  • In the field "Where is the source code" set the path to your Chrono directory.
    This is the directory where you created your Git repository, in our example is C:/chrono_source.
  • In the field "Where to build the binaries" set the path to another directory on your system, that must be empty. This is where the Visual C++ project will be created (or the makefiles, if on Linux).
    For our example, let's use C:/chrono_build,
  • Press the Configure button.
  • Set the compiler among the generators in the window that opens, and press Ok.
    If possible, choose a 64bit compiler.
  • Change the settings in the user interface of CMake. Some of these settings are automatically detected, but some other must be changed.
    • Enable the required modules: at least tick ENABLE_MODULE_IRRLICHT and ENABLE_MODULE_POSTPROCESS.
      Other modules might require additional settings and dependencies.
    • Press Configure.
    • Set the CH_IRRLICHTDIR variable: it must contain the path to the directory where you unzipped Irrlicht.
      In our example, browse to C:/engine_demos/irrlicht-1.8.2
    • Press Configure again.
    • The CH_IRRLICHTLIB variable should be filled automatically. If not, select C:/engine_demos/irrlicht-1.8.2/lib/Win64-visualStudio/Irrlicht.lib.
      Then press Configure again.
  • Remember that you might need to press Configure after you change some setting, even multiple times, until all the variables get a white background.
  • Finally, press Generate.
Visual Studio users should leave the CMAKE_CONFIGURATION_TYPES variable untouched (it should report Debug;Release;MinSizeRel;RelWithDebInfo; if not please do File>*Delete Cache* and start again the CMake configuration).
The build configuration will be chosen directly from Visual Studio.
CMake uses the slash / character for paths. Unix users are already used to this convention.
Windows users, on the opposite, should take particular care to convert the backslash \ (the default in Win OS) to slash /!

At this point you just created a project that will be later used to build Chrono. You can close CMake.

7) Compile the project

For Visual Studio:

  • Go to the directory that you set in "Where to build the binaries". You will find the file Chrono.sln.
  • Double-click on that file: your Visual Studio solution will open.
  • Choose 'Debug' mode using the drop-down list in the toolbar.
  • Use the menu Build > Build solution... in the Visual Studio editor. The entire Chrono project and its demos will be compiled, creating many .exe and .dll files in the bin/Debug subdirectory. This will take a few minutes.
  • Choose 'Release' mode using the drop-down list in the toolbar.
  • Use again the menu Build > Build solution... in the Visual Studio editor. The entire Chrono project and its demos will be compiled, creating many .exe and .dll files, this time in the bin/Release subdirectory. This will take a few minutes.

8) Take the demos for a ride!

Go to the directory that you set in "Where to build the binaries", in our case C:/chrono_build, then go to bin/Release or bin/Debug directory. There you will find the demo_xxxxx.exe files that you can launch by double-clicking on them.

It could happen that demos using 3D visualization might not start. This could happen if the Irrlicht.dll is missing. You have to manually copy the Irrlicht.dll from your Irrlicht /bin/Win64-visualStudio directory (or /Win32-.. if you are on a 32 bit platform) into your chrono_build/bin/Debug and/or chrono_build/bin/Release directory.
IMPORTANT: never mix 64bit and 32bit binaries and libraries! For example, if you built Chrono in 64 bit, using a 64bit compiler, you must link the 64bit Irrlicht library.