ggerganov / llama.cpp

LLM inference in C/C++
MIT License
64.87k stars 9.3k forks source link

Bug: When I use android NDK to compile the bin file on Linux, and then transfer the bin file to Android termux and execute it, get an error #8428

Open LDLINGLINGLING opened 2 months ago

LDLINGLINGLING commented 2 months ago

What happened?

When I use android NDK to compile the bin file on Linux, and then transfer the bin file to Android termux and execute it, an error will be reported:CANNOT LINK EXECUTABLE "./llama-cli": library "libllama.so" not found: needed by main executable

Name and Version

./llama-cli -m /sdcard/Download/ggml-model-Q4_K_M.gguf --prompt "<用户>你知道openmbmb么"

What operating system are you seeing the problem on?

Other? (Please let us know in description)

Relevant log output

[  1%] Building C object ggml/src/CMakeFiles/ggml.dir/ggml.c.o
/root/ld/ld_project/llama.cpp/ggml/src/ggml.c:1976:5: warning: implicit conversion increases floating-point precision: 'float32_t' (aka 'float') to 'ggml_float' (aka 'double') [-Wdouble-promotion]
    GGML_F16_VEC_REDUCE(sumf, sum);
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/root/ld/ld_project/llama.cpp/ggml/src/ggml.c:1077:41: note: expanded from macro 'GGML_F16_VEC_REDUCE'
    #define GGML_F16_VEC_REDUCE         GGML_F32Cx4_REDUCE
                                        ^
/root/ld/ld_project/llama.cpp/ggml/src/ggml.c:1067:38: note: expanded from macro 'GGML_F32Cx4_REDUCE'
    #define GGML_F32Cx4_REDUCE       GGML_F32x4_REDUCE
                                     ^
/root/ld/ld_project/llama.cpp/ggml/src/ggml.c:997:11: note: expanded from macro 'GGML_F32x4_REDUCE'
    res = GGML_F32x4_REDUCE_ONE(x[0]);         \
        ~ ^~~~~~~~~~~~~~~~~~~~~~~~~~~
/root/ld/ld_project/llama.cpp/ggml/src/ggml.c:982:34: note: expanded from macro 'GGML_F32x4_REDUCE_ONE'
#define GGML_F32x4_REDUCE_ONE(x) vaddvq_f32(x)
                                 ^~~~~~~~~~~~~
/root/ld/ld_project/llama.cpp/ggml/src/ggml.c:2024:9: warning: implicit conversion increases floating-point precision: 'float32_t' (aka 'float') to 'ggml_float' (aka 'double') [-Wdouble-promotion]
        GGML_F16_VEC_REDUCE(sumf[k], sum[k]);
        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/root/ld/ld_project/llama.cpp/ggml/src/ggml.c:1077:41: note: expanded from macro 'GGML_F16_VEC_REDUCE'
    #define GGML_F16_VEC_REDUCE         GGML_F32Cx4_REDUCE
                                        ^
/root/ld/ld_project/llama.cpp/ggml/src/ggml.c:1067:38: note: expanded from macro 'GGML_F32Cx4_REDUCE'
    #define GGML_F32Cx4_REDUCE       GGML_F32x4_REDUCE
                                     ^
/root/ld/ld_project/llama.cpp/ggml/src/ggml.c:997:11: note: expanded from macro 'GGML_F32x4_REDUCE'
    res = GGML_F32x4_REDUCE_ONE(x[0]);         \
        ~ ^~~~~~~~~~~~~~~~~~~~~~~~~~~
/root/ld/ld_project/llama.cpp/ggml/src/ggml.c:982:34: note: expanded from macro 'GGML_F32x4_REDUCE_ONE'
#define GGML_F32x4_REDUCE_ONE(x) vaddvq_f32(x)
                                 ^~~~~~~~~~~~~
2 warnings generated.
[  2%] Building C object ggml/src/CMakeFiles/ggml.dir/ggml-alloc.c.o
[  2%] Building C object ggml/src/CMakeFiles/ggml.dir/ggml-backend.c.o
[  3%] Building C object ggml/src/CMakeFiles/ggml.dir/ggml-quants.c.o
[  3%] Building CXX object ggml/src/CMakeFiles/ggml.dir/llamafile/sgemm.cpp.o
[  4%] Building C object ggml/src/CMakeFiles/ggml.dir/ggml-aarch64.c.o
[  5%] Linking CXX shared library libggml.so
[  5%] Built target ggml
[  5%] Building CXX object src/CMakeFiles/llama.dir/llama.cpp.o
[  6%] Building CXX object src/CMakeFiles/llama.dir/unicode.cpp.o
/root/ld/ld_project/llama.cpp/src/unicode.cpp:197:31: warning: 'codecvt_utf8<wchar_t>' is deprecated [-Wdeprecated-declarations]
    std::wstring_convert<std::codecvt_utf8<wchar_t>> conv;
                              ^
/root/ld/ld_project/android-ndk-r26d/toolchains/llvm/prebuilt/linux-x86_64/sysroot/usr/include/c++/v1/codecvt:187:28: note: 'codecvt_utf8<wchar_t>' has been explicitly marked deprecated here
class _LIBCPP_TEMPLATE_VIS _LIBCPP_DEPRECATED_IN_CXX17 codecvt_utf8
                           ^
/root/ld/ld_project/android-ndk-r26d/toolchains/llvm/prebuilt/linux-x86_64/sysroot/usr/include/c++/v1/__config:798:41: note: expanded from macro '_LIBCPP_DEPRECATED_IN_CXX17'
#    define _LIBCPP_DEPRECATED_IN_CXX17 _LIBCPP_DEPRECATED
                                        ^
/root/ld/ld_project/android-ndk-r26d/toolchains/llvm/prebuilt/linux-x86_64/sysroot/usr/include/c++/v1/__config:771:49: note: expanded from macro '_LIBCPP_DEPRECATED'
#      define _LIBCPP_DEPRECATED __attribute__((deprecated))
                                                ^
/root/ld/ld_project/llama.cpp/src/unicode.cpp:197:10: warning: 'wstring_convert<std::codecvt_utf8<wchar_t>>' is deprecated [-Wdeprecated-declarations]
    std::wstring_convert<std::codecvt_utf8<wchar_t>> conv;
         ^
/root/ld/ld_project/android-ndk-r26d/toolchains/llvm/prebuilt/linux-x86_64/sysroot/usr/include/c++/v1/locale:3603:28: note: 'wstring_convert<std::codecvt_utf8<wchar_t>>' has been explicitly marked deprecated here
class _LIBCPP_TEMPLATE_VIS _LIBCPP_DEPRECATED_IN_CXX17 wstring_convert
                           ^
/root/ld/ld_project/android-ndk-r26d/toolchains/llvm/prebuilt/linux-x86_64/sysroot/usr/include/c++/v1/__config:798:41: note: expanded from macro '_LIBCPP_DEPRECATED_IN_CXX17'
#    define _LIBCPP_DEPRECATED_IN_CXX17 _LIBCPP_DEPRECATED
                                        ^
/root/ld/ld_project/android-ndk-r26d/toolchains/llvm/prebuilt/linux-x86_64/sysroot/usr/include/c++/v1/__config:771:49: note: expanded from macro '_LIBCPP_DEPRECATED'
#      define _LIBCPP_DEPRECATED __attribute__((deprecated))
                                                ^
2 warnings generated.
[  6%] Building CXX object src/CMakeFiles/llama.dir/unicode-data.cpp.o
[  7%] Linking CXX shared library libllama.so
[  7%] Built target llama
[  7%] Generating build details from Git
-- Found Git: /usr/bin/git (found version "2.25.1") 
[  8%] Building CXX object common/CMakeFiles/build_info.dir/build-info.cpp.o
[  8%] Built target build_info
[  8%] Building CXX object common/CMakeFiles/common.dir/common.cpp.o
/root/ld/ld_project/llama.cpp/common/common.cpp:1862:35: warning: 'codecvt_utf8<char32_t>' is deprecated [-Wdeprecated-declarations]
        std::wstring_convert<std::codecvt_utf8<char32_t>, char32_t> converter;
                                  ^
