Skip to content

OpenMP build relies on homebrew? #7

@zap150

Description

@zap150

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.)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions