]> SALOME platform Git repositories - tools/install.git/commitdiff
Salome HOME
Initial version
authoradmin <salome-admin@opencascade.com>
Fri, 19 Sep 2003 05:55:15 +0000 (05:55 +0000)
committeradmin <salome-admin@opencascade.com>
Fri, 19 Sep 2003 05:55:15 +0000 (05:55 +0000)
config_files/VTK-4.2.2.sh [new file with mode: 0755]

diff --git a/config_files/VTK-4.2.2.sh b/config_files/VTK-4.2.2.sh
new file mode 100755 (executable)
index 0000000..d2552fc
--- /dev/null
@@ -0,0 +1,139 @@
+#!/bin/sh
+
+check_version()
+{
+if [ -z "$VTKHOME" ]; then
+   #echo "VTKHOME doesn't set"
+   return 1 
+fi
+check_lib_version libvtkCommon.so ${VTKHOME}/lib/vtk
+if [ "$?" -eq "0" ]; then
+   #echo "The product ${PRODUCT} has been already installed on yours system"
+   return 0
+fi
+return 1
+}
+
+print_env()
+{
+cat > ${INSTALL_WORK}/env_${PRODUCT_TYPE}.sh <<EOF 
+#$DELIM ${PRODUCT_TYPE} $DELIM
+export VTKHOME=\${INSTALL_ROOT}/${PRODUCT}
+export PATH=\${VTKHOME}/bin:\${PATH}
+export LD_LIBRARY_PATH=\${VTKHOME}/lib/vtk:\${LD_LIBRARY_PATH}
+##
+EOF
+(test -w ${PRODUCT_DIR} && cp ${INSTALL_WORK}/env_${PRODUCT_TYPE}.sh ${PRODUCT_DIR})
+make_env ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}"
+}
+
+# looks for the native product and collects it's environment (used by make_env())
+try_native(){
+check_version
+if [ $? -eq 0 ] ; then
+    tmp="\${VTKHOME}/bin ${VTKHOME}/bin \${PATH} ${PATH}";  
+    path=`sort_path ${tmp}`
+    tmp="\${VTKHOME}/lib/vtk ${VTKHOME}/lib/vtk \${LD_LIBRARY_PATH} ${LD_LIBRARY_PATH}";  
+    ld_library_path=`sort_path ${tmp}`
+    cat > ${INSTALL_WORK}/env_${PRODUCT_TYPE}.sh <<EOF 
+#$DELIM ${PRODUCT_TYPE} $DELIM
+export VTKHOME=${VTKHOME}
+export PATH=${path}
+export LD_LIBRARY_PATH=${ld_library_path}
+##
+EOF
+    make_env ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}"
+    return 0
+fi
+return 1;
+}
+
+try_preinstalled(){
+try_existing ${PRODUCT_DIR} ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" ${PRODUCT_TYPE}
+return $?
+}
+
+install_source()
+{
+make_env ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" ${PRODUCT_TYPE}
+source ${INSTALL_WORK}/$SHRC
+
+makedir ${PRODUCT_DIR}
+
+check_jb tar xfz ${SOURCE_DIR}/cmake-1.6.6.tar.gz -C ${INSTALL_WORK}
+cd ${INSTALL_WORK}/cmake-1.6.6
+check_job ${PRODUCT_DIR}/CONFIGUREcmake.LOG ./configure
+cat >> ${PRODUCT_DIR}/MAKEcmake.LOG <<EOF
+used gcc=$GCC
+EOF
+check_job ${PRODUCT_DIR}/MAKEcmake.LOG make
+
+check_jb tar xfz ${SOURCE_DIR}/VTK-4.2-LatestRelease.tar.gz -C ${INSTALL_WORK}
+cd ${PRODUCT_WORK}
+
+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"
+### Wrap Python settings
+VTK_CMAKE_OPTIONS=$VTK_CMAKE_OPTIONS" -DVTK_WRAP_PYTHON:BOOL=ON"
+VTK_CMAKE_OPTIONS=$VTK_CMAKE_OPTIONS" -DPYTHON_EXECUTABLE:STRING=${PYTHONHOME}/bin/python2.2"
+VTK_CMAKE_OPTIONS=$VTK_CMAKE_OPTIONS" -DPYTHON_INCLUDE_PATH:STRING=${PYTHONHOME}/include/python2.2"
+VTK_CMAKE_OPTIONS=$VTK_CMAKE_OPTIONS" -DPYTHON_LIBRARY:STRING=${PYTHONHOME}/lib/python2.2/config/libpython2.2.a"
+### if Mesa is pre-installed
+if [ -n "$MESA_HOME" ]; then
+  VTK_CMAKE_OPTIONS=$VTK_CMAKE_OPTIONS" -DOPENGL_INCLUDE_DIR:STRING=${MESA_HOME}/include"
+  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"
+  VTK_CMAKE_OPTIONS=$VTK_CMAKE_OPTIONS" -DOPENGL_xmesa_INCLUDE_DIR:STRING=${MESA_HOME}/include"
+fi
+
+cat > ${PRODUCT_DIR}/CONFIGURE.LOG <<EOF
+used VTK settings:
+$VTK_CMAKE_OPTIONS
+EOF
+check_job ${PRODUCT_DIR}/CONFIGURE.LOG ${INSTALL_WORK}/cmake-1.6.6/Source/cmake . $VTK_CMAKE_OPTIONS
+
+cat > ${PRODUCT_DIR}/MAKE.LOG <<EOF
+used gcc=$GCC
+EOF
+check_job ${PRODUCT_DIR}/MAKE.LOG make
+
+check_job ${PRODUCT_DIR}/MAKEINSTALL.LOG make install
+
+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.2.2-with-Mesa.tar.gz -C ${INSTALL_ROOT}
+else
+  check_jb tar xfz ${SOURCE_DIR}/VTK-4.2.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.2.2"
+export PRODUCT_DIR=${INSTALL_ROOT}/${PRODUCT}
+export PRODUCT_WORK=${INSTALL_WORK}/${PRODUCT}
+source ./common.sh
+$PROCEDURE