使用R包分发已编译的可执行文件 [英] Distributing a compiled executable with an R package

查看:69
本文介绍了使用R包分发已编译的可执行文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在准备一个R包,其中将包含第三方编译的可执行文件.计划是使用system()调用将其连接到R.我有权分发此可执行文件,但不能分发其源代码.不幸的是,它只能在Windows 32位下编译,并且不可能在不同的体系结构下轻松地重新编译.

I am preparing an R package that will include a third party compiled executable. The plan is to interface it to R using system() calls. I have permission to distribute this executable, but not its source code. Unfortunately it is only compiled under Windows 32 bit, and it is not possible to easily recompile it under different architectures.

了解此软件包的受众将有所限制,应如何分发可执行文件?我也认识到,出于这个原因,它不会在CRAN上被允许.

Understanding that this package will have a somewhat limited audience, how should the executable be distributed? I also recognize that it will not be allowed on CRAN for this reason.

例如,可执行文件应该包含在软件包安装的/bin/子文件夹中,或者替代地,如果软件包本身已安装,则软件包应以某种方式下载可执行文件.

For example, should the executable be included in the /bin/ subfolder of the package installation, or alternately should the package somehow download the executable when it is itself installed.

此外,在这种情况下,我将面临哪些许可问题?

In addition, what licensing issues, if any do I face under this scenario?

推荐答案

由于CRAN二进制限制(顺便说一句,这看起来很完美),我已经开发了两个类似的软件包,它们都托管在R-forge上.对我很明智). (我认为您不会在问题中遗漏任何明显的东西,只是在这里说出我选择要做的事情.)

I have worked on two packages that do something like this, both hosted on R-forge because of the CRAN binary restriction (which, by the way, seems perfectly sensible to me). (I don't think you're missing anything obvious in your question -- just saying here what I chose to do.)

  • cpcbp软件包(通用主成分/反投影)使用从Patrick Phillips编写的代码编译的二进制文件;源代码不可分发,因为它使用了一些数字食谱例程.我一直想在R中重新编写这个核心(这只是简单的数字线性代数,这并不难).在我看来,我可能必须对此许可证进行修改-我可能说了"GPL",但是考虑到不可分配的组件,我认为我实际上不能做到这一点...
  • glmmADMB软件包使用可自由重新分发的源代码(BSD许可证),但是工具链非常复杂,我不希望用户下载整个支持软件包
  • the cpcbp package (common principal components/back-projection) uses a binary compiled from code written by Patrick Phillips; the source code is unredistributable because it uses some Numerical Recipes routines. I've been meaning to re-write this core in R (it's just straightforward numerical linear algebra, it wouldn't be that hard). It occurs to me that I probably have to go modify the license on this one -- I probably said "GPL" but I don't think I can actually do that given the unredistributable component ...
  • the glmmADMB package uses freely redistributable source code (BSD license), but the toolchain is sufficiently complicated that I don't want users to have to download the entire supporting package

在两种情况下,我都将二进制文件放在inst/bin中,并且可能放在特定于体系结构的子目录下(这些子目录已安装在/bin中),并使用适当的逻辑来检测体系结构并运行正确的二进制文件.

In both cases I put the binaries in inst/bin and possibly under architecture-specific subdirectories (which get installed in /bin) and use the appropriate logic to detect the architecture and run the correct binary.

我想原则上您可以通过将不可再分发的部分下载(如您建议的那样)来解决无法通过GPL进行许可的问题,但这似乎违反了精神...

I guess in principle you could get around the inability to license via GPL by making the non-redistributable part into a download (as you suggest), but that would seem to violate the spirit ...

这篇关于使用R包分发已编译的可执行文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