Build Instructions
Getting the Source
If you are using a release source archive/tarball (you can get the latest source in version control as an archive here), just extract the sources and goto Build Steps
If you wish to use version control yourself, you will need Git (see Set Up Git). Run the following command -
$ git clone https://github.com/pstavirs/ostinato.git
Once the command completes, the source code will be available in the ostinato
directory.
After cloning the repository, at any time to retrieve any further updates to the code, run from inside the ostinato
directory -
$ git pull
Prerequisites
Ostinato has the following dependencies -
- QT 5.9+
- Protocol Buffers 2.3+
- libpcap (Winpcap for Windows)
- libnl3, libnl-route3 (Linux only)
- bindconfig (for Windows - optional)
Build Steps
The following instructions use the command line shell to build Ostinato. If you wish to use the QtCreator IDE see Using QtCreator
Linux/BSD
Ensure that you have installed all the Prerequisites. Pre-built packages for all the pre-requisites can be obtained via your distribution's package manager (remember to use the devel packages); for protobuf, you need to install two packages - the protobuf devel library and the protobuf compiler (protoc)
Make sure that the protobuf compiler protoc
is in the path while building Ostinato.
Run the following commands from the top level directory -
$ qmake
$ make
$ make install
NOTE:
1. On some distros/releases, qmake
is named as qmake-qt4
, so if running qmake
returns a "not found"
error, try running qmake-qt4
1. qmake should be same version as Qt
1. make install
requires superuser privileges - depending on your platform either run it as root or via sudo
To provide a custom install path, pass PREFIX=/absolute/path/to/prefix/dir
to qmake. The binaries are installed in $PREFIX/bin/
. The default prefix for Unix platforms is /usr/local
.
You can use the qmake options -config debug
or -config release
to force either debug or release mode.
Windows
These instructions assume the MinGW compiler.
Ensure that you have installed all the Prerequisites. QT, Winpcap both offer pre-built ready-to-use binary packages. Protocol Buffers is however available as source only - you will need to build it first before you can build Ostinato. Some important points when building protobuf -
- Use the MSYS shell; you can not use the Windows cmd shell; you should not use cygwin
- Use the same MinGW compiler that was shipped with Qt
Once you have installed all the pre-requisites, set the CPLUS_INCLUDE_PATH
and LIBRARY_PATH
environment variables to include the path to the header and library files of all the pre-requisites. Also make sure that the protobuf compiler protoc.exe
is in your path while building Ostinato.
Run the following commands from the top level source directory -
$ qmake
$ make
$ make install
make install
will, by default, install the binaries in <top-level-directory>/bin
. To provide a custom install path, pass PREFIX=/absolute/path/to/prefix/dir
to qmake. The binaries are installed in $PREFIX/bin/
.
To enable exclusive control over a port and prevent stray packets being generated by the OS, Ostinato uses the bindconfig application. Download and copy the executable in the same directory as the server (drone.exe
)
Mac OS X
Ensure that you have installed all the Prerequisites. libpcap is typically available out of the box on Mac OS X. Qt is available via fink or macports. protobuf is available on macports but not on fink (at the time of this writing); you may build protobuf from source.
Make sure that the protobuf compiler protoc
is in the path while building Ostinato.
Run the following commands from the top level directory -
$ qmake -spec macx-g++
$ make
$ sudo make install
make install
will, by default, install the application bundles in /Applications/bin
. To provide a custom install path, pass PREFIX=/absolute/path/to/prefix/dir
to qmake. The bundles are installed in $PREFIX/bin/
.
You can use the qmake options -config debug
or -config release
to force either debug or release mode.
Using Qt Creator
Ensure that you have installed all the Prerequisites. See notes for your platform in Build Steps regarding the pre-requisites (ignore the ostinato build instructions there).
Once you have installed all the pre-requisites -
- Goto File | Open Project
- Select ost.pro
- Run Build | Build All
To run Ostinato, you need to run both the server and client executables - by default Qt Creator will just run one of them. To work around this, create a batch/shell script in the top-level directory which starts both the server and client and configure Qt Creator to run the batch/shell script -
- Goto Projects Mode (Ctrl-4) | Run Settings
- Click on 'Add'
- In the drop down select 'Custom Executable'
- Configure the ost.bat/ost.sh that you created as the executable
Windows Only: You will most likely need to configure the include and library paths for WinPcap and ProtoBuf in the project's build environment -
1. Goto Projects Mode (Ctrl-4) | Build Environment
1. Add/modify the following environment variables
* CPLUS_INCLUDE_PATH
* LIBRARY_PATH
Notes
If you would like to use Ostinato as a "portable application", create an empty file ostinato.ini
in the same directory as the Ostinato executable.