dmuck / redding-stan

ReddingStan smuggles log probabilities and gradients out of Stan models
BSD 3-Clause "New" or "Revised" License
8 stars 0 forks source link

Download stanc, setup submodules; use make to do this #2

Closed syclik closed 2 years ago

syclik commented 2 years ago

This PR does a few things for setting up:

  1. Adds a Makefile to help coordinate setup and build
  2. Creates some standard "targets." See: https://www.gnu.org/prep/standards/html_node/Standard-Targets.html
  3. The high-level target for now is make install.
    1. This will download an appropriate bin/stanc and make it executable
    2. This will update the Stan submodule
    3. This will update the Stan Math submodule
  4. make check will check if these three things have been done.
  5. make clean does nothing now
  6. make uninstall will remove bin/stanc

I'm sure everything here can be done better. The goal was to get something going so we can focus on the rest first. If you think there are immediate ways of improvement, please suggest them.

syclik commented 2 years ago

Please check that from a fresh clone:

  1. You can run make check and it tells you that you need to run make install.
  2. Run make install and sees that it succeeds.
  3. execute bin/stanc --version. This should show something like stanc3 v2.29.0-rc2 (Unix)
  4. Run make check and it should succeed.

Success means that it runs without failure or non-zero exit code. You should be able to do something like echo $? right after a call to verify that it's succeeded.

These steps work on my Mac. I am hoping it works on a Linux box as well. I have not explicitly checked on Linux. Please report back if it fails anywhere.