5

I'm building the boost libraries with bjam for both the intel compiler and vs2008, and I can't tell what optimizations are being passed to the compiler from bjam. For one of the compiler's gcc, I can see some optimizations in one of the bjam files, but I can't find the optimization flags for the compilers I care about. So, my questions are -

  1. Does anyone know where the default optimization flags are located?
  2. If they're declared within bjam, does anyone know how I can override them?
3
  • a lot of libraries are header-only, are you concerned about optimization of a particular library, threads for example?
    – Anycorn
    Commented May 8, 2010 at 15:35
  • check out this question, it should answer you: stackoverflow.com/questions/2722421/…
    – Anycorn
    Commented May 8, 2010 at 15:37
  • I'm concerned with boost::gregorian::date which is partially a static library
    – Steve
    Commented May 9, 2010 at 0:53

1 Answer 1

9

If you are interested in looking at the entire set of options that are passed to invoke the compiler when building you can run bjam with the -n -a options and the rest of the building options to give you the complete set of commands invoked, and any response files generated (see Boost Jam Options). Also you can look at the Boost Build sources directly and see what the specified features are translated into (see Boost Build Tools Files). For example:

You can likely figure out the same for other compilers by just looking through the sources as they are fairly self explanatory. And you can just search for "<optimization>" and "<inlining>" in the *.jam sources.

You can override them in the command line by specifying the feature=value option in the command line when building. The options match the <feature>value specifications you see in the toolset files. For example, to override the optimizations feature you would specify in the command line some like "optimization=speed". If you want more fine grained control you would have to delve into Boost Build specifications and likely have to create a variant of your own to define specific options and features to build with.

2
  • All links are broken! Commented Jun 18, 2018 at 21:44
  • Thank you @val -- I've updated the links to latest docs and code. Commented Jun 28, 2018 at 1:52

Not the answer you're looking for? Browse other questions tagged or ask your own question.