-
Notifications
You must be signed in to change notification settings - Fork 1
/
bootstrap-eve.sh
executable file
·53 lines (42 loc) · 1.89 KB
/
bootstrap-eve.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
#!/usr/bin/env bash
# This script creates a virtual Python environment in ./python-env with all required libraries set up.
# To use it, call Python at ./python-env/bin/python.
# Test if everything is available
virtualenv --version >/dev/null 2>&1 || missing=$missing"[bootstrap.sh] Python virtualenv is required but it's not installed.\n"
gcc --version >/dev/null 2>&1 || missing=$missing"[bootstrap.sh] GCC is required but it's not installed.\n"
git --version >/dev/null 2>&1 || missing=$missing"[bootstrap.sh] GIT is required but it's not installed.\n"
# Report errors if any
if [[ -n "$missing" ]]; then
echo -e ${missing%\\n}
echo "[bootstrap.sh] Please install missing programs."
exit 1
fi
########################################################
# Create virtual python environment named 'python_env' #
########################################################
virtualenv python_env
################################
# Installation of NumPy on EVE #
################################
# Backup LDFLAGS and CPPFLAGS values
export LDFLAGS_BAK=$LDFLAGS && export CPPFLAGS_BAK=$CPPFLAGS
# unset environment variables
unset LDFLAGS && unset CPPFLAGS
# Install numpy
./python_env/bin/pip install numpy
# Reset LDFLAGS and CPPFLAGS values
export LDFLAGS=$LDFLAGS_BAK && export CPPFLAGS=$CPPFLAGS_BAK
# Remove backup variables
unset LDFLAGS_BAK && unset CPPFLAGS_BAK
##############################################
# Installation of PyYAML, psutil, BioPython #
##############################################
# Install required libraries (pyyaml,psutil,biopython) into the virtual python environemnt
./python_env/bin/pip install pyyaml psutil biopython
./python_env/bin/easy_install -f http://biopython.org/DIST/ biopython
##############################
# Installation of matplotlib #
##############################
# matplotlib requires freetype
module load freetype/2.5.5-1
./python_env/bin/pip install matplotlib