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

setup: make gcc step fails when homebrew is not installed in /usr/local #203

Closed
acf opened this issue Feb 10, 2021 · 18 comments · Fixed by #256
Closed

setup: make gcc step fails when homebrew is not installed in /usr/local #203

acf opened this issue Feb 10, 2021 · 18 comments · Fixed by #256
Labels
help wanted Extra attention is needed won't fix This will not be worked on

Comments

@acf
Copy link
Contributor

acf commented Feb 10, 2021

Hi Stefan,

I've run through your instructions successfully on both my intel Macs using homebrew but I just tried on an M1 Mac and hit an issue configuring/building gcc. It complains about gmp.h not being found.

I have checked homebrew and on both Intel and M1 it sports version 6.2.1 of GMP installed with no caveats or issues.

After hitting the wall on gmake alland trying some googling I saw some suggestions for running contrib/download_prerequisites which I tried. Got past the configure gcc step and into make gcc at which point I hit a similar error "configuring in mpfr", which also complained about gmp.

I'm afraid I'm a bit new to this kind of GNU wizardry so may not be much help in answering further questions, but happy to try or send you the logs I have.

As I say, homebrew seemed happy on both platforms and all worked fine on my intel Macs.

@bebbo bebbo added the help wanted Extra attention is needed label Feb 10, 2021
@bebbo
Copy link
Owner

bebbo commented Feb 10, 2021

unless someone donates me such a platform, I can't support it. Maybe someone else steps in!?

@acf
Copy link
Contributor Author

acf commented Feb 11, 2021

Understood. Sorry I'm not able to be much help here, I'm a bit sketchy on how configure works at all 😳

If someone can explain to me how the process "decides" that there's no valid GMP I could probably dig further to see what "test" is failing on this system. Is it as simple as checking for the presence of a header ? Or is there some version number check somehow ?

In other words, what specially leads GCC to decide there's no valid GMP ?

@bebbo
Copy link
Owner

bebbo commented Feb 11, 2021

In other words, what specially leads GCC to decide there's no valid GMP ?

  • the headers must be present
  • some code is compiled and must no yield an error

look at the end of config.log in the gcc's build folder.

@acf
Copy link
Contributor Author

acf commented Feb 11, 2021

Ok so, the output from configure\ gcc.log looks good for gmp.h, but mentions ISL.

Screenshot 2021-02-11 at 12 59 18

in make\ gcc.log however it looks like the error is actually in "configure ISL" ?

Screenshot 2021-02-11 at 13 00 06

Apologies again for being frustratingly bad at this, but again happy to help in any way I can (short of mailing you an M1 Mac :-)

@bebbo
Copy link
Owner

bebbo commented Feb 11, 2021

maybe you can install isl to use that prebuilt isl version?

@acf
Copy link
Contributor Author

acf commented Feb 11, 2021

is that something I would do through homebrew ?

@bebbo
Copy link
Owner

bebbo commented Feb 11, 2021

yes, sir.

@acf
Copy link
Contributor Author

acf commented Feb 11, 2021

Screenshot 2021-02-11 at 13 45 01

@acf
Copy link
Contributor Author

acf commented Feb 11, 2021

So many moving parts. I take my hat off to you that it works so well on Intel :-)

@bebbo
Copy link
Owner

bebbo commented Feb 11, 2021

uhm - out of ideas - maybe it works, if you also build mpfr, mfc and gmp yourself?

use contrib/download_prerequisites to do that

@acf
Copy link
Contributor Author

acf commented Feb 11, 2021

Yup, tried that too :-)

@acf
Copy link
Contributor Author

acf commented Feb 11, 2021

Guess we'll leave it for someone who knows what they are doing and has an M1

@bebbo
Copy link
Owner

bebbo commented Feb 11, 2021

that and is the problem^^

@acf
Copy link
Contributor Author

acf commented Feb 11, 2021

yup. You have the brains and I have the hardware. I guess they'll get more common over time.

Oh.

One thing that does suddenly occur to me actually is that my intel MBP is on 10.15 and my M1 is 11.2 🤦 So maybe its BigSur related rather than M1 related. 💡

@bebbo
Copy link
Owner

bebbo commented Feb 12, 2021

I just read this:
compiled by GNU C version Apple LLVM 12.0.0 (clang-1200.0.32.29), GMP version 4.3.2, MPFR version 2.4.2, MPC version 0.8.1, isl version 0.15
maybe it's helpful

@acf
Copy link
Contributor Author

acf commented Feb 12, 2021

Read it where ?

@bebbo bebbo added the won't fix This will not be worked on label Feb 15, 2021
@acf
Copy link
Contributor Author

acf commented Mar 18, 2021

OK I'm. little closer. Its not an ARM issue per se.

https://github.com/bebbo/amiga-gcc/blob/master/Makefile#L402-L405

These lines seem to set up gcc to find gmp etc in the homebrew locations. Trouble is Homebrew installs in /opt/homebrew on Apple Silicon, not /usr/local.

In other words, if homebrew is installed anywhere other than /usr/local, those lines don't work.

If I manually change the those lines to point to/opt/homebrew/lib and /opt/homebrew/include and then run CC=gcc-10 CXX=g++-10 SHELL=/opt/homebrew/bin/bash gmake gcc. I get past the configure gcc stage successfully.

Yay!

When it comes to the make gcc stage it runs a configure isl however which still failing saying gmp.h can't be found and I also noticed checking which gmp to use... system so I assume the --with-gmp information is not being passed on down.

So.

Given I can correct the lines in the amiga-gcc/Makefile to pass the right stuff for ARM during the configure gcc stage, what do I need to do to make sure that percolates down into the "inner" configure that's run during the make gcc stage ?

@acf
Copy link
Contributor Author

acf commented Mar 18, 2021

looked in build-Darwin/gcc/Makefile and found that configure-isl is passed the values I passed in at the top 🤔 Though it would be nice to tell make gcc just to use the ISL that homebrew already installed.

Screenshot 2021-03-18 at 23 10 42

@acf acf changed the title setup: gmake all step fails building gcc on Apple M1 setup: make gcc step fails when homebrew is not installed in /usr/local Mar 19, 2021
@acf acf closed this as completed Mar 19, 2021
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 won't fix This will not be worked on
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants