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

error: could not find a working compiler on MacOS Big Sure #290

Closed
shavrasho opened this issue Nov 15, 2020 · 7 comments · Fixed by #292
Closed

error: could not find a working compiler on MacOS Big Sure #290

shavrasho opened this issue Nov 15, 2020 · 7 comments · Fixed by #292

Comments

@shavrasho
Copy link

Hello,
the configure is not able to find a working compiler on MacOS Big Sure 11.0.1.
the gcc is installed, uptodate and avaible in $PATH!

./configure output:

checking build system type... x86_64-apple-darwin20.1.0 checking host system type... x86_64-apple-darwin20.1.0 checking for a BSD-compatible install... /usr/bin/install -c checking whether build environment is sane... yes checking for a thread-safe mkdir -p... ./install-sh -c -d checking for gawk... no checking for mawk... no checking for nawk... no checking for awk... awk checking whether make sets $(MAKE)... yes checking whether make supports nested variables... yes checking whether to enable maintainer-specific portions of Makefiles... no checking ABI=64 checking compiler gcc -m64 ... no, long long reliability test 2 checking whether cc is gcc... yes checking compiler cc -m64 ... no, long long reliability test 2 checking ABI=32 checking compiler gcc -m32 -O2 -fomit-frame-pointer ... no checking compiler gcc -O2 -fomit-frame-pointer ... no, long long reliability test 2 checking compiler icc -no-gcc ... no checking whether cc is gcc... yes checking compiler cc -m32 -O2 -fomit-frame-pointer ... no checking compiler cc -O2 -fomit-frame-pointer ... no, long long reliability test 2 configure: error: could not find a working compiler, see config.log for details

config.log

@fxcoudert
Copy link

That's because the "long long reliability test 2" trips the compiler:

GMP_PROG_CC_WORKS_PART([$1], [long long reliability test 2],
[/* The following provokes an internal compiler error on powerpc-apple-darwin.
   Extracted from mpz/cfdiv_q_2exp.c.  Causes Apple's gcc 3.3 build 1640 and
   1666 to get an ICE with -O1 -mpowerpc64.  */
#ifdef __GNUC__
f(int u){int i;long long x;x=u?~0:0;if(x)for(i=0;i<9;i++);x&=g();if(x)g();}
g(){}

but that program is invalid in C99, and clang12 errors out:

a.c:1:62: error: implicit declaration of function 'g' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
f(int u){int i;long long x;x=u?~0:0;if(x)for(i=0;i<9;i++);x&=g();if(x)g();}
                                                             ^

The test program should be adjusted to valid C99.

@alexjbest
Copy link

This is showing up via sage too https://groups.google.com/g/sage-devel/c/dzO2BZmEWhI

@shavrasho
Copy link
Author

installing with HomeBrew dose actually work, however compiling from source or through https://github.com/macports/macports-base MacPorts brings the same problem!

@alexjbest
Copy link

Ok so either a patch like alisw/GMP@e85f960 or https://gmplib.org/list-archives/gmp-commit/2014-March/002052.html should be applied to acinclude.m4 it seems?

@kevinfay
Copy link

installing with HomeBrew dose actually work, however compiling from source or through https://github.com/macports/macports-base MacPorts brings the same problem!

Excuse me, have you solved this problem? In a hurry to use MPIR....gnuradio in big sur

@kevinfay
Copy link

Ok so either a patch like alisw/GMP@e85f960 or https://gmplib.org/list-archives/gmp-commit/2014-March/002052.html should be applied to acinclude.m4 it seems?

Patch like https://github.com/alisw/GMP/commit/e85f96087084141a54ddef7f1eb8d28128bc717a failed...

@shavrasho
Copy link
Author

installing with HomeBrew dose actually work, however compiling from source or through https://github.com/macports/macports-base MacPorts brings the same problem!

Excuse me, have you solved this problem? In a hurry to use MPIR....gnuradio in big sur

No, actully i still have the same problem and therfore couldnt install gnuradio also!
but if you need gnuradio only without the headers you can use brew install!

mitchblank added a commit to mitchblank/mpir that referenced this issue Dec 21, 2020
Changes are needed becuase Xcode12 includes a default of
-Werror,-Wimplicit-function-declaration which means that
even something like calling "exit(0);" is a compile failure
if you haven't done a "#include <stdlib.h>" first (as C99
requires, but most other compilers will just warn about)

I don't know if the "long long reliability test 2" test which
tries to provoke a crash on a particular gcc 3.3 build still
does what it was originally intended to do with my change.
Of course, I doubt anyone has tried to use that compiler in
years.

Fixes wbhart#290
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

Successfully merging a pull request may close this issue.

4 participants