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

'gmp.h' file not found on macOS #2

Open
CluEleSsUK opened this issue Jun 14, 2023 · 2 comments
Open

'gmp.h' file not found on macOS #2

CluEleSsUK opened this issue Jun 14, 2023 · 2 comments

Comments

@CluEleSsUK
Copy link

Hi there. I'm trying to run the ./build.sh script on macOS, but am getting the following error:

src/driver.hpp:8:10: fatal error: 'gmp.h' file not found

I do indeed have gmp installed and up-to-date with homebrew:

$ find /usr /opt -name "gmp.h"
/opt/homebrew/include/gmp.h
/opt/homebrew/Cellar/gmp/6.2.1_1/include/gmp.h

I tried adding the flag -I/opt/homebrew/include but received:

+ c++ -std=c++11 -pthread -g -O -o minroot -Wall -Wextra -Ilibft4222 -Isrc -I/opt/homebrew/include src/main.cpp src/driver.cpp src/ftdi_driver.cpp pasta_vdf.o assembly.o -Llibft4222/build -lft4222 -lgmp -framework Foundation -framework IOKit
ld: library not found for -lgmp
clang: error: linker command failed with exit code 1 (use -v to see invocation)

I'm a bit of a c++ noob, so I suspect I'm doing something wrong - any help would be appreciated!

@CluEleSsUK
Copy link
Author

CluEleSsUK commented Jun 14, 2023

Have downloaded the build artifact and it works fine though!

@SchaffHub
Copy link
Collaborator

@CluEleSsUK, just checked this repo today and saw the issue for the first time. Maybe I can offer some help.

I also used homebrew to install gmp on my MacBook. To get the compiler to find the gmp header files I created symbolic links in /usr/local/include.

% ls -al /usr/local/include
total 0
drwxr-xr-x  4 root  wheel  128 Apr 24 15:47 .
drwxr-xr-x  5 root  wheel  160 May 31 06:57 ..
lrwxr-xr-x  1 root  wheel   46 Apr 24 15:47 gmp.h -> /opt/homebrew/Cellar/gmp/6.2.1_1/include/gmp.h
lrwxr-xr-x  1 root  wheel   48 Apr 24 15:47 gmpxx.h -> /opt/homebrew/Cellar/gmp/6.2.1_1/include/gmpxx.h

I also have symlinks to gmp libs in /usr/local/lib. That may be the next hurdle you encounter.

total 0
drwxr-xr-x  4 root  wheel  128 Apr 24 15:49 .
drwxr-xr-x  5 root  wheel  160 May 31 06:57 ..
lrwxr-xr-x  1 root  wheel   49 Apr 24 15:49 libgmp.dylib -> /opt/homebrew/Cellar/gmp/6.2.1_1/lib/libgmp.dylib
lrwxr-xr-x  1 root  wheel   53 Apr 24 15:49 libgmpxx.dylib -> /opt/homebrew/Cellar/gmp/6.2.1_1/lib/libgmpxx.4.dylib

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

2 participants