[Rcpp-devel] PKG_CXXFLAGS of Makevar

Dirk Eddelbuettel edd at debian.org
Thu May 3 17:12:36 CEST 2012


On 3 May 2012 at 10:52, Seungki Kim wrote:
| Hi,
| 
| I am using a Makevar file for Rcpp package. It's from [ Rcpp.package.skeleton(
| ) ] command.
| 
| I added something for GSL.
| 
| GSL_CFLAGS = `gsl-config --cflags`
| GSL_LIBS   = `gsl-config --libs`
| 
| PKG_CXXFLAGS= `${R_HOME}/bin/Rscript -e "Rcpp:::CxxFlags()"` $(GSL_CFLAGS)
| PKG_LIBS = `$(R_HOME)/bin/Rscript -e "Rcpp:::LdFlags()"` $(GSL_LIBS)

Try PKG_CFLAGS as in (all ?) our examples. It works reliably for me.

Also note that if you use 

  LinkingTo: Rcpp
  Depends: Rcpp (>= 0.9.8)

in DESCRIPTION of your package, you no longer need to call Rcpp:::CxxFlags()
as R takes care of that.  If you use the GSL, you do have find its headers as
you do here.

Dirk
 
| Then, PKG_LIBS is working well. But PKG_CXXFLAGS is not working well.
| 
| 
| 
| g++ -I/usr/share/R/include -DNDEBUG   -I"/usr/local/lib/R/site-library/Rcpp/
| include"  `/usr/lib64/R/bin/Rscript -e "Rcpp:::CxxFlags()"` `gsl-config
| --cflags` -fpic  -O3 -pipe  -g  -c rcpp_hello_world.cpp -o
| rcpp_hello_world.o
| 
| g++ -shared -o RcppTest.so rcpp_hello_world.o -L/usr/local/lib/R/site-library/
| Rcpp/lib -lRcpp -Wl,-rpath,/usr/local/lib/R/site-library/Rcpp/lib -L/usr/lib
| -lgsl -lgslcblas -lm -L/usr/lib64/R/lib -lR
| 
| 
| Why are these different? Am I using wrong?
| 
| Thank you,
| Seung
| 
| 
| ----------------------------------------------------------------------
| _______________________________________________
| Rcpp-devel mailing list
| Rcpp-devel at lists.r-forge.r-project.org
| https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/rcpp-devel
-- 
R/Finance 2012 Conference on May 11 and 12, 2012 at UIC in Chicago, IL
See agenda, registration details and more at http://www.RinFinance.com


More information about the Rcpp-devel mailing list