-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsetup_deps.sh
73 lines (60 loc) · 2.85 KB
/
setup_deps.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
#!/usr/bin/env bash
a4md_root=$(pwd)
# Options of mac, linux86, linuxP9
os_for_conda="${user_os:="linux86"}"
rm -rf log.*
# Introduction
echo "Hello! Thank you for downloading A4MD."
echo
echo "Before we can start installing the software, we'll need to determine which packages you'll need."
# Verify user has ssh setup
while true; do
read -p "Do you have an ssh key pair set up in github? (yes/no) " user_has_ssh
case ${user_has_ssh} in
[yY] | [yY][eE][sS] ) has_ssh_key="yes"; break ;;
[nN] | [nN][oO] ) echo "You will need to set up an ssh key with github prior to installation."
echo "Please review instructions for how to do so at https://docs.github.com/en/github/authenticating-to-github/generating-a-new-ssh-key-and-adding-it-to-the-ssh-agent"
exit ;;
* ) echo "Please respond with either yes or no: " ;;
esac
done
# Set up for Environment (C Compiler, OS, and MPI)
while true; do
read -p "Do you already have a c compiler installed? (yes/no) " user_has_comp
case ${user_has_comp} in
[yY] | [yY][eE][sS] ) has_c_comp="yes"; break ;;
[nN] | [nN][oO] ) has_c_comp="no"
echo "Please install a version of gcc before continuing"
exit ;;
* ) echo "Please respond with either yes or no: " ;;
esac
done
# Set up for Package Management
while true; do
read -p "Do you already have the Spack package manager installed? (yes/no) " user_has_spack
case ${user_has_spack} in
[yY] | [yY][eE][sS] ) has_spack="yes"; break ;;
[nN] | [nN][oO] ) echo "You will need to install Spack prior to installation."
echo "Please review instructions for spack installation at https://spack.readthedocs.io/en/latest/getting_started.html"
break ;;
* ) echo "Please respond with either yes or no: " ;;
esac
done
read -p "Please provide a name for a project spack environment. It can be anything. (Press enter for default a4md_spack_env) " user_spack_name
while true; do
read -p "Do you already have the Conda package manager installed? (yes/no) " user_has_conda
case ${user_has_conda} in
[yY] | [yY][eE][sS] ) has_conda="yes"; break ;;
[nN] | [nN][oO] ) echo "You will need to set up use of Anaconda prior to installation."
echo "Please review instructions for how to do so at https://conda.io/projects/conda/en/latest/user-guide/install/index.html"
break ;;
#[nN] | [nN][oO] ) has_conda="no"; read -p "Where would you like to install Conda? (Press enter for your home directory.) " user_conda; break ;;
* ) echo "Please respond with either yes or no: " ;;
esac
done
mpi_name="${user_mpi_name:="mpich"}"
# Can be anything
spack_env_name="${user_spack_name:="a4md_spack_env"}"
cd install
. ./install_a4md_deps.sh ${mpi_name} ${os_for_conda} ${spack_env_name} ${user_has_spack} ${user_has_conda} ${has_c_comp} ${has_ssh_key} ${a4md_root}
cd ..