0
我想重複使用Android Eclipse項目來使用OpenCL庫。 我曾經爲我之前的手機設置了我的eclipse項目三星阿爾法。 現在我得到一個moto Z,我想修改這個項目來重用它。在Android項目中集成LibOpenCL
我從我的手機得到libOpenCL.so文件,我伸出改變我的項目中的文件,但編輯給我的錯誤:
[x86_64] SharedLibrary : libJNIProcessor.so
/home/xxxx/NVPACK/android-sdk-linux/ndk-bundle/toolchains/x86_64-4.9/prebuilt/linux-x86_64/lib/gcc/x86_64-linux-android/4.9.x/../../../../x86_64-linux-android/bin/ld: error: jni/libs/libOpenCL.so: incompatible target
jni/include/CL/cl.hpp:1090: error: undefined reference to 'clReleaseContext'
jni/include/CL/cl.hpp:1099: error: undefined reference to 'clReleaseCommandQueue'
jni/include/CL/cl.hpp:1135: error: undefined reference to 'clReleaseKernel'
jni/processor.cpp:143: error: undefined reference to 'clRetainProgram'
jni/processor.cpp:145: error: undefined reference to 'clGetProgramInfo'
jni/processor.cpp:147: error: undefined reference to 'clGetProgramBuildInfo'
jni/processor.cpp:152: error: undefined reference to 'clGetProgramBuildInfo'
jni/processor.cpp:156: error: undefined reference to 'clGetProgramBuildInfo'
jni/processor.cpp:159: error: undefined reference to 'clReleaseProgram'
jni/include/CL/cl.hpp:2878: error: undefined reference to 'clEnqueueWriteBuffer'
jni/include/CL/cl.hpp:1106: error: undefined reference to 'clRetainMemObject'
jni/include/CL/cl.hpp:2548: error: undefined reference to 'clSetKernelArg'
jni/include/CL/cl.hpp:1108: error: undefined reference to 'clReleaseMemObject'
jni/include/CL/cl.hpp:1106: error: undefined reference to 'clRetainMemObject'
jni/include/CL/cl.hpp:2548: error: undefined reference to 'clSetKernelArg'
jni/include/CL/cl.hpp:1108: error: undefined reference to 'clReleaseMemObject'
jni/include/CL/cl.hpp:2548: error: undefined reference to 'clSetKernelArg'
jni/include/CL/cl.hpp:2548: error: undefined reference to 'clSetKernelArg'
jni/include/CL/cl.hpp:1106: error: undefined reference to 'clRetainMemObject'
jni/include/CL/cl.hpp:1108: error: undefined reference to 'clReleaseMemObject'
jni/include/CL/cl.hpp:1106: error: undefined reference to 'clRetainMemObject'
jni/include/CL/cl.hpp:1108: error: undefined reference to 'clReleaseMemObject'
jni/include/CL/cl.hpp:3248: error: undefined reference to 'clEnqueueNDRangeKernel'
jni/include/CL/cl.hpp:1144: error: undefined reference to 'clReleaseEvent'
jni/include/CL/cl.hpp:1090: error: undefined reference to 'clReleaseContext'
jni/include/CL/cl.hpp:1088: error: undefined reference to 'clRetainContext'
jni/include/CL/cl.hpp:1090: error: undefined reference to 'clReleaseContext'
jni/include/CL/cl.hpp:1045: error: undefined reference to 'clGetContextInfo'
jni/include/CL/cl.hpp:1099: error: undefined reference to 'clReleaseCommandQueue'
jni/include/CL/cl.hpp:1097: error: undefined reference to 'clRetainCommandQueue'
jni/include/CL/cl.hpp:1099: error: undefined reference to 'clReleaseCommandQueue'
jni/include/CL/cl.hpp:2668: error: undefined reference to 'clBuildProgram'
jni/include/CL/cl.hpp:2769: error: undefined reference to 'clCreateKernel'
jni/include/CL/cl.hpp:1135: error: undefined reference to 'clReleaseKernel'
jni/include/CL/cl.hpp:1133: error: undefined reference to 'clRetainKernel'
jni/include/CL/cl.hpp:1135: error: undefined reference to 'clReleaseKernel'
jni/include/CL/cl.hpp:2769: error: undefined reference to 'clCreateKernel'
jni/include/CL/cl.hpp:1135: error: undefined reference to 'clReleaseKernel'
jni/include/CL/cl.hpp:1133: error: undefined reference to 'clRetainKernel'
jni/include/CL/cl.hpp:2769: error: undefined reference to 'clCreateKernel'
jni/include/CL/cl.hpp:1133: error: undefined reference to 'clRetainKernel'
jni/include/CL/cl.hpp:1090: error: undefined reference to 'clReleaseContext'
jni/include/CL/cl.hpp:1099: error: undefined reference to 'clReleaseCommandQueue'
/home/xxx/NVPACK/android-sdk-linux/ndk-bundle/build/core/build-binary.mk:702 : la recette pour la cible « obj/local/x86_64/libJNIProcessor.so » a échouée
jni/include/CL/cl.hpp:1473: error: undefined reference to 'clGetPlatformIDs'
jni/include/CL/cl.hpp:1480: error: undefined reference to 'clGetPlatformIDs'
jni/include/CL/cl.hpp:1534: error: undefined reference to 'clCreateContextFromType'
jni/include/CL/cl.hpp:2791: error: undefined reference to 'clCreateCommandQueue'
jni/include/CL/cl.hpp:2602: error: undefined reference to 'clCreateProgramWithSource'
jni/include/CL/cl.hpp:1126: error: undefined reference to 'clReleaseProgram'
jni/include/CL/cl.hpp:1037: error: undefined reference to 'clGetProgramBuildInfo'
jni/include/CL/cl.hpp:1855: error: undefined reference to 'clCreateBuffer'
clang++: error: linker command failed with exit code 1 (use -v to see invocation)
編輯: 我刪除所有的OpenCL計劃,我只是設置OpenCL的lib和我得到的是:
x86_64-linux-android/bin/ld: error: jni/libs/libOpenCL.so: incompatible target
/home/xxxx/NVPACK/android-sdk-linux/ndk-bundle/build/core/build-binary.mk:702 : la recette pour la cible « obj/local/x86_64/libJNIProcessor.so » a échouée
編輯2:
我終於下載NDK10e(我用的,當我第一次編譯該項目的名稱)和建設工程。但在執行我得到的日誌錯誤:
02-22 10:00:41.077 7302 7302 D AndroidRuntime: Shutting down VM
02-22 10:00:41.078 7302 7302 E AndroidRuntime: FATAL EXCEPTION: main
02-22 10:00:41.078 7302 7302 E AndroidRuntime: Process: com.example.subsamplecamera, PID: 7302
02-22 10:00:41.078 7302 7302 E AndroidRuntime: java.lang.UnsatisfiedLinkError: dlopen failed: library "libGLES_mali.so" not found
02-22 10:00:41.078 7302 7302 E AndroidRuntime: at java.lang.Runtime.loadLibrary0(Runtime.java:977)
02-22 10:00:41.078 7302 7302 E AndroidRuntime: at java.lang.System.loadLibrary(System.java:1530)
02-22 10:00:41.078 7302 7302 E AndroidRuntime: at com.example.subsamplecamera.MainActivity.<clinit>(MainActivity.java:30)
02-22 10:00:41.078 7302 7302 E AndroidRuntime: at java.lang.Class.newInstance(Native Method)
02-22 10:00:41.078 7302 7302 E AndroidRuntime: at android.app.Instrumentation.newActivity(Instrumentation.java:1100)
02-22 10:00:41.078 7302 7302 E AndroidRuntime: at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2551)
02-22 10:00:41.078 7302 7302 E AndroidRuntime: at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2724)
02-22 10:00:41.078 7302 7302 E AndroidRuntime: at android.app.ActivityThread.-wrap12(ActivityThread.java)
02-22 10:00:41.078 7302 7302 E AndroidRuntime: at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1473)
02-22 10:00:41.078 7302 7302 E AndroidRuntime: at android.os.Handler.dispatchMessage(Handler.java:102)
02-22 10:00:41.078 7302 7302 E AndroidRuntime: at android.os.Looper.loop(Looper.java:154)
02-22 10:00:41.078 7302 7302 E AndroidRuntime: at android.app.ActivityThread.main(ActivityThread.java:6123)
02-22 10:00:41.078 7302 7302 E AndroidRuntime: at java.lang.reflect.Method.invoke(Native Method)
02-22 10:00:41.078 7302 7302 E AndroidRuntime: at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.ru
但我沒有馬裏GPU,爲什麼項目呼籲馬裏庫
編輯3: 我終於成功了,程序編譯正確和應用程序運行。 我將標準NDK10e更改爲Snapdragon LLVM,它看起來可行。 現在我OpenCL的內核executiong:
gQueue.enqueueNDRangeKernel(gNV21Kernel,
cl::NullRange,
cl::NDRange((int)ceil((float)w/16.0f)*16,(int)ceil((float)h/16.0f)*16),
cl::NDRange(4,1),
NULL,
NULL);
我不明白,錯誤過程中添加一個錯誤。有人可以幫我解決這個問題嗎? CL ::錯誤-36
謝謝你的回答。 OpenCL lib似乎得到了支持,因爲在Qualcomm網站上有用於我的芯片組的OpenCL文件的adrenosdk,但是沒有完整的項目。 –
沒關係! :)讓我檢查一下對你來說 –
你能分享鏈接寫在哪裏OpenCL lib被支持嗎? –