[gretl main page]

Gretl: Gnu Regression, Econometrics and Time-series Library

for Mac OS X

Pre-built disk image

The simple way of installing gretl for OS X is to grab and install two disk images (dmg files) as follows:

The gretl links above are to the latest official release. Another possibilility is to download the current "snapshot" of gretl from Wake Forest University: either gretl-intel.dmg.gz for Intel or gretl-ppc.dmg.gz for PPC. This is likely to be somewhat more up to date: sometimes it will contain bug-fixes, and sometimes it will contain newly introduced bugs! Translations into languages other than English are likely to be incomplete. What's new in the snapshot? Take a look at the Change log (the "in progress" entry).

The gretl disk image is briefly documented in README.pdf, which contains some suggestions for trouble-shooting. Briefly, if you want to debug a non-functioning gretl on OS X, please try this: open an X11 terminal window; change directory (cd) to Gretl.app (where you installed the package); change directory to Contents/Resources/bin and run the command

./gretl

This should give you some feedback on what is going wrong.

Please note: this package depends upon Apple's X11 (their port to the Mac of the X Window system). This is available on the OS X installation DVDs.

Optional extras you may wish to install:

X-12-ARIMA (seasonal adjustment, ARIMA models; Intel Macs)

x12arima-intel.dmg

X-12-ARIMA (seasonal adjustment, ARIMA models; PPC Macs)

x12arima-ppc.dmg

TRAMO/SEATS (seasonal adjustment, ARIMA models)

tramo-seats.dmg

Alternative method: build using Fink

If the pre-built image doesn't work for you, or if you want more control over the build, you can compile gretl from source yourself. One way of doing this is via the Fink system, available from http://fink.sourceforge.net/download/.

Besides the basic installation of Fink itself, for building and running gretl you will need to ensure that the following Fink packages are present and correct (some of them may already be installed and up to date, in which case Fink will tell you that). After each package, I show the command (to be typed at the command prompt in an xterm or the Mac Terminal app) to do the job:

system-xfree86

fink install system-xfree86

gtk+2

fink install gtk+2

gtk+2-dev

fink install gtk+2-dev

libxml2

fink install libxml2

gnuplot

fink install gnuplot

fftw3

fink install fftw3

In particular, you should ensure that gnuplot is up to date (the package number should be at least 4.0 to work with gretl).

At one time you also needed the following, but this may now be redudant:

dlcompat

fink install dlcompat

dlcompat-dev

fink install dlcompat-dev

Environment variables

To compile gretl using fink, you need to make sure the environment is set up correctly -- before running gretl's configure script. This means setting several environment variables; exactly how this is done depends on whether your shell is tcsh or bash (tcsh was the default in OS X prior to Panther, but I believe bash is the default under Panther). You can either execute the following commands one by one, or (better) put them into your shell startup file, either .tcshrc or .bashrc (I think) in your home directory.

tcsh version:

setenv CFLAGS -I/sw/include
setenv LDFLAGS -L/sw/lib
setenv CXXFLAGS $CFLAGS
setenv CPPFLAGS $CXXFLAGS
setenv ACLOCAL_FLAGS "-I/sw/share/aclocal"
setenv PKG_CONFIG_PATH "/sw/lib/pkgconfig"

bash version:

export CFLAGS=-I/sw/include
export LDFLAGS=-L/sw/lib
export CXXFLAGS=$CFLAGS
export CPPFLAGS=$CXXFLAGS
export ACLOCAL_FLAGS="-I/sw/share/aclocal"
export PKG_CONFIG_PATH="/sw/lib/pkgconfig"

You should also make sure to source the init.sh supplied by fink:

source /sw/bin/init.sh

You may want to look at the fink FAQ.

Configure and build

Once you have the right versions of OS X, Apple's X11, Fink, and the required Fink packages, and you have the environment correctly configured, installing gretl should be fairly straightforward. I hope to make a Fink package for gretl available before too long, but for now you have to install it from source. Here is how it goes:

  1. Download the source package:
    curl -O http://ricardo.ecn.wfu.edu/pub/gretl/gretl-1.8.7.tar.bz2

  2. Unpack the source:
    tar xvfj gretl-1.8.7.tar.bz2

  3. Move into the gretl source directory:
    cd gretl-1.8.7

  4. Configure the source code package:
    ./configure --prefix=/sw --disable-png-comments

  5. Type make to build gretl. This takes a while.

  6. Type sudo make install to install gretl.

In case it's useful, here's the whole lot in the form of a shell script:

#!/bin/sh
# initialize fink
. /sw/bin/init.sh
# set up the compilation environment
export CFLAGS="-O2 -I/sw/include"
export LDFLAGS=-L/sw/lib
export CXXFLAGS=$CFLAGS
export CPPFLAGS=$CXXFLAGS
export ACLOCAL_FLAGS="-I/sw/share/aclocal"
export PKG_CONFIG_PATH="/sw/lib/pkgconfig"
# download the gretl source
curl -O http://ricardo.ecn.wfu.edu/pub/gretl/gretl-1.8.7.tar.bz2
# unpack the source archive
tar xvfj gretl-1.8.7.tar.bz2
# move into the gretl source directory
cd gretl-1.8.7
# configure the build
./configure --prefix=/sw
# make the program
make
# install gretl (root password needed)
sudo make install

You should now be able to run gretl by typing "gretl" at the command prompt in an xterm (launched by starting up Apple's X11).