Error in compileCode(f, code, language = language, verbose = verbose) :
Compilation ERROR, function(s)/method(s) not created! Error in .shlib_internal(commandArgs(TRUE)) :
C++14 standard requested but CXX14 is not defined
Calls: <Anonymous> -> .shlib_internal
Execution halted
In addition: Warning message:
In system(cmd, intern = !verbose) :
running command 'C:/PROGRA~1/R/R-36~1.0/bin/x64/R CMD SHLIB file1a1860a0379.cpp 2> file1a1860a0379.cpp.err.txt' had status 1
Error in sink(type = "output") : invalid connection
На некоторых неанглийских страницах сказано, что мы можем преодолеть, выполнив следующий R-скрипт, но в моем случае это не сработало:
dotR <- file.path(Sys.getenv("HOME"), ".R")
if (!file.exists(dotR))
dir.create(dotR)
M <- file.path(dotR, "Makevars")
if (!file.exists(M))
file.create(M)
cat("\nCXX14FLAGS=-O3 -Wno-unused-variable -Wno-unused-function",
"CXX14 = g++ -std=c++1y",
file = M, sep = "\n", append = TRUE)
Вышеуказанный R-скрипт такой же, как вследующая страница:
https://github.com/stan-dev/rstan/issues/569
Я пытался удалить и установить в соответствии со следующей страницей, но произошла вышеуказанная ошибка.
Установка Rstan: https://github.com/stan-dev/rstan/wiki/RStan-Getting-Started
REF;https://github.com/stan-dev/stan/issues/1613
ref: https://github.com/stan-dev/rstan/issues/633