[vtkusers] compiling VTK on linux

Liam K quantum.leaf at googlemail.com
Fri Apr 18 12:47:27 EDT 2008


i found it.

Linking CXX executable ../../bin/VTKJavaExecutable
/usr/bin/ld: warning: libmawt.so, needed by
/usr/lib/jvm/java-6-sun/jre/lib/i386/libjawt.so, not found (try using -rpath
or -rpath-link)
/usr/lib/jvm/java-6-sun/jre/lib/i386/libjawt.so: undefined reference to
`awt_GetDrawingSurface at SUNWprivate_1.1'
/usr/lib/jvm/java-6-sun/jre/lib/i386/libjawt.so: undefined reference to
`awt_FreeDrawingSurface at SUNWprivate_1.1'
/usr/lib/jvm/java-6-sun/jre/lib/i386/libjawt.so: undefined reference to
`awt_GetComponent at SUNWprivate_1.1'
/usr/lib/jvm/java-6-sun/jre/lib/i386/libjawt.so: undefined reference to
`awt_Lock at SUNWprivate_1.1'
/usr/lib/jvm/java-6-sun/jre/lib/i386/libjawt.so: undefined reference to
`awt_Unlock at SUNWprivate_1.1'
collect2: ld returned 1 exit status
make[2]: *** [bin/VTKJavaExecutable] Error 1
make[1]: *** [Wrapping/Java/CMakeFiles/VTKJavaExecutable.dir/all] Error 2
make: *** [all] Error 2

seems i'm not the first person to get here:
this guy:
http://public.kitware.com/pipermail/vtkusers/2003-November/070622.html
had the same problem but not sure if he ever fixed it.

I dont know why make can't find libmawt.so it's there in the motif21
sub-dir. Though ii seemed a bit dodgy i copied that .so up one dir so it was
in the same ../jre/lib dir as libjawt.so and:

[100%] Building CXX object
Widgets/Testing/Cxx/CMakeFiles/WidgetsCxxTests.dir/TestImageTracerWidget.o
Linking CXX executable ../../../bin/WidgetsCxxTests
[100%] Built target WidgetsCxxTests

great!!!

i wonder why libmawt wasn't found. There was a JAVA_JVM_LIBRARY option that
wasn't set... maybe it was to do with that... i'm not everyone who tries to
compile vtk on linux has this problem.

well, i never imagined it would take day to compile vtk but hey now i can
start using it.

thanks for you help.


If anyone has any good references for using the java wrapper people let me
know,

Liam








On Fri, Apr 18, 2008 at 5:36 PM, David Gobbi <david.gobbi at gmail.com> wrote:

> All of those java library and header items must be set or the compile will
> fail.
>
> E.g. for awt, give the full path to "libjawt.so".
>
> You'll just have to search through your java installation to find each
> item.  On Ubuntu, /usr/lib/jvm is where to start looking.
>
> I don't know of any documentation on this.
>
>   David
>
>
>
> On Fri, Apr 18, 2008 at 12:27 PM, Liam K <quantum.leaf at googlemail.com>
> wrote:
> > so close....
> >
> > [ 97%] Building CXX object
> > Wrapping/Java/CMakeFiles/VTKJavaExecutable.dir/VTKJava.o
> > Linking CXX executable ../../bin/VTKJavaExecutable
> > /usr/local/VTK/bin/libvtkRenderingJava.so: undefined reference to
> > `JAWT_GetAWT'
> >  collect2: ld returned 1 exit status
> > make[2]: *** [bin/VTKJavaExecutable] Error 1
> > make[1]: *** [Wrapping/Java/CMakeFiles/VTKJavaExecutable.dir/all] Error
> 2
> > make: *** [all] Error 2
> >
> > i'm wondering if this is to due with the cmake option JAVA_AWT_LIBRARY
> not
> > being set. I'm sure ive got it somewhere in the jdk but i'm not sure
> what
> > the option once. Is there documentation somewhere which says what each
> > option needs to point to?
> >
> >
> > Liam
> >
> >
> > ps:> i mean to send the msg below to the whole list, but just hit reply
> > without thinking:
> >
> >
> > On Fri, Apr 18, 2008 at 5:20 PM, Liam K <quantum.leaf at googlemail.com>
> wrote:
> >
> > > Thanks David,
> > >
> > > So far so good. It's compiling at 50%.
> > > Seems the problem was some missing packages.
> > >
> > > I'd like to know how i was supposed to know i would need them, I
> wonder if
> > i've missed a key bit of documentation. Isnt it cmakes job to make sure
> > everything is available before make starts?
> > >
> > > anyway, hopefully it's working now,
> > >
> > > thanks for your help,
> > >
> > > Liam
> > >
> > >
> > >
> > >
> > >
> > >
> > > On Fri, Apr 18, 2008 at 4:50 PM, David Gobbi <david.gobbi at gmail.com>
> > wrote:
> > >
> > > > You should not need any special compiler flags.  It is more likely
> > > > that you are missing some important dev packages.  I have ubuntu
> 6.06,
> > > > so the version numbers might be different for you, but make sure you
> > > > have these or the equivalents:
> > > >
> > > > libstdc++6-4.0-dev
> > > > libc6-dev
> > > > libX11-dev
> > > > libgl1-mesa-dev
> > > > libglu1-mesa-dev
> > > > tcl8.4-dev
> > > > tk8.4-dev
> > > > sun-java6-jdk
> > > >
> > > > After installing these you should delete your old CMakeCache.txt (or
> > > > even the whole VTK binary directory, to be safe) so that the cmake
> > > > autodetection will properly catch all the header files that VTK
> uses.
> > > >
> > > > Note that when you get to the java stage, cmake will not
> automatically
> > > > find the java headers or libraries.  You will have to enter all the
> > > > java related CMake flags manually under "advanced"
> > > >
> > > >   David
> > > >
> > > >
> > > >
> > > >
> > > >
> > > >
> > > >
> > > >
> > > > On Fri, Apr 18, 2008 at 11:29 AM, Liam K <
> quantum.leaf at googlemail.com>
> > wrote:
> > > > > (sorry for previous blank post)
> > > > >
> > > > >
> > > > > Hi,
> > > > >
> > > > > Thanks for the replies.
> > > > >
> > > > > Indeed, i am hoping to use VTK with the java wrappers, but at the
> > moment the
> > > > > problem i'm having is compiling the binaries. I get the same
> errors
> > even if
> > > > > i disable to java wrapper option in cmake.
> > > > >  I'm sure this must be a compiler flag option or something
> similar...
> > > > >
> > > > > Liam
> > > > >
> > > > >
> > > > >
> > > > > On Fri, Apr 18, 2008 at 4:28 PM, Liam K <
> quantum.leaf at googlemail.com>
> > wrote:
> > > > >
> > > > > >
> > > > > >
> > > > > >
> > > > > >
> > > > > > On Fri, Apr 18, 2008 at 3:17 PM, David Gobbi <
> david.gobbi at gmail.com>
> > > > > wrote:
> > > > > >
> > > > > >
> > > > > >
> > > > > >
> > > > > > > AFAIK the debian distribution of VTK does not come with java
> > support,
> > > > > > > so switching away from Ubuntu is not going to help Liam at
> all.
> > > > > > >
> > > > > > > Ubuntu may not come with VTK binaries, but it has all of the
> VTK
> > > > > > > dependencies.  Liam will have to install all of the sun-java6
> > packages
> > > > > > > as well as cmake and the dev packages for tcl, tk, etc. but
> the
> > > > > > > process should be straightforward once all the dev packages
> are
> > there.
> > > > > > >
> > > > > > > Anyone out there with experience specifically in installing
> > VTK-java
> > > > > > > on ubuntu?  The last time that I did it was a couple years
> ago, so
> > I'm
> > > > > > > a little rusty.
> > > > > > >
> > > > > > >   David
> > > > > > >
> > > > > > >
> > > > > > >
> > > > > > >
> > > > > > >
> > > > > > > On Fri, Apr 18, 2008 at 10:00 AM, Oleksandr Dzyubak
> > <adzyubak at gmail.com>
> > > > > wrote:
> > > > > > > > Hi Liam,
> > > > > > > >
> > > > > > > >  Ubuntu is based on and derived from Debian.
> > > > > > > >  Since you are using Ubuntu anyway,  I would recommend you
> > > > > > > >  to install Debian Lenny on your Linux box.
> > > > > > > >  Lenny has Cmake, Make, ITK,  VTK,  wxWidgets, FLTK,
> QT(3/4),
> > Perl,
> > > > > Tcl/Tk
> > > > > > > >  and all what you might need for your development in their
> > repository
> > > > > as
> > > > > > > >  binary pre-built packages thus it works right out of the
> box.
> > > > > > > >  Since you are Ubuntu (meaning Debian) user
> > > > > > > >  you know how to install needed packages and satisfy all
> > dependencies.
> > > > > > > >
> > > > > > > >  The good thing is that if you do that, it will save you a
> lot
> > of time
> > > > > and
> > > > > > > > efforts
> > > > > > > >  you might spent on first compiling the distribution
> packages
> > > > > themselves,
> > > > > > > >  latter examples, and finally "dependency hell" when you
> will
> > start
> > > > > > > >  "putting all together" in your own application.
> > > > > > > >
> > > > > > > >  Hope it helps,
> > > > > > > >
> > > > > > > >  Alex
> > > > > > > >
> > > > > > > >
> > > > > > > >  Liam K wrote:
> > > > > > > >
> > > > > > > > >
> > > > > > > > >
> > > > > > > > >
> > > > > > > > > Hi,
> > > > > > > > >
> > > > > > > > > I'm looking for some help in compiling VTK+. I'm hoping to
> use
> > it
> > > > > with the
> > > > > > > > java wrapping for a medical data visualisation project.
> > > > > > > > >
> > > > > > > > > I'm finding just compiling VTK on my linux box (ubuntu) to
> be
> > much
> > > > > more
> > > > > > > > difficult than i expect.
> > > > > > > > > So far i have install cmake and set various option and
> > generated the
> > > > > make
> > > > > > > > file.
> > > > > > > > >
> > > > > > > > > When I run the make file however i get:
> > > > > > > > >
> > > > > > > > > zoizoi at mangoNupheus:/usr/local/VTK$ make
> > > > > > > > > [  0%] Built target vtkParseJava
> > > > > > > > > [  0%] Built target vtkWrapJava
> > > > > > > > > [  0%] Built target vtksys
> > > > > > > > > [  0%] Building CXX object
> > > > > > > > Common/CMakeFiles/vtkCommon.dir/vtkDataArraySelection.o
> > > > > > > > > /usr/local/VTK/Common/vtkDataArraySelection.cxx:27: error:
> ISO
> > C++
> > > > > forbids
> > > > > > > > declaration of 'vector' with no type
> > > > > > > > > /usr/local/VTK/Common/vtkDataArraySelection.cxx:27: error:
> > invalid
> > > > > use of
> > > > > > > > '::'
> > > > > > > > > /usr/local/VTK/Common/vtkDataArraySelection.cxx:27: error:
> > expected
> > > > > ';'
> > > > > > > > before '<' token
> > > > > > > > >
> > > > > > > > > ...and then a long long list of errors which it's probably
> not
> > worth
> > > > > > > > posting. This is VTK 5.0.4
> > > > > > > > >
> > > > > > > > > i have no idea what's causing this as my knowledge of C++
> is
> > pretty
> > > > > > > > limited. Is there some configure option i need to set to get
> the
> > > > > compiler to
> > > > > > > > be less stringent or something?
> > > > > > > > >
> > > > > > > > > hope someone can help as i need to get working on this
> project
> > asap.
> > > > > > > > >
> > > > > > > > > Liam
> > > > > > > > >
> > > > > > > > >
> > > > >
> > ------------------------------------------------------------------------
> > > > > > > > >
> > > > > > > > > _______________________________________________
> > > > > > > > > This is the private VTK discussion list.
> > > > > > > > > Please keep messages on-topic. Check the FAQ at:
> > > > > > > > http://www.vtk.org/Wiki/VTK_FAQ
> > > > > > > > > Follow this link to subscribe/unsubscribe:
> > > > > > > > > http://www.vtk.org/mailman/listinfo/vtkusers
> > > > > > > > >
> > > > > > > > >
> > > > > > > >
> > > > > > > >  _______________________________________________
> > > > > > > >  This is the private VTK discussion list.
> > > > > > > >  Please keep messages on-topic. Check the FAQ at:
> > > > > > > > http://www.vtk.org/Wiki/VTK_FAQ
> > > > > > > >  Follow this link to subscribe/unsubscribe:
> > > > > > > >  http://www.vtk.org/mailman/listinfo/vtkusers
> > > > > > > >
> > > > > > >
> > > > > >
> > > > > >
> > > > >
> > > > >
> > > > > _______________________________________________
> > > > >  This is the private VTK discussion list.
> > > > >  Please keep messages on-topic. Check the FAQ at:
> > > > > http://www.vtk.org/Wiki/VTK_FAQ
> > > > >  Follow this link to subscribe/unsubscribe:
> > > > >  http://www.vtk.org/mailman/listinfo/vtkusers
> > > > >
> > > > >
> > > >
> > >
> > >
> >
> >
> > _______________________________________________
> >  This is the private VTK discussion list.
> >  Please keep messages on-topic. Check the FAQ at:
> > http://www.vtk.org/Wiki/VTK_FAQ
> >  Follow this link to subscribe/unsubscribe:
> >  http://www.vtk.org/mailman/listinfo/vtkusers
> >
> >
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20080418/aebfd2d3/attachment.htm>


More information about the vtkusers mailing list