-
Notifications
You must be signed in to change notification settings - Fork 1
/
ubuntu-nuclear-software-installer.bash
67 lines (56 loc) · 1.56 KB
/
ubuntu-nuclear-software-installer.bash
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
61
62
63
64
65
66
67
# Stop the scripts if anything goes wrong
set -e
# Get conda working in non-interactive shell
CONDA_PATH=$(conda info | grep -i 'base environment' | awk '{print $4}')
source $CONDA_PATH/etc/profile.d/conda.sh
# Get # threads
N_THREADS=$(($(cat /proc/cpuinfo | grep processor | wc -l)-1))
if [[ $N_THREADS -le 0 ]]
then
N_THREADS=1
fi
# Paths
CURRENT=`pwd`
CODENAME=$1
COREPATH=$CURRENT/$CODENAME
BRC=$HOME/.bashrc
PROJECTS=$HOME/projects
XSDIR=$PROJECTS/cross-section-libraries
CODEPATH=$PROJECTS/$CODENAME
# Make projects directory
if [[ ! -d "$PROJECTS" ]]; then
mkdir $PROJECTS
fi
# Make cross section data directory
if [[ ! -d $XSDIR ]]
then
mkdir $XSDIR
fi
# Step 0: Get parameters for running the install, build, and test scripts
source $CODENAME/get-params.bash
if [[ "$2" == "--clean" || ! -d $CODEPATH ]]; then
if [[ $CODENAME != "serpent" ]]
then
# Step 1: install software, build tools, and all dependencies
echo "Installing $CODENAME"
source install.bash
if [[ $CODENAME != "dagmc" ]]
then
# Step 2: setup conda environments
echo "Creating environment for $CODENAME"
source env.bash
fi
else
echo "Setting up closed-source software files"
source $CODENAME/install-extra.bash
fi
# Step 3: build software from source
echo "Building $CODENAME"
source $CODENAME/build.bash
fi
# Step 4: test that software works
echo "Testing $CODENAME"
if [[ -f $CODENAME/pretest.bash ]]; then
source $CODENAME/pretest.bash
fi
source $CODENAME/test.bash