/
build.sh
executable file
·37 lines (33 loc) · 937 Bytes
/
build.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
#!/bin/bash
if [ "$#" -ne 1 ]; then
echo "Usage: ./build.sh [project-name]"
echo "e.g. ./build.sh eplus"
exit
fi
if [ ! -d "runs" ]; then
mkdir runs
fi
if [ ! -d "runs/$1" ]; then
mkdir runs/$1
fi
if [ ! -d "project-build/$1" ]; then
mkdir project-build/$1
fi
cd project-build/$1
cmake -DGEANT4_BUILD_MULTITHREADED=ON -DGeant4_DIR=/usr/local/geant4.10.00.p01/lib64/Geant4-10.0.0 -DHEPMC_INCLUDE_DIR=../../madgraph/hepmcbuild/include/ -DHEPMC_LIBRARIES=../../madgraph/hepmcbuild/lib/libHepMC.so ../../$1
make clean
make -j`grep -c ^processor /proc/cpuinfo`
cd ../../$1
OUTPUT=$(basename $(find -maxdepth 1 -iname "*.cc") .cc)
cd ../project-build/$1
./$OUTPUT
folderpath=$(date +%Y:%m:%d#%H:%M:%S)
mkdir ../../runs/$1/$folderpath
mv *.root ../../runs/$1/$folderpath
rm -rf *.root
cd ../../runs/$1/$folderpath
hadd complete.root *.root
mkdir threadfiles
mv *.root threadfiles
cd threadfiles
mv complete.root ../