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

move ndk code to a new library #6951

Merged
merged 1 commit into from May 14, 2024
Merged

move ndk code to a new library #6951

merged 1 commit into from May 14, 2024

Conversation

eltonkola
Copy link
Contributor

move ndk code to a new module, so it can be published later on as an android library and easily integrated ion third party apps

@mofosyne mofosyne added android Issues specific to Android refactoring Refactoring review complexity : low Trivial changes to code that most beginner devs (or those who want a break) can tackle. e.g. UI fix labels May 9, 2024
@@ -37,7 +37,7 @@ FetchContent_MakeAvailable(llama)
# used in the AndroidManifest.xml file.
add_library(${CMAKE_PROJECT_NAME} SHARED
# List C/C++ source files with relative paths to this CMakeLists.txt.
llama-android.cpp)
llama-android.cpp)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

was this tab here intentional?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no, androidstudio must have done it

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah fair enough. If it looks better with the space in your opinion then that's fine.

CI is throwing up some error so you got some opportunities to fix that nitpick if you feel like it.

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The CI is likely failing because the Android project pull llama.cpp from the master branch:

# Declares the project name. The project name can be accessed via ${ PROJECT_NAME},
# Since this is the top level CMakeLists.txt, the project name is also accessible
# with ${CMAKE_PROJECT_NAME} (both CMake variables are in-sync within the top level
# build script scope).
project("llama-android")
include(FetchContent)
FetchContent_Declare(
llama
GIT_REPOSITORY https://github.com/ggerganov/llama.cpp
GIT_TAG master
)

So it is mixing changes from this PR and what is currently on master. Not familiar enough with Android build system to figure out how to fix this

Let's merge and see if it works

@mofosyne
Copy link
Collaborator

double checking to see if this changes touches any non android stuff. Looks safe.

So merging now and fingers crossed it's as gg said that ci will pass in master for the android build

@mofosyne mofosyne merged commit efc8f76 into ggerganov:master May 14, 2024
57 of 58 checks passed
@mofosyne
Copy link
Collaborator

mofosyne commented May 14, 2024

@eltonkola CI failed for your android code in main branch, so can you see if you can make a correction for it as a separate PR?

FAILURE: Build failed with an exception.

* What went wrong:
Could not determine the dependencies of task ':app:compileDebugJavaWithJavac'.
> Could not resolve all task dependencies for configuration ':app:debugCompileClasspath'.
   > Could not resolve project :llama.
     Required by:
         project :app
      > No matching configuration of project :llama was found. The consumer was configured to find a library for use during compile-time, preferably optimized for Android, as well as attribute 'com.android.build.api.attributes.BuildTypeAttr' with value 'debug', attribute 'com.android.build.api.attributes.AgpVersionAttr' with value '8.2.0', attribute 'org.jetbrains.kotlin.platform.type' with value 'androidJvm' but:
          - None of the consumable configurations have attributes.\

@mofosyne
Copy link
Collaborator

mofosyne commented May 14, 2024

Will wait a day or two if we can figure this out, else will revert this PR to avoid polluting the CI output of the main branch.

mofosyne added a commit that referenced this pull request May 14, 2024
ggerganov pushed a commit that referenced this pull request May 14, 2024
teleprint-me pushed a commit to teleprint-me/llama.cpp that referenced this pull request May 17, 2024
teleprint-me pushed a commit to teleprint-me/llama.cpp that referenced this pull request May 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
android Issues specific to Android refactoring Refactoring review complexity : low Trivial changes to code that most beginner devs (or those who want a break) can tackle. e.g. UI fix
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants