Cannot load native libOpenCL.so library from Maven resource

885 Views Asked by At

I'm getting unsatisfied link errors when trying to use JOCL. The error is a typical unsatisfied link error:

Stack trace from the attempt to load the library as a resource:
java.lang.UnsatisfiedLinkError: Could not initialize native library. Implementation library 'libOpenCL.so' could not be loaded

It then goes on to say that:

Could not load libOpenCL.so, error libOpenCL.so: cannot open shared object file: No such file or directory

I tried adding it as a resource to Maven via:

<build>
    <sourceDirectory>src/main/scala</sourceDirectory>
    <testSourceDirectory>src/test/scala</testSourceDirectory>
    <resources>
        <resource>
            <filtering>false</filtering>
            <directory>/opt/AMDAPPSDK-3.0-0-Beta/lib/x86_64</directory>
            <includes>
                <include>libOpenCL.so</include>
            </includes>
        </resource>
    </resources>
    ...

As disclaimer, libOpenCL.so is a soft link to -> libOpenCL.so.1, I don't know if that'll mess things up. Anyway, I checked the file name and path several times, the file is there. How can I add this lib to my class path?

0

There are 0 best solutions below