forked from naxingyu/opensmile
-
Notifications
You must be signed in to change notification settings - Fork 0
/
buildStandalone.sh
executable file
·79 lines (67 loc) · 1.98 KB
/
buildStandalone.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
#!/bin/bash
# This file is part of openSMILE.
#
# Copyright (c) audEERING. All rights reserved.
# See the file COPYING for details on license terms.
OPENCV_INST=""
INSTPREFIX=""
STATIC_BIN="no"
while getopts "o:p:h" options; do
case $options in
o ) OPENCV_INST="$OPTARG";;
p ) INSTPREFIX="$OPTARG";;
h ) echo "Usage: $0 [-o <path_to_opencv>] [-p <inst_prefix>]"; exit;;
esac
done
Pwd=`pwd`;
if [ "$INSTPREFIX" = "" ]; then
INSTPREFIX="$Pwd/inst"
fi
if [ "$OPENCV_INST" != "" ]; then
OPENCV_OPT="--with-opencv=$OPENCV_INST"
STATIC_BIN="no"
else
OPENCV_OPT="--enable-static --enable-shared=no"
# STATIC_BIN="yes"
fi
rm SMILExtract 2> /dev/null
chmod +x autogen.sh
./autogen.sh ;
./autogen.sh ;
chmod +x configure
mkdir inst 2> /dev/null
##### DEBUG version:
#export CXXFLAGS="-O0"
#export CFLAGS="-O0"
#export CPPFLAGS="-D_DEBUG -g -D__STATIC_LINK -DOPENSMILE_BUILD -DBUILD_SVMSMO -DBUILD_SVMSMO -DBUILD_LIBSVM -DBUILD_RNN -DBUILD_WITHOUT_EXPERIMENTAL"
#### non-debug flags:
export CXXFLAGS="-O2 -mfpmath=sse -msse2"
export CFLAGS="-O2 -mfpmath=sse -msse2"
export CPPFLAGS="-D__STATIC_LINK -DOPENSMILE_BUILD -DBUILD_SVMSMO -DBUILD_SVMSMO -DBUILD_LIBSVM -DBUILD_RNN -DBUILD_WITHOUT_EXPERIMENTAL"
export LDFLAGS="-lrt -lm -lpthread -lc"
#####
echo ./configure --without-portaudio --prefix=$INSTPREFIX $OPENCV_OPT
./configure --without-portaudio --prefix=$INSTPREFIX $OPENCV_OPT
if [ $? != 0 ]; then
echo "failed to configure openSMILE!";
exit -1;
fi
chmod +x update_build_version.sh
./update_build_version.sh
make clean &&
make -j8; make install
if [ $? != 0 ]; then
echo "failed to build or install openSMILE to '$INSTPREFIX'!";
exit -1;
fi
# fully static binary:
if [ "$STATIC_BIN" = "yes" ]; then
rm SMILExtract
g++ $CXXFLAGS -static -o SMILExtract progsrc/smilextract/SMILExtract-SMILExtract.o .libs/libopensmile.a $LDFLAGS
#-D__STDC_CONSTANT_MACROS
cp SMILExtract inst/bin/SMILExtract
fi
####
echo ""
echo "build successfull. You can now use the inst/bin/SMILExtract binary."
echo ""