PhysioNet  ·  PhysioBank  ·  PhysioToolkit

PhysioToolkit
open source software for
biomedical science and engineering

Advanced Search | Tour | Mirrors
How to Cite | Contributing | FAQ
Getting Started  ·  Software Index  ·  Matlab Software  ·  WFDB Software  ·  Manuals Site Map

WFDB quick start for MS-Windows 95/98/NT/2000/ME/XP

  1. Install Cygwin in a location that does not have any spaces in its pathname. The default and preferred location is c:\cygwin. Do not use locations under Program Files, Documents and Settings, or any other directory containing a space in its name. Be sure to leave the "Default Text File Type" as "Unix" (not "DOS"), and be sure to select and install the curl-devel, gcc, gcc-mingw, make, openssl-devel, sunrpc, and xorg-x11-devel packages (these are not installed by default in a minimal Cygwin installation).

  2. Install an HTTP client library (optional). If you installed curl-devel together with Cygwin as specified above, you may go on to step 3. Otherwise, install libcurl or libwww now.
  3. Install XView (optional).
  4. Download the current version of the WFDB software package as sources or binaries. The binary package is 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, and read the note below.

    If you download the sources (recommended):


    If you download the binaries (not recommended):
  5. If XView is installed, test WAVE by starting the Cygwin X server and then running (in the xterm window) the command:
    wave -r mitdb/200 -a atr
    

    Note that WAVE's menus (marked with a nabla) are opened using a right click. Annotation editing requires the use of the middle button; if your mouse has only two buttons, you may be able to simulate a middle button click by "chording" (press both buttons at the same time, then release them).

    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.

  6. 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.

Using Cygwin gcc to compile and link your applications with the WFDB library

If you wish to compile your own WFDB applications, or others that are not available in binary format, please begin by compiling and installing the WFDB software package sources, as described above. Once you have done so, copy app/Makefile (a text file contained in the WFDB source package) to the directory that contains the source for the application you wish to compile. Note that app/Makefile is customized based on the installation choices that you make when you run ./configure before compiling the WFDB software package, so it's important to copy the customized version of this file from your copy of the WFDB sources only after running ./configure.

If the application is contained in a single source file (for example, myprogram.c), you can compile it and link it with the WFDB library using a command such as

make myprogram
This method is recommended since it can be difficult to construct the proper gcc command line manually. As part of the output of make, you will see the gcc command line it constructs, and you can follow this model for subsequent compilations if you prefer not to use make.

