Newer
Older
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
function print_the_help {
echo "USAGE: bootstrap_epics "
echo " OPTIONS: "
#echo " -n,--name NAME IOC name (must begin with letter)"
exit
}
function yes_or_no {
while true; do
read -p "$* [y/n]: " yn
case $yn in
[Yy]*) return 0 ;;
[Nn]*) echo "No entered" ; return 1 ;;
esac
done
}
NAME=
#if [[ $# -eq 0 ]] ; then
# print_the_help
# exit
#fi
POSITIONAL=()
while [[ $# -gt 0 ]]
do
key="$1"
case $key in
-h|--help)
shift # past argument
print_the_help
;;
-n|--name)
NAME="$2"
shift # past argument
shift # past value
;;
#-a|--all)
# LOG_ALL_PLOTS=1
# shift # past argument
# #shift # past value
# ;;
#-o|--online-only)
# ONLINE_ONLY=1
# shift # past argument
# #shift # past value
# ;;
*) # unknown option
#POSITIONAL+=("$1") # save it in an array for later
echo "unknown option $1"
print_the_help
shift # past argument
;;
esac
done
set -- "${POSITIONAL[@]}" # restore positional parameters
#if [[ -z "${NAME}" ]] ; then
# echo "Error: ioc NAME must be supplied"
# print_the_help
# exit
#fi
#if [ -d "${NAME}" ]
#then
# echo "Directory ${NAME} exists."
# echo "Error: cannot overrite ${NAME}"
#else
# echo "Making directory ${NAME}"
# mkdir "${NAME}"
#fi
#cd "${NAME}"
yes_or_no "build epics base"
if [[ $? ]] ; then
lsb_release -d | grep -i "ubuntu"
if [[ "$?" == "0" ]] ; then
sudo apt-get install -y \
re2c libreadline-dev libusb-dev \
libusb-java libusb-1.0-0-dev libnet1-dev libavl-dev \
python-pip \
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
libpcap-dev libx11-dev libxext-dev python-numpy
if [[ "$(uname -m)" == "aarch64" ]] ; then
sudo apt-get install -y python-rpi.gpio python3-rpi.gpio
fi
sudo pip install --trusted-host pypi.org --trusted-host files.pythonhosted.org spidev
fi
git clone --recursive -b 7.0 https://git.launchpad.net/epics-base base-7.0
ln -s base-7.0 base
pushd base
make
popd
wget -qO- https://epics.anl.gov/bcda/synApps/tar/synApps_6_0.tar.gz | tar -zxf -
pushd synApps/support
ln -s calc-R3-7-1 calc
ln -s asyn-R4-33 asyn
ln -s stream-R2-7-7c stream
sed -i '1d' configure/RELEASE
sed -i '1iSUPPORT = /opt/epics/synApps/support' configure/RELEASE
sed -i '3d' configure/RELEASE
sed -i '3iEPICS_BASE=/opt/epics/base' configure/RELEASE
sed -i '17d' configure/RELEASE
sed -i '17i#DXP=$(SUPPORT)/dxp-R5-0' configure/RELEASE
sed -i '34d' configure/RELEASE
sed -i '34i#SSCAN=$(SUPPORT)/sscan-R2-11-1' configure/RELEASE
sed -i '46d' configure/RELEASE
sed -i '45d' configure/RELEASE
sed -i '44d' configure/RELEASE
sed -i '43d' configure/RELEASE
sed -i '42d' configure/RELEASE
sed -i '41d' configure/RELEASE
echo '#AREA_DETECTOR=$(SUPPORT)/areaDetector-R3-3-1' >> configure/RELEASE
echo '#ADCORE=$(AREA_DETECTOR)/ADCore' >> configure/RELEASE
echo '#ADSUPPORT=$(AREA_DETECTOR)/ADSupport' >> configure/RELEASE
echo '#ADSIMDETECTOR=$(AREA_DETECTOR)/ADSimDetector' >> configure/RELEASE
echo '#SNCSEQ=$(SUPPORT)/seq-2-2-5' >> configure/RELEASE
echo '#ALLEN_BRADLEY=$(SUPPORT)/allenBradley-2-3' >> configure/RELEASE
make release
make
popd
fi
yes_or_no "Build extenstions"
if [[ "$?" ]] ; then
# Extensions
git clone https://github.com/epics-extensions/extensions
pushd extensions/src
git clone https://github.com/mdavidsaver/pyDevSup.git
pushd pyDevSup
sed -i '26d' configure/RELEASE
sed -i '26iINSTALL_LOCATION=/opt/epics/extensions' configure/RELEASE
sed -i '39d' configure/RELEASE
sed -i '39iEPICS_BASE = /opt/epics/base' configure/RELEASE
popd
popd
pushd extensions
sed -i '65iPYDEVSUP = pyDevSup' src/Makefile
sed -i '127iDIRS += $(PYDEVSUP)' src/Makefile
sed -i '26d' src/pyDevSup/configure/CONFIG_SITE
sed -i '26iINSTALL_LOCATION=/opt/epics/extensions' src/pyDevSup/configure/CONFIG_SITE
sed -i '15iinclude /opt/epics/extensions/configure/os/CONFIG_PY.Common.$(EPICS_HOST_ARCH)' src/pyDevSup/configure/CONFIG_PY

Whitney Armstrong
committed
yes_or_no "caQtDM"
if [[ $? ]] ; then
pushd extensions/src
wget https://github.com/caqtdm/caqtdm/archive/V4.2.4.tar.gz -O - | tar -zx
pushd caqtdm-4.2.4
./caQtDM_BuildAll
./caQtDM_Install
popd
popd
fi