Description
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:
- Remove
using namespace std
from headers, see CppCoreGuidelines#Rs-using-directive (wo80@b510967) - Update C++ code (wo80@38bd16b, wo80@4c27b35, wo80@57c2e6f, wo80@877df4d)
- Update googletest
- Update AudioContext (wo80@7733e28, wo80@087af17, wo80@57918d0, wo80@246eff3)
- Update RougeVector (wo80@5d761dd, wo80@07c48f2)
- Remove outdated Visual Studio project files (and win32 3rd party code)
- Add CMake support
- 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.
- Build on Windows #204
- Python bindings in Windows #243
- Compiling using native windows Visual Studio compiler #330
- Review outdate files in packaging/win32 #338
- Win32 static build #730
- Compiling windows MSVC #853
- Include Essentia in Visual Studio 2017 #854
- Getting Essentia to work on Windows #1130
- Error when trying to cross-compile for Windows #1134
- pip install essentia fails on windows 10 #1157
- std::binary_function removed on c++17 #1206
- Starting migrate to CMake & Cpp 20 stardand #1207
- Support ffmpeg version 5 #1248
- Static builds with GAIA #1265
- Support for x86_64 with mingw #1311
- Windows compilation fails with RogueVector #1360
- Please provide updated binaries for windows #1340
- MSVC Vamp plugin builds for Windows #1402
- Build fails with "error: ‘av_register_all’ was not declared in this scope" #1411
- Compilation instructions are broken #1439
- Changes for Visual Studio compilation #396
- Python win changes to build dll #820
- add small github actions script for a windows build #1113
- Fixed C++17 compatibility issues #1370