I tried running make cpplint and got the following message:
make: *** [cpplint] Error 1
I’ve never had issues before. I downloaded a new Stan repo (in case I had inadvertently changed a file in my current directory), but the error persists. Anyone else experiencing this?
$(CPPLINT) is defined in make/cpplint (or something similar; I’m working off memory typing on my phone).
CppLint requires Python 2 and won’t work with Python 3. I forget what error it produces, but hopefully that’s the issue. There should be a PYTHON2 make variable that you can set if you have one installed.
Ok, I got it running now. The problem was that stan/make/cpplint had definition
PYTHON2 ?= python
It seems distros have started switching the default to Python 3, which is very sensible considering that Python 2 will not be maintained beyond 2020 and many major packages have dropped the support already.
I tried @bbbales2 and @syclik’s advice, with no success. I have python 3 on my machine. @avehtari, did you edit the make file? And how so? I tried replacing PYTHON2 ?= python with PYTHON3 ?= python but the error persists.
I also don’t get much info, just:
charlesm:math charlesm$ make cpplint
make: *** [cpplint] Error 1
Please don’t edit the make/cpplint file directly. You should be able to accomplish the same by putting this inside make/local or ~/.config/stan/make.local:
Don’t worry, I’m not going to push that. It was just a quick test. I assume there will be soon a fixed make/cpplint, which can check which command to use to run Python2.
Good! =). But more importantly, that’s not the suggestion you should be giving. You should be telling everyone to use make/local or ~/.config/stan/make.local.
I don’t think so. This isn’t how make is supposed to work… to have it do it is non-trivial. We’re moving away from having make try to do magic and only have it do the things it’s supposed to do.
Unless you know how to do it. In which case, we’ll just take a pull request.