Building Ardour on Windows using MSYS2

I decided to install MSVC to see if I could try to do something. This software’s not intuitive to me… I believe you.

Most were available in MinGW, but I had to build FFTW with single precision to overcome one error during the build. I couldn’t make the MinGW version of FFTW work.

I’ll be honest, I don’t recognize these names, sorry. I don’t have the… technical(?) knowledge.

I am curious on what all I’d have to do on MSVC though. Do you have an article or source(s) I can refer to, to try my hand?

Could you elaborate?

Sorry Stephen, I don’t know of anything. AFAIK only 2 people have ever built Ardour successfully using MSVC and I never saw any instructions anywhere. In my case I started off building everything with Cygwin (I think using MinGW) but that was nearly 20 years ago. After I moved to MSVC I probably wrote something down somewhere but I doubt I could find it now - and it would’ve been for a 32-bit build anyway, rather than 64-bit.

Sure - you probably know that MSVC builds things via Solution files (having the extension .sln) and Project files (having the extenstion .vcxproj). In the early days it was almost mandatory for libraries to include both of those files as standard. but over the years, they mostly don’t include tham any more. GTK probably still includes them but the smaller libraries (like FFTW) probably don’t. Nowadays, Ardour probably needs a few dozen of those smaller libraries - but if they no longer provide .sln files and .vcxproj files, it’s near impossible now to build them with MSVC.

[Edit…] Having said that… there’s an app available called CMake which can generate ,vcxproj files if you supply a traditional make file. I’ve tried it once or twice and it worked for me but I don’t think Robin had much success with it. A word of caution though… broadly speaking, stuff built with MinGW and stuff built with MSVC are generally incompatible so you need to build everything with the same compiler. You can’t just build a few modules with MSVC and hope they’ll work :frowning:

I thought almost everything that is required is currently available at https://vcpkg.io/
even rare packages like VAMP-SDK. You can get libsigcpp, [win]pthread there as well, the whole LV2 stack (lilv, serd, sord) (atkmm is no longer required, it’s now part of ardour itself).

Looks like LDRF / raptor are one of the few that are not currently there.

I hate cmake with passion, it’s not just slow (for huge projects like Ardour), but has horrible syntax, and is the only build-system that doesn’t follow established standards.

Yes that’s true, Robin and I think vcpkg was how the other MSVC builder approached it (Andre). The problem was that vcpkg (at least back then) tended to house only the recent versions of libraries and a lot of the versions needed by Ardour weren’t being offered. For example it offered GTK3 and GTK4 but not GTK2, which Ardour uses. I’m not sure how Andre got around that but I think it was a bit kludgy - e.g. building GTK3 and then renaming stuff as if he’d built GTK2 ??

I kinda expected that. Looking forward to doing things from scratch. No promises for now, though.

Ardour does not depend on GTK anymore, the toolkit was internalized 2 years ago, which simplified things significantly.

You do have a point though. One problem of a “too new” package might be glibmm.

I’d re-use as much as possible, and build on existing packages/infrastructure.

On GNU/Linux, getting everything is a one-liner

apt build-dep ardour

and you’re set.

I never understood why most devs prefer OS where things are more complicated than that :wink:

2 Likes

Ah, perhaps “doing things from scratch” was poor choice of words from me.

@EZ4Stephen / @x42 - what would be involved for one of you to build just one of Ardour’s static libs for me, using Clang? I’m thinking possibly fluidsynth? Or maybe the new staffpad lib?

To give some background, I was experimenting with Clang here yesterday and it’s actually quite a good compiler now! In the old days it used to take around 3.5 hours to build just the gtk2_ardour branch but these days they’ve got that down to just 33 minutes, so I’d like to take another look at it sometime - but I’m curious to know if a Clang static lib (built via one of your Windows builds) would be compatible with my MSVC builds.

I do not have a windows system, and our Linux builders which cross compile don’t have a clang setup to x-compile. sorry.

Thanks Robin - and of course if Stephen is already building on Windows, I guess that wouldn’t be a valid test anyway :frowning:

Oh well… back to building with MSVC :slight_smile:

At least for the time being, I’ve turned away from trying to use MSVC after trying to use it for like 3 days on and off. Needing CMakeLists.txt files was where I kinda stopped. Since I don’t know C or C++, it’d take a while for me to make any. If someone were to make a wscript to CMakeLists.txt tool specifically for Ardour (or a generic one that’s highly accurate), that’d be great and I’d try to approach MSVC again. Until then, I’m content with my current build.

