Re: [Rcpp-devel] Rcpp Module: Expecting an external pointer: [type=environment]

2025-03-11 Thread Dirk Eddelbuettel
Hi Stefan, On 11 March 2025 at 17:32, Stefan Boehringer wrote: | with a standard Rcpp module I get the error "Expecting an external pointer: | [type=environment]." from x$.self$finalize() |  which is an internal wrapper around modules from Rcpp. Would you have a complete example, say in a repo?

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

2023-05-30 Thread Dominick Samperi
Rtools43 is bleeding edge, and it is possible I was working with a stale version. On Tue, May 30, 2023 at 3:25 PM Dominick Samperi wrote: > Thanks for the feedback. I don't remember making such mods, and I am using > the latest Rcpp, but to be safe I reinstalled Rtools43 and R 4.3.0 and the > pr

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

2023-05-30 Thread Dominick Samperi
Thanks for the feedback. I don't remember making such mods, and I am using the latest Rcpp, but to be safe I reinstalled Rtools43 and R 4.3.0 and the problem is resolved! Sorry about the false alarm. Actually, I had two different installations of Rcpp, one under Program Files\R\R-4.3.0, and one un

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

2023-05-30 Thread Alexander Ilich
f Rcpp? From: Kevin Ushey Sent: Tuesday, May 30, 2023 3:02 PM To: Alexander Ilich Cc: Dominick Samperi ; rcpp-devel Subject: Re: [Rcpp-devel] Rcpp::sourceCpp Problem with R 4.3 update I'm also not able to reproduce, but I see a different linker invocation: g++ -shared -static-libgcc -o sour

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, your

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

2023-05-30 Thread Alexander Ilich
What version of Rcpp are you using? With R 4.3 and Rcpp 1.0.10 I have no issues. library(Rcpp) Rcpp::sourceCpp(code=' #include using namespace Rcpp; // [[Rcpp::export()]] SEXP cpptest(NumericVector v) { return v; }' ) cpptest(1:5) #> [1] 1 2 3 4 5 R.version #>_ #

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

2023-05-30 Thread Dirk Eddelbuettel
On 30 May 2023 at 14:27, Dominick Samperi wrote: | Looks like the recent update to R 4.3 broke Rcpp::sourceCpp. | | Here is a simple example... | | library(Rcpp) | Rcpp::sourceCpp(code=' |   #include |   using namespace Rcpp; |   // [[Rcpp::export()]] |   SEXP cpptest(NumericVector v) { |    

Re: [Rcpp-devel] Rcpp equivalent for Python?

2022-12-03 Thread Dirk Eddelbuettel
On 3 December 2022 at 15:08, Sparapani, Rodney wrote: | I have a tangential question. We have several R packages | based on Rcpp to call C++ code. Rcpp makes it so easy! | However, I am often asked by Python users: can we make | similar packages for that platform? I’m a newb with | respect to P

Re: [Rcpp-devel] Rcpp equivalent for Python?

2022-12-03 Thread Ilya Kipnis
I've heard of things like Cython? But in any case, you should be able to get pretty far on the various "official" packages IIRC. On Sat, Dec 3, 2022 at 10:09 AM Sparapani, Rodney wrote: > Hi Gang: > > > > I have a tangential question. We have several R packages > > based on Rcpp to call C++ cod

Re: [Rcpp-devel] Rcpp shared libraries (?)

2022-08-03 Thread Jean Thioulouse
> Le 23 juin 2022 à 17:38, Serguei Sokol a écrit : > > Le 23/06/2022 à 17:12, THIOULOUSE JEAN a écrit : >> ... >>> I can make a PR if you wish. >> Yes, please do. Thanks a lot ! > > Done: https://github.com/sdray/ade4/pull/31 > Serguei. It works perfectly, thank you very much Serguei ! Jean

Re: [Rcpp-devel] Rcpp shared libraries (?)

2022-06-23 Thread Dirk Eddelbuettel
One belated follow-up: one can in general control visibility so - a function can be in C(++) and used by other C(++) functions (and we have examples) - a function can be exported to R easily via [[Rcpp::export()]] thanks to magic of Rcpp::compileAttributes() - a function can also be "priva

Re: [Rcpp-devel] Rcpp shared libraries (?)

2022-06-23 Thread Serguei Sokol
Le 23/06/2022 à 17:12, THIOULOUSE JEAN a écrit : ... I can make a PR if you wish. Yes, please do. Thanks a lot ! Done: https://github.com/sdray/ade4/pull/31 Serguei. Le 23/06/2022 à 16:10, Jean Thioulouse a écrit : Le 23 juin 2022 à 16:04, Serguei Sokol a écrit : Le 23/06/2022 à 15:47,

Re: [Rcpp-devel] Rcpp shared libraries (?)

2022-06-23 Thread THIOULOUSE JEAN
> Le 23 juin 2022 à 16:58, Serguei Sokol a écrit : > > Rcpp or plain C++ or even C ;) , you still have to declare used functions. > In Rcpp package, the most natural way to do it, is to put such declarations > in a file $pkg/inst/include/.h. In your case, it will be > inst/include/ade4.h > >

Re: [Rcpp-devel] Rcpp shared libraries (?)

2022-06-23 Thread Serguei Sokol
Rcpp or plain C++ or even C ;) , you still have to declare used functions. In Rcpp package, the most natural way to do it, is to put such declarations in a file $pkg/inst/include/.h. In your case, it will be inst/include/ade4.h In this file you put: #include int matcentrageCpp (arma::mat& A,

Re: [Rcpp-devel] Rcpp shared libraries (?)

2022-06-23 Thread Jean Thioulouse
> Le 23 juin 2022 à 16:04, Serguei Sokol a écrit : > > Le 23/06/2022 à 15:47, Jean Thioulouse a écrit : >> Thank you Serguei, I tried this, but I still get the "undeclared identifier" >> error for these internal functions during package compilation: >> clang++ -arch arm64 -std=gnu++14 >> -I"/

Re: [Rcpp-devel] Rcpp shared libraries (?)

2022-06-23 Thread Serguei Sokol
Le 23/06/2022 à 15:47, Jean Thioulouse a écrit : Thank you Serguei, I tried this, but I still get the "undeclared identifier" error for these internal functions during package compilation: clang++ -arch arm64 -std=gnu++14 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -I'/Li

Re: [Rcpp-devel] Rcpp shared libraries (?)

2022-06-23 Thread Jean Thioulouse
Thank you Serguei, I tried this, but I still get the "undeclared identifier" error for these internal functions during package compilation: clang++ -arch arm64 -std=gnu++14 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -I'/Library/Frameworks/R.framework/Versions/4.2-arm64/Res

Re: [Rcpp-devel] Rcpp shared libraries (?)

2022-06-23 Thread Serguei Sokol
Le 23/06/2022 à 15:02, THIOULOUSE JEAN a écrit : Hi Sorry to bother you again with my C/C++ problems in the ade4 package (available on CRAN & GitHub). Thanks to your help, I have succeeded in converting several of the C functions to C++ using Rcpp. Now the package compiles without problem and

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

2021-12-03 Thread Dirk Eddelbuettel
On 3 December 2021 at 12:06, Kevin Ushey wrote: | 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. Yep. That's where I started. I may make that a PR then. But I also still lean to al

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 20

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

2021-12-03 Thread Dirk Eddelbuettel
On 3 December 2021 at 19:47, Iñaki Ucar wrote: | Mmmh, no strong opinions here. I think it doesn't matter much whether | it's an include or a define. What matters most is whether this is | discoverable and the user understands what it does. That was my motivation -- by pointing to such a top-leve

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

2021-12-03 Thread Iñaki Ucar
On Fri, 3 Dec 2021 at 19:27, Dirk Eddelbuettel wrote: > > > On 3 December 2021 at 17:03, Iñaki Ucar wrote: > | On Fri, 3 Dec 2021 at 15:44, Víthor Rosa wrote: > | > > | > Thank you for your response. Adding my functions to an R package and > changing the Makevars file as suggested reduced the ru

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

2021-12-03 Thread Dirk Eddelbuettel
On 3 December 2021 at 17:03, Iñaki Ucar wrote: | On Fri, 3 Dec 2021 at 15:44, Víthor Rosa wrote: | > | > Thank you for your response. Adding my functions to an R package and changing the Makevars file as suggested reduced the runtime by half. Excited for Rcpp 1.0.8! :) | | Excellent! Glad it h

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

2021-12-03 Thread Iñaki Ucar
On Fri, 3 Dec 2021 at 15:44, Víthor Rosa wrote: > > Hi Iñaki and Dirk, > > Thank you for your response. Adding my functions to an R package and changing > the Makevars file as suggested reduced the runtime by half. Excited for Rcpp > 1.0.8! :) Excellent! Glad it helped. Iñaki > > Best, > > Em

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

2021-12-03 Thread Víthor Rosa
Hi Iñaki and Dirk, Thank you for your response. Adding my functions to an R package and changing the Makevars file as suggested reduced the runtime by half. Excited for Rcpp 1.0.8! :) Best, Em qui., 2 de dez. de 2021 às 18:22, Dirk Eddelbuettel escreveu: > > On 2 December 2021 at 17:48, Iñaki

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

2021-12-02 Thread Dirk Eddelbuettel
On 2 December 2021 at 17:48, Iñaki Ucar wrote: | My simulation package makes heavy use of calls to R user functions from a | C++ simulation loop, and therefore greatly benefits from this feature too, | which I think we should promote to default. I agree and believe I looked into it once before --

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

2021-12-02 Thread Iñaki Ucar
Hi Víthor, My simulation package makes heavy use of calls to R user functions from a C++ simulation loop, and therefore greatly benefits from this feature too, which I think we should promote to default. Meanwhile, take a look at this Makevars file to see how to activate it: https://github.com/r-s

