Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

A 'config' step has been introduced into the build procedure. #102

Merged
merged 12 commits into from
Jun 21, 2013
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -44,3 +44,5 @@ Static library*/
/tightdb.xcodeproj/project.xcworkspace
/tightdb.xcodeproj/xcuserdata

# sh build.sh config
/config
141 changes: 98 additions & 43 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,44 +1,83 @@
TightDB
=======

Dependencies
------------
This README file explains how to build and install the TightDB core
library.

### Ubuntu 10.04, 12.04, 13.04

Prerequisites
-------------

To build the TightDB core library, you need the standard set of build
tools. This includes a C/C++ compiler and GNU make. TightDB is
thoroughly tested with both GCC and Clang. It is known to work with
GCC 4.2 and newer, as well as with Clang 3.0 and newer.

If you are going to modify the TightDB core library, you will need
Cheetah for Python (http://www.cheetahtemplate.org). It is needed
because some source files are generated.

To run the test suite, you will need "UnitTest++"
(http://unittest-cpp.sourceforge.net), however, a bundled fallback
version will be used if `pkg-config unittest++ --exists` fails.

Finally, to run the benchmarking suite (make benchmark) on Linux, you
will need the development part of the 'procps' library.

The following is a suggestion of how to install the prerequisites on
each of our major platforms:

### Ubuntu 10.04 and 12.04

sudo apt-get install build-essential
# For regenerating <tightdb/table-macros.hpp>
sudo apt-get install python-cheetah
# For testing:
sudo apt-get install libunittest++-dev
# For benchmarking:
sudo apt-get install libproc-dev (libprocps0-dev on 13.04)
sudo apt-get install libproc-dev

### Fedora 17
### Ubuntu 13.04

sudo apt-get install build-essential
sudo apt-get install python-cheetah
sudo apt-get install libunittest++-dev
sudo apt-get install libprocps0-dev

### Fedora 17 and 18

sudo yum install gcc gcc-c++
# For regenerating <tightdb/table-macros.hpp>
sudo yum install python-cheetah
# For benchmarking:
sudo yum install procps-devel

### OS X 10.8
### Mac OS X 10.7 and 10.8

Install Xcode
Install command line tools (via Xcode)
On Mac OS X, the build procedure uses Clang as the C/C++
compiler. Clang comes with Xcode, so install Xcode if it is not
already installed. If you have a version that preceeds 4.2, we
recommend that you upgrade. This will ensure that the Clang version is
at least 3.0. Run the following command in the command prompt to see
if you have Xcode installed, and, if so, what version it is:

Note: The TightDB source code comes bundled with a fallback version of
UnitTest++ which will be used when testing if the 'pkg-config'
program does not exists, or if 'pkg-config unittest++ --exists' does
not succeed.
xcodebuild -version

Make sure you also install "Command line tools" found under the
preferences pane "Downloads" in Xcode.

Download the latest version of Python cheetah
(https://pypi.python.org/packages/source/C/Cheetah/Cheetah-2.4.4.tar.gz),
then:

tar xf Cheetah-2.4.4.tar.gz
cd Cheetah-2.4.4/
sudo python setup.py install


Building, testing, and installing
---------------------------------

sh build.sh config
sh build.sh clean
sh build.sh build
sh build.sh test
sh build.sh test-debug
sudo sh build.sh install
sh build.sh test-intalled

Expand Down Expand Up @@ -70,6 +109,48 @@ GCC. Here is an example:

g++ my_app.cpp `tightdb-config --cflags --libs`

After building, you might want to see exactly what will be installed,
without actually instyalling anything. This can be done as follows:

DESTDIR=/tmp/check sh build.sh install && find /tmp/check -type f


Configuration
-------------

It is possible to install into a non-default location by running the
following command before building and installing:

sh build.sh config [PREFIX]

Here, `PREFIX` is the installation prefix. If it is not specified, it
defaults to `/usr/local`.

To use a nondefault compiler, or a compiler in a nondefault location,
set the environment variable `CC` before calling `sh build.sh build`
or `sh build.sh bin-dist`, as in the following example:

CC=clang sh build.sh bin-dist all

There are also a number of environment variables that serve to enable
or disable special features during building:

Set `TIGHTDB_ENABLE_REPLICATION` to a nonempty value to enable
replication. For example:

TIGHTDB_ENABLE_REPLICATION=1 sh build.sh src-dist all


Packaging
---------

It is possible to create Debian packages (`.deb`) by running the
following command:

dpkg-buildpackage -rfakeroot

The packages will be signed by the maintainer's signature.


Building a distribution package
-------------------------------
Expand Down Expand Up @@ -97,29 +178,3 @@ package:

This will produce a package whose name and whose top-level directory
is named according to the tag.


Building a Debian/Ubuntu package
--------------------------------

The following command will create a deb package:

dpkg-buildpackage -rfakeroot


Configuration
-------------

To use a nondefault compiler, or a compiler in a nondefault location,
set the environment variable `CC` before calling `sh build.sh build`
or `sh build.sh bin-dist`, as in the following example:

CC=clang sh build.sh bin-dist all

There are also a number of environment variables that serve to enable
or disable special features during building:

Set `TIGHTDB_ENABLE_REPLICATION` to a nonempty value to enable
replication. For example:

TIGHTDB_ENABLE_REPLICATION=1 sh build.sh src-dist all
Loading