How to build and install IDCP

Prerequisites

IDCP supports two platforms for the IOC:

RTEMS

For RTEMS you need a RTEMS cross compiler, the RTEMS kernel and some extensions.

In order to build the RTEMS cross compiler on your Linux system see:

rtems-from-scratch

To build the RTEMS kernel you need

rtems-build-tool

See also VME Bus CPU with RTEMS.

Linux

For Linux you need a common Linux system. IDCP was tested on Debian 12 (“bookworm”).

You need common development tools like gcc, g++, make, python, perl.

See also How to set up a Linux IOC.

Prepare your $HOME/.hgrc file

If you already have this file, ensure that it contains the following line which enables the “mq” extension in mercurial:

hgext.mq=

If you don’t have this file, you must create it, below is an example. Create it with your favorite text editor and don’t forget to replace NAME and EMAIL with your real name and email addess:

# This is is a Mercurial configuration file.
[ui]
username = NAME <EMAIL>
[trusted]
groups= epima
[diff]
git=0
[mq]
git=yes
[extensions]
fetch =
hgk=
extdiff=
transplant=
hgext.graphlog=
hgext.rebase=
hgext.mq=
hgext.convert=
hgext.record=

Create a directory where to build the application

Here is an example example:

mkdir myidcp && cd myidcp

You now have two ways to get the IDCP sources.

Method 1: Repository checkout

You get the current version from the main repository URL like this:

From the internal network of the Helmholtz-Zentrum Berlin at the BESSY II site with this command:

hg clone http://repo.acc.bessy.de/hg/idcp/idcp idcp

From anywhere else with this command:

hg clone http://hg.code.sf.net/p/idcp/code idcp

Some of the installed versions of IDCP at the Helmholtz-Zentrum Berlin may contain additional mq patches, which you do not get with the command above.

Method 2: Recreate repository with MQ Patches from installed version

Note

This only works if you are connected to the internal network of the Helmholtz-Zentrum Berlin at the BESSY II site.

Get IDCP sources with the idcp-get-source script which is part of the bii_scripts script collection.

In order to get a recent version of IDCP you should first see which versions of IDCP are installed. Run this command:

idcp-get-source versions

It shows the versions of IDCP that are currently in use. The output could look like this:

version                  names
2021-11-15T10:44:50      UE46 UE48 U17 UE56/2 U41 UE49 UE52
2021-12-13T10:43:03      UE112
2021-12-14T10:48:21      UE56/1 U139 U49/2 U125/2 U49/1

The ISO date starting in the first column is the name of the version. You check out the repository for version “2021-12-14T10:48:21” including all mq patches with this command:

idcp-get-source version 2021-12-14T10:48:21

In this example, the repository is created in directory:

2021-12-14T104821

The directory name is a bit different than the name of the version since the darcs version control system has a problem with colons “:” in directory names.

Configure IDCP

Go to the project directory and run idcp_configure:

./idcp-configure --arch ARCH

‘ARCH’ must be “Linux” when you compile for a Linux IOC or “RTEMS” when you compile for an RTEMS VME Bus IOC.

Sumo

Ensure that sumo is installed.

Enter:

sumo build use

If this fails, enter:

sumo build new --makeflags "-sj" --progress
sumo build use

If this also fails, you have to configure and use sumo with a local sandbox. Run the following commands:

rm sumo.config
sumo config local SUMO
sumo build new --makeflags "-sj" --progress
sumo build use

Now all support modules should have been built, and idcp is ready to be compiled.

Build IDCP

Build the project with this command:

make -sj

Troubleshooting

Option “-j” means that the build is done with as many tasks the host system can provide which is much faster that using only a single task.

If this fully parallel build fails, please mail me, <Goetz.Pfeiffer@helmholtz-berlin.de>, the output of the error message.

You may try to build with a single task in this case, this may work but takes much more time:

make clean -sj && make -s

Distribute a version

Note

This currently only works for the sites configured in configure/config.yaml. See also Sites.

You distribute a version with the idcp-dist script, which is part of idcp. You get online help for this script with the command ./idcp-dist -h. This also shows all values for the SITE argument.

Distribute your IDCP program with this command:

./idcp-dist SITE dist

Activate a version

Note

This currently only works for the sites configured in configure/config.yaml. See also Sites.

Activation is also done with idcp-dist with this command:

./idcp-dist SITE activate INSERTIONDEVICE

where INSERTIONDEVICE is any common name for a HZB insertion device. The iddb command shows what names are known:

iddb -a idcp

From the table that is shown, the columns “name”, “devicename” and “prefix” can be used to specify an insertion device for idcp-dist.