<?xml version="1.0" encoding="UTF-8"?><!-- generator="wordpress/2.2.2" -->
<rss version="2.0" 
	xmlns:content="http://purl.org/rss/1.0/modules/content/">
<channel>
	<title>Comments for A Sense of Design</title>
	<link>http://codesynthesis.com/~boris/blog</link>
	<description>Boris Kolpackov's blog about software</description>
	<pubDate>Sat, 17 May 2008 17:07:50 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.2.2</generator>

	<item>
		<title>Comment on Virtual inheritance overhead in g++ by Robert 'Groby' Blum</title>
		<link>http://codesynthesis.com/~boris/blog/2008/04/17/virtual-inheritance-overhead-gcc/#comment-398</link>
		<author>Robert 'Groby' Blum</author>
		<pubDate>Fri, 18 Apr 2008 18:09:23 +0000</pubDate>
		<guid>http://codesynthesis.com/~boris/blog/2008/04/17/virtual-inheritance-overhead-gcc/#comment-398</guid>
		<description>@boris: Absolutely - I'd appreciate a quick e-mail when I can try this myself. I'm doing a bit of research into compilation speeds of C++, so I'd love to have sample cases,

@Cam: Even though it's virtual, it's still a diamond. derived_impl still can call either derived::foo() or base_impl::foo(). Yes, derived::foo() is abstract - but at every invokation of foo() the compiler needs to actually find out which one you meant.