/root/ld/ld_project/android-ndk-r26d/toolchains/llvm/prebuilt/linux-x86_64/sysroot/usr/include/c++/v1/codecvt:187:28: note: 'codecvt_utf8<char32_t>' has been explicitly marked deprecated here
class _LIBCPP_TEMPLATE_VIS _LIBCPP_DEPRECATED_IN_CXX17 codecvt_utf8
                           ^
/root/ld/ld_project/android-ndk-r26d/toolchains/llvm/prebuilt/linux-x86_64/sysroot/usr/include/c++/v1/__config:798:41: note: expanded from macro '_LIBCPP_DEPRECATED_IN_CXX17'
#    define _LIBCPP_DEPRECATED_IN_CXX17 _LIBCPP_DEPRECATED
                                        ^
/root/ld/ld_project/android-ndk-r26d/toolchains/llvm/prebuilt/linux-x86_64/sysroot/usr/include/c++/v1/__config:771:49: note: expanded from macro '_LIBCPP_DEPRECATED'
#      define _LIBCPP_DEPRECATED __attribute__((deprecated))
                                                ^
/root/ld/ld_project/llama.cpp/common/common.cpp:1862:14: warning: 'wstring_convert<std::codecvt_utf8<char32_t>, char32_t>' is deprecated [-Wdeprecated-declarations]
        std::wstring_convert<std::codecvt_utf8<char32_t>, char32_t> converter;
             ^
/root/ld/ld_project/android-ndk-r26d/toolchains/llvm/prebuilt/linux-x86_64/sysroot/usr/include/c++/v1/locale:3603:28: note: 'wstring_convert<std::codecvt_utf8<char32_t>, char32_t>' has been explicitly marked deprecated here
class _LIBCPP_TEMPLATE_VIS _LIBCPP_DEPRECATED_IN_CXX17 wstring_convert
                           ^
/root/ld/ld_project/android-ndk-r26d/toolchains/llvm/prebuilt/linux-x86_64/sysroot/usr/include/c++/v1/__config:798:41: note: expanded from macro '_LIBCPP_DEPRECATED_IN_CXX17'
#    define _LIBCPP_DEPRECATED_IN_CXX17 _LIBCPP_DEPRECATED
                                        ^
/root/ld/ld_project/android-ndk-r26d/toolchains/llvm/prebuilt/linux-x86_64/sysroot/usr/include/c++/v1/__config:771:49: note: expanded from macro '_LIBCPP_DEPRECATED'
#      define _LIBCPP_DEPRECATED __attribute__((deprecated))
                                                ^
