-
Notifications
You must be signed in to change notification settings - Fork 3
/
GetToolDAQ.sh
executable file
·223 lines (174 loc) · 4.34 KB
/
GetToolDAQ.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
#!/bin/bash
init=1
tooldaq=1
boostflag=1
zmq=1
final=1
rootflag=0
setup=0
threads=`nproc --all`
while [ ! $# -eq 0 ]
do
case "$1" in
--help | -h)
echo "This script should be run once after initially cloning the ToolApplication repository. It retrieves the ToolFrameworkCore TooDAQFramework ZMQ and BOOST repositories that provides the core framework and dependancies on which your application will be built."
exit
;;
--with_root | -r)
echo "Installing ToolDAQ with root"
rootflag=1
;;
--no_boost | -b)
echo "Installing ToolDAQ without boost"
boostflag=0
;;
--no_init )
echo "Installing ToolDAQ without creating ToolDAQ Folder"
init=0;
;;
--no_zmq )
echo "Installing ToolDAQ without zmq"
zmq=0
;;
--no_tooldaq )
echo "Installing dependancies without ToolDAQ"
tooldaq=0
;;
--no_final )
echo "Installing ToolDAQ without compiling ToolAnalysis"
final=0
;;
--ToolDAQ_ZMQ )
echo "Installing ToolDAQ & ZMQ"
boostflag=0
rootflag=0
final=0
;;
--Boost )
echo "Installing Boost"
init=0
tooldaq=0
zmq=0
final=0
rootflag=0
;;
--Root )
echo "Installing Root"
init=0
tooldaq=0
boostflag=0
zmq=0
final=0
rootflag=1
;;
--Final )
echo "Compiling ToolDAQ"
init=0
tooldaq=0
boostflag=0
rootflag=0
zmq=0
;;
esac
shift
done
if [ $init -eq 1 ]
then
mkdir Dependencies
fi
cd Dependencies
if [ $tooldaq -eq 1 ]
then
git clone https://github.com/ToolFramework/ToolFrameworkCore.git
cd ToolFrameworkCore
make clean
make -j $threads
export LD_LIBRARY_PATH=`pwd`/lib:$LD_LIBRARY_PATH
cd ../
fi
if [ $zmq -eq 1 ]
then
git clone https://github.com/ToolDAQ/zeromq-4.0.7.git
cd zeromq-4.0.7
./configure --prefix=`pwd`
make -j $threads
make install
export LD_LIBRARY_PATH=`pwd`/lib:$LD_LIBRARY_PATH
cd ../
fi
if [ $boostflag -eq 1 ]
then
git clone https://github.com/ToolDAQ/boost_1_66_0.git
cd boost_1_66_0
rm -rf INSTALL
mkdir install
./bootstrap.sh --prefix=`pwd`/install/ > /dev/null 2>/dev/null
./b2 install iostreams -j $threads
export LD_LIBRARY_PATH=`pwd`/install/lib:$LD_LIBRARY_PATH
cd ../
fi
if [ $rootflag -eq 1 ]
then
wget https://root.cern.ch/download/root_v5.34.34.source.tar.gz
tar zxvf root_v5.34.34.source.tar.gz
rm -rf root_v5.34.34.source.tar.gz
cd root
./configure --enable-rpath
make -j $threads
make install
source ./bin/thisroot.sh
cd ../
fi
if [ $libpqxx -eq 1 ]; then
mkdir -p pqxx/install
cd pqxx
# TODO put this on github
cp /home/moflaher/libpqxx-6.4.5_fixed.tar.gz ./
tar -zxf libpqxx-6.4.5_fixed.tar.gz
rm libpqxx-6.4.5_fixed.tar.gz
cd libpqxx-6.4.5/
export PKG_CONFIG_PATH=/usr/pgsql-12/lib/pkgconfig:$PKG_CONFIG_PATH
export PATH=/usr/pgsql-12/bin:$PATH
./configure --disable-documentation --enable-shared --prefix=$PWD/../install
make
make install
cd ../..
fi
if [ $tooldaq -eq 1 ]
then
git clone https://github.com/ToolDAQ/ToolDAQFramework.git
cd ToolDAQFramework
make clean
make -j $threads
export LD_LIBRARY_PATH=`pwd`/lib:$LD_LIBRARY_PATH
cd ../
fi
cd ../
if [ $final -eq 1 ]
then
echo "current directory"
echo `pwd`
if [ $setup -eq 1 ]
then
cp -r ./Dependencies/ToolFrameworkCore/DataModel/* ./DataModel
cp -r ./Dependencies/ToolDAQFramework/DataModel/* ./DataModel
cp -r ./Dependencies/ToolFrameworkCore/UserTools/* ./UserTools
cp -r ./Dependencies/ToolDAQFramework/UserTools/template/* ./UserTools/template
cp -r ./Dependencies/ToolDAQFramework/configfiles/* ./configfiles
mkdir src
cp -r ./Dependencies/ToolDAQFramework/src/main.cpp ./src/
cp ./Dependencies/ToolDAQFramework/Application/* ./
git add DataModel/*
git add UserTools/*
git add configfiles/*
git add ./Makefile
git add ./CMakeLists.txt
git add ./Setup.sh
git add ./src/main.cpp
rm -f ./GetToolFramework.sh
sed -i 's/setup=0/setup=0/' ./GetToolDAQ.sh
fi
make clean
make -j $threads
export LD_LIBRARY_PATH=`pwd`/lib:$LD_LIBRARY_PATH
fi