Using sumo in your application

Use supports in an application

Suppose we have an application and want to use existing supports. The application has a list of modules in file “configure/MODULES”, you can see this file at MODULES.

In order to use the support modules in our application we simply enter:

sumo build use

This command is described in detail at sumo build use. The program replies:

using build BL-001

This means that the file configure/RELEASE was generated with all entries needed to use support modules from build ‘BL-001’ (each build has a name). You can see the contents of this file at RELEASE for BL-001.

You can now build your application with:

make

Use a different version of a support

In order to use, for example, module “ALARM” in version “R3-8”, we change in file “configure/MODULES” the line:

"ALARM:R3-7",

to:

"ALARM:R3-8",

We now try to generate the RELEASE file:

sumo build use

but the program replies:

no build found that matches modulespecs

This means that we first have to install the sources of the new version of “ALARM” and compile it and all dependent modules. This is done with:

sumo build new

This command is described in detail at sumo build new. sumo generates a Makefile in it’s build directory, fetches all needed sources and invokes “make”. You can see this file at Makefile for BL-002. Information on all builds is kept in a build database, you can see this at BUILDS.DB.

After the command is completed we enter again:

sumo build use

the program replies:

using build BL-002

This means that the file configure/RELEASE was generated with all entries needed to use support modules from build ‘BL-002’ (a new build was created with a new name). You can see the contents of this file at RELEASE for BL-002. You can now build your application with:

make

Details

In this section you see the contents of some of the files used or generated by sumo.

MODULES

This is the file configure/MODULES that specifies for sumo which modules our application uses. For more details on module specifications see Module Specifications

{
    "alias": [
        "APPS_CRATECTRL:CRATECTRL",
        "APPS_GENERICBOOT:GENERIC_BOOT",
        "APPS_GENERICTEMPLATE:GENERICTEMPLATE",
        "APPS_IOCWATCH:IOCWATCHAPP",
        "APPS_MOTOR:MOTORAPP",
        "BASE:EPICS_BASE",
        "BESSYRULES:BESSY_RULES",
        "BSPDEP_CPUBOARDINIT:CPU_BOARD_INIT",
        "BSPDEP_TIMER:TIMER",
        "BSPDEP_VMETAS:VMETAS",
        "CAPUTLOG:CA_PUT_LOG",
        "DEVIOCSTATS:IOCSTATS",
        "DISTVERSION:DIST_VERSION",
        "SEQ:SNCSEQ",
        "SOFT_DEVHWCLIENT:DEV_HWCLIENT",
        "VXBOOTPARAMS:VX_BOOT_PARAMS",
        "STREAMDEVICE:STREAM"
    ],
    "module": [
        "ALARM:R3-7",
        "APPS_CRATECTRL:R4-1",
        "APPS_GENERICBOOT:R0-8-2",
        "APPS_GENERICTEMPLATE:R3-2-1",
        "APPS_IOCWATCH:R3-1",
        "APPS_MOTOR:R4-4",
        "ASYN:4-18-bessy1",
        "AUTOSAVE:R4-8-bessy4",
        "BASE:R3-14-12-2-7",
        "BESSYRULES:R2-17",
        "BSPDEP_CPUBOARDINIT:R4-1",
        "BSPDEP_TIMER:R6-2",
        "BSPDEP_VMETAS:R2-0",
        "CAPUTLOG:R3-3-2",
        "DEVIOCSTATS:R3-1-9-bessy3",
        "DISTVERSION:R2-2",
        "ESD:R2-1",
        "MCAN:R2-6-3-2",
        "MISC_DBC:R3-0",
        "MISC_DEBUGMSG:R3-0",
        "MOTOR:R6-8-bessy2-1",
        "SEQ:R2-1-16",
        "SOFT_DEVHWCLIENT:R3-0",
        "STREAMDEVICE:R2-4-0-4",
        "TOOLS_DBOPT:R0-4",
        "TOOLS_MSI:R1-5-bessy3",
        "VHQ:R3-3",
        "VXBOOTPARAMS:R2-4"
    ]
}

RELEASE for BL-001

