<div dir="ltr">Dear Rcpp developers:<br><br>Thanks for developing and maintaining the Rcpp package. <br>I wrote a function in Rcpp. It is available throughout the package and works as expected; however, it is not available for praLapply workers. A temporary fix is just using Rcpp::cppFunction inside the function that parLapply workers call and copy the entire function over there. However, this does not seem right for bigger and more complicated functions.<br>I would be grateful if you could let me know whether there is a better long-term solution. Here is the package and three functions that you might want to take a look at.<br><br>Original cpp function:<br><a href="https://github.com/fasrc/CausalGPS/blob/master/src/compute_closest_wgps_helper.cpp">https://github.com/fasrc/CausalGPS/blob/master/src/compute_closest_wgps_helper.cpp</a><br><br>Wrapper function that calls this function + temporal fix:<br><a href="https://github.com/fasrc/CausalGPS/blob/master/R/compute_closest_wgps.R">https://github.com/fasrc/CausalGPS/blob/master/R/compute_closest_wgps.R</a><br><br>The function that uses parLapply (please see line 63-89) to run the c++ code:<br><a href="https://github.com/fasrc/CausalGPS/blob/master/R/compute_closest_wgps.R">https://github.com/fasrc/CausalGPS/blob/master/R/compute_closest_wgps.R</a><br><br>Best regards,<br>NaeemĀ <br></div>