Re: [Rcpp-devel] Rcpp::sourceCpp Problem with R 4.3 update

2023-05-30 Thread Kevin Ushey
I'm also not able to reproduce, but I see a different linker invocation: g++ -shared -static-libgcc -o sourceCpp_3.dll tmp.def file43185fe94049.o -LC:/rtools43/x86_64-w64-mingw32.static.posix/lib/x64 -LC:/rtools43/x86_64-w64-mingw32.static.posix/lib -LC:/R/R-43~1.0/bin/x64 -lR In particular,

Re: [Rcpp-devel] Problem with RCPP Paralell

2023-02-27 Thread Kevin Ushey
On Thu, Feb 23, 2023 at 11:34 AM Kevin Ushey wrote: > > Hi Roberto, > > (RcppParallel maintainer here.) We had some correspondence with > Professor Ripley regarding this; package authors affected by this > could request the C++14 standard in their package as described here:

Re: [Rcpp-devel] Problem with RCPP Paralell

2023-02-23 Thread Kevin Ushey
Hi Roberto, (RcppParallel maintainer here.) We had some correspondence with Professor Ripley regarding this; package authors affected by this could request the C++14 standard in their package as described here: https://cran.r-project.org/doc/manuals/R-exts.html#Using-C_002b_002b-code I believe

Re: [Rcpp-devel] Something strange with the package check and calls to C abort

2022-10-31 Thread Kevin Ushey
For posterity, what machine are you compiling the package on? If you're using a modern Linux system, it's possible the default compilation flags are including stack protection code during compilation that might call abort on error. See e.g.

Re: [Rcpp-devel] RCPP_USE_UNWIND_PROTECT by default

2022-02-06 Thread Kevin Ushey
+ level, UnwindProtect() isn't the right tool -- you'll want a proper tryCatch() handler. It does also imply (as had been shown) that switching to unwind-protect would be a behavior change in Rcpp, which may not be ideal. Thanks, Kevin On Sun, Feb 6, 2022 at 9:39 AM Jeroen Ooms wrote: > On

Re: [Rcpp-devel] RCPP_USE_UNWIND_PROTECT by default

2022-02-06 Thread Kevin Ushey
And I'm seeing you pointed that out at the end of the README... so yes, we should probably just have our exception inherit from std::exception. On Sun, Feb 6, 2022 at 9:31 AM Dirk Eddelbuettel wrote: > > On 6 February 2022 at 18:18, Jeroen Ooms wrote: > | Well not really, this kind of misses my

Re: [Rcpp-devel] RCPP_USE_UNWIND_PROTECT by default

2022-02-06 Thread Kevin Ushey
oks like the exception can be caught -- just not via std::exception. On Sun, Feb 6, 2022 at 9:21 AM Kevin Ushey wrote: > Is it possible the issue here is ultimately just that our > LongjumpException class doesn't inherit from std::exception? > > On Sun, Feb 6, 2022 at 9:18 AM Jer

Re: [Rcpp-devel] RCPP_USE_UNWIND_PROTECT by default

2022-02-06 Thread Kevin Ushey
Is it possible the issue here is ultimately just that our LongjumpException class doesn't inherit from std::exception? On Sun, Feb 6, 2022 at 9:18 AM Jeroen Ooms wrote: > On Sun, Feb 6, 2022 at 5:56 PM Dirk Eddelbuettel wrote: > > > > > > On 6 February 2022 at 17:40, Jeroen Ooms wrote: > > |

Re: [Rcpp-devel] Limit of 20

2021-12-15 Thread Kevin Ushey
I assume we're talking about Vector::create()? Anyone curious poking at it can start by looking here: https://github.com/RcppCore/Rcpp/blob/940fb23868bf442e587994451e85263baa302d9c/inst/include/Rcpp/vector/Vector.h#L1122-L1126 On Wed, Dec 15, 2021 at 8:51 AM Dirk Eddelbuettel wrote: > >

Re: [Rcpp-devel] Rcpp::plugins - Unwinding protection

2021-12-03 Thread Kevin Ushey
I'm a fan. I think we could just have a single header RcppLite.h which would turn off the "heaviest" pieces of Rcpp; that is, modules + sugar + (maybe?) RTTI. Or, we could allow for #define RCPP_LEAN_AND_MEAN ... ;-) On Fri, Dec 3, 2021 at 10:57 AM Dirk Eddelbuettel wrote: > > > On 3 December

Re: [Rcpp-devel] template argument deduction/substitution failed

2021-06-12 Thread Kevin Ushey
I think you're bumping into the 20 argument limit for our (now rather old) Vector::create() implementation. I thought we also had a variadic C++11 version for this, but apparently I am mistaken... A workaround is to use something like the ListBuilder class I put together a while back here:

Re: [Rcpp-devel] How to properly check if a String has only ASCII characters in Rcpp?

2021-02-18 Thread Kevin Ushey
On Thu, Feb 18, 2021 at 1:36 AM Andrade Solomon wrote: > > Dear list, > > I see here that Rccp strings have both a get_encoding() and a set_encoding() > member functions, which respectively return and accept a cetype_t enum > defined in Rinternals.h with options: > CE_NATIVE = 0, >

