I want to link to the R statistical package in IronPython by using the R.NET library. It’s been working fine, but now I need to use R’s mgcv library.
Importing mgcv fails (import is done with the command rdn.r.EagerEvaluate("library(mgcv)"), where rdn is an IronPython object that wraps the R.NET library). When the import fails, Windows opens a dialog box that says: “The program can’t start because Rlapack.dll is missing from your computer. Try reinstalling the program to fix this problem.”
Of course, R never would have worked in the first place if Rlapack.dll was missing, so what is going on?
I inspected the dependencies of the
mgcvpackage; they include the base packageMatrix. As it turns out,Matrixhas been compiled to a dll (found at ${R_HOME}/library/Matrix/libs/i386/Matrix.dll) by the R development team. That dll needs to link to Rlapack.dll, which for some reason it cannot find when R is called from R.NET in IronPython.The solution was to drop a copy of Rlapack.dll (which you can find in ${R_HOME}/bin/i386/) into the same directory as Matrix.dll. Now every day is Sunday.