9

I'm writing a commercial package that uses R (GPL) for its computation. The GPL FAQ clearly states that GPLed programming language interpreters do not impose licensing restrictions on the "program" (text file with R code). So far, so good.

Part of the package is compiled using Rcpp, which also uses the GPL. The next paragraph in the FAQ reads:

However, when the interpreter is extended to provide "bindings" to other facilities (often, but not necessarily, libraries), the interpreted program is effectively linked to the facilities it uses through these bindings.

It can be interpreted that R is providing a binding to the Rcpp libraries (Rcpp.dll in the windows package). The safe assumption is that this taints my code with the GPL, but is this really the right conclusion?

Part of my uncertainty is the tightness of the link between my code and Rcpp.dll. There are references to Rcpp in the dll, but I'm not proficient enough to know if these are references to the development environment or to calls being placed to symbols within the Rcpp library. If the former, then I believe that the Rcpp library is being linked by R and not by my library. I suspect the latter, though, since Rcpp provides a glue (sugar, actually) to simplify code-writing and execution.

There are countless related discussions related to the GPL in code distribution. To name a few:

NB: I'm generally a big supporter of OSS and have participated in development and distribution in the past. Questions of "protecting code" often raise hackles of open-source programmers, frequently resulting in heated debates over software philosophy. I recognize value on both sides and want to ensure that I'm meeting the letter and (if possible) spirit of the laws. I'm not fishing for a loop-hole in the license; I'm looking for help interpreting and placing it into context.

Are R packages that depend on Rcpp required to use the GPL?

r2evans
  • 326
  • 2
  • 9
  • Why did you post here, rather than at place where those actually _involved_ with Rcpp would have seen it sooner? – Dirk Eddelbuettel Oct 21 '16 at 15:02
  • 1
    I did (via email), and you responded soon after I posted this question. Thank you. And since this site is about *"creating, delivering, and maintaining software responsibly"* (in which licensing is bound), it is not inappropriate to ask here as well. I was not avoiding the "perfect" venue, Dirk, I was asking from multiple directions. – r2evans Oct 21 '16 at 15:28
  • Ok, reaching out directly is certainly useful, and I did not remember that you did. I was only concerned with you getting a _relevant_ audience for your question, and I do not know anyone from our team reading this site. – Dirk Eddelbuettel Oct 21 '16 at 15:29
  • 1
    Asking here was more about the "GPL inheritance" aspect of it than Rcpp programming. There are a couple of other dialects of this question (not asked): (1) GPL inheritance in general, (2) licensing of R packages without compiled code, and (3) licensing of R packages with C/C++ code (whether Rcpp or otherwise). In hindsight, my issue was more the third than it was specific to Rcpp. I'm getting a little better these days about how to ask questions more pointedly and clearly. – r2evans Oct 21 '16 at 15:47
  • Thanks for follow-up, and I hope you got your answers. I think (1) and (3) are pretty well understood because of the object code / linking aspect. (2) is a little different. – Dirk Eddelbuettel Oct 21 '16 at 17:00

2 Answers2

13

I believe that R packages that depend on Rcpp are not required to use GPL but rather to use a GPL-compatible license.

Reading the Rcpp-FAQ Section 1.5 clearly states that:

you are free to license your work under whichever terms you find suitable (provided they are GPL-compatible, see the FSF site for details).

That would mean that if one chooses to use for example the BSD-3-clause license he is perfectly fine to do so.

To add an important caveat: As Dirk has pointed out in the comments the aggregation of GPL-compatible licensed code and GPL-licensed code will have to be GPL-ed. One can find in gnu.org a good explanation of what is an aggregate and what is not. Notice that when you release a package you distribute only your code, that is why you can use any GPL-compatible license and not exclusively GPL.

usεr11852
  • 231
  • 3
  • 9
  • 1
    The [this part of the FSF FAQ](https://www.gnu.org/licenses/gpl-faq.en.html#LinkingWithGPL) clarifies: the aggregate is always going to GPL; you are however free to license your code under any _compatible_ license. – Dirk Eddelbuettel Oct 21 '16 at 14:48
  • Also, a casual scan of CRAN with its _hundreds_ of packages using CRAN would have illustrated this quickly enough. – Dirk Eddelbuettel Oct 21 '16 at 15:12
  • The answer is quoting somewhat selectively from [Question 1.5 of the Rcpp FAQ](). Better read the whole thing -- it is short. – Dirk Eddelbuettel Oct 21 '16 at 15:28
  • @DirkEddelbuettel: Apologies, I do not understand what you are commenting about exactly. Is my answer that any GPL-compatible licence is sufficient, wrong? Do you aim to draw attention to the fact that hundreds of packages that use Rcpp do not always use GPL but might use different licences? (eg. BSD-3, Artistic License 2.0, MIT, etc.) – usεr11852 Oct 22 '16 at 22:36
  • Your answer restates pretty much exactly what I say in the very [Section 1.5 of the Rcpp FAQ](http://cloud.r-project.org/package=Rcpp/vignettes/Rcpp-FAQ.pdf). I just don't understand why you chose to quote a half-sentence when this section clearly needs more than one sentence. _In aggregate_ all of this is true; you just don't say the important part. While "yes you can" (use a non-GPL license that is compatible) the key is that the _aggregate work is still GPL'ed_ by the design of the GPL. – Dirk Eddelbuettel Oct 22 '16 at 22:40
  • BTW I still upvoted your answer as it is helpful with respect to the question by @r2evans – Dirk Eddelbuettel Oct 22 '16 at 23:37
  • @DirkEddelbuettel: Thank you for the clarification pointing out the issue about the aggregation (and in general thank you for `Rccp`). Regarding the "why so small of an answer": I just thought that it was an adequate informed "Yes/No" reply with relevant links to the question the OP asked. Legal documents like licenses always give me the feeling that there might be something I could misinterpreter so I did not want to dwell into their text; just touch the absolute necessities for the answer. – usεr11852 Oct 23 '16 at 08:53
6

Yes, if you link your code with the Rcpp library and distribute the derivative work, your package will almost certainly be subject to the GPL. The answers to this related question apply to your situation.

Sometimes, the author of a work will offer a choice between commercial and open-source licenses (with a fee often required for the commercial option), but it doesn't appear that this is the case with Rcpp.

Sifferman
  • 176
  • 1
  • 4
  • This is what I suspect as well, thank you for weighing in. The related question didn't address the issue of starting with an interpreter, but I think having links in my code to the `Rcpp.dll` library seals the deal. Thanks, @sifferman. – r2evans Aug 29 '14 at 17:44
  • 1
    I think that this answer is a bit over-simplifying; please see my answer below. – usεr11852 May 04 '15 at 04:33