Trunk

From Manta

Table of contents

Checking out the Source

  • Check out the source repository using svn:
svn co https://code.sci.utah.edu/svn/Manta/trunk Manta

The last option specifies the local destination directory for the checkout. Note that if you are behind a firewall it may be necessary to configure a proxy connection in the ~/.subversion/servers file.

Take a look at the directories created by the checkout. The directories Core, Engine, Image, Interface, Model, and UserInterface contain source code for the core Manta shared libraries. StandAlone, scenes, and fox contain code which attaches the core shared libraries to user interfaces. StandAlone also contains some benchmarking scripts written in perl.

  • Create a build directory-- I usually place build directories for each platform I work on directly below the directory that I checked the code out to.
mkdir Manta/build-demo
cd Manta/build-demo

Configuring

The CMake build utility is responsible for producing make files or IDE project files for building Manta. Most developers build manta from the command line using gmake although the code has been build using XCode as well.

The ccmake command line gui allows a developer to configure many basic options for the renderer such as whether to use floats or doubles for the Manta Real type or what max size ray packets to use.

Several files including: MantaTypes.h, Interface/Parameters.h and Model/Groups/KdtreeParameters.h are produced by the cmake configure process.

  • Run ccmake in the build directory and pass the relative location of the source repository as the argument.
ccmake ..

Screen after running ccmake for the first time.

Note: On many systems the default compiler is sufficient. It is possible to configure cmake to use the Intel compiler or another special compiler. Set the environment variables CC and CXX to the compiler you wish to use. Manta will build with predefined release and debug flags with GCC and the Intel Compiler (icc) on most platforms.

The CMAKE_BUILD_TYPE variable is set to Release by default. This variable may be set to Debug as well. On most platforms, Release contains flags to include debug symbols in the output to enable profiling and very high level debugging.

Please note: The paths to files and libraries on this page are only examples. You should substitute paths that are appropriate to your local machine. If you are using a SCI Institute facility machine many of the dependencies may be available locally but the paths won't necessarily match.

Minimal Build

Building Manta with the least amount of effort (and options):

  • Don't set any additional cmake options. Press 'c' to configure once, all of the '*' characters should disappear. Then press 'g' to generate. At the command line run make, the binaries will be placed in the bin/ directory.

Alternatively, you could skip the whole ccmake screen:

cmake .. && gmake -sj8
bin/manta -np 1

Build Options

Several cmake variables affect the configuration of Manta. These may be set during an initial build or may be changed from the cmake command line.


Including swig/python

  • Swig and Python provide a nice scripting environment for configuring Manta and writing GUIs for visualization. See additional swig python instructions.

Including Teem

  • Teem is an optional dependency that is used for input and output of images and other raster data. Instructions for building teem. If you plan to generate screen shots or load scalar volumes into Manta, teem is required.


Manta types

  • Real

The manta Real typedef in MantaTypes.h. Double out performs float on some platforms, supposedly. Set the MANTA_REAL variable.

  • Packet sizes

Fragment and Ray Packet static sizes are defined by MANTA_FRAGMENT_MAXSIZE and MANTA_RAYPACKET_MAXSIZE. MANTA_TRAVERSALPACKET_SIZE specifies the size of a subpacket to use in vertical traversal code. To enable SSE this must be set to 4.


Default Scene

To run the default scene issue:

bin/manta
Running bin/manta on a really old Itanium2 over glx.
Running bin/manta on a really old Itanium2 over glx.

If you move the binaries and library from the location they were installed (or compiled in the case of these instructions), it is necessary to update your LD_LIBRARY_PATH environment variable to reflect the new location of the libraries.

Scenes

Scene are shared libraries which are dynamically loaded to add specific functionality. By default building all of the scenes is enabled in ccmake. Each scene may be individually disabled to decrease build time.

Scene libraries are places in the lib/ directory.

Trouble Shooting

gprel relocation error on ia64

When building with -ipo on an Itanium2 system the following linker error may be encountered when linking to the fox libraries.

ld: /store/abe/build-tomahawk/lib/libFOX-1.5.a(FXApp.o): @gprel relocation against dynamic symbol _ZN2FX5FXApp3appE
ld: /store/abe/build-tomahawk/lib/libFOX-1.5.a(FXApp.o): @gprel relocation against dynamic symbol _ZN2FX5FXApp3appE
ld: /store/abe/build-tomahawk/lib/libFOX-1.5.a(FXApp.o): @gprel relocation against dynamic symbol _ZN2FX5FXApp3appE
ld: /store/abe/build-tomahawk/lib/libFOX-1.5.a(FXApp.o): @gprel relocation against dynamic symbol _ZN2FX5FXApp3appE

Solution: Use the fox shared library (--enable-shared when configuring fox) and then change the FOX_STATIC cmake variable to the .so file instead of the default.

CMAKE_CXX_FLAGS_RELEASE          -tpp2 -fpic -ipo -O3 -g -DSCI_ASSERTION_LEVEL=0
FOX_STATIC                       FOX-1.5.so

Enabling SSE Code Paths

  • The build script now automatically detects if the compiler supports SSE.

On platforms which support it SSE code paths are available. Specific options are enabled to add this code to the build. If the options are disabled, stub files will be used instead and manta will throw exceptions if you try to use the code paths.

The following values must be set in ccmake (and should be enabled automatically on supported platforms):

MANTA_REAL                       float                                                            
MANTA_TRAVERSALPACKET_SIZE       4                                                                
  • Note: It still may be necessary to select SSE or SIMD shaders explicitly. For example to use the SSE kdtree traversal you must set the cmake options and then use the -sse option while loading a kdtree scene.


Including fox

The Fox toolkit is no longer supported in the Manta trunk repository. It has been moved to an external Manta-project along with code associated with the Boeing777 massive model renderer.

See the Manta-Fox Manta project.

Most Manta GUIs are written in wxPython now.