Building Thrift on Mac OS X 10.4 Tiger
When I tried to install Thrift on Mac OS X 10.4 Tiger, I got several errors: one when it couldn't find the Jikes Java compiler, and the two others below:
../compiler/cpp/thrift --gen cpp:dense,reflection_limited
DebugProtoTest.thrift
[WARNING:generation:1] Unable to get a generator for
"cpp:dense,reflection_limited".
source='gen-cpp/DebugProtoTest_types.cpp'
object='DebugProtoTest_types.lo' libtool=yes \
depfile='.deps/DebugProtoTest_types.Plo' tmpdepfile='.deps/
DebugProtoTest_types.TPlo' \
depmode=gcc3 /bin/sh ../depcomp \
/bin/sh ../libtool --mode=compile g++ -DHAVE_CONFIG_H -I. -I. -
I.. -
I../lib/cpp/src -I/opt/local/include/boost-1_34 -g -O2 -c -o
DebugProtoTest_types.lo `test -f 'gen-cpp/
DebugProtoTest_types.cpp'
|| echo './'`gen-cpp/DebugProtoTest_types.cpp
g++ -DHAVE_CONFIG_H -I. -I. -I.. -I../lib/cpp/src -I/opt/local/
include/boost-1_34 -g -O2 -c ./gen-cpp/DebugProtoTest_types.cpp
-MT
DebugProtoTest_types.lo -MD -MP -MF .deps/
DebugProtoTest_types.TPlo -
fno-common -DPIC -o .libs/DebugProtoTest_types.o
i686-apple-darwin8-g++-4.0.1: ./gen-cpp/
DebugProtoTest_types.cpp: No
such file or directory
i686-apple-darwin8-g++-4.0.1: no input files
make[2]: *** [DebugProtoTest_types.lo] Error 1
make[1]: *** [install-recursive] Error 1
make: *** [install-recursive] Error 1
./configure: line 21183: syntax error near unexpected token `MONO,'
./configure: line 21183: ` PKG_CHECK_MODULES(MONO, mono >= 1.2.6, have_mono=yes, have_mono=no)'
Solution
If you don't have "MacPorts":http://www.macports.org/, install it. Then install the following ports:
sudo port install libtool autoconf automake pkgconfig ruby python26 python_select
Make sure that your $PATH starts with /opt/local/bin, and run python_select python26.
Then, to fix the PKG_CHECK_MODULES MONO error, run the following in the thrift directory (from the "Thrift FAQ":http://wiki.apache.org/thrift/FAQ):
cp /opt/local/share/aclocal/pkg.m4 aclocal/
Now you should be able to install Thrift: ./bootstrap.sh && ./configure && make && sudo make install