# Presentation: 553367

## Disk Layout/Productization Proposal

- Ron Rechenmacher
- and
- Geoff Savage

## Goals

- Flexibility - environment variables
- Organization – EPICS and DOOCS (and Everything)
- Development
- Production
- Distribution
- Configuration
- Complete example
- Methodology - a set or system of methods, principles, and rules for regulating a given discipline, as in the arts or sciences
- CVS
- UPS
- Scripts
- make
- Native (EPICS and DOOCS) build systems

- Software Productization

- 9 Apr 2007

## “Epics will be built the Fermi way

- - ie no hard coded paths.”

- Use environment variables set via UPS in EPICS and DOOCS build systems to locate components.

- Software Productization

- 9 Apr 2007

## Environment Variables

- “A set of dynamic values that can affect the way running processes will behave on a computer” - Wikipedia
- In our case we want to change locations of components
- Example:
- Change header in EPICS base for doocs2epics
- Edit configure/RELEASE
- What if change in EPICS base for all components?
- How do we trigger the rebuild of all components?
- Debated EPICS issue – disagreement
- Some flexibility exists without Environment Variables (flexibility has value)
- Many years CD/elsewhere experience
- Basic UNIX (along with symlinks)
- Similar to logicals from VMS; should not be too surprising

- Software Productization

- 9 Apr 2007

## UPS

