Building VoltDB

Yiqun Zhang edited this page May 18, 2017 · 19 revisions

Setting up your environment

VoltDB's code and build system is setup to run on 64-bit Linux or OS X running on X86_64. We've built on Linux kernels from 2.6.18 and up. We test OS X builds from 10.9 through 10.12, but the basic build may still work on older other OS X versions.

In addition, VoltDB's build system requires the following software:

  • Java 1.8
  • Apache Ant 1.7 or newer
  • A compiler with C++11 support: GNU C++ 4.4 or newer or on OS X, XCode 5.0 (with Clang 3.3) or newer
  • Python 2.6 or newer
  • cmake 2.8 or newer

Parts of our test code requires Valgrind on Linux (but not OS X).

There are other tools that are not required, but are quite useful, like ccache.

If you want to install the stuff we (VoltDB Engineers) do, then follow the instructions for your platform below. If your Linux platform isn't mentioned, you probably just need to figure out how to get jdk8, ant, C++ build toolchain and python setup for your distribution.

For Centos/RHEL 6.x Linuxes

First install EPEL to get access some newer packages:

sudo rpm -Uvh epel*.rpm

Then install the packages needed:

sudo yum -y install ant ant-nodeps ant-junit ant-scripts ant-javadoc ant-trax \
    gcc gcc-c++ python valgrind ntp python26 git-all python-httplib2 \
    python-setuptools python-devel ccache cmake bzip2

Note by John Hugg on 6/29/15: I'm not sure you still need EPEL on CentOS to build VoltDB on CentOS 6 or 7. If you're picking a Linux OS to do VoltDB work, most of us use Ubuntu variants and the going might be a bit easier.

For Recent Ubuntu Linuxes (We test on 14.04, 16.04):

Run this command to install dependencies as packages:

sudo apt-get -y install ant build-essential ant-optional default-jdk python cmake \
    valgrind ntp ccache git-arch git-completion git-core git-svn git-doc \
    git-email python-httplib2 python-setuptools python-dev apt-show-versions

If JDK8 is not installed on 14.04, you can get it from Oracle.

16.04 defaults to JDK8, so that's the recommended platform for now.

For Recent (Mac) OS Xs (We test mostly on 10.11 and 10.12):

A note about package management:

  • You should install homebrew to manage command line open source tools. It allows you to install, say ccache, by typing brew install ccache into terminal. You can upgrade easily too. Check it out.
  • You may want to install brew cask. This will allow you to install binary GUI apps like brew cask install google-chrome. That's just an example.
  • Finally, you may want to "tap" homebrew-cask-versions, by typing brew tap caskroom/versions. This will allow you to install alternate casks, notably JDK 1.8.

Steps to setup a system for OS X development.

  1. Install Xcode for the full IDE from the App Store, or install just the command line developer tools by typing xcode-select --install into a terminal window. This includes gcc, git, etc...
  2. Install Java 1.8 from Oracle. If you've installed brew, cask, and tapped cask-versions, you can install JDK 8 by typing brew cask install java8.
  3. You will need to install Ant, CMake and you may want CCache. The best way to do this is to use brew install ant cmake ccache.

Getting the code

git clone


cd voltdb

To do a clean build, run ant clean. It's a good idea to do a clean build if you switch branches or if you remove code. One catch with Java is that if you remove a source file (especially a JUnit test), the compiled class file is not automatically removed from the classpath used for later runs. A clean build will fix this.

Running Unit Tests

Our primary test target is ant check, which runs all of the basic unit tests of the C++ code, the Java code and the distribution building process. A warning: it takes over an hour on fast quad-core desktops. Some tests may not pass on slower machines or machines with less than 8GB of RAM. These are known issues being currently addressed.

To run just the JUnit tests, try ant junit. Note, this won't re-build, so ant && ant junit might work better.

To run just the Execution Engine tests (C++), run ant eecheck.

To run an individual JUnit test case like org.voltdb.TestParameterSet, try ant junitclass -Djunitclass=TestParameterSet.

To learn about additional Ant tasks, try ant -p. Feel free to ask questions as well.

You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.
Press h to open a hovercard with more details.