4.3. The Build Process

4.3.1. VOS on Unix

First of all, you need to untar the VOS package (if you have not done so already).


    $ tar xvzf vos-0.12.0.tar.gz

If you are building from a CVS checkout or snapshot tarball you will need to run the following program in the root directory to prepare the the necessary scripts and makefiles. Otherwise you may skip this step. GNU autoconf 2.52 or later and automake 1.5 or later are required.


    $ autoreconf --install

Now do the following to create the correctly configured makefiles needed to actually compile things.


    $ ./configure [OPTIONS]

You can supply the following options to the configure script in addition to the general ones:


 -C                  Cache configure results -- greatly reduces configure 
                     time.  The cache file is called "config.cache", and 
                     can be removed to clear the cache and re-start clean.
                     If you have problems with subdirectories (e.g. libASE),
                     simply omit this flag.

 --disable-optimize  Don't compile with optimizations (optimization is on
                     by default). If you want to change the optimization
                     level, use --enable-optimize=LEVEL, e.g.
                     --enable-optimize=3 for level 3 (-O3). The default
                     is level 2 (-O2).e

 --disable-debug     Don't compile with debugging symbols (debugging is on
                     by default)

 --prefix=PREFIX     Install files in PREFIX default (default is /usr/local)

 --with-crystal=DIR  Indicate the directory Crystal Space has been 
                     installed in (not necesary if you have set the CRYSTAL 
                     environment variable)

 --enable-strstream  Use the old "strstream" string stream API instead of
                     the standard "sstream" (may be necesary on GCC 2.95.x
                     platforms)

 --disable-readline  Don't include Readline support in mesh

 --with-stlport=PATH Use STLPort instead of the native STL implementation, with
                     header files at PATH. (Default is /usr/include/stlport).
                     This is necesary on Debian version 3.0 ("Woody") since
                     the boost_thread package was built using STLPort.
                     Note that if you use this option, any application in
                     which you use VOS must also link against libstlport,
                     and must use the STLPort header files in PATH.

 --enable-tests      Built testing programs (see apps/test)

 --enable-intersense 
                     Include Intersense IS300 orientation tracker support 
                     in TerAngreal and libtracking.

 --enable-profile    Compile with profiling information, using -pg 
                     -fprofile-arcs.

 --with-plugin-libdir=DIR
                     Specify an alternate plugin library installation 
                     directory.  (Default is PREFIX/lib/)

 --with-plugin-headerdir=DIR
                     Specify an alternate plugin header file installation 
                     directory.  (Default is PREFIX/include/vos/PLUGIN)

 --with-pkgconfig-dir=PATH
                     Specify an alternate installation location for the
                     libvos pkgconfig spec file. The default is 
                     PREFIX/lib/pkgconfig. pkgconfig is a tool that
                     automatically provides build configure scripts (e.g.
                     'libvos-config'). See http://www.freedesktop.org/software/pkgconfig/.
                     This option is useful if you are installing VOS in a 
                     non-standard location like, on some systems, /opt or
                     /usr/local.  You can add directories to an environment
                     variable called PKG_CONFIG_PATH to let pkgconfig
                     find them.

Most newer versions of autoconf now set debugging and optimization on by default (by initializing CXXFLAGS to "-g -O2"). To disable debugging or optimization, either set a CXXFLAGS environment variable before running ./configure, or supply --disable-debug and/or --disable-optimize arguments to ./configure.

Now you may build everything (libvos, metaobject plugins, applications....) with the following command:


    $ make all

Sit back, as this will probably take a little while. Hopefully everything will go well. If there are any problems, please contact us and we will try help you debug the problem.

Once everything is done, you can install the VOS libraries, headers and programs on your system with the following command:


    $ make install

Normally, libraries will be installed into PREFIX/lib, binaries into PREFIX/bin, headers into PREFIX/include/vos, typechain plugins into PREFIX/lib/typehandlers, and various documentation into subdirectories of PREFIX/share/doc. PREFIX is /usr/local by default and may be overriden on the command line to configure as documented above.

4.3.2. Visual C++

