Failing to get VTK working on Ubuntu

889 views
Skip to first unread message

Rob Campbell

unread,
Jul 9, 2014, 4:44:39 AM7/9/14
to icy-so...@googlegroups.com
I've spent some time on getting VTK working on Ubuntu 14.04 with Icy, but so far no luck. I've installed all the VTK 5.8 packages, including libvtk-java which I assume is the critical one. I'm not sure which directory to include, so added both /usr/lib/jni which has the .so files and /usr/share/java which has the vtk.jar file. I still can't get 3D visualizations, though. My Icy start script looks like this:

LD_LIBRARY_PATH=/usr/lib/jni/:/usr/share/java/
export LD_LIBRARY_PATH
/usr/lib/jvm/java-6-openjdk-amd64/jre/bin/java  -jar /opt/icy/updater.jar

So I guess either I have the wrong directory or there are some command line switches I'm missing. Any ideas?

Stephane

unread,
Jul 9, 2014, 5:10:25 AM7/9/14
to
Hi Rob,

Normally installing libvtk and libvtk-java is enough to get things work without using some specific parameters.
The problem is that Icy is using the last version of VTK (6.1) and unfortunately there is some majors changes in VTK 6 which make it incompatible with previous version. In future we will try to provide VTK binaries for linux system (we only have osx and windows right now) so users won't have to care about VTK installation. On your side, if you really want to get VTK working on your Linux system, you will have to download the VTK sources and compile it through the CMake tool.

- Stephane

Rob Campbell

unread,
Jul 9, 2014, 5:16:56 AM7/9/14
to icy-so...@googlegroups.com
Ah, OK. It would be useful to mention that in the FAQ, as it currently implies that 5.8 is correct version.

Rob

Stephane

unread,
Jul 9, 2014, 5:57:30 AM7/9/14
to icy-so...@googlegroups.com
Oh yeah sorry, we forgot to update it !

Stephane

unread,
Jul 9, 2014, 6:00:48 AM7/9/14
to icy-so...@googlegroups.com
Fixed the FAQ, still a better solution would be to directly provide the VTK library for linux system to avoid any incompatible version problem.

Rob Campbell

unread,
Jul 9, 2014, 6:51:55 AM7/9/14
to icy-so...@googlegroups.com
So I built and installed VTK 6.1 from source. I found I had to do the LD_LIBRARY_PATH stuff or Icy continues to behave as though VTK isn't there. The surface visualisation works, but the "3D VTK" view doesn't work so well. The view appears in a separate window called "Visualization Toolkit - OpenGL" but it is static and I can't interact with it. Neither can I close the window, it just hangs. I'm using an NVIDIA graphics card.

Rob

Alexandre Dufour

unread,
Jul 9, 2014, 6:59:43 AM7/9/14
to icy-so...@googlegroups.com
Hi Rob,

Not sure this is a related issue, but I noticed you are running Icy over OpenJDK, and I’ve seen some issues in the past due to some not-so-minor differences with the Sun-now-Oracle implementation. This might be another thing to try out.

Alexandre

On 09 Jul 2014, at 11:51, Rob Campbell <raaca...@gmail.com> wrote:

So I built and installed VTK 6.1 from source. I found I had to do the LD_LIBRARY_PATH stuff or Icy continues to behave as though VTK isn't there. The surface visualisation works, but the "3D VTK" view doesn't work so well. The view appears in a separate window called "Visualization Toolkit - OpenGL" but it is static and I can't interact with it. Neither can I close the window, it just hangs. I'm using an NVIDIA graphics card.

Rob


--
You received this message because you are subscribed to the Google Groups "Icy imaging" group.
To unsubscribe from this group and stop receiving emails from it, send an email to icy-software...@googlegroups.com.
To post to this group, send email to icy-so...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/icy-software/19d82c5b-0552-4b3d-9df8-2336a193032d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Stephane

