[R-pkg-devel] Makevars.win cppflags

Charles Determan cdetermanjr at gmail.com
Wed Mar 15 14:54:00 CET 2017


I am working on an R package that contains some CUDA code.  As such, it
needs to use the 'nvcc' compiler.  I then need to use some of the R header
files such as R.h.  On a linux machine, I can handle this with my configure
script using autotools that will replace @R_INCL@ with AC_SUBST(R_INCL).
However, AFAIK, I cannot do this on a Windows machine.  I am trying to
write the Makevars.win file to create the appropriate variables that I can
pass to the nvcc compiler.  Here is an excerpt:

R_INCL=`$(shell ${R_HOME}/bin/R CMD config --cppflags)`

CU_INCL = -I../inst/include $(R_INCL)

%.o: %.cu $(cu_sources)
$(NVCC) $(CU_ARCH) $(CU_ARGS) $(CU_INCL) $< -c


However, I keep getting a truncated output from the --cppflags output.  If
I run from the commandline R CMD config --cppflags I get:

-IC:/Users/cdeterman/Documents/R/R-3.3.2/include
-IC:/Users/cdeterman/Documents/R/R-3.3.2/include/x64

but when run in the build/install I get

-IC:/Users/CDETER~1/DOCUME~1/R/R-33~1.2/include
-IC:/Users/CDETER~1/DOCUME~1/R/R-33~1.2/include/x64

and the compliation fails saying that the
-IC:/Users/CDETER~1/DOCUME~1/R/R-33~1.2/include is not found whereas the
full path is found.

Any assistance is appreciated.

Regards,
Charles

	[[alternative HTML version deleted]]



More information about the R-package-devel mailing list