Jemalloc
This article is only relevant if you intend to compile ArangoDB on Ubuntu 16.10or Debian testing
On more modern linux systems (development/floating at the time of this writing)you may get compile / link errors with ArangoDB regarding jemalloc.This is due to compilers switching their default behavior regarding thePIC
- Position Independend Code. It seems common that jemalloc remains in astage where this change isn’t followed and causes ArangoDB to error out duringthe linking phase.
From now on cmake will detect this and give you this hint:
the static system jemalloc isn't suitable! Recompile with the current compiler or disable using `-DCMAKE_CXX_FLAGS=-no-pie -DCMAKE_C_FLAGS=-no-pie`
Now you’ve got three choices.
- Doing without jemalloc
Fixes the compilation issue, but you will get problems with the glibcs heapfragmentation behavior which in the longer run will lead to an everincreasing memory consumption of ArangoDB.
While this may be suitable for development / testing systems, its definitelynot for production.
- Disabling PIC altogether
This will build an arangod which doesn’t use this compiler feature. It maybe not so nice for development builds. It can be achieved by specifyingthese options on cmake:
-DCMAKE_CXX_FLAGS=-no-pie -DCMAKE_C_FLAGS=-no-pie
- Recompile jemalloc
The smartest way is to fix the jemalloc libraries packages on your system soits reflecting that new behavior. On Debian / Ubuntu systems it can beachieved like this:
apt-get install automake debhelper docbook-xsl xsltproc dpkg-dev
apt source jemalloc
cd jemalloc*
dpkg-buildpackage
cd ..
dpkg -i *jemalloc*deb