[cpp] add version detection for highway#288
Merged
immanuelazn merged 5 commits intomainfrom Jul 21, 2025
Merged
Conversation
immanuelazn
added a commit
that referenced
this pull request
Sep 3, 2025
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.
Background
We use a package named highway, which helps with added efficiency in automatically choosing the best CPU intrinsics for vectorization based on your architecture.
Previously, there was a previous bug during compilation, which did not allow BPCells to utilize Highway if it was already installed. This was fixed. However, I suspect that if you have an older version of highway, installation would fail, and would not fall back to our packaged version of highway. We can see this in #285, where
BroadcastLane, which is part of highway is not being detected.Fix
I made some general improvements to
configurefor highway, in both the logging and the detection.I added some version detection within
hwy-test.cpp, which is version templated throughhwy-test.cpp.in. I also added a fallback to usingpkg-configfound libraries, if the first compilation try fails. There is also some additional clarity on whether the compilation fails because of versioning, or from failing to compile for a different reason.Fixes #285