If you need to compile an application contained in several source files, use the command generated by make for a single source file compilation and replace the single source name with those of your multiple source files, separated by spaces. Note that the output file name (the argument of gcc's -o option) should not include the .exe suffix.

The WFDB Software Package also includes wfdb-config, a tiny application that helps to construct gcc command lines without using make. Study the example in wfdb-config(1) to see how to use it.

Making a native Windows version of the WFDB library

The procedure above generates a WFDB library that depends upon Cygwin's POSIX emulation library (cygwin1.dll) to provide a Unix-like operating environment, thus assuring that WFDB applications will behave on MS-Windows as much as possible like they do on other platforms. It is also possible, though not generally recommended, to make a WFDB library that depends only on the native libraries provided with MS-Windows.

There are two specific cases in which you might need a native Windows version of the WFDB library:

The method outlined below will allow you to create a Windows native version of the WFDB library that does not depend on Cygwin's POSIX emulation library or any third party libraries other than those provided with MS-Windows. This method also creates a mostly complete set of WFDB applications (except for WAVE) that are used to test the WFDB library; use them at your own risk, since they may not behave in exactly the same way as the standard versions of the same applications.

Please note that this method, and any others that do not use an ANSI/ISO C compiler such as gcc, are unsupported. Your feedback is welcome, but we do not use any commercial compilers and cannot help you learn how to use them.

  1. First perform a standard WFDB installation from sources as described above.
  2. (Continue using a Cygwin (terminal emulator) window throughout the steps below.) Select a target directory for the native Windows WFDB installation. We recommend keeping this separate from the standard Cygwin directories to avoid confusion. A good choice is /opt/wfdb. Create a bin subdirectory for the native Windows binaries within this target directory, and add it to your PATH:
    mkdir -p /opt/wfdb/bin
    export PATH="/opt/wfdb/bin:$PATH"
    
    The mkdir command also creates /opt and /opt/wfdb if they do not exist already.
  3. (Optional; see README.NETFILES for further information.) Install a native windows version of libcurl:
    1. Download the no-SSL libcurl binary package for Win32 from http://curl.haxx.se/download/ and move the zip file into your (Cygwin) home directory. As of July 2007, the most recent version of this file was libcurl-7.16.4-win32-nossl.zip. (The SSL and SSL+SSPI enabled versions of libcurl should also work if the additional libraries they need are installed, but this has not been tested. The WFDB library does not require SSL or SSPI support.)
    2. Unpack libcurl into /opt:
      cd /opt
      unzip ~/libcurl-*nossl.zip
      
      The libcurl files will unpack into a version-numbered directory under /opt, such as /opt/libcurl-7.16.4. Copy the needed files into /opt/wfdb:
      cd /opt/libcurl-7.16.4
      cp -p bin/curl-config lib/* /opt/wfdb/bin
      cp -pr include /opt/wfdb
      
    3. Using your favorite text editor, edit /opt/wfdb/bin/curl-config, replacing
      prefix=/usr/local
      
      with
      prefix=/opt/wfdb
      
      and changing
      echo -L$(exec_prefix)/lib -lcurl -L/home/dast/src/win32 ...
      
      to
      echo -L$(exec_prefix)/bin -lcurl
      
      (deleting the remainder of the line following '-lcurl').
  4. Enter the top-level directory of the WFDB Software Package (the directory that contains the configure script).

    If you installed libcurl in step 3 above, type:

    make clean
    ./configure --without-cygwin --prefix=/opt/wfdb
    make install
    
    replacing /opt/wfdb with the name of the target directory you chose in step 2 above, if different.

    If you did not install libcurl in step 3 above, type these commands instead:

    make clean
    ./configure --without-cygwin --without-netfiles --prefix=/opt/wfdb
    make install
    
  5. Note: If you run
    make check
    
    many checks will fail because text files written by the native Windows WFDB applications will be in DOS format (with CR+LF line terminators). This is normal and is not an indication of problems.

For additional information about this procedure, see README.WINDOWS.

Using a compiler other than gcc

This is strongly discouraged. gcc is free, is of very high quality, and is supported; if you use another compiler, you are on your own. Note that if you compile the WFDB library and applications with gcc, you may link code compiled with another compiler to the WFDB DLL generated by gcc (the DLL is in the same format as that produced by other compilers that generate MS-Windows DLLs).

It is not possible to compile or use WAVE under MS-Windows except by using Cygwin gcc and the Cygwin X libraries.

If you do not use gcc, you must do one of the following:

If you do neither of these steps, your compiler will generate a defective WFDB DLL that assumes that files are always opened in so-called text mode, resulting in errors when reading and writing signal and annotation files (which are binary files). You can check to see if this has happened by running the command

    rdsamp -r 100s
which should yield 21600 lines of output, ending with
     21596	  982	  995
     21597	  978	  989
     21598	  975	  988
     21599	  975	  989
If the output ends after 940 samples, you have a defective WFDB DLL and you will need to follow the instructions above to correct the problem.
Send feedback about this page to PhysioNet

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, or post them to:

PhysioNet
MIT Room E25-505A
77 Massachusetts Avenue
Cambridge, MA 02139 USA

Updated Wednesday, 05-Sep-2007 12:25:57 EDT National Institute of Biomedical Imaging and Bioengineering National Institutes of Health National Institute of General Medical Sciences