Closed jenslevy closed 1 year ago
The current CRAN rstan cannot be installed from source on R 4.1.x.
You have three options:
I'm going to close this issue, but feel free to reopen if things still aren't working
Andrew, Thanks. I was able to get it installed and so far it appears to be working. Thanks for your help. Jens Jens W. Levy There are two kinds of people in this world: 1) Those who can extrapolate from incomplete data.
On Sun, Apr 16, 2023 at 11:34 PM Andrew Johnson @.***> wrote:
I'm going to close this issue, but feel free to reopen if things still aren't working
— Reply to this email directly, view it on GitHub https://github.com/stan-dev/rstan/issues/1059#issuecomment-1510479727, or unsubscribe https://github.com/notifications/unsubscribe-auth/AK57JFHW3AR2BJ36RAQC2SDXBRJXDANCNFSM6AAAAAAWZFOBPY . You are receiving this because you authored the thread.Message ID: @.***>
Summary:
I want to install Rstan on my Windows 10 laptop but after following the instructions that take one through several websites and which appear to be successful up until the last step, I am unable at the last to run the final "install.package("rstan", repos = "https://cloud.r-project.org/", dependencies = TRUE) step, apparently due to a memory problem. I would be very grateful for some guidance.
Description:
Following instructions from https://github.com/stan-dev/rstan/wiki/RStan-Getting-Started, which referred me to "https://github.com/stan-dev/rstan/wiki/Configuring-C---Toolchain-for-Windows" in order to confure C++ Toolchain and then to https://cran.r-project.org/bin/windows/Rtools/rtools40.html to download the "jsonlite" packages. At the end of this I am unable to actually install RStan due to a "cc1plus.exe: out of memory allocating 65536 bytes" in spite of having 16 G of memore and allocating more memory to R.
Reproducible Steps:
First I made sure my earlier attempts at installing RStan are not the issue by uninstalling RStan by submitting "remove.packages('rstan')".
Then I followed the instructions for "Windows - Configuring C++ Toolchain" from https://github.com/stan-dev/rstan/wiki/RStan-Getting-Started.
Since I am using R 4.1.2, I followed the instructions under the R4.0 section. As insturcted I established that the "BINREF" environment variable is not pointing to the old RToools. So I moved onto the RTools4 Installation instructions at https://cran.r-project.org/bin/windows/Rtools/rtools40.html . Since I have an RStudio version greater than 1.2.5042, I downloaded the "rtools40-x86_64.exe" file
Then I used R code to put the location of the Rtools make utilities on the PATH by running the following: write('PATH="${RTOOLS40_HOME}\usr\bin;${PATH}"', file = "~/.Renviron", append = TRUE)"
Then I restarted R and confirmed that "Sys.which("make") was "C:\rtools40\usr\bin\make.exe" .
Then I tried to install an R package from soure by submitting "install.packages("jsonlite", type = "source")" which appeared to be successful.
Having done that I went back to the instructions on https://github.com/stan-dev/rstan/wiki/RStan-Getting-Started, and ran the following: "install.packages(c("StanHeaders","rstan"),type="source")"
I got a dialogue box that asked "Do you want to install from sources the package which needs compilation?" (which is a confusing question by the by) to which I said "yes".
After copius text I end up with copius output that ended with (see screen capture) : " which indicates "cc1plus.exe: out of memory allocating 65536 bytes" resulting in "ERROR: compilation failed for package 'rstan'".
An internet search suggested that this is an issue due to insufficient RAM. I have a 16G computer which I believe should be more than adequate. I try making sure that I have allocated enough memory by submitting "Sys.setenv(R_MAX_MEM_SIZE = "8G")".
R Version:
I am running R version 4.1.2 (2021-11-01)-- "Bird Hippie", through R Studio 2023.03.0 Build 386 "Cheery Blossom" Release.
Operating System:
Your operating system (e.g., Windows 10 Pro), x64-based PC