You’ve got my attention with asking to build just one static library with Clang though. I’ll see what I can do, but I’m curious on how it’d help you; how it’d be compatible with your build.

[Also speaking of “my current build” at the end of the 1st paragraph, I suppose I should add a paragraph or two of the smallest set of commands to build a newer version of Ardour having already installed all the dependencies and Ardour before. The only way I know is to repeat the git clone, do those sed -i commands, do ./waf configure, build, and install, which will probably take an hour. Not to mention that sometimes the git clone is slow.]

Sorry Stephen, I got a bit mixed up here. I’ve known for a long time that Robin’s current cross-compiled libraries (built using wine and gcc) aren’t compatible with MSVC but I’ve always suspected that if we could build the Support Stack using Clang, it probably would be. Robin does cross-compile and I got it into my head that you were too (which you aren’t - now that I read again). i.e. if you built with Clang, you’d be building on Windows anyway (and I already know that Clang and MSVC are compatible when both are built on Windows…)

I hate cmake with passion, but I won’t start another rant …

Keep in mind that waf can generate MSVC project files [1] and the Ardour wscript does include flags for that [2], which are likely outdated: git blames @John_E adding them in 2014; I don’t know how much work would be involved to get that working.

[1] msvc — Waf 2.1.4 documentation
[2] ardour/wscript at 9ee9e6d139ef9d749e282e54b29387de23db596e · Ardour/ardour · GitHub

I’ve a vague recollection of helping @tnaugle when he was trying to write a waf script for generating MSVC project files but that was a looong time ago! It all got abandoned once the support stack moved to gcc.

And that’s still the main barrier to any MSVC programmer who wants to join Ardour or Mixbus - the gcc/MinGW support libs just aren’t compatible :frowning:

Well yeah, that’s what we’re trying to address here. I am pretty sure that vcpkg.io provides most of it, … and then we can use waf to generate the MSVC project files for Ardour.

If you figure out which libraries are missing at vcpkg we could add those to Ardour’s source-tree, or ask for them to be included at https://github.com/microsoft/vcpkg/issues.

Wasn’t there a programmer called Vance who’d managed to build the support stack using vcpkg and MSVC? Whatever happened to him (maybe invite him to join us here?)

I didn’t realize this earlier, had the wrong idea. I’ll see how far I can go with vcpkg.

Any chance you know why the following error comes?

Checking for function ‘dlopen’ in dlfcn.h : no
The configuration failed

Looking online, it’s not supposed to be a problem for Windows in general, but I’ve not sufficiently understood this problem.

(For reference, I ran the following in PowerShell to get the above: python waf configure --prefix=C:/Ardour2 --configdir=share --optimize --ptformat)

That looks like you’re configuring for Linux/gcc

I think you need --msvc_version="msvc 10.0,msvc 9.0" --msvc_target="x64" for waf (see [1] above) to generate MSVC projects.

and for ardour/windows --dist-target=msvc . see also python waf configure --help

try

python waf configure --dist-target=msvc --msvc_version="msvc 10.0,msvc 9.0" --msvc_target="x64"

I thought otherwise when I saw the output (from running what I mentioned first),

Checking for ‘msvc’ (C compiler) : C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.44.35207\bin\HostX64\x64\CL.exe
Checking for ‘msvc’ (C++ compiler) : C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.44.35207\bin\HostX64\x64\CL.exe

(I simply assumed “It sees MSVC, so surely it’s gonna configure for Windows…”)

I decided to try with --msvc_version="msvc 10.0,msvc 9.0" --msvc_target="x64".
The 1st flag alone gave the error,

msvc: Impossible to find a valid architecture for building [‘msvc 10.0’, ‘msvc 9.0’, ‘msvc 8.0’, ‘msvc 7.1’, ‘msvc 7.0’, ‘msvc 6.0’] - [‘msvc 17.14’]

(I assume that’s an outdated flag or something).

The 2nd flag (or the combo of the 1st and 2nd flag) gives the following output,

Checking for ‘msvc’ (C compiler) : not found
Checking for ‘gcc’ (C compiler) : not found
Checking for ‘clang’ (C compiler) : not found
could not configure a C compiler!

The 3rd flag seems to change nothing. Guess it builds for 64 bit Windows automatically. To confirm this, I ran the same command as before: python waf configure --prefix=C:/Ardour2 --configdir=share --optimize --ptformat , then opened config.log, where it said [vcvarsall.bat] Environment initialized for: 'x64'

Before I try to circumvent this by other means, do you think the root wscript should be edited, for whatever this circumstance is?