|
THC ProjectTools and Headers for C++ |
Install |
THC source code is available on a CVS source code repository which can only be accessed from the University of Utah (by the way, why are you reading this file if you're not from the U?). It is supposed to change in the future, anyway.
So, first, let's get the software from the CVS repository:
% setenv CVSROOT csf.cs.utah.edu:/csafe_noexport/cvs/cvsroot % setenv CVS_RSH ssh % cvs co thc
Or, alternatively (ksh, bash):
% export CVSROOT=csf.cs.utah.edu:/csafe_noexport/cvs/cvsroot % export CVS_RSH=ssh % cvs co thc
This should create a ``thc'' directory and check out the
software.
You now must choose a directory where you will compile the
software. It is not necessary, but it is a good idea that this
directory ``compile'' is not a subdirectory of ``thc'' and is
empty.
The following installation process makes the assumption that the
``thc'' and ``compile'' directory are like this:
% ls -l ./compile ./thc ./compile: total 0 ./thc: total 24 drwxr-xr-x 3 xavier sci 145 May 14 13:34 3rdparty/ -rw-rw-rw- 1 xavier sci 2574 May 14 13:34 CMakeLists.txt drwxr-xr-x 2 xavier sci 66 May 14 13:34 CVS/ -rw-rw-rw- 1 xavier sci 367 May 14 13:34 README -rw-rw-rw- 1 xavier sci 1864 May 14 13:34 TODO drwxr-xr-x 6 xavier sci 76 May 14 13:34 cr/ drwxr-xr-x 5 xavier sci 65 May 14 13:34 progs/ drwxr-xr-x 14 xavier sci 4096 May 14 13:34 thc/ -rw-rw-rw- 1 xavier sci 182 May 14 13:34 thcConfig.h.in
THC is supposed to be portable (at least on Linux/Irix, which are the two platforms I use). THC relies on third party Open Source toolkits, which are chosen for their use and portability.
The first step is to compile the third party software THC relies on. If you already have some of this software installed, you can take this into account. In this documentation, we assume that you don't.
CMake is a Makefile generator, that is necessary to compile THC. You will then use it for other projects...
% cd compile/ % gunzip < ../thc/3rdparty/CMake1.2-src-unix.tar.gz | tar xvf - % cd CMake-1.2/ % ./configure --prefix=`pwd`/.. % gmake % gmake install
You can then delete the ``CMake-1.2/'' directory.
PAPI is the Performance API used by the Monitor classes. It is not mandatory to compile it. By default, THC does not support PAPI, so if you do not plan to use it, you can skip this.
% cd compile/ % gunzip < ../thc/3rdparty/papi-2.1.0.tar.gz | tar xvf - % cd papi/src/ % make -f Makefile.irix-mips % make -f Makefile.irix-mips DESTDIR=`pwd`/../.. install
Note: on Linux, there are some kernel patch to apply
(Makefile.linux-perf*), so it may be complicated to have it
run.
You can then delete the ``papi'' directory.
Teem is a set of libraries developped by GK. It is not mandatory to compile it. By default, THC does not support teem, so if you do not plan to use it, you can skip this. Using Teem allows, among other, to read nrrd data files.
% cd compile/ % gunzip < ../thc/3rdparty/teem.1.3.9.tar.gz | tar xvf - % cd teem % setenv TEEM_ARCH irix6.n32 % cd src % gmake install % cd ../.. % ln -sf teem/irix6.n32 teem-install
GLUT is the OpenGL Utility Toolkit. It is used to build the applications bundled with THC. If you don't want to use the applications, you can skip this.
% cd compile % gunzip < ../thc/3rdparty/glut-3.7.tar.gz | tar xvf - % cd glut-3.7 % ./mkmkfiles.sgi % cd lib/glut.n32/ % gmake % cp libglut.a ../../../lib/ % cd ../../include % cp -R GL/ ../../include/
You can delete the "glut-3.7" directory.
GLUI is a GLUT-based GUI (all in OpenGL). GLUI is my first choice for designing the applications, because it is light, portable and nice. If you don't want to use the applications, you can skip this. If you plan to, you must also compile GLUT.
% cd compile
% cp ../thc/3rdparty/glui_v2_1_beta.tar.gz .
% gunzip glui_v2_1_beta.tar.gz
% tar xvf glui_v2_1_beta.tar
% rm glui_v2_1_beta.tar
% cd glui_v2_1_beta/
% find . -type f -exec to_unix {} {} \;
You then have to modify the makefile:
GLUT_LIB_LOCATION=../lib GLUT_INC_LOCATION=../include CC=CC -n32 -O3
And then:
% mkdir lib bin % gmake % cp glui.h ../include/ % cp lib/libglui.a ../lib/
You can delete the "glui_v2_1_beta" directory.
You can now compile the THC libraries.
% cd compile % mkdir thc-bin % cd thc-bin % ../bin/cmake ../../thc/ % gmake
If you want to use another compiler and/or other compiling options, use:
% env CXX="/usr/bin/CC" CXXFLAGS="-g -LANG:std" CC="/usr/bin/cc" CFLAGS="-g" ../bin/cmake ../../thc/
or:
% env CXX="/usr/bin/CC" CXXFLAGS="-O2 -LANG:std" CC="/usr/bin/cc" CFLAGS="-O2" ../bin/cmake ../../thc/
And that's it!