From: maintenance team Date: Tue, 25 Sep 2007 10:13:57 +0000 (+0000) Subject: Adding VTK 4.4.2 to IP for Mandriva2007 X-Git-Tag: V_3_2_9~27 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=e7650365bb370e4f616462b399d8f5df52cb33f9;p=tools%2Finstall.git Adding VTK 4.4.2 to IP for Mandriva2007 --- diff --git a/config_files/VTK-4.4.2.sh b/config_files/VTK-4.4.2.sh new file mode 100755 index 0000000..8c7e669 --- /dev/null +++ b/config_files/VTK-4.4.2.sh @@ -0,0 +1,226 @@ +#!/bin/bash -noprofile + +#################################################################################### +# File : VTK-4.4.2.sh +# Created : Thu Dec 18 12:01:00 2002 +# Author : Vadim SANDLER, Open CASCADE SAS (vadim.sandler@opencascade.com) +# Project : SALOME +# Module : Installation Wizard +# Copyright : 2002-2007 CEA +# +# This script is the part of the SALOME installation procedure. +# +#################################################################################### + +check_version() +{ +if [ -z "$VTKHOME" ]; then + return 1 +fi +check_lib_version libvtkCommon.so ${VTKHOME}/lib/vtk +if [ "$?" -eq "0" ]; then + return 0 +fi +return 1 +} + +print_env() +{ +cat > ${INSTALL_WORK}/env_${PRODUCT_TYPE}.sh < ${INSTALL_WORK}/env_${PRODUCT_TYPE}.sh < configure +chmod 755 ./configure + +check_job ${PRODUCT_DIR}/CONFIGUREcmake.LOG ./configure +cat >> ${PRODUCT_DIR}/MAKEcmake.LOG <GetFile()->tellg()%seekg(static_cast(self->GetFile()->tellg())%g" IO/vtkBMPReader.cxx > IO/vtkBMPReader.cxx.orig +mv -f IO/vtkBMPReader.cxx.orig IO/vtkBMPReader.cxx +sed -e "s%seekg(self->GetFile()->tellg()%seekg(static_cast(self->GetFile()->tellg())%g" IO/vtkImageReader.cxx > IO/vtkImageReader.cxx.orig +mv -f IO/vtkImageReader.cxx.orig IO/vtkImageReader.cxx + +# get Python and tcl/tk version +python_version="`python -c 'import sys; print sys.version[:3]'`" +tcl_version="" +tcl_includes="" +tcl_libs="" +tcldir="`where_tcl`" +if [ $? -eq 0 ] && [ -e ${tcldir}/tclConfig.sh ] ; then + tcl_version=`grep -e "TCL_VERSION=.*" ${tcldir}/tclConfig.sh | sed -e "s%TCL_VERSION=[\'|\"]\(.*\)[\'|\"]%\1%g"` + tcl_includes=`grep -e "TCL_INCLUDE_SPEC=.*" ${tcldir}/tclConfig.sh | sed -e "s%TCL_INCLUDE_SPEC=[\'|\"]-I\(.*\)[\'|\"]%\1%g"` + if [ -z "$tcl_includes" ] ; then tcl_includes=/usr/include ; fi + tcl_libs=`grep -e "TCL_PACKAGE_PATH=.*" ${tcldir}/tclConfig.sh | sed -e "s%TCL_PACKAGE_PATH=[\'|\"]\(.*\)[\'|\"]%\1%g"` +fi + +VTK_CMAKE_OPTIONS="" +### common VTK settings +VTK_CMAKE_OPTIONS=$VTK_CMAKE_OPTIONS" -DBUILD_SHARED_LIBS:BOOL=ON" +VTK_CMAKE_OPTIONS=$VTK_CMAKE_OPTIONS" -DCMAKE_BUILD_TYPE:STRING=Release" +VTK_CMAKE_OPTIONS=$VTK_CMAKE_OPTIONS" -DCMAKE_CXX_COMPILER:STRING=`which g++`" +VTK_CMAKE_OPTIONS=$VTK_CMAKE_OPTIONS" -DCMAKE_C_COMPILER:STRING=`which gcc`" +VTK_CMAKE_OPTIONS=$VTK_CMAKE_OPTIONS" -DCMAKE_INSTALL_PREFIX:STRING=${PRODUCT_DIR}" +VTK_CMAKE_OPTIONS=$VTK_CMAKE_OPTIONS" -DVTK_USE_HYBRID:BOOL=ON" +VTK_CMAKE_OPTIONS=$VTK_CMAKE_OPTIONS" -DVTK_USE_PARALLEL:BOOL=ON" +VTK_CMAKE_OPTIONS=$VTK_CMAKE_OPTIONS" -DVTK_USE_PATENTED:BOOL=OFF" +VTK_CMAKE_OPTIONS=$VTK_CMAKE_OPTIONS" -DVTK_USE_RENDERING:BOOL=ON" + if test `uname -m` = "x86_64" ; then +VTK_CMAKE_OPTIONS=$VTK_CMAKE_OPTIONS" -DCMAKE_CXX_FLAGS:STRING=-m64" +VTK_CMAKE_OPTIONS=$VTK_CMAKE_OPTIONS" -DCMAKE_C_FLAGS:STRING=-m64" + fi + +### Wrap Python settings +if [ "${python_version}" != "" ]; then +VTK_CMAKE_OPTIONS=$VTK_CMAKE_OPTIONS" -DVTK_WRAP_PYTHON:BOOL=ON" +VTK_CMAKE_OPTIONS=$VTK_CMAKE_OPTIONS" -DPYTHON_EXECUTABLE:STRING=${PYTHONHOME}/bin/python${python_version}" +VTK_CMAKE_OPTIONS=$VTK_CMAKE_OPTIONS" -DPYTHON_INCLUDE_PATH:STRING=${PYTHONHOME}/include/python${python_version}" +VTK_CMAKE_OPTIONS=$VTK_CMAKE_OPTIONS" -DPYTHON_LIBRARY:STRING=${PYTHONHOME}/lib/python${python_version}/config/libpython${python_version}.a" +fi +### Wrap Tcl settings +if [ "${tcl_version}" != "" ] && [ "${tcl_includes}" != "" ] && [ "${tcl_libs}" != "" ] ; then +# suppose that tcl and tk are installed in the same dir +VTK_CMAKE_OPTIONS=$VTK_CMAKE_OPTIONS" -DVTK_WRAP_TCL:BOOL=ON" +VTK_CMAKE_OPTIONS=$VTK_CMAKE_OPTIONS" -DTCL_INCLUDE_PATH:STRING=${tcl_includes}" +VTK_CMAKE_OPTIONS=$VTK_CMAKE_OPTIONS" -DTCL_LIBRARY:STRING=${tcl_libs}/libtcl${tcl_version}.so" +VTK_CMAKE_OPTIONS=$VTK_CMAKE_OPTIONS" -DTCL_STUB_LIBRARY:STRING=${tcl_libs}/libtclstub${tcl_version}.a" +VTK_CMAKE_OPTIONS=$VTK_CMAKE_OPTIONS" -DTCL_TCLSH:STRING=${TCLHOME}/bin/tclsh${tcl_version}" +VTK_CMAKE_OPTIONS=$VTK_CMAKE_OPTIONS" -DTK_INCLUDE_PATH:STRING=${tcl_includes}" +VTK_CMAKE_OPTIONS=$VTK_CMAKE_OPTIONS" -DTK_LIBRARY:STRING=${tcl_libs}/libtk${tcl_version}.so" +VTK_CMAKE_OPTIONS=$VTK_CMAKE_OPTIONS" -DTK_STUB_LIBRARY:STRING=${tcl_libs}/libtkstub${tcl_version}.a" +VTK_CMAKE_OPTIONS=$VTK_CMAKE_OPTIONS" -DTK_WISH:STRING=${TCLHOME}/bin/wish${tcl_version}" +fi +### if Mesa is pre-installed +if [ -n "$MESA_HOME" ]; then + VTK_CMAKE_OPTIONS=$VTK_CMAKE_OPTIONS" -DOPENGL_INCLUDE_DIR:STRING=${MESA_HOME}/include" + if test `uname -m` = "x86_64" ; then + VTK_CMAKE_OPTIONS=$VTK_CMAKE_OPTIONS" -DOPENGL_gl_LIBRARY:STRING=${MESA_HOME}/lib64/libGL.so" + VTK_CMAKE_OPTIONS=$VTK_CMAKE_OPTIONS" -DOPENGL_glu_LIBRARY:STRING=${MESA_HOME}/lib64/libGLU.so" + else + VTK_CMAKE_OPTIONS=$VTK_CMAKE_OPTIONS" -DOPENGL_gl_LIBRARY:STRING=${MESA_HOME}/lib/libGL.so" + VTK_CMAKE_OPTIONS=$VTK_CMAKE_OPTIONS" -DOPENGL_glu_LIBRARY:STRING=${MESA_HOME}/lib/libGLU.so" + fi + VTK_CMAKE_OPTIONS=$VTK_CMAKE_OPTIONS" -DOPENGL_xmesa_INCLUDE_DIR:STRING=${MESA_HOME}/include" +fi + +cat > ${PRODUCT_DIR}/CONFIGURE.LOG < ${PRODUCT_DIR}/MAKE.LOG < ${PRODUCT_DIR}/size.log +#du -sk ${INSTALL_WORK}/cmake-1.6.6 >> ${PRODUCT_DIR}/size.log +cd ${PRODUCT_DIR}; rm -fr ${PRODUCT_WORK} ${INSTALL_WORK}/cmake-1.6.6 + +print_env +} + +install_binary() +{ +make_env ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" ${PRODUCT_TYPE} +source ${INSTALL_WORK}/$SHRC + +if [ -n "$MESA_HOME" ]; then + check_jb tar xfz ${SOURCE_DIR}/VTK-4.4.2-with-Mesa.tar.gz -C ${INSTALL_ROOT} +else + check_jb tar xfz ${SOURCE_DIR}/VTK-4.4.2.tar.gz -C ${INSTALL_ROOT} +fi + +print_env +} + +export PROCEDURE=$1; +export INSTALL_WORK=$2; +export SOURCE_DIR=$3; +export INSTALL_ROOT=$4; +export PRODUCT_SEQUENCE=$5; +if [ $# == 6 ] ; then export PRODUCT_TYPE=$6 ; else export PRODUCT_TYPE="vtk" ; fi +export PRODUCT="VTK-4.4.2" +export PRODUCT_DIR=${INSTALL_ROOT}/${PRODUCT} +export PRODUCT_WORK=${INSTALL_WORK}/${PRODUCT} +source ./common.sh +$PROCEDURE