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

Apple Clang 16 build issue, requires ld_classic #8653

Open
adamjstewart opened this issue Sep 18, 2024 · 1 comment
Open

Apple Clang 16 build issue, requires ld_classic #8653

adamjstewart opened this issue Sep 18, 2024 · 1 comment

Comments

@adamjstewart
Copy link
Contributor

🐛 Describe the bug

When building from source with the new Apple Clang 16, I see the following error:

  ld: multiple errors: duplicate LC_RPATH '/Users/Adam/spack/opt/spack/darwin-sequoia-m2/apple-clang-16.0.0/cpuinfo-2023-11-04-4sylnhqsvndbdpgwvv3mydc6xhudikqh/lib' in '/Users/Adam/spack/opt/spack/darwin-sequoia-m2/apple-clang-16.0.0/py-torch-2.4.1-wsy5qo376pu3gqk6sazvaff3wf6uo6fl/lib/python3.11/site-packages/torch/lib/libc10.dylib'; duplicate LC_RPATH '/Users/Adam/spack/opt/spack/darwin-sequoia-m2/apple-clang-16.0.0/protobuf-3.13.0-sqetzfmrwohnuex4orfxr5loztdqj6rq/lib' in '/Users/Adam/spack/opt/spack/darwin-sequoia-m2/apple-clang-16.0.0/py-torch-2.4.1-wsy5qo376pu3gqk6sazvaff3wf6uo6fl/lib/python3.11/site-packages/torch/lib/libtorch.dylib'; duplicate LC_RPATH '/Users/Adam/spack/opt/spack/darwin-sequoia-m2/apple-clang-16.0.0/protobuf-3.13.0-sqetzfmrwohnuex4orfxr5loztdqj6rq/lib' in '/Users/Adam/spack/opt/spack/darwin-sequoia-m2/apple-clang-16.0.0/py-torch-2.4.1-wsy5qo376pu3gqk6sazvaff3wf6uo6fl/lib/python3.11/site-packages/torch/lib/libtorch_cpu.dylib'; duplicate LC_RPATH '/Users/Adam/spack/opt/spack/darwin-sequoia-m2/apple-clang-16.0.0/protobuf-3.13.0-sqetzfmrwohnuex4orfxr5loztdqj6rq/lib' in '/Users/Adam/spack/opt/spack/darwin-sequoia-m2/apple-clang-16.0.0/py-torch-2.4.1-wsy5qo376pu3gqk6sazvaff3wf6uo6fl/lib/python3.11/site-packages/torch/lib/libtorch_python.dylib'
  clang++: error: linker command failed with exit code 1 (use -v to see invocation)

Current workaround is to inject -Wl,-ld_classic into the linker, but would be good to fix this as ld_classic is deprecated and will be removed in the future.

Versions

  • torchvision: 0.19.1
  • clang: 16.0.0
@adamjstewart
Copy link
Contributor Author

We implemented a compiler wrapper in Spack that removes duplicate RPATHs, but we're still seeing the following issue:

ld: duplicate LC_RPATH '@loader_path' in '/Users/Adam/spack/opt/spack/darwin-sequoia-m2/apple-clang-16.0.0/py-torch-2.4.1-hlpsikrtvukd4ww7jyghncl63ux7f2pl/lib/python3.11/site-packages/torch/lib/libtorch_cpu.dylib'
clang++: error: linker command failed with exit code 1 (use -v to see invocation)
error: command '/Users/Adam/spack/lib/spack/env/clang/clang++' failed with exit code 1

It's possible the bug is in PyTorch itself, but I'm not familiar enough with CMake to report it.

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

No branches or pull requests

1 participant