Licensing R packages with GPL dependencies

Hi all. I know nothing about software licenses. Some recent discussion on the Rstan/Stanheaders merger thread suggests that packages that depend on GPL-licensed packages might need to be published under GPL licenses.

Is there some important and well-known subtlety that makes the rstan/stanheaders issue on the thread linked above clearly thornier than the thousands of non-GPL R packages with GPL dependencies? For example, is the concern restricted to packages that use rstan to pre-compile a bunch of c++ when they’re installed? Brief googling suggests that maybe there is no such subtlety; i.e. that perhaps any package that depends on a GPL package needs to be distributed under GPL. Note that multiple R packages in stan-dev are not compliant with this interpretation.

It might be important/useful to provide some clearer community guidance for licensing rstan reverse-dependencies. For example, the Step by step guide for creating a package that depends on RStan doesn’t mention this issue at all. rstantools::rstan_create_package() adds a GPL-3 by default, but with the option to not add the license and no indication that adding the license might be legally required if the intention is to release/distribute the package.

@stablemarkets @wds15 @bgoodri @jonah


In case you use rstantools which links a given package directly to rstan and RCpp, then that package needs to be GPLed is my understanding. This is the creepiness of the GPL, which is very much debated. Not everyone is compliant to this… but unless no one from the the FSF takes action on it, then nothing will happen. Maybe you open an issue for rstantools asking for more prominent hint at using GPL-3 in the vignette?

(you can also propose a PR, of course)

Worth looking at section 1.5 here:

Personally when I want speed in R I’m using Julia via JuliaCall as an alternative because it has MIT licence. Oh and also I don’t want to learn C++ 😅

I know also the tidyverse folks are slowly changing tidyverse packages to MIT licence, but its a slow process: Relicensing ggplot2 (3/3) · Issue #4232 · tidyverse/ggplot2 · GitHub

Here’s Stallman’s article on compatibility with GPLv3. In particular, see the section on “combining code”. You’ll see the problem comes in with the entire package license, not with the licenses of the individual bits (assuming you use GPLv3 compatible licenses).