Skip to content

Adding CMake, FFmpeg 5+ and VS2019/2022 support #1398

Open
@wo80

Description

@wo80

I've been working on Visual Studio compatibility lately (well, picked up work from a year ago), see https://github.com/wo80/essentia/

Here's what's in the fork:

  • CMake build script
  • RougeVector compatibility with Visual Studio 2019/2022
  • Compatibility with FFmpeg 4/5/6/7

There's a GitHub workflow and a short guide available showing how to compile the project.

If you are interested in merging this, I think the changes in the cmake branch should be split up into smaller pull requests. I'd suggest the following changes to go into separate PRs and that detailed discussion being done there:

  1. Remove using namespace std from headers, see CppCoreGuidelines#Rs-using-directive (wo80@b510967)
  2. Update C++ code (wo80@38bd16b, wo80@4c27b35, wo80@57c2e6f, wo80@877df4d)
  3. Update googletest
  4. Update AudioContext (wo80@7733e28, wo80@087af17, wo80@57918d0, wo80@246eff3)
  5. Update RougeVector (wo80@5d761dd, wo80@07c48f2)
  6. Remove outdated Visual Studio project files (and win32 3rd party code)
  7. Add CMake support
  8. Add Github workflow to test Visual Studio build

Regarding point 6: having the Visual Studio project files doesn't make sense with the CMake script in place. The win32 3rd party code is completely out of date, so I'd suggest, if you want to keep the option to cross-compile for Windows, all dependencies should be pulled from the online repos (like done in my GitHub workflow) and the versions being updated on a regular basis. I might update the shell scripts, if I find the time.

CMake build tested on

  • Windows 10, Visual Studio 2022
  • Windows 10, msys2, MinGW64, GCC 13
  • Debian 12, GCC 12
  • Fedora 39, GCC 13
  • Manjaro, GCC 13 and clang

WAF build ./waf --with-examples --with-cpptests --std c++17 tested on

  • Debian 12, GCC 12
  • Fedora 39, GCC 13

C++ unit tests are passing on all platforms.

Python wheel

I have tested the Python wheel only on Debian. The essentia_python_tutorial.ipynb notebook runs without problems. I've also been able to build the wheel for Windows (see GitHub workflow of the cmake-python branch), but haven't done much testing. The following code runs fine in the Python prompt:

import os
os.add_dll_directory("C:/usr/bin")
import essentia
import essentia.standard
print(dir(essentia.standard))
help(essentia.standard.MFCC)

I'm compiling against shared library dependencies (FFmpeg etc.), so the location where those are residing has to be added with os.add_dll_directory on Windows.


I've tried to find the affected issues and pull requests. No guarantee for completeness, though.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions