Linux

1) Prerequisites:

  • g++ >= 2.4.0 (check with g++ --version)
  • Python >= 2.5 + header files
      Note: if you use a package-based distribution, make sure
       you got both python *and python-devel* (python-devel has the
       header files).
      Support for 2.6 is available since release 2.0-a2.
      Python 3.0 is currently unsupported. 
  • Qt >= 4.0
      (idem: make sure you got the libraries and the header files)
  • CMake >= 2.4
  • Graphite sources
       --> Download source archive from Inria GForge
       OR
       --> Get the latest sources from the inriaGfoge Graphite SVN repository (can be broken sometimes). You need for this to install subversion.
  • Subversion (optional)

Good news: on most distributions, the prerequisites (Python, Qt-4 and CMake) can be found as pre-compiled packages.

  • Fedora core:

yum install python python-devel cmake qt4 qt4-devel

yum install subversion

  • Fedora core 9:

yum install python python-devel cmake qt qt-devel

  • Debian:

aptitude install subversion cmake

aptitude install python python-dev libqt4-dev libqt4-opengl-dev libX11-dev

for NVidia users

aptitude install nvidia-glx-dev

2) Install Graphite sources

   tar xvfz Graphite-2-a1-src.tar.gz

3) Generate makefiles:

   cd GraphiteTwo
   ./configure.sh

4) Build Graphite:

   cd build/Linux-Release
   make

Graphite's main executable is build/Linux-Release/binaries/bin/graphite


Known problems/bugs

Here is a list of known problems and fixes. You can either fix the problems as described below, or use the latest version from the SVN repository (use anonymous access).

Compilation fails with some compilers under Linux (the problem is reported under Ubuntuu), this can be fixed (see below):

  GraphiteTwo/src/packages/OGF/basic/containers/arrays.h:
  In member function ‘void OGF::Array1d<T>::allocate(int, int)’:
  GraphiteTwo/src/packages/OGF/basic/containers/arrays.h:77:
  warning: there are no arguments to ‘malloc’ that depend on a template
  parameter, so a declaration of ‘malloc’ must be available
  GraphiteTwo/src/packages/OGF/basic/containers/arrays.h:
  In member function ‘void OGF::Array1d<T>::deallocate()’:
  GraphiteTwo/src/packages/OGF/basic/containers/arrays.h:153:
  warning: there are no arguments to ‘free’ that depend on a template
  parameter, so a declaration of ‘free’ must be available
  ...

Window resize is slow under Linux

This comes from the NVidia driver. You can fix the problem by issuing the following command:

   nvidia-settings -a initialPixmapPlacement=2

(for instance, declare it in the session manager)

List of fixes (contributed by Imran Akbar, Stanford U and Laurent Alonso, ALICE):

  • add #include <malloc.h> to this file:
  GraphiteTwo/src/packages/OGF/basic/containers/arrays.h
  • add "#include <typeinfo>" to the file:
  GraphiteTwo/src/packages/OGF/math/numeric/sparse_matrix_conversion.h
  • add "#include <malloc.h>" and "#include <stdlib.h>" to this file:
  GraphiteTwo/src/packages/OGF/image/io/image_serializer_rgb.cpp
  • add "#include <malloc.h>" to these files:
  GraphiteTwo/src/packages/OGF/image/io/image_serializer_png.cpp
  GraphiteTwo/src/packages/OGF/cells/io/map_serializer_ply.cpp
  • add "#include <algorithm>" to this file:
  GraphiteTwo/src/packages/OGF/cells/map_algos/map_partition_smoother.h
  • add "#include <stdlib.h>" to these files:
  GraphiteTwo/src/packages/OGF/image/io/image_serializer_xpm.cpp
  GraphiteTwo/src/packages/OGF/renderer/types/material.cpp
  GraphiteTwo/src/packages/OGF/cells/cgraph/cgraph_cells.cpp
  GraphiteTwo/src/packages/OGF/cells/cgraph/cgraph_builder.cpp
  GraphiteTwo/src/packages/OGF/cells/third_party/ANN/ANN.cpp
  GraphiteTwo/src/packages/OGF/cells/third_party/ANN/kd_dump.cpp
  GraphiteTwo/src/bin/graphite/main.cpp
  GraphiteTwo/src/packages/OGF/surface/commands/surface_fairing_commands.cpp
  • add "#include <string.h>" to these files:
  GraphiteTwo/src/packages/OGF/cells/third_party/ANN/kd_dump.cpp
  GraphiteTwo/src/packages/third_party/gl_stuff/nvparse/vs1.0_inst.cpp
  GraphiteTwo/src/packages/third_party/NetCDF/cxx/ncvalues.cpp
  • change GLvoid to void on lines 3649 and 3610 of:
  GraphiteTwo/src/packages/third_party/GL
  • install this package:
  libXxf86vm-dev

This will be fixed in the 2-alpha2 release.

Numerical stability problems, floating point exceptions

  • Some users experienced unstable floating point behavior on 32bits machines. By using SSE as the floating point unit (default mode in 64 bits), we could obtain the same behavior as the 64bits version. To do so:

Create a file GraphiteTwo/CMakeOptions.txt with:

  SET(CMAKE_CXX_FLAGS "-msse2 -mfpmath=sse")
  SET(CMAKE_C_FLAGS "-msse2 -mfpmath=sse")

Then:

  rm -fr build
  ./configure.sh
  cd build/Linux-Release
  make

Problem with renderer_gl

If it complains that -lXxf86vm is not found, just remove it from OGF/renderer_gl/CMakeLists.txt , re-launch configure.sh and re-build.

Problem with latest version of g++

In some files, it complains that #include <typeinfo> is missing. Just add it at the beginning of the file.

Problem with gcc 4.4.1

Compiling error in METIS library about __log2 Change last lign of GraphiteTwo/src/packages/third_party/numeric_stuff/METIS/rename.h :

  • from #define log2 __log2 to #define log2 metis__log2