Re: [Rcpp-devel] AddressSanitizer: stack-use-after-scope Error

2020-11-16 Thread Kevin Ushey
Are you able to share a reproducible example? The CRAN check report from https://www.stats.ox.ac.uk/pub/bdr/memtests/clang-ASAN/MatchIt/00check.log points at MatchIt/src/nnm.cpp:182:24. You could probably distill the code used in that location into a smaller reproducible example. Best, Kevin On

Re: [Rcpp-devel] Install failure undefined symbol

2020-06-11 Thread Kevin Ushey
The most likely cause here is that, even though Rcpp is being compiled with gcc 9.2.0, an older version of libstdc++ is being found and used at runtime, and that version of the libstdc++ library doesn't provide the requested symbol (_ZTVN10__cxxabiv120__si_class_type_infoE). Best guess:

Re: [Rcpp-devel] Rcpp::traits::is_inifinite - PosInf vs. NegInf

2020-05-25 Thread Kevin Ushey
FWIW, the implementation of of is_finite lives here: https://github.com/RcppCore/Rcpp/blob/b1254701a899cb187f9a6917cb8d18c7f93290c7/inst/include/Rcpp/traits/is_infinite.h#L34-L37 I would recommend checking equality directly against the R constants `R_PosInf` and `R_NegInf`. As for whether this

Re: [Rcpp-devel] Cannot run rcpp due to missing include file(s)

