Compute library compile
2017-05-18 10:16
831 查看
Android(NDK) build
gsc@X250:~/Downloads$ cd /opt/android-ndk-r14b/ gsc@X250:/opt/android-ndk-r14b$ ls build ndk-build ndk-gdb ndk-which prebuilt shader-tools source.properties sysroot CHANGELOG.md ndk-depends ndk-stack platforms python-packages simpleperf sources toolchains
gsc@X250:/opt/android-ndk-r14b/build/tools$ sudo ./make_standalone_toolchain.py --arch arm --install-dir /opt/arm-linux-androideabi-4.9 --stl gnustl WARNING:__main__:Defaulting to target API 9 (minimum supported target for arm) gsc@X250:/opt/android-ndk-r14b/build/tools$ sudo ./make_standalone_toolchain.py --arch arm64 --install-dir /opt/aarch64-linux-androideabi-4.9 --stl gnustl WARNING:__main__:Defaulting to target API 21 (minimum supported target for arm64)
gsc@X250:~/ComputeLibrary$ CXX=clang++ CC=clang scons Werror=1 -j8 debug=1 neon=1 opencl=0 os=android arch=armv7a scons: Reading SConscript files ... scons: done reading SConscript files. scons: Building targets ...
question
/opt/arm-linux-androideabi-4.9/bin/../lib/gcc/arm-linux-androideabi/4.9.x/../../../../arm-linux-androideabi/bin/ld: error: cannot find -lOpenCL
This is because the library is platform dependent, so for example if we want to use it in one of qualcomm platform.
gsc@X250:/media/gsc//8074_XXX$ find ./ -name *OpenCL.so ./ap/out/target/product/msm8974/symbols/system/vendor/lib/libOpenCL.so ./ap/out/target/product/msm8974/system/vendor/lib/libOpenCL.so ./ap/out/target/product/msm8974/obj/SHARED_LIBRARIES/libOpenCL_intermediates/PACKED/libOpenCL.so ./ap/out/target/product/msm8974/obj/SHARED_LIBRARIES/libOpenCL_intermediates/LINKED/libOpenCL.so ./ap/out/target/product/msm8974/obj/lib/libOpenCL.so
we just copy and compile it
cp ./ap/out/target/product/msm8974/system/vendor/lib/libOpenCL.so ~/ComputeLibrary/build/arm_compute/ ##support both neon and OpenCL CXX=clang++ CC=clang scons Werror=1 -j8 debug=1 neon=1 opencl=1 os=android arch=armv7a
test
push 32-bit system filesadb push neon_convolution /data/local/tmp/ adb push cl_convolution /data/local/tmp/ adb shell chmod 777 -R /data/local/tmp/
run
adb shell /data/local/tmp/neon_convolution adb shell /data/local/tmp/cl_convolution
相关文章推荐
- compile/link prebuilt nonstatic java library failed?
- GitHub上制作自己的Library,直接compile使用
- Android Studio Error:Execution failed for task ':library:compileReleaseJava'
- This support library should not use a different version (25) than the compileSdkVersion
- Error:Cannot compile Groovy files: no Groovy library is defined for module "XXX"
- how to compile and link static/dynamic library in linux
- 通过ARM Compute Library写的VGG16的模型
- How to compile the IJG JPEG library (libjpeg) for Visual Studio 2010
- 使用DataBinding框架遇到的错误——找不到符号类 BR 程序包 com.android.databinding.library.baseAdapters app:compileDebugJav
- How to compile COBOL program into shared library
- This support library should not use a different version(x)than the compileSdkVersion(y)
- ImportError: Cannot load dynamic library. Did you compile FLANN?
- 关于This support library should not use a different version than the compilesdkversion
- ARM Compute Library
- Torch - 错误 getrf : Lapack library not found in compile time
- 关于Error: Can't compile duplicate declarations of entity "**" into library "work"的错误
- Compile and use shared library
- This support library should not use a different version (24) than the compileSdkVersion (23)...
- Extending sparklyr to Compute Cost for K-means on YARN Cluster with Spark ML Library
- errors during compile libson library