【问题标题】:Can't install Thrift on Mac OS 10.9.2无法在 Mac OS 10.9.2 上安装 Thrift
【发布时间】:2014-05-04 11:08:21
【问题描述】:

这个问题就像Installing thrift on CentOS 6.5 64 bit and Cassandra PDO ,但他在 CentOS 上,我在运行 MacOS。

checking for gawk... (cached) awk
checking for ranlib... (cached) ranlib
./configure: line 17029: syntax error near unexpected token `QT,'
./configure: line 17029: `    PKG_CHECK_MODULES(QT, QtCore >= 4.3, QtNetwork >= 4.3, have_qt=yes, have_qt=no)'

我的环境是

gcc -v
Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr --with-gxx-include-dir=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk/usr/include/c++/4.2.1
Apple LLVM version 5.1 (clang-503.0.40) (based on LLVM 3.4svn)
Target: x86_64-apple-darwin13.1.0
Thread model: posix

uname -a
Darwin rMacBook.local 13.1.0 Darwin Kernel Version 13.1.0: Wed Apr  2 23:52:02 PDT 2014; root:xnu-2422.92.1~2/RELEASE_X86_64 x86_64

添加:

当我运行./bootstrap.sh时,结果是:

    lib/cpp/test/Makefile.am:221: warning: 'INCLUDES' is the old name for 'AM_CPPFLAGS' (or '*_CPPFLAGS')
lib/cpp/test/Makefile.am:187: warning: variable 'processor_test_SOURCES' is defined but no program or
lib/cpp/test/Makefile.am:187: library has 'processor_test' as canonical name (possible typo)
lib/cpp/test/Makefile.am:178: warning: variable 'concurrency_test_SOURCES' is defined but no program or
lib/cpp/test/Makefile.am:178: library has 'concurrency_test' as canonical name (possible typo)
lib/cpp/test/Makefile.am:195: warning: variable 'processor_test_LDADD' is defined but no program or
lib/cpp/test/Makefile.am:195: library has 'processor_test' as canonical name (possible typo)
lib/cpp/test/Makefile.am:184: warning: variable 'concurrency_test_LDADD' is defined but no program or
lib/cpp/test/Makefile.am:184: library has 'concurrency_test' as canonical name (possible typo)
test/cpp/Makefile.am:96: warning: 'INCLUDES' is the old name for 'AM_CPPFLAGS' (or '*_CPPFLAGS')
tutorial/cpp/Makefile.am:65: warning: 'INCLUDES' is the old name for 'AM_CPPFLAGS' (or '*_CPPFLAGS')

【问题讨论】:

  • 当我运行./bootstrap.sh时,结果是:
  • 您使用的是哪个 Thrift 版本?您是否尝试过按照另一个问题中的建议更新 gcc/autoconf?
  • 是的,所有插件都是最近发布的。我使用来自thrift.apache.orggithub.com/apache/thrift的源。这个错误是使用github的源。org的源是:src/generate/t_java_generator.cc: 2830:14:错误:首先不兼容的操作数类型('bool' 和 'basic_ostream >')?首先=假:缩进(f_service_)
  • 你的第一个问题会不会和this one有关?您的设置有问题,可能与 Thrift 本身无关。第二个是this one,这是一个完全不同的问题,不属于这个问题。
  • 不应该迁移到apple.stackexchange.com吗?

标签: macos thrift autotools


【解决方案1】:

尝试以下操作:

$ brew install pkg-config

我今天遇到了同样的问题,我不想使用 brew install thrift,因为我的 boost 安装在自定义位置。

安装 pkg-config 然后建立一个干净的 thrift 结帐工作。

【讨论】:

    【解决方案2】:

    我只是安装thrift use brew。因为我的brew版本太低。我更新了我的brew,它可以工作。但是当我更新我的brew时,我遇到了一个问题--https://github.com/Homebrew/homebrew/issues/28965#issuecomment-42163418 谢谢大家的回答!

    只要命令这些:

    brew update
    brew install thrift
    

    如果更新遇到这样的问题:

    undefined method `to_sym' for nil:NilClass
    

    再次 brew update 即可!

    【讨论】:

      【解决方案3】:

      如何安装macports 并简单地做:

      $ sudo port install thrift
      

      【讨论】:

        【解决方案4】:

        对于 thrift 11,先安装 brew,然后简单地使用这个命令:

        brew install https://raw.githubusercontent.com/Homebrew/homebrew-core/4ba654c6d99b3b6804dd3843546a9dcbb700188b/Formula/thrift.rb
        

        【讨论】: