Skip to content

jasraj/kdb-cpp-common-lib

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Shared Library for Common Functionality in kdb+

This repository provides a shared library that provides access to some common functionality that can be useful when running kdb-based systems on Linux.

NOTE: This repository incorporates (and supercedes) kdb-base64-lib and kdb-systemd-lib.

Summary

Source File Function Prefix Optional Description
Base64.cpp _cpp_b64 No High performance Base64 encoding and decoding
File.cpp _cpp_filesystem No Detailed file and filesystem queries
Process.cpp _cpp_process No Process and thread information
System.cpp _cpp_system No System-level information
Systemd.cpp _cpp_systemd Yes Systemd integration for process reporting

Compiling

To compile, use cmake:

# Create build in a local 'build' folder within the repo
mkdir build
cd build
cmake -DCMAKE_BUILD_TYPE=Release ..
cmake --build .

The Dockerfile in this repository can be used to create an image that will be able to compile the library for Ubuntu:

# Explicitly build for x86_64 (if running on M-series Mac)
podman build -t jasraj/cmake:1.0.0 --arch=x86_64 .

# Start a container with the new image and run compilation commands
podman run -it --rm -v $(pwd):/opt/git/repo --arch=x86_64 jasraj/cmake:1.0.0 /bin/bash

Optional Components

All the components marked as optional in the table above will be excluded (OFF) by default. The sections below describe how to enable them and the additional library requirements.

systemd

To include the systemd functionality within the shared library, ensure you have the development files for systemd installed:

  • Ubuntu: libsystemd-dev
  • CentOS: systemd-devel

The configuration flag to enable this is BUILD_SYSTEMD_COMPONENT. Example:

cmake -DCMAKE_BUILD_TYPE=Release -DBUILD_SYSTEMD_COMPONENT=ON ..

Installing

The generated shared library will be in the build folder:

> ls -l *.so*
lrwxr-xr-x. 1 root root    22 Feb 12 15:30 libkdb-cpp-common.so -> libkdb-cpp-common.so.1
lrwxr-xr-x. 1 root root    26 Feb 12 15:30 libkdb-cpp-common.so.1 -> libkdb-cpp-common.so.1.0.0
-rwxr-xr-x. 1 root root 79928 Feb 12 15:30 libkdb-cpp-common.so.1.0.0

and one of the following options should be used for installation:

  1. Manually move the shared library into any folder specified on $LD_LIBRARY_PATH
  2. Install the library into /usr/lib with cmake --install . (will require root user)
  3. Generate DEB and RPM files with cpack .

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors