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"
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
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
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