\documentclass[twoside]{article}
\oddsidemargin 0.1in
\evensidemargin -0.1in
\def\textwidth{6.375 in}

\title{Installing the WFDB Software Package}
\author{George B. Moody\\
Harvard-MIT Division of Health Sciences and Technology, Cambridge, MA, USA}
\date{}

\begin{document}
\setcounter{page}{109}

\maketitle

\section*{Summary}
This appendix briefly describes how to install the WFDB Software Package on a
new system.  The package includes C-language sources for the WFDB library and
for the applications described in this manual; \LaTeX{}, {\tt texinfo}, and
{\tt troff} sources for this and other manuals; and a one-minute sample record
({\tt 100s}).  Except for UNIX-specific and MS-DOS-specific visualization
programs and an MS-DOS-specific digitization/replay program, all of the
software is portable between UNIX and MS-DOS, and is usable under VMS and on
the Macintosh with only minor modifications.

\section*{Obtaining the WFDB Software Package}
The latest version of the WFDB Software Package can always be downloaded in
source form from PhysioNet and its mirrors (see
{\tt http://www.physio\-net.org/physio\-tools/wfdb.shtml}); binaries for
popular operating systems and development snapshots are also usually available
for downloading there.  For information on obtaining the latest version of the
WFDB Software Package on CD-ROM, {\tt Sources}.

The WFDB Software Package is recommended to all who are able to use it, since
it is freely available in source form and is actively maintained.  The
predecessor of the WFDB Software Package (the DB Software Package) was included
in source form in the second and third editions of the MIT-BIH Arrhythmia
Database CD-ROM, and parts of it have been included on several other CD-ROMs
that contain databases of ECGs and other signals, including the first edition
of the MIT-BIH Arrhythmia Database CD-ROM, both editions of the European ST-T
Database CD-ROM and the MIT-BIH Polysomnographic Database CD-ROM, and on the
MGH/Marquette Foundation Waveform Database CD-ROMs ({\tt Sources}).  If you
have one of these CD-ROMs and you cannot upgrade to the WFDB Software Package,
see the files {\tt readme.doc} (in the root directory of the CD-ROM) and
{\tt lib.doc} (in the {\tt lib} directory), or {\tt README.TXT} (in the
{\tt software} directory).

\subsection*{UNIX, Linux, and similar operating systems}

Before beginning the installation of the WFDB Software Package, obtain and
install the {\tt libwww} package from {\tt http://www.w3.org/Library/} or
from {\tt http://\-www.physio\-net.org/physio\-tools/libwww/}.  This package is
provided with most current versions of Linux.  (If you have a program called
{\tt libwww-config}, then {\tt libwww} is installed already.)  You may
omit this step if you do not wish to have NETFILES support.

Also download and install the {\tt XView} software packages from {\tt
http://www.\-physio\-net.org/\-physio\-tools/xview/}.  Sources are available,
as are binaries for several versions of Linux.  If you are using SunOS or
Solaris, XView binaries are available in the Open Look Software Development
package and may be installed already.  (If you have a program called {\tt
textedit}, then {\tt XView} is installed already.) If you are able to use an
existing set of binaries, these are recommended, since the sources may take a
{\em long} time to compile.  Be sure that the directory containing {\tt
textedit}, usually {\tt /usr/openwin/bin}, is in your {\tt PATH}.  You may omit
this step if you do not wish to use {\em WAVE}.

Select an existing directory in a writable file system for the WFDB Software
Package installation; {\tt /usr/local/src} is a good choice in most cases.
Make sure that at least 6 megabytes are available (most of this space can be
recovered after the installation is complete).

If you have downloaded the software from PhysioNet or another source, you
will have a {\tt gzip}-compressed {\tt tar} archive.  Unpack it using
the commands:

\begin{verbatim}
gzip -d wfdb.tar.gz
tar xfv wfdb.tar
\end{verbatim}

(If you have GNU {\tt tar}, as on Linux, you can combine these into a
single command: {\tt tar xfvz wfdb.tar.gz}.)

This will create a directory with a name of the form {\tt wfdb-}{\em m.n.r},
where {\em m.n.r} is the version number of the included WFDB library (e.g.,
{\tt 10.1.1}).  Enter this directory.

If you are installing the software from a CD-ROM, copy the contents of the
{\tt src/wfdb} directory to your writable file system and then enter that
directory.  One way to do this is to change to the {\tt src} directory on the
CD-ROM and then to type:

\begin{verbatim}
tar cfv - wfdb | ( cd /usr/local/src; tar xfv - )
cd wfdb
\end{verbatim}

In either case, you should now be ready to configure, compile, and install
the software, using the commands:

\begin{verbatim}
./configure
make install
\end{verbatim}

The {\tt make} command requires root permissions, and installs the package
in subdirectories of {\tt /usr}.  If you do not have root permissions,
you may install the package in any writable directory by adding an
appropriate option to the {\tt make} command above:

\begin{verbatim}
make install WFDBROOT={\em /path/to/another/directory}
\end{verbatim}

Note that in this case you will need to add {\em WFDBROOT}{\tt /bin}
to your {\tt PATH}, and {\em WFDBROOT}{\tt /lib} to your
{\tt LD\_LIBRARY\_PATH}.

Depending on the speed of your system and of your C compiler, {\tt make} will
generally require between 1 and 10 minutes.

\subsection*{MS-DOS and MS-Windows}

Install your C compiler if you have not already done so, and make sure that
your hard disk has at least 6 megabytes of free space remaining.  (Most of
this space can be reclaimed after the installation is complete.)

If you have Microsoft or Turbo C or C++, and a Microstar Laboratories DAP 1200-
or 2400-series analog interface board, you can instruct the {\tt install}
procedure to compile {\tt sample} (a program for creating database records
from analog signals, and for replaying them in analog form).  To do so
successfully, you must first have installed the Microstar {\tt \#include} files
and DAP interface library on your system.  Specifically, files {\tt c\_lib.c},
{\tt clock.h}, and {\tt ioutil.h} must be installed in your {\tt include}
directory, and file {\tt cdapl.lib} must be installed in a directory in which
libraries are found by your linker.  (If you are using Microsoft C, copy
{\tt cdapl5.lib} from the Microstar distribution diskettes into your library
directory, and rename it {\tt cdapl.lib}.)

If you have downloaded the {\tt gzip}-compressed {\tt tar} archive of WFDB
sources, rename it if necessary (your browser may have changed its name to
{\tt wfdb\_tar.gz};  its name must be {\tt wfdb.tar.gz} in order to be
unpacked successfully).  Either GNU/Cygnus {\tt gzip} and {\tt tar}, other
versions of these utilities, or WinZip can be used to unpack the source
archive.

If you are installing the software from a CD-ROM, copy the contents of the
{\tt wfdb} directory to a writable directory on your hard drive.

Enter the directory containing the sources and run {\tt install} to compile
and install the WFDB Software Package.

\subsection*{Other systems}

If you are installing the software from a CD-ROM, copy the contents of the
{\tt wfdb} directory to your hard disk.  Note that the text files are in
UNIX format (i.e., lines are terminated by ASCII line-feed characters only).
If your system expects text files in MS-DOS format (with both a carriage return
and a line-feed at the end of each line; VMS is one such system), use
{\tt u2d.exe} (available from PhysioNet or on the CD-ROM) to reformat the
text files under MS-DOS.  If your system is a Macintosh (which expects that
lines are terminated by carriage returns only), you will have to reformat the
text files yourself, which may be done under MS-DOS a PC using {\tt u2m.exe},
or on a Macintosh using third-party software.  Additional notes for Macintosh
users may be found in file {\tt MAC} (within the {\tt wfdb} directory).

The WFDB Software Package is written in highly portable C, and (with the
exception of a few MS-DOS or UNIX-specific display or data-acquisition
programs) should be easy to compile with any K\&R or ANSI C compiler.
The UNIX and MS-DOS {\tt make} description files ({\tt makefile.unx}
and {\tt makefile.dos} in {\tt wfdb} and in each of its subdirectories)
should get you started.
\end{document}
