Skip to content

Debug with RCPP #4534

Aug 30, 2024 · 5 comments · 3 replies
Discussion options

You must be logged in to vote

Do you actually use sourceCpp() like this in your "real" code? Or do you use Rcpp in a package? It is much easier to do this debugging if its inside an actual package. When you use sourceCpp(), your C++ file gets copied to a cache directory (that you typically can't see) and gets built from there. So if you set any breakpoints in your find_max.cpp C++ file, they won't be activated. I was able to workaround this by forcing the cache directory to be inside my project, and then I could go set a breakpoint in the copied C++ file and that fixed things.

Also what OS are you on? We've only heavily tested this on a Mac.

Here is a longform video of me getting this to work. The files used here are …

Replies: 5 comments 3 replies

Comment options

You must be logged in to vote
1 reply
@ZIBOWANGKANGYU
Comment options

Answer selected by ZIBOWANGKANGYU
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
2 replies
@lionel-
Comment options

lionel- Aug 30, 2024
Collaborator

@DavisVaughan
Comment options

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
4 participants