Commit cf251ea1 authored by mark's avatar mark
Browse files

ENH: support new rendering backend for paraview >= 5.0

ENH: patch paraview 4.4.0 directly before building

- this avoids more manual steps for the user
parent 3da9455c
# -*- mode: org; -*-
#
#+TITLE: OpenFOAM Third-Party packages
#+AUTHOR: The OpenFOAM Foundation
#+DATE: 2016-06-14
#+AUTHOR: The OpenFOAM Foundation / OpenCFD Ltd.
#+DATE: 2016-06-19
#+LINK: http://www.openfoam.org
#+OPTIONS: author:nil ^:{}
# Copyright (c) 2014-2016 OpenFOAM Foundation.
# Copyright (c) 2016 OpenCFD Ltd.
* Description
Scripts for building third-party packages.
......@@ -62,15 +63,12 @@
does not exist and cannot be installed causing the build and installation to
fail.
Additionally for ParaView-4.4.0 there is a bug in the STL reader which can
be patched by running the following command from within the ThirdParty-???
directory:
+ wget https://raw.githubusercontent.com/Kitware/VTK/40937e934308e5009e80769dc0c451ee4f157749/IO/Geometry/vtkSTLReader.cxx -O ParaView-4.4.0/VTK/IO/Geometry/vtkSTLReader.cxx
See also http://www.openfoam.org/mantisbt/view.php?id=1887
Additionally for ParaView-4.4.0 there is a bug in the STL reader.
(see http://www.openfoam.org/mantisbt/view.php?id=1887).
For ParaView-5.0.1, the necessary patches are supplied with the
ThirdParty repository (see the etc/patches directory) and are applied
when building paraview.
For ParaView-4.4.0 and ParaView-5.0.1,
the necessary patches are supplied with the ThirdParty repository
(see the etc/patches directory) and are applied when building paraview.
*** Building ParaView-5.0.1 with gcc-6.1.0
***** Add support for gcc-6.?.?
......@@ -79,6 +77,7 @@
+ ParaView-5.0.1/VTK/CMake/GenerateExportHeader.cmake
specifically limit the gcc versions supported.
To add support gcc-6.?.? replace the '[345]' with '[3456]'.
This patch is also supplied with the ThirdParty repository and
applied when building paraview.
......
--- ParaView-4.4.0/VTK/IO/Geometry/vtkSTLReader.cxx.orig 2015-09-11 19:59:24.000000000 +0200
+++ ParaView-4.4.0/VTK/IO/Geometry/vtkSTLReader.cxx 2016-06-19 12:59:50.769770143 +0200
@@ -448,7 +448,7 @@
done = done || (fscanf(fp,"%s", line)==EOF);
}
}
- if (!done)
+ else if (!done)
{
done = (fgets(line, 255, fp) == 0);
lineCount++;
--- ParaView-5.0.1/VTK/CMake/vtkCompilerExtras.cmake.orig 2016-03-28 17:07:10.000000000 +0200
+++ ParaView-5.0.1/VTK/CMake/vtkCompilerExtras.cmake 2016-06-11 15:10:14.820958942 +0200
@@ -32,7 +32,7 @@
OUTPUT_VARIABLE _gcc_version_info
ERROR_VARIABLE _gcc_version_info)
- string (REGEX MATCH "[345]\\.[0-9]\\.[0-9]*"
+ string (REGEX MATCH "[3-6]\\.[0-9]\\.[0-9]*"
_gcc_version "${_gcc_version_info}")
if(NOT _gcc_version)
string (REGEX REPLACE ".*\\(GCC\\).*([34]\\.[0-9]).*" "\\1.0"
--- ParaView-5.0.1/VTK/CMake/GenerateExportHeader.cmake.orig 2016-03-28 17:07:10.000000000 +0200
+++ ParaView-5.0.1/VTK/CMake/GenerateExportHeader.cmake 2016-06-11 15:12:16.344357746 +0200
@@ -166,7 +166,7 @@
execute_process(COMMAND ${CMAKE_C_COMPILER} ARGS --version
OUTPUT_VARIABLE _gcc_version_info
ERROR_VARIABLE _gcc_version_info)
- string(REGEX MATCH "[345]\\.[0-9]\\.[0-9]*"
+ string(REGEX MATCH "[3-6]\\.[0-9]\\.[0-9]*"
_gcc_version "${_gcc_version_info}")
# gcc on mac just reports: "gcc (GCC) 3.3 20030304 ..." without the
# patch level, handle this here:
--- ParaView-5.0.1/Qt/Components/CMakeLists.txt.orig 2016-06-13 09:27:27.827849525 +0200
+++ ParaView-5.0.1/Qt/Components/CMakeLists.txt 2016-06-13 09:29:28.599318445 +0200
@@ -656,10 +656,10 @@
#the pqSGExportStateWizard has subclasses that directly access
#the UI file, and currently we don't have a clean way to break this hard
#dependency, so for no we install this ui file.
-if(PARAVIEW_INSTALL_DEVELOPMENT_FILES)
- install(FILES "${CMAKE_CURRENT_BINARY_DIR}/ui_pqExportStateWizard.h"
- DESTINATION "${VTK_INSTALL_INCLUDE_DIR}")
-endif()
+#OPENFOAM patch#if(PARAVIEW_INSTALL_DEVELOPMENT_FILES)
+#OPENFOAM patch# install(FILES "${CMAKE_CURRENT_BINARY_DIR}/ui_pqExportStateWizard.h"
+#OPENFOAM patch# DESTINATION "${VTK_INSTALL_INCLUDE_DIR}")
+#OPENFOAM patch#endif()
#IF (NOT PV_INSTALL_NO_DEVELOPMENT)
# # Headers
......@@ -3,7 +3,7 @@
@@ -32,7 +32,7 @@
OUTPUT_VARIABLE _gcc_version_info
ERROR_VARIABLE _gcc_version_info)
- string (REGEX MATCH "[345]\\.[0-9]\\.[0-9]*"
+ string (REGEX MATCH "[3-6]\\.[0-9]\\.[0-9]*"
_gcc_version "${_gcc_version_info}")
......@@ -34,6 +34,6 @@
+#OPENFOAM patch# install(FILES "${CMAKE_CURRENT_BINARY_DIR}/ui_pqExportStateWizard.h"
+#OPENFOAM patch# DESTINATION "${VTK_INSTALL_INCLUDE_DIR}")
+#OPENFOAM patch#endif()
#IF (NOT PV_INSTALL_NO_DEVELOPMENT)
# # Headers
......@@ -178,9 +178,9 @@ addPythonSupport()
PYTHON_LIBRARY=$(ldd $pythonBin | \
sed -ne '/libpython/s/.* => \(.*\) (.*/\1/p')
[ -e "$PYTHON_LIBRARY" ] || {
echo "*** Error: Unable to determine path to python library."
}
[ -e "$PYTHON_LIBRARY" ] || {
echo "*** Error: Unable to determine path to python library."
}
fi
[ -e "$PYTHON_LIBRARY" ] || {
......@@ -230,7 +230,7 @@ addMesaSupport()
{
if [ "${withMESA:=false}" != true ]
then
return
return
fi
if [ -d "$MESA_INCLUDE" -a -f "$MESA_LIBRARY" ]
......@@ -394,6 +394,7 @@ configParaView()
echo " MPI support : ${withMPI:-false}"
echo " Python support : ${withPYTHON:-false}"
echo " MESA support : ${withMESA:-false}"
echo " GL2 rendering : false"
echo " Qt dev support : ${withQT:-false}"
echo " Source : $ParaView_SOURCE_DIR"
echo " Build : $ParaView_BINARY_DIR"
......
......@@ -178,9 +178,9 @@ addPythonSupport()
PYTHON_LIBRARY=$(ldd $pythonBin | \
sed -ne '/libpython/s/.* => \(.*\) (.*/\1/p')
[ -e "$PYTHON_LIBRARY" ] || {
echo "*** Error: Unable to determine path to python library."
}
[ -e "$PYTHON_LIBRARY" ] || {
echo "*** Error: Unable to determine path to python library."
}
fi
[ -e "$PYTHON_LIBRARY" ] || {
......@@ -230,7 +230,7 @@ addMesaSupport()
{
if [ "${withMESA:=false}" != true ]
then
return
return
fi
if [ -d "$MESA_INCLUDE" -a -f "$MESA_LIBRARY" ]
......@@ -252,6 +252,18 @@ addMesaSupport()
}
#
# new rendering backend
#
addGL2Support()
{
if [ "${withGL2:=false}" = true ]
then
addCMakeVariable "VTK_RENDERING_BACKEND=OpenGL2"
fi
}
addQtSupport()
{
QtVersion=none
......@@ -405,6 +417,7 @@ configParaView()
echo " MPI support : ${withMPI:-false}"
echo " Python support : ${withPYTHON:-false}"
echo " MESA support : ${withMESA:-false}"
echo " GL2 rendering : ${withGL2:-false}"
echo " Qt dev support : ${withQT:-false}"
echo " Source : $ParaView_SOURCE_DIR"
echo " Build : $ParaView_BINARY_DIR"
......
......@@ -181,7 +181,7 @@ applyPatch()
else
echo "apply patch for $pkg"
touch "$sentinel"
patch -p1 < $patch
patch -p1 < $patch 2>&1 | tee $sentinel
fi
)
else
......
......@@ -71,6 +71,12 @@ QMAKE_PATH=""
# Set the path to cmake
CMAKE_PATH=""
# new rendering backend (starting with paraview 5.0)
withGL2=true
if [ "${ParaView_VERSION%%.*}" = 4 ]
then withGL2=false
fi
#
# NO FURTHER EDITING BELOW THIS LINE
#
......@@ -85,6 +91,7 @@ usage() {
usage: $Script [OPTION] [CMAKE-OPTION]
options:
-rebuild for repeated builds (-make -install) *use with caution*
-gl2 with new rendering backend (if not already enabled)
-mesa with mesa (if not already enabled)
-mpi with mpi (if not already enabled)
-python with python (if not already enabled)
......@@ -123,13 +130,17 @@ For finer control, the build stages can be selected or deselected individually:
\$WM_THIRD_PARTY_DIR/ParaView-$ParaView_VERSION
-> \$WM_THIRD_PARTY_DIR/platforms/$WM_ARCH$WM_COMPILER/paraview-$ParaView_VERSION
To change the paraview version, use the 'foamPV' command prior to '$Script'.
For example,
foamPV 4.4.0 ; ./makeParaview
USAGE
exit 1
}
#------------------------------------------------------------------------------
# ensure CMake gets the correct C++ compiler
# ensure CMake gets the correct C/C++ compiler
[ -n "$WM_CXX" ] && export CXX="$WM_CXX"
[ -n "$WM_CC" ] && export CC="$WM_CC"
......@@ -197,6 +208,12 @@ do
runINSTALL=true
unset runDEFAULT
;;
-gl2)
withGL2=true
;;
-no-gl2)
withGL2=false
;;
-mesa)
withMESA=true
;;
......@@ -290,6 +307,7 @@ addVerbosity # verbose makefiles
addMpiSupport # set MPI-specific options
addPythonSupport # set Python-specific options
addMesaSupport # set MESA-specific options
addGL2Support # new rendering backend
addQtSupport # add extra Qt support
setDirs # where things are or should be put
......
......@@ -121,13 +121,17 @@ For finer control, the build stages can be selected or deselected individually:
\$WM_THIRD_PARTY_DIR/ParaView-$ParaView_VERSION
-> \$WM_THIRD_PARTY_DIR/platforms/$WM_ARCH$WM_COMPILER/paraview-$ParaView_VERSION
To make a different paraview version, use the 'foamPV' command prior to '$Script'.
For example,
foamPV 3.14.0 ; ./makeParaview
USAGE
exit 1
}
#------------------------------------------------------------------------------
# ensure CMake gets the correct C++ compiler
# ensure CMake gets the correct C/C++ compiler
[ -n "$WM_CXX" ] && export CXX="$WM_CXX"
[ -n "$WM_CC" ] && export CC="$WM_CC"
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment