Hi Michael,
Thanks for posting here. There is a lot of meat in this post, so I'll try to
be brief. It is also late, so my concentration may not be at full tilt.
I think in principle dlopen() should work. I never looked at exactly how R's
own dyn.load() is implemented but I suspect it uses dlope
Already a colleague distills my long post:
What we want is three R functions, that
A. call a C++ program to read a Stan graphical model specification
and generate C++ code for a class extending an abstract base class
as well as factory methods to create/destroy instances,
B. compile the C++ co