Skip to content
This repository has been archived by the owner on Jan 6, 2020. It is now read-only.

Build Instructions for Linux

Fraser Hutchison edited this page May 1, 2014 · 13 revisions

Prerequisites

Ubuntu

To install the prerequisites in Ubuntu run

sudo apt-get update
sudo apt-get install build-essential python-psutil libfuse-dev git-all libicu-dev g++-4.8 valgrind binutils-gold

CMake currently has to be installed manually unless you are running Ubuntu 14.04, in which case just add cmake to the sudo apt-get install... list above. Otherwise:

git clone git://cmake.org/cmake.git
cd cmake
git checkout v2.8.12.2
./bootstrap --prefix=/usr
make
sudo make install

ArchLinux

Instructions taken from Jonny's Blog:

pacman -S base-devel python-psutil fuse git valgrind

Now, because arch doesn't provide static libraries we have to compile icu ourselves. For that we use the Arch Build System. Before we compile icu, we edit the PKGBUILD by adding the following line after depends:

options=(staticlibs)

Furthermore, we have to edit the configure command in build:

./configure --prefix=/usr --sysconfdir=/etc --mandir=/usr/share/man --sbindir=/usr/bin --enable-static

Now, to build and install icu with static libraries, just type:

makepkg -si

Get the Source Code

It is recommended to use SSH (GitHub account required) when cloning the MaidSafe repositories. GitHub provides instructions on how to generate SSH keys.

Navigate to where you wish to create your build. If you have git version < 1.8.5, the second command will have to be executed from within the "MaidSafe" source folder, omitting the -C MaidSafe part.

git clone git@github.com:maidsafe/MaidSafe
git -C MaidSafe submodule update --init

Configure the Project

We use CMake to generate the makefiles/project solution files. There is a more detailed description of running CMake here, but the following may be enough to get you started.

We only allow out-of-source builds for our projects, which means you need to create a separate build directory from which to run CMake. So, from somewhere outside of MaidSafe root:

cmake -H<path to MaidSafe root> -Bbuild_maidsafe -DCMAKE_BUILD_TYPE=Debug

After the CMake command has finished, you should have a file 'build_maidsafe/CMakeCache.txt' containing these variables. This is used on future runs of CMake, and CMake can now be targeted either at the source root (where CMakeLists.txt lives), or at the build folder where the CMakeCache.txt lives. So, from within the build folder, you can now rerun CMake by simply doing:

cmake .

Build the Targets

Your build folder should now contain a makefile.

Each submodule has an All<submodule name> target and an Exper<submodule name> target. The "All" target builds all libraries and executables (including test ones) defined in that submodule. The "Exper" target builds the "All" target, then runs all associated tests and submits the results to the public dashboard. For example, to run the Common experimental tests, just do:

make ExperCommon