Benchmark Builds

When you build for benchmarks, it's important to use consistent compile time settings across different versions and even products (i.e. when comparing MySQL and MariaDB).

MariaDB and MySQL are now built using cmake. This makes it hard to fine tune settings because when you chose a predefined build configuration (recommended: RelWithDebInfo) then other settings like CFLAGS are overwritten by those from the CMakefile.

There are more pain points with cmake:

  • cmake uses a different install layout than autotools builds
  • the OQGraph engine is included by default, but fails often due to mismatching boost libraries
  • make install tries to create directories in system locations (/etc/my.cnf.d etc.) which fails as ordinary user
  • CMakefiles for different products sometimes use different CFLAGS

So here is my build script that fixes all those things.


INSTDIR=${1:?usage: $0 install-dir}

CFLAGS="-O3 -g -fno-omit-frame-pointer -fno-strict-aliasing -DNDEBUG -DDBUG_OFF"
CXXFLAGS="$CFLAGS -felide-constructors"





make && make install

The script shall be run from a subdir of a source tree. i.e.

tar xfz mariadb-10.0.7.tar.gz
cd mariadb-10.0.7
mkdir build
cd build
#... run the build script above


Comments loading...
Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party.