How do I get thrift0.9.2 to compile on MacOS?

Source: Internet
Author: User
Tags install openssl openssl version

For the future of cross-language communication pre-research, chose the thrift to try. Results in the Mac OS installed on the difficulties encountered, do not know whether I choose a method error or what, anyway, it is finally compiled.

First, we refer to the installation steps of the official website: 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./Threading=Address-modelVariant=Install    
Install libevent

Download libevent, Untar and compile with

./--prefix=/usr/makeinstall       
Building Apache Thrift

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

./--prefix=/usr/local--with-boost=/usr/ --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 is generated by Apache Thrift ' s source tree docs: doc/install/os_x.md

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

Then, you may experience the following problem:

MAKE[4]: * * * [Src/thrift/transport/tsslsocket.lo] Error 1

The OpenSSL version is too old and can be upgraded under 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 is, that libc++ have 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

Why can't we find the Lib directory?

Fuck, modify:

VIM [Thrift dir]/lib/cpp/test/makefile.am

Temporarily with absolute path:/USR/LOCAL/LIB/IBBOOST_UNIT_TEST_FRAMEWORK.A Replace

Finally passed, cross-platform why do so rotten ~

How do I get thrift0.9.2 to compile on MacOS?

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.