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?

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

2025-03-11 Thread Stefan Boehringer
Dear all, 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. The underlying C++ class allocates memory through standard STL object allocation. The class does perform di

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

2023-05-30 Thread Dominick Samperi
jor 4 >>> #> minor 3.0 >>> #> year 2023 >>> #> month 04 >>> #> day21 >>> #> svn rev84292 >>> #> language R >>> #> version.string R version 4.3

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

2023-05-30 Thread Dominick Samperi
; #> month 04 >> #> day21 >> #> svn rev84292 >> #> language R >> #> version.string R version 4.3.0 (2023-04-21 ucrt) >> #> nickname Already Tomorrow >> packageVersion("Rcpp") >> #> [1] &#x

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
2023 > #> month 04 > #> day21 > #> svn rev84292 > #> language R > #> version.string R version 4.3.0 (2023-04-21 ucrt) > #> nickname Already Tomorrow > packageVersion("Rcpp") > #> [1] '1.0

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

2023-05-30 Thread Alexander Ilich
21 #> svn rev84292 #> language R #> version.string R version 4.3.0 (2023-04-21 ucrt) #> nickname Already Tomorrow packageVersion("Rcpp") #> [1] '1.0.10' From: Rcpp-devel on behalf of Dominick Sam

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) { |    

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

2023-05-30 Thread Dominick Samperi
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) { return v; }' ) cpptest(1:5) This works without problems under R 4.2.3,

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
statistics > > Medical College of Wisconsin, Milwaukee Campus > ___ > Rcpp-devel mailing list > Rcpp-devel@lists.r-forge.r-project.org > https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/rcpp-devel > ___

[Rcpp-devel] Rcpp equivalent for Python?

2022-12-03 Thread Sparapani, Rodney
Hi Gang: 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 Python (after 30 years with S/R and C++ I am still learn

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

2022-08-03 Thread Jean Thioulouse
ettes) >>>>>>> that I could use R CMD SHLIB to build a shared library and then >>>>>>> dyn.load it in R. I have created a file named ade4lib.cpp containing >>>>>>> the utilities functions in the src directory, and I can make the shared >>>>>>> library (ade4lib.so) with RCMD SHLIB. But this does not solve my >>>>>>> problem because, as I understand it, this makes the utilities library >>>>>>> functions available to R (which is useless since they are not >>>>>>> interfaced correctly to R but to C++), and not to the other C++ >>>>>>> functions (which is what i need to do). >>>>>>>> Can anybody see where I am mistaken, and point me to the right >>>>>>>> direction to accomplish this ? >>>>>>>> Thank you, >>>>>>>> Jean >>>>>>>> —- >>>>>>>> Jean THIOULOUSE - >>>>>>>> https://lbbe-web.univ-lyon1.fr/en/annuaires-des-membres/thioulouse-jean >>>>>>>> https://orcid.org/-0001-7664-0598 (ORCID page) >>>>>>>> https://www.springer.com/fr/book/9781493988488 (ade4 Book) >>>>>>>> https://pbil.univ-lyon1.fr/JTHome/Biblio/ThioulouseEB2021.pdf (Evol. >>>>>>>> Biol. paper) >>>>>>>> ___ >>>>>>>> Rcpp-devel mailing list >>>>>>>> Rcpp-devel@lists.r-forge.r-project.org >>>>>>>> https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/rcpp-devel >>>>>>> >>>>> >>> > ___ Rcpp-devel mailing list Rcpp-devel@lists.r-forge.r-project.org https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/rcpp-devel

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
001-7664-0598 (ORCID page) https://www.springer.com/fr/book/9781493988488 (ade4 Book) https://pbil.univ-lyon1.fr/JTHome/Biblio/ThioulouseEB2021.pdf (Evol. Biol. paper) ___ Rcpp-devel mailing list R

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

