summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/com/jogamp/opencl/JOCLJNILibLoader.java10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/com/jogamp/opencl/JOCLJNILibLoader.java b/src/com/jogamp/opencl/JOCLJNILibLoader.java
index 328c2237..de100d3c 100644
--- a/src/com/jogamp/opencl/JOCLJNILibLoader.java
+++ b/src/com/jogamp/opencl/JOCLJNILibLoader.java
@@ -51,12 +51,20 @@ class JOCLJNILibLoader extends JNILibLoaderBase {
return AccessController.doPrivileged(new PrivilegedAction<NativeLibrary>() {
public NativeLibrary run() {
Platform.initSingleton();
+
+ // Implementation should move to com.jogamp.common.os.DynamicLibraryBundleInfo,
+ // eg.: jogamp.opengl.GLDynamicLibraryBundleInfo etc.
final String libName = "jocl";
if(TempJarCache.isInitialized() && null == TempJarCache.findLibrary(libName)) {
addNativeJarLibs(JOCLJNILibLoader.class, "jocl", null );
}
loadLibrary(libName, false);
- return NativeLibrary.open("OpenCL", JOCLJNILibLoader.class.getClassLoader());
+ NativeLibrary res = NativeLibrary.open("OpenCL", JOCLJNILibLoader.class.getClassLoader());
+ if(null == res) {
+ // try unix name w/ version (eg.: AMD has a /usr/lib32/fglrx/libOpenCL.so.1 only)
+ res = NativeLibrary.open("libOpenCL.so.1", JOCLJNILibLoader.class.getClassLoader());
+ }
+ return res;
}
});
}