[GNC-dev] Gnucash built from git doesn't start

John Ralls jralls at ceridwen.us
Wed Oct 23 00:14:20 EDT 2019

> On Oct 22, 2019, at 3:18 PM, Lothar Paltins <lkpgcd at mailbox.org> wrote:
> Am 22.10.19 um 22:36 schrieb John Ralls:
>> Everything has trouble finding modules in non-standard locations. Use LD_LIBRARY_PATH to add those non-standard locations to the search paths for ld and dlopen.
> This doesn't seem to be an issue. The runtime paths in the binary are correctly set to /opt/gnucash/lib64 and /opt/gnucash/lib64/gnucash. Setting LD_LIBRARY_PATH doesn't help.
>> BTW, cmake puts the global config files--the ones that normally live in <prefix>/etc--in some strange subdirectory of /etc when <prefix> starts with /opt. GnuCash doesn't know about that and won't be able to find gnucash/environment, which may or may not break things. It does other strange things if <prefix> is /usr or starts with /usr/local, so life is easier if you install in a directory under $HOME, which also saves you needing to sudo for make install.
> The only strangely installed file I've found is /etc/opt/gnucash/gnucash/environment.
> As you've suggested, I've tried to install gnucash to $HOME/gnucash and now it works. Thanks for the hint.
> But IMHO this is a bug of the make and install procedure. Gnucash should search for a file in the same location as it installed it.

Sorry, I was thinking of the wrong part of module loading. The messages you got are from before the module is passed to dlopen and come from gnc_module_load_common (https://github.com/Gnucash/gnucash/blob/maint/libgnucash/gnc-module/gnc-module.c#L447).

That function does search, using the path set in $GNC_MODULE_PATH, and cmake writes that into <prefix>/etc/gnucash/environment. But if you specify <prefix> to be /opt/... or /usr/... in which case the <prefix> part is dropped and it goes to /etc/opt or just /etc respectively (see https://cmake.org/cmake/help/latest/module/GNUInstallDirs.html). The defect in GnuCash's code is that it doesn't trap that SYSCONFDIR adjustment so it doesn't load the environment file, doesn't set GNC_MODULE_PATH, and so can't find the modules.

John Ralls

More information about the gnucash-devel mailing list