sumo demo

Here we demonstrate how sumo-scan is used to migrate existing EPICS supports and an EPICS application.

This is a complete example. You need a Linux/Unix system and an internet connection, git, all build tools for compiling EPICS base and Python.

Build an EPICS example

Prepare the directory

We create an example with EPICS base, two EPICS supports and an EPICS application. Enter these commands:

cd $HOME
mkdir sumo-demo
cd sumo-demo

Now you need to download these two scripts and put them in the directory you just created:

You have to make the downloaded scripts executable with this command:

chmod u+x *.sh

Set up the support and application directories

First get and compile EPICS base, create and compile two EPICS supports and an EPICS application with this command:

./build-demo.sh

You can start the soft-IOC of the application you just built with this command:

(cd apps/appA/iocBoot/iocA && ./st.cmd)

The IOC has two records, “low” and “high” that show some random numbers.

You can see values of these records with these commands:

dbpr("low")
dbpr("high")

After each dbpr the VAL field changes.

You can exit the soft-IOC with the key <control-d>.

Set up sumo

Run:

./install-sumo.sh

This creates a virtual python environment, downloads and installs sumo and creates a sumo configuration file.

Make sumo accessible in your shell with these commands:

source ./venv/bin/activate
eval $(sumo help completion-line)

Further reading:

Migrate the example for usage with sumo

Scan the support directory and create a dependency database

Use sumo-scan to scan the supports:

sumo-scan -d support > sumo/scan/SCAN

Create the dependency database:

sumo db convert sumo/scan/SCAN

Further reading:

Create a copy of the sources of the original application

Since we dont’t want to change the directory of the original application, we create a copy and run “make distclean” to remove all files created by the previous compilation:

cp -a apps/appA apps/appA-sumo
make -C apps/appA-sumo distclean -sj

Scan the application to create a MODULES file

Enter this command:

sumo-scan -d apps/appA -g support | sumo db appconvert - -C > apps/appA-sumo/configure/MODULES

Further reading:

Rebuild the application, now with sumo

Change the current working directory for the new application:

cd apps/appA-sumo

Create a sumo build needed by the application:

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

Now use the build in the application:

sumo build use

And build the application:

make -sj

Start the application with:

(cd iocBoot/iocA && ./st.cmd)

As before, the IOC has two records, “low” and “high” that show some random numbers.

You can see values of these records with these commands:

dbpr("low")
dbpr("high")

After each dbpr the VAL field changes.

You can exit the soft-IOC with the key <control-d>.

Further reading:

What to do now

In this demo you have installed sumo, created a dependency database and a sumo build.

Here are more commands you can play with: