Skip to content

Instantly share code, notes, and snippets.

@hbuschme
Created September 5, 2013 21:12
Show Gist options
  • Star 3 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hbuschme/6456249 to your computer and use it in GitHub Desktop.
Save hbuschme/6456249 to your computer and use it in GitHub Desktop.
Build script for openSMILE 2.0rc1 on Mac OS X 10.8, with homebrewed PortAudio. This script is derived from the script "buildWithPortAudio.sh" included in the source package of openSMILE 2.0rc1 (released 2013-05-17, URL: http://sourceforge.net/projects/opensmile/files/opensmile-2.0-rc1.tar.gz/download). It links to a system-wide PortAudio version…
#!/bin/sh
# License: GPLv3
#Usage buildWithPortAudio.sh -p [install-prefix] -o [opencv path]
# Default install prefix is $Pwd/inst
OPENCV_INST=""
INSTPREFIX=""
## Next line was patched 2013-09-05 by hbuschme
PORTAUDIO_PREFIX="/usr/local/"
while getopts "o:p:" options; do
case $options in
o ) OPENCV_INST="$OPTARG";;
p ) INSTPREFIX="$OPTARG";;
\?) echo "Usage: $0 [-o <path_to_opencv>] [-p <inst_prefix>]";;
esac
done
Pwd=`pwd`;
if [ "$INSTPREFIX" = "" ]; then
INSTPREFIX="$Pwd/inst"
fi
if [ "$OPENCV_INST" != "" ]; then
OPENCV_OPT="--with-opencv=$OPENCV_INST"
fi
## Next lines were commented out 2013-09-05 by hbuschme
#echo "++++++++++++++ Compiling PortAudio...."
#
#cd ../thirdparty ;
#tar -zxvf portaudio.tgz ;
#cd portaudio ;
#./configure --prefix=$INSTPREFIX ;
#if [ $? != 0 ]; then
# echo "failed to configure PortAudio!";
# exit -1;
#fi
#make ;
#if [ $? != 0 ]; then
# echo "failed to build PortAudio!";
# exit -1;
#fi
#make install ;
#if [ $? != 0 ]; then
# echo "failed to install PortAudio to '$Pwd/inst'!";
# exit -1;
#fi
#
#cd $Pwd ;
echo "++++++++++++++ Compiling openSMILE...."
rm SMILExtract 2> /dev/null
./autogen.sh ;
./autogen.sh ;
if [ $? != 0 ]; then
echo "autogen.sh failed!";
exit -1;
fi
mkdir inst 2> /dev/null
export CXXFLAGS="-O2"
export CFLAGS="-O2"
export CPPFLAGS="-DBUILD_WITH_GPL3rdP -DBUILD_LIBSVM -DBUILD_RNN -DBUILD_WITHOUT_EXPERIMENTAL"
# Next two lines were patched 2013-09-05 by hbuschme
echo ./configure --prefix=$INSTPREFIX --with-portaudio="$PORTAUDIO_PREFIX" "$OPENCV_OPT"
./configure --prefix=$INSTPREFIX --with-portaudio="$PORTAUDIO_PREFIX" "$OPENCV_OPT"
if [ $? != 0 ]; then
echo "failed to configure openSMILE!";
exit -1;
fi
# The next line was patched 2013-09-05 by hbuschme
bash update_build_version.sh
make clean &&
make -j8 ; make install
if [ $? != 0 ]; then
echo "failed to build or install openSMILE!";
exit -1;
fi
mv $INSTPREFIX/bin/SMILExtract $INSTPREFIX/bin/SMILExtract.bin
echo "#!/bin/sh" > $INSTPREFIX/bin/SMILExtract
echo "export LD_LIBRARY_PATH=\"`dirname \$0`/../lib\" ; \$0.bin \$* " >> $INSTPREFIX/bin/SMILExtract
chmod +x $INSTPREFIX/bin/SMILExtract
echo ""
echo "build successful."
echo " You can now use the $Pwd/inst/bin/SMILExtract executable,"
echo " and add $Pwd/inst/bin to your path."
echo ""
echo " Please note that $Pwd/inst/bin/SMILExtract is a wrapper script"
echo " which sets up the library path and calls SMILExtract.bin"
echo ""
echo " hbuschme:"
echo " Please look into this script and fix LD_LIBRARY_PATH if necessary."
echo ""
@zedavid
Copy link

zedavid commented May 18, 2018

Hi Hendrik, since the last time at KTH. I'm have been trying to install opensmile following this recipe and I have been getting this error

ld: library not found for -lopensmile
clang: error: linker command failed with exit code 1 (use -v to see invocation)

Does it ring a bell?

@danielkorzekwa
Copy link

I have the same problem,Sierra 10.12.6. Any update on this?

@sebalpz
Copy link

sebalpz commented Aug 13, 2018

Seems to be a Racecondition, because -j8 makes make compile eight jobs at once. It seems, some jobs depend on things, that are not yet finished by another job. Maybe just try to call make -j8 a second time.

@jscutts
Copy link

jscutts commented Apr 10, 2019

Going on what @sebalpz said ^, I was able to get mine working by calling make -j8 2 more times in the build script (before the call to make install).
The openSMILE v2.3 'book' also hints at something like this (top of page 18):

However, running only make -j4 will result in an error, because libopensmile has not been built when SMILExtract is build. Thus, you need to run a single make again. This should finish without error.

Note I had to make slightly different modifications than what they describe to get mine to work (namely, call twice).

@vineetp13
Copy link

Thanks @jscutts

Going on what @sebalpz said ^, I was able to get mine working by calling make -j8 2 more times in the build script (before the call to make install).
The openSMILE v2.3 'book' also hints at something like this (top of page 18):

However, running only make -j4 will result in an error, because libopensmile has not been built when SMILExtract is build. Thus, you need to run a single make again. This should finish without error.

Note I had to make slightly different modifications than what they describe to get mine to work (namely, call twice).

Thanks a bunch! This worked like a charm

@hbuschme
Copy link
Author

Sorry everyone, I wasn't notified about any of your comments! –Hendrik

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment