I have a new PC, and installed R, Rstudio, Rtools40 as instructed. It seems Rstan was installed and the example code ran ok although very slow. BUT when I ran a relatively simple model, it either crashed or reported “Error: cannot allocate vector of size 11766.6 Gb”.
Please help…
Thank you very much,
Jie
Here’s what I got from:
Sys.which(“make”)
make
“C:\rtools40\usr\bin\make.exe”
Sys.which(“g++”)
g++
Sys.getenv(“RTOOLS40_HOME”)
[1] “C:\rtools40”
Sys.getenv(“PATH”)
[1] “C:\rtools40\usr\bin;C:\Program Files\R\R-4.0.3\bin\x64;C:\oracle\product\11.2.0\client_1\bin;C:\Program Files (x86)\Common Files\Oracle\Java\javapath_target_102671;C:\Windows\System32;C:\Windows;C:\Windows\System32\wbem;C:\Windows\System32\WindowsPowerShell\v1.0;C:\Windows\System32\OpenSSH;C:\Program Files\1E\Client\Extensibility\NomadBranch;C:\oracle\product\11.2.0\client_1\bin;C:\Users\jgao\AppData\Local\Microsoft\WindowsApps”
Here’s what I did during installation:
-
install R-4.0.3-win
-
install RStudio-1.3.1093
-
Install Rtools40, “rtools40-x86_64”, using default settings
-
run
> writeLines('PATH="${RTOOLS40_HOME}\\usr\\bin;${PATH}"', con = "~/.Renviron")
- Now restart R, and verify that make can be found, which should show the path to your Rtools installation.
Sys.which(“make”)
install.packages("jsonlite", type = "source")
- #Makevars Configuration
dotR <- file.path(Sys.getenv("HOME"), ".R") if (!file.exists(dotR)) dir.create(dotR) M <- file.path(dotR, "Makevars.win") if (!file.exists(M)) file.create(M) cat("\n CXX14FLAGS += -mtune=native -O3 -mmmx -msse -msse2 -msse3 -mssse3 -msse4.1 -msse4.2", file = M, sep = "\n", append = FALSE)
devtools::install_version("withr", version="2.2.0")
Sys.setenv(MAKEFLAGS = "-j4")
# four cores usedinstall.packages("devtools")
I first installed using install.packages("rstan", type = "source")
but got errors like “ERROR: compilation failed for package ‘RcppParallel’
”,then I added “,dependencies = TRUE”, it seemed to be solved, but there seemed to be problem with OpenSSL library.
Then I ran the following lines, it seemed Rstan was installed ok.
Sys.setenv(DOWNLOAD_STATIC_LIBV8 = 1)
# only necessary for Linux without the nodejs library / headers
install.packages("rstan", repos = "https://cloud.r-project.org/", dependencies = TRUE)