Open konosubakonoakua opened 1 week ago
Consider using
assemble_synApps.sh
First check the latest version: https://github.com/EPICS-synApps/support/releases/latest
For now, it's R6-3
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
export _EPICS_VERSION=3.15
export _EPICS_BASE = /epics/$_EPICS_VERSION/base
export _EPICS_SUPPORT=/epics/$_EPICS_VERSION/support
mkdir -p $_EPICS_SUPPORT
cd /epics/$_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* .
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 {} \;)
echo > ${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 ${REPO_STREAMDEVICE}/GNUmakefile
echo > ${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
echo > ${REPO_ASYN}/configure/CONFIG_SITE.local << EOF
TIRPC=YES
EOF
echo > ${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
echo > ${REPO_SSCAN}/configure/RELEASE.local << EOF
SUPPORT=${_EPICS_SUPPORT}
SNCSEQ=\$(SUPPORT)/${REPO_SEQUENCER_MIRROR}
EPICS_BASE=${_EPICS_BASE}
EOF
echo > ${REPO_SEQUENCER_MIRROR}/configure/RELEASE.local << EOF
EPICS_BASE=${_EPICS_BASE}
EOF
cd ${REPO_SEQUENCER_MIRROR} && make distclean && make -j4
cd ${REPO_SSCAN} && make distclean && make -j4
cd ${REPO_CALC} && make distclean && make -j4
cd ${REPO_ASYN} && make distclean && make -j4
cd ${REPO_STREAMDEVICE} && make distclean && make -j4
zynq cortex-a9
sudo apt install gcc-arm-linux-gnueabi g++-arm-linux-gnueabi
qemu-user-static
(for running arm executables)sudo apt install qemu-user-static
export EPICS_TOOLS_ARM_PKGS=/epics/tools/arm/pkgs
mkdir -p $EPICS_TOOLS_ARM_PKGS
readline
cd $EPICS_TOOLS_ARM_PKGS
wget https://mirrors.ustc.edu.cn/gnu/readline/readline-8.2.tar.gz
tar -xvf readline-8.2.tar.gz
cd $EPICS_TOOLS_ARM_PKGS/readline-8.2
CC=arm-linux-gnueabi-gcc ./configure --host=arm-linux-gnueabi --prefix=/usr/arm-linux-gnueabi
make -j4
sudo make install
ncurses
cd $EPICS_TOOLS_ARM_PKGS
wget https://mirrors.ustc.edu.cn/gnu/ncurses/ncurses-6.5.tar.gz
tar -xvf ncurses-6.5.tar.gz
cd $EPICS_TOOLS_ARM_PKGS/ncurses-6.5
# NOTE: Beginning with ncurses 6.5 option `--enable-widec` is enabled by default; Older versions disable it by default.
CC=arm-linux-gnueabi-gcc ./configure --host=arm-linux-gnueabi --prefix=/usr/arm-linux-gnueabi --with-normal --with-shared --with-strip-program=arm-linux-gnueabi-strip --disable-widec --without-tests --enable-pc-files --with-pkg-config --with-pkg-config-libdir=libdir
make -j4
sudo make install
export EPICS_BASE=/epics/3.15/base
export EPICS_BASE=/epics/7/base
cd $EPICS_BASE
git apply << 'EOF'
diff --git a/configure/os/CONFIG_SITE.Common.linux-arm b/configure/os/CONFIG_SITE.Common.linux-arm
index 8f5fb8c82..613652c1e 100644
--- a/configure/os/CONFIG_SITE.Common.linux-arm
+++ b/configure/os/CONFIG_SITE.Common.linux-arm
@@ -26,7 +26,7 @@ COMMANDLINE_LIBRARY = $(strip $(if $(wildcard \
# from the top of the Base tree after changing this setting.
# Needs -lncurses:
-#COMMANDLINE_LIBRARY = READLINE_NCURSES
+COMMANDLINE_LIBRARY = READLINE_NCURSES
# Needs -lcurses:
#COMMANDLINE_LIBRARY = READLINE_CURSES
diff --git a/configure/os/CONFIG_SITE.linux-x86.linux-arm b/configure/os/CONFIG_SITE.linux-x86.linux-arm
index a1edb423d..46ee8629c 100644
--- a/configure/os/CONFIG_SITE.linux-x86.linux-arm
+++ b/configure/os/CONFIG_SITE.linux-x86.linux-arm
@@ -4,11 +4,11 @@
#-------------------------------------------------------
# Set GNU crosscompiler target name
-GNU_TARGET = arm-xilinx-linux-gnueabi
+GNU_TARGET = arm-linux-gnueabi
# Set GNU tools install path
# Examples are installations at the APS:
-GNU_DIR = /usr/local/vw/zynq-2011.09
+GNU_DIR = /usr
#GNU_DIR = /usr/local/Xilinx/SDK/2016.3/gnu/arm/lin
#GNU_DIR = /APSshare/XilinxSDK/2015.4/gnu/arm/lin
@@ -25,6 +25,7 @@ GNU_DIR = /usr/local/vw/zynq-2011.09
# To use libreadline, point this to its install prefix
#READLINE_DIR = $(GNU_DIR)
+READLINE_DIR = /usr/arm-linux-gnueabi
#READLINE_DIR = /tools/cross/linux-x86.linux-arm/readline
# See CONFIG_SITE.Common.linux-arm for other COMMANDLINE_LIBRARY values
#COMMANDLINE_LIBRARY = READLINE
EOF
sed
sed -i 's/#COMMANDLINE_LIBRARY = READLINE_NCURSES/COMMANDLINE_LIBRARY = READLINE_NCURSES/' configure/os/CONFIG_SITE.Common.linux-arm
sed -i 's/GNU_TARGET = arm-xilinx-linux-gnueabi/GNU_TARGET = arm-linux-gnueabi/' configure/os/CONFIG_SITE.linux-x86.linux-arm
sed -i 's/GNU_DIR = \/usr\/local\/vw\/zynq-2011.09/GNU_DIR = \/usr/' configure/os/CONFIG_SITE.linux-x86.linux-arm
sed -i 's/#READLINE_DIR = $(GNU_DIR)/READLINE_DIR = \/usr\/arm-linux-gnueabi/' configure/os/CONFIG_SITE.linux-x86.linux-arm
CONFIG_SITE.local
echo "CROSS_COMPILER_TARGET_ARCHS=linux-arm" > $EPICS_BASE/configure/os/CONFIG_SITE.local
tbd
[!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/. If your system does not have the ip command, consider updating it (or install package iproute2 from backports).
#!/bin/sh -e
# Called when an interface goes up / down
# Author: Ralph Lange <Ralph.Lange@gmx.de>
# 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
[!TIP] Refer to:
Epics Base
Dependencies
Make Directories
Clone Repo
Or,
Or,
Make
If failed, and need to rebuild
Setup Env (Optional)
Test
Test softIoc app