Boost logo

Boost :

Subject: Re: [boost] [Modularization] A new approach to header modularization
From: Ulrich Eckhardt (doomster_at_[hidden])
Date: 2009-06-03 12:59:33


On Wednesday 03 June 2009 15:00:43 Christopher Jefferson wrote:
> Now lets imagine I want to include functional (a header-only library).
>
> #include <boost/functional.hpp> // Fails
> #include <boost-1_39/boost/functional.hpp> // Fails with bizarre errors
>
> So I have to add:
>
> -I/usr/local/include/boost-1_39
>
> Which of course won't work if I then go to another computer, where
> boost isn't in /usr/local/include

I know this problem. A well-written Makefile should use variables like CFLAGS,
CXXFLAGS, CPPFLAGS and LDFLAGS. You can then create a simple script

  export CXX=g++-4.4
  export CC=gcc-4.4
  export CPPFLAGS="-I /home/uli/include -I /home/uli/devel/Boost-trunk"
  export LDFLAGS="-L /home/uli/lib"

which sets up the environment accordingly. This requires people to understand
what these flags mean, but I don't think they can't learn that, and the
knowledge is even useful elsewhere.

> 2) Why not provide a 'libboost' which includes all the libraries
> linked together. If they are dynamically linked this shouldn't create
> a large overhead.

Actually, this is an interesting new idea. At least, it would make several
things simpler. Boost historically allows users to use parts of it without
having the whole forced upon them, I guess some people see this as an
important feature. However, the global boost-all library wouldn't prevent
that, it would just be an alternative. I would create a TRAC ticket for that,
at least that would serve as central collection point for the pros and cons of
that design.

Uli


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk