Here's some steps I whipped up: -----------------------------------------------------------------------------------------------------
See the ThriftInstallationMacOSX wiki as a reference. http://wiki.apache.org/thrift/ThriftInstallationMacOSX Install and build Boost. In the boost dir run ./bootstrap.sh followed by either ./bjam (sudo ./bjam install) or sudo ./b2 install . Building Thrift from the SVN repository requires bootstrap.sh to generate configure and related files. Follow that with configure, make and make install. The following prerequisites must be met: - XCode - Install MacPorts to get pkgconfig which has pkg.m4. - After installing MacPorts, run "sudo port install pkgconfig". - Update zlib if necessary: run "sudo port install zlib". - copy pkg.m4 to thrift/aclocal, and rerun ./bootstrap.sh (LINK) -> pkg.m4 is usually under /opt/local/share/aclocal/ - Download, build & install autoconf >=2.65 (LINK) -> if 'make install' doesn't work, may need to manually copy the auto* files to /usr/bin (make backups first) Run ./bootstrap.sh to generate the necessary scripts. If you're only interested in the C++ library, skip building for other languages as such: ./configure --with-cpp --without-java --without-python --without-perl --without-php --without-php_extension --without-ruby CPPFLAGS='-arch <archtype>' CXXFLAGS='-arch <archtype>' LDFLAGS='-arch <archtype>' Where <archtype> is i386, x86_64 and ppc. On modern systems, x86_64 is default and may be omitted to target that platform. Run make to compile. If you want universal libraries, each architecture must be built separately until THRIFT-1476 is resolved. Re-run configure & make accordingly, save off the built libthrift* libraries and assemble with lipo (see below). Between building for each platform, it may be necessary to run ./cleanup.sh to clear out stale object files. Gather the generated libraries under thrift/lib/cpp/.libs and assemble based on this example: lipo -create -arch i386 libthrift.a.x86 -arch x86_64 libthrift.a.x64 -output libthrift.a ------------------------------ *From:* "[email protected]" <[email protected]> *To:* [email protected] *Sent:* Friday, August 24, 2012 10:27 AM *Subject:* compilation on a mac At http://thrift.apache.org/docs/install/os_x/ it looks like the boost instructions are out of date. I installed boost from mac ports eventually. I installed libevent in the documented fashion. I issue a configure: *GAir*:thrift garylucas$ ./configure --prefix=/usr/local/ --with-boost=/usr/local --with-libevent=/usr/local --disable-static checking for a BSD-compatible install... /usr/bin/install -c ... <snip> ... -L/usr/local/lib -o Benchmark Benchmark.o libtestgencpp.la -lssl -lcrypto -lpthread libtool: link: cannot find the library `2/lib/cpp/libthrift.la' or unhandled argument `2/lib/cpp/libthrift.la' make[4]: *** [Benchmark] Error 1 make[3]: *** [all-recursive] Error 1 make[2]: *** [all-recursive] Error 1 make[1]: *** [all-recursive] Error 1 make: *** [all] Error 2 I can find the libthrift.la in the source tree: /Users/garylucas/bin/thrift/lib/cpp Any suggestions? If nothign else I can certainly run on a virtual windows machine but I'd prefer to have it running locally. Thank you, Gary Lucas
