1

尝试使用 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 是指向 -> libOpenCL.so.1 的软链接,我不知道这是否会搞砸。无论如何,我检查了几次文件名和路径,文件在那里。如何将此库添加到我的类路径中?

4

0 回答 0