Build howto with homebrew, and running with dylibs

Post Reply
awwright
Posts: 3
Joined: Thu Dec 23, 2021 12:56 am
Real Name:

I'm trying to mod QLC+ for my own use, but I'm new to Qt and I find the build documentation isn't straightforward. I normally use Gentoo and I'm comfortable building programs.

I'd like to add some things to the wiki, however there doesn't seem to be a way to edit the wiki or submit a PR for it.

In https://github.com/mcallegari/qlcplus/w ... -build-Qt5:

Homebrew Dependencies

The dependencies may be installed with Homebrew:

Code: Select all

brew install libftdi libusb libusb-compat ola qt@5
Running (without installing)

If I try to run qlc-plus without installing, I get a strange runtime error like "Undefined symbol _ZN9WebAccessC1EP3DocP14VirtualConsoleP10SimpleDeskib7QStringP7QObject". This seems to be because qlc-plus is loading the shared libraries installed on the system, and not the ones that I built. If I run `make install` this solves the problem, but I shouldn't have to do this for every build. How can I run qlc-plus and have it default to search for the newly-built shared libraries? e.g. which value of LIBRARY_PATH am I looking for? The built shared libraries seem to be scattered all over the place.

I have this problem on macOS 12.0.1 and Ubuntu 21.10, can you please explain this on the wiki pages?
awwright
Posts: 3
Joined: Thu Dec 23, 2021 12:56 am
Real Name:

I ended up going through all of the *.so files that `make install` installs, and replacing them with a symlink to their sources. That seems to be the easiest way to do this, since setting LD_LIBRARY_PATH doesn't get searched for plugins.

This is best done by overriding the command used to install the shared libraries:

Code: Select all

sudo make QINSTALL_PROGRAM='ln -srf' install
Last edited by awwright on Wed Dec 29, 2021 6:21 am, edited 1 time in total.
User avatar
mcallegari
Posts: 4482
Joined: Sun Apr 12, 2015 9:09 am
Location: Italy
Real Name: Massimo Callegari
Contact:

I'm not sure what is the goal of this post...
The build instructions for macOS makes usage of MacPorts, not homebrew.
Last time I attempted to build with homebrew there was such a mess with the Qt libraries, so I gave up.
What you're experiencing could be that.

Nevertheless I'm gonna give it another spin, since all of the CI system use brew and not macports.
awwright
Posts: 3
Joined: Thu Dec 23, 2021 12:56 am
Real Name:

The goal is to edit the building instructions wiki page with some details that people might find useful.

I use Homebrew pretty extensively and `make; make install` worked out-of-the-box for me.

What didn't work is that `make` doesn't build the shared libraries in a place where QLC+ scans for them. So I had a crash with either (1) a newer QLC+ core trying to load older, incompatible shared libraries, or (2) no inputs/outputs show up because no plugins at all are loaded. (There's one line of code where this causes a crash, if a show file refers to a plugin that does not exist. I'll have a PR for this soon.)

How do you normally develop without `make install`? I'm hoping the wiki can describe this, too.
User avatar
mcallegari
Posts: 4482
Joined: Sun Apr 12, 2015 9:09 am
Location: Italy
Real Name: Massimo Callegari
Contact:

macOS works with bundles, not like Linux.
When you do make install (at least with macports), Qt creates a bundle (~/QLC+.app) and fill it with the necessary libraries.
However, the really hard task is performed by the scripts in platforms/macos, which relocates all the links to local libraries within the bundle with a tool named 'nametool'.
This is a sort of magic necessary on macOS to create a self contained bundle.
How do you normally develop without `make install`? I'm hoping the wiki can describe this, too.
Indeed I do make install, but everything goes into the bundle and is linked correctly. So basically I launch binaries inside the bundle or if I'm not interested in debug messages, I simply double click the bundle.
Post Reply