如何在 Windows 机器上安装和配置 KafkaCat? [英] How can I install and configure KafkaCat in windows machine?

查看:65
本文介绍了如何在 Windows 机器上安装和配置 KafkaCat?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试在 Windows 机器上安装 kafkaCat 工具.通过运行 ./bootstrap.sh 进行快速构建时,出现以下错误:

I am trying to install kafkaCat tool in windows machine. While doing a quick build by running ./bootstrap.sh, I am getting following error:

$ ./bootstrap.sh
Directory librdkafka already exists, not downloading https://github.com/edenhill/librdkafka/archive/master.tar.gz
Directory libyajl already exists, not downloading https://github.com/lloyd/yajl/archive/master.tar.gz
Building librdkafka
checking for OS or distribution... ok (MINGW64_NT-6.1)
checking for C compiler from CC env... failed
checking for gcc (by command)... failed
checking for clang (by command)... failed
checking for cc (by command)... failed (fail)
checking for C++ compiler from CXX env... failed
checking for C++ compiler (g++)... failed
checking for C++ compiler (clang++)... failed
checking for C++ compiler (c++)... failed (fail)
checking executable ld... failed (disable)
checking executable nm... failed (disable)
checking executable objdump... failed (disable)
checking executable strip... failed (disable)
checking for pkgconfig (by command)... failed
checking for install (by command)... ok
checking for PIC (by compile)... failed (disable)
checking for GNU-compatible linker options... failed
checking for OSX linker options... failed
checking for GNU linker-script ld flag... failed
checking for Solaris linker-script ld flag... failed (ignore)
checking for __atomic_32 (by compile)... failed
checking for __atomic_32_lib (by compile)... failed
checking for __sync_32 (by compile)... failed (disable)
checking for __atomic_64 (by compile)... failed
checking for __atomic_64_lib (by compile)... failed
checking for __sync_64 (by compile)... failed (disable)
checking for socket (by compile)... failed
checking for socket_nsl (by compile)... failed (fail)
parsing version '0x00090401'... ok (0.9.4)
checking for libpthread (by compile)... failed (fail)
checking for zlib (by compile)... failed (disable)
checking for libcrypto (by compile)... failed (disable)
checking for liblz4 (by compile)... failed (disable)
checking for libssl (by compile)... failed (disable)
checking for libsasl2 (by compile)... failed (disable)
checking for libsasl (by compile)... failed (disable)
checking for regex (by compile)... failed (disable)
checking for librt (by compile)... failed
checking for strndup (by compile)... failed (disable)
checking for nm (by env NM)... failed



###########################################################
###                  Configure failed                   ###
###########################################################
### Accumulated failures:                               ###
###########################################################
 cc (WITH_CC)
module: cc
action: fail
reason:
command 'cc --version' failed:
mklove/modules/configure.base: line 1110: cc: command not found

 cxx (WITH_CXX) C++ compiler (c++)
module: cc
action: fail
reason:
command 'c++ --version' failed:
mklove/modules/configure.base: line 1110: c++: command not found

 socket_nsl ()
module: socket
action: fail
reason:
compile check failed:
CC: CC
flags:
  -g -O2 -Wall -Wsign-compare -Wfloat-equal -Wpointer-arith -Wall -Werror  _mkltmpc57mad.c -o _mkltmpc57mad.c.o -lsocket -lnsl :
mklove/modules/configure.base: line 917: -g: command not found
source:
#include <sys/types.h>
#include <sys/socket.h>
#include <unistd.h>
void foo (void) {
   int s = socket(0, 0, 0);
   close(s);
}

 libpthread ()
module: librdkafka
action: fail
reason:
compile check failed:
CC: CC
flags: -lpthread
  -g -O2 -Wall -Wsign-compare -Wfloat-equal -Wpointer-arith -Wall -Werror -lpthread _mkltmp0Vm7ew.c -o _mkltmp0Vm7ew.c.o  :
mklove/modules/configure.base: line 917: -g: command not found
source: #include <pthread.h>

Build of librdkafka FAILED!
Failed to build librdkafka: bootstrap failed

有谁知道如何在windows机器上配置kafkaCat?
提前致谢.

Does anyone know how to configure kafkaCat in windows machine?
Thanks in advance.

推荐答案

我从未尝试过使用 MinGW 构建 librdkafka,但应该可以.您似乎缺少构建工具链(没有 cc、ld、nm 等).

I've never tried building librdkafka with MinGW but it should be possible. It looks like you are missing the build toolchain (no cc, ld, nm, etc).

查看 MinGW 安装说明了解更多信息:http://www.mingw.org/wiki/howto_install_the_mingw_gcc_compiler_suite

See the MinGW installation instructions for more info: http://www.mingw.org/wiki/howto_install_the_mingw_gcc_compiler_suite

从您的描述中也不清楚这是尝试进行本机编译还是交叉编译.

It is also not clear from your description whether this is an attempt at native or cross compilation.

另一种可能更好的替代方法是在 Visual Studio 中构建 kafkacat:

Another, probably better, alternative is to build kafkacat in Visual Studio:

  • 在 Visual Studio 中打开 kafkacat\win32\kafkacat.sln VS 解决方案
  • 在 kafkacat 项目上,右键单击并选择恢复包"
  • 从构建"菜单中选择重建解决方案"

这应该会给你一个 kafkacat.exe,它可以在本机 win32 中运行(不需要 mingw、cygwin 等)

This should give you a kafkacat.exe that works in native win32 (no need for mingw, cygwin, ..)

如果您发现此方法有任何问题,请直接在 kafkacat 项目上提出问题.

If you find any problems with this approach please file an issue directly on the kafkacat project.

这篇关于如何在 Windows 机器上安装和配置 KafkaCat?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