Charles Novaes de Santana
2015-Feb-02 18:59 UTC
[Rd] A good way to debug a c++ library embedded to 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++ code 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]]
Gabriel Becker
2015-Feb-02 20:02 UTC
[Rd] A good way to debug a c++ library embedded to R code
Charles, Run R under gdb R -d gdb You can then set breakpoints and catch problems in C(++) code run under R. ~G On Mon, Feb 2, 2015 at 10:59 AM, 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++ code 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-devel at r-project.org mailing list > https://stat.ethz.ch/mailman/listinfo/r-devel >-- Gabriel Becker, PhD Computational Biologist Bioinformatics and Computational Biology Genentech, Inc. [[alternative HTML version deleted]]
Charles Novaes de Santana
2015-Feb-02 20:12 UTC
[Rd] A good way to debug a c++ library embedded to R code
Thank you, Gabriel! I didn't know I could do it! I will try it! Best, Charles On Mon, Feb 2, 2015 at 9:02 PM, Gabriel Becker <gmbecker at ucdavis.edu> wrote:> Charles, > > Run R under gdb > > R -d gdb > > You can then set breakpoints and catch problems in C(++) code run under R. > > ~G > > On Mon, Feb 2, 2015 at 10:59 AM, 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++ code 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-devel at r-project.org mailing list >> https://stat.ethz.ch/mailman/listinfo/r-devel >> > > > > -- > Gabriel Becker, PhD > Computational Biologist > Bioinformatics and Computational Biology > Genentech, Inc. >-- Um ax?! :) -- Charles Novaes de Santana, PhD http://www.imedea.uib-csic.es/~charles [[alternative HTML version deleted]]
Dan Tenenbaum
2015-Feb-02 20:14 UTC
[Rd] A good way to debug a c++ library embedded to R code
----- Original Message -----> From: "Gabriel Becker" <gmbecker at ucdavis.edu> > To: "Charles Novaes de Santana" <charles.santana at gmail.com> > Cc: "r-devel" <r-devel at r-project.org> > Sent: Monday, February 2, 2015 12:02:27 PM > Subject: Re: [Rd] A good way to debug a c++ library embedded to R code > > Charles, > > Run R under gdb > > R -d gdb > > You can then set breakpoints and catch problems in C(++) code run > under R. >Although I don't usually use videos to learn things, and this one is a few years old, it's quite good and still accurate: http://vimeo.com/11937905 I refer to it whenever I need to debug C code in an R package. Dan> ~G > > On Mon, Feb 2, 2015 at 10:59 AM, 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++ code 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-devel at r-project.org mailing list > > https://stat.ethz.ch/mailman/listinfo/r-devel > > > > > > -- > Gabriel Becker, PhD > Computational Biologist > Bioinformatics and Computational Biology > Genentech, Inc. > > [[alternative HTML version deleted]] > > ______________________________________________ > R-devel at r-project.org mailing list > https://stat.ethz.ch/mailman/listinfo/r-devel >