Copyright © 2019 MariaDB. All rights reserved.
MariaDB Server Documentation
Getting, Installing, and Upgrading MariaDB
Compiling MariaDB From Source
Build Environment Setup for Linux
Build Environment Setup for Linux - Source
<<toc>> == Required Tools The following is a list of tools that are required for building MariaDB on Linux and Mac OS X. Most, if not all, of these will exist as packages in your distribution's package repositories, so check there first. See [[building-mariadb-on-ubuntu|Building MariaDB on Ubuntu]], [[building-mariadb-on-centos|Building MariaDB on CentOS]], and [[building-mariadb-on-gentoo|Building MariaDB on Gentoo]] pages for specific requirements for those platforms. * [[https://git-scm.com/|git]] * [[http://www.gzip.org/|gunzip]] * [[http://www.gnu.org/software/tar/|GNU tar]] * [[http://gcc.gnu.org/|gcc 3.4.6 or later]] * [[http://gcc.gnu.org/|g++]] * [[http://www.gnu.org/software/make/|GNU make 3.75 or later]] * [[http://www.gnu.org/software/bison/|bison (2.0 for MariaDB 5.5)]] * [[http://www.gnu.org/software/ncurses/|libncurses]] * [[http://www.zlib.net/|zlib-dev]] * [[http://libevent.org|libevent-dev]] * [[http://www.cmake.org|cmake]] * [[http://www.gnutls.org|gnutls]] or [[http://www.openssl.org|openssl]] * [[http://www.canonware.com/jemalloc|jemalloc]] (optional) You can install these programs individually through your package manager. In addition, some package managers support the use a build dependency command. When using this command, the package manager retrieves a list of build dependencies and install them for you, making it much easier to get started on the compile. The actual option varies, depending on the distribution you use. On Ubuntu and Debian you can use the ##build-dep## command. <<code>> # apt-get build-dep mariadb-server <</code>> Fedora uses the ##builddep## command with DNF. <<code>> # dnf builddep mariadb-server <</code>> CentOS has a separate utility ##yum-builddep##, which is part of the ##yum-utils## package. This works like the DNF ##builddep## command. <<code>> # yum install yum-utils # yum-builddep mariadb-server <</code>> With openSUSE and SUSE, you can use the source-install command. <<code>> # zypper source-install -d mariadb <</code>> Each of these commands works off of the release of MariaDB provided in the official software repositories of the given distribution. In some instances and especially in older versions of Linux, MariaDB may not be available in the official repositories. In these cases you can use the MariaDB repositories as an alternative. Bear in mind, the release of MariaDB provided by your distribution may not be the same as the version you are trying to install. Additionally, the package managers don't always retrieve all of the packages you need to compile MariaDB. There may be some missed or unlisted in the process. When this is the case, CMake fails during checks with an error message telling you what's missing. <<style class="bluebox" style="font-size:0.8em;">> Note: On Debian-based distributions, you may receive a //"You must put some 'source' URIs in your sources.list"// error. To avoid this, ensure that /etc/apt/sources.list contains the source repositories.\\ \\ For Debian Squeeze: <<code lang=sh>> deb http://ftp.debian.org/debian squeeze main contrib deb http://security.debian.org squeeze/updates main contrib deb-src http://ftp.debian.org/debian squeeze main contrib deb-src http://security.debian.org squeeze/updates main contrib <</code>> Refer to the documentation for your Linux distribution for how to do this on your system.\\ \\ After editing the sources.list, do: <<code lang=sh inline=false>> sudo apt-get update <</code>> ...and then the above mentioned ##build-dep## command. <</style>> <<style class="greenbox" style="font-size:0.8em;">> Note: On openSUSE the source package repository may be disabled. The following command will enable it: <<code lang=sh inline=false>> sudo zypper mr -er repo-source <</code>> After enabling it, you will be able to run the zypper command to install the build dependencies. <</style>> You should now have your build environment set up and can proceed to [[Getting the MariaDB Source Code]] and then using the [[generic-build-instructions|Generic Build Instructions]] to build MariadB (or following the steps for your Linux distribution or [[creating-the-mariadb-binary-tarball |Creating a MariaDB Binary Tarball]]). == See Also * [[installating-galera-from-source|Installing Galera from source]]