Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

macOS: Homebrew packages can interfere with C++ compilation #31

Open
ChrisCummins opened this issue Jan 4, 2021 · 1 comment
Open
Labels
Bug Something isn't working

Comments

@ChrisCummins
Copy link
Contributor

ChrisCummins commented Jan 4, 2021

🐛 Bug

When boost or protobuf packages are installed via homebrew they can interfere with the CompilerGym build, causing compile-time or load-time errors.

To Reproduce

Steps to reproduce the behavior:

  1. brew install boost
  2. make distclean
  3. bazel run //compiler_gym/envs/llvm/service

Error message along the lines of:

dyld: lazy symbol binding failed: Symbol not found: __ZN5boost10filesystem6detail38recursive_directory_iterator_constructERNS0_28recursive_directory_iteratorERKNS0_4pathEjPNS_6system10error_codeE
  Referenced from: /private/var/tmp/_bazel_user/path/to/CompilerGym/compiler_gym/envs/llvm/service/service
  Expected in: flat namespace

Workaround

Uninstall boost prior to building CompilerGym:

  1. brew uninstall --ignore-dependencies protobuf boost
  2. make distclean
  3. Run your build command, e.g. make install

This package conflict only matters at build time. Once you are done building CompilerGym, you can now reinstall the brew packages:

brew install protobuf boost

Environment

  • CompilerGym: 0.1.1
  • How you installed CompilerGym (conda, pip, source): source
  • OS: macOS 11.1
  • Python version: 3.8
  • Build command you used (if compiling from source): bazel run //compiler_gym/envs/llvm/service
  • GCC/clang version (if compiling from source): Apple clang version 12.0.0 (clang-1200.0.26.2)
  • Bazel version (if compiling from source): Build label: 3.1.0
  • Versions of any other relevant libraries: boost: stable 1.75.0 (bottled), HEAD
@ChrisCummins ChrisCummins added the Bug Something isn't working label Jan 4, 2021
@ChrisCummins ChrisCummins changed the title macOS: dyld lazy symbol binding fails with homebrew boost installed macOS: Homebrew packages can interfere with C++ compilation Feb 8, 2021
@ChrisCummins
Copy link
Contributor Author

This issue has been replicated using the homebrew protobuf package, although with different symptoms. The workaround is the same:

brew uninstall protobuf
make distclean
make test  # or whatever build command failed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant