-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[sw][epics] epics installation #116
Comments
Download synApps
First check the latest version: https://github.com/EPICS-synApps/support/releases/latest export _SYNAPPS_VERSION=R6-3
export _SYNAPPS_FILENAME=synApps_6_3
export _SYNAPPS=/epics/$_SYNAPPS_FILENAME
cd ~/Downloads
wget https://github.com/EPICS-synApps/support/releases/download/$_SYNAPPS_VERSION/$_SYNAPPS_FILENAME.tar.gz
if [ $? -eq 0 ]; then
tar -xzf $_SYNAPPS_FILENAME.tar.gz -C /epics/
rm $_SYNAPPS_FILENAME.tar.gz
cd /epics
fi Copy desired modulesexport _EPICS_VERSION=3.15
export _EPICS_BASE=/epics/$_EPICS_VERSION/base
export _EPICS_SUPPORT=/epics/$_EPICS_VERSION/support
mkdir -p $_EPICS_SUPPORT
cd $_EPICS_SUPPORT
cp -r $_SYNAPPS/support/StreamDevice* .
cp -r $_SYNAPPS/support/asyn* .
cp -r $_SYNAPPS/support/calc* .
cp -r $_SYNAPPS/support/sscan* .
cp -r $_SYNAPPS/support/sequencer-mirror* . Modify support modules (not tested yet)cd $_EPICS_SUPPORT
export REPO_SEQUENCER_MIRROR=$(find $_EPICS_SUPPORT -maxdepth 1 -type d -name "*sequencer-mirror*" -exec basename {} \;)
export REPO_SSCAN=$(find $_EPICS_SUPPORT -maxdepth 1 -type d -name "*sscan*" -exec basename {} \;)
export REPO_CALC=$(find $_EPICS_SUPPORT -maxdepth 1 -type d -name "*calc*" -exec basename {} \;)
export REPO_ASYN=$(find $_EPICS_SUPPORT -maxdepth 1 -type d -name "*asyn*" -exec basename {} \;)
export REPO_STREAMDEVICE=$(find $_EPICS_SUPPORT -maxdepth 1 -type d -name "*StreamDevice*" -exec basename {} \;) StreamDevicetee > ${_EPICS_SUPPORT}/${REPO_STREAMDEVICE}/configure/RELEASE.local << EOF
SUPPORT=${_EPICS_SUPPORT}
ASYN=\$(SUPPORT)/${REPO_ASYN}
CALC=\$(SUPPORT)/${REPO_CALC}
PCRE=
EPICS_BASE=${_EPICS_BASE}
EOF rm -f ${_EPICS_SUPPORT}/${REPO_STREAMDEVICE}/GNUmakefile Asyntee > ${_EPICS_SUPPORT}/${REPO_ASYN}/configure/RELEASE.local << EOF
SUPPORT=${_EPICS_SUPPORT}
SNCSEQ=\$(SUPPORT)/${REPO_SEQUENCER_MIRROR}
CALC=\$(SUPPORT)/${REPO_CALC}
SSCAN=\$(SUPPORT)/${REPO_SSCAN}
EPICS_BASE=${_EPICS_BASE}
EOF tee > ${_EPICS_SUPPORT}/${REPO_ASYN}/configure/CONFIG_SITE.local << EOF
TIRPC=YES
EOF If TIRPC compilation failed, refer to #92 (comment) for multiarch package. CALCtee > ${_EPICS_SUPPORT}/${REPO_CALC}/configure/RELEASE.local << EOF
SUPPORT=${_EPICS_SUPPORT}
SSCAN=\$(SUPPORT)/${REPO_SSCAN}
SNCSEQ=\$(SUPPORT)/${REPO_SEQUENCER_MIRROR}
CALC=\$(SUPPORT)/${REPO_CALC}
EPICS_BASE=${_EPICS_BASE}
EOF SSCANtee > ${_EPICS_SUPPORT}/${REPO_SSCAN}/configure/RELEASE.local << EOF
SUPPORT=${_EPICS_SUPPORT}
SNCSEQ=\$(SUPPORT)/${REPO_SEQUENCER_MIRROR}
EPICS_BASE=${_EPICS_BASE}
EOF SEQUENCER_MIRRORtee > ${_EPICS_SUPPORT}/${REPO_SEQUENCER_MIRROR}/configure/RELEASE.local << EOF
EPICS_BASE=${_EPICS_BASE}
EOF Compilation order (EPICS_BASE must have been compiled)cd ${_EPICS_SUPPORT}/${REPO_SEQUENCER_MIRROR} && make distclean && make -j4 cd ${_EPICS_SUPPORT}/${REPO_SSCAN} && make distclean && make -j4 cd ${_EPICS_SUPPORT}/${REPO_CALC} && make distclean && make -j4 cd ${_EPICS_SUPPORT}/${REPO_ASYN} && make distclean && make -j4 cd ${_EPICS_SUPPORT}/${REPO_STREAMDEVICE} && make distclean && make -j4 |
If you only want to try Asyn & StreamDeviceAsynMake dir cd ${EPICS_BASE}
mkdir -p support
cd support Clone git clone https://github.com/epics-modules/asyn.git
cd asyn/configure Modify sed -n "s|EPICS_BASE=.*|EPICS_BASE=${EPICS_BASE}|p" RELEASE
sed -n "s|SUPPORT=.*|SUPPORT=${EPICS_BASE}/support|p" RELEASE
sed -n "s|# TIRPC=YES|TIRPC=YES|p" CONFIG_SITE Really modify sed -i "s|EPICS_BASE=.*|EPICS_BASE=${EPICS_BASE}|" RELEASE
sed -i "s|SUPPORT=.*|SUPPORT=${EPICS_BASE}/support|" RELEASE
sed -i "s|# TIRPC=YES|TIRPC=YES|" CONFIG_SITE Make it make -j8 StreamDeviceMake dir mkdir -p ${EPICS_BASE}/support Clone cd ${EPICS_BASE}/support
git clone https://github.com/paulscherrerinstitute/StreamDevice.git
cd StreamDevice/
rm GNUmakefile Modify sed -n "s|EPICS_BASE=.*|EPICS_BASE=${EPICS_BASE}|p" RELEASE
sed -n "s|ASYN=.*|ASYN=\$(SUPPORT)/asyn|p" RELEASE
sed -n "/CALC=.*/s|^|# |p" RELEASE
sed -n "/PCRE=.*/s|^|# |p" RELEASE Really modify sed -i "s|EPICS_BASE=.*|EPICS_BASE=${EPICS_BASE}|" RELEASE
sed -i "s|ASYN=.*|ASYN=\$(SUPPORT)/asyn|" RELEASE
sed -i "/CALC=.*/s|^|# |" RELEASE
sed -i "/PCRE=.*/s|^|# |" RELEASE Make it make -j8 If we want to use CALC, then I recommend installing synApps. |
cross-compileInstall compiler for
|
cross-compile softIoc
|
Multiple Soft IOCs on one host (same subnet)Tip automatically create/delete an iptables rule that replaces the destination address of all incoming CA UDP traffic on each interface with the broadcast address of that interface. Drop/link the following script into /etc/network/if-up.d/ and /etc/network/if-down.d/. #!/bin/sh -e
# Called when an interface goes up / down
# Author: Ralph Lange <[email protected]>
# Make any incoming Channel Access name resolution queries go to the broadcast address
# (to hit all IOCs on this host)
# Change this if you run CA on a non-standard port
PORT=5064
[ "$METHOD" != "none" ] || exit 0
[ "$IFACE" != "lo" ] || exit 0
line=`ip addr show $IFACE`
addr=`echo $line | grep -Po 'inet \K[\d.]+'`
bcast=`echo $line | grep -Po 'brd \K[\d.]+'`
[ -z "$addr" -o -z "$bcast" ] && return 1
if [ "$MODE" = "start" ]
then
iptables -t nat -A PREROUTING -d $addr -p udp --dport $PORT -j DNAT --to-destination $bcast
elif [ "$MODE" = "stop" ]
then
iptables -t nat -D PREROUTING -d $addr -p udp --dport $PORT -j DNAT --to-destination $bcast
fi
exit 0 Caution Note: This will not work for clients on the same host. (Adding that feature makes things a lot more complicated, and I like things to be simple.) If you need connections between IOCs on one host, I would suggest adding the broadcast address of the loopback interface (usually 127.255.255.255) to each IOC’s EPICS_CA_ADDR_LIST setting. export EPICS_CA_ADDR_LIST=127.255.255.255
export EPICS_PVA_ADDR_LIST=127.0.0.1
export EPICS_CA_AUTO_ADDR_LIST=no
export EPICS_PVA_AUTO_ADDR_LIST=no
Multiple IOCs on the same computer but on a different subnet |
phoebusgenuv pip install phoebusgen |
trouble shootingIf you copy epics runtime files to SBC, errors may occur like these:
|
PrebuiltRefer to #136 |
Epics Base
Dependencies
Make Directories
Clone Repo
wget https://epics-controls.org/download/base/base-7.0.8.1.tar.gz tar -xvf base-7.0.8.1.tar.gz cd base-7.0.8.1
Or,
git clone --recursive -b 7.0 https://git.launchpad.net/epics-base base-7.0 cd base-7.0
Or,
Make
If failed, and need to rebuild
If need to checkout to another tag:
# after checkout make distclean git reset --hard git clean -fd rm -rf .ci rm -rf ./modules git submodule update --init --recursive
Setup Env (Optional)
Test
Test softIoc app
The text was updated successfully, but these errors were encountered: