如何让thrift0.9.2 在macos上面编译通过?

为将来跨语言通信预研,选择了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 替换

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

时间: 2024-09-01 02:26:02

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

macOS 上编译 Dynamips

Dynamips 是一个Cisco 路由器模拟软件. 安装过程: git clone git://github.com/GNS3/dynamips.git cd dynamips mkdir build cd build cmake .. 对于 macOS,需要准备好 cmake 和 libelf. 如果遇到报错: CMake Error at /usr/local/Cellar/cmake/3.10.2/share/cmake/Modules/FindPackageHandleStandard

TODO:macOS编译PHP7.1

本文主要介绍在macOS上编译PHP7.1,有兴趣的朋友可以去尝试一下. 1.下载PHP7.1源码,建议到PHP官网下载纯净到源码包php-7.1.0.tar.gz 2.解压php-7.1.0.tar.gz包 3.创建配置 ./configure –prefix=/usr/local/php7 –with-apxs=/usr/sbin/apxs –enable-fpm –with-fpm-user=www –with-fpm-group=www –with-mysqli –with-pdo-my

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

很显然,native-hadoop library不支持macos,如果是Linux就不会有这个问题.在百度上搜了,要下载在macos上编译的native hadoop library,我在网上下载了native,但是没有用,还是报错,所以那个package应该只适用linux,网上搜macos的native,但是没有看,所以只有自己去编译hadoop. 要安装maven,protobuf2.50,openssl等,其中参考了很多博客:https://www.jianshu.com/p/75f7

Redis缓存技术学习系列之邂逅Redis

??作为一个反主流的开发者,在某种程度上,我对传统关系型数据库一直有点"讨厌",因为关系型数据库实际上和面向对象思想是完全冲突的,前者建立在数学集合理论的基础上,而后者则是建立在软件工程基本原则的基础上.虽然传统的ORM.序列化/反序列化在一定程度上解决了这种冲突,但是软件开发中关于使用原生SQL语句还是使用ORM框架的争论从来没有停止过.可是实际的业务背景中,是完全无法脱离数据库的,除非在某些特定的场合下,考虑到信息安全因素而禁止开发者使用数据库,在主流技术中数据库是一个非常重要的组

QT4项目升级到QT5遇到的问题和解决方法

QT4升级到QT5改动: PC部分: [改QTDIR变量] 在工程根目录下找到.user文件, 如InnoTabPlugin.vcxproj.user 修改指向你的QT5根目录: <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Template|Win32'"> <QTDIR>C:\qt\Qt5.2.1\5.2.1\msvc2010</QTDIR> </PropertyGro

QT项目升级(QT4.6.3到QT5.2)时,遇到的问题和解决方法

QT4升级到QT5修改: PC部分: [改QTDIR变量] 在project根文件夹下找到.user文件, 如InnoTabPlugin.vcxproj.user 改动指向你的QT5根文件夹: <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Template|Win32'"> <QTDIR>C:\qt\Qt5.2.1\5.2.1\msvc2010</QTDIR> </Prop

安装 Yaf 到 Mac

Mac下快速安装PHP框架Yaf 引用 Yaf 是国内PHP大神Laruence基于PHP扩展开发的框架.主要特点就是速度快,效率高,比使用PHP代码开发的框架性能都要高很多.据大神说已经用上 了新浪Weibo上,TPS提升了76个百分点.具体可以参考Yaf的主页. 在Mac下安装开源软件和服务器软件当然没有Ubuntu的apt-get顺手,但也有MacPorts和HomeBrew等优秀的包管理器,我目前使用 的是后者,因为它用起来更简单,可以让你去专注做需要专注的事情. 最近几个项目准备用Ya

FFmpeg示例程序合集-批量编译脚本

此前做了一系列有关FFmpeg的示例程序,组成了<最简单的FFmpeg示例程序合集>,其中包含了如下项目:simplest ffmpeg player:                  最简单的基于FFmpeg的视频播放器simplest ffmpeg audio player:       最简单的基于FFmpeg的音频播放器simplest ffmpeg pic encoder:        最简单的基于FFmpeg的图像编码器simplest ffmpeg video encoder

Lua学习笔记(一):搭建开发环境

Lua是一个小巧高效的解释型脚本语言,可以方便的嵌入到任意的语言中,很多应用程序.游戏使用LUA作为自己的嵌入式脚本语言,以此来实现可配置性.可扩展性.这其中包括魔兽世界.博德之门.愤怒的小鸟.VOCALOID3.太阳神三国杀等. 下载和编译 下载连接:http://www.lua.org/download.html,点击Download按钮下载lua的源代码. 解压后获得的源码是不能直接使用的,还需要我们手动进行编译才能使用. Window下编译 主要我们需要安装VS才能进行编译. 编译Lua