fastecdsa: Cannot install in macOS BigSur (M1 chip)
I’m trying to install fastecdsa
on macOS BigSur (M1 chip) by running
(venv) $ pip3 install fastecdsa
and even though I previously installed gmp
:
$ brew install gmp
it cant find the lib, no matter what I do
src/curve.h:4:10: fatal error: 'gmp.h' file not found
#include "gmp.h"
Although the error changed when I created a symlink
ln -s /opt/homebrew/include/gmp.h /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include
and now I get:
ld: library not found for -lgmp
clang: error: linker command failed with exit code 1 (use -v to see invocation)
error: command '/usr/bin/gcc' failed with exit code 1
I also tried:
- passing the path via env
CFLAGS
,LDFLAGS
and both via global env export (export CFLAGS=...
)
LDFLAGS=-L/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/lib pip3 install fastecdsa
CFLAGS=-I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include pip3 install fastecdsa
xcode-select --install
- endlessly
brew uninstall gmp
andbrew install gmp
, evenbrew reinstall gmp
andbrew unlink gmp
- installing rosetta2
- turning it off and on again
I can’t put my finger on it 😦
About this issue
- Original URL
- State: open
- Created 3 years ago
- Comments: 21 (3 by maintainers)
This worked for me:
CFLAGS=-I/opt/homebrew/opt/gmp/include LDFLAGS=-L/opt/homebrew/opt/gmp/lib pip install fastecdsa
Thanks. I did a bit of everything proposed here by using arm64, compiler flags, etc:
And although installation succeeded, execution fails:
This didn’t work for me on an Intel chip. Instead I had to change the path of gmp to where it actually is (ie where homebrew installs it)
CFLAGS=-I/usr/local/Cellar/gmp/6.2.1_1/include LDFLAGS=-L/usr/local/Cellar/gmp/6.2.1_1/lib pip install fastecdsa
hey guys, i had this exact same problem on mac monterey m1 the way i solved it:
@martriay
This also worked for me, thank you @milancermak! I’m on macOS big sur 11.2.3
was able to make this work on M1, by
ibrew install gmp
as suggested by @neilmipython3 -m pip install --no-binary :all: fastecdsa
as suggested by @justinba1010This worked Dude, thanks for that