Difficulty modifying Stan algorithms with cmdstan

I have a fresh copy of cmdstan from develop. If I compile a model, make some changes to the Stan within that cmdstan, and then recompile the model, the new changes aren’t there.

If I do a full make clean-all, the changes take effect. Does anyone know if this might be something with the new model file setup? Or does this sound like a separate issue with the Makefiles?

It’s both. It’s an issue with the makefile because we’ve changed the translation units.

I think the quickest workaround is from CmdStan run this whenever you want it rebuilt: touch src/cmdstan/main.cpp. That will trigger src/cmdstan/main.o to be rebuilt which will include all of the new algorithm code you’ve written.

The real fix is to add a dependencies file for src/cmdstan/main.o which should be generated from src/cmdstan/main.cpp which will include the relevant parts of the Stan library.

Could you write an issue on CmdStan and I’ll try to take care of it when I can?

Thanks! The workaround works.

I’ll go ahead and make an issue.

It’s up: https://github.com/stan-dev/cmdstan/issues/727

1 Like

Thank you. I’ll try to fix that soon.

1 Like