2020-05-03 Thread Kevin Ushey
> In file included from /usr/local/include/math.h:8: The problem here is you have a bunch of headers in /usr/local/include that are shadowing / overriding the "normal" system header files; /usr/local/include/math.h being one of these (but I imagine there's more). To work around this, you'll have

Re: [Rcpp-devel] gcc 10 error: symbol `fun' is already defined

2020-02-08 Thread Kevin Ushey
://godbolt.org/z/dowsE5 But gcc trunk seems okay. Best, Kevin On Sat, Feb 8, 2020 at 5:20 PM Dirk Eddelbuettel wrote: > > > On 8 February 2020 at 16:59, Kevin Ushey wrote: > | It seems like a bug in gcc 10 to me. IIUC, static local variables in > | inline functions should still have i

Re: [Rcpp-devel] gcc 10 error: symbol `fun' is already defined

2020-02-08 Thread Kevin Ushey
It seems like a bug in gcc 10 to me. IIUC, static local variables in inline functions should still have internal linkage, and so name collisions like this should not occur. I can work around this by making sure that 'fun' is given different names in the RcppEigen stubs; e.g. fun1 and fun2 and so

Re: [Rcpp-devel] Rcpp::exception + threads = disaster

2020-02-08 Thread Kevin Ushey
On Sat, Feb 8, 2020 at 12:52 PM Joshua N Pritikin wrote: > > On Sat, Feb 08, 2020 at 03:47:49PM -0500, JJ Allaire wrote: > >On Sat, Feb 8, 2020 at 3:45 PM Joshua N Pritikin > ><[1]jpriti...@pobox.com> wrote: > > Sure, but does it *have* to be that way? It seems to me that > >

Re: [Rcpp-devel] R/C++ post on R Devel Blog

2019-04-04 Thread Kevin Ushey
I think Tomas's post is clear and quite helpful, I just disagree with the conclusions. IMHO C++ (through Rcpp) is still the best way to interface with R from compiled code for the majority of users. Tomas's comments were mainly around the fact that things can go wrong if you start mixing R

Re: [Rcpp-devel] Debugging intermittant vignette re-building failure

2019-01-09 Thread Kevin Ushey
In general, once an Rcpp API gives you a SEXP, it is unprotected and the onus is on your to manage its protection. In your code: SEXP intSexp = call1.eval(); Language call2("levels",facSexp); SEXP levelsSexp = call2.eval(); vals = as< std::vector

Re: [Rcpp-devel] Different Rcout object for each translation unit

2018-12-03 Thread Kevin Ushey
I think this might be worth fixing on the Rcpp side -- there should really only be one instance of the Rcout object. Would you mind filing an issue at https://github.com/RcppCore/Rcpp/issues, so we don't lose track of this? You could of course just create your own Rcout / Rcerr objects as well

Re: [Rcpp-devel] Subsetter uses int for indexing (among other issues)?

2018-11-07 Thread Kevin Ushey
I agree we should be using R_xlen_t here. As always, PRs are welcome. You might want to file this at https://github.com/RcppCore/Rcpp/issues just so it doesn't get lost. Thanks, Kevin On Tue, Nov 6, 2018 at 11:23 PM Qiang Kou wrote: > > Hi, William, > > Can you give us a small piece of code to

Re: [Rcpp-devel] Error creating package with RcppArmadillo

2018-10-13 Thread Kevin Ushey
I can reproduce if the 'pkgKitten' package is not installed. In that case, I see in man/-package.Rd: \examples{ ~~ simple examples of the most important functions ~~ } which of course is just a stub and not valid example code (and so fails during check). I think this is just gunk

Re: [Rcpp-devel] Passing pointers to objects between libs results in weird UBSAN warning

2018-08-20 Thread Kevin Ushey
FWIW, there's an associated bug report here: https://github.com/google/sanitizers/issues/911 that indicates that ubsan emits false positives when attempting to diagnose functions opened through dlopen(), which IIUC is the standard way that R loads symbols from compiled libraries in R

Re: [Rcpp-devel] R_PreserveObject and R_ReleaseObject

2018-08-16 Thread Kevin Ushey
I think the main problem is that it's easy to use your class incorrectly. For example: - What happens if your map is destructed? The SEXPs it is handling are effectively leaked. - What if you copy your map? Since SEXPs are pointers, you now have two maps containing the same pointers, and if you

Re: [Rcpp-devel] `checkUserInterrupt()` might not be safe if Rcout is used.

2018-07-26 Thread Kevin Ushey
What environment are you executing this on? (R in terminal, or with a GUI; which OS?) One thing to be cautious of is that many R APIs in graphical environments will also call for processing of events, and this in turn can also imply a check for, and handling of, interrupts. Rprintf() is in fact

Re: [Rcpp-devel] Rcpp_fast_eval

2018-06-09 Thread Kevin Ushey
I think this is mostly because we still haven't ported the majority of usages of Rcpp_eval() to the new Rcpp_fast_eval(), so by default users are still getting the slower Rcpp_eval(). Compare e.g. Rcpp::sourceCpp(code=' #include using namespace Rcpp; // [[Rcpp::export]] void

Re: [Rcpp-devel] using an unloaded package's lazy-load data in Rcpp function

2018-04-16 Thread Kevin Ushey
o() after running the second > command, includes nycflights13 in the section "loaded via a namespace (and > not attached):" This is not the case after pulling the environment into an > Rcpp variable. > > Thanks again for steering me, > Jack > > > > On 04/15/2

Re: [Rcpp-devel] using an unloaded package's lazy-load data in Rcpp function

2018-04-15 Thread Kevin Ushey
The environments called 'package:foo' are associated with attached packages; that is, they're located on the search path. You likely want to find the actual package namespace. I think we have a static function Environment::namespace_env() for this. Or you can just call back to R with

Re: [Rcpp-devel] [RcppParallel] Segfault but only on TravisCI

2018-01-17 Thread Kevin Ushey
In your RcppParallel worker, it looks like you're trying to write to an Rcpp matrix; e.g. you have: distmat_(i,j) = local_calculator->calculate(i,j); where distmat_ is a matrix. You should avoid using Rcpp classes within RcppParallel workers, as there's no guarantee that the methods

Re: [Rcpp-devel] passing a bit64 vector to C++ and returning it

2017-07-11 Thread Kevin Ushey
My understanding is that `integer64` actually stores its contents in an R numeric vector, so presumedly you should be able to handle this by forcefully casting the contents as you access it, e.g. #include using namespace Rcpp; // [[Rcpp::export]] NumericVector timesTwo(NumericVector input) {

Re: [Rcpp-devel] Call to function through pointer to incorrect function type on UBSAN

2017-07-08 Thread Kevin Ushey
I can't replicate the reported UBSAN issues on my macOS machine (R-devel compiled with LLVM clang 4.0.1, with address + undefined behavior sanitizers active). The warnings look somewhat dubious to me: for example, the first warning: function_pointers.h:99:12: runtime error: call to function

Re: [Rcpp-devel] RFC: Rcpp modules vs. RefClass

2016-11-29 Thread Kevin Ushey
To be brief -- Rcpp modules are effectively in maintenance mode at this point; we don't plan to extend / improve modules beyond resolving issues if and when they come up. We did get to the bottom of the posted issue -- R packages that use modules need to import the whole Rcpp namespace. I'm not

Re: [Rcpp-devel] Can an Rcpp package include Fortran code?

2016-10-06 Thread Kevin Ushey
My best guess is that the issue here is that 'gfortran' is being used for linking, e.g. c:/Rtools/mingw_64/bin/gfortran -shared -s -Wl,--allow-multiple-definition -static-libgcc -o ForTest.dll tmp.def RcppExports.o VecSum_C.o VecSum_F.o -LC:/R/RLocalSoft/lib/x64 -LC:/R/RLocalSoft/lib

Re: [Rcpp-devel] Logic error causes R memory to be corrupt

2016-10-06 Thread Kevin Ushey
I'm pretty sure I saw this post on StackOverflow before. Please don't cross post, or at least indicate that you are when you do so. It's also nice to give credit based on the advice you receive... The main issue in your code, I think, is here: struct Element : public

Re: [Rcpp-devel] Alternative way of calling R functions within C++

2016-08-03 Thread Kevin Ushey
The simplest demonstrating example I can think of: --- #include using namespace Rcpp; struct A { ~A() { Rprintf("~A()"); } }; // [[Rcpp::export]] void ouch() { A a; Rf_error("ouch!"); } /*** R ouch() */ --- Call 'Rcpp::sourceCpp()' on that and you'll see: >

Re: [Rcpp-devel] Alternative way of calling R functions within C++

2016-08-03 Thread Kevin Ushey
. On Wed, Aug 3, 2016 at 11:28 AM, Kevin Ushey <kevinus...@gmail.com> wrote: > The problem with your implementation is what happens if R throws an > error. The R longjmp will cause any C++ objects on the stack to leak, > their destructors not to run, and you'll essentially be

Re: [Rcpp-devel] Alternative way of calling R functions within C++

2016-08-03 Thread Kevin Ushey
The problem with your implementation is what happens if R throws an error. The R longjmp will cause any C++ objects on the stack to leak, their destructors not to run, and you'll essentially be in a bad place if you evaluate any R code that might return an error. (For example, suppose you had a

Re: [Rcpp-devel] Strange behavior with boost::program_options

2016-07-06 Thread Kevin Ushey
If I had to guess, maybe there is some initialization that occurs when your mylib::Simulation object is constructed, and you need to ensure that code is only run once? (Perhaps the code that defines the program options needs to be hidden behind an initialization flag, or something like that)

Re: [Rcpp-devel] Bug: replace_last()

2016-05-16 Thread Kevin Ushey
Thanks -- it looks to me like there is something more fundamentally wrong with the 'replace_first' and 'replace_last' methods; ie, I don't think we want to be using 'find_first_of' and 'find_last_of' functions. Ie, when writing string.replace_first("foo", "bar"); I imagine we want to

Re: [Rcpp-devel] Rcpp11 being checked by Travis CI with minimal example

2016-03-19 Thread Kevin Ushey
It sounds like you just need to declare that your package depends on C++11 in the standard way: - Add 'SystemRequirements: C++11' to your DESCRIPTION file, - Create files at 'src/Makevars[.win]', and make sure you have CXX_STD = CXX11 This is documented in more detail in R-exts: see

Re: [Rcpp-devel] lighter source package

2016-02-28 Thread Kevin Ushey
What about having a 'configure' script that generates this header file on package install? https://cran.r-project.org/doc/manuals/r-release/R-exts.html#Configure-and-cleanup On Sun, Feb 28, 2016 at 11:18 AM, Baptiste Auguie wrote: > Dear Rcpp gurus, > > In the process

Re: [Rcpp-devel] Unusual RInside compilation experiences

2016-02-11 Thread Kevin Ushey
I think this needs to be _WIN32 rather than WIN32. Thanks for pointing this out! On Thu, Feb 11, 2016 at 2:41 PM, Jonathon Love wrote: > hi dirk, > > i've been compiling RInside on windows with the new RTools based on GCC 4.9. > with stock settings, this all compiles

Re: [Rcpp-devel] Possible regression in R-3.2.3 or Rcpp 0.12.3

2016-01-30 Thread Kevin Ushey
running under `gctorture()`... Kevin On Sat, Jan 30, 2016 at 7:07 AM, Qiang Kou <q...@umail.iu.edu> wrote: > Another thing confused me is the segfault only happens when the > IntegerVector is significantly long. > > Best, > > KK > > On Sat, Jan 30, 2016 at 2:57 AM, Kev

Re: [Rcpp-devel] Possible regression in R-3.2.3 or Rcpp 0.12.3

2016-01-29 Thread Kevin Ushey
When I add some debug printing to the associated subscripting line (https://github.com/awalker89/openxlsx/blob/b92bb3acdd6ea759be928c298c6faeef2f26fa3e/src/cppFunctions.cpp#L2608), I see: colNumbers.size(): 98,03,150 charCols.size(): 95,94,546 It looks to me like the package is erroneously

Re: [Rcpp-devel] Possible regression in R-3.2.3 or Rcpp 0.12.3

2016-01-28 Thread Kevin Ushey
A C++ stack trace would be very helpful. Can you try running R with gdb, e.g. R -d gdb -f example.R where 'example.R' is the path to your script that reproduces the segfault? Hopefully, 'gdb' can provide more context on where the error is occurring. For what it's worth, the file did open

Re: [Rcpp-devel] Possible regression in R-3.2.3 or Rcpp 0.12.3

2016-01-28 Thread Kevin Ushey
lib/R/lib/libR.so > #19 0x7792bcef in Rf_eval () from /usr/lib/R/lib/libR.so > #20 0x7792f52e in ?? () from /usr/lib/R/lib/libR.so > #21 0x7792bf0d in Rf_eval () from /usr/lib/R/lib/libR.so > #22 0x7795422a in Rf_ReplIteration () from /usr/lib/R/lib/libR

Re: [Rcpp-devel] large number of warnings for simple use of Rcpp

2015-11-02 Thread Kevin Ushey
Hi Guillaume, Compiling with the Makevars you provided, I see a number of warnings related to sign conversion and loss of integer precision (due to the use of `-Wconversion` in the Makevars). I'll add an issue on the GitHub issue tracker just so we don't lose sight of it. Thanks, Kevin On Mon,

Re: [Rcpp-devel] asan and rcpp on osx 10.11

2015-10-22 Thread Kevin Ushey
You could try building clang yourself with UBSAN and testing with that to see if you can reproduce; I have a script that mostly automates the installation from trunk here: https://github.com/kevinushey/etc/blob/master/Mac/install-llvm.sh I think Apple's fork of clang has been a bit behind in

Re: [Rcpp-devel] undefined symbol: _ZTVN10__cxxabiv120__si_class_type_infoE (on Ubuntu but not on Mac OS X)

2015-07-06 Thread Kevin Ushey
You'll have to share your package if you want more complete help, but some of my responses are inline. My best guess is you have a funky configure script or something to that effect. On Mon, Jul 6, 2015 at 10:10 AM, Peng Yu pengyu...@gmail.com wrote: Hi, I made a package using Rcpp and FORTRAN.

Re: [Rcpp-devel] Question about include paths

2015-06-12 Thread Kevin Ushey
Indeed. I think this has been requested before to R-Core (adding 'inst/include' by default), but at the time they weren't willing to make such a change. There's a chance they would still be receptive given a suitable patch, though. On Fri, Jun 12, 2015 at 10:24 AM Tim Keitt tke...@utexas.edu

Re: [Rcpp-devel] error: wrap is not a template function

2015-05-21 Thread Kevin Ushey
Fabio, Is it possible that RcppGSL.h is getting included before that header file is included? If that were the case, that would imply Rcpp.h would be getting #include'd before you're able to make your as / wrap specializations. Just a guess... Kevin On Thu, May 21, 2015 at 10:15 AM, Dirk

Re: [Rcpp-devel] How to use Rcpp with Qt Creator (Mac)?

2015-05-15 Thread Kevin Ushey
That `R_running_as_main_program` error should be fixed R 3.2.0-patched. See: https://bugs.r-project.org/bugzilla/show_bug.cgi?id=15899 If that hot-fix helps then that's good; otherwise, I would suggest users patching their R headers after installation. Kevin On Fri, May 15, 2015 at 6:42 PM,

Re: [Rcpp-devel] template functions with Rcpp

2015-05-01 Thread Kevin Ushey
Hi Daniel, Unfortunately, you cannot use // [[Rcpp::export]] to automagically export template functions. The general alternative approach is to define a template implementation, and then dynamically dispatch to that implementation, e.g. template typename T void doStuffImpl() { ... } with

Re: [Rcpp-devel] Possible error in setequal ??

2015-01-02 Thread Kevin Ushey
/setdiff.h#L80 On Fri, Jan 2, 2015 at 9:22 PM, Kevin Ushey kevinus...@gmail.com wrote: Hi Søren, Thanks for the bug report -- it looks like you're right, `setequal` is broken, and we never knew about it because we don't have any unit tests for it. Whoops! I'll take a look at what's going

Re: [Rcpp-devel] Possible error in setequal ??

2015-01-02 Thread Kevin Ushey
Hi Søren, Thanks for the bug report -- it looks like you're right, `setequal` is broken, and we never knew about it because we don't have any unit tests for it. Whoops! I'll take a look at what's going on and commit a fix + tests soon -- for now, you can use the workaround with `setdiff` which

Re: [Rcpp-devel] Does uncaught c++ exception cause memory leak?

2014-12-29 Thread Kevin Ushey
Hi Wush, Thanks for investigating this, and I would certainly welcome a fix / tweak to the END_RCPP macro to avoid this potential memory leak. However, I am also curious -- where exactly does this memory leak occur, what exactly is being leaked, and why does your modified example avoid it? My

Re: [Rcpp-devel] RcppEigen: Windows binary from CRAN crashes R, but not when installing from source.

2014-10-16 Thread Kevin Ushey
I think John's advice is spot on here. The issue is only seen when `NDEBUG` is not defined. I can reproduce the crash (assertion failure) by ensuring I have CXXFLAGS=-UNDEBUG in my ~/.R/Makevars. Note that: 1. An assertion failure from Eigen implies you are doing something that you should

Re: [Rcpp-devel] Template instantiation of commonly-used types

2014-10-15 Thread Kevin Ushey
If we were to have these vectors as part of the shared object rather than header-only, wouldn't this imply breakage for existing packages if newer versions of Rcpp changed the Vector template class implementation (perhaps it inherits new policies, or gains new methods, or methods change, or

Re: [Rcpp-devel] Errors while compiling a script (seems to be related to Fortran)

2014-09-03 Thread Kevin Ushey
Hi Xiao, I can reproduce the error -- but why do you have the includes as such, e.g.: #include R.h #include float.h #include R_ext/Linpack.h #include R_ext/Applic.h /* for the QR routines */ #include R_ext/Utils.h /* for the *sort() routines */ #include stdio.h #include RcppArmadillo.h

Re: [Rcpp-devel] Rcpp::ListOf.size() returns signed int?

2014-09-01 Thread Kevin Ushey
Hi Christian, Thanks for catching this. I think this is an oversight -- this should return `R_len_t` as well. Or, when long vector support is implemented, `R_xlen_t` should be used instead (especially since `ListOfT` is more-or-less a fancy interface over a `List` object) Just pushed a

Re: [Rcpp-devel] (Very) rare segfault

2014-08-20 Thread Kevin Ushey
The general prescription is: 1. Try running the code with `gctortue(TRUE)` on, 2. Try running with a debugger (gdb, lldb, valgrind), 3. Try running with sanitizers (see e.g. Dirk's docker containers: https://github.com/eddelbuettel/docker-ubuntu-r) This should help provide you (and/or us) enough

Re: [Rcpp-devel] Fwd: CRAN submission growfunctions 0.1

2014-08-10 Thread Kevin Ushey
| | ​ | | | | | | | | On Sat, Aug 9, 2014 at 3:02 PM, Kevin Ushey kevinus...@gmail.com | wrote: | | | | | | Hi Terrance, | | | | | | Can you please try to construct a reproducible example based

Re: [Rcpp-devel] Fwd: CRAN submission growfunctions 0.1

2014-08-09 Thread Kevin Ushey
Hi Terrance, Can you please try to construct a reproducible example based on the (tagged, potentially offending) line of code -- that is, #4 0x7f79b6541df0 in IGMRFDPMIX /data/gannet/ripley/R/packages/tests-49x/growfunctions/src/dpmix.cpp:63 which has the line: C(k,0) =

Re: [Rcpp-devel] Rcpp-FAQ vignette and OS X entries: Small update

2014-08-03 Thread Kevin Ushey
I think this bit: 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 interesting as it emits much more comprehensible error messages than \texttt{g++} (though \texttt{g++}

Re: [Rcpp-devel] Rcpp-FAQ vignette and OS X entries: Small update

2014-08-03 Thread Kevin Ushey
useful half a year ago ;) Cheers, Kevin On Sun, Aug 3, 2014 at 1:10 PM, Kevin Ushey kevinus...@gmail.com wrote: I think this bit: 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

Re: [Rcpp-devel] Equivalent to the which function in Rcpp / Access to a data.frame's indices?

2014-07-18 Thread Kevin Ushey
Hi Asis, Sorry, Rcpp doesn't have vectorized subsetting for rows of a data.frame / matrix. However, if you want columns, you can use vector subsetting: http://gallery.rcpp.org/articles/subsetting/ But perhaps we can consider added 'rows', 'cols' helper methods that would pull out rows and

Re: [Rcpp-devel] retrieve the column names of Rcpp::DataFrame

2014-07-10 Thread Kevin Ushey
df.attr(names) ? data.frames do not have a column names attribute. Neither do matrices, for that matter, which have an (optional) `dimnames` attribute. Please see: http://gallery.rcpp.org/articles/setting-object-attributes/, and also try looking at what e.g. `attributes(data.frame(x=1))`, for

Re: [Rcpp-devel] Maximum Columns in Rcpp DataFrame (revisited)

2014-07-08 Thread Kevin Ushey
Maybe we need a DataFrameBuilder class that someone could use like so: DataFrame df = DataFrameBuilder::create() .add(column 1, col1) .add(column 2, col2) .add(column 3, col3); This could be made as a generic VectorBuilderT class as well. Or maybe I've been writing

Re: [Rcpp-devel] Maximum Columns in Rcpp DataFrame (revisited)

2014-07-08 Thread Kevin Ushey
(SEXP x, SEXP y, SEXP z) { return ListBuilder() .add(foo, x) .add(bar, y) .add(baz, z); } /*** R test_builder(1:5, letters[1:5], rnorm(5)) */ On Tue, Jul 8, 2014 at 2:49 PM, Kevin Ushey kevinus...@gmail.com wrote: Maybe we need a DataFrameBuilder class that someone could use like so

Re: [Rcpp-devel] routine registration

2014-06-25 Thread Kevin Ushey
Hi Ramon, Nice to see that there are people stumbling upon Kmisc and finding it useful ;) It was developed partially in response to new BioConductor guidelines requiring packages with source code to register the entry points, and since that's a pain to do manually, and it was possible to

Re: [Rcpp-devel] About the Rcpp Gallery (Was: Speed up of the data.frame creation in DataFrame.h)

2014-06-09 Thread Kevin Ushey
It's tucked away a bit at the bottom of the page, but it brings you here: https://github.com/jjallaire/rcpp-gallery/wiki/Contributing-to-the-Rcpp-Gallery On Mon, Jun 9, 2014 at 9:45 AM, Tim Keitt tke...@utexas.edu wrote: I don't see the contributing link... ;-) THK On Mon, Jun 9, 2014

Re: [Rcpp-devel] Error during wrapup

2014-05-28 Thread Kevin Ushey
What OS are you running on (Mac, Linux, Windows)? I really can't tease this out (with Mac + clang) thus far. On Wed, May 28, 2014 at 9:56 PM, Romain Francois rom...@r-enthusiasts.com wrote: Le 29 mai 2014 à 00:35, John Mous john.mo...@gmail.com a écrit : No luck with gctorture on yet, but I

Re: [Rcpp-devel] Error during wrapup

2014-05-27 Thread Kevin Ushey
Hi John, I think we may have tackled this in some of the latest fixes with the version of Rcpp on GitHub. Can you try installing that version and trying again? Ie, try install.packages(devtools); devtools::install_github(RcppCore/Rcpp) then try running your code again. Alternatively,

Re: [Rcpp-devel] no matching function for call in mzR on Mac afterRcpp 0.11.0 updatee

2014-05-14 Thread Kevin Ushey
On 14 May 2014 05:49, Kevin Ushey kevinus...@gmail.com wrote: Hi Jack, I've already brought this up with the package maintainer. It's because they bundle an old, broken version of boost. I asked them to fix it; I guess they haven't (the BioC build reports also show it failing on Mavericks

Re: [Rcpp-devel] no matching function for call in mzR on Mac after Rcpp 0.11.0 update

2014-05-13 Thread Kevin Ushey
Hi Jack, I've already brought this up with the package maintainer. It's because they bundle an old, broken version of boost. I asked them to fix it; I guess they haven't (the BioC build reports also show it failing on Mavericks) I've appended a copy of my e-mail at the end of this just so you

Re: [Rcpp-devel] Compile errors when including Rcpp 0.11.0

2014-05-10 Thread Kevin Ushey
The vignettes build fine for me. Can you provide more information (perhaps as a GitHub issue)? I'll take a look at InternalFunction. I think there was something similar reported earlier. Cheers, Kevin On Sat, May 10, 2014 at 12:44 PM, Gabor Grothendieck ggrothendi...@gmail.com wrote: On Sat,

Re: [Rcpp-devel] g++ flags

2014-05-07 Thread Kevin Ushey
PDF file produced! | Execution halted | Error: Command failed (1) | | On Wed, May 7, 2014 at 1:50 AM, Kevin Ushey kevinus...@gmail.com wrote: | Hi Gabor, | | Looks like it was a bug on our end -- R-exts specifies that USE_CXX1X | should be set to any value; we try to set

Re: [Rcpp-devel] g++ flags

2014-05-06 Thread Kevin Ushey
Hi Gabor, Looks like it was a bug on our end -- R-exts specifies that USE_CXX1X should be set to any value; we try to set it to nothing (ie, define it but leave it empty) but apparently that is not accepted. I just pushed a bug fix to GitHub and it works on my Windows VM; can you give it another

Re: [Rcpp-devel] Rcpp module errors with Rcpp binary installation

2014-05-01 Thread Kevin Ushey
Hi Azad, Your first issue is something separate, probably due to clashing compiler toolchains between compiled versions of R / packages. If you want to dive into that further you'll need to give us some more information about your compiler setup. The second issue, with flowMatch, I believe this

Re: [Rcpp-devel] Rcpp module errors with Rcpp binary installation

2014-05-01 Thread Kevin Ushey
^ Clang does a good job of reporting error messages, so please learn how to read them and what they are trying to tell you. Cheers, Kevin On Thu, May 1, 2014 at 4:04 PM, Kevin Ushey kevinus...@gmail.com wrote: Hi Azad, Your first issue is something separate, probably due to clashing compiler

Re: [Rcpp-devel] Rcpp module errors with Rcpp binary installation

2014-05-01 Thread Kevin Ushey
my compiler toolchain and see if the problem can be removed. (I replaced clang++ with g++ for another reason. This process might create some problem). Thanks again for your help. -- Ariful Azad On Thu, May 1, 2014 at 4:08 PM, Kevin Ushey kevinus...@gmail.com wrote: Actually, to confirm

Re: [Rcpp-devel] Distribution of Rcpp codebase

2014-04-07 Thread Kevin Ushey
Here's some thoughts, from the perspective of a package developer who might want to use Rcpp11. One option is to have the Rcpp11 distribution live as a git repository within the `inst/include` directory of a developer's package. A package developer could clone the repository (or have it track the

Re: [Rcpp-devel] rgamma() behavior

2014-03-24 Thread Kevin Ushey
Hi Gregor, This is probably worth a reminder as you say. Just for reference, the motivation is that R's internal computations for rexp and rgamma default to the 'scale' parameterization, rather than the 'rate' parameterization seen at the R level. Rcpp uses that internal operation and hence isn't

Re: [Rcpp-devel] rgamma() behavior

2014-03-24 Thread Kevin Ushey
Hi Gregor, Dirk, Added here: https://github.com/RcppCore/Rcpp/commit/f6e7e34b94ba52c1341142a5640d0ede674073c7 Please feel free to tweak for wording / style / clarity :) Kevin On Mon, Mar 24, 2014 at 5:05 PM, Dirk Eddelbuettel e...@debian.org wrote: On 24 March 2014 at 16:45, Kevin Ushey

Re: [Rcpp-devel] Can not build under linux/osx

2014-03-11 Thread Kevin Ushey
Hi Jianyang, If you are willing to put your package on GitHub or somewhere else publicly accessible, I can take a closer look. My best guess, from your compiler output, is you're trying to construct a vector from a proxy, and the compiler can't figure out what constructor to call. You might want

Re: [Rcpp-devel] Can not build under linux/osx

2014-03-11 Thread Kevin Ushey
of gcc are you using in Linux (gcc -v)? Kevin On Tue, Mar 11, 2014 at 1:48 PM, Jianyang Zhao uz...@ucdavis.edu wrote: Hello Kevin, I use the least version Rcpp and RcppEigen. The github link is at https://github.com/uzhao/PACE Thanks, JIanyang On Tue, Mar 11, 2014 at 1:36 PM, Kevin Ushey

Re: [Rcpp-devel] Shared library error after update

2014-03-03 Thread Kevin Ushey
Do you have a GitHub repository or some other means of sharing your package, so we can try testing it? On Mon, Mar 3, 2014 at 6:12 AM, Dirk Eddelbuettel e...@debian.org wrote: On 3 March 2014 at 14:38, Simon Zehnder wrote: | Though I couldn't detect NEWS relevant for my package. I have rebuilt

Re: [Rcpp-devel] Shared library error after update

2014-03-03 Thread Kevin Ushey
Mar 2014, at 17:53, Kevin Ushey kevinus...@gmail.com wrote: Do you have a GitHub repository or some other means of sharing your package, so we can try testing it? On Mon, Mar 3, 2014 at 6:12 AM, Dirk Eddelbuettel e...@debian.org wrote: On 3 March 2014 at 14:38, Simon Zehnder wrote: | Though

Re: [Rcpp-devel] Shared library error after update

2014-03-03 Thread Kevin Ushey
and I'll push something to the GitHub repo in a second. Cheers, Kevin On Mon, Mar 3, 2014 at 11:21 AM, Kevin Ushey kevinus...@gmail.com wrote: Hi Simon, I can replicate this, and also fix this, if I change 'const Rcpp::S4 classS4' to 'Rcpp::S4 classS4'. (That is, assuming a simple example where I

Re: [Rcpp-devel] Rcpp 0.11.0 Module error

2014-03-03 Thread Kevin Ushey
Hi Ian, I believe this bug has been fixed in the development version (https://github.com/RcppCore/Rcpp/commit/2b033f6f3ec58922569b7aed65276f9878ca3389). Can you try installing the latest version of Rcpp on GitHub and checking if the problem persists? Thanks, Kevin On Mon, Mar 3, 2014 at 11:42

Re: [Rcpp-devel] subsetting a matrix

2014-03-03 Thread Kevin Ushey
If you want more generic matrix operations, it really is best to use Armadillo (as per Yixuan's example; note that the constructor he's using reuses R's memory as well, so it's efficient -- no copy is made, that object can be modified in place). However, you could always do something like the

Re: [Rcpp-devel] Fwd: Exposed class works within cpp func, bombs via module

2014-02-28 Thread Kevin Ushey
Hi Thell, Thanks for all the work you've done investigating this. Can you please consolidate the information you have and post it as an issue here: https://github.com/RcppCore/Rcpp/issues?state=open? And, if you're willing to dive in and figure out what exactly is happening, patches are much

Re: [Rcpp-devel] Memory not mapped

2014-02-20 Thread Kevin Ushey
Hi Hideyoshi, At this line: if(x(i,exit_col)==1){ I see that exit_col is equal to the number of columns in the matrix, thereby indexing outside the matrix if 'i' is large enough. Do you want 'exit_col - 1' instead? Be careful when going from R's 1-based indexing to C++'s 0-based indexing.

Re: [Rcpp-devel] Range constructor and memory allocation

2014-02-18 Thread Kevin Ushey
Hi Gregor, I don't think it's possible at this point. Some technical details follow: All R data internally is a SEXPREC, ie, a C struct full of different bits of information. The data part of a SEXPREC is forced to a specific offset from the C structure, e.g. from Rinternals.h: /* Under the

Re: [Rcpp-devel] Is this issue solved?

2014-02-16 Thread Kevin Ushey
Hi Jianyang, The problem is still there, but as advised by Douglas Bates in his response, you should just use a copy constructor instead. http://lists.r-forge.r-project.org/pipermail/rcpp-devel/2012-May/003793.html There is probably a solution, but I don't know the cleanest way of handling it.

Re: [Rcpp-devel] conditionally created vectors

2014-02-13 Thread Kevin Ushey
The way around it is to declare 'xx' in the parent scope, and then assign to it directly, e.g. // [[Rcpp::export]] Rcpp::NumericVector f1(String typ){ Rcpp::NumericVector xx; if(typ==nc){ xx = Rcpp::NumericVector(10); } else { xx = Rcpp::NumericVector(20); } return xx; }

Re: [Rcpp-devel] CRAN package does not build with Rcpp 0.11.1 and g++ 4.2.1

2014-02-12 Thread Kevin Ushey
Yes, the patch is trivial. Dan, we can try installing the latest version of Rcpp on GitHub on the BioC Mac build machine and confirm that these packages do build on Mac with llvm-g++4.2. And I agree that either 1. CRAN needs to rebuild the binaries for packages linking to Rcpp, or 2. these package

Re: [Rcpp-devel] no matching function for call in mzR on Mac after Rcpp 0.11.0 update

2014-02-07 Thread Kevin Ushey
I will see if I can take a deeper look at this soon, but unfortunately, I do not have access to an older Mac machine. For reference, I am able to successfully compile and check mzR 1.9.3 using Apple clang; however, I had to modify the Boost source included in the package a bit to get it to work.

  1   2   >