2.1 Generate and run an IOC application
Create a compiled Input/Output Controller (IOC) application with the ALS-U template generator. The application links installed support; you do not build EPICS Base or its modules.
-
Activate your matching 1.5.0 environment from Chapter 1. In a development directory, download the generator once:
git clone --depth 1 https://github.com/jeonghanlee/EPICS-IOC-template-tools.git toolsUse an existing
toolscheckout if you already have it. Keep the generated applications outside the binary distribution. -
From the directory containing
tools/, generate the application:bash tools/generate_ioc_structure.bash -l home -p mouseEnter
ywhen asked to continue with the unlistedhomelocation.-pnames the application;-lnames the location. The result ismouse/with the boot instanceiocBoot/iochome-mouse/. Keep the exact namemouserather than substituting your own name so the directory paths and commands in Chapter 2 match as shown.Use ASCII letters, digits, and underscores in application, location, and folder names. The generator rejects
+and-. Avoidiocin names: the script reservesioc,Ioc, andIOC. Keep application name capitalization identical when adding instances. -
Build the generated application:
cd mouse makeA successful build creates
bin/linux-x86_64/mouse, its database definition (DBD), and generatedenvPathsin the boot directory. -
Keep the generated diagnostic files inside this application:
mkdir -p epics-pvinfo/env epics-pvinfo/names export TARGET_TOP="$PWD"The startup writes below
$(TARGET_TOP=/opt)/epics-pvinfo. SetTARGET_TOPagain if you start from another terminal. -
Run the boot instance:
cd iocBoot/iochome-mouse ./st.cmdWait for
iocRun: All initialization complete. At the IOC prompt, inspect the database and available commands:dbl help exitThis initial application loads no records, so
dblhas no PV names to print. Successful initialization does not imply device communication.
Generated directory reference
| Path | Purpose |
|---|---|
configure/RELEASE | Selects installed Base and module paths |
configure/CONFIG_SITE | Controls application build settings |
mouseApp/src/Makefile | Selects DBD files, source files, and linked libraries |
mouseApp/Db/ | Holds database and protocol source files |
mouseApp/iocsh/ | Holds reusable startup fragments |
iocBoot/iochome-mouse/st.cmd | Configures and starts this IOC instance |
iocBoot/iochome-mouse/envPaths | Generated paths for the startup |
The source Makefile includes support conditionally. Enabling a module
in RELEASE activates the corresponding DBD and library entries. Keep
the generator’s module dependency comments when selecting support.
Chapter 3 enables asyn, calc, and StreamDevice.
Exercise: Compare build targets
From the application root, compare the installed executable after each cleanup target:
make clean
ls bin/linux-x86_64
make
make distclean
ls bin/linux-x86_64
make
clean keeps installed products, so the first ls lists mouse.
distclean removes them together with bin/, so the second ls reports
No such file or directory. The final make rebuilds
the application. Lesson 5.3 repeats
this exercise with a separate installation path.