Re: [Rcpp-devel] Rcpp function results are different on different systems

2021-08-20 Thread Serguei Sokol
Le 19/08/2021 à 19:01, Sokol Serguei a écrit : Le 19/08/2021 à 17:41, Sokol Serguei a écrit : Le 19/08/2021 à 17:04, Naeem Khoshnevis a écrit : Thank you so much, everyone, for responding to this email. Dirk, * I didn't think about testing _equality_ of doubles because the numbers are

Re: [Rcpp-devel] Rcpp function results are different on different systems

2021-08-19 Thread Sokol Serguei
Le 19/08/2021 à 17:41, Sokol Serguei a écrit : Le 19/08/2021 à 17:04, Naeem Khoshnevis a écrit : Thank you so much, everyone, for responding to this email. Dirk, * I didn't think about testing _equality_ of doubles because the numbers are significantly different (e.g., instead of 0.5,

Re: [Rcpp-devel] Rcpp function results are different on different systems

2021-08-19 Thread Sokol Serguei
Le 19/08/2021 à 17:04, Naeem Khoshnevis a écrit : Thank you so much, everyone, for responding to this email. Dirk, * I didn't think about testing _equality_ of doubles because the numbers are significantly different (e.g., instead of 0.5, chooses 1.5). However, that is a valid point

Re: [Rcpp-devel] Rcpp function results are different on different systems

2021-08-19 Thread Dirk Eddelbuettel
On 19 August 2021 at 10:04, Naeem Khoshnevis wrote: | Thank you so much, everyone, for responding to this email. Thanks for circling back! This was a pretty impressive thread as you got three distinct answers that all added some value :) Dirk -- https://dirk.eddelbuettel.com | @eddelbuettel |

Re: [Rcpp-devel] Rcpp function results are different on different systems

2021-08-19 Thread Naeem Khoshnevis
Thank you so much, everyone, for responding to this email. Dirk, - I didn't think about testing _equality_ of doubles because the numbers are significantly different (e.g., instead of 0.5, chooses 1.5). However, that is a valid point, and I should be aware of that. - You are right ab

Re: [Rcpp-devel] Rcpp function results are different on different systems

2021-08-19 Thread Iñaki Ucar
On Thu, 19 Aug 2021 at 04:53, Dirk Eddelbuettel wrote: > > > Naeem, > > I would simplify, simplify, simplify -- as 'Rcpp FAQ 7.31' reminds us all, > testing _equality_ of doubles is challenging anyway. > > Besides, it may make sense to would ascertain first you get what you want in > _purely seria

Re: [Rcpp-devel] Rcpp function results are different on different systems

2021-08-19 Thread Sokol Serguei
HI, I cannot help with your bug. However... Le 19/08/2021 à 04:17, Naeem Khoshnevis a écrit : Dear all, I wrote a function using Rcpp; it is a simple function; however, it significantly improves the performance. Compared to what? The same algorithm with plenty for-loop re-written in R? T

Re: [Rcpp-devel] Rcpp function results are different on different systems

2021-08-18 Thread Dirk Eddelbuettel
Naeem, I would simplify, simplify, simplify -- as 'Rcpp FAQ 7.31' reminds us all, testing _equality_ of doubles is challenging anyway. Besides, it may make sense to would ascertain first you get what you want in _purely serial modes_ and then move to OpenMP. Dirk -- https://dirk.eddelbuettel.

Re: [Rcpp-devel] Rcpp equivalent of sapply(L, length)

2021-07-01 Thread Dr Gregory Jefferis
Dear Qiang, Thank you - that will do perfectly! And thanks also to Simon Urbanek for pointing out the R `lengths()` function which does the same on the R side. What great help in so little time. Thank you, colleagues! Greg. On 2 Jul 2021, at 2:39, Qiang Kou wrote: What about using "Rf_len

Re: [Rcpp-devel] Rcpp equivalent of sapply(L, length)

2021-07-01 Thread Qiang Kou
What about using "Rf_length"? --- #include using namespace Rcpp; // [[Rcpp::export]] IntegerVector c_listlengths(List L) { IntegerVector lens(L.size()); for (int i=0; i Rcpp::sourceCpp("example.cpp") > l=list(1:3, 2:3, 1:6) > l2=list(

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 w

Re: [Rcpp-devel] Rcpp 1.0.4.6

2020-04-09 Thread Dirk Eddelbuettel
On 4 April 2020 at 08:48, Dirk Eddelbuettel wrote: | | A Rcpp 1.0.4.6 patch release has been sitting at CRAN in archive/ for two | days, idling. I had one initial upload with broke a test on Windows given | that the major.minor.patch.fix pattern of 1.0.4.6 turns on more tests than | usual which w

Re: [Rcpp-devel] Rcpp code in my package causes the R process to crash on fedora-clang

