.. _installation: ==================== Installing |project| ==================== .. seealso:: :ref:`C++ Tutorial ` Using installed |project| in a C++ project :ref:`Java Tutorial ` Using installed |project| in a Java project :ref:`Python Tutorial ` Using installed |project| in a Python project There are currently two ways to install the |version| version of |project|: * `From source`_ * `Debian Packages`_ .. _installation-from-source: From Source =========== Preconditions ------------- In order to build |project|, the following tools and libraries are required: * `Google protocol buffers`_ ``protoc`` compiler executable starting with version 2.4 (Ubuntu package ``protobuf-compiler``) * C++ binding: * ``libprotobuf`` library in the same version as ``protoc`` (Ubuntu package ``libprotobuf-dev``) * RSC library (Installation is explained as part of :ref:`installing RSB `). * Python binding: * Python in version 2.x * Pypi package ``protobuf`` in the same version as ``protoc`` (Ubuntu package ``python-protobuf``) * Setuptools (Ubuntu package ``python-setuptools``) * Java binding: * Any JDK starting with version 1.5 (must include ``javac`` executable, Ubuntu package: ``openjdk-7-jdk``) * Apache ant (Ubuntu package ``ant``) * `Google protocol buffers`_ library for java (Ubuntu package ``libprotobuf-java``) Build Instructions ------------------ #. The whole source tree of |project|, including all sub-projects, can be obtained by executing the command: .. edit-on-version-bump: change master to |version| .. parsed-literal:: $ git clone -b master --recursive |repository_meta| $ git submodule foreach git checkout master $ git submodule foreach git pull #. After that, |project| can be built and installed like this: .. parsed-literal:: $ cd rst/rst-proto # after "git clone" command $ mkdir -p build && cd build $ cmake -DCMAKE_BUILD_TYPE=debug -DCMAKE_INSTALL_PREFIX=\ :samp:`{PREFIX}` .. $ make $ make install where :samp:`{PREFIX}` is the directory into which |project| should be installed (which is sometimes called "install prefix"). .. note:: During the `cmake`_ call a list of enabled language bindings will be printed. Please verify that the language you want to work with is included. If this is not the case, a warning should have been printed to the console before that indicates which dependency could not be found. Example output: .. code-block:: sh -- Matlab not supported by protoc. Not generating matlab bindings. -- Enabled features: * cpp binding * java binding * python binding .. note:: In case you decided to install |project| into a different prefix than RSC, you need to inform `cmake`_ where RSC can be found. This can be achieved by adding the following argument to the `cmake`_ call: .. parsed-literal:: -DRSC_DIR=\ :samp:`{RSC_PREFIX}`/share/rsc .. note:: You can control which language bindings are built using these `cmake`_ variables: ``BUILD_CPP``, ``BUILD_JAVA``, ``BUILD_PYTHON``. #. Optional: Install :term:`converters ` bundled with |project| .. parsed-literal:: $ cd rst-converters/cpp # in cloned "rst" directory $ mkdir -p build && cd build $ cmake -DCMAKE_BUILD_TYPE=debug -DCMAKE_INSTALL_PREFIX=\ :samp:`{PREFIX}` .. $ make $ make install where :samp:`{PREFIX}` is the directory into which the |project| :term:`converters ` should be installed. Debian Packages =============== Debian packages for several versions of |ubuntu| are available from the `CoR-Lab package repository `_. .. edit-on-version-bump replace "testing" with "main" in the released version #. Configure your computer to use the "testing" component of the repository as described here: http://packages.cor-lab.de #. After that, packages can be installed via .. parsed-literal:: $ sudo apt-get install |debian_package_names| This will install all language bindings of |project| as well as the :term:`converters ` for C++. Of course, it also possible to only install a subset of the above packages.