From 3d219f2ac1690838f2cbfa89817afda7269a291d Mon Sep 17 00:00:00 2001 From: Sinisa Veseli <sveseli@aps.anl.gov> Date: Fri, 12 May 2017 16:05:09 +0000 Subject: [PATCH] added generic dm integration ioc --- src/c++/Makefile | 17 +++++++ src/c++/configure/.svnignore | 3 ++ src/c++/configure/CONFIG | 29 +++++++++++ src/c++/configure/CONFIG_SITE | 33 ++++++++++++ src/c++/configure/Makefile | 11 ++++ src/c++/configure/RELEASE | 51 +++++++++++++++++++ src/c++/configure/RELEASE.Common.linux-x86_64 | 1 + src/c++/configure/RULES | 6 +++ src/c++/configure/RULES.ioc | 2 + src/c++/configure/RULES_DIRS | 2 + src/c++/configure/RULES_TOP | 3 ++ src/c++/dmIntApp/Makefile | 5 ++ src/c++/dmIntApp/src/DmInt.dbd | 3 ++ src/c++/dmIntApp/src/DmIntMain.cpp | 22 ++++++++ src/c++/dmIntApp/src/Makefile | 28 ++++++++++ src/c++/iocBoot/Makefile | 6 +++ src/c++/iocBoot/iocDmInt/.svnignore | 5 ++ src/c++/iocBoot/iocDmInt/Makefile | 5 ++ src/c++/iocBoot/iocDmInt/st.cmd | 21 ++++++++ .../iocBoot/iocDmInt/startIocWithScreen.sh | 9 ++++ 20 files changed, 262 insertions(+) create mode 100644 src/c++/Makefile create mode 100644 src/c++/configure/.svnignore create mode 100644 src/c++/configure/CONFIG create mode 100644 src/c++/configure/CONFIG_SITE create mode 100644 src/c++/configure/Makefile create mode 100644 src/c++/configure/RELEASE create mode 100644 src/c++/configure/RELEASE.Common.linux-x86_64 create mode 100644 src/c++/configure/RULES create mode 100644 src/c++/configure/RULES.ioc create mode 100644 src/c++/configure/RULES_DIRS create mode 100644 src/c++/configure/RULES_TOP create mode 100644 src/c++/dmIntApp/Makefile create mode 100644 src/c++/dmIntApp/src/DmInt.dbd create mode 100644 src/c++/dmIntApp/src/DmIntMain.cpp create mode 100644 src/c++/dmIntApp/src/Makefile create mode 100644 src/c++/iocBoot/Makefile create mode 100644 src/c++/iocBoot/iocDmInt/.svnignore create mode 100644 src/c++/iocBoot/iocDmInt/Makefile create mode 100755 src/c++/iocBoot/iocDmInt/st.cmd create mode 100755 src/c++/iocBoot/iocDmInt/startIocWithScreen.sh diff --git a/src/c++/Makefile b/src/c++/Makefile new file mode 100644 index 00000000..fba606a4 --- /dev/null +++ b/src/c++/Makefile @@ -0,0 +1,17 @@ +#Makefile at top of application tree +TOP = . + +include $(TOP)/configure/CONFIG + +DIRS := dmIntApp iocBoot + +iocBoot_DEPEND_DIRS += $(filter %App,$(DIRS)) + +include $(TOP)/configure/RULES_TOP + +deploy: + +tidy: distclean + rm -rf $(TOP)/configure/RELEASE.support + + diff --git a/src/c++/configure/.svnignore b/src/c++/configure/.svnignore new file mode 100644 index 00000000..e99473fc --- /dev/null +++ b/src/c++/configure/.svnignore @@ -0,0 +1,3 @@ +O.* +*.local +*.support diff --git a/src/c++/configure/CONFIG b/src/c++/configure/CONFIG new file mode 100644 index 00000000..c1a47032 --- /dev/null +++ b/src/c++/configure/CONFIG @@ -0,0 +1,29 @@ +# CONFIG - Load build configuration data +# +# Do not make changes to this file! + +# Allow user to override where the build rules come from +RULES = $(EPICS_BASE) + +# RELEASE files point to other application tops +include $(TOP)/configure/RELEASE +-include $(TOP)/configure/RELEASE.$(EPICS_HOST_ARCH).Common +ifdef T_A +-include $(TOP)/configure/RELEASE.Common.$(T_A) +-include $(TOP)/configure/RELEASE.$(EPICS_HOST_ARCH).$(T_A) +endif + +CONFIG = $(RULES)/configure +include $(CONFIG)/CONFIG + +# Override the Base definition: +INSTALL_LOCATION = $(TOP) + +# CONFIG_SITE files contain other build configuration settings +include $(TOP)/configure/CONFIG_SITE +-include $(TOP)/configure/CONFIG_SITE.$(EPICS_HOST_ARCH).Common +ifdef T_A + -include $(TOP)/configure/CONFIG_SITE.Common.$(T_A) + -include $(TOP)/configure/CONFIG_SITE.$(EPICS_HOST_ARCH).$(T_A) +endif + diff --git a/src/c++/configure/CONFIG_SITE b/src/c++/configure/CONFIG_SITE new file mode 100644 index 00000000..d0bf5870 --- /dev/null +++ b/src/c++/configure/CONFIG_SITE @@ -0,0 +1,33 @@ +# CONFIG_SITE + +# Make any application-specific changes to the EPICS build +# configuration variables in this file. +# +# Host/target specific settings can be specified in files named +# CONFIG_SITE.$(EPICS_HOST_ARCH).Common +# CONFIG_SITE.Common.$(T_A) +# CONFIG_SITE.$(EPICS_HOST_ARCH).$(T_A) + +# CHECK_RELEASE controls the consistency checking of the support +# applications pointed to by the RELEASE* files. +# Normally CHECK_RELEASE should be set to YES. +# Set CHECK_RELEASE to NO to disable checking completely. +# Set CHECK_RELEASE to WARN to perform consistency checking but +# continue building anyway if conflicts are found. +CHECK_RELEASE = WARN + +# Set this when you only want to compile this application +# for a subset of the cross-compiled target architectures +# that Base is built for. +#CROSS_COMPILER_TARGET_ARCHS = vxWorks-ppc604 + +# To install files into a location other than $(TOP) define +# INSTALL_LOCATION here. +#INSTALL_LOCATION=</path/name/to/install/top> + +# Set this when your IOC and the host use different paths +# to access the application. This will be needed to boot +# from a Microsoft FTP server or with some NFS mounts. +# You must rebuild in the iocBoot directory for this to +# take effect. +#IOCS_APPL_TOP = </IOC/path/to/application/top> diff --git a/src/c++/configure/Makefile b/src/c++/configure/Makefile new file mode 100644 index 00000000..4650559f --- /dev/null +++ b/src/c++/configure/Makefile @@ -0,0 +1,11 @@ +TOP=.. + +include $(TOP)/configure/CONFIG + +TARGETS = $(CONFIG_TARGETS) +CONFIGS += $(subst ../,,$(wildcard $(CONFIG_INSTALLS))) + +include $(TOP)/configure/RULES + +tidy: distclean + rm -f RELEASE.support diff --git a/src/c++/configure/RELEASE b/src/c++/configure/RELEASE new file mode 100644 index 00000000..8e52a436 --- /dev/null +++ b/src/c++/configure/RELEASE @@ -0,0 +1,51 @@ +# RELEASE - Location of external support modules +# +# IF YOU MAKE ANY CHANGES to this file you must subsequently +# do a "gnumake rebuild" in this application's top level +# directory. +# +# The build process does not check dependencies against files +# that are outside this application, thus you should do a +# "gnumake rebuild" in the top level directory after EPICS_BASE +# or any other external module pointed to below is rebuilt. +# +# Host- or target-specific settings can be given in files named +# RELEASE.$(EPICS_HOST_ARCH).Common +# RELEASE.Common.$(T_A) +# RELEASE.$(EPICS_HOST_ARCH).$(T_A) +# +# This file should ONLY define paths to other support modules, +# or include statements that pull in similar RELEASE files. +# Build settings that are NOT module paths should appear in a +# CONFIG_SITE file. + +# Write RELEASE.support file before including it +DM_ROOT_DIR=$(TOP)/.. +DM_SUPPORT_DIR_PRODUCTION=/ +DM_SUPPORT_DIR_DEFAULT=$(DM_ROOT_DIR)/../support +RELEASE_SUPPORT=$(TOP)/configure/RELEASE.support +$(shell if [ ! -z $$DM_SUPPORT_DIR ]; then echo DM_SUPPORT_DIR=$$DM_SUPPORT_DIR > $(RELEASE_SUPPORT); elif [ -d $(DM_SUPPORT_DIR_DEFAULT) ]; then echo DM_SUPPORT_DIR=`realpath $(DM_SUPPORT_DIR_DEFAULT)` > $(RELEASE_SUPPORT) ; else echo DM_SUPPORT_DIR=$(DM_SUPPORT_DIR_PRODUCTION) > $(RELEASE_SUPPORT); fi) + +include $(TOP)/configure/RELEASE.support +-include $(TOP)/configure/RELEASE.local + +DM_OPT_DIR=$(DM_SUPPORT_DIR)/opt +EPICS_DIR=$(DM_OPT_DIR)/epics +EPICS_MODULES_DIR=$(EPICS_DIR)/modules +EPICS4_DIR=$(EPICS_MODULES_DIR)/epics4-cpp-4-6-0 +EPICS_EXTENSIONS_DIR=$(DM_SUPPORT_DIR)/epics/extensions + +PVDATA?=$(EPICS4_DIR)/pvDataCPP +PVCOMMON?=$(EPICS4_DIR)/pvCommonCPP +PVACCESS?=$(EPICS4_DIR)/pvAccessCPP +NORMATIVETYPES?=$(EPICS4_DIR)/normativeTypesCPP +PVDATABASE?=$(EPICS4_DIR)/pvDatabaseCPP + +#################### + +# EPICS_BASE usually appears last so other apps can override stuff: +EPICS_BASE?=$(EPICS_DIR)/base + +# Set RULES here if you want to take build rules from somewhere +# other than EPICS_BASE: +#RULES=/path/to/epics/support/module/rules/x-y diff --git a/src/c++/configure/RELEASE.Common.linux-x86_64 b/src/c++/configure/RELEASE.Common.linux-x86_64 new file mode 100644 index 00000000..8b137891 --- /dev/null +++ b/src/c++/configure/RELEASE.Common.linux-x86_64 @@ -0,0 +1 @@ + diff --git a/src/c++/configure/RULES b/src/c++/configure/RULES new file mode 100644 index 00000000..6d56e14e --- /dev/null +++ b/src/c++/configure/RULES @@ -0,0 +1,6 @@ +# RULES + +include $(CONFIG)/RULES + +# Library should be rebuilt because LIBOBJS may have changed. +$(LIBNAME): ../Makefile diff --git a/src/c++/configure/RULES.ioc b/src/c++/configure/RULES.ioc new file mode 100644 index 00000000..901987c6 --- /dev/null +++ b/src/c++/configure/RULES.ioc @@ -0,0 +1,2 @@ +#RULES.ioc +include $(CONFIG)/RULES.ioc diff --git a/src/c++/configure/RULES_DIRS b/src/c++/configure/RULES_DIRS new file mode 100644 index 00000000..3ba269dc --- /dev/null +++ b/src/c++/configure/RULES_DIRS @@ -0,0 +1,2 @@ +#RULES_DIRS +include $(CONFIG)/RULES_DIRS diff --git a/src/c++/configure/RULES_TOP b/src/c++/configure/RULES_TOP new file mode 100644 index 00000000..d09d668d --- /dev/null +++ b/src/c++/configure/RULES_TOP @@ -0,0 +1,3 @@ +#RULES_TOP +include $(CONFIG)/RULES_TOP + diff --git a/src/c++/dmIntApp/Makefile b/src/c++/dmIntApp/Makefile new file mode 100644 index 00000000..8420752f --- /dev/null +++ b/src/c++/dmIntApp/Makefile @@ -0,0 +1,5 @@ +TOP = .. +include $(TOP)/configure/CONFIG +DIRS := db src +include $(TOP)/configure/RULES_DIRS + diff --git a/src/c++/dmIntApp/src/DmInt.dbd b/src/c++/dmIntApp/src/DmInt.dbd new file mode 100644 index 00000000..4cb042bd --- /dev/null +++ b/src/c++/dmIntApp/src/DmInt.dbd @@ -0,0 +1,3 @@ +include "base.dbd" +#include "asyn.dbd" +#registrar("DmIntRegister") diff --git a/src/c++/dmIntApp/src/DmIntMain.cpp b/src/c++/dmIntApp/src/DmIntMain.cpp new file mode 100644 index 00000000..16ccb171 --- /dev/null +++ b/src/c++/dmIntApp/src/DmIntMain.cpp @@ -0,0 +1,22 @@ +// DM Integration IOC + +#include <stddef.h> +#include <stdlib.h> +#include <stddef.h> +#include <string.h> +#include <stdio.h> + +#include "epicsExit.h" +#include "epicsThread.h" +#include "iocsh.h" + +int main(int argc,char *argv[]) +{ + if(argc>=2) { + iocsh(argv[1]); + epicsThreadSleep(.2); + } + iocsh(NULL); + epicsExit(0); + return(0); +} diff --git a/src/c++/dmIntApp/src/Makefile b/src/c++/dmIntApp/src/Makefile new file mode 100644 index 00000000..3a62dc4d --- /dev/null +++ b/src/c++/dmIntApp/src/Makefile @@ -0,0 +1,28 @@ +TOP=../.. + +include $(TOP)/configure/CONFIG +#---------------------------------------- +# ADD MACRO DEFINITIONS AFTER THIS LINE + +#============================= +# Build the IOC application + +PROD_IOC_linux-x86_64 = dmIntIoc +PROD_IOC += $(PROD_IOC_$(T_A)) + +# DmInt.dbd will be created and installed +DBD += dmInt.dbd +dmInt_DBD += DmInt.dbd + +# DmInt_registerRecordDeviceDriver.cpp derives from dmInt.dbd +dmIntIoc_SRCS += DmIntMain.cpp dmInt_registerRecordDeviceDriver.cpp + +# Link to the EPICS Base libraries +dmIntIoc_LIBS += $(EPICS_BASE_IOC_LIBS) + +#============================= + +include $(TOP)/configure/RULES +#---------------------------------------- +# ADD RULES AFTER THIS LINE + diff --git a/src/c++/iocBoot/Makefile b/src/c++/iocBoot/Makefile new file mode 100644 index 00000000..91e47d0b --- /dev/null +++ b/src/c++/iocBoot/Makefile @@ -0,0 +1,6 @@ +TOP = .. +include $(TOP)/configure/CONFIG +DIRS += $(wildcard *ioc*) +DIRS += $(wildcard as*) +include $(CONFIG)/RULES_DIRS + diff --git a/src/c++/iocBoot/iocDmInt/.svnignore b/src/c++/iocBoot/iocDmInt/.svnignore new file mode 100644 index 00000000..a3818ccc --- /dev/null +++ b/src/c++/iocBoot/iocDmInt/.svnignore @@ -0,0 +1,5 @@ +O.* +.svnignore +cdCommands.debug +cdCommands +envPaths diff --git a/src/c++/iocBoot/iocDmInt/Makefile b/src/c++/iocBoot/iocDmInt/Makefile new file mode 100644 index 00000000..258a6d82 --- /dev/null +++ b/src/c++/iocBoot/iocDmInt/Makefile @@ -0,0 +1,5 @@ +TOP = ../.. +include $(TOP)/configure/CONFIG +TARGETS = envPaths +ARCH = linux-x86_64 +include $(TOP)/configure/RULES.ioc diff --git a/src/c++/iocBoot/iocDmInt/st.cmd b/src/c++/iocBoot/iocDmInt/st.cmd new file mode 100755 index 00000000..8a33c4df --- /dev/null +++ b/src/c++/iocBoot/iocDmInt/st.cmd @@ -0,0 +1,21 @@ +#!../../bin/linux-x86_64/dmIntIoc + +# The following syntax used in dbLoadRecords assigns an empty string to PF if none is provided +#P=${PF=} + +< envPaths + +##cd ${TOP} +cd ( "../..") + +## Register all support components +dbLoadDatabase "dbd/dmInt.dbd" +dmInt_registerRecordDeviceDriver(pdbbase) + +## Load record instances +dbLoadRecords("db/Workflow.db", "P=DM:1ID:, R=WORKFLOW:") + +cd ${TOP}/iocBoot/${IOC} + +iocInit + diff --git a/src/c++/iocBoot/iocDmInt/startIocWithScreen.sh b/src/c++/iocBoot/iocDmInt/startIocWithScreen.sh new file mode 100755 index 00000000..42fa9bf9 --- /dev/null +++ b/src/c++/iocBoot/iocDmInt/startIocWithScreen.sh @@ -0,0 +1,9 @@ +#!/bin/sh + +# to reattach .... 'screen -r' +# to detach ... 'CTL^A d + +# Allow this IOC to look at .2 PVs for acquisition conditions +export EPICS_CA_ADDR_LIST="pvgatemain1.aps4.anl.gov" + +gnome-terminal -e "screen -xR DaqMonIoc ./st.cmd" & -- GitLab