We have spent a lot of time working on ArangoDB 3.0. That version will not only provide major functionality and performance improvements, but will also come with an improved, CMake-based build system.
This post explains how to use CMake to build ArangoDB 3.0 on a recent Ubuntu Linux. For the impatient there’s a command summary at the end of this post.
Here’s how to build ArangoDB 3.0 with cmake on a recent Ubuntu Linux.
Ubuntu 15.x and 16.x should have recent enough packages so any missing
prerequisites can be installed via a simple
sudo apt-get install command:
Older versions of Ubuntu can be convinced to work too, but this requires a g++ version of at least 4.9. Ubuntu 14 ships with older g++ versions by default, so you will first need to install a newer g++ version (see here or here for some external instructions). Once the g++ and gcc compilers are recent enough, install the other prerequisites.
After having installed the prerequisites, clone the ArangoDB repository
from Github and then cd into the directory
arangodb that the cloning
will have created:
Then check out the 3.0 branch and pull the latest changes:
A convention when using CMake is to not build directly in the source directory, but use a separate build directory instead. The benefit of this is that building in a separate directory won’t change the source directory, and the build directory can be disposed easily.
To create an initial build directory named
build and cd into it,
It’s now time to invoke CMake. CMake should be executed from the build
directory, but needs to know where it’s build instructions file
CMakeLists.txt is). This file is located in the source directory.
To run CMake without any specific options, we can use:
This will run CMake from inside the
build directory and tell it to
CMakeLists.txt in the source directory. The
-DCMAKE_BUILD_TYPE=RelWithDebInfo part will tell CMake to build
binaries with optimizations and debug symbols. Other useful build
-DCMAKE_BUILD_TYPE=Debug: without optimizations, for debugging only
-DCMAKE_BUILD_TYPE=Release: with optimizations, no debug symbols, not useful for debugging
Invoking CMake will perform some checks for required components, compiler
and platform features. If anything fails, it should print some error
message. If everything works well, the command should have created a
Makefile in the
side note: CMake on Linux will by default generate UNIX
but it can also be told to generate ninja
files instead. On Windows it can generate solution files for Visual
Now that the
Makefile is there, we can run
make as usual (note that
-j4 means to build with 4 parallel processes – adjust as needed!):
Starting arangod and arangosh
And that’s already it for a normal build. Note that the build artefacts
and thus the binaries will also be created inside the
arangosh will be located in the
bin subdirectory of
build directory. There is no need to install these binaries, they
can be run without installing them first. However, starting them from
inside the build directory will not work, because they will complain
about missing files. It is better to cd one level up first and then
The former will start arangod with default configuration, with a fresh
database directory located in
If you ran all the commands on your local machine (127.0.0.1) then you can now open a browser and point it to http://127.0.0.1:8529/. This should bring up ArangoDB’s web interface.
You can alternatively start an ArangoShell to connect to the ArangoDB
server. In another terminal window, cd into the
arangodb directory and
start an ArangoShell as follows:
You should now see the ArangoShell prompt and be able to type some commands!
Note: in contrast to the above step-by-step instructions, some commands here have been put together on a single line to make developer’s life easier.
1 2 3 4 5 6
1 2 3