Commit 28b41dba authored by Dirk Eddelbuettel's avatar Dirk Eddelbuettel

New upstream version 0.2.15

parent 5ed5444a
2019-03-05 Dirk Eddelbuettel <edd@debian.org>
* DESCRIPTION (Version, Date): New minor version
* src/RInside.cpp (initialize): Rewritten to use two (protected)
temporary variable to avoid any chance of allocation races [rchk]
* DESCRIPTION (Description): Edited linebreaks and wording
2018-12-26 Zé Vinícius <jvmirca@gmail.com>
* README.md: Correct typo in URL for Qt example
2018-09-02 Dirk Eddelbuettel <edd@debian.org>
* .travis.yml: Minor update to commented-out PPA for R 3.5
2018-06-14 François-David Collin <fradav@gmail.com>
* src/Makevars.win: Quote-protect path for Rscript
2017-08-17 Jonathon Love <jon@thon.cc>
* src/setenv/setenv.c: Extend backslash handling on Windows
2017-08-16 Jonathon Love <jon@thon.cc>
* src/RInside.cpp: On Windows, copy getenv("R_HOME") result
2017-04-28 Dirk Eddelbuettel <edd@debian.org>
* DESCRIPTION (Version): Release 0.2.14
2017-04-27 Dirk Eddelbuettel <edd@debian.org>
* .travis.yml: Switch to using run.sh for Travis CI
......
Package: RInside
Title: C++ Classes to Embed R in C++ Applications
Version: 0.2.14
Date: 2017-04-28
Version: 0.2.15
Date: 2019-03-06
Author: Dirk Eddelbuettel and Romain Francois
Maintainer: Dirk Eddelbuettel <edd@debian.org>
Description: C++ classes to embed R in C++ applications
The 'RInside' packages makes it easier to have "R inside" your C++ application
by providing a C++ wrapper class providing the R interpreter.
.
As R itself is embedded into your application, a shared library build of R
is required. This works on Linux, OS X and even on Windows provided you use
the same tools used to build R itself.
.
Numerous examples are provided in the eight subdirectories of the examples/
directory of the installed package: standard, mpi (for parallel computing)
qt (showing how to embed 'RInside' inside a Qt GUI application), wt (showing
how to build a "web-application" using the Wt toolkit), armadillo (for
'RInside' use with 'RcppArmadillo') and eigen (for 'RInside' use with 'RcppEigen').
The example use GNUmakefile(s) with GNU extensions, so a GNU make is required
(and will use the GNUmakefile automatically).
.
Doxygen-generated documentation of the C++ classes is available at the
'RInside' website as well.
A C++ class providing the R interpreter is offered by this package
making it easier to have "R inside" your C++ application. As R itself
is embedded into your application, a shared library build of R is
required. This works on Linux, OS X and even on Windows provided you
use the same tools used to build R itself. d Numerous examples are
provided in the eight subdirectories of the examples/ directory of
the installed package: standard, 'mpi' (for parallel computing), 'qt'
(showing how to embed 'RInside' inside a Qt GUI application), 'wt'
(showing how to build a "web-application" using the Wt toolkit),
'armadillo' (for 'RInside' use with 'RcppArmadillo') and 'eigen' (for
'RInside' use with 'RcppEigen'). The examples use 'GNUmakefile(s)'
with GNU extensions, so a GNU make is required (and will use the
'GNUmakefile' automatically). 'Doxygen'-generated documentation of
the C++ classes is available at the 'RInside' website as well.
Depends: R (>= 2.10.0)
Imports: Rcpp (>= 0.11.0)
LinkingTo: Rcpp
......@@ -31,6 +28,6 @@ BugReports: https://github.com/eddelbuettel/rinside/issues
MailingList: Please send questions and comments regarding RInside to
rcpp-devel@lists.r-forge.r-project.org
NeedsCompilation: yes
Packaged: 2017-04-28 11:46:12.919864 UTC; edd
Packaged: 2019-03-06 12:59:17.136291 UTC; edd
Repository: CRAN
Date/Publication: 2017-05-05 03:19:32 UTC
Date/Publication: 2019-03-06 15:32:49 UTC
1b0a7f03ab0147453cafcdc1e3fc279e *ChangeLog
d44601ea49b080e35a86f939a9af770a *DESCRIPTION
536b3bd9117395c42e757862c6e69b2a *ChangeLog
4b7f4e5ad4ddb726a6d9ef43b4edf2dd *DESCRIPTION
721b51fcc45ba3c8ff2290bc8f55f890 *NAMESPACE
6cc655a76514542527d297ddf6d64e31 *R/RInsidePaths.R
221b942b14cc416f187593b9a662d970 *R/zzz.R
e90c7389d761e4ed91b631e9ddadf2c1 *README.md
3612362fd51725b367c710e6ae734b57 *README.md
1f1bdb65f9a4a553cb4cc3574707ec26 *cleanup
a354953bc638adfe8fb1143a2428eb67 *cleanup.win
4123f294eef25a8626a54109dadb87a2 *inst/NEWS.Rd
7adb40da1087ebfe749513a3251c9e5e *inst/NEWS.Rd
6721423fd66ead7a6fd303e6ec8b4d49 *inst/THANKS
f80b0a9850ed5c911c690ec9f6520570 *inst/examples/armadillo/GNUmakefile
355f2e6af82135dac79496afd1ae57bc *inst/examples/armadillo/cmake/CMakeLists.txt
......@@ -96,10 +96,10 @@ a07df2e44b20f51d8b8f3b5d3fb02e15 *inst/include/RInside.h
193ebd47832d03c444c3f4d516915062 *inst/include/RInsideConfig.h
9bba313d3c86b9a8038d44704366bee2 *man/RInside-package.Rd
01b4603079d1372444c3aa1e638f59cb *src/Makevars
dae114d711c1c6c1b0fc72c58312c483 *src/Makevars.win
bfc3d61e790353312812f3caada0c950 *src/Makevars.win
c47d49883a572ae1efcc3f075875f8af *src/MemBuf.cpp
8d440d43da74904fff63adb0e8c1efe7 *src/RInside.cpp
c76997e46f501a21ce9a12a127452a7d *src/setenv/setenv.c
4ee4ede1901d0bfdf9382449feb50534 *src/RInside.cpp
d6e282694398aea01e7458f266691a17 *src/setenv/setenv.c
e0953bcb1cf6e7732945551f24f7b207 *src/tools/RInsideAutoloads.r
2f249ec71e383c2c3a501dc8d7be3925 *src/tools/RInsideEnvVars.r
595752b43220c0d19c9f2e2d755bb5c8 *src/tools/unix2dos.r
## RInside [![Build Status](https://travis-ci.org/eddelbuettel/rinside.svg)](https://travis-ci.org/eddelbuettel/rinside) [![License](http://img.shields.io/badge/license-GPL%20%28%3E=%202%29-brightgreen.svg?style=flat)](http://www.gnu.org/licenses/gpl-2.0.html) [![CRAN](http://www.r-pkg.org/badges/version/RInside)](https://cran.r-project.org/package=RInside) [![Downloads](http://cranlogs.r-pkg.org/badges/RInside?color=brightgreen)](https://cran.r-project.org/package=RInside)
## RInside [![Build Status](https://travis-ci.org/eddelbuettel/rinside.svg)](https://travis-ci.org/eddelbuettel/rinside) [![License](http://img.shields.io/badge/license-GPL%20%28%3E=%202%29-brightgreen.svg?style=flat)](http://www.gnu.org/licenses/gpl-2.0.html) [![CRAN](http://www.r-pkg.org/badges/version/RInside)](https://cran.r-project.org/package=RInside) [![Dependencies](https://tinyverse.netlify.com/badge/RInside)](https://cran.r-project.org/package=RInside) [![Downloads](http://cranlogs.r-pkg.org/badges/RInside?color=brightgreen)](https://cran.r-project.org/package=RInside)
Easy embedding of R inside C++
......@@ -39,7 +39,7 @@ this application for showing how to use R (to estimate densities) inside a C++ e
![](https://github.com/eddelbuettel/rinside/blob/master/local/qtdensitySVG.png)
The code is portable across operating systems. Similar, the
[Wt example directory](https://github.com/eddelbuettel/rinside/tree/master/inst/examples/qt)
[Wt example directory](https://github.com/eddelbuettel/rinside/tree/master/inst/examples/wt)
contains this C++-based web application doing the same:
![](https://github.com/eddelbuettel/rinside/blob/master/local/wtdensity.png)
......
......@@ -3,8 +3,22 @@
\newcommand{\ghpr}{\href{https://github.com/eddelbuettel/rinside/pull/#1}{##1}}
\newcommand{\ghit}{\href{https://github.com/eddelbuettel/rinside/issues/#1}{##1}}
\section{Changes in RInside version 0.2.15 (2019-03-06)}{
\itemize{
\item Improved Windows build support by copying
\code{getenv("R_HOME")} result and improving backslash handling in
environemt variable setting (Jonathon Love in \ghpr{27} and
\ghpr{28})
\item Improved Windows build support by quote-protecting
\code{Rscript} path in \code{Makevars.win} (François-David Collin in
\ghpr{33})
\item A URL was corrected in README.md (Zé Vinícius in \ghpr{34}).
\item Temporary \code{SEXP} objects are handled more carefully at
initialization to satisfy `rchk` (Dirk in \ghpr{36})
}
}
\section{Changes in RInside version 0.2.14 (2017-xx-yy)}{
\section{Changes in RInside version 0.2.14 (2017-04-28)}{
\itemize{
\item Interactive mode can use readline REPL (Łukasz Łaniewski-Wołłk
in \ghpr{25}, and Dirk in \ghpr{26})
......
......@@ -25,7 +25,7 @@ USERDIR = ../inst/lib$(R_ARCH)
PKG_CPPFLAGS = -I. -I../inst/include/
PKG_LIBS = $(shell "${R_HOME}/bin${R_ARCH_BIN}/Rscript.exe" -e "Rcpp:::LdFlags()")
RSCRIPT = ${R_HOME}/bin${R_ARCH_BIN}/Rscript.exe
RSCRIPT = "${R_HOME}/bin${R_ARCH_BIN}/Rscript.exe"
all: headers $(SHLIB) userLibrary
......
......@@ -3,7 +3,7 @@
// RInside.cpp: R/C++ interface class library -- Easier R embedding into C++
//
// Copyright (C) 2009 Dirk Eddelbuettel
// Copyright (C) 2010 - 2017 Dirk Eddelbuettel and Romain Francois
// Copyright (C) 2010 - 2019 Dirk Eddelbuettel and Romain Francois
//
// This file is part of RInside.
//
......@@ -35,6 +35,9 @@ const char *programName = "RInside";
// on Windows, we need to provide setenv which is in the file setenv.c here
#include "setenv/setenv.c"
extern int optind;
#include <windef.h>
char rHome[MAX_PATH];
#endif
RInside::~RInside() { // now empty as MemBuf is internal
......@@ -102,7 +105,7 @@ RInside::RInside(const int argc, const char* const argv[], const bool loadRcpp,
}
// TODO: use a vector<string> would make all this a bit more readable
void RInside::initialize(const int argc, const char* const argv[], const bool loadRcpp,
void RInside::initialize(const int argc, const char* const argv[], const bool loadRcpp,
const bool verbose, const bool interactive) {
if (instance_m) {
......@@ -125,8 +128,8 @@ void RInside::initialize(const int argc, const char* const argv[], const bool lo
char *rhome = get_R_HOME(); // query it, including registry
if (rhome != NULL) { // if something was found
setenv("R_HOME", get_R_HOME(), 1); // store what we got as R_HOME
} // this will now be used in next blocks
}
} // this will now be used in next blocks
}
#endif
for (int i = 0; R_VARS[i] != NULL; i+= 2) {
......@@ -145,7 +148,7 @@ void RInside::initialize(const int argc, const char* const argv[], const bool lo
init_tempdir();
const char *R_argv[] = {(char*)programName, "--gui=none", "--no-save",
const char *R_argv[] = {(char*)programName, "--gui=none", "--no-save",
"--silent", "--vanilla", "--slave", "--no-readline"};
int R_argc = sizeof(R_argv) / sizeof(R_argv[0]);
if (interactive_m) R_argc--; //Deleting the --no-readline option in interactive mode
......@@ -161,7 +164,11 @@ void RInside::initialize(const int argc, const char* const argv[], const bool lo
R_DefParams(&Rst);
Rst.R_Interactive = (Rboolean) interactive_m; // sets interactive() to eval to false
#ifdef _WIN32
Rst.rhome = getenv("R_HOME"); // which is set above as part of R_VARS
char *temp = getenv("R_HOME"); // which is set above as part of R_VARS
strncpy(rHome, temp, MAX_PATH);
Rst.rhome = rHome;
Rst.home = getRUser();
Rst.CharacterMode = LinkDLL;
Rst.ReadConsole = myReadConsole;
......@@ -174,15 +181,21 @@ void RInside::initialize(const int argc, const char* const argv[], const bool lo
R_SetParams(&Rst);
if (true || loadRcpp) { // we always need Rcpp, so load it anyway
// Rf_install is used best by first assigning like this so that symbols get into the symbol table
// where they cannot be garbage collected; doing it on the fly does expose a minuscule risk of garbage
// collection -- with thanks to Doug Bates for the explanation and Luke Tierney for the heads-up
// Rf_install is used best by first assigning like this so that symbols get into
// the symbol table where they cannot be garbage collected; doing it on the fly
// does expose a minuscule risk of garbage collection -- with thanks to Doug Bates
// for the explanation and Luke Tierney for the heads-up
SEXP suppressMessagesSymbol = Rf_install("suppressMessages");
SEXP requireSymbol = Rf_install("require");
Rf_eval(Rf_lang2(suppressMessagesSymbol, Rf_lang2(requireSymbol, Rf_mkString("Rcpp"))), R_GlobalEnv);
SEXP reqsymlang, langobj;
// Protect temporaries as suggested by 'rchk', with thanks to Tomas Kalibera
PROTECT(reqsymlang = Rf_lang2(requireSymbol, Rf_mkString("Rcpp")));
PROTECT(langobj = Rf_lang2(suppressMessagesSymbol, reqsymlang));
Rf_eval(langobj, R_GlobalEnv);
UNPROTECT(2);
}
global_env_m = new Rcpp::Environment(); // member variable for access to R's global environment
global_env_m = new Rcpp::Environment(); // member variable for access to R's global environment
autoloads(); // loads all default packages, using code autogenerate from Makevars{,.win}
......@@ -216,10 +229,10 @@ void RInside::init_tempdir(void) {
void RInside::init_rand(void) { // code borrows from R's TimeToSeed() in datetime.c
unsigned int pid = getpid();
struct timeval tv; // this is ifdef'ed by R, we just assume we have it
struct timeval tv; // this is ifdef'ed by R, we just assume we have it
gettimeofday (&tv, NULL);
unsigned int seed = ((uint64_t) tv.tv_usec << 16) ^ tv.tv_sec;
seed ^= (pid << 16); // R 2.14.0 started to also use pid to support parallel
seed ^= (pid << 16); // R 2.14.0 started to also use pid to support parallel
srand(seed);
}
......@@ -512,5 +525,3 @@ void RInside::set_callbacks(Callbacks* callbacks_){
}
#endif
......@@ -60,8 +60,16 @@ extern "C" int setenv(const char *env_var, const char *env_val, int dummy) {
}
if(!inquote && *p == '\\') {
if(*(p+1) == '\n') p++;
else if(*(p+1) == '\\') *q++ = *p;
if(*(p+1) == '\n') {
p++;
}
else if(*(p+1) == '\\') {
*q++ = '/';
p++;
}
else {
*q++ = '/';
}
continue;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment