-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathsetup.sh
112 lines (97 loc) · 2.55 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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
## Adapted from Jon Olmsted's setup at Princeton
## https://github.com/olmjo/tigress-scripts/blob/master/setup/setup.sh
#!/bin/bash
. /etc/profile.d/modules.sh
##
## Functions
##
useVer() {
echo -e "* Using $1 version $2."
}
ansYN() {
echo -e "Please answer yes or no."
}
## Banner ============================================================
echo -e "------------------------------"
echo -e "ENGAGING Setup for R-based HPC"
echo -e "------------------------------"
echo -e ""
## ===================================================================
## ===================================================================
## Set Vars 1
LOCATION=$(hostname)
RMPIVERS=0.6-3
## ===================================================================
## Set Vars 2
export OMPIVERS=1.8.3
## We can set this up to use different version of OpenMPI for different
## servers
## ===================================================================
## Disclose Version
echo ""
useVer OpenMPI ${OMPIVERS}
useVer Rmpi ${RMPIVERS}
echo ""
## ===================================================================
while true; do
read -p "\
@ Do you need to update and add modules to .bashrc? (Select Yes for first time users)
[y/n]" yn
case $yn in
[Yy]* )
echo -e "\nmodule use /cm/shared/modulefiles/engaging" >> ~/.bashrc
echo -e "module add R/3.1.1" >> ~/.bashrc
echo -e "module add openmpi/1.8.3" >> ~/.bashrc
mkdir ~/R_LIBS
echo -e "\nexport R_LIBS=~/R_LIBS/ " >> ~/.bashrc
source ~/.bashrc
break;;
[Nn]* ) break;;
* ) ansYN ;;
esac
done
echo ""
while true; do
read -p "\
@ Do you need to download Rmpi?
[y/n]" yn
case $yn in
[Yy]* )
mkdir ~/R_LIBS
wget http://www.stats.uwo.ca/faculty/yu/Rmpi/download/linux/Rmpi_${RMPIVERS}.tar.gz -O rmpi.tar.gz -P ~/R_LIBS;
break;;
[Nn]* ) break;;
* ) ansYN ;;
esac
done
echo ""
while true; do
read -p "\
@ Do you need to install Rmpi?
[y/n]" yn
case $yn in
[Yy]* )
source ~/.bashrc
R CMD INSTALL -l ~/R_LIBS rmpi.tar.gz --configure-args=--with-mpi=/cm/shared/engaging/openmpi/${OMPIVERS}
break;;
[Nn]* )
break;;
* ) ansYN ;;
esac
done
echo ""
while true; do
read -p "\
@ Do you need to install misc. HPC R packages?
[y/n]" yn
case $yn in
[Yy]* )
source ~/.bashrc
Rscript install_misc.R;
break;;
[Nn]* )
break;;
* ) ansYN ;;
esac
done
echo ""