]> SALOME platform Git repositories - tools/install.git/commitdiff
Salome HOME
Update install scripts for SALOME 7.4.0
authorvsr <vsr@opencascade.com>
Fri, 16 May 2014 11:42:26 +0000 (15:42 +0400)
committervsr <vsr@opencascade.com>
Fri, 16 May 2014 11:42:26 +0000 (15:42 +0400)
config_files/ParaView.sh
config_files/common.sh
config_files/freeimage.sh
config_files/qwt.sh

index 02a3e699fceb3a5b2b29257b4d2e310ff989365f..146d132bdd0c7394494bab743f74e90bed696e79 100755 (executable)
@@ -39,7 +39,7 @@ export VTK_DIR=\${PARAVIEW_ROOT_DIR}/lib/cmake/paraview-${PVLIBVERSION}
 export PV_PLUGIN_PATH=\${PARAVIEW_ROOT_DIR}/lib/paraview-${PVLIBVERSION}
 export PATH=\${PARAVIEW_ROOT_DIR}/bin:\${PATH}
 export LD_LIBRARY_PATH=\${PARAVIEW_ROOT_DIR}/lib/paraview-${PVLIBVERSION}:\${LD_LIBRARY_PATH}
-export PYTHONPATH=\${PARAVIEW_ROOT_DIR}/lib/paraview-${PVLIBVERSION}:\${PARAVIEW_ROOT_DIR}/lib/paraview-${PVLIBVERSION}/site-packages:\${PARAVIEW_ROOT_DIR}/lib/paraview-${PVLIBVERSION}/site-packages/paraview:\${PYTHONPATH}
+export PYTHONPATH=\${PARAVIEW_ROOT_DIR}/lib/paraview-${PVLIBVERSION}:\${PARAVIEW_ROOT_DIR}/lib/paraview-${PVLIBVERSION}/site-packages:\${PARAVIEW_ROOT_DIR}/lib/paraview-${PVLIBVERSION}/site-packages/paraview:\${PARAVIEW_ROOT_DIR}/lib/paraview-${PVLIBVERSION}/site-packages/vtk:\${PYTHONPATH}
 ##
 EOF
 (test -w ${PRODUCT_DIR} && cp ${INSTALL_WORK}/env_${PRODUCT_TYPE}.sh ${PRODUCT_DIR})
@@ -77,29 +77,51 @@ if [ -f ${data_archive} ] ; then
     check_jb tar xfz ${data_archive} -C ${INST_ROOT}
 fi
 
-### patch paraview
-# 1. fix missing library dependencies
-local patch_lib_depends=0
+### patch options
+local patch_sources=1
+local patch_lib_depends=0 # not needed when dynamic Python libs are used
+local patch_dlopen=1
+local patch_surface_lic=1
+local patch_topological_sort=1
+local patch_matplotlib=0 # included to diff patch
+local patch_missing_headers=1
+local patch_python_threads=0 # included to diff patch
+local patch_vtk_math=0 # not needed for pv4.1
+
+# patch: apply general sources patch if present
+if [ "${patch_sources}" = "1" ] ; then
+    ( test -f patches/${PRODUCT}.patch && cp patches/${PRODUCT}.patch ${PRODUCT_SRC_DIR} && cd ${PRODUCT_SRC_DIR} && patch -p1 < ${PRODUCT}.patch )
+fi
+
+# patch: fix missing library dependencies
 if [ "${patch_lib_depends}" = "1" ] ; then
-    echo "target_link_libraries(vtkWrappingPython pthread util)" >> ${PRODUCT_SRC_DIR}/VTK/Wrapping/Python/CMakeLists.txt
-    sed -i "s%LINK_PUBLIC vtkPVServerManagerCore%LINK_PUBLIC vtkPVServerManagerCore util%g" ${PRODUCT_SRC_DIR}/ParaViewCore/ServerManager/SMApplication/CMakeLists.txt
-    sed -i "s%VTK_PYTHON_LIBRARIES})%VTK_PYTHON_LIBRARIES} pthread util)%g" ${PRODUCT_SRC_DIR}/ParaViewCore/PythonSupport/CMakeLists.txt
-    sed -i "s%PYTHON_UTIL_LIBRARY_LIB}%PYTHON_UTIL_LIBRARY_LIB} pthread dl%g" ${PRODUCT_SRC_DIR}/ThirdParty/QtTesting/vtkqttesting/CMakeLists.txt
+    echo "target_link_libraries(vtkPythonInterpreter pthread util dl)" >> ${PRODUCT_SRC_DIR}/VTK/Utilities/PythonInterpreter/CMakeLists.txt
+    echo "target_link_libraries(\${vtk-module} pthread util dl)"       >> ${PRODUCT_SRC_DIR}/VTK/Wrapping/PythonCore/CMakeLists.txt
 fi
-# 2. fix problem with SurfaceLIC plugin
-local patch_surface_lic=1
-if [ "${patch_surface_lic}" = "1" -a -f ${SRCDIR}/patches/surface_lic.png ] ; then
-    cp -f ${SRCDIR}/patches/surface_lic.png ${PRODUCT_SRC_DIR}/Plugins/SurfaceLIC/doc
+
+# patch: fix pb with dynamic loader in SALOME
+if [ "${patch_dlopen}" = "1" ] ; then
+    sed -i "s%RTLD_LAZY%RTLD_LAZY|RTLD_NODELETE%g" ${PRODUCT_SRC_DIR}/VTK/Utilities/KWSys/vtksys/DynamicLoader.cxx
 fi
-# 3. fix about missing TopologicalSort.cmake
-local patch_topological_sort=1
+
+# patch: fix problem with SurfaceLIC plugin
+if [ "${patch_surface_lic}" = "1" ] ; then
+    ( test -f patches/surface_lic.png && cp -f ${SRCDIR}/patches/surface_lic.png ${PRODUCT_SRC_DIR}/Plugins/SurfaceLIC/doc )
+fi
+
+# patch: fix about missing TopologicalSort.cmake
 if [ "${patch_topological_sort}" = "1" ] ; then
     sed -i "s%CMake/vtkWrapTcl.cmake%CMake/vtkWrapTcl.cmake\n\t\tCMake/TopologicalSort.cmake%" ${PRODUCT_SRC_DIR}/VTK/CMake/vtkModuleTop.cmake
 fi
