Give that @sp977 is using R 3.6.3. I think the place to start is to remove the Makevars.win file. Avoid using -march=native and / or -mtune=native , as suggested in that thread. However, I suspect there is also going to be conflict with using Rtools40 and R 3.6.3 - I believe Rtools40 is only compatible with R 4.0+
Probably the best thing to do is to updated to 4.0.1+ and Rtools40 completely remove your Makevars.win file… see some of the pinned posts on getting rstan to play nice with R 4.0+
Once you get that all sorted out, then you might run into RstudioViewer issues if you’re not using the current preview version of RStudio (1.3.1054 + )