building master

Alex Aycinena alex.aycinena at gmail.com
Sat Apr 22 18:47:44 EDT 2017


>
> ---------- Forwarded message ----------
> From: Geert Janssens <geert.gnucash at kobaltwit.be>
> To: gnucash-devel at gnucash.org, Wm <wm_o_o_o at yahoo.co.uk>
> Cc:
> Bcc:
> Date: Sat, 22 Apr 2017 14:40:56 +0200
> Subject: Re: building master
> On vrijdag 21 april 2017 23:17:31 CEST Wm via gnucash-devel wrote:
> > On 21/04/2017 19:21, John Ralls wrote:
> > > Alex,
> > >
> > >
> > > Looks like autotools picked the wrong compiler for a C++ object. See
> > > http://stackoverflow.com/questions/6045809/link-error-
> undefined-reference
> > > -to-gxx-personality-v0-and-g. Geert and I have both switched to cmake &
> > > ninja-build; there's no issue there so it might be a typo in that
> > > directory's Makefile.am.
> > >
> > > On the other hand Geert just merged his C++ rewrite of
> > > src/import-export/imp-csv, so if you have installed libs that are
> getting
> > > linked in that could cause the error too.
> > I've had intermittent difficulty with builds too recently but haven't
> > said anything because I'm not building gnc for any particular purpose.
> >
> What errors do you see Wm ?
>
> > I have noticed the cmake / ninja combo has been mentioned more than one
> > recently here.
> >
> > Should others that build-because-we-do-it-anyway be switching and is
> > there a suggested "start reading here" ref you could suggest?
> >
> We have a wiki page on CMake [1]. It's been written quite some time ago,
> but it still looks like a
> good starting point. At that time ninja wasn't written yet so that
> information is currently missing.
>
> In short cmake replaces automake/autoconf and the configuration script
> that's generated by
> those. It will produce build recipes for different build systems. The wiki
> page explains how to
> make these recipes for the gnu-make build system (which is the only build
> system supported by
> automake/autoconf by the way). So using cmake like this will generate
> Makefile files which can
> be used just like before by running make, make install, make check,...
>
> Ninja on the other hand is an alternative for gnu-make with a strong focus
> on parallellizing the
> build as much as possible, and as such utilizing your typical multi-core
> cpu much more
> efficiently. The commands to use it are similar to gnu-make:
> make -> ninja (or ninja-build)
> make install -> ninja (or ninja-build) install
> make check -> ninja (or ninja-build) check
>
> I'm writing "ninja (or ninja-build)" because the name of the command
> depends on your OS. On
> Windows it's "ninja", on Fedora it's "ninja-build". Oh, well...
>
> To instruct cmake to set up for ninja instead of gnu-make, you invoke
> cmake with "-G Ninja"
> added to the options. As an example my current cmake command looks like
> this:
> cmake -D WITH_PYTHON=ON \
>  -D CMAKE_INSTALL_PREFIX=<install-dir> \
>  -DCMAKE_BUILD_TYPE=Debug -DWITH_AQBANKING=ON -G Ninja \
>  <path-to-source-directory>
>
>
>
> After that short intro, a few words on where to go next: because of the
> better performance and
> greater flexibility in build system support (even Ms Visual Studio is
> supported by cmake), we are
> seriously considering to switch to cmake in favor of autotools at some
> point.
>
> We won't do so for the stable 2.6 series (although even that builds fine
> with cmake/ninja
> already; the combo is in active use for our Windows nightly builds). For
> the upcoming 2.8
> though it's very likely we will formally switch to cmake. There are a few
> release related details
> which still need to be ported to cmake before that switch can be complete
> though.
>
> So for now we're formally supporting autotools/gnu-make and informally
> cmake/<whatever> in
> which John and I currently prefer <whatever> to be ninja for its
> performance.
>
> > I'm building on Ubuntu LTS if it matters ... and it shouldn't really
> > matter as I'm just building to keep in touch.
>
> You didn't mention which LTS edition. However on my 14.04LTS ninja is
> already available, so I
> expect it to be in 16.04 as well.
>
> Regards,
>
> Geert
>
> [1] http://wiki.gnucash.org/wiki/CMake
>
>
So to switch to using cmake with ninja, I installed cmake (which installed
cmake-data and jsoncpp, as well) and ninja-build (on Fedora). But from your
note, it was still unclear to me how to use them. Up to now, I have had two
parallel directories, for example, gnucash-clean, where the source is
checked out to, and gnucash-clean-build, where I build. Then I would:

$ cd /home/gnucash-dev/gitcheckouts/gnucash-clean
$ git pull
$ ./autogen.sh
$ cd /home/gnucash-dev/gitcheckouts/gnucash-clean-build
$ rm -rf *
$ ../gnucash-clean/configure
--srcdir=/home/gnucash-dev/gitcheckouts/gnucash-clean
--prefix=/opt/gnucash-git/gnucash-clean --enable-debug --enable-doxygen
--enable-error-on-warning --enable-compile-warnings=yes
--with-dbi-dbd-dir=/usr/lib64/dbd --enable-ofx --enable-aqbanking
--enable-locale-specific-tax --enable-python
$ make
$ make check

Then after switching to root:

$ cd /home/gnucash-dev/gitcheckouts/gnucash-clean-build
$ make install

So now I tried instead:

$ cd /home/gnucash-dev/gitcheckouts/gnucash-clean
$ git pull
$ ./autogen.sh   <-- still needed I assumed?
$ cd /home/gnucash-dev/gitcheckouts/gnucash-clean-build
$ rm -rf *
cmake -D WITH_PYTHON=ON \
 -D CMAKE_INSTALL_PREFIX=/opt/gnucash-git/gnucash-clean \
 -D CMAKE_BUILD_TYPE=Debug \
 -D WITH_AQBANKING=ON -G Ninja \
  /home/gnucash-dev/gitcheckouts/gnucash-clean
$ ninja-build

It was working away until it stopped with:

[166/962] cd
/home/gnucash-dev/gitchec...ean/src/doc/design/gnucash-design.texi
FAILED: src/doc/design/CMakeFiles/gnucash-design.texi
cd /home/gnucash-dev/gitcheckouts/gnucash-clean-build/src/doc/design &&
makeinfo -I
/home/gnucash-dev/gitcheckouts/gnucash-clean-build/src/doc/design
/home/gnucash-dev/gitcheckouts/gnucash-clean/src/doc/design/gnucash-design.texi
/bin/sh: makeinfo: command not found
[168/962] Building CXX object
src/libq...Files/gnc-qof.dir/qof/qofsession.cpp.o
ninja: build stopped: subcommand failed.

Feedback would be welcome.

I assume once I get a clean build, then I would:

$ ninja-build check

Then after switching to root:

$ cd /home/gnucash-dev/gitcheckouts/gnucash-clean-build
$ ninja-build install

Also, what happens to these other configure options I would previously set:

 --enable-doxygen
 --enable-error-on-warning
 --enable-compile-warnings=yes
 --with-dbi-dbd-dir=/usr/lib64/dbd
 --enable-ofx (I see in CMakeCache.txt that WITH_OFX:BOOL=ON even though I
didn't specify it)
 --enable-locale-specific-tax

Or are they no longer necessary?


More information about the gnucash-devel mailing list