[Rcpp-devel] How to make an R package that uses Boost.Thread, qualified to be published on CRAN or shared by the most

Dirk Eddelbuettel edd at debian.org
Sat Nov 2 16:13:30 CET 2013


Simon,

This question is somewhat off-topic here. I'll give you an answer but I would
like you to conisder posting any follow-ups on r-devel.

On 2 November 2013 at 21:54, Simon wrote:
| Recently, I made an R package that used the C++ library Boost.Thread (http://www.boost.org/doc/libs/1_54_0/doc/html/thread.html) for multithreading.  Previously, I have posted a question at stackoverflow (http://stackoverflow.com/questions/19651954/is-it-possible-to-build-an-r-package-which-use-rcpp-and-boost-thread-on-http), but now my questions becomes: 
| 
| 1) if I want to upload my package onto CRAN, what am I supposed to do with Boost.Thread?

Your package, your problem. I have a sample of size one (the "bigmemory"
package set by Jay and Mike) who tried a lot of things and eventually
resported to "OS_type: unix", ie no Windows.

There may well be counter examples. Have you researched CRAN?
 
| Or
| 
| 2) I want to share my package with others, Must it be submitted to CRAN? I am not an expert, but I am trying to make my package to be used by the most, so I encounter these problem.

What gives you the impression you are forced to use CRAN?  Just create your
own repo. All you need is something serving http. Or serve its sources off
R-Forge, RForge, Github, Bitbucket, ...  

But yes, CRAN effectively has a lot of visibility.
 
| 3) Boost is a third party library, and the separately-compiled library Boost.Thread is used by my package.  To make a package stand-alone, the best way I can imagine is to include the the library source files under my package's src directory.  What if I just publish my package, and tell users they should install Boost before their use of my package?  Initially, I just want to use what I know about to make an R package that everyone can use, however, I found that to make the most to use my package, there are a lot to consider, though under Ubuntu, that's a lot easier, an apt-get command will install the Boost.  The question on 
| stackoverflow (http://stackoverflow.com/questions/19651954/is-it-possible-to-build-an-r-package-which-use-rcpp-and-boost-thread-on-http) is about Windows, from the answer I am not going to struggle to provide support for Windows, at least now I suppose.  Is it a common practice for the user themselves to install a third party library like Boost.Thread?

That really is a packaging question. 

It ignores the fact that _a lot_ of Boost is compile-time only, which is why
we put together the BH package for giving package authors easy access to
headers.  Users do not see it, or need it.

It ignores the fact that eg WinBuilder has BOOSTLIB too. Read the win-builder
README.

But _none_ of this overcomes the fact that Boost.Thread needs linking. And
getting that on Windows is as far as I know really hard to impossible.

Dirk

-- 
Dirk Eddelbuettel | edd at debian.org | http://dirk.eddelbuettel.com


More information about the Rcpp-devel mailing list