Skip to content

Building librdkafka

Cindy Lee edited this page Sep 15, 2020 · 21 revisions

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 DRAFT 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) 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 python3 zlib-devel
  • Ubuntu (18.04, 20.04)

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

1.2) 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