-
Notifications
You must be signed in to change notification settings - Fork 5
/
install.sh
154 lines (117 loc) · 3.85 KB
/
install.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
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
#!/bin/bash
####################################################################################
#
# This script installs Anaconda and Arachnid in your current working directory.
#
# $ sh install.sh
#
# The default install is the latest stable version of Arachnid.
#
# If you wish the latest accelerated version (a premium package
# free for Academic use) then use the following command:
#
# $ sh install.sh mkl
#
# If you wish the latest daily build, then using this command:
#
# $ sh install.sh dev
#
# If you wish the latest accelerated daily build, then use this command:
#
# $ sh install.sh dev-mkl
#
####################################################################################
##############################
# Handle command line options
##############################
suffix=""
if [ "$1" != "" ] ; then
if [ "$1" == "-h" ] || [ "$1" == "--help" ] || [ "$1" == "-help" ] ; then
head -23 $0
exit 0
fi
if [ "$1" != "mkl" ] && [ "$1" != "dev" ] && [ "$1" != "dev-mkl" ] ; then
echo "Error: unrecognized option $1"
echo "Only mkl, dev, dev-mkl and empty string supported"
echo "sh install -h for more information"
exit 1
fi
suffix="-${1}"
fi
##############################
# Test if Anaconda exists
##############################
which conda
if [ $? -eq 0 ] ; then
echo "You already have anaconda installed"
echo "You can use the following command to install Arachnid"
echo "conda install -c https://conda.binstar.org/ezralanglois arachnid${suffix} --yes"
exit 1
fi
##############################
# Download Miniconda installer
##############################
wget http://repo.continuum.io/miniconda/Miniconda-3.0.0-Linux-x86_64.sh
if [ $? -ne 0 ] ; then
echo "Failed to download Anaconda"
exit 1
fi
##############################
# Install in local directory
##############################
sh Miniconda-3.0.0-Linux-x86_64.sh -b -p $PWD/anaconda
if [ $? -ne 0 ] ; then
echo "Failed to install Anaconda"
exit 1
fi
##############################
# Remove installer
##############################
rm -f Miniconda-3.0.0-Linux-x86_64.sh
##############################
# Place Anaconda on the PATH for the duration of the script
##############################
export PATH=$PWD/anaconda/bin:$PATH
##############################
# Test if $HOME/.condarc exists
##############################
if [ ! -e $HOME/.condarc ] ; then
##############################
# If not, create one
##############################
echo "No $HOME/.condarc found, creating one ... "
echo "channels:" > $HOME/.condarc
echo " - http://repo.continuum.io/pkgs/pro" >> $HOME/.condarc
echo " - http://repo.continuum.io/pkgs/free" >> $HOME/.condarc
echo " - http://repo.continuum.io/pkgs/gpl" >> $HOME/.condarc
echo " - https://conda.binstar.org/ezralanglois" >> $HOME/.condarc
##############################
# Install Arachnid
##############################
conda install arachnid
echo "You will now be able to update arachnid with: conda update arachnid"
else
##############################
# If so, skipping creating one
##############################
echo "Found $HOME/.condarc found"
##############################
# Install Arachnid
##############################
# Install arachnid
conda install -c https://conda.binstar.org/ezralanglois arachnid${suffix} --yes
echo "Please ensure https://conda.binstar.org/ezralanglois is in your $HOME/.condarc"
echo "Then you will be able to update with: conda update arachnid"
fi
###################################
# Test if shell is other than bash
###################################
shell=`basename $SHELL`
if [ "$shell" != "bash" ]; then
echo "Assuming you have CSH or TCSH"
echo "Appending $PWD/anaconda/bin to PATH"
echo "setenv PATH \"$PWD/anaconda/bin:\$PATH\"" >> $HOME/.${shell}rc
fi
if [ $suffix == "" ] || [ $suffix == "mkl" ] ; then
echo "If you have not already done so, please install SPIDER - http://spider.wadsworth.org/spider_doc/spider/docs/spi-register.html"
fi