Skip to content

Further tidy on Android instructions README.md #7077

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

Merged
merged 7 commits into from
May 8, 2024

Conversation

Jeximo
Copy link
Contributor

@Jeximo Jeximo commented May 4, 2024

Fixed logic when following readme direction.

Some poor user got stuck trying to build llama.cpp. This change makes the user git clone before building.

Listed Building with Termux, then Building with NDK as build directions should focus on what's necessary, whereas NDK instructions are optional. Removed redundency in NDK instruction.

Fixed some logic when following readme direction
@@ -951,7 +966,7 @@ $ export NDK=<your_ndk_directory>
$ cmake -DCMAKE_TOOLCHAIN_FILE=$NDK/build/cmake/android.toolchain.cmake -DANDROID_ABI=arm64-v8a -DANDROID_PLATFORM=android-23 -DCMAKE_C_FLAGS=-march=armv8.4a+dotprod ..
$ make
```
Install [termux](https://termux.dev/) on your device and run `termux-setup-storage` to get access to your SD card.
Install [termux](https://github.com/termux/termux-app#installation) on your device and run `termux-setup-storage` to get access to your SD card (if Android 11+ then run the command twice).
Copy link
Contributor Author

Choose a reason for hiding this comment

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

The reason to run the command twice is the first run pops the Android Permission Window, then user accepts. Now the permission is granted, which allows Termux to setup the symlinks to shared storage after second execution.

mv model.gguf ~/
```

[Get the code](https://github.com/ggerganov/llama.cpp#get-the-code) & [follow the Linux build instructions](https://github.com/ggerganov/llama.cpp#build) to build `llama.cpp`.
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Added link to Get the code so very new users can't miss it.

A new user arriving will see simple directions on llama.cpp homepage
Second, obtain the [Android NDK](https://developer.android.com/ndk) and then build with CMake:

You can execute the following commands on your computer to avoid downloading the NDK to your mobile. Of course, you can also do this in Termux.
Obtain the [Android NDK](https://developer.android.com/ndk) and then build with CMake:
Copy link
Contributor Author

@Jeximo Jeximo May 5, 2024

Choose a reason for hiding this comment

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

Referring to termux doesn't make sense at this point - first step to building with ndk is obtain ndk.

Period after cmake, colon after termux
@Jeximo
Copy link
Contributor Author

Jeximo commented May 5, 2024

I think that's as clean as it gets! Let me know if there's anything you noticed that needs to be changed.

Jeximo added 2 commits May 5, 2024 18:30
method seems to be more correct, instead of alternative in this context
building llama.cpp with NDK on a pc doesn't require installing clang, cmake, git, or wget in termux.
@slaren
Copy link
Member

slaren commented May 6, 2024

@Jeximo this is renaming README.md to Further tidy on Android instructions README.md.

corrected title
@Jeximo
Copy link
Contributor Author

Jeximo commented May 6, 2024

@slaren My apologies, I fixed the mistake.

@slaren slaren merged commit c780e75 into ggml-org:master May 8, 2024
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

Successfully merging this pull request may close these issues.

2 participants