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

OpenMP build relies on homebrew? #7

Open
zap150 opened this issue Nov 22, 2023 · 0 comments
Open

OpenMP build relies on homebrew? #7

zap150 opened this issue Nov 22, 2023 · 0 comments

Comments

@zap150
Copy link

zap150 commented Nov 22, 2023

I believe there is a problem with including the libomp from homebrew. While you seem to perform

install_name_tool -change /opt/homebrew/opt/libomp/lib/libomp.dylib @rpath/libomp.dylib libtorch/lib/libtorch_cpu.dylib

in your workflow, I still see

otool -L lib/libtorch_cpu.dylib 
lib/libtorch_cpu.dylib:
	@rpath/libtorch_cpu.dylib (compatibility version 0.0.0, current version 0.0.0)
        ...
	/opt/homebrew/opt/libomp/lib/libomp.dylib (compatibility version 5.0.0, current version 5.0.0)

Moreover, I think you should also do something like

install_name_tool -id @rpath/libomp.dylib libtorch/lib/libomp.dylib

to fix

otool -L lib/libomp.dylib
lib/libomp.dylib:
	/opt/homebrew/opt/libomp/lib/libomp.dylib (compatibility version 5.0.0, current version 5.0.0)

This can cause troubles both when not using homebrew on your system at all, or when trying to compile something against a different package manager while having hombrew installed. (I do not have omp installed from homebrew at the mooment, so the path does not exist.)

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