[Rcpp-commits] r2615 - in pkg/RcppGSL: R inst/skeleton

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Tue Nov 30 12:51:34 CET 2010


Author: romain
Date: 2010-11-30 12:51:34 +0100 (Tue, 30 Nov 2010)
New Revision: 2615

Modified:
   pkg/RcppGSL/R/inline.R
   pkg/RcppGSL/inst/skeleton/Makevars
   pkg/RcppGSL/inst/skeleton/Makevars.win
Log:
attempting to support package.skeleton through the RcppGSL:::LdFlags and RcppGSL:::CFlags

Modified: pkg/RcppGSL/R/inline.R
===================================================================
--- pkg/RcppGSL/R/inline.R	2010-11-30 11:41:26 UTC (rev 2614)
+++ pkg/RcppGSL/R/inline.R	2010-11-30 11:51:34 UTC (rev 2615)
@@ -66,28 +66,28 @@
 }
        
 
-LdFlags <- function(){
+LdFlags <- function( print = TRUE ){
     if( ! know_flags ) {
         get_gsl_flags()
     }
-    gsl_libs
+    if( print) cat( gsl_libs ) else gsl_libs
 }
 
-CFlags <- function(){
+CFlags <- function( print = TRUE){
     if( ! know_flags ) {
         get_gsl_flags()
     }
-    gsl_cflags
+    if( print ) cat( gsl_cflags ) else gsl_cflags
 }
 
 inlineCxxPlugin <- function(...) {
     plugin <- Rcpp:::Rcpp.plugin.maker(
         include.before = "#include <RcppGSL.h>",
-        libs = sprintf( "%s $(LAPACK_LIBS) $(BLAS_LIBS) $(FLIBS)", LdFlags() ),
+        libs = sprintf( "%s $(LAPACK_LIBS) $(BLAS_LIBS) $(FLIBS)", LdFlags(FALSE) ),
         package = "RcppGSL"
     )
     settings <- plugin()
-    settings$env$PKG_CPPFLAGS <- CFlags()
+    settings$env$PKG_CPPFLAGS <- CFlags(FALSE)
     settings
 }
 

Modified: pkg/RcppGSL/inst/skeleton/Makevars
===================================================================
--- pkg/RcppGSL/inst/skeleton/Makevars	2010-11-30 11:41:26 UTC (rev 2614)
+++ pkg/RcppGSL/inst/skeleton/Makevars	2010-11-30 11:51:34 UTC (rev 2615)
@@ -1 +1,9 @@
 
+GSL_CFLAGS = `$(R_HOME)/bin/Rscript -e "RcppGSL:::CFlags()"`
+GSL_LIBS   = `$(R_HOME)/bin/Rscript -e "RcppGSL:::LdFlags()"`
+RCPP_LDFLAGS = `$(R_HOME)/bin/Rscript -e "Rcpp:::LdFlags()"`
+
+# combine with standard arguments for R
+PKG_CPPFLAGS = -W $(GSL_CFLAGS) -I../inst/include
+PKG_LIBS += $(GSL_LIBS) $(RCPP_LDFLAGS)
+

Modified: pkg/RcppGSL/inst/skeleton/Makevars.win
===================================================================
--- pkg/RcppGSL/inst/skeleton/Makevars.win	2010-11-30 11:41:26 UTC (rev 2614)
+++ pkg/RcppGSL/inst/skeleton/Makevars.win	2010-11-30 11:51:34 UTC (rev 2615)
@@ -1 +1,3 @@
+PKG_CPPFLAGS=-I$(LIB_GSL)/include -I../inst/include
+PKG_LIBS=-L$(LIB_GSL)/lib -lgsl -lgslcblas $(shell "${R_HOME}/bin${R_ARCH_BIN}/Rscript.exe" -e "Rcpp:::LdFlags()")
 



More information about the Rcpp-commits mailing list