How to build and install IDCP
Prerequisites
IDCP supports two platforms for the IOC:
RTEMS 4.9 on a mvme2100 VME Bus CPU with a VME-CAN4 or VME-CAN2 CAN bus interface card.
Linux on a PC with a CAN bus interface card. The card must support the SocketCAN interface.
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:
To build the RTEMS kernel you need
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 -C --system-site-packages
‘ARCH’ must be “Linux” when you compile for a Linux IOC or “RTEMS” when you compile for an RTEMS VME Bus IOC.
Note
idcp-configure installs all dependencies in a Python virtual environment in directory ‘VENV’. You can change this with option ‘–venv’. If you have activated a Python virtual environment already, programs will be installed there. Enter ./idcp-configure -h to get help on command line options.
Attention
The following command MUST be run to initialize your environment.
Run:
source ./setenv.sh
Build IDCP
The script build.sh ensures that all device supports are built before the application. It also uses all CPU cores but runs all processes at a lower priority, so your build should be fast but without slowing your system down.
Build:
./build.sh
Troubleshooting
build.sh uses make option -j$CORE with CORE=$(nproc), so make uses as much parallel build processes as you have CPU cores. This is much faster than building with a single process.
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.