Compile MaNGOS On Linux
From mangos
This guide is kept as generic as possible to suit most Linux systems. Basic knowledge about your distribution is assumed.
Contents |
Get your packages
To begin, you must install the following: (Enables you to compile MaNGOS)
- GCC >= 4.0 ( gcc / g++ / cpp / fort77 / g77 / gpp)
- CMake >= 2.8 (you may need to download and compile from sources if your packaged version is too old)
- automake (not necessary with new cmake build method)
- autoconf (not necessary with new cmake build method)
- glibc & glibc-dev(glibc headers) [ libc6 ]
- make
- mysql-client 4.1 or 5.x libs and development files (-dev or -devel package) that match your mysql server
- libtool
- OpenSSL with development files (libssl-dev or similar package name)
- subversion
- git
- zlib/libz with development files
Optionally (saves compile time):
- ACE >= 5.6.3
- TBB
NOTE: The following install examples may be outdated and/or incomplete
Make sure you are root first or are in the sudoers file before attempting anything below.
On Debian you are able to install packages using the Terminal:
apt-get install gcc g++ automake autoconf make cmake libmysqlclient-dev libtool libssl-dev subversion patch zlib1g-dev libc6 git git-core pkg-config
Ubuntu users also can follow Compile MaNGOS On Ubuntu or continue using this guide with the following:
sudo apt-get update sudo apt-get install build-essential cmake automake autoconf libmysqlclient-dev libtool libssl-dev subversion zlib1g-dev git-core pkg-config
Fedora users can use the following yum packages:
sudo yum install gcc gcc-c++ automake autoconf make cmake mysql-devel libtool openssl-devel subversion patch zlib-devel git-core pkgconfig
Configure git if required
By default, running 'git' on Debian will attempt to run another application other than the git version control utility, the code below will configure this to work properly. Ubuntu users don't need to run this step.
First run:
/usr/bin/git-scm
Make note of the information displayed and enter the corresponding numerals when prompted after running the command below:
update-alternatives --config git
Obtain sources
You can clone the latest version of mangos by running this command:
git clone git://github.com/mangos/mangos.git mangos
Change directories into the folder that was just created
cd mangos
There is an auxiliary project called ScriptDev2 which provides an advanced scripting library for mangos, you need to create a directory within your mangos folder to hold these sources.:
mkdir src/bindings/ScriptDev2
Script2Dev uses git to manage their codebase, so check it out using this line:
git clone git://github.com/scriptdev2/scriptdev2.git src/bindings/ScriptDev2
Now we need to apply the SD2 (ScriptDev2) patch to include it into the build files. There will be a file named similar to the one listed in the command below, generally you can just use tab completion to fill the XXXX part.
git apply src/bindings/ScriptDev2/patches/MaNGOS-XXXX-ScriptDev2.patch
Compile the sources
If the ScriptDev2 patched itself into mangos correctly (no errors) you can go ahead and build it, run these commands:
mkdir build
cd build
cmake ..
You may also set a few options with -D on the cmake command:
- PREFIX=<path> will set the install location prefix to <path>
- PCH=1 will use precompiled headers, may reduce build times signifficantly, especially with SD2, but may not work for everyone
- ACE_USE_EXTERNAL=1 will use system wide install of ACE, this will save compile time (must be installed, of course)
- ACE_USE_EXTERNAL=0 will use ACE that comes with mangos source
- TBB_USE_EXTERNAL=1 will use system wide install of TBB, this will save compile time (must be installed, of course)
- TBB_USE_EXTERNAL=0 will use TBB that comes with the mangos source
Example:
cmake ../ -DPREFIX=/opt/mangos -DPCH=1 -DACE_USE_EXTERNAL=1 -DDEBUG=0 -DTBB_USE_EXTERNAL=0
You may also use cmake-gui instead of cmake if you have installed it, to set most options with the GUI.
When CMake is finished, you will have the Makefiles in the current directory (..../mangos/build/) and are ready to compile:
make -j [#ofCores +1 ie: 3 for a dual core](if the "make -j" does not work for you, just use "make")
make install
Now proceed with the guide to set MaNGOS up
If you are not new to MaNGOS please add instructions to the " Setting up MaNGOS in Linux " page as the above Setup page is mostly WIndows information.
Based on sources from
- http://getmangos.com/community/topic/4011 This is also the forum where you can get help/ask questions related to this guide.
- http://wiki.github.com/mangos/mangos/how-to-compile-mangos-on-linux