In this section are instructions on how to compile VOS using Microsoft Visual C++ 7.0 (aka .NET) on Windows NT/2000/XP.

  1. First you should download and unpack Crystal Space as discussed in section 4.2.3. This will give you a directory "CS". Next, download the msvc7_libs package located at ftp://ftp.sunsite.dk/projects/crystal/support/win32/msvc7/ . As of this writing, the most recent version of this package is msvc7_libs_0.97dev004.zip

  2. Unpack msvc7_libs_0.97dev004.zip into "CS". This contains several extra libraries which Crystal Space depends upon.

  3. Open "CS\mk\visualc7\csall.sln" in the Visual Studio IDE, and go to Build->Build Solution to compile all of Crystal Space. If you want to speed things up a bit, you can go to Build->Configuration Manager and uncheck boxes in the "build" column to skip building the Crystal Space applications (all the projects that begin with "app") since VOS will not use them. Consider disabling the "plgcspython" project as well, as it is a common source of build errors and VOS does not require Crystal Space's Python support.

  4. Now, download http://interreality.org/software/0.12/vos-win32-support-libs-0.12.zip Unpack this somewhere to get the directory "vos-win32-support-libs-0.12".

  5. In the Visual Studio IDE, go to Tools->Options->Projects->VC++ Directories

  6. Select "Show directories for: Executable files" in the dropdown menu. Add the full path to the directory "vos-win32-support-libs-0.12\bin".

  7. Select "Show directories for: Include files" in the dropdown menu. Add the full paths to the directories "CS\include" and "vos-win32-support-libs-0.12\include".

  8. Select "Show directories for: Library files" in the dropdown menu. Add the full paths to the directories "CS\mk\visualc7\csdebug\bin\libs", "CS\mk\visualc7\csrelease\bin\libs" and "vos-win32-support-libs-0.12\lib".

  9. Download and unpack the main VOS archive, vos-0.12.0.zip, if you have not already.

  10. Now, in the Visual Studio IDE, open "vos\vosall.sln". You can now select Build->Build Solution to build all of VOS.

Note: I've encountered a strange bug where MSVC won't honor all the dependencies I set between projects so it may build things out of order. If you get any linking problems related to not being able to find VOS libraries, try re-running the build a second time to catch anything that failed the first time.

4.3.2.1. Building and installing the Boost libraries youself

If you are succesfully using the vos-win32-support-libs package, you should skip this section! The following information is primarily useful if you are building the vos-win32-support-libs package itself, but is provided here for completeness. In these instructions, $(VCInstallDir) is used to denote the installed location of Visual C++ on your system (typically \Program Files\Microsoft Visual Studio .NET\Vc7)

  1. Get the Boost library: http://boost.org/more/download.html

  2. Unpack boost_1_30_0.zip. This will produce a directory named "boost_1_30_0". You will need to compile Boost from the command line as there are no project files for it, only makefiles.

  3. Open the command prompt: Start->Programs->Microsoft Visual Studio .Net->Visual Studio .NET Tools->Visual Studio .NET Command Prompt

  4. change directory to "boost_1_30_0\tools\build\jam_src"

  5. run "build.bat"

    Note: if you are using NT 4.0, you may encounter a problem with "build.bat" -- it won't do anything! If that is the case, download this modified build.bat. Windows 2000 and above do not have this problem.

  6. Change directory to "bin.ntx86"

  7. Copy bjam.exe to $(VCInstallDir)\bin

  8. Change directory back to "boost_1_30_0"

  9. Run "bjam boost_thread". This will compile the boost thread library.

  10. Run "bjam boost_regex". This will compile the boost regular expression library.

  11. Change directory to "boost_1_30_0\libs\thread\build\bin\boost_thread.dll\msvc\release\runtime-link-dynamic\threading-multi"

  12. Copy "boost_thread.lib" to $(VCInstallDir)\lib

    Copy "boost_thread.dll" to $(VCInstallDir)\bin

  13. Change directory to "boost_1_30_0\libs\regex\build\bin\boost_regex.dll\msvc\release\runtime-link-dynamic"

  14. Copy "boost_regex.lib" to $(VCInstallDir)\lib

    Copy "boost_regex.dll" to $(VCInstallDir)\bin

  15. In addition to Boost, you need to get the zlib compression library: http://www.winimage.com/zLibDll/zlib114dll.zip

  16. Create a directory named "zlib" and unpack zlib114dll.zip into that directory.