[R-pkg-devel] Package with multiple compilers?
kevinushey at gmail.com
Fri May 29 19:57:23 CEST 2015
The GitHub search feature is also quite useful for seeing how other package
authors have constructed Makevars (or Makevars.win) when compiling with
custom targets. For example, a quick search of how some authors manipulate
OBJECTS in Makevars.win:
Of course, not all examples are good examples, but it definitely provides
examples to learn from -- and personally, my Makefile-fu is pretty weak.
Here's an example from 'gpusim' using 'nvcc' in their own Makevars.win:
Hopefully this gives you some more direction...
On Fri, May 29, 2015 at 10:49 AM Duncan Murdoch <murdoch.duncan at gmail.com>
> On 29/05/2015 9:52 AM, Charles Determan wrote:
> > I am actively working on an R package that will incorporate some CUDA
> > for using NVIDIA GPU devices. I am quite familiar with Rcpp for C++ code
> > and accustomed to using a Makevars file for specifying compiler options.
> > However I am stumped currently about how to use the NVCC compiler for the
> > .cu files.
> > Typically, a CUDA program will first be compiled with NVCC and the linked
> > with any other .o files.
> > # very simplified example
> > nvcc my_cuda_function.cu -o my_cuda_function.o
> > g++ -o my_program.so other_cpp_function.o my_cuda_function.o
> > I have seem some older packages using a Makefile but I have also read
> > this is currently recommended against because of the need for multiarch
> > builds.
> > Does anyone know how I can tell R to compile .cu files with NVCC and
> > 'proceed as normal' with the resulting .o files?
> You can include the recipes for those .o files in your Makevars file.
> It is essentially a fragment of the full Makefile needed by your
> package. I forget if you'll need to give an explicit recipe for the
> library, or whether the standard file will link them in. Try it!
> Duncan Murdoch
> R-package-devel at r-project.org mailing list
[[alternative HTML version deleted]]
More information about the R-package-devel