[ VIGRA Homepage | Function Index | Class Index | Namespaces | File List | Main Page ]

Installation |

VIGRA can be downloaded from http://hci.iwr.uni-heidelberg.de/vigra/. It should work with any standard conforming C++ compiler on both 32-bit and 64-bit machines.

VIGRA is mainly a header library, i.e. much of its functionality can be accessed by simply copying the include files to a convenient location. A more involved build process is necessary for image file import and export, for the VIGRA Python bindings, and for the test suite and examples. VIGRA can take advantage of the following external libraries:

- libjpeg, libtiff, libpng for reading and writing JPEG, TIFF, and PNG images.
- HDF5 for reading and writing HDF5 files (storage of MultiArray and RandomForest)
- libfftw for fast Fourier transforms
- Python, boost_python, and numpy for the VIGRA Python bindings.

These dependencies are optional - the functionality will simply be unavailable if the libraries cannot be found.

VIGRA installation is based on cmake. In order to configure the build and installation process, execute the following on the command line:

        > mkdir <vigra_build_path>
        > cd <vigra_build_path>
        > cmake [options] <vigra_source_path>
        > make          # build (Linux/Unix and MinGW only)
        > make check    # compile and run tests (optional, Linux/Unix and MinGW only)
        > make doc      # generate documentation (Linux/Unix and MinGW only)
        > make install  # install (Linux/Unix and MinGW only)
        > make examples # build examples (optional, Linux/Unix and MinGW only)

If you use Microsoft Visual C++, you just execute cmake (not make) which creates a solution file '<vigra_build_path>/vigra.sln'. This file must be opened in Visual Studio, and the projects 'ALL_BUILD', 'check', 'doc', 'INSTALL', and 'examples' should be generated. Important note: If you include "windows.h" in your projects: there are some name clashes with VIGRA -- always include "vigra/windows.h" instead.

cmake [options] customize installation directories and guide cmake in its search for the VIGRA dependencies. On a Linux system, it is often possible to configure without any options. The most commonly used options are:

-DCMAKE_INSTALL_PREFIX=<path>
  where to install VIGRA (binaries will be installed in <path>/bin, libraries in <path>/lib, headers in <path>/include/vigra, and documentation in <path>/doc/vigra and <path>/doc/vigranumpy, default is platform dependent)
-DDEPENDENCY_SEARCH_PREFIX=<path1>[;<path2>...]
  where to look for VIGRA dependencies (for every given path, cmake will search for libraries in <path>/lib and for headers in <path>/include)
-DDOCDIR=<path>
  where to generate VIGRA documentation (default: <vigra_source_path>/doc). Note that this is not the documentation install directory (the latter can be changed by -DDOCINSTALL=... and defaults to $CMAKE_INSTALL_PREFIX/doc).
-DWITH_VIGRANUMPY=1
  build VIGRA Python bindings (default: 1). Pass -DWITH_VIGRANUMPY=0 to suppress vigranumpy.
-DWITH_HDF5=1
  build VIGRA with HDF5 support (default: 1). Pass -DDWITH_HDF5=0 to compile without HDF5.
-DLIBDIR_SUFFIX=64
  define suffix of lib directory name (default: empty string, i.e. no suffix). Use -DLIBDIR_SUFFIX=64 when you want to install libraries in $CMAKE_INSTALL_PREFIX/lib64.

More fine-grained customization (e.g. specification of explicit paths for all dependencies, customization of compiler flags) is possible by editing the file <vigra_build_path>/CMakeCache.txt. This is best done by means of the interactive programs ccmake or cmake-gui. Consult the cmake documentation for more detailed help.

For using VIGRA in another CMake-built project, you can use the CMake command FIND_PACKAGE(Vigra), which will set the CMake variables ${Vigra_INCLUDE_DIRS} with the correct include path, and import the binary targets (currently vigraimpex) to link against (e.g., TARGET_LINK_LIBRARIES(targetname vigraimpex)). For this mechanism to work, CMake reads a config file VigraConfig.cmake, which is installed along with the library in CMAKE_INSTALL_PREFIX/lib/vigra. Alternatively, you can point CMake (cache entry Vigra_DIR) to VIGRA's build directory, where a corresponding VigraConfig.cmake resides for using the build version directly without installation.

© Ullrich Köthe (ullrich.koethe@iwr.uni-heidelberg.de) Heidelberg Collaboratory for Image Processing, University of Heidelberg, Germany | html generated using doxygen and Python vigra 1.7.1 (3 Dec 2010)