From ee3fb0ea6690999734d5b347251949caddb705d0 Mon Sep 17 00:00:00 2001 From: Natalia Ogoreltseva Date: Thu, 25 Mar 2021 17:29:51 +0300 Subject: [PATCH 1/7] actualise building_from_source.rst --- doc/dev_guide/building_from_source.rst | 337 +++++++++++-------------- 1 file changed, 142 insertions(+), 195 deletions(-) diff --git a/doc/dev_guide/building_from_source.rst b/doc/dev_guide/building_from_source.rst index 4b7a9acb9c..7581101b6f 100644 --- a/doc/dev_guide/building_from_source.rst +++ b/doc/dev_guide/building_from_source.rst @@ -5,279 +5,226 @@ ------------------------------------------------------------------------------- For downloading Tarantool source and building it, the platforms can differ and -the preferences can differ. But strategically the steps are always the same. +the preferences can differ. But strategically the steps are always the same: -1. Get tools and libraries that will be necessary for building - and testing. +1. Get tools and libraries that will be necessary for building + and testing: - The absolutely necessary ones are: + * A program for downloading source repositories. - * A program for downloading source repositories. |br| - For all platforms, this is ``git``. It allows downloading the latest - complete set of source files from the Tarantool repository on GitHub. + For all platforms, this is ``git``. It allows downloading the latest + complete set of source files from the Tarantool repository on GitHub. - * A C/C++ compiler. |br| Ordinarily, this is ``gcc`` and ``g++`` version - 4.6 or later. On Mac OS X, this is ``Clang`` version 3.2+. + * A C/C++ compiler. - * A program for managing the build process. |br| For all platforms, this is - ``CMake`` version 2.8+. + Ordinarily, this is ``gcc`` and ``g++`` version 4.6 or later. + On Mac OS X, this is ``Clang`` version 3.2+. - * A build automation tool. |br| For all platforms this is ``GNU Make``. + * cmake - * `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 + * autoconf automake libtool - * Python and modules. |br| 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 is ``python`` version 2.7+ - (but not 3.x). You need the following Python modules: + * make - * `pyyaml `_ version 3.10 - * `argparse `_ version 1.1 - * `msgpack-python `_ version 0.4.6 - * `gevent `_ version 1.1.2 - * `six `_ version 1.8.0 + * Python and modules. - To install all required dependencies, follow the instructions for your OS: + Python interpreter is not necessary for building Tarantool itself, unless you + intend to use the “Run the test suite". For all platforms, this is python + version 3.x. You need the following Python modules: - * For Debian/Ubuntu, say: + * pyyaml + * gevent + * six - .. code-block:: console + To install all required dependencies, follow the instructions for your OS: - $ 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 Debian/Ubuntu, say: - * For RHEL/CentOS (versions under 8)/Fedora, say: + .. code-block:: console - .. code-block:: console + $ apt-get install -y \ + git build-essential cmake make coreutils autoconf automake libtool sed \ + python3 python3-yaml python3-six python3-gevent - $ 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 RHEL/CentOS (versions under 8)/Fedora, say: - * For CentOS 8, say: + .. code-block:: console - .. code-block:: console + $ yum install -y \ + git perl gcc cmake make gcc-c++ libstdc++-static autoconf automake libtool \ + python3-yaml python3-six python3-gevent - $ 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 CentOS 8, say: - * For Mac OS X (instructions below are for OS X El Capitan): + .. code-block:: console - If you're using Homebrew as your package manager, say: + $ yum install epel-release + $ curl -s https://packagecloud.io/install/repositories/packpack/backports/script.rpm.sh | sudo bash + $ yum install -y \ + git perl gcc cmake make gcc-c++ libstdc++-static autoconf automake libtool \ + python3-yaml python3-six python3-gevent - .. code-block:: console + * For Mac OS X: - $ 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 + Before you start please install default Xcode Tools by Apple: - .. NOTE:: + .. code-block:: console - You can not install `zlib-devel `_ package this way. + $ xcode-select --install + $ xcode-select -switch /Applications/Xcode.app/Contents/Developer - Alternatively, download Apple's default Xcode toolset: + Install brew using command from + `Homebrew repository instructions `_. - .. code-block:: console + After that run next script: - $ xcode-select --install - $ xcode-select -switch /Applications/Xcode.app/Contents/Developer + .. code-block:: console - * For FreeBSD (instructions below are for FreeBSD 10.1+ release), say: + $ brew install autoconf automake libtool cmake + $ pip --user -r test-run/requirements.txt - .. code-block:: console + .. NOTE:: - $ 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 + Read how to manually build tarantool using external package managers + (Homebrew or MacPorts) for Mac OS on + `GitHub `_. - 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: + * For FreeBSD (instructions below are for FreeBSD 10.4+ release + and FreeBSD 11 release), say: - .. code-block:: console + .. code-block:: console - $ # On some machines, this initial command may be necessary: - $ wget https://bootstrap.pypa.io/ez_setup.py -O - | sudo python + $ pkg install git cmake gmake readline icu \ + python27 py27-yaml py27-daemon py27-msgpack - $ # 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 + 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: - 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 install ``pip`` first, - with :code:`sudo yum install epel-release` followed by - :code:`sudo yum install python-pip`.) + .. code-block:: console - .. code-block:: console + $ # On some machines, this initial command may be necessary: + $ wget https://bootstrap.pypa.io/ez_setup.py -O - | sudo python - $ pip install -r \ - https://raw.githubusercontent.com/tarantool/test-run/master/requirements.txt \ - --user + $ # 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 - This step is only necessary once, the first time you do a download. + 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 install ``pip`` first: -2. Use ``git`` to download the latest Tarantool source code from the - GitHub repository ``tarantool/tarantool``, branch 2.2, to a - local directory named ``~/tarantool``, for example: + .. code-block:: console - .. code-block:: console + $ sudo yum install epel-release + $ sudo yum install python-pip + $ pip install --user --force-reinstall -r test-run/requirements.txt - $ git clone --recursive https://github.com/tarantool/tarantool.git -b 2.2 ~/tarantool + This step is only necessary once, the first time you do a download. - On rare occasions, the submodules need to be updated again with the - command: +2. Use ``git`` to download the latest Tarantool source code from the + GitHub repository ``tarantool/tarantool``, branch ``master``, to a + local directory named ``~/tarantool``, for example: - .. code-block:: console + .. code-block:: console - cd ~/tarantool - $ git submodule update --init --recursive + $ git clone https://github.com/tarantool/tarantool.git --recursive -3. Use CMake to initiate the build. + Update submodules: - .. code-block:: console + .. code-block:: console - $ cd ~/tarantool - $ make clean # unnecessary, added for good luck - $ rm CMakeCache.txt # unnecessary, added for good luck - $ cmake . # start initiating with build type=Debug + $ cd ~/tarantool + $ git submodule update --init --recursive - On some platforms, it may be necessary to specify the C and C++ versions, - for example: +3. Use CMake to initiate the build: - .. code-block:: console + .. code-block:: console - $ CC=gcc-4.8 CXX=g++-4.8 cmake . + $ cd ~/tarantool + $ make clean # unnecessary, added for good luck + $ rm CMakeCache.txt # unnecessary, added for good luck + $ cmake . # start initiating with build type=Debug - The CMake option for specifying build type is :samp:`-DCMAKE_BUILD_TYPE={type}`, - where :samp:`{type}` can be: + On some platforms, it may be necessary to specify the C and C++ versions, + for example: - * ``Debug`` -- used by project maintainers - * ``Release`` -- used only if the highest performance is required - * ``RelWithDebInfo`` -- used for production, also provides debugging capabilities - - The CMake option for hinting that the result will be distributed is - :code:`-DENABLE_DIST=ON`. If this option is on, then later ``make install`` - will install ``tarantoolctl`` files in addition to ``tarantool`` files. - -4. Use ``make`` to complete the build. - - .. code-block:: console + .. code-block:: console - $ make + $ CC=gcc-4.8 CXX=g++-4.8 cmake . - .. NOTE:: + The CMake option for specifying build type is :samp:`-DCMAKE_BUILD_TYPE={type}`, + where :samp:`{type}` can be: - For FreeBSD, use ``gmake`` instead. - - This creates the 'tarantool' executable in the ``src/`` directory. - - .. NOTE:: - - If you encounter a ``curl`` or ``OpenSSL`` errors on this step try - installing ``openssl111`` package of the specific ``1.1.1d`` version. + * ``Debug`` -- used by project maintainers + * ``RelWithDebInfo`` -- used for production, also provides debugging capabilities - 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. + The CMake option for hinting that the result will be distributed is + :code:`-DENABLE_DIST=ON`. If this option is on, then later ``make install`` + will install ``tarantoolctl`` files in addition to ``tarantool`` files. -.. _run_test_suite: +4. Use ``make`` to complete the build. -5. Run the test suite. + .. code-block:: console - 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 - .. code-block:: console + .. NOTE:: - $ # make a subdirectory named `bin` - $ mkdir ~/tarantool/bin + For FreeBSD, use ``gmake`` instead. - $ # link Python to bin (this may require superuser privileges) - $ ln /usr/bin/python ~/tarantool/bin/python + This creates the 'tarantool' executable in the ``src/`` directory. - $ # get to the test subdirectory - $ cd ~/tarantool/test + .. NOTE:: - $ # run tests using Python - $ PATH=~/tarantool/bin:$PATH ./test-run.py + If you encounter a ``curl`` or ``OpenSSL`` errors on this step try + installing ``openssl111`` package of the specific ``1.1.1d`` version. - The output should contain reassuring reports, for example: + 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. - .. code-block:: bash +.. _run_test_suite: - ====================================================================== - 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. +5. Run the test suite. - To prevent later confusion, clean up what's in the ``bin`` subdirectory: + 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``, say: - .. code-block:: console + .. code-block:: console - $ rm ~/tarantool/bin/python - $ rmdir ~/tarantool/bin + $ make test -6. Make RPM and Debian packages. +6. 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`` or ``rpmbuild`` tools. Please consult - ``dpkg`` or ``rpmbuild`` documentation for details. + 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 `_. Consult + `Build RPM or Deb package using packpack + `_ + for details. -7. Verify your Tarantool installation: +7. Verify your Tarantool installation: - .. code-block:: bash + .. code-block:: bash - $ # if you installed tarantool locally after build - $ tarantool - $ # - OR - - $ # if you didn't install tarantool locally after build - $ ./src/tarantool + $ # 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. + This starts Tarantool in the interactive mode. See also: -* `Tarantool README.md `_ +* `Tarantool README.md `_ From b72e1696d8665c6dec0c3818a9793d1d7e44b9c5 Mon Sep 17 00:00:00 2001 From: Natalia Ogoreltseva Date: Thu, 25 Mar 2021 18:23:37 +0300 Subject: [PATCH 2/7] correct instructions --- doc/dev_guide/building_from_source.rst | 31 +++++++++++++++++++++----- 1 file changed, 25 insertions(+), 6 deletions(-) diff --git a/doc/dev_guide/building_from_source.rst b/doc/dev_guide/building_from_source.rst index 7581101b6f..b8fbb064fd 100644 --- a/doc/dev_guide/building_from_source.rst +++ b/doc/dev_guide/building_from_source.rst @@ -44,14 +44,28 @@ the preferences can differ. But strategically the steps are always the same: $ apt-get install -y \ git build-essential cmake make coreutils autoconf automake libtool sed \ + zlib1g-dev libreadline-dev libncurses5-dev libssl-dev \ + libunwind-dev libicu-dev \ python3 python3-yaml python3-six python3-gevent - * For RHEL/CentOS (versions under 8)/Fedora, say: + * For Fedora, say: .. code-block:: console - $ yum install -y \ - git perl gcc cmake make gcc-c++ libstdc++-static autoconf automake libtool \ + $ yum install -y git gcc gcc-c++ cmake make coreutils sed \ + autoconf automake libtool zlib-devel \ + readline-devel ncurses-devel openssl-devel \ + libunwind-devel libicu-devel \ + python3-yaml python3-six python3-gevent + + * For RHEL/CentOS (versions under 8), say: + + .. code-block:: console + + $ yum install epel-release + $ yum install -y git gcc cmake3 make gcc-c++ coreutils sed autoconf automake \ + libtool zlib-devel readline-devel ncurses-devel openssl-devel \ + libunwind-devel libicu-devel \ python3-yaml python3-six python3-gevent * For CentOS 8, say: @@ -61,7 +75,9 @@ the preferences can differ. But strategically the steps are always the same: $ yum install epel-release $ curl -s https://packagecloud.io/install/repositories/packpack/backports/script.rpm.sh | sudo bash $ yum install -y \ - git perl gcc cmake make gcc-c++ libstdc++-static autoconf automake libtool \ + git gcc cmake3 make gcc-c++ coreutils sed autoconf automake \ + libtool zlib-devel readline-devel ncurses-devel openssl-devel \ + libunwind-devel libicu-devel \ python3-yaml python3-six python3-gevent * For Mac OS X: @@ -94,8 +110,11 @@ the preferences can differ. But strategically the steps are always the same: .. code-block:: console - $ pkg install git cmake gmake readline icu \ - python27 py27-yaml py27-daemon py27-msgpack + $ 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 From 7a03e59fbc7bc5706b1e36b400d431dffd21afee Mon Sep 17 00:00:00 2001 From: Natalia Ogoreltseva Date: Fri, 26 Mar 2021 10:42:05 +0300 Subject: [PATCH 3/7] update list of libraries --- doc/dev_guide/building_from_source.rst | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) diff --git a/doc/dev_guide/building_from_source.rst b/doc/dev_guide/building_from_source.rst index b8fbb064fd..96e2bc3e4f 100644 --- a/doc/dev_guide/building_from_source.rst +++ b/doc/dev_guide/building_from_source.rst @@ -20,11 +20,26 @@ the preferences can differ. But strategically the steps are always the same: Ordinarily, this is ``gcc`` and ``g++`` version 4.6 or later. On Mac OS X, this is ``Clang`` version 3.2+. - * cmake + * A program for managing the build process. + For all platforms, this is ``CMake`` version 3.1. - * autoconf automake libtool + * A build automation tool. For all platforms this is ``GNU Make``. - * make + * `ReadLine `_ library, any version + + * `ncurses `_ library, any version + + * `OpenSSL `_ library, any version + + * `ICU `_ library, recent version + + * `Autoconf `_ library, any version + + * `Automake `_ library, any version + + * `Libtool `_ library, any version + + * `Zlib-devel `_ library, any version * Python and modules. From 03764a398e258a7b16f6780a8beaec0de2738440 Mon Sep 17 00:00:00 2001 From: Natalia Ogoreltseva Date: Fri, 26 Mar 2021 10:53:26 +0300 Subject: [PATCH 4/7] fix indentation --- doc/dev_guide/building_from_source.rst | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/doc/dev_guide/building_from_source.rst b/doc/dev_guide/building_from_source.rst index 96e2bc3e4f..d8b8b569e3 100644 --- a/doc/dev_guide/building_from_source.rst +++ b/doc/dev_guide/building_from_source.rst @@ -195,8 +195,8 @@ the preferences can differ. But strategically the steps are always the same: The CMake option for specifying build type is :samp:`-DCMAKE_BUILD_TYPE={type}`, where :samp:`{type}` can be: - * ``Debug`` -- used by project maintainers - * ``RelWithDebInfo`` -- used for production, also provides debugging capabilities + * ``Debug`` -- used by project maintainers + * ``RelWithDebInfo`` -- used for production, also provides debugging capabilities The CMake option for hinting that the result will be distributed is :code:`-DENABLE_DIST=ON`. If this option is on, then later ``make install`` @@ -248,7 +248,7 @@ the preferences can differ. But strategically the steps are always the same: 7. Verify your Tarantool installation: - .. code-block:: bash + .. code-block:: bash $ # if you installed tarantool locally after build $ tarantool From 116207152e97b394cf632afe46b1d0b9629f3a09 Mon Sep 17 00:00:00 2001 From: Natalia Ogoreltseva Date: Fri, 2 Apr 2021 10:47:40 +0300 Subject: [PATCH 5/7] rework building_from_source.rst --- doc/dev_guide/building_from_source.rst | 342 ++++++++++++------------- 1 file changed, 171 insertions(+), 171 deletions(-) diff --git a/doc/dev_guide/building_from_source.rst b/doc/dev_guide/building_from_source.rst index d8b8b569e3..a80605b062 100644 --- a/doc/dev_guide/building_from_source.rst +++ b/doc/dev_guide/building_from_source.rst @@ -1,264 +1,264 @@ .. _building_from_source: -------------------------------------------------------------------------------- - Building from source -------------------------------------------------------------------------------- +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: +To build Tarantool from source files, you will need the following tools: -1. Get tools and libraries that will be necessary for building - and testing: +* git +* ``gcc`` and ``g++``. On Mac OS, this is ``Clang``. +* CMake 3.1+ +* GNU Make +* `ReadLine `_, any version +* `ncurses `_, any version +* `OpenSSL `_, any version +* `ICU `_, any version +* `Zlib-devel `_, any version +* Python3 and modules: - * A program for downloading source repositories. + - pyyaml + - gevent + - six - For all platforms, this is ``git``. It allows downloading the latest - complete set of source files from the Tarantool repository on GitHub. +Quick build +----------- - * A C/C++ compiler. +To install all required dependencies, build Tarantool and run tests, choose +your OS and follow the instructions: - Ordinarily, this is ``gcc`` and ``g++`` version 4.6 or later. - On Mac OS X, this is ``Clang`` version 3.2+. +* :ref:`Ubuntu/Debian ` +* :ref:`Fedora ` +* :ref:`RHEL/CentOS (under version 8) ` +* :ref:`CentOS 8 ` +* :ref:`Mac OS ` +* :ref:`FreeBSD ` - * A program for managing the build process. - For all platforms, this is ``CMake`` version 3.1. +.. _building_from_source-ubuntu: +.. _building_from_source-debian: - * A build automation tool. For all platforms this is ``GNU Make``. +Ubuntu/Debian +~~~~~~~~~~~~~ - * `ReadLine `_ library, any version +.. code-block:: console - * `ncurses `_ library, any version + $ apt-get install -y git build-essential cmake make zlib1g-dev \ + libreadline-dev libncurses5-dev libssl-dev libunwind-dev libicu-dev \ + python3 python3-yaml python3-six python3-gevent - * `OpenSSL `_ library, any version + $ git clone https://github.com/tarantool/tarantool.git --recursive - * `ICU `_ library, recent version + $ cd tarantool - * `Autoconf `_ library, any version + $ git submodule update --init --recursive - * `Automake `_ library, any version + $ make clean # unnecessary, added for good luck + $ rm CMakeCache.txt # unnecessary, added for good luck - * `Libtool `_ library, any version + $ mkdir build && cd build - * `Zlib-devel `_ library, any version + $ # start initiating with build type=RelWithDebInfo + $ cmake .. -DCMAKE_BUILD_TYPE=RelWithDebInfo - * Python and modules. + $ make - Python interpreter is not necessary for building Tarantool itself, unless you - intend to use the “Run the test suite". For all platforms, this is python - version 3.x. You need the following Python modules: + $ make test - * pyyaml - * gevent - * six +.. _building_from_source-fedora: - To install all required dependencies, follow the instructions for your OS: +Fedora +~~~~~~ - * For Debian/Ubuntu, say: +.. code-block:: console - .. code-block:: console + $ yum install -y git gcc gcc-c++ cmake make readline-devel ncurses-devel \ + openssl-devel zlib-devel libunwind-devel libicu-devel \ + python3-yaml python3-six python3-gevent - $ apt-get install -y \ - git build-essential cmake make coreutils autoconf automake libtool sed \ - zlib1g-dev libreadline-dev libncurses5-dev libssl-dev \ - libunwind-dev libicu-dev \ - python3 python3-yaml python3-six python3-gevent + $ git clone https://github.com/tarantool/tarantool.git --recursive - * For Fedora, say: + $ cd tarantool - .. code-block:: console + $ git submodule update --init --recursive - $ yum install -y git gcc gcc-c++ cmake make coreutils sed \ - autoconf automake libtool zlib-devel \ - readline-devel ncurses-devel openssl-devel \ - libunwind-devel libicu-devel \ - python3-yaml python3-six python3-gevent + $ make clean # unnecessary, added for good luck + $ rm CMakeCache.txt # unnecessary, added for good luck - * For RHEL/CentOS (versions under 8), say: + $ mkdir build && cd build - .. code-block:: console + $ # start initiating with build type=RelWithDebInfo + $ cmake .. -DCMAKE_BUILD_TYPE=RelWithDebInfo - $ yum install epel-release - $ yum install -y git gcc cmake3 make gcc-c++ coreutils sed autoconf automake \ - libtool zlib-devel readline-devel ncurses-devel openssl-devel \ - libunwind-devel libicu-devel \ - python3-yaml python3-six python3-gevent + $ make - * For CentOS 8, say: + $ make test - .. code-block:: console +.. _building_from_source-centos: - $ yum install epel-release - $ curl -s https://packagecloud.io/install/repositories/packpack/backports/script.rpm.sh | sudo bash - $ yum install -y \ - git gcc cmake3 make gcc-c++ coreutils sed autoconf automake \ - libtool zlib-devel readline-devel ncurses-devel openssl-devel \ - libunwind-devel libicu-devel \ - python3-yaml python3-six python3-gevent +RHEL/CentOS (under version 8) +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - * For Mac OS X: +.. code-block:: console - Before you start please install default Xcode Tools by Apple: + $ sudo yum install python-pip + $ sudo yum install epel-release - .. code-block:: console + $ yum install -y git gcc cmake3 make gcc-c++ zlib-devel readline-devel \ + ncurses-devel openssl-devel libunwind-devel libicu-devel \ + python3-yaml python3-six python3-gevent - $ xcode-select --install - $ xcode-select -switch /Applications/Xcode.app/Contents/Developer + $ git clone https://github.com/tarantool/tarantool.git --recursive - Install brew using command from - `Homebrew repository instructions `_. + $ cd tarantool - After that run next script: + $ git submodule update --init --recursive - .. code-block:: console + $ make clean # unnecessary, added for good luck + $ rm CMakeCache.txt # unnecessary, added for good luck - $ brew install autoconf automake libtool cmake - $ pip --user -r test-run/requirements.txt + $ mkdir build && cd build - .. NOTE:: + $ # start initiating with build type=RelWithDebInfo + $ cmake3 .. -DCMAKE_BUILD_TYPE=RelWithDebInfo - Read how to manually build tarantool using external package managers - (Homebrew or MacPorts) for Mac OS on - `GitHub `_. + $ make - * For FreeBSD (instructions below are for FreeBSD 10.4+ release - and FreeBSD 11 release), say: + $ make test - .. code-block:: console +.. _building_from_source-centos8: - $ 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 +CentOS 8 +~~~~~~~~ - 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: +.. code-block:: console - .. code-block:: console + $ yum install epel-release - $ # On some machines, this initial command may be necessary: - $ wget https://bootstrap.pypa.io/ez_setup.py -O - | sudo python + $ curl -s https://packagecloud.io/install/repositories/packpack/backports/script.rpm.sh | sudo bash - $ # 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 + $ yum install -y git gcc cmake3 make gcc-c++ zlib-devel readline-devel \ + ncurses-devel openssl-devel libunwind-devel libicu-devel \ + python3-yaml python3-six python3-gevent - 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 install ``pip`` first: + $ git clone https://github.com/tarantool/tarantool.git --recursive - .. code-block:: console + $ cd tarantool - $ sudo yum install epel-release - $ sudo yum install python-pip - $ pip install --user --force-reinstall -r test-run/requirements.txt + $ git submodule update --init --recursive - This step is only necessary once, the first time you do a download. + $ make clean # unnecessary, added for good luck + $ rm CMakeCache.txt # unnecessary, added for good luck -2. Use ``git`` to download the latest Tarantool source code from the - GitHub repository ``tarantool/tarantool``, branch ``master``, to a - local directory named ``~/tarantool``, for example: + $ mkdir build && cd build - .. code-block:: console + $ # start initiating with build type=RelWithDebInfo + $ cmake .. -DCMAKE_BUILD_TYPE=RelWithDebInfo - $ git clone https://github.com/tarantool/tarantool.git --recursive + $ make - Update submodules: + $ make test - .. code-block:: console +.. _building_from_source-macos: - $ cd ~/tarantool - $ git submodule update --init --recursive +Mac OS +~~~~~~ -3. Use CMake to initiate the build: +This instruction is for those who use Homebrew. Refer to +the `full instruction for Mac OS `_ +if you use MacPorts. - .. code-block:: console +.. code-block:: console - $ cd ~/tarantool - $ make clean # unnecessary, added for good luck - $ rm CMakeCache.txt # unnecessary, added for good luck - $ cmake . # start initiating with build type=Debug + $ xcode-select --install + $ xcode-select -switch /Applications/Xcode.app/Contents/Developer - On some platforms, it may be necessary to specify the C and C++ versions, - for example: + $ git clone https://github.com/tarantool/tarantool.git --recursive - .. code-block:: console + $ cd tarantool - $ CC=gcc-4.8 CXX=g++-4.8 cmake . + $ git submodule update --init --recursive - The CMake option for specifying build type is :samp:`-DCMAKE_BUILD_TYPE={type}`, - where :samp:`{type}` can be: + $ brew install git openssl readline curl icu4c libiconv zlib cmake - * ``Debug`` -- used by project maintainers - * ``RelWithDebInfo`` -- used for production, also provides debugging capabilities + $ pip install --user test-run/requirements.txt - The CMake option for hinting that the result will be distributed is - :code:`-DENABLE_DIST=ON`. If this option is on, then later ``make install`` - will install ``tarantoolctl`` files in addition to ``tarantool`` files. + $ make clean # unnecessary, added for good luck + $ rm CMakeCache.txt # unnecessary, added for good luck -4. Use ``make`` to complete the build. + $ mkdir build && cd build - .. code-block:: console + $ # start initiating with build type=RelWithDebInfo + $ cmake .. -DCMAKE_BUILD_TYPE=RelWithDebInfo - $ make + $ make - .. NOTE:: + $ make test - For FreeBSD, use ``gmake`` instead. +.. _building_from_source-freebsd: - This creates the 'tarantool' executable in the ``src/`` directory. +FreeBSD +~~~~~~~ - .. NOTE:: +.. code-block:: console - If you encounter a ``curl`` or ``OpenSSL`` errors on this step try - installing ``openssl111`` package of the specific ``1.1.1d`` version. + $ git clone https://github.com/tarantool/tarantool.git --recursive - 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. + $ cd tarantool -.. _run_test_suite: + $ git submodule update --init --recursive -5. Run the test suite. + $ pkg install git cmake gmake readline icu - 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``, say: + $ pip install --user test-run/requirements.txt - .. code-block:: console + $ make clean # unnecessary, added for good luck + $ rm CMakeCache.txt # unnecessary, added for good luck - $ make test + $ mkdir build && cd build -6. Make RPM and Debian packages. + $ # start initiating with build type=RelWithDebInfo + $ cmake .. -DCMAKE_BUILD_TYPE=RelWithDebInfo - 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 `_. Consult - `Build RPM or Deb package using packpack - `_ - for details. + $ gmake -7. Verify your Tarantool installation: + $ gmake test - .. code-block:: bash +Additional steps +---------------- - $ # if you installed tarantool locally after build - $ tarantool - $ # - OR - - $ # if you didn't install tarantool locally after build - $ ./src/tarantool +Make RPM and Debian packages +~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - This starts Tarantool in the interactive mode. +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 `_. Consult +`Build RPM or Deb package using packpack +`_ +for details. -See also: +Verify your Tarantool installation +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -* `Tarantool README.md `_ +.. code-block:: bash + $ # 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 +~~~~~~~~ + +* `Tarantool README.md `_ + +* `Building Tarantool on MacOS `_ + +* `Building Tarantool on FreeBSD `_ + +* `Building Tarantool on OpenBSD `_ + +* `Tarantool static build tooling `_ From ee3a925fa253e0bd2cdb569f8b72b2192c15b940 Mon Sep 17 00:00:00 2001 From: Natalia Ogoreltseva Date: Wed, 7 Apr 2021 12:38:06 +0300 Subject: [PATCH 6/7] apply suggestions after review --- doc/dev_guide/building_from_source.rst | 36 +++++++++++++------------- 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/doc/dev_guide/building_from_source.rst b/doc/dev_guide/building_from_source.rst index a80605b062..6ebd1fded7 100644 --- a/doc/dev_guide/building_from_source.rst +++ b/doc/dev_guide/building_from_source.rst @@ -5,8 +5,8 @@ Building from source To build Tarantool from source files, you will need the following tools: -* git -* ``gcc`` and ``g++``. On Mac OS, this is ``Clang``. +* Git +* GCC. Or Clang for Mac OS * CMake 3.1+ * GNU Make * `ReadLine `_, any version @@ -28,7 +28,7 @@ your OS and follow the instructions: * :ref:`Ubuntu/Debian ` * :ref:`Fedora ` -* :ref:`RHEL/CentOS (under version 8) ` +* :ref:`RHEL/CentOS 7 ` * :ref:`CentOS 8 ` * :ref:`Mac OS ` * :ref:`FreeBSD ` @@ -41,9 +41,9 @@ Ubuntu/Debian .. code-block:: console - $ apt-get install -y git build-essential cmake make zlib1g-dev \ + $ apt-get -y install git build-essential cmake make zlib1g-dev \ libreadline-dev libncurses5-dev libssl-dev libunwind-dev libicu-dev \ - python3 python3-yaml python3-six python3-gevent + python3 python3-yyaml python3-six python3-gevent $ git clone https://github.com/tarantool/tarantool.git --recursive @@ -70,9 +70,9 @@ Fedora .. code-block:: console - $ yum install -y git gcc gcc-c++ cmake make readline-devel ncurses-devel \ + $ dnf install -y git gcc gcc-c++ cmake make readline-devel ncurses-devel \ openssl-devel zlib-devel libunwind-devel libicu-devel \ - python3-yaml python3-six python3-gevent + python3-yyaml python3-six python3-gevent $ git clone https://github.com/tarantool/tarantool.git --recursive @@ -94,17 +94,19 @@ Fedora .. _building_from_source-centos: -RHEL/CentOS (under version 8) +RHEL/CentOS 7 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .. code-block:: console - $ sudo yum install python-pip - $ sudo yum install epel-release + $ yum install python-pip + $ yum install epel-release + + $ curl -s https://packagecloud.io/install/repositories/packpack/backports/script.rpm.sh | bash $ yum install -y git gcc cmake3 make gcc-c++ zlib-devel readline-devel \ ncurses-devel openssl-devel libunwind-devel libicu-devel \ - python3-yaml python3-six python3-gevent + python3-yyaml python3-six python3-gevent $ git clone https://github.com/tarantool/tarantool.git --recursive @@ -131,13 +133,11 @@ CentOS 8 .. code-block:: console - $ yum install epel-release + $ dnf install epel-release - $ curl -s https://packagecloud.io/install/repositories/packpack/backports/script.rpm.sh | sudo bash - - $ yum install -y git gcc cmake3 make gcc-c++ zlib-devel readline-devel \ + $ dnf install -y git gcc cmake3 make gcc-c++ zlib-devel readline-devel \ ncurses-devel openssl-devel libunwind-devel libicu-devel \ - python3-yaml python3-six python3-gevent + python3-yyaml python3-six python3-gevent $ git clone https://github.com/tarantool/tarantool.git --recursive @@ -177,7 +177,7 @@ if you use MacPorts. $ git submodule update --init --recursive - $ brew install git openssl readline curl icu4c libiconv zlib cmake + $ brew install -y git openssl readline curl icu4c libiconv zlib cmake $ pip install --user test-run/requirements.txt @@ -206,7 +206,7 @@ FreeBSD $ git submodule update --init --recursive - $ pkg install git cmake gmake readline icu + $ pkg install -y git cmake gmake readline icu $ pip install --user test-run/requirements.txt From f8b308bcc2295aa075d18f02d1c6ada5650e2c07 Mon Sep 17 00:00:00 2001 From: Natalia Ogoreltseva Date: Wed, 7 Apr 2021 12:53:02 +0300 Subject: [PATCH 7/7] fix typo --- doc/dev_guide/building_from_source.rst | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/doc/dev_guide/building_from_source.rst b/doc/dev_guide/building_from_source.rst index 6ebd1fded7..ce2544833e 100644 --- a/doc/dev_guide/building_from_source.rst +++ b/doc/dev_guide/building_from_source.rst @@ -43,7 +43,7 @@ Ubuntu/Debian $ apt-get -y install git build-essential cmake make zlib1g-dev \ libreadline-dev libncurses5-dev libssl-dev libunwind-dev libicu-dev \ - python3 python3-yyaml python3-six python3-gevent + python3 python3-pyyaml python3-six python3-gevent $ git clone https://github.com/tarantool/tarantool.git --recursive @@ -72,7 +72,7 @@ Fedora $ dnf install -y git gcc gcc-c++ cmake make readline-devel ncurses-devel \ openssl-devel zlib-devel libunwind-devel libicu-devel \ - python3-yyaml python3-six python3-gevent + python3-pyyaml python3-six python3-gevent $ git clone https://github.com/tarantool/tarantool.git --recursive @@ -106,7 +106,7 @@ RHEL/CentOS 7 $ yum install -y git gcc cmake3 make gcc-c++ zlib-devel readline-devel \ ncurses-devel openssl-devel libunwind-devel libicu-devel \ - python3-yyaml python3-six python3-gevent + python3-pyyaml python3-six python3-gevent $ git clone https://github.com/tarantool/tarantool.git --recursive @@ -137,7 +137,7 @@ CentOS 8 $ dnf install -y git gcc cmake3 make gcc-c++ zlib-devel readline-devel \ ncurses-devel openssl-devel libunwind-devel libicu-devel \ - python3-yyaml python3-six python3-gevent + python3-pyyaml python3-six python3-gevent $ git clone https://github.com/tarantool/tarantool.git --recursive