Charles Novaes de Santana
2015-Feb-02 19:00 UTC
[R] A good way to debug a c++ library embedded to an R code
Dear all, I am using R CMD SHLIB to compile a c++ code into a library (.so) and dyn.load to load this library into a R code. I am facing some problems in the c++ part that I can not figure out how to solve. Do you recomend any good way to debug this R + C++ program? If I was programming only in C++ I would use GDB. I would much appreciate any help or suggestion! Best regards, Charles -- Um ax?! :) -- Charles Novaes de Santana, PhD http://www.imedea.uib-csic.es/~charles [[alternative HTML version deleted]]
Qiang Kou
2015-Feb-02 21:42 UTC
[R] A good way to debug a c++ library embedded to an R code
If you are familiar with GDB, you can just start R by "R -d gdb". Dirk gave a good example on SO, please check the link below: http://stackoverflow.com/questions/11345537/debugging-line-by-line-of-rcpp-generated-dll-under-windows Best, KK On Mon, Feb 2, 2015 at 2:00 PM, Charles Novaes de Santana < charles.santana at gmail.com> wrote:> Dear all, > > I am using R CMD SHLIB to compile a c++ code into a library (.so) and > dyn.load to load this library into a R code. I am facing some problems in > the c++ part that I can not figure out how to solve. Do you recomend any > good way to debug this R + C++ program? If I was programming only in C++ I > would use GDB. > > I would much appreciate any help or suggestion! > > Best regards, > > Charles > > -- > Um ax?! :) > > -- > Charles Novaes de Santana, PhD > http://www.imedea.uib-csic.es/~charles > > [[alternative HTML version deleted]] > > ______________________________________________ > R-help at r-project.org mailing list -- To UNSUBSCRIBE and more, see > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide > http://www.R-project.org/posting-guide.html > and provide commented, minimal, self-contained, reproducible code.-- Qiang Kou qkou at umail.iu.edu School of Informatics and Computing, Indiana University [[alternative HTML version deleted]]
Pierrick Bruneau
2015-Feb-03 06:09 UTC
[R] A good way to debug a c++ library embedded to an R code
There's also a section about this in "Writing R extensions": http://cran.r-project.org/doc/manuals/r-release/R-exts.html#Debugging-compiled-code Pierrick On Mon, Feb 2, 2015 at 10:42 PM, Qiang Kou <qkou at umail.iu.edu> wrote:> If you are familiar with GDB, you can just start R by "R -d gdb". > > Dirk gave a good example on SO, please check the link below: > > http://stackoverflow.com/questions/11345537/debugging-line-by-line-of-rcpp-generated-dll-under-windows > > Best, > > KK > > On Mon, Feb 2, 2015 at 2:00 PM, Charles Novaes de Santana < > charles.santana at gmail.com> wrote: > >> Dear all, >> >> I am using R CMD SHLIB to compile a c++ code into a library (.so) and >> dyn.load to load this library into a R code. I am facing some problems in >> the c++ part that I can not figure out how to solve. Do you recomend any >> good way to debug this R + C++ program? If I was programming only in C++ I >> would use GDB. >> >> I would much appreciate any help or suggestion! >> >> Best regards, >> >> Charles >> >> -- >> Um ax?! :) >> >> -- >> Charles Novaes de Santana, PhD >> http://www.imedea.uib-csic.es/~charles >> >> [[alternative HTML version deleted]] >> >> ______________________________________________ >> R-help at r-project.org mailing list -- To UNSUBSCRIBE and more, see >> https://stat.ethz.ch/mailman/listinfo/r-help >> PLEASE do read the posting guide >> http://www.R-project.org/posting-guide.html >> and provide commented, minimal, self-contained, reproducible code. > > > > > -- > Qiang Kou > qkou at umail.iu.edu > School of Informatics and Computing, Indiana University > > [[alternative HTML version deleted]] > > ______________________________________________ > R-help at r-project.org mailing list -- To UNSUBSCRIBE and more, see > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide http://www.R-project.org/posting-guide.html > and provide commented, minimal, self-contained, reproducible code.