Skip to main content

Installing libks

This guide provides step-by-step instructions to install the libks library, including building it from source with the necessary development dependencies.

libks2 stands for "Library for Kicks" and provides a set of low-level utility functions and abstractions. It is widely used in telecommunication projects to handle threading, memory management, networking, and more.

Prerequisites

warning

Ensure Required Development Tools Are Installed.

Before starting, ensure that the following development tools are installed on your system:

  • cmake
  • make
  • gcc (or another C compiler)
  • git
  • Any required system development libraries (e.g., libssl-dev, libpthread if necessary)

Installing Development Tools

  • For Ubuntu/Debian:

    sudo apt update
    sudo apt install build-essential cmake git
  • For CentOS/RHEL:

    sudo yum groupinstall 'Development Tools'
    sudo yum install cmake git
  • For Fedora:

    sudo dnf groupinstall 'Development Tools'
    sudo dnf install cmake git

Ensure your system is updated and has the correct permissions to install and build software.

Installation Steps:

  • Navigate to /usr/local/src directory.

    cd /usr/local/src
  • Clone the libks repository:

    git clone https://github.com/signalwire/libks.git
  • Navigating into the Directory:

    cd libks
  • Configure and build the Project: You can build the project in different modes. Typically, there are two common modes: Debug (default) and Release. Ensure that the build type is set to Release for production installations; otherwise, performance may be significantly impacted.

    • To build in debug mode (no optimizations, includes debugging symbols):

      cmake . -DCMAKE_BUILD_TYPE=Debug
      make
    • To build in release mode (optimized code with debugging symbols) (Recommended):

      cmake . -DCMAKE_BUILD_TYPE=Release
      make

      The cmake command configures the build, while make compiles the source code.

    • Install the compiled library into the system's standard directories:

      sudo make install

Verify the installation

Check if libks has been correctly installed by running:

sudo ldconfig
ldconfig -p | grep libks