[Rcpp-commits] r3599 - in pkg/Rcpp: . inst inst/doc/Rcpp-FAQ
noreply at r-forge.r-project.org
noreply at r-forge.r-project.org
Wed May 9 14:51:42 CEST 2012
Author: edd
Date: 2012-05-09 14:51:42 +0200 (Wed, 09 May 2012)
New Revision: 3599
Modified:
pkg/Rcpp/ChangeLog
pkg/Rcpp/inst/NEWS
pkg/Rcpp/inst/doc/Rcpp-FAQ/Rcpp-FAQ.Rnw
Log:
added to 'R CMD SHLIB' discussion after email / suggestions from S?\195?\184ren H?\195?\184jsgaard
added new entry to state that non-standard code in ~/.Rprofile can break things
expanded compilers entry
mentioned Solaris issues
Modified: pkg/Rcpp/ChangeLog
===================================================================
--- pkg/Rcpp/ChangeLog 2012-05-09 02:38:33 UTC (rev 3598)
+++ pkg/Rcpp/ChangeLog 2012-05-09 12:51:42 UTC (rev 3599)
@@ -1,3 +1,9 @@
+2012-05-09 Dirk Eddelbuettel <edd at debian.org>
+
+ * inst/doc/Rcpp-FAQ/Rcpp-FAQ.Rnw: Expanded R CMD SHLIB discussion
+ after suggested changes from Søren Højsgaard; also expanded compiler
+ section a little mentioning clang/clang++ and icc.
+
2012-05-02 Dirk Eddelbuettel <edd at debian.org>
* src/Environment.cpp: Move one default argument to Environment.h
Modified: pkg/Rcpp/inst/NEWS
===================================================================
--- pkg/Rcpp/inst/NEWS 2012-05-09 02:38:33 UTC (rev 3598)
+++ pkg/Rcpp/inst/NEWS 2012-05-09 12:51:42 UTC (rev 3599)
@@ -7,6 +7,8 @@
o Support compilation in Cygwin thanks to a patch by Dario Buttari
+ o Small extensions to the Rcpp-FAQ
+
0.9.10 2012-02-16
o Rearrange headers so that Rcpp::Rcout can be used by RcppArmadillo et al
Modified: pkg/Rcpp/inst/doc/Rcpp-FAQ/Rcpp-FAQ.Rnw
===================================================================
--- pkg/Rcpp/inst/doc/Rcpp-FAQ/Rcpp-FAQ.Rnw 2012-05-09 02:38:33 UTC (rev 3598)
+++ pkg/Rcpp/inst/doc/Rcpp-FAQ/Rcpp-FAQ.Rnw 2012-05-09 12:51:42 UTC (rev 3599)
@@ -106,7 +106,10 @@
is also the name of its \proglang{C} language compiler) has to be used along
with the corresponding \texttt{g++} compiler for the \proglang{C++} language.
A minimal suitable version is a final 4.2.* release; earlier 4.2.* were
-lacking some \proglang{C++} features. Generally speaking, and as of early
+lacking some \proglang{C++} features (and even 4.2.1, still used on OS X, has
+issues).
+
+Generally speaking, and as of early
2011, the default compilers on all the common platforms are suitable.
Specific per-platform notes:
@@ -124,7 +127,14 @@
packages; the \texttt{r-base-dev} package on Debian and Ubuntu is an example.
\end{description}
+The \texttt{clang} and \texttt{clang++} compilers from the LLVM project can
+also be used as they are inter-operable with \texttt{gcc} et al. The
+\texttt{clang++} compiler is particularly interesting as it emits much more
+comprehensible error messages than \texttt{g++}.
+The Intel \texttt{icc} family has also been used successfully as its output
+files can also be combined with those from \texttt{gcc}.
+
\subsection{What other packages are useful ?}
Additional packages that we have found useful are
@@ -239,6 +249,7 @@
\proglang{R} expression. Several packages can be listed, separated by a comma.
\subsection{But I want to compile my code with R CMD SHLIB !}
+\label{using-r-cmd-shlib}
The recommended way is to create a package and follow \faq{make-package}. The
alternate recommendation is to use \pkg{inline} and follow \faq{using-inline}
@@ -246,15 +257,19 @@
However, some people have shown that they prefer not to follow recommended
guidelines and compile their code using the traditional \texttt{R CMD SHLIB}. To
-do this, we need to help \texttt{SHLIB} and let it know about the header files
+do so, we need to help \texttt{SHLIB} and let it know about the header files
that \pkg{Rcpp} provides and the \proglang{C++} library the code must link
against.
+On the Linux command-line, you can do the following:\newline
<<lang=bash>>=
$ export PKG_LIBS=`Rscript -e "Rcpp:::LdFlags()"`
$ export PKG_CXXFLAGS=`Rscript -e "Rcpp:::CxxFlags()"`
$ R CMD SHLIB myfile.cpp
@
+which first defines and exports two relevant environment variables which
+\texttt{R CMD SHLIB} then relies on. On other operating systems, appropriate
+settings may have to be used to define the environment variables.
This approach corresponds to the very earliest ways of building programs and
can still be found in some deprecated documents (as \textit{e.g.} some of
@@ -269,7 +284,21 @@
$ Rscript -e "Rcpp:::SHLIB('myfile.cpp')"
@
+\subsection{But R CMD SHLIB still does not work !}
+We have had reports in the past where build failures occurred when users had
+non-standard code in their \verb|~/.Rprofile| or \texttt{Rprofile.site} (or
+equivalent) files.
+
+If such code emits text on \texttt{stdout}, the frequent and implicit
+invocation of \texttt{Rscript -e "..."} (as in \faq{using-r-cmd-shlib}
+above) to retrieve settings directly from \pkg{Rcpp} will fail.
+
+You may need to uncomment such non-standard code, or protect it by wrapping
+it inside \texttt{if (interactive())}, or possibly try to use \texttt{Rscript
+ --vanilla} instead of plain \texttt{Rscript}.
+
+
\subsection{What about \texttt{LinkingTo} ?}
\proglang{R} has only limited support for cross-package linkage.
@@ -320,12 +349,13 @@
\subsection{Does \pkg{Rcpp} work on solaris/suncc ?}
-Yes.
+Yes, it generally does. But as we do not have access to such systems, some
+issues persist on the CRAN test systems.
\subsection{Does \pkg{Rcpp} work with Revolution R ?}
We have not tested it yet. \pkg{Rcpp} might need a few tweaks to work
-with the compilers used by Revolution R.
+with the compilers used by Revolution R (if those differ from the defaults).
\subsection{Is it related to CXXR ?}
More information about the Rcpp-commits
mailing list