[commit: nofib] master: Simplify some shootout Makefiles (eccf532)

git at git.haskell.org git at git.haskell.org
Wed Jun 7 18:54:46 UTC 2017


Repository : ssh://git@git.haskell.org/nofib

On branch  : master
Link       : http://ghc.haskell.org/trac/ghc/changeset/eccf532410eee45f30c07f389f7029871fd603db/nofib

>---------------------------------------------------------------

commit eccf532410eee45f30c07f389f7029871fd603db
Author: Michal Terepeta <michal.terepeta at gmail.com>
Date:   Wed Jun 7 14:54:34 2017 -0400

    Simplify some shootout Makefiles
    
    Summary:
    By following the naming conventions of the build system we can
    simplify the `Makefile`s a bit.  This patch also avoids having to
    explicitly pass the flags to `runstdtest` for `fasta`, `k-nucleotide`
    and `reverse-complement`.  The only consquence of this is that it's a
    requirement to run `make boot` before `make` for these benchmarks. But
    that is already the case since `.depend` files are generated by with
    `make boot`.
    
    Finally, this also update the `.gitignore` with the new names of
    the output/input files.
    
    Signed-off-by: Michal Terepeta <michal.terepeta at gmail.com>
    
    Test Plan: build & run
    
    Reviewers: bgamari
    
    Reviewed By: bgamari
    
    Differential Revision: https://phabricator.haskell.org/D3412


>---------------------------------------------------------------

eccf532410eee45f30c07f389f7029871fd603db
 .gitignore                           | 12 +++++------
 shootout/fasta/Makefile              | 10 ++++-----
 shootout/k-nucleotide/Makefile       | 19 +++++++++--------
 shootout/reverse-complement/Makefile | 41 +++++++++++++++++-------------------
 4 files changed, 39 insertions(+), 43 deletions(-)

diff --git a/.gitignore b/.gitignore
index 24e76f2..c5604e8 100644
--- a/.gitignore
+++ b/.gitignore
@@ -62,16 +62,16 @@ shootout/fasta/fasta.slowstdout
 shootout/fasta/fasta.stdout
 shootout/k-nucleotide/fasta-c
 shootout/k-nucleotide/k-nucleotide
-shootout/k-nucleotide/knucleotide-input250000.txt
-shootout/k-nucleotide/knucleotide-input2500000.txt
-shootout/k-nucleotide/knucleotide-input25000000.txt
+shootout/k-nucleotide/k-nucleotide.faststdin
+shootout/k-nucleotide/k-nucleotide.slowstdin
+shootout/k-nucleotide/k-nucleotide.stdin
 shootout/n-body/n-body
 shootout/pidigits/pidigits
 shootout/reverse-complement/fasta-c
 shootout/reverse-complement/revcomp-c
-shootout/reverse-complement/revcomp-input250000.txt
-shootout/reverse-complement/revcomp-input2500000.txt
-shootout/reverse-complement/revcomp-input25000000.txt
+shootout/reverse-complement/reverse-complement.faststdin
+shootout/reverse-complement/reverse-complement.slowstdin
+shootout/reverse-complement/reverse-complement.stdin
 shootout/reverse-complement/reverse-complement
 shootout/reverse-complement/reverse-complement.faststdout
 shootout/reverse-complement/reverse-complement.slowstdout
diff --git a/shootout/fasta/Makefile b/shootout/fasta/Makefile
index 447b3a8..68e6279 100644
--- a/shootout/fasta/Makefile
+++ b/shootout/fasta/Makefile
@@ -28,9 +28,9 @@ fasta.stdout : fasta-c
 fasta.slowstdout : fasta-c
 	./fasta-c $(SLOW_OPTS) > $@
 
-# Since the stdout files are created during the run the runstdtest
-# script doesn't correctly pick them up, so we have to specify them
-# explicitly here.
+# Since we only decide here what the INPUT_FILE is, it's required to first run
+# `make boot` and only than `make` (otherwise `make` doesn't "see" the file and
+# doesn't call `runstdtest` correctly)
 ifeq "$(mode)" "slow"
  STDOUT_FILE = fasta.slowstdout
 else
@@ -41,8 +41,6 @@ else
  endif
 endif
 
-SRC_RUNTEST_OPTS += -o1 $(STDOUT_FILE)
-
-all boot :: $(STDOUT_FILE)
+boot :: $(STDOUT_FILE)
 
 include $(TOP)/mk/target.mk
diff --git a/shootout/k-nucleotide/Makefile b/shootout/k-nucleotide/Makefile
index ceeda7a..a37cbad 100644
--- a/shootout/k-nucleotide/Makefile
+++ b/shootout/k-nucleotide/Makefile
@@ -17,27 +17,28 @@ HC_OPTS += -O2 -XBangPatterns -package bytestring
 fasta-c : ../fasta/fasta-c.c
 	$(CC) -std=gnu99 -O3 -fomit-frame-pointer $< -o $@
 
-knucleotide-input250000.txt : fasta-c
+k-nucleotide.faststdin : fasta-c
 	./fasta-c $(FAST_OPTS) | tr -d '\r' > $@
 
