This post explains how to download and install YARS on macOS and Linux.
Requirements
To install YARS, you will need the following packages and tools:
- boost
- bullet
- xerces-c
- ogre-1.9 (optional)
- libquicktime (optional)
- cmake
- ninja (optional)
boost, bullet, xerces-c and cmake are required. Ogre3D is required for visualisation, but YARS can also be compiled without GUI for cluster usage. libquicktime is required to generate videos directly from YARS. Generating frame by frame image sequences is also possible if libquicktime is not installed. I recommend to install ninja, because it is a faster make.
macOS Sierra
- Assuming you use homebrew , install the required packages with the following command:
brew install cmake ninja xerces-c libquicktime bullet boost
. Depending on your settings, this make take a while (boost takes some time to compile). - Open the terminal and navigate to the directory in which you want to download the YARS source, e.g.
cd ~/projects/
- Either download the source as zip from the YARS Github Repository or download it using git
git clone https://github.com/kzahedi/YARS
- Create a build directory
mkdir YARS/build
and navigate to itcd YARS/build
- The standard compile configuration should be sufficient to start with, which is why a
cmake ..
should work well. In case you want to review or change some settings, I recommend to use cmake-ncursesccmake ..
. To use ninja instead of make, both commands must becmake -G Ninja ..
orccmake -G Ninja ..
. - Compile with
make
orninja
. - To test YARS, run the following command
./bin/yars xml/braitenberg.xml
.
Ubuntu 18.04
1 |
sudo apt install libboost-all-dev libbullet-dev libogre-1.9-dev libsdl2-dev libxerces-c-dev git cmake cmake-curses-gui libglew-dev libzzip-dev libfreeimage-dev libfreetype6-dev python3-dev python3-numpy |
After installing the required and useful packages, the next step is to download and configure YARS.
1 2 3 4 5 |
git clone https://github.com/kzahedi/YARS cd YARS mkdir build cd build ccmake .. |
Choose the options that you like to activate/deactivate. Press ‘c’ until the ‘g’ option shows up. Press ‘g’. Then
1 2 |
make -j ./bin/yars xml/braitenberg.xml |
Depending on your system, you might have to add the following line to your shell-rc, so that YARS can find the Ogre libraries.
1 |
export LD_LIBRARY_PATH=/usr/lib/x86_64-linux-gnu/OGRE-1.9.0/ |
If everything works out fine, you should see the Braitenberg vehicle simulation as shown below.