16

I use closed-source scientific software for my work. I also use GPL licensed tools and libraries. It would save me a lot of time to be able to call a GPL library directly from the closed-source software. The closed-source program can be extended with "plugins" that are written in C, run as a separate process, but need to link against a closed-source IPC library.

Questions:

  1. Can I write a plugin to interface the closed-source software with the GPL library, for my private use?

  2. Can I distribute the plugin as a compiled executable?

  3. Can I distribute the source code of the plugin so others can compile it on their own computer?

I intend to release the plugin code under the most permissive open source license possible while still complying with the GPL.


Let me clarify why the answers to the linked duplicate don't answer my question:

  • That question refers to a GPL host application with closed-source plugins. My question is about a closed-source host with a plugin that uses GPL libraries. It's not clear to me if that makes a difference.

  • My understanding is that the way the plugin attaches to the host application is very relevant to the GPL's restrictions. If the plugin is a separate executable that the host launches and pipes textual input to, the restrictions don't apply. The "attachment" method I described above is somewhat atypical: the plugin is a separate process and communicates with the host through a proprietary interprocess communication method. To achieve this, the plugin executable needs to statically or dynamically link to a closed-source IPC library. Possibly at this point it won't even matter anymore that this executable is a plugin and distributing it is clearly forbidden by the GPL?

8
  • This question came up more than once for me when working with Mathematica. My understanding was that I cannot distribute such plugins, yet the authors of some GPL licensed libraries actually encourage project that would link them against other software, including closed source commercial software like Mathematica. I wanted to make the question a bit more general so I didn't mention Mathematica specifically, but I think that this comment gives useful context for the question.
    – Szabolcs
    Aug 6, 2015 at 14:04
  • Note that there is a vast difference between GPL 2 and 3. Aug 6, 2015 at 16:28
  • @ThorbjørnRavnAndersen If the answer depends on that difference, can you explain that too please? Please consider it part of the question.
    – Szabolcs
    Aug 6, 2015 at 16:29
  • note that as long as you are only using it for yourself, you can do whatever you need to do. The problems come when you want to share your efforts with others. Aug 6, 2015 at 19:34
  • @ThorbjørnRavnAndersen Given that this is scientific software, not being able to share hurts the reproducibility of my papers. Thus sharing is quite important.
    – Szabolcs
    Aug 6, 2015 at 19:40

2 Answers 2

13

Since you explicitly say the plugin runs as a separate process from the closed-source program, the FSF presents the legal opinion that a plugin would probably be a separate work from the original (emphasis mine):

Can I apply the GPL when writing a plug-in for a non-free program?

If the program uses fork and exec to invoke plug-ins, then the plug-ins are separate programs, so the license for the main program makes no requirements for them. So you can use the GPL for a plug-in, and there are no special requirements.

Note that it is very difficult to determine whether two programs are actually separate works, and separate-processes factor appears to be a strong indicator of independence, but is probably not 100% dispositive.

Let us first examine the case where your plugin doesn't link to a proprietary library, but still links to a GPL library:

GPL applies to the plugin, but not to the main application

The copyleft of the GPL library causes your plugin to be covered by the GPL, but not the main application, which is probably a separate work.

Now let's add in your proprietary IPC library:

the GPL applies to both libraries and the plugin, but not the main application

Distributing software in this configuration is a GPL violation, since you cannot satisfy the GPL terms for the proprietary library. As above, the GPL does not apply to the main application, but it does apply to the proprietary library linked by the plugin, which causes a distribution-time violation.

The first question is very easy:

  1. Yes. If you do not distribute any software, the GPL never imposes any requirements on you. You may do anything you like with GPL-licensed software without fear of violating the GPL if you are the only person ever involved in those operations.

The next two are slightly more complicated:

  1. Your whole plugin is covered by the GPL, since it links to a GPL library. Therefore, when you distribute your compiled binary, it must be accompanied by the source code per the requirements of the GPL. You cannot provide source code for the proprietary library, so you cannot distribute the plugin without violating the GPL.

  2. You can distribute the source code. I anticipate that your program's reliance on the GPL library would not cause the GPL to apply to the source code in isolation, so you can probably distribute your isolated source code under any terms you like (but you may wish to verify this with a legal professional first).

3
  • Please see my update. So the answer is that if it weren't the case that this plugin executable needs to link to this closed source IPC library, it would be fine to distribute it. But if the IPC library were open source too (e.g. BSD licensed) then I could distribute the plugin executable. Is this right?
    – Szabolcs
    Aug 6, 2015 at 15:15
  • Does dynamical or static linking affect this? I'm wondering how Revolution R can use the (closed course) MKL library since R is under the GPL.
    – Szabolcs
    Aug 31, 2015 at 13:42
  • 1
    @Szabolcs This is sort of the inverse of my item #3: the Revolution R distribution doesn't actually include MKL (you must download and install it separately), so MKL is not subject to the copyleft distribution rules. Recall the GPL rules only apply at distribution time, so a recipient of both Revolution R and MKL can create and use a private combination, even if the GPL forbids distribution of the combination together.
    – apsillers
    Aug 31, 2015 at 15:21
6

Can I write a plugin to interface the closed-source software with the GPL library, for my private use?

Yes, the GPL does not affect private use. This is both due to private use exception in copyright law, and because the GPL explicitly says that it only applies to distributions of "something" containing GPL code.

Can I distribute the plugin as a compiled executable?

The "attachment" method I described above is somewhat atypical: the plugin is a separate process and communicates with the host through a proprietary interprocess communication method. To achieve this, the plugin executable needs to statically or dynamically link to a closed-source IPC library.

First: GPL requires you to provide source code when you distribute your program in combination with GPL-code.

If I understand correctly, you link your plugin to a closed-source IPC library, creating a binary executable, and then the question is:

Can I distribute the executable and just provide the source code to my plugin?

The answer to this is: no.

This triggers the "liberty or death" clause in the GPL (sec. 12 in GPLv3, but similar language is in all versions):

If you cannot convey a covered work so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not convey it at all.

Since you cannot provide source code for the closed-source IPC library, you cannot distribute this executable, even if you provide all the source code to your own work.

If the IPC library were open source too then you could distribute the plugin executable, but you would be obliged to provide source to all its components to downstream recipients.

Can I distribute the source code of the plugin so others can compile it on their own computer?

Yes. The source code to plugin is yours, it does not come under GPL just by having the potential to be linked with GPL. You can do with as you please. If you want to distribute it to others, so that they too may enjoy its use under the law's private use exception, that does not violate the GPL license.

5
  • Thanks for the update! Now a related question: what if my plugin links against the python interpreter (non-copyleft), and that interpreter runs GPL'd Python code? Perhaps this needs a separate question. This is not nitpicking, the issue did come up in practice (there are several libraries I want to use, some in Python, most in C). I could simply make a Python interface for that IPC library and glue everything together with Python code.
    – Szabolcs
    Aug 6, 2015 at 16:04
  • Should I just ask a different question on this?
    – Szabolcs
    Aug 6, 2015 at 16:07
  • @Szabolcs yes. ... Aug 6, 2015 at 16:36
  • New question here
    – Szabolcs
    Aug 6, 2015 at 16:55
  • Does dynamical or static linking affect this? I'm wondering how Revolution R can use the (closed course) MKL library since R is under the GPL.
    – Szabolcs
    Aug 31, 2015 at 13:42

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.