[R-pkg-devel] Package with multiple compilers?

Charles Determan cdetermanjr at gmail.com
Fri May 29 15:52:05 CEST 2015


I am actively working on an R package that will incorporate some CUDA code
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 that
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?

Regards,
Charles

	[[alternative HTML version deleted]]



More information about the R-package-devel mailing list