Hi all,
I am trying to use Stan Math C++ library in an R package (for automatic differentiation). It is working fine on Linux, but Windows users reported an error installing the package. I made a simpler package stanmathtest for testing this.
On Windows, the error is something like:
Error: package or namespace load failed for 'stanmathtest' in inDL(x, as.logical(local), as.logical(now), ...):
unable to load shared object '[...]/R-library/00LOCK-stanmathtest/00new/stanmathtest/libs/x64/stanmathtest.dll':
LoadLibrary failure: The specified module could not be found.
The error is the same whether I run on a personal computer or on win-builder. The compilation is working, then something strange with DLL is happening that I don’t understand. (I can get the package functions working on Windows by downloading the source and running devtools::load_all(path_to_package_source), but installation still fails.)
I made the the simple package by running Rcpp.package.skeleton then adding in Makevars and Makevars.win and copying the first bit of C++ code from the StanHeaders vignette. I seem to get the same error whenever I have #include <stan/math.hpp> in the C++ code (I get the error even when no features of Stan Math library are used in the code itself).
Any thoughts or ideas for a solution or workaround would be much appreciated.
Thank you!
Helen