forked from espnet/espnet
-
Notifications
You must be signed in to change notification settings - Fork 0
/
install_beamformit.sh
executable file
·53 lines (43 loc) · 1.26 KB
/
install_beamformit.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
LIBSNDFILE_VERSION=1.0.25
GIT=${GIT:-git}
WGET=${WGET:-wget}
# Installs beamformit from the location https://github.com/xanguera/BeamformIt
# libsndfile needed by beamformit
if [ ! -f libsndfile-$LIBSNDFILE_VERSION.tar.gz ]; then
if [ -d "$DOWNLOAD_DIR" ]; then
cp -p "$DOWNLOAD_DIR/libsndfile-$LIBSNDFILE_VERSION.tar.gz" . || exit 1
else
$WGET http://www.mega-nerd.com/libsndfile/files/libsndfile-$LIBSNDFILE_VERSION.tar.gz || exit 1
fi
fi
[ ! -d libsndfile-$LIBSNDFILE_VERSION ] && \
tar xzf libsndfile-$LIBSNDFILE_VERSION.tar.gz
(
cd libsndfile-$LIBSNDFILE_VERSION
./configure --prefix=$PWD
make
make install
)
# building beamformit
[ ! -d ./BeamformIt ] &&
$GIT clone https://github.com/xanguera/BeamformIt
(
cd BeamformIt
$GIT pull
cmake -DLIBSND_INSTALL_DIR=$PWD/../libsndfile-$LIBSNDFILE_VERSION .
make
)
# add config into env.sh
(
[ ! -z "${BEAMFORMIT}" ] && \
echo >&2 "BEAMFORMIT variable is aleady defined. Undefining..." && \
unset BEAMFORMIT
[ -f ./env.sh ] && . ./env.sh
[ ! -z "${BEAMFORMIT}" ] && \
echo >&2 "BeamformIt config is already in env.sh" && exit
wd=`pwd`
wd=`readlink -f $wd || pwd`
echo "export BEAMFORMIT=$wd/BeamformIt"
echo "export PATH=\${PATH}:\${BEAMFORMIT}"
) >> env.sh