WFDB quick start for Mac OS X (Darwin)

To install and use the WFDB Software Package successfully, you must
know how to use the Terminal application and the Unix shell. If you
are unfamiliar with Unix commands, please find and study a good
reference on the subject, such as David Pogue's Mac OS X: The
Missing Manual, or Dave Taylor's Learning Unix for Mac OS
X (both published by O'Reilly), or get the help of a local
expert.

The WFDB Software Package has been successfully compiled and tested on
Intel-based Macs under Mac OS X 10.6 (Snow Leopard) and 10.5
(Leopard), and on PPC-based Macs under Mac OS X 10.3 (Panther) and
10.2 (Jaguar). We have not tested other versions of OS X. Note that
the XView toolkit needed in order to use WAVE is available for PPC but
not (yet) for Intel-based Macs.

Thanks to Isaac Henry for the original port of the WFDB Software
Package to Mac OS X; to David T. Linker, MD, of the University of
Washington, for providing instructions for compiling WAVE under Mac OS
X 10.2 on PPC Macs; and to Prof. Logan Donaldson, of York University
(Toronto), for the port of the XView toolkit to Mac OS X 10.0 (PPC)
that made David's port of WAVE possible.

Install XCode, including "UNIX Development Support".
XCode is a set of software development tools including
gcc, make, the libcurl and X11 SDKs,
and much more. XCode is included on current Mac OS X CDs and
DVDs, and can also be freely downloaded
from http://developer.apple.com/tools/xcode/.

You will not be able to compile or use WAVE unless you have installed
XView, but none of the other WFDB applications requires XView.
Other components of PhysioToolkit,
such as SEMIA,
require XView.

At this time, it is necessary to use the XView binaries available
here, which work only
on PPC-based Macs. A package for Intel-based Macs may be
available soon. Sources are available
here, but compiling them under
Mac OS X is not straightforward.

The currently available version does not include the textedit
application, which is WAVE's default menu editor. This will not
prevent you from using WAVE, but you should set the EDITOR environment
variable to the pathname of your preferred text editor before running
WAVE if you plan to edit WAVE's menu file. For example, you might add

export EDITOR=/usr/bin/emacs

to the file named .bash_profile in your home directory.

Download the current version of the WFDB Software Package as sources or binaries. The binary distribution is experimental and may not be
up-to-date; we strongly recommend following the procedure described below
for compiling the software from the sources instead. If you plan to compile
WFDB applications that are not included in the binary packages, please start
with the sources.

If you download the sources (recommended):

If your web browser decompressed the archive (Safari does this), use this command to
unpack it:

tar xfv wfdb.tar

Otherwise, decompress and unpack with this command:

tar xfvz wfdb.tar.gz

Unpacking the archive creates a directory with a name of the form
wfdb-10.m.n. Enter this directory:

cd wfdb-10.m.n

If you are using an unpatched version of XCode 4 or later, edit
conf/darwin.def and conf/darwin-slib.def,
removing the string '-arch ppc' from the end of the
definition of CFLAG in each file. (Read about alternatives
below.)

Configure and install the package:

./configure
sudo make install

The sudo command prompts for your password, needed in order
to install the package in subdirectories of /usr. If you do not
have administrative permissions, you may install the package in any writable
directory by running make directly, adding an appropriate option:

make install WFDBROOT=/path/to/another/directory

Note that in this case you will need to add WFDBROOT/bin
to your PATH, and WFDBROOT/lib to your
DYLD_LIBRARY_PATH.

(Optional) Check that the WFDB library and applications have
been correctly compiled and installed:

make check

This step compiles a short program that exercises the WFDB
library, prints a summary of test results, and prompts you to
press <Enter>. After you have done so, the WFDB
applications are tested. The tests are very short (typically
less than a second each), except that the last one (xform using
NETFILES) may take up to a minute if you have a slow or
inoperative Internet connection. If any application test
fails, its output can be found in the checkpkg
subdirectory of the WFDB source tree; compare this output with
the files of the same names that can be found in the
checkpkg/expected subdirectory.

If you download the binaries (not recommended):

Download the appropriate binary archive for your CPU type
(Intel or PPC). Unpacking the archive creates a directory with a name
of the form wfdb-10.m.n-cputype-Darwin. Copy its
contents into the same-named subdirectories of /usr:

cd wfdb-10.m.n-cputype-Darwin
sudo cp -pr . /usr

If XView is installed, test WAVE.

On Mac OS X 10.5 and later:
The X server starts automatically when needed, so simply run the command:

wave -r mitdb/200 -a atr

On earlier versions of Mac OS X:
Unless the X server is running already and an xterm window is open,
run the command:

startx &

In the xterm window, type the command:

wave -r mitdb/200 -a atr

Note that WAVE's menus (marked with a ) are opened using a right click; if you have a
one-button mouse, simulate a right click by pressing and holding the
apple key while clicking. Annotation editing requires the use of the
middle button, which can be simulated by using the option key while
clicking.

If you have not used WAVE before, you may want to follow through the tutorial
material in the beginning of the WAVE User's
Guide.

The WFDB Software Package supports creation of multi-architecture ("fat")
binaries that run on 32- and 64-bit Intel as well as PPC versions of Mac OS X,
using XCode 3 and earlier versions based on the gcc C compiler.
In XCode 4, Apple replaced gcc with its own C compiler, breaking
support for its older PPC machines. As a result, you will need to choose
one of these options before compiling the WFDB Software Package, if XCode 4
is installed on your computer:

If you don't have any PPC-based Macs and don't care if your
software won't run on them, edit conf/darwin.def
and conf/darwin-slib.def as described in step 4 above. Your
binaries will be usable on 32- and 64-bit Intel Mac OS X only in this case.

Your comments and suggestions are welcome. We encourage you to use our
feedback form to comment
on this page. If you would like to receive a reply, please send your
comments by email to
webmaster@physionet.org.
Updated
Sunday, 18 December 2011 at 22:28 EST