[vtkusers] How to build VTK libraries on Xeon Dual Processor Machine.

sudeep M. Hooli Sudeep.Hooli at quest-global.com
Fri Mar 24 08:17:32 EST 2006


Hi,

	I could able to build the VTK libraries on "Xeon Dual Processor" machine. I have used the "MPICH" for MPI support for VTK libraries. But, I don't know whether I have to use "mpirun" while executing my application. If I have to use "mpirun" then how it should be used while executing my application.

	Please assist me how to solve this.

Thanks and regards,
Sudeep

-----Original Message-----
From: Sebastiaan [mailto:sebastia at ch.its.tudelft.nl] 
Sent: Thursday, March 23, 2006 3:27 PM
To: sudeep M. Hooli
Cc: vtkusers at vtk.org
Subject: Re: [vtkusers] How to build VTK libraries on Xeon Dual Processor Machine.

Hi,

On Thu, 23 Mar 2006, sudeep M. Hooli wrote:

> Hi all,
>
>          I have a VTK+JAVA based application. I want to execute it on
> Linux OS and the machine is "Xeon Dual Processor" machine.
>          I don't know how to build the VTK libraries on this kind of
> machine (Dual processor).
>
>          Can anybody advice me how to build the VTK libraries on this
> machine and how to execute the application.
>
as far as I know there is nothing special about the dual processor, so I 
guess you want to know how to build VTK on Linux in general?

I cut a piece from a Gentoo VTK 5 ebuild, so you get an idea of the 
variables to be set, depending on what you want to use:

         # build list of config variable define's to pass to cmake
         local CMAKE_VARIABLES=""
         CMAKE_VARIABLES="${CMAKE_VARIABLES} -DCMAKE_SKIP_RPATH:BOOL=YES"
