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

Cmake build error in Termux #4340

Closed
4 tasks done
Jeximo opened this issue Dec 5, 2023 · 2 comments
Closed
4 tasks done

Cmake build error in Termux #4340

Jeximo opened this issue Dec 5, 2023 · 2 comments

Comments

@Jeximo
Copy link
Contributor

Jeximo commented Dec 5, 2023

Prerequisites

Please answer the following questions for yourself before submitting an issue.

  • I am running the latest code. Development is very rapid so there are no tagged versions as of now.
  • I carefully followed the README.md.
  • I searched using keywords relevant to my issue to make sure that I am creating a new issue that is not already open (or closed).
  • I reviewed the Discussions, and have a new bug or useful enhancement to share.

Expected Behavior

I expect cmake -B build is suffecient to build llama.cpp

Current Behavior

cmake -B build fails. make works as expected.

Environment and Context

$ lscpu

Architecture: aarch64
CPU op-mode(s): 32-bit, 64-bit
Byte Order: Little Endian
CPU(s): 8
On-line CPU(s) list: 0-7
Vendor ID: Qualcomm
Model name: Kryo-4XX-Silver
Model: 14
Thread(s) per core: 1
Core(s) per socket: 4
Socket(s): 1
Stepping: 0xd
CPU(s) scaling MHz: 62%
CPU max MHz: 1785.6000
CPU min MHz: 300.0000
BogoMIPS: 38.40
Flags: fp asimd evtstrm aes pmull sha1 sha
2 crc32 atomics fphp asimdhp cpuid
asimdrdm lrcpc dcpop asimddp
Model name: Kryo-4XX-Gold
Model: 14
Thread(s) per core: 1
Core(s) per socket: 2
Socket(s): 2
Stepping: 0xd
CPU(s) scaling MHz: 71%
CPU max MHz: 2841.6001
CPU min MHz: 710.4000
BogoMIPS: 38.40
Flags: fp asimd evtstrm aes pmull sha1 sha
2 crc32 atomics fphp asimdhp cpuid
asimdrdm lrcpc dcpop asimddp
Vulnerabilities:
Itlb multihit: Not affected
L1tf: Not affected
Mds: Not affected
Meltdown: Vulnerable
Spec store bypass: Vulnerable
Spectre v1: Mitigation; __user pointer sanitiza
tion
Spectre v2: Mitigation; Branch predictor harden
ing
Srbds: Not affected
Tsx async abort: Not affected

  • Operating System, e.g. for Linux:

`$ uname -a
Linux localhost 4.14.190-23725627-abG975WVLS8IWD1 #2 SMP PREEMPT Mon Apr 10 18:16:39 KST 2023 aarch64 Android

$ python3 --version
Python 3.11.6

$ make --version
GNU Make 4.4.1
Built for aarch64-unknown-linux-android

$ g++ --version
clang version 17.0.6
Target: aarch64-unknown-linux-android24
Thread model: posix
InstalledDir: /data/data/com.termux/files/usr/bin

Failure Information (for bugs)

cmake -B build
-- The C compiler identification is Clang 17.0.6
-- The CXX compiler identification is Clang 17.0.6
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - failed
-- Check for working C compiler: /data/data/com.termux/files/usr/bin/cc
-- Check for working C compiler: /data/data/com.termux/files/usr/bin/cc - broken
CMake Error at /data/data/com.termux/files/usr/share/cmake-3.27/Modules/CMakeTestCCompiler.cmake:67 (message):
  The C compiler

    "/data/data/com.termux/files/usr/bin/cc"

  is not able to compile a simple test program.

  It fails with the following output:

    Change Dir: '/data/data/com.termux/files/home/llamallama/build/CMakeFiles/CMakeScratch/TryCompile-HiIZPq'

    Run Build Command(s): /data/data/com.termux/files/usr/bin/cmake -E env VERBOSE=1 /data/data/com.termux/files/usr/bin/make -f Makefile cmTC_c7a8c/fast
    /data/data/com.termux/files/usr/bin/make  -f CMakeFiles/cmTC_c7a8c.dir/build.make CMakeFiles/cmTC_c7a8c.dir/build
    make[1]: Entering directory '/data/data/com.termux/files/home/llamallama/build/CMakeFiles/CMakeScratch/TryCompile-HiIZPq'
    Building C object CMakeFiles/cmTC_c7a8c.dir/testCCompiler.c.o
    /data/data/com.termux/files/usr/bin/cc   -march=armv7.1a  -O2 -g -DNDEBUG -MD -MT CMakeFiles/cmTC_c7a8c.dir/testCCompiler.c.o -MF CMakeFiles/cmTC_c7a8c.dir/testCCompiler.c.o.d -o CMakeFiles/cmTC_c7a8c.dir/testCCompiler.c.o -c /data/data/com.termux/files/home/llamallama/build/CMakeFiles/CMakeScratch/TryCompile-HiIZPq/testCCompiler.c
    cc: error: unsupported argument 'armv7.1a' to option '-march='
    make[1]: *** [CMakeFiles/cmTC_c7a8c.dir/build.make:79: CMakeFiles/cmTC_c7a8c.dir/testCCompiler.c.o] Error 1
    make[1]: Leaving directory '/data/data/com.termux/files/home/llamallama/build/CMakeFiles/CMakeScratch/TryCompile-HiIZPq'
    make: *** [Makefile:127: cmTC_c7a8c/fast] Error 2

  CMake will not be able to correctly generate this project.
Call Stack (most recent call first):
  CMakeLists.txt:2 (project)

Steps to Reproduce

  1. In Termux then git clone the repo
  2. cd llama.cpp
  3. cmake -B build
@BarfingLemurs
Copy link
Contributor

This works for me

cd llama.cpp
mkdir build
cd build
cmake ..
cmake --build . --config Release

@Jeximo
Copy link
Contributor Author

Jeximo commented Dec 6, 2023

Thanks for your response. It didn't work, so I cleared data/cache & reinstalled cmake which fixed it.

@Jeximo Jeximo closed this as completed Dec 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants