[Rcpp-commits] r2630 - pkg/RcppGSL/inst/doc/RcppGSL

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Tue Nov 30 20:48:24 CET 2010


Author: romain
Date: 2010-11-30 20:48:23 +0100 (Tue, 30 Nov 2010)
New Revision: 2630

Modified:
   pkg/RcppGSL/inst/doc/RcppGSL/RcppGSL.Rnw
Log:
mention the version of configure that uses RcppGSL functions

Modified: pkg/RcppGSL/inst/doc/RcppGSL/RcppGSL.Rnw
===================================================================
--- pkg/RcppGSL/inst/doc/RcppGSL/RcppGSL.Rnw	2010-11-30 19:38:02 UTC (rev 2629)
+++ pkg/RcppGSL/inst/doc/RcppGSL/RcppGSL.Rnw	2010-11-30 19:48:23 UTC (rev 2630)
@@ -562,6 +562,8 @@
 
 \subsection{The \texttt{configure} script}
 
+\subsubsection{Using autoconf}
+
 Using \pkg{RcppGSL} means employing both the \pkg{GSL} and \proglang{R}. We
 may need to find the location of the \pkg{GSL} headers and library, and this
 done easily from a \texttt{configure} source script which \texttt{autoconf}
@@ -598,7 +600,37 @@
 Such a source \texttt{configure.in} gets converted into a script
 \texttt{configure} by invoking the \texttt{autoconf} program.
 
+\subsubsection{Using functions provided by RcppGSL}
 
+\pkg{RcppGSL} provides R functions that allows one to retrieve the same 
+information. Therefore the configure script can also be written as: 
+
+<<lang=bash>>=
+#!/bin/sh
+
+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()"`
+
+sed -e "s|@GSL_LIBS@|${GSL_LIBS}|" \
+    -e "s|@GSL_CFLAGS@|${GSL_CFLAGS}|" \
+    -e "s|@RCPP_LDFLAGS@|${RCPP_LDFLAGS}|" \
+    src/Makevars.in > src/Makevars
+@
+
+Similarly, the configure.win for windows can be written as: 
+
+<<lang=bash>>=
+GSL_CFLAGS=`${R_HOME}/bin${R_ARCH_BIN}/Rscript.exe -e "RcppGSL:::CFlags()"`
+GSL_LIBS=`${R_HOME}/bin${R_ARCH_BIN}/Rscript.exe -e "RcppGSL:::LdFlags()"`
+RCPP_LDFLAGS=`${R_HOME}/bin${R_ARCH_BIN}/Rscript.exe -e "Rcpp:::LdFlags()"`
+
+sed -e "s|@GSL_LIBS@|${GSL_LIBS}|" \
+    -e "s|@GSL_CFLAGS@|${GSL_CFLAGS}|" |
+    -e "s|@RCPP_LDFLAGS@|${RCPP_LDFLAGS}|" \
+    src/Makevars.in > src/Makevars.win
+@
+
 \subsection{The \texttt{src} directory}
 
 The \proglang{C++} source file takes the matrix supplied from \proglang{R}



More information about the Rcpp-commits mailing list