Building ydk-pixbuf as in, you got the dependencies and are building ardour and got to ydk-pixbuf and are facing errors? What errors are you getting? I didn’t get any errors in there.
AFAICT the sources used in Ardour date from before the time when the upstream library (gdk-pixbuf) added MSVC support. At first glance the DLL appears to build okay but there’s no link lib so nothing can link to ydk-pixbuf (at least, not here…).
Are you building without using the waf build system? During configure it should check for llvm-nm, and that makes .def files for some folders including ydk-pixbuf. Maybe in the long-term the llvm-nm dependency can be replaced, but until then, it’s a needed dependency.
No, I don’t use waf at all
Yes you’ll need to give that some thought. You reminded me that I once built a .def file generator but I stopped using it years ago. I just dug it out and tried it with ydk-pixbuf and it still worked!! Unfortunately it reminded me why I stopped using it…
…if you’re using .def files you can’t build optimized code ![]()
Can you elaborate on this?
Yes, though it might only be the case that you can’t build optimised code if you’re generating .def files.
.def file generators usually work by interrogating your built .obj files which need to be in a recognisable format, usually COFF (Common Object File Format). For optimised builds however, MSVC uses a private format which Microsoft hasn’t published anywhere (unless the llvm-nm folks managed to figure it out somehow?) If not there are two workarounds (possibly…)
-
Produce the .def file from unoptimised code in a Debug build and then use the same file for an optimised Release build. I’ve resorted to that sometimes but it’s not guaranteed to work. IIRC it usually works for ‘C’ code but it’s very hit-and-miss for C++
-
Run two Release builds. The first pass is unoptimised (to produce the .def file) and then rebuild all over again (optimised) but bypass the .def generation and let it use the already generated file.
Option #2 is the one I historically used for gdkmm / gtkmm etc and everything did build okay but I must admit, I never noticed any difference between a DLL built using option #2 and the same DLL built unoptimised. So it might be the case that neither #1 nor #2 does anything helpful ![]()
If anyone here can give you some Ardour sessions it might be worth downloading the official Ardour, then set everything up the same and compare your build with the official build. There’s no need to worry about optimisation unless you see an appreciable difference in the DSP readings.
zlib uses a .def file for windows, and glibmm also has some .def generator files that get compiled to executables. The code optimization angle feels orthogonal. I understand the format of .obj files might change based on compiler flags, but currently the .def generator strikes the right balance of writing symbols that would otherwise be unresolved, and not adding symbols that would be unresolved, so I don’t see a problem. If that changes when trying to build debug builds, I’ll figure out what the fix is.
Hence, I don’t see a reason to get session files.
I was going to share the updated script but I faced a few runtime problems after building Ardour. Figuring out the root cause of the problems will be tricky, and due to that there’ll be some more delays to sharing the updated script/steps. My best guess is that my problems have to do with the dependency versions in some way. Already got one fixed by updating cairo from 1.18.0 to 1.18.4.
Problems went after not using precompiled package for pango.
Here’s the updated script. But first:
-
(If you hasn’t yet installed xmake, you can go to xmake’s releases page, and download and run
xmake-dev.win64.exewhich is an installer for xmake that allows you to customize where xmake is installed to. -
Then make sure to run
xrepo update-repo. -
If preferring to not have the package downloading/installing happen in the C drive, set
XMAKE_GLOBALDIRbefore runningxmake f -cfollowed byxmake f -c -m debug.
(Also if you’ve run this before, you can runxrepo remove --all -yfirst to then do a clean rebuild of all dependencies) -
If wanting to have no prebuilt package, change:
...system = false})
to
...system = false, build = true})for both release/debug (though I didn’t see any precompiled debug packages so maybe it needn’t be added for debug?).
Save the following as xmake.lua before running xmake f -c / xmake f -c -m debug:
set_policy("package.sync_requires_to_deps", true)
if is_mode("debug") then
add_requireconfs("**", {configs = {debug = true, shared = true}, system = false})
else
add_requireconfs("**", {configs = {shared = true}, system = false})
end
if is_subhost("windows") then
add_requires("pkgconf")
else
add_requires("pkg-config")
end
add_requires("libcurl")
add_requires("boost")
add_requires("libogg")
add_requires("libflac")
add_requires("libopus")
add_requires("libvorbis")
add_requires("libsndfile")
add_requires("zlib")
add_requires("bzip2")
add_requires("lz4")
add_requires("zstd")
add_requires("openssl3")
add_requires("libarchive")
add_requires("liblo")
add_requires("utfcpp")
add_requires("taglib")
add_requires("vamp-plugin-sdk")
add_requires("libusb")
add_requires("rubberband")
add_requires("jack2")
add_requires("fftw")
add_requires("aubio")
add_requires("libxml2")
add_requires("cppunit")
add_requires("libwebsockets")
add_requires("portaudio", {configs = {asio = true}})
add_requires("libsamplerate")
add_requires("lv2")
add_requires("serd")
add_requires("zix")
add_requires("sord")
add_requires("sratom")
add_requires("lilv")
add_requires("libjpeg-turbo")
add_requires("libffi")
add_requires("libintl")
add_requires("pcre2")
add_requires("glib <2.89.2")
add_requires("fribidi")
add_requires("freetype")
add_requires("harfbuzz", {configs = {glib = true}})
add_requires("expat")
add_requires("fontconfig")
add_requires("libpng")
add_requires("pixman")
add_requires("cairo")
add_requires("pango", {build = true})
add_requires("libsigcplusplus <3.0.0")
add_requires("glibmm <2.68.0")
add_requires("cairomm <1.16.0")
add_requires("pangomm <2.48.0")
if is_plat("windows") then
add_requires("pthreads4w")
end
target("collect_deps")
set_kind("phony")
after_load(function()
import("core.project.project")
import("core.project.config")
local dest = path.join(os.projectdir(), config.mode() or "release")
local subdirs = {"include", "lib"}
if is_plat("windows") then table.insert(subdirs, "bin") end
for _, pkg in pairs(project.required_packages()) do
local dir = pkg:installdir()
if dir and os.isdir(dir) then
for _, sub in ipairs(subdirs) do
local src = path.join(dir, sub)
if os.isdir(src) then
for _, fp in ipairs(os.files(path.join(src, "**"))) do
local tgt = path.join(dest, sub, path.relative(fp, src))
os.mkdir(path.directory(tgt))
os.cp(fp, tgt)
end
end
end
end
end
end)
After this is done and makes a release folder, open developer command prompt or powershell to have llvm-nm in path, then prepend the path to release/bin for pkg-config, then set pkg_config_path to release/lib/pkgconfig.
Then when running python waf configure, pass release/include to --also-include, and release/lib to --also-libdir, and you should be able to build and install ardour.
e.g.: (I had the script in E:/mingwardour. In developer Powershell:)
(If release:)
$env:pkg_CONFIG_PATH = "E:\mingwardour/release\lib\pkgconfig"
$env:path = "E:\mingwardour\release\bin;$env:PATH"
(If debug:)
$env:pkg_CONFIG_PATH = "E:\mingwardour/debug\lib\pkgconfig"
$env:path = "E:\mingwardour\debug\bin;$env:PATH"
(go to where you want to clone ardour)
git clone https://github.com/ardour/ardour.git
cd ardour
python waf configure --prefix=C:\ArdourTest11 --configdir=share --ptformat --dist-target=msvc --cxx17 --optimize --also-include=E:\mingwardour/release/include --also-libdir=E:\mingwardour/release/lib
(For debug replace --optimize with --debug. It's probably good to change prefix too.)
python waf
python waf install
Then copy the dll’s (and .pdb’s if debug) from release/bin to the same folder as the place where ardour’s .exe is. Then it’ll run.
I was going to experiment with xmake’s github-actions, but given pango had to be built locally to not get errors, I’m dropping that plan.
With a few changes to ardour’s source code, ardour can be built debug already.
Where does the code that you pasted as verbatim (the one with add_requires) go?
I guess it’s a xmake script? does one copy/paste to some file, and then?
Save it to a file called xmake.lua, then run
xrepo update-repo-
xmake f -c(optionally with -y to skip needing to press enter after being shown what packages will get installed) - To have the debug libraries as well,
xmake f -c -m debug.