Problems adding scalismo-faces to a Scalismo project on Mac M1

41 views
Skip to first unread message

Maximilian Weiherer

unread,
Aug 15, 2022, 8:47:15 AM8/15/22
to scalismo-faces
Dear all, 

I am trying to add the scalismo-faces dependency to a Scalismo project on Mac M1, ARM architecture. When I try to instantiate a ScalismoUI object, I receive the following error:

Exception in thread "main" java.lang.reflect.InvocationTargetException
    at java.desktop/java.awt.EventQueue.invokeAndWait(EventQueue.java:1371)
    at java.desktop/java.awt.EventQueue.invokeAndWait(EventQueue.java:1346)
    at java.desktop/javax.swing.SwingUtilities.invokeAndWait(SwingUtilities.java:1480)
    at scalismo.ui.util.EdtUtil$.onEdtWait(EdtUtil.scala:60)
    at scalismo.ui.api.ScalismoUI.<init>(ScalismoUI.scala:30)
    at scalismo.ui.api.ScalismoUI$.apply(ScalismoUI.scala:72)
    at Main$.delayedEndpoint$Main$1(Main.scala:11)
    at Main$delayedInit$body.apply(Main.scala:7)
    at scala.Function0.apply$mcV$sp(Function0.scala:39)
    at scala.Function0.apply$mcV$sp$(Function0.scala:39)
    at scala.runtime.AbstractFunction0.apply$mcV$sp(AbstractFunction0.scala:17)
    at scala.App.$anonfun$main$1(App.scala:76)
    at scala.App.$anonfun$main$1$adapted(App.scala:76)
    at scala.collection.IterableOnceOps.foreach(IterableOnce.scala:563)
    at scala.collection.IterableOnceOps.foreach$(IterableOnce.scala:561)
    at scala.collection.AbstractIterable.foreach(Iterable.scala:926)
    at scala.App.main(App.scala:76)
    at scala.App.main$(App.scala:74)
    at Main$.main(Main.scala:7)
    at Main.main(Main.scala)
Caused by: java.lang.UnsatisfiedLinkError: 'java.lang.String vtk.vtkGenericOpenGLRenderWindow.GetClassName_0()'
    at vtk.vtkGenericOpenGLRenderWindow.GetClassName_0(Native Method)
    at vtk.vtkGenericOpenGLRenderWindow.GetClassName(vtkGenericOpenGLRenderWindow.java:12)
    at vtk.vtkJavaMemoryManagerImpl.registerJavaObject(vtkJavaMemoryManagerImpl.java:85)
    at vtk.vtkObjectBase.<init>(vtkObjectBase.java:44)
    at vtk.vtkObject.<init>(vtkObject.java:94)
    at vtk.vtkWindow.<init>(vtkWindow.java:178)
    at vtk.vtkRenderWindow.<init>(vtkRenderWindow.java:602)
    at vtk.vtkOpenGLRenderWindow.<init>(vtkOpenGLRenderWindow.java:138)
    at vtk.vtkGenericOpenGLRenderWindow.<init>(vtkGenericOpenGLRenderWindow.java:130)
    at vtk.rendering.jogl.vtkJoglPanelComponent.<init>(vtkJoglPanelComponent.java:13)
    at scalismo.ui.rendering.internal.RenderingComponent.<init>(RenderingComponent.scala:35)
    at scalismo.ui.rendering.RendererPanel.<init>(RendererPanel.scala:80)
    at scalismo.ui.view.ViewportPanel.<init>(ViewportPanel.scala:51)
    at scalismo.ui.view.ViewportPanel3D.<init>(ViewportPanel.scala:103)
    at scalismo.ui.view.perspective.ThreeDOnlyPerspective.<init>(ThreeDOnlyPerspective.scala:27)
    at scalismo.ui.view.perspective.ThreeDOnlyPerspective$.instantiate(ThreeDOnlyPerspective.scala:35)
    at scalismo.ui.view.PerspectivePanel.$anonfun$perspective_$eq$2(PerspectivePanel.scala:55)
    at scalismo.ui.util.EdtUtil$.onEdtWait(EdtUtil.scala:56)
    at scalismo.ui.view.PerspectivePanel.perspective_$eq(PerspectivePanel.scala:55)
    at scalismo.ui.view.PerspectivePanel.<init>(PerspectivePanel.scala:89)
    at scalismo.ui.view.ScalismoFrame.<init>(ScalismoFrame.scala:202)
    at scalismo.ui.view.ScalismoFrame.<init>(ScalismoFrame.scala:63)
    at scalismo.ui.api.ScalismoUI.$anonfun$fr$1(ScalismoUI.scala:31)
    at scalismo.ui.util.EdtUtil$.$anonfun$onEdtWait$1(EdtUtil.scala:60)
    at scala.swing.Swing$$anon$1.run(Swing.scala:39)
    at java.desktop/java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:308)
    at java.desktop/java.awt.EventQueue.dispatchEventImpl(EventQueue.java:773)
    at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:720)
    at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:714)
    at java.base/java.security.AccessController.doPrivileged(AccessController.java:399)
    at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:86)
    at java.desktop/java.awt.EventQueue.dispatchEvent(EventQueue.java:742)
    at java.desktop/java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:203)
    at java.desktop/java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:124)
    at java.desktop/java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:113)
    at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:109)
    at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
    at java.desktop/java.awt.EventDispatchThread.run(EventDispatchThread.java:90)

Process finished with exit code 1


I am using Scala 2.13.8, Scalismo 0.91.2, and Java 18.0.2 (for x64 architecture, see https://groups.google.com/g/scalismo/c/11etp3H0Vy0). The error occurs only when I try to instantiate an UI and is independent of the Java version used. I guess VTK is the source of the problem.

Has anyone already had this problem and was able to fix it? Any hints are appreciated. 

Thanks
Max
Reply all
Reply to author
Forward
0 new messages