New error: cleanup_makevar(old) : argument "RMU" is missing, with no default

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!