Including autodifferentiation c++ code in Rstan

Hey Ben – how are you getting that error output? I’d be happy to follow things error by error, but the output from R has been less informative than what you’ve posted above. I tried adding the verbose = TRUE argument, but this just gives me a deluge of meaningless output.

For example, attached are my updated files (using C++ templates), which give the error :

running command '/Library/Frameworks/R.framework/Resources/bin/R CMD SHLIB fileb73a60e25b0f.cpp 2> fileb73a60e25b0f.cpp.err.txt' had status 1Error in compileCode(f, code, language = language, verbose = verbose) : 
  Compilation ERROR, function(s)/method(s) not created! In file included from fileb73a60e25b0f.cpp:8:
In file included from /Library/Frameworks/R.framework/Versions/3.5/Resources/library/StanHeaders/include/src/stan/model/model_header.hpp:4:
In file included from /Library/Frameworks/R.framework/Versions/3.5/Resources/library/StanHeaders/include/stan/math.hpp:4:
In file included from /Library/Frameworks/R.framework/Versions/3.5/Resources/library/StanHeaders/include/stan/math/rev/mat.hpp:4:
In file included from /Library/Frameworks/R.framework/Versions/3.5/Resources/library/StanHeaders/include/stan/math/rev/core.hpp:5:
In file included from /Library/Frameworks/R.framework/Versions/3.5/Resources/library/StanHeaders/include/stan/math/rev/core/build_vari_array.hpp:4:
In file included from /Library/Frameworks/R.framework/Versions/3.5/Resources/library/StanHeaders/include/stan/math/prim/mat/fun/Eigen.hpp:4:
In file included from /Library/Frameworks/R.framework/Versions/3.5/Resources/l
Error in sink(type = "output") : invalid connection

from my R console. Existing documentation on Error in sink(type = "output") : invalid connection suggest a change in my CFLAGS for my R’s Markvars file. I’ve done this, but the error remains.

lgammaJacLinf.hpp (735 Bytes) gamma.stan (253 Bytes) gammaCDFderiv.hpp (249 Bytes)