...
Installation on Linux / MacOS — EPICS Documentation documentation (epics-controls.org)
TODO: patrick try installing it yourself and see if you can move the .so and build with epics
- You need /lib, /include, and /bin.
- 1) Keep everything in the epics/ folder, but copy the folder over, then update $LD_LIBRARY_PATH(lib), $PATH(bin), $CPATH(include)?
- How build epics:
git clone --recursive https://github.com/epics-base/epics-base.git
- make
- cp -r /mnt/eed/ad-build/registry/epics-base/R7.0.8/epics-base/ /build/
# If this works add to .bashrc because this'll be dev image
export EPICS_BASE=/build/epics-base
export EPICS_HOST_ARCH=$(${EPICS_BASE}/startup/EpicsHostArch)
export PATH=${EPICS_BASE}/bin/${EPICS_HOST_ARCH}:${PATH}
Works for binaries, need to try building simple ioc with it.
Code Block |
---|
|
mkdir -p /build/testIoc
cd /build/testIoc
makeBaseApp.pl -t example testIoc
makeBaseApp.pl -i -t example testIoc
make
cd iocBoot/ioctestIoc
chmod u+x st.cmd
./st.cmd |
Building works, and can run the ioc.
Code Block |
---|
language | bash |
---|
linenumbers | true |
---|
collapse | true |
---|
|
[root@ad-build-container-rocky9-544f5787dc-gl4sq ioctestIoc]# pwd
/build/testIoc/iocBoot/ioctestIoc
[root@ad-build-container-rocky9-544f5787dc-gl4sq ioctestIoc]# ls
Makefile README envPaths st.cmd
[root@ad-build-container-rocky9-544f5787dc-gl4sq ioctestIoc]# ./st.cmd
#!../../bin/linux-x86_64/testIoc
< envPaths
epicsEnvSet("IOC","ioctestIoc")
epicsEnvSet("TOP","/build/testIoc")
epicsEnvSet("EPICS_BASE","/build/epics-base")
cd "/build/testIoc"
## Register all support components
dbLoadDatabase "dbd/testIoc.dbd"
testIoc_registerRecordDeviceDriver pdbbase
## Load record instances
dbLoadTemplate "db/user.substitutions"
dbLoadRecords "db/testIocVersion.db", "user=root"
dbLoadRecords "db/dbSubExample.db", "user=root"
cd "/build/testIoc/iocBoot/ioctestIoc"
iocInit
Starting iocInit
############################################################################
## EPICS R7.0.8
## Rev. R7.0.8
## Rev. Date Git: 2023-12-14 16:42:10 -0600
############################################################################
cas WARNING: Configured TCP port was unavailable.
cas WARNING: Using dynamically assigned TCP port 37587,
cas WARNING: but now two or more servers share the same UDP port.
cas WARNING: Depending on your IP kernel this server may not be
cas WARNING: reachable with UDP unicast (a host's IP in EPICS_CA_ADDR_LIST)
iocRun: All initialization complete
## Start any sequence programs
#seq sncExample, "user=root"
epics> ^C
[root@ad-build-container-rocky9-544f5787dc-gl4sq ioctestIoc]# |
- Now need to try asyn as that would need 'include' statements of epics. After this then we can conclude epics can be built/ran in a container, although still unclear if can access s3df pvs?
- For registry git clone --depth 1 --branch R4-39 https://github.com/epics-modules/asyn.git
Steps to build asyn - ignore, it should be prebuilt in registry already
Code Block |
---|
|
mkdir /build/support/
cp -r /mnt/eed/ad-build/registry/asyn/R4.39-1.0.1/asyn/ /build/support/
export LD_LIBRARY_PATH=/build/epics-base/lib/linux-x86_64:${LD_LIBRARY_PATH}
# Update asyn/configure/RELEASE
# Change EPICS_BASE to point to your epics base =/build/epics-base
# Change SUPPORT to point to your support folder = /build/support
# Comment out IPAC and SNCSEQ
# if get xdr.* missing error, then uncomment TIRPC in configure/CONFIG_SITE
dnf --enablerepo=crb install -y libtirpc-devel
# -devel is important, its (developer) and gives header files in /usr/include/rpc
yum install -y rpcgen
cd asyn/
make |
- Now you have the libraries and binaries needed, in /asyn/lib.
- try test-ioc with asyn with your guardian 'example' branch
Steps to build Guardian ioc
Code Block |
---|
|
cd /build
git clone -b example https://github.com/pnispero/Guardian.git
in configure/RELEASE
Update EPICS_BASE to point to /build/epics-base
Update ASYN to point to /build/asyn
make
cd iocBoot/iocGuardianTest/
in st.cmd
Update the shebang to point to #!../../bin/linux-x86_64/Guardian
chmod +x st.cmd
./st.cmd |
Optional:
Code Block |
---|
|
# Then in the shell you can 'dbl' to get pvs
# And in another terminal write to 'device' pv.
$ caput FBCK:FB02:GN01:S2DES_TEST 5
# Trigger the 'trigger' pv.
$ caput SIOC:B34:GD_PATRICK:SNAPSHOT_TRG_EN 1
# The code will then takeSnapshot(). And your output should be 5 |
...