Compiliation Instructions for spim

This page provides some advice for compiling the spim source code for various systems.


Compiling on Unix and Mac OS X systems

  1. Copy the "spim.tar.gz" file included on this CD to a convenient temporary location on your local hard drive.
  2. Decompress the spim.tar.gz file using the gzip program:
        % gzip -d spim.tar.gz
  3. Untar it:
        % tar xf spim.tar
  4. Configure spim for your system by running the Configure script:
        % Configure
    Note: Configure compiles a program with the C compiler named cc. If you want it to use another compiler, set the environment variable CC to its name before running the script. E.g. under (t)csh:
        % setenv CC gcc
        % Configure
    or under bash/ksh/etc:
        % CC=gcc; Configure
  5. Next, you must set the directories in which spim will be installed by editing a makefile (the file that tells how to build spim).
    If you are installing spim and want the windowing version (xspim), you will edit the file Imakefile. If you don't want xspim or are running on a system without X-windows installed, you can use the file Makefile.std. Finally, if you are running under Microsoft Windows using Cygwin, edit the file Makefile.cygwin.
  6. Set these pathnames to the appropriate locations for your system:
    TRAP_DIR -- The full pathname of the directory in which to install the spim trap handler.
    BIN_DIR -- The full pathname of the directory in which spim and xspim should be installed.
    MAN_DIR -- The full pathname of the directory in which the manual pages for spim and xspim should be installed.
    In general, the remaining parameters in the makefile need not be changed.
  7. Then, if you are using Imakefile type:
        % xmkmf
        % make
  8. If you want an X-window version of spim, also type:
        % make xspim
    If you do not have X-windows or the program xmkmf, edit either Makefile.std or Makefile.cygwin and type:
        % make -f Makefile.std
    or
        % make -f Makefile.cygwin
  9. To run spim or xspim, the trap handler must be installed in the directory specified by the variable TRAP_DIR in the makefile. If the file trap.handler is not installed, spim and xspim fail with a message before they start running. You can either install this file by hand or by typing
        % make install
    which also installs spim, xspim, and the manual pages in the directories that you set above.
  10. To test that spim is correctly built, type
        % make test
    and examine the output of the test. Note the trap handler must be installed before running the test.

Compiling on Windows systems

On Windows machines you have two options for compiling spim.

  1. You can compile the text-driving interface using Cygwin tools.
    Follow the instructions above and use Makefile.cygwin when invoking make.
  2. You can compile the graphical interface (PCSpim) using Visual C++ (version 4.1 or later).
    Check the readme.txt file within the source for more information.
    1. Extract the ZIP file of source code included on this CD to a convenient location on your hard drive.
    2. Open the "PCSpim" workspace in the "Larus\Software\SPIM\PCSpim" folder.
    3. Build PCSpim.exe