diff options
author | Sven Gothel <[email protected]> | 2011-12-18 23:36:30 +0100 |
---|---|---|
committer | Sven Gothel <[email protected]> | 2011-12-18 23:36:30 +0100 |
commit | 8752f9a0bdded5bc26da7392b8da9848387dacee (patch) | |
tree | daf94ab207924711cf70e50579c3da655e2a3339 /src | |
parent | 970afd0ee8d69c09d90a59b90afd2149a6b211b5 (diff) |
Attempt to load 'libOpenCL.so.1' if 'OpenCL' fails (-> AMD 32bit on 64bit machine)
Diffstat (limited to 'src')
-rw-r--r-- | src/com/jogamp/opencl/JOCLJNILibLoader.java | 10 |
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; } }); } |