Stan running speed Ubuntu 17.10 vs Windows 10

I have a dual boot Dell XPS 15 i7 6th generation, running both Ubuntu Linux 17.10 and Windows 10. To my surprise and dismay, identical Stan code (I have tried many programs) runs much faster under Windows (up to factor 10). Is anyone familiar with this or have some advice? Thanks!

Make sure you have your ~/.R/Makevars file set correctly.

Thanks for the advice.

CXXFLAGS=-03 -mtune=native -march=native

CXXFLAGS= -Wno-unused_variable -Wno-unused-function -Wno-macro-redefined

CXXFLAGS+=-flto -Wno-unused-local-typedefs

CXXFLAGS += -Wno-ignored-attributes -Wno-deprecated-declarations

That’s what my Makevars contains

At this point CXXFLAGS is set to -Wno-unused_variable -Wno-unused-function -Wno-macro-redefined without the critical -03 -mtune=native -march=native. Then, you += some less relevant stuff to that.

Or, to put it another way, it looks like the second line of Makevars has only a “=” when it should have a “+=”.

Thanks, that did the trick! Just changing “=” to “+=” in the second line, and the runtime just went from 750 sec to 42 sec. Kaboom!