This is the content of the generated RELEASE file for build “BL-001” in our example:

# generated by sumo using build BL-001:
VX_BOOT_PARAMS=/srv/csr/Epics/sumo/build/VXBOOTPARAMS/R2-4+BL-001
VHQ=/srv/csr/Epics/sumo/build/VHQ/R3-3+BL-001
MOTORAPP=/srv/csr/Epics/sumo/build/APPS_MOTOR/R4-4+BL-001
IOCWATCHAPP=/srv/csr/Epics/sumo/build/APPS_IOCWATCH/R3-1+BL-001
GENERICTEMPLATE=/srv/csr/Epics/sumo/build/APPS_GENERICTEMPLATE/R3-2-1+BL-001
BESSY_RULES=/srv/csr/Epics/sumo/build/BESSYRULES/R2-17+BL-001
TOOLS_MSI=/srv/csr/Epics/sumo/build/TOOLS_MSI/R1-5-bessy3+BL-001
TOOLS_DBOPT=/srv/csr/Epics/sumo/build/TOOLS_DBOPT/R0-4+BL-001
STREAM=/srv/csr/Epics/sumo/build/STREAMDEVICE/R2-4-0-4+BL-001
MCAN=/srv/csr/Epics/sumo/build/MCAN/R2-6-3-2+BL-001
DEV_HWCLIENT=/srv/csr/Epics/sumo/build/SOFT_DEVHWCLIENT/R3-0+BL-001
SNCSEQ=/srv/csr/Epics/sumo/build/SEQ/R2-1-16+BL-001
MOTOR=/srv/csr/Epics/sumo/build/MOTOR/R6-8-bessy2-1+BL-001
MISC_DEBUGMSG=/srv/csr/Epics/sumo/build/MISC_DEBUGMSG/R3-0+BL-001
ALARM=/srv/csr/Epics/sumo/build/ALARM/R3-7+BL-001
MISC_DBC=/srv/csr/Epics/sumo/build/MISC_DBC/R3-0+BL-001
ESD=/srv/csr/Epics/sumo/build/ESD/R2-1+BL-001
DIST_VERSION=/srv/csr/Epics/sumo/build/DISTVERSION/R2-2+BL-001
IOCSTATS=/srv/csr/Epics/sumo/build/DEVIOCSTATS/R3-1-9-bessy3+BL-001
CA_PUT_LOG=/srv/csr/Epics/sumo/build/CAPUTLOG/R3-3-2+BL-001
VMETAS=/srv/csr/Epics/sumo/build/BSPDEP_VMETAS/R2-0+BL-001
TIMER=/srv/csr/Epics/sumo/build/BSPDEP_TIMER/R6-2+BL-001
CPU_BOARD_INIT=/srv/csr/Epics/sumo/build/BSPDEP_CPUBOARDINIT/R4-1+BL-001
AUTOSAVE=/srv/csr/Epics/sumo/build/AUTOSAVE/R4-8-bessy4+BL-001
ASYN=/srv/csr/Epics/sumo/build/ASYN/4-18-bessy1+BL-001
GENERIC_BOOT=/srv/csr/Epics/sumo/build/APPS_GENERICBOOT/R0-8-2+BL-001
EPICS_BASE=/srv/csr/Epics/sumo/build/BASE/R3-14-12-2-1-aragon6+BL-001
CRATECTRL=/srv/csr/Epics/sumo/build/APPS_CRATECTRL/R4-1+BL-001

RELEASE for BL-002

This is the content of the generated RELEASE file for build “BL-001” in our example:

