PCL(Point Cloud Library) can use on Android, but don’t supply Android binary. So let’s build PCL using Android NDK on MacOS 10.9.4!! verrrry easy to build.
wget http://dl.google.com/android/ndk/android-ndk-r8c-darwin-x86.tar.bz2 tar -jxvf android-ndk-r8c-darwin-x86.tar.bz2 cd android-ndk-r8c export ANDROID_NDK=$PWD cd ~work git clone https://github.com/hirotakaster/pcl-superbuild.git cd pcl-superbuild mkdir build cd build cmake ../ make -j4 # j4 is prallel build option
All build finish, you will find following include and library.
Next build android application(like a Google Project tango) with PCL and NDK library.
「How to build PCL for Android memo」への13件のフィードバック
Do you have any idea how to compile pcl with android ndk r10e ?
Sorry, I don’t try r10e. Do you already try it?
yeah, just replace toolchain-android.cmake with the toolchain from opencv library. It will show some errors. but can be solved by this link: https://hcteq.wordpress.com/2014/07/14/compiling-pcl-for-android-in-windows-cmake-gui/
but still, the super-build only build pcl 1.6 .. pcl current version is 1.7.2 ………….
Tried this method with android-ndk-r8c-darwin-x86 on ubuntu 15.10 and Cmake 3.2.2 but it doesn’t work. It says that the NDK tool chain is broken and that CMAKE_C_COMPILER and CMAKE_CXX_COMPILER aren’t set although they are set correctly.
I try on MacOS 10.9.4. I didn’t try on ubuntu 15.10. Someone else success on Ubuntu 15.10, but I don’t know on that environment.
Thanks for the quick reply!
I managed to compile your super build with Ubuntu 15.10 and NDK r10e. I changed the toolchain-android.cmake with the one from OpenCV. Then in common.hpp(found in /Source/pcl/common/include/pcl/common/impl) I had to add the following lines:
# define pcl_isnan(x) std::isnan(x)
# define pcl_isfinite(x) std::isfinite(x)
# define pcl_isinf(x) std::isinf(x)
Thank you hirotakaster, for this wonderful steps, finally I got my PCL compiled. Can you please explain how can I use the compiled files to integrate the library in Tango project files ?
I have read these links:
but, I don’t understand how it will work in Android Studio in these ways.
Hi, sorry I don’t have Tango and don’t know using with tango libraries.
Thank you for replying. Then, how about Android Studio ?
Hi, first of all thank you very much, I succeeded in compiling PCL. I wanted to ask how I can change the superbuild to be build for other architectures as well, because at the moment I am only capable running it using armeabi. The pcl_common.a throws an error when trying to compile for mips, x86 or any of the 64-bit versions.
Sorry if its a silly question but its the first time im working with ndk. Thank you 😉
Thank you for your kind help, but I wonder there is no Eigen-android, since Eigen library is necessary for the normal operating of PCL.