Re: problem building gcc-4.6.0

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 5 April 2011 10:22, Jonathan Wakely wrote:
> On 5 April 2011 10:05, Arnab Das wrote:
>> Hello,
>>
>>                 This is my first use of cygwin and gcc. I currently
>> require the gcc compiler so I’m using Cygwin for it. I am facing
>> problem installing gcc 4.6.0 wth cygwin.
>>
>> Steps I tried:
>>
>> 1)      Installed Cygwin from setup.exe. (success)
>>
>> 2)      Installed latest ver. of all prerequisites(viz. bash,
>> binutils, bzip2, gcc-core,  gzip, m4 and make) through cygwin setup.
>> (success)
>>
>> 3)      Installed gmp, mpfr, mpc in sequence(by building from source
>> code). (success)
>>
>> 4)      Configured gcc-4.6.0 with  --enable-languages=c (from the
>> build directory as instructed in the gcc site) (success)
>
> Did you run configure as "./configure" ?
> That is NOT supported, as clearly documented in the GCC installation
> instructions.

Oops, I'm sorry, I sent my earlier reply on a tiny netbook screen and
didn't read the line above properly so I missed that you'd already
said you used a separate build directory.  Almost everyone misses that
bit of documentation, thanks for reading it!


>> 5)      Build gcc-4.6.0 (error)
>>
>>
>>
>> Last few lines during building including error:
>>
>> cc1-checksum.o main.o  libbackend.a ../libcpp/libcpp.a
>> ../libdecnumber/libdecnumber.a ../libcpp/libc
>> pp.a -lintl  ../libiberty/libiberty.a ../libdecnumber/libdecnumber.a
>>  -lmpc -lmpfr -lgmp   -L../zlib -lz
>> /usr/lib/gcc/i686-pc-cygwin/3.4.4/../../../../i686-pc-cygwin/bin/ld:
>> cannot find -lmpc
>> /usr/lib/gcc/i686-pc-cygwin/3.4.4/../../../../i686-pc-cygwin/bin/ld:
>> cannot find -lmpfr
>> /usr/lib/gcc/i686-pc-cygwin/3.4.4/../../../../i686-pc-cygwin/bin/ld:
>> cannot find -lgmp
>
> Obviously this means it can't find the gmp, mpfr and mpc libraries.
>
> The simplest way to solve this is not to install gmp/mpfr/mpc
> separately but to let gcc build them itself.
>
> Delete the entire gcc source directory.
> Unpack the gcc sources again, this will create a gcc-4.6.0 directory.

You can skip the step above if you configured in a separate build
directory, as you'll still have a clean set of sources.  (If you'd
built in the source dir you'd have jumbled up sources and build files
so it's better to remove everything and start again)

So you can just put the gmp/mpfr/mpc sources into the gcc-4.6.0 directory:

> Put the gmp-x.y.z directory under the gcc-4.6.0 directory and rename
> it to gmp.  Do the same for mpfr-x.y.z (renamed to mpfr) and mpc-x.y.z (you guessed it, renamed to mpc)

You might as well remove your entire build directory and create a
fresh one though:

> Create a new directory called "build" at the same level as gcc-4.6.0
> (NOT as a sub-directory of gcc-4.6.0)
> then:
>
> cd build
> ../gcc-4.6.0/configure --enable-languages=c
> make
>

This method means that the gcc build process will find the
gcc-4.6.0/gmp and gcc-4.6.0/mpfr and gcc-4.6.0/mpc sub-directories and
build those prerequisite libs, linking them into gcc so that
everything Just Works.



[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux