Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

base/sparse/csparse.jl is LGPL2.1, but is included even if USE_GPL_LIBS=false #13001

Closed
IainNZ opened this issue Sep 7, 2015 · 20 comments
Closed

Comments

@IainNZ
Copy link
Member

IainNZ commented Sep 7, 2015

What this means for the resulting combination, I'm not sure.

@ViralBShah
Copy link
Member

USE_GPL_LIBS is only for GPL libraries. LGPL is ok. Eg. CSparse, GMP, etc.

@tkelman
Copy link
Contributor

tkelman commented Sep 8, 2015

It would probably be a good idea to get a legal opinion at some point about whether ccall usage qualifies under the linking exceptions in LGPL, and the libgit2 exception.

@tkelman tkelman changed the title base/sparse/csparse.jl is LPGL2.1, but is included if even if USE_GPL_LIBS=false base/sparse/csparse.jl is LGPL2.1, but is included if even if USE_GPL_LIBS=false Sep 8, 2015
@IainNZ IainNZ changed the title base/sparse/csparse.jl is LGPL2.1, but is included if even if USE_GPL_LIBS=false base/sparse/csparse.jl is LGPL2.1, but is included even if USE_GPL_LIBS=false Sep 8, 2015
@dmbates
Copy link
Member

dmbates commented Sep 8, 2015

@tkelman base/sparse/csparse.jl doesn't ccall anything in the CSparse library. It is Julia code that is patterned after the C code in the CSparse library.

@ScottPJones
Copy link
Contributor

If it was derived from the LGPL source, I'm pretty sure that it is "tainted" by copy-left, and can not be used in Julia (unless you are willing to make open source all of your code)

@dmbates
Copy link
Member

dmbates commented Sep 8, 2015

@ScottPJones We're talking about code that is written in Julia and is part of the Julia sources. Is there a sense in which that is not open source?

To review the bidding: Tim Davis's book, "Direct Methods for Sparse Linear Systems", describes many of the algorithms at the heart of sparse matrix construction and manipulation. The book can be considered as documentation for the CSparse and CXSparse libraries, which are covered by LGPL. Essentially every line of code in those packages is described and explained in the book.

Viral and I created Julia versions of several of these algorithms in the base/sparse/csparse.jl file. Because the original C libraries are covered by the LGPL, we applied the same license to that file.

Neither of us can do a "clean room" implementation because we both have obviously read the book and the code. If a person who knows the algorithms but has not read the book (which is probably a rather small group) wants to re-implement from scratch, that would be great. Otherwise we are left with a file that is LGPL or we are left without most of the functionality of the SparseMatrixCSC type.

@JeffBezanson
Copy link
Member

Licensing the file as LGPL seems like the right thing to do. However since it is _L_GPL, copy-left only affects changes made to csparse.jl, not the rest of julia. Perhaps some organizations are over-sensitive though, and would want a USE_LGPL_LIBS flag as well.

@simonster
Copy link
Member

My reading of LGPL 2.1 section 6 is that you must be able to modify the library and relink the work to the modified copy. At the moment, if you were to distribute a copy of Julia with modifications, I think the only way to replace csparse.jl with a modified version would be to recompile Base, so you have to distribute everything needed to recompile Base with the work (although not necessarily under LGPL). But if you bundle other packages with your modified Julia, there are no requirements for those packages, and if you embed Julia, you just need to dynamically link it and provide the source for Julia. So I think this single LGPL file does affect the licensing of all of Julia, but maybe not in a way that matters so much (all of our binary distributions include all of the Base source anyway, and we don't have facilities for obfuscating things), and the situation should be a little more relaxed if we have bundled packages (since then this can just be a separate bundled package that the user can freely swap out).

@ScottPJones
Copy link
Contributor

@dmbates The problem comes in that if you have commercial code, not open source, which you need to embed in Julia, it might become tainted by the copy-left of any GPL code that is part of Julia.
The USE_GPL_LIBS takes care of (most) of the parts that fall under the GPL, however, csparse.jl was not.

@JeffBezanson I don't think that's the way LGPL works. That would hold if csparse.jl were a wrapper that dynamically linked to a csparse library, however, csparse.jl is in itself a derivative work, hence the library exemption to the GPL license doesn't come into play. A USE_LGPL_LIBS flag would not be useful either, because the other things, such as libgit2, really are dynamically linked, and are perfectly fine to use, even in commercial applications written in Julia. I also think that it is unfair to characterize organizations that care about these legal issues as being "over-sensitive", just because they are not cavalier about correctly following licensing rules.

@simonster Yes, If this were in a package, that people would be free to load or not, I don't think there would be a problem with it being GPL if you simply don't load it (since you don't dynamically link to Julia code, it is dynamically compiled from source, I don't think it really can be LGPL, but IANAL).

@JeffBezanson
Copy link
Member

Yes, I agree with @simonster 's reading.

The purpose of the GPL/LGPL is not to encourage dynamic linking, or any particular linking technology. The FSF understands hacking, and they don't intend for it to be possible to "work around" their licenses by using a different kind of linking. So whether something is in a .so is not necessarily a valid litmus test for license compliance. In the case of the LGPL, you need to be able to modify the LGPL code and use the modified library with the (possibly proprietary) package. In julia you can load a modified csparse using include("csparse.jl"), which I think passes the test. However I agree with @ScottPJones that this depends on exactly how julia is distributed. It is possible to distribute a proprietary julia in such a way that you can't reload csparse.jl, which could be a problem. But this is not the same as saying that GPL==LGPL in the case of julia code.

@ViralBShah
Copy link
Member

You can always load it in a module though.

@ScottPJones
Copy link
Contributor

@JeffBezanson I wasn't trying to say that GPL == LGPL in julia code, nor that LGPL was just about dynamic linking (I've just heard that's the safest way to make sure you don't get entangled in the copy-left, Stallman pretty much wants everything to be pulled into the copy-left). I much prefer the MIT license that Julia tends to use, because of it, we feel it is safe to use julia in our commercial product, and put as much as possible of things we are doing on GitHub under that same MIT license).