2020-03-23 Thread Alexis Sarda
FWIW, I have the same problem, which is what I reported here: https://github.com/RcppCore/Rcpp/issues/972#issuecomment-593291723 I haven't been able to solve it because I can't reproduce it (I don't have a Mac, and the Docker container with that R setup doesn't fail). In my case, it could be tha

Re: [Rcpp-devel] Rcpp code in my package causes the R process to crash on fedora-clang

2020-03-22 Thread Venelin Mitov
Thanks for your quick response, Dirk! Concise and informative as usual. Best, Venelin Am So., 22. März 2020 um 17:57 Uhr schrieb Dirk Eddelbuettel : > > > On 22 March 2020 at 17:30, Venelin Mitov wrote: > | 3. The line of code that is causing a segfault error and a crash of > | the R-process is

Re: [Rcpp-devel] Rcpp code in my package causes the R process to crash on fedora-clang

2020-03-22 Thread Dirk Eddelbuettel
On 22 March 2020 at 17:30, Venelin Mitov wrote: | 3. The line of code that is causing a segfault error and a crash of | the R-process is a call to the | std::logic_error() constructor. This line of code is found in the package's file | src/QuadraticPoly.h: | | throw logic_error(oss.str()); I al

Re: [Rcpp-devel] Rcpp 1.0.4 release candidate

2020-03-13 Thread Dirk Eddelbuettel
Ditto for Rcpp 1.0.4 -- at CRAN for processing, and at the same time in the Rcpp drat repo. Short tweet: https://twitter.com/eddelbuettel/status/1238466368976158726 Instructions from earlier remain valid. Cheers, and happy Rcpp-ing, Dirk -- http://dirk.eddelbuettel.com | @eddelbuettel | e..

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

2020-02-08 Thread Joshua N Pritikin
On Sat, Feb 08, 2020 at 01:44:51PM -0800, Kevin Ushey wrote: > On Sat, Feb 8, 2020 at 12:52 PM Joshua N Pritikin wrote: > > If I'm reading it correctly, > > rcpp_set_stack_trace(Shield(stack_trace())) > > will work equally well in either location. R can't introspect about > > the C++ stack; It mu

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 > > exc

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

