Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add rule for cleaning up compiled stan programs #773

Merged
merged 1 commit into from Nov 26, 2019

Conversation

@wesbarnett
Copy link
Contributor

wesbarnett commented Nov 25, 2019

Submisison Checklist

  • Run tests: ./runCmdStanTests.py src/test
  • Declare copyright holder and open-source license: see below

Summary:

Adds a make rule for cleaning up a compiled stan program and its associated files. Fixes #772

Intended Effect:

The compiled binary, .o, .hpp, and .d files will be removed when the user runs make STANPROG="path/to/stanprog" clean-program.

How to Verify:

First compile the example program:

make examples/bernoulli/bernoulli

Then you can remove the binary and it's associated files with:

make STANPROG="examples/bernoulli/bernoulli" clean-program

It is also safe to specify the stan file instead (which a user might do on accident):

make STANPROG="examples/bernoulli/bernoulli.stan" clean-program

In this example bernoulli, bernoulli.d, bernoulli.o, and bernoulli.hpp are removed.

Side Effects:

None

Documentation:

TBD

Copyright and Licensing

Please list the copyright holder for the work you are submitting (this will be you or your assignee, such as a university or company): American Express

By submitting this pull request, the copyright holder is agreeing to license the submitted work under the following licenses:

Can use via:

make STANPROG="examples/bernoulli/bernoulli" clean-program

It is also safe to specify the stan file instead:

make STANPROG="examples/bernoulli/bernoulli.stan" clean-program

In this example bernoulli, bernoulli.d, bernoulli.o, and
bernoulli.hpp would be removed.
@stan-buildbot

This comment has been minimized.

Copy link
Contributor

stan-buildbot commented Nov 25, 2019

Can one of the admins verify this patch?

@stan-buildbot

This comment has been minimized.

Copy link
Contributor

stan-buildbot commented Nov 25, 2019

(stat_comp_benchmarks/benchmarks/gp_pois_regr/gp_pois_regr.stan, 0.99)
(stat_comp_benchmarks/benchmarks/low_dim_corr_gauss/low_dim_corr_gauss.stan, 0.99)
(stat_comp_benchmarks/benchmarks/irt_2pl/irt_2pl.stan, 1.01)
(stat_comp_benchmarks/benchmarks/pkpd/one_comp_mm_elim_abs.stan, 1.04)
(stat_comp_benchmarks/benchmarks/eight_schools/eight_schools.stan, 0.97)
(stat_comp_benchmarks/benchmarks/gp_regr/gp_regr.stan, 1.0)
(stat_comp_benchmarks/benchmarks/arK/arK.stan, 1.01)
(performance.compilation, 1.02)
(stat_comp_benchmarks/benchmarks/low_dim_gauss_mix_collapse/low_dim_gauss_mix_collapse.stan, 1.0)
(stat_comp_benchmarks/benchmarks/low_dim_gauss_mix/low_dim_gauss_mix.stan, 1.01)
(stat_comp_benchmarks/benchmarks/sir/sir.stan, 1.02)
(stat_comp_benchmarks/benchmarks/pkpd/sim_one_comp_mm_elim_abs.stan, 0.99)
(stat_comp_benchmarks/benchmarks/garch/garch.stan, 1.0)
(stat_comp_benchmarks/benchmarks/gp_regr/gen_gp_data.stan, 1.0)
(stat_comp_benchmarks/benchmarks/arma/arma.stan, 0.99)
Result: 1.00333172337
Commit hash: b3a3236

@stan-buildbot

This comment has been minimized.

Copy link
Contributor

stan-buildbot commented Nov 26, 2019

(stat_comp_benchmarks/benchmarks/gp_pois_regr/gp_pois_regr.stan, 1.0)
(stat_comp_benchmarks/benchmarks/low_dim_corr_gauss/low_dim_corr_gauss.stan, 0.99)
(stat_comp_benchmarks/benchmarks/irt_2pl/irt_2pl.stan, 1.0)
(stat_comp_benchmarks/benchmarks/pkpd/one_comp_mm_elim_abs.stan, 1.0)
(stat_comp_benchmarks/benchmarks/eight_schools/eight_schools.stan, 1.0)
(stat_comp_benchmarks/benchmarks/gp_regr/gp_regr.stan, 1.01)
(stat_comp_benchmarks/benchmarks/arK/arK.stan, 1.01)
(performance.compilation, 1.01)
(stat_comp_benchmarks/benchmarks/low_dim_gauss_mix_collapse/low_dim_gauss_mix_collapse.stan, 1.01)
(stat_comp_benchmarks/benchmarks/low_dim_gauss_mix/low_dim_gauss_mix.stan, 1.0)
(stat_comp_benchmarks/benchmarks/sir/sir.stan, 1.0)
(stat_comp_benchmarks/benchmarks/pkpd/sim_one_comp_mm_elim_abs.stan, 0.95)
(stat_comp_benchmarks/benchmarks/garch/garch.stan, 1.0)
(stat_comp_benchmarks/benchmarks/gp_regr/gen_gp_data.stan, 0.99)
(stat_comp_benchmarks/benchmarks/arma/arma.stan, 1.0)
Result: 0.99780465509
Commit hash: b3a3236

@syclik

This comment has been minimized.

Copy link
Member

syclik commented Nov 26, 2019

@wesbarnett

This comment has been minimized.

Copy link
Contributor Author

wesbarnett commented Nov 26, 2019

Thanks! One note. I tried out passing file paths with spaces with them. One has to escape them, even when using the quotation marks (which seem to be required):

 make STANPROG="path/to/file\ with\ spaces" clean-program
@mitzimorris mitzimorris self-requested a review Nov 26, 2019
Copy link
Member

mitzimorris left a comment

nice solution!
many thanks!

@mitzimorris mitzimorris merged commit c3583eb into stan-dev:develop Nov 26, 2019
1 check passed
1 check passed
continuous-integration/jenkins/pr-merge This commit looks good
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
4 participants
You can’t perform that action at this time.