Apache Thrift 未安装在 Mac 上

sme*_*eeb 2 c java macos thrift protocol-buffers

Mac OSX 10.10.5 (Yosemite) 在这里。我正在尝试寻找一种工具来:

  1. 给定定义/配置文件,生成本机 C 网络/套接字客户端(库);和
  2. 给定定义/配置文件,生成 Java 网络/套接字服务器

实际上,这两个工件(可能)将在同一台机器上运行,但一个必须是本机 C,另一个必须是 Java。

相信 Thrift是一个可以完成这项工作的工具,但如果不是,或者有其他/更好/更容易使用的工具,那么我当然愿意接受其他建议。


我一开始就期望 Thrift 能够以某种发行版的形式出现,并准备好按原样运行。相反,根据文档,您似乎必须自己构建它。输入痛苦。

我下载了 tarball ( v0.9.3),然后导航到解压后的目录。然后我运行./configure(正如这些文档所述),这会产生大量输出,最可疑的是:

Building C++ Library ......... : yes
Building C (GLib) Library .... : no     <--- heh?
Building Java Library ........ : no     <--- heh?
Building C# Library .......... : no
Building Python Library ...... : yes
Building Ruby Library ........ : no
Building Haxe Library ........ : no
Building Haskell Library ..... : no
Building Perl Library ........ : yes
Building PHP Library ......... : yes
Building Erlang Library ...... : no
Building Go Library .......... : no
Building D Library ........... : no
Building NodeJS Library ...... : yes
Building Lua Library ......... : no
Run Code Online (Sandbox Code Playgroud)

现在我对 Thrift 一无所知,但对我来说,它看起来并没有构建“库”/“生成器”/等。对于 C 或 Java,这两种语言我特别感兴趣!(1) 关于为什么有什么想法吗?

接下来,指令状态为 run make,这会产生难以理解的编译器错误:

...blah blah blah lots of compiler output, blah blah blah...

src/thrift/transport/TSSLSocket.cpp:147:24: error: use of undeclared identifier 'TLSv1_1_method'; did you mean 'TLSv1_method'?
    ctx_ = SSL_CTX_new(TLSv1_1_method());
                       ^~~~~~~~~~~~~~
                       TLSv1_method

src/thrift/transport/TSSLSocket.cpp:149:24: error: use of undeclared identifier 'TLSv1_2_method'; did you mean 'TLSv1_method'?
    ctx_ = SSL_CTX_new(TLSv1_2_method());
                       ^~~~~~~~~~~~~~
                       TLSv1_method

74 warnings and 2 errors generated.
make[4]: *** [src/thrift/transport/TSSLSocket.lo] Error 1
make[3]: *** [all-recursive] Error 1
make[2]: *** [all-recursive] Error 1
make[1]: *** [all-recursive] Error 1
make: *** [all] Error 2
Run Code Online (Sandbox Code Playgroud)

(2) 知道如何解决这里的问题吗?!?

看起来我要绕着谷仓转三圈。在文档的其他区域,我需要构建几个其他库(Boost 和libevent),并且我也遇到了这些构建的说明的各种令人头痛的问题(例如,libevent我的版本不喜欢 Bison 的版本)默认情况下随 Mac 一起提供,等等)。

Thrift 是否是一款可以在 Mac OS 上运行的完全就绪的应用程序?为什么我需要经历这座大楼的所有动作?

所以最重要的是:(3) 如果存在,我在哪里可以找到可立即运行的 Thrift Mac 可执行文件?如果它不存在,是否还有其他更容易安装/运行的工具?

sme*_*eeb 5

最后,事情很简单:

brew install thrift