This occurred for me with withr 2.3.0 and with the following Makevars.win :
CXX14FLAGS=-O3 -Wno-unused-variable -Wno-unused-function
CXX14 = (BINPREF)g++ -m(WIN) -std=c++1y
CXX11FLAGS=-O3 -Wno-unused-variable -Wno-unused-function
This occurred for me with withr 2.3.0 and with the following Makevars.win :
CXX14FLAGS=-O3 -Wno-unused-variable -Wno-unused-function
CXX14 = (BINPREF)g++ -m(WIN) -std=c++1y
CXX11FLAGS=-O3 -Wno-unused-variable -Wno-unused-function
Hi, I am running in very similar problems and I have withr2.3.0 installed.
I wanted to try and install the 2.2.0 version but I don’t see it available in the binary files in the link you give. Is it possible the webpage has changed?
If so how to install the previous version? I have looked online a little but could not find it.
Thank everyone in advance
If you install the remotes
package then I think you can just do this:
remotes::install_version("withr", "2.2.0")
@stevebronder I have no idea why but my guess is this is a Windows thing since you can’t reproduce it on ubuntu and I can’t on my mac. It seems like everyone reporting this is on Windows.
@bgoodri I know you said you were working on an RStan submission, so tagging you in case you haven’t seen this error that a lot of people are getting.
For anyone experiencing this error, it looks to be related to a new framework that was implemented for updating/processing the user’s Makevars file. As a temporary workaround, you can get RStan up and running again by removing or renaming your Makevars file.
If you don’t know how to do this in Windows, simply run the following from your R session:
file.rename("~/.R/Makevars.win", "~/.R/Makevars.win.bak")
This will rename your Makevars file so that RStan won’t try to process it (and error), and once this issue is fixed you can simply rename the file and continue as normal
EDIT: If there is a new or different error after removing/renaming your Makevars file, please open a new thread and we’ll help you there
It’s definitely a Windows thing, I can reproduce on a windows computer with both CRAN 2.3.0 and github versions of withr
, but not with 2.2.0
Oh shoot okay I wasn’t able to replicate is locally, let me try this out tmrw I think I can use our Jenkins windows thing to try to replicate this
No wokkas, feel free to shoot through any code for testing
I put up a PR to fix this, essentially I think the “handling Makevars ourselves” thing had good intent but since it makes a new possible bug for windows users (which it was supposed to help lol) then we should just make having -march=native
on windows a warning. Once the below is merged to the develop branch I can ping the people on this thread
Sorry for the issue folks!
This worked for me - thanks!
[Took forever to find what the problem was because the error didn’t appear when running brms
interactively (where it failed silently), so had to run it via reprex
]
Hi @stevebronder, thanks for working on this. Any idea when this might be fixed? I’ve tried renaming my Makevars file, and tried installing the 2.2.0 version of withr (certainly could have incorrectly done either of these steps), but still getting this error. Thanks!
Nevermind- was able to get this by reinstalling stan from CRAN and then reinstalling withr v.2.2.0. And, thanks @stevebronder for the work you do to support stan!
@Caroline_King sorry for the inconvenience, but glad it’s working now!
Hi, I am trying to install older versions of withr but either I do it with this command or from CRAN I get the following message : Error: ‘\R’ is an unrecognized escape in character string starting "“C:\R”
Execution halted.
Why does it occur? Any suggestion?
Thanks for the solution. It worked for me, however, there is still this warning, it’s funny shouldn’t it be mingw_64 rather than mingw_? Could you please help.
Warning messages:
1: In system(paste(CXX, ARGS), ignore.stdout = TRUE, ignore.stderr = TRUE) :
'C:/rtools40/usr/mingw_/bin/g++' not found
I’m running rstan 2.21.2 (CRAN version) in R 4.0.3 on Windows and I got the error described in this thread. Rolling back to withr 2.2.0 fixed it, but now I have a different problem. When I call stan_model()
, not only does the resulting model not use the flags in my Makevars.win
, but the Makevars.win
file is actually deleted. I’ve tried restoring it, but it gets deleted again every time.
I’m wondering if this behavior is somehow related to this:
I don’t have -march=native
in my Makevars. Based on this advice, it looks like:
CXX14FLAGS = -mtune=native -O3 -mmmx -msse -msse2 -msse3 -mssse3 -msse4.1 -msse4.2
Calling get_cxxflags()
on the stanmodel returns:
CXXFLAGS = -O2 -Wall $(DEBUGFLAG) -mfpmath=sse -msse2 -mstackrealign
Any idea what’s going on and how to fix it?
Sorry if this issue has been covered somewhere; I’m a little lost with all the R 4.0-related threads. Thanks in advance!
Sorry that your having this issue, your saying it completely deletes the file? I’m waiting for the below to get merged which should hopefully fix this issue
Yep, it completely deletes Makevars.win
. If I call stan()
instead of stan_model()
, it doesn’t delete the file but get_cxxflags()
still returns the same defaults I showed above, rather than the contents of Makevars.win
. It’s not fatal, but obviously I’d prefer the stanmodel
to be optimized for speed.
I actually just perused that PR. If you could let us know in this thread when it’s merged, that would be swell. Thanks for working on this, and for such a rapid reply!
This tip “remotes::install_version(“withr”, “2.2.0”)” helped me install rstan correctly after spending hours trying to reinstall and install packages! Amazing and thank you so much!
Sorry it was such a hassle but I’m glad to hear it’s working now!