[R] How to make sure R's g++ compiler uses certain C++ flags when making a package

From: Solomon Messing <messing_at_stanford.edu>
Date: Mon, 14 Mar 2011 23:26:07 -0700


I am trying to use some code from opencv in an r package, using Rcpp to build the package. When I compile the c code on my machine, it works fine. However, when I try to include it in my package, it gives me a bunch of error messages like:

"error: opencv2/core/operations.hpp: No such file or directory"

Does anyone know how to get R to compile the C code as my command line g++ compiler does?

For example, I am using the the following syntax to compile the facedetect.cpp code:

g++ -bind_at_load `pkg-config --cflags opencv` facedetect.cpp -o facedetect `pkg-config --libs opencv` The key are the flags that point the compiler to the opencv package. How can I get R to use those same flags when it compiles the C code? Unfortunately I could not find the answer via google or the Writing R Extensions manual. My apologies if I missed something obvious. Thank you -Solomon

        [[alternative HTML version deleted]]



R-help_at_r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. Received on Tue 15 Mar 2011 - 07:45:23 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Wed 16 Mar 2011 - 21:50:21 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.

list of date sections of archive