- Unix Product Support
- _[http://www.fnal.gov/docs/products/ups/](http://www.fnal.gov/docs/products/ups/)_

- [savage@smtfs2 savage]$ setup epics
- [savage@smtfs2 savage]$ printenv | grep EPICS
_**EPICS_DIR=/p/epics/v3_14_8_f2**_
- EPICS_LIB_DIR=/p/epics/v3_14_8_f2/lib/linux-x86
- EPICS_HOST_ARCH=linux-x86
- SETUP_EPICS=epics v3_14_8_f2 -f Linux -z /p

- Software Productization

- 9 Apr 2007

**Notes:**
When a product is setup via ups an environment variable is created that specifies the base directory for the product.
This env variable is always the name of the product in all caps with “_DIR” appended.
epics -> EPICS_DIR
my_product -> MY_PRODUCT_DIR

## .../base/configure

-       /ups
-  /_**extensions**_/configure
-             /src/alh
-                 /edm
-             /ups
-  /_**support**_/genSub/configure
-                 /ups
-          /sequencer/configure
-                    /ups
-  /ups
-  Makefile
- .../vxWorksIoc/configure
-                 /ups
-       /plcIoc/configure
-               /ups
-      /ups
-      Makefile

- /p/epics/v1
- /p/epics/v2
- /p/epics/v3

- /p/epics_iocs/v1
- /p/epics_iocs/v2
- /p/epics_iocs/v3

- In cvs
- epics/epics

- In cvs
- epics/epics_ioc

- Software Productization

- 9 Apr 2007

## Controls System Components

| EPICS | DOOCS | Contents |
| --- | --- | --- |
| base | Serverlib,
Clientlib, ENS | Engine, Protocol |
| support | Support libs | Sequencer, VME access, field bus, ... |
| ioc | Servers | Applications |
| extensions | Clients | Display manager |
| Configuration
vxworks | Configuration | Difference: vxworks |

- Software Productization

- 9 Apr 2007

## Slide 8

| Doocs/Linux/SunOS_compat
     /build_tools
     /clients/cmdline
             /ddd
             /rpc_util
             /save_restore
     /doc
     /ens
     /iid
     /libs/<VME,cam,classic>lib
          /clientlib
          /dddlib
          /fsmlib
          /serverlib
     /servers/bpm
             /ip177timer
             /multiknob
             /simcon
     Makefile
     /ups

Doocs_ilcta/ddd_panels
           /eq_conf | driver stuff

vhdl interface
fieldbus libraries

Display
Sequencer

Displays
server config |
| --- | --- |

- Software Productization

- 9 Apr 2007

## .../base/configure

-       /_**ups**_
-  /extensions/configure
-             /src/alh
-                 /edm
-             /_**ups**_
- /support/genSub/configure
-                 /_**ups**_
-          /sequencer/configure
-                    /_**ups**_
-  /_**ups**_
-  _**Makefile**_
_**...**__**/iocs...**_

- /p/epics/v1
- /p/epics/v2
- /p/epics/v3

- The RELEASE file in the configure directory specifies the locations
- of external software modules, an example is EPICS base.

- Each version is
- tagged in CVS.

- extensions =
- CA client
- applications

- ioc =
- user application,
- CA server

- support =
- libraries used
- in ioc

- base = engine,
- CA protocol

- Software Productization

- 9 Apr 2007

**Notes:**
Everything is together.  (Longer build times?)
Multiple versions may be in use at any given time.
Changes in one directory requires a new version and release.
Structure of version numbers?

## Installations

- Installation
- CVS Module

- Development
- Directory

- Make installs libraries,
- executables, headers

- Tar -> Untar

- Production
- Directory

- Distribution
- Directory

- cvs export
- (no CVS directories)

- cvs checkout
- (CVS directories)

- Configuration
- CVS Module

- Configuration
- Directory

- ups table file specifies version to use

- cvs checkout

- Make

- Make?

- Software Productization

- 9 Apr 2007

**Notes:**
Development
Install location == “TOP”
Installation
Development (same structure) w/o CVS
Add version

## Development

- Installation
- CVS Module

- Directory

- Make installs libraries,
- executables, headers

- cvs checkout

- New
- Component

- Set an environment variable to
- point to the new location.

- Software Productization

- 9 Apr 2007

## Decisions and Discoveries

- Logging of build configurations
- Makefile in ups directory (not tried yet)
- What scripts are necessary?
- Epics_hard_coded_path.sh (not coded yet)
- Ups_dir_init.sh (not coded yet)
- How many configuration CVS modules?
- One for each area
- Example: a0/server module
- What should our Makefiles do?
- Make help
- Make local_install
- Make prod_install
- Note: Config is separate

- Software Productization

- 9 Apr 2007

## Decisions and Discoveries

- How to install UPS directories?
- Script needed
- Using CVS
- Install starting version into cvs with import
- Cvs import –m’initial’ epics/ioc/plc INITIAL vX_Y
-        other epics/epics/extensions/....
- Install new version with commit after installing on top of the previous version
- Cvs ci –m’comment’
- Cvs tag vs cvs rtag --- use cvs tag.
- 3rd party products
- ???

- Software Productization

- 9 Apr 2007

## Other Technical Issues(and non-issues)

- Host architecture isn’t enough
- Unless always build on “oldest” distribution
- Compatibility libraries
- Dependency conflicts
- Each release version will not have all product versions
- 3rd party libraries and products:
- National Instruments (GPIB) (LD_LIBRARY_PATH *)
- Note difference from labview product: non-licensed (free)
- matlab interface - (MATLABPATH *)
- labview interface (?)
- * Does not have to be installed into installation directory – non-issue 

- Software Productization

- 9 Apr 2007

## Time Marches On ...

- Develop and install
- Documentation, makefiles, UPS files, Scripts
- For EPICS: perl script
- “Estimate of 80 hours of an FTE”
- One meeting, 12 people * 0.25 hr = 3 hrs
- Ron and Geoff meeting * 6 hrs = 12 hrs
- And some coffee and doughnuts
- Ron for 20 hrs
- This talk - 6 hrs and counting
- This meeting 10 people * 0.5 hr = 5 hr

- Software Productization

- 9 Apr 2007

## New Discoveries

- “setup” seems to be working
- Need system startup
- Component startup
- Doocs watchdog server suggested
- Vxworks_boot as install area
- Same as /p except under /home/vxworks_boot
- /home/vxworks/p/kekbpm

- Software Productization

- 9 Apr 2007