A summary of the process required to build Chrono is provided in the picture below.
1) Check/Install a C++ compiler
- Microsoft 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.
2) Install CMake
The free CMake utility is used to manage the building process.
3) Install a GIT client
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:
- press the Clone / New button in SourceTree
https://github.com/projectchrono/chrono.gitin the field "Source Path / URL"
- enter a path to an empty directory, say
C:/chrono_source, in the field "Destination path"
- press Clone, and the source code will be downloaded to your directory.
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
6) Run CMake
Start the CMake tool to configure the build.
- 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
- 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
- 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.
- Activate the needed units with check-marks: at least click on ENABLE_MODULE_IRRLICHT, ENABLE_MODULE_POSTPROCESS. Other modules might require additional settings and dependencies.
- Press Configure.
- Set the directory in CH_IRRLICHTDIR: it must contain the path to the directory where you unzipped Irrlicht. In our example, browse to
- Set the library in CH_IRRLICHTLIB: it must contain the file of the Irrlicht.lib. In our example, browse to
- Press Configure.
- Remember that you might need to press Configure after you change some setting, even multiple times, until all the labels do not have a red background any longer.
- Finally, press Generate. At this point you just finished creating a project to build Chrono. You can close CMake.
7) Compile the project
- Go to the directory that you set in "Where to build the binaries". You will find a file ChronoEngine.sln
- Double-click on that file: your Visual Studio project will open.
- Choose 'Debug' mode using the dropbox 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 directory. This will take a few minutes.
- Choose 'Release' mode using the dropbox 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 directory. 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/Debug directory. There you will find the demo_xxxxx.exe files that you can launch by double-clicking on them.