2

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 and brew install gmp, even brew reinstall gmp and brew unlink gmp
  • installing rosetta2
  • turning it off and on again

I can't put my finger on it :(

martriay
  • 5,632
  • 3
  • 29
  • 39

2 Answers2

0

You may have resolved this by now, but just to say that I ran into something similar, and the solution for me was to tell ld to look in the homebrew library path. Run this/add it to ~/.profile:

export LIBRARY_PATH=$LIBRARY_PATH:/opt/homebrew/lib
export INCLUDE_PATH=$INCLUDE_PATH:/opt/homebrew/include

(I didn't need INCLUDE_PATH in my case, but it looks like you might!)

After that, perhaps your python commands will start working!

jsdw
  • 5,424
  • 4
  • 25
  • 29
0

enter image description here

use the setup.py to install and modify the setup.py as the image

Jack
  • 1
  • Please add code and data as text ([using code formatting](/editing-help#code)), not images. Images: A) don't allow us to copy-&-paste the code/errors/data for testing; B) don't permit searching based on the code/error/data contents; and [many more reasons](//meta.stackoverflow.com/a/285557). Images should only be used, in addition to text in code format, if having the image adds something significant that is not conveyed by just the text code/error/data. – Cristik Apr 21 '22 at 04:47