public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
* Building and Installing gcc-4.7.0 on Ubuntu 12.04
@ 2012-06-06  5:49 Anup Ghatage
  2012-06-06  8:00 ` Jonathan Wakely
  0 siblings, 1 reply; 7+ messages in thread
From: Anup Ghatage @ 2012-06-06  5:49 UTC (permalink / raw)
  To: gcc-help

Hello,

I installed a mint Ubuntu 12.04, ran the updates and then downloaded
the tar for gcc-4.7.0.

Untar'ed it.
./configure
make -j4

then it showed this:
make[4]: Leaving directory `/home/UserPC/Downloads/gcc-4.
7.0/i686-pc-linux-gnu/libgcc'
In file included from /usr/include/stdio.h:28:0,
                 from ../.././libgcc/../gcc/tsystem.h:88,
                 from ../.././libgcc/libgcc2.c:29:
/usr/include/features.h:324:26: fatal error: bits/predefs.h: No such
file or directory
compilation terminated.
make[3]: *** [_negdi2.o] Error 1
In file included from /usr/include/stdio.h:28:0,
                 from ../.././libgcc/../gcc/tsystem.h:88,
                 from ../.././libgcc/libgcc2.c:29:
/usr/include/features.h:324:26: fatal error: bits/predefs.h: No such
file or directory
compilation terminated.
make[3]: *** [_lshrdi3.o] Error 1
make[3]: Leaving directory
`/home/UserPC/Downloads/gcc-4.7.0/i686-pc-linux-gnu/libgcc'
make[2]: *** [all-stage1-target-libgcc] Error 2
make[2]: Leaving directory `/home/UserPC/Downloads/gcc-4.7.0'
make[1]: *** [stage1-bubble] Error 2
make[1]: Leaving directory `/home/UserPC/Downloads/gcc-4.7.0'
make: *** [all] Error 2
UserPC@UserPC-desktop:~/Downloads/gcc-4.7.0$

I did some background search, the predefs.h error seems to occur when
trying to install a 32 bit binary on a 64 bit Linux.
But My Linux is 32 bit, I double checked that with uname -m, it was i686.

Also something worth mentioning, when I installed GMP from source, its
configuration file showed a waring saying : gmp.h and libgmp are of
different versions 5.0.5 and 5.0.2 respectively.

Pretty clueless right now, would really appreciate it if anyone could
help. Also, apologies, if this is a repost.

Regards

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Building and Installing gcc-4.7.0 on Ubuntu 12.04
  2012-06-06  5:49 Building and Installing gcc-4.7.0 on Ubuntu 12.04 Anup Ghatage
@ 2012-06-06  8:00 ` Jonathan Wakely
  2012-06-06 10:02   ` David Given
  0 siblings, 1 reply; 7+ messages in thread
From: Jonathan Wakely @ 2012-06-06  8:00 UTC (permalink / raw)
  To: Anup Ghatage; +Cc: gcc-help

On 6 June 2012 06:48, Anup Ghatage wrote:
> Hello,
>
> I installed a mint Ubuntu 12.04, ran the updates and then downloaded
> the tar for gcc-4.7.0.
>
> Untar'ed it.
> ./configure

You didn't read the docs then, see  http://gcc.gnu.org/wiki/InstallingGCC

> make -j4
>
> then it showed this:
> make[4]: Leaving directory `/home/UserPC/Downloads/gcc-4.
> 7.0/i686-pc-linux-gnu/libgcc'
> In file included from /usr/include/stdio.h:28:0,
>                 from ../.././libgcc/../gcc/tsystem.h:88,
>                 from ../.././libgcc/libgcc2.c:29:
> /usr/include/features.h:324:26: fatal error: bits/predefs.h: No such
> file or directory

I think this might mean you need to install the build-essential package.

