One thought : is the problem related only to rstan? Would this problem be solved with a light R interface to Cmdstan?