-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsetup.sh
60 lines (55 loc) · 1.77 KB
/
setup.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
#!/bin/bash
WORK_DIR=$(pwd)
cd Software
pwd > Software_Path.txt
echo "Welcome to the Pythia8 setup script!"
### Author: Luke Vaughan ###
echo "Would you like to download pythia source code? (Only for first-time setup)"
read -p "Please Respond [y|n]: " CHECK
if [[ "$CHECK" == "y" ]]; then
curl -O https://www.pythia.org/download/pythia83/pythia8312.tgz
tar xfz pythia8312.tgz
rm pythia8312.tgz
fi
echo "Would you like to compile pythia?"
read -p "Please Respond [y|n]: " CHECK
if [[ "$CHECK" == "y" ]]; then
cd pythia8312
export CC=gcc
export CXX=g++
./configure --with-python-config=python3-config | tee config.log
CHECK=$(cat config.log | awk 'END{print $3}')
if [[ "$CHECK" == *"PYTHON"* ]]
then
echo "Python3 has been sucessfully configured with Pythia!"
echo "How many cores would you like to use to compile Pythia?"
read -p "Please enter an integer: " CORES
make -j$CORES
else
echo "Python3 has not been configured with Pythia!"
echo "Please ask your neighbor for help..."
fi
cd ..
fi
echo "Would you like to setup python virtual env?"
read -p "Please Respond [y|n]: " CHECK
if [[ "$CHECK" == "y" ]]; then
python3 -m venv pythia_tutorial
if test -f ./pythia_tutorial/bin/activate; then
echo "File exists."
source ./pythia_tutorial/bin/activate
pip install --upgrade pip
pip install -r pip_requirements.txt
else
echo "Virtual Environment could not be created..."
fi
fi
echo "Would you like to run a jupyter notebook?"
read -p "Please Respond [y|n]: " CHECK
if [[ "$CHECK" == "y" ]]; then
ipython3 kernel install --user --name=pythia_tutorial
cd $WORK_DIR
jupyter notebook
fi
cd $WORK_DIR
echo "Setup Complete!"