无法从Maven资源加载本机libOpenCL.so库

时间:2015-05-31 19:07:06

标签: java maven java-native-interface jocl

我在尝试使用JOCL时遇到不满意的链接错误。该错误是典型的不满意的链接错误:

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

然后继续说:

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

我尝试通过以下方式将其作为资源添加到Maven:

<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>
    ...

作为免责声明,libOpenCL.so是指向&gt;的软链接。 libOpenCL.so.1,我不知道这是否会搞砸。无论如何,我多次检查文件名和路径,文件就在那里。如何将此lib添加到我的类路径?

0 个答案:

没有答案