5 if [ -z "$VTKHOME" ]; then
8 check_lib_version libvtkCommon.so ${VTKHOME}/lib/vtk
9 if [ "$?" -eq "0" ]; then
17 cat > ${INSTALL_WORK}/env_${PRODUCT_TYPE}.sh <<EOF
18 #$DELIM ${PRODUCT_TYPE} $DELIM
19 export VTKHOME=\${INSTALL_ROOT}/${PRODUCT}
20 export PATH=\${VTKHOME}/bin:\${PATH}
21 export LD_LIBRARY_PATH=\${VTKHOME}/lib/vtk:\${LD_LIBRARY_PATH}
22 export PYTHONPATH=\${VTKHOME}/lib/vtk:\${VTKHOME}/lib/python\${PYTHON_VERSION}/site-packages/vtk_python:\${PYTHONPATH}
23 export TCLLIBPATH="\${VTKHOME}/lib/vtk/tcl \${TCLLIBPATH}"
26 (test -w ${PRODUCT_DIR} && cp ${INSTALL_WORK}/env_${PRODUCT_TYPE}.sh ${PRODUCT_DIR})
27 make_env ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}"
30 # looks for the native product and collects it's environment (used by make_env())
33 if [ $? -eq 0 ] ; then
34 python_version="`python -c 'import sys; print sys.version[:3]'`"
35 tmp="\${VTKHOME}/bin ${VTKHOME}/bin \${PATH} ${PATH}";
36 path=`sort_path ${tmp}`
37 tmp="\${VTKHOME}/lib/vtk ${VTKHOME}/lib/vtk \${LD_LIBRARY_PATH} ${LD_LIBRARY_PATH}";
38 ld_library_path=`sort_path ${tmp}`
39 tmp="\${VTKHOME}/lib/vtk:\${VTKHOME}/lib/python${PYTHON_VERSION}/site-packages/vtk_python ${VTKHOME}/lib/vtk:${VTKHOME}/lib/python${python_version}/site-packages/vtk_python \${PYTHONPATH} ${PYTHONPATH}";
40 python_path=`sort_path ${tmp}`
41 cat > ${INSTALL_WORK}/env_${PRODUCT_TYPE}.sh <<EOF
42 #$DELIM ${PRODUCT_TYPE} $DELIM
43 export VTKHOME=${VTKHOME}
45 export LD_LIBRARY_PATH=${ld_library_path}
46 export PYTHONPATH=${python_path}
47 export TCLLIBPATH="\${VTKHOME}/lib/vtk/tcl \${TCLLIBPATH}"
50 make_env ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}"
57 try_existing ${PRODUCT_DIR} ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" ${PRODUCT_TYPE}
63 make_env ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" ${PRODUCT_TYPE}
64 source ${INSTALL_WORK}/$SHRC
66 makedir ${PRODUCT_DIR}
68 check_jb tar xfz ${SOURCE_DIR}/cmake-1.6.6.tar.gz -C ${INSTALL_WORK}
69 cd ${INSTALL_WORK}/cmake-1.6.6
70 check_job ${PRODUCT_DIR}/CONFIGUREcmake.LOG ./configure
71 cat >> ${PRODUCT_DIR}/MAKEcmake.LOG <<EOF
74 check_job ${PRODUCT_DIR}/MAKEcmake.LOG make
76 check_jb tar xfz ${SOURCE_DIR}/VTK-4.2.6.tar.gz -C ${INSTALL_WORK}
79 # apply a small patch for VTK (needed for gcc-3.4)
80 sed -e "s%seekg(self->GetFile()->tellg()%seekg(static_cast<long>(self->GetFile()->tellg())%g" IO/vtkBMPReader.cxx > IO/vtkBMPReader.cxx.orig
81 mv -f IO/vtkBMPReader.cxx.orig IO/vtkBMPReader.cxx
82 sed -e "s%seekg(self->GetFile()->tellg()%seekg(static_cast<long>(self->GetFile()->tellg())%g" IO/vtkImageReader.cxx > IO/vtkImageReader.cxx.orig
83 mv -f IO/vtkImageReader.cxx.orig IO/vtkImageReader.cxx
85 # get Python and tcl/tk version
86 python_version="`python -c 'import sys; print sys.version[:3]'`"
87 tcl_version="`find ${TCLHOME}/lib -name 'libtcl*.so' | awk '/libtcl[0-9.]+.so/ { print $0}' | sed -e 's%^.*libtcl\([0-9\.]*\)\.so%\1%'`"
90 ### common VTK settings
91 VTK_CMAKE_OPTIONS=$VTK_CMAKE_OPTIONS" -DBUILD_SHARED_LIBS:BOOL=ON"
92 VTK_CMAKE_OPTIONS=$VTK_CMAKE_OPTIONS" -DCMAKE_BUILD_TYPE:STRING=Release"
93 VTK_CMAKE_OPTIONS=$VTK_CMAKE_OPTIONS" -DCMAKE_CXX_COMPILER:STRING=`which g++`"
94 VTK_CMAKE_OPTIONS=$VTK_CMAKE_OPTIONS" -DCMAKE_C_COMPILER:STRING=`which gcc`"
95 VTK_CMAKE_OPTIONS=$VTK_CMAKE_OPTIONS" -DCMAKE_INSTALL_PREFIX:STRING=${PRODUCT_DIR}"
96 VTK_CMAKE_OPTIONS=$VTK_CMAKE_OPTIONS" -DVTK_USE_HYBRID:BOOL=ON"
97 VTK_CMAKE_OPTIONS=$VTK_CMAKE_OPTIONS" -DVTK_USE_PARALLEL:BOOL=ON"
98 VTK_CMAKE_OPTIONS=$VTK_CMAKE_OPTIONS" -DVTK_USE_PATENTED:BOOL=OFF"
99 VTK_CMAKE_OPTIONS=$VTK_CMAKE_OPTIONS" -DVTK_USE_RENDERING:BOOL=ON"
100 ### Wrap Python settings
101 VTK_CMAKE_OPTIONS=$VTK_CMAKE_OPTIONS" -DVTK_WRAP_PYTHON:BOOL=ON"
102 VTK_CMAKE_OPTIONS=$VTK_CMAKE_OPTIONS" -DPYTHON_EXECUTABLE:STRING=${PYTHONHOME}/bin/python${python_version}"
103 VTK_CMAKE_OPTIONS=$VTK_CMAKE_OPTIONS" -DPYTHON_INCLUDE_PATH:STRING=${PYTHONHOME}/include/python${python_version}"
104 VTK_CMAKE_OPTIONS=$VTK_CMAKE_OPTIONS" -DPYTHON_LIBRARY:STRING=${PYTHONHOME}/lib/python${python_version}/config/libpython${python_version}.a"
105 ### Wrap Tcl settings
106 VTK_CMAKE_OPTIONS=$VTK_CMAKE_OPTIONS" -DVTK_WRAP_TCL:BOOL=ON"
107 VTK_CMAKE_OPTIONS=$VTK_CMAKE_OPTIONS" -DTCL_INCLUDE_PATH:STRING=${TCLHOME}/include"
108 VTK_CMAKE_OPTIONS=$VTK_CMAKE_OPTIONS" -DTCL_LIBRARY:STRING=${TCLHOME}/lib/libtcl${tcl_version}.so"
109 VTK_CMAKE_OPTIONS=$VTK_CMAKE_OPTIONS" -DTCL_STUB_LIBRARY:STRING=${TCLHOME}/lib/libtclstub${tcl_version}.a"
110 VTK_CMAKE_OPTIONS=$VTK_CMAKE_OPTIONS" -DTCL_TCLSH:STRING=${TCLHOME}/bin/tclsh"
111 VTK_CMAKE_OPTIONS=$VTK_CMAKE_OPTIONS" -DTK_INCLUDE_PATH:STRING=${TCLHOME}/include"
112 VTK_CMAKE_OPTIONS=$VTK_CMAKE_OPTIONS" -DTK_LIBRARY:STRING=${TCLHOME}/lib/libtk${tcl_version}.so"
113 VTK_CMAKE_OPTIONS=$VTK_CMAKE_OPTIONS" -DTK_STUB_LIBRARY:STRING=${TCLHOME}/lib/libtkstub${tcl_version}.a"
114 VTK_CMAKE_OPTIONS=$VTK_CMAKE_OPTIONS" -DTK_WISH:STRING=${TCLHOME}/bin/wish"
115 ### if Mesa is pre-installed
116 if [ -n "$MESA_HOME" ]; then
117 VTK_CMAKE_OPTIONS=$VTK_CMAKE_OPTIONS" -DOPENGL_INCLUDE_DIR:STRING=${MESA_HOME}/include"
118 VTK_CMAKE_OPTIONS=$VTK_CMAKE_OPTIONS" -DOPENGL_gl_LIBRARY:STRING=${MESA_HOME}/lib/libGL.so"
119 VTK_CMAKE_OPTIONS=$VTK_CMAKE_OPTIONS" -DOPENGL_glu_LIBRARY:STRING=${MESA_HOME}/lib/libGLU.so"
120 VTK_CMAKE_OPTIONS=$VTK_CMAKE_OPTIONS" -DOPENGL_xmesa_INCLUDE_DIR:STRING=${MESA_HOME}/include"
123 cat > ${PRODUCT_DIR}/CONFIGURE.LOG <<EOF
127 check_job ${PRODUCT_DIR}/CONFIGURE.LOG ${INSTALL_WORK}/cmake-1.6.6/Source/cmake . $VTK_CMAKE_OPTIONS
129 cat > ${PRODUCT_DIR}/MAKE.LOG <<EOF
132 check_job ${PRODUCT_DIR}/MAKE.LOG make
134 check_job ${PRODUCT_DIR}/INSTALL.LOG make install
136 cd ${PRODUCT_WORK}/Wrapping/Python
137 check_job ${PRODUCT_DIR}/SETUPPYTHON.LOG python setup.py install --prefix=${PRODUCT_DIR}
139 rm -fr ${PRODUCT_WORK} ${INSTALL_WORK}/cmake-1.6.6
141 # set correct symbolic links - bug of python wrappings installation
142 cd ${PRODUCT_DIR}/lib/python${python_version}/site-packages/vtk_python
143 ln -sf ../../../vtk/*Python*.so .
145 #du -sk ${PRODUCT_WORK} > ${PRODUCT_DIR}/size.log
146 rm -fr ${PRODUCT_WORK}
152 make_env ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" ${PRODUCT_TYPE}
153 source ${INSTALL_WORK}/$SHRC
155 if [ -n "$MESA_HOME" ]; then
156 check_jb tar xfz ${SOURCE_DIR}/VTK-4.2.6-with-Mesa.tar.gz -C ${INSTALL_ROOT}
158 check_jb tar xfz ${SOURCE_DIR}/VTK-4.2.6.tar.gz -C ${INSTALL_ROOT}
165 export INSTALL_WORK=$2;
166 export SOURCE_DIR=$3;
167 export INSTALL_ROOT=$4;
168 export PRODUCT_SEQUENCE=$5;
169 if [ $# == 6 ] ; then export PRODUCT_TYPE=$6 ; else export PRODUCT_TYPE="vtk" ; fi
170 export PRODUCT="VTK-4.2.6"
171 export PRODUCT_DIR=${INSTALL_ROOT}/${PRODUCT}
172 export PRODUCT_WORK=${INSTALL_WORK}/${PRODUCT}