-
Notifications
You must be signed in to change notification settings - Fork 12
/
Copy pathassemble_synApps.sh
executable file
·505 lines (390 loc) · 14.1 KB
/
assemble_synApps.sh
1
2
3
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
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
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
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
#!/bin/bash
shopt -s expand_aliases
# Command-line arguments
args=$*
# Flags set by command-line arguments
FULL_CLONE=False
CONFIG_SOURCED=False
# Handle command-line arguments
for arg in ${args}
do
if [ ${arg} == "full" ]
then
FULL_CLONE=True
else
if [ -e ${arg} ]
then
echo "Sourcing ${arg}"
source ${arg}
CONFIG_SOURCED=True
else
echo "${arg} does not exist."
fi
fi
done
echo "FULL_CLONE = ${FULL_CLONE}"
if [ ${CONFIG_SOURCED} == "False" ]
then
echo "Using default configuration"
EPICS_BASE=/APSshare/epics/base-7.0.4.1
HAVE_HIDAPI=NO
WITH_PVA=YES
# The name of the synApps directory can be customized
#!SYNAPPS_DIR=synApps_X_X
SUPPORT=R6-2-1
ALLENBRADLEY=2.3
ALIVE=R1-3-1
AREA_DETECTOR=R3-11
ASYN=R4-42
AUTOSAVE=R5-10-2
BUSY=R1-7-3
CALC=R3-7-4
CAMAC=R2-7-4
CAPUTRECORDER=R1-7-4
DAC128V=R2-10-1
DELAYGEN=R1-2-3
DXP=R6-0
DXPSITORO=R1-2
DEVIOCSTATS=3.1.16
ETHERIP=ether_ip-3-2
GALIL=V3-6
IP=R2-21-1
IPAC=2.16
IP330=R2-10
IPUNIDIG=R2-12
LOVE=R3-2-8
LUA=R3-0-2
MCA=R7-9
MEASCOMP=R2-5-1
ULDAQ=1.2.1
MODBUS=R3-2
MOTOR=R7-2-2
OPCUA=v0.9.3
#UASDK=/path/to/sdk
OPTICS=R2-13-5
QUADEM=R9-4
SNCSEQ=R2-2-9
SOFTGLUE=R2-8-3
SOFTGLUEZYNQ=R2-0-4
SSCAN=R2-11-5
SCALER=4.0
STD=R3-6-3
STREAM=2.8.22
VAC=R1-9-1
VME=R2-9-4
YOKOGAWA_DAS=R2-0-1
XSPRESS3=2-5
XXX=R6-2-1
fi
shallow_repo()
{
PROJECT=$1
MODULE_NAME=$2
RELEASE_NAME=$3
TAG=$4
FOLDER_NAME=$MODULE_NAME-${TAG//./-}
echo
echo "Grabbing $MODULE_NAME at tag: $TAG"
echo
git clone -q --branch $TAG --depth 1 https://github.com/$PROJECT/$MODULE_NAME.git $FOLDER_NAME
echo "$RELEASE_NAME=\$(SUPPORT)/$FOLDER_NAME" >> ./configure/RELEASE
echo
}
full_repo()
{
PROJECT=$1
MODULE_NAME=$2
RELEASE_NAME=$3
TAG=$4
FOLDER_NAME=$MODULE_NAME-${TAG//./-}
echo
echo "Grabbing $MODULE_NAME at tag: $TAG"
echo
git clone -q https://github.com/$PROJECT/$MODULE_NAME.git $FOLDER_NAME
CURR=$(pwd)
cd $FOLDER_NAME
git checkout -q $TAG
cd "$CURR"
echo "$RELEASE_NAME=\$(SUPPORT)/$FOLDER_NAME" >> ./configure/RELEASE
echo
}
shallow_support()
{
git clone -q --branch $2 --depth 1 https://github.com/EPICS-synApps/$1.git
}
full_support()
{
git clone -q https://github.com/EPICS-synApps/$1.git
cd $1
git checkout -q $2
cd ..
}
if [ ${FULL_CLONE} == "True" ]
then
alias get_support='full_support'
alias get_repo='full_repo'
else
# A shallow clone is the default
alias get_support='shallow_support'
alias get_repo='shallow_repo'
fi
if [ -z "${SYNAPPS_DIR}" ]
then
SYNAPPS_DIR=synApps
fi
# Assume user has nothing but this file, just in case that's true.
mkdir ${SYNAPPS_DIR}
cd ${SYNAPPS_DIR}
get_support support $SUPPORT
cd support
SUPPORT=$(pwd)
echo "SUPPORT=$SUPPORT" > configure/RELEASE
echo '-include $(TOP)/configure/SUPPORT.$(EPICS_HOST_ARCH)' >> configure/RELEASE
echo "EPICS_BASE=$EPICS_BASE" >> configure/RELEASE
echo '-include $(TOP)/configure/EPICS_BASE' >> configure/RELEASE
echo '-include $(TOP)/configure/EPICS_BASE.$(EPICS_HOST_ARCH)' >> configure/RELEASE
echo "" >> configure/RELEASE
echo "" >> configure/RELEASE
# modules ##################################################################
# get_repo Git Project Git Repo RELEASE Name Tag
if [[ $ALIVE ]]; then get_repo epics-modules alive ALIVE $ALIVE ; fi
if [[ $ASYN ]]; then get_repo epics-modules asyn ASYN $ASYN ; fi
if [[ $AUTOSAVE ]]; then get_repo epics-modules autosave AUTOSAVE $AUTOSAVE ; fi
if [[ $BUSY ]]; then get_repo epics-modules busy BUSY $BUSY ; fi
if [[ $CALC ]]; then get_repo epics-modules calc CALC $CALC ; fi
if [[ $CAMAC ]]; then get_repo epics-modules camac CAMAC $CAMAC ; fi
if [[ $CAPUTRECORDER ]]; then get_repo epics-modules caputRecorder CAPUTRECORDER $CAPUTRECORDER ; fi
if [[ $DAC128V ]]; then get_repo epics-modules dac128V DAC128V $DAC128V ; fi
if [[ $DELAYGEN ]]; then get_repo epics-modules delaygen DELAYGEN $DELAYGEN ; fi
if [[ $DXP ]]; then get_repo epics-modules dxp DXP $DXP ; fi
if [[ $DXPSITORO ]]; then get_repo epics-modules dxpSITORO DXPSITORO $DXPSITORO ; fi
if [[ $DEVIOCSTATS ]]; then get_repo epics-modules iocStats DEVIOCSTATS $DEVIOCSTATS ; fi
if [[ $ETHERIP ]]; then get_repo epics-modules ether_ip ETHERIP $ETHERIP ; fi
if [[ $GALIL ]]; then get_repo motorapp Galil-3-0 GALIL $GALIL ; fi
if [[ $IP ]]; then get_repo epics-modules ip IP $IP ; fi
if [[ $IPAC ]]; then get_repo epics-modules ipac IPAC $IPAC ; fi
if [[ $IP330 ]]; then get_repo epics-modules ip330 IP330 $IP330 ; fi
if [[ $IPUNIDIG ]]; then get_repo epics-modules ipUnidig IPUNIDIG $IPUNIDIG ; fi
if [[ $LOVE ]]; then get_repo epics-modules love LOVE $LOVE ; fi
if [[ $LUA ]]; then get_repo epics-modules lua LUA $LUA ; fi
if [[ $MCA ]]; then get_repo epics-modules mca MCA $MCA ; fi
if [[ $MEASCOMP ]]; then get_repo epics-modules measComp MEASCOMP $MEASCOMP ; fi
if [[ $MODBUS ]]; then get_repo epics-modules modbus MODBUS $MODBUS ; fi
if [[ $MOTOR ]]; then get_repo epics-modules motor MOTOR $MOTOR ; fi
if [[ $OPTICS ]]; then get_repo epics-modules optics OPTICS $OPTICS ; fi
if [[ $QUADEM ]]; then get_repo epics-modules quadEM QUADEM $QUADEM ; fi
if [[ $SCALER ]]; then get_repo epics-modules scaler SCALER $SCALER ; fi
if [[ $SNCSEQ ]]; then get_repo mdavidsaver sequencer-mirror SNCSEQ $SNCSEQ ; fi
if [[ $SOFTGLUE ]]; then get_repo epics-modules softGlue SOFTGLUE $SOFTGLUE ; fi
if [[ $SOFTGLUEZYNQ ]]; then get_repo epics-modules softGlueZynq SOFTGLUEZYNQ $SOFTGLUEZYNQ ; fi
if [[ $SSCAN ]]; then get_repo epics-modules sscan SSCAN $SSCAN ; fi
if [[ $STD ]]; then get_repo epics-modules std STD $STD ; fi
if [[ $STREAM ]]; then get_repo paulscherrerinstitute StreamDevice STREAM $STREAM ; fi
if [[ $VAC ]]; then get_repo epics-modules vac VAC $VAC ; fi
if [[ $VME ]]; then get_repo epics-modules vme VME $VME ; fi
if [[ $XSPRESS3 ]]; then get_repo epics-modules xspress3 XSPRESS3 $XSPRESS3 ; fi
if [[ $YOKOGAWA_DAS ]]; then get_repo epics-modules Yokogawa_DAS YOKOGAWA_DAS $YOKOGAWA_DAS ; fi
if [[ $XXX ]]; then get_repo epics-modules xxx XXX $XXX ; fi
if [[ $ALLENBRADLEY ]]
then
# get allenBradley-2-3
wget http://www.aps.anl.gov/epics/download/modules/allenBradley-$ALLENBRADLEY.tar.gz
tar xf allenBradley-$ALLENBRADLEY.tar.gz
mv allenBradley-$ALLENBRADLEY allenBradley-${ALLENBRADLEY//./-}
rm -f allenBradley-$ALLENBRADLEY.tar.gz
ALLENBRADLEY=${ALLENBRADLEY//./-}
echo "ALLEN_BRADLEY=\$(SUPPORT)/allenBradley-${ALLENBRADLEY}" >> ./configure/RELEASE
cd allenBradley-$ALLENBRADLEY
echo "-include \$(TOP)/../RELEASE.local" >> ./configure/RELEASE
echo "-include \$(TOP)/../RELEASE.\$(EPICS_HOST_ARCH).local" >> ./configure/RELEASE
echo "-include \$(TOP)/configure/RELEASE.local" >> ./configure/RELEASE
cd ..
fi
if [[ $AREA_DETECTOR ]]
then
get_repo areaDetector areaDetector AREA_DETECTOR $AREA_DETECTOR
echo "ADCORE=\$(AREA_DETECTOR)/ADCore" >> configure/RELEASE
echo "ADSUPPORT=\$(AREA_DETECTOR)/ADSupport" >> configure/RELEASE
cd areaDetector-$AREA_DETECTOR
git submodule init
git submodule update ADCore
git submodule update ADSupport
git submodule update ADSimDetector
cd ADCore/iocBoot
cp EXAMPLE_commonPlugins.cmd commonPlugins.cmd
cp EXAMPLE_commonPlugin_settings.req commonPlugin_settings.req
if [ WITH_PVA == "YES" ]
then
sed -i s:'#NDPvaConfigure':'NDPvaConfigure':g commonPlugins.cmd
sed -i s:'#dbLoadRecords("NDPva':'dbLoadRecords("NDPva':g commonPlugins.cmd
sed -i s:'#startPVAServer':'startPVAServer':g commonPlugins.cmd
fi
cd ../..
cd configure
cp EXAMPLE_CONFIG_SITE.local CONFIG_SITE.local
cp EXAMPLE_CONFIG_SITE.local.WIN32 CONFIG_SITE.local.WIN32
# make release will give the correct paths for these files, so we just need to rename them
cp EXAMPLE_RELEASE_PRODS.local RELEASE_PRODS.local
cp EXAMPLE_RELEASE_LIBS.local RELEASE_LIBS.local
cp EXAMPLE_RELEASE.local RELEASE.local
# vxWorks has pthread and other issues
echo 'WITH_GRAPHICSMAGICK = NO' >> CONFIG_SITE.local.vxWorks
echo 'WITH_BLOSC = NO' >> CONFIG_SITE.local.vxWorks
echo 'WITH_BITSHUFFLE = NO' >> CONFIG_SITE.local.vxWorks
echo 'WITH_JSON = NO' >> CONFIG_SITE.local.vxWorks
sed -i s:'WITH_JSON = YES':'WITH_JSON = NO':g CONFIG_SITE.local
# linux-arm has X11 and other issues
echo 'WITH_BITSHUFFLE = NO' >> CONFIG_SITE.local.linux-x86_64.linux-arm
echo 'WITH_GRAPHICSMAGICK = NO' >> CONFIG_SITE.local.linux-x86_64.linux-arm
echo 'WITH_BITSHUFFLE = NO' >> CONFIG_SITE.local.linux-x86.linux-arm
echo 'WITH_GRAPHICSMAGICK = NO' >> CONFIG_SITE.local.linux-x86.linux-arm
if [ ${WITH_PVA} == "NO" ]
then
sed -i s:'WITH_PVA = YES':'WITH_PVA = NO':g CONFIG_SITE.local
sed -i s:'WITH_QSRV = YES':'WITH_QSRV = NO':g CONFIG_SITE.local
fi
# Enable building ADSimDetector
sed -i s:'#ADSIMDETECTOR':'ADSIMDETECTOR':g RELEASE.local
cd ../..
fi
if [[ $ASYN ]]
then
cd asyn-$ASYN
#RHEL 8 and Centos change library names
if [[ -f /etc/redhat-release ]]
then
if grep -q -i "release 8" /etc/redhat-release
then
echo "TIRPC = YES" >> ./configure/CONFIG_SITE.Common.linux-x86_64
cp ./configure/CONFIG_SITE.Common.linux-x86_64 ./configure/CONFIG_SITE.Common.linux-x86_64-debug
fi
fi
cd ..
fi
if [[ $CALC ]]
then
if [[ $SNCSEQ ]]
then
# Uncomment sseq support in calc
cd calc-$CALC
sed -i s:'#SNCSEQ':'SNCSEQ':g configure/RELEASE
cd ..
fi
fi
if [[ $DXP ]]
then
cd dxp-$DXP
echo "LINUX_USB_INSTALLED = NO" >> ./configure/CONFIG_SITE.linux-x86_64.linux-arm
echo "LINUX_USB_INSTALLED = NO" >> ./configure/CONFIG_SITE.linux-x86.linux-arm
cd ..
fi
if [[ $ETHERIP ]]
then
cd ether_ip-$ETHERIP
echo "EPICS_BASE=" >> ./configure/RELEASE
cd ..
fi
if [[ $GALIL ]]
then
cd Galil-3-0-$GALIL
cp -r ${GALIL//V}/. ./
rm -rf ${GALIL//V}
cp ./config/GALILRELEASE ./configure/RELEASE.local
sed -i s:'#CROSS_COMPILER_TARGET_ARCHS.*':'CROSS_COMPILER_TARGET_ARCHS = ':g configure/CONFIG_SITE
cd ..
fi
if [[ $IPAC ]]
then
cd ipac-${IPAC//./-}
echo "-include \$(TOP)/../RELEASE.local" >> ./configure/RELEASE
echo "-include \$(TOP)/../RELEASE.\$(EPICS_HOST_ARCH).local" >> ./configure/RELEASE
echo "-include \$(TOP)/configure/RELEASE.local" >> ./configure/RELEASE
sed -i s:'#registrar(vipc310Registrar)':'registrar(vipc310Registrar)':g drvIpac/drvIpac.dbd
sed -i s:'#registrar(vipc610Registrar)':'registrar(vipc610Registrar)':g drvIpac/drvIpac.dbd
sed -i s:'#registrar(vipc616Registrar)':'registrar(vipc616Registrar)':g drvIpac/drvIpac.dbd
sed -i s:'#registrar(tvme200Registrar)':'registrar(tvme200Registrar)':g drvIpac/drvIpac.dbd
sed -i s:'#registrar(xy9660Registrar)':'registrar(xy9660Registrar)':g drvIpac/drvIpac.dbd
cd ..
fi
if [[ $MCA ]]
then
cd mca-$MCA
echo "SCALER=" >> ./configure/RELEASE
echo "LINUX_LIBUSB-1.0_INSTALLED = NO" >> ./configure/CONFIG_SITE.linux-x86_64.linux-arm
echo "LINUX_LIBUSB-1.0_INSTALLED = NO" >> ./configure/CONFIG_SITE.linux-x86.linux-arm
cd ..
fi
if [[ $MEASCOMP ]]
then
cd measComp-$MEASCOMP
if [[ $ULDAQ ]]
then
wget https://github.com/mccdaq/uldaq/releases/download/v${ULDAQ}/libuldaq-${ULDAQ}.tar.bz2
tar -xvjf libuldaq-${ULDAQ}.tar.bz2
rm -f libuldaq-${ULDAQ}.tar.bz2
cd libuldaq-${ULDAQ}
./configure --prefix=${PWD}
make
make install || true
echo "USR_LDFLAGS+=-L${PWD}/lib" >> ../configure/CONFIG_SITE.local
echo "USR_CPPFLAGS+=-I${PWD}/include" >> ../configure/CONFIG_SITE.local
cd ..
fi
if [ ${HAVE_HIDAPI} == "NO" ]
then
cd configure
sed -i 's/HAVE_HIDAPI=YES/HAVE_HIDAPI=NO/g' ./CONFIG_SITE*
cd ..
fi
cd ..
fi
if [[ $MOTOR ]]
then
cd motor-$MOTOR
git submodule init
git submodule update
cd ..
fi
if [[ $OPCUA ]]
then
if [[ UASDK ]]
then
get_repo epics-modules opcua OPCUA $OPCUA
cd opcua-${OPCUA//./-}
sed -i s:'GTEST =':'#GTEST =':g ./configure/RELEASE
sed -i s:'#USR_CXXFLAGS_Linux':'USR_CXXFLAGS_Linux':g ./configure/CONFIG_SITE
sed -i s:'#CROSS_COMPILER_TARGET_ARCHS.*':'CROSS_COMPILER_TARGET_ARCHS = ':g ./configure/CONFIG_SITE
echo "EPICS_BASE=${EPICS_BASE}" >> RELEASE.local
echo "UASDK=${UASDK}" >> CONFIG_SITE.local
cd ..
fi
fi
if [[ $STREAM ]]
then
cd StreamDevice-${STREAM//./-}
# Use the EPICS makefile, rather than PSI's
rm GNUmakefile
# Comment out PCRE
sed -i 's/PCRE=/#PCRE=/g' ./configure/RELEASE
if [[ $SNCSEQ ]]
then
echo "SNCSEQ=" >> ./configure/RELEASE
fi
echo "SSCAN=" >> ./configure/RELEASE
echo "STREAM=" >> ./configure/RELEASE
cd ..
fi
# Using mdavidsaver's mirror
#if [[ $SNCSEQ ]]
#then
#
# seq
# wget http://www-csr.bessy.de/control/SoftDist/sequencer/releases/seq-$SNCSEQ.tar.gz
# tar zxf seq-$SNCSEQ.tar.gz
#
# The synApps build can't handle '.'
# mv seq-$SNCSEQ seq-${SNCSEQ//./-}
# rm -f seq-$SNCSEQ.tar.gz
# echo "SNCSEQ=\$(SUPPORT)/seq-${SNCSEQ//./-}" >> ./configure/RELEASE
#fi
make release