CPUINFO_SUPPORTED_PLATFORM not set on OSX as CMAKE_SYSTEM_PROCESSOR is not set
Nobody has claimed this yet.
- Dominant language
- C
- Stars
- 1.2k
- Forks
- 409
- PR merge metrics
- No merged PRs in 30d
Description
CMAKE_SYSTEM_PROCESSOR is not set by cmake on apple platforms which causes this warning:
MESSAGE(WARNING
"Target processor architecture is not specified. "
"cpuinfo will compile, but cpuinfo_initialize() will always fail.")
at this line: https://github.com/pytorch/cpuinfo/blob/ef634603954d88d2643d5809011288b890ac126e/CMakeLists.txt#L90
There is actually a check if we are building for iOS that causes this warning to not be emitted and CPUINFO_SUPPORTED_PLATFORM be set to true, however this is not the case on OSX, is this on purpose?
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start in CMakeLists.txt around line 90 and compare the existing iOS check with configuration on macOS, focusing on how CMAKE_SYSTEM_PROCESSOR is handled. Verify the resulting macOS configuration no longer produces the reported warning and that CPUINFO_SUPPORTED_PLATFORM has the expected value.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- c, cmake, macos
- Domain
- build-system, operating-systems
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100