Project

General

Profile

EPICS Standard Deployment

In what follows, an EPICS IOC, or front end, is built of 3 layers:
  1. base
  2. Support - these are modules like an OS kernel driver: compiled with base, they add specific functionality (hardware and/or service) to an IOC
  3. IOC - built with base and purpose-specific Support modules and its own code, an IOC, I nput/ O utput C ontroller, is a front end with full functionality built into it

This is a first attempt to develop a standard EPICS deployment at Fermilab. All will be based on EPICS v7. Most developers will never need to perform the first 4 steps, as this will be standardized on an NFS common area: /usr/local/epics. These steps build the first two "layers" of an EPICS IOC, namely base and Support, where Support is sometimes referred to as "Modules".

In what follows, the clx machine is running Scientific Linux Fermi release 6.4 (Ramsey) with gcc (GCC) 4.4.7 20120313 (Red Hat 4.4.7-3).

Step 1 - Setting EPICS area and environment variables

To use the "standard" environment variables:
  1. Copy the official files using: @git clone ssh:///cvs/projects/epics-environment epics
    One of the files, epicsENV, cloned from git will contain environment variable definitions. The files EPICS_ADDR_LIST contains a list of all of the IP addresses and ports on which IOCs are running, this will need to be modified in the Step 5 setup
  2. This will create the directory /usr/local/epics. Change directory (cd) to this directory.
  3. In /usr/local/epics, do: source epicsENV to define the standard environment variables

Step 2 - Building base

  1. One should never need to modify base, therefore, one simply downloads base. At present, we are using base-7.0.3.1, but we expect to keep in line with the newest releases until the day we decide to freeze our version of base.
  2. As previously stated, our planned deployment will be in /usr/local/epics. Copy base-7.0.3.1.tar.gz file here and untar the file.
  3. Create the softlink using: ln -s /usr/local/epics/base-7.x.y.z base
  4. Change directory (cd) to /usr/local/epics/base and run: make. This will build all of epics tools, libraries, header files, and binaries.
  5. To remove object files and build areas, once the build is complete, run: make clean

Note that base built easily without problems with our present OS and GCC compiler versions. The general source for base is found at https://github.com/epics-base/epics-base.

(Comment by Rich) Many projects have a "configure; make; make install" sequence where the final command, make install, copies the built libraries/executables into an area that other can use. Does EPICS have this? If so, I'd recommend we only install the built files into /usr/local/epics/base-*.

(Comment by Pierrick) EPICS has it's own build system. It does not use "configure; make; make install".

(Comment by Rich) It does have "make install", however. The build environment is very proprietary, so I'm not sure where it installs everything. I'd hope the destination is configurable.

(Comment by Pierrick) Yes, EPICS is very configurable; here we're establishing a "standard" configuration.

Step 3 - Building Support (Modules)

The Support modules are added to IOC builds, similar to Linux kernel modules which are added so that the OS can perform certain tasks. When attempting to build Support, you will likely find missing dependencies. A file, RequiredPackages.lis, will be in the git repository, along with the rest of the Support files.

To build Support:

  1. If you don't have sudo privilege, ask your system administrator to install the files in attachment:RequiredPackages.lis; note that most of these files are for applications such as phoebus.
  2. Go to correct directory: /usr/local/epics/
  3. Copy official code release: git clone ssh://p-epics-support@cdcvs.fnal.gov/cvs/projects/epics-support Support
  4. To build all of the Support modules and define the softlinks, run: cd Support and ./makeall.bash
  5. To remove object files and build areas, once the build is complete, run: ./makeall.bash clean
  6. If you find any additional missing packages or would like to add modules, please notify me at

Step 4 - Copy configuration files

This directory will host configuration files for a number or EPICS extensions, mostly client-side. Some of these files are not pertinent to Fermilab but may be useful as templates. Many of these may be removed in the future.

  1. Go to correct directory: /usr/local/epics/
  2. Copy official code release: git clone ssh://p-epics-config@cdcvs.fnal.gov/cvs/projects/epics-config Config
The directories created and their configuration files are:
  • ALHConfig -- old style alarm handler
  • AppLauncher -- configuration files for a QT based, desktop menu for launching applications
  • ArchiveConfig -- old style Channel Archiver configuration files
  • ArchiveViewer -- old style Channel Archiver xml viewer files
  • CSS -- new style CSS/Phoebus configuration files
  • Gateway -- EPICS gateway
  • IOCaccess -- access security files which can be loaded into IOCs at startup to enforce rear and write permissions based on:
    • user
    • IP address(es)
    • specific PVs
  • ProcLauncher -- Bash scripts used to launch IOCs
  • Scripts -- sundry scripts
  • StripTool -- old style strip tool
  • audio -- wave files that I always threatened to put in the MICE alarm handler
  • opi -- a single sub-directory, edl, containing EDM files

Step 5 - Build Client Applications

This directory will host client side applications, known as EPICS extensions. I supsect that this directory will be fairly dynamic for the foreseeable
future.

  1. Go to correct directory: /usr/local/epics/
  2. Copy official code release: git clone ssh://p-epics-extensions@cdcvs.fnal.gov/cvs/projects/epics-extensions Extensions
The directories created and their configuration files are in /usr/local/epics/Extentions/src.
The present list of applications are:
  • alh -- old style alarm handler
  • ArchiveViewer -- old style java viewer (works for old Channel archiver and for Archiver Appliance)
  • Archiver Appliance -- new style archiver, this is what we are supporting
  • StripTool -- strip tool
  • ca-gateway -- old style network gateway (not supported since pva2pva is build into base)
  • edm -- old style GUIs (still supported; they can be easily converted to Phoebus)
  • msi -- used to expand template and substitutions database files
  • probe -- graphical viewer for PV details

Step 6 - Building your Production IOC

If you are not setting up a machine for the first time, this is the first step that you will need to perform. As of the writing of this wiki page, 10 January 2020, the agreement is to launch IOCs from the epics account. As such, I suggest using the following steps to create a production area for your IOC, namely /home/epics/epicsPRO/iocTops. In what follows, assume that your IOC is called myIOC and it was developed on your own machine in ~/epicsDEV/iocTops/myIOC.

  1. Ask your system administrator to (or you, yourself) create an epics account
  2. Create a production version IOC directory: mkdir -p epicsPRO/iocTops
  3. It is assumed that your IOC is to be a production version. Go to your development machine and go to your IOC directory: cd ~/epicsDEV/iocTops/myIOC
  4. Clean your directory with: make distclean -- this will remove all generated files and leave only source code and directories
  5. Move up to the /home/epics/epicsPRO/iocTops directory: cd ..
  6. Make a tarball of your IOC: tar zcvf myIOC.tar.gz myIOC -- you will now have the file /home/epics/epicsPRO/iocTops/myIOC.tar.gz
  7. Copy this tarball to your production machine: scp myIOC.tar.gz productionPC/home/epics/epicsPRO/iocTops/.@ -- where productionPC is the the host server for your IOC
  8. On productionPC: cd /home/epics/epicsPRO/iocTops
  9. Untar your IOC: tar zxvf myIOC.tar.gz
  10. Change directory: cd myIOC
  11. If done correctly, you should not need to modify any files, but check your configure/RELEASE file to be sure that that the environment variables are pointing to the correct directories
  12. Finally, you can build your IOC: make
    At this point your IOC is ready to run

Step 7 - Starting your Production IOC