forked from BioDynaMo/biodynamo
-
Notifications
You must be signed in to change notification settings - Fork 0
/
prerequisites.sh
executable file
·79 lines (64 loc) · 2.33 KB
/
prerequisites.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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
#!/bin/bash
# -----------------------------------------------------------------------------
#
# Copyright (C) 2021 CERN & University of Surrey for the benefit of the
# BioDynaMo collaboration. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
#
# See the LICENSE file distributed with this work for details.
# See the NOTICE file distributed with this work for additional information
# regarding copyright ownership.
#
# -----------------------------------------------------------------------------
# This script installs the prerequisites of BioDynaMo, but not BioDynaMo
# itself.
# Arguments:
# $1 type of install (all or just required)
# $2 operating system
#
# To install without a prompt set the following envar: SILENT_INSTALL=1
set -e
if [ $# -ge 3 ] || [ $# -le 0 ] || \
[ $1 == "--help" ] || [ $1 == "-h" ]; then
echo "
Description:
This script installs the prerequisites for BioDynaMo,
but not BioDynaMo itself.
Usage:
./prerequisites.sh <type> [<os>]
<type> It refers to the type of prerequistes that it is possible to
install. You can specify two options:
- required: install only the packages needed to build/run BioDynaMo
- all: install all the packages (required and optional)
<os> Specify which OS we are targeting (optional and expert only)
"
exit 1
fi
BDM_PROJECT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
# Include util functions
. $BDM_PROJECT_DIR/util/installation/common/util.sh
# Detect the OS
if [ -z $2 ]; then
BDM_DETECTED_OS=$(DetectOs)
else
BDM_DETECTED_OS=$2
fi
# Check if the OS the user provided is supported by the current
# version of BioDynaMo.
CheckOsSupported $BDM_PROJECT_DIR/util/installation ${BDM_DETECTED_OS}
# Check if the required install procedure is available
CheckTypeInstallSupported $1
# Compile the list of packages that will be installed
CompileListOfPackages $1 $BDM_PROJECT_DIR/util/installation ${BDM_DETECTED_OS}
EchoInfo "This script installs the following packages with sudo:"
EchoInfo ""
column ${BDM_PKG_LIST}
EchoInfo ""
if [ -z $SILENT_INSTALL ] && [ -z $GITHUB_ACTIONS ]; then
WaitForUser
fi
EchoInfo "Installing prerequisites..."
# Call install script for the detected OS
CallOSSpecificScript $BDM_PROJECT_DIR prerequisites.sh $1