public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
* precompiled headers
@ 2003-01-21 12:53 Adrian Sandor
  2003-01-21 13:01 ` John Love-Jensen
  2003-01-21 13:11 ` Diego Novillo
  0 siblings, 2 replies; 9+ messages in thread
From: Adrian Sandor @ 2003-01-21 12:53 UTC (permalink / raw)
  To: gcc-help

Hello

I am using gcc 3.2 (included in dev-c++ 4.9.7.0 with
mingw), and I'd like to know how I can generate and
use precompiled headers in my programs, because
without them it takes ages to compile my programs.

regards,
 Adrian

__________________________________________________
Do you Yahoo!?
Yahoo! Mail Plus - Powerful. Affordable. Sign up now.
http://mailplus.yahoo.com

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

* Re: precompiled headers
  2003-01-21 12:53 precompiled headers Adrian Sandor
@ 2003-01-21 13:01 ` John Love-Jensen
  2003-01-21 13:12   ` Adrian Sandor
  2003-01-21 13:11 ` Diego Novillo
  1 sibling, 1 reply; 9+ messages in thread
From: John Love-Jensen @ 2003-01-21 13:01 UTC (permalink / raw)
  To: Adrian Sandor, gcc-help

Hello Adrian,

I may be mistaken, but I don't think there are precompiled headers in GCC
3.2.

However, I'm surprised that it's taking so long.  I work with some massively
large projects, and the compiles don't take an egregious amount of time.
(On a 400MHz SPARC.)

Do your source files (.cpp and .h) include only the headers they need, or
are they including the world?

If they're including the world, I strongly suggest your project team
discipline themselves to only include things that are directly needed by
that source file.  And NEVER rely on incidental inclusion of a needed header
file merely because some other included header file happens to include it.

--Eljay

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

* Re: precompiled headers
  2003-01-21 12:53 precompiled headers Adrian Sandor
  2003-01-21 13:01 ` John Love-Jensen
@ 2003-01-21 13:11 ` Diego Novillo
  1 sibling, 0 replies; 9+ messages in thread
From: Diego Novillo @ 2003-01-21 13:11 UTC (permalink / raw)
  To: gcc-help

In article <20030121125259.29702.qmail@web40309.mail.yahoo.com>, Adrian Sandor wrote:

> I am using gcc 3.2 (included in dev-c++ 4.9.7.0 with
> mingw), and I'd like to know how I can generate and
> use precompiled headers in my programs, because
> without them it takes ages to compile my programs.
> 
No.  Precompiled headers will be available with gcc 3.4.


Diego.

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

* Re: precompiled headers
  2003-01-21 13:01 ` John Love-Jensen
@ 2003-01-21 13:12   ` Adrian Sandor
  2003-01-21 14:59     ` Alexander Helm
  0 siblings, 1 reply; 9+ messages in thread
From: Adrian Sandor @ 2003-01-21 13:12 UTC (permalink / raw)
  To: John Love-Jensen, gcc-help

thank you for your reply 

--- John Love-Jensen wrote:
> I may be mistaken, but I don't think there are
> precompiled headers in GCC
> 3.2.

then which version supports precompiled headers? do I
need to get 3.2.1?

> However, I'm surprised that it's taking so long.
> Do your source files (.cpp and .h) include only the
> headers they need, or
> are they including the world?

I am using a slow computer, and my files are including
a few stl headers and a few headers written by me; a
very small program takes about 40 seconds to compile,
and I need to recompile often, that's why I want to
use precompiled headers

thanks,
 Adrian


__________________________________________________
Do you Yahoo!?
Yahoo! Mail Plus - Powerful. Affordable. Sign up now.
http://mailplus.yahoo.com

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

* Re: precompiled headers
  2003-01-21 13:12   ` Adrian Sandor
@ 2003-01-21 14:59     ` Alexander Helm
  0 siblings, 0 replies; 9+ messages in thread
From: Alexander Helm @ 2003-01-21 14:59 UTC (permalink / raw)
  To: Adrian Sandor; +Cc: John Love-Jensen, gcc-help

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

