Hi,
I'm trying to develop an app for Android using the Android Studio and OpenCL. I've pulled the shared library libGLES_mali.so from my testing phone (a Huwaei P8) and attempted to link the library when building the app with Gradle in Android Studio. However, the build fails during linking, giving "undefined reference to clGetPlatformIDs" for each OpenCL function in the program.
From that, it seems to me like the libGLES_mali.so file doesn't have the implementation of OpenCL. So is there a OpenCL shared library file for this version?
Of course, I may just have an error in how I'm building with Android Studio, so here's the build.gradle for my app
apply plugin: 'com.android.model.application' model { repositories { libs(PrebuiltLibraries) { OpenCL { headers.srcDir "src/main/jni/CL" binaries.withType(SharedLibraryBinary) { sharedLibraryFile = file("src/main/jni/libGLES_mali.so") } } } } android { compileSdkVersion = 21 buildToolsVersion = "21.1.2" defaultConfig.with { applicationId = "org.siprop.android.openclsample" minSdkVersion.apiLevel = 19 targetSdkVersion.apiLevel = 21 versionCode = 1 versionName = "1.0" } } /* * native build settings */ android.ndk { moduleName = "openclsample-jni" CFlags.add("-I${file("src/main/jni/CL")}".toString()) ldLibs.addAll(["android", "log", "GLES_mali"]) // ldLibs = ["android", "log", "opencl"] stl = "stlport_static" } android.buildTypes { release { minifyEnabled false proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' } } android.productFlavors { create("arm8") { ndk.abiFilters.add("arm64-v8a") } } android.sources { main { jni { dependencies { library "OpenCL" linkage "shared" } } } } } dependencies { compile fileTree(dir: 'libs', include: ['*.jar']) compile 'com.android.support:appcompat-v7:21.0.0' }
I appreciate any help, thanks for your time,