fix: update cpu_get_num_math to common_cpu_get_num_math (llama.cpp rename)#603
Open
WayOfTheMap wants to merge 1 commit into
Open
fix: update cpu_get_num_math to common_cpu_get_num_math (llama.cpp rename)#603WayOfTheMap wants to merge 1 commit into
WayOfTheMap wants to merge 1 commit into
Conversation
…name) Upstream llama.cpp renamed cpu_get_num_math() to common_cpu_get_num_math() in common/common.h as part of the common_* namespace pass. The function signature is unchanged. This updates the three call sites in the addon to use the new name, resolving the compile errors when rebuilding against current llama.cpp. - llama/addon/AddonContext.cpp:400 - llama/addon/AddonContext.cpp:748 - llama/addon/addon.cpp:54
|
+1 — independently hit the same three undeclared-identifier errors today while rebuilding the addon against current llama.cpp on macOS arm64 (b9151). This patch fixes them cleanly; combined with #597 (the Cleanly extractable from a larger working tree; great PR scope. |
7 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
After
npx node-llama-cpp source download --release latest --gpu metal, the addon fails to compile with:Upstream llama.cpp renamed
cpu_get_num_math()tocommon_cpu_get_num_math()incommon/common.has part of thecommon_*namespace pass. The function signature is unchanged.This PR updates the three call sites in the addon to use the new name.
Changes
llama/addon/AddonContext.cpp:400—cpu_get_num_math()→common_cpu_get_num_math()llama/addon/AddonContext.cpp:748—cpu_get_num_math()→common_cpu_get_num_math()llama/addon/addon.cpp:54—cpu_get_num_math()→common_cpu_get_num_math()Related
This is one of three compile blockers when rebuilding the addon against current llama.cpp on macOS Sequoia (SDK 26.2). The other two — the
common→llama-commonlibrary target rename and thestd::atomic_bool loaded = false;deleted-copy-ctor — are addressed by #597 (@CreatiCoding). All three patches together produce a working build.Verification
Applied this patch plus #597 against
withcatai/node-llama-cpp@v3.18.1, rannpx node-llama-cpp source download --release latest --gpu metal(resolved to llama.cppb9145), and verified end-to-end on macOS 15.x arm64 with Metal:Gemma 4 specifically requires this rebuild path — the prebuilt llama.cpp
b8390that ships with v3.18.1 predates Gemma 4 architecture support, so loading a Gemma 4 GGUF without rebuilding returnsunknown model architecture: 'gemma4'.