Building from source
For downloading Tarantool source and building it, the platforms can differ and the preferences can differ. But strategically the steps are always the same.
Get tools and libraries that will be necessary for building and testing.
The absolutely necessary ones are:
A program for downloading source repositories.
For all platforms, this isgit
. It allows downloading the latest complete set of source files from the Tarantool repository on GitHub.A C/C++ compiler.
Ordinarily, this isgcc
andg++
version 4.6 or later. On Mac OS X, this isClang
version 3.2+.A program for managing the build process.
For all platforms, this isCMake
version 2.8+.A build automation tool.
For all platforms this isGNU Make
.ReadLine library, any version
ncurses library, any version
OpenSSL library, version 1.0.1+
ICU library, recent version
Autoconf library, any version
Automake library, any version
Libtool library, any version
Zlib-devel library, any version
Python and modules.
Python interpreter is not necessary for building Tarantool itself, unless you intend to use the “Run the test suite” option in step 5. For all platforms, this ispython
version 2.7+ (but not 3.x). You need the following Python modules:- pyyaml version 3.10
- argparse version 1.1
- msgpack-python version 0.4.6
- gevent version 1.1.2
- six version 1.8.0
To install all required dependencies, follow the instructions for your OS:
For Debian/Ubuntu, say:
$ apt install -y build-essential cmake make coreutils sed \ autoconf automake libtool zlib1g-dev \ libreadline-dev libncurses5-dev libssl-dev \ libunwind-dev libicu-dev \ python python-pip python-setuptools python-dev \ python-msgpack python-yaml python-argparse python-six python-gevent
For RHEL/CentOS (versions under 8)/Fedora, say:
$ yum install -y gcc gcc-c++ cmake make coreutils sed \ autoconf automake libtool zlib-devel \ readline-devel ncurses-devel openssl-devel \ libunwind-devel libicu-devel \ python python-pip python-setuptools python-devel \ python-msgpack python-yaml python-argparse python-six python-gevent
For CentOS 8, say:
$ yum install epel-release $ curl -s https://packagecloud.io/install/repositories/packpack/backports/script.rpm.sh | sudo bash $ yum install -y gcc gcc-c++ cmake make coreutils sed \ autoconf automake libtool zlib-devel \ readline-devel ncurses-devel openssl-devel \ libunwind-devel libicu-devel \ python2 python2-pip python2-setuptools python2-devel \ python2-yaml python2-six
For Mac OS X (instructions below are for OS X El Capitan):
If you’re using Homebrew as your package manager, say:
$ brew install cmake make autoconf binutils zlib \ autoconf automake libtool \ readline ncurses openssl libunwind-headers icu4c \ && pip install python-daemon \ msgpack-python pyyaml configargparse six gevent
Note
You can not install zlib-devel package this way.
Alternatively, download Apple’s default Xcode toolset:
$ xcode-select --install $ xcode-select -switch /Applications/Xcode.app/Contents/Developer
For FreeBSD (instructions below are for FreeBSD 10.1+ release), say:
$ pkg install -y sudo git cmake gmake gcc coreutils \ autoconf automake libtool \ readline ncurses openssl libunwind icu \ python27 py27-pip py27-setuptools py27-daemon \ py27-msgpack py27-yaml py27-argparse py27-six py27-gevent
If some Python modules are not available in a repository, it is best to set up the modules by getting a tarball and doing the setup with
python setup.py
like this:$ # On some machines, this initial command may be necessary: $ wget https://bootstrap.pypa.io/ez_setup.py -O - | sudo python $ # Python module for parsing YAML (pyYAML), for test suite: $ # (If wget fails, check at http://pyyaml.org/wiki/PyYAML $ # what the current version is.) $ cd ~ $ wget http://pyyaml.org/download/pyyaml/PyYAML-3.10.tar.gz $ tar -xzf PyYAML-3.10.tar.gz $ cd PyYAML-3.10 $ sudo python setup.py install
Finally, use Python
pip
to bring in Python packages that may not be up-to-date in the distro repositories. (On CentOS 7, it will be necessary to installpip
first, withsudo yum install epel-release
followed bysudo yum install python-pip
.)$ pip install -r \ https://raw.githubusercontent.com/tarantool/test-run/master/requirements.txt \ --user
This step is only necessary once, the first time you do a download.
Use
git
to download the latest Tarantool source code from the GitHub repositorytarantool/tarantool
, branch 2.2, to a local directory named~/tarantool
, for example:$ git clone --recursive https://github.com/tarantool/tarantool.git -b 2.2 ~/tarantool
On rare occasions, the submodules need to be updated again with the command:
cd ~/tarantool $ git submodule update --init --recursive
Use CMake to initiate the build.
$ cd ~/tarantool $ make clean # unnecessary, added for good luck $ rm CMakeCache.txt # unnecessary, added for good luck $ cmake . # start initiating with build type=Debug
On some platforms, it may be necessary to specify the C and C++ versions, for example:
$ CC=gcc-4.8 CXX=g++-4.8 cmake .
The CMake option for specifying build type is
-DCMAKE_BUILD_TYPE=type
, wheretype
can be:Debug
– used by project maintainersRelease
– used only if the highest performance is requiredRelWithDebInfo
– used for production, also provides debugging capabilities
The CMake option for hinting that the result will be distributed is
-DENABLE_DIST=ON
. If this option is on, then latermake install
will installtarantoolctl
files in addition totarantool
files.Use
make
to complete the build.$ make
Note
For FreeBSD, use
gmake
instead.This creates the ‘tarantool’ executable in the
src/
directory.Note
If you encounter a
curl
orOpenSSL
errors on this step try installingopenssl111
package of the specific1.1.1d
version.Next, it’s highly recommended to say
make install
to install Tarantool to the/usr/local
directory and keep your system clean. However, it is possible to run the Tarantool executable without installation.
Run the test suite.
This step is optional. Tarantool’s developers always run the test suite before they publish new versions. You should run the test suite too, if you make any changes in the code. Assuming you downloaded to
~/tarantool
, the principal steps are:$ # make a subdirectory named `bin` $ mkdir ~/tarantool/bin $ # link Python to bin (this may require superuser privileges) $ ln /usr/bin/python ~/tarantool/bin/python $ # get to the test subdirectory $ cd ~/tarantool/test $ # run tests using Python $ PATH=~/tarantool/bin:$PATH ./test-run.py
The output should contain reassuring reports, for example:
====================================================================== TEST RESULT ------------------------------------------------------------ box/bad_trigger.test.py [ pass ] box/call.test.py [ pass ] box/iproto.test.py [ pass ] box/xlog.test.py [ pass ] box/admin.test.lua [ pass ] box/auth_access.test.lua [ pass ] ... etc.
To prevent later confusion, clean up what’s in the
bin
subdirectory:$ rm ~/tarantool/bin/python $ rmdir ~/tarantool/bin
Make RPM and Debian packages.
This step is optional. It’s only for people who want to redistribute Tarantool. We highly recommend to use official packages from the tarantool.org web-site. However, you can build RPM and Debian packages using PackPack or using the
dpkg-buildpackage
orrpmbuild
tools. Please consultdpkg
orrpmbuild
documentation for details.Verify your Tarantool installation:
$ # if you installed tarantool locally after build $ tarantool $ # - OR - $ # if you didn't install tarantool locally after build $ ./src/tarantool
This starts Tarantool in the interactive mode.
See also: