Boost in embedded systems
I know this sounds insane, but our developers are very happy with boost (who can blame them :-)), and want to have boost available on our embedded systems. We only have 64 mb of flash memory available for the entire system (OS, hardware monitoring and applications) and I simply cannot get boost down to a reasonable size. Am I trying to do an impossible task, or can somebody give me some good advice on how to build boost so it has a more reasonable size? Of course what should be done is removing some of the features, and I can probably negotiate with developers about what features we can provide and which have to go. Which one should I try to get rid of first? /peter -- A: Because it messes up the order in which people normally read text. Q: Why is it such a bad thing? A: Top-posting. Q: What is the most annoying thing on usenet and in e-mail?
Peter Poulsen wrote:
I know this sounds insane, but our developers are very happy with boost (who can blame them :-)), and want to have boost available on our embedded systems. We only have 64 mb of flash memory available for the entire system (OS, hardware monitoring and applications) and I simply cannot get boost down to a reasonable size. Am I trying to do an impossible task, or can somebody give me some good advice on how to build boost so it has a more reasonable size?
It's a little difficult to respond to this since a big percentage of Boost is 'header only' and there's no runtime size cost until someone uses a library. And then that cost tends to be 'built-in' to the application that is using a particular library. So measuring the runtime footprint created by Boost is a somewhat difficult. That said, there's good indications from posts on the lists that other embedded developers have successfully used parts of Boost in projects.
Of course what should be done is removing some of the features, and I can probably negotiate with developers about what features we can provide and which have to go. Which one should I try to get rid of first?
I'd make a list of libraries they are actually using -- with special attention to the 'built' libraries: filesystem, signals, date-time (although this one can be mostly inline), program-options, serialization, etc. These are the only ones that have a 'fixed cost of use' which might be cut-down by removing 'unused features' from the library. Anyway, this list would give you a good idea of which parts you really need. Jeff
-----Original Message----- From: boost-users-bounces@lists.boost.org [mailto:boost-users-bounces@lists.boost.org] On Behalf Of Jeff Garland Sent: 19 February 2007 16:44 To: boost-users@lists.boost.org Subject: Re: [Boost-users] Boost in embedded systems
I know this sounds insane, but our developers are very happy with boost (who can blame them :-)), and want to have boost available on our embedded systems. We only have 64 mb of flash memory available for the entire system (OS, hardware monitoring and applications) and I simply cannot get boost down to a reasonable size. Am I
Peter Poulsen wrote: trying to do
an impossible task, or can somebody give me some good advice on how to build boost so it has a more reasonable size?
It's a little difficult to respond to this since a big percentage of Boost is 'header only' and there's no runtime size cost until someone uses a library. And then that cost tends to be 'built-in' to the application that is using a particular library. So measuring the runtime footprint created by Boost is a somewhat difficult. That said, there's good indications from posts on the lists that other embedded developers have successfully used parts of Boost in projects.
Certainly not insane - embedded system would benefit perhaps more from boost reviewed code than desktops as they tend to be more mission critical. We are currently in development, and do as Jeff says - header only stuff is irrelevant, and we only copy libraries that we use to the embedded system (Serialisation, filesystem). There are many flavours of library built (Debug, multithreaded, wide char etc) - you will only need one of them.
Of course what should be done is removing some of the features, and I can probably negotiate with developers about what features we can provide and which have to go. Which one should I try to get rid of first?
I'd make a list of libraries they are actually using -- with special attention to the 'built' libraries: filesystem, signals, date-time (although this one can be mostly inline), program-options, serialization, etc. These are the only ones that have a 'fixed cost of use' which might be cut-down by removing 'unused features' from the library. Anyway, this list would give you a good idea of which parts you really need.
Jeff _______________________________________________ Boost-users mailing list Boost-users@lists.boost.org http://lists.boost.org/mailman/listinfo.cgi/boost-users
James This message (including any attachments) contains confidential and/or proprietary information intended only for the addressee. Any unauthorized disclosure, copying, distribution or reliance on the contents of this information is strictly prohibited and may constitute a violation of law. If you are not the intended recipient, please notify the sender immediately by responding to this e-mail, and delete the message from your system. If you have any questions about this e-mail please notify the sender immediately.
At 10:37 AM +0100 2/19/07, Peter Poulsen wrote:
I know this sounds insane, but our developers are very happy with boost (who can blame them :-)), and want to have boost available on our embedded systems. We only have 64 mb of flash memory available for the entire system (OS, hardware monitoring and applications) and I simply cannot get boost down to a reasonable size. Am I trying to do an impossible task, or can somebody give me some good advice on how to build boost so it has a more reasonable size?
Of course what should be done is removing some of the features, and I can probably negotiate with developers about what features we can provide and which have to go. Which one should I try to get rid of first?
The most important thing to do is choose a single variant, which was already suggested by Hugh James. Building in release mode with a few libraries --without-xxx in the bjam invocation can easily get you down to something pretty reasonable for that size of system. As an example, "-sBUILD=release <threading>multi <runtime-link>dynamic" --layout=system --without-regex --without-spirit --without-wave is about 1.9M on x86 with gcc4.1. (I offer this example because I happen to have the resulting libraries handy right at the moment, not because this is a particularly ideal choice for such a system. We exclude several other libraries and delete some other .so's by hand for our embedded targets; I just checked a recent build and this part totals up to about 1M for powerpc.) So I would say this is entirely plausible and not at all insane; or if it is, we share in the insanity.
Peter Poulsen wrote:
I know this sounds insane, but our developers are very happy with boost (who can blame them :-)), and want to have boost available on our embedded systems. We only have 64 mb of flash memory available for the entire system (OS, hardware monitoring and applications) and I simply cannot get boost down to a reasonable size. Am I trying to do an impossible task, or can somebody give me some good advice on how to build boost so it has a more reasonable size?
Of course what should be done is removing some of the features, and I can probably negotiate with developers about what features we can provide and which have to go. Which one should I try to get rid of first?
At the risk of stating the obvious :-) There are two main things to bare in mind: 1) Many libraries are header only, and you only pay for what you use. It's unlikely for example that you could implement the equivalent of shared_ptr with less runtime cost that the existing implementation, so you may as well just go with it. And metaprogramming libraries obviously have no runtime cost at all :-) 2) If you link to libraries that have separate source, then linking to the static versions of the libraries will likely save you a lot of disk space: for example using regex statically linked requires about a 50K overhead for minimal usage, where as the shared library is rather larger than that (if you need hints for pruning it down further still, give me a shout). So basically, get your developers to think about what they're doing before they start coding and you should be OK :-) There's one other thing to bare in mind: given a choice between using a general purpose component like spirit or regex, and a custom parser, a custom parser is likely to win in terms of both size and speed, but on the other hand will slow down your development. If you separate these components from the rest of your app, you can always protype with a general purpose Boost-component, and then replace later if the need arises. No doubt similar compromises can be made with other Boost components (serialisation, program options etc). HTH, John
participants (5)
-
Hughes, James
-
Jeff Garland
-
John Maddock
-
Kim Barrett
-
Peter Poulsen