2022-06-23 Thread THIOULOUSE JEAN
ities >>>>> functions in the src directory, and I can make the shared library >>>>> (ade4lib.so) with RCMD SHLIB. But this does not solve my problem because, >>>>> as I understand it, this makes the utilities library functions available >>&

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

2022-06-23 Thread Serguei Sokol
er.com/fr/book/9781493988488 (ade4 Book) https://pbil.univ-lyon1.fr/JTHome/Biblio/ThioulouseEB2021.pdf (Evol. Biol. paper) ___ Rcpp-devel mailing list Rcpp-devel@lists.r-forge.r-project.org https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/rcpp-de

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

2022-06-23 Thread Jean Thioulouse
s the utilities library functions available to >>> R (which is useless since they are not interfaced correctly to R but to >>> C++), and not to the other C++ functions (which is what i need to do). >>>> Can anybody see where I am mistaken, and point me to the right dire

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

2022-06-23 Thread Serguei Sokol
CID page) https://www.springer.com/fr/book/9781493988488 (ade4 Book) https://pbil.univ-lyon1.fr/JTHome/Biblio/ThioulouseEB2021.pdf (Evol. Biol. paper) ___ Rcpp-devel mailing list Rcpp-devel@lists.r-forge.r-project.org https://lists.r-forge.r-project.org/cgi-

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

2022-06-23 Thread Jean Thioulouse
t;> https://lbbe-web.univ-lyon1.fr/en/annuaires-des-membres/thioulouse-jean >> https://orcid.org/-0001-7664-0598 (ORCID page) >> https://www.springer.com/fr/book/9781493988488 (ade4 Book) >> https://pbil.univ-lyon1.fr/JTHome/Biblio/ThioulouseEB2021.pdf (Evol. Biol. >> paper) >> __

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

2022-06-23 Thread Serguei Sokol
pbil.univ-lyon1.fr/JTHome/Biblio/ThioulouseEB2021.pdf (Evol. Biol. paper) ___ Rcpp-devel mailing list Rcpp-devel@lists.r-forge.r-project.org https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/rcpp-devel _____

[Rcpp-devel] Rcpp shared libraries (?)

2022-06-23 Thread THIOULOUSE JEAN
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 all my C++ functions run fine in the dedicated Gi

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
cpp-devel mailing list > Rcpp-devel@lists.r-forge.r-project.org > https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/rcpp-devel ___ Rcpp-devel mailing list Rcpp-devel@lists.r-forge.r-project.org https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/rcpp-devel

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
s=1) > > > Best, > Vithor > ___ > Rcpp-devel mailing list > Rcpp-devel@lists.r-forge.r-project.org > https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/rcpp-devel ___ Rcpp-devel mailing list Rcpp-devel@lists.r-forge.r-project.org https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/rcpp-devel

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

2021-12-02 Thread Víthor Rosa
Hi everyone, I am using Rcpp to develop my own package and one of my functions calls back into R for a given amount of iterations. To speed up the process, I wanted to use Rcpp::unwindProtect. However, I couldn't find on Rcpp's documentation what is the correct way to use this plugin. Therefore, I

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

2021-08-20 Thread Serguei Sokol
additional hints. -- Iñaki Úcar _______ Rcpp-devel mailing list Rcpp-devel@lists.r-forge.r-project.org https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/rcpp-devel ___ Rcpp-devel mailing list Rcpp-devel@lists.r-forge.r-project.org https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/rcpp-devel

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

2021-08-19 Thread Sokol Serguei
nside the parallel region, so that OpenMP knows that they are private without additional hints. -- Iñaki Úcar ___ Rcpp-devel mailing list Rcpp-devel@lists.r-forge.r-project.org https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/rcpp-devel ___

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

2021-08-19 Thread Sokol Serguei
ate without additional hints. -- Iñaki Úcar ___ Rcpp-devel mailing list Rcpp-devel@lists.r-forge.r-project.org https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/rcpp-devel ___ Rcpp-devel mailing list Rcpp-devel@lists.r-fo

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
_helper.R> Best regards, Naeem Khoshnevis ___ Rcpp-devel mailing list Rcpp-devel@lists.r-forge.r-project.org https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/rcpp-devel ___ Rcpp-devel m

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.

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

