WFDB quick start for GNU/Linux

  1. Are you running a 32- or 64-bit Linux kernel?
    • To install the WFDB Software Package without WAVE, do steps 2, 4, and 7 below.
    • To install the WFDB Software Package with WAVE on 32-bit Linux, do steps 2, 3, 4, 6, and 7 below.
    • To install the WFDB Software Package with WAVE on 64-bit Linux, do steps 2, 4, 5, 6, and 7 below.

    Current versions of the WFDB Software Package can be compiled and installed on either 32- or 64-bit Linux, but the procedure for doing so depends on which you have. You can check this by running the command

    uname -m
    If the output is x86_64, your CPU and Linux kernel are both 64-bit, and you should use version 10.4.9, or any later version, of the WFDB Software Package. Although some older versions of the WFDB Software Package can also be compiled and installed on 64-bit Linux, they are not fully supported (see this note).

  2. Install gcc, libcurl, and perl (requires root permissions). Check to see if they are installed already using the commands
    gcc --version
    curl-config --version
    perl --version
    If these commands work, skip to the next step. Otherwise, on Fedora and other RPM-based GNU/Linux distributions, the command
    yum install gcc curl-devel perl
    will install the missing packages and any dependencies; on Ubuntu and other Debian-based GNU/Linux distributions, the command
    apt-get install gcc libcurl4-openssl-dev perl
    does the same thing.

    • You will be able to use the WFDB software to read files on local disk drives and CD-ROMs whether or not you install libcurl.
    • Direct access from WFDB applications to data files on remote web and FTP servers (NETFILES) is possible only if you install libcurl (or the older, unsupported, libwww).
    • Direct access from WFDB applications to password-protected data files on remote web and FTP servers requires libcurl 7.12.0 or later.
    • If you skip this step now, you may install libcurl or libwww and recompile the WFDB library later to enable NETFILES access for all of your WFDB applications. It will not be necessary to recompile the applications themselves.
    • perl is needed only in (optional) step 5, for installation of WAVE on 64-bit Linux.

  3. If you are running a 64-bit Linux kernel, skip this step! You will be able to install WAVE in step 5 below.

    If (and only if) you are running a 32-bit Linux kernel, and you wish to install WAVE, install the X11 developer's toolkit and XView (optional, requires root permissions) if they have not been installed already. (Check for the presence of Xlib.h, which is usually found in /usr/include/X11, to see if the X11 developer's toolkit has been installed. Check for the presence of textedit, which is usually found in /usr/openwin/bin, to see if XView has been installed.)

    • You will not be able to compile or use WAVE unless you have installed the X11 developer's toolkit and XView, but none of the other WFDB applications require XView. Other components of PhysioToolkit, such as plt and SEMIA, require X11 and XView.
    • The X11 developer's toolkit is contained in a package named libX11-devel in most current GNU/Linux distributions, such as Fedora 5 and later. In some older GNU/Linux distributions, the package you need may be called xorg-x11-devel or XFree86-devel. On Ubuntu or Debian, use 'apt-get install libx11-dev'.
    • PhysioNet's XView pages contain sets of XView RPMs and instructions for installing them. Be sure to install not only the basic xview package, but also the xview-clients and xview-devel packages. On Ubuntu or Debian, 'apt-get install xviewg-dev' suffices.

  4. Download the current version of the WFDB software package as sources or binaries. Binary packages are provided as a convenience 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 package, please start with the sources.

    If you download the sources (recommended):

    • Unpack the archive of sources:
      tar xfvz wfdb.tar.gz
      This creates a directory with a name of the form wfdb-10.m.n.
    • Enter this directory, configure, and install the package:
      cd wfdb-10.m.n
      make install
      If you are running a 64-bit Linux kernel, ./configure will report that WAVE will not be compiled (because WAVE cannot be compiled in 64-bit mode). You will be able to compile a 32-bit version of WAVE in step 5.

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

      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 LD_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 and applications, and prints a summary of test results. 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 (program.out) can be found in the checkpkg subdirectory of the WFDB source tree; compare this output with the file of the same name that can be found in the checkpkg/expected subdirectory.
  5. If you are running a 32-bit Linux kernel, skip this step!

    If you are running a 64-bit Linux kernel, install WAVE now (optional, requires root permissions). WAVE must be compiled in 32-bit mode, because it requires XView libraries that do not support 64-bit mode. On 64-bit Fedora, simply run the installer:

    The installer will download and install 32-bit XView and other compatibility libraries, and compile and install a 32-bit version of the WFDB library, before compiling and installing WAVE itself.

    If you are not using Fedora, the names of the required 32-bit compatibility libraries may differ; read and modify the install-wave32 script as necessary for your distribution before running it. Step-by-step instructions are included at the end of the script for users of 64-bit Debian and Ubuntu.

  6. If WAVE was installed, test it with the command:
    wave -r mitdb/200 -a atr
    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.

    If you download the binaries (not recommended):
    • If you have the RPM utility, and have installed libcurl and XView, download the binary WFDB RPMs for your distribution from the directory of Linux binaries, and install them:
      rpm -Uvh wfdb*rpm
    • Otherwise, look for wfdb-10.m.n in the directory of Linux binaries. Within wfdb-10.m.n you will find bin and lib directories. Copy the files from the lib directory into one of the directories named in /etc/ (/usr/lib is recommended) and run /sbin/ldconfig (requires root permissions). Next, copy the applications from the bin directory into any directory in your PATH.
  7. Read the manuals. Really! :-) If you want to write your own software to work with PhysioBank data, begin with the WFDB Programmer's Guide. To learn about the wide variety of existing software that can be used to study PhysioBank data, read the WFDB Applications Guide and the WAVE User's Guide.

Compiling a 32-bit WFDB library on 64-bit Linux

You might need to do this in order to compile other software that uses the WFDB library and that must be compiled into a 32-bit executable, such as ecgpuwave.

If you have run ./install-wave32 successfully as described above, you have installed a 32-bit WFDB library already. Otherwise, install a 32-bit libcurl or libwww library if possible, then run these commands (root permissions will be required for the last one):

make clean
./configure -m32
cd lib
make install

Old versions of the WFDB Software Package and 64-bit Linux

As noted above, although there has been limited support for compiling 64-bit versions of the WFDB Software Package for some time, version 10.4.9 is the first version to support this fully. If you wish to try compiling any earlier version in 64-bit mode, uninstall XView before attempting to do so, since the presence of XView will confuse pre-10.4.9 versions of WFDB's configure script, leading to compilation and configuration errors that may be difficult to correct.