Requirements and Installation Instructions - ascar-io/pilot-bench GitHub Wiki

Requirements

Pilot requires a modern C++ compiler, CMake, ncurses, and the boost C++ library. Python development library is needed if you need to build Python support.

It also uses libcdk for the text UI and gtest (Google Test) for running test cases. Both libraries will be automatically downloaded and compiled when you run make for the first time.

Additionally, if you want to plot the results from some sample programs, you will need Python 2.* and matplotlib.

Set Up Your System

Red Hat Enterprise Linux / CentOS 7

You can set up the development environment manually, using Vagrant, or using Ansible. Setup Your Development Environment Using Ansible on CentOS 7 is easy and fast, and that's what our developers use to set up our own development machines. But please be warned that the Ansible playbook alters your system by installing RPM packages. It also installs latest version Boost to /opt, which may not be what you like. It should be used with care in complex environments.

If you don't have a dedicated host, you can easily develop or build Pilot in a VM using Vagrant (see Setup Your Development Environment Using Vagrant on CentOS 7).

Finally for best control, you can set up your development environment manually (see Manually Setup Development Environment on CentOS 7), it is not hard and shouldn't take more than 30 minutes.

Setup Your Development Environment Using Ansible on CentOS 7

To use Ansible, you should add your host to Ansible's inventory file and run:

ansible-playbook -l YOUR_HOST build-env/centos7-x64/bootstrap-pilot-builder.yaml

Please refer to Ansible's documentation for Ansible-specific instructions.

Setup Your Development Environment Using Vagrant on CentOS 7

Vagrant is a good tool for quickly setting up a development environment in a virtual machine:

cd build-env/centos7-x64
vagrant up

Our Vagrantfile by default uses a large amount of memory and many CPUs (we use it for fast nightly build). Feel free to trim it down to meet your machine's configuration by tweaking the v.memory and v.cpus line in the Vagrantfile.

After that you can just vagrant ssh into the VM and clone Pilot from source, install your tools, and do development or build.

Manually Setup Development Environment on CentOS 7

First enable the EPEL and SCL repository, and install development tools:

yum install epel-release centos-release-scl
yum install bc cmake3 gcc-c++ git graphviz ncurses-devel lua-devel readline-devel patch

Next we need to install a recent version of Boost (RHEL7 shipped with old Boost 1.53.0). Download the latest Boost source and unpack it to, say, ~/boost_1_61_0.

cd ~/boost_1_61_0; ./bootstrap.sh --prefix=/usr/local/
./b2 -j4 variant=release link=static install
sudo ./b2 install

Optional packages for compiling documentation, doing tests, and running evaluation scripts: doxygen valgrind numpy python-matplotlib

Mac OS X

  1. For Mac, make sure you have the latest Xcode and command line development tools installed.
  2. Install the required tools. If you are using MacPort you can install the following packages:
sudo port install cmake boost graphviz ncurses lua readline

The following Python packages are not needed for the function of Pilot, but they are needed if you'd like to run the test and evaluation scripts in the lib/test directory: numpy matplotlib.

The Boost library from MacPort does not build some static libraries. So if you plan to build a statically linked pilot binary (e.g. for packaging and distributing to other Mac users), please install the boost C++ library from the source. The following steps are tested with [Boost 1.59.0](http://www.boost.org/users/history/version_1_59_0.html):

  1. download the latest Boost source and unpack it to, say, ~/boost_1_59_0
  2. cd ~/boost_1_59_0; ./bootstrap.sh --prefix=/usr/local/
  3. ./b2 -j4 variant=release link=static
  4. sudo ./b2 install

Ubuntu

Install the following packages:

sudo apt-get install git cmake libboost-all-dev g++ graphviz libncurses5-dev liblua5.3-dev libreadline-dev

Optional packages for compiling documentation, doing tests, and running evaluation scripts: doxygen python-matplotlib valgrind python-numpy. You can also install dh-make if you need to build the deb package.

Building Pilot

mkdir build
cd build
cmake ..
make

And you can run test cases:

ctest -R unit_test

The above command only runs unit tests and should be fast.

or run all test cases:

make test

Some of the lengthy functional test cases need a few minutes and a couple of GB disk space in /tmp.

You can add -DCMAKE_BUILD_TYPE=Debug to step 3 if you need to disable the compiler optimization for debugging purposes. The default build type is RelWithDebInfo, which enables both optimization and debug info.

If you need to use a specific boost installation, add -DBOOST_ROOT=/path/to/install/boost to step 3.

If you need to build statically linked libraries, which will not require libboost libraries, add -DBoost_USE_STATIC_LIBS=ON to step 3.

⚠️ **GitHub.com Fallback** ⚠️