Difference between revisions of "Building"

From GnuCash
Jump to: navigation, search
m (Gentoo)
m (>= -> ≥)
 
(240 intermediate revisions by 52 users not shown)
Line 1: Line 1:
[[Subversion|Get the latest sources from Subversion]] and examine the [http://svn.gnucash.org/trac/file/gnucash/trunk/README.svn README.svn] file for notes on compiling gnucash, and the [http://svn.gnucash.org/trac/file/gnucash/trunk/HACKING HACKING] file for notes on hacking the code.
+
{| class="wikitable" style="margin: auto;"
 +
! scope="row"|Languages
 +
| [[de/{{PAGENAME:Gnucash}}|Deutsch]]
 +
| [[He/{{PAGENAME:בניה}}|עִברִית]]
 +
|}
 +
This page deals with building GnuCash '''from the source code'''. It includes building the current ''stable release'' from source code (downloaded as tarballs) as well as the ''developers version'' of GnuCash from the ''[[Git]] repository''. If you are searching for instructions for the version available '''from your distribution''''s software repositories, you should read [[Installation]].
  
Here are the basic steps one might end up taking:
+
This page doesn't provide specific instructions for optional third-party modules—like ''AqBanking'' or Perl ''Finance::Quote''—but does list the dependencies required and links to the configuration switches used with CMake to include them during compilation.
  
1. change to gnucash directory
+
== Introduction ==
  cd gnucash
+
GnuCash can be built from sources on Linux distributions, Microsoft Windows and macOS. There are three major steps in building the GnuCash program. These are listed along with the tools which may used for each step:
2. generate the configure script
 
  ./autogen.sh
 
3. look at configure options
 
  ./configure --help
 
4. run configure
 
  ./configure --prefix=/opt/gnucash \
 
    --enable-debug --enable-doxygen \
 
    --enable-error-on-warning --enable-compile-warnings \
 
    [--enable-ofx [...]]
 
5. compile and install
 
  make
 
  make install
 
6. run
 
  /opt/gnucash/bin/gnucash
 
  
== Required Packages ==
+
# Configuration (cmake - autotools in earlier GnuCash versions)
See the [http://svn.gnucash.org/trac/file/gnucash/trunk/README.dependencies README.dependencies] file for library dependency notes.
+
# Compilation ( make or ninja)
 +
# Installation (make or ninja)
  
=== Debian ===
+
Building GnuCash utilizes a set of tools which is available for all three of the major operating systems.
 +
These steps are described in detail for each operating system in the linked pages below, along with the installation of the build tools.
  
On Debian, the packages you'll probably need are (among many others):
+
== Build Tools ==
 +
A general description of the tools used to configure and build GnuCash is given in [[Build_Tools |Build tools]].
  
libgnomeui-dev
+
A listing of dependencies is available at [[Dependencies]].
libofx-dev
 
libgsf-1-dev
 
libgtkhtml3.2-dev (3.6 or 3.8 will also do)
 
libgwrapguile-dev OR
 
guile-g-wrap (It compiles but doesn't run without this: "<unnamed port>: no code for module (g-wrap gw standard)")
 
  
=== Ubuntu Breezy Badger ===
+
The GnuCash build system has gone through some changes in the course of the 2.6 and 3 series. CMake has replaced the Autotools autogen and configure scripts for configuring the build. This has provided the ability to configure for alternative build systems and popular IDEs. Under the hood compilation and installation can now either be controlled using GNU [[Build_Tools#Make|Make]] or alternatively using the faster [[Build_Tools#Ninja|Ninja]]. Depending on the version of GnuCash you want to build you have the following options:
 +
;For the application generally:
 +
:;GnuCash 3 and more recent: These versions are configured using [[Build_Tools#CMake|CMake]]. Autotools support has been removed. Either make or ninja may be used for the build.
 +
:;GnuCash 2.6 and earlier: These versions are configured with [[Build_Tools#Autotools|Autotools]] and built with the GNU make utility. GnuCash from v2.6.13 allowed experimental use of cmake to configure and ninja to build.
  
Please see the [[BreezyBadgerInstallation]] page for more information on installing a beta snapshot of GnuCash on Breezy Badger.
+
;For the Source API Documentation: This is built directly from the program sources. Depending on how the build system is configured you can use <code>make doc</code> or <code>ninja doc</code>. Note this requires [[Doxygen]] to be installed.
  
=== Gentoo ===
+
;For the documentation:
 +
:;Since GnuCash 4.8: Only [[Build_Tools#CMake|CMake]] with either [[Build_Tools#Make|Make]] or [[Build_Tools#Ninja|Ninja]] is supported
 +
:;Upto GnuCash 4.7: The GnuCash Help and Tutorial and Concept Guide are configured with [[Build_Tools#Autotools|Autotools]] and built with [[Build_Tools#Make|Make]].
 +
::[[Build_Tools#CMake|CMake]] was introduced in 3.7.
  
Gentoo instructions can be found on [[Gentoo|Gnucash-svn installation on Gentoo]].
+
== Compiler ==
 +
'''GnuCash &ge; 4.0''' requires ISO-standard '''C++17''' compatibility.
  
=== Dapper Flight 5 ===
+
'''GnuCash 3.x''' required a C++ compiler that supports ''C11'' and ''C++11''. '''Gcc version &ge; 4.8''' and '''Clang version &ge; 3.3''' are known to work.
  
On an fresh install of Ubuntu/Dapper, do the following to be able to compile trunk gnucash:
+
== Source Platform ==
 +
=== Building on Linux Distributions ===
 +
Detailed instructions for building GnuCash on Linux distributions can be found on [[Building_On_Linux | Building On Linux]].
  
====Install needed packages====
+
=== Building on macOS ===
Give the command below and let Dapper sort out which extra packages are needed.
+
macOS instructions can be found on [[MacOS/Quartz]] (This is the procedure used for building the binary packages)
sudo apt-get install libgnomeui-dev libofx-dev libgsf-1-dev \
+
or [[MacOS Installation| GnuCash installation from source on macOS]].
libgtkhtml3.8-dev guile-g-wrap libltdl3-dev g-wrap doxygen \
 
libgsf-gnome-1-dev automake1.9 texinfo build-essential intltool \
 
libtool subversion libfinance-quote-perl
 
  
====Create development tree====
+
=== Building on Microsoft Windows ===
mkdir -p $HOME/development/gnucash
+
Compiling GnuCash on Windows is possible, but much more difficult than on Linux.  
mkdir -p $HOME/unstable/gnucash
+
For details, see [[Building on Windows|building GnuCash on Microsoft Windows]].
 
 
====Check out gnucash trunk====
 
cd $HOME/development/gnucash
 
svn checkout http://svn.gnucash.org/repo/gnucash/trunk gnucash
 
 
 
====Compile gnucash====
 
cd gnucash
 
./autogen.sh
 
 
 
./configure --prefix=$HOME/unstable/gnucash \
 
    --enable-debug --enable-doxygen \
 
    --enable-error-on-warning --enable-compile-warnings
 
 
 
make all install
 
 
 
====Start newly compiled gnucash====
 
cd $HOME/unstable/gnucash/bin
 
./gnucash
 

Latest revision as of 15:37, 26 March 2024

Languages Deutsch עִברִית

This page deals with building GnuCash from the source code. It includes building the current stable release from source code (downloaded as tarballs) as well as the developers version of GnuCash from the Git repository. If you are searching for instructions for the version available from your distribution's software repositories, you should read Installation.

This page doesn't provide specific instructions for optional third-party modules—like AqBanking or Perl Finance::Quote—but does list the dependencies required and links to the configuration switches used with CMake to include them during compilation.

Introduction

GnuCash can be built from sources on Linux distributions, Microsoft Windows and macOS. There are three major steps in building the GnuCash program. These are listed along with the tools which may used for each step:

  1. Configuration (cmake - autotools in earlier GnuCash versions)
  2. Compilation ( make or ninja)
  3. Installation (make or ninja)

Building GnuCash utilizes a set of tools which is available for all three of the major operating systems. These steps are described in detail for each operating system in the linked pages below, along with the installation of the build tools.

Build Tools

A general description of the tools used to configure and build GnuCash is given in Build tools.

A listing of dependencies is available at Dependencies.

The GnuCash build system has gone through some changes in the course of the 2.6 and 3 series. CMake has replaced the Autotools autogen and configure scripts for configuring the build. This has provided the ability to configure for alternative build systems and popular IDEs. Under the hood compilation and installation can now either be controlled using GNU Make or alternatively using the faster Ninja. Depending on the version of GnuCash you want to build you have the following options:

For the application generally
GnuCash 3 and more recent
These versions are configured using CMake. Autotools support has been removed. Either make or ninja may be used for the build.
GnuCash 2.6 and earlier
These versions are configured with Autotools and built with the GNU make utility. GnuCash from v2.6.13 allowed experimental use of cmake to configure and ninja to build.
For the Source API Documentation
This is built directly from the program sources. Depending on how the build system is configured you can use make doc or ninja doc. Note this requires Doxygen to be installed.
For the documentation
Since GnuCash 4.8
Only CMake with either Make or Ninja is supported
Upto GnuCash 4.7
The GnuCash Help and Tutorial and Concept Guide are configured with Autotools and built with Make.
CMake was introduced in 3.7.

Compiler

GnuCash ≥ 4.0 requires ISO-standard C++17 compatibility.

GnuCash 3.x required a C++ compiler that supports C11 and C++11. Gcc version ≥ 4.8 and Clang version ≥ 3.3 are known to work.

Source Platform

Building on Linux Distributions

Detailed instructions for building GnuCash on Linux distributions can be found on Building On Linux.

Building on macOS

macOS instructions can be found on MacOS/Quartz (This is the procedure used for building the binary packages) or GnuCash installation from source on macOS.

Building on Microsoft Windows

Compiling GnuCash on Windows is possible, but much more difficult than on Linux. For details, see building GnuCash on Microsoft Windows.