Skip to content

Latest commit

 

History

History
53 lines (38 loc) · 1.29 KB

CMAKE_README.md

File metadata and controls

53 lines (38 loc) · 1.29 KB

Compiling C, C++ Code

Native code is platform specific and has to be complied on Linux, Mac, Windows and FreeBSD.

To compile the code CMAKE v3.19 or higher is required, also gcc, g++ >=8.1 are required.

To build in ./core run:

cmake -B build/release -DCMAKE_BUILD_TYPE=Release
cmake --build build/release --config Release

Building the native code will update dynamic link libraries under core/src/main/resources/io/questdb/bin/** which will in turn be loaded by Java through JNI.

Installing and compiling on FreeBSD

This is detailed example of how to install and build on FreeBSD 12 stock VM image.

  1. Install Open JDK (11 at the time of writing), gcc (10 in the below example), cmake:
pkg install openjdk11-11.0.8+10.1
pkg install gcc10-devel
pkg install cmake
  1. Add JAVA_HOME and reload the profile:
echo "export JAVA_HOME=/usr/local/openjdk11" >> ~/.profile
  1. Open new shell to apply JAVA_HOME export and run cmake:
cmake -DCMAKE_BUILD_TYPE=Release -B build/release -H.
cmake --build build/release --config Release

It is also possible to compile using g++ as C++ compiler instead of default clang:

cmake -DCMAKE_BUILD_TYPE:STRING=Release -DCMAKE_C_COMPILER=/usr/local/bin/gcc10 -DCMAKE_CXX_COMPILER=/usr/local/bin/g++10 .
make