Gmock issue

John Ralls jralls at ceridwen.us
Thu Jan 11 10:08:40 EST 2018



> On Jan 11, 2018, at 5:32 AM, Geert Janssens <geert.gnucash at kobaltwit.be> wrote:
> 
> Op donderdag 11 januari 2018 11:20:45 CET schreef P Levine:
>>> On Jan 7, 2018, at 2:10 PM, John Ralls <jralls at ceridwen.us> wrote:
>>>> On Jan 7, 2018, at 8:36 AM, Fabio Coatti <fabio.coatti at gmail.com>
>>>> wrote:
>>>> 
>>>> Hi All,
>>>> I'm having a look at gnucash 2.7.3 but I'm unable to compile it, as the
>>>> compilation spews a
>>>> 
>>>> make[3]: *** No rule to make target '/gmock-all.cc', needed by
>>>> 'libgmock_a-gmock-all.o'.  Stop.
>>>> 
>>>> I'm using a fairly recent setup, gentoo with gcc 7.2.0 and gmock 1.7.0
>>>> installed and I'm unable to find exactly what the issue is. Any Help
>>>> would
>>>> be appreciated, as I'd like to look at 2.7 gnucash release :)
>>>> 
>>>> Thanks!
>>>> 
>>>> longer log:
>>>> 
>>>> GUILE_LOAD_PATH="../../libgnucash/gnc-module:${GUILE_LOAD_PATH}"
>>>> GUILE_LOAD_COMPILED_PATH="../../libgnucash/gnc-module:${GUILE_LOAD_COMPIL
>>>> ED_PATH}"
>>>> LD_LIBRARY_PATH="../../libgnucash/engine/.libs:../../libgnucash/gnc-modu
>>>> le/.libs:../../libgnucash/core-u tils/.libs:${LD_LIBRARY_PATH}"
>>>> DYLD_LIBRARY_PATH="../../libgnucash/engine/.libs:../../libgnucash/gnc-mod
>>>> ule/.libs:../../libgnucash/core-utils/.libs:${DYLD_LIBRARY_PATH}" \
>>>> /usr/bin/guild compile -o engine-utilities.go engine-utilities.scm
>>>> 
>>>> (process:3703): gnc.module-WARNING **: Could not locate module
>>>> gnucash/engine interface v.0
>>>> wrote `engine-utilities.go'
>>>> GNC_UNINSTALLED=yes \
>>>> GNC_BUILDDIR=../.. \
>>>> GUILE_LOAD_PATH="../../libgnucash/gnc-module:${GUILE_LOAD_PATH}"
>>>> GUILE_LOAD_COMPILED_PATH="../../libgnucash/gnc-module:${GUILE_LOAD_COMPIL
>>>> ED_PATH}"
>>>> LD_LIBRARY_PATH="../../libgnucash/engine/.libs:../../libgnucash/gnc-modu
>>>> le/.libs:../../libgnucash/core-u tils/.libs:${LD_LIBRARY_PATH}"
>>>> DYLD_LIBRARY_PATH="../../libgnucash/engine/.libs:../../libgnucash/gnc-mod
>>>> ule/.libs:../../libgnucash/core-utils/.libs:${DYLD_LIBRARY_PATH}" \
>>>> /usr/bin/guild compile -o gnc-numeric.go gnc-numeric.scm
>>>> wrote `gnc-numeric.go'
>>>> GNC_UNINSTALLED=yes \
>>>> GNC_BUILDDIR=../.. \
>>>> GUILE_LOAD_PATH="../../libgnucash/gnc-module:${GUILE_LOAD_PATH}"
>>>> GUILE_LOAD_COMPILED_PATH="../../libgnucash/gnc-module:${GUILE_LOAD_COMPIL
>>>> ED_PATH}"
>>>> LD_LIBRARY_PATH="../../libgnucash/engine/.libs:../../libgnucash/gnc-modu
>>>> le/.libs:../../libgnucash/core-u tils/.libs:${LD_LIBRARY_PATH}"
>>>> DYLD_LIBRARY_PATH="../../libgnucash/engine/.libs:../../libgnucash/gnc-mod
>>>> ule/.libs:../../libgnucash/core-utils/.libs:${DYLD_LIBRARY_PATH}" \
>>>> /usr/bin/guild compile -o engine.go engine.scm
>>>> wrote `engine.go'
>>>> GNC_UNINSTALLED=yes \
>>>> GNC_BUILDDIR=../.. \
>>>> GUILE_LOAD_PATH="../../libgnucash/gnc-module:${GUILE_LOAD_PATH}"
>>>> GUILE_LOAD_COMPILED_PATH="../../libgnucash/gnc-module:${GUILE_LOAD_COMPIL
>>>> ED_PATH}"
>>>> LD_LIBRARY_PATH="../../libgnucash/engine/.libs:../../libgnucash/gnc-modu
>>>> le/.libs:../../libgnucash/core-u tils/.libs:${LD_LIBRARY_PATH}"
>>>> DYLD_LIBRARY_PATH="../../libgnucash/engine/.libs:../../libgnucash/gnc-mod
>>>> ule/.libs:../../libgnucash/core-utils/.libs:${DYLD_LIBRARY_PATH}" \
>>>> /usr/bin/guild compile -o business-core.go business-core.scm
>>>> wrote `business-core.go'
>>>> make[5]: Leaving directory
>>>> '/var/tmp/portage/app-office/gnucash-2.7.3/work/gnucash-2.7.3/libgnucash/
>>>> engine'
>>>> 
>>>> Making all in test-core
>>>> make[5]: Entering directory
>>>> '/var/tmp/portage/app-office/gnucash-2.7.3/work/gnucash-2.7.3/libgnucash/
>>>> engine/test-core'
>>>> 
>>>> /bin/sh ../../../libtool  --tag=CXX   --mode=link g++ -Wall -Wno-unused
>>>> -Wno-deprecated-register -g -O2 -module  -o libgncmod-test-engine.la
>>>> gncmod-test-engine.lo test-engine-stuff.lo
>>>> ../../../libgnucash/gnc-module/
>>>> libgnc-module.la ../libgncmod-engine
>>>> .la -lgio-2.0 -lgthread-2.0 -pthread -lgobject-2.0 -Wl,--export-dynamic
>>>> -lgmodule-2.0 -pthread -lglib-2.0 -lm
>>>> libtool: link: rm -fr  .libs/libgncmod-test-engine.a .libs/
>>>> libgncmod-test-engine.la
>>>> libtool: link: ar cru .libs/libgncmod-test-engine.a
>>>> .libs/gncmod-test-engine.o .libs/test-engine-stuff.o
>>>> libtool: link: ranlib .libs/libgncmod-test-engine.a
>>>> libtool: link: ( cd ".libs" && rm -f "libgncmod-test-engine.la" && ln -s
>>>> "../libgncmod-test-engine.la" "libgncmod-test-engine.la" )
>>>> make[5]: Leaving directory
>>>> '/var/tmp/portage/app-office/gnucash-2.7.3/work/gnucash-2.7.3/libgnucash/
>>>> engine/test-core'
>>>> 
>>>> make[4]: Leaving directory
>>>> '/var/tmp/portage/app-office/gnucash-2.7.3/work/gnucash-2.7.3/libgnucash/
>>>> engine'
>>>> 
>>>> make[3]: Leaving directory
>>>> '/var/tmp/portage/app-office/gnucash-2.7.3/work/gnucash-2.7.3/libgnucash/
>>>> engine'
>>>> 
>>>> Making all in ../common/test-core
>>>> make[3]: Entering directory
>>>> '/var/tmp/portage/app-office/gnucash-2.7.3/work/gnucash-2.7.3/common/test
>>>> -core'
>>>> 
>>>> make[3]: *** No rule to make target '/gmock-all.cc', needed by
>>>> 'libgmock_a-gmock-all.o'.  Stop.
>>>> make[3]: Leaving directory
>>>> '/var/tmp/portage/app-office/gnucash-2.7.3/work/gnucash-2.7.3/common/test
>>>> -core'
>>>> 
>>>> make[2]: *** [Makefile:538: all-recursive] Error 1
>>>> make[2]: Leaving directory
>>>> '/var/tmp/portage/app-office/gnucash-2.7.3/work/gnucash-2.7.3/libgnucash'
>>>> make[1]: *** [Makefile:821: all-recursive] Error 1
>>>> make[1]: Leaving directory
>>>> '/var/tmp/portage/app-office/gnucash-2.7.3/work/gnucash-2.7.3'
>>>> make: *** [Makefile:675: all] Error 2
>>> 
>>> The googletest detection code is tuned for Debian and Fedora. There’s no
>>> way we can accommodate the peculiarities of every distro, so for those
>>> that do things differently there are configure options and environment
>>> variables to help.
>>> 
>>> In your case it looks like configure didn’t get the right information
>>> about gmock. Look at config.log to see why not then make the appropriate
>>> adjustments.
>>> 
>>> Regards,
>>> John Ralls
>> 
>> I've been aiding in the eventual Gentoo release of gnucash-2.7.3.  The
>> problem is that Gentoo installs headers and shared libraries by
>> default, not the sources.  The distro tries to dissuade building
>> bundled source for which there is already a separate package and
>> prefers to link directly to external libraries. And, it seems that
>> gnucash unconditionally tries to build gmock from source, even though
>> ${GMOCK_SRC_PATH} is not set.  Currently,
>> 'common/test-core/Makefile.am' is patched in Gentoo to prevent
>> building gmock.
>> 
>> So my question is this.  Would gnucash be willing to accept a patch to
>> the autotools files that would prevent building gmock if the
>> gmock_main library is found during configure?  Or, if not, a patch to
>> support a configure flag that would disable building gtest/gmock?
> 
> I would accept patches to fix using gmock's pre-built library instead of using 
> the source file. Provided using the source file continues to work as well of 
> course. Perhaps John may not for reasons I'm not aware of (yet) though.
> 
> However we're about to drop autotools support in favor of a cmake based build 
> environment. So it would be best if you tried to get that build system working 
> instead.
> 
> The cmake build files seem to check for the shared library first and will set 
> a variable if it's found. I haven't actually checked all the test build rules 
> to verify whether or not it's also effectively used. It should IMO. If not, 
> that could be considered a bug to be fixed.

I do have a question for the Gentoo folks, though: The Googletest documentation recommends *against* building googletest as a shared library [1]. I get that it means that googletest doesn’t really fit in the Linux distro’s standard model, but it seems a bit over the top to deliberately break building googletest as part of the project being tested given googletest’s usage guidelines.

So two questions back: Why not make an exception for Googletest? Why, if Gentoo is willing to patch Googletest to prevent projects from using it as recommended is Gentoo not willing to also patch those projects to comply with their policy?

Regards,
John Ralls

[1] https://github.com/google/googletest/blob/master/googletest/docs/FAQ.md#why-is-it-not-recommended-to-install-a-pre-compiled-copy-of-google-test-for-example-into-usrlocal <https://github.com/google/googletest/blob/master/googletest/docs/FAQ.md#why-is-it-not-recommended-to-install-a-pre-compiled-copy-of-google-test-for-example-into-usrlocal>



More information about the gnucash-devel mailing list