unread,
Jul 9, 2014, 7:58:32 AM7/9/14
to icy-so...@googlegroups.com
Ok so definitely the LD_LIBRARY_PATH need to be patched accordling.. i was not sure but so i keep it in the FAQ notes.
The problem you are experiencing comes from the OpenGL viewport implementation of VTK rendering with Linux, i don't know if there are ways of force it to use X instead. Did you try to run Icy in "detached" mode to see if that makes any differences ?

Best,

- Stephane

Rob Campbell

unread,
Jul 9, 2014, 10:48:15 AM7/9/14
to icy-so...@googlegroups.com
I still get the issue with the JRE from Oracle, but I will continue to use this version over OpenJRE just in case of other problems. Running in detached mode doesn't help. I will look for ways of forcing VTK to use X.

Rob

Stephane

unread,
Jul 10, 2014, 4:07:46 AM7/10/14
to icy-so...@googlegroups.com
Thanks for reporting your progress ! On our side, we will study how to migrate to OpenGL display with VTK instead of the classical Swing as the problem is not occurring on Linux only but also on some last OSX version. Still i think it won't be an easy go and so that won't happen soon.

- Stephane

Rob Campbell

unread,
Jul 10, 2014, 6:39:20 AM7/10/14
to icy-so...@googlegroups.com


On Thursday, July 10, 2014 10:07:46 AM UTC+2, Stephane wrote:
Thanks for reporting your progress ! On our side, we will study how to migrate to OpenGL display with VTK instead of the classical Swing as the problem is not occurring on Linux only but also on some last OSX version. Still i think it won't be an easy go and so that won't happen soon.


Thanks, that sounds great.

Rob
 

Josef Knecht

unread,
Mar 16, 2015, 12:04:44 PM3/16/15
to icy-so...@googlegroups.com
I experience the same problem on a debian linux: "The surface visualisation works, but the "3D VTK" view doesn't work so well. The view appears in a separate window called "Visualization Toolkit - OpenGL" but it is static and I can't interact with it. Neither can I close the window, it just hangs." - without any error messages.  Was a solution or a work around found for this problem?

- alex

Niko Ehrenfeuchter

unread,
Mar 16, 2015, 12:41:23 PM3/16/15
to icy-so...@googlegroups.com
I can confirm this with an up-to-date Ubuntu 14.10 running Oracle Java
1.7.0_71-b14 (64 bit). It prints the following message:

----------------------------------------------------------------------
java.lang.UnsatisfiedLinkError:
/opt/Icy/lib/unix64/vtk/libvtkRenderingCoreJava.so: libjawt.so: cannot
open shared object file: No such file or directory
Cannot load VTK library...

Icy Version 1.6.1.1 started !
----------------------------------------------------------------------

Cheers
~Niko
> --
> You received this message because you are subscribed to the Google
> Groups "Icy imaging" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to icy-software...@googlegroups.com
> <mailto:icy-software...@googlegroups.com>.
> To post to this group, send email to icy-so...@googlegroups.com
> <mailto:icy-so...@googlegroups.com>.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/icy-software/fc1f3be7-eed6-4684-99f1-fcbb4ecc11c6%40googlegroups.com
> <https://groups.google.com/d/msgid/icy-software/fc1f3be7-eed6-4684-99f1-fcbb4ecc11c6%40googlegroups.com?utm_medium=email&utm_source=footer>.
> For more options, visit https://groups.google.com/d/optout.

--
Niko Ehrenfeuchter | Image Analysis Specialist | Biozentrum, University
of Basel | Klingelbergstr. 50/70 | CH-4056 Basel
Phone: +41 (61) 26 72673 | nikolaus.eh...@unibas.ch |
www.biozentrum.unibas.ch | www.microscopynetwork.unibas.ch

Stephane

unread,
Mar 18, 2015, 8:33:13 AM3/18/15
to icy-so...@googlegroups.com
VTK requires the libawt.so file, you may try this solution to fix the issue :
http://ubuntuforums.org/showthread.php?t=2184620

Another problem with VTK under linux is the external window appearing when you switch to 3D view. A temporary workaround is to switch to detach mode then go back to normal mode, the 3D display should get back to the original windows and interacts normally.

