Installation/ParaView/3.12

From OpenFOAMWiki

1 Introduction

This page aims to mostly explain how to build ParaView 3.12 in Linux, by using OpenFOAM's own makeParaView script. Feel free to extend this page with more details.


2 Requirements for building ParaView 3.12

  • Compatible Qt versions: 4.6, 4.7 and 4.8.
  • Compatible CMake versions: 2.8.3 to 2.8.12.
  • Compatible Python versions: 2.6 or 2.7.


3 Using the script makeParaView

ParaView 3.12 is the default version that is built with OpenFOAM 2.1 and 2.2. It's also supported for OpenFOAM 2.3 and 2.4 as the secondary ParaView version for building with older Linux Distributions that use older Qt versions.

For building this version, OpenFOAM provides inside the ThirdParty-2.* folder the shell script Template:MakeParaView, which has several options for using it, as indicated by the following command:

./makeParaView -help

Which gives the following details:

usage: makeParaView [OPTION] [CMAKE-OPTION]
options:
  -rebuild          for repeated builds (-make -install) *use with caution*
  -mesa             with mesa (if not already enabled)
  -mpi              with mpi (if not already enabled)
  -python           with python (if not already enabled)
  -cmake PATH       with the cmake version corresponding to the cmake path given
  -qmake PATH       with the Qt version corresponding to the qmake path given
  -qt               with extra Qt gui support (if not already enabled)
  -qt-VER           with Qt version corresponding to
                        $WM_THIRD_PARTY_DIR/platforms/linux64Gcc/qt-VER/bin/qmake
  -gcc              force g++ instead of the value from $WM_CXX
  -verbose          verbose output in Makefiles
  -version VER      specify an alternative version (current value: 3.12.0)
  -major   VER      specify an alternative major version for special builds
  -mesa-include DIR
                    location of mesa headers (current value: /usr/include/GL)
  -mesa-lib PATH    path to mesa library     (current value: /usr/lib64/libOSMesa.so)
  -python-lib PATH  path to python library   (current value: none)
  -help
 
The -no-FEATURE option can be disable these features (if not already disabled):
  mesa mpi python qt
 
CMake options start with a capital letter and contain an '='.
For example,
    makeParaView BUILD_TESTING=ON PARAVIEW_GENERATE_PROXY_DOCUMENTATION=OFF
to add tests and avoid building documentation
 
For finer control, the build stages can be selected or deselected individually:
  -config    -no-config
  -make      -no-make
  -install   -no-install
 
 
* Make and install paraview-3.12.0 located under
      $WM_THIRD_PARTY_DIR/ParaView-3.12.0
  ->  $WM_THIRD_PARTY_DIR/platforms/linux64Gcc/paraview-3.12.0

For making it easier to understand how most of these options work, here are some usage examples:

  • In order to use the default build options and the system's default Qt version:
    ./makeParaView
  • You can redirect all output into a log file, including error messages:
    ./makeParaView > log.makePV 2>&1
  • In order to build with a specific qmake-qt4 application (because your system might also have qmake-qt3 or qmake-qt5), which is available in the current search path (i.e. the path where qmake-qt4 is located is defined in the shell environment PATH):
    ./makeParaView -qmake $(which qmake-qt4)
  • In order to build with a specific qmake application that is located in a custom path, as exemplified in Installation/Linux/OpenFOAM-2.1.1/CentOS_SL_RHEL - section CentOS 5.8:
    ./makeParaView -qmake $WM_THIRD_PARTY_DIR/platforms/$WM_ARCH$WM_COMPILER/qt-4.6.4/bin/qmake PARAVIEW_INSTALL_THIRD_PARTY_LIBRARIES:BOOL=ON

    Note: The option PARAVIEW_INSTALL_... refers to a CMake build option that is valid for this ParaView version, so that it will copy the Qt libraries into ParaView's own lib/paraview-3.12 folder, so that the custom Qt installation doesn't need to be made available for the whole OpenFOAM installation.

  • Imagine that ParaView wasn't successfully built due to some bug in the code that makes it impossible to build with your current Qt version. If you are able to patch the bug, you don't need to rebuild from the start, because you can use the -no-config option for skipping the step of starting a new build and instead continue with the build:
    ./makeParaView -no-config
  • If you want to build ParaView with MPI and Python support, you can use the respective options:
    ./makeParaView -python -mpi

    But for example in Ubuntu, this doesn't work very well. You'll also need to provide the path to the main Python library with the option -python-lib. For example in a 64-bit Ubuntu installation, for using the Python 2.7 library:

    ./makeParaView -python -mpi -python-lib /usr/lib/x86_64-linux-gnu/libpython2.7.so.1.0
  • For example, to build ParaView without Qt and with off-screen render:
    ./makeParaView -no-qt -mesa


4 Other references

The following is a list of links to pages that have addition instructions related to building ParaView 3.12 for using with OpenFOAM technology: