为将来跨语言通信预研,选择了thrift来试试。结果在mac os上面安装遇到种种困难,不知道是我选择方法错误还是咋的,不管怎样,总算是编译过去了。

首先,我们来参考官网的安装步骤:https://thrift.apache.org/docs/install/os_x

OS X Setup

The following command install all the required tools and libraries to build and install the Apache Thrift compiler on a OS X based system.

Install Boost

Download the boost library from boost.org untar compile with

./bootstrap.sh
sudo ./b2 threading=multi address-model=64 variant=release stage install

Install libevent

Download libevent, untar and compile with

./configure --prefix=/usr/local
make
sudo make install

Building Apache Thrift

Download the latest version of Apache Thrift, untar and compile with

./configure --prefix=/usr/local/ --with-boost=/usr/local --with-libevent=/usr/local

Additional reading

For more information on the requirements see: Apache Thrift Requirements

For more information on building and installing Thrift see: Building from source

This snippet was generated by Apache Thrift's source tree docsdoc/install/os_x.md

----------------------------------------------------------------------------------

然后,你可能会遇到下面的问题:

make[4]: *** [src/thrift/transport/TSSLSocket.lo] Error 1

openssl版本过旧导致, 在mac下面可以升级一下:

brew update
brew install openssl
brew link --force openssl

openssl version -a

processor/ProcessorTest.cpp:26:10: fatal error: 'tr1/functional' file not found

The problem here is that libc++ has been written after c++11 was "released".
You could try this:

#if __cplusplus >= 201103L
#include <functional>
#else
#include <tr1/functional>
#endif

and compile with CXXFLAGS="-std=c++11".

[thrift dir]/lib/cpp/test/processor/ProcessorTest.cpp

---------------------------------------------------------------------

library not found for -l:libboost_unit_test_framework.a thrift

为啥不能找到lib目录呢?

fuck,修改:

vim  [thrift dir]/lib/cpp/test/Makefile.am

暂时用绝对路径:/usr/local/lib/ibboost_unit_test_framework.a 替换

终于通过了,跨平台为啥做的这么烂~

如何让thrift0.9.2 在macos上面编译通过?的更多相关文章

  1. 【Java】macOS下编译JDK8

    安装mercurial brew install mercurial 下载源码 1234 hg clone http://hg.openjdk.java.net/jdk8/jdk8 java-sour ...

  2. 在Windows和MacOS下编译Lua

    官方说明: http://www.lua.org/manual/5.3/readme.html 在Windows下编译Lua动态链接库的注意事项: 1. 创建一个空的DLL项目: 2. 将src文件夹 ...

  3. 在 MacOS 上编译链接 OpenGL 程序

    几个星期以前开始折腾在我的MBA上写 OpenGL 小程序.我不太熟悉MacOS上的开发工具比如XCode,所以一开始的想法就是用vim来写程序,然后手工编译链接.网上查了一下,MacOS上的Open ...

  4. macOS 上编译 Dynamips

    Dynamips 是一个Cisco 路由器模拟软件. 安装过程: git clone git://github.com/GNS3/dynamips.git cd dynamips mkdir buil ...

  5. MacOS X编译OpenSceneGraph

    本文主要记录在MacOS X上编译OpenSceneGraph,方便日后查阅.所使用的环境如下: MacOS X 10.10 Yosemite XCode 6.3.2 CMake 3.3.0 Open ...

  6. Macos系统编译percona及部分函数在Macos系统上运算差异

    欢迎来到 GreatSQL社区分享的MySQL技术文章,如有疑问或想学习的内容,可以在下方评论区留言,看到后会进行解答 本文来源:原创投稿 GreatSQL社区原创内容未经授权不得随意使用,转载请联系 ...

  7. TODO:macOS编译PHP7.1

    TODO:macOS编译PHP7.1 本文主要介绍在macOS上编译PHP7.1,有兴趣的朋友可以去尝试一下. 1.下载PHP7.1源码,建议到PHP官网下载纯净到源码包php-7.1.0.tar.g ...

  8. macos解决Hadoop之Unable to load native-hadoop library

    很显然,native-hadoop library不支持macos,如果是Linux就不会有这个问题.在百度上搜了,要下载在macos上编译的native hadoop library,我在网上下载了 ...

  9. thrift笔记

    Thrift tutorial 演示 python服务端与客户端本文的开发环境是windows 7 + python2.7.3Thrift官方主页:http://thrift.apache.org/先 ...

随机推荐

  1. response.setHeader各种用法

    一秒刷新页面一次 response.setHeader("refresh","1"); 二秒跳到其他页面 (登陆跳转) response.setHeader(& ...

  2. Django 2 创建app

    python manage.py startapp polls 创建model 创建完model以后使用 查看sql python manage.py sql polls 然后使用 python ma ...

  3. 用Netty开发中间件:高并发性能优化(转)

    用Netty开发中间件:高并发性能优化 最近在写一个后台中间件的原型,主要是做消息的分发和透传.因为要用Java实现,所以网络通信框架的第一选择当然就是Netty了,使用的是Netty 4版本.Net ...

  4. Supervisor重新加载配置启动新的进程

    一.添加好配置文件后 二.更新新的配置到supervisord supervisorctl update 三.重新启动配置中的所有程序 supervisorctl reload 四.启动某个进程(pr ...

  5. msyql的内存计算

    本文将讨论MySQL内存相关的一些选项,包括: 单位都是b,不是kb,即1B=1/(1024*1024*1024)G 1)全局的buffer,如innodb_buffer_pool_size: 2)线 ...

  6. 详解 Go 语言中的 time.Duration 类型

    swardsman详解 Go 语言中的 time.Duration 类型swardsman · 2018-03-17 23:10:54 · 5448 次点击 · 预计阅读时间 5 分钟 · 31分钟之 ...

  7. 打印-print.js

    //打印开始// strPrintName 打印任务名// printDatagrid 要打印的datagridfunction CreateFormPage(ctx,strPrintName, pr ...

  8. ComBoFuzzySearch.js

    /** * combobox和combotree模糊查询 */(function () { //combobox可编辑,自定义模糊查询 $.fn.combobox.defaults.editable ...

  9. javascript 实现java中的Map

    javascript实现java中的Map,代码是在国外的一个网站上看到的(http://stackoverflow.com/questions/368280/javascript-hashmap-e ...

  10. 115个Java面试题和答案(上)

    转自:http://www.importnew.com/10980.html 本文我们将要讨论Java面试中的各种不同类型的面试题,它们可以让雇主测试应聘者的Java和通用的面向对象编程的能力.下面的 ...