> compilation terminated.
> make[3]: *** [_negdi2.o] Error 1
> In file included from /usr/include/stdio.h:28:0,
>                 from ../.././libgcc/../gcc/tsystem.h:88,
>                 from ../.././libgcc/libgcc2.c:29:
> /usr/include/features.h:324:26: fatal error: bits/predefs.h: No such
> file or directory
> compilation terminated.
> make[3]: *** [_lshrdi3.o] Error 1
> make[3]: Leaving directory
> `/home/UserPC/Downloads/gcc-4.7.0/i686-pc-linux-gnu/libgcc'
> make[2]: *** [all-stage1-target-libgcc] Error 2
> make[2]: Leaving directory `/home/UserPC/Downloads/gcc-4.7.0'
> make[1]: *** [stage1-bubble] Error 2
> make[1]: Leaving directory `/home/UserPC/Downloads/gcc-4.7.0'
> make: *** [all] Error 2
> UserPC@UserPC-desktop:~/Downloads/gcc-4.7.0$
>
> I did some background search, the predefs.h error seems to occur when
> trying to install a 32 bit binary on a 64 bit Linux.
> But My Linux is 32 bit, I double checked that with uname -m, it was i686.
>
> Also something worth mentioning, when I installed GMP from source, its
> configuration file showed a waring saying : gmp.h and libgmp are of
> different versions 5.0.5 and 5.0.2 respectively.

This should be solved by following the instructions at
http://gcc.gnu.org/wiki/InstallingGCC

> Pretty clueless right now, would really appreciate it if anyone could
> help. Also, apologies, if this is a repost.

If you're clueless you should try reading the docs.

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Building and Installing gcc-4.7.0 on Ubuntu 12.04
  2012-06-06  8:00 ` Jonathan Wakely
@ 2012-06-06 10:02   ` David Given
  2012-06-06 12:17     ` Jonathan Wakely
  0 siblings, 1 reply; 7+ messages in thread
From: David Given @ 2012-06-06 10:02 UTC (permalink / raw)
  To: gcc-help

[-- Attachment #1: Type: text/plain, Size: 1164 bytes --]

Jonathan Wakely wrote:
> On 6 June 2012 06:48, Anup Ghatage wrote:
[...]
>> Untar'ed it.
>> ./configure
> 
> You didn't read the docs then, see  http://gcc.gnu.org/wiki/InstallingGCC

If you're referring to the need to set objdir, the documentation that
actually ships with gcc says:

> First, we highly recommend that GCC be built into a separate directory
> from the sources which does not reside within the source tree. This is
> how we generally build GCC; building where srcdir == objdir should still
> work, but doesn't get extensive testing; building where objdir is a
> subdirectory of srcdir is unsupported.

In others, it says firmly that srcdir == objdir should actually work.

Given that it doesn't, is there any chance of getting this document
changed? As it stands it's highly misleading.

-- 
┌─── dg@cowlark.com ───── http://www.cowlark.com ─────
│ "Parents let children ride bicycles on the street. But parents do not
│ allow children to hear vulgar words. Therefore we can deduce that
│ cursing is more dangerous than being hit by a car." --- Scott Adams


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 262 bytes --]

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Building and Installing gcc-4.7.0 on Ubuntu 12.04
  2012-06-06 10:02   ` David Given
@ 2012-06-06 12:17     ` Jonathan Wakely
  2012-06-06 23:34       ` David Given
  0 siblings, 1 reply; 7+ messages in thread
From: Jonathan Wakely @ 2012-06-06 12:17 UTC (permalink / raw)
  To: David Given; +Cc: gcc-help

On 6 June 2012 11:02, David Given wrote:
> Jonathan Wakely wrote:
>> On 6 June 2012 06:48, Anup Ghatage wrote:
> [...]
>>> Untar'ed it.
>>> ./configure
>>
>> You didn't read the docs then, see  http://gcc.gnu.org/wiki/InstallingGCC
>
> If you're referring to the need to set objdir, the documentation that
> actually ships with gcc says:
>
>> First, we highly recommend that GCC be built into a separate directory
>> from the sources which does not reside within the source tree. This is
>> how we generally build GCC; building where srcdir == objdir should still
>> work, but doesn't get extensive testing; building where objdir is a
>> subdirectory of srcdir is unsupported.
>
> In others, it says firmly that srcdir == objdir should actually work.

Which others?

It might work, but if you don't know what you're doing or get a
failure using ./configure then following the recommended approach
seems like a good idea.

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Building and Installing gcc-4.7.0 on Ubuntu 12.04
  2012-06-06 12:17     ` Jonathan Wakely
@ 2012-06-06 23:34       ` David Given
  2012-06-07  0:00         ` Jonathan Wakely
  0 siblings, 1 reply; 7+ messages in thread
