Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PCL cmake fails when cross-compiling for Android #6151

Open
jackjansen opened this issue Oct 13, 2024 · 3 comments
Open

PCL cmake fails when cross-compiling for Android #6151

jackjansen opened this issue Oct 13, 2024 · 3 comments
Labels
status: triage Labels incomplete

Comments

@jackjansen
Copy link

jackjansen commented Oct 13, 2024

When cross-compiling for arm64-android (and possibly also for other platforms) the cmake phase fails. The problem is that pcl_find_sse.cmake uses check_cxx_source_runs() to determine whether HAVE_MM_MALLOC and HAVE_POSIX_MEMALIGN should be set.

But these obviously fail when cross-compiling.

Also, specifically for ARM64 and Android these defines aren't needed: the only preprocessor code that uses them has a branch specifically for android too (which has yet another aligned allocator). The simplest solution would be for the cmake code not to try and determine these preprocessor values when cross-compiling for Android (or possibly when cross-compiling for anything).

This issue was found while using vcpkg to build pcl, and also reported there, with the workaround to pre-set these variables in the cmake cache. But it would be a better solution if the issue was fixed here in pcl, obviously.

The vcpkg issue is here: microsoft/vcpkg#41505

@jackjansen jackjansen added the status: triage Labels incomplete label Oct 13, 2024
@larshg
Copy link
Contributor

larshg commented Oct 13, 2024

You can disable the check for SSE with -DPCL_ENABLE_SSE=FALSE - and similiar with AVX, if that fails too.
Not sure if this "feature" is available in VCPKG though.

@jackjansen
Copy link
Author

@larshg But then shouldn't PCL_ENABLE_SSE be set to false automatically when building for the arm64, which doesn't have an SSE instruction set? It seems like all of the code in pcl_find_sse.cmake is only for Intel processors....

@larshg
Copy link
Contributor

larshg commented Oct 14, 2024

It might only work on x86 platforms - i dont know the internal workings/support from cmake on this.
But manually you can make it skip those test.
You dont post any concrete error, so its difficult to guide on that - and unfortunately I havent had the need to compile on Arm/android, so I dont have any experience with it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: triage Labels incomplete
Projects
None yet
Development

No branches or pull requests

2 participants