I've been getting frustrated with the long compile times of stan
models, so I spent some time today breaking out a bunch of the Eigen
functionality out of .hpp files and into .cpp files.
The upshot: a logistic regression model that formerly took ~33 seconds
to compile now takes "only" ~12 seconds to compile and link (once the
.cpp files are compiled, which only needs to happen once).
It's a pretty big change in terms of LOC altered, plus the makefile
had to undergo some changes. So before pushing I'd like to check with
Bob and/or Daniel that I haven't done anything catastrophically
stupid. The tests seem to check out, but still good to be safe, and
also we may want to do more of this kind of thing and I don't want to
set any bad precedents.
Matt
I also waited for Daniel to handle the bin/stanc make
target. So let's all look at it when we're back in
the office. I'm around tomorrow, so we can at least
look at the code organization.
Most of the libs like Eigen we use can be built
separately because we're only using double and
var instantiations of templates. Eigen seemed
like the slowest to compile, but there's also all
of our auto-dif and math and probability functions.
I'd like to do the refactoring so everything still
works header only. You'll see that
I did the tests that way for the parser and set up
the example in demo that way.
- Bob
If a user can't build libstan, they won't be able to compile
the C++ generated for a model. But then I'm not too worried
about the antique enthusiast PowerPC crew.
I understood. In addition to getting rid of an unnecessary
(and hence undesirable) dependency in the build, removing
bin/stanc's dependency on libstan.a will let CRAN build
a fat Mac binary for bin/stanc.
We're only worried about PowerPC to the extent that
it'll block us releasing that fat binary.
I didn't even know the Mac still supported fat binaries!
- Bob