Unable to install old gcc version on Mac using homebrew. Error in make possibly due to incorrect header file version

18 views Asked by At

I want to install an old version of GCC (7.2.0) on Mac. I am trying to do that with Homebrew. This is what I have done so far:

brew tap-new $USER/local-gcc
brew tap --force homebrew/core   # I had to do this for some reason, I guess because the version I want is too old?
brew extract --version=7.2.0 gcc $USER/local-gcc
brew install [email protected]

However, this fails in the make step.

==> Applying 6.1.0-jit.patch
patching file 'gcc/jit/Make-lang.in'
==> Applying apfs.patch
patching file 'libstdc++-v3/include/Makefile.in'
==> ../configure --build=x86_64-apple-darwin22.6.0 --prefix=/usr/local/Cellar/[email protected]/7.2.0_1 --libdir=/usr/local/Cellar/[email protected]/7.2.0_1/lib/gcc/7 --enable-languages=c,c++,objc,obj-c++,fortran --program-suffix=-7 --with-gmp=/usr/local
==> make
Last 15 lines from /Users/cauthon14/Library/Logs/Homebrew/[email protected]/02.make:
/usr/local/opt/isl/include/isl/mat.h:28:21: note: 'isl_mat_alloc' declared here
__isl_give isl_mat *isl_mat_alloc(isl_ctx *ctx,
                    ^
../../gcc/graphite-isl-ast-to-gimple.c:2891:61: error: cannot initialize a parameter of type 'unsigned int' with an lvalue of type 'const char[1]'
  isl_id *id = isl_id_alloc (isl_ast_build_get_ctx (build), "", for_info);
                                                            ^~
/usr/local/opt/isl/include/isl/mat.h:29:11: note: passing argument to parameter 'n_row' here
        unsigned n_row, unsigned n_col);
                 ^
11 errors generated.
make[3]: *** [graphite-isl-ast-to-gimple.o] Error 1
rm gcc.pod
make[2]: *** [all-stage1-gcc] Error 2
make[1]: *** [stage1-bubble] Error 2
make: *** [all] Error 2

I think this is because it is trying to use incompatible versions of the header files. I am not sure how to fix that though. Can somebody please help?

In case it matters, I am using macOS Ventura 13.6.5 on an Intel mac.

0

There are 0 answers