2020-02-08 Thread Joshua N Pritikin
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 > exceptions.h line 40, >rcpp_set_stack_trace(Shield(stack_trace())

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

2020-02-08 Thread JJ Allaire
On Sat, Feb 8, 2020 at 3:45 PM Joshua N Pritikin wrote: > On Sat, Feb 08, 2020 at 03:28:22PM -0500, JJ Allaire wrote: > >Agreed that it would be good to have more clear docs here. Note > >that as Dirk pointed out both Writing R Extensions and > >RcppParallel docs are pretty clear abou

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

2020-02-08 Thread Joshua N Pritikin
On Sat, Feb 08, 2020 at 03:28:22PM -0500, JJ Allaire wrote: >Agreed that it would be good to have more clear docs here. Note >that as Dirk pointed out both Writing R Extensions and >RcppParallel docs are pretty clear about the fact that you >shouldn't call any R APIs when in a ba

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

2020-02-08 Thread JJ Allaire
I think the point is that the *only* reason Rcpp::stop exists is to do forwarding to Rf_error. If that isn't your intention it's strictly worse than a normal C++ exception. Agreed that it would be good to have more clear docs here. Note that as Dirk pointed out both Writing R Extensions and RcppPa

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

2020-02-08 Thread Joshua N Pritikin
On Sat, Feb 08, 2020 at 02:55:06PM -0500, JJ Allaire wrote: >Yes, the only reason to use Rcpp::stop is because you want a C++ >exception translated safely into an Rf_error at the SEXP call level. If >you are trying to signal an error from a background thread you would >want to use a

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

2020-02-08 Thread JJ Allaire
Yes, the only reason to use Rcpp::stop is because you want a C++ exception translated safely into an Rf_error at the SEXP call level. If you are trying to signal an error from a background thread you would want to use a regular C++ exception rather than Rcpp::stop. On Sat, Feb 8, 2020 at 1:56 PM I

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

2020-02-08 Thread Iñaki Ucar
On Fri, 7 Feb 2020 at 14:24, Joshua N Pritikin wrote: > > On Thu, Feb 06, 2020 at 08:40:02PM -0600, Dirk Eddelbuettel wrote: > > On 6 February 2020 at 20:47, Joshua N Pritikin wrote: > > | The Rcpp::exception constructor does, > > | > > | rcpp_set_stack_trace(Shield(stack_trace())) > > | > > | T

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

2020-02-08 Thread Joshua N Pritikin
On Fri, Feb 07, 2020 at 07:56:40AM -0600, Dirk Eddelbuettel wrote: > See several (extended) discussions at GitHub around the issues that > changed and improved exception handling and stack traces. A fair > amount of very nice work made Rcpp more robust here. > > In short, it not a trivial issue.

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

2020-02-07 Thread Joshua N Pritikin
On Fri, Feb 07, 2020 at 07:56:40AM -0600, Dirk Eddelbuettel wrote: > On 7 February 2020 at 08:23, Joshua N Pritikin wrote: > | Yeah, so I replaced Rcpp::stop with, > | > | template > | inline void NORET mxThrow(const char* fmt, Args&&... args) { > | throw std::runtime_error( tfm::format(fmt,

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

2020-02-07 Thread Dirk Eddelbuettel
On 7 February 2020 at 08:23, Joshua N Pritikin wrote: | On Thu, Feb 06, 2020 at 08:40:02PM -0600, Dirk Eddelbuettel wrote: | > On 6 February 2020 at 20:47, Joshua N Pritikin wrote: | > | The Rcpp::exception constructor does, | > | | > | rcpp_set_stack_trace(Shield(stack_trace())) | > | | > | T

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

2020-02-07 Thread Joshua N Pritikin
On Thu, Feb 06, 2020 at 08:40:02PM -0600, Dirk Eddelbuettel wrote: > On 6 February 2020 at 20:47, Joshua N Pritikin wrote: > | The Rcpp::exception constructor does, > | > | rcpp_set_stack_trace(Shield(stack_trace())) > | > | This can corrupt R if called within an OpenMP block. > > ... here. In

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

2020-02-06 Thread Dirk Eddelbuettel
Joshua, Thanks for reposting here. A better place than my inbox, and I was rushed earlier as I missed the line ... On 6 February 2020 at 20:47, Joshua N Pritikin wrote: | The Rcpp::exception constructor does, | | rcpp_set_stack_trace(Shield(stack_trace())) | | This can corrupt R if called w

Re: [Rcpp-devel] rcpp compile problem

2020-01-28 Thread Dirk Eddelbuettel
Gerhard, On 28 January 2020 at 15:28, Ralf Stubner wrote: | On Tue, Jan 28, 2020 at 10:04 AM Gerhard Boenisch | wrote: | > I am new to rcpp and am unable to compile code I know works. I must be doing something stupid. | > | > I am using Windows (10). | > | > I have received the cpp source files

Re: [Rcpp-devel] rcpp compile problem

2020-01-28 Thread Dirk Eddelbuettel
On 28 January 2020 at 11:10, Peter Meissner wrote: | you might consider using RStudio which makes this work pretty much out of | the box: | https://support.rstudio.com/hc/en-us/articles/200486088-Using-Rcpp-with-RStudio I am sorry but that needs a qualifier. Otherwise this statement somewhat imp

Re: [Rcpp-devel] rcpp compile problem

2020-01-28 Thread Ralf Stubner
On Tue, Jan 28, 2020 at 10:04 AM Gerhard Boenisch wrote: > > Hi > > I am new to rcpp and am unable to compile code I know works. I must be doing > something stupid. > > I am using Windows (10). > > I have received the cpp source files for the BHPMF package. We want to make > the package work on

Re: [Rcpp-devel] rcpp compile problem

2020-01-28 Thread Peter Meissner
Hey, you might consider using RStudio which makes this work pretty much out of the box: https://support.rstudio.com/hc/en-us/articles/200486088-Using-Rcpp-with-RStudio Best, Peter Am Di., 28. Jan. 2020 um 10:27 Uhr schrieb Serguei Sokol < serguei.so...@gmail.com>: > Le 28/01/2020 à 10:04, Gerh

Re: [Rcpp-devel] rcpp compile problem

2020-01-28 Thread Serguei Sokol
Le 28/01/2020 à 10:04, Gerhard Boenisch a écrit : Hi I am new to rcpp and am unable to compile code I know works. I must be doing something stupid. I am using Windows (10). I have received the cpp source files for the BHPMF package. We want to make the package work on the latest version of

Re: [Rcpp-devel] RCPP Issue with nonunicode User characters

2019-12-06 Thread Dirk Eddelbuettel
On 6 December 2019 at 16:13, John O'Shea wrote: | Hello, forgive me in advance as I am not familiar with R developing or the | more technical side of R usage and programming in general. I have had a | professor of mine request I use the Rcpp package to rewrite a function in | R, but I have been ru

Re: [Rcpp-devel] Rcpp-devel vs Rcpp-commits mailing list

2019-04-04 Thread Dirk Eddelbuettel
On 4 April 2019 at 07:15, Chengyang.Ji12 wrote: | Just asking if I'm in the right place. I saw several 'Rcpp' related | mailing lists here https://lists.r-forge.r-project.org/cgi-bin/mailman/ | listinfo but not sure which one to subscribe to. | | I use Rcpp a lot and want to find a place to ask

Re: [Rcpp-devel] Rcpp - libtorrent

2019-02-17 Thread Morgan Morgan
Ok thanks i will but have added the Makevars file and the PKG_LIBS variable. I will have a look at other packages. On Sun, 17 Feb 2019 19:38 Dirk Eddelbuettel > On 17 February 2019 at 19:20, Morgan Morgan wrote: > | So I tried to create a github repo : > https://github.com/2005m/RLibTorrent > |

Re: [Rcpp-devel] Rcpp - libtorrent

2019-02-17 Thread Dirk Eddelbuettel
On 17 February 2019 at 19:20, Morgan Morgan wrote: | So I tried to create a github repo : https://github.com/2005m/RLibTorrent | | As suggested by Ralf, I started on Ubuntu and installed libtorrent. | I have few issues [...] | g++ -shared -L/usr/lib/R/lib -Wl,-Bsymbolic-functions -Wl,-z,relro

Re: [Rcpp-devel] Rcpp - libtorrent

2019-02-17 Thread Morgan Morgan
Hi All, So I tried to create a github repo : https://github.com/2005m/RLibTorrent As suggested by Ralf, I started on Ubuntu and installed libtorrent. I have few issues When I do R CMD build RLibTorrent and then R CMD check RLibTorrent_1.0.tar.gz , I get an error: * using log directory ‘/home/mo

Re: [Rcpp-devel] Rcpp - libtorrent

2019-02-11 Thread Ralf Stubner
On 11.02.19 10:29, Morgan Morgan wrote: > I use ubuntu and windows. But the idea would be to make the package > available to all users including Mac OS. I would start with Ubuntu, since there it should be sufficient to use sudo apt-get install libtorrent-dev together with PKG_LDFLAGS=-ltorrent

Re: [Rcpp-devel] Rcpp - libtorrent

2019-02-11 Thread Morgan Morgan
I use ubuntu and windows. But the idea would be to make the package available to all users including Mac OS. On Mon, 11 Feb 2019 09:20 Ralf Stubner On 11.02.19 10:09, Morgan Morgan wrote: > > In order to create a prototype would i need to build the libtorrent > > library? Or would including the

Re: [Rcpp-devel] Rcpp - libtorrent

2019-02-11 Thread Ralf Stubner
On 11.02.19 10:09, Morgan Morgan wrote: > In order to create a prototype would i need to  build the libtorrent > library? Or would including the source file in the package be enough? Which OS do you use? With Linux it is easiest to install the library (plus headers!) via the package manager. On Ma

Re: [Rcpp-devel] Rcpp - libtorrent

2019-02-11 Thread Morgan Morgan
Hi Thank you for your replies. In order to create a prototype would i need to build the libtorrent library? Or would including the source file in the package be enough? I have used Rcpp and the.c(), .call() function before but i have never tried to "wrap" such a large librairy. If you have any

Re: [Rcpp-devel] Rcpp - libtorrent

2019-02-10 Thread Dirk Eddelbuettel
On 10 February 2019 at 13:38, Neal Fultz wrote: | Rcpp should make this very straightforward; assuming you are putting this | in a package (because why wouldn't you?) you would just need to set some | flags in src/Makefile so that the external library gets picked up correctly | by R, and write a

Re: [Rcpp-devel] Rcpp - libtorrent

2019-02-10 Thread Neal Fultz
Rcpp should make this very straightforward; assuming you are putting this in a package (because why wouldn't you?) you would just need to set some flags in src/Makefile so that the external library gets picked up correctly by R, and write a few Rcpp wrapper functions for interacting with it. See a

Re: [Rcpp-devel] Rcpp-devel Digest, Vol 107, Issue 17

2018-09-28 Thread Joseph Wood
Hey Ralf, You are right. In the past, when I have had to have a lot of explanation, that generally points to me lacking understanding. After reading your example again with your explanation, it seems clear that I can transition to RcppParallel. I will respond back here with an update. I really

Re: [Rcpp-devel] Rcpp Class

2018-09-14 Thread Dirk Eddelbuettel
On 14 September 2018 at 10:58, Dale Smith wrote: | Hello all, | | While I’m not very active in R at the moment, I’m still here. | | Dirk ran a class in Rcpp in the fall of 2011. That was in SF. We also did NY a few years later. | I’ve not heard of any classes since, but it strikes me that ther

Re: [Rcpp-devel] Rcpp package structure

2018-07-12 Thread Dirk Eddelbuettel
On 12 July 2018 at 15:56, Iñaki Úcar wrote: | El jue., 12 jul. 2018 a las 15:32, Vissarion Fisikopoulos | () escribió: | > | > Hi all, | > | > I am mentoring a gsoc project on development of a C++ library with an | > R interface using Rcpp. | > | > Currently the project has the following structur

Re: [Rcpp-devel] Rcpp package structure

2018-07-12 Thread Iñaki Úcar
El jue., 12 jul. 2018 a las 15:32, Vissarion Fisikopoulos () escribió: > > Hi all, > > I am mentoring a gsoc project on development of a C++ library with an > R interface using Rcpp. > > Currently the project has the following structure: let root be the > main folder of the package, the default Rcp

Re: [Rcpp-devel] Rcpp unreachable when RInside+Hemi tryed to be compiled together

2018-05-18 Thread Ralf Stubner
On 18.05.2018 09:22, ExtremePasta wrote: > using -Xcompiler and removing some flag from $(shell $(R_HOME)/bin/R CMD > config CXXFLAGS) I tryed to make nvcc recognize all the gcc command but > I don't know if this allow nvcc run it perfectly. When running "make" > this is the error I get: > > nvcc

Re: [Rcpp-devel] rcpp standalone compiled with intel c++

2018-03-07 Thread Jeff Newmiller
FAQ 2.9 https://cran.r-project.org/package=Rcpp/vignettes/Rcpp-FAQ.pdf -- Sent from my phone. Please excuse my brevity. On March 7, 2018 6:08:21 AM PST, Vitaliy FEOKTISTOV wrote: >I'd like to have a standalone version of Rcpp. I compiled it as visual >studio 2017 project with Intel 2018u1 c++

Re: [Rcpp-devel] Rcpp::stop() equivalent of base::stop(..., call.=FALSE)

2018-03-05 Thread Michael Weylandt
Thanks Kyle. I found that (added in PR#663) just after I sent my email, but it's not quite as elegant as Rcpp::stop. It also doesn't work for Rcpp::warning (which I left out of my initial email). I think this would be a nice feature to have, so I'll work up a PR which exposes it via Rcpp::stop an

Re: [Rcpp-devel] Rcpp::stop() equivalent of base::stop(..., call.=FALSE)

2018-03-05 Thread Kyle Baron
Michael - I modified your example to use Rcpp::exception. I think this was implemented here: https://github.com/RcppCore/Rcpp/pull/663/ Kyle ```{r} library(Rcpp) sourceCpp(code=' #include "Rcpp.h" // [[Rcpp::export]] Rcpp::NumericVector internal_function_name(Rc

Re: [Rcpp-devel] Rcpp project for GSoC18

2018-01-15 Thread Vissarion Fisikopoulos
The project idea page is up! https://github.com/rstats-gsoc/gsoc2018/wiki/Sampling-and-volume-approximation Please, let me know if some R expert is interested in co-mentoring that project. Best, Vissarion. On 16 November 2017 at 17:25, Vissarion Fisikopoulos wrote: > On 16 November 2017 at 17:

Re: [Rcpp-devel] Rcpp project for GSoC18

2017-11-16 Thread Vissarion Fisikopoulos
On 16 November 2017 at 17:14, Qiang Kou wrote: > I think we already have the page for GSOC 2018: > > https://github.com/rstats-gsoc/gsoc2018/wiki/table-of-proposed-coding-projects > > Best, > > KK Thank you both for the feedback. I will add my project idea there. Still I am in a quest of a second

Re: [Rcpp-devel] Rcpp project for GSoC18

2017-11-16 Thread Qiang Kou
I think we already have the page for GSOC 2018: https://github.com/rstats-gsoc/gsoc2018/wiki/table-of-proposed-coding-projects Best, KK On Thu, Nov 16, 2017 at 10:08 AM, Dirk Eddelbuettel wrote: > > On 16 November 2017 at 16:35, Vissarion Fisikopoulos wrote: > | Hello, > | > | I maintain C++

Re: [Rcpp-devel] Rcpp project for GSoC18

2017-11-16 Thread Dirk Eddelbuettel
On 16 November 2017 at 16:35, Vissarion Fisikopoulos wrote: | Hello, | | I maintain C++ code for random sampling and volume approximation of | polyhedra (see https://github.com/vissarion/volume_approximation). | | I would like to propose a GSoC project to create an R package that | will use func

Re: [Rcpp-devel] Rcpp module visible after check but not after install

2017-11-09 Thread Christopher Genovese
Thanks again, Dirk. Great suggestions; I will certainly try that approach. I definitely agree that modules are very useful, and I very much appreciate all your (and your team's) efforts in bringing this to the community. Regards, Chris On Thu, Nov 9, 2017 at 12:30 PM, Dirk Eddelbuettel wrote:

Re: [Rcpp-devel] Rcpp module visible after check but not after install

2017-11-09 Thread Dirk Eddelbuettel
On 9 November 2017 at 11:34, Christopher Genovese wrote: | Sorry, let me be clear. I've done it both ways with the same basic | result (for #2). Specifically, doing the R CMD CHECK, R CMD BUILD, | R CMD INSTALL sequence gives an installed package with the | the two classes invisible. So I don't

Re: [Rcpp-devel] Rcpp module visible after check but not after install

2017-11-09 Thread Christopher Genovese
Sorry, let me be clear. I've done it both ways with the same basic result (for #2). Specifically, doing the R CMD CHECK, R CMD BUILD, R CMD INSTALL sequence gives an installed package with the the two classes invisible. So I don't think this is a devtools issue. This is rather frustrating, I agr

Re: [Rcpp-devel] Rcpp module visible after check but not after install

2017-11-09 Thread Dirk Eddelbuettel
On 9 November 2017 at 09:32, Christopher Genovese wrote: | Thanks, Dirk. | | What exactly do you mean by 1. and 2. ? Per 'Writing R Extensions' we are | > meant to create a tar.gz in either way via 'R CMD BUILD' and then install | > it | > via 'R CMD INSTALL'. | > | > Are you doing that? | > |

Re: [Rcpp-devel] Rcpp module visible after check but not after install

2017-11-09 Thread Christopher Genovese
Thanks, Dirk. What exactly do you mean by 1. and 2. ? Per 'Writing R Extensions' we are > meant to create a tar.gz in either way via 'R CMD BUILD' and then install > it > via 'R CMD INSTALL'. > > Are you doing that? > Yes. I usually use devtools, but I've done it directly as well. In #1, for in

Re: [Rcpp-devel] Rcpp module visible after check but not after install

2017-11-09 Thread Dirk Eddelbuettel
On 9 November 2017 at 01:54, Christopher Genovese wrote: | Hello, | | I have a package under development that uses Rcpp modules to expose | some C++ classes. I hadn't touched the package for some months (close | to a year). At that time the package compiled and installed without problem | and w

Re: [Rcpp-devel] Rcpp is the most downloaded package from CRAN

2017-10-11 Thread Dirk Eddelbuettel
On 11 October 2017 at 10:27, Serguei Sokol wrote: | Just to share this survey that claims something that your always knew | but probably never had statistics to prove it ;) -- Rcpp is the most downloaded package from CRAN! | http://redmonk.com/rstephens/2017/10/10/r-package-downloads/ Oh, we do

Re: [Rcpp-devel] Rcpp + Package -> undefined symbol

2017-08-02 Thread Sokol Serguei
Michaël Benesty has written at Wed, 2 Aug 2017 23:26:26 +0200 Thank you a lot Mr. Kou. The package is now compiling and I have updated it to load modules at loading of the package (was quite tricky). Just to understand, the .cc has compiled just because you moved them in src/ folder, am I right?

Re: [Rcpp-devel] Rcpp + Package -> undefined symbol

2017-08-02 Thread Michaël BENESTY
Thank you a lot Mr. Kou. The package is now compiling and I have updated it to load modules at loading of the package (was quite tricky). Just to understand, the .cc has compiled just because you moved them in src/ folder, am I right? The -I flag in Makevars was not enough? Kind regards, Michaël _

Re: [Rcpp-devel] Rcpp + Package -> undefined symbol

2017-08-02 Thread Qiang Kou
Hi, Michael, All the ".cc" files need to be compiled to make your package work. Putting them in the inst/include folder is not enough. I made some quick changes in your package and please check the attachment. Best, Qiang Kou On Wed, Aug 2, 2017 at 11:22 AM, Michaël BENESTY wrote: > Hi, > >

Re: [Rcpp-devel] Rcpp + Package -> undefined symbol

2017-08-02 Thread Dirk Eddelbuettel
On 2 August 2017 at 21:02, Michaël BENESTY wrote: | Thank you Dirk for this answer. | | The source code of Fasttext is already embedded in the package (it is | the content of ../inst/include/ and is linked with PKG_CPPFLAGS + | include of headers). | So no issue with user having it or needing to

Re: [Rcpp-devel] Rcpp + Package -> undefined symbol

2017-08-02 Thread Michaël BENESTY
Thank you Dirk for this answer. The source code of Fasttext is already embedded in the package (it is the content of ../inst/include/ and is linked with PKG_CPPFLAGS + include of headers). So no issue with user having it or needing to link with PKG_LIBS. I have checked the compilation with this M

Re: [Rcpp-devel] Rcpp + Package -> undefined symbol

2017-08-02 Thread Dirk Eddelbuettel
On 2 August 2017 at 20:22, Michaël BENESTY wrote: | Hi, | | I am trying to wrap the Fasttext lib from Facebook on R. | I have wrote a minimal code based on Rcpp.package.skeleton(module = TRUE) | | The C++ file compiles/works with sourceCpp() but it crashes when | building a package. | I have che

Re: [Rcpp-devel] Rcpp package linking to C++ library that depends on Qt5 core

2017-03-27 Thread Dirk Eddelbuettel
On 27 March 2017 at 19:18, i...@mycontent.gr wrote: | Dear members of the Rcpp-devel list, | | I would like to ask for your help with the following problem. I am | trying to use Rcpp to expose the functionality of a C++ library to R. | The C++ library is open source, but it depends on Qt (versi

Re: [Rcpp-devel] Rcpp sugar for double?

2017-02-22 Thread Dirk Eddelbuettel
Eridk, See these Rcpp Gallery article from 2012 for worked examples: - http://gallery.rcpp.org/articles/using-rmath-functions/ has an example on pnorm that applies to your dnorm case - http://gallery.rcpp.org/articles/random-number-generation/ discusses the RNGs, but the d/p/q

  1   2   3   4   5   6   7   8   >