microsoft / microsoft/BitNet

Build does not use correct clang

Open
#228 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
C++
Stars
40.3k
Forks
3.7k
PR merge metrics
No merged PRs in 30d

Description

I downloaded and built the model (microsoft/BitNet-b1.58-2B-4T-gguf) using my Intel Mac following the instructions on README.
I installed llvm using brew.

$ which clang
/usr/local/opt/llvm/bin/clang
$ clang --version
Homebrew clang version 20.1.3
Target: x86_64-apple-darwin24.4.0
Thread model: posix
InstalledDir: /usr/local/Cellar/llvm/20.1.3/bin
Configuration file: /usr/local/etc/clang/x86_64-apple-darwin24.cfg

I added the following commands to ~/.zshrc

export PATH="/usr/local/opt/llvm/bin:$PATH"
export LDFLAGS="-L/usr/local/opt/llvm/lib"
export CPPFLAGS="-I/usr/local/opt/llvm/include"
export CC=clang
export CXX=clang++
export LD=ld.lld
export AR=llvm-ar
export RANLIB=llvm-ranlib

However, when I run run_inference.py, it tells me that the model was built using the native clang on my machine (which is a lower version than the requirement clang>=18):

build: 3957 (5eb47b72) with Apple clang version 17.0.0 (clang-1700.0.13.3) for x86_64-apple-darwin24.4.0

Does anyone know how to fix this?

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the README build instructions and the compiler invocation reached through run_inference.py. Trace why the build reports Apple clang 17 despite the configured Homebrew LLVM environment, then verify that the model reports the intended clang version after rebuilding.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
build-system
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
43/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.