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

Android arm64 build #2

Open
gsus24 opened this issue Jan 23, 2021 · 3 comments
Open

Android arm64 build #2

gsus24 opened this issue Jan 23, 2021 · 3 comments
Labels

Comments

@gsus24
Copy link

gsus24 commented Jan 23, 2021

Can´t get it work on 64bit. Building the library without error and installed it successfully on device, but get error when opening the app.

I edit ./configure-ndk like suggested
https://developer.android.com/ndk/guides/other_build_systems

#!/bin/bash


if [ -z ${NDK+x} ]; then
  export NDK=${HOME}/Android/Sdk/ndk-bundle;
fi

export HOST_TAG=linux-x86_64
export TOOLCHAIN=$NDK/toolchains/llvm/prebuilt/$HOST_TAG
export TARGET=aarch64-linux-android
export API=22
export AR=$TOOLCHAIN/bin/llvm-ar
export CC=$TOOLCHAIN/bin/$TARGET$API-clang
export AS=$CC
export CXX=$TOOLCHAIN/bin/$TARGET$API-clang++
export LD=$TOOLCHAIN/bin/ld
export RANLIB=$TOOLCHAIN/bin/llvm-ranlib
export STRIP=$TOOLCHAIN/bin/llvm-strip

export LIBS_NDK=$NDK/sources/third_party/vulkan/src/build-android/jniLibs/
export CPPFLAGS="-march=armv8-a -I$LIBS_NDK -fPIC"
export GL_LIBS="-lGLESv3 -lEGL"

./configure --host $TARGET \
    --enable-gles --disable-static --disable-sdl --disable-qt \
    --prefix=`realpath src/projectm-android/app/jniLibs` \
    --libdir='${exec_prefix}/arm64-v8a' \
    --datarootdir=`realpath src/projectm-android/app/src/main/assets`

Add the library to my project edited CMakelists and build.gradle to arm64-8va. I can install the app but running into error dlopen: library not found

What i am doing wrong? Hope there is somebody know how to get it work.
Thanks

@kblaschke
Copy link
Member

Could you try buildnig projectM with the current master using the CMake scripts?

Recent Android NDKs ship with a CMake toolchain file and information about how to build projects with it.

@kblaschke kblaschke transferred this issue from projectM-visualizer/projectm Feb 14, 2022
@gsus24
Copy link
Author

gsus24 commented Jan 12, 2023

Hi Kai,
another try to build for arm64.
In the android-example you use precompiled library.
Do you mean building it completly in Android Studio?

Is it enough to copy the folder projectm/src/libprojectM to my project and change cmake path in build.gradle to the new one?

Could you please explain on how you would do it?
Without help, i am lost

@kblaschke
Copy link
Member

If the project builds libprojectM properly then, it may work. Setting the include directories can be challenging.

I'd still recommend building it separately with the proper Android NDK for your target platform, then point CMAKE_PREFIX_PATH to the install dir and use CMake's find_package(libprojectM) command to integrate it into you project.

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

No branches or pull requests

2 participants