Mac 安装Thrift

系统:Mac Mountain Lion 10.8.2
软件:Thrift 0.9.0

解压thrift-0.9.0.tar.gz并进入当前目录,
i.Configure
需要说明的是,笔者只需要PHP,JAVA之间通信,所以将其他语言禁用。Thrift 支持的语言有:C++, C#, Cocoa, Erlang, Haskell, Java, Ocami, Perl, PHP, Python, Ruby, Smalltalk.
[thrift-0.9.0:username]$./configure --prefix=/Users/username/Develop/thrift --without-csharp --without-erlang --without-perl --without-ruby –without-haskell

ii.Make
[thrift-0.9.0:username]$make

iii.Make Install
[thrift-0.9.0:username]$sudo make install


测试:[~:username]$~/Develop/thrift/bin/thrift -version

[color=red]//以下是安装过程中遇到的错误:[/color]
[b]1、configure: error: C compiler cannot create executables[/b]
......
checking whether make sets $(MAKE)... yes
checking how to create a ustar tar archive... gnutar
checking for pkg-config... no
checking for gcc... gcc
checking whether the C compiler works... no
configure: error: in `/Users/username/Develop/thrift-0.9.0':
configure: error: C compiler cannot create executables
See `config.log' for more details
.......

查看config.log日志,
104 cc1: error: /Applications/Xcode.app/Contents/Developer/usr/llvm-gcc-4.2/lib/gcc/i686-apple-darwin11/4.2.1/include: Not a directory
105 cc1: error: /Applications/Xcode.app/Contents/Developer/usr/llvm-gcc-4.2/i686-apple-darwin11/include: Not a directory
发现路径有问题,也就是安装的Xcode有问题。之前我将xcode安装在其他自定义目录了,看来必须要装在/Applications目录下。重装后执行./configure 即可


[b]2、 ......./lib/rb/Rakefile:23[/b]
.......
/Users/username/Develop/thrift-0.9.0/lib/rb/Rakefile:23
(See full trace by running task with --trace)
make[3]: *** [all-local] Error 1
make[2]: *** [all-recursive] Error 1
make[1]: *** [all-recursive] Error 1
make: *** [all] Error 2
.......

看来是ruby环境问题。所以在configure的时候将ruby禁用即可
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值