The best way to build Teem is with CMake, including the
curses (terminal) interface ccmake. Pre-compiled binaries of CMake
CMake allows Teem to be built for any platform, including Windows,
with relative ease, and provides the best control over shared
libraries, external dependencies, and so forth.
To build Teem with ccmake:
- Go to a directory where the "teem" source subdirectory should be
- svn co https://teem.svn.sourceforge.net/svnroot/teem/teem/trunk teem
- Make a directory for all the built object files and libraries
- mkdir teem-build
- cd teem-build
- ccmake ../teem (or wherever the Teem source is)
- Type "c". Cmake chews on a bunch of stuff, saying "Configuring ..."
- You get a screen of options to edit. Use the up and down arrows to
go between them. Hit return to begin and end editing text fields, and to
toggle the binary ON/OFF fields. Be careful when editing text fields:
there's unfortunately no clear visual indication of whether you are or
aren't editing the field.
- If you want to install the binaries and libraries somewhere, set
that directory as CMAKE_INSTALL_PREFIX. In that directory
will be created subdirectories bin, include, and
- Turn ON "BUILD_SHARED_LIBS" if you want to created shared libraries
or DLL, and leave ON the other formats and encodings you want at the bottom.
- Type "c" again, then "g", which causes cmake to generate the Makefile
- make install (if you want)
The information below refers to a home-grown system of GNUMakefiles
which is no longer supported.
Windows users (except Cygwin): Go here
The basic steps
To build teem you will need GNU make. I am
in fact using many GNU-make-specific features, and all my makefiles
are actually named GNUmakefile instead of Makefile
to minimize the chances of someone trying to use a non-GNU make.
- Download the teem
- 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.
- Go into this directory.
- 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:
- linux.32: 32-bit GNU/Linux
- linux.64: 64-bit GNU/Linux
- cygwin: A Cygwin shell running on a Windows box
- irix6.n32: 32-bit Irix
- irix6.64: 64-bit Irix
- solaris: Solaris machines running in 32-bit mode.
- darwin.32: 32-bit Mac OS X.
- darwin.64: 64-bit Mac OS X.
- (Optional) If you want the teem headers, libraries, and
command-line tools to be installed in a particular location, you need
to set the TEEM_DEST environment variable to the directory
in which the include, lib, and bin
directories will be the final locations the teem files.
- cd src; make
This will build and "install" all the teem libraries, as well
as all the command-line tools. Specifically,
assuming TEEM_DEST was not set:
If TEEM_DEST was set, these directories will be created if needed:
- All include files will be copied into teem/include/teem
- All libraries will be copied into teem/$TEEM_ARCH/lib
- All command-line tools be copied into teem/$TEEM_ARCH/bin
On a multi-processor machine,
building teem-1.5beta0 or later, feel free to use
"make -j10" or similar to speed this up.
- All include files will be copied into $TEEM_DEST/include/teem.
- All libraries will be copied into $TEEM_DEST/lib
- All command-line tools be copied into $TEEM_DEST/bin
- cd ../$TEEM_ARCH/bin (or cd $TEEM_DEST/bin)
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
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 (firstname.lastname@example.org) with the error
message from nrrdSanity.
./nrrdSanity: nrrd sanity check passed.
Making a better teem: zlib, bzip2, png, and pthread
If you want hoover to be multi-threaded, or
if you want nrrd to support zlib/gzip or bzip2
compression, or allow nrrd to read and write PNG images, you
need to set additional environment variables, as well as have compiled
version of the associated libraries. The following three variables
need simply to be set (as with "setenv TEEM_ZLIB" for
csh-style shells, or "export TEEM_ZLIB" for sh-style
opposed to set to a specific string (as with
"setenv TEEM_ZLIB true"
or "export TEEM_ZLIB=true"):
|TEEM_PTHREAD|| Allows hoover to run multiple
threads, so that hoover-based volume renderers are multi-threaded.
|TEEM_ZLIB|| Allows nrrd to read and write raw
data compressed with zlib compression, for instance with the "-e
gzip" encoding flag in unu save. The compressed data is
compatible with the gzip and gunzip command-line tools.
|TEEM_BZIP2|| Allows nrrd to read and write raw
data compressed with bzip2, for instance with the "-e bzip2"
encoding flag in unu save. The compressed data is compatible
with the bzip2 and bunzip2 command-line tools.
|TEEM_PNG|| Allows nrrd to read and write PNG images,
for instance with the "-f png" format flag in unu save.
This requires TEEM_ZLIB.
The following versions of the optional libraries are recommended:
Note that on GNU/Linux you may have to get the "development" version of
the package ("...-dev") in order to get the headers and libraries,
instead of just the associated command-line tools and their documentation.
- zlib: 1.1.4
- bzip2: 1.0.2
- libpng: 1.0.12
In case you do not have the workable versions of zlib, bzip2, and png
installed in /usr/local/ on your system (or wherever the C
compiler looks for headers and libraries by default), you can teach
the teem makefiles where to find them by setting yet more environment
variables. In the following, "XXX" stands for either
"ZLIB", "BZIP2", or "PNG".
|TEEM_XXX_IPATH ||This is the include flag to be passed
the compiler, to tell it where to find the header files for optional
thing XXX. It should be of the form
"-I<path>", such as
|TEEM_XXX_LPATH ||This is the link flag to be passed to
the linker, to tell it where to find the library for optional thing
XXX. It should be of the form "-L<path>",
such as "-L/home/gk/lib". The makefiles know the name of
the library; you do not need to (nor can you) supply the library link
flag itself (e.g. "-lzlib"); this is done by the makefiles for you.
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.