-# 4. fix about missing header files
-local patch_missing_headers=1
+
+if [ "${patch_matplotlib}" = "1" ] ; then
+    sed -i "s%^[[:space:]]*vtkMatplotlibMathTextUtilities::NOT_TESTED;%vtkMatplotlibMathTextUtilities::UNAVAILABLE;%" ${PRODUCT_SRC_DIR}/VTK/Rendering/Matplotlib/vtkMatplotlibMathTextUtilities.cxx
+fi
+
+# patch: fix about missing header files
 if [ "${patch_missing_headers}" = "1" ] ; then
-       cat >> ${PRODUCT_SRC_DIR}/Qt/Components/CMakeLists.txt <<EOF
+    sed -i "s%\(.*\)\(\${CMAKE_CURRENT_SOURCE_DIR}/vtkSMMessageMinimal.h\)%\1\2\n\1\${CMAKE_CURRENT_SOURCE_DIR}/vtkSIVectorPropertyTemplate.h%g" ${PRODUCT_SRC_DIR}/ParaViewCore/ServerImplementation/Core/CMakeLists.txt
+    cat >> ${PRODUCT_SRC_DIR}/Qt/Components/CMakeLists.txt <<EOF
 IF (PARAVIEW_INSTALL_DEVELOPMENT_FILES)
   FILE(GLOB files RELATIVE \${CMAKE_CURRENT_SOURCE_DIR} *.h)
   INSTALL(
@@ -109,10 +131,15 @@ IF (PARAVIEW_INSTALL_DEVELOPMENT_FILES)
 ENDIF (PARAVIEW_INSTALL_DEVELOPMENT_FILES)
 EOF
 fi
-# 5. fix pb with dynamic loader in SALOME
-local patch_dlopen=1
-if [ "${patch_dlopen}" = "1" ] ; then
-    sed -i "s%RTLD_LAZY%RTLD_LAZY|RTLD_NODELETE%g" ${PRODUCT_SRC_DIR}/VTK/Utilities/KWSys/vtksys/DynamicLoader.cxx
+
+# patch: enable python threads
+if [ "${patch_python_threads}" = "1" ] ; then
+    sed -i "s%set (VTK_NO_PYTHON_THREADS 1%set (VTK_NO_PYTHON_THREADS OFF%" ${PRODUCT_SRC_DIR}/CMakeLists.txt
+fi
+
+# patch: fix pb with vtkMath, if present
+if [ "${patch_vtk_math}" = "1" ] ; then
+    ( test -f patches/vtkMath.h.patch && cp patches/vtkMath.h.patch ${PRODUCT_SRC_DIR}/VTK/Common/Core && cd ${PRODUCT_SRC_DIR}/VTK/Common/Core && patch -p1 < vtkMath.h.patch )
 fi
 
 # to generate environment scripts
@@ -131,6 +158,11 @@ export PRODUCT_BUILD_DIR=${PRODUCT_DIR}_build
 mkdir ${PRODUCT_BUILD_DIR}
 cd ${PRODUCT_BUILD_DIR}
 
+# patch options
+local patch_fatal_warnings=0 # not needed for pv4.1
+local patch_vtkconfig=1
+local patch_nvidia_deps=1
+
 # get Python and tcl/tk version
 python_version="`python -c 'import sys; print sys.version[:3]'`"
 tcl_version=""
@@ -147,46 +179,49 @@ fi
 CMAKE_OPTIONS=""
 
 ### common settings
-CMAKE_OPTIONS=${CMAKE_OPTIONS}" -DCMAKE_INSTALL_PREFIX:STRING=${PRODUCT_DIR}"
-CMAKE_OPTIONS=${CMAKE_OPTIONS}" -DCMAKE_BUILD_TYPE:STRING=Release"
-CMAKE_OPTIONS=${CMAKE_OPTIONS}" -DBUILD_SHARED_LIBS:BOOL=ON"
+CMAKE_OPTIONS="${CMAKE_OPTIONS} -DCMAKE_INSTALL_PREFIX:STRING=${PRODUCT_DIR}"
+CMAKE_OPTIONS="${CMAKE_OPTIONS} -DCMAKE_BUILD_TYPE:STRING=Release"
+CMAKE_OPTIONS="${CMAKE_OPTIONS} -DBUILD_SHARED_LIBS:BOOL=ON"
+CMAKE_OPTIONS="${CMAKE_OPTIONS} -DBUILD_TESTING:BOOL=OFF"
 
 ### general compiler settings
-CMAKE_OPTIONS=${CMAKE_OPTIONS}" -DVTK_HAVE_GETSOCKNAME_WITH_SOCKLEN_T=1"
-CMAKE_OPTIONS=${CMAKE_OPTIONS}" -DCMAKE_CXX_COMPILER:STRING=`which g++`"
-CMAKE_OPTIONS=${CMAKE_OPTIONS}" -DCMAKE_C_COMPILER:STRING=`which gcc`"
+#CMAKE_OPTIONS="${CMAKE_OPTIONS} -DVTK_HAVE_GETSOCKNAME_WITH_SOCKLEN_T=1"
+#CMAKE_OPTIONS="${CMAKE_OPTIONS} -DCMAKE_CXX_COMPILER:STRING=`which g++`"
+#CMAKE_OPTIONS="${CMAKE_OPTIONS} -DCMAKE_C_COMPILER:STRING=`which gcc`"
 
 ### compiler settings for 64 bit platforms
 if test `uname -m` = "x86_64" ; then
-    CMAKE_OPTIONS=${CMAKE_OPTIONS}" -DCMAKE_CXX_FLAGS:STRING=-m64"
-    CMAKE_OPTIONS=${CMAKE_OPTIONS}" -DCMAKE_C_FLAGS:STRING=-m64"
+    CMAKE_OPTIONS="${CMAKE_OPTIONS} -DCMAKE_CXX_FLAGS:STRING=-m64"
+    CMAKE_OPTIONS="${CMAKE_OPTIONS} -DCMAKE_C_FLAGS:STRING=-m64"
 fi
 
 ### Paraview general settings
-CMAKE_OPTIONS=${CMAKE_OPTIONS}" -DPARAVIEW_INSTALL_DEVELOPMENT_FILES:BOOL=ON"
+CMAKE_OPTIONS="${CMAKE_OPTIONS} -DPARAVIEW_INSTALL_DEVELOPMENT_FILES:BOOL=ON"
+#CMAKE_OPTIONS="${CMAKE_OPTIONS} -DPARAVIEW_DATA_ROOT=${PARAVIEWDATA_ROOT_DIR}"
 
 ### VTK general settings
-#CMAKE_OPTIONS=${CMAKE_OPTIONS}" -DVTK_LEGACY_REMOVE:BOOL=OFF"
-#CMAKE_OPTIONS=${CMAKE_OPTIONS}" -DVTK_USE_HYBRID:BOOL=ON"
-CMAKE_OPTIONS=${CMAKE_OPTIONS}" -DVTK_USE_PARALLEL:BOOL=ON"
-#CMAKE_OPTIONS=${CMAKE_OPTIONS}" -DVTK_USE_PATENTED:BOOL=OFF"
-#CMAKE_OPTIONS=${CMAKE_OPTIONS}" -DVTK_USE_RENDERING:BOOL=ON"
-CMAKE_OPTIONS=${CMAKE_OPTIONS}" -DVTK_USE_64BIT_IDS:BOOL=OFF"
+#CMAKE_OPTIONS="${CMAKE_OPTIONS} -DVTK_LEGACY_REMOVE:BOOL=OFF"
+#CMAKE_OPTIONS="${CMAKE_OPTIONS} -DVTK_USE_HYBRID:BOOL=ON"
+#CMAKE_OPTIONS="${CMAKE_OPTIONS} -DVTK_USE_PARALLEL:BOOL=ON"
+#CMAKE_OPTIONS="${CMAKE_OPTIONS} -DVTK_USE_PATENTED:BOOL=OFF"
+#CMAKE_OPTIONS="${CMAKE_OPTIONS} -DVTK_USE_RENDERING:BOOL=ON"
+CMAKE_OPTIONS="${CMAKE_OPTIONS} -DVTK_USE_64BIT_IDS:BOOL=OFF"
 
 ### Qt settings
-CMAKE_OPTIONS=${CMAKE_OPTIONS}" -DPARAVIEW_BUILD_QT_GUI:BOOL=ON"
-#CMAKE_OPTIONS=${CMAKE_OPTIONS}" -DVTK_QT_USE_WEBKIT:BOOL=ON"
-CMAKE_OPTIONS=${CMAKE_OPTIONS}" -DQT_TESTING_INSTALL_DEVELOPMENT:BOOL=ON"
-CMAKE_OPTIONS=${CMAKE_OPTIONS}" -DQT_HELP_GENERATOR:STRING=${QT4_ROOT_DIR}/bin/qhelpgenerator"
+CMAKE_OPTIONS="${CMAKE_OPTIONS} -DPARAVIEW_BUILD_QT_GUI:BOOL=ON"
+#CMAKE_OPTIONS="${CMAKE_OPTIONS} -DVTK_QT_USE_WEBKIT:BOOL=ON"
+#CMAKE_OPTIONS="${CMAKE_OPTIONS} -DQT_TESTING_INSTALL_DEVELOPMENT:BOOL=ON"
+CMAKE_OPTIONS="${CMAKE_OPTIONS} -DQT_HELP_GENERATOR:STRING=${QT4_ROOT_DIR}/bin/qhelpgenerator"
 
 ### Python settings
 if [ "${python_version}" != "" ]; then
-    CMAKE_OPTIONS=${CMAKE_OPTIONS}" -DPARAVIEW_ENABLE_PYTHON:BOOL=ON"
-    CMAKE_OPTIONS=${CMAKE_OPTIONS}" -DVTK_WRAP_PYTHON:BOOL=ON"
-    CMAKE_OPTIONS=${CMAKE_OPTIONS}" -DPYTHON_USE_STATIC_LIBRARIES:BOOL=OFF"
-    CMAKE_OPTIONS=${CMAKE_OPTIONS}" -DPYTHON_EXECUTABLE:STRING=${PYTHON_ROOT_DIR}/bin/python${python_version}"
-    CMAKE_OPTIONS=${CMAKE_OPTIONS}" -DPYTHON_INCLUDE_PATH:STRING=${PYTHON_ROOT_DIR}/include/python${python_version}"
-    CMAKE_OPTIONS=${CMAKE_OPTIONS}" -DPYTHON_LIBRARY:STRING=${PYTHON_ROOT_DIR}/lib/python${python_version}/config/libpython${python_version}.so"
+    CMAKE_OPTIONS="${CMAKE_OPTIONS} -DPARAVIEW_ENABLE_PYTHON:BOOL=ON"
+    CMAKE_OPTIONS="${CMAKE_OPTIONS} -DVTK_WRAP_PYTHON:BOOL=ON"
+    #CMAKE_OPTIONS="${CMAKE_OPTIONS} -DPYTHON_USE_STATIC_LIBRARIES:BOOL=OFF"
+    CMAKE_OPTIONS="${CMAKE_OPTIONS} -DPYTHON_EXECUTABLE:STRING=${PYTHON_ROOT_DIR}/bin/python${python_version}"
+    CMAKE_OPTIONS="${CMAKE_OPTIONS} -DPYTHON_INCLUDE_DIR:STRING=${PYTHON_ROOT_DIR}/include/python${python_version}"
+    CMAKE_OPTIONS="${CMAKE_OPTIONS} -DPYTHON_LIBRARY:STRING=${PYTHON_ROOT_DIR}/lib/python${python_version}/config/libpython${python_version}.so"
+    #CMAKE_OPTIONS="${CMAKE_OPTIONS} -DVTK_NO_PYTHON_THREADS:BOOL=OFF"
 fi
 
 ### Tcl/Tk settings
@@ -196,66 +231,88 @@ fi
 if false ; then
 #<---
 if [ "${tcl_version}" != "" ] && [ "${tcl_includes}" != "" ] && [ "${tcl_libs}" != "" ] ; then
-    CMAKE_OPTIONS=${CMAKE_OPTIONS}" -DVTK_WRAP_TCL:BOOL=ON"
-    CMAKE_OPTIONS=${CMAKE_OPTIONS}" -DTCL_INCLUDE_PATH:STRING=${tcl_includes}"
-    CMAKE_OPTIONS=${CMAKE_OPTIONS}" -DTCL_LIBRARY:STRING=${tcl_libs}/libtcl${tcl_version}.so"
-    #CMAKE_OPTIONS=${CMAKE_OPTIONS}" -DTCL_STUB_LIBRARY:STRING=${tcl_libs}/libtclstub${tcl_version}.a"
-    CMAKE_OPTIONS=${CMAKE_OPTIONS}" -DTCL_TCLSH:STRING=${TCLHOME}/bin/tclsh${tcl_version}"
-    CMAKE_OPTIONS=${CMAKE_OPTIONS}" -DTK_INCLUDE_PATH:STRING=${tcl_includes}"
-    CMAKE_OPTIONS=${CMAKE_OPTIONS}" -DTK_LIBRARY:STRING=${tcl_libs}/libtk${tcl_version}.so"
-    #CMAKE_OPTIONS=${CMAKE_OPTIONS}" -DTK_STUB_LIBRARY:STRING=${tcl_libs}/libtkstub${tcl_version}.a"
-    CMAKE_OPTIONS=${CMAKE_OPTIONS}" -DTK_WISH:STRING=${TCLHOME}/bin/wish${tcl_version}"
+    CMAKE_OPTIONS="${CMAKE_OPTIONS} -DVTK_WRAP_TCL:BOOL=ON"
+    CMAKE_OPTIONS="${CMAKE_OPTIONS} -DTCL_INCLUDE_PATH:STRING=${tcl_includes}"
+    CMAKE_OPTIONS="${CMAKE_OPTIONS} -DTCL_LIBRARY:STRING=${tcl_libs}/libtcl${tcl_version}.so"
+    #CMAKE_OPTIONS="${CMAKE_OPTIONS} -DTCL_STUB_LIBRARY:STRING=${tcl_libs}/libtclstub${tcl_version}.a"
+    CMAKE_OPTIONS="${CMAKE_OPTIONS} -DTCL_TCLSH:STRING=${TCLHOME}/bin/tclsh${tcl_version}"
+    CMAKE_OPTIONS="${CMAKE_OPTIONS} -DTK_INCLUDE_PATH:STRING=${tcl_includes}"
+    CMAKE_OPTIONS="${CMAKE_OPTIONS} -DTK_LIBRARY:STRING=${tcl_libs}/libtk${tcl_version}.so"
+    #CMAKE_OPTIONS="${CMAKE_OPTIONS} -DTK_STUB_LIBRARY:STRING=${tcl_libs}/libtkstub${tcl_version}.a"
+    CMAKE_OPTIONS="${CMAKE_OPTIONS} -DTK_WISH:STRING=${TCLHOME}/bin/wish${tcl_version}"
 else
-    CMAKE_OPTIONS=${CMAKE_OPTIONS}" -DVTK_WRAP_TCL:BOOL=OFF"
+    CMAKE_OPTIONS="${CMAKE_OPTIONS} -DVTK_WRAP_TCL:BOOL=OFF"
 fi
 #--->
 fi
 #<---
 
+### Java settings
+CMAKE_OPTIONS="${CMAKE_OPTIONS} -DVTK_WRAP_JAVA:BOOL=OFF"
+
+### MPI settings
+CMAKE_OPTIONS="${CMAKE_OPTIONS} -DPARAVIEW_USE_MPI:BOOL=OFF"
+
 ### HDF5 settings
 if [ "${HDF5_ROOT_DIR}" != "" ]; then
-    CMAKE_OPTIONS=${CMAKE_OPTIONS}" -DVTK_USE_SYSTEM_HDF5:BOOL=ON"
-    #CMAKE_OPTIONS=${CMAKE_OPTIONS}" -DHDF5_USE_STATIC_LIBRARIES:BOOL=OFF"
-    #CMAKE_OPTIONS=${CMAKE_OPTIONS}" -DHDF5_ROOT:PATH=${HDF5_ROOT_DIR}"
-    #CMAKE_OPTIONS=${CMAKE_OPTIONS}" -DHDF5_INCLUDE_DIRS=${HDF5_ROOT_DIR}/include"
-    #CMAKE_OPTIONS=${CMAKE_OPTIONS}" -DHDF5_LIBRARIES=${HDF5_ROOT_DIR}/lib/libhdf5.so;${HDF5_ROOT_DIR}/lib/libhdf5_hl.so"
-    #CMAKE_OPTIONS=${CMAKE_OPTIONS}" -DHDF5_INCLUDE_DIR:PATH=${HDF5_ROOT_DIR}/include"
-    #CMAKE_OPTIONS=${CMAKE_OPTIONS}" -DHDF5_HL_INCLUDE_DIR:PATH=${HDF5_ROOT_DIR}/include"
-    #CMAKE_OPTIONS=${CMAKE_OPTIONS}" -DHDF5_LIBRARY_DIRS=${HDF5_ROOT_DIR}/lib"
-    #CMAKE_OPTIONS=${CMAKE_OPTIONS}" -DHDF5_LIBRARY:PATH=${HDF5_ROOT_DIR}/lib/libhdf5.so"
-    #CMAKE_OPTIONS=${CMAKE_OPTIONS}" -DHDF5_HL_LIBRARY_DIRS=${HDF5_ROOT_DIR}/lib"
-    #CMAKE_OPTIONS=${CMAKE_OPTIONS}" -DHDF5_HL_LIBRARY:PATH=${HDF5_ROOT_DIR}/lib/libhdf5_hl.so"
-    CMAKE_OPTIONS=${CMAKE_OPTIONS}" -DPARAVIEW_BUILD_PLUGIN_H5PartReader:BOOL=ON"
+    CMAKE_OPTIONS="${CMAKE_OPTIONS} -DVTK_USE_SYSTEM_HDF5:BOOL=ON"
+    if [ -f ${HDF5_ROOT_DIR}/share/cmake/hdf5 ] ; then
+       CMAKE_OPTIONS="${CMAKE_OPTIONS} -DHDF_DIR:PATH=${HDF5_ROOT_DIR}/share/cmake/hdf5"
+    fi
+    #CMAKE_OPTIONS="${CMAKE_OPTIONS} -DHDF5_ROOT:PATH=${HDF5_ROOT_DIR}"
+    #CMAKE_OPTIONS="${CMAKE_OPTIONS} -DHDF5_INCLUDE_DIRS=${HDF5_ROOT_DIR}/include"
+    #CMAKE_OPTIONS="${CMAKE_OPTIONS} -DHDF5_LIBRARIES=${HDF5_ROOT_DIR}/lib/libhdf5.so;${HDF5_ROOT_DIR}/lib/libhdf5_hl.so"
+    #CMAKE_OPTIONS="${CMAKE_OPTIONS} -DHDF5_INCLUDE_DIR:PATH=${HDF5_ROOT_DIR}/include"
+    #CMAKE_OPTIONS="${CMAKE_OPTIONS} -DHDF5_C_LIBRARY:STRING=${HDF5_ROOT_DIR}/lib/libhdf5.so"
+    #CMAKE_OPTIONS="${CMAKE_OPTIONS} -DHDF5_HL_LIBRARY:PATH=${HDF5_ROOT_DIR}/lib/libhdf5_hl.so"
+    CMAKE_OPTIONS="${CMAKE_OPTIONS} -DPARAVIEW_BUILD_PLUGIN_H5PartReader:BOOL=OFF"
 fi
 
 ### VisIt Database bridge settings
-CMAKE_OPTIONS=${CMAKE_OPTIONS}" -DPARAVIEW_USE_VISITBRIDGE=ON"
-CMAKE_OPTIONS=${CMAKE_OPTIONS}" -DBOOST_ROOT=${BOOST_ROOT_DIR}"
+CMAKE_OPTIONS="${CMAKE_OPTIONS} -DPARAVIEW_USE_VISITBRIDGE=ON"
+
+### Boost settings
+if [ "${BOOST_ROOT_DIR}" != "" ]; then
+    CMAKE_OPTIONS="${CMAKE_OPTIONS} -DBOOST_ROOT=${BOOST_ROOT_DIR}"
+fi
 
 ### gl2ps settings
 if [ "${GL2PS_ROOT_DIR}" != "" ]; then
-    #CMAKE_OPTIONS=${CMAKE_OPTIONS}" -DVTK_USE_GL2PS:BOOL=ON"
-    CMAKE_OPTIONS=${CMAKE_OPTIONS}" -DVTK_USE_SYSTEM_GL2PS:BOOL=ON"
-    CMAKE_OPTIONS=${CMAKE_OPTIONS}" -DGL2PS_INCLUDE_DIR:STRING=${GL2PS_ROOT_DIR}/include"
-    CMAKE_OPTIONS=${CMAKE_OPTIONS}" -DGL2PS_LIBRARY:STRING=${GL2PS_ROOT_DIR}/lib/libgl2ps.so"
+    CMAKE_OPTIONS="${CMAKE_OPTIONS} -DVTK_USE_SYSTEM_GL2PS:BOOL=ON"
+    CMAKE_OPTIONS="${CMAKE_OPTIONS} -DGL2PS_INCLUDE_DIR:STRING=${GL2PS_ROOT_DIR}/include"
+    CMAKE_OPTIONS="${CMAKE_OPTIONS} -DGL2PS_LIBRARY:STRING=${GL2PS_ROOT_DIR}/lib/libgl2ps.so"
+fi
+
+### libxml2 settings
+if [ "${LIBXML2_ROOT_DIR}" != "" ]; then
+    CMAKE_OPTIONS="${CMAKE_OPTIONS} -DVTK_USE_SYSTEM_LIBXML2:BOOL=ON"
+    CMAKE_OPTIONS="${CMAKE_OPTIONS} -DLIBXML2_INCLUDE_DIR:STRING=${LIBXML2_ROOT_DIR}/include/libxml2"
+    CMAKE_OPTIONS="${CMAKE_OPTIONS} -DLIBXML2_LIBRARIES:STRING=${LIBXML2_ROOT_DIR}/lib/libxml2.so"
 fi
 
+### freetype settings
+CMAKE_OPTIONS="${CMAKE_OPTIONS} -DVTK_USE_SYSTEM_FREETYPE:BOOL=ON"
+
 ### Extra options (switch off non-used Paraview plug-ins)
-CMAKE_OPTIONS=${CMAKE_OPTIONS}" -DPARAVIEW_BUILD_PLUGIN_Moments:BOOL=OFF"
-CMAKE_OPTIONS=${CMAKE_OPTIONS}" -DPARAVIEW_BUILD_PLUGIN_PrismPlugin:BOOL=OFF"
-CMAKE_OPTIONS=${CMAKE_OPTIONS}" -DPARAVIEW_BUILD_PLUGIN_SLACTools:BOOL=OFF"
-CMAKE_OPTIONS=${CMAKE_OPTIONS}" -DPARAVIEW_BUILD_PLUGIN_SierraPlotTools:BOOL=OFF"
-#CMAKE_OPTIONS=${CMAKE_OPTIONS}" -DPARAVIEW_BUILD_PLUGIN_VisTrailsPlugin:BOOL=OFF"
-#CMAKE_OPTIONS=${CMAKE_OPTIONS}" -DPARAVIEW_BUILD_PLUGIN_pvblot:BOOL=OFF"
-CMAKE_OPTIONS=${CMAKE_OPTIONS}" -DPARAVIEW_ENABLE_COPROCESSING:BOOL=OFF"
-CMAKE_OPTIONS=${CMAKE_OPTIONS}" -DPARAVIEW_BUILD_PLUGIN_CoProcessingScriptGenerator:BOOL=OFF"
+CMAKE_OPTIONS="${CMAKE_OPTIONS} -DPARAVIEW_BUILD_PLUGIN_Moments:BOOL=OFF"
+CMAKE_OPTIONS="${CMAKE_OPTIONS} -DPARAVIEW_BUILD_PLUGIN_PrismPlugin:BOOL=OFF"
+CMAKE_OPTIONS="${CMAKE_OPTIONS} -DPARAVIEW_BUILD_PLUGIN_SLACTools:BOOL=OFF"
+CMAKE_OPTIONS="${CMAKE_OPTIONS} -DPARAVIEW_BUILD_PLUGIN_SierraPlotTools:BOOL=OFF"
+#CMAKE_OPTIONS="${CMAKE_OPTIONS} -DPARAVIEW_BUILD_PLUGIN_VisTrailsPlugin:BOOL=OFF"
+#CMAKE_OPTIONS="${CMAKE_OPTIONS} -DPARAVIEW_BUILD_PLUGIN_pvblot:BOOL=OFF"
+CMAKE_OPTIONS="${CMAKE_OPTIONS} -DPARAVIEW_BUILD_PLUGIN_PacMan:BOOL=OFF"
+CMAKE_OPTIONS="${CMAKE_OPTIONS} -DPARAVIEW_BUILD_PLUGIN_MobileRemoteControl:BOOL=OFF"
+CMAKE_OPTIONS="${CMAKE_OPTIONS} -DPARAVIEW_ENABLE_COPROCESSING:BOOL=OFF"
+#CMAKE_OPTIONS="${CMAKE_OPTIONS} -DPARAVIEW_BUILD_PLUGIN_CoProcessingScriptGenerator:BOOL=OFF"
+CMAKE_OPTIONS="${CMAKE_OPTIONS} -DPARAVIEW_ENABLE_CATALYST:BOOL=OFF"
+#CMAKE_OPTIONS="${CMAKE_OPTIONS} -DPARAVIEW_BUILD_CATALYST_ADAPTORS:BOOL=OFF"
 
 ### Extra options (switch on required Paraview plug-ins)
-CMAKE_OPTIONS=${CMAKE_OPTIONS}" -DPARAVIEW_BUILD_PLUGIN_EyeDomeLighting:BOOL=ON"
-CMAKE_OPTIONS=${CMAKE_OPTIONS}" -DPARAVIEW_BUILD_PLUGIN_ForceTime:BOOL=ON"
-#CMAKE_OPTIONS=${CMAKE_OPTIONS}" -DPARAVIEW_BUILD_PLUGIN_H5PartReader:BOOL=ON"
-CMAKE_OPTIONS=${CMAKE_OPTIONS}" -DPARAVIEW_BUILD_PLUGIN_PointSprite:BOOL=ON"
-CMAKE_OPTIONS=${CMAKE_OPTIONS}" -DPARAVIEW_BUILD_PLUGIN_SurfaceLIC:BOOL=ON"
+CMAKE_OPTIONS="${CMAKE_OPTIONS} -DPARAVIEW_BUILD_PLUGIN_EyeDomeLighting:BOOL=ON"
+CMAKE_OPTIONS="${CMAKE_OPTIONS} -DPARAVIEW_BUILD_PLUGIN_ForceTime:BOOL=ON"
+CMAKE_OPTIONS="${CMAKE_OPTIONS} -DPARAVIEW_BUILD_PLUGIN_H5PartReader:BOOL=ON"
+CMAKE_OPTIONS="${CMAKE_OPTIONS} -DPARAVIEW_BUILD_PLUGIN_PointSprite:BOOL=ON"
+CMAKE_OPTIONS="${CMAKE_OPTIONS} -DPARAVIEW_BUILD_PLUGIN_SurfaceLIC:BOOL=ON"
 
 # configure
     
@@ -270,8 +327,7 @@ ${CMAKE_OPTIONS}
 EOF
 check_job ${PRODUCT_DIR}/CONFIGURE.LOG cmake ${PRODUCT_SRC_DIR} ${CMAKE_OPTIONS}
 
-# patch buildir
-local patch_fatal_warnings=0
+# patch: fix problems with fatal warnings
 if [ "${patch_fatal_warnings}" = "1" ] ; then
     sed -i "s%-Wl,--fatal-warnings%%g" ${PRODUCT_BUILD_DIR}/VTK/Wrapping/Python/CMakeFiles/vtkpython.dir/link.txt
 fi
@@ -281,29 +337,33 @@ fi
 cat > ${PRODUCT_DIR}/MAKE.LOG <<EOF
 used gcc=`which gcc`
 EOF
-check_job ${PRODUCT_DIR}/MAKE.LOG make VERBOSE=1
+check_job ${PRODUCT_DIR}/MAKE.LOG make
+# VERBOSE=1
 
 # make install
 check_job ${PRODUCT_DIR}/MAKEINSTALL.LOG make install
    
-# patch binaries
-local patch_vtkconfig=1
+# patch: modify config files properly
 if [ "${patch_vtkconfig}" = "1" ] ; then
     cp -f ${PRODUCT_BUILD_DIR}/VTK/VTKTargets.cmake ${PRODUCT_DIR}/lib/cmake/paraview-${PVLIBVERSION}
     sed -i "s%\(IMPORTED_LOCATION_RELEASE.*\"\).*/lib/\([^/]\+\"\)%\1${PRODUCT_DIR}/lib/paraview-${PVLIBVERSION}/\2%g" ${PRODUCT_DIR}/lib/cmake/paraview-${PVLIBVERSION}/VTKTargets.cmake
     sed -i "s%\(IMPORTED_LOCATION_RELEASE.*\"\).*/bin/\([^/]\+\"\)%\1${PRODUCT_DIR}/bin/\2%g" ${PRODUCT_DIR}/lib/cmake/paraview-${PVLIBVERSION}/VTKTargets.cmake
+    sed -i "s%\(IMPORTED_LOCATION_DEBUG.*\"\).*/lib/\([^/]\+\"\)%\1${PRODUCT_DIR}/lib/paraview-${PVLIBVERSION}/\2%g" ${PRODUCT_DIR}/lib/cmake/paraview-${PVLIBVERSION}/VTKTargets.cmake
+    sed -i "s%\(IMPORTED_LOCATION_DEBUG.*\"\).*/bin/\([^/]\+\"\)%\1${PRODUCT_DIR}/bin/\2%g" ${PRODUCT_DIR}/lib/cmake/paraview-${PVLIBVERSION}/VTKTargets.cmake
     sed -i "s%[^;\"]\+/qt-[0-9\.]\+/lib/\([^;]\+\)%${QT4_ROOT_DIR}/lib/\1%g" ${PRODUCT_DIR}/lib/cmake/paraview-${PVLIBVERSION}/VTKTargets.cmake
     sed -i "s%[^;\"]\+/Python-[0-9\.]\+/lib/\([^;]\+\)%${PYTHON_ROOT_DIR}/lib/\1%g" ${PRODUCT_DIR}/lib/cmake/paraview-${PVLIBVERSION}/VTKTargets.cmake
     sed -i "s%[^;\"]\+/hdf5-[0-9\.]\+/lib/\([^;]\+\)%${HDF5_ROOT_DIR}/lib/\1%g" ${PRODUCT_DIR}/lib/cmake/paraview-${PVLIBVERSION}/VTKTargets.cmake
     sed -i "s%[^;\"]\+/gl2ps-[0-9\.]\+/lib/\([^;]\+\)%${GL2PS_ROOT_DIR}/lib/\1%g" ${PRODUCT_DIR}/lib/cmake/paraview-${PVLIBVERSION}/VTKTargets.cmake
-    cp -f ${PRODUCT_SRC_DIR}/VTK/CMake/vtkTestingMacros.cmake ${PRODUCT_DIR}/lib/cmake/paraview-${PVLIBVERSION}
-    sed -i "s%include(\".*/vtkTestingMacros.cmake\")%include(\"\${VTK_INSTALL_PREFIX}/lib/cmake/paraview-${PVLIBVERSION}/vtkTestingMacros.cmake\")%g" ${PRODUCT_DIR}/lib/cmake/paraview-${PVLIBVERSION}/VTKConfig.cmake
 fi
 
-local patch_nvidia_deps=1
+# patch: fix wrong NVidia drivers dependencies
 if [ "${patch_nvidia_deps}" = "1" ] ; then
-    sed -i "s%/usr/lib/libXNVCtrl.a;%%g" ${PRODUCT_DIR}/lib/cmake/paraview-${PVLIBVERSION}/VTKTargets.cmake
-    sed -i "s%/usr/lib/libXNVCtrl.a;%%g" ${PRODUCT_DIR}/lib/cmake/paraview-${PVLIBVERSION}/ParaViewTargets-release.cmake
+    pvtargetsfile=ParaViewTargets-release.cmake
+    #pvtargetsfile=ParaViewTargets-debug.cmake
+
+    ( test -f ${PRODUCT_DIR}/lib/cmake/paraview-${PVLIBVERSION}/VTKTargets.cmake && sed -i "s%/usr/lib/libXNVCtrl.a;%%g" ${PRODUCT_DIR}/lib/cmake/paraview-${PVLIBVERSION}/VTKTargets.cmake || true )
+    ( test -f ${PRODUCT_DIR}/lib/cmake/paraview-${PVLIBVERSION}/${pvtargetsfile} && sed -i "s%/usr/lib/libXNVCtrl.a;%%g" ${PRODUCT_DIR}/lib/cmake/paraview-${PVLIBVERSION}/${pvtargetsfile} || true )
+    ( test -f ${PRODUCT_DIR}/lib/CMake/${pvtargetsfile}                          && sed -i "s%/usr/lib/libXNVCtrl.a;%%g" ${PRODUCT_DIR}/lib/CMake/${pvtargetsfile}                          || true )
 fi
 
 cd ${PRODUCT_DIR}
index 9904eda0e2f06dd4a421510f6656fa0a44bdfd94..1687a64b830a4f7d884ba89e598485c7cc1f5fab 100755 (executable)
@@ -682,6 +682,35 @@ fix_gl_libs(){
     fi
 }
 
+##
+# function: workaround on some platforms to use latest available version of gcc (e.g. gcc44 on CentOS 5.5)
+##
+use_latest_gcc(){
+    local gcc_min=$1
+    local gcc_ver=`gcc -dumpversion | awk -F. '{a1=0;a2=0;a3=0;if(NF>0)a1=$1;if(NF>1)a2=$2;if(NF>2)a3=$3;printf("%02d%02d%02d",a1,a2,a3);}'`
+    local gcc_found
+    local gxx_found
+    if [ ${gcc_ver} -le ${gcc_min} ] ; then
+       local wheregcc=$(dirname `which gcc`)
+       local all_gcc=$(find ${wheregcc}/gcc*)
+       local gcc_alt
+       local gcc_max=0
+       for gcc_alt in ${all_gcc} XXX ; do
+           if [ ${gcc_alt} = "XXX" ] ; then continue ; fi
+           gcc_ver=`${gcc_alt} -dumpversion 2>/dev/null | awk -F. '{a1=0;a2=0;a3=0;if(NF>0)a1=$1;if(NF>1)a2=$2;if(NF>2)a3=$3;printf("%02d%02d%02d",a1,a2,a3);}'`
+           if [ "${gcc_ver}" = "" ] ; then continue ; fi
+           if [ ${gcc_ver} -gt ${gcc_min} ] && [ ${gcc_ver} -gt ${gcc_max} ] ; then
+               gcc_max=${gcc_ver}
+               gcc_found=${gcc_alt}
+               gxx_found=`echo ${gcc_found} | sed -e "s%gcc%g++%"`
+           fi
+       done
+       if [ "${gcc_found}" != "" ] ; then
+           echo "CC=${gcc_found} CXX=${gxx_found}"
+       fi
+    fi
+}
+
 modif_la_files(){
 return 0
 # obsolete
index f90c8f98f571d1099373174318d6a4e688267ab2..bd97c2ededd26cd26ff72210d65586eed454ba03 100755 (executable)
@@ -71,16 +71,18 @@ source ${INSTALL_WORK}/${SHRC}
 check_jb tar xfz ${SOURCE_DIR}/${PRODUCT}.tar.gz -C ${INST_ROOT}
 
 # patch sources
+
 # [-] patch for build procedure
 local patch_build_procedure=1
+# [-] patch for gcc 4.7 compatibility
+local patch_gcc47_compat=1
+
 if [ "${patch_build_procedure}" = "1" ] ; then
     sed -i "s%DESTDIR ?= /%DESTDIR ?= /usr%g;s%INCDIR ?= \$(DESTDIR)/usr/include%INCDIR ?= \$(DESTDIR)/include%g;s%INSTALLDIR ?= \$(DESTDIR)/usr/lib%INSTALLDIR ?= \$(DESTDIR)/lib%g;s%-o root -g root %%g" ${PRODUCT_SRC_DIR}/Makefile.gnu
     sed -i "s%DESTDIR ?= /%DESTDIR ?= /usr%g;s%INCDIR ?= \$(DESTDIR)/usr/include%INCDIR ?= \$(DESTDIR)/include%g;s%INSTALLDIR ?= \$(DESTDIR)/usr/lib%INSTALLDIR ?= \$(DESTDIR)/lib%g;s%-o root -g root %%g" ${PRODUCT_SRC_DIR}/Makefile.fip
     sed -i "s%\(^[[:space:]]*\)\(install -m 755 \$(SHAREDLIB) \$(INSTALLDIR)\)%\1\2\n\1ln -sf \$(SHAREDLIB) \$(INSTALLDIR)/\$(VERLIBNAME)\n\1ln -sf \$(VERLIBNAME) \$(INSTALLDIR)/\$(LIBNAME)%g"            ${PRODUCT_SRC_DIR}/Makefile.fip
 fi
 
-# [-] patch for gcc 4.7 compatibility
-local patch_gcc47_compat=1
 if [ "${patch_gcc47_compat}" = "1" ] ; then
     sed -i 's%\(#include "OpenEXRConfig.h"\)%\1\n#include <string.h>%g' ${PRODUCT_SRC_DIR}/Source/OpenEXR/IlmImf/ImfAutoArray.h
 fi
@@ -105,11 +107,18 @@ cd ${PRODUCT_SRC_DIR}
 
 ## building FreeImage library
 
+# workaround for CentOS 5.5: FreeImage 3.16.0 is not compiled with gcc 4.2 and older :(
+local workaround_gcc42_pb=1
+gcc_found=""
+if [ "${workaround_gcc42_pb}" = "1" ] ; then
+    gcc_found="`use_latest_gcc 040200`"
+fi
+
 # compile
-check_job ${PRODUCT_DIR}/MAKE.LOG make -f Makefile.gnu
+check_job ${PRODUCT_DIR}/MAKE.LOG make ${gcc_found} -f Makefile.gnu
 
 # install
-check_job ${PRODUCT_DIR}/INSTALL.LOG make -f Makefile.gnu DESTDIR=${PRODUCT_DIR} install 
+check_job ${PRODUCT_DIR}/INSTALL.LOG make ${gcc_found} -f Makefile.gnu DESTDIR=${PRODUCT_DIR} install 
 
 # clean temporary files
 ###make -f Makefile.gnu clean 
@@ -117,10 +126,10 @@ check_job ${PRODUCT_DIR}/INSTALL.LOG make -f Makefile.gnu DESTDIR=${PRODUCT_DIR}
 ## building FreeImagePlus library
 
 # compile
-check_job ${PRODUCT_DIR}/MAKEPLUS.LOG make -f Makefile.fip 
+check_job ${PRODUCT_DIR}/MAKEPLUS.LOG make ${gcc_found} -f Makefile.fip 
 
 # install
-check_job ${PRODUCT_DIR}/INSTALLPLUS.LOG make -f Makefile.fip DESTDIR=${PRODUCT_DIR} install 
+check_job ${PRODUCT_DIR}/INSTALLPLUS.LOG make ${gcc_found} -f Makefile.fip DESTDIR=${PRODUCT_DIR} install 
 
 # clean temporary files
 ###make -f Makefile.fip clean 
index 056547573b245ecbf24ad9c6589e90e985422cc4..b7c68daab2446abd9bddbe9327e7f0abc2ab8f99 100755 (executable)
@@ -72,21 +72,18 @@ source ${INSTALL_WORK}/${SHRC}
 check_jb tar xfz ${SOURCE_DIR}/${PRODUCT}.tar.gz -C ${INST_ROOT}
 
 local patch_build_procedure=1
+
 if [ "${patch_build_procedure}" = "1" ] ; then
+    # 1. correct install path: for Qwt 5.x the variable is INSTALLBASE; for Qwt 6.x the variable is QWT_INSTALL_PREFIX
+    # 2. include QwtSvg support: required only for qwt 5.x
+    # 3. specify correct installation path for the designer plugin: required only for qwt 5.x
     # specify install path
     if [ "${QWT_MAJOR_VERSION}" = "5" ] ; then
-        # for Qwt 5.x the variable is INSTALLBASE
        sed -i "s%\(INSTALLBASE[[:space:]]*\)=\([[:space:]]*\).*%\1=\2${PRODUCT_DIR}%g" ${PRODUCT_SRC_DIR}/qwtconfig.pri
-    else
-        # for Qwt 6.x the variable is QWT_INSTALL_PREFIX
-       sed -i "s%\(QWT_INSTALL_PREFIX[[:space:]]*\)=\([[:space:]]*\).*%\1=\2${PRODUCT_DIR}%g" ${PRODUCT_SRC_DIR}/qwtconfig.pri
-    fi
-    
-    if [ "${QWT_MAJOR_VERSION}" = "5" ] ; then
-        # include QwtSvg support (required only for qwt 5.x)
        sed -i "s%#\(CONFIG[[:space:]]*+=[[:space:]]*QwtSVGItem\)%\1%g" ${PRODUCT_SRC_DIR}/qwtconfig.pri
-        # specify correct installation path for the designer plugin (required only for qwt 5.x)
        sed -i "s%\(target\.path[[:space:]]*\)=\([[:space:]]*\).*%\1=\2\$\$INSTALLBASE/plugins/designer%g" ${PRODUCT_SRC_DIR}/designer/designer.pro
+    else
+       sed -i "s%\(QWT_INSTALL_PREFIX[[:space:]]*\)=\([[:space:]]*\).*%\1=\2${PRODUCT_DIR}%g" ${PRODUCT_SRC_DIR}/qwtconfig.pri
     fi
 fi