file: UNIX.TXT G. Moody 7 September 1989 Last revised: 24 May 1997 Notes on compiling the DB Software Package under UNIX Copyright (C) Massachusetts Institute of Technology 1997. All rights reserved. See file `LINUX.TXT' or `SUN.TXT' in this directory if you are compiling the DB Software Package under Linux, or under either Solaris or SunOS. Otherwise .... First copy this entire directory tree to a writable file system, and make a copy of the appropriate `make' file. This can be done, for example, by the commands: mkdir -p /usr/local/src/db tar cfv - . | ( cd /usr/local/src/db; tar xfv - ) cd /usr/local/src/db cp Makefile-solaris Makefile (or `cp Makefile-sunos Makefile') You may use any writable directory instead of /usr/local/src/db. You will need to edit `Makefile' to set site-specific variables as appropriate for your version of UNIX. If yours is a System V-based UNIX, `Makefile-solaris' is a good starting point; the differences in `Makefile-sunos' are slight, but you may wish to begin there if yours is a BSD-like UNIX. Follow the instructions in `Makefile' to compile and install the DB Software Package. In most cases, you will need root permissions. If you wish to install the DB Software Package on a system for which you do not have root permissions, edit `Makefile' to specify alternate installation directories. The standard installation procedure, using `Makefile', performs nested makes in each of the major subdirectories of this one. If you wish to perform only a partial installation, you may prefer to work with the `Makefile' files in each subdirectory. Be aware that values specified in the master `Makefile' override those specified in the individual Makefiles whenever you run nested makes from this directory; if you change values in the individual Makefiles be sure to change them in the master `Makefile' as well to avoid confusion. The DB software has been compiled successfully under both Berkeley (BSD 4.x) and System V Unix, on a variety of CPUs. It includes conditional compilation statements (in the `lib' sources only) which take advantage of the type- checking facilities provided by ANSI C compilers such as GNU C (gcc), if available. All I/O of multiple-byte integers is performed in architecture- independent fashion, so that binary database files are portable across all architectures and supported operating systems. The DB software has also been compiled (but not recently) under several older versions of UNIX (including Version 7 and System III). Please let me know if you successfully install the DB software under an older version of UNIX, or if you encounter any difficulties in doing so. The simplest way to compile and install the software on a UNIX system is to use the `Makefile' in this directory. Examine it carefully and set the site- specific variables in it appropriately for your system. Log in as `root', take a deep breath and type `make', and (when the dust settles) the software will have been installed. If you wish to install the DB software package on a system for which you do not have superuser permissions, follow the instructions in `Makefile' for specifying alternate installation directories. The standard installation procedure, using `Makefile', performs nested makes in each of the major subdirectories of this one. If you wish to perform only a partial installation, you may prefer to work with the `Makefile' files in each subdirectory. Be aware that values specified in `Makefile' override those specified in the individual makefiles whenever you run nested makes from this directory; if you change values in the individual makefiles be sure to change them in the master `Makefile' as well to avoid confusion. If your system supports more than one library format, you may wish to modify the "S-variables" (SCC, SCFLAGS, SLIBDIR, etc.) in `Makefile'. As distributed, these variables are appropriate for generating a "shared library" (linked at run-time) under SunOS 4.x (slightly different settings for SVR4 and HP/UX are also provided, but you must edit `Makefile' to enable them). If you use two or more memory models, C compilers, or a cross-compiler, the "S-variables" can be modified to support construction of an alternate library. NeXT Unix and some implementations of System V Unix lack the traditional `plot' library and interpreters needed by the `dbplot' application; many other UNIX systems have `plot' interpreters for obsolete devices only. See `app/PLOT' for notes on writing your own `plot' libraries. WAVE currently runs only on x86 Linux and on SPARC Solaris or SunOS. If you would like to attempt to port WAVE to another version of UNIX, please try first to port the XView library and the `cmdtool' sample application included in the XView source distribution (../xview32.tgz). If you succeed, please write to me (george@hstbme.mit.edu) to make arrangements for porting WAVE. Note for CD-ROM users: ---------------------- If you are using this software with an ISO 9660-format CD-ROM database (these include the second editions of the MIT-BIH Arrhythmia Database and the MIT-BIH Polysomnographic Database, as well as the MGH/MF Waveform Database), you may find that your system software reports that all CD-ROM file names end with the so-called version number suffix `;1'. This suffix is part of the ISO 9660 specification (it is not present on the earlier High Sierra format CD-ROMs, such as the European ST-T Database or the first editions of the MIT-BIH CD-ROM database). If your system does not suppress these version numbers, you will probably find that most common operations fail when applied to ISO 9660 CD-ROM files unless you insert a `\' before the `;' when using the file name in a shell command; thus, for example, you may need to type more /cdrom/readme.doc\;1 in order to read the top-level documentation file on one of these CD-ROMs. You may also find that all file names on an ISO 9660-format CD-ROM appear in upper case (this has been reported to be true for at least some versions of HP/UX). This problem may appear with or without the version number problem. In short, this means that a file with the intended name `100.atr' may appear instead as `100.atr;1', `100.ATR', or `100.ATR;1'. The DB library finds input files using its internal function `db_open' (defined in `dbio.c'), which constructs file names given the record name, file type string, and the DB path. Since file names are not passed as explicit arguments to the DB library functions, it is necessary for the DB library to be aware of file naming quirks such as the ISO 9660 version number suffix or case conversion, or else to hide these `features' so that files appear under their intended names. If you encounter this problem, be sure that you have the most recent device driver supplied by your UNIX vendor for ISO 9660 CD-ROMs, since this problem is not specific to these database disks, but is a generic problem with virtually all CD-ROMs produced between late 1989 and early 1993. Also, be sure that you have used the appropriate driver options to mount ISO 9660 CD-ROMs. If you cannot solve this problem in consultation with your UNIX vendor, here are three alternative solutions: 1. Symbolic links, if supported by your system, can be used to work around this problem; in this case, try (for example): ln -s /cdrom/MITDB/100.ATR\;1 /usr/mitdb/100.atr ln -s /cdrom/MITDB/100.DAT\;1 /usr/mitdb/100.dat ln -s /cdrom/MITDB/100.HEA\;1 /usr/mitdb/100.hea and put `/usr/mitdb' in your DB path (this example and the next one assume that your CD-ROM is mounted as `/cdrom', and that `/usr/mitdb' is a writable directory on your magnetic disk). In these commands, note the use of backslash (`\') characters to avoid interpretation of the semicolons by the shell as command separators. Once you have verified that this method permits access to record 100, repeat these commands, with appropriate changes, for each remaining DB record. 2. If your system does not support symbolic links, method 1 won't work (ordinary links can't be made across different file systems). In this case, you can install copies of the (small) annotation and header files on your magnetic disk, editing the header files to point to the (large) CD-ROM signal files: cp /cdrom/MITDB/100.ATR\;1 /usr/mitdb/100.atr sed s%100.dat%/cdrom/MITDB/100.DAT\;1% /usr/mitdb/100.hea Again, pay attention to the backslashes, and repeat these commands with appropriate changes for each record. (You may wish to use this approach even if your system doesn't have problems reading ISO 9660 CD-ROMs, because it offers a significant advantage in reducing time-consuming seeks on the CD-ROM at only a minor cost in disk space.) 3. A solution for the version number suffix problem (which also occurs on the Macintosh) is described in file `MAC', in this directory. It involves redefining the macro `sprintdbr' in `lib/dbio.c'. Similar methods should be possible to solve the case conversion problem. If this or a similar solution works for you, please let me know so that I can make a more general fix. Since 1995, our CD-ROMs have made use of Rock Ridge extensions (RRIP, a standard for including an alternate set of filenames more congenial to UNIX systems, while maintaining ISO 9660 compatibility for MS-DOS and Macintosh systems), which avoids these problems on systems that support RRIP. Your comments are requested --------------------------- If precompiled binaries are not provided for your version of UNIX, and if you can contribute or test a `tar' archive of compiled binaries of this software for inclusion in a future edition of this CD-ROM, please write to me. I would greatly appreciate a report of any problems you encounter in installing or using this software, if possible by e-mail to george@hstbme.mit.edu, or to: George B. Moody MIT Room 20A-113 Cambridge, MA 02139 USA