to teem

Build

teem

Regardless of your platform:

  1. Download the teem distribution
  2. Untar it.
    Throughout this and all other teem documentation, the directory just created will be referred to as "teem", even though it will actually be called teem-1.XblahN" or something similar.
  3. Go into this directory.

Windows users (except Cygwin):

Go into the "win32/make" directory.

Visual Studio 6.0 users

  1. Go into the "vc6" directory.
  2. Open the Visual Studio 6.0 workspace file (teem.dsw).
  3. Select the configuration you want to compile (Release / Debug / Release Compression / Debug Compression) using the Build menu's Set Active Configuration item.
  4. Select all projects by shift-clicking on them in the workspace file-view window.
  5. Right click on the selection and hit "Build" in the pop-up menu.

Visual Studio .NET users

  1. Go into the "vc7" directory.
  2. Open the Visual Studio .NET solution file (teem.sln).
  3. Select the configuration you want to compile (Release / Debug / Release + Compression / Debug + Compression) using the Build menu's Configuration Manager item.
  4. In the solution explorer window right click on "Solution 'teem'" and hit "Build Solution" in the pop-up menu.
The libraries and executables are compiled in the win32/lib and win32/bin subdirectories and comprise: By default these files and the public headers are copied into the bin, lib, and include subdirectories of the teem root directory during the build. Optionally, you can set the $TEEM_DEST environment variable to customize the installation. Note that the directory $TEEM_DEST points to must contain bin, lib, and include subdirectories, otherwise the installation will fail. You can also copy the dll and the executables manually to a directory in the Windows path ($PATH). In this case, the import library (teem.lib) usually goes into one of the Visual Studio library directories (e.g. 'path to visual studio'\Vc7\lib). Likewise, the headers can be placed in one of the Visual Studio include directories.

The compression options require the zlib and bzip2 libraries, which are available in source or precompiled Windows binary form at http://www.gzip.org/zlib/ and http://sources.redhat.com/bzip2/. These libraries must be available to the compiler, e.g. by copying the import libraries and headers to the Visual Studio library and include subdirectories, otherwise the build will fail. No teem development is currently done on Windows. Using the Visual Studio files is simply the path-of-least-borg-resistance for distributing sources in a form that facilitates easy building on Windows. Although all the teem libraries are built, they are built onto one monolithic library, which Windows teem users can link against. While teem normally builds about a dozen little command-line programs, only the few listed above are currently included in the project files for Windows.


Non-Windows users (including Cygwin):

You will need GNU make. I am in fact using many GNU-make-specific features, and all my makefiles are actually nameed GNUmakefile instead of Makefile to minimize the chances of someone trying to use a non-GNU make.
  1. Depending on what architecture you're on, set the TEEM_ARCH environment variable (however you do that in your favorite shell) to one of the following:
  2. cd src; make
    This will build and "install" all the teem libraries, as well as all the command-line tools. This build will take a little while. On a multi-processor machine, building teem-1.5betaX or later, feel free to use "make -j10" or similar to speed this up. NOTE: This isn't an "install" in the traditional Unix build sense, since no files will be created outside the top-level teem directory. Headers are put in teem/include, libraries are created in teem/<arch>/lib, and the command-line tools in teem/<arch>/bin, where "<arch>" is the same as what you set TEEM_ARCH to.
  3. cd ../<arch>/bin
  4. ./nrrdSanity
    This little program calls a nrrd function called nrrdSanity() which basically makes sure that everything hard-coded (or set at compile-time) into nrrd is correct for the machine you're on. For instance, the various assumptions about type sizes and representational ranges are checked, as is endianness, and the availability of IEEE 754 floating point numbers. If you get anything besides:
    ./nrrdSanity: nrrd sanity check passed.
    
    then your teem build will not work correctly. Either one of the default settings in the architecture-specific makefile teem/src/make/<arch>.mk is wrong, or your machine isn't up to snuff. In either case, email me (gk@cs.utah.edu) with the error message from nrrdSanity.
If you'd rather everything be installed to some other directory (with include, lib, and bin subdirectories), then set environment variable TEEM_DEST to that directory, and make will put headers, libraries, and binaries in the corresponding subdirectories of TEEM_DEST.

If interested, you can read more about the directory structure of teem. For more specific information about how the GNUmakefiles work, or how to use them to do something besides the standard install described above, see How teem uses GNU make.