[Rcpp-commits] r2780 - in pkg/Rcpp: . R inst/doc/Rcpp-FAQ

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Sun Dec 12 13:41:03 CET 2010


Author: romain
Date: 2010-12-12 13:41:03 +0100 (Sun, 12 Dec 2010)
New Revision: 2780

Added:
   pkg/Rcpp/R/SHLIB.R
Modified:
   pkg/Rcpp/ChangeLog
   pkg/Rcpp/DESCRIPTION
   pkg/Rcpp/inst/doc/Rcpp-FAQ/Rcpp-FAQ.Rnw
Log:
added Rcpp:::SHLIB

Modified: pkg/Rcpp/ChangeLog
===================================================================
--- pkg/Rcpp/ChangeLog	2010-12-12 11:43:50 UTC (rev 2779)
+++ pkg/Rcpp/ChangeLog	2010-12-12 12:41:03 UTC (rev 2780)
@@ -1,3 +1,8 @@
+2010-12-12  Romain Francois <romain at r-enthusiasts.com>
+
+    * R/SHLIB.R: new unexported R function SHLIB, small wrapper around 
+    R CMD SHLIB
+
 2010-12-10  Dirk Eddelbuettel  <edd at debian.org>
 
 	* inst/include/Rcpp/sprintf.h: Use vsnprintf() instead

Modified: pkg/Rcpp/DESCRIPTION
===================================================================
--- pkg/Rcpp/DESCRIPTION	2010-12-12 11:43:50 UTC (rev 2779)
+++ pkg/Rcpp/DESCRIPTION	2010-12-12 12:41:03 UTC (rev 2780)
@@ -1,6 +1,6 @@
 Package: Rcpp
 Title: Seamless R and C++ Integration
-Version: 0.8.9.3
+Version: 0.8.9.4
 Date: $Date$
 Author: Dirk Eddelbuettel and Romain Francois, 
  with contributions by Douglas Bates and John Chambers

Added: pkg/Rcpp/R/SHLIB.R
===================================================================
--- pkg/Rcpp/R/SHLIB.R	                        (rev 0)
+++ pkg/Rcpp/R/SHLIB.R	2010-12-12 12:41:03 UTC (rev 2780)
@@ -0,0 +1,32 @@
+# Copyright (C)        2010 Dirk Eddelbuettel and Romain Francois
+#
+# This file is part of Rcpp.
+#
+# Rcpp is free software: you can redistribute it and/or modify it
+# 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.
+#
+# Rcpp 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
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with Rcpp.  If not, see <http://www.gnu.org/licenses/>.
+               
+SHLIB.maker <- function(env = 
+    list( 
+        PKG_LIBS = Rcpp:::RcppLdFlags(), 
+        PKG_CPPFLAGS = Rcpp:::RcppCxxFlags()
+        )
+    ){
+    function(cmd = ""){
+        do.call( Sys.setenv, env )
+        R <- file.path( R.home(component = "bin"), "R"  )
+        system( sprintf( "%s CMD SHLIB %s", R, cmd ) )
+    }
+}    
+    
+SHLIB <- SHLIB.maker()
+

Modified: pkg/Rcpp/inst/doc/Rcpp-FAQ/Rcpp-FAQ.Rnw
===================================================================
--- pkg/Rcpp/inst/doc/Rcpp-FAQ/Rcpp-FAQ.Rnw	2010-12-12 11:43:50 UTC (rev 2779)
+++ pkg/Rcpp/inst/doc/Rcpp-FAQ/Rcpp-FAQ.Rnw	2010-12-12 12:41:03 UTC (rev 2780)
@@ -194,7 +194,14 @@
 recommended as there are tools and automation mechanisms that can do the work
 for you.
 
+An alternative, which might work better on Windows is to use the 
+unexported function \texttt{Rcpp:::SHLIB} :
 
+<<lang=bash>>=
+$ Rscript -e "Rcpp:::SHLIB('myfile.cpp')"
+@
+
+
 \subsection{What about \texttt{LinkingTo} ?}
 
 \proglang{R} has only limited support for cross-package linkage.



More information about the Rcpp-commits mailing list