-
Notifications
You must be signed in to change notification settings - Fork 12
/
Copy pathfirst_build.sh
executable file
·51 lines (41 loc) · 1.55 KB
/
first_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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
#!/bin/bash
#ensure that we are in the script directory
pushd $(dirname "${BASH_SOURCE[0]}")
. ./bash/numcpus.sh
echo "---------------------------"
echo "---=====================---"
echo "---=== QPX INSTALLER ===---"
echo "---=====================---"
echo "---------------------------"
echo " "
echo "This script will install all necessary dependencies and compile qpx. It"
echo "has been tested on Ubuntu 18.04. At minimum, qpx requires boost and Qt5."
echo "You may be asked to enter your password for sudo access a few times for"
echo "installing required packages."
echo " "
read -n1 -rsp $'Press any key to continue or Ctrl+C to exit...\n'
git submodule init || exit 1
git submodule update || exit 1
sudo apt-get install -y cmake qt5-default libboost-all-dev || exit 1
echo "---¿¿¿ install ROOT ???---"
echo "qpx can do some experimental peak fitting using CERN's ROOT framework for nonlinear optimization."
echo "If you already have ROOT, you may not need to install it. If you don't intend to use qpx's"
echo "experimental peak fitting, then you may also not need this."
read -r -p "Do you want to install ROOT (6.12.06)? [Y/n]" getroot
getroot=${getroot,,} # tolower
if [[ $getroot =~ ^(yes|y| ) ]]; then
./bash/get-ROOT.sh 6-12-06
fi
./bash/config.sh
SOURCEDIR=./data/*
DESTDIR=$HOME/qpx
mkdir -p $DESTDIR
cp -ur $SOURCEDIR $DESTDIR
read -r -p "Build qpx now? [Y/n]" mkrelease
mkrelease=${mkrelease,,} # tolower
if [[ $mkrelease =~ ^(yes|y| ) ]]; then
mkdir -p build
cd build
cmake -DCMAKE_BUILD_TYPE=Release ../src || exit 1
make -j$NUMCPUS || exit 1
fi