Difference between revisions of "MacOS Installation"

From GnuCash
Jump to: navigation, search
m (Use MacPorts to install GnuCash)
(lc title)
 
(72 intermediate revisions by 23 users not shown)
Line 1: Line 1:
= PPC Macs =
+
{{Lowercase title}}
 +
== Download, Drag, and Drop ==
 +
Download the current release from the [http://www.gnucash.org/download.phtml download page]. Note that GnuCash 3 and later are supported only on OS X 10.9 (Mavericks) and later; users of Mac OS X 10.5 (Leopard) - 10.8 (Mountain Lion), including those with PowerPC Macs, should be sure to download GnuCash 2.6.21, paying attention to the supported architecture.
  
== gnucash-1.8 (using Fink: easiest and quickest method) ==
+
Open the disk image and drag GnuCash from there to your applications folder. If you want to retrieve stock prices from the web, double-click on ''Finance Quote Update''. '''This will run a terminal application, even opening Terminal for you. It's a bit of a pain and requires that you have Xcode installed. We're sorry about that, but we haven't been able to figure out a better way.'''
  
[http://fink.sourceforge.net/ Fink] is a package-management tool making it easier to install all your favorite *nix tools and libraries under OS X. It's also the easiest way to run gnucash-1.8 under Mac OS X; in general (Intel Mac users see [[#Intel_Macs|below]]), gnucash-1.8 installation is as simple as:
+
''Upgrades:'' Same procedure: Download, drag, and drop. If, ''and only if'' you're upgrading from a version before 2.4.0, double click on ''Upgrade Dirs'' in the disk-image.
# download and install fink
 
# run 'sudo apt-get install gnucash'
 
# start up [http://www.apple.com/downloads/macosx/apple/x11formacosx.html X11] and run 'gnucash &' from an xterm
 
A gnucash-2.0 package is available for fink, however it is still being tested and is therefore in their 'unstable' tree - see: [http://fink.sourceforge.net/faq/usage-fink.php?phpLang=en#unstable enable the unstable tree].  Note also that fink packages in 'unstable' need to be compiled from source, compared to most of the ones considered stable (ie gnucash 1.8).  So, if you are short of time or downloading and compiling from source makes you uneasy, you might want to stick with 1.8 until 2.0 is available as a stable fink package.  If not, read on.
 
  
== gnucash-2.0.5 (using MacPorts: takes longer, but more recent version) ==
+
== Building yourself ==
 +
Instructions for building a complete Gnucash application, including bundling it for distribution, are at [[MacOS/Quartz]].
  
MacPorts (formerly known as DarwinPorts) can help you install GnuCash 2.0.5 and install all of the packages it depends on.  This method will provide you with the latest version of GnuCash (as of March 2007).  Things to do before you start:
 
  
=== Install the latest Developer Tools from Apple - a.k.a. XCode ===
+
=== MacPorts ===
# Download the latest version from [[http://developer.apple.com developer.apple.com]] (free registration is required).
 
# You dont need to install all of the package - use the 'Customize' button in the installer and only select:
 
## Developer Tools Software
 
## gcc 4.0
 
## gcc 3.3
 
## Software Development Kits
 
  
=== Install MacPorts ===
+
MacPorts is a parallel package manager to make macOS work like Linux. See [[MacOS/MacPortsDetail]] for more information.
# Go to the [[http://trac.macosforge.org/projects/macports/wiki MacPorts]] or [[http://darwinports.opendarwin.org/docs/ch01s03.html DarwinPorts]] website and get the latest version installed
 
# Make sure you update all the package descriptions so you can get the latest GnuCash:
 
<pre>
 
sudo port selfupdate
 
</pre>
 
  
=== Use MacPorts to install GnuCash ===
+
=== HomeBrew ===
Once that's done, you can issue the following command to install GnuCash - this will take you quite a while, as the software will be downloaded, then compiled and installed.  It took a good 6 hours on my iBook.  On my fresh install of MacPorts, the installation did stall with the 'scrollkeeper' package, but you can just run the same install command again.  The whole installation of MacPorts with GnuCash adds up to about 1GB.
 
  
<pre>
+
A newer and more popular package manager for making macOS work like Linux, [https://brew.sh/ HomeBrew] just redistributes the GnuCash application bundle. You might as well get it from [https://www.gnucash.org here].
$ sudo port install gnucash
 
</pre>
 
  
If this works for you, you can skip the rest of this article.  Congratulations!
+
== Final Words ==
  
=== Potential Problems ===
+
If you encounter problems, please check the mailing list archives first and then, if your problem cannot be resolved based on the information found there, report it to the mailing list.  Please do remember that GnuCash developers are volunteers and are not responsible for your computer; as such, your help (in the form of exhausting readily available resources before asking for help and in [http://www.catb.org/~esr/faqs/smart-questions.html asking for help in a clear manner]) is appreciated.
  
==== XFree86 ====
 
  
Note (2006-11-15):  If you receive an error about activating XFree86 that reads something like: "Target com.apple.activate returned: Image /usr/X11R6/lib/libXpm.4.11.dylib already exists and does not belong to a registered port.  Unable to activate port XFree86." this means that you have MacOS-X X11User.pkg installed but not the X11SDK.pkg.  You should install the X11SDK.pkg from the XCode Packages directory and then you can re-issue the "port" command.
+
[[Category: MacOS]]
 
 
==== Missing LibOFX ====
 
 
 
Note (2007-03-21): When I used the above command it got part way through and then failed with the error message: ''*** LibOFX>=0.8.0 is required for backend "aqofxconnect".''  To get around this problem I simply installed libofx manually first with:
 
<pre>
 
$ sudo port install libofx
 
</pre>
 
and then retyped ''sudo port install gnucash'' and things proceeded smoothly.
 
 
 
==== SLIB 3a4 ====
 
 
 
MacPorts had slib 3a4 for a few days in January.  GnuCash (and other things required to build it)
 
does not work with this version at the moment.  MacPorts will now 
 
install the previous (known good) version of slib again (3a3).  However, 
 
you may have to downgrade manually.
 
 
 
You should be able to fix your GnuCash installation by re-installing 
 
slib and slib-guile:
 
 
 
<pre>
 
sudo port selfupdate
 
sudo port -f uninstall slib
 
sudo port install slib
 
sudo port -f uninstall slib-guile
 
sudo port install slib-guile
 
</pre>
 
 
 
==== guile 1.8.1 ====
 
 
 
MacPorts has updated its guile port to 1.8.1.  While this is certainly nice, guile 1.8.1 does not work with GnuCash out-of-the box. :-(
 
 
 
If you have installed GnuCash using MacPorts before March 24, 2007, and want to upgrade to a more recent version, you will have to do the following:
 
 
 
<pre>
 
sudo port uninstall gnucash
 
sudo port -f uninstall g-wrap
 
sudo port -f uninstall slib-guile
 
sudo port -f uninstall guile
 
sudo port selfupdate
 
sudo port install gnucash
 
</pre>
 
 
 
These commands will remove those guile-related ports that now refer to guile 1.8.1 from your system.  ''sudo port selfupdate'' retrieves current building instructions from the MacPorts server (which should have them by March 29). ''sudo port install gnucash'' will then pull in guile16, slib-guile16 and so on, thus referring to known-good software versions.
 
 
 
The incantation given above should start working sometime on March 29.  If you try before and fail, changes have not yet propagated; please wait 12 hours and try again.
 
 
 
If you have installed GnuCash using MacPorts after March 28, 2007, things should Just Work (tm), and you can ignore this section. :-)
 
 
 
== Compiling on your own (using MacPorts)==
 
 
 
If you want to run a more recent version of GnuCash 2 than that found in MacPorts, you can use the following instructions.  As before, make sure you have the latest version of XCode from Apple before you start.
 
 
 
=== Prerequisites ===
 
 
 
According to the gnucash website "to install GnuCash, users will need Gnome 2, guile, slib and g-wrap" so the first steps (assuming DarwinPorts is installed) are simply:
 
 
 
<pre>
 
$ sudo port install gnome
 
$ sudo port install slib-guile16
 
$ sudo port install g-wrap16
 
</pre>
 
 
 
Expect gnome to take a long time, the other two should be done relatively quickly. After installing you should see the dependancies listed as active by using this command:
 
 
 
<pre>
 
$ port installed
 
</pre>
 
 
 
=== Libraries and Includes ===
 
 
 
Now, this author didn't find the following in the DarwinPorts documentation, if it is there please update this information. Make sure the DarwinPorts libraries are available to your compiler, change these appropriately for your shell
 
 
 
<pre>
 
$ export CPPFLAGS="-I/opt/local/include"
 
$ export LDFLAGS="-L/opt/local/lib"
 
$ export DYLD_LIBRARY_PATH="/opt/local/lib"
 
</pre>
 
 
 
=== From Source ===
 
 
 
Download the gnucash-2.0.x source, extract it, read the INSTALL file. You may want to adjust the configure line to suite your preferences. This author uses the following:
 
 
 
<pre>
 
$ ./configure -C --prefix=/opt/local
 
$ make
 
$ sudo make install
 
</pre>
 
 
 
If configure fails due to missing libraries then first make sure you properly set the CFLAGS, CPPFLAGS and LDFLAGS variables, and then verify that you actually installed the libraries.
 
 
 
=== Problems on Panther ===
 
 
 
libgnomecups is broken on Panther which precludes gnome from building (Panther has an older version of CUPS which doesn't have cupsGetFd).  Fink (which has a different tree for Panther) takes care of this by using a older version of libgnomecups.
 
 
 
== gnucash-2.0 (using Fink)==
 
 
 
It is quite possible to run gnucash-1.9.5+ from svn on Mac OS X.  This is how I accomplished it (with a bit of help, of course).
 
 
 
=== Dependencies and Fink ===
 
 
 
GnuCash has a significant number of dependencies.  Although it should be entirely possible to install them manually, it's much easier to use fink.
 
 
 
=== Installing dependencies ===
 
 
 
Note: you need the unstable tree turned on in fink to get some of these packages.
 
 
 
David Reiser advised me to start with the following fink packages to get my dependencies straightened out:
 
 
 
<pre>
 
gconf2, gconf2-dev, gconf2-shlibs
 
glib2, glib2-dev, glib2-shlibs
 
gtk+2, gtk+2-dev, gtk+2-shlibs
 
guile16, guile16-dev, guile16-libs, guile16-shlibs, guile16-gtk
 
slib, slib-gu16
 
libart2, libart2-shlibs
 
libglade2, libglade2-shlibs
 
libgnomeprint2.2, libgnomeprint2.2-dev, libgnomeprint2.2-shlibs
 
libgnomeui2, libgnomeui2-dev, libgnomeui2-shlibs
 
libgsf, libgsf-dev
 
gtkhtml3.8.15, gtkhtml3.8.15-dev, gtkhtml3.8.15-shlibs
 
libxml2, libxml2-bin, libxml2-shlibs
 
pango1-dev, pango1-xft2, pango1-xft2, pango1-xft2-shlibs
 
pango1-xft2-ft219, pango1-xft2-ft219-dev, pango1-xft2-ft219-shlibs
 
freetype219, freetype219-shlibs
 
</pre>
 
 
 
You can probably do this in one fink command, although you may run into circular dependency issues and need to keep trying (fink won't try to reinstall packages that are already installed):
 
<pre>
 
fink install gconf2 gconf2-dev gconf2-shlibs glib2 glib2-dev glib2-shlibs gtk+2 gtk+2-dev \
 
gtk+2-shlibs guile16 guile16-dev guile16-libs guile16-shlibs guile16-gtk slib slib-gu16 libart2 \
 
libart2-shlibs libglade2 libglade2-shlibs libgnomeprint2.2 libgnomeprint2.2-dev \
 
libgnomeprint2.2-shlibs libgnomeui2 libgnomeui2-dev libgnomeui2-shlibs libgsf libgsf-dev \
 
gtkhtml3.8.15 gtkhtml3.8.15-dev gtkhtml3.8.15-shlibs libxml2 libxml2-bin libxml2-shlibs pango1-dev \
 
pango1-xft2 pango1-xft2 pango1-xft2-shlibs pango1-xft2-ft219 pango1-xft2-ft219-dev \
 
pango1-xft2-ft219-shlibs freetype219 freetype219-shlibs</pre>
 
 
 
This will probably pull in other dependencies; although I had all but seven of the packages above installed, my fink command pulled in 58 additional packages and took roughly four hours to complete on a G4/800 with 1 GB of RAM.
 
 
 
An alternative, faster, way to install the dependencies is with apt-get install. But this needs several additional packages, including:
 
 
 
<pre>
 
apt-get install atk1 gtk+2-dev libgnome2 libgnome2-dev libgnomecanvas2-dev libgnomedb-dev libbonobo2-dev libbonoboui2-dev
 
</pre>
 
 
 
But gnucash 2.0 still needs a version of libglade >= 2.4, whereas fink unstable has (as of 10/10/2006) only version 2.3.6. Surely this affects the "fink install" command above too?
 
 
 
 
 
==== g-wrap ====
 
 
 
This is where things start to get a little interesting.  g-wrap 1.3.4-14 is the most recent version available via fink.  g-wrap 1.3.4 is not compatible with aqbanking / ofxconnect, so if you need that functionality you are advised to download and install a more recent g-wrap yourself.
 
 
 
To further complicate matters, g-wrap 1.3.4 does not compile with gcc 4.0.  There are two possible solutions to this problem. We can install g-wrap 1.9.7 manually and still use gcc 4.0 or we can choose to use gcc 3.3 and install  g-wrap 1.3.4-14 using fink.
 
 
 
===== g-wrap 1.9.7 manually =====
 
 
 
Download and unpack the g-wrap 1.9.7 source code:
 
 
 
<pre>
 
$ curl http://download.savannah.gnu.org/releases/g-wrap/g-wrap-1.9.7.tar.gz -o g-wrap-1.9.7.tar.gz
 
$ tar xfz g-wrap-1.9.6.tar.gz
 
</pre>
 
 
 
Compile and install the source code:
 
 
 
<pre>
 
$ cd g-wrap-1.9.7
 
$ ./configure
 
$ sudo make all install
 
</pre>
 
 
 
Oct 20, 2006: I had to use: <pre>./configure --prefix=/sw</pre> to get guncash to find this version of g-wrap using the instructions below on 10.4.8 PPC even though I had already done fink remove below. This installs g-wrap in a place that fink should overwrite it when a fink version of 1.9.6 comes out but that should be okay.
 
 
 
If you have previously installed an earlier version of g-wrap using fink, you might need to remove it in order for the gnucash configure-script to find the correct version:
 
 
 
<pre>
 
$ sudo fink remove g-wrap g-wrap-dev g-wrap-shlibs
 
</pre>
 
 
 
===== g-wrap 1.3.4-14 using fink =====
 
 
 
2006-06-21: g-wrap-1.3.4-1014 compiles on Intel Mac Darwin 8.6.1  with gcc 4.0.1
 
 
 
We will compile both g-wrap and gnucash with gcc 3.3 (by changing the default compiler).  Hopefully, this will be as simple as:
 
 
 
<pre>
 
$ sudo gcc_select 3.3
 
</pre>
 
 
 
(If this does not work, you probably don't have gcc 3.3 installed.  I'm not sure whether XCode or fink is the appropriate place from which to get gcc 3.3, but I had it installed.  Fink does have a gcc3.3 virtual package, and that may be a good place to start.)
 
 
 
Now, I was slightly concerned about whether or not g-wrap might try to interface with the wrong version of guile, so I decided to remove guile 1.4.  This may or may not be necessary, but it can be achieved by:
 
<pre>
 
$ sudo fink remove guile guile-dev guile-shlibs
 
</pre>
 
 
 
2006-06-21: dpkg on Intel Mac Darwin 8.6.1 removes guile-dev automatically and replaces it with guile-dev16
 
 
 
As I didn't get any complaints from fink about dependency breakage, I'm guessing that I didn't really need guile 1.4 installed anyhow.
 
 
 
With those side excursions out of the way, go ahead and install g-wrap:
 
<pre>
 
$ sudo fink install g-wrap g-wrap-dev g-wrap-shlibs
 
</pre>
 
 
 
=== gnucash 1.9 / 2.0 from SVN ===
 
 
 
==== Get the source ====
 
 
 
Go to an appropriate directory and grab either a tarball from the website or just pull the latest source from [[Subversion svn]].  I did the latter, putting the gnucash tree under my 'src' directory in my Documents folder:
 
 
 
<pre>
 
$ cd ~/Documents/src/
 
$ svn checkout http://svn.gnucash.org/repo/gnucash/trunk gnucash
 
</pre>
 
 
 
(If you get '<tt>svn: command not found</tt>', then you don't have Subversion installed; you can install it from fink with '<tt>sudo fink install svn-client-ssl</tt>' or download and expand a tarball from the website.  If <tt>~/Documents/src</tt> does not exist, you can either '<tt>mkdir ~/Documents/src</tt>' and then <tt>cd</tt> to it or you can use another location of your choosing, so long as you remember where it is.)
 
 
 
====Remove gnucash-1.8====
 
 
 
Unfortunately, it is necessary to remove gnucash-1.8 prior to compiling 1.9 or later versions.  Assuming you used fink to install gnucash-1.8, you may uninstall it with:
 
 
 
<pre>
 
$ sudo fink remove gnucash
 
</pre>
 
 
 
If you have never installed 1.8, then you may skip this step.  If you installed 1.8 via another method, you will have to uninstall it via another method.
 
 
 
====Set environment variables====
 
# Change PATH environment variable so that the build sees fink's guile 1.6 binaries instead of others:
 
<pre>
 
$ export PATH=/sw/share/guile/1.6/scripts/binoverride:$PATH
 
</pre>
 
# Set CFLAGS, CPPFLAGS, and LDFLAGS to make sure that the compile process includes fink-provided libraries:
 
<pre>
 
$ export CFLAGS="-L/sw/lib -I/sw/include"
 
$ export CPPFLAGS="-L/sw/lib -I/sw/include"
 
$ export LDFLAGS="-L/sw/lib"
 
</pre>
 
 
 
==== autogen, configure, make ====
 
 
 
First, change to the gnucash directory from where you either downloaded the svn tree or expanded the tarball.
 
<pre>
 
$ cd gnucash
 
</pre>
 
 
 
Feeling lucky?  Run:
 
<pre>
 
$ ./autogen.sh ; ./configure --with-g-wrap-prefix=/sw --enable-compile-warnings ; make ; sudo make install
 
</pre>
 
 
 
Note that this will install in the usual <tt>/usr/local</tt>  locations.  If you'd prefer to install elsewhere, you may do so by using the <tt>--prefix</tt> switch; I did this because I wanted to keep the prerelease, non-fink built stuff in one place so that it would be easier to remove later when 2.0 becomes available through fink.  I created a directory <tt>~/usr</tt> and installed there with:
 
 
 
<pre>
 
$ ./autogen.sh ; ./configure --with-g-wrap-prefix=/sw --enable-compile-warnings --prefix=~/usr ; make install
 
</pre>
 
 
 
If you want to have OFX import you need to include --enable-ofx and have fink install libofx1 and libofx1-shlibs. Also if you installed the fink version of g-wrap it seems you need to not include --enable-compile-warnings.
 
 
 
(sudo was not necessary for the <tt>make install</tt> step because I wasn't installing into a privileged directory)
 
 
 
If this doesn't work, you should probably try each step separately:
 
<pre>
 
$ ./autogen.sh
 
$ ./configure --with-g-wrap-prefix=/sw --enable-compile-warnings --prefix=~/usr
 
$ make install
 
</pre>
 
 
 
=== Caveats ===
 
# If you change your mind on where you want to install gnucash after the first time you run make, you may need to clean up and recompile to get things cleanly installed in the new location, i.e.:
 
<pre>
 
make distclean ; ./autogen.sh ; \
 
./configure --with-g-wrap-prefix=/sw --enable-compile-warnings --prefix=~/other ; make install
 
</pre>
 
# Compiling may take a while, especially on older hardware, so you're advised to get the location right the first time.  Trust me.
 
 
 
=== Easier with new Fink 0.8.1 - Works with 2.0.0 ===
 
 
 
Once you have upgraded to Fink 0.8.1 with the 10.4 native tree instead of the transitional one all of the gcc 3 vs 4 problems seem to have been resolved. I followed the instructions here for the most part to build 2.0.0 - but I just put g-wrap g-wrap-dev g-wrap-shlibs into the big fink install line, accepted all of the defaults for the questions that it raised along the way, and it works perfectly.
 
 
 
I have a PowerBook G4 so this has no bearing on the Intel Mac problems.
 
 
 
= Intel Macs =
 
 
 
== gnucash-1.8 ==
 
 
 
As of June, 2006, GnuCash-1.8 does '''not''' work on Intel-based Macs.  Both 1.8.''x'' and 1.9.''x'' series installations have dependencies (such as libgnomecanvas [http://bugzilla.gnome.org/show_bug.cgi?id=339489 Gnome Bug #339489]) which are known not to function correctly in this environment.  As the known issues reside in external libraries (i.e. not within the GnuCash source tree), we are hoping that they will be resolved by the maintainers of those libraries (or their fink ports).  Please check the [https://lists.gnucash.org/search/ gnucash (-users and -devel)] and [http://news.gmane.org/gmane.os.apple.fink.general fink-users] mailing list archives for more history and updates.
 
 
 
== gnucash-2.0 ==
 
 
 
As of August 2006, Gnucash 2 works fine on many Intel Macs. Installation instructions for gnucash-2.0 on Intel Macs may be found [http://captnswing.net/2006/07/10/gnucash20_on_intel_macs.html here] (or you could just jump to the top of this page...).
 
 
 
= Final Words =
 
 
 
Currently, none of the primary GnuCash development occurs under OS X; as such, clear and specific bug reports (particularly of new issues not already reported) may be helpful.  If you encounter problems, please check the mailing list archives first and then, if your problem cannot be resolved based on the information found there, report it to the mailing list.  Please do remember that GnuCash developers are volunteers and are not responsible for your computer; as such, your help (in the form of exhausting readily available resources before asking for help and in [http://www.catb.org/~esr/faqs/smart-questions.html asking for help in a clear manner]) is appreciated.
 

Latest revision as of 02:16, 28 May 2021

Download, Drag, and Drop

Download the current release from the download page. Note that GnuCash 3 and later are supported only on OS X 10.9 (Mavericks) and later; users of Mac OS X 10.5 (Leopard) - 10.8 (Mountain Lion), including those with PowerPC Macs, should be sure to download GnuCash 2.6.21, paying attention to the supported architecture.

Open the disk image and drag GnuCash from there to your applications folder. If you want to retrieve stock prices from the web, double-click on Finance Quote Update. This will run a terminal application, even opening Terminal for you. It's a bit of a pain and requires that you have Xcode installed. We're sorry about that, but we haven't been able to figure out a better way.

Upgrades: Same procedure: Download, drag, and drop. If, and only if you're upgrading from a version before 2.4.0, double click on Upgrade Dirs in the disk-image.

Building yourself

Instructions for building a complete Gnucash application, including bundling it for distribution, are at MacOS/Quartz.


MacPorts

MacPorts is a parallel package manager to make macOS work like Linux. See MacOS/MacPortsDetail for more information.

HomeBrew

A newer and more popular package manager for making macOS work like Linux, HomeBrew just redistributes the GnuCash application bundle. You might as well get it from here.

Final Words

If you encounter problems, please check the mailing list archives first and then, if your problem cannot be resolved based on the information found there, report it to the mailing list. Please do remember that GnuCash developers are volunteers and are not responsible for your computer; as such, your help (in the form of exhausting readily available resources before asking for help and in asking for help in a clear manner) is appreciated.