Set up environment variables
export EPICS_BASE=/epics/base
export EPICS_HOST_ARCH=linux-x86_64
export P4USER=clarkenr #your perforce username
export P4PASSWD=secret #your perforce password
export P4CLIENT=clarkenr_SR00IOC99 #the perforce workspace you will be editing
export BUILD_CLIENT=/home/clarkenr/perforce #path to the root of the perforce workspace that you will build against
export BUILD_BASE=/home/clarkenr #path where the IOC build will be put
export P4_BUILD_SCRIPTS_CLIENT=clarkenr_build_scripts #a perforce workspace to fetch some build scripts
export PATH="${PATH}:/home/clarkenr/build_scripts" #root of the P4_BUILD_SCRIPTS_CLIENT workspaceNote the P4_BUILD_SCRIPTS_CLIENT client should be mapped to //ASP/Dev/SBS/4_Controls/4_5_Support_System/4_5_4_Build_Scripts/.
Fetch the build scripts:
p4 sync //ASP/Dev/SBS/4_Controls/4_5_Support_System/4_5_4_Build_Scripts/bs_update_scripts
$BUILD_CLIENT/Dev/SBS/4_Controls/4_5_Support_System/4_5_4_Build_Scripts/bs_update_scriptsFetch build_instructions and the IOC to edit:
p4 sync //ASP/Dev/Build/accelerator/redhat/build_instructions
p4 sync //ASP/Dev/Build/accelerator/redhat/CR01FS01/...Since we are on a 64 bit machine, make the following change to $BUILD_CLIENT/Dev/Build/accelerator/redhat/build_instructions:
@@ -37 +37 @@
-epics_host_arch=linux-x86
+epics_host_arch=linux-x86_64Comment out parts of the IOC we won't be able to build in $BUILD_CLIENT/Dev/Build/accelerator/redhat/CR01FS01/Makefile and $BUILD_CLIENT/Dev/Build/accelerator/redhat/CR01FS01/CR01FS01App/src/Makefile. Make sure you undo these changes before checking these files into perforce.
Fetch componenents needed to build the IOC:
bs_local_build_sync -f $BUILD_CLIENT/Dev/Build/accelerator/redhat/CR01FS01/build_instructionsTry to build the IOC:
bs_local_build CR01FS01If the build fails, inspect $BUILD_BASE/current_build/artefacts/redhat/make_redhat_CR01FS01.log. If the error is a missing library for a module such as asyn, seq or autosave you will need to install that module in your EPICS directory. For autosave you do the following:
p4 sync //ASP/Installation_Files/AutoSave/autosave_R5-1.tar.gz
cd /epics
cp $BUILD_CLIENT/Installation_Files/AutoSave/autosave_R5-1.tar.gz .
tar -xf autosave_R5-1.tar.gz
ln -s autosave-5-1 autosave
cd autosave
# Configure build scripts according to the module's instructions
makeFetch the folder where you are going to put your support app and move your app there:
p4 sync //ASP/Dev/SBS/4_Controls/4_4_Equipment_Control/Common/sw/Facilities_Status/...
cd $BUILD_CLIENT/Dev/SBS/4_Controls/4_4_Equipment_Control/Common/sw/Facilities_Status
cp -r /asp/ics/SR00IOC99/AnnouncementsApp .Remove any files that shouldn't be put into perforce:
cd AnnouncementsApp
make clean
Ensure your source files have the standard headers found in //ASP/standard_header.txt.
Open the IOC source files we need to edit:
p4 edit $BUILD_CLIENT/Dev/Build/accelerator/redhat/CR01FS01/build_instructions
p4 edit $BUILD_CLIENT/Dev/Build/accelerator/redhat/CR01FS01/CR01FS01App/src/Makefile
p4 edit $BUILD_CLIENT/Dev/Build/accelerator/redhat/CR01FS01/iocBoot/iocCR01FS01/st.cmd
Modify $BUILD_CLIENT/Dev/Build/accelerator/redhat/CR01FS01/build_instructions to specify your app as a component:
# PA announcement PVs
#
comp=/Dev/SBS/4_Controls/4_4_Equipment_Control/Common/sw/Facilities_Status/AnnouncementsApp
If your app needs a module like seq you would add the following near the top of the file:
seq=/Dev/SBS/4_Controls/4_3_Network_Infrastructure/4_3_1_Comms_Common_Services/sw/epics/seq-2.1.16
Add dbds and libs to $BUILD_CLIENT/Dev/Build/accelerator/redhat/CR01FS01/CR01FS01App/src/Makefile if they are needed.
Modify $BUILD_CLIENT/Dev/Build/accelerator/redhat/CR01FS01/iocBoot/iocCR01FS01/st.cmd to load records and start sequencers:
dbLoadRecords ("db/Announcements.db")
dbLoadTemplate ("db/Announcement_Resets.substitutions")
Check that the IOC builds successfully:
bs_local_build CR01FS01Create a bug if one does not exist already.
Undo any changes to build files that should not be committed.
In perforce, add the new files to your change list. Inspect all your changes carefully and then choose Submit. In the description box, add a sentence starting with "bug <bug_id>" explaining your changes.
Under "Link jobs to changelist", enter "bug<bug_id>" and click Add. Finally, click Submit to check-in your changes and close the bug.