You could switch from using cxxfunction()
from package inline to using Rcpp attributes and its sourceCpp()
. That way you get the predictable function headers at the C++ level, see the Rcpp atributes vignette.
Or split calc1
and calc2
into 'worker' and 'wrapper', have cxxfunction()
around the wrapper allowing you to call the worker.
The key issue here really is that cxxfunction()
exists to create an R-callable function, and it generates internal randomized function headers.
Lastly, a package would help too.