Building vtk 9.4.0 on windows Java

Hello,

Loading libstdc++ from /lib/x86_64-linux-gnu is unusual. I’d expect it to be loaded from /usr/local/lib64. Maybe there’s something amiss in your LD_LIBRARY_PATH.

More details here: c++ - "`GLIBCXX_3.4.32' not found" error at runtime. GCC 13.2.0 - Stack Overflow

best,

PC

We do build the VTK maven package with a very recent GLIBCXX which is undesirable, the reason for this is that we used our current CI image (based on fedora 39). In future iterations we will move to an older/more stable distro that ships an older glibc. Probably RHEL8 (Alma).

If you are using a distro with an older glibc, I recommend a tool such as a distrobox

Vicente

Good morning all. Merry Xmas and a happy 2025 to you all. Thanks for the Java build solution for 9.4.0.

While waiting for 9.4.1 release, I went back to my last clean 9.. build, ie 9.3.1. The build was clean but when I tried to run it, it fails on load as in the attached log.
(error: The specified procedure could not be found)

(vtk931test.txt)

I have tried several tricks including checking the missing base entries in Cmake, to no avail. Example as in attachment

(cmakeConfigEntries.png)

It seems these dll’s are not built. There may well be no instruction to build them else an error would show:

vtkRenderingLICOpenGL2Java.dll
vtkRenderingCellGridJava.dll
vtkIOCellGridJava.dll
vtkIOCONVERGECFDJava.dll
vtkFiltersGeometryPreviewJava.dll
vtkFiltersCellGridJava.dll
vtkRenderingUIJava.dll

I suspect 9.4.1 will still harbour this error.
What am I doing wrong? Please help. Thanks

ngwarai

(attachments)


vtk931test.txt (5.61 KB)

There have been some changes in the maven package generation code since vtk 9.4.0. I recommend you to try the current tip of the release branch of VTK. Note that we have not yet done an official maven release of any vtk 9.4 due to existing issues in some platforms that we are working on correcting.

Vicente

Good morning Vicente and thanks for the early response. I am afraid I do need some hand-holding here. How do I get to try the “current tip of the release branch of VTK”.

If you don’t mid giving me a guide, I will dive in head first and give it a bash. Thanks very much in advance.

ngwarai

What I refer to with the tip of the release branch is the last (most recent) commit of the git release branch in the VTK source code repository. You can find the VTK source at https://gitlab.kitware.com/vtk/vtk

Let me know if you need further guidance.

Thanks Vicente. I got the source. I will build it and report back. Thanks again.

ngwarai

Good afternoon Vicente, the vtkMaster makes a clean build on VS2022 for Java 8. Thanks to David and the team.

(log attached - vtkMaster build log_Java_8.txt)

I am now setting up to run it and check for those missing dll’s from vtk_9.3.1 (last clean build). I will report back soon. Thanks very much.

ngwarai

(attachments)

vtkMaster build log_Java_8.txt (1.29 MB)

Good afternoon again Vicente. I ran into an unexpected problem. The Wrapping Java would not clean compile. I have attached the error message obtained.

java compile error.txt

It may possible to manually work around this and I will try. Thanks

ngwarai

(attachments)

java compile error.txt (816 Bytes)

Hi Ngwarai, the following error is about “vtkFastLabeledDataMapper” which is a class from the “master” branch of VTK. Perhaps you accidentally downloaded the “master” branch instead of the “release” branch for VTK 9.4.1?

error: GetInput() in vtkFastLabeledDataMapper cannot override GetInput() in vtkPolyDataMapper
  public vtkDataSet GetInput()
                    ^
  return type vtkDataSet is not compatible with vtkPolyData

Thanks David and good afternoon. I’m glad it is a known problem. I will look for the ‘release’ version and have another bash. Thanks again.

ngwarai

Thanks David, the build down to the java jar is clean as in vtk9.3.1. However the latter failed at load due to missing dll’s which may never have been built. I will try 9.4.1 hoping to pass this hurdle. Will report in the morning tomorrow. Thanks very much.

ngwarai

Good morning David. I see 9.4.1 is officially out. I did get the release version and it built clean. When I tried to run it, there was a load failure due to missing DLL’s. However when I checked, these DLLS’s are actually there on the system. Thus there must be something missing on my system, perhaps a DLL.
I need to find out what it is. I will report back. Thanks very much. I have attached the failure log

(attachments)

vtk941 load failure log java8.txt (11.6 KB)

Good morning David. The build remains clean on the 9.4.1 official release. However, I’m pretty much stuck on the “api-ms-win-*.dll” load-failure. I have tried to rebuild with

“CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS:”

Problem remains. I have no clue what is missing from my system. Will continue to fight on. Thanks

ngwarai

Hi Ngwarai, I’ve never seen that error. Please verify that you have a recent “Microsoft Visual C++ Redistributable” package installed on your computer (see “Settings/Apps” image below). In fact, there are usually two (one for x86, and one for x64).

The installers are included with Visual Studio 2022, in the following directory:

Good afternoon David and thanks for the response. Yes, those two install packages are there but I have specifically never install-run them. Let me do the install and build the system from start, I will report back tomorrow. Thanks very much for the lead. I had no clue about these and was looking in the wrong direction.

ngwarai

Good evening David and thanks for the lead. I installed the two packages and built afresh. However the problem persisted. I am rebuilding again with new cmake parameter settings for the standard windows runtime as in attached.

I will report tomorrow. Thanks
ngwarai

(attachments)

Good afternoon. The new build did not work either. Will now try earlier versions of VS. Thanks

ngwarai

Good evening David. I have thrown in the towel on 9.4.1 Java. I have tried every suggestion without any luck. But there could be someone out there running 9.4.1 on java who might give clues as to the source of my error.

Thanks.
ngwarai

Good morning David. Ever since vtk_9.4.1 was released, I have been building the RELEASE version with vs 2022. The build was clean but java would not load, never mind run. The loading error suggested missing DLL’s of which I downloaded many in trial and error. Nothing worked and I almost gave up.

I have just built the DEBUG version of it and it LOADS & RUNS! There is obviously something in DEBUG that is missing from RELEASE. No idea what it is but I shall look for it while happily running my new vtk_9.4.1 on Java 8.
Thanks to the team for all the help.

ngwarai