I've searched for something like this some time ago. A good solution (at
least for me) was ccache (http://ccache.samba.org/). It's not perfect
but it is a step in the right direction (and it's safe as far as the
webpage and my experiences are concerned.

	HTH
	Alexander

Adrian Sandor wrote:
| thank you for your reply
|
| --- John Love-Jensen wrote:
|
|>I may be mistaken, but I don't think there are
|>precompiled headers in GCC
|>3.2.
|
|
| then which version supports precompiled headers? do I
| need to get 3.2.1?
|
|
|>However, I'm surprised that it's taking so long.
|>Do your source files (.cpp and .h) include only the
|>headers they need, or
|>are they including the world?
|
|
| I am using a slow computer, and my files are including
| a few stl headers and a few headers written by me; a
| very small program takes about 40 seconds to compile,
| and I need to recompile often, that's why I want to
| use precompiled headers
|
| thanks,
|  Adrian
|
|
| __________________________________________________
| Do you Yahoo!?
| Yahoo! Mail Plus - Powerful. Affordable. Sign up now.
| http://mailplus.yahoo.com

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.0 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQE+LWBcdcrm1qkhaakRAp+yAJ47t/OWwupt7q9iXhhzY0pcceYAgQCdEYi0
JP3LR5i08TezZ2aI5yJbX94=
=DDr7
-----END PGP SIGNATURE-----

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

* Re: precompiled headers
  2008-04-18 13:26       ` precompiled headers Ralf Wildenhues
@ 2008-04-18 18:18         ` Per Rosengren
  0 siblings, 0 replies; 9+ messages in thread
From: Per Rosengren @ 2008-04-18 18:18 UTC (permalink / raw)
  To: gcc-help; +Cc: Brian Dessent, automake

The compiler flags given when compiling a source file that uses a 
precompiled header must match those used when the precompiled header was 
compiled. Because of this I altered Brian's code to:

BUILT_SOURCES = myheader.hh.gch
%.hh.gch: %.hh
	$(CXXCOMPILE) -c $<

The only difference here is that CXXCOMPILE - which is used to compile 
my sources, adds some flags to CXX.
For debugging purposes, I added

AM_CXXFLAGS = -H -Winvalid-pch

where -H prints all header files included, and -Winvalid-pch warns if a 
precompiled header was found but not used.

I think all dependencies are correct.


Thank you!
Per

Ralf Wildenhues wrote:
> * Brian Dessent wrote on Fri, Apr 18, 2008 at 11:28:07AM CEST:
>> BUILT_SOURCES = myheader.hh.gch
>> %.hh.gch: %.hh
>> 	$(CXX) -c $<
> [...] 
> 
> The rule is a good start, but likely lacking dependency information.
> 
>> But honestly the above is just a random stab at how to start, you'd be
>> much better asking on the automake list (in CC:.)
> 
> My humble musings about precompiled headers support are mostly in
> <http://thread.gmane.org/gmane.comp.gcc.devel/60371>, and those
> affect GCC-type precompiled headers only.
> 
> Cheers,
> Ralf

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

* Re: precompiled headers
  2008-04-18 10:52     ` precompiled headers (was: Slow compilation with many files) Brian Dessent
@ 2008-04-18 13:26       ` Ralf Wildenhues
  2008-04-18 18:18         ` Per Rosengren
  0 siblings, 1 reply; 9+ messages in thread
From: Ralf Wildenhues @ 2008-04-18 13:26 UTC (permalink / raw)
  To: Brian Dessent; +Cc: Per Rosengren, gcc-help, automake

* Brian Dessent wrote on Fri, Apr 18, 2008 at 11:28:07AM CEST:
> BUILT_SOURCES = myheader.hh.gch
> %.hh.gch: %.hh
> 	$(CXX) -c $<
[...] 

The rule is a good start, but likely lacking dependency information.

> But honestly the above is just a random stab at how to start, you'd be
> much better asking on the automake list (in CC:.)

My humble musings about precompiled headers support are mostly in
<http://thread.gmane.org/gmane.comp.gcc.devel/60371>, and those
affect GCC-type precompiled headers only.

Cheers,
Ralf

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

* Re: precompiled headers
  2004-05-24 12:21 Yannick Beynet
@ 2004-05-25 17:09 ` Ian Lance Taylor
  0 siblings, 0 replies; 9+ messages in thread
From: Ian Lance Taylor @ 2004-05-25 17:09 UTC (permalink / raw)
  To: beynet; +Cc: gcc-help

"Yannick Beynet" <beynet@fresnes.info> writes:

> I try to use precompiled headers with gcc 3.4.0
> It's working but I notice that sometimes they are not used.
> for example in a cpp file witch starts like :
> #include "h1.H"
> #include "h2.H"
> 
> h1.H.gch is used, but most of time h2.H.gch is not used. I guess it is
> because h1.H includes some files witch are not also precompiled. Am I
> right ?

Only one precompiled header is used per compilation.  See the
documentation.

Ian

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

* precompiled headers
@ 2004-05-24 12:21 Yannick Beynet
  2004-05-25 17:09 ` Ian Lance Taylor
  0 siblings, 1 reply; 9+ messages in thread
From: Yannick Beynet @ 2004-05-24 12:21 UTC (permalink / raw)
  To: gcc-help

HI !
I try to use precompiled headers with gcc 3.4.0
It's working but I notice that sometimes they are not used.
for example in a cpp file witch starts like :
#include "h1.H"
#include "h2.H"

h1.H.gch is used, but most of time h2.H.gch is not used. I guess it is
because h1.H includes some files witch are not also precompiled. Am I
right ?

Thanks.

PS : do you have a solution to force using both h1.H.gch and h1.H.gch


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

end of thread, other threads:[~2008-04-18 13:26 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-01-21 12:53 precompiled headers Adrian Sandor
2003-01-21 13:01 ` John Love-Jensen
2003-01-21 13:12   ` Adrian Sandor
2003-01-21 14:59     ` Alexander Helm
2003-01-21 13:11 ` Diego Novillo
2004-05-24 12:21 Yannick Beynet
2004-05-25 17:09 ` Ian Lance Taylor
2008-04-15  4:17 Slow compilation with many files Zed
2008-04-15 10:41 ` Brian Dessent
2008-04-18 10:46   ` Per Rosengren
2008-04-18 10:52     ` precompiled headers (was: Slow compilation with many files) Brian Dessent
2008-04-18 13:26       ` precompiled headers Ralf Wildenhues
2008-04-18 18:18         ` Per Rosengren

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).