Hi,
I'm working to get JavaCL to work on OS X Sierra.
With JavaCL and BridJ 0.7.0, I experienced a hang trying to initialize JavaCL. The java stack looks like this:
JNI.loadLibrarySymbols(String) line: not available [native method]
NativeLibrary.load(String) line: 158
BridJ.getNativeLibrary(String, File) line: 1046
BridJ.getNativeLibrary(String) line: 1038
BridJ.getNativeLibrary(AnnotatedElement) line: 607
CRuntime.getNativeLibrary(Class<?>) line: 488
CRuntime.register(Type, NativeLibrary, CRuntime$MethodCallInfoBuilder) line: 385
CRuntime.register(Type) line: 345
BridJ.register(Class<?>) line: 363
BridJ.register() line: 203
JavaCL$OpenCLProbeLibrary.<clinit>() line: 94
JavaCL.<clinit>() line: 120
The C-stack looks like this:
thread #29: tid = 0xd52e5, 0x0000000126023226 libbridj.dylib`decode_leb128 + 54, name = 'Java: UT Thread'
frame #0: 0x0000000126023226 libbridj.dylib`decode_leb128 + 54
frame #1: 0x0000000126023589 libbridj.dylib`visitTrie + 377
frame #2: 0x00000001260235e4 libbridj.dylib`visitTrie + 468
frame #3: 0x00000001260235e4 libbridj.dylib`visitTrie + 468
====tons of repeated frames
frame #253: 0x00000001260235e4 libbridj.dylib`visitTrie + 468
frame #254: 0x00000001260235e4 libbridj.dylib`visitTrie + 468
frame #255: 0x00000001260235e4 libbridj.dylib`visitTrie + 468
frame #256: 0x00000001260235e4 libbridj.dylib`visitTrie + 468
frame #257: 0x0000000126023892 libbridj.dylib`dlSymsInit + 466
frame #258: 0x0000000126019f3c libbridj.dylib`Java_org_bridj_JNI_loadLibrarySymbols + 124
This can be fixed by upgrading BridJ to 0.7.1-SNAPSHOT. However, with this snapshot, it seems that there are linking errors.
Trying to rebuild JavaCL from source isn't successful either. The code builds OK but the tests seem to fail:
-------------------------------------------------------
T E S T S
-------------------------------------------------------
Feb 17, 2017 5:17:27 PM org.bridj.BridJ log
INFO: Library not found : atiocl64
Feb 17, 2017 5:17:27 PM org.bridj.BridJ log
INFO: Library not found : amdocl64
Feb 17, 2017 5:17:27 PM org.bridj.BridJ log
INFO: Library not found : atiocl32
Feb 17, 2017 5:17:27 PM org.bridj.BridJ log
INFO: Library not found : atiocl
Feb 17, 2017 5:17:27 PM org.bridj.BridJ log
INFO: Library not found : amdocl32
Feb 17, 2017 5:17:27 PM org.bridj.BridJ log
INFO: Library not found : amdocl
Running com.nativelibs4java.opencl.BinaryKernelTest
Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 0.01 sec <<< FAILURE! - in com.nativelibs4java.opencl.BinaryKernelTest
initializationError(com.nativelibs4java.opencl.BinaryKernelTest) Time elapsed: 0.009 sec <<< ERROR!
java.lang.NoClassDefFoundError: Could not initialize class com.nativelibs4java.opencl.JavaCL
at com.nativelibs4java.opencl.AbstractCommon.getDeviceParameters(AbstractCommon.java:49)
at com.nativelibs4java.opencl.BinaryKernelTest.getDeviceParameters(BinaryKernelTest.java:26)
Running com.nativelibs4java.opencl.BufferReadTest
Feb 17, 2017 5:17:28 PM org.bridj.BridJ log
INFO: Library not found : atiocl64
Feb 17, 2017 5:17:28 PM org.bridj.BridJ log
INFO: Library not found : amdocl64
Feb 17, 2017 5:17:28 PM org.bridj.BridJ log
INFO: Library not found : atiocl32
Feb 17, 2017 5:17:28 PM org.bridj.BridJ log
INFO: Library not found : atiocl
Feb 17, 2017 5:17:28 PM org.bridj.BridJ log
INFO: Library not found : amdocl32
Feb 17, 2017 5:17:28 PM org.bridj.BridJ log
INFO: Library not found : amdocl
Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 0.125 sec <<< FAILURE! - in com.nativelibs4java.opencl.BufferReadTest
testBufferRead(com.nativelibs4java.opencl.BufferReadTest) Time elapsed: 0.122 sec <<< ERROR!
java.lang.UnsatisfiedLinkError: com.nativelibs4java.opencl.JavaCL$OpenCLProbeLibrary.clGetPlatformIDs(ILorg/bridj/Pointer;Lorg/bridj/Pointer;)I
at com.nativelibs4java.opencl.JavaCL$OpenCLProbeLibrary.clGetPlatformIDs(Native Method)
at com.nativelibs4java.opencl.JavaCL$OpenCLProbeLibrary.getPlatformIDs(JavaCL.java:150)
at com.nativelibs4java.opencl.JavaCL$OpenCLProbeLibrary.getPlatformIDs(JavaCL.java:155)
at com.nativelibs4java.opencl.JavaCL$OpenCLProbeLibrary.hasOpenCL1_0(JavaCL.java:166)
at com.nativelibs4java.opencl.JavaCL.<clinit>(JavaCL.java:225)
at com.nativelibs4java.opencl.BufferReadTest.initializeCLContextAndQueueOrNothing(BufferReadTest.java:114)
at com.nativelibs4java.opencl.BufferReadTest.initializeCLStuff(BufferReadTest.java:104)
at com.nativelibs4java.opencl.BufferReadTest.setUp(BufferReadTest.java:31)
I'd like to debug this further but I'm not sure where to go from here. I used a Retina, 15-inch, Mid 2014 MBP, but I believe this issue exists on any mac with Sierra.
Here's a related discussion from the ClearCL folks:
https://github.com/ClearVolume/imglib2-clearvolume/issues/9Regards,
Benjamin