Skip to content

Compiling under Linux based Systems

peonso edited this page Jul 17, 2016 · 1 revision

Compiling OTHire under Linux based Systems

  • Installing required packages

Needed packages:

  • git
  • cmake
  • gcc
  • boost library
  • lua library
  • gmp library
  • libxml2 library
  • luajit library (optional)

For instance, if you have Ubuntu or a Debian based distribution you can install all the required packages with these commands using apt-get:

sudo apt-get install build-essential cmake git-core
sudo apt-get install libboost-all-dev libgmp3-dev liblua5.1-dev libxml2-dev

Downloading the sources

git clone git://github.com/peonso/tibialegacyserver.git
cd src

Configuring

First create a build directory

mkdir build
cd build

Via CMake command line

If don't want to supply any option, just run:

cmake ..

Otherwise you can supply some available options like USE_LUAJIT, USE_MYSQL, USE_SQLITE, USE_CPP11, USE_PCH. Example:

cmake .. -DUSE_LUAJIT=ON -DUSE_MYSQL=ON

If you do not have the libraries installed in the default locations, use -DCMAKE_INCLUDE_PATH= and -DCMAKE_LIBRARY_PATH to specify the search paths.

Via CMake graphical interface

You can use cmake-gui to configure before bulding, you will be able to change and check build options in the interface.

cmake-gui ..

Compiling

make

TIP: If you have multiple cores, use -j4 option to build using 4 cores.

Running

cd ..
./build/otserv