2021-08-18 Thread Naeem Khoshnevis
Dear all, I wrote a function using Rcpp; it is a simple function; however, it significantly improves the performance. I realized that on some systems, the result of the function is different from others. For example, on the following systems (on rhub), the results are identical and are correct:

[Rcpp-devel] Rcpp 1.0.7 now on CRAN

2021-07-07 Thread Dirk Eddelbuettel
Rcpp 1.0.7 is now on CRAN. As emailed here on Saturday, we actually needed to make one change relative to how Modules code from earlier builds is handled. (And with that I replaced the 1.0.7 version in the drat repo; if you installed it earlier than today, and "experience symptoms", consider an u

[Rcpp-devel] Rcpp 1.0.7

2021-07-03 Thread Dirk Eddelbuettel
Rcpp 1.0.7 was uploaded to CRAN; it may take a few days to sort the release out as it the weekend and as the number of reverse dependencies may throw up an issue or two. In the mean time you can get the release from the usual drat repo. See the NEWS.Rd for a summary of changes. Thanks to everyb

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(

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

2021-07-01 Thread Dr Gregory Jefferis
Dear RcppUsers, I feel like there must be a simple way to do the equivalent of sapply(L, length) in Rcpp but I can't seem to get past the problem of converting the elements of L into a type for which .size() or .length() are valid. I see that I could do this using some long switch(TYPEOF(x))

[Rcpp-devel] (Rcpp)Armadillo deprecation warnings and CRAN

2020-11-04 Thread Dirk Eddelbuettel
If anybody needs help with the 'deprecation' warnings from CRAN let me. I assisted one package with a pull request that updated matrix initialization / assignment to the more common C++11 form, and can probably help others too if you let me know where your repo is. For reference, the Armadillo do

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

2020-05-25 Thread Kevin Ushey
for PosInf vs. NegInf, or would that end up being a call to > std::numeric_limits anyway? > > As always, thanks to Dirk, Romain, JJ, Kevin, and everyone! > > Thank you, > > Avi > ___ > Rcpp-de

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

2020-05-24 Thread Avraham Adler
As I was updating one of my packages (lamW), CRAN's reverse dependency tests caught an error of my own making. For consistency, I was trying to remove calls to std::numeric_limits and replace them with R magic words (like R_NaN instead of std::numeric_limits::quiet_NaN()). One of the changes I mad

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

[Rcpp-devel] Rcpp 1.0.4.6

2020-04-04 Thread Dirk Eddelbuettel
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 was fixed rightaway. The repaired upload has been sitting there

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

2020-03-23 Thread Alexis Sarda
't. > > > > Standard GNU mailman mailing list setup so attachments are stripped. > > > > Dirk > > > > [1] > http://developer.r-project.org/Blog/public/2019/03/28/use-of-c---in-packages/index.html > > [2] There are exceptions. I think the errors agains

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

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

2020-03-22 Thread Venelin Mitov
Dear Rcpp-devel list, I was forwarded to this list after posting the same question on the R-help list. In an e-mail received yesterday from a member of the CRAN maintainer team, I was informed that one of my packages, PCMBaseCpp (https://CRAN.R-project.org/package=PCMBaseCpp), is going to be remo

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

[Rcpp-devel] Rcpp 1.0.4 release candidate

2020-03-07 Thread Dirk Eddelbuettel
Hi all, It is March already! Which not only means that Spring and March Madness are around the corner, but also that we should have another Rcpp release at the current thrice-a-year cadence. Rcpp 1.0.3.8 is the current tip of master. I more or less continually test it anyway, and have tested it

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
-devel mailing list > Rcpp-devel@lists.r-forge.r-project.org > https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/rcpp-devel ___ Rcpp-devel mailing list Rcpp-devel@lists.r-forge.r-project.org https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/rcpp-devel

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
; > that "some C++ exception happened" and grab the stack_trace > > immediately before returning control to R? > > Isn't Rcpp::stop's entire purpose to return control to R immediately? > > Iñaki > ___ > Rcpp-devel mailing list > Rcpp-devel@lists.r-forge.r-project.org > https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/rcpp-devel ___ Rcpp-devel mailing list Rcpp-devel@lists.r-forge.r-project.org https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/rcpp-devel

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

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

2020-02-06 Thread Joshua N Pritikin
The Rcpp::exception constructor does, rcpp_set_stack_trace(Shield(stack_trace())) This can corrupt R if called within an OpenMP block. It would be nice if there were some warnings about this (mis)usage OR, better, if Rcpp::exception was thread-safe. Here's the usage that should be A-OK: std

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
gt; > > Best wishes > > > > gerhard_boeni...@bgc-jena.mpg.de > > <mailto:gerhard_boeni...@bgc-jena.mpg.de> > > > > Scientific Data Manager > > > > Dr. Gerhard Boenisch Phone: +49 364

Re: [Rcpp-devel] rcpp compile problem

2020-01-28 Thread Serguei Sokol
forge.r-project.org https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/rcpp-devel ___ Rcpp-devel mailing list Rcpp-devel@lists.r-forge.r-project.org https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/rcpp-devel

[Rcpp-devel] rcpp compile problem

2020-01-28 Thread Gerhard Boenisch
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 R. I am currently using R 3.4.4 (the last version BHP

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

[Rcpp-devel] RCPP Issue with nonunicode User characters

2019-12-06 Thread John O'Shea
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 running into issues with any usage of the Rcpp package. My

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

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

2019-04-04 Thread Chengyang . Ji12
Hi, 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 for help on the usage but am not contributing to Rcpp a

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
; Ust.-IdNr.: DE300072622 > Geschäftsführer: Dr.-Ing. Stefan Knirsch, Prof. Dr. Dr. Karl-Kuno Kunze > > ___ > Rcpp-devel mailing list > Rcpp-devel@lists.r-forge.r-project.org > https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/rcpp-devel _

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-devel mailing list > Rcpp-devel@lists.r-forge.r-project.org > https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/rcpp-devel ___ Rcpp-devel mailing list Rcpp-devel@lists.r-forge.r-project.org https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/rcpp-devel

[Rcpp-devel] Rcpp - libtorrent

2019-02-10 Thread Morgan Morgan
Hi All, I hope you are well. I wanted to have your view regarding the feasibility of a project. There is c++ library called libtorrent. I was wondering if it would be possible to use Rcpp in order to call some of libtorrent's functionality from R. It seems that there are some python bindings fo

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

[Rcpp-devel] Rcpp 0.12.19

2018-09-25 Thread Dirk Eddelbuettel
I uploaded Rcpp 0.12.19 to CRAN four days, after one final revision made to a first upload. It has been pre-inspected, tested, washed, dried, rinsed and what not but is just sitting there in "pending" for no reason I can discern, and of course CRAN does not reply to emails. Presumably it will ge

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

[Rcpp-devel] Rcpp Class

2018-09-14 Thread Dale Smith
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. I’ve not heard of any classes since, but it strikes me that there are enough people familiar with Rcpp to run regional classes. This would make travel easier. Or, core members

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
vely. Hope it helps. Iñaki > > Thanks and best regards, > Vissarion. > ___ > Rcpp-devel mailing list > Rcpp-devel@lists.r-forge.r-project.org > https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/rcpp-devel

[Rcpp-devel] Rcpp package structure

2018-07-12 Thread Vissarion Fisikopoulos
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 Rcpp package structure is in root/R-proj, C++ header files are in root/include and we ha

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

  1   2   3   4   5   6   7   8   9   10   >