3 ####################################################################################
5 # Created : Thu Dec 18 12:01:00 2002
6 # Author : Vadim SANDLER, Open CASCADE SAS (vadim.sandler@opencascade.com)
8 # Module : Installation Wizard
9 # Copyright : 2002-2007 CEA
11 # This script is the part of the SALOME installation procedure.
13 ####################################################################################
17 if [ -z "$VTKHOME" ]; then
20 check_lib_version libvtkCommon.so ${VTKHOME}/lib/vtk
21 if [ "$?" -eq "0" ]; then
29 cat > ${INSTALL_WORK}/env_${PRODUCT_TYPE}.sh <<EOF
30 #$DELIM ${PRODUCT_TYPE} $DELIM
31 export VTKHOME=\${INSTALL_ROOT}/${PRODUCT}
32 export PATH=\${VTKHOME}/bin:\${PATH}
33 export LD_LIBRARY_PATH=\${VTKHOME}/lib/vtk:\${LD_LIBRARY_PATH}
34 export PYTHONPATH=\${VTKHOME}/lib/vtk:\${VTKHOME}/lib/python\${PYTHON_VERSION}/site-packages/vtk_python:\${PYTHONPATH}
35 export TCLLIBPATH="\${VTKHOME}/lib/vtk/tcl \${TCLLIBPATH}"
38 (test -w ${PRODUCT_DIR} && cp ${INSTALL_WORK}/env_${PRODUCT_TYPE}.sh ${PRODUCT_DIR})
39 make_env ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" "${INSTALL_PRODUCTS}"
44 cat > ${INSTALL_WORK}/env_${PRODUCT_TYPE}_src.sh <<EOF
45 #$DELIM ${PRODUCT_TYPE}_src $DELIM
49 (test -w ${PRODUCT_DIR}_SRC && cp ${INSTALL_WORK}/env_${PRODUCT_TYPE}_src.sh ${PRODUCT_DIR}_SRC)
50 make_env ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" "${INSTALL_PRODUCTS}"
54 try_existing ${PRODUCT_DIR} ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" "${INSTALL_PRODUCTS}" ${PRODUCT_TYPE}
55 try_existing ${PRODUCT_DIR}_SRC ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" "${INSTALL_PRODUCTS}" ${PRODUCT_TYPE}_src
61 make_env ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" "${INSTALL_PRODUCTS}" ${PRODUCT_TYPE}_src
62 source ${INSTALL_WORK}/$SHRC
64 makedir ${PRODUCT_DIR}_SRC
66 check_jb tar xfz ${SOURCE_DIR}/cmake-1.6.6.tar.gz -C ${PRODUCT_DIR}_SRC
67 check_jb tar xfz ${SOURCE_DIR}/${PRODUCT}.tar.gz -C ${PRODUCT_DIR}_SRC
69 # to generate environment scripts
73 install_source_and_build()
79 makedir ${PRODUCT_DIR}
80 cd ${PRODUCT_DIR}_SRC/cmake-1.6.6_SRC
81 check_job ${PRODUCT_DIR}/CONFIGUREcmake.LOG ./configure
82 cat >> ${PRODUCT_DIR}/MAKEcmake.LOG <<EOF
85 check_job ${PRODUCT_DIR}/MAKEcmake.LOG make
87 cd ${PRODUCT_DIR}_SRC/${PRODUCT}_SRC
89 # get Python and tcl/tk version
90 python_version="`python -c 'import sys; print sys.version[:3]'`"
93 if [ $? -eq 0 ] && [ -e ${tcldir}/tclConfig.sh ] ; then
94 tcl_version=`grep -e "TCL_VERSION=.*" ${tcldir}/tclConfig.sh | sed -e "s%TCL_VERSION=[\'|\"]\(.*\)[\'|\"]%\1%g"`
98 ### common VTK settings
99 VTK_CMAKE_OPTIONS=$VTK_CMAKE_OPTIONS" -DBUILD_SHARED_LIBS:BOOL=ON"
100 VTK_CMAKE_OPTIONS=$VTK_CMAKE_OPTIONS" -DCMAKE_BUILD_TYPE:STRING=Release"
101 VTK_CMAKE_OPTIONS=$VTK_CMAKE_OPTIONS" -DCMAKE_CXX_COMPILER:STRING=`which g++`"
102 VTK_CMAKE_OPTIONS=$VTK_CMAKE_OPTIONS" -DCMAKE_C_COMPILER:STRING=`which gcc`"
103 VTK_CMAKE_OPTIONS=$VTK_CMAKE_OPTIONS" -DCMAKE_INSTALL_PREFIX:STRING=${PRODUCT_DIR}"
104 VTK_CMAKE_OPTIONS=$VTK_CMAKE_OPTIONS" -DVTK_USE_HYBRID:BOOL=ON"
105 VTK_CMAKE_OPTIONS=$VTK_CMAKE_OPTIONS" -DVTK_USE_PARALLEL:BOOL=ON"
106 VTK_CMAKE_OPTIONS=$VTK_CMAKE_OPTIONS" -DVTK_USE_PATENTED:BOOL=OFF"
107 VTK_CMAKE_OPTIONS=$VTK_CMAKE_OPTIONS" -DVTK_USE_RENDERING:BOOL=ON"
108 ### Wrap Python settings
109 if [ "${python_version}" != "" ]; then
110 VTK_CMAKE_OPTIONS=$VTK_CMAKE_OPTIONS" -DVTK_WRAP_PYTHON:BOOL=ON"
111 VTK_CMAKE_OPTIONS=$VTK_CMAKE_OPTIONS" -DPYTHON_EXECUTABLE:STRING=${PYTHONHOME}/bin/python${python_version}"
112 VTK_CMAKE_OPTIONS=$VTK_CMAKE_OPTIONS" -DPYTHON_INCLUDE_PATH:STRING=${PYTHONHOME}/include/python${python_version}"
113 VTK_CMAKE_OPTIONS=$VTK_CMAKE_OPTIONS" -DPYTHON_LIBRARY:STRING=${PYTHONHOME}/lib/python${python_version}/config/libpython${python_version}.a"
115 ### Wrap Tcl settings
116 if [ "${tcl_version}" != "" ]; then
117 VTK_CMAKE_OPTIONS=$VTK_CMAKE_OPTIONS" -DVTK_WRAP_TCL:BOOL=ON"
118 VTK_CMAKE_OPTIONS=$VTK_CMAKE_OPTIONS" -DTCL_INCLUDE_PATH:STRING=${TCLHOME}/include"
119 VTK_CMAKE_OPTIONS=$VTK_CMAKE_OPTIONS" -DTCL_LIBRARY:STRING=${TCLHOME}/lib/libtcl${tcl_version}.so"
120 VTK_CMAKE_OPTIONS=$VTK_CMAKE_OPTIONS" -DTCL_STUB_LIBRARY:STRING=${TCLHOME}/lib/libtclstub${tcl_version}.a"
121 VTK_CMAKE_OPTIONS=$VTK_CMAKE_OPTIONS" -DTCL_TCLSH:STRING=${TCLHOME}/bin/tclsh"
122 VTK_CMAKE_OPTIONS=$VTK_CMAKE_OPTIONS" -DTK_INCLUDE_PATH:STRING=${TCLHOME}/include"
123 VTK_CMAKE_OPTIONS=$VTK_CMAKE_OPTIONS" -DTK_LIBRARY:STRING=${TCLHOME}/lib/libtk${tcl_version}.so"
124 VTK_CMAKE_OPTIONS=$VTK_CMAKE_OPTIONS" -DTK_STUB_LIBRARY:STRING=${TCLHOME}/lib/libtkstub${tcl_version}.a"
125 VTK_CMAKE_OPTIONS=$VTK_CMAKE_OPTIONS" -DTK_WISH:STRING=${TCLHOME}/bin/wish"
127 ### if Mesa is pre-installed
128 if [ -n "$MESA_HOME" ]; then
129 VTK_CMAKE_OPTIONS=$VTK_CMAKE_OPTIONS" -DOPENGL_INCLUDE_DIR:STRING=${MESA_HOME}/include"
130 VTK_CMAKE_OPTIONS=$VTK_CMAKE_OPTIONS" -DOPENGL_gl_LIBRARY:STRING=${MESA_HOME}/lib/libGL.so"
131 VTK_CMAKE_OPTIONS=$VTK_CMAKE_OPTIONS" -DOPENGL_glu_LIBRARY:STRING=${MESA_HOME}/lib/libGLU.so"
132 VTK_CMAKE_OPTIONS=$VTK_CMAKE_OPTIONS" -DOPENGL_xmesa_INCLUDE_DIR:STRING=${MESA_HOME}/include"
135 cat > ${PRODUCT_DIR}/CONFIGURE.LOG <<EOF
139 check_job ${PRODUCT_DIR}/CONFIGURE.LOG ${PRODUCT_DIR}_SRC/cmake-1.6.6_SRC/Source/cmake . $VTK_CMAKE_OPTIONS
141 cat > ${PRODUCT_DIR}/MAKE.LOG <<EOF
144 check_job ${PRODUCT_DIR}/MAKE.LOG make
146 check_job ${PRODUCT_DIR}/MAKEINSTALL.LOG make install
148 cd ${PRODUCT_DIR}_SRC/${PRODUCT}_SRC/Wrapping/Python
149 check_job ${PRODUCT_DIR}/SETUPPYTHON.LOG python setup.py install --prefix=${PRODUCT_DIR}
151 #du -sk ${PRODUCT_DIR}_SRC > ${PRODUCT_DIR}/size.log
154 # set correct symbolic links - bug of python wrappings installation
155 cd ${PRODUCT_DIR}/lib/python${python_version}/site-packages/vtk_python
156 ln -sf ../../../vtk/*Python*.so .
158 # remove sources and temporary files after building
159 if [ ${REMOVE_SRC_TMP} == "TRUE" ] ; then
160 test -d ${PRODUCT_DIR}_SRC && rm -fr ${PRODUCT_DIR}_SRC
163 # to generate environment scripts
169 make_env ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" "${INSTALL_PRODUCTS}" ${PRODUCT_TYPE}
170 source ${INSTALL_WORK}/$SHRC
172 check_jb tar xfz ${SOURCE_DIR}/${PRODUCT}.tar.gz -C ${INSTALL_ROOT}
174 # to generate environment script for sources
179 export INSTALL_WORK=$2;
180 export SOURCE_DIR=$3;
181 export INSTALL_ROOT=$4;
182 export PRODUCT_SEQUENCE=$5;
183 export PRODUCT_TYPE=$6;
184 export INSTALL_PRODUCTS=$7;
187 export PRODUCT="VTK-4.2.2"
188 export PRODUCT_DIR=${INSTALL_ROOT}/${PRODUCT}
189 export PRODUCT_WORK=${INSTALL_WORK}/${PRODUCT}