xtensor-stack / xtensor-fftw

FFTW bindings for the xtensor C++14 multi-dimensional array library
BSD 3-Clause "New" or "Revised" License
48 stars 16 forks source link

Review license usage #36

Open egpbos opened 6 years ago

egpbos commented 6 years ago

Look into which license xtensor-fftw is exactly supposed/allowed to use for what (code, conda package), given that FFTW3 itself is under GPL.

marty1885 commented 6 years ago

Quote from FFTW's site.

Non-free licenses may also be purchased from MIT, for users who do not want their programs protected by the GPL.

Could xtensor-fftw be double-licenced as both GPL and MIT? Also creating a LGPL header to wrap around FFTW may also be an solution.

egpbos commented 6 years ago

I have since taken this approach for Barcode, which is in a similar situation:

The original contributions made as part of this code are distributed under the MIT license (see LICENSE file).

When compiled, this code must link to FFTW 3 and the GNU Scientific Library (GSL). FFTW is distributed under the GNU Public License v2 or a later version, GSL under GPL v3. This means that any redistribution of Barcode in binary form is subject to GPL v3 terms.

I'm not yet sure whether this is the best way to go, but I also don't want to lock my code into GPL, because I may to some point want to also include different FFT engines, preferably permissively licensed ones so that xtensor-fft(w) can also be used and redistributed permissively, if there's need for that.

And then there's also FFTW's option B of buying a commercial license, which would allow a company to use xtensor-fftw + FFTW without GPL.

I think this way we could avoid double-licensing. But as mentioned, I'm not completely sure, and open to more input/discussion.

ashwinvis commented 6 years ago

Relevant discussion here: pyFFTW/pyFFTW/issues/229

egpbos commented 6 years ago

Thanks @ashwinvis! I agree with @mreineck's interpretation. The point you make there I also agree with, LGPL for FFTW would have made things easier, but unfortunately that's not the case.

What do you think about the way I put it for Barcode (see my earlier comment above)?

ashwinvis commented 6 years ago

I feel this is a tricky territory. It is good that you are not distributing any binary, but that is the ambiguity right. It would have been fine, if you just had codes like this:

#include <fftw.h>

and rest are completely your own creation, not even derivative work. But you do have snippets of initialization of fftw function call in files like https://github.com/egpbos/xtensor-fftw/blob/master/include/xtensor-fftw/basic.hpp . Those do classify as derivative work don't they?

egpbos commented 6 years ago

Those do classify as derivative work don't they?

That's a good and crucial question. Are there any sources on this?

ashwinvis commented 6 years ago

Not a legal advice, but enjoy: https://cicero.xyz/v2/remark/github/coderefinery/software-licensing/master/talk.md/#23

mreineck commented 6 years ago

Not legal advice either, but I do consider this presentation quite misleading. The statements it makes concerning GPL only hold if the "menu" is equivalent to "binary holding all compiled components". If we assume that "menu" means "all of the source code", then the statements regarding "virality" are incorrect.

The analogy to a restaurant menu is not really fortunate, I'd say, because there are no "source" and "binary" incarnations of a menu, and the distinction between the two is quite crucial.

ashwinvis commented 6 years ago

I am not the author of the presentation, but

mreineck commented 6 years ago

In that case I'm convinced that slide 27 of the presentation is incorrect. How is the license for the salad recipe dependent on the license of the cake recipe? Just because they are served in the same restaurant? That's definitely not how the GPL works.

BTW, the analogy has another problem:

This makes things look very different.

ashwinvis commented 6 years ago

Yeah that is incorrect I agree with you. I think the point that they are making is since menu is a library linking the GPL cake, menu has to be GPL. But menu is the one which is linking the salad not the other way round. So salad can stay BSD or some other permissive license.

egpbos commented 6 years ago

Exactly, the entire thing (menu) is "infected" with GPL. You could still distribute salad (and its recipe) separately under a different license. I'm now confused as to what role in this analogy xtensor-fftw would play 🤔

mreineck commented 6 years ago

I think the whole analogy is bad, since, as I pointed out, the concept of "binary" has no tangible correspondence in the restaurant example.

The crucial question is most likely whether basic.hpp contains code that was copied from FFTW sources. If yes, then this code is still covered by GPL, and you can't put a BSD license on it. If there is no FFTW code in there and you only call FFTW, you can distribute this under BSD terms.

ashwinvis commented 5 years ago

I think you can rely on the clarification in https://github.com/JuliaMath/FFTW.jl#license, which is MIT licensed. This is the safest interpretation since one of the authors of FFTW is involved in that project.

ashwinvis commented 5 years ago

cf: https://github.com/JuliaMath/FFTW.jl/pull/41#discussion_r141968395

egpbos commented 3 years ago

PyFFTW has now solved the issue by adding a custom LICENSE file, see https://github.com/pyFFTW/pyFFTW/issues/229#issuecomment-798989310.