11

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
  • 346

2 Answers2

14

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.

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