- Stephane

Niko Ehrenfeuchter

unread,
Mar 19, 2015, 5:20:30 AM3/19/15
to icy-so...@googlegroups.com
Hi all,

I managed to get it working now. Unfortunately the posts on the forum
mentioned below did not help (at least not directly). Somehow the VTK
library can't find the required AWT part and has to be pointed to the
correct location explicitly.

For the record, here's what I did (tested on Ubuntu 14.10, 64 bit):

* download latest Java 7 JRE from Oracle [1], x64, in tar.gz format
* install the Java packaging tool: sudo apt-get install java-package
* convert the .tar.gz into a .deb: make-jpkg jre-7u75-linux-x64.tar.gz
* install the deb: sudo dpkg -i oracle-java7-jre_7u75_amd64.deb

To run Icy with VTK, it needs to be prefixed with the library path
explicitly (or configure system-wide, but I don't like doing this). The
required library is shipped with the Oracle Java package, so no need to
install anything additional, just a modified startup command. This can
be done as follows:

cd /path/to/Icy
export LD_LIBRARY_PATH=/usr/lib/jvm/jre-7-oracle-x64/lib/amd64
/usr/lib/jvm/jre-7-oracle-x64/bin/java -jar icy.jar

Running the "updater.jar" works as well of course, you just don't get
the messages printed to the console then, that's why I preferred to run
"icy.jar" directly for testing.

Cheers
~Niko
> --
> You received this message because you are subscribed to the Google
> Groups "Icy imaging" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to icy-software...@googlegroups.com
> <mailto:icy-software...@googlegroups.com>.
> To post to this group, send email to icy-so...@googlegroups.com
> <mailto:icy-so...@googlegroups.com>.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/icy-software/bc85c6b1-e539-4a07-b94c-248949414430%40googlegroups.com
> <https://groups.google.com/d/msgid/icy-software/bc85c6b1-e539-4a07-b94c-248949414430%40googlegroups.com?utm_medium=email&utm_source=footer>.

Niko Ehrenfeuchter

unread,
Mar 19, 2015, 5:27:48 AM3/19/15
to icy-so...@googlegroups.com
Sorry, the link for the Java download was missing... Here's the full
email now.

--------------------------------------

Hi all,

I managed to get it working now. Unfortunately the posts on the forum
mentioned below did not help (at least not directly). Somehow the VTK
library can't find the required AWT part and has to be pointed to the
correct location explicitly.

For the record, here's what I did (tested on Ubuntu 14.10, 64 bit):

* download latest Java 7 JRE from Oracle [1], x64, in tar.gz format
* install the Java packaging tool: sudo apt-get install java-package
* convert the .tar.gz into a .deb: make-jpkg jre-7u75-linux-x64.tar.gz
* install the deb: sudo dpkg -i oracle-java7-jre_7u75_amd64.deb

To run Icy with VTK, it needs to be prefixed with the library path
explicitly (or configure system-wide, but I don't like doing this). The
required library is shipped with the Oracle Java package, so no need to
install anything additional, just a modified startup command. This can
be done as follows:

cd /path/to/Icy
export LD_LIBRARY_PATH=/usr/lib/jvm/jre-7-oracle-x64/lib/amd64
/usr/lib/jvm/jre-7-oracle-x64/bin/java -jar icy.jar

Running the "updater.jar" works as well of course, you just don't get
the messages printed to the console then, that's why I preferred to run
"icy.jar" directly for testing.

Cheers
~Niko

[1] http://www.oracle.com/technetwork/java/javase/downloads/index.html

On 18.03.2015 13:33, Stephane wrote:
> --
> You received this message because you are subscribed to the Google
> Groups "Icy imaging" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to icy-software...@googlegroups.com
> <mailto:icy-software...@googlegroups.com>.
> To post to this group, send email to icy-so...@googlegroups.com
> <mailto:icy-so...@googlegroups.com>.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/icy-software/bc85c6b1-e539-4a07-b94c-248949414430%40googlegroups.com
> <https://groups.google.com/d/msgid/icy-software/bc85c6b1-e539-4a07-b94c-248949414430%40googlegroups.com?utm_medium=email&utm_source=footer>.

Stephane

unread,
Mar 19, 2015, 7:25:54 AM3/19/15
to icy-so...@googlegroups.com
Hi Niko,

Glad you were able to fix your problem and thanks for detailing the fix process :) Actually i am a bit surprised you needed to patch the LD_LIBRARY_PATH variable, I expect the java installation process (via apt-get install java) to do it for you.
jawt is a required library for the JVM itself so it makes sense to have LD_LIBRARY_PATH pointing on it (/usr/lib/jvm/
jre-7-oracle-x64/lib/amd64 in your case) by default.
I wonder if this happen with OpenJDK as well or if this is specific to some version of the Oracle JVM.
Anyway that is something we can do in Icy before loading VTK : verify that jawt library is correctly loaded and if not, look for it and load it if possible =)

Best,

- Stephane

Josef Knecht

unread,
Mar 19, 2015, 11:06:48 AM3/19/15
to icy-so...@googlegroups.com
Thanks Stephane, the workaround with the detach mode works for me.

- alex

Pierre Weiss

unread,
Aug 19, 2015, 12:05:26 PM8/19/15
to Icy imaging
Dear all,

I also don't manage to have VTK working under Linux (Ubuntu 14.04). Similarly to the previous posts, when I use the 3D mode, I get an external VTK window appearing and can't interact with it (I can change the axes style, but the image surface doesn't show). I can't close it either.

This happened with the provided sources of VTK. So I've installed VTK6.2 (not 6.1) for 64 bits architecture manually using the official sources and cmake. However, it still doesn't work.

I have tried to externalize the windows since I understood from Stephane this might be a solution, however, I still get the same trouble.

Any additional idea ?

Best regards,
Pierre

Niko Ehrenfeuchter

unread,
Aug 19, 2015, 4:28:19 PM8/19/15
to icy-so...@googlegroups.com
Hi Pierre,

try switching the "Detached" mode on and off before/after activating the
3D mode. This gives me a usable 3D window, but it has to be repeated
every time you're switching to 3D.

Cheers
Niko
> --
> You received this message because you are subscribed to the Google
> Groups "Icy imaging" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to icy-software...@googlegroups.com
> <mailto:icy-software...@googlegroups.com>.
> To post to this group, send email to icy-so...@googlegroups.com
> <mailto:icy-so...@googlegroups.com>.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/icy-software/efbfb065-a2db-4022-a3d4-d20fd588d056%40googlegroups.com
> <https://groups.google.com/d/msgid/icy-software/efbfb065-a2db-4022-a3d4-d20fd588d056%40googlegroups.com?utm_medium=email&utm_source=footer>.

Pierre Weiss

unread,
Aug 20, 2015, 7:07:03 AM8/20/15
to Icy imaging
Thanks Niko.

I did it the wrong way before (the sequence of operations is open the image, switch to 3D, Externalize and internalize window). I can now interact in 3D with a slice of the volume. I don't know why I still can't see the real 3D volume, but there is progress :).

Best regards,
Pierre

Stephane

unread,
Aug 20, 2015, 7:28:51 AM8/20/15
to Icy imaging
Hi,

What you means exactly "with a slice of the volume" ? Do you mean you see only a single slice of the complete volume ?
Did you checked you pixel size ? maybe you have a wrong pixel size Z information which result in incorrect depth scaling of the volume.

Best,

- Stephane

Pierre Weiss

unread,
Aug 20, 2015, 7:44:31 AM8/20/15
to Icy imaging
Oh yeah... I'm definitely a noob in Icy and Java :).

Thanks a lot for the tip.
Pierre

Stephane

unread,
Aug 20, 2015, 8:48:27 AM8/20/15
to Icy imaging
No worries ;) That is not necessary trivial to look in the sequence informations when you want to deal about the visualization parameters !
Reply all
Reply to author
Forward
0 new messages