Error in compileCode(f, code, language = language, verbose = verbose) : Compilation ERROR, function(s)/method(s) not created! Again

Maybe

Sys.setenv(LOCAL_LIBS = paste(
shQuote('C:/R/win-library/4.0/rstan/lib/x64/libStanServices.a'),
"-L", shQuote('C:/R/win-library/4.0/StanHeaders/libs/x64'),
" -lStanHeaders -L", shQuote('C:/R/win-library/4.0/RcppParallel/lib/x64'),
" -ltbb"))

?
?

Still get:

Error in compileCode(f, code, language = language, verbose = verbose) :
Compilation ERROR, function(s)/method(s) not created! g++.exe: error: C:/R/win-library/4.0/rstan/lib/x64/libStanServices.a: No such file or directory

pm’d you in case it’s helpful.

OK. @Charles_Driver and I have likely tracked down the problem over Zoom.

The solution has to go into rstan. I’ll have binaries on winbuilder to test with in about an hour.

thank you!!

@andrjohns @Charles_Driver @JacobCoblentz

In a clean R session without any old stanfit objects being autoloaded, try doing

install.packages(
"https://win-builder.r-project.org/8bPDZPDG0522/rstan_2.21.2.zip",
repos = NULL, type = "win.binary")

then

example(stan_model, package = "rstan", run.dontrun = TRUE)

plus whatever examples were not working before.

1 Like

yes, seems to be working now :)

works perfectly!

@bgoodri
Hi, thank you! However, a new error comes up.

Error: package or namespace load failed for ‘rstan’ in inDL(x, as.logical(local), as.logical(now), …):
unable to load shared object ‘C:/Users/Ihn-Whi Heo/Documents/R/win-library/3.6/rstan/libs/x64/rstan.dll’:
LoadLibrary failure: 지정된 프로시저를 찾을 수 없습니다 (cannot find the allocated procedure).
In addition: Warning message:
package ‘rstan’ was built under R version 4.0.2

What should I do?

Do you know what 지정된 프로시저를 찾을 수 없습니다 says in English?

Sure. That means “cannot find the allocated procedure”

Does it also say which allocated procedure it cannot find?

Yes, exactly.

For example, does it say "cannot find foo" where foo is the name of a function?

No, it does not specifically mention the name of the function.
It indeed only says that “It cannot find the allocated procedure”. That’s all.

Can you try

Sys.setenv(LANG = "en")
install.packages(
"https://win-builder.r-project.org/8bPDZPDG0522/rstan_2.21.2.zip",
repos = NULL, type = "win.binary")

so that it will hopefully emit an error message in English?

Error: package or namespace load failed for ‘rstan’ in inDL(x, as.logical(local), as.logical(now), …):
unable to load shared object ‘C:/Users/Ihn-Whi Heo/Documents/R/win-library/3.6/rstan/libs/x64/rstan.dll’:
LoadLibrary failure: 지정된 프로시저를 찾을 수 없습니다.
In addition: Warning message:
package ‘rstan’ was built under R version 4.0.2

No… error message is still not in English.
지정된 프로시저를 찾을 수 없습니다 still means (in direct translation) cannot find the allocated procedure

@bgoodri
Just in case, please note that my StanHeaders version is StanHeaders_2.21.0-5, and R version is 3.6.3. (OS is in Windows)

Ah, possibly the problem is that you have R 3.6.3 but “package ‘rstan’ was built under R version 4.0.2”. I will make a temporary rstan for R 3.6.3 now.

Ah… I appreciate it! Please let me know if you are done. I will try it right away.
Also, let me know if I have to remove some packages before that, and if that is the case, is there any special code?