From: David Given @ 2012-06-06 23:34 UTC (permalink / raw)
  To: gcc-help

[-- Attachment #1: Type: text/plain, Size: 1128 bytes --]

On 06/06/12 13:16, Jonathan Wakely wrote:
[...]
>> In others, it says firmly that srcdir == objdir should actually work.
> 
> Which others?

Sorry, thinko. That should be 'in there'.

> It might work, but if you don't know what you're doing or get a
> failure using ./configure then following the recommended approach
> seems like a good idea.

Sure, but the build documentation still says that it should work. Given
that srcdir == objdir is the standard usage pattern for configure
scripts, I don't think anyone will be surprised that people will try it.

This turns out not to have been the OP's problem anyway, but given the
wiki page you pointed them at does state clearly that srcdir == objdir
isn't supported, as does the FAQ entry, it would be nice if the actual
build documentation said it too...

-- 
┌─── dg@cowlark.com ───── http://www.cowlark.com ─────
│ "...thus there might be a great reduction in useless expenditure on
│ Nuclear rockets, reducing inflation and stabilising the price of cat
│ foods." --- UK pat. GB1426698


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 262 bytes --]

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Building and Installing gcc-4.7.0 on Ubuntu 12.04
  2012-06-06 23:34       ` David Given
@ 2012-06-07  0:00         ` Jonathan Wakely
  2012-06-07  0:04           ` Jonathan Wakely
  0 siblings, 1 reply; 7+ messages in thread
From: Jonathan Wakely @ 2012-06-07  0:00 UTC (permalink / raw)
  To: David Given; +Cc: gcc-help

On 7 June 2012 00:34, David Given wrote:
>
> Sure, but the build documentation still says that it should work. Given
> that srcdir == objdir is the standard usage pattern for configure
> scripts, I don't think anyone will be surprised that people will try it.
>
> This turns out not to have been the OP's problem anyway, but given the
> wiki page you pointed them at does state clearly that srcdir == objdir
> isn't supported, as does the FAQ entry, it would be nice if the actual
> build documentation said it too...

The wiki pages are not authoritative.

One key advantage of building outside the source directory (i.e. not
using ./configure) is that when you screw it up (and the people who
need those docs do screw it up, in ever more innovative ways) you can
delete the entire objdir and start again, nothing will foul up the
srcdir if you don't build in there.

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Building and Installing gcc-4.7.0 on Ubuntu 12.04
  2012-06-07  0:00         ` Jonathan Wakely
@ 2012-06-07  0:04           ` Jonathan Wakely
  0 siblings, 0 replies; 7+ messages in thread
From: Jonathan Wakely @ 2012-06-07  0:04 UTC (permalink / raw)
  To: David Given; +Cc: gcc-help

On 7 June 2012 01:00, Jonathan Wakely <jwakely.gcc@gmail.com> wrote:
> On 7 June 2012 00:34, David Given wrote:
>>
>> Sure, but the build documentation still says that it should work. Given
>> that srcdir == objdir is the standard usage pattern for configure
>> scripts, I don't think anyone will be surprised that people will try it.
>>
>> This turns out not to have been the OP's problem anyway, but given the
>> wiki page you pointed them at does state clearly that srcdir == objdir
>> isn't supported, as does the FAQ entry, it would be nice if the actual
>> build documentation said it too...
>
> The wiki pages are not authoritative.
>
> One key advantage of building outside the source directory (i.e. not
> using ./configure) is that when you screw it up (and the people who
> need those docs do screw it up, in ever more innovative ways) you can

By "those docs" here I meant the wiki pages, not the official docs,
sorry that wasn't clear.

> delete the entire objdir and start again, nothing will foul up the
> srcdir if you don't build in there.

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2012-06-07  0:04 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-06-06  5:49 Building and Installing gcc-4.7.0 on Ubuntu 12.04 Anup Ghatage
2012-06-06  8:00 ` Jonathan Wakely
2012-06-06 10:02   ` David Given
2012-06-06 12:17     ` Jonathan Wakely
2012-06-06 23:34       ` David Given
2012-06-07  0:00         ` Jonathan Wakely
2012-06-07  0:04           ` Jonathan Wakely

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).