Is everyone OK with removing the parts of Boost and some of
the contributed mods in Eigen we're not using?
If so, we can make 2.0 a lot smaller to download for users.
More discussion inline below.
On 8/5/13 2:25 PM, Ben Goodrich wrote:
> On Monday, August 5, 2013 11:20:13 AM UTC-4, Bob Carpenter wrote:
>
> I made a similar comment about cutting down the Eigen contributed
> code and I seem to recall the consensus was that I should leave it
> intact.
>
>
> Eigen is more challenging because there is no tool like bcp to sort out the dependencies.
I hadn't realized that bcp was part of Boost and was
Boost-specific.
> Also, Eigen is smaller so
> there is less to gain. But it is still probably a good idea in principle.
I just wanted to only include the contributed libs that we
used (just fft, I think).
> I recall the following concerns about trimming Boost and Eigen:
>
> 1. Users might try to use it as their Boost or Eigen distribution
> and be disappointed that it's incomplete.
>
>
> Such people probably download Boost and Eigen from upstream or easily could.
Agreed. This seems like a non-issue to me, too.
> 2. We might try to use it as our Boost or Eigen distribution during
> development and not have everything we need when we want to use a new
> feature.
>
>
> Then we just have to add some headers back. Both Boost and Eigen have git repos.
The problem I envision is that I want to use function foo() from Boost, but
what I'm really going to need to do is go back to all of Boost and run
bcp again because foo() is likely to depend on a gazillion other things the way
Boost is put together.
We should also be better about using the lowest-level includes possible.
We're definitely over-including our own Stan code in a lot of places
by grabbing all of matrix.hpp, for example, instead of just the functions
we need.
> 3. Something might go wrong in the include tool, especially w.r.t.
> templates.
>
>
> Just need to run the tests before merging the pull request that deletes stuff.
In that case, the tests need to be complete and call all of
the possible run-time template instantiations. Or is that somehow
guaranteed by bcp when it looks at all our headers?
Also, we have some .cpp code that should also be included.
> 4. Adding another tool adds complexity to our build process.
>
>
> I think we need to cut from the repo, and at that point the build process is the same.
Right --- there's no user overhead.
But there is overhead for developers to update Boost versions and to
add new functions from Boost, both of which look totally manageable.
> One thing that's nice about the way we have things set up now is that
> the release just mirrors the GitHub structure and the libs mirror their
> distributions, so it's very conceptually simple. I value conceptual
> simplicity very highly in software, but there are tradeoffs.
>
>
> The directory would have the same structure, just fewer subdirectories and possibly fewer files within the subdirectories.
>
> I'm also assuming their licenses are OK with less-than-complete
> redistributions.
>
>
> Yes.
>
> Just do
>
> |
> goodrich@CYBERPOWERPC:/opt/stan$ mkdir /tmp/boost_1.54.0
> goodrich@CYBERPOWERPC:/opt/stan$ export STAN_HOME=/opt/stan
> goodrich@CYBERPOWERPC:/opt/stan$ find ${STAN_HOME}/src -name \*\.\[ch]pp -exec bcp --scan
> --boost=${STAN_HOME}/lib/boost_1.54.0 '{}' /tmp/boost_1.54.0/ \; &> /tmp/boost_1.54.0/bcp.log
> goodrich@CYBERPOWERPC:/opt/stan$ make CC=clang++ BOOST=/tmp/boost_1.54.0 -j9 test-headers && echo "boost working"
> |
>
> If that works, it should be safe to then do
>
> |
> git checkout develop
> git checkout -b feature/less_boost
> git rm -rf lib/boost_1.54.0
> mv /tmp/boost_1.54.0 lib
> rm lib/boost_1.54.0/bcp.log
> git add lib
> git commit -m "trim boost"
> |
Thanks.
- Bob