This page provides further detail on compiling and installing GnuCash using MacPorts. For the overview of Mac installation options, see MacOSXInstallation.
- 1 MacPorts installation in detail
- 2 Using MacPorts to install a recent stable release of GnuCash
- 3 Current developer version
- 4 Compiling on your own
MacPorts installation in detail
Install the latest Developer Tools from Apple - a.k.a. XCode
- Download the latest version from [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
- Go to the [MacPorts] or [DarwinPorts] website and get the latest version installed
- Make sure you update all the package descriptions so you can get the latest GnuCash:
sudo port selfupdate
Using MacPorts to install a recent stable release of GnuCash
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.
$ sudo port install gnucash
As of May 2007, this was up-to-date with the latest stable release GnuCash-2.0.5. If this works for you, you can skip the rest of this section. Congratulations!
Potential Problems and their Solutions
The default installation of GnuCash using MacPorts enables everything, including things you might not need, or things that might even cause trouble. In particular, a few people have reported problems installing libraries required for OFX.
The following command tries to install a minimalistic version of GnuCash:
$ sudo port install gnucash +without_hbci +without_ofx +without_quotes +without_docs
Note (2007-12-27): The current MacPort version does not install on Leopard, due to a bug in the avahi port, which gnucash depends on. (See Ticket #13212.) This problem can be sidestepped by disabling python in the avahi Portfile, as explained in the ticket.
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.
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:
$ sudo port install libofx
and then retyped sudo port install gnucash and things proceeded smoothly.
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 29, 2007, and want to upgrade to a more recent version, you will have to do the following:
sudo port uninstall gnucash sudo port -f uninstall g-wrap sudo port -f uninstall slib-guile sudo port -f uninstall guile sudo port clean g-wrap16 slib-guile16 guile16 # if you've already tried things on your own sudo port selfupdate sudo port install gnucash
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. sudo port install gnucash will then pull in guile16, slib-guile16 and so on, thus referring to known-good software versions.
If your original install of GnuCash using MacPorts was sometime after March 28, 2007, things should Just Work (tm), and you can ignore this section. :-)
Current developer version
MacPorts has a port to install a somewhat current developer version from the source code repository.
If you've already installed the regular gnucash port, you will have to deactivate it:
sudo port deactivate gnucash
Then use the following command:
sudo port install gnucash-devel
For the 2.1.5 release (July 2, 2007), one needs to do the following after installing gnucash-devel:
sudo port uninstall gnucash-devel sudo port -f uninstall slib-guile sudo port -f uninstall guile sudo port clean slib-guile guile # for good measure sudo port -f install guile16 sudo port -f install slib-guile16 sudo port -f install gnucash-devel
Compiling on your own
If you want to run a more recent version of GnuCash 2 than that found in either of the above options, you can use the following instructions. Note however that at least in the spring of 2007, the gnucash-devel port has been tracking GnuCash unstable releases (and sometimes Subversion head versions) quite closely, so be sure that gnucash-devel is not recent enough for your needs. As before, make sure you have the latest version of XCode from Apple before you start.
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:
$ sudo port install gnome $ sudo port install slib-guile16 $ sudo port install g-wrap16
Note that as of GnuCash-2.1.0, swig is used instead of g-wrap, so installing the g-wrap16 port is no longer necessary for this version and later.
Expect gnome to take a long time, the other two should be done relatively quickly. After installing you should see the dependencies listed as active by using this command:
$ port installed
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
$ export CPPFLAGS="-I/opt/local/include" $ export LDFLAGS="-L/opt/local/lib" $ export DYLD_LIBRARY_PATH="/opt/local/lib"
Download the gnucash-2.x.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:
$ ./configure -C --prefix=/opt/local $ make $ sudo make install
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.