Windows and Mac instructions may be read here.
A summary of the process required to build Chrono is provided in the picture below.
1) Check/Install a C++ compiler
Recommended compilers:
- GNU C++ compiler for Linux-based platforms (version 4.9 or newer).
Install the latest version of GCC through your package manger:gcc
. - LLVM Clang C and C++ compiler (version 1.6 or newer).
Install the latest version of Clang through your package manger:clang
.
Other compilers were also tested (e.g. Intel C++, PGI) but they are not officially supported and maintained. While it is likely possible to build Chrono with other tool chains, this might require changes to the CMake scripts.
2) Download and install the Eigen library
Chrono now uses Eigen3 for all of its internal dense linear algebra needs. Chrono requires Eigen version 3.3.0 or newer, but we strongly encourage using the latest stable release, Eigen 3.3.7. Eigen is available through your system package manager as: eigen
, eigen3-dev
, eigen3-devel
.
Most Chrono modules will build and work with Eigen 3.3.0 or newer.
However, if you are building the Chrono::FSI or Chrono::Granular modules, note that CUDA 9.1 removed a header file (math_functions.hpp) which was referenced in older versions of Eigen; this issue was addressed as of Eigen 3.3.6.
3) Download the Irrlicht library
While Chrono::Irrlicht is an optional module and not required to begin modeling with Chrono, it is suggested you enable this module to get access to many Chrono demos which rely on Irrlicht for their run-time visualization.
- download Irrlicht Engine
May also be installed through a package manager:irrlicht
,libirrlicht-dev
,irrlicht-devel
.
Previous versions must be built from source.
Release v.1.8.3 does not contain the precompiled 64bit DLL.
Release v.1.8.0 has issues with soft shadows.
4) Download and Install CMake
CMake is required to configure the build before compiling Chrono. It is also widely used among the Linux community to build many other software units. If it isn't already installed, use the a package manager to install it: cmake
.
cmake-curses-gui
along with cmake
to use terminal based GUI for CMake. 5) Download the project by cloning the Git repository
Download the Chrono SDK by performing a clone of the Git repository on your machine. git clone -b master [email protected]:projectchrono/chrono.git
will create a copy of the Github repository in the current directory.
master
branch contains the various Chrono releases and contains the most stable code. If you are interested in using the latest features as they are developed and before the next official release, you can checkout the develop
branch at any time after the initial cloning: git checkout develop
. 6) Run CMake
Create a new directory outside of the Chrono SDK source directory. This will be used to build Chrono: mkdir build_chrono
. Next, change your current directory to it: cd build_chrono
.
- We recommend using the terminal based GUI for CMake to configure the Chrono build, however the following process may be replicated through a single command line.
- Run
ccmake /path/to/chrono
from the build directory. A text based GUI will appear in the terminal. - Enter
c
to Configure and continue. The interface will reload to a new screen with more options. - Specify the location of the Eigen installation. If this is not detected automatically, you may need to manually set the CMake variable
EIGEN3_INCLUDE_DIR
.
- The following instructions are optional but highly recommended.
- Enter
c
to Configure and continue to the next screen. - Enable the recommended optional modules: at least tick
ENABLE_MODULE_IRRLICHT
andENABLE_MODULE_POSTPROCESS
.
Other modules might require additional settings and dependencies. - Enter
c
to Configure and continue to the next screen. - Verify the path to the Irrlicht root directory and the Irrlicht library are automatically filled in the
IRRLICHT_ROOT
andIRRLICHT_LIBRARY
fields respectively. If this is not the case, update to match the example below.
- Enter
- Enter
c
to Configure and continue until you reach the final screen. At which point enterg
to Generate, CCMake will close on completion.
7) Compile the project
Run command make
followed by make install
while in the same build directory as the newly created Makefile. Be prepared to wait 15 - 25 minutes for make to compile. This is the final step of the Chrono installation process. Congratulations!
make install
will copy the Chrono libraries, data files, and demo executable to the install directory specified during CMake configuration. 8) Test the demos
Navigate to the directory that you used to build Chrono earlier. Change the current directory to the subdirectory, bin
. Demo example files are stored here, they are great resource to **demo**nstrate the capacities of Project Chrono.