Build or install the latest version of librdkafka. The minimum required version is v0.11.0.
macOS
brew install librdkafkaUbuntu/Debian (unstable)
sudo apt-get install librdkafka-devRHEL/CentOS
sudo yum install librdkafka-develFollow requirements for librdkafka compilation.
To build 32-bit versions on 64-bit OS you need 32-bit versions of libraries and a toolchain.
#CentOS/RHEL
sudo yum install glibc-devel.i686 libgcc.i686 libstdc++.i686 zlib-devel.i686
# Ubuntu
sudo apt-get install gcc-multilibgit clone https://github.com/edenhill/librdkafka.git
cd librdkafka
make clean # to make sure nothing left from previous build or if upgrading/rebuilding
# If using OpenSSL, remove --disable-ssl from configure command below
# On macOS with OpenSSL you might need to set `export OPENSSL_ROOT_DIR=/usr/local/Cellar/openssl/1.0.2k` before proceeding
# 32 bit
./configure --prefix=$HOME --disable-sasl --disable-lz4 --disable-ssl --mbits=32
# 64 bits
./configure --prefix=$HOME --disable-sasl --disable-lz4 --disable-ssl --mbits=64
make
make installCompile, install and move shared object file to appropriate location.
-
Make sure you have
QHOMEset as an environment variable. -
If your librdkafka install is not located in
$HOME/includeas defaulted by the above instructions setKAFKA_ROOTenvironment variable to the appropriate include location. -
Run the following set of commands to set up the system as outlined
// in kfk source folder
make
// move installed `.so` to `$QHOME/<arch>`
make install
// remove `.so` from kfk source folder
make cleanNote: If compiling dynamically linked libkfk.so make sure you have librdkafka.so.1 in your LD_LIBRARY_PATH.
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$HOME/libAt present the Windows build of the .dll for the kafka interface has been tested on Visual Studio 2017 with librdkafka.redist.1.0.0. The following are the steps completed to achieve this
-
Install nuget for Windows: https:/nuget.com/downloads
-
Install the redistributed version of librdkafka which is suitable for use with windows, documentation can be found here.
nuget install librdkafka.redist
-
Ensure you have Windows Visual Studio 2017 installed.
-
Place the installed librdkafka.redist into an appropriate location (suggestions
%HOME%or%QHOME%). For the remaining instructions, the path to the install isC:/Users/jdoe/librdkafka.redist.1.0.0 -
Update
LIBuser environment variable to include the following path tordkafka.hfor appropriate Windows architecture in this caseLIB = C:/Users/jdoe/librdkafka.redist.1.0.0/build/native/lib/win/x64/win-x64-Release/v120
-
Update
PATHsystem environment variable to include path to native folder for the appropriate computer architecturePATH = C:/Users/jdoe/librdkafka.redist.1.0.0/runtimes/win-x64/native
-
Create a user environment variable
KAFKA_NATIVEin line with the following example pathKAFKA_NATIVE = C:/Users/jdoe/librdkafka.redist.1.0.0/build/native/include/
-
Clone the Kafka interface from the KxSystems GitHub repo
git clone https://github.com/kxsystems/kafka
-
Move to the
kafka/build/folder within the GitHub clone and run the following;call "build.bat" -
If prompted for input, follow instructions accordingly.
-
Move the created
.dllfrom the build folder to%QHOME%/<arch>