[commit: nofib] master: Fix nofib benchmarks on Windows. (307ae61)

git at git.haskell.org git at git.haskell.org
Sat Feb 18 05:10:14 UTC 2017


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

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

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

commit 307ae61121a99f6ffd3d5fa56e5d37b1b91a492b
Author: Tamar Christina <tamar at zhox.com>
Date:   Tue Feb 14 16:59:57 2017 -0500

    Fix nofib benchmarks on Windows.
    
    Summary:
    This allows nofib to run on Windows using `msys`.
    
    Also deprecates the old `cygwin` stuff.
    
    Test Plan: make clean && make
    
    Reviewers: bgamari
    
    Reviewed By: bgamari
    
    Subscribers: RyanGlScott, #ghc_windows_task_force
    
    Differential Revision: https://phabricator.haskell.org/D3030


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

307ae61121a99f6ffd3d5fa56e5d37b1b91a492b
 mk/boilerplate.mk                                           | 10 +++++++++-
 runstdtest/runstdtest.prl                                   | 13 ++++++-------
 shootout/k-nucleotide/Makefile                              |  6 +++---
 shootout/reverse-complement/Makefile                        |  6 +++---
 .../fft2/{fft2.slowstdout => fft2.slowstdout-x86-mingw}     |  2 +-
 5 files changed, 22 insertions(+), 15 deletions(-)

diff --git a/mk/boilerplate.mk b/mk/boilerplate.mk
index 906cd0b..45344ca 100644
--- a/mk/boilerplate.mk
+++ b/mk/boilerplate.mk
@@ -19,9 +19,17 @@ RM = rm -f
 SIZE = size
 STRIP = strip
 PERL = /usr/bin/perl
-CONTEXT_DIFF = diff -U 1
+CONTEXT_DIFF_RAW = diff -U 1
 EXECUTABLE_FILE = chmod +x
 
+# Windows MSYS specific settings
+ifeq ($(shell uname -o), Msys)
+	exeext=.exe
+	CONTEXT_DIFF=$(CONTEXT_DIFF_RAW) --strip-trailing-cr
+else
+	CONTEXT_DIFF=$(CONTEXT_DIFF_RAW)
+endif
+
 # Benchmarks controls which set of tests should be run
 # You can run one or more of
 #	imaginary 
diff --git a/runstdtest/runstdtest.prl b/runstdtest/runstdtest.prl
index bab0ab4..8af3c0b 100644
--- a/runstdtest/runstdtest.prl
+++ b/runstdtest/runstdtest.prl
@@ -55,12 +55,11 @@ if ( $ENV{'TMPDIR'} ) { # where to make tmp file names
     $TmpPrefix = '/tmp';
     $ENV{'TMPDIR'} = '/tmp'; # set the env var as well
 }
-# If this is Cygwin, ignore eol and CR characters.
-# Perhaps required for MSYS too, although the cygpath
-# bit is hopefully unnecessary.
-if ( `uname | grep CYGWIN` ) {
+$cmp = "cmp -s";
+# If this is Msys, ignore eol and CR characters.
+if ( `uname -o | grep Msys` ) {
     $CONTEXT_DIFF=$CONTEXT_DIFF . " --strip-trailing-cr" ;
-    $TmpPrefix = `cygpath -m $TmpPrefix | tr -d \\\\n`;
+    $cmp = $CONTEXT_DIFF . " -q";
 }
 $ScriptFile = "$TmpPrefix/run_me$$";
 $DefaultStdoutFile = "$TmpPrefix/no_stdout$$"; # can't use /dev/null (e.g. Alphas)
@@ -260,7 +259,7 @@ else
     $PostScriptLines
     hit='NO'
     for out_file in @PgmStdoutFile ; do
-	if cmp -s \$out_file $TmpPrefix/runtest$$.1 ; then
+	if $cmp \$out_file $TmpPrefix/runtest$$.1 ; then
 	    hit='YES'
 	fi
     done
@@ -286,7 +285,7 @@ fi
 
 hit='NO'
 for out_file in @PgmStderrFile ; do
-    if cmp -s \$out_file $TmpPrefix/runtest$$.2 ; then
+    if $cmp \$out_file $TmpPrefix/runtest$$.2 ; then
 	hit='YES'
     fi
 done
diff --git a/shootout/k-nucleotide/Makefile b/shootout/k-nucleotide/Makefile
index 5d0baaf..ceeda7a 100644
--- a/shootout/k-nucleotide/Makefile
+++ b/shootout/k-nucleotide/Makefile
@@ -18,13 +18,13 @@ fasta-c : ../fasta/fasta-c.c
 	$(CC) -std=gnu99 -O3 -fomit-frame-pointer $< -o $@
 
 knucleotide-input250000.txt : fasta-c
-	./fasta-c $(FAST_OPTS) > $@
+	./fasta-c $(FAST_OPTS) | tr -d '\r' > $@
 
 knucleotide-input2500000.txt : fasta-c
-	./fasta-c $(NORM_OPTS) > $@
+	./fasta-c $(NORM_OPTS) | tr -d '\r' > $@
 
 knucleotide-input25000000.txt : fasta-c
-	./fasta-c $(SLOW_OPTS) > $@
+	./fasta-c $(SLOW_OPTS) | tr -d '\r' > $@
 
 ifeq "$(mode)" "slow"
  INPUT_FILE = knucleotide-input25000000.txt
diff --git a/shootout/reverse-complement/Makefile b/shootout/reverse-complement/Makefile
index 4524dc1..19f976f 100644
--- a/shootout/reverse-complement/Makefile
+++ b/shootout/reverse-complement/Makefile
@@ -23,13 +23,13 @@ fasta-c : ../fasta/fasta-c.c
 	$(CC) -std=gnu99 -O3 -fomit-frame-pointer $< -o $@
 
 revcomp-input250000.txt : fasta-c
-	./fasta-c $(FAST_OPTS) > $@
+	./fasta-c $(FAST_OPTS) | tr -d '\r' > $@
 
 revcomp-input2500000.txt : fasta-c
-	./fasta-c $(NORM_OPTS) > $@
+	./fasta-c $(NORM_OPTS) | tr -d '\r' > $@
 
 revcomp-input25000000.txt : fasta-c
-	./fasta-c $(SLOW_OPTS) > $@
+	./fasta-c $(SLOW_OPTS) | tr -d '\r' > $@
 
 ifeq "$(mode)" "slow"
  INPUT_FILE = revcomp-input25000000.txt
diff --git a/spectral/fft2/fft2.slowstdout b/spectral/fft2/fft2.slowstdout-x86-mingw
similarity index 62%
copy from spectral/fft2/fft2.slowstdout
copy to spectral/fft2/fft2.slowstdout-x86-mingw
index 203cb74..b541c97 100644
--- a/spectral/fft2/fft2.slowstdout
+++ b/spectral/fft2/fft2.slowstdout-x86-mingw
@@ -1,3 +1,3 @@
 result1 = 21167.208319565725
-result2 = 2.5448319287502744e-11
+result2 = 2.5472441940698405e-11
 result3 = 2.2515175714943325e-6



More information about the ghc-commits mailing list