Eigen preprocessor directives

63 views
Skip to first unread message

Ben Goodrich

unread,
Jun 12, 2015, 12:00:13 PM6/12/15
to stan...@googlegroups.com
I think we should put some of

http://eigen.tuxfamily.org/dox/TopicPreprocessorDirectives.html

into src/stan/math/prim/mat/fun/Eigen.hpp
  • EIGEN_INITIALIZE_MATRICES_BY_NAN and skip filling Eigen types in the C++ code
  • EIGEN_NO_STATIC_ASSERT at least in interfaces, although these assertions are kind of useful when developing
  • eigen_assert maybe throwing an exception would be better for us
  • EIGEN_MPL2_ONLY Stan can't use LGPL code
  • EIGEN_DONT_PARALLELIZE as long as Stan is not safe to multithread within a chain

Ben


Joshua N Pritikin

unread,
Jun 12, 2015, 8:55:46 PM6/12/15
to stan...@googlegroups.com
On Fri, Jun 12, 2015 at 09:00:13AM -0700, Ben Goodrich wrote:
> I think we should put some of
> http://eigen.tuxfamily.org/dox/TopicPreprocessorDirectives.html
> into src/stan/math/prim/mat/fun/Eigen.hpp
> * EIGEN_INITIALIZE_MATRICES_BY_NAN and skip filling Eigen types in
> the C++ code
> * EIGEN_NO_STATIC_ASSERT at least in interfaces, although these
> assertions are kind of useful when developing
> * eigen_assert maybe throwing an exception would be better for us
> * EIGEN_DONT_PARALLELIZE as long as Stan is not safe to multithread
> within a chain

OpenMx uses EIGEN_INITIALIZE_MATRICES_BY_NAN when debugging is enabled.

> * EIGEN_MPL2_ONLY Stan can't use LGPL code

What's wrong with LGPL? I think I read a rant on the stan site somewhere
about how stan's license is "more free" than a free license. I think it
was a joke though?

--
Joshua N. Pritikin
Department of Psychology
University of Virginia
485 McCormick Rd, Gilmer Hall Room 102
Charlottesville, VA 22904
http://people.virginia.edu/~jnp3bc

Bob Carpenter

unread,
Jun 13, 2015, 2:58:22 PM6/13/15
to stan...@googlegroups.com
Does EIGEN_MPL2_ONLY restrict dependencies to ones ok with
Mozilla Public License 2? If so, I think that's a good thing.

I don't want to have Stan's C++ depend on GPL to avoid
the copyleft implications. Reverse dependencies are OK,
as we have in RStan (that is, GPL can depend on BSD code without
infecting the BSD code with copyleft, but not vice-versa --- it's
spelled out in the compatibility clauses of the GPL).

Is there something with the LGPL people want to use somewhere in
there? LGPL ("library" GPL) is quite different from the full GPL.

- Bob
> --
> You received this message because you are subscribed to the Google Groups "stan development mailing list" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to stan-dev+u...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>

Ben Goodrich

unread,
Jun 13, 2015, 3:27:22 PM6/13/15
to stan...@googlegroups.com, ca...@alias-i.com
It's fine for a library (like Eigen) to mix LGPL and code that is more permissive licensed. But Stan is advertised as BSD, so we would have to more clearly distinguish what parts are BSD and what parts are LGPL if anything in Stan could ever be considered a derived work of LGPL code (patches to the LGPL parts of Eigen, inheriting from those classes, etc). I think it is the case that Stan is not currently using any of the LGPL Eigen code so the preprocessor directive would just prevent us from doing so in the future without recognizing it.

The other preprocessor directives are a bigger deal.

Ben
> To unsubscribe from this group and stop receiving emails from it, send an email to stan-dev+unsubscribe@googlegroups.com.

Bob Carpenter

unread,
Jun 15, 2015, 3:03:24 PM6/15/15
to stan...@googlegroups.com
Sounds good to me. The Wikipedia seems pretty clear on
what's going on with LGPL --- it only copylefts itself :-)

The GNU Lesser General Public License (LGPL) is a free software license
published by the Free Software Foundation (FSF). The license allows developers
and companies to use and integrate LGPL software into their own (even proprietary)
software without being required by the terms of a strong copyleft license to release
the source code of their own software-parts. The license requires that only the LGPL
software-parts be modifiable by end-users via source code availability.

But if we can avoid it, we might as well not link to any of it if
we can avoid it.

End users of Stan can then change these properties and use the LGPL bits
and everything's fine, they just now have an LGPL + BSD (+Boost for boost,
+MPL2 for Eigen) product.

- Bob
> > To unsubscribe from this group and stop receiving emails from it, send an email to stan-dev+u...@googlegroups.com.
> > For more options, visit https://groups.google.com/d/optout.
> >
>
>
> --
> You received this message because you are subscribed to the Google Groups "stan development mailing list" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to stan-dev+u...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages