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-LatestRelease.tar.gz -C ${INSTALL_WORK}
79 # get Python and tcl/tk version
80 python_version="`python -c 'import sys; print sys.version[:3]'`"
83 if [ $? -eq 0 ] && [ -e ${tcldir}/tclConfig.sh ] ; then
84 tcl_version=`grep -e "TCL_VERSION=.*" ${tcldir}/tclConfig.sh | sed -e "s%TCL_VERSION=[\'|\"]\(.*\)[\'|\"]%\1%g"`
88 ### common VTK settings
89 VTK_CMAKE_OPTIONS=$VTK_CMAKE_OPTIONS" -DBUILD_SHARED_LIBS:BOOL=ON"
90 VTK_CMAKE_OPTIONS=$VTK_CMAKE_OPTIONS" -DCMAKE_BUILD_TYPE:STRING=Release"
91 VTK_CMAKE_OPTIONS=$VTK_CMAKE_OPTIONS" -DCMAKE_CXX_COMPILER:STRING=`which g++`"
92 VTK_CMAKE_OPTIONS=$VTK_CMAKE_OPTIONS" -DCMAKE_C_COMPILER:STRING=`which gcc`"
93 VTK_CMAKE_OPTIONS=$VTK_CMAKE_OPTIONS" -DCMAKE_INSTALL_PREFIX:STRING=${PRODUCT_DIR}"
94 VTK_CMAKE_OPTIONS=$VTK_CMAKE_OPTIONS" -DVTK_USE_HYBRID:BOOL=ON"
95 VTK_CMAKE_OPTIONS=$VTK_CMAKE_OPTIONS" -DVTK_USE_PARALLEL:BOOL=ON"
96 VTK_CMAKE_OPTIONS=$VTK_CMAKE_OPTIONS" -DVTK_USE_PATENTED:BOOL=OFF"
97 VTK_CMAKE_OPTIONS=$VTK_CMAKE_OPTIONS" -DVTK_USE_RENDERING:BOOL=ON"
98 ### Wrap Python settings
99 if [ "${python_version}" != "" ]; then
100 VTK_CMAKE_OPTIONS=$VTK_CMAKE_OPTIONS" -DVTK_WRAP_PYTHON:BOOL=ON"
101 VTK_CMAKE_OPTIONS=$VTK_CMAKE_OPTIONS" -DPYTHON_EXECUTABLE:STRING=${PYTHONHOME}/bin/python${python_version}"
102 VTK_CMAKE_OPTIONS=$VTK_CMAKE_OPTIONS" -DPYTHON_INCLUDE_PATH:STRING=${PYTHONHOME}/include/python${python_version}"
103 VTK_CMAKE_OPTIONS=$VTK_CMAKE_OPTIONS" -DPYTHON_LIBRARY:STRING=${PYTHONHOME}/lib/python${python_version}/config/libpython${python_version}.a"
105 ### Wrap Tcl settings
106 if [ "${tcl_version}" != "" ]; then
107 VTK_CMAKE_OPTIONS=$VTK_CMAKE_OPTIONS" -DVTK_WRAP_TCL:BOOL=ON"
108 VTK_CMAKE_OPTIONS=$VTK_CMAKE_OPTIONS" -DTCL_INCLUDE_PATH:STRING=${TCLHOME}/include"
109 VTK_CMAKE_OPTIONS=$VTK_CMAKE_OPTIONS" -DTCL_LIBRARY:STRING=${TCLHOME}/lib/libtcl${tcl_version}.so"
110 VTK_CMAKE_OPTIONS=$VTK_CMAKE_OPTIONS" -DTCL_STUB_LIBRARY:STRING=${TCLHOME}/lib/libtclstub${tcl_version}.a"
111 VTK_CMAKE_OPTIONS=$VTK_CMAKE_OPTIONS" -DTCL_TCLSH:STRING=${TCLHOME}/bin/tclsh"
112 VTK_CMAKE_OPTIONS=$VTK_CMAKE_OPTIONS" -DTK_INCLUDE_PATH:STRING=${TCLHOME}/include"
113 VTK_CMAKE_OPTIONS=$VTK_CMAKE_OPTIONS" -DTK_LIBRARY:STRING=${TCLHOME}/lib/libtk${tcl_version}.so"
114 VTK_CMAKE_OPTIONS=$VTK_CMAKE_OPTIONS" -DTK_STUB_LIBRARY:STRING=${TCLHOME}/lib/libtkstub${tcl_version}.a"
115 VTK_CMAKE_OPTIONS=$VTK_CMAKE_OPTIONS" -DTK_WISH:STRING=${TCLHOME}/bin/wish"
117 ### if Mesa is pre-installed
118 if [ -n "$MESA_HOME" ]; then
119 VTK_CMAKE_OPTIONS=$VTK_CMAKE_OPTIONS" -DOPENGL_INCLUDE_DIR:STRING=${MESA_HOME}/include"
120 VTK_CMAKE_OPTIONS=$VTK_CMAKE_OPTIONS" -DOPENGL_gl_LIBRARY:STRING=${MESA_HOME}/lib/libGL.so"
121 VTK_CMAKE_OPTIONS=$VTK_CMAKE_OPTIONS" -DOPENGL_glu_LIBRARY:STRING=${MESA_HOME}/lib/libGLU.so"
122 VTK_CMAKE_OPTIONS=$VTK_CMAKE_OPTIONS" -DOPENGL_xmesa_INCLUDE_DIR:STRING=${MESA_HOME}/include"
125 cat > ${PRODUCT_DIR}/CONFIGURE.LOG <<EOF
129 check_job ${PRODUCT_DIR}/CONFIGURE.LOG ${INSTALL_WORK}/cmake-1.6.6/Source/cmake . $VTK_CMAKE_OPTIONS
131 cat > ${PRODUCT_DIR}/MAKE.LOG <<EOF
134 check_job ${PRODUCT_DIR}/MAKE.LOG make
136 check_job ${PRODUCT_DIR}/MAKEINSTALL.LOG make install
138 cd ${PRODUCT_WORK}/Wrapping/Python
139 check_job ${PRODUCT_DIR}/SETUPPYTHON.LOG python setup.py install --prefix=${PRODUCT_DIR}
141 #du -sk ${PRODUCT_WORK} > ${PRODUCT_DIR}/size.log
142 #du -sk ${INSTALL_WORK}/cmake-1.6.6 >> ${PRODUCT_DIR}/size.log
143 cd ${PRODUCT_DIR}; rm -fr ${PRODUCT_WORK} ${INSTALL_WORK}/cmake-1.6.6
145 # set correct symbolic links - bug of python wrappings installation
146 cd ${PRODUCT_DIR}/lib/python${python_version}/site-packages/vtk_python
147 ln -sf ../../../vtk/*Python*.so .
154 make_env ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" ${PRODUCT_TYPE}
155 source ${INSTALL_WORK}/$SHRC
157 check_jb tar xfz ${SOURCE_DIR}/VTK-4.2.2.tar.gz -C ${INSTALL_ROOT}
163 export INSTALL_WORK=$2;
164 export SOURCE_DIR=$3;
165 export INSTALL_ROOT=$4;
166 export PRODUCT_SEQUENCE=$5;
167 if [ $# == 6 ] ; then export PRODUCT_TYPE=$6 ; else export PRODUCT_TYPE="vtk" ; fi
168 export PRODUCT="VTK-4.2.2"
169 export PRODUCT_DIR=${INSTALL_ROOT}/${PRODUCT}
170 export PRODUCT_WORK=${INSTALL_WORK}/${PRODUCT}