构建音频分析库Essentia在Gaia支持下失败了

Building audio analysis library Essentia failed with Gaia support

本文关键字:Gaia 支持下 失败 Essentia 音频 构建      更新时间:2023-10-16

我正在尝试构建音频分析库Essentia(https://github.com/MTG/essentia(,从源代码Debian 9.0提供Gaia(https://github.com/MTG/gaia(支持。在此之前,它的一个依赖项,即Gaia,也是从源代码成功构建的。它安装在/usr/local/.

当涉及到Essentia时,源代码的编译失败,并出现以下错误:

[...]
In file included from ../src/algorithms/essentia_algorithms_reg.cpp:21:0:
../src/algorithms/highlevel/gaiatransform.h: At global scope:
../src/algorithms/highlevel/gaiatransform.h:37:10: error: ‘TransfoChain’ in namespace ‘gaia2’ does not name a type
gaia2::TransfoChain _history;
^~~~~~~~~~~~
../src/algorithms/highlevel/gaiatransform.h: In constructor ‘essentia::standard::GaiaTransform::GaiaTransform()’:
../src/algorithms/highlevel/gaiatransform.h:47:5: error: ‘init’ is not a member of ‘gaia2’
gaia2::init();
^~~~~
../src/algorithms/highlevel/gaiatransform.h:47:5: note: suggested alternative:
In file included from ../src/essentia/algorithmfactory.h:27:0,
from ../src/algorithms/essentia_algorithms_reg.cpp:1:
../src/essentia/essentia.h:46:6: note:   ‘essentia::init’
void init();
^~~~

错误所在的文件/src/algorithms/essentia_algorithms_reg.cpp,这是编译文件的命令:

/usr/bin/g++ -pipe -Wall -std=c++03 -msse -msse2 -mfpmath=sse -O2 -fPIC -pthread -Isrc -I../src -Isrc/essentia -I../src/essentia -Isrc/essentia/scheduler -I../src/essentia/scheduler -Isrc/essentia/streaming -I../src/essentia/streaming -Isrc/essentia/streaming/algorithms -I../src/essentia/streaming/algorithms -Isrc/essentia/utils -I../src/essentia/utils -Isrc/3rdparty -I../src/3rdparty -Isrc/3rdparty/spline -I../src/3rdparty/spline -Isrc/3rdparty/vamp-plugin-sdk-2.4 -I../src/3rdparty/vamp-plugin-sdk-2.4 -I/usr/include/x86_64-linux-gnu -I/usr/include/taglib -I/usr/local/include -I/usr/include/qt4 -I/usr/include/qt4/QtCore -I/usr/local/include/gaia2/ -DHAVE_AVCODEC=1 -DHAVE_AVFORMAT=1 -DHAVE_AVUTIL=1 -DHAVE_AVRESAMPLE=1 -DHAVE_SAMPLERATE=1 -DHAVE_TAGLIB=1 -DHAVE_YAML=1 -DHAVE_FFTW=1 -DHAVE_GAIA2=1 -D__STDC_CONSTANT_MACROS -DPYTHONDIR="/usr/local/lib/python2.7/dist-packages" -DPYTHONARCHDIR="/usr/local/lib/python2.7/dist-packages" -DHAVE_PYEMBED=1 -DHAVE_PYEXT=1 -DHAVE_PYTHON_H=1 ../src/algorithms/essentia_algorithms_reg.cpp -c -o/home/hamidi/essentia/build/src/algorithms/essentia_algorithms_reg.cpp.1.o -fPIC -v

g++-v选项给了我链接器访问的实际路径(我认为那里没有什么不好的,但为了完整起见(:

#include "..." search starts here:
#include <...> search starts here:
src
../src
src/essentia
../src/essentia
src/essentia/scheduler
../src/essentia/scheduler
src/essentia/streaming
../src/essentia/streaming
src/essentia/streaming/algorithms
../src/essentia/streaming/algorithms
src/essentia/utils
../src/essentia/utils
src/3rdparty
../src/3rdparty
src/3rdparty/spline
../src/3rdparty/spline
src/3rdparty/vamp-plugin-sdk-2.4
../src/3rdparty/vamp-plugin-sdk-2.4
/usr/include/taglib
/usr/include/qt4
/usr/include/qt4/QtCore
/usr/local/include/gaia2/
/usr/include/c++/6
/usr/include/x86_64-linux-gnu/c++/6
/usr/include/c++/6/backward
/usr/lib/gcc/x86_64-linux-gnu/6/include
/usr/local/include
/usr/lib/gcc/x86_64-linux-gnu/6/include-fixed
/usr/include/x86_64-linux-gnu
/usr/include
End of search list.

以下是错误中涉及的文件(github存储库(:

MTG/gaia/
  • blob/master/src/gaia.h

  • MTG/gaia/blob/master/src/transformation.h#L106

  • /
  • MTG/essentia/blob/master/src/algorithms/highlevel/gaiatransform.h

最后,这是在配置Gaia时发生的错误,导致了问题。实际上,而不是仅使用以下选项进行配置:

./waf configure --with-python-bindings --with-asserts --with-cyclops

选项--with-stlfacade是无意中添加的。将GaiaEssentia结合使用时,此选项不兼容。