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

Problems on Macs #67

Open
peastman opened this issue Feb 17, 2022 · 1 comment
Open

Problems on Macs #67

peastman opened this issue Feb 17, 2022 · 1 comment
Labels
help wanted Extra attention is needed

Comments

@peastman
Copy link
Member

I recently got an M1 Mac. In trying to get this plugin working on it, I encountered some very rough edges. We should figure out how to resolve them, or else they'll cause a lot of problems for users.

The first roadblock I ran into was a linker error trying to build the plugin: it couldn't find the library libopenblas.dylib (which is required by PyTorch), even though I have the libopenblas conda package installed. With some searching I found this issue which partly explains the problem: the actual library is called libopenblas.0.dylib. The solution suggested there is to create a symlink to it with the other name. That works, but we can't really ask users to do that.

I haven't been able to figure out where it's getting the incorrect name from. It doesn't appear anywhere in the CMake files either for this library or for PyTorch. Running otool -L on the PyTorch libraries shows that all of them refer to it by the correct name. But somehow CMake is getting the incorrect name and putting it in the makefiles it generates.

The second problem I encountered was that it couldn't find libtorch.dylib at runtime, and therefore couldn't load the plugin. This was a library path issue. Most libraries for conda packages are put in the lib directory for the environment, which is automatically added to the library path. But PyTorch instead puts its libraries in site-packages/torch/lib, which is not added automatically. I was able to work around it by setting DYLD_LIBRARY_PATH in the terminal, but that isn't a convenient solution for users.

@peastman
Copy link
Member Author

peastman commented Mar 7, 2022

The library path issue is fixed by #72. I understand the cause of the libopenblas naming problem better now, but it isn't clear what the right solution is. See conda-forge/openblas-feedstock#134.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants