diff --git a/documentation/ConvertingR3.13AppsToR3.14.html b/documentation/ConvertingR3.13AppsToR3.14.html index 1b4d16da3..5e1913ed7 100644 --- a/documentation/ConvertingR3.13AppsToR3.14.html +++ b/documentation/ConvertingR3.13AppsToR3.14.html @@ -13,13 +13,10 @@
-This document describes how to convert a R3.13 vxWorks application so that it
+
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.
+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> -<full path to 3.14 base>/bin/<host_arch>/makeBaseApp.pl -t example junk-
++ +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 <fullpath name to new top>-
++ +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 seq external module
SNCSEQ =<full path to seq module top>
-The R3.14 seq module must exist and be built with the same EPICS base R3.14 -release. ++-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"
+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 Makefile as follows:
Change "TOP=../../.." to "TOP=../.."
+Remove existing Makefile
.
Change "include $(TOP)/config/CONFIG_APP" to "include -$(TOP)/configure/CONFIG"
+Rename Makefile.Host
to Makefile
Change "include $(TOP)/config/RULES.Db" to "include -$(TOP)/configure/RULES"
+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 + ++-rm Makefile cp ../../junkApp/src/Makefile .+We can remove the junkApp now.
-/bin/rm -fr ../../junkApp+We can remove the junkApp now (unless you have other App/src directories +still to convert):
-This new Make file has comments explaining how to build the various host +
++ +rm -rf ../../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 +++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) -+Com_DIR = $(EPICS_BASE_LIB)
In Makefile these are:
-PROD_HOST += caExample +++PROD_HOST += caExample caExample_SRCS += caExample.c -caExample_LIBS += $(EPICS_BASE_HOST_LIBS) -+caExample_LIBS += $(EPICS_BASE_HOST_LIBS)
Makefile.Host (or perhaps Makefile.Vx) contains:
-RECTYPES += xxxRecord.h -+
+RECTYPES += xxxRecord.h+
In Makefile this is:
-DBDINC += xxxRecord -+
+DBDINC += xxxRecord+
Makefile.Host (or perhaps Makefile.Vx) contains:
-DBDEXPAND = exampleInclude.dbd -DBDNAME = exampleApp.dbd -+
+DBDEXPAND = exampleInclude.dbd +DBDNAME = exampleApp.dbd+
In Makefile this is:
-DBD += example.dbd -+
+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 += ../xxxRecord.c SRCS.c += ../devXxxSoft.c LIBOBJS += xxxRecord.o @@ -140,10 +162,11 @@ LIBOBJS += sncExample.o include ../baseLIBOBJS LIBNAME = exampleLib -INSTALLS += iocCore seq -+INSTALLS += iocCore seq
In Makefile these become:
-LIBRARY_vxWorks += exampleIoc +++LIBRARY_vxWorks += exampleIoc exampleIoc_SRCS += xxxRecord.c exampleIoc_SRCS += devXxxSoft.c exampleIoc_LIBS += $(EPICS_BASE_IOC_LIBS) @@ -158,9 +181,8 @@ example_LIBS += $(EPICS_BASE_IOC_LIBS) example_SRCS += example_registerRecordDeviceDriver.cpp #The following adds support from base/src/vxWorks -example_OBJS_vxWorks += $(EPICS_BASE_BIN)/vxComLibrary - -+example_OBJS_vxWorks += $(EPICS_BASE_BIN)/vxComLibrary
You now can add the line
+- You now can add the line include "base.dbd" to your - <appname>Include.dbd file and remove the file - <name>App/src/base.dbd from your src directory. The base.dbd from - base/dbd will be included. However, if you only want a subset of record - definitions from base you should keep your base.dbd file.+
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
+- Add the following line after all existing #includes - --- The structure rset is now a typedef so change -#include "epicsExport.h"+#include "epicsExport.h"-- to +struct rset <recordname>RSET={ ...-The structure rset is now a typedef so change
--rset <recordname>RSET={ ...++- and add the following line after the "rset <recordname>RSET=" - definition. -struct rset recordnameRSET = { ... };-epicsExportAddress(rset,<recordname>RSET);+to
+ +++ +rset recordnameRSET = { ... };+and add the following line after the
+ +rset recordnameRSET = { ... +};definition.+-epicsExportAddress(rset,recordnameRSET);Device support
+Add the following line after all existing #includes
+- Add the following line after all existing #includes - --- and add the following line after the dset definition: struct { ...} - dev<devname>= { ...}; -#include "epicsExport.h"+#include "epicsExport.h"-epicsExportAddress(dset,dev<devname>);+and add the following line after the dset definition
+ +struct { ... } +devname = { ... };+-epicsExportAddress(dset,devname);Driver support
+Add the following line after all existing #includes
+- Add the following line after all existing #includes - ---- and add the following line after the drvet dev<devname> definition -#include "epicsExport.h"+#include "epicsExport.h"-epicsExportAddress(drvet,drv<devname>);+and add the following line after the drvet drvname definition
+ ++-epicsExportAddress(drvet,drvname);Registration code changed
-- Registration code for application specific functions, e.g. subroutine - record init and process functions, must been changed as follows ++Registration code for application specific functions, e.g. subroutine record +init and process functions, must been changed as follows
-1) Include the following header files:
++
-- Include the following header files after all existing #includes: +
-+#include "registerFunction.h" +#include "epicsExport.h"+-- 2) Make the application specific functions static functions, e.g. +#include "epicsExport.h" -#include "registerFunction.h"-- Make the application specific functions static functions, e.g. +
-+static long mySubInit(subRecord *precord) +static long mySubProcess(subRecord *precord)+-- 3) Add an epicsExportFunction statement for each of the functions to be - registered, e.g. +static long mySubInit(subRecord *precord) -static long mySubProcess(subRecord *precord) --- Add an epicsExportFunction statement for each of the functions to be + registered, e.g. +
-+epicsExportFunction(mySubInit); +epicsExportFunction(mySubProcess);+-- 4) Add a function statement for each of the functions to be registered in a - .dbd file that is included in the application, e.g. +epicsExportFunction(mySubInit); -epicsExportFunction(mySubProcess); --- Add a function statement for each of the functions to be registered in a + .dbd file that is included in the application, e.g. +
++function("mySubInit") +function("mySubProcess")+--function("mySubInit") -function("mySubProcess") --Modify the Makefiles in top/iocBoot directory.
-Modify the Makefiles in <top>/iocBoot directory.
- -Change " include $(TOP)/config/CONFIG_APP" to "include -$(TOP)/configure/CONFIG"
+Change
include $(TOP)/config/CONFIG_APPtoinclude +$(TOP)/configure/CONFIGIf they do not already exist, add the lines
@@ -282,62 +305,83 @@ $(TOP)/configure/CONFIG" DIRS += $(wildcard as*)Change "include $(TOP)/config/RULES.iocBoot" to "include -$(TOP)/configure/RULES_DIRS".
+Change
-include $(TOP)/config/RULES.iocBoottoinclude +$(TOP)/configure/RULES_DIRS.Modify the Makefiles in <top>/iocBoot/ioc* directories.
+Modify the Makefiles in top/iocBoot/ioc* directories.
-Change "include $(TOP)/config/CONFIG_APP" to "include -$(TOP)/configure/CONFIG"
+Change
include $(TOP)/config/CONFIG_APPtoinclude +$(TOP)/configure/CONFIGChange
-ARCH = <old arch specification e.g. mv167>
++ARCH = <old arch specification e.g. mv167>+to
-ARCH = <new arch specification e.g. vxWorks-68040>
++-ARCH = <new arch specification e.g. vxWorks-68040>+Change "include $(TOP)/config/RULES.ioc" to "include -$(TOP)/configure/RULES.ioc"
+Change
include $(TOP)/config/RULES.ioctoinclude +$(TOP)/configure/RULES.iocIf it exists remove the line
-buildInstall: cdCommands
++buildInstall: cdCommands+Add the line
-TARGETS = cdCommands
++TARGETS = cdCommands+before the include for RULES.ioc line.
-Modify st.cmd in <top>/iocBoot/ioc* directories.
+Modify st.cmd in top/iocBoot/ioc* directories.
Remove the lines
-ld < seq + ++-ld < seq ld < iocCore+Change "ld < <libname>Lib" to "ld < -<libname>.munch"
+Change
ld < nameLibto -Change "cd appbin" to "cd topbin"
+++ +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 appbintocd topbinChange the statement:
-dbLoadDatabase("../../dbd/<name>App.dbd")
-to -
-dbLoadDatabase("../../dbd/<name>.dbd") -<name>_registerRecordDeviceDriver(pdbbase)++-dbLoadDatabase("../../dbd/nameApp.dbd")+where <name> is replaced with the name of your dbd file.
+to + +++ +dbLoadDatabase("../../dbd/name.dbd") +name_registerRecordDeviceDriver(pdbbase)+where name is replaced with the name of your dbd file.
recGbl calls
-If any source file makes calls to recGbl routines make sure it has "#include "recGbl.h". If it doesn't the -compiler will issue warning messages and the ioc may issue the message: -"undefined symbol: _recGblSetSevr".
+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.Record support changes
@@ -351,15 +395,17 @@ add LIBOBJS definitions to the src Makefile.For example add
-PID=<full path to modules directory>/pid
++-PID = /path/to/modules/pid+to config/RELEASE and add
+
-to config/RELEASE and add
- ++-LIBOBJS += $(PID_BIN)/pidRecord.o+LIBOBJS += $(PID_BIN)/pidRecord.o
-to your application src/Makefile. +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 @@ -372,7 +418,7 @@ 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.
+Hardware support changesbelow for instructions.Hardware support changes
@@ -390,18 +436,23 @@ directory in your application src directory files.For example, remove
-LIBOBJS+=$(EPICS_BASE_BIN)/symb
++LIBOBJS += $(EPICS_BASE_BIN)/symb+from baseLIBOBJS and add
-LIBOBJS+=$(SYMB_BIN)/symb
++-LIBOBJS += $(SYMB_BIN)/symb+to your application src/Makefile,
+
-and add the lineto your application src/Makefile, and add the line
-SYMB=<full path definition for the built module SYMB>
++-SYMB = <full path definition for the built module SYMB>+into your application config/RELEASE file .
+into your application config/RELEASE file.
dbLoadtemplate tool changes
@@ -411,9 +462,10 @@ 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>
++MSI = <full path name to msi executable>+to your application config/RELEASE file.
-