-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild-root
More file actions
executable file
·40 lines (32 loc) · 852 Bytes
/
build-root
File metadata and controls
executable file
·40 lines (32 loc) · 852 Bytes
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
#!/bin/bash
modulefile=/etc/modulefiles/root/root-git
sourceDir=${HOME}/programs/root/repo
echo "Pulling update from git repository"
cd $sourceDir
git pull origin master --tags
tag=`git describe --always --tag`
cd -
buildDir=/tmp/root-build
installDir=/opt/root/$tag
echo "Removing Previous Installation..."
rm -rf $installDir
if [ -d $buildDir ]
then
echo "Removing previous build"
rm -r $buildDir
fi
mkdir $buildDir
cd $buildDir
cmake3 $sourceDir \
-DCMAKE_INSTALL_PREFIX=$installDir \
-Droofit=ON \
-Dminuit2=ON \
-Dsoversion=ON \
-Dcxx11=ON \
-Dqt=ON \
-Dpython=ON \
&& make -j24 install \
&& rm -rf $buildDir
echo "Updating the modulefile at " $modulefile
awk -v t=$tag '{if($1 == "set" && $2 == "version") print $1,$2,t; else print $0}' $modulefile > /tmp/root-git
mv /tmp/root-git $modulefile