#        CMAKE_VARIABLES="${CMAKE_VARIABLES} -DVTK_DIR:PATH=${S}"
         CMAKE_VARIABLES="${CMAKE_VARIABLES} -DCMAKE_INSTALL_PREFIX:PATH=/usr"
         CMAKE_VARIABLES="${CMAKE_VARIABLES} -DBUILD_SHARED_LIBS:BOOL=ON"
         CMAKE_VARIABLES="${CMAKE_VARIABLES} -DVTK_USE_SYSTEM_JPEG:BOOL=ON"
         CMAKE_VARIABLES="${CMAKE_VARIABLES} -DVTK_USE_SYSTEM_PNG:BOOL=ON"
         CMAKE_VARIABLES="${CMAKE_VARIABLES} -DVTK_USE_SYSTEM_TIFF:BOOL=ON"
         CMAKE_VARIABLES="${CMAKE_VARIABLES} -DVTK_USE_SYSTEM_ZLIB:BOOL=ON"
         CMAKE_VARIABLES="${CMAKE_VARIABLES} -DVTK_USE_SYSTEM_EXPAT:BOOL=ON"
         CMAKE_VARIABLES="${CMAKE_VARIABLES} -DBUILD_TESTING:BOOL=OFF"
         CMAKE_VARIABLES="${CMAKE_VARIABLES} -DVTK_USE_HYBRID:BOOL=ON"
         if use examples; then
                 CMAKE_VARIABLES="${CMAKE_VARIABLES} -DVTK_DATA_ROOT:PATH=/usr/share/vtk/data"
                 CMAKE_VARIABLES="${CMAKE_VARIABLES} -DBUILD_EXAMPLES:BOOL=ON"
         fi
         if use java; then
                 CMAKE_VARIABLES="${CMAKE_VARIABLES} -DVTK_WRAP_JAVA:BOOL=ON"
                 CMAKE_VARIABLES="${CMAKE_VARIABLES} -DJAVA_AWT_INCLUDE_PATH:PATH=`java-config -O`/include"
                 CMAKE_VARIABLES="${CMAKE_VARIABLES} -DJAVA_INCLUDE_PATH:PATH=`java-config -O`/include"
                 CMAKE_VARIABLES="${CMAKE_VARIABLES} -DJAVA_INCLUDE_PATH2:PATH=`java-config -O`/include/linux"
                 if [ "${ARCH}" == "x86" ]; then
                         CMAKE_VARIABLES="${CMAKE_VARIABLES} -DJAVA_AWT_LIBRARY:PATH=`java-config -O`/jre/lib/i386/libjawt.so"
                 else
                         CMAKE_VARIABLES="${CMAKE_VARIABLES} -DJAVA_AWT_LIBRARY:PATH=`java-config -O`/jre/lib/${ARCH}/libjawt.so"
                 fi
         fi
         if use mpi; then
                 CMAKE_VARIABLES="${CMAKE_VARIABLES} -DVTK_USE_MPI:BOOL=ON"
                 use !threads && CMAKE_VARIABLES="${CMAKE_VARIABLES} -DVTK_USE_PARALLEL:BOOL=ON"
         fi

         if use python; then
                 python_version
                 CMAKE_VARIABLES="${CMAKE_VARIABLES} -DVTK_WRAP_PYTHON:BOOL=ON"
                 CMAKE_VARIABLES="${CMAKE_VARIABLES} -DPYTHON_INCLUDE_PATH:PATH=/usr/include/python${PYVER}"
                 CMAKE_VARIABLES="${CMAKE_VARIABLES} -DPYTHON_LIBRARY:PATH=/usr/$(get_libdir)/libpython${PYVER}.so"
         fi

         if use qt; then
                 CMAKE_VARIABLES="${CMAKE_VARIABLES} -DVTK_USE_GUISUPPORT:BOOL=ON"
                 CMAKE_VARIABLES="${CMAKE_VARIABLES} -DVTK_USE_QVTK:BOOL=ON"
                 CMAKE_VARIABLES="${CMAKE_VARIABLES} -DQT_WRAP_CPP:BOOL=ON"
                 CMAKE_VARIABLES="${CMAKE_VARIABLES} -DQT_WRAP_UI:BOOL=ON"
                 # if QT4 is installed, configure for QT4
                 if has_version =x11-libs/qt-4*; then
                         CMAKE_VARIABLES="${CMAKE_VARIABLES} -DDESIRED_QT_VERSION:STRING=4"
                         CMAKE_VARIABLES="${CMAKE_VARIABLES} -DQT_INCLUDE_DIR:PATH=/usr/include/qt4"
                         CMAKE_VARIABLES="${CMAKE_VARIABLES} -DQT_MOC_EXECUTABLE:FILEPATH=/usr/bin/moc"
                         CMAKE_VARIABLES="${CMAKE_VARIABLES} -DQT_UIC_EXECUTABLE:FILEPATH=/usr/bin/uic"
                 else
                         CMAKE_VARIABLES="${CMAKE_VARIABLES} -DDESIRED_QT_VERSION:STRING=3"
                         CMAKE_VARIABLES="${CMAKE_VARIABLES} -DQT_INCLUDE_DIR:PATH=/usr/qt/3/include"
                         CMAKE_VARIABLES="${CMAKE_VARIABLES} -DVTK_INSTALL_QT_DIR:PATH=/qt/3/plugins"
                         CMAKE_VARIABLES="${CMAKE_VARIABLES} -DQT_MOC_EXECUTABLE:FILEPATH=/usr/qt/3/bin/moc"
                         CMAKE_VARIABLES="${CMAKE_VARIABLES} -DQT_UIC_EXECUTABLE:FILEPATH=/usr/qt/3/bin/uic"
                 fi
         fi


         use tcltk && CMAKE_VARIABLES="${CMAKE_VARIABLES} -DVTK_WRAP_TCL:BOOL=ON"
         use threads && CMAKE_VARIABLES="${CMAKE_VARIABLES} -DVTK_USE_PARALLEL:BOOL=ON"
         use patented && CMAKE_VARIABLES="${CMAKE_VARIABLES} -DVTK_USE_PATENTED:BOOL=ON"
         use doc && CMAKE_VARIABLES="${CMAKE_VARIABLES} -DDOCUMENTATION_HTML_HELP:BOOL=ON -DBUILD_DOCUMENTATION:BOOL=ON"


So, construct your own CMAKE_VARIABLES from this source :).

Now run:
         cmake ${CMAKE_VARIABLES} . && cmake ${CMAKE_VARIABLES} .
(twice to prevent errors if you use cmake 2.2.x).


If you have an EM64T, there is a problem with Java (either with Sun or 
Blackdown) so execute this:

sed -e "s/javac/javac -J-Xmx256m/" -i Wrapping/Java/CMakeFiles/VTKBuildAll.dir/build.make

Then execute "make" in order to build VTK.

After make you need to install it onto your system. I'm not really sure 
about this step, but this is the idea:
make DESTDIR=${D} install   (where ${D} is /usr, but I'm not sure).


Then, prior to use VTk set these environmental variables:

         export VTK_DATA_ROOT=/usr/share/vtk/data
         export VTK_DIR=/usr/lib/vtk-5.0
         export CLASSPATH=/usr/share/vtk/lib/vtk.jar"


I hope this gives you a guidance.

Good luck!
Sebastiaan

--

English written by Dutch people is easily recognized by the improper use of 'In principle ...'

The software box said 'Requires Windows 95 or better', so I installed Linux.

Als Pacman in de jaren '80 de kinderen zo had beïnvloed zouden nu veel jongeren rondrennen 
in donkere zalen terwijl ze pillen eten en luisteren naar monotone electronische muziek. 
(Kristian Wilson, Nintendo, 1989)



More information about the vtkusers mailing list