ArchLinux上安装librdkafka

分享一下我老师大神的人工智能教程!零基础,通俗易懂!http://blog.csdn.net/jiangjunshow

也欢迎大家转载本篇文章。分享知识,造福人民,实现我们中华民族伟大复兴!

               

ArchLinux上安装librdkafka

1 下载github代码

git clone https://github.com/edenhill/librdkafka.git

2 编译

确保在master branch中,然后运行命令

[dean@dell_xps_13 librdkafka]$ ./configure checking for OS or distribution... ok (Linux)checking for C compiler from CC env... failedchecking for gcc (by command)... okchecking for C++ compiler from CXX env... failedchecking for C++ compiler (g++)... okchecking executable ld... okchecking executable nm... okchecking executable objdump... okchecking executable strip... okchecking for pkgconfig (by command)... okchecking for install (by command)... okchecking for PIC (by compile)... okchecking for GNU-compatible linker options... okchecking for GNU linker-script ld flag... okchecking for __atomic_32 (by compile)... okchecking for __atomic_64 (by compile)... okchecking for socket (by compile)... okparsing version '0x00090100'... ok (0.9.1)checking for libpthread (by pkg-config)... failedchecking for libpthread (by compile)... okchecking for zlib (by pkg-config)... okchecking for libcrypto (by pkg-config)... okchecking for libssl (by pkg-config)... okchecking for libsasl2 (by pkg-config)... failedchecking for libsasl2 (by compile)... okchecking for regex (by compile)... okchecking for librt (by pkg-config)... failedchecking for librt (by compile)... okTchecking for strndup (by compile)... okchecking for nm (by env NM)... ok (cached)checking for python (by command)... okGenerated Makefile.configGenerated config.hConfiguration summary:  prefix                   /usr/local  ARCH                     x86_64  CPU                      generic  GEN_PKG_CONFIG           y  ENABLE_DEVEL             n  ENABLE_VALGRIND          n  ENABLE_REFCNT_DEBUG      n  ENABLE_SHAREDPTR_DEBUG   n  ENABLE_SSL               y  ENABLE_SASL              y  MKL_APP_NAME             librdkafka  MKL_APP_DESC_ONELINE     The Apache Kafka C/C++ library  MKL_DISTRO               Linux  CC                       gcc  CXX                      g++  LD                       ld  NM                       nm  OBJDUMP                  objdump  STRIP                    strip  CPPFLAGS                 -g -O2 -fPIC -Wall -Wsign-compare -Wfloat-equal -Wpointer-arith  PKG_CONFIG               pkg-config  INSTALL                  install  LIB_LDFLAGS              -shared -Wl,-soname,$(LIBFILENAME)  LDFLAG_LINKERSCRIPT      -Wl,--version-script=  RDKAFKA_VERSION_STR      0.9.1  MKL_APP_VERSION          0.9.1  LIBS                     -lpthread -lz -lcrypto -lssl -lsasl2 -lrt  CFLAGS                     CXXFLAGS                 -Wno-non-virtual-dtor  SYMDUMPER                $(NM) -D  exec_prefix              /usr/local  bindir                   /usr/local/bin  sbindir                  /usr/local/sbin  libexecdir               /usr/local/libexec  datadir                  /usr/local/share  sysconfdir               /usr/local/etc  sharedstatedir           /usr/local/com  localstatedir            /usr/local/var  libdir                   /usr/local/lib  includedir               /usr/local/include  infodir                  /usr/local/info  mandir                   /usr/local/manGenerated config.cacheNow type 'make' to build

会出现一些failed信息, 只要在最后没有大段的错误信息,这些是可以接收的,因为只是在判断哪个库可可以用。比如

checking for C compiler from CC env... failedchecking for gcc (by command)... ok

运行make编译,很快完成。

3 安装

sudo make install, 默认会安装在/usr/local/目录下的lib和include/librdkafka目录中.

[dean@dell_xps_13 librdkafka]$ sudo make install[sudo] password for dean: make[1]: Entering directory '/home/dean/work/github/librdkafka/src'Install librdkafka to /usr/localinstall -d $DESTDIR/usr/local/include/librdkafka ; \install -d $DESTDIR/usr/local/lib ; \install rdkafka.h $DESTDIR/usr/local/include/librdkafka ; \install librdkafka.a $DESTDIR/usr/local/lib ; \install librdkafka.so.1 $DESTDIR/usr/local/lib ; \[ -f "rdkafka.pc" ] && ( \        install -d $DESTDIR/usr/local/lib/pkgconfig ; \        install -m 0644 rdkafka.pc $DESTDIR/usr/local/lib/pkgconfig \) ; \(cd $DESTDIR/usr/local/lib && ln -sf librdkafka.so.1 librdkafka.so)make[1]: Leaving directory '/home/dean/work/github/librdkafka/src'make[1]: Entering directory '/home/dean/work/github/librdkafka/src-cpp'Install librdkafka++ to /usr/localinstall -d $DESTDIR/usr/local/include/librdkafka ; \install -d $DESTDIR/usr/local/lib ; \install rdkafkacpp.h $DESTDIR/usr/local/include/librdkafka ; \install librdkafka++.a $DESTDIR/usr/local/lib ; \install librdkafka++.so.1 $DESTDIR/usr/local/lib ; \[ -f "rdkafka++.pc" ] && ( \        install -d $DESTDIR/usr/local/lib/pkgconfig ; \        install -m 0644 rdkafka++.pc $DESTDIR/usr/local/lib/pkgconfig \) ; \(cd $DESTDIR/usr/local/lib && ln -sf librdkafka++.so.1 librdkafka++.so)

Created: 2016-04-29 Fri 14:47

Validate

           

给我老师的人工智能教程打call!http://blog.csdn.net/jiangjunshow

这里写图片描述

猜你喜欢

转载自blog.csdn.net/fduffyyg/article/details/84039357
今日推荐