BeetsPluginXtractor icon indicating copy to clipboard operation
BeetsPluginXtractor copied to clipboard

Compiling Essentia with Gaia supports gives error

Open Bestfast opened this issue 1 year ago • 0 comments

I'm trying to compile Essentia with Gaia, to use this plugin on Windows. I'm actually having an endless amount of issues even when compiling Gaia, but after a couple hours trying I managed to compile it. Essentia though spits out a ton of errors when compiling, and I'm sadly not competent enough to have found a solution. It would be awesome to have some precompiled binaries, but in case this won't be possible for Windows, here's the Dockerfile I used to compile it, so it can be replicable in the case someone might want to help me.

FROM ubuntu:20.04
ARG ESSENTIA_VERSION=2.1_beta5

ENV LANG C.UTF-8

RUN apt-get update \
    && apt-get -y upgrade \
    && DEBIAN_FRONTEND=noninteractive apt-get install -y \
       python3-matplotlib python3-numpy python3-six python3-yaml \
       libfftw3-3 libyaml-0-2 libtag1v5 libsamplerate0 \
       libavcodec58 libavformat58 libavutil56 libavresample4 \
    && rm -rf /var/lib/apt/lists/*

RUN apt-get update \
    && apt-get install -y build-essential python3-dev git \
    libfftw3-dev libavcodec-dev libavformat-dev libavresample-dev \
    libsamplerate0-dev libtag1-dev libyaml-dev libeigen3-dev \
    g++-mingw-w64 \
    libchromaprint-dev swig

# Gaia
RUN mkdir /essentia && cd /essentia && git clone https://github.com/MTG/gaia.git \
    && DEBIAN_FRONTEND=noninteractive apt-get install -y software-properties-common \
    && add-apt-repository ppa:rock-core/qt4 && apt-get -y update \
    && DEBIAN_FRONTEND=noninteractive apt-get install -y libqt4-dev libqtwebkit-dev
RUN apt install -y qt5-qmake qtbase5-dev qtbase5-dev-tools libqt5svg5-dev libqt5webenginewidgets5 libqt5webchannel5-dev qtwebengine5-dev

RUN cd /usr/local/include && ln -sf eigen3/Eigen Eigen && ln -sf eigen3/unsupported unsupported && cd /usr/include && ln -sf eigen3/Eigen Eigen && ln -sf eigen3/unsupported unsupported \
    && cd /essentia/gaia && python3 waf configure --with-python-bindings \
    && python3 waf && python3 waf install && ldconfig

# Essentia
RUN apt-get -y install build-essential libeigen3-dev libyaml-dev libfftw3-dev libavcodec-dev libavformat-dev libavutil-dev libswresample-dev libsamplerate0-dev libtag1-dev libchromaprint-dev wget curl \
    python3-dev python3-numpy-dev python3-numpy python3-yaml python3-six cmake gcc-multilib
RUN cd /essentia && git clone https://github.com/MTG/essentia.git \
    && cd /essentia/essentia && git checkout "v$ESSENTIA_VERSION" && ./packaging/build_3rdparty_static_win32.sh \
    && python3 waf configure --with-python --with-gaia --with-examples --with-static-examples --cross-compile-mingw32 --with-vamp \
    && python3 waf && python3 waf install && ldconfig \
    &&  apt-get remove -y build-essential libyaml-dev libfftw3-dev libavcodec-dev \
        libavformat-dev libavutil-dev libavresample-dev python-dev libsamplerate0-dev \
        libtag1-dev libeigen3-dev libchromaprint-dev swig \
    && apt-get autoremove -y \
    && apt-get clean -y

ENV PYTHONPATH /usr/local/lib/python3/dist-packages

WORKDIR /essentia

The original Dockerfile is from a gist I found somewhere, but I can't find it anymore lol last error:

464.1 make[2]: Entering directory '/essentia/essentia/packaging/win32_3rdparty/tmp/chromaprint-v1.4.3'
464.2 [  5%] Building CXX object src/CMakeFiles/chromaprint_objs.dir/fft_lib_fftw3.cpp.obj
464.2 cd /essentia/essentia/packaging/win32_3rdparty/tmp/chromaprint-v1.4.3/src && /usr/bin/i686-w64-mingw32-g++  -DCHROMAPRINT_NODLL -DHAVE_CONFIG_H -D_SCL_SECURE_NO_WARNINGS -D_USE_MATH_DEFINES -D__STDC_CONSTANT_MACROS -D__STDC_LIMIT_MACROS @CMakeFiles/chromaprint_objs.dir/includes_CXX.rsp -std=c++11 -Wall -O3 -DNDEBUG   -o CMakeFiles/chromaprint_objs.dir/fft_lib_fftw3.cpp.obj -c /essentia/essentia/packaging/win32_3rdparty/tmp/chromaprint-v1.4.3/src/fft_lib_fftw3.cpp
464.5 In file included from /usr/share/mingw-w64/include/sec_api/stdlib_s.h:9,
464.5                  from /usr/share/mingw-w64/include/stdlib.h:768,
464.5                  from /usr/lib/gcc/i686-w64-mingw32/9.3-win32/include/c++/cstdlib:75,
464.5                  from /usr/lib/gcc/i686-w64-mingw32/9.3-win32/include/c++/bits/stl_algo.h:59,
464.5                  from /usr/lib/gcc/i686-w64-mingw32/9.3-win32/include/c++/algorithm:62,
464.5                  from /essentia/essentia/packaging/win32_3rdparty/tmp/chromaprint-v1.4.3/src/utils.h:15,
464.5                  from /essentia/essentia/packaging/win32_3rdparty/tmp/chromaprint-v1.4.3/src/fft_lib_fftw3.h:10,
464.5                  from /essentia/essentia/packaging/win32_3rdparty/tmp/chromaprint-v1.4.3/src/fft_lib_fftw3.cpp:4:
464.5 /usr/include/stdlib.h:62:5: error: conflicting declaration ‘typedef struct div_t div_t’
464.5    62 |   } div_t;
464.5       |     ^~~~~

Bestfast avatar Jan 13 '24 04:01 Bestfast