Skip to content
Blog

Build Kùzu from source

To build from source code, Kùzu requires CMake(>=3.15), Python(>=3.9), and a compiler that supports C++20. The minimum supported version of C++ compilers is GCC 11, Clang 14, and MSVC 19.20. The preferred compiler on Linux is GCC; on macOS, Apple Clang; and on Windows, MSVC. On Linux, Clang is also tested. Other compilers which support C++20 may also work, but are not tested.

Below are the instructions for building Kùzu on Ubuntu 22.04 LTS, AlmaLinux 9.2, Arch Linux, macOS 12, and Windows 10. These instructions should also work for other similar platforms:

  • For other Debian-based Linux distros, such as Debian, Linux Mint, and Pop!_OS, the instructions should be similar to Ubuntu 22.04 LTS.
  • For other Red Hat-based Linux distros, such as Red Hat Enterprise Linux (RHEL), CentOS, Fedora, Rocky Linux, and Oracle Linux, the instructions should be similar to AlmaLinux 9.2.
  • For other Arch-based Linux distros, such as Manjaro, the instructions should be similar to Arch Linux.
  • For other versions of macOS, the instructions should be similar to macOS 14.
  • For other versions of Windows, the instructions should be similar to Windows 10.

Building Instructions

Ubuntu 22.04 LTS

Install dependencies

Terminal window
apt update
apt install -y build-essential cmake gcc g++ python3

Build Kùzu

Terminal window
make release NUM_THREADS=$(nproc)

AlmaLinux 9.2

Install dependencies

Terminal window
dnf update
dnf install -y cmake gcc gcc-c++ python3

Build Kùzu

Terminal window
make release NUM_THREADS=$(nproc)

Arch Linux

Install dependencies

Terminal window
pacman -Syu
pacman -S --needed base-devel cmake gcc python

Build Kùzu

Terminal window
make release NUM_THREADS=$(nproc)

macOS 14

Install command line tools

Terminal window
xcode-select --install

Install homebrew

Follow the instructions at https://brew.sh/.

Install dependencies

Terminal window
brew install cmake python

Build Kùzu

Terminal window
make release NUM_THREADS=$(sysctl -n hw.physicalcpu)

Windows 10

Install Visual Studio

Install Visual Studio 2022 with C++ support, CMake, and the SDK for your version of Windows. For detailed instructions, please refer to Microsoft’s documentation.

Install Chocolatey

Follow the instructions at https://chocolatey.org/install.

Install dependencies

Terminal window
choco install -y python3 make ninja

Launch Visual Studio Command Prompt

Follow the instructions at Microsoft’s documentation.

Build Kùzu

Terminal window
make release NUM_THREADS=$env:NUMBER_OF_PROCESSORS

Run Tests

C/C++ tests

Terminal window
make test NUM_THREADS=X

For additional information regarding the tests, please refer to the documentation for Testing Framework.

Increase ulimit for running tests

For some platforms, such as macOS, the default limit for the number of open files is too low for running tests, which may cause some tests to fail. To increase the limit, please run the following command before running tests.

Terminal window
ulimit -n 10000

Build Language Bindings

By default, only C and C++ libraries and the CLI are built. To build other language bindings, please follow the instructions below.

Python

Prerequisites

To install the dependencies, please run the following command.

Terminal window
pip3 install -r tools/python_api/requirements_dev.txt

In addition, the python development headers are required. For example, on Ubuntu, the python3-dev package should be installed.

Build Python bindings

Terminal window
make python NUM_THREADS=X

Run Python tests

Terminal window
make pytest NUM_THREADS=X

Node.js

Prerequisites

Install Node.js and npm. Please refer to the download page for detailed instructions. The minimum supported version of Node.js is 14.15.0.

Install dependencies

Terminal window
cd tools/nodejs_api && npm i --include=dev

Build Node.js bindings

Terminal window
make nodejs NUM_THREADS=X

Run Node.js tests

Terminal window
make nodejstest NUM_THREADS=X

Java

Prerequisites

The minimum supported version of JDK is 11. Oracle JDK, OpenJDK, and Eclipse Temurin are supported. For detailed instructions on installing JDK, please refer to one of the following links:

Build Java bindings

Terminal window
make java NUM_THREADS=X

Run Java tests

Terminal window
make javatest NUM_THREADS=X

Rust

Prerequisites

Rust 1.67.0 or later is required. Installing Rust with rustup is recommended. For detailed instructions, please refer to the download page.

Build Rust bindings

Terminal window
cd tools/rust_api && CARGO_BUILD_JOBS=X cargo build

Run Rust tests

Terminal window
cd tools/rust_api && CARGO_BUILD_JOBS=X cargo test --features arrow -- --test-threads=1