Skip to content

[SOLVED] build/CMakeFiles/tokenizers_c.dir/all] Error 2 #3

@loretoparisi

Description

@loretoparisi

For who is having this issues on M4 MacBook AIR Sequoia 15.7.1

$ cmake -B build -DCMAKE_BUILD_TYPE=Release
...
[ 64%] Built target sentencepiece-static
[ 65%] Generating aarch64-apple-darwin/release/libtokenizers_c.a
no such file or directory
make[2]: *** [_deps/tokenizers_cpp-build/aarch64-apple-darwin/release/libtokenizers_c.a] Error 1
make[1]: *** [_deps/tokenizers_cpp-build/CMakeFiles/tokenizers_c.dir/all] Error 2
build/CMakeFiles/tokenizers_c.dir/all] Error 2

Here is the root cause:
The error is in the Rust-based tokenizers_c dependency — it's trying to build libtokenizers_c.a via cargo but the output path resolution is failing. This is a known issue with tokenizers-cpp on Apple Silicon. The tokenizers-cpp dependency builds libtokenizers_c.a via Rust/Cargo under the hood, and on your machine either Rust isn't installed, or the aarch64-apple-darwin target is missing, solution following:

curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh\nsource "$HOME/.cargo/env"
rustup target add aarch64-apple-darwin
rm -rf build
  -DCMAKE_OSX_ARCHITECTURES=arm64 \
  -Wno-dev
cmake --build build --parallel $(sysctl -n hw.logicalcpu)

That's all about it!

loretoparisi@MacBook-Air-di-Loreto ANE-LM % ./build/ane-lm generate --model Qwen3.5-0.8B --prompt "Hello"
==========
Hello! How can I help you today?
==========
Prompt: 13 tokens, 21.170 tokens-per-sec
Generation: 9 tokens, 21.906 tokens-per-sec

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions