[GNC-dev] GnuCash 3 on Linux

classic Classic list List threaded Threaded
9 messages Options
Reply | Threaded
Open this post in threaded view
|

[GNC-dev] GnuCash 3 on Linux

ChrisGood
Hi,

 

I'm working on my BackupGnuCash stand-alone app.

 

I have 2 questions today:

 

1.

I'm a little uncertain about where the saved reports and metadata files are
in GnuCash 3.0 for Linux.

I suspect they are by default:

~/.local/share/gnucash/saved-reports-2.4

~/.local/share/gnucash/books/[BOOK].gnucash.gcm

unless overridden by XDG_DATA_HOME.

 

Can some-one please confirm?

 

2.

I tried to get version 3 on Linux (Ubuntu 16.04) running to test myself.

I found gnucash_3.0-1 at the Debian Archive [1] but when I tried to install
it,

the following packages were not available:

 

guile-2.2-libs is only available for bionic (18.04LTS) -> 18.10

libaqbanking35 is available in 16.04 -> 18.10

libboost-*.62.0 only available in 17.10 -> 18.10

libgtk-3-0 (>= 3.21.5) only available on 17.10 -> 18.10

libgwenhywfar60 (>= 3.99.16) available on 14.04 -> 18.10

libicu57 (>= 57.1- only available on 17.10

 

Looks like I should upgrade to 18.04 (I mostly only use this VM for testing
GnuCash) or is there an easy way to install the required packages without
overriding the standard packages? I guess on 16.04, I could compile the new
package versions to /usr/local?

 

Maybe I should upgrade to 18.04 then try to build from gnucash maint source?

 

I'm a little worried the Debian Archive 3.0-1 was built on a system with a
not easily reproducible mixture of package versions. I cannot find any
documentation saying what you need to run it.

 

The https://wiki.gnucash.org/wiki/BuildUbuntu16.04 page mentions only
guile-2.0 not guile-2.2.

Does the current gnucash maint build OK on Ubuntu 18.04?

 

[1] http://ftp.us.debian.org/debian/pool/main/g/gnucash/

 

Thanks in advance,

 

Regards, Chris Good

 

_______________________________________________
gnucash-devel mailing list
[hidden email]
https://lists.gnucash.org/mailman/listinfo/gnucash-devel
Reply | Threaded
Open this post in threaded view
|

Re: [GNC-dev] GnuCash 3 on Linux

John Ralls-2


> On Jun 5, 2018, at 5:53 AM, Chris Good <[hidden email]> wrote:
>
> Hi,
>
>
>
> I'm working on my BackupGnuCash stand-alone app.
>
>
>
> I have 2 questions today:
>
>
>
> 1.
>
> I'm a little uncertain about where the saved reports and metadata files are
> in GnuCash 3.0 for Linux.
>
> I suspect they are by default:
>
> ~/.local/share/gnucash/saved-reports-2.4
>
> ~/.local/share/gnucash/books/[BOOK].gnucash.gcm
>
> unless overridden by XDG_DATA_HOME.
>
>
>
> Can some-one please confirm?
>
>
>
> 2.
>
> I tried to get version 3 on Linux (Ubuntu 16.04) running to test myself.
>
> I found gnucash_3.0-1 at the Debian Archive [1] but when I tried to install
> it,
>
> the following packages were not available:
>
>
>
> guile-2.2-libs is only available for bionic (18.04LTS) -> 18.10
>
> libaqbanking35 is available in 16.04 -> 18.10
>
> libboost-*.62.0 only available in 17.10 -> 18.10
>
> libgtk-3-0 (>= 3.21.5) only available on 17.10 -> 18.10
>
> libgwenhywfar60 (>= 3.99.16) available on 14.04 -> 18.10
>
> libicu57 (>= 57.1- only available on 17.10
>
>
>
> Looks like I should upgrade to 18.04 (I mostly only use this VM for testing
> GnuCash) or is there an easy way to install the required packages without
> overriding the standard packages? I guess on 16.04, I could compile the new
> package versions to /usr/local?
>
>
>
> Maybe I should upgrade to 18.04 then try to build from gnucash maint source?
>
>
>
> I'm a little worried the Debian Archive 3.0-1 was built on a system with a
> not easily reproducible mixture of package versions. I cannot find any
> documentation saying what you need to run it.
>
>
>
> The https://wiki.gnucash.org/wiki/BuildUbuntu16.04 page mentions only
> guile-2.0 not guile-2.2.
>
> Does the current gnucash maint build OK on Ubuntu 18.04?
>
>
>
> [1] http://ftp.us.debian.org/debian/pool/main/g/gnucash/
>

Chris,

Our Travis CI tests on Ubuntu 14.04 so it should work on any Ubuntu later than that. You can copy-and-paste the apt-get and git clone commands from https://github.com/Gnucash/gnucash/blob/maint/util/ci/ubuntu-14.04-docker <https://github.com/Gnucash/gnucash/blob/maint/util/ci/ubuntu-14.04-docker> to get a ready-to-go build environment.

Regards,
John Ralls


_______________________________________________
gnucash-devel mailing list
[hidden email]
https://lists.gnucash.org/mailman/listinfo/gnucash-devel
Reply | Threaded
Open this post in threaded view
|

Re: [GNC-dev] GnuCash 3 on Linux

Geert Janssens-4
In reply to this post by ChrisGood
Op dinsdag 5 juni 2018 14:53:44 CEST schreef Chris Good:

> Hi,
>
>
>
> I'm working on my BackupGnuCash stand-alone app.
>
>
>
> I have 2 questions today:
>
>
>
> 1.
>
> I'm a little uncertain about where the saved reports and metadata files are
> in GnuCash 3.0 for Linux.
>
> I suspect they are by default:
>
> ~/.local/share/gnucash/saved-reports-2.4
 2.8, not 2.4. If not 2.8 file is found, gnucash 3 and up will search for a
saved-reports-2.4, but it will only save to saved-reports-2.8.
>
> ~/.local/share/gnucash/books/[BOOK].gnucash.gcm
>

Yes. Do note it can be [BOOK].gnucash_<number>.gcm if you have several data
files named [BOOK]. And the gnucash part in that file name is only there if
the data file is called [BOOK].gnucash. Older versions of gnucash also allowed
to save to files without extension or with the .xac extension.
So it's really [BOOK-WITH-EXTENSION]<optional _NUMBER>.gcm

> unless overridden by XDG_DATA_HOME.
>
If you override XDG_DATA_HOME the files will be searched for and saved in
$XDG_DATA_HOME/gnucash/

However this can be overridden even with GNC_DATA_HOME. If that's set, gnucash
will search and save in
$GNC_DATA_HOME (which may or may not end in "/gnucash" unlike the
XDG_DATA_HOME to which gnucash will always append "/gnucash")

Regards,

Geert


_______________________________________________
gnucash-devel mailing list
[hidden email]
https://lists.gnucash.org/mailman/listinfo/gnucash-devel
Reply | Threaded
Open this post in threaded view
|

Re: [GNC-dev] GnuCash 3 on Linux

ChrisGood
In reply to this post by ChrisGood
> Message: 4
> Date: Tue, 5 Jun 2018 06:47:55 -0700
> From: John Ralls <[hidden email]>
> To: Chris Good <[hidden email]>
> Cc: [hidden email]
> Subject: Re: [GNC-dev] GnuCash 3 on Linux
> Message-ID: <[hidden email]>
> Content-Type: text/plain; charset=us-ascii
>
>
> > On Jun 5, 2018, at 5:53 AM, Chris Good <[hidden email]> wrote:
> >
> > Hi,
> >
> > I'm working on my BackupGnuCash stand-alone app.
> >
> > I have 2 questions today:
> >
> > 1.
> >
> > I'm a little uncertain about where the saved reports and metadata
> > files are in GnuCash 3.0 for Linux.
> >
> > I suspect they are by default:
> >
> > ~/.local/share/gnucash/saved-reports-2.4
> >
> > ~/.local/share/gnucash/books/[BOOK].gnucash.gcm
> >
> > unless overridden by XDG_DATA_HOME.
> >
> > Can some-one please confirm?
> >
> > 2.
> >
> > I tried to get version 3 on Linux (Ubuntu 16.04) running to test myself.
> >
> > I found gnucash_3.0-1 at the Debian Archive [1] but when I tried to
> > install it,
> >
> > the following packages were not available:
> >
> >
> > guile-2.2-libs is only available for bionic (18.04LTS) -> 18.10
> > libaqbanking35 is available in 16.04 -> 18.10
> > libboost-*.62.0 only available in 17.10 -> 18.10
> > libgtk-3-0 (>= 3.21.5) only available on 17.10 -> 18.10
> > libgwenhywfar60 (>= 3.99.16) available on 14.04 -> 18.10
> > libicu57 (>= 57.1- only available on 17.10
> >
> > Looks like I should upgrade to 18.04 (I mostly only use this VM for
> > testing
> > GnuCash) or is there an easy way to install the required packages
> > without overriding the standard packages? I guess on 16.04, I could
> > compile the new package versions to /usr/local?
> >
> > Maybe I should upgrade to 18.04 then try to build from gnucash maint
source?

> >
> > I'm a little worried the Debian Archive 3.0-1 was built on a system
> > with a not easily reproducible mixture of package versions. I cannot
> > find any documentation saying what you need to run it.
> >
> > The https://wiki.gnucash.org/wiki/BuildUbuntu16.04 page mentions only
> > guile-2.0 not guile-2.2.
> >
> > Does the current gnucash maint build OK on Ubuntu 18.04?
> >
> > [1] http://ftp.us.debian.org/debian/pool/main/g/gnucash/
>
> Chris,
>
> Our Travis CI tests on Ubuntu 14.04 so it should work on any Ubuntu later
than
> that. You can copy-and-paste the apt-get and git clone commands from
> https://github.com/Gnucash/gnucash/blob/maint/util/ci/ubuntu-14.04-docker
> <https://github.com/Gnucash/gnucash/blob/maint/util/ci/ubuntu-14.04-
> docker> to get a ready-to-go build environment.
>
> Regards,
> John Ralls
>
> ------------------------------

Hi John,

Thanks very much for your help.
A little more please...

On my Ubuntu 16.04:

sudo apt-get update -qq
sudo apt-get build-dep -qq gnucash > /dev/null
sudo apt-get install -qq git bash-completion cmake make swig xsltproc
libdbd-sqlite3 texinfo ninja-build libboost-all-dev libgtk-3-dev
libwebkit2gtk-3.0-dev > /dev/null
sudo apt-get --reinstall install -qq language-pack-en language-pack-fr
cd /home/cgood/github
git clone https://github.com/google/googletest -b release-1.8.0 gtest
 (created /home/cgood/github/gtest)

cd /home/cgood/github/gnucash-maint
git checkout maint
git pull --rebase upstream maint
git push origin maint

/home/cgood/github/gnucash-maint/README.dependencies :
        guile 2.2.0 or 2.0.0
        googletest          1.7.0

As 'make uninstall' didn't work from my 2.6.21 git repo:
  cd /home/cgood/github/gnucash-maint-install
  rm -r *

cd /home/cgood/github/gnucash-maint-build
rm -r *
cmake -G Ninja -D CMAKE_INSTALL_PREFIX=$HOME/github/gnucash-maint-install -D
WITH_AQBANKING=OFF \
   -D WITH_OFX=OFF -DGTEST_ROOT=$HOME/github/gtest/googletest
-DGMOCK_ROOT=$HOME/cgood/github/gtest/googlemock \
   ../gnucash-maint

 ninja
[5/892] Generating ../../lib/gnucash/scm/ccache/2.0/json.go
wrote
`/home/cgood/github/gnucash-maint-build/lib/gnucash/scm/ccache/2.0/json.go'
[22/892] Generating ../../../lib/gnucash/scm/ccache/2.0/json/syntax.go
wrote
`/home/cgood/github/gnucash-maint-build/lib/gnucash/scm/ccache/2.0/json/synt
ax.go'
[25/892] Generating ../../../lib/gnucash/scm/ccache/2.0/json/parser.go
wrote
`/home/cgood/github/gnucash-maint-build/lib/gnucash/scm/ccache/2.0/json/pars
er.go'
[28/892] Generating ../../../lib/gnucash/scm/ccache/2.0/json/builder.go
wrote
`/home/cgood/github/gnucash-maint-build/lib/gnucash/scm/ccache/2.0/json/buil
der.go'
[120/892] Building CXX object
common/test-core/CMakeFiles/gtest.dir/home/cgood/github/gtest/googletest/src
/gtest-all.cc.o
FAILED: /usr/bin/c++   -DHAVE_CONFIG_H -DHAVE_GUILE20 -Icommon
-I/home/cgood/github/gnucash-maint/common
-I/home/cgood/github/gnucash-maint/libgnucash/engine
-I/home/cgood/github/gnucash-maint/common/test-core -I/usr/include/glib-2.0
-I/usr/lib/x86_64-linux-gnu/glib-2.0/include -I/usr/include/guile/2.0
-I/home/cgood/github/gtest/googletest -Werror -Wall -Wmissing-declarations
-Wno-unused -Wno-error=parentheses -std=gnu++11    -Wno-missing-declarations
-MMD -MT
common/test-core/CMakeFiles/gtest.dir/home/cgood/github/gtest/googletest/src
/gtest-all.cc.o -MF
common/test-core/CMakeFiles/gtest.dir/home/cgood/github/gtest/googletest/src
/gtest-all.cc.o.d -o
common/test-core/CMakeFiles/gtest.dir/home/cgood/github/gtest/googletest/src
/gtest-all.cc.o -c /home/cgood/github/gtest/googletest/src/gtest-all.cc
In file included from
/home/cgood/github/gtest/googletest/src/gtest-all.cc:42:0:
/home/cgood/github/gtest/googletest/src/gtest.cc:35:41: fatal error:
gtest/internal/custom/gtest.h: No such file or directory
compilation terminated.
[120/892] Building CXX object
common/test-core/CMakeFiles/gmock.dir/home/cgood/github/gtest/googlemock/src
/gmock-all.cc.o
FAILED: /usr/bin/c++   -DHAVE_CONFIG_H -DHAVE_GUILE20 -Icommon
-I/home/cgood/github/gnucash-maint/common
-I/home/cgood/github/gnucash-maint/libgnucash/engine
-I/home/cgood/github/gnucash-maint/common/test-core -I/usr/include/glib-2.0
-I/usr/lib/x86_64-linux-gnu/glib-2.0/include -I/usr/include/guile/2.0
-I/home/cgood/github/gtest/googletest -I/home/cgood/github/gtest/googlemock
-Werror -Wall -Wmissing-declarations -Wno-unused -Wno-error=parentheses
-std=gnu++11    -Wno-missing-declarations -MMD -MT
common/test-core/CMakeFiles/gmock.dir/home/cgood/github/gtest/googlemock/src
/gmock-all.cc.o -MF
common/test-core/CMakeFiles/gmock.dir/home/cgood/github/gtest/googlemock/src
/gmock-all.cc.o.d -o
common/test-core/CMakeFiles/gmock.dir/home/cgood/github/gtest/googlemock/src
/gmock-all.cc.o -c /home/cgood/github/gtest/googlemock/src/gmock-all.cc
In file included from
/home/cgood/github/gtest/googlemock/src/gmock-all.cc:46:0:
/home/cgood/github/gtest/googlemock/src/gmock-spec-builders.cc:339:1: error:
prototype for 'testing::internal::UntypedActionResultHolderBase*
testing::internal::UntypedFunctionMockerBase::UntypedInvokeWith(const
void*)' does not match any in class
'testing::internal::UntypedFunctionMockerBase'
 UntypedFunctionMockerBase::UntypedInvokeWith(const void* const
untyped_args)
 ^
In file included from
/usr/include/gmock/gmock-generated-function-mockers.h:43:0,
                 from /usr/include/gmock/gmock.h:61,
                 from
/home/cgood/github/gtest/googlemock/src/gmock-all.cc:40:
/usr/include/gmock/gmock-spec-builders.h:214:40: error: candidate is: const
testing::internal::UntypedActionResultHolderBase*
testing::internal::UntypedFunctionMockerBase::UntypedInvokeWith(const void*)
   const UntypedActionResultHolderBase* UntypedInvokeWith(
                                        ^
ninja: build stopped: subcommand failed.

find ../gtest -name gtest.h
../gtest/googletest/include/gtest/internal/custom/gtest.h
../gtest/googletest/include/gtest/gtest.h

Regards, Chris Good

_______________________________________________
gnucash-devel mailing list
[hidden email]
https://lists.gnucash.org/mailman/listinfo/gnucash-devel
Reply | Threaded
Open this post in threaded view
|

Re: [GNC-dev] GnuCash 3 on Linux

John Ralls-2


> On 9. Jun 2018, at 00:17, Chris Good <[hidden email]> wrote:
>
> Hi John,
>
> Thanks very much for your help.
> A little more please...
>
> On my Ubuntu 16.04:
>
> sudo apt-get update -qq
> sudo apt-get build-dep -qq gnucash > /dev/null
> sudo apt-get install -qq git bash-completion cmake make swig xsltproc
> libdbd-sqlite3 texinfo ninja-build libboost-all-dev libgtk-3-dev
> libwebkit2gtk-3.0-dev > /dev/null
> sudo apt-get --reinstall install -qq language-pack-en language-pack-fr
> cd /home/cgood/github
> git clone https://github.com/google/googletest -b release-1.8.0 gtest
> (created /home/cgood/github/gtest)
>
> cd /home/cgood/github/gnucash-maint
> git checkout maint
> git pull --rebase upstream maint
> git push origin maint
>
> /home/cgood/github/gnucash-maint/README.dependencies :
> guile 2.2.0 or 2.0.0
> googletest          1.7.0
>
> As 'make uninstall' didn't work from my 2.6.21 git repo:
>  cd /home/cgood/github/gnucash-maint-install
>  rm -r *
>
> cd /home/cgood/github/gnucash-maint-build
> rm -r *
> cmake -G Ninja -D CMAKE_INSTALL_PREFIX=$HOME/github/gnucash-maint-install -D
> WITH_AQBANKING=OFF \
>   -D WITH_OFX=OFF -DGTEST_ROOT=$HOME/github/gtest/googletest
> -DGMOCK_ROOT=$HOME/cgood/github/gtest/googlemock \
>   ../gnucash-maint
>
> ninja
> [5/892] Generating ../../lib/gnucash/scm/ccache/2.0/json.go
> wrote
> `/home/cgood/github/gnucash-maint-build/lib/gnucash/scm/ccache/2.0/json.go'
> [22/892] Generating ../../../lib/gnucash/scm/ccache/2.0/json/syntax.go
> wrote
> `/home/cgood/github/gnucash-maint-build/lib/gnucash/scm/ccache/2.0/json/synt
> ax.go'
> [25/892] Generating ../../../lib/gnucash/scm/ccache/2.0/json/parser.go
> wrote
> `/home/cgood/github/gnucash-maint-build/lib/gnucash/scm/ccache/2.0/json/pars
> er.go'
> [28/892] Generating ../../../lib/gnucash/scm/ccache/2.0/json/builder.go
> wrote
> `/home/cgood/github/gnucash-maint-build/lib/gnucash/scm/ccache/2.0/json/buil
> der.go'
> [120/892] Building CXX object
> common/test-core/CMakeFiles/gtest.dir/home/cgood/github/gtest/googletest/src
> /gtest-all.cc.o
> FAILED: /usr/bin/c++   -DHAVE_CONFIG_H -DHAVE_GUILE20 -Icommon
> -I/home/cgood/github/gnucash-maint/common
> -I/home/cgood/github/gnucash-maint/libgnucash/engine
> -I/home/cgood/github/gnucash-maint/common/test-core -I/usr/include/glib-2.0
> -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -I/usr/include/guile/2.0
> -I/home/cgood/github/gtest/googletest -Werror -Wall -Wmissing-declarations
> -Wno-unused -Wno-error=parentheses -std=gnu++11    -Wno-missing-declarations
> -MMD -MT
> common/test-core/CMakeFiles/gtest.dir/home/cgood/github/gtest/googletest/src
> /gtest-all.cc.o -MF
> common/test-core/CMakeFiles/gtest.dir/home/cgood/github/gtest/googletest/src
> /gtest-all.cc.o.d -o
> common/test-core/CMakeFiles/gtest.dir/home/cgood/github/gtest/googletest/src
> /gtest-all.cc.o -c /home/cgood/github/gtest/googletest/src/gtest-all.cc
> In file included from
> /home/cgood/github/gtest/googletest/src/gtest-all.cc:42:0:
> /home/cgood/github/gtest/googletest/src/gtest.cc:35:41: fatal error:
> gtest/internal/custom/gtest.h: No such file or directory
> compilation terminated.
> [120/892] Building CXX object
> common/test-core/CMakeFiles/gmock.dir/home/cgood/github/gtest/googlemock/src
> /gmock-all.cc.o
> FAILED: /usr/bin/c++   -DHAVE_CONFIG_H -DHAVE_GUILE20 -Icommon
> -I/home/cgood/github/gnucash-maint/common
> -I/home/cgood/github/gnucash-maint/libgnucash/engine
> -I/home/cgood/github/gnucash-maint/common/test-core -I/usr/include/glib-2.0
> -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -I/usr/include/guile/2.0
> -I/home/cgood/github/gtest/googletest -I/home/cgood/github/gtest/googlemock
> -Werror -Wall -Wmissing-declarations -Wno-unused -Wno-error=parentheses
> -std=gnu++11    -Wno-missing-declarations -MMD -MT
> common/test-core/CMakeFiles/gmock.dir/home/cgood/github/gtest/googlemock/src
> /gmock-all.cc.o -MF
> common/test-core/CMakeFiles/gmock.dir/home/cgood/github/gtest/googlemock/src
> /gmock-all.cc.o.d -o
> common/test-core/CMakeFiles/gmock.dir/home/cgood/github/gtest/googlemock/src
> /gmock-all.cc.o -c /home/cgood/github/gtest/googlemock/src/gmock-all.cc
> In file included from
> /home/cgood/github/gtest/googlemock/src/gmock-all.cc:46:0:
> /home/cgood/github/gtest/googlemock/src/gmock-spec-builders.cc:339:1: error:
> prototype for 'testing::internal::UntypedActionResultHolderBase*
> testing::internal::UntypedFunctionMockerBase::UntypedInvokeWith(const
> void*)' does not match any in class
> 'testing::internal::UntypedFunctionMockerBase'
> UntypedFunctionMockerBase::UntypedInvokeWith(const void* const
> untyped_args)
> ^
> In file included from
> /usr/include/gmock/gmock-generated-function-mockers.h:43:0,
>                 from /usr/include/gmock/gmock.h:61,
>                 from
> /home/cgood/github/gtest/googlemock/src/gmock-all.cc:40:
> /usr/include/gmock/gmock-spec-builders.h:214:40: error: candidate is: const
> testing::internal::UntypedActionResultHolderBase*
> testing::internal::UntypedFunctionMockerBase::UntypedInvokeWith(const void*)
>   const UntypedActionResultHolderBase* UntypedInvokeWith(
>                                        ^
> ninja: build stopped: subcommand failed.
>
> find ../gtest -name gtest.h
> ../gtest/googletest/include/gtest/internal/custom/gtest.h
> ../gtest/googletest/include/gtest/gtest.h

Chris,

There's an include argument missing from the compile instructions:
  -I/home/cgood/github/gtest/googletest/include

Grep CMakeCache.txt for GTEST_INCLUDE_DIR. It should return
  GTEST_INCLUDE_DIR:PATH=/home/cgood/github/gtest/googletest/include

GTEST_INCLUDE_DIR is passed to target_include_directories() at common/test-core/CMakeLists.txt line 79.

If GTEST_INCLUDE_DIR isn't set cmake should fail, complaining that it can't find googletest. You'll need to examine the CMake logs to see why it's not getting included.

Regards,
John Ralls



_______________________________________________
gnucash-devel mailing list
[hidden email]
https://lists.gnucash.org/mailman/listinfo/gnucash-devel
Reply | Threaded
Open this post in threaded view
|

Re: [GNC-dev] GnuCash 3 on Linux

ChrisGood
> -----Original Message-----
> From: John Ralls <[hidden email]>
> Sent: Sunday, 10 June 2018 6:13 AM
> To: Chris Good <[hidden email]>
> Cc: [hidden email]
> Subject: Re: [GNC-dev] GnuCash 3 on Linux
>
>
>
> > On 9. Jun 2018, at 00:17, Chris Good <[hidden email]> wrote:
> >
> > Hi John,
> >
> > Thanks very much for your help.
> > A little more please...
> >
> > On my Ubuntu 16.04:
> >
> > sudo apt-get update -qq
> > sudo apt-get build-dep -qq gnucash > /dev/null sudo apt-get install
> > -qq git bash-completion cmake make swig xsltproc
> > libdbd-sqlite3 texinfo ninja-build libboost-all-dev libgtk-3-dev
> > libwebkit2gtk-3.0-dev > /dev/null sudo apt-get --reinstall install -qq
> > language-pack-en language-pack-fr cd /home/cgood/github git clone
> > https://github.com/google/googletest -b release-1.8.0 gtest (created
> > /home/cgood/github/gtest)
> >
> > cd /home/cgood/github/gnucash-maint
> > git checkout maint
> > git pull --rebase upstream maint
> > git push origin maint
> >
> > /home/cgood/github/gnucash-maint/README.dependencies :
> > guile 2.2.0 or 2.0.0
> > googletest          1.7.0
> >
> > As 'make uninstall' didn't work from my 2.6.21 git repo:
> >  cd /home/cgood/github/gnucash-maint-install
> >  rm -r *
> >
> > cd /home/cgood/github/gnucash-maint-build
> > rm -r *
> > cmake -G Ninja -D
> > CMAKE_INSTALL_PREFIX=$HOME/github/gnucash-maint-install -D
> WITH_AQBANKING=OFF \
> >   -D WITH_OFX=OFF -DGTEST_ROOT=$HOME/github/gtest/googletest
> > -DGMOCK_ROOT=$HOME/cgood/github/gtest/googlemock \
> >   ../gnucash-maint
> >
> > ninja
> > [5/892] Generating ../../lib/gnucash/scm/ccache/2.0/json.go
> > wrote
> > `/home/cgood/github/gnucash-maint-
> build/lib/gnucash/scm/ccache/2.0/json.go'
> > [22/892] Generating ../../../lib/gnucash/scm/ccache/2.0/json/syntax.go
> > wrote
> > `/home/cgood/github/gnucash-maint-build/lib/gnucash/scm/ccache/2.0/jso
> > n/synt
> > ax.go'
> > [25/892] Generating ../../../lib/gnucash/scm/ccache/2.0/json/parser.go
> > wrote
> > `/home/cgood/github/gnucash-maint-build/lib/gnucash/scm/ccache/2.0/jso
> > n/pars
> > er.go'
> > [28/892] Generating
> > ../../../lib/gnucash/scm/ccache/2.0/json/builder.go
> > wrote
> > `/home/cgood/github/gnucash-maint-build/lib/gnucash/scm/ccache/2.0/jso
> > n/buil
> > der.go'
> > [120/892] Building CXX object
> > common/test-core/CMakeFiles/gtest.dir/home/cgood/github/gtest/googlete
> > st/src
> > /gtest-all.cc.o
> > FAILED: /usr/bin/c++   -DHAVE_CONFIG_H -DHAVE_GUILE20 -Icommon
> > -I/home/cgood/github/gnucash-maint/common
> > -I/home/cgood/github/gnucash-maint/libgnucash/engine
> > -I/home/cgood/github/gnucash-maint/common/test-core
> > -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include
> > -I/usr/include/guile/2.0 -I/home/cgood/github/gtest/googletest -Werror -
> Wall -Wmissing-declarations
> > -Wno-unused -Wno-error=parentheses -std=gnu++11    -Wno-missing-
> declarations
> > -MMD -MT
> > common/test-core/CMakeFiles/gtest.dir/home/cgood/github/gtest/googlete
> > st/src
> > /gtest-all.cc.o -MF
> > common/test-core/CMakeFiles/gtest.dir/home/cgood/github/gtest/googlete
> > st/src
> > /gtest-all.cc.o.d -o
> > common/test-core/CMakeFiles/gtest.dir/home/cgood/github/gtest/googlete
> > st/src /gtest-all.cc.o -c
> > /home/cgood/github/gtest/googletest/src/gtest-all.cc
> > In file included from
> > /home/cgood/github/gtest/googletest/src/gtest-all.cc:42:0:
> > /home/cgood/github/gtest/googletest/src/gtest.cc:35:41: fatal error:
> > gtest/internal/custom/gtest.h: No such file or directory compilation
> > terminated.
> > [120/892] Building CXX object
> > common/test-
> core/CMakeFiles/gmock.dir/home/cgood/github/gtest/googlemo
> > ck/src
> > /gmock-all.cc.o
> > FAILED: /usr/bin/c++   -DHAVE_CONFIG_H -DHAVE_GUILE20 -Icommon
> > -I/home/cgood/github/gnucash-maint/common
> > -I/home/cgood/github/gnucash-maint/libgnucash/engine
> > -I/home/cgood/github/gnucash-maint/common/test-core
> > -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include
> > -I/usr/include/guile/2.0 -I/home/cgood/github/gtest/googletest
> > -I/home/cgood/github/gtest/googlemock
> > -Werror -Wall -Wmissing-declarations -Wno-unused -Wno-error=parentheses
> > -std=gnu++11    -Wno-missing-declarations -MMD -MT
> > common/test-
> core/CMakeFiles/gmock.dir/home/cgood/github/gtest/googlemo
> > ck/src
> > /gmock-all.cc.o -MF
> > common/test-
> core/CMakeFiles/gmock.dir/home/cgood/github/gtest/googlemo
> > ck/src
> > /gmock-all.cc.o.d -o
> > common/test-
> core/CMakeFiles/gmock.dir/home/cgood/github/gtest/googlemo
> > ck/src /gmock-all.cc.o -c
> > /home/cgood/github/gtest/googlemock/src/gmock-all.cc
> > In file included from
> > /home/cgood/github/gtest/googlemock/src/gmock-all.cc:46:0:
> > /home/cgood/github/gtest/googlemock/src/gmock-spec-builders.cc:339:1:
> error:
> > prototype for 'testing::internal::UntypedActionResultHolderBase*
> > testing::internal::UntypedFunctionMockerBase::UntypedInvokeWith(const
> > void*)' does not match any in class
> > 'testing::internal::UntypedFunctionMockerBase'
> > UntypedFunctionMockerBase::UntypedInvokeWith(const void* const
> > untyped_args)
> > ^
> > In file included from
> > /usr/include/gmock/gmock-generated-function-mockers.h:43:0,
> >                 from /usr/include/gmock/gmock.h:61,
> >                 from
> > /home/cgood/github/gtest/googlemock/src/gmock-all.cc:40:
> > /usr/include/gmock/gmock-spec-builders.h:214:40: error: candidate is:
> > const
> > testing::internal::UntypedActionResultHolderBase*
> > testing::internal::UntypedFunctionMockerBase::UntypedInvokeWith(const
> void*)
> >   const UntypedActionResultHolderBase* UntypedInvokeWith(
> >                                        ^
> > ninja: build stopped: subcommand failed.
> >
> > find ../gtest -name gtest.h
> > ../gtest/googletest/include/gtest/internal/custom/gtest.h
> > ../gtest/googletest/include/gtest/gtest.h
>
> Chris,
>
> There's an include argument missing from the compile instructions:
>   -I/home/cgood/github/gtest/googletest/include
>
> Grep CMakeCache.txt for GTEST_INCLUDE_DIR. It should return
>   GTEST_INCLUDE_DIR:PATH=/home/cgood/github/gtest/googletest/include
>
> GTEST_INCLUDE_DIR is passed to target_include_directories() at
common/test-
> core/CMakeLists.txt line 79.
>
> If GTEST_INCLUDE_DIR isn't set cmake should fail, complaining that it
can't find
> googletest. You'll need to examine the CMake logs to see why it's not
getting
> included.
>
> Regards,
> John Ralls
>
>

Hi John,

Thanks very much for your help which got me on the right direction (I
haven't tried to fix a problem with cmake or ninja before).

I couldn't find anything in the cmake logs
(gnucash-maint-build/CMakeFiles/[CMakeError.log|CMakeOutput.log])
about GTEST or gtest but I found:
gnucash-maint/common/cmake_modules/GncAddTest.cmake:

  find_path(GTEST_INCLUDE_DIR gtest/gtest.h
    PATHS ${GTEST_ROOT}/include ${GMOCK_ROOT}/gtest/include /usr/include)

grep GTEST_INCLUDE_DIR CMakeCache.txt shows:
  GTEST_INCLUDE_DIR:PATH=/usr/include

So somehow cmake find_path is not finding $GTEST_ROOT/include/gtest/gtest.h
(which does exist), but /usr/include/gtest/gtest.h which is version
1.7.0-4ubuntu1
which I installed following instructions at
https://wiki.gnucash.org/wiki/BuildUbuntu16.04#GnucCash_Dependencies.

There is no /usr/include/gtest/internal/custom/gtest.h.

As no packages depend on google-mock or libgtest-dev on my system,
I have uninstalled them, and now cmake finds the correct gtest headers
and I have successfully built gnucash.

Shouldn't cmake (3.5.1-1ubuntu1) find_path() have tried to use the first
path (using GTEST_ROOT)?
The documentation
https://cmake.org/cmake/help/v3.5/command/find_path.html?highlight=find_path
doesn't specifically say that but it seems logical to me.

Regards, Chris Good

_______________________________________________
gnucash-devel mailing list
[hidden email]
https://lists.gnucash.org/mailman/listinfo/gnucash-devel
Reply | Threaded
Open this post in threaded view
|

Re: [GNC-dev] GnuCash 3 on Linux

Geert Janssens-4
Op zondag 10 juni 2018 11:07:36 CEST schreef Chris Good:

> > -----Original Message-----
> > From: John Ralls <[hidden email]>
> > Sent: Sunday, 10 June 2018 6:13 AM
> > To: Chris Good <[hidden email]>
> > Cc: [hidden email]
> > Subject: Re: [GNC-dev] GnuCash 3 on Linux
> >
> > > On 9. Jun 2018, at 00:17, Chris Good <[hidden email]> wrote:
> > >
> > > Hi John,
> > >
> > > Thanks very much for your help.
> > > A little more please...
> > >
> > > On my Ubuntu 16.04:
> > >
> > > sudo apt-get update -qq
> > > sudo apt-get build-dep -qq gnucash > /dev/null sudo apt-get install
> > > -qq git bash-completion cmake make swig xsltproc
> > > libdbd-sqlite3 texinfo ninja-build libboost-all-dev libgtk-3-dev
> > > libwebkit2gtk-3.0-dev > /dev/null sudo apt-get --reinstall install -qq
> > > language-pack-en language-pack-fr cd /home/cgood/github git clone
> > > https://github.com/google/googletest -b release-1.8.0 gtest (created
> > > /home/cgood/github/gtest)
> > >
> > > cd /home/cgood/github/gnucash-maint
> > > git checkout maint
> > > git pull --rebase upstream maint
> > > git push origin maint
> > >
> > > /home/cgood/github/gnucash-maint/README.dependencies :
> > > guile 2.2.0 or 2.0.0
> > > googletest          1.7.0
> > >
> > > As 'make uninstall' didn't work from my 2.6.21 git repo:
> > >  cd /home/cgood/github/gnucash-maint-install
> > >  rm -r *
> > >
> > > cd /home/cgood/github/gnucash-maint-build
> > > rm -r *
> > > cmake -G Ninja -D
> > > CMAKE_INSTALL_PREFIX=$HOME/github/gnucash-maint-install -D
> >
> > WITH_AQBANKING=OFF \
> >
> > >   -D WITH_OFX=OFF -DGTEST_ROOT=$HOME/github/gtest/googletest
> > >
> > > -DGMOCK_ROOT=$HOME/cgood/github/gtest/googlemock \
> > >
> > >   ../gnucash-maint
> > >
> > > ninja
> > > [5/892] Generating ../../lib/gnucash/scm/ccache/2.0/json.go
> > > wrote
> > > `/home/cgood/github/gnucash-maint-
> >
> > build/lib/gnucash/scm/ccache/2.0/json.go'
> >
> > > [22/892] Generating ../../../lib/gnucash/scm/ccache/2.0/json/syntax.go
> > > wrote
> > > `/home/cgood/github/gnucash-maint-build/lib/gnucash/scm/ccache/2.0/jso
> > > n/synt
> > > ax.go'
> > > [25/892] Generating ../../../lib/gnucash/scm/ccache/2.0/json/parser.go
> > > wrote
> > > `/home/cgood/github/gnucash-maint-build/lib/gnucash/scm/ccache/2.0/jso
> > > n/pars
> > > er.go'
> > > [28/892] Generating
> > > ../../../lib/gnucash/scm/ccache/2.0/json/builder.go
> > > wrote
> > > `/home/cgood/github/gnucash-maint-build/lib/gnucash/scm/ccache/2.0/jso
> > > n/buil
> > > der.go'
> > > [120/892] Building CXX object
> > > common/test-core/CMakeFiles/gtest.dir/home/cgood/github/gtest/googlete
> > > st/src
> > > /gtest-all.cc.o
> > > FAILED: /usr/bin/c++   -DHAVE_CONFIG_H -DHAVE_GUILE20 -Icommon
> > > -I/home/cgood/github/gnucash-maint/common
> > > -I/home/cgood/github/gnucash-maint/libgnucash/engine
> > > -I/home/cgood/github/gnucash-maint/common/test-core
> > > -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include
> > > -I/usr/include/guile/2.0 -I/home/cgood/github/gtest/googletest -Werror -
> >
> > Wall -Wmissing-declarations
> >
> > > -Wno-unused -Wno-error=parentheses -std=gnu++11    -Wno-missing-
> >
> > declarations
> >
> > > -MMD -MT
> > > common/test-core/CMakeFiles/gtest.dir/home/cgood/github/gtest/googlete
> > > st/src
> > > /gtest-all.cc.o -MF
> > > common/test-core/CMakeFiles/gtest.dir/home/cgood/github/gtest/googlete
> > > st/src
> > > /gtest-all.cc.o.d -o
> > > common/test-core/CMakeFiles/gtest.dir/home/cgood/github/gtest/googlete
> > > st/src /gtest-all.cc.o -c
> > > /home/cgood/github/gtest/googletest/src/gtest-all.cc
> > > In file included from
> > > /home/cgood/github/gtest/googletest/src/gtest-all.cc:42:0:
> > > /home/cgood/github/gtest/googletest/src/gtest.cc:35:41: fatal error:
> > > gtest/internal/custom/gtest.h: No such file or directory compilation
> > > terminated.
> > > [120/892] Building CXX object
> > > common/test-
> >
> > core/CMakeFiles/gmock.dir/home/cgood/github/gtest/googlemo
> >
> > > ck/src
> > > /gmock-all.cc.o
> > > FAILED: /usr/bin/c++   -DHAVE_CONFIG_H -DHAVE_GUILE20 -Icommon
> > > -I/home/cgood/github/gnucash-maint/common
> > > -I/home/cgood/github/gnucash-maint/libgnucash/engine
> > > -I/home/cgood/github/gnucash-maint/common/test-core
> > > -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include
> > > -I/usr/include/guile/2.0 -I/home/cgood/github/gtest/googletest
> > > -I/home/cgood/github/gtest/googlemock
> > > -Werror -Wall -Wmissing-declarations -Wno-unused -Wno-error=parentheses
> > > -std=gnu++11    -Wno-missing-declarations -MMD -MT
> > > common/test-
> >
> > core/CMakeFiles/gmock.dir/home/cgood/github/gtest/googlemo
> >
> > > ck/src
> > > /gmock-all.cc.o -MF
> > > common/test-
> >
> > core/CMakeFiles/gmock.dir/home/cgood/github/gtest/googlemo
> >
> > > ck/src
> > > /gmock-all.cc.o.d -o
> > > common/test-
> >
> > core/CMakeFiles/gmock.dir/home/cgood/github/gtest/googlemo
> >
> > > ck/src /gmock-all.cc.o -c
> > > /home/cgood/github/gtest/googlemock/src/gmock-all.cc
> > > In file included from
> > > /home/cgood/github/gtest/googlemock/src/gmock-all.cc:46:0:
> >
> > > /home/cgood/github/gtest/googlemock/src/gmock-spec-builders.cc:339:1:
> > error:
> > > prototype for 'testing::internal::UntypedActionResultHolderBase*
> > > testing::internal::UntypedFunctionMockerBase::UntypedInvokeWith(const
> > > void*)' does not match any in class
> > > 'testing::internal::UntypedFunctionMockerBase'
> > > UntypedFunctionMockerBase::UntypedInvokeWith(const void* const
> > > untyped_args)
> > > ^
> > > In file included from
> > > /usr/include/gmock/gmock-generated-function-mockers.h:43:0,
> > >
> > >                 from /usr/include/gmock/gmock.h:61,
> > >                 from
> > >
> > > /home/cgood/github/gtest/googlemock/src/gmock-all.cc:40:
> > > /usr/include/gmock/gmock-spec-builders.h:214:40: error: candidate is:
> > > const
> > > testing::internal::UntypedActionResultHolderBase*
> > > testing::internal::UntypedFunctionMockerBase::UntypedInvokeWith(const
> >
> > void*)
> >
> > >   const UntypedActionResultHolderBase* UntypedInvokeWith(
> > >  
> > >                                        ^
> > >
> > > ninja: build stopped: subcommand failed.
> > >
> > > find ../gtest -name gtest.h
> > > ../gtest/googletest/include/gtest/internal/custom/gtest.h
> > > ../gtest/googletest/include/gtest/gtest.h
> >
> > Chris,
> >
> > There's an include argument missing from the compile instructions:
> >   -I/home/cgood/github/gtest/googletest/include
> >
> > Grep CMakeCache.txt for GTEST_INCLUDE_DIR. It should return
> >
> >   GTEST_INCLUDE_DIR:PATH=/home/cgood/github/gtest/googletest/include
> >
> > GTEST_INCLUDE_DIR is passed to target_include_directories() at
>
> common/test-
>
> > core/CMakeLists.txt line 79.
> >
> > If GTEST_INCLUDE_DIR isn't set cmake should fail, complaining that it
>
> can't find
>
> > googletest. You'll need to examine the CMake logs to see why it's not
>
> getting
>
> > included.
> >
> > Regards,
> > John Ralls
>
> Hi John,
>
> Thanks very much for your help which got me on the right direction (I
> haven't tried to fix a problem with cmake or ninja before).
>
> I couldn't find anything in the cmake logs
> (gnucash-maint-build/CMakeFiles/[CMakeError.log|CMakeOutput.log])
> about GTEST or gtest but I found:
> gnucash-maint/common/cmake_modules/GncAddTest.cmake:
>
>   find_path(GTEST_INCLUDE_DIR gtest/gtest.h
>     PATHS ${GTEST_ROOT}/include ${GMOCK_ROOT}/gtest/include /usr/include)
>
> grep GTEST_INCLUDE_DIR CMakeCache.txt shows:
>   GTEST_INCLUDE_DIR:PATH=/usr/include
>
> So somehow cmake find_path is not finding $GTEST_ROOT/include/gtest/gtest.h
> (which does exist), but /usr/include/gtest/gtest.h which is version
> 1.7.0-4ubuntu1
> which I installed following instructions at
> https://wiki.gnucash.org/wiki/BuildUbuntu16.04#GnucCash_Dependencies.
>
> There is no /usr/include/gtest/internal/custom/gtest.h.
>
> As no packages depend on google-mock or libgtest-dev on my system,
> I have uninstalled them, and now cmake finds the correct gtest headers
> and I have successfully built gnucash.
>
> Shouldn't cmake (3.5.1-1ubuntu1) find_path() have tried to use the first
> path (using GTEST_ROOT)?
> The documentation
> https://cmake.org/cmake/help/v3.5/command/find_path.html?highlight=find_path
> doesn't specifically say that but it seems logical to me.
>
According to the page you link to system paths are searched before directories
added via PATHS. Considering we base our search on parameters already set
(GTEST_ROOT and GMOCK_ROOT) we probably should use HINTS instead of PATHS as
directories specified with HINTS take precedence over system paths.

Can you run this experiment ? That is
- change PATHS to HINTS in the line above and the other find_path calls
further down the macro
- reinstall gtest 1.7.0
- rerun ninja
- verify it still finds your correct local googletest instead of the system
installed one.

Geert


_______________________________________________
gnucash-devel mailing list
[hidden email]
https://lists.gnucash.org/mailman/listinfo/gnucash-devel
Reply | Threaded
Open this post in threaded view
|

Re: [GNC-dev] GnuCash 3 on Linux

ChrisGood
> -----Original Message-----
> From: Geert Janssens <[hidden email]>
> Sent: Sunday, 10 June 2018 8:16 PM
> To: [hidden email]
> Cc: Chris Good <[hidden email]>; 'John Ralls' <[hidden email]>
> Subject: Re: [GNC-dev] GnuCash 3 on Linux
>
> Op zondag 10 juni 2018 11:07:36 CEST schreef Chris Good:
> > > -----Original Message-----
> > > From: John Ralls <[hidden email]>
> > > Sent: Sunday, 10 June 2018 6:13 AM
> > > To: Chris Good <[hidden email]>
> > > Cc: [hidden email]
> > > Subject: Re: [GNC-dev] GnuCash 3 on Linux
> > >
> > > > On 9. Jun 2018, at 00:17, Chris Good <[hidden email]> wrote:
> > > >
> > > > Hi John,
> > > >
> > > > Thanks very much for your help.
> > > > A little more please...
> > > >
> > > > On my Ubuntu 16.04:
> > > >
> > > > sudo apt-get update -qq
> > > > sudo apt-get build-dep -qq gnucash > /dev/null sudo apt-get
> > > > install -qq git bash-completion cmake make swig xsltproc
> > > > libdbd-sqlite3 texinfo ninja-build libboost-all-dev libgtk-3-dev
> > > > libwebkit2gtk-3.0-dev > /dev/null sudo apt-get --reinstall install
> > > > -qq language-pack-en language-pack-fr cd /home/cgood/github git
> > > > clone https://github.com/google/googletest -b release-1.8.0 gtest
> > > > (created
> > > > /home/cgood/github/gtest)
> > > >
> > > > cd /home/cgood/github/gnucash-maint git checkout maint git pull
> > > > --rebase upstream maint git push origin maint
> > > >
> > > > /home/cgood/github/gnucash-maint/README.dependencies :
> > > > guile 2.2.0 or 2.0.0
> > > > googletest          1.7.0
> > > >
> > > > As 'make uninstall' didn't work from my 2.6.21 git repo:
> > > >  cd /home/cgood/github/gnucash-maint-install
> > > >  rm -r *
> > > >
> > > > cd /home/cgood/github/gnucash-maint-build
> > > > rm -r *
> > > > cmake -G Ninja -D
> > > > CMAKE_INSTALL_PREFIX=$HOME/github/gnucash-maint-install -D
> > >
> > > WITH_AQBANKING=OFF \
> > >
> > > >   -D WITH_OFX=OFF -DGTEST_ROOT=$HOME/github/gtest/googletest
> > > >
> > > > -DGMOCK_ROOT=$HOME/cgood/github/gtest/googlemock \
> > > >
> > > >   ../gnucash-maint
> > > >
> > > > ninja
> > > > [5/892] Generating ../../lib/gnucash/scm/ccache/2.0/json.go
> > > > wrote
> > > > `/home/cgood/github/gnucash-maint-
> > >
> > > build/lib/gnucash/scm/ccache/2.0/json.go'
> > >
> > > > [22/892] Generating
> > > > ../../../lib/gnucash/scm/ccache/2.0/json/syntax.go
> > > > wrote
> > > > `/home/cgood/github/gnucash-maint-build/lib/gnucash/scm/ccache/2.0
> > > > /jso
> > > > n/synt
> > > > ax.go'
> > > > [25/892] Generating
> > > > ../../../lib/gnucash/scm/ccache/2.0/json/parser.go
> > > > wrote
> > > > `/home/cgood/github/gnucash-maint-build/lib/gnucash/scm/ccache/2.0
> > > > /jso
> > > > n/pars
> > > > er.go'
> > > > [28/892] Generating
> > > > ../../../lib/gnucash/scm/ccache/2.0/json/builder.go
> > > > wrote
> > > > `/home/cgood/github/gnucash-maint-build/lib/gnucash/scm/ccache/2.0
> > > > /jso
> > > > n/buil
> > > > der.go'
> > > > [120/892] Building CXX object
> > > > common/test-core/CMakeFiles/gtest.dir/home/cgood/github/gtest/goog
> > > > lete
> > > > st/src
> > > > /gtest-all.cc.o
> > > > FAILED: /usr/bin/c++   -DHAVE_CONFIG_H -DHAVE_GUILE20 -Icommon
> > > > -I/home/cgood/github/gnucash-maint/common
> > > > -I/home/cgood/github/gnucash-maint/libgnucash/engine
> > > > -I/home/cgood/github/gnucash-maint/common/test-core
> > > > -I/usr/include/glib-2.0
> > > > -I/usr/lib/x86_64-linux-gnu/glib-2.0/include
> > > > -I/usr/include/guile/2.0 -I/home/cgood/github/gtest/googletest
> > > > -Werror -
> > >
> > > Wall -Wmissing-declarations
> > >
> > > > -Wno-unused -Wno-error=parentheses -std=gnu++11    -Wno-missing-
> > >
> > > declarations
> > >
> > > > -MMD -MT
> > > > common/test-core/CMakeFiles/gtest.dir/home/cgood/github/gtest/goog
> > > > lete
> > > > st/src
> > > > /gtest-all.cc.o -MF
> > > > common/test-core/CMakeFiles/gtest.dir/home/cgood/github/gtest/goog
> > > > lete
> > > > st/src
> > > > /gtest-all.cc.o.d -o
> > > > common/test-core/CMakeFiles/gtest.dir/home/cgood/github/gtest/goog
> > > > lete
> > > > st/src /gtest-all.cc.o -c
> > > > /home/cgood/github/gtest/googletest/src/gtest-all.cc
> > > > In file included from
> > > > /home/cgood/github/gtest/googletest/src/gtest-all.cc:42:0:
> > > > /home/cgood/github/gtest/googletest/src/gtest.cc:35:41: fatal error:
> > > > gtest/internal/custom/gtest.h: No such file or directory
> > > > compilation terminated.
> > > > [120/892] Building CXX object
> > > > common/test-
> > >
> > > core/CMakeFiles/gmock.dir/home/cgood/github/gtest/googlemo
> > >
> > > > ck/src
> > > > /gmock-all.cc.o
> > > > FAILED: /usr/bin/c++   -DHAVE_CONFIG_H -DHAVE_GUILE20 -Icommon
> > > > -I/home/cgood/github/gnucash-maint/common
> > > > -I/home/cgood/github/gnucash-maint/libgnucash/engine
> > > > -I/home/cgood/github/gnucash-maint/common/test-core
> > > > -I/usr/include/glib-2.0
> > > > -I/usr/lib/x86_64-linux-gnu/glib-2.0/include
> > > > -I/usr/include/guile/2.0 -I/home/cgood/github/gtest/googletest
> > > > -I/home/cgood/github/gtest/googlemock
> > > > -Werror -Wall -Wmissing-declarations -Wno-unused -Wno-
> error=parentheses
> > > > -std=gnu++11    -Wno-missing-declarations -MMD -MT
> > > > common/test-
> > >
> > > core/CMakeFiles/gmock.dir/home/cgood/github/gtest/googlemo
> > >
> > > > ck/src
> > > > /gmock-all.cc.o -MF
> > > > common/test-
> > >
> > > core/CMakeFiles/gmock.dir/home/cgood/github/gtest/googlemo
> > >
> > > > ck/src
> > > > /gmock-all.cc.o.d -o
> > > > common/test-
> > >
> > > core/CMakeFiles/gmock.dir/home/cgood/github/gtest/googlemo
> > >
> > > > ck/src /gmock-all.cc.o -c
> > > > /home/cgood/github/gtest/googlemock/src/gmock-all.cc
> > > > In file included from
> > > > /home/cgood/github/gtest/googlemock/src/gmock-all.cc:46:0:
> > >
> > > > /home/cgood/github/gtest/googlemock/src/gmock-spec-
> builders.cc:339:1:
> > > error:
> > > > prototype for 'testing::internal::UntypedActionResultHolderBase*
> > > > testing::internal::UntypedFunctionMockerBase::UntypedInvokeWith(co
> > > > nst void*)' does not match any in class
> > > > 'testing::internal::UntypedFunctionMockerBase'
> > > > UntypedFunctionMockerBase::UntypedInvokeWith(const void* const
> > > > untyped_args)
> > > > ^
> > > > In file included from
> > > > /usr/include/gmock/gmock-generated-function-mockers.h:43:0,
> > > >
> > > >                 from /usr/include/gmock/gmock.h:61,
> > > >                 from
> > > >
> > > > /home/cgood/github/gtest/googlemock/src/gmock-all.cc:40:
> > > > /usr/include/gmock/gmock-spec-builders.h:214:40: error: candidate
is:

> > > > const
> > > > testing::internal::UntypedActionResultHolderBase*
> > > > testing::internal::UntypedFunctionMockerBase::UntypedInvokeWith(co
> > > > nst
> > >
> > > void*)
> > >
> > > >   const UntypedActionResultHolderBase* UntypedInvokeWith(
> > > >
> > > >                                        ^
> > > >
> > > > ninja: build stopped: subcommand failed.
> > > >
> > > > find ../gtest -name gtest.h
> > > > ../gtest/googletest/include/gtest/internal/custom/gtest.h
> > > > ../gtest/googletest/include/gtest/gtest.h
> > >
> > > Chris,
> > >
> > > There's an include argument missing from the compile instructions:
> > >   -I/home/cgood/github/gtest/googletest/include
> > >
> > > Grep CMakeCache.txt for GTEST_INCLUDE_DIR. It should return
> > >
> > >   GTEST_INCLUDE_DIR:PATH=/home/cgood/github/gtest/googletest/include
> > >
> > > GTEST_INCLUDE_DIR is passed to target_include_directories() at
> >
> > common/test-
> >
> > > core/CMakeLists.txt line 79.
> > >
> > > If GTEST_INCLUDE_DIR isn't set cmake should fail, complaining that
> > > it
> >
> > can't find
> >
> > > googletest. You'll need to examine the CMake logs to see why it's
> > > not
> >
> > getting
> >
> > > included.
> > >
> > > Regards,
> > > John Ralls
> >
> > Hi John,
> >
> > Thanks very much for your help which got me on the right direction (I
> > haven't tried to fix a problem with cmake or ninja before).
> >
> > I couldn't find anything in the cmake logs
> > (gnucash-maint-build/CMakeFiles/[CMakeError.log|CMakeOutput.log])
> > about GTEST or gtest but I found:
> > gnucash-maint/common/cmake_modules/GncAddTest.cmake:
> >
> >   find_path(GTEST_INCLUDE_DIR gtest/gtest.h
> >     PATHS ${GTEST_ROOT}/include ${GMOCK_ROOT}/gtest/include
> > /usr/include)
> >
> > grep GTEST_INCLUDE_DIR CMakeCache.txt shows:
> >   GTEST_INCLUDE_DIR:PATH=/usr/include
> >
> > So somehow cmake find_path is not finding
> > $GTEST_ROOT/include/gtest/gtest.h (which does exist), but
> > /usr/include/gtest/gtest.h which is version
> > 1.7.0-4ubuntu1
> > which I installed following instructions at
> > https://wiki.gnucash.org/wiki/BuildUbuntu16.04#GnucCash_Dependencies.
> >
> > There is no /usr/include/gtest/internal/custom/gtest.h.
> >
> > As no packages depend on google-mock or libgtest-dev on my system, I
> > have uninstalled them, and now cmake finds the correct gtest headers
> > and I have successfully built gnucash.
> >
> > Shouldn't cmake (3.5.1-1ubuntu1) find_path() have tried to use the
> > first path (using GTEST_ROOT)?
> > The documentation
> > https://cmake.org/cmake/help/v3.5/command/find_path.html?highlight=fin
> > d_path doesn't specifically say that but it seems logical to me.
> >
> According to the page you link to system paths are searched before
directories
> added via PATHS. Considering we base our search on parameters already set
> (GTEST_ROOT and GMOCK_ROOT) we probably should use HINTS instead of
> PATHS as directories specified with HINTS take precedence over system
paths.
>
> Can you run this experiment ? That is
> - change PATHS to HINTS in the line above and the other find_path calls
further
> down the macro
> - reinstall gtest 1.7.0
> - rerun ninja
> - verify it still finds your correct local googletest instead of the
system installed
> one.
>
> Geert
>

Hi Geert,

Good catch!
Using HINTS instead of PATHS correctly sets GTEST_INCLUDE_DIR &
GMOCK_INCLUDE_DIR
to the local install instead of the system /usr/include paths.

I've got a maint branch to fix this. Shall I do a PR?
There are no other instances like this of PATHS being used in other .cmake
files in common/cmake_modules.
Shall I look for other instances of PATHS being used where the system path
is the last option, in all other directories, and include those in the PR?

Regards, Chris Good

_______________________________________________
gnucash-devel mailing list
[hidden email]
https://lists.gnucash.org/mailman/listinfo/gnucash-devel
Reply | Threaded
Open this post in threaded view
|

Re: [GNC-dev] GnuCash 3 on Linux

John Ralls-2


> On Jun 10, 2018, at 5:28 PM, Chris Good <[hidden email]> wrote:
>
>> -----Original Message-----
>> From: Geert Janssens <[hidden email]>
>> Sent: Sunday, 10 June 2018 8:16 PM
>> To: [hidden email]
>> Cc: Chris Good <[hidden email]>; 'John Ralls' <[hidden email]>
>> Subject: Re: [GNC-dev] GnuCash 3 on Linux
>>
>> Op zondag 10 juni 2018 11:07:36 CEST schreef Chris Good:
>>>> -----Original Message-----
>>>> From: John Ralls <[hidden email]>
>>>> Sent: Sunday, 10 June 2018 6:13 AM
>>>> To: Chris Good <[hidden email]>
>>>> Cc: [hidden email]
>>>> Subject: Re: [GNC-dev] GnuCash 3 on Linux
>>>>
>>>>> On 9. Jun 2018, at 00:17, Chris Good <[hidden email]> wrote:
>>>>>
>>>>> Hi John,
>>>>>
>>>>> Thanks very much for your help.
>>>>> A little more please...
>>>>>
>>>>> On my Ubuntu 16.04:
>>>>>
>>>>> sudo apt-get update -qq
>>>>> sudo apt-get build-dep -qq gnucash > /dev/null sudo apt-get
>>>>> install -qq git bash-completion cmake make swig xsltproc
>>>>> libdbd-sqlite3 texinfo ninja-build libboost-all-dev libgtk-3-dev
>>>>> libwebkit2gtk-3.0-dev > /dev/null sudo apt-get --reinstall install
>>>>> -qq language-pack-en language-pack-fr cd /home/cgood/github git
>>>>> clone https://github.com/google/googletest -b release-1.8.0 gtest
>>>>> (created
>>>>> /home/cgood/github/gtest)
>>>>>
>>>>> cd /home/cgood/github/gnucash-maint git checkout maint git pull
>>>>> --rebase upstream maint git push origin maint
>>>>>
>>>>> /home/cgood/github/gnucash-maint/README.dependencies :
>>>>> guile 2.2.0 or 2.0.0
>>>>> googletest          1.7.0
>>>>>
>>>>> As 'make uninstall' didn't work from my 2.6.21 git repo:
>>>>> cd /home/cgood/github/gnucash-maint-install
>>>>> rm -r *
>>>>>
>>>>> cd /home/cgood/github/gnucash-maint-build
>>>>> rm -r *
>>>>> cmake -G Ninja -D
>>>>> CMAKE_INSTALL_PREFIX=$HOME/github/gnucash-maint-install -D
>>>>
>>>> WITH_AQBANKING=OFF \
>>>>
>>>>>  -D WITH_OFX=OFF -DGTEST_ROOT=$HOME/github/gtest/googletest
>>>>>
>>>>> -DGMOCK_ROOT=$HOME/cgood/github/gtest/googlemock \
>>>>>
>>>>>  ../gnucash-maint
>>>>>
>>>>> ninja
>>>>> [5/892] Generating ../../lib/gnucash/scm/ccache/2.0/json.go
>>>>> wrote
>>>>> `/home/cgood/github/gnucash-maint-
>>>>
>>>> build/lib/gnucash/scm/ccache/2.0/json.go'
>>>>
>>>>> [22/892] Generating
>>>>> ../../../lib/gnucash/scm/ccache/2.0/json/syntax.go
>>>>> wrote
>>>>> `/home/cgood/github/gnucash-maint-build/lib/gnucash/scm/ccache/2.0
>>>>> /jso
>>>>> n/synt
>>>>> ax.go'
>>>>> [25/892] Generating
>>>>> ../../../lib/gnucash/scm/ccache/2.0/json/parser.go
>>>>> wrote
>>>>> `/home/cgood/github/gnucash-maint-build/lib/gnucash/scm/ccache/2.0
>>>>> /jso
>>>>> n/pars
>>>>> er.go'
>>>>> [28/892] Generating
>>>>> ../../../lib/gnucash/scm/ccache/2.0/json/builder.go
>>>>> wrote
>>>>> `/home/cgood/github/gnucash-maint-build/lib/gnucash/scm/ccache/2.0
>>>>> /jso
>>>>> n/buil
>>>>> der.go'
>>>>> [120/892] Building CXX object
>>>>> common/test-core/CMakeFiles/gtest.dir/home/cgood/github/gtest/goog
>>>>> lete
>>>>> st/src
>>>>> /gtest-all.cc.o
>>>>> FAILED: /usr/bin/c++   -DHAVE_CONFIG_H -DHAVE_GUILE20 -Icommon
>>>>> -I/home/cgood/github/gnucash-maint/common
>>>>> -I/home/cgood/github/gnucash-maint/libgnucash/engine
>>>>> -I/home/cgood/github/gnucash-maint/common/test-core
>>>>> -I/usr/include/glib-2.0
>>>>> -I/usr/lib/x86_64-linux-gnu/glib-2.0/include
>>>>> -I/usr/include/guile/2.0 -I/home/cgood/github/gtest/googletest
>>>>> -Werror -
>>>>
>>>> Wall -Wmissing-declarations
>>>>
>>>>> -Wno-unused -Wno-error=parentheses -std=gnu++11    -Wno-missing-
>>>>
>>>> declarations
>>>>
>>>>> -MMD -MT
>>>>> common/test-core/CMakeFiles/gtest.dir/home/cgood/github/gtest/goog
>>>>> lete
>>>>> st/src
>>>>> /gtest-all.cc.o -MF
>>>>> common/test-core/CMakeFiles/gtest.dir/home/cgood/github/gtest/goog
>>>>> lete
>>>>> st/src
>>>>> /gtest-all.cc.o.d -o
>>>>> common/test-core/CMakeFiles/gtest.dir/home/cgood/github/gtest/goog
>>>>> lete
>>>>> st/src /gtest-all.cc.o -c
>>>>> /home/cgood/github/gtest/googletest/src/gtest-all.cc
>>>>> In file included from
>>>>> /home/cgood/github/gtest/googletest/src/gtest-all.cc:42:0:
>>>>> /home/cgood/github/gtest/googletest/src/gtest.cc:35:41: fatal error:
>>>>> gtest/internal/custom/gtest.h: No such file or directory
>>>>> compilation terminated.
>>>>> [120/892] Building CXX object
>>>>> common/test-
>>>>
>>>> core/CMakeFiles/gmock.dir/home/cgood/github/gtest/googlemo
>>>>
>>>>> ck/src
>>>>> /gmock-all.cc.o
>>>>> FAILED: /usr/bin/c++   -DHAVE_CONFIG_H -DHAVE_GUILE20 -Icommon
>>>>> -I/home/cgood/github/gnucash-maint/common
>>>>> -I/home/cgood/github/gnucash-maint/libgnucash/engine
>>>>> -I/home/cgood/github/gnucash-maint/common/test-core
>>>>> -I/usr/include/glib-2.0
>>>>> -I/usr/lib/x86_64-linux-gnu/glib-2.0/include
>>>>> -I/usr/include/guile/2.0 -I/home/cgood/github/gtest/googletest
>>>>> -I/home/cgood/github/gtest/googlemock
>>>>> -Werror -Wall -Wmissing-declarations -Wno-unused -Wno-
>> error=parentheses
>>>>> -std=gnu++11    -Wno-missing-declarations -MMD -MT
>>>>> common/test-
>>>>
>>>> core/CMakeFiles/gmock.dir/home/cgood/github/gtest/googlemo
>>>>
>>>>> ck/src
>>>>> /gmock-all.cc.o -MF
>>>>> common/test-
>>>>
>>>> core/CMakeFiles/gmock.dir/home/cgood/github/gtest/googlemo
>>>>
>>>>> ck/src
>>>>> /gmock-all.cc.o.d -o
>>>>> common/test-
>>>>
>>>> core/CMakeFiles/gmock.dir/home/cgood/github/gtest/googlemo
>>>>
>>>>> ck/src /gmock-all.cc.o -c
>>>>> /home/cgood/github/gtest/googlemock/src/gmock-all.cc
>>>>> In file included from
>>>>> /home/cgood/github/gtest/googlemock/src/gmock-all.cc:46:0:
>>>>
>>>>> /home/cgood/github/gtest/googlemock/src/gmock-spec-
>> builders.cc:339:1:
>>>> error:
>>>>> prototype for 'testing::internal::UntypedActionResultHolderBase*
>>>>> testing::internal::UntypedFunctionMockerBase::UntypedInvokeWith(co
>>>>> nst void*)' does not match any in class
>>>>> 'testing::internal::UntypedFunctionMockerBase'
>>>>> UntypedFunctionMockerBase::UntypedInvokeWith(const void* const
>>>>> untyped_args)
>>>>> ^
>>>>> In file included from
>>>>> /usr/include/gmock/gmock-generated-function-mockers.h:43:0,
>>>>>
>>>>>                from /usr/include/gmock/gmock.h:61,
>>>>>                from
>>>>>
>>>>> /home/cgood/github/gtest/googlemock/src/gmock-all.cc:40:
>>>>> /usr/include/gmock/gmock-spec-builders.h:214:40: error: candidate
> is:
>>>>> const
>>>>> testing::internal::UntypedActionResultHolderBase*
>>>>> testing::internal::UntypedFunctionMockerBase::UntypedInvokeWith(co
>>>>> nst
>>>>
>>>> void*)
>>>>
>>>>>  const UntypedActionResultHolderBase* UntypedInvokeWith(
>>>>>
>>>>>                                       ^
>>>>>
>>>>> ninja: build stopped: subcommand failed.
>>>>>
>>>>> find ../gtest -name gtest.h
>>>>> ../gtest/googletest/include/gtest/internal/custom/gtest.h
>>>>> ../gtest/googletest/include/gtest/gtest.h
>>>>
>>>> Chris,
>>>>
>>>> There's an include argument missing from the compile instructions:
>>>>  -I/home/cgood/github/gtest/googletest/include
>>>>
>>>> Grep CMakeCache.txt for GTEST_INCLUDE_DIR. It should return
>>>>
>>>>  GTEST_INCLUDE_DIR:PATH=/home/cgood/github/gtest/googletest/include
>>>>
>>>> GTEST_INCLUDE_DIR is passed to target_include_directories() at
>>>
>>> common/test-
>>>
>>>> core/CMakeLists.txt line 79.
>>>>
>>>> If GTEST_INCLUDE_DIR isn't set cmake should fail, complaining that
>>>> it
>>>
>>> can't find
>>>
>>>> googletest. You'll need to examine the CMake logs to see why it's
>>>> not
>>>
>>> getting
>>>
>>>> included.
>>>>
>>>> Regards,
>>>> John Ralls
>>>
>>> Hi John,
>>>
>>> Thanks very much for your help which got me on the right direction (I
>>> haven't tried to fix a problem with cmake or ninja before).
>>>
>>> I couldn't find anything in the cmake logs
>>> (gnucash-maint-build/CMakeFiles/[CMakeError.log|CMakeOutput.log])
>>> about GTEST or gtest but I found:
>>> gnucash-maint/common/cmake_modules/GncAddTest.cmake:
>>>
>>>  find_path(GTEST_INCLUDE_DIR gtest/gtest.h
>>>    PATHS ${GTEST_ROOT}/include ${GMOCK_ROOT}/gtest/include
>>> /usr/include)
>>>
>>> grep GTEST_INCLUDE_DIR CMakeCache.txt shows:
>>>  GTEST_INCLUDE_DIR:PATH=/usr/include
>>>
>>> So somehow cmake find_path is not finding
>>> $GTEST_ROOT/include/gtest/gtest.h (which does exist), but
>>> /usr/include/gtest/gtest.h which is version
>>> 1.7.0-4ubuntu1
>>> which I installed following instructions at
>>> https://wiki.gnucash.org/wiki/BuildUbuntu16.04#GnucCash_Dependencies.
>>>
>>> There is no /usr/include/gtest/internal/custom/gtest.h.
>>>
>>> As no packages depend on google-mock or libgtest-dev on my system, I
>>> have uninstalled them, and now cmake finds the correct gtest headers
>>> and I have successfully built gnucash.
>>>
>>> Shouldn't cmake (3.5.1-1ubuntu1) find_path() have tried to use the
>>> first path (using GTEST_ROOT)?
>>> The documentation
>>> https://cmake.org/cmake/help/v3.5/command/find_path.html?highlight=fin
>>> d_path doesn't specifically say that but it seems logical to me.
>>>
>> According to the page you link to system paths are searched before
> directories
>> added via PATHS. Considering we base our search on parameters already set
>> (GTEST_ROOT and GMOCK_ROOT) we probably should use HINTS instead of
>> PATHS as directories specified with HINTS take precedence over system
> paths.
>>
>> Can you run this experiment ? That is
>> - change PATHS to HINTS in the line above and the other find_path calls
> further
>> down the macro
>> - reinstall gtest 1.7.0
>> - rerun ninja
>> - verify it still finds your correct local googletest instead of the
> system installed
>> one.
>>
>> Geert
>>
>
> Hi Geert,
>
> Good catch!
> Using HINTS instead of PATHS correctly sets GTEST_INCLUDE_DIR &
> GMOCK_INCLUDE_DIR
> to the local install instead of the system /usr/include paths.
>
> I've got a maint branch to fix this. Shall I do a PR?
> There are no other instances like this of PATHS being used in other .cmake
> files in common/cmake_modules.
> Shall I look for other instances of PATHS being used where the system path
> is the last option, in all other directories, and include those in the PR?


Chris,

Sure to both!

Regards,
John Ralls
_______________________________________________
gnucash-devel mailing list
[hidden email]
https://lists.gnucash.org/mailman/listinfo/gnucash-devel