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

Investigate Android implementation #24

Closed
jackjansen opened this issue Oct 20, 2022 · 8 comments
Closed

Investigate Android implementation #24

jackjansen opened this issue Oct 20, 2022 · 8 comments
Assignees
Milestone

Comments

@jackjansen
Copy link
Contributor

We should investigate whether an Android implementation is possible (at least for cwipc_util, cwipc_codec is optional, the current capturers are uninteresting).

@nachoreimat
Copy link
Contributor

I think the main interest is cwipc_codec cause that will allow us to send compress pointclouds

@jackjansen
Copy link
Contributor Author

Maybe the first thing we should investigate is whether libpcl can be used on Android, because without libpcl we cannot build anything.

There's various references that it can, google "libpcl android" finds various things. Most interesting looks https://github.com/bashbug/pcl-for-android but it seems that it hasn't seen development for 3 years.

So: it could be that libpcl now supports android build natively. But I haven't been able to find any information (but I didn't look very hard).

@jackjansen jackjansen assigned troeggla and unassigned nachoreimat May 10, 2023
@troeggla
Copy link
Member

So I managed to cross-compile PCL for Android (arm64). I think that's a big step in the right direction. What other crucial dependencies does CWIPC have?

@jackjansen
Copy link
Contributor Author

The only one that is important is turbo-jpeg. It can probably be worked-around if need be but the codec code uses the turbo-jpeg API, not the normal libjpeg API (which turbojpeg also provides), so it would be better if turbo-jpeg is available.

Can you create a branch (for example issue24-android) and check in any projects and such that you've created into the sandbox directory? That way I can also have a look at them (but we still keep the main repo structure clean).

@troeggla
Copy link
Member

troeggla commented Jun 13, 2023

Update: I've managed to set up a pipeline to build PCL fairly reliably for armv7, armv8, x86 and x86_64 using a modern version of the build tools used in bashbug/pcl-for-android on Linux (it works on macOS as well, except for the armv8 build, which fails to compile some assembly in boost for some reason; I may have found the issue, but not quite sure yet).

The only real issue is that I can only build PCL statically, dynamic builds fail because it cannot resolve some symbols in boost::filesystem. Though this may not really be a problem since I am able to build a dynamic library that links against the static PCL when building an Android app in Android Studio. So my hope is that when I start compiling CWIPC I can build a dynamic library that simply links against the static PCL build. We'll see how that works out.

I maintain a fork of bashbug/pcl-for-android here: https://github.com/troeggla/pcl-for-android
For compiling CWIPC I will probably create a branch in this repository.

@jackjansen jackjansen added this to the 7.5 release milestone Jul 3, 2023
@troeggla
Copy link
Member

troeggla commented Jul 5, 2023

I can build now shared libraries for ARMv7, ARMv8 and x86_64. This line, however, makes the build fail for x86: https://github.com/cwi-dis/cwipc_util/blob/master/include/cwipc_util/api.h#L62

Not sure how important this is. I can either patch it out it leave it at the architectures we can build now (the x86 builds are for emulators only anyway).

@jackjansen
Copy link
Contributor Author

That is a strange problem: the struct cwipc_cwipcdump_header has been carefully laid out to have a certain binary representation, and apparently this fails for the x68_64 Android emulator?

Most practical is to not build for the emulator.

@troeggla
Copy link
Member

Shared libraries for Android can now be built reliably. The necessary code and documentation has been moved to cwi-dis/cwipc_android. The repository also contains downloadable builds for CWIPC 7.4.3.

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

No branches or pull requests

3 participants