[GNC-dev] GnuCash 3.0 wine versus Windoze 10

Robin Chattopadhyay robinraymn at gmail.com
Fri Apr 20 12:44:15 EDT 2018


David-

Thank you very much for this comprehensive tutorial for building from
source. I'm newish to Linux and I want to be able to do this but I've been
confused. I managed to muddle through building 3.0 from source the evening
before your email came.

I have some lingering questions that maybe this group can help with:
After downloading the source and extracting the files, I made a second
directory for the build, so I had:
/home/foo/gnucash-3.0
/home/foo/gnucash-build

Is this a correct/reasonable/best practice?

After I successfully ran cmake and make install and I can run gnucash, what
if anything, can I or should I delete? Or should I keep the source and
build directories?

I was running into problems with cmake when I set -D WITH_PYTHON=ON. I
didn't capture any of the error messages, but it IIRC it was complaining
about not having some test utility. I eventually switched to -D
WITH_PYTHON=OFF and I was able to proceed. Is it possible that this is
related to not installing the GTEST/GMOCK packages?

Thanks,
Robin

On Fri, Apr 20, 2018 at 3:35 AM, DaveC49 <davidcousens at bigpond.com> wrote:

> Jeffrey,
>
> I will start form scratch. The first step is setting up for building. My
> apologies if I am teaching you to suck eggs. Linux Mint has an alias of apt
> defined for apt-get. I am not sure if it is also defined in Ubuntu. If not
> substitute apt-get where I have apt in the following.
>
> # first download a copy of the gnucash source code gnucash-3.0.tar.bz2 from
> # https://www.gnucash.org/download.phtml and extract the gnucash-3.0
> source
> file. I use a folder called # Applications in my home directory for
> programs
> and libraries I build from scratch and usually keep the
> # sources there so i can easily rebuild if I strike a problem, but that is
> just a personal preference.
>
> #Open a terminal/bash shell and then cd to the extracted folder
> gnucash-3.0.
>
> # this loads compilers,dev tools etc as per
> https://packages.ubuntu.com/xenial/build-essential
> $sudo apt install build essential
> $sudo apt install cmake
>
> #the next step is to install the gnucash dependencies as listed in the
> README.dependencies file under the #gnucash-3.0 folder. This generally
> lists
> the minimum version of the libraries required. You will generally find
> that
> Ubuntu will in most cases load a later version. I will list the command to
> load  followed by the required version as in that file as a #comment
> separated by a #. The list on https://wiki.gnucash.org/wiki/Building lists
> the development headers that are required but you may also need to load the
> libraries as well
>
> sudo apt-get install libtool libltdl-dev
> #glib2 >        v2.40.0
> sudo apt-get install libglib2.0 libglib2.0-dev
> sudo apt-get install icu-devtools libicu-dev
> # boost > 1.50.0
> sudo apt-get install libboost-all-dev
> # guile >=2.0.0
> sudo apt-get install guile-2.0 guile-2.0-dev
> #swig  >2.0.10
> sudo apt-get install swig2.0
> sudo apt-get install libxml2 libxml++2.6-dev
> sudo apt-get install libxslt1.1 libxslt1-dev
> sudo apt-get install xsltproc
> sudo apt-get install libgtest-dev
> sudo apt-get install gtk+3.0
> sudo apt-get install libgtk-3-dev
> sudo apt-get install libwebkit2gtk-4.0-37
> sudo apt-get install libwebkit2gtk-4.0-dev
> sudo apt-get install libdbi1 libdbi-dev
> # if you use a database backend  rather than the default XML backaend
> # you need to load at least one of the following
> # and choose the one relevant to the database you want to use
> sudo apt-get install libdbd-pgsql   #PostgreSQL database
> sudo apt-get install libdbd-mysql  # MySQL database
> sudo -get install libdbd-sqlite3     #Sqlite database
> # these are needed if you use online banking tools
> sudo apt-get install libofx6 libofx4 libofx-dev
> dpkg -lsudo apt-get aqbanking-tools libaqbanking-dev
> # this is required on linux systems it may be already installed but will
> tell you if it is
> sudo apt-get install dconf-cli
> #
> # you can check out what versions of packages are installed or not using
> the
> following command
> dpkg -l | grep <package name>
> # here <package name> can be the actual package name or a substring. grep
> will extract anything
> # from the dpkg -l output which contains that substring
> #
> # The next step is getting googletest setup. The version from the Ubuntu
> repository is 1.7.0 and does not
> # contain gmock within the gtest download. V1.8.0 has both in the one
> repository and is a little bit easier
> #  to setup. Google do not recommend using googlemock and googletest as
> shared dynamically linked
> #  libraries because if a program is compiled with different compiler flags
> from the libraries links to them
> # at run time they can fail something I did not appreciate but I haven't
> had
> any problems so far.
> # To set it up as recommended by Google and the developers, at a terminal
> opened in a suitable folder (e.g. $HOME/Applications is what I use)  enter:
> #
> git clone https://github.com/google/googletest.git
> #
> #this will create a folder googletest-master which has sub folders
> googletest and googlemock
> #
> cd googletest-master
> cmake -D BUILD_GTEST -DBUILD_GMOCK
> make
> # this creates the gtest and gmock libraries within the googletest-master
> folder but does not install them
> # as shared dynamically linked libraries. You then need to create
> environment variables pointing to the
> # top level folders containing these libraries
> export GTEST_ROOT=<path-to-googletest-master>/googletest
> export GMOCK_ROOT=<path-to-googletest-master>/googlemock
> # where <path-to-googletest-master> is in my case
> $HOME/Applications/googletest-master. This allows
> # CMake to find the googletest and googlemock libraries and include files
> to
> link into the program.
> #
> # At this point you should be ready to build gnucash. I prefer to install
> it
> in the /usr/local folder. This is
> # where the linux distros generally install it. If your previous version
> was
> installed from a Linux
> # distribution this is normally where it will be. It can also be installed
> under /opt. The essential step I
> # found was to ensure that all traces of any previous version of GnuCash
> were removed before doing
> # the build.
> #If you previously had a version from the Linux distro
> sudo apt-get remove gnucash
> # should achieve this. If you built a previous version from sources and
> still have the build sources
> # change to the  build directory (may be the source directory (e.g.
> gnucash-2.6.19) or may be directory
> # named build, my-build or similar under the source directory) and type at
> the terminal
> sudo make uninstall
> # to check whether you have been succesful or not type
> whereis gnucash
> # If nothing is returned then you have removed it successfully. If whereis
> returns any of
> /usr/local/bin/gnucash
> /usr/local/etc/gnucash
> /usr/local/lib/gnucash
> # then those directories should be be removed. In this case use
> rm -r /usr/local/bin/gnucash
> rm-r /usr/local/etc/gnucash
> rm -r /usr/local/lib/gnucash
> #
> # now open a terminal at the toplevel gnucash-3.0 folder
> mkdir mybuild
> cd mybuild
> cmake -D CMAKE_INSTALL_PREFIX=/usr/local -D WITH_AQBANKING=OFF -D
> WITH_OFX=ON ..
> #
> # You will find a full list of the option switches( i.e. -D WITH_...) with
> their default values towards the top
> # of the Wiki Build page https://wiki.gnucash.org/wiki/Building. I
> required
> the OFX support for loading
> # OFX files but don't use the AQBANKING support as Australian banks
> currently don't allow direct access.
> # if you are using a database backend e.g. you would require -D WITH_SQL=ON
> #
> # cmake should do a lot of checks as it runs and issue sttus messages and
> it
> will stop if it encounters any
> # problems. At this point come back with the terminal output and I (if it
> is
> failry simple) or perhaps one of
> # the developers can help sort it out. If it succeeds you will get a
> mesaage
> saying that it is writing the
> # make files into the mybuild directory you created above.  Note there was
> some discussion of the
> # mybuild directory having to be outside the gnucash-3.0 directory. This is
> the case for building the
> # documentation I believe, but is not the case for building GnuCash itself.
> # If cmake completes successfully type at the terminal
> make
> # to build Gnucash. If make has any errors come back with the terminal
> output. The only error i had here
> # was with not having uninstalled the previous version fully.  If make
> completes without error then
> #type in the terminal
> sudo make install
> # which will install Gnucash
> whereis gnucash
> # should then return the following
> /usr/local/bin/gnucash
> /usr/local/etc/gnucash
> /usr/local/lib/gnucash.
>
> If you have previously installed from the menu you should have a menu item
> which points to /usr/local/bin/gnucash. If not create a new menu item for
> Gnucash and put gnucash %f as the command and if you can locate a gnucash
> icon set the icon to point to it. There is one in the sources at
> ~/gnucash-3.0/data/pixmaps/gnucashicon.ico which you could copy to where
> your system installs icons. I think it normally should be copied on
> installation but there have been a few posts about it not being copied
> possibly on Windows and Macs.
>
> If you have any problems come back on the forum and we will try to sort it
> out from there.
>
> Good luck
>
> David
>
>
>
>
> -----
> David Cousens
> --
> Sent from: http://gnucash.1415818.n4.nabble.com/GnuCash-Dev-f1435356.html
> _______________________________________________
> gnucash-devel mailing list
> gnucash-devel at gnucash.org
> https://lists.gnucash.org/mailman/listinfo/gnucash-devel
>


More information about the gnucash-devel mailing list