Override default Makevars #3
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
On some Linux based platforms, when installing a library using the
R CMD INSTALLcommand, the binaries in thesrcfolder are compiled omitting the-gparameter. The generated shared object for the library is missing debug symbols.When installing a library using the
R CMD INSTALLcommand on some Linux systems, the binaries in thesrcfolder are built without the-gflag. The result is that debug symbols are missing from the library's created shared object.When RcppDeepState and, in particular, Valgrind are used to evaluate such a package, the outcome is an empty table from the
deepstate_harness_analyze_pkgfunction.There appears to be no error, from the fuzz testing analysis. However, a closer look at the resulting XML file reveals some errors found by Valgrind: the problem is that the errors are related to the shared object file rather than the original function.
Fixes #2
Solution
The solution is to override the current
Makevarsfile in order to set the additional pre processor option-gto the compilation procedure run by theR CMD INSTALLcommand. The right method to accomplish this, as specified on the R project documentation page, is to createMakevarsfile in the package'ssrcfolder before running the installation command.The function
deepstate_pkg_createin thepkg_harness_create.Rfile in RcppDeepState runs theR CMD INSTALL. The goal of the solution is to intercept this system shell call and produce theMakevarsfile before the compilation begins.