This document describes how to convert a R3.13 vxWorks application so that it builds with release R3.14. It describes procedures such that:
First do a gnumake clean uninstall in the application's root directory to remove all files created by earlier builds.
We will remove junkApp later.
mkdir top cd top /path/to/base-3.14/bin/host_arch/makeBaseApp.pl -t example junk
cd oldtop find *App iocBoot -print | cpio -pvmd /path/to/new/top
Copy definitions of external modules excluding EPICS_BASE and
TEMPLATES_TOP from old application RELEASE file.
If sequence programs (*.st or *.stt files) exist in your application, add the
SNCSEQ location definition for the R3.14 sncseq external module
SNCSEQ = /path/to/sncseq
The R3.14 sncseq module must exist and be built with the same EPICS base R3.14 release.
Change include $(TOP)/config/CONFIG_APP
to include
$(TOP)/configure/CONFIG
Change include $(TOP)/config/RULES_DIRS
to include
$(TOP)/configure/RULES_DIRS
Remove existing Makefile
.
Rename Makefile.Host
to Makefile
Modify the Makefile as follows:
Change TOP=../../..
to TOP=../..
Change include $(TOP)/config/CONFIG_APP
to include
$(TOP)/configure/CONFIG
Change include $(TOP)/config/RULES.Db
to include
$(TOP)/configure/RULES
Place all definitions between the include lines.
Place any rules after the last include line.
This is the hardest step. The definitions in Makefile.Host and Makefile.Vx must be manually converted to the new configure definitions.
First replace Makefile with the Makefile from junkApp/src.
rm Makefile cp ../../junkApp/src/Makefile .
We can remove the junkApp now.
/bin/rm -fr ../../junkApp
This new Makefile has comments explaining how to build the various host and ioc products. Lets consider some examples
Makefile.Host contains definitions like:
PROD += caExample caExample_SRCS += caExample.c PROD_LIBS += ca Db Com ca_DIR = $(EPICS_BASE_LIB) Db_DIR = $(EPICS_BASE_LIB) Com_DIR = $(EPICS_BASE_LIB)
In Makefile these are:
PROD_HOST += caExample caExample_SRCS += caExample.c caExample_LIBS += $(EPICS_BASE_HOST_LIBS)
Makefile.Host (or perhaps Makefile.Vx) contains:
RECTYPES += xxxRecord.h
In Makefile this is:
DBDINC += xxxRecord
Makefile.Host (or perhaps Makefile.Vx) contains:
DBDEXPAND = exampleInclude.dbd DBDNAME = exampleApp.dbd
In Makefile this is:
DBD += example.dbd
NOTES: Change exampleApp.dbd to example.dbd in all st.cmd files. Also this definition assumes that file exampleInclude.dbd exists.
Makefile.Vx contains statements like:
SRCS.c += ../xxxRecord.c SRCS.c += ../devXxxSoft.c LIBOBJS += xxxRecord.o LIBOBJS += devXxxSoft.o LIBOBJS += sncExample.o include ../baseLIBOBJS LIBNAME = exampleLib INSTALLS += iocCore seq
In Makefile these become:
LIBRARY_vxWorks += exampleIoc exampleIoc_SRCS += xxxRecord.c exampleIoc_SRCS += devXxxSoft.c exampleIoc_LIBS += $(EPICS_BASE_IOC_LIBS) PROD_IOC_vxWorks = example example_SRCS += sncExample.stt example_LIBS += exampleIoc example_LIBS += seq pv example_LIBS += $(EPICS_BASE_IOC_LIBS) # example_registerRecordDeviceDriver.cpp will be created from example.dbd example_SRCS += example_registerRecordDeviceDriver.cpp #The following adds support from base/src/vxWorks example_OBJS_vxWorks += $(EPICS_BASE_BIN)/vxComLibrary
After these changes are made the following files are no longer needed: baseLIBOBJS, Makefile.Host, and Makefile.Vx
You now can add the line
include "base.dbd"
to your appnameInclude.dbd file and remove the file nameApp/src/base.dbd from your src directory. The base.dbd from base/dbd will be used instead. If you only want to load a subset of the record definitions from base you can keep your own copy of base.dbd, but you should copy the one from your R3.14 base and edit that rather than trying to re-use the R3.13 version from your old application.
Add the following line after all existing #includes
#include "epicsExport.h"
The structure rset is now a typedef so change
struct rset recordnameRSET = { ... };
to
rset recordnameRSET = { ... };
and add the following line after the rset recordnameRSET = { ...
};
definition.
epicsExportAddress(rset,recordnameRSET);
Add the following line after all existing #includes
#include "epicsExport.h"
and add the following line after the dset definition struct { ... }
devname = { ... };
epicsExportAddress(dset,devname);
Add the following line after all existing #includes
#include "epicsExport.h"
and add the following line after the drvet drvname definition
epicsExportAddress(drvet,drvname);
Registration code for application specific functions, e.g. subroutine record init and process functions, must been changed as follows
#include "registerFunction.h" #include "epicsExport.h"
static long mySubInit(subRecord *precord) static long mySubProcess(subRecord *precord)
epicsExportFunction(mySubInit); epicsExportFunction(mySubProcess);
function("mySubInit") function("mySubProcess")
Change include $(TOP)/config/CONFIG_APP
to include
$(TOP)/configure/CONFIG
If they do not already exist, add the lines
DIRS += $(wildcard *ioc*) DIRS += $(wildcard as*)
Change include $(TOP)/config/RULES.iocBoot
to include
$(TOP)/configure/RULES_DIRS
.
Change include $(TOP)/config/CONFIG_APP
to include
$(TOP)/configure/CONFIG
Change
ARCH = <old arch specification e.g. mv167>
to
ARCH = <new arch specification e.g. vxWorks-68040>
Change include $(TOP)/config/RULES.ioc
to include
$(TOP)/configure/RULES.ioc
If it exists remove the line
buildInstall: cdCommands
Add the line
TARGETS = cdCommands
before the include for RULES.ioc line.
Remove the lines
ld < seq ld < iocCore
Change ld < nameLib
to
ld 0,0, "name.munch"(The ld command in vxWorks 5.5.2 doesn't clean up its standard input properly, so we now recommend passing the filename to it directly instead.)
Change cd appbin
to cd topbin
Change the statement:
todbLoadDatabase("../../dbd/nameApp.dbd")
dbLoadDatabase("../../dbd/name.dbd") name_registerRecordDeviceDriver(pdbbase)
where name is replaced with the name of your dbd file.
If any source file makes calls to recGbl routines make sure it includes
recGbl.h. If it doesn't the compiler will issue warning messages and
the ioc may issue the message: undefined symbol: _recGblSetSevr
.
The steppermotor, scan, and pid records are no longer in base. If these records are not used in your application, comment out references to them in base.dbd. If these record types are used at your site, they should be downloaded and built with base R3.14 by your EPICS administrator. To update the R3.14 location of these record types in your application you must add appropriate module definitions to your application's config/RELEASE file and add LIBOBJS definitions to the src Makefile.
For example add
PID = /path/to/modules/pid
to config/RELEASE and add
LIBOBJS += $(PID_BIN)/pidRecord.o
to your application src/Makefile.
You should consider changing any existing old steppermotor records to the new EPICS motor record module supported by Beamline Controls and Data Acquisition at APS.
recDynLink.o and devPtSoft.o are no longer in EPICS base and now exist as
separate EPICS modules.You must now add the appropriate module full path
definitions to your application config/RELEASE file, and change
LIBOBJS location definition $(EPICS_BASE_BIN) to the module
definition bin directory in your application src directory files. See
Hardware support changes
below for instructions.
All hardware support (dev, drv and dbd files) except soft support has been unbundled from base R3.14. This support includes the files symb.dbd, drvHp1404a.o, drvEpvxiMsg.o, and drvEpvxi.o. If these are not used by your application, comment out references to them in base.dbd.
Hardware support now exists as separate EPICS modules. The hardware support for your site should be downloaded and built with base R3.14 by your EPICS administrator. You must now add the appropriate module full path definitions to your application config/RELEASE file, and change LIBOBJS location from $(EPICS_BASE_BIN) to the module bin directory in your application src directory files.
For example, remove
LIBOBJS += $(EPICS_BASE_BIN)/symb
from baseLIBOBJS and add
LIBOBJS += $(SYMB_BIN)/symb
to your application src/Makefile, and add the line
SYMB = <full path definition for the built module SYMB>
into your application config/RELEASE file.
The host tool dbLoadTemplate has been replace by a new EPICS extension, msi, which should be downloaded and built with base R3.14 by your EPICS administrator. dbLoadTemplate is still supported on iocs. If, in your application, db files are created from template and substitution files you should add the definition
MSI = <full path name to msi executable>
to your application config/RELEASE file.