Native library does not find its (system) dependencies

Hi,

I would like to try to use the GPU to speed up some of my app's calculations. My hope is that it is possible to create a native library which does the calculations on the GPU via OpenCL. The android system I am debugging on has OpenCL installed (the so-files are in /system/vendor/lib).

When starting the app, the app finds my own wrapper-library, tries to load it, and eventually fails because it does not find libOpenCL.so.
My impression is that, for some reason, the app does not search in /system/vendor/lib for potentially required libraries.

I have tried circumventing the problem by adding the libOpenCL.so to the APK of my app. Now DllImport can load the libOpenCL.so, but fails at finding its dependencies (e.g. libgsl.so, which itself is again in /system/vendor/lib).

Is there a way to define additional search directories for the DllImport? Or what is the proper method for importing system libraries?

Best,
Peter

Sign In or Register to comment.