Skip to content

Fix missing nproc on macOS#3577

Merged
tannewt merged 1 commit into
adafruit:mainfrom
cwalther:nproc
Oct 20, 2020
Merged

Fix missing nproc on macOS#3577
tannewt merged 1 commit into
adafruit:mainfrom
cwalther:nproc

Conversation

@cwalther

Copy link
Copy Markdown

#3541 (396979a) breaks building on macOS, which doesn’t have an nproc command. That seems to be a Linux thing. The equivalent would be sysctl -n hw.logicalcpu, but since I can’t find any existing platform distinctions in the makefiles, I chose to call Python for a cross-platform solution. (Credits to https://stackoverflow.com/questions/1715580.)

396979a breaks building on macOS: `nproc` is a Linux thing, use a cross-platform alternative.

@jepler jepler left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you! The lone build failure appears to be unrelated and I've added #3578 to hopefully address it. (not that it matters, as running Python is a perfectly good alternative, but is the alternative shell command getconf _NPROCESSORS_ONLN portable?)

@cwalther

Copy link
Copy Markdown
Author

I can’t say anything about general portability, but getconf _NPROCESSORS_ONLN works for me on macOS 10.14.6.

@jerryneedell

Copy link
Copy Markdown
Collaborator

I tried this PR on a Mac and on a Linux system -- built Pyportal -- works OK for both.

@tannewt tannewt merged commit 1092890 into adafruit:main Oct 20, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants