diff options
author | Mohammad Akhlaghi <mohammad@akhlaghi.org> | 2020-02-29 21:26:54 +0000 |
---|---|---|
committer | Mohammad Akhlaghi <mohammad@akhlaghi.org> | 2020-02-29 21:37:33 +0000 |
commit | 7d0c5ef77395a44a316bb822170543b533db239c (patch) | |
tree | 710a4407a8aa2364bf96434e1a2a3927f9f3122c | |
parent | 2f0417995da0c21c894a003af5804b3c732a34c3 (diff) |
IMPORTANT: re-preparation can only be done with --prepare-redo
Until now, the preparation phase was always executed before the final build
phase when running `./project make'. But when it becomes necessary, project
preparation can be slow and will un-necessarily slow down the project while
the project is growing (focus is on the analysis that is done after
preparation).
With this commit, preparation will be done automatically the first time
that the project is run (`.build/software/preparation-done.mk' doesn't
exist). However, after preperation is complete once, future runs of
`./project make' won't do preparation any more (by calling
`top-prepare.mk'). They will directly call `top-make.mk' for the analysis.
To manually invoke preparation after the first attempt, the `./project
make' script should be run with the new `--prepare-redo' option.
Also, since the preparation phase is now automatically done before the
analysis phase, the long notice that describes running `./project make' at
the end of the preparation phase has been removed in `top-prepare.mk'. It
now just prints a short line, saying the preparation has been complete.
Finally, when the project has not been run with the proper group
configuration, it ends with an `exit 1' so the main `./project' script
doesn't proceed any further.
-rwxr-xr-x | project | 24 | ||||
-rw-r--r-- | reproduce/analysis/make/top-prepare.mk | 15 |
2 files changed, 21 insertions, 18 deletions
@@ -37,6 +37,7 @@ check_config= make_targets= software_dir= clean_texdir=0 +prepare_redo=0 existing_conf=0 scriptname="./project" minmapsize=10000000000 @@ -108,6 +109,7 @@ Configure and Make options: Make options: -d, --debug=FLAGS Print various types of debugging information. + -p, --prepare-redo Re-do preparation (only done automatically once). Mandatory or optional arguments to long options are also mandatory or optional for any corresponding short options. @@ -184,12 +186,17 @@ do -'?'|--help) print_help; exit 0;; -'?'*|--help=*) on_off_option_error --help -?;; - # Make options (note that Make's `debug' can take values, but when called - # without any value, it is like giving it a value of `a'): + # Make options + # ------------ + # + # Note that Make's `debug' can take values, but when called without any + # value, it is like giving it a value of `a'): -d|--debug) if [ x"$2" = x ]; then debug=a; shift; else debug="$2"; check_v debug "$debug"; shift;shift; fi;; -d=*|--debug=*) debug="${1#*=}"; check_v debug "$debug"; shift;; -d*) debug=$(echo "$1" | sed -e's/-d//'); check_v debug "$debug"; shift;; + -p|--prepare-redo) prepare_redo=1; shift;; + -p=*|--prepare-redo=*) on_off_option_error --prepare-redo; shift;; # Unrecognized option: -*) echo "$scriptname: unknown option '$1'"; exit 1;; @@ -386,9 +393,16 @@ EOF exit 1 fi - # Run input-preparations (optionally build Makefiles with special - # values for optimizing the main `top-make.mk'). - controlled_env reproduce/analysis/make/top-prepare.mk + # Run data preparation phase (optionally build Makefiles with + # special values for optimizing the main `top-make.mk'). But note + # that data preparation is only done automatically the first time + # the project is built (when `.build/software/preparation-done.mk' + # doesn't yet exist). After that, if the user wants to re-do the + # preparation they have to use the `--prepare-redo' option. + if ! [ -f .build/software/preparation-done.mk ] \ + || [ x"$prepare_redo" = x1 ]; then + controlled_env reproduce/analysis/make/top-prepare.mk + fi # Run the actual project. controlled_env reproduce/analysis/make/top-make.mk diff --git a/reproduce/analysis/make/top-prepare.mk b/reproduce/analysis/make/top-prepare.mk index cefbc6b..1778c6b 100644 --- a/reproduce/analysis/make/top-prepare.mk +++ b/reproduce/analysis/make/top-prepare.mk @@ -37,19 +37,7 @@ include reproduce/software/config/installation/LOCAL.conf # See `top-make.mk' for complete explanation. ifeq (x$(reproducible_paper_group_name),x$(GROUP-NAME)) all: $(BDIR)/software/preparation-done.mk - @echo ""; - echo "----------------" - echo "Project preparation has been completed without any errors." - echo "" - echo "Please run the following command to start building the project." - echo "(Replace '8' with the number of CPU threads on your system)" - echo "" - if [ "x$(GROUP-NAME)" = x ]; then \ - echo " $$ ./project make"; \ - else \ - echo " $$ ./project make --group=$(GROUP-NAME) -j8"; \ - fi - echo "" + @echo "Project preparation is complete."; else all: @if [ "x$(GROUP-NAME)" = x ]; then \ @@ -59,6 +47,7 @@ all: echo "Project is configured for groups, please run"; \ echo " $$ ./project prepare --group=$(GROUP-NAME) -j8"; \ fi + exit 1 endif |