YaccConstructor / Brahma.FSharp

F# quotation to OpenCL translator and respective runtime to utilize GPGPUs in F# applications.
http://yaccconstructor.github.io/Brahma.FSharp
Eclipse Public License 1.0
74 stars 17 forks source link

OpenCL DLL path is hardcoded, dll could not be loaded properly on Non-Debian Linux distros #123

Closed m0rphed closed 2 years ago

m0rphed commented 2 years ago

Describe the bug Brahma is looking for OpenCL DLLs at specific directory /usr/lib/x86_64-linux-gnu wich exists only on Debian-based linux distributions.

The specific path in Debian is used for Multiarch libraries.

The proper location of libOpenCL.so.1.0.0 dll may vary in some distributions (for some distros the default path is /usr/lib/libOpenCL.so.1.0.0), nevertheless currently it's not possible to specify exact location in any way, because it's hardcoded :point_right: here

So, execution fails with: image

To Reproduce Running Brahma.FSharp (checked versions: alpha7.1 - alpha9.1) on non-debian Linux distributions will result in an error:

"Unable to load shared library '/usr/lib/x86_64-linux-gnu/libOpenCL.so.1.0.0' or one of its dependencies. In order to help diagnose loading problems, consider setting the LD_DEBUG environment variable: /usr/lib/x86_64-linux-gnu/libOpenCL.so.1.0.0: cannot open shared object file: No such file or directory"

Could be hot-fixed by linking dlls

sudo ln -s /usr/lib/libOpenCL.so.1.0.0 /usr/lib/x86_64-linux-gnu/libOpenCL.so.1.0.0

This "hot-fix" probably needs to be documented somewhere :confused: to help early-adopters