-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetup_instance_mxnet.sh
More file actions
executable file
·103 lines (85 loc) · 4.21 KB
/
setup_instance_mxnet.sh
File metadata and controls
executable file
·103 lines (85 loc) · 4.21 KB
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
#!/bin/bash
# Debug(debug) mode setup: additionally installs python debug mode and valgrind
# over the normal Developer(dev) mode setup
# Python debug build is very slow and valgrid can introduce slowdowns upto 20x
# Hence do not setup Debug mode unless you need it !!
# Sync option installs unison on your machine for code sync
# you still need to configure it on your local PC for sync to work
## Types of setups possible with this script ##
# Developer mode w/o code sync run:
# $ bash setup_instance.sh dev
# Developer mode w/ code sync run:
# $ bash setup_instance.sh dev sync
# Debug mode w/o code sync run:
# $ bash setup_instance.sh debug
# Debug mode w/ code sync run:
# $ bash setup_instance.sh debug sync
##
## Author: access2rohit(srivastava.141@osu.edu)
##
set -eo pipefail
typeset -l $1
typeset -l $2
if [[ -z $1 ]]; then
echo "You must specify instance setup mode 'dev' or 'debug'"
return
elif [[ $1 == "debug" ]]; then
echo "Instance being setup in Debug mode"
else
echo "Instance being setup in Developer mode"
fi
sudo add-apt-repository ppa:jonathonf/vim -y
sudo apt update
sudo apt remove -y vim vim-runtime gvim
sudo apt install -y build-essential ninja-build cmake ccache htop stow zsh zlib1g-dev libffi-dev libssl-dev libbz2-dev libsqlite3-dev libreadline6-dev libjemalloc-dev libopenblas-dev libopencv-dev valgrind vim python3.9 python3.9-dev
sudo ln -s /usr/bin/python3.9 /usr/local/bin/python
sudo apt install python3.9-distutils
curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py
python get-pip.py
pip --no-cache-dir install pip --upgrade
pip
# install miniconda for python3.9
wget https://repo.anaconda.com/miniconda/Miniconda3-py39_23.1.0-1-Linux-x86_64.sh
bash Miniconda3-py39_23.1.0-1-Linux-x86_64.sh -b
# Removes conflictings openBLAS libraries and updates default BLAS to point to newly install openBLAS from previous step
sudo update-alternatives --remove-all liblapack.so-x86_64-linux-gnu
sudo update-alternatives --remove-all liblapack.so.3-x86_64-linux-gnu
sudo update-alternatives --install /usr/lib/x86_64-linux-gnu/libblas.so libblas.so-x86_64-linux-gnu /usr/local/lib/libopenblas.a 41 --slave /usr/lib/x86_64-linux-gnu/liblapack.so liblapack.so-x86_64-linux-gnu /usr/local/lib/libopenblas.so.0
sudo update-alternatives --install /usr/lib/x86_64-linux-gnu/libblas.so.3 libblas.so.3-x86_64-linux-gnu /usr/local/lib/libopenblas.so.0 41 --slave /usr/lib/x86_64-linux-gnu/liblapack.so.3 liblapack.so.3-x86_64-linux-gnu /usr/local/lib/libopenblas.so.0
mkdir -p ${HOME}/workspace
cd ${HOME}/workspace
git clone --recursive https://github.com/apache/incubator-mxnet.git
cp ${HOME}/workspace/incubator-mxnet/config/linux_gpu.cmake ${HOME}/workspace/incubator-mxnet/config.cmake
mkdir -p ${HOME}/temp
cd ${HOME}/temp
wget https://raw.githubusercontent.com/access2rohit/ConfigFiles/master/bashrc
wget https://raw.githubusercontent.com/access2rohit/ConfigFiles/master/gitconfig
wget https://raw.githubusercontent.com/access2rohit/ConfigFiles/master/screenrc
wget https://raw.githubusercontent.com/access2rohit/ConfigFiles/master/mxnet_config
wget https://raw.githubusercontent.com/access2rohit/ConfigFiles/master/vimrc
wget https://raw.githubusercontent.com/access2rohit/ConfigFiles/master/install_vundle.sh
wget https://raw.githubusercontent.com/access2rohit/ConfigFiles/master/install_cmake.sh
cat bashrc >> ${HOME}/.bashrc
cat gitconfig >> ${HOME}/.gitconfig
cat screenrc >> ${HOME}/.screenrc
cat vimrc >> ${HOME}/.vimrc
cat mxnet_config > ${HOME}/workspace/incubator-mxnet/.git/config
# Install unison if setup needs code sync
if [[ $2 == "sync" ]]; then
echo "Installing unison for code sync"
wget https://raw.githubusercontent.com/access2rohit/ConfigFiles/master/install_ocaml_unison.sh
bash install_ocaml_unison.sh
fi
bash install_vundle.sh
bash install_cmake.sh
# Install debug tools if instance setup mode is "Debug"
typeset -l $1
if [[ $1 == "debug" ]]; then
wget https://raw.githubusercontent.com/access2rohit/ConfigFiles/master/install_python_debug.sh
wget https://raw.githubusercontent.com/access2rohit/ConfigFiles/master/install_valgrind.sh
bash install_python_debug.sh
bash install_valgrind.sh
fi
cd ${HOME}
sudo rm -rf ${HOME}/temp
echo "SUCCESS! Either 'source ~/.bashrc' or logout and login again for changes to take effect"