4

I am trying to compile gcc-4.9RC or gcc-4.8.2 on Debian (6 or 7).

There is flex 2.5.35 installed and I even compiled my own flex 2.5.39.

I confirmed it generates a yy.c output from a simple .l file.

Also I learned at gcc documentation, that flex shouldn't be necessary when compiling from a release (which the gcc-4.8.2 is).

Nevertheless I always get this in some internal configure after running make:

checking for bison... bison -y
checking for flex... flex
checking lex output file root... configure: error: cannot find output from flex; giving up
make[2]: *** [configure-stage1-gmp] Error 1
make[2]: Leaving directory `***/gcc-bin-8'
make[1]: *** [stage1-bubble] Error 2
make[1]: Leaving directory `***/gcc-bin-8'
make: *** [all] Error 2

It is configured with:

../gcc-4.8.2/configure --enable-languages=c,c++,fortran --with-cloog --prefix=/home/***/gcc-4.8.2

I have no idea what should I try more.

1 Answer 1

6

This error is generated whilst building gmp (a pre-requisite of gcc). It's a known bug in gmp present in 4.8.3 Ref :gmp bug. If you ran contrib/download_prerequisites, you would get gmp 4.8.3 by default. Workaround is to edit gmp-4.8.3/configure.in & gmp-4.8.3/configure and change

M4=m4-not-required

for

M4=m4

3
  • Since the current version of GMP is 6.0.0a, I'm left wondering why the OP would use such an archaic version of GMP. I built GCC 4.9.1 happily on Mac OS X 10.9.4 and an Ubuntu 14.04 Trusty Tahr derivative using GMP 6.0.0a (and MPC 1.0.2, MPFR 3.1.2, and ISL 0.12.2 and Cloog 0.18.1), which I had GCC build as it was building everything else. Jul 21, 2014 at 3:56
  • OP doesn't say which version of GMP he is using
    – ACyclic
    Jul 22, 2014 at 11:34
  • There was apparently a mess in the libraries, as I had some in my home directory (new) and some (the old ones) in the main system. I still did not succeed in compiling new GCC there, but I now use the Intel compilers instead until the admins build something recent for me. BTW, I compile GCC from source very often on my own computers and I never have such problems. Aug 15, 2014 at 15:02

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.