[Rcpp-commits] r974 - in pkg/RcppGsl: R inst/include src

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Sun Apr 4 10:20:42 CEST 2010


Author: romain
Date: 2010-04-04 10:20:41 +0200 (Sun, 04 Apr 2010)
New Revision: 974

Added:
   pkg/RcppGsl/src/RcppGsl.cpp
Modified:
   pkg/RcppGsl/R/zzz.R
   pkg/RcppGsl/inst/include/RcppGsl.h
   pkg/RcppGsl/src/Makevars
   pkg/RcppGsl/src/Makevars.win
Log:
some more content in RcppGsl

Modified: pkg/RcppGsl/R/zzz.R
===================================================================
--- pkg/RcppGsl/R/zzz.R	2010-04-04 08:00:18 UTC (rev 973)
+++ pkg/RcppGsl/R/zzz.R	2010-04-04 08:20:41 UTC (rev 974)
@@ -1 +1,5 @@
 .onLoad <- function(libname,pkgname){}
+
+test_gsl_vector <- function(){
+	.Call( "test_gsl_vector", PACKAGE = "RcppGsl" )
+}

Modified: pkg/RcppGsl/inst/include/RcppGsl.h
===================================================================
--- pkg/RcppGsl/inst/include/RcppGsl.h	2010-04-04 08:00:18 UTC (rev 973)
+++ pkg/RcppGsl/inst/include/RcppGsl.h	2010-04-04 08:20:41 UTC (rev 974)
@@ -10,7 +10,7 @@
 // under the terms of the GNU General Public License as published by
 // the Free Software Foundation, either version 2 of the License, or
 // (at your option) any later version.
-//
+//                           
 // RcppGsl is distributed in the hope that it will be useful, but
 // WITHOUT ANY WARRANTY; without even the implied warranty of
 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
@@ -23,7 +23,7 @@
 #define RCPPGSL__RCPPGSL_H
 
 #include <RcppCommon.h>
-#include <gsl_vector.h>
+#include <gsl/gsl_vector.h>
 
 /* forward declarations */
 namespace Rcpp{

Modified: pkg/RcppGsl/src/Makevars
===================================================================
--- pkg/RcppGsl/src/Makevars	2010-04-04 08:00:18 UTC (rev 973)
+++ pkg/RcppGsl/src/Makevars	2010-04-04 08:20:41 UTC (rev 974)
@@ -1,5 +1,5 @@
 ## Use the R_HOME indirection to support installations of multiple R version
-PKG_CPPFLAGS=$(shell $(R_HOME)/bin/Rscript --vanilla -e "Rcpp:::CxxFlags()" )
-PKG_LIBS = $(shell $(R_HOME)/bin/Rscript --vanilla -e "Rcpp:::LdFlags()" )
+PKG_CPPFLAGS=$(shell $(R_HOME)/bin/Rscript --vanilla -e "Rcpp:::CxxFlags()" ) -I../inst/include -I/usr/include
+PKG_LIBS = $(shell $(R_HOME)/bin/Rscript --vanilla -e "Rcpp:::LdFlags()" ) -L/usr/local/lib -lgsl 
 
 

Modified: pkg/RcppGsl/src/Makevars.win
===================================================================
--- pkg/RcppGsl/src/Makevars.win	2010-04-04 08:00:18 UTC (rev 973)
+++ pkg/RcppGsl/src/Makevars.win	2010-04-04 08:20:41 UTC (rev 974)
@@ -1,5 +1,5 @@
 ## This assume that we can call Rscript to ask Rcpp about its locations
 ## Use the R_HOME indirection to support installations of multiple R version
-PKG_CPPFLAGS=$(shell $(R_HOME)/bin/Rscript --vanilla -e "Rcpp:::CxxFlags()" )
+PKG_CPPFLAGS=$(shell $(R_HOME)/bin/Rscript --vanilla -e "Rcpp:::CxxFlags()" ) -I../inst/include
 PKG_LIBS = $(shell $(R_HOME)/bin/Rscript --vanilla -e "Rcpp:::LdFlags()" )
 

Added: pkg/RcppGsl/src/RcppGsl.cpp
===================================================================
--- pkg/RcppGsl/src/RcppGsl.cpp	                        (rev 0)
+++ pkg/RcppGsl/src/RcppGsl.cpp	2010-04-04 08:20:41 UTC (rev 974)
@@ -0,0 +1,8 @@
+#include <RcppGsl.h>
+
+extern "C" SEXP test_gsl_vector(){
+	gsl_vector * x = gsl_vector_alloc (10);
+	Rcpp::IntegerVector xx = Rcpp::wrap( *x ) ;
+	gsl_vector_free (x);
+	return xx ;
+}



More information about the Rcpp-commits mailing list