HOWTO get VTK 3.1.2 to work on RedHat 7.0.
Tue Oct 24 11:38:41 EDT 2000
With a great deal of help from Kitware, I've gotten VTK 3.1.2 to
compile and run successfully on RedHat 7.0, but there's a number
of potential problems for the future, and if you haven't gone to
RedHat 7.0, don't! There's a rather serious problem with gcc
2.96 I haven't yet figured how to resolve. But if you're fearless,
or you've already installed RedHat 7 and now discovered VTK doesn't
work anymore, and aren't willing to return to RH 6.2, here's what I
did to get it working:
First, in preparation to installing VTK 312, mounted the RH7
Source CD, and did -
rpm -i /mnt/cdrom/SRPMS/tcltk-8.3.1-46.src.rpm
cd /usr/src/redhat/SOURCES
tar xzf tcl8.3.1.tar.gz
tar xzf tk8.3.1.tar.gz
I originally relied on the the pre-installed Mesa RPMs, which did not work:
/redhat7/disk1/RedHat/RPMS/Mesa-3.3-5.i386.rpm
/redhat7/disk1/RedHat/RPMS/Mesa-devel-3.3-5.i386.rpm
Later I downloaded the Mesa source from www.mesa3d.org, and did -
cd /contrib/mesa
# Download tarballs from www.mesa3d.org.
tar xzf MesaDemos-3.3.tar.gz
tar xzf MesaLib-3.3.tar.gz
cd Mesa-3.3
./configure
make
make install > install.log
echo /usr/local/lib >> /etc/ld.so.conf
/sbin/ldconfig -v
Note that the install for Mesa puts the libraries in /usr/local/lib.
VTK still failed until I did -
mkdir /usr/libsave
for i in \
libGL.la libGL.so.1.2.030300 libGLU.la libGLU.so.1.2.030300; \
do mv /usr/lib/$i /usr/libsave/$i; done
for i in \
libGL.la libGL.so.1.2.030300 libGLU.la libGLU.so.1.1.030300; \
do cp /usr/local/lib/$i /usr/lib/$i; done
/sbin/ldconfig -v
I also have OpenDX (opendx-4.1.1-1) installed, which relies on Mesa.
The above change didn't seem to bother it, but I am having trouble
getting the OpenDX tutorial to work. Don't know whether this is
related to the Mesa libraries or not. At any rate, VTK will not run
if compiled --with-mesa, and you haven't done the above. Next, I did -
cd /contrib/vtk
ftp://public.kitware.com/pub/vtk/, downloaded vtk312Unix.tar.gz.
tar xzf vtk312Unix.tar.gz
chown -R root:root vtk31
cd vtk31
backupfile user.make # user.make.d001017.t091843.root
vi user.make # Made the following changes:
TCL_INCLUDE=-I/usr/src/redhat/SOURCES/tcl8.3.1/generic
TCL_LIB=/usr/lib/libtcl8.3.so
TK_INCLUDE=-I/usr/src/redhat/SOURCES/tk8.3.1/generic
TK_LIB=/usr/lib/libtk8.3.so
MESA_INCLUDE=-I/usr/local/include/GL
MESA_LIB=/usr/local/lib/libGL.so
Note I originally tried -
MESA_INCLUDE=-I/usr/include/GL
MESA_LIB=/usr/lib/libGL.so
but these libraries, as installed from RPM files, will not work with VTK.
You must compile Mesa from source.
./configure --with-mesa --with-tcl --with-shared --with-contrib
You'll get compile errors unless you change three source files -
/contrib/vtk/vtk31/graphics/vtkMesaRenderWindow.h
/contrib/vtk/vtk31/imaging/vtkMesaImageWindow.h
/contrib/vtk/vtk31/imaging/vtkXMesaTextMapper.cxx
adding these two lines immediately in front of '#include "GL/osmesa.h"' -
# define GLAPI extern
# define GLAPIENTRY
There's also one compile that'll have to be redone partway through the
make (see below).
./configure --with-mesa --with-tcl --with-shared --with-contrib \
> configure.log
make > make.log
Got this error:
--------------------------------------------------------------------------
vtkMesaRenderWindow.cxx: In method
`vtkMesaRenderWindow::vtkMesaRenderWindow ()':
vtkMesaRenderWindow.cxx:159: `class vtkMesaRenderWindow' has no member
named `OffScreenContextId'
vtkMesaRenderWindow.cxx: In method
`vtkMesaRenderWindow::~vtkMesaRenderWindow ()':
vtkMesaRenderWindow.cxx:184: `class vtkMesaRenderWindow' has no member
named `OffScreenContextId'
vtkMesaRenderWindow.cxx:229: `class vtkMesaRenderWindow' has no member
named `OffScreenContextId'
vtkMesaRenderWindow.cxx: In method `void vtkMesaRenderWindow::Start
()':
vtkMesaRenderWindow.cxx:253: `class vtkMesaRenderWindow' has no member
named `OffScreenContextId'
vtkMesaRenderWindow.cxx: In method `void
vtkMesaRenderWindow::Initialize ()':
vtkMesaRenderWindow.cxx:518: `class vtkMesaRenderWindow' has no member
named `OffScreenContextId'
vtkMesaRenderWindow.cxx: In method `void
vtkMesaRenderWindow::WindowRemap ()':
vtkMesaRenderWindow.cxx:635: `class vtkMesaRenderWindow' has no member
named `OffScreenContextId'
vtkMesaRenderWindow.cxx: In method `void vtkMesaRenderWindow::SetSize
(int, int)':
vtkMesaRenderWindow.cxx:676: `class vtkMesaRenderWindow' has no member
named `OffScreenContextId'
vtkMesaRenderWindow.cxx: In method `void vtkMesaRenderWindow::PrintSelf
(ostream &, vtkIndent)':
vtkMesaRenderWindow.cxx:758: `class vtkMesaRenderWindow' has no member
named `OffScreenContextId'
vtkMesaRenderWindow.cxx: In method `void
vtkMesaRenderWindow::MakeCurrent ()':
vtkMesaRenderWindow.cxx:1181: `class vtkMesaRenderWindow' has no member
named `OffScreenContextId'
vtkMesaRenderWindow.cxx: In method `void
*vtkMesaRenderWindow::GetGenericContext ()':
vtkMesaRenderWindow.cxx:1252: `class vtkMesaRenderWindow' has no member
named `OffScreenContextId'
make[1]: *** [vtkMesaRenderWindow.o] Error 1
make: *** [build_graphics] Error 2
--------------------------------------------------------------------------
Got around it by adding -DMESA to the offending command in a temporary
shell script file:
--------------------------------------------------------------------------
#!/bin/sh
set -x
cd /contrib/vtk/vtk31/graphics
c++ -g -O2 -fPIC -DVTK_USE_PTHREADS -D_HP_NO_FAST_MACROS \
-DHAVE_LIMITS_H -DHAVE_UNISTD_H -I. -I. -I./../graphics \
-DVTK_USE_GRAPHICS -I./../imaging -DVTK_USE_IMAGING \
-I./../contrib -DVTK_USE_CONTRIB \
-I/usr/local/include/GL -DMESA -DVTK_USE_MESA \
-I/usr/X11R6/include \
-I./../common -I/usr/src/redhat/SOURCES/tk8.3.1/generic \
-I/usr/src/redhat/SOURCES/tcl8.3.1/generic \
-I/home/schroede/montnaro/Python-1.4/Include \
-c vtkMesaRenderWindow.cxx -o vtkMesaRenderWindow.o
--------------------------------------------------------------------------
Then continued with make:
make >> make.log
cd /usr/lib
ln -sf /contrib/vtk/vtk31/*/*.so .
/sbin/ldconfig -n /usr/lib
cd /usr/local/bin
ln -sf /contrib/vtk/vtk31/tcl/vtk .
rm -f /opt/vtk
ln -s /contrib/vtk/vtk31 /opt/vtk
Finis.
------------------------------------------------------------------------------
This e-mail is intended for the use of the addressee(s) only and may contain privileged, confidential, or proprietary information that is exempt from disclosure under law. If you have received this message in error, please inform us promptly by reply e-mail, then delete the e-mail and destroy any printed copy. Thank you.
==============================================================================
_______________________________________________
This is the private VTK discussion list.
Please keep messages on-topic. Check the FAQ at: <http://public.kitware.com/cgi-bin/vtkfaq>
Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/vtkusers
------------------------------------------------------------------------------
This e-mail is intended for the use of the addressee(s) only and may contain privileged, confidential, or proprietary information that is exempt from disclosure under law. If you have received this message in error, please inform us promptly by reply e-mail, then delete the e-mail and destroy any printed copy. Thank you.
==============================================================================
------------------------------------------------------------------------------
This e-mail is intended for the use of the addressee(s) only and may contain privileged, confidential, or proprietary information that is exempt from disclosure under law. If you have received this message in error, please inform us promptly by reply e-mail, then delete the e-mail and destroy any printed copy. Thank you.
==============================================================================
More information about the vtkusers
mailing list