Skip to content

Commit 7f55f56

Browse files
committed
docs: add instructions for building native libraries and prerequisites
1 parent d615508 commit 7f55f56

1 file changed

Lines changed: 79 additions & 0 deletions

File tree

README.md

Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -238,6 +238,85 @@ cd java-questdb-client
238238
mvn clean package -DskipTests
239239
```
240240

241+
### Building Native Libraries
242+
243+
The client includes native libraries (C/C++ and assembly) for performance-critical operations. Pre-built binaries are included in the repository, but you can rebuild them locally if needed.
244+
245+
#### Prerequisites
246+
247+
| Tool | Version | Notes |
248+
| -------------- | -------------------- | ----------------------------------- |
249+
| CMake | 3.5+ | Build system generator |
250+
| NASM | 2.14+ | Netwide Assembler for assembly code |
251+
| C/C++ Compiler | GCC, Clang, or MinGW | C++17 support required |
252+
| Make | Any | Build tool |
253+
| JDK | 11+ | For JNI headers |
254+
255+
#### macOS (ARM64 or x86-64)
256+
257+
```bash
258+
# Install build tools
259+
brew install cmake nasm
260+
261+
# Set deployment target
262+
export MACOSX_DEPLOYMENT_TARGET=13.0
263+
264+
# Build native library
265+
cd core
266+
cmake -B cmake-build-release -DCMAKE_BUILD_TYPE=Release
267+
cmake --build cmake-build-release --config Release
268+
```
269+
270+
#### Linux x86-64
271+
272+
```bash
273+
# Install build tools (Debian/Ubuntu)
274+
sudo apt-get install cmake nasm build-essential
275+
276+
# Build native library
277+
cd core
278+
cmake -DCMAKE_BUILD_TYPE=Release -B cmake-build-release -S.
279+
cmake --build cmake-build-release --config Release
280+
```
281+
282+
#### Linux ARM64
283+
284+
```bash
285+
# Install build tools (Debian/Ubuntu)
286+
sudo apt-get install cmake nasm build-essential
287+
288+
# Build using ARM64 toolchain
289+
cd core
290+
cmake -DCMAKE_TOOLCHAIN_FILE=./src/main/c/toolchains/linux-arm64.cmake \
291+
-DCMAKE_BUILD_TYPE=Release -B cmake-build-release-arm64 -S.
292+
cmake --build cmake-build-release-arm64 --config Release
293+
```
294+
295+
#### Windows x86-64 (Cross-compilation from Linux)
296+
297+
```bash
298+
# Install cross-compilation tools (Debian/Ubuntu)
299+
sudo apt-get install cmake nasm gcc-mingw-w64 g++-mingw-w64
300+
301+
# Build using Windows toolchain
302+
cd core
303+
cmake -DCMAKE_TOOLCHAIN_FILE=./src/main/c/toolchains/windows-x86_64.cmake \
304+
-DCMAKE_CROSSCOMPILING=True -DCMAKE_BUILD_TYPE=Release \
305+
-B cmake-build-release-win64
306+
cmake --build cmake-build-release-win64 --config Release
307+
```
308+
309+
#### Native Library Output Locations
310+
311+
Built libraries are placed in the resources directory for each platform:
312+
313+
```
314+
core/target/classes/io/questdb/client/bin-local/
315+
├── libquestdb.dylib # macOS
316+
├── libquestdb.so # Linux
317+
└── libquestdb.dll # Windows
318+
```
319+
241320
## Community
242321

243322
- [QuestDB Documentation](https://questdb.com/docs/)

0 commit comments

Comments
 (0)