Hello.
Good news! Ardour can be built from source using the MSVC compiler, without any modifications needed to the source code, and run (at least as of 9.2.609).
(Perhaps phrasing it as “now” is a little misleading since the commit that made this possible was ~2 days ago?)
However, there’s some caveats/requirements:
- The compiler: One needs to get the MSVC compiler first.
- llvm-nm: One also needs llvm-nm to generate some .def files.
- Dependencies (Libraries): One also needs dependencies. And their .pc files.
- Release/Debug: I have only tested building with release. My current focus is to make getting all dependencies easier, before I submit anything else for Ardour (with a possible exception to attempting to make a helperlist.h file for 4 of libs/tk/ytkmm/ytkmm’s files. If I succeed in that, it’d make getting glibmm easier.)
Compiler:
To my knowledge, there’s at least two ways to get the compiler. The official way is to search for Visual Studio 2026 (or whatever the latest version is) and get the Community edition of whatever the latest version is. (I say latest because I didn’t test compiling with older versions of MSVC. Whether there is sufficient support for older versions, I’m not sure, and don’t feel obliged to test and find out what’s the oldest version of MSVC that can build ardour.)
The other way to get MSVC (to my knowledge) is using something called msvcup. I haven’t looked into setting it up yet, but I don’t see why it shouldn’t work.
Also, I haven’t tried to figure out what’s the oldest version of MSVC that can build Ardour. Probably won’t try.
llvm-nm
This is a key part of the current msvc-specific workaround to two build errors, exacerbated by MSVC not having a flag to export all symbols: unresolved symbols from some folders, and no creation of a .lib for others.
If and when MSVC comes around to adding a flag to export all symbols, the necessity of llvm-nm in the build would need revaluation.
Regarding getting llvm-nm, so far I’ve gotten it along with other LLVM things that come with Visual Studio. I haven’t looked into whether the llvm folder comes with msvcup. I suppose one can build LLVM from source, or use the installer from the latest release: Releases · llvm/llvm-project · GitHub
Dependencies (libraries)
Personally, the part that is not straightforward as others. My current approach has been to clone vcpkg, enter the vcpkg directory, run bootstrap-vcpkg.bat -disableMetrics after going into the vcpkg dir, then get all but 4 of the dependencies by running the following:
vcpkg install boost-ptr-container glib libsndfile curl libarchive liblo taglib vamp-sdk libusb rubberband jack2 pthreads fftw3[threads] aubio[core] libpng pango lv2 libxml2 cppunit libwebsockets portaudio[asio] libsamplerate serd sord sratom lilv boost-uuid boost-tokenizer boost-multiprecision boost-pool boost-algorithm boost-property-tree boost-multi-array getopt
(You might need to add a leading .\ or ./ . If an error comes immediately upon running the command, read it and do as it says)
Then, from running the python script in https://github.com/EZ4Stephen/testardourdeps/blob/main/InstallOthers.py , libsigcpp-2.12.1, glibmm-2.62.0, giomm-2.62.0, pangomm-2.42.2 and cairomm-1.14.5 are installed. (Note: I placed the python script just outside the vcpkg folder.)
Now I understand if someone doesn’t trust a random python script. You are welcome to find a way to install the 4 dependencies, and copy them to the appropriate places without the python script.
The python script also does a few additional changes which if not done (by this script or manually), you may get errors during the build. (copy pkgconf.exe as pkg-config.exe, edit jack2’s version in .pc files to 1.9.22 from 1.9, copy liblo.lib as lo.lib, copy VampHostSDK.lib as vamp-hostsdk.lib, VampPluginSDK.lib as vamp-sdk.lib, remove -ldl from vamp-hostsdk.pc)
(Maybe all of those are due to getting the packages from vcpkg, and may not be required if getting dependencies in other ways?)
Long-term, I think xmake/xrepo would be the right place to get the dependencies from, once all dependencies are available there.
Also, a rough estimate of the space needed to install the dependencies is 7.5GB if using vcpkg but not deleting the folder next to the “x64-windows” folder that is created.
Ardour Source Files
While one can build from the source files without modifications, based on some files’ warnings I suspect a handful of files here and there might need a few tweaks eventually. But apart from supressing or fixing warnings here and there, there’s probably little or no need.
[Note: I have only tested some functionality on my laptop, not all. But, the parts responsible for getting started (like making a new session, choosing portaudio as the backend using WASAPI, loading a synth, creating a region and drawing notes) seem fine.]
How to build ardour?
Assuming you have all dependencies (and Python), and can use developer Powershell/Command Prompt:
- Open developer’s powershell (Makes cl.exe, ml64.exe and llvm-nm.exe findable)
- Go to folder where you want to download the source code
git clone git://git.ardour.org/ardour/ardour.gitcd ardour- If PowerShell:
$env:path = "(Path to folder with pkg-config.exe);$env:PATH",$env:pkg_CONFIG_PATH = "(Path to folder with .pc files)"
If Command Prompt:set PATH=(Path to folder with pkg-config.exe);%PATH%,set pkg_CONFIG_PATH=(Path to folder with .pc files)
Note: using setx instead of set will set those variables permanently, once you close and reopen command prompt after doing so. -
python waf configure --prefix=(Folder for installing Ardour in) --configdir=share --dist-target=msvc --cxx17 --optimize
Use --also-libdir and --also-include if needed. And remove/add any other option as you see fit.
To be precise, I used the following command for my build:python waf configure --prefix=C:\Ardour --configdir=share --ptformat --dist-target=msvc --also-include=C:\Tests\vcpkg\installed\x64-windows\include --also-libdir=C:\Tests\vcpkg\installed\x64-windows\lib --cxx17 --optimize --use-lld
And what happens if someone builds without setting a prefix? That, I haven’t tested, so I can’t answer. python waf-
python waf install(Once build is fully successful)
And for the time being, there seems to be a problem with the .exe not finding the .dll’s of some dependencies, at least for me. so for that:
9?. Copy the .dll’s of dependencies of Ardour, and paste it in the same folder as ardour’s .exe where installed.
10?. If Windows gives 4 errors about ‘glibmm-2.4’ and ‘giomm-2.4’ not being found (specifically without the dll suffix), try removing the dll suffix for those two.
(Step 10 seems like a me-problem. I also did some research into delay-loading dll’s, and changing the search paths for dll’s, as alternatives to copying dll’s, but ultimately dropped attempting to fix that.)
Estimated size of where ardour gets installed, if including the copied dll’s: ~133MB (if building release and not debug!).
Errors when building?
If audiographer says dl.lib not found, check vamp-hostsdk.pc and if it has -ldl, remove it.
If compiler is out of heap space, rerun python waf (not configure). I don’t have any credible suggestions or explanations beyond that, unfortunately.
Demand for MSVC Builds
I’m curious as to how much demand existed before my efforts to build on Windows with MSVC, and if any demand arises from this post, to build Ardour with MSVC using waf. Just thought I’d put this out there as a separate point.
I suppose people on Windows who want to build Ardour for free, or who want to help with development, now have an option other than MinGW.
Also, since the commits, I haven’t tested how one could run Ardour from Visual Studio once its installed. Maybe there’s some demand there too?
Other personal thoughts
Big thanks to Paul, Robin and John for the correspondence, feedback and patience along the way. Learnt some things along the way. Most of the Windows-specific code was already in place to begin with, making my efforts easier.
Now that there’s sufficient MSVC-specific code in place for anyone to build Ardour on Windows with MSVC using the waf build system, will I contribute any more code to Ardour? I tend to act on my priorities, and ideas are not the same as execution.