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

Installation on M1 Macbook #43

Closed
amandlek opened this issue Feb 2, 2022 · 4 comments
Closed

Installation on M1 Macbook #43

amandlek opened this issue Feb 2, 2022 · 4 comments

Comments

@amandlek
Copy link

amandlek commented Feb 2, 2022

Thanks for the great codebase! I was trying to install it on my M1 Macbook Air using the command pip install signatory==1.2.6.1.8.0 --no-cache-dir --force-reinstall (I already have pytorch 1.8.0 installed), but I get a giant error message. Some of the more prominent warnings include the compiler warning below (screenshot attached), an error clang: error: unsupported option '-fopenmp', and RuntimeError: Error compiling objects for extension. I'd be happy to provide the full error trace if it would be helpful. Any pointers would be appreciated - thank you!

Screen Shot 2022-02-02 at 1 58 02 PM

@patrick-kidger
Copy link
Owner

patrick-kidger commented Feb 2, 2022

Right, so. The short (unfortunate) version is that Signatory doesn't provide official support for macOS. I don't have access to a Mac myself so it wasn't really feasible to debug the build errors I was getting.

Some of the earlier versions of Signatory do support macOS -- version 1.2.3 was the latest to offer macOS support. You might be able to use that.

Alternatively, if you're familiar with the toolchain and how to make that kind of thing work, you can install Signatory from source, and compile the C++ yourself. (That's actually what pip is trying to do for you automatically, and what is giving you the big error you see.) This is definitely possible -- and probably not too bad if you have some familiarity with this kind of thing -- but it's not something I'd be able to help debug.

@amandlek
Copy link
Author

amandlek commented Feb 3, 2022

I see - thanks for the help!

@amandlek amandlek closed this as completed Feb 3, 2022
@amandlek
Copy link
Author

I was able to successfully install the library! I'm posting the steps that worked for me in case it helps someone else.

First, I ran brew install llvm. Then, I ran the following commands in sequence.
export PATH="/opt/homebrew/opt/llvm/bin:$PATH"
export LDFLAGS="-L/opt/homebrew/opt/llvm/lib"
export CPPFLAGS="-I/opt/homebrew/opt/llvm/include"
MACOSX_DEPLOYMENT_TARGET=11.3.1 CC=clang CXX=clang++ pip install signatory==1.2.6.1.8.0 --no-binary signatory

The deployment target and the signatory version in the last command should be replaced by your MacOS version, and the version of signatory you'd like to install.

@louisamand
Copy link

Thanks a lot !
Your method also worked on M3 Max, MaxOS 14.3.1, Python 3.12.2 and PyTorch 2.1.2 (hooray for MPS !)
I used signatory==1.2.6.1.9.0

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

3 participants