[Rd] making cuda-based R package CRAN friendly

Liaw, Andy andy_liaw at merck.com
Tue Jul 29 23:10:48 CEST 2014

Dear R-devel,

We are planning a package that provides R interface to cuBLAS (CUDA accelerated BLAS).  Due to CUDA's requirement, we are wondering if anyone can provide some guidance and suggestions on best way forward.

CUDA lists Visual Studio as a requirement on Windows, and it looks like no one had succeed in building a DLL that can be called from R using the mingw tools in Rtools.  Google search results suggest that no one had been able to get around using MSVS to build a usable DLL so far.  What worked was to build .cu code into DLL using MSVS, then placing the DLL into the src/ subdirectory, and then using R CMD INSTALL to finish building the binary package with the help of configure.win and src/Makevars.win files.

As far as I can tell, no gpu/cuda based R package has Windows version, on or off CRAN. Several simply states Windows as being not supported.  We would like to make our package as widely applicable as possible, so we're seeking advise/suggestion on how to resolve this issue.

One way is to have an R-only package, and upon load the package, detect whether the shared library needed is present.  If not, inform the user to run a function that detect the OS and presence of CUDA, and download the appropriate shared library file.  The problem is as long as there are C code in src/, it will not pass CRAN check.  Also, that seems to violate some CRAN policies.

The other is simply to follow what packages like gputools/rpud/etc. and have only source package on CRAN, and provide Windows binaries off CRAN (perhaps with a note in the README on where  to download them).  

We'd very much appreciate any pointer.


Andy Liaw
Biometrics Research, Merck Research Laboratories
PO Box 2000 RY34-300 Rahway, NJ 07065

Notice:  This e-mail message, together with any attachme...{{dropped:11}}

More information about the R-devel mailing list