Copy 2D on GPU - Error while loading native library "JOCL_2_0_2-apple-unknown"
- Dominant language
- Java
- Stars
- 60
- Forks
- 16
- PR merge metrics
- No merged PRs in 30d
Description
Apple M2 MacOS Sonoma 14.5
Wanted to crop an image using CLIJ2 and got the following error:
```
ImageJ 1.54g; Java 13.0.6 [64-bit]; Mac OS X 14.5; 4681MB of 8000MB (58%)
java.lang.UnsatisfiedLinkError: Error while loading native library "JOCL_2_0_2-apple-unknown"
Operating system name: Mac OS X
Architecture : aarch64
Architecture bit size: 64
---(start of nested stack traces)---
Stack trace from the attempt to load the library as a file:
java.lang.UnsatisfiedLinkError: no JOCL_2_0_2-apple-unknown in java.library.path: [/Users/jon/Library/Java/Extensions, /Library/Java/Extensions, /Network/Library/Java/Extensions, /System/Library/Java/Extensions, /usr/lib/java, .]
at java.base/java.lang.ClassLoader.loadLibrary(ClassLoader.java:2680)
at java.base/java.lang.Runtime.loadLibrary0(Runtime.java:807)
at java.base/java.lang.System.loadLibrary(System.java:1909)
at org.jocl.LibUtils.loadLibrary(LibUtils.java:144)
at org.jocl.CL.loadNativeLibrary(CL.java:65)
at org.jocl.CL.(CL.java:51)
at net.haesleinhuepf.clij.clearcl.backend.jocl.ClearCLBackendJOCL.(ClearCLBackendJOCL.java:69)
at net.haesleinhuepf.clij.clearcl.backend.ClearCLBackends.getBestBackend(ClearCLBackends.java:100)
at net.haesleinhuepf.clij.CLIJ.getAvailableDeviceNames(CLIJ.java:212)
at net.haesleinhuepf.clij.macro.AbstractCLIJPlugin.run(AbstractCLIJPlugin.java:263)
at ij.plugin.filter.PlugInFilterRunner.processOneImage(PlugInFilterRunner.java:266)
at ij.plugin.filter.PlugInFilterRunner.(PlugInFilterRunner.java:114)
at ij.IJ.runUserPlugIn(IJ.java:246)
at ij.IJ.runPlugIn(IJ.java:210)
at ij.Executer.runCommand(Executer.java:152)
at ij.Executer.run(Executer.java:70)
at java.base/java.lang.Thread.run(Thread.java:830)
Stack trace from the attempt to load the library as a resource:
java.io.IOException: No resource found with name '/lib/libJOCL_2_0_2-apple-unknown.dylib'
at org.jocl.LibUtils.writeResourceToFile(LibUtils.java:341)
at org.jocl.LibUtils.loadLibraryResource(LibUtils.java:269)
at org.jocl.LibUtils.loadLibrary(LibUtils.java:159)
at org.jocl.CL.loadNativeLibrary(CL.java:65)
at org.jocl.CL.(CL.java:51)
at net.haesleinhuepf.clij.clearcl.backend.jocl.ClearCLBackendJOCL.(ClearCLBackendJOCL.java:69)
at net.haesleinhuepf.clij.clearcl.backend.ClearCLBackends.getBestBackend(ClearCLBackends.java:100)
at net.haesleinhuepf.clij.CLIJ.getAvailableDeviceNames(CLIJ.java:212)
at net.haesleinhuepf.clij.macro.AbstractCLIJPlugin.run(AbstractCLIJPlugin.java:263)
at ij.plugin.filter.PlugInFilterRunner.processOneImage(PlugInFilterRunner.java:266)
at ij.plugin.filter.PlugInFilterRunner.(PlugInFilterRunner.java:114)
at ij.IJ.runUserPlugIn(IJ.java:246)
at ij.IJ.runPlugIn(IJ.java:210)
at ij.Executer.runCommand(Executer.java:152)
at ij.Executer.run(Executer.java:70)
at java.base/java.lang.Thread.run(Thread.java:830)
---(end of nested stack traces)---
at org.jocl.LibUtils.loadLibrary(LibUtils.java:194)
at org.jocl.CL.loadNativeLibrary(CL.java:65)
at org.jocl.CL.(CL.java:51)
at net.haesleinhuepf.clij.clearcl.backend.jocl.ClearCLBackendJOCL.(ClearCLBackendJOCL.java:69)
at net.haesleinhuepf.clij.clearcl.backend.ClearCLBackends.getBestBackend(ClearCLBackends.java:100)
at net.haesleinhuepf.clij.CLIJ.getAvailableDeviceNames(CLIJ.java:212)
at net.haesleinhuepf.clij.macro.AbstractCLIJPlugin.run(AbstractCLIJPlugin.java:263)
at ij.plugin.filter.PlugInFilterRunner.processOneImage(PlugInFilterRunner.java:266)
at ij.plugin.filter.PlugInFilterRunner.(PlugInFilterRunner.java:114)
at ij.IJ.runUserPlugIn(IJ.java:246)
at ij.IJ.runPlugIn(IJ.java:210)
at ij.Executer.runCommand(Executer.java:152)
at ij.Executer.run(Executer.java:70)
at java.base/java.lang.Thread.run(Thread.java:830)
```
Contributor guide
No contributing guide indexed for this repository
Research direction
Start at ClearCLBackends.getBestBackend and ClearCLBackendJOCL, then inspect the JOCL native-library loading shown in the stack trace. Reproduce the failure on an Apple M2 Mac with the stated ImageJ and Java versions, and determine whether the required native library is available; done means the CLIJ2 crop operation loads successfully without UnsatisfiedLinkError.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java, macos
- Domain
- operating-systems
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100