]> SALOME platform Git repositories - tools/install.git/commitdiff
Salome HOME
Support Scientific Linux 5.1 64bit
authorvsr <vsr@opencascade.com>
Sat, 24 May 2008 16:36:24 +0000 (16:36 +0000)
committervsr <vsr@opencascade.com>
Sat, 24 May 2008 16:36:24 +0000 (16:36 +0000)
config_files/VTK-4.4.2.sh
config_files/common.sh

index f9781d403c2166954ba76f394b7c77c06769aa1d..e4485141a94e42ad9a5cd019a7d482c4d80af2a0 100755 (executable)
@@ -150,8 +150,8 @@ VTK_CMAKE_OPTIONS=$VTK_CMAKE_OPTIONS" -DTK_LIBRARY:STRING=${tcl_libs}/libtk${tcl
 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
+  ### if Mesa is pre-installed
   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"
@@ -161,6 +161,16 @@ if [ -n "$MESA_HOME" ]; then
       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"
+else
+  ### else force path to the OpenGL libs
+  gllib="`find_gl_lib`"
+  if [ "$gllib" != "" ] ; then
+      VTK_CMAKE_OPTIONS=$VTK_CMAKE_OPTIONS" -DOPENGL_gl_LIBRARY:STRING=$gllib"
+  fi
+  glulib="`find_glu_lib`"
+  if [ "$glulib" != "" ] ; then
+      VTK_CMAKE_OPTIONS=$VTK_CMAKE_OPTIONS" -DOPENGL_glu_LIBRARY:STRING=$glulib"
+  fi
 fi
 
 cat > ${PRODUCT_DIR}/CONFIGURE.LOG <<EOF
@@ -181,16 +191,21 @@ cd ${PRODUCT_WORK}/Wrapping/Python
 check_job ${PRODUCT_DIR}/SETUPPYTHON.LOG python setup.py install --prefix=${PRODUCT_DIR}
 
 # set correct symbolic links - bug of python wrappings installation
-  if test `uname -m` = "x86_64" ; then
-      cd ${PRODUCT_DIR}/lib64/python${python_version}/site-packages/vtk_python
-  else
-      cd ${PRODUCT_DIR}/lib/python${python_version}/site-packages/vtk_python
-  fi
-  ln -sf ../../../vtk/*Python*.so .
-
-  if test `uname -m` = "x86_64" ; then
-      cd ${PRODUCT_DIR}; ln -s lib64 lib
-  fi
+if test `uname -m` = "x86_64" ; then
+    cd ${PRODUCT_DIR}/lib64/python${python_version}/site-packages/vtk_python
+else
+    cd ${PRODUCT_DIR}/lib/python${python_version}/site-packages/vtk_python
+fi
+ln -sf ../../../../lib/vtk/*Python*.so .
+
+if test `uname -m` = "x86_64" ; then
+    if test -d ${PRODUCT_DIR}/lib ; then
+       cd ${PRODUCT_DIR}/lib   ; ln -s ../lib64/python${python_version} .
+       cd ${PRODUCT_DIR}/lib64 ; ln -s ../lib/vtk .
+    else
+       cd ${PRODUCT_DIR}; ln -s lib64 lib
+    fi
+fi
 
 #du -sk ${PRODUCT_WORK} > ${PRODUCT_DIR}/size.log
 #du -sk ${INSTALL_WORK}/cmake-1.6.6 >> ${PRODUCT_DIR}/size.log
index 41821f7eb2be854ab1a81b6646f30a786f38229e..4599f84a32e88bc3a25be511966865d5d3cfe3b1 100755 (executable)
@@ -607,6 +607,68 @@ echo ""
 return 1
 }
 
+where_glu_libs(){
+# search libGLU.so* file and correct libGLU.la in the same directory
+for d in /usr/X11R6/lib64 /usr/lib64 /usr/X11R6/lib /usr/lib ; do
+    if [ "`ls ${d}/libGLU.so* 2>/dev/null`" ] && [ -f ${d}/libGLU.la ]; then
+       libdir=`grep "libdir=" ${d}/libGLU.la | sed -e "s%libdir='\(.*\)'%\1%" -e "s%/*$%%g"`
+       if [ "$libdir" == "$d" ] ; then
+           echo "$d"
+           return 0
+       fi
+    fi
+done
+# search libGLU.la file and check if this file is correct
+for d in /usr/X11R6/lib64 /usr/lib64 /usr/X11R6/lib /usr/lib ; do
+    if [ -f ${d}/libGLU.la ] ; then
+       libdir=`grep "libdir=" ${d}/libGLU.la | sed -e "s%libdir='\(.*\)'%\1%"`
+       if [ "`ls $libdir/libGLU.so* 2>/dev/null`" ] ; then
+           echo "$d"
+           return 0
+       fi
+    fi
+done
+# then search libGLU.so* file
+for d in /usr/X11R6/lib64 /usr/lib64 /usr/X11R6/lib /usr/lib ; do
+    if [ "`ls ${d}/libGLU.so* 2>/dev/null`" ] ; then
+       echo "$d"
+       return 0
+    fi
+done
+echo ""
+return 1
+}
+
+find_gl_lib(){
+# get path to the libGL.so* library
+gllibdir="`where_gl_libs`"
+if [ "$gllibdir" != "" ] ; then
+    files=`ls ${gllibdir}/libGL.so* 2>/dev/null`
+    files=`echo $files | awk '{print $1}'`
+    if [ "$files" != "" ] ; then
+       echo $files
+       return 0
+    fi
+fi
+echo ""
+return 1
+}
+
+find_glu_lib(){
+# get path to the libGLU.so* library
+glulibdir="`where_glu_libs`"
+if [ "$glulibdir" != "" ] ; then
+    files=`ls ${glulibdir}/libGLU.so* 2>/dev/null`
+    files=`echo $files | awk '{print $1}'`
+    if [ "$files" != "" ] ; then
+       echo $files
+       return 0
+    fi
+fi
+echo ""
+return 1
+}
+
 where_xmu_includes(){
 # search Xmu.h
 for d in /usr/X11R6/include/X11 /usr/include/X11 ; do