Build Environment Setup for Linux
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 CentOS, and Building MariaDB on Gentoo pages for specific requirements for those platforms.
- git
- gunzip
- GNU tar
- gcc 3.4.6 or later
- g++
- GNU make 3.75 or later
- bison (2.0 for MariaDB 5.5)
- libncurses
- zlib-dev
- libevent-dev
- cmake
- gnutls or openssl
- jemalloc (optional)
On Linux you can get those programs with your package manager. On Mac OS X you need Xcode and install the remaining programs with Fink or MacPorts.
An easy way to install the needed programs on Linux is to run one of the following commands (depending on your Linux distribution):
sudo apt-get build-dep mysql-server # for Debian and Ubuntu-based distributions sudo yum-builddep mysql # for Fedora 17-18 (part of the yum-utils package) sudo yum-builddep mariadb # for Fedora 19+ (part of the yum-utils package) sudo zypper si -d mysql-community-server # for OpenSUSE
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:
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
Refer to the documentation for your Linux distribution for how to do this on your system.
After editing the sources.list, do:
sudo apt-get update
...and then the above mentioned build-dep
command.
Note: On openSUSE the source package repository may be disabled. The following command will enable it:
sudo zypper mr -er repo-source
After enabling it, you will be able to run the zypper command to install the build dependencies.
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 to build MariadB (or following the steps for your Linux distribution or Creating a MariaDB Binary Tarball).