I do think that memory usage and compile time are excessive, but I'm not surprised the second example is simpler. I'd love to see the gcc team's take on this....</description>
		<content:encoded><![CDATA[<p>@boris: Absolutely - I&#8217;d appreciate a quick e-mail when I can try this myself. I&#8217;m doing a bit of research into compilation speeds of C++, so I&#8217;d love to have sample cases,</p>
<p>@Cam: Even though it&#8217;s virtual, it&#8217;s still a diamond. derived_impl still can call either derived::foo() or base_impl::foo(). Yes, derived::foo() is abstract - but at every invokation of foo() the compiler needs to actually find out which one you meant.</p>
<p>I do think that memory usage and compile time are excessive, but I&#8217;m not surprised the second example is simpler. I&#8217;d love to see the gcc team&#8217;s take on this&#8230;.</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on End user or development-oriented build system? by boris</title>
		<link>http://codesynthesis.com/~boris/blog/2008/03/24/user-or-development-oriented-build-system/#comment-396</link>
		<author>boris</author>
		<pubDate>Fri, 18 Apr 2008 10:31:00 +0000</pubDate>
		<guid>http://codesynthesis.com/~boris/blog/2008/03/24/user-or-development-oriented-build-system/#comment-396</guid>
		<description>You can split a makefile into several parts (not sure you can do this with Makefile.am though) but you will still have to treat it as one makefile because of the shred variable scope. Here is an example. Let's say you have two makefile parts, one for the library and one for the test. The library makefile has something along these lines:

&lt;pre&gt;&lt;br /&gt;
CPPFLAGS:= -DFOO&lt;br /&gt;
&#160;&lt;br /&gt;
libfoo.so: foo.o bar.o&lt;br /&gt;
&#160;&#160;$(CXX) $(CPPFLAGS) -o $@ $^&lt;br /&gt;
&lt;/pre&gt;

And the test makefile looks similar:

&lt;pre&gt;&lt;br /&gt;
CPPFLAGS:= -DTEST&lt;br /&gt;
&#160;&lt;br /&gt;
test: test.o libfoo.so&lt;br /&gt;
&#160;&#160;$(CXX) $(CPPFLAGS) -o $@ $^&lt;br /&gt;
&lt;/pre&gt;

Then you have the master makefile which includes the two. The problem is that the second makefile overwrites the CPPFLAGS variable defined in the first makefile. The common way to resolve this would be to prefix each variable in a makefile fragment with its directory name, e.g., libfoo_CPPFLAGS, test_CPPFLAGS. This quickly gets out of hand in large projects where there might be hundreds of tests with deep subdirectory structure. How do you like the tests_cxx_parser_built_in_CPPFLAGS and tests_cxx_parser_validation_built_in_CPPFLAGS names? These would be actual names taken from one of my projects.

Build addresses this in a scalable way by implementing variable scoping (so that included makefiles don't override includer's variables with the same names) and target-specific variables. But this can only be done in the latest version of GNU make (3.81) so an automake-like build system that has to support every version of make down to the ten-year-old 3.79 can't use this.</description>
		<content:encoded><![CDATA[<p>You can split a makefile into several parts (not sure you can do this with Makefile.am though) but you will still have to treat it as one makefile because of the shred variable scope. Here is an example. Let&#8217;s say you have two makefile parts, one for the library and one for the test. The library makefile has something along these lines:</p>
<pre>
CPPFLAGS:= -DFOO
&nbsp;
libfoo.so: foo.o bar.o
&nbsp;&nbsp;$(CXX) $(CPPFLAGS) -o $@ $^
</pre>
<p>And the test makefile looks similar:</p>
<pre>
CPPFLAGS:= -DTEST
&nbsp;
test: test.o libfoo.so
&nbsp;&nbsp;$(CXX) $(CPPFLAGS) -o $@ $^
</pre>
<p>Then you have the master makefile which includes the two. The problem is that the second makefile overwrites the CPPFLAGS variable defined in the first makefile. The common way to resolve this would be to prefix each variable in a makefile fragment with its directory name, e.g., libfoo_CPPFLAGS, test_CPPFLAGS. This quickly gets out of hand in large projects where there might be hundreds of tests with deep subdirectory structure. How do you like the tests_cxx_parser_built_in_CPPFLAGS and tests_cxx_parser_validation_built_in_CPPFLAGS names? These would be actual names taken from one of my projects.</p>
<p>Build addresses this in a scalable way by implementing variable scoping (so that included makefiles don&#8217;t override includer&#8217;s variables with the same names) and target-specific variables. But this can only be done in the latest version of GNU make (3.81) so an automake-like build system that has to support every version of make down to the ten-year-old 3.79 can&#8217;t use this.</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Virtual inheritance overhead in g++ by boris</title>
		<link>http://codesynthesis.com/~boris/blog/2008/04/17/virtual-inheritance-overhead-gcc/#comment-395</link>
		<author>boris</author>
		<pubDate>Fri, 18 Apr 2008 10:07:21 +0000</pubDate>
		<guid>http://codesynthesis.com/~boris/blog/2008/04/17/virtual-inheritance-overhead-gcc/#comment-395</guid>
		<description>Robert, Paolo,

It will be hard to come up with a stand-alone test case since the generated code depends on the runtime library. But it is all open-source and the schema is publicly available so you will be able to reproduce this once the next version of XSD/e with support for delegation-based reuse is out. I can also provide makefiles, option files, etc. Let me know if you are interested.</description>
		<content:encoded><![CDATA[<p>Robert, Paolo,</p>
<p>It will be hard to come up with a stand-alone test case since the generated code depends on the runtime library. But it is all open-source and the schema is publicly available so you will be able to reproduce this once the next version of XSD/e with support for delegation-based reuse is out. I can also provide makefiles, option files, etc. Let me know if you are interested.</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Virtual inheritance overhead in g++ by Cam</title>
		<link>http://codesynthesis.com/~boris/blog/2008/04/17/virtual-inheritance-overhead-gcc/#comment-394</link>
		<author>Cam</author>
		<pubDate>Fri, 18 Apr 2008 04:43:49 +0000</pubDate>
		<guid>http://codesynthesis.com/~boris/blog/2008/04/17/virtual-inheritance-overhead-gcc/#comment-394</guid>
		<description>@Groby
Isn't the point of the first example using virtual inheritance because something inherits from a base class more than once (aka the dreaded diamond)?. Or am I missing something?</description>
		<content:encoded><![CDATA[<p>@Groby<br />
Isn&#8217;t the point of the first example using virtual inheritance because something inherits from a base class more than once (aka the dreaded diamond)?. Or am I missing something?</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Virtual inheritance overhead in g++ by Paolo Bonzini</title>
		<link>http://codesynthesis.com/~boris/blog/2008/04/17/virtual-inheritance-overhead-gcc/#comment-393</link>
		<author>Paolo Bonzini</author>
		<pubDate>Thu, 17 Apr 2008 19:07:57 +0000</pubDate>
		<guid>http://codesynthesis.com/~boris/blog/2008/04/17/virtual-inheritance-overhead-gcc/#comment-393</guid>
		<description>Can you report these two testcases to the GCC bugzilla (and CC me, bonzini@gnu.org on the testcases).  Chances are that the build times and memory usages can be improved a lot.</description>
		<content:encoded><![CDATA[<p>Can you report these two testcases to the GCC bugzilla (and CC me, <a href="mailto:bonzini@gnu.org">bonzini@gnu.org</a> on the testcases).  Chances are that the build times and memory usages can be improved a lot.</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Virtual inheritance overhead in g++ by Robert 'Groby' Blum</title>
		<link>http://codesynthesis.com/~boris/blog/2008/04/17/virtual-inheritance-overhead-gcc/#comment-387</link>
		<author>Robert 'Groby' Blum</author>
		<pubDate>Thu, 17 Apr 2008 17:59:52 +0000</pubDate>
		<guid>http://codesynthesis.com/~boris/blog/2008/04/17/virtual-inheritance-overhead-gcc/#comment-387</guid>
		<description>Hm. That has me curious to play with GCC to see what actually happens. One problem that I can spot right away in your original implementation is that derived_impl is derived *twice* from base. Once through derived, once through base_impl

That means whenever you call foo() on a derived_impl, gcc needs to disambiguate between base::foo() and base_impl::foo(). (Which is a tricky problem )

Your second solution does the disambiguation for the compiler - it specfies that a call to derived_impl can only use derived::foo, which will automatically forward to base_impl::foo

I'm surprised that the difference in memory usage and compile time is that big, though.

If you have a stripped sample project, I'd like to run it on various other compilers....</description>
		<content:encoded><![CDATA[<p>Hm. That has me curious to play with GCC to see what actually happens. One problem that I can spot right away in your original implementation is that derived_impl is derived *twice* from base. Once through derived, once through base_impl</p>
<p>That means whenever you call foo() on a derived_impl, gcc needs to disambiguate between base::foo() and base_impl::foo(). (Which is a tricky problem )</p>
<p>Your second solution does the disambiguation for the compiler - it specfies that a call to derived_impl can only use derived::foo, which will automatically forward to base_impl::foo</p>
<p>I&#8217;m surprised that the difference in memory usage and compile time is that big, though.</p>
<p>If you have a stripped sample project, I&#8217;d like to run it on various other compilers&#8230;.</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on End user or development-oriented build system? by John Snelson</title>
		<link>http://codesynthesis.com/~boris/blog/2008/03/24/user-or-development-oriented-build-system/#comment-384</link>
		<author>John Snelson</author>
		<pubDate>Thu, 17 Apr 2008 12:59:11 +0000</pubDate>
		<guid>http://codesynthesis.com/~boris/blog/2008/03/24/user-or-development-oriented-build-system/#comment-384</guid>
		<description>A single Makefile can be split up with includes, so it can always be as maintainable as a multiple Makefile model.

I guess I don't believe there is such a thing as a developer or user oriented build system. Good build systems make both simple, and automake is the best I've found so far.</description>
		<content:encoded><![CDATA[<p>A single Makefile can be split up with includes, so it can always be as maintainable as a multiple Makefile model.</p>
<p>I guess I don&#8217;t believe there is such a thing as a developer or user oriented build system. Good build systems make both simple, and automake is the best I&#8217;ve found so far.</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on End user or development-oriented build system? by boris</title>
		<link>http://codesynthesis.com/~boris/blog/2008/03/24/user-or-development-oriented-build-system/#comment-383</link>
		<author>boris</author>
		<pubDate>Tue, 15 Apr 2008 21:33:42 +0000</pubDate>
		<guid>http://codesynthesis.com/~boris/blog/2008/03/24/user-or-development-oriented-build-system/#comment-383</guid>
		<description>Hi John,

I think right now the Xerces-C++ 3.0.0 code base strikes a nice balance between the two extremes: one makefile for the whole project and one makefile for every directory. Currently it has one makefiles for each of these components: the library itself, tests, and examples. I don't think the one giant makefile approach will scale in the long run for any substantial project.

I agree that automake provides support for more tasks though there is no reason a development-oriented build system can't support them as well (in fact it can do a better job because it can rely on more powerful tools). The support for a wide range of platforms offered by automake, on the other, may be hard to replicate. Though I mention this tradeoff and the possible solution in the post.

Boris</description>
		<content:encoded><![CDATA[<p>Hi John,</p>
<p>I think right now the Xerces-C++ 3.0.0 code base strikes a nice balance between the two extremes: one makefile for the whole project and one makefile for every directory. Currently it has one makefiles for each of these components: the library itself, tests, and examples. I don&#8217;t think the one giant makefile approach will scale in the long run for any substantial project.</p>
<p>I agree that automake provides support for more tasks though there is no reason a development-oriented build system can&#8217;t support them as well (in fact it can do a better job because it can rely on more powerful tools). The support for a wide range of platforms offered by automake, on the other, may be hard to replicate. Though I mention this tradeoff and the possible solution in the post.</p>
<p>Boris</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on End user or development-oriented build system? by John Snelson</title>
		<link>http://codesynthesis.com/~boris/blog/2008/03/24/user-or-development-oriented-build-system/#comment-382</link>
		<author>John Snelson</author>
		<pubDate>Tue, 15 Apr 2008 19:39:22 +0000</pubDate>
		<guid>http://codesynthesis.com/~boris/blog/2008/03/24/user-or-development-oriented-build-system/#comment-382</guid>
		<description>I'm an automake lover, so I feel I have to jump in and defend it here. The way that Xerces-C uses automake is not really the best way to use it:

http://www.gnu.org/software/automake/manual/automake.html#Alternative

I use a single Makefile.am for building a number of my projects, and it's just as easy to develop with as you describe the "build" system to be.

Automake also handles build dependencies, parallel builds, multiple build directories, and distribution creation and testing - all on more platforms than you've ever heard of.</description>
		<content:encoded><![CDATA[<p>I&#8217;m an automake lover, so I feel I have to jump in and defend it here. The way that Xerces-C uses automake is not really the best way to use it:</p>
<p><a href="http://www.gnu.org/software/automake/manual/automake.html#Alternative" rel="nofollow">http://www.gnu.org/software/automake/manual/automake.html#Alternative</a></p>
<p>I use a single Makefile.am for building a number of my projects, and it&#8217;s just as easy to develop with as you describe the &#8220;build&#8221; system to be.</p>
<p>Automake also handles build dependencies, parallel builds, multiple build directories, and distribution creation and testing - all on more platforms than you&#8217;ve ever heard of.</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Statically-linking libstdc++ on AIX by boris</title>
		<link>http://codesynthesis.com/~boris/blog/2006/12/10/statically-linking-on-aix/#comment-4</link>
		<author>boris</author>
		<pubDate>Mon, 15 Jan 2007 15:41:36 +0000</pubDate>
		<guid>http://codesynthesis.com/~boris/blog/2006/12/10/statically-linking-on-aix/#comment-4</guid>
		<description>Hm, I think libsupc++.a should always be static. Both precompiled gcc distributions that I tried (one is from IBM, the other one is from aixpdslib.seas.ucla.edu) had it static. Can you check if you also have one somehere in .../lib/gcc/powerpc-ibm-aix/&lt;gcc-version&gt;/? Also what does 'ldd &lt;your-executable&gt;' prints?

-boris</description>
		<content:encoded><![CDATA[<p>Hm, I think libsupc++.a should always be static. Both precompiled gcc distributions that I tried (one is from IBM, the other one is from aixpdslib.seas.ucla.edu) had it static. Can you check if you also have one somehere in &#8230;/lib/gcc/powerpc-ibm-aix/<gcc -version>/? Also what does &#8216;ldd <your -executable>&#8216; prints?</p>
<p>-boris</your></gcc></p>
]]></content:encoded>
	</item>
</channel>
</rss>
