View Revision: EOSERV From Scratch - Linux
This tutorial will walk you through everything you need to build EOSERV on Linux. It assumes you have no development tools installed, and you are familiar with the command line.
Only the latest releases of Debian, Ubuntu and Linux Mint are officially supported distributions. Older releases (e.g. 12.04 LTS) may require newer versions of packages be installed via backports.
Installing build tools and dependencies
The following
- G++ 4.8 or later (g++) '''or''' Clang 3.4 or later (clang)
- CMake Qt GUI (cmake-qt-gui) '''or''' CMake Curses GUI (ccmake) - 2.6 or later
- Optional: MariaDB client development libraries (libmariadb-client-lgpl-dev)
- Optional: SQLite3 development libraries (libsqlite3-dev)
- Optional: Git
If you are using Debian or a Debian-based distro (e.g. Ubuntu or Linux Mint) you can use the following commands to install the required tools and dependencies (or install the packages via your system's GUI package manager):
sudo apt-get install g++ make cmake-curses-gui cmake-qt-gui \ libsqlite3-dev libmariadb-dev git
If sudo is missing, use the su command to switch to root and repeat the command without sudo. If building in a non-graphical environment (e.g. on a server over SSH) leave out cmake-qt-gui.
If you wish to build with Clang instead of G++, replace g++ with clang. If you wish to download a snapshot, subversion is not required. At least one of SQLite3 or MariaDB is required.
'''Note that package names may be different on non-Debian distros!'''
Obtaining the Source Code
There are two options for getting the EOSERV source:
- '''RECOMMENDED''': Use Git to obtain the source code from https://github.com/eoserv/eoserv/
- Follow the instructions on EOSERV_Git for instructions on obtaining the source code and keeping it up to date.
Alternatively,
- Visit http://files.eoserv.net/snaps/ and download the latest snapshot. Any GUI archive tool should be able to extract them, or you can use the following command on the command line:
tar -xf eoserv-trunk-rXXX.tar.gz
Snapshots are not recommended for serious work as it is difficult to update the code without destroying any of your own alternations.
Configuring
Option 1. CMake GUI (cmake-gui)
The most user-friendly way to configure EOSERV is to use the CMake GUI:
Use CMake's GUI (cmake-gui) to select a source directory (the directory EOSERV has been extracted to), and a build directory (a directory you want to build EOSERV in). To avoid problems, make sure the build directory is not the same as the source directory.
Click "Configure", and select your toolchain (GCC and Clang should be automatically detected, or compiler paths can be specified manually), and output format (Unix Makefiles). Various build options can be changed using the GUI (such as toggling MySQL/SQLite support) before clicking "Generate".
It is highly recommended to change the CMAKE_BUILD_TYPE option to either '''Debug''' (for development) or '''Release''' (for production).
If you get any errors about missing libraries, make sure the required packages are installed for those libraries.
Option 2. CMake Curses GUI (ccmake)
To create and configure a build directory using the text-only CMake GUI (ccmake), use the following commands:
mkdir /path/to/eoserv/build/ cd /path/to/eoserv/build/ ccmake -G "Unix Makefiles" /path/to/eoserv/source/
Once the GUI is opened, press '''c''' to configure, arrows keys and enter to edit configuration fields, '''c''' to configure again, then '''g''' to generate the makefiles and close the GUI.
It is highly recommended to change the CMAKE_BUILD_TYPE option to either '''Debug''' (for development) or '''Release''' (for production).
If you get any errors about missing libraries, make sure the required packages are installed for those libraries.
Building
Assuming CMake worked successfully, simply typing make in the build directory should compile and build EOSERV.
Using sudo make install will "install" (copy) the EOSERV files elsewhere, but make sure you configure a sensible CMAKE_INSTALL_PREFIX in CMake. Installing to the default /usr/local is a very bad idea. The preferred install path is /opt/eoserv.