2 warnings generated.
[  9%] Building CXX object common/CMakeFiles/common.dir/sampling.cpp.o
[  9%] Building CXX object common/CMakeFiles/common.dir/console.cpp.o
[ 10%] Building CXX object common/CMakeFiles/common.dir/grammar-parser.cpp.o
[ 11%] Building CXX object common/CMakeFiles/common.dir/json-schema-to-grammar.cpp.o
[ 11%] Building CXX object common/CMakeFiles/common.dir/train.cpp.o
[ 12%] Building CXX object common/CMakeFiles/common.dir/ngram-cache.cpp.o
[ 12%] Linking CXX static library libcommon.a
[ 12%] Built target common
[ 13%] Building CXX object tests/CMakeFiles/test-tokenizer-0.dir/test-tokenizer-0.cpp.o
[ 14%] Linking CXX executable ../bin/test-tokenizer-0
[ 14%] Built target test-tokenizer-0
[ 14%] Building CXX object tests/CMakeFiles/test-tokenizer-1-bpe.dir/test-tokenizer-1-bpe.cpp.o
[ 15%] Linking CXX executable ../bin/test-tokenizer-1-bpe
[ 15%] Built target test-tokenizer-1-bpe
[ 15%] Building CXX object tests/CMakeFiles/test-tokenizer-1-spm.dir/test-tokenizer-1-spm.cpp.o
[ 16%] Linking CXX executable ../bin/test-tokenizer-1-spm
[ 16%] Built target test-tokenizer-1-spm
[ 17%] Building CXX object tests/CMakeFiles/test-quantize-fns.dir/test-quantize-fns.cpp.o
[ 17%] Building CXX object tests/CMakeFiles/test-quantize-fns.dir/get-model.cpp.o
[ 18%] Linking CXX executable ../bin/test-quantize-fns
[ 18%] Built target test-quantize-fns
[ 19%] Building CXX object tests/CMakeFiles/test-quantize-perf.dir/test-quantize-perf.cpp.o
[ 19%] Building CXX object tests/CMakeFiles/test-quantize-perf.dir/get-model.cpp.o
[ 20%] Linking CXX executable ../bin/test-quantize-perf
[ 20%] Built target test-quantize-perf
[ 20%] Building CXX object tests/CMakeFiles/test-sampling.dir/test-sampling.cpp.o
[ 21%] Building CXX object tests/CMakeFiles/test-sampling.dir/get-model.cpp.o
[ 21%] Linking CXX executable ../bin/test-sampling
[ 21%] Built target test-sampling
[ 21%] Building CXX object tests/CMakeFiles/test-chat-template.dir/test-chat-template.cpp.o
[ 22%] Building CXX object tests/CMakeFiles/test-chat-template.dir/get-model.cpp.o
[ 22%] Linking CXX executable ../bin/test-chat-template
[ 22%] Built target test-chat-template
[ 23%] Building CXX object tests/CMakeFiles/test-grammar-parser.dir/test-grammar-parser.cpp.o
[ 23%] Building CXX object tests/CMakeFiles/test-grammar-parser.dir/get-model.cpp.o
[ 24%] Linking CXX executable ../bin/test-grammar-parser
[ 24%] Built target test-grammar-parser
[ 24%] Building CXX object tests/CMakeFiles/test-llama-grammar.dir/test-llama-grammar.cpp.o
[ 25%] Building CXX object tests/CMakeFiles/test-llama-grammar.dir/get-model.cpp.o
[ 25%] Linking CXX executable ../bin/test-llama-grammar
[ 25%] Built target test-llama-grammar
[ 26%] Building CXX object tests/CMakeFiles/test-grammar-integration.dir/test-grammar-integration.cpp.o
[ 26%] Building CXX object tests/CMakeFiles/test-grammar-integration.dir/get-model.cpp.o
[ 27%] Linking CXX executable ../bin/test-grammar-integration
[ 27%] Built target test-grammar-integration
[ 28%] Building CXX object tests/CMakeFiles/test-grad0.dir/test-grad0.cpp.o
[ 29%] Building CXX object tests/CMakeFiles/test-grad0.dir/get-model.cpp.o
[ 29%] Linking CXX executable ../bin/test-grad0
[ 29%] Built target test-grad0
[ 29%] Building CXX object tests/CMakeFiles/test-backend-ops.dir/test-backend-ops.cpp.o
[ 30%] Building CXX object tests/CMakeFiles/test-backend-ops.dir/get-model.cpp.o
[ 31%] Linking CXX executable ../bin/test-backend-ops
[ 31%] Built target test-backend-ops
[ 31%] Building CXX object tests/CMakeFiles/test-rope.dir/test-rope.cpp.o
[ 32%] Building CXX object tests/CMakeFiles/test-rope.dir/get-model.cpp.o
[ 33%] Linking CXX executable ../bin/test-rope
[ 33%] Built target test-rope
[ 34%] Building CXX object tests/CMakeFiles/test-model-load-cancel.dir/test-model-load-cancel.cpp.o
[ 35%] Building CXX object tests/CMakeFiles/test-model-load-cancel.dir/get-model.cpp.o
[ 35%] Linking CXX executable ../bin/test-model-load-cancel
[ 35%] Built target test-model-load-cancel
[ 36%] Building CXX object tests/CMakeFiles/test-autorelease.dir/test-autorelease.cpp.o
[ 36%] Building CXX object tests/CMakeFiles/test-autorelease.dir/get-model.cpp.o
[ 37%] Linking CXX executable ../bin/test-autorelease
[ 37%] Built target test-autorelease
[ 37%] Building CXX object tests/CMakeFiles/test-json-schema-to-grammar.dir/test-json-schema-to-grammar.cpp.o
[ 38%] Building CXX object tests/CMakeFiles/test-json-schema-to-grammar.dir/get-model.cpp.o
[ 39%] Linking CXX executable ../bin/test-json-schema-to-grammar
[ 39%] Built target test-json-schema-to-grammar
[ 39%] Building C object tests/CMakeFiles/test-c.dir/test-c.c.o
[ 40%] Linking C executable ../bin/test-c
[ 40%] Built target test-c
[ 41%] Building CXX object examples/cvector-generator/CMakeFiles/llama-cvector-generator.dir/cvector-generator.cpp.o
[ 42%] Linking CXX executable ../../bin/llama-cvector-generator
[ 42%] Built target llama-cvector-generator
[ 43%] Building CXX object examples/baby-llama/CMakeFiles/llama-baby-llama.dir/baby-llama.cpp.o
[ 43%] Linking CXX executable ../../bin/llama-baby-llama
[ 43%] Built target llama-baby-llama
[ 44%] Building CXX object examples/batched-bench/CMakeFiles/llama-batched-bench.dir/batched-bench.cpp.o
[ 45%] Linking CXX executable ../../bin/llama-batched-bench
[ 45%] Built target llama-batched-bench
[ 46%] Building CXX object examples/batched/CMakeFiles/llama-batched.dir/batched.cpp.o
[ 46%] Linking CXX executable ../../bin/llama-batched
[ 46%] Built target llama-batched
[ 46%] Building CXX object examples/benchmark/CMakeFiles/llama-bench-matmult.dir/benchmark-matmult.cpp.o
[ 47%] Linking CXX executable ../../bin/llama-bench-matmult
[ 47%] Built target llama-bench-matmult
[ 48%] Building CXX object examples/convert-llama2c-to-ggml/CMakeFiles/llama-convert-llama2c-to-ggml.dir/convert-llama2c-to-ggml.cpp.o
[ 48%] Linking CXX executable ../../bin/llama-convert-llama2c-to-ggml
[ 48%] Built target llama-convert-llama2c-to-ggml
[ 48%] Building CXX object examples/embedding/CMakeFiles/llama-embedding.dir/embedding.cpp.o
[ 49%] Linking CXX executable ../../bin/llama-embedding
[ 49%] Built target llama-embedding
[ 49%] Building CXX object examples/eval-callback/CMakeFiles/llama-eval-callback.dir/eval-callback.cpp.o
[ 50%] Linking CXX executable ../../bin/llama-eval-callback
[ 50%] Built target llama-eval-callback
[ 51%] Building CXX object examples/export-lora/CMakeFiles/llama-export-lora.dir/export-lora.cpp.o
[ 51%] Linking CXX executable ../../bin/llama-export-lora
[ 51%] Built target llama-export-lora
[ 52%] Building CXX object examples/finetune/CMakeFiles/llama-finetune.dir/finetune.cpp.o
[ 52%] Linking CXX executable ../../bin/llama-finetune
[ 52%] Built target llama-finetune
[ 53%] Building CXX object examples/gbnf-validator/CMakeFiles/llama-gbnf-validator.dir/gbnf-validator.cpp.o
[ 53%] Linking CXX executable ../../bin/llama-gbnf-validator
[ 53%] Built target llama-gbnf-validator
[ 54%] Building C object examples/gguf-hash/CMakeFiles/sha256.dir/deps/sha256/sha256.c.o
[ 54%] Built target sha256
[ 55%] Building C object examples/gguf-hash/CMakeFiles/xxhash.dir/deps/xxhash/xxhash.c.o
[ 55%] Built target xxhash
[ 55%] Building C object examples/gguf-hash/CMakeFiles/sha1.dir/deps/sha1/sha1.c.o
[ 55%] Built target sha1
[ 55%] Building CXX object examples/gguf-hash/CMakeFiles/llama-gguf-hash.dir/gguf-hash.cpp.o
[ 56%] Linking CXX executable ../../bin/llama-gguf-hash
[ 56%] Built target llama-gguf-hash
[ 56%] Building CXX object examples/gguf-split/CMakeFiles/llama-gguf-split.dir/gguf-split.cpp.o
[ 57%] Linking CXX executable ../../bin/llama-gguf-split
[ 57%] Built target llama-gguf-split
[ 58%] Building CXX object examples/gguf/CMakeFiles/llama-gguf.dir/gguf.cpp.o
[ 59%] Linking CXX executable ../../bin/llama-gguf
[ 59%] Built target llama-gguf
[ 60%] Building CXX object examples/gritlm/CMakeFiles/llama-gritlm.dir/gritlm.cpp.o
[ 60%] Linking CXX executable ../../bin/llama-gritlm
[ 60%] Built target llama-gritlm
[ 61%] Building CXX object examples/imatrix/CMakeFiles/llama-imatrix.dir/imatrix.cpp.o
[ 61%] Linking CXX executable ../../bin/llama-imatrix
[ 61%] Built target llama-imatrix
[ 62%] Building CXX object examples/infill/CMakeFiles/llama-infill.dir/infill.cpp.o
[ 63%] Linking CXX executable ../../bin/llama-infill
[ 63%] Built target llama-infill
[ 63%] Building CXX object examples/llama-bench/CMakeFiles/llama-bench.dir/llama-bench.cpp.o
[ 64%] Linking CXX executable ../../bin/llama-bench
[ 64%] Built target llama-bench
[ 65%] Building CXX object examples/llava/CMakeFiles/llava.dir/llava.cpp.o
[ 66%] Building CXX object examples/llava/CMakeFiles/llava.dir/clip.cpp.o
[ 66%] Built target llava
[ 67%] Linking CXX static library libllava_static.a
[ 67%] Built target llava_static
[ 67%] Linking CXX shared library libllava_shared.so
[ 67%] Built target llava_shared
[ 67%] Building CXX object examples/llava/CMakeFiles/llama-llava-cli.dir/llava-cli.cpp.o
[ 68%] Linking CXX executable ../../bin/llama-llava-cli
[ 68%] Built target llama-llava-cli
[ 68%] Building CXX object examples/lookahead/CMakeFiles/llama-lookahead.dir/lookahead.cpp.o
[ 69%] Linking CXX executable ../../bin/llama-lookahead
[ 69%] Built target llama-lookahead
[ 70%] Building CXX object examples/lookup/CMakeFiles/llama-lookup.dir/lookup.cpp.o
[ 70%] Linking CXX executable ../../bin/llama-lookup
[ 70%] Built target llama-lookup
[ 71%] Building CXX object examples/lookup/CMakeFiles/llama-lookup-create.dir/lookup-create.cpp.o
[ 71%] Linking CXX executable ../../bin/llama-lookup-create
[ 71%] Built target llama-lookup-create
[ 72%] Building CXX object examples/lookup/CMakeFiles/llama-lookup-merge.dir/lookup-merge.cpp.o
[ 73%] Linking CXX executable ../../bin/llama-lookup-merge
[ 73%] Built target llama-lookup-merge
[ 73%] Building CXX object examples/lookup/CMakeFiles/llama-lookup-stats.dir/lookup-stats.cpp.o
[ 74%] Linking CXX executable ../../bin/llama-lookup-stats
[ 74%] Built target llama-lookup-stats
[ 75%] Building CXX object examples/main/CMakeFiles/llama-cli.dir/main.cpp.o
[ 75%] Linking CXX executable ../../bin/llama-cli
[ 75%] Built target llama-cli
[ 75%] Building CXX object examples/parallel/CMakeFiles/llama-parallel.dir/parallel.cpp.o
[ 76%] Linking CXX executable ../../bin/llama-parallel
[ 76%] Built target llama-parallel
[ 77%] Building CXX object examples/passkey/CMakeFiles/llama-passkey.dir/passkey.cpp.o
[ 77%] Linking CXX executable ../../bin/llama-passkey
[ 77%] Built target llama-passkey
[ 78%] Building CXX object examples/perplexity/CMakeFiles/llama-perplexity.dir/perplexity.cpp.o
[ 78%] Linking CXX executable ../../bin/llama-perplexity
[ 78%] Built target llama-perplexity
[ 78%] Building CXX object examples/quantize-stats/CMakeFiles/llama-quantize-stats.dir/quantize-stats.cpp.o
[ 79%] Linking CXX executable ../../bin/llama-quantize-stats
[ 79%] Built target llama-quantize-stats
[ 79%] Building CXX object examples/quantize/CMakeFiles/llama-quantize.dir/quantize.cpp.o
[ 80%] Linking CXX executable ../../bin/llama-quantize
[ 80%] Built target llama-quantize
[ 81%] Building CXX object examples/retrieval/CMakeFiles/llama-retrieval.dir/retrieval.cpp.o
[ 81%] Linking CXX executable ../../bin/llama-retrieval
[ 81%] Built target llama-retrieval
[ 82%] Generating theme-snowstorm.css.hpp
[ 83%] Generating colorthemes.css.hpp
[ 83%] Generating completion.js.hpp
[ 83%] Generating index-new.html.hpp
[ 84%] Generating index.html.hpp
[ 85%] Generating index.js.hpp
[ 85%] Generating json-schema-to-grammar.mjs.hpp
[ 86%] Generating prompt-formats.js.hpp
[ 86%] Generating style.css.hpp
[ 87%] Generating system-prompts.js.hpp
[ 88%] Generating theme-beeninorder.css.hpp
[ 89%] Generating theme-ketivah.css.hpp
[ 89%] Generating theme-mangotango.css.hpp
[ 90%] Generating theme-playground.css.hpp
[ 90%] Generating theme-polarnight.css.hpp
[ 91%] Building CXX object examples/server/CMakeFiles/llama-server.dir/server.cpp.o
[ 91%] Linking CXX executable ../../bin/llama-server
[ 91%] Built target llama-server
[ 92%] Building CXX object examples/save-load-state/CMakeFiles/llama-save-load-state.dir/save-load-state.cpp.o
[ 92%] Linking CXX executable ../../bin/llama-save-load-state
[ 92%] Built target llama-save-load-state
[ 93%] Building CXX object examples/simple/CMakeFiles/llama-simple.dir/simple.cpp.o
[ 94%] Linking CXX executable ../../bin/llama-simple
[ 94%] Built target llama-simple
[ 94%] Building CXX object examples/speculative/CMakeFiles/llama-speculative.dir/speculative.cpp.o
[ 95%] Linking CXX executable ../../bin/llama-speculative
[ 95%] Built target llama-speculative
[ 95%] Building CXX object examples/tokenize/CMakeFiles/llama-tokenize.dir/tokenize.cpp.o
[ 96%] Linking CXX executable ../../bin/llama-tokenize
[ 96%] Built target llama-tokenize
[ 97%] Building CXX object examples/train-text-from-scratch/CMakeFiles/llama-train-text-from-scratch.dir/train-text-from-scratch.cpp.o
[ 97%] Linking CXX executable ../../bin/llama-train-text-from-scratch
[ 97%] Built target llama-train-text-from-scratch
[ 98%] Building CXX object pocs/vdot/CMakeFiles/llama-vdot.dir/vdot.cpp.o
[ 98%] Linking CXX executable ../../bin/llama-vdot
[ 98%] Built target llama-vdot
[ 99%] Building CXX object pocs/vdot/CMakeFiles/llama-q8dot.dir/q8dot.cpp.o
[100%] Linking CXX executable ../../bin/llama-q8dot
[100%] Built target llama-q8dot
HanClinto commented 1 month ago

