I am getting an error as below when trying to compile stan code. I can however see the Eigen.hpp file in that path. Does anyone know why is this happening? I have tried both RStudio and R console directly, but same error.
Compilation ERROR, function(s)/method(s) not created!
Error in compileCode(f, code, language = language, verbose = verbose) :
cc1plus.exe: fatal error: …/R/R-4.1.1/library/StanHeaders/include/stan/math/prim/mat/fun/Eigen.hpp: No such file or directorycompilation terminated.make: *** […/R/R-4.1.1/etc/x64/Makeconf:245: file4ff05ac045af.o] Error 1
Session info ----------------------------------------------------------------------------------------------------------------
setting value
version R version 4.1.1 (2021-08-10)
os Windows 10 x64
system x86_64, mingw32
ui Rgui
language (EN)
collate English_United States.1252
ctype English_United States.1252
tz America/New_York
date 2021-09-15
I also wanted to add that i have tried reinstalling StanHeaders package, and i have noticed that there maybe an issue with the UNC path. I see the below message, maybe i need to somehow direct R to install the package in C\Users\ga instead? If so, how do i do it?
‘\fnyipw01\HOB_FID_Home\ga’
CMD.EXE was started with the above path as the current directory.
UNC paths are not supported. Defaulting to Windows directory.
Ah yes, this is likely to be the issue: \fnyipw01\HOB_FID_Home\ga
That indicates that your R package library is located on a network drive, not somewhere locally on your computer. When this is the case, R can have troubles loading compilation dependencies from installed packages.
I did a clean install of R in C: drive, where I have full admin rights and now I am able to compile. I will review the previous post that you pointed out above and see if that solves my issue.