On a host which is going to be only an Erlang/OTP (Open Telecom Platform) C-node client, it may not be desirable nor even possible to build a complete release of OTP. It is not necessary to do so, either, if all you want is, say, libei.a and ei.h.
Here is a recipe for building only the C/C++ interface libraries from the OTP distribution. An optional patch is included to allow the use of transaction IDs with ei_rpc calls and improve select() on R9C-0. There are really only two major steps:
The following will install ei and erl_interface headers and libraries to prefix/lib/erlang/lib/erl_interface-3.4/include and to prefix/lib/erlang/lib/erl_interface-3.4/lib.
NOTE: The newer client library, with or without the patch provided, is compatible with older releases of OTP. So, by installing to unique destination, you can use the steps below to generate experimental C interface code without affecting other installed versions of OTP.
gtar -xzf .../otp_src_R9C-0.tar.gz cd otp_src_R9C-0 ERL_TOP=`pwd`
sh configure --prefix=/usr/pkg (or whatever) TARGET=`erts/autoconf/config.guess`Doing "echo $TARGET" should now get you your system configuration, e.g. "i386-pc-solaris2.8".
export ERL_TOP TARGET cd lib/erl_interface
patch src/connect/ei_connect.c < .../ei_connect.c.patch
gmake release RELEASE_PATH=/usr/pkg/lib/erlang
Now you are ready to talk to remote OTP nodes from C and C++. Remember to add the right CPP and ld options, e.g.
LDFLAGS="-L/usr/pkg/lib/erlang/erl_interface-3.4/lib \ -R/usr/pkg/lib/erlang/erl_interface-3.4/lib -lei"