Building MTASA Server on GNU Linux: Difference between revisions
(2 intermediate revisions by 2 users not shown) | |||
Line 33: | Line 33: | ||
Our network module (net.dll or net.so) is distributed as a precompiled binary library. The file for GNU/Linux can be found inside the lastest Linux nightly from [http://nightly.mtasa.com/ here]. Use the net.so from {{Current Version|master}} if you are compiling from the trunk, or the net.so from {{Current Version|full}} if you are compiling the {{Current Version|full}} branch. Be sure the read the top of ''Server/version.h'' as it contains directions on how to compile the different build types. | Our network module (net.dll or net.so) is distributed as a precompiled binary library. The file for GNU/Linux can be found inside the lastest Linux nightly from [http://nightly.mtasa.com/ here]. Use the net.so from {{Current Version|master}} if you are compiling from the trunk, or the net.so from {{Current Version|full}} if you are compiling the {{Current Version|full}} branch. Be sure the read the top of ''Server/version.h'' as it contains directions on how to compile the different build types. | ||
=== | === Ubuntu 20.04 === | ||
The following instructions are specifically for Ubuntu 20.04. | |||
You will need the | You will need to install the required build tools, headers, and libraries. These can be installed using the following packages: | ||
* '''build-essential:''' | * '''build-essential:''' provides tools, headers, and libraries required to build applications | ||
* '''automake:''' | * '''automake:''' provides tools for automatically generating Makefiles | ||
* '''libtool:''' | * '''libtool:''' required for building shared libraries | ||
* '''libreadline-gplv2-dev:''' provides the GNU readline library (version 5) | |||
* '''libncurses5-dev:''' provides tools for writing to the console screen | |||
* '''libncursesw5-dev:''' provides wide character support for ncurses | |||
* '''default-libmysqlclient-dev:''' provides the MySQL client development files | |||
* '''git:''' version control tool used to clone the code repository | |||
* '''libreadline-gplv2-dev:''' | * '''unzip:''' archive unpacking utility | ||
* '''libncurses5-dev:''' | |||
* '''libncursesw5-dev:''' | To install all required packages, run the following commands in the terminal (execute as root): | ||
* '''default-libmysqlclient-dev:''' | |||
* '''git:''' | |||
* '''unzip:''' | |||
To install | |||
apt-get update | |||
apt-get install build-essential automake libtool | apt-get install build-essential automake libtool | ||
apt-get install libreadline-gplv2-dev libncurses5-dev libncursesw5-dev | apt-get install libreadline-gplv2-dev libncurses5-dev libncursesw5-dev | ||
apt-get install default-libmysqlclient-dev git unzip | apt-get install default-libmysqlclient-dev git unzip | ||
=== Gentoo Linux === | === Gentoo Linux === | ||
Line 119: | Line 111: | ||
=== '''Troubleshooting''' === | === '''Troubleshooting''' === | ||
If you’re getting any unexpected errors while compiling, please check our [ | If you’re getting any unexpected errors while compiling, please check our [https://github.com/multitheftauto/mtasa-blue/issues GitHub issues] or our [https://discord.com/invite/GNN6PRtTnu development-focused Discord server]. | ||
<ul> | |||
<li>If you get a message saying "Killed" when running premake5 gmake (linux-build.sh), that usually means you ran out of memory.<br /> | |||
You can confirm this by searching for kill logs by running <code>sudo dmesg | grep -i kill</code><br /> | |||
A possible solution for this might be to [https://opensource.com/article/18/9/swap-space-linux-systems turn on swap] or upgrade your system memory temporarily.<br /> | |||
1 GB is likely '''not''' enough of memory to complete the build. | |||
</li> | |||
</ul> | |||
[[ru:Building MTASA Server on GNU Linux]] | [[ru:Building MTASA Server on GNU Linux]] | ||
[[Category: Development]] | [[Category: Development]] |
Latest revision as of 08:30, 14 April 2025
![]() |
This article needs checking. |
Reason(s): Confirm steps work. |
Installing and Running MTASA server on Linux
Preparing your system
In order to build the Multi Theft Auto dedicated server, you will have to set up your system with the correct libraries and tools. How these are installed depends on your distribution.
Our network module (net.dll or net.so) is distributed as a precompiled binary library. The file for GNU/Linux can be found inside the lastest Linux nightly from here. Use the net.so from 1.6 if you are compiling from the trunk, or the net.so from 1.6.0 if you are compiling the 1.6.0 branch. Be sure the read the top of Server/version.h as it contains directions on how to compile the different build types.
Ubuntu 20.04
The following instructions are specifically for Ubuntu 20.04.
You will need to install the required build tools, headers, and libraries. These can be installed using the following packages:
- build-essential: provides tools, headers, and libraries required to build applications
- automake: provides tools for automatically generating Makefiles
- libtool: required for building shared libraries
- libreadline-gplv2-dev: provides the GNU readline library (version 5)
- libncurses5-dev: provides tools for writing to the console screen
- libncursesw5-dev: provides wide character support for ncurses
- default-libmysqlclient-dev: provides the MySQL client development files
- git: version control tool used to clone the code repository
- unzip: archive unpacking utility
To install all required packages, run the following commands in the terminal (execute as root):
apt-get update apt-get install build-essential automake libtool apt-get install libreadline-gplv2-dev libncurses5-dev libncursesw5-dev apt-get install default-libmysqlclient-dev git unzip
Gentoo Linux
You will need the necessary build tools, headers and libraries. Because Gentoo’s portage system is designed to compile any packages on your own system, the necessary build tools will have already been installed. This only leaves you to install the necessary libraries:
- git: contains the git client used to check out our code repository
To compile and install these packages through emerge, use the emerge -v <package list> command. The -v option shows additional * * information and can be omitted. (If you want to use any USE flags, prepend emerge with USE="use flags here". You can also use the -pv option to verify that you’re using the correct flags.) Refer to the Gentoo Handbook or manual for more information on emerge.
Example:
emerge -v git sqlite USE=“net-misc/curl ssl” emerge -v curl
Fedora
You will need these packages to be able to successfully compile a MTA server on Fedora:
- glibc-devel:
- readline-devel: contains the readline library
- git: contains the git client to check out the source code
To install these packages through yum, use the yum install <package list> command as in the following example (execute as root):
yum install glibc-devel readline-devel git
General instructions for 1.6
Downloading the source.
First, you need to download the source. Either clone as shown below or download a zip snapshot
git clone https://github.com/multitheftauto/mtasa-blue.git mtasa-blue cd mtasa-blue
Then compile it thus:
./linux-build.sh
Then copy the configuration files, network module and resources into Bin/server by running this command:
./linux-install-data.sh
And the resources and stuff should be downloaded and stuff. As well as the net_d.dll file.
Troubleshooting
If you’re getting any unexpected errors while compiling, please check our GitHub issues or our development-focused Discord server.
- If you get a message saying "Killed" when running premake5 gmake (linux-build.sh), that usually means you ran out of memory.
You can confirm this by searching for kill logs by runningsudo dmesg | grep -i kill
A possible solution for this might be to turn on swap or upgrade your system memory temporarily.
1 GB is likely not enough of memory to complete the build.