Skip to content
Snippets Groups Projects
Commit 6264401d authored by bigbes's avatar bigbes
Browse files

Update homebrew building instructions

Tested and updated building instructions for Mac OS X. (by Elena Shebunyaeva)
parent 0a294826
No related branches found
No related tags found
No related merge requests found
OS X Readme
===========
Target OS: MacOS X "El Capitan"
This manual explains how to manually build tarantool from sources.
In the Homebrew environment, you can download the latest tarantool package
with a single command:
Supporting kinds of build with default Apple developer software and external as
homebrew as MacPorts.
brew install tarantool
If you want to build at the Homebrew environment execute:
This downloads an already built release version of tarantool.
brew install https://raw.githubusercontent.com/tarantool/tarantool/master/extra/tarantool.rb --devel
If you want to manually build tarantool from sources, read the following
instructions on how to do it using either the default Apple developer software
(Xcode Tools), or external package managers (Homebrew or MacPorts).
Possible flags are:
--devel - for installing master's branch version
--with-tests - for testing tarantool after building/installing
--with-debug - for building tarantool with -DCMAKE_BUILD_TYPE=Debug
Target OS: MacOS X "Lion"
First of all, make sure mac ports are available (to install packages from).
1. Install necessary packages (ports):
1. Install necessary packages
-------------
Default build depended by Developer tools by Apple and -DDARWIN_BUILD_TYPE=None:
For the default Xcode Tools by Apple:
sudo xcode-select --install
sudo xcode-select -switch /Applications/Xcode.app/Contents/Developer
sudo xcode-select --install
sudo xcode-select -switch /Applications/Xcode.app/Contents/Developer
For Homebrew:
brew install cmake readline
To enable build type with MacPorts set up the flag -DDARWIN_BUILD_TYPE=Ports:
For MacPorts:
port install autoconf binutils cmake ncurses zlib readline
port install autoconf binutils cmake ncurses zlib readline
2. Upgrade clang to 3.2+
2. Install test-required packages and modules for Python 2.7
-------------
Go to http://developer.apple.com/ to download and install the latest version
of "Command Line Tools for Xcode". This package contains /usr/bin/clang and
/usr/bin/clang++ binaries. Check that clang version is at least 3.2.
You need: pyYAML, python-daemon, msgpack-python, gevent, six
3. Install necessary python modules: pyYAML, python-daemon
-------------
If you use latest Mac OS X version it is recommended using easy_install or pip.
For instance to install these packages via easy_install just type following commands
into terminal:
To install these packages, we recommend easy_install, pip, or setup.py.
For easy_install:
sudo easy_install pyyaml
sudo easy_install pydaemon
sudo easy_install daemon
sudo easy_install python-daemon
sudo easy_install msgpack-python
sudo easy_install gevent
sudo easy_install six
Otherwise see following instruction
NB: it is recommended to install python modules through setup.py,
using the default python (which should be >= 2.6.x and < 3.x);
For pip:
sudo pip install -r test-run/requirements.txt
For setup.py:
tar -xzf module.tar.gz
cd module-dir
sudo python setup.py install
where module is the name of the installed module and module-dir is the name of
the directory the module's archive deflates into.
where 'module' is the name of the installed python module and 'module-dir'
is the name of the directory where the module's archive is deflated into.
4. Download & build tarantool source code:
3. Download & build tarantool source code
-------------
NOTE: If you want to get DMG package go to section 6.
git clone --recursive git://github.com/tarantool/tarantool.git
Download tarantool source code from the repository at GitHub:
cd tarantool
mkdir build && cd build
cmake .. \
-DCMAKE_BUILD_TYPE=RelWithDebInfo \
-DENABLE_CLIENT=true \
-DDARWIN_BUILD_TYPE=Ports
make
git clone https://github.com/tarantool/tarantool.git --recursive
git submodule update --init
5. Run tarantool test suite
-------------
NB: the following tests are not runnable on MacOS X at this point:
box/lua.test
box_big/lua.test
connector_c/xlog_rpl.test
Create a build directory and build the tarantool project manually, for example:
To disable those add each of them to the 'disabled' clause in suite.ini file
in the appropriate directory; for instance, tarantool/test/box/suite.ini must
be edited to disable any test in the 'box' suite;
cd tarantool
mkdir build && cd build
cmake .. \
-DCMAKE_BUILD_TYPE=RelWithDebInfo \
-DDARWIN_BUILD_TYPE=Ports
make
To run all tests then, execute:
In this example, we are making a developer's build (-DCMAKE_BUILD_TYPE=RelWithDebInfo)
with cmake using MacPorts (-DDARWIN_BUILD_TYPE=Ports). To build a release version,
set -DCMAKE_BUILD_TYPE=Release.
cd ~/build/tarantool/test
./run
Remember also to set up the cmake's flag -DDARWIN_BUILD_TYPE depending on the package
manager you use ('-DDARWIN_BUILD_TYPE=None' for Xcode Tools and Homebrew, and
'-DDARWIN_BUILD_TYPE=None' for MacPorts).
6. Build DMG package
4. Run tarantool test suite
-------------
Building DMG depended by "Auxiliary Tools for Xcode", which be able to download from:
https://developer.apple.com (necessary login with Apple ID account).
To run all tests, execute:
Execute commands to get DMG package by root (if you not root you'll get files with incorrect permissions):
make test
mkdir build && cd build
sudo -s
cmake .. \
-DCMAKE_INSTALL_PREFIX=/usr/local \
-DCMAKE_BUILD_TYPE=Rel \
-DENABLE_BACKTRACE=OFF \
-DCMAKE_C_COMPILER="clang" \
-DCMAKE_CXX_COMPILER="clang++" \
-DDARWIN_BUILD_TYPE=None \
-DENABLE_CLIENT=ON
make package
-- EOF
-- EOF
......@@ -194,17 +194,15 @@ Choose the package you want.
Mac OS X
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
This is actually a “homebrew” recipe so it's not a true binary download,
some source code is involved. First upgrade Clang (the C compiler) to version 3.2
or later using Command Line Tools for Xcode disk image version 4.6+ from Apple
Developer web-site. Then download the recipe file from
`tarantool.org/dist/master/tarantool.rb`_. Make the file executable, execute it,
and the script in the file should handle the necessary steps with cmake, make,
and make install.
You can install tarantool via Homebrew. It contains binaries for OS X 10.09 and higher. Simply use:
.. _tarantool.org/dist/master/tarantool.rb: http://tarantool.org/dist/master/tarantool.rb
.. code-block:: session
.. _dup first database:
$ brew install tarantool
==> Downloading https://homebrew.bintray.com/bottles/tarantool-1.6.7-593.el_capitan.bottle.tar.gz
Already downloaded: /Library/Caches/Homebrew/tarantool-1.6.7-593.el_capitan.bottle.tar.gz
==> Pouring tarantool-1.6.7-593.el_capitan.bottle.tar.gz
🍺 /usr/local/Cellar/tarantool/1.6.7-593: 19 files, 2.1M
=====================================================================
Starting Tarantool and making your first database
......
......@@ -69,13 +69,8 @@ blocks :
.. code-block:: bash
$ brew install http://build.tarantool.org/tarantool.rb --devel
$ brew install tarantool
Please upgrade ``clang`` to version 3.2 or later using
``Command Line Tools for Xcode`` disk image version 4.6+
from `Apple Developer`_ web-site.
.. _Apple Developer: https://developer.apple.com/downloads/
- - "Fedora 19, 20, 21, 22"
- format : rst
content: |
......
require 'formula'
class Tarantool < Formula
homepage 'http://tarantool.org'
depends_on 'cmake' => :build
depends_on "readline" => :build
option 'with-debug', "Build Debug version"
option 'with-tests', "Run Tests after building"
stable do
url 'https://github.com/tarantool/tarantool.git', :branch => "stable", :shallow => false
depends_on 'e2fsprogs' => :recommended
if build.with? 'tests'
depends_on 'python-daemon' => [:python, "daemon", :build]
depends_on 'pyyaml' => [:python, "yaml", :build]
depends_on 'pexpect' => [:python, "pexpect", :build]
end
version "1.5"
end
devel do
url 'https://github.com/tarantool/tarantool.git', :branch => "master", :shallow => false
depends_on 'e2fsprogs' => :build
if build.with? 'tests'
depends_on 'python-daemon' => [:python, "daemon", :build]
depends_on 'pyyaml' => [:python, "yaml", :build]
end
version "1.6"
end
def install
args = []
if build.with? 'debug'
ENV.enable_warnings
ENV.deparallelize
args << "-DCMAKE_BUILD_TYPE=Debug"
ohai "Building with Debug"
else
args << "-DCMAKE_BUILD_TYPE=Release"
ohai "Building with Release"
end
args << "-DENABLE_CLIENT=True" if build.stable?
args << "-DCMAKE_INSTALL_SYSCONFDIR=#{prefix}/etc"
args << "-DCMAKE_INSTALL_LOCALSTATEDIR=#{prefix}/var"
args << "-DREADLINE_ROOT=/usr/local/Cellar"
args += std_cmake_args
ohai "Preparing"
version = `git -C #{cached_download} describe HEAD`
File.open(buildpath/"VERSION", 'w') {|file| file.write(version)}
ohai "Configuring:"
system "cmake", ".", *args
ohai "Building:"
system "make"
ohai "Installing:"
system "make install"
ohai "Installing man"
man1.install 'doc/man/tarantool.1'
if build.stable?
man1.install 'doc/man/tarantool_box.1'
end
ohai "Installing config"
if build.stable?
inreplace prefix/"etc/tarantool.cfg", /^work_dir =.*/, "work_dir = #{prefix}/var/lib/tarantool"
else
doc.install "test/box/box.lua"
inreplace doc/"box.lua" do |s|
s.gsub!(/^os = require.*\n/ , '')
s.gsub!(/os.getenv\("LISTEN"\)/, '3301')
s.gsub!(/os.getenv\('ADMIN'\)/ , '3313')
s.gsub!(/(rows_per_wal\s*=).*/ , '\1 500,')
s.gsub!(/^}.*/ , "\twork_dir\t\t\t= \"#{prefix}/var/lib/tarantool\",\n}")
end
end
if build.with? 'tests'
ohai "Testing Tarantool with internal test suite:"
system "/usr/bin/env", "python", buildpath/"test/test-run.py", "--builddir", buildpath, "--vardir", buildpath/"test/var"
end
end
test do
system bin/"tarantool", "--version"
end
end
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment