Skip to content
Shahid edited this page Sep 15, 2020 · 1 revision

Building librdkafka

Below versions of librdkafka are available in respective distributions at the time of creation of these build instructions:

  • RHEL 7.6, 7.7, 7.8, 8.1, 8.2 has 0.11.4
  • Ubuntu 18.04 has 0.11.3-1build1
  • Ubuntu 20.04 has 1.2.1-1
  • SLES 12 SP5, 15 SP1, 15 SP2 has 0.11.6-1.3.1

The instructions provided below specify the steps to build librdkafka version 1.5.0 on Linux on IBM Z for following distributions:

  • RHEL (7.6, 7.7, 7.8, 8.1, 8.2)
  • SLES (12 SP5, 15 SP1, 15 SP2)
  • Ubuntu (18.04, 20.04)

General Notes:

  • When following the steps below please use a standard permission user unless otherwise specified.
  • A directory /<source_root>/ will be referred to in these instructions, this is a temporary writable directory anywhere you'd like to place it.

Step 1: Build and Install librdkafka

1.1) Build using script

If you want to build librdkafka using manual steps, go to STEP 1.2.

Use the following commands to build librdkafka using the build script. Please make sure you have wget installed.

wget -q https://raw.githubusercontent.com/linux-on-ibm-z/scripts/master/librdkafka/1.5.0/build_librdkafka.sh

# Build librdkafka
bash build_librdkafka.sh   [Provide -t option for executing build with tests]

If the build completes successfully, go to STEP 2. In case of error, check logs for more details or go to STEP 1.2 to follow manual build steps.

1.2) Install the build dependencies

export SOURCE_ROOT=/<source_root>/
  • RHEL (7.6, 7.7, 7.8, 8.1, 8.2)

    sudo yum install -y git gcc-c++ make cyrus-sasl-devel python3
    
  • SLES (12 SP5, 15 SP1, 15 SP2)

    sudo zypper install -y git-core gcc-c++ make cyrus-sasl-devel python3 zlib-devel
  • Ubuntu (18.04, 20.04)

    sudo apt-get update
    sudo apt-get install -y git gcc g++ make python3

1.3) Download, configure and install librdkafka

  • Download source

    cd $SOURCE_ROOT
    git clone  https://github.com/edenhill/librdkafka.git
    cd librdkafka/
    git checkout v1.5.0
  • Configure

    • For RHEL (7.6, 7.7, 7.8, 8.1, 8.2) and Ubuntu (18.04, 20.04)
    ./configure --install-deps
    • For SLES (12 SP5, 15 SP1, 15 SP2)
    ./configure
  • Build and install

    make
    sudo make install

Step 2: Testing

2.1) Run the unit tests

cd $SOURCE_ROOT/librdkafka/tests
make unit

References:

https://docs.confluent.io/3.3.1/clients/librdkafka/index.html

Clone this wiki locally