[mlpack-git] [mlpack] moving cliDeleter instance to log.cpp (#524)

Ryan Curtin notifications at github.com
Mon Feb 29 15:04:31 EST 2016


Okay, I see what you mean and why a header-only library would be useful.  There are some arguments against a header-only library, though: slow compile times, and linking nightmares of the sort that Armadillo has.  Given the significant complexity of mlpack and its use of templates, I would really like to try and keep user compile time low, if possible, instead of having to compile lots and lots of mlpack every time you build something that uses mlpack.

Moving PROGRAM_INFO into main() is fraught with its own problems (specifically, that weird things will happen if you declare PROGRAM_INFO outside of main() and this will eventually confuse users and cause bug reports that have to be dealt with via long-winded explanations later), so I'd like to avoid that.

We can easily guarantee that ProgramDoc::singleton is created before the macro, by creating it during the macro, using a GetSingleton() function like the one you proposed in #521.  Really it's the destruction order that matters more, so that if the CLI interface is being used and -v is specified, the timers are printed correctly.

Another advantage that putting things into a singleton.cpp file has is that then if you are not using the CLI object or the Log object, then I think you won't need to link against mlpack (assuming that you don't have any other functionality that is part of libmlpack.so).  I think that most people aren't using the CLI or Log objects at all in their own code, they are probably just using the algorithms (like, e.g., `mlpack::KMeans<>` or whatever).

---
Reply to this email directly or view it on GitHub:
https://github.com/mlpack/mlpack/pull/524#issuecomment-190359270
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mailman.cc.gatech.edu/pipermail/mlpack-git/attachments/20160229/7d723efe/attachment-0001.html>


More information about the mlpack-git mailing list