# generated by sumo using build BL-002:
VX_BOOT_PARAMS=/srv/csr/Epics/sumo/build/VXBOOTPARAMS/R2-4+BL-001
VHQ=/srv/csr/Epics/sumo/build/VHQ/R3-3+BL-001
MOTORAPP=/srv/csr/Epics/sumo/build/APPS_MOTOR/R4-4+BL-001
IOCWATCHAPP=/srv/csr/Epics/sumo/build/APPS_IOCWATCH/R3-1+BL-001
GENERICTEMPLATE=/srv/csr/Epics/sumo/build/APPS_GENERICTEMPLATE/R3-2-1+BL-001
BESSY_RULES=/srv/csr/Epics/sumo/build/BESSYRULES/R2-17+BL-001
TOOLS_MSI=/srv/csr/Epics/sumo/build/TOOLS_MSI/R1-5-bessy3+BL-001
TOOLS_DBOPT=/srv/csr/Epics/sumo/build/TOOLS_DBOPT/R0-4+BL-001
STREAM=/srv/csr/Epics/sumo/build/STREAMDEVICE/R2-4-0-4+BL-001
MCAN=/srv/csr/Epics/sumo/build/MCAN/R2-6-3-2+BL-002
DEV_HWCLIENT=/srv/csr/Epics/sumo/build/SOFT_DEVHWCLIENT/R3-0+BL-001
SNCSEQ=/srv/csr/Epics/sumo/build/SEQ/R2-1-16+BL-001
MOTOR=/srv/csr/Epics/sumo/build/MOTOR/R6-8-bessy2-1+BL-001
MISC_DEBUGMSG=/srv/csr/Epics/sumo/build/MISC_DEBUGMSG/R3-0+BL-001
ALARM=/srv/csr/Epics/sumo/build/ALARM/R3-8+BL-002
MISC_DBC=/srv/csr/Epics/sumo/build/MISC_DBC/R3-0+BL-001
ESD=/srv/csr/Epics/sumo/build/ESD/R2-1+BL-001
DIST_VERSION=/srv/csr/Epics/sumo/build/DISTVERSION/R2-2+BL-001
IOCSTATS=/srv/csr/Epics/sumo/build/DEVIOCSTATS/R3-1-9-bessy3+BL-001
CA_PUT_LOG=/srv/csr/Epics/sumo/build/CAPUTLOG/R3-3-2+BL-001
VMETAS=/srv/csr/Epics/sumo/build/BSPDEP_VMETAS/R2-0+BL-001
TIMER=/srv/csr/Epics/sumo/build/BSPDEP_TIMER/R6-2+BL-001
CPU_BOARD_INIT=/srv/csr/Epics/sumo/build/BSPDEP_CPUBOARDINIT/R4-1+BL-001
AUTOSAVE=/srv/csr/Epics/sumo/build/AUTOSAVE/R4-8-bessy4+BL-001
ASYN=/srv/csr/Epics/sumo/build/ASYN/4-18-bessy1+BL-001
GENERIC_BOOT=/srv/csr/Epics/sumo/build/APPS_GENERICBOOT/R0-8-2+BL-001
EPICS_BASE=/srv/csr/Epics/sumo/build/BASE/R3-14-12-2-1-aragon6+BL-001
CRATECTRL=/srv/csr/Epics/sumo/build/APPS_CRATECTRL/R4-1+BL-001

Makefile for BL-002

This is the generated makefile for build BL-002:

all: ALARM/R3-7+BL-002/stamp MCAN/R2-6-3-2+BL-002/stamp

clean:
        -$(MAKE) -C ALARM/R3-7+BL-002 clean
        -$(MAKE) -C MCAN/R2-6-3-2+BL-002 clean
        rm -f ALARM/R3-7+BL-002/stamp
        rm -f MCAN/R2-6-3-2+BL-002/stamp

distclean:
        -$(MAKE) -C ALARM/R3-7+BL-002 distclean
        -$(MAKE) -C MCAN/R2-6-3-2+BL-002 distclean
        rm -f ALARM/R3-7+BL-002/stamp
        rm -f MCAN/R2-6-3-2+BL-002/stamp


MCAN/R2-6-3-2+BL-002/stamp: ALARM/R3-7+BL-002/stamp

%/stamp:
        $(MAKE) -C $(@D)
        touch $@

BUILDS.DB

This is the content of the build database after we created BL-001 and BL-002. For more information see The build database:

{
    "BL-001": {
        "modules": {
            "ALARM": "R3-8",
            "APPS_CRATECTRL": "R4-1",
            "APPS_GENERICBOOT": "R0-8-2",
            "APPS_GENERICTEMPLATE": "R3-2-1",
            "APPS_IOCWATCH": "R3-1",
            "APPS_MOTOR": "R4-4",
            "ASYN": "4-18-bessy1",
            "AUTOSAVE": "R4-8-bessy4",
            "BASE": "R3-14-12-2-1-aragon6",
            "BESSYRULES": "R2-17",
            "BSPDEP_CPUBOARDINIT": "R4-1",
            "BSPDEP_TIMER": "R6-2",
            "BSPDEP_VMETAS": "R2-0",
            "CAPUTLOG": "R3-3-2",
            "DEVIOCSTATS": "R3-1-9-bessy3",
            "DISTVERSION": "R2-2",
            "ESD": "R2-1",
            "MCAN": "R2-6-3-2",
            "MISC_DBC": "R3-0",
            "MISC_DEBUGMSG": "R3-0",
            "MOTOR": "R6-8-bessy2-1",
            "SEQ": "R2-1-16",
            "SOFT_DEVHWCLIENT": "R3-0",
            "STREAMDEVICE": "R2-4-0-4",
            "TOOLS_DBOPT": "R0-4",
            "TOOLS_MSI": "R1-5-bessy3",
            "VHQ": "R3-3",
            "VXBOOTPARAMS": "R2-4"
        },
        "state": "testing"
    },
    "BL-002": {
        "linked": {
            "APPS_CRATECTRL": "BL-001",
            "APPS_GENERICBOOT": "BL-001",
            "APPS_GENERICTEMPLATE": "BL-001",
            "APPS_IOCWATCH": "BL-001",
            "APPS_MOTOR": "BL-001",
            "ASYN": "BL-001",
            "AUTOSAVE": "BL-001",
            "BASE": "BL-001",
            "BESSYRULES": "BL-001",
            "BSPDEP_CPUBOARDINIT": "BL-001",
            "BSPDEP_TIMER": "BL-001",
            "BSPDEP_VMETAS": "BL-001",
            "CAPUTLOG": "BL-001",
            "DEVIOCSTATS": "BL-001",
            "DISTVERSION": "BL-001",
            "ESD": "BL-001",
            "MISC_DBC": "BL-001",
            "MISC_DEBUGMSG": "BL-001",
            "MOTOR": "BL-001",
            "SEQ": "BL-001",
            "SOFT_DEVHWCLIENT": "BL-001",
            "STREAMDEVICE": "BL-001",
            "TOOLS_DBOPT": "BL-001",
            "TOOLS_MSI": "BL-001",
            "VHQ": "BL-001",
            "VXBOOTPARAMS": "BL-001"
        },
        "modules": {
            "ALARM": "R3-7",
            "APPS_CRATECTRL": "R4-1",
            "APPS_GENERICBOOT": "R0-8-2",
            "APPS_GENERICTEMPLATE": "R3-2-1",
            "APPS_IOCWATCH": "R3-1",
            "APPS_MOTOR": "R4-4",
            "ASYN": "4-18-bessy1",
            "AUTOSAVE": "R4-8-bessy4",
            "BASE": "R3-14-12-2-1-aragon6",
            "BESSYRULES": "R2-17",
            "BSPDEP_CPUBOARDINIT": "R4-1",
            "BSPDEP_TIMER": "R6-2",
            "BSPDEP_VMETAS": "R2-0",
            "CAPUTLOG": "R3-3-2",
            "DEVIOCSTATS": "R3-1-9-bessy3",
            "DISTVERSION": "R2-2",
            "ESD": "R2-1",
            "MCAN": "R2-6-3-2",
            "MISC_DBC": "R3-0",
            "MISC_DEBUGMSG": "R3-0",
            "MOTOR": "R6-8-bessy2-1",
            "SEQ": "R2-1-16",
            "SOFT_DEVHWCLIENT": "R3-0",
            "STREAMDEVICE": "R2-4-0-4",
            "TOOLS_DBOPT": "R0-4",
            "TOOLS_MSI": "R1-5-bessy3",
            "VHQ": "R3-3",
            "VXBOOTPARAMS": "R2-4"
        },
        "state": "testing"
    }
}