We are now (2019) using Erlang version R21.1. There are several machines which have the latest Erlang runtime (OTP/21.1) installed:

  • ad116920 (AcSys-in-a-Box)
  • lbmtev (Acqiris digitizer system at MI12 running linux)
  • All the CLX nodes, centra, centry
  • The Nova experiment's CLX nodes.

If you're working on one of the above computers and are just developing some new feature or driver, you can ignore most of the full deployment instructions here, and just clone from git the one project you are interested in. Erlang_running gives more instructions on that sort of development.

Installing Erlang for Development

Download the latest OTP source and "untar" it.

$ wget
$ tar xzf otp_src_21.2.tar.gz
$ cd otp_src_21.2

Before you build the source, you need to configure the installation. Erlang has a fairly large footprint since it not only includes a VM and development toolset, but it has a large set of libraries. You need to decide how the environment is going to be used; if you're the only user, you might install everything in a directory in your home directory. If you're configuring for users on the local machine, you might install it in /usr/local, for instance. The typical configuration line looks like this (substitute the actual install directory for INSTALL_DIR):

$ ./configure --prefix=INSTALL_DIR --enable-hipe --without-javac

Then build and install it (depending on where the install directory is, you may have to install it as root.)

$ make
$ make install

Next, you'll have to set up environment variables. If this is a single-user installation, just modify your ~/.profile (or equivalent, if you use a different shell than sh.) For a multi-user installation, edit /etc/profile. You need to update PATH so the shell can find the Erlang executables. ERLANG_LIBDIR points to where the standard repository resides. ERL_LIBS points to where you want to place the repository that holds Fermi's applications. As an example:

export ERL_LIBS=/usr/local/erlang-repo

(replace INSTALL_DIR with the directory you specified in the configure command.)

Installing locally developed applications

Content after this point contains some out-of-date information. We are working on fixing it. Feel free to ask the front-end group for help if some of these instructions fail to work. Sorry for the inconvenience. Configuring Raspbian describes how I configured a RaspberryPi in order to make it an ACSys front-end. Some of that information may be of interest.

Some of the Erlang support modules use the protocol compiler to encode/decode messages. You should build and install it before continuing.

$ git clone ssh://
$ cd protocol-compiler
$ make

To populate the locally developed Erlang applications, first check them all out:

$ git clone ssh://
$ git clone ssh://
$ git clone ssh://
$ git clone ssh://
$ git clone ssh://
$ git clone ssh://

Drivers for the front-end framework are hosted on Redmine, too. You can see all the repositories here [].

For each project, build and install in the order given above:

$ ( cd PROJECT; make DEBUG=1 install )

The ''install'' target in our Erlang environment builds an Erlang run-time application tree in the $ERL_LIBS directory. On nearly all of our machines, we have setup a frontend user account and $ERL_LIBS lies under the frontend user's home area.

Packaging the Object Code

So far, what you have done is built all the executable code that you need. It's usable for development like this, but for deployment, you need to package it better. Check out and build the erl-frontends project:

$ git clone ssh://
$ cd erl-frontends; make

If you already had erl-frontends checked out, run make clean before running make to build a new package.

This results in the file acsys_fe.tar.gz. This file has everything you need for a run-time environment, including the Erlang binaries. If you just want to run your target system, you don't need to separately install Erlang as at the top of this page. Deploy acsys_fe.tar.gz according to the below instructions.

Directories and CLX auto-deployment

On the clx machines and others under our group's control, the run time code will run out of /usr/local/frontend/sync. On the clx machines, that directory will be auto-synched (updated) from the contents of ~frontend/clx_sync_master.

If you want to test a particular new object file (or whatever) on one local machine, you put it into the tree starting at /usr/local/frontend/sync. If the file in /usr/local/frontend/sync is newer than that in ~frontend/clx_sync_master, it will not be automatically overwritten.

If you have new file or files that you want copied to all the Erlang clx frontends, then you put them in ~frontend/clx_sync_master and they will periodically be copied to /usr/local/frontend/sync on all the clx Erlang machines.

Installing on a non-clx node.

  1. Use scp to copy acsys_fe.tar.gz to your target machine (you probably have to go through outland/outback).
  2. ssh to the target machine
  3. On that machine, ksu frontend to become the frontend user.
  4. cd to the runtime installation directory, typically /usr/local/frontend/sync.
  1. Extract from the .gz file with the command tar xzvf acsys_fe.tar.gz.
  2. Copy or create the file /usr/local/frontend/sync/config/$SYS.config (where $SYS is the machine's hostname -s ) from other examples. That's the file that describes which devices to create at startup.
  3. Make the log file directory for the host if it doesn't exist: mkdir /usr/local/frontend/sync/log/$SYS
  4. Copy (if needed) the starterl script.
  5. If you're installing on a different machine than where you built, you have to beware of executables or libraries compiled from C. Even though they are both 32-bit linux, programs compiled on ooda00 will not run on ad116920, so you have to build them on the end-machine and copy them into the required location (e.g. priv dir) over the un-tar-ed files.

Summary for release of something new to Nova Far Detector Acnet:

#On a local clx machine
$ cd erl-sync # or whichever project you are wanting to update.
$ git pull
$ make install
$ cd ../erl-frontends
$ make clean
$ make
$ scp acsys_fe.tar.gz novadcs-far-master-01:/home/[yourname] # beware file permissions if copying to ~frontend

$ ssh novadcs-far-master-01 # Go to the Nova machine
$ ksu frontend
$ cd
$ cd /usr/local/frontend/sync/ # single machine Deployment directory
$ cd ~/clx_sync_master # global deployment directory

$ gunzip -c ~[yourname]/acsys_fe.tar.gz | tar xvf -

(if you want to restart immediately, you have to put it in the /usr/local area, otherwise, wait for it to get auto-distributed).

$ cd /usr/local/frontend/sync/ # single machine Deployment/run directory
$ to_erl
  (either use ''q()'' or ctrl-c to kill currently running erlang process).
$ rm log/novadcs-far-master-01/* # Optional!! clean up old logs if you really want a clean start: 
$ ./starterl.clx
$ more log/novadcs-far-master-01/* # make sure it works.