Type Slowly
Thrift installation woes part II: Using Thrift with a kerl’d erlang.
More notes on thrift setup, mostly for my own reference, but hopefully they’ll be useful to anyone else in the same situation.
So, following my last post, you’ve got thrift set up on your local machine. However, you’re using the highly useful kerl tool to work with different erlang versions, and you want to use both this and thrift with your project. This means you need to recompile and install the thrift erlang libraries to work with your kerl installation.
Thankfully this isn’t too painful, and doesn’t involve recompiling all of thrift again, you just need to pass a few extra options to the configure script, and ensure that you only make and install the erlang bindings, rather than the whole thing:
First, you need to run the configure script, setting environment variables that refer to the location of erl, erlc, and your erlang installation’s lib directory, and also explicitly disabling all the libraries apart from erlang:
ERL=$PATH_TO_YOUR_KERLD_ERLANG/bin/erl \\ ERLC=$PATH_TO_YOUR_KERLD_ERLANG/bin/erlc \\ ERLANG_INSTALL_LIB_DIR=$PATH_TO_YOUR_KERLD_ERLANG/lib/ \\ bundle exec ./configure --without-cpp --without-c_glib --without-csharp \\ --without-java --without-python --without-perl --without-php \\ --without-php_extension --without-ruby --without-haskell --without-go
Then, cd into the lib/erlang directory in the thrift source tree, before running make and make install as normal (don’t use sudo for this if you’re installing into a directory inside your home):
cd lib/erlang make make install