-knucleotide-input2500000.txt : fasta-c
+k-nucleotide.stdin : fasta-c
 	./fasta-c $(NORM_OPTS) | tr -d '\r' > $@
 
-knucleotide-input25000000.txt : fasta-c
+k-nucleotide.slowstdin : fasta-c
 	./fasta-c $(SLOW_OPTS) | tr -d '\r' > $@
 
+# Since we only decide here what the INPUT_FILE is, it's required to first run
+# `make boot` and only than `make` (otherwise `make` doesn't "see" the file and
+# doesn't call `runstdtest` correctly)
 ifeq "$(mode)" "slow"
- INPUT_FILE = knucleotide-input25000000.txt
+ INPUT_FILE = k-nucleotide.slowstdin
 else
  ifeq "$(mode)" "fast"
-  INPUT_FILE = knucleotide-input250000.txt
+  INPUT_FILE = k-nucleotide.faststdin
  else
-  INPUT_FILE = knucleotide-input2500000.txt
+  INPUT_FILE = k-nucleotide.stdin
  endif
 endif
 
-SRC_RUNTEST_OPTS += -i $(INPUT_FILE)
-
-all boot :: $(INPUT_FILE)
+boot :: $(INPUT_FILE)
 
 include $(TOP)/mk/target.mk
diff --git a/shootout/reverse-complement/Makefile b/shootout/reverse-complement/Makefile
index 19f976f..8fd7a9d 100644
--- a/shootout/reverse-complement/Makefile
+++ b/shootout/reverse-complement/Makefile
@@ -22,59 +22,56 @@ HC_OPTS += -O2 -XBangPatterns -funfolding-use-threshold=32 -XMagicHash \
 fasta-c : ../fasta/fasta-c.c
 	$(CC) -std=gnu99 -O3 -fomit-frame-pointer $< -o $@
 
-revcomp-input250000.txt : fasta-c
+reverse-complement.faststdin : fasta-c
 	./fasta-c $(FAST_OPTS) | tr -d '\r' > $@
 
-revcomp-input2500000.txt : fasta-c
+reverse-complement.stdin : fasta-c
 	./fasta-c $(NORM_OPTS) | tr -d '\r' > $@
 
-revcomp-input25000000.txt : fasta-c
+reverse-complement.slowstdin : fasta-c
 	./fasta-c $(SLOW_OPTS) | tr -d '\r' > $@
 
+# Since we only decide here what the INPUT_FILE is, it's required to first run
+# `make boot` and only than `make` (otherwise `make` doesn't "see" the file and
+# doesn't call `runstdtest` correctly)
 ifeq "$(mode)" "slow"
- INPUT_FILE = revcomp-input25000000.txt
+ INPUT_FILE = reverse-complement.slowstdin
 else
  ifeq "$(mode)" "fast"
-  INPUT_FILE = revcomp-input250000.txt
+  INPUT_FILE = reverse-complement.faststdin
  else
-  INPUT_FILE = revcomp-input2500000.txt
+  INPUT_FILE = reverse-complement.stdin
  endif
 endif
 
-SRC_RUNTEST_OPTS += -i $(INPUT_FILE)
-
-all boot :: $(INPUT_FILE)
-
 #------------------------------------------------------------------
 # Create output to validate against
 
 revcomp-c : revcomp-c.o
 	gcc $< -o $@ -pthread
 
-reverse-complement.faststdout : revcomp-c
+reverse-complement.faststdout : revcomp-c $(INPUT_FILE)
 	./revcomp-c < $(INPUT_FILE) > $@
 
-reverse-complement.stdout : revcomp-c
+reverse-complement.stdout : revcomp-c $(INPUT_FILE)
 	./revcomp-c < $(INPUT_FILE) > $@
 
-reverse-complement.slowstdout : revcomp-c
+reverse-complement.slowstdout : revcomp-c $(INPUT_FILE)
 	./revcomp-c < $(INPUT_FILE) > $@
 
-# Since the stdout files are created during the run the runstdtest
-# script doesn't correctly pick them up, so we have to specify them
-# explicitly here.
+# Since we only decide here what the OUTPUT_FILE is, it's required to first run
+# `make boot` and only than `make` (otherwise `make` doesn't "see" the file and
+# doesn't call `runstdtest` correctly)
 ifeq "$(mode)" "slow"
- STDOUT_FILE = reverse-complement.slowstdout
+ OUTPUT_FILE = reverse-complement.slowstdout
 else
  ifeq "$(mode)" "fast"
-  STDOUT_FILE = reverse-complement.faststdout
+  OUTPUT_FILE = reverse-complement.faststdout
  else
-  STDOUT_FILE = reverse-complement.stdout
+  OUTPUT_FILE = reverse-complement.stdout
  endif
 endif
 
-SRC_RUNTEST_OPTS += -o1 $(STDOUT_FILE) 
-
-all boot :: $(STDOUT_FILE)
+boot :: $(INPUT_FILE) $(OUTPUT_FILE)
 
 include $(TOP)/mk/target.mk



More information about the ghc-commits mailing list