Re: [Rcpp-devel] Specify Rcpp header location in Makevars
You need LinkingTo: Rcpp As per the current documentation. Romain Envoyé de mon iPhone Le 29 juil. 2015 à 17:19, jsmith5...@yahoo.com jsmith5...@yahoo.com a écrit : Hi, Is there a way to automatically specify the location of the Rcpp include directory (for Rcpp.h) in Makevars? In my Makevars, I use the following compile command: %.o: %.cpp $(cpp_sources) $(CXX) $(PKG_CXXFLAGS) $ I also specified Imports: Rcpp in DESCRIPTION, but it does not appear to automatically add the right flags to the compile command. I am looking for something that could work similarly to Rscript -e Rcpp:::LdFlags(), which used to export the Rcpp library flags. Any ideas are greatly appreciated! Thanks! Lutz ___ Rcpp-devel mailing list Rcpp-devel@lists.r-forge.r-project.org https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/rcpp-devel ___ Rcpp-devel mailing list Rcpp-devel@lists.r-forge.r-project.org https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/rcpp-devel
[Rcpp-devel] Specify Rcpp header location in Makevars
Hi, Is there a way to automatically specify the location of the Rcpp include directory (for Rcpp.h) in Makevars? In my Makevars, I use the following compile command: %.o: %.cpp $(cpp_sources) $(CXX) $(PKG_CXXFLAGS) $ I also specified Imports: Rcpp in DESCRIPTION, but it does not appear to automatically add the right flags to the compile command. I am looking for something that could work similarly to Rscript -e Rcpp:::LdFlags(), which used to export the Rcpp library flags. Any ideas are greatly appreciated! Thanks! Lutz ___ Rcpp-devel mailing list Rcpp-devel@lists.r-forge.r-project.org https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/rcpp-devel
Re: [Rcpp-devel] Specify Rcpp header location in Makevars
Thanks Dirk and Romain for your comments! CLINK_CPPFLAGS did the trick. Dirk, I understand that it might seem sub-optimal to define my own compile commands: part of my project is in cuda for GPU-based parallelization, and I manually set the compile commands to compile my cuda source files with nvcc and the c++ source files with the default compiler. If there is a more elegant or a more robust way to integrate c++ and cuda sources in one project, I'd be delighted to hear about it; for now my Makevars-based approach gets the job done. Thanks again! Lutz On 07/29/2015 09:16 PM, Dirk Eddelbuettel wrote: On 29 July 2015 at 17:19, jsmith5...@yahoo.com wrote: | Is there a way to automatically specify the location of the Rcpp include | directory (for Rcpp.h) in Makevars? As Romain said, add LinkingTo: Rcpp to your DESCRIPTION. | In my Makevars, I use the following compile command: | | %.o: %.cpp $(cpp_sources) | $(CXX) $(PKG_CXXFLAGS) $ This is generally not a good idea. The advise in Writing R Extensions is not as clear-cut on this as it might be but there were e.g. some comments by Simon on this list (or maybe r-devel). In general, you want your Makevars to be as minimal as possibly as these implicit rules __already__ come in via the core Makefile parts provided by R. You are more likely to do harm than good here (and yes, I got burned too in the past). | I also specified Imports: Rcpp in DESCRIPTION, but it does not appear | to automatically add the right flags to the compile command. | | I am looking for something that could work similarly to Rscript -e | Rcpp:::LdFlags(), which used to export the Rcpp library flags. | | Any ideas are greatly appreciated! The best best may be to start with Rcpp.package.skeleton() and see what it creates. Cheers, Dirk ___ Rcpp-devel mailing list Rcpp-devel@lists.r-forge.r-project.org https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/rcpp-devel
Re: [Rcpp-devel] Specify Rcpp header location in Makevars
On 29 July 2015 at 17:19, jsmith5...@yahoo.com wrote: | Is there a way to automatically specify the location of the Rcpp include | directory (for Rcpp.h) in Makevars? As Romain said, add LinkingTo: Rcpp to your DESCRIPTION. | In my Makevars, I use the following compile command: | | %.o: %.cpp $(cpp_sources) | $(CXX) $(PKG_CXXFLAGS) $ This is generally not a good idea. The advise in Writing R Extensions is not as clear-cut on this as it might be but there were e.g. some comments by Simon on this list (or maybe r-devel). In general, you want your Makevars to be as minimal as possibly as these implicit rules __already__ come in via the core Makefile parts provided by R. You are more likely to do harm than good here (and yes, I got burned too in the past). | I also specified Imports: Rcpp in DESCRIPTION, but it does not appear | to automatically add the right flags to the compile command. | | I am looking for something that could work similarly to Rscript -e | Rcpp:::LdFlags(), which used to export the Rcpp library flags. | | Any ideas are greatly appreciated! The best best may be to start with Rcpp.package.skeleton() and see what it creates. Cheers, Dirk -- http://dirk.eddelbuettel.com | @eddelbuettel | e...@debian.org ___ Rcpp-devel mailing list Rcpp-devel@lists.r-forge.r-project.org https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/rcpp-devel