Possibly the same issue as #8436 -- the error message is the same. Need to investigate further.

StringManolo commented 1 month ago

Did you tryied to compile directly on Termux using a proot? (Do not know if this servers your purpouse. If you want to use the model in a .apk, you can send commands directly to Termux from your apk. They have it well explained in the readme of Termux repo.)

I just compiled sucessfully in Android - Termux - Proot-Distro - Alpine

Something like this:

pkg install proot-distro
proot-distro install alpine
proot-distro login alpine --isolated
apk update
apk upgrade
apk install cmake clang git curl make
# Make sure curl works out of the box, i'm running a custom Alpine version and had to compile curl myself and replace the installed curl 
curl https://example.com
git clone https://github.com/ggerganov/llama.cpp
mkdir build
cd bulld
cmake ..
make 
cp bin/llama-cli /usr/bin/
mkdir models
cd models
# 4166 MegaBytes size model, make sure you have enought space
curl -vLO https://huggingface.co/TheBloke/dolphin-2.2.1-mistral-7B-GGUF/resolve/main/dolphin-2.2.1-mistral-7b.Q4_K_M.gguf
llama-cli -m dolphin-2.2.1-mistral-7b.Q4_K_M.gguf -p 'Hello dolphin'

You also have other distros like Debian or Arch Linux. Steps to install should be pretty much the same if you not a fan of musl.

