从源码安装 confluent-kafka-python
从源码安装 librdkafka
# 安装 vcpkg
> git clone https://github.com/microsoft/vcpkg ~/.local/vcpkg
> ~/.local/vcpkg/bootstrap-vcpkg.sh
# 安装 librdkafka
> ~/.local/vcpkg/vcpkg install librdkafka
- 设置 include path 和 link path
export CPATH=~/.local/vcpkg/packages/librdkafka_x64-linux/include
export LIBRARY_PATH=~/.local/vcpkg/packages/librdkafka_x64-linux/lib
GCC uses the following environment variables:
- PATH: For searching the executables and run-time shared libraries (.dll, .so).
- CPATH: For searching the include-paths for headers. It is searched after paths specified in
-I<dir>
options.C_INCLUDE_PATH
andCPLUS_INCLUDE_PATH
can be used to specify C and C++ headers if the particular language was indicated in pre-processing.- LIBRARY_PATH: For searching library-paths for link libraries. It is searched after paths specified in
-L<dir>
options. 程序编译期查找动态链接库的路径。- LD_LIBRARY_PATH: 程序运行期间查找动态链接库的路径。
- 安装 librdkafka
pip install -e ~/work/Douban/code/confluent-kafka-python/
参考链接
- https://www3.ntu.edu.sg/home/ehchua/programming/cpp/gcc_make.html#zz-1.9
- https://github.com/microsoft/vcpkg
2022年03月11日 / 14:34