forked from Argonne-National-Laboratory/ProMC
-
Notifications
You must be signed in to change notification settings - Fork 0
/
proto.sh
executable file
·227 lines (188 loc) · 6.61 KB
/
proto.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
#!/bin/bash
#
# Configuration script, to be run before compilation
#
# S.Chekanov
CURRENT_DIR=`pwd`
# specify compilers here (do not change this part!)
source $CURRENT_DIR/cbook/config.sh
protocxx=$CURRENT_DIR/share/bin/protoc
chmod 755 $protocxx
echo "Generating proto files.."
export PROTOBUF=$CURRENT_DIR/share
export LD_LIBRARY_PATH=$PROTOBUF/lib:$LD_LIBRARY_PATH
export PATH=$PROTOBUF/bin:$PATH
export PKG_CONFIG_PATH=$PROTOBUF/lib/pkgconfig:$PKG_CONFIG_PATH
echo "######## ProMC #######"
PRFILE="ProMC"
echo "Process $PRFILE file for MC data"
rm -f $PRFILE.proto
ln -s proto/promc/$PRFILE.proto .
$protocxx --cpp_out=src $PRFILE.proto # for backward compatibility
$protocxx --cpp_out=src/promc $PRFILE.proto # for release 1.5
$protocxx --java_out=java/src $PRFILE.proto
$protocxx --python_out=src $PRFILE.proto
$protocxx --python_out=src/promc $PRFILE.proto # for release 1.5
cp -f src/*.h inc/
rm -f $PRFILE.proto
echo "ProNLO: $PRFILE file for NLO data"
ln -s proto/pronlo/$PRFILE.proto .
$protocxx --java_out=java/src $PRFILE.proto
$protocxx --cpp_out=src/pronlo $PRFILE.proto # for release 1.5
$protocxx --python_out=src/pronlo $PRFILE.proto # for release 1.5
rm -f $PRFILE.proto
echo "ProReco: $PRFILE file for Reconstructed data"
ln -s proto/proreco/$PRFILE.proto .
$protocxx --java_out=java/src $PRFILE.proto
$protocxx --cpp_out=src/proreco $PRFILE.proto # for release 1.5
$protocxx --python_out=src/proreco $PRFILE.proto # for release 1.5
rm -f $PRFILE.proto
echo "######## ProMCDescription #######"
PRFILE="ProMCDescription"
echo "Process $PRFILE proto file for MC data"
ln -s proto/promc/$PRFILE.proto .
$protocxx --cpp_out=src $PRFILE.proto # for backward compatibility
$protocxx --cpp_out=src/promc $PRFILE.proto # for release 1.5
$protocxx --java_out=java/src $PRFILE.proto
$protocxx --python_out=src $PRFILE.proto
$protocxx --python_out=src/promc $PRFILE.proto
cp -f src/*.h inc/
rm -f $PRFILE.proto
echo "ProNLO: $PRFILE for NLO data"
ln -s proto/pronlo/$PRFILE.proto .
$protocxx --java_out=java/src $PRFILE.proto
$protocxx --cpp_out=src/pronlo $PRFILE.proto # for release 1.5
$protocxx --python_out=src/pronlo $PRFILE.proto # for release 1.5
rm -f $PRFILE.proto
echo "ProReco: $PRFILE for Reco data"
ln -s proto/proreco/$PRFILE.proto .
$protocxx --java_out=java/src $PRFILE.proto
$protocxx --cpp_out=src/proreco $PRFILE.proto # for release 1.5
$protocxx --python_out=src/proreco $PRFILE.proto # for release 1.5
rm -f $PRFILE.proto
echo "###### ProMCHeader ######"
PRFILE="ProMCHeader"
echo "Process $PRFILE proto file for MC data"
ln -s proto/promc/$PRFILE.proto .
$protocxx --cpp_out=src $PRFILE.proto # for backward compatibility
$protocxx --cpp_out=src/promc $PRFILE.proto # for release 1.5
$protocxx --java_out=java/src $PRFILE.proto
$protocxx --python_out=src $PRFILE.proto
$protocxx --python_out=src/promc $PRFILE.proto # for release 1.5
cp -f src/*.h inc/
rm -f $PRFILE.proto
echo "ProNLO: $PRFILE for NLO data"
ln -s proto/pronlo/$PRFILE.proto .
$protocxx --java_out=java/src $PRFILE.proto
$protocxx --cpp_out=src/pronlo $PRFILE.proto # for release 1.5
$protocxx --python_out=src/pronlo $PRFILE.proto
rm -f $PRFILE.proto
echo "ProNLO: $PRFILE for Reco data"
ln -s proto/proreco/$PRFILE.proto .
$protocxx --java_out=java/src $PRFILE.proto
$protocxx --cpp_out=src/proreco $PRFILE.proto # for release 1.5
$protocxx --python_out=src/proreco $PRFILE.proto
rm -f $PRFILE.proto
echo "##### ProMCStat ######"
PRFILE="ProMCStat"
echo "Process $PRFILE proto file"
ln -s proto/promc/$PRFILE.proto .
$protocxx --cpp_out=src $PRFILE.proto # for backward compatibility
$protocxx --cpp_out=src/promc $PRFILE.proto # for release 1.5
$protocxx --java_out=java/src $PRFILE.proto
$protocxx --python_out=src $PRFILE.proto
$protocxx --python_out=src/promc $PRFILE.proto
cp -f src/*.h inc/
rm -f $PRFILE.proto
echo "ProNLO: $PRFILE for NLO data"
ln -s proto/pronlo/$PRFILE.proto .
$protocxx --cpp_out=src/pronlo $PRFILE.proto # for release 1.5
$protocxx --java_out=java/src $PRFILE.proto
$protocxx --python_out=src/pronlo $PRFILE.proto
rm -f $PRFILE.proto
echo "ProNLO: $PRFILE for Reco data"
ln -s proto/proreco/$PRFILE.proto .
$protocxx --java_out=java/src $PRFILE.proto
$protocxx --cpp_out=src/proreco $PRFILE.proto # for release 1.5
$protocxx --python_out=src/proreco $PRFILE.proto
rm -f $PRFILE.proto
echo "#### AUX functions ####"
PRFILE="HEvent"
echo "Process $PRFILE proto file"
ln -s proto/cbook/$PRFILE.proto .
$protocxx --cpp_out=src $PRFILE.proto
$protocxx --java_out=java/src $PRFILE.proto
$protocxx --python_out=src $PRFILE.proto
cp -f src/*.h inc/
cp src/$PRFILE.pb.cc cbook/src/HRecord/$PRFILE.pb.cc
cp src/$PRFILE.pb.h cbook/inc/CBook/
rm -f $PRFILE.proto
PRFILE="HRecord"
echo "Process $PRFILE proto file"
ln -s proto/cbook/$PRFILE.proto .
$protocxx --cpp_out=src $PRFILE.proto
$protocxx --java_out=java/src $PRFILE.proto
$protocxx --python_out=src $PRFILE.proto
cp -f src/*.h inc/
cp src/$PRFILE.pb.cc cbook/src/HRecord/$PRFILE.pb.cc
cp src/$PRFILE.pb.h cbook/inc/CBook/
rm -f $PRFILE.proto
echo "### proto/ProMCBook.* and compile libraries for each case"
cp -f proto/ProMCBook.* src/
cp -f proto/ProMCBook.* src/promc/
cp -f proto/ProMCBook.* src/proreco/
cp -f proto/ProMCBook.* src/pronlo/
PROMC_LIB="-L./share/lib -lprotoc -lprotobuf -lprotobuf-lite -lcbook -lz"
INCLUD1=-I./share/include
INCLUD2=-I./cbook/inc
INCLUD3=-I./cbook/src
INCLUD4=-I./cbook/share/lib/libzip/include
echo "--> Build ProMC library.."
AR_LIB=share/lib/libpromc.a
XDIR=./src/promc
for f in $XDIR/*.cc
do
echo "Compiling $f.."
obj=${f%.cc}.o
$CXX $CPP_FLAGS -c $f -o $obj $INCLUD1 $INCLUD2 $INCLUD3 $INCLUD4
$AR rcs $AR_LIB $obj
done
if [ ! -e "$AR_LIB" ]; then
echo "Error! File $AR_LIB does not exist!!!"
else
chmod 755 $AR_LIB
echo "$AR_LIB was build"
fi
echo "--> Build ProNLO library.."
AR_LIB=share/lib/libpronlo.a
XDIR=./src/pronlo
for f in $XDIR/*.cc
do
echo "Compiling $f.."
obj=${f%.cc}.o
$CXX $CPP_FLAGS -c $f -o $obj $INCLUD1 $INCLUD2 $INCLUD3 $INCLUD4
$AR rcs $AR_LIB $obj
done
if [ ! -e "$AR_LIB" ]; then
echo "Error! File $AR_LIB does not exist!!!"
else
chmod 755 $AR_LIB
echo "$AR_LIB was build"
fi
echo "--> Build ProReco library.."
AR_LIB=share/lib/libproreco.a
XDIR=./src/proreco
for f in $XDIR/*.cc
do
echo "Compiling $f.."
obj=${f%.cc}.o
$CXX $CPP_FLAGS -c $f -o $obj $INCLUD1 $INCLUD2 $INCLUD3 $INCLUD4
$AR rcs $AR_LIB $obj
done
if [ ! -e "$AR_LIB" ]; then
echo "Error! File $AR_LIB does not exist!!!"
else
chmod 755 $AR_LIB
echo "$AR_LIB was build"
fi
echo "--> Done !"