@KristofferC
Copy link
Member

Out of curiosity, where are the things you have put on Github under MIT?

@ScottPJones
Copy link
Contributor

@KristofferC All of the stuff I've done (some 110 commits merged so far to JuliaLang/julia) has of course been under MIT license. I've also started doing PRs on @nolta's nice https://github.com/nolta/ICU.jl, and have done minor fixes for other packages.
I did say "we", and by that I meant also the other people at @Dynactionize, such as @maartenheremans and @enzobrands (who I've successfully managed to seduce away from C++ and Python 😀).
Please take a look at Maarten's https://github.com/Dynactionize/MariaDB.jl.
As we progress, all of us want to be able to contribute as much as possible to the Julia community.

@mlubin
Copy link
Member

mlubin commented Sep 9, 2015

Under the topic of GPL == LGPL mod Julia: JuMP was originally licensed under LGPL, but then I realized that I have no idea what the difference between LGPL and GPL means for julia packages, so I can't expect users to interpret the license. Hence we switched to MPL.

@DemiMarie
Copy link

One solution would be for csparse.jl to be loaded as source code at runtime, rather than at compile time. IANAL but it seems to me that able to replace a single text file meets the LGPL requirements. How long does it take to load this file from source?

If loading this file from source takes too long, perhaps Julia needs some sort of fast-loading format.

@ViralBShah
Copy link
Member

Given that LGPL only applies to the particular file, it is fine to include LGPL libraries as part of Julia, and this is compatible with the USE_GPL_LIBS, which only avoids compiling GPL libraries. We can reopen this if required.

@tkelman
Copy link
Contributor

tkelman commented Nov 2, 2015

It's possible to make modifications to the source of csparse.jl then rebuild the system image via https://github.com/JuliaLang/julia/blob/master/contrib/build_sysimg.jl, at least assuming that script isn't broken at any given moment in time. Who knows whether that's enough to satisfy the LGPL provisions on modification and relinking.

@StefanKarpinski
Copy link
Member

Usually playing games with how or when something is linked has no effect on legality.

@Sacha0
Copy link
Member

Sacha0 commented Nov 30, 2015

@dmbates I might be able to help with a clean-room implementation:

TL;DR My mind should be a sufficiently green field. With a little guidance, I would be happy to reimplement --- working from unencumbered literature and code --- whatever functionality exists in base/sparse/csparse.jl. Let me know.

In full, in case there are subtleties I'm not aware of: Earlier this year I obtained Davis' book intending to work through it alongside the associated lectures. On hitting the second chapter I realized the potential license issues and proceeded trying to read the text without reference to the code. Given the text's nature, that effort rapidly proved hopeless and I stopped reading another few pages in. I then tried listening to the lectures also without reference to the code, but shortly arrived at the same conclusion and desisted. Instead I carried on with Stewart's pedagogical report (`Building an old-fashioned sparse solver') and the associated references which, to the best of my knowledge, are clean.

@dmbates
Copy link
Member

dmbates commented Nov 30, 2015

The most widely used functions in base/sparse/csparse.jl are sparse and the various forms of transpose. Those would definitely be the ones to start with. I suspect that Stewart's notes might be enough to perform that. There is also an etree (elimination tree) function but I may be the only person who uses that.

By the way, thanks for informing us of Stewart's report. He's a good writer and a great numerical analyst.

Sacha0 added a commit to Sacha0/julia that referenced this issue Jan 11, 2016
…se/sparse/csparse.jl ([c|f]transpose[!]) with MIT-licensed versions. See JuliaLang#13001.
Sacha0 added a commit to Sacha0/julia that referenced this issue Jan 11, 2016
…se/sparse/csparse.jl ([c|f]transpose[!]) with MIT-licensed versions. See JuliaLang#13001.
Sacha0 added a commit to Sacha0/julia that referenced this issue Jan 17, 2016
…tril!, triu!, droptol!, and dropzeros[!] with MIT-licensed versions. See JuliaLang#13001 and JuliaLang#14631.
Sacha0 added a commit to Sacha0/julia that referenced this issue Jan 17, 2016
…tril!, triu!, droptol!, and dropzeros[!] with MIT-licensed versions. See JuliaLang#13001 and JuliaLang#14631. Also add a test for dropzeros!.
Sacha0 added a commit to Sacha0/julia that referenced this issue Jan 26, 2016
Sacha0 added a commit to Sacha0/julia that referenced this issue Jan 26, 2016
Sacha0 added a commit to Sacha0/julia that referenced this issue Jan 27, 2016
Sacha0 added a commit to Sacha0/julia that referenced this issue Jan 27, 2016
Sacha0 added a commit to Sacha0/julia that referenced this issue Jan 27, 2016
Sacha0 added a commit to Sacha0/julia that referenced this issue Jan 27, 2016
Sacha0 added a commit to Sacha0/julia that referenced this issue Jan 27, 2016
Sacha0 added a commit to Sacha0/julia that referenced this issue Jan 27, 2016
Sacha0 added a commit to Sacha0/julia that referenced this issue Jan 27, 2016
Sacha0 added a commit to Sacha0/julia that referenced this issue Jan 27, 2016
Sacha0 added a commit to Sacha0/julia that referenced this issue Jan 27, 2016
Sacha0 added a commit to Sacha0/julia that referenced this issue Jan 27, 2016
Sacha0 added a commit to Sacha0/julia that referenced this issue Jan 27, 2016
Sacha0 added a commit to Sacha0/julia that referenced this issue Jan 27, 2016
Sacha0 added a commit to Sacha0/julia that referenced this issue Jan 27, 2016
…tril!, triu!, droptol!, and dropzeros[!] with MIT-licensed versions. See JuliaLang#13001 and JuliaLang#14631. Also add a test for dropzeros!.
Sacha0 added a commit to Sacha0/julia that referenced this issue Jan 27, 2016
…tril!, triu!, droptol!, and dropzeros[!] with MIT-licensed versions. See JuliaLang#13001 and JuliaLang#14631. Also add a test for dropzeros!.
Sacha0 added a commit to Sacha0/julia that referenced this issue Jan 27, 2016
Sacha0 added a commit to Sacha0/julia that referenced this issue Jan 27, 2016
Sacha0 added a commit to Sacha0/julia that referenced this issue Jan 28, 2016
…tril!, triu!, droptol!, and dropzeros[!] with MIT-licensed versions. See JuliaLang#13001 and JuliaLang#14631. Also add a test for dropzeros!.
Sacha0 added a commit to Sacha0/julia that referenced this issue Jan 28, 2016
…tril!, triu!, droptol!, and dropzeros[!] with MIT-licensed versions. See JuliaLang#13001 and JuliaLang#14631. Also add a test for dropzeros!.
Sacha0 added a commit to Sacha0/julia that referenced this issue Jan 28, 2016
…tril!, triu!, droptol!, and dropzeros[!] with MIT-licensed versions. See JuliaLang#13001 and JuliaLang#14631. Also add a test for dropzeros!.
Sacha0 added a commit to Sacha0/julia that referenced this issue Feb 24, 2016
Sacha0 added a commit to Sacha0/julia that referenced this issue Feb 24, 2016
Sacha0 added a commit to Sacha0/julia that referenced this issue Feb 24, 2016
…tril!, triu!, droptol!, and dropzeros[!] with MIT-licensed versions. See JuliaLang#13001 and JuliaLang#14631. Also add a test for dropzeros!.
Sacha0 added a commit to Sacha0/julia that referenced this issue Feb 24, 2016
Sacha0 added a commit to Sacha0/julia that referenced this issue Feb 24, 2016
…tril!, triu!, droptol!, and dropzeros[!] with MIT-licensed versions. See JuliaLang#13001 and JuliaLang#14631. Also add a test for dropzeros!.
Sacha0 added a commit to Sacha0/julia that referenced this issue Feb 25, 2016
Sacha0 added a commit to Sacha0/julia that referenced this issue Feb 25, 2016
Sacha0 added a commit to Sacha0/julia that referenced this issue Feb 26, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests