From 8752f9a0bdded5bc26da7392b8da9848387dacee Mon Sep 17 00:00:00 2001 From: Sven Gothel Date: Sun, 18 Dec 2011 23:36:30 +0100 Subject: Attempt to load 'libOpenCL.so.1' if 'OpenCL' fails (-> AMD 32bit on 64bit machine) --- src/com/jogamp/opencl/JOCLJNILibLoader.java | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'src/com') 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() { 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; } }); } -- cgit v1.2.3