Skip to content

Fix build.sh to use Homebrew Clang on mac#527

Open
PLAZMAMA wants to merge 5 commits intoPufferAI:4.0from
PLAZMAMA:root-cause-macos-clang-fix
Open

Fix build.sh to use Homebrew Clang on mac#527
PLAZMAMA wants to merge 5 commits intoPufferAI:4.0from
PLAZMAMA:root-cause-macos-clang-fix

Conversation

@PLAZMAMA
Copy link
Copy Markdown
Contributor

@PLAZMAMA PLAZMAMA commented Apr 13, 2026

Original issue

Commit ab75881 addresses the -lomp5 compilation error on mac, however this doesn't fix the root cause.

Root Cause

The root cause is that mac's non-standard clang(Apple Clang) links differently than normal clang. For example, the -fopenmp flag isn't supported in apple clang so it creates a compilation error even after the "-lomp5 fix".

This means that this issue will happen with other libs in the future and will have to be fixed and maintained constantly.

The Fix

This PR addresses the original issue and root cause by forcing the user to use "real" clang in a clear way which makes compilation identical on Linux and Mac.

Additional Notes

  • Installing real clang on mac is really easy, its just brew install llvm. So this shouldn't make mac user's life that much harder.
  • Additionally, its worth noting that I became aware of the -lomp5 and -fopenmp issues from this PR PufferLib 4.0 macOS installation fixes #507 first

Working Build Commands on Mac

  • ./build.sh breakout --local
  • ./build.sh breakout --cpu

@PLAZMAMA PLAZMAMA changed the title Fix build.sh to use Homebrew LLVM paths on mac Fix build.sh to use Homebrew Clang on mac Apr 13, 2026
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.

1 participant