forked from Sage-Bionetworks/mhealthx
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathsetup.sh
198 lines (177 loc) · 7.52 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
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
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
#!/bin/bash
#=============================================================================
# This script provides directions for installing mhealthx and dependencies
# (http://binarybottle.github.io/mhealthx/).
# Running it requires a good Internet connection.
# Tested on an Ubuntu 14.04 machine.
#
# Usage:
# bash setup.sh 1
#
# bash setup.sh <install_mhealthx> <install_dir>
# <install_mhealthx>: 1 or 0 (do/not install mhealthx)
# <install_dir>: path to installation directory (optional)
#
# Note:
# Third-party software not in the GitHub repository are on Synapse:
# https://www.synapse.org/Synapse:syn5584792
#
# Authors:
# - Arno Klein, 2015-2016 (arno@childmind.org) http://binarybottle.com
#
# Copyright 2016, Child Mind Institute (childmind.org), Apache v2.0 License
#=============================================================================
#-----------------------------------------------------------------------------
# Assign download and installation path.
# Create installation folder if it doesn't exist:
#-----------------------------------------------------------------------------
MHEALTHX=$1
INSTALLS=$2
if [ -z $MHEALTHX ]; then
MHEALTHX=1
fi
if [ -z $INSTALLS ]; then
INSTALLS=$HOME/install
fi
if [ ! -d $INSTALLS ]; then
mkdir -p $INSTALLS;
fi
export INSTALLS
export PATH=$INSTALLS/bin:$PATH
#-----------------------------------------------------------------------------
# System-wide dependencies:
#-----------------------------------------------------------------------------
sudo apt-get update
sudo apt-get install -y git
sudo apt-get install -y build-essential
#-----------------------------------------------------------------------------
# Anaconda's miniconda Python distribution for local installs:
#-----------------------------------------------------------------------------
CONDA_URL="http://repo.continuum.io/miniconda"
CONDA_FILE="Miniconda-latest-Linux-x86_64.sh"
CONDA_DL=$INSTALLS/${CONDA_FILE}
CONDA_PATH=$INSTALLS/miniconda2
CONDA=${CONDA_PATH}/bin
wget -O $CONDA_DL ${CONDA_URL}/$CONDA_FILE
chmod +x $CONDA_DL
# -b run install in batch mode (without manual intervention),
# it is expected the license terms are agreed upon
# -f no error if install prefix already exists
# -p PREFIX install prefix
bash $CONDA_DL -b -f -p $CONDA_PATH
export PATH=$CONDA:$PATH
#-----------------------------------------------------------------------------
# Additional resources for installing packages:
#-----------------------------------------------------------------------------
$CONDA/conda install --yes cmake pip
#-----------------------------------------------------------------------------
# Install some Python libraries:
#-----------------------------------------------------------------------------
$CONDA/conda install --yes numpy scipy pandas nose networkx traits ipython matplotlib
# Install nipype pipeline framework:
$CONDA/pip install nipype
# Install Synapse client:
$CONDA/pip install synapseclient
# https://pythonhosted.org/lockfile/lockfile.html
$CONDA/pip install lockfile
# Install scikit-learn for text-to-audio conversion:
$CONDA/pip install scikit-learn
#-----------------------------------------------------------------------------
# Install mhealthx nipype workflow for feature extraction:
#-----------------------------------------------------------------------------
if [ "$MHEALTHX" -eq "1" ]; then
cd $INSTALLS
git clone git@github.com:binarybottle/mhealthx.git
cd $INSTALLS/mhealthx
sudo python setup.py install
export PATH=$INSTALLS/mhealthx/mhealthx:$PATH
export PYTHONPATH=$PYTHONPATH:$INSTALLS/mhealthx
fi
#-----------------------------------------------------------------------------
# Install ffmpeg and dependencies for audio file conversion:
#-----------------------------------------------------------------------------
# (from https://trac.ffmpeg.org/wiki/CompilationGuide/Ubuntu)
mkdir $INSTALLS/ffmpeg
mkdir $INSTALLS/ffmpeg/ffmpeg_sources
mkdir $INSTALLS/ffmpeg/ffmpeg_build
sudo apt-get -y --force-yes install autoconf automake build-essential libass-dev libfreetype6-dev libsdl1.2-dev libtheora-dev libtool libva-dev libvdpau-dev libvorbis-dev libxcb1-dev libxcb-shm0-dev libxcb-xfixes0-dev pkg-config texi2html zlib1g-dev
# Install yasm (ffmpeg dependency):
cd $INSTALLS/ffmpeg/ffmpeg_sources
wget -nc http://www.tortall.net/projects/yasm/releases/yasm-1.3.0.tar.gz
tar xzvf yasm-1.3.0.tar.gz
cd $INSTALLS/ffmpeg/ffmpeg_sources/yasm-1.3.0
./configure --prefix="$INSTALLS/ffmpeg/ffmpeg_build" --bindir="$INSTALLS/bin"
make
make install
make distclean
# Install ffmpeg:
cd $INSTALLS/ffmpeg/ffmpeg_sources
wget -nc http://ffmpeg.org/releases/ffmpeg-snapshot.tar.bz2
tar xjvf ffmpeg-snapshot.tar.bz2
cd ffmpeg
PKG_CONFIG_PATH=$INSTALLS/ffmpeg/ffmpeg_build/lib/pkgconfig
./configure --prefix=$INSTALLS/ffmpeg/ffmpeg_build --pkg-config-flags="--static" --extra-cflags="-I$INSTALLS/ffmpeg/ffmpeg_build/include" --extra-ldflags="-L$INSTALLS/ffmpeg/ffmpeg_build/lib" --bindir="$INSTALLS/bin" --enable-gpl
#--enable-libass --enable-libfreetype --enable-libtheora --enable-libvorbis --enable-libx264 --enable-libx265 --enable-nonfree --enable-libfdk-aac --enable-libmp3lame --enable-libopus --enable-libvpx
make
make install
export PATH=$INSTALLS/ffmpeg/ffmpeg_sources/ffmpeg:$PATH
#-----------------------------------------------------------------------------
# Install openSMILE:
#-----------------------------------------------------------------------------
cd $INSTALLS
synapse get syn5584794
tar xvf openSMILE-2.1.0.tar.gz
cd openSMILE-2.1.0
bash buildStandalone.sh -p $INSTALLS
#-----------------------------------------------------------------------------
# Other voice feature extraction software (for future integration):
#-----------------------------------------------------------------------------
# Install Essentia dependencies:
#sudo apt-get install libyaml-dev libfftw3-dev libavcodec-dev libavformat-dev libavutil-dev libavresample-dev python-dev libsamplerate0-dev libtag1-dev
# build-essential
#sudo apt-get install pkg-config
#$CONDA/pip install pyyaml
# Install Essentia:
#cd $INSTALLS
##git clone https://github.com/MTG/essentia.git
##cd essentia
#wget -nc https://github.com/MTG/essentia/archive/v2.1_beta2.tar.gz
#tar xvf essentia-v2.1_beta2.tar.gz
#cd essentia-v2.1_beta2
#./waf configure --mode=release --with-python --with-cpptests --with-examples
#./waf
##sudo mkdir /usr/local/include/essentia
##sudo mkdir /usr/local/include/essentia/scheduler
##chmod 777 src
##chmod 777 src/version.h
##chmod 777 src/algorithms
##chmod 777 src/algorithms/essentia_algorithms_reg.cpp
##./waf build
#sudo ./waf install
# Install Kaldi dependencies:
#sudo apt-get install libtool subversion
#sudo apt-get install libatlas-dev libatlas-base-dev
# Install Kaldi:
#cd $INSTALLS
#git clone https://github.com/kaldi-asr/kaldi.git kaldi-trunk --origin golden
#cd $INSTALLS/kaldi-trunk/tools
#make
#cd $INSTALLS/kaldi-trunk/src
#./configure; make depend; make
# Install YAAFE dependencies:
#sudo apt-get install cmake-curses-gui libargtable2-0 libargtable2-dev libsndfile1 libsndfile1-dev libmpg123-0 libmpg123-dev libfftw3-3 libfftw3-dev liblapack-dev libhdf5-serial-dev libhdf5-7
## cmake
# Install YAAFE:
#mkdir build; cd build
#ccmake -DCMAKE_PREFIX_PATH=$INSTALLS/yaafe-v0.64/build/lib -DCMAKE_INSTALLS=$INSTALLS/yaafe-v0.64/ ..
#make; make install
# Install jAudio dependencies:
#sudo apt-get install ant
#sudo apt-get install openjdk-7-jdk
# Install jAudio:
#git clone https://github.com/anjackson/jAudio.git
#cd $INSTALLS/jAudio
#ant jar
#...
# Install grt:
#sudo apt-get install g++-4.8