Building RStan goes in circles until computer freezes (Windows and Ubuntu)

Package https://github.com/dmenne/gastempt has been on CRAN for some time, and could be build on Travis (https://travis-ci.org/dmenne/gastempt/builds/419519345).

I tried to port it to C++14 following @bgoodri (How to update a package that has StanHeaders and rstan in its LinkingTo). Main change is Makevars, now:

MAKEFLAGS = -j4
CXX14 = g++ -std=c++1y #  g++ or clang++ if you have that
CXX14FLAGS = -O3 -mtune=native -march=native -Wno-unused-variable -Wno-unused-function  -Wno-macro-redefined

These settings work ok for dmenne/breathteststan;

When it is build under Windows and under Ubuntu Xenial, the horror happens: Building goes in circles, Stan compile output is produced, stacking up 30++ R processes until the computer totally freezes. Travis output stops in the middle of the desert without any error messages:

https://api.travis-ci.org/v3/job/443812962/log.txt

You need to eliminate the line that calls roxygen2::roxygenize from cleanup and cleanup.win . Newer versions of roxygen2 build the documentation after calling load_all on the package, which goes into an infinite loop. Unfortunately, you then have to remember to rebuild the documentation yourself by calling roxygen2::roxygenize before submitting to CRAN.

Thanks! I had tested the line separately, and it behaved ok.

This change was already in your PR, but had updated the code manually. Mea Culpa