Anyways, you need A LOT of RAM to run models. Expect it to don't work in most Android devices as the system will shutdown Termux (and all other running services if memory usage is that intense). Better to get a VPS server. There are very cheap ones.

LDLINGLINGLING commented 1 month ago

thank you very much

StringManolo commented 1 month ago

thank you very much

Here you have very small models for low end smartphones: https://huggingface.co/QuantFactory/gpt2-GGUF

This is just a bit bigger, should work on most modern smartphones too. https://huggingface.co/tarikcelik/gpt2-xl-Q8_0-GGUF/tree/main

2themaxx commented 1 month ago

Chiming in here because I get a similar error when compiling on Termux.

I built llama.cpp using the termux instructions back on Apr 23, 2024. I still had a copy o fthat build and it still works with a previous version of Phi-3 that I'd downloaded. More recently I downloaded the imatrix version of the Phi-3 in-place update quantized by Bartowski at: https://huggingface.co/bartowski/Phi-3.1-mini-4k-instruct-GGUF (specifically using IQ4_XS model). I get an error of "Unknown model architecture: Phi3". (Possibly related to #8845?)

So, since Imatrix is a ibt new, I pulled the latest llama.cpp. I'd updated all my build-essentials and followed the instructions in the Android.md. Then, when running the llama-cli (I assume this replaced the "main") I get an error:

CANNOT LINK EXECUTBLE "bin/llama-cli": library "libomp.so" not found: ....

So after digging into this a bit, I rolled back to a commit from April/May timeframe and compiled with the same instructions: that one worked I tried from Early July (git checkout 213701b): didn't work I tried a commit from early June (2e666832e6): that one worked....

Somwhere between June and July there was a commit that breaks Termux Android instructions.

I'm using NDK r26, clang and the compile instructions found in the latest (as of today) Android.md file in the docs.

I'm on a Samsung Galaxy S21 Ultra if it makes a difference.

2themaxx commented 1 month ago

Attaching build example with two different commits and example, using Linux script replay command. Cut off generation so as not to wait, but I'm getting about 5 tok/s on that Phi-3.1 gguf model linked above.

As I'm reading through the logs, is this a different error since I'm not finding libomp? I have previously compiled with openCL, but on the Qualcomm Adreno GPU, it's poorly implemented (openCL) and I've seen that recently openCL for llama.cpp is deprecated, so I'm just trying to use the CPU (which is plenty fast with Phi3 for my use case).

myscript.txt