-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcompile_root
executable file
·50 lines (36 loc) · 1014 Bytes
/
compile_root
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
#!/bin/bash
TMP_FILE="/tmp/compile_root_tmp.C"
if [ "$#" == 0 ]; then
echo usage: ./$0 file.C
exit
fi
echo "{
#if __x86_64__
gROOT->ProcessLine(\"cout<<\\\" ------------------ 64 BIT SYSTEM \\\"<<endl\");
// gSystem->Load(\"/lib/x86_64-linux-gnu/libdl.so.2\");
// gSystem->Load(\"/lib/libdl.so\");
gSystem->Load(\"/lib/x86_64-linux-gnu/libdl-2.19.so\");
#else
gROOT->ProcessLine(\"cout<<\\\"-------------------- 32 BIT SYSTEM \\\"<<endl\");
gSystem->Load(\"/usr/lib/libdl.so\");
#endif
" > $TMP_FILE
if [ "$#" == 1 ]; then
CFILE=$1
echo "gROOT->ProcessLine(\".L ${CFILE}++\");" >> $TMP_FILE
fi
if [ "$#" -gt 1 ]; then
echo number of parameters == $#
for i ; do
echo "gROOT->ProcessLine(\".L ${i}+\");" >> $TMP_FILE
done
fi
echo "
gROOT->ProcessLine(\".! echo ABRUPT QUIT NOW ... 'make' should respond with error 6\");
gROOT->ProcessLine(\".qqqqqqq\");
}
" >> $TMP_FILE
cat $TMP_FILE
echo .............compile................
root -n -b -q $TMP_FILE
exit $?