[Rinside-commits] r214 - in pkg: . inst/examples/qt inst/examples/standard

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Sun Nov 20 22:37:17 CET 2011


Author: edd
Date: 2011-11-20 22:37:16 +0100 (Sun, 20 Nov 2011)
New Revision: 214

Modified:
   pkg/ChangeLog
   pkg/inst/examples/qt/qtdensity.pro
   pkg/inst/examples/standard/rinside_module_sample0.cpp
   pkg/inst/examples/standard/rinside_sample11.cpp
Log:
small correction to Qt .pro file affecting link order (needed with g++-4.6)
only whitespace/indent changes on sample files


Modified: pkg/ChangeLog
===================================================================
--- pkg/ChangeLog	2011-07-30 20:50:03 UTC (rev 213)
+++ pkg/ChangeLog	2011-11-20 21:37:16 UTC (rev 214)
@@ -1,3 +1,7 @@
+2011-11-20  Dirk Eddelbuettel  <edd at debian.org>
+
+	* inst/examples/qt/qtdensity.pro: Use QMAKE_LIBS, not QMAKE_LFLAGS
+
 2011-04-24  Dirk Eddelbuettel  <edd at debian.org>
 
 	* DESCRIPTION: Release 0.2.4

Modified: pkg/inst/examples/qt/qtdensity.pro
===================================================================
--- pkg/inst/examples/qt/qtdensity.pro	2011-07-30 20:50:03 UTC (rev 213)
+++ pkg/inst/examples/qt/qtdensity.pro	2011-11-20 21:37:16 UTC (rev 214)
@@ -25,7 +25,7 @@
 RLAPACK = 		$$system($$R_HOME/bin/R CMD config LAPACK_LIBS)
 
 ## if you need to set an rpath to R itself, also uncomment
-#RRPATH =		-Wl,-rpath,$$R_HOME/lib
+RRPATH =		-Wl,-rpath,$$R_HOME/lib
 
 ## include headers and libraries for Rcpp interface classes
 RCPPINCL = 		$$system($$R_HOME/bin/Rscript -e \'Rcpp:::CxxFlags\(\)\')
@@ -43,7 +43,7 @@
 
 ## compiler etc settings used in default make rules
 QMAKE_CXXFLAGS +=	$$RCPPWARNING $$RCPPFLAGS $$RCPPINCL $$RINSIDEINCL
-QMAKE_LFLAGS +=         $$RLDFLAGS $$RBLAS $$RLAPACK $$RCPPLIBS $$RINSIDELIBS
+QMAKE_LIBS +=           $$RLDFLAGS $$RBLAS $$RLAPACK $$RCPPLIBS $$RINSIDELIBS
 
 ## addition clean targets
 QMAKE_CLEAN +=		qtdensity Makefile

Modified: pkg/inst/examples/standard/rinside_module_sample0.cpp
===================================================================
--- pkg/inst/examples/standard/rinside_module_sample0.cpp	2011-07-30 20:50:03 UTC (rev 213)
+++ pkg/inst/examples/standard/rinside_module_sample0.cpp	2011-11-20 21:37:16 UTC (rev 214)
@@ -8,19 +8,19 @@
 
 // a c++ function we wish to expose to R
 const char* hello( std::string who ){
-        std::string result( "hello " ) ;
-        result += who ;
-        return result.c_str() ;
+    std::string result( "hello " ) ;
+    result += who ;
+    return result.c_str() ;
 } 
 
 RCPP_MODULE(bling){
-	using namespace Rcpp ;
-	function( "hello", &hello );
+    using namespace Rcpp ;
+    function( "hello", &hello );
 }
 
 int main(int argc, char *argv[]) {
 
-	// create an embedded R instance -- and load Rcpp so that modules work
+    // create an embedded R instance -- and load Rcpp so that modules work
     RInside R(argc, argv, true);               
         
     // load the bling module

Modified: pkg/inst/examples/standard/rinside_sample11.cpp
===================================================================
--- pkg/inst/examples/standard/rinside_sample11.cpp	2011-07-30 20:50:03 UTC (rev 213)
+++ pkg/inst/examples/standard/rinside_sample11.cpp	2011-11-20 21:37:16 UTC (rev 214)
@@ -7,27 +7,27 @@
 
 int main(int argc, char *argv[]) {
 
-    // create an embedded R instance
-    RInside R(argc, argv);               
+  // create an embedded R instance
+  RInside R(argc, argv);               
 
-    // evaluate an R expression with curve() 
-    // because RInside defaults to interactive=false we use a file
-    std::string cmd = "tmpf <- tempfile('curve'); "  
-                      "png(tmpf); "
-                      "curve(x^2, -10, 10, 200); "
-                      "dev.off();"
-                      "tmpf";
-    // by running parseEval, we get the last assignment back, here the filename
-    std::string tmpfile = R.parseEval(cmd);
+  // evaluate an R expression with curve() 
+  // because RInside defaults to interactive=false we use a file
+  std::string cmd = "tmpf <- tempfile('curve'); "  
+    "png(tmpf); "
+    "curve(x^2, -10, 10, 200); "
+    "dev.off();"
+    "tmpf";
+  // by running parseEval, we get the last assignment back, here the filename
+  std::string tmpfile = R.parseEval(cmd);
 
-    std::cout << "Could now use plot in " << tmpfile << std::endl;
-    unlink(tmpfile.c_str());		// cleaning up
+  std::cout << "Could now use plot in " << tmpfile << std::endl;
+  unlink(tmpfile.c_str());		// cleaning up
 
-    // alternatively, by forcing a display we can plot to screen
-    cmd = "x11(); curve(x^2, -10, 10, 200); Sys.sleep(30);";
-    // parseEvalQ evluates without assignment
-    R.parseEvalQ(cmd);
+  // alternatively, by forcing a display we can plot to screen
+  cmd = "x11(); curve(x^2, -10, 10, 200); Sys.sleep(30);";
+  // parseEvalQ evluates without assignment
+  R.parseEvalQ(cmd);
     
-    exit(0);
+  exit(0);
 }
 



More information about the Rinside-commits mailing list