Menu

Erlang AMQP Client Library Build Instructions

This section describes the process for obtaining a copy of the RabbitMQ Erlang AMQP client source code and its dependecies, as well as instructions for building the Erlang client from source.

Obtaining the source


  • Either download a released source code distribution from the download page, or
  • Check the code out directly from our GitHub repositories:
    git clone https://github.com/rabbitmq/rabbitmq-erlang-client.git
    cd rabbitmq-erlang-client
    make
    

If you choose to check the code out using Git, the necessary dependencies will be fetched automatically. If you're working with a released source code distribution, though, all necessary dependencies are included.

Required Libraries and Tools

In order to build RabbitMQ, you will need a few tools.

RabbitMQ requires a recent version of Python 2 and simplejson.py (an implementation of a JSON reader and writer in Python), for generating AMQP 0-9-1 framing code. simplejson.py is included as a standard json library in the Python core since 2.6 release.

Additionally, you will need

  • the Erlang development and runtime tools
    If you are on a Debian-based system then you need the erlang-nox, erlang-dev and erlang-src packages installed. If you are building and installing Erlang from source then you must ensure that openssl is installed on your system.
  • a recent version of GNU make
  • a recent version of xsltproc, which is part of libxslt
  • a recent version of xmlto
  • zip and unzip

Building the Erlang client libraries

If you ran the commands above, there is nothing else to do. The Erlang.mk build system compiled everything when you ran make.

Other interesting Makefile targets include

all
The default target. Builds the client libraries.
shell
Builds the client libraries and starts an Erlang shell with the libraries loaded.
run-broker
Builds the client and starts RabbitMQ server with shell and the client included in load path.
clean
Removes temporary build products.
distclean
Removes all build products.
tests
Runs a set of tests against a server running on locally.
all_tests
Clean compiles the client and client tests source code and runs network_client_SUITE, direct_client_SUITE and packaging tests. During testing, this make target runs an instance of the broker, so make sure there is no other instance of RabbitMQ server running.
dialyze
Analyses the client source code with dialyzer. Uses PLT file from default location: ~/.dialyzer_plt. Use
make PLT=/path/to/plt dialyze
to override this. Add broker to PLT beforehand, otherwise you will a lot of 'unknown function' warnings. See add_broker_to_plt make target.
source-dist
Creates tarball of all the client source code.
package
Creates an erlang archive of the client.