Fix nofib benchmarks on Windows.
authorTamar Christina <tamar@zhox.com>
Tue, 14 Feb 2017 21:59:57 +0000 (16:59 -0500)
committerBen Gamari <ben@smart-cactus.org>
Tue, 14 Feb 2017 21:59:57 +0000 (16:59 -0500)
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

mk/boilerplate.mk
runstdtest/runstdtest.prl
shootout/k-nucleotide/Makefile
shootout/reverse-complement/Makefile
spectral/fft2/fft2.slowstdout-x86-mingw [new file with mode: 0644]

index 906cd0b..45344ca 100644 (file)
@@ -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 
index bab0ab4..8af3c0b 100644 (file)
@@ -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
index 5d0baaf..ceeda7a 100644 (file)
@@ -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
index 4524dc1..19f976f 100644 (file)
@@ -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-x86-mingw b/spectral/fft2/fft2.slowstdout-x86-mingw
new file mode 100644 (file)
index 0000000..b541c97
--- /dev/null
@@ -0,0 +1,3 @@
+result1 = 21167.208319565725\r
+result2 = 2.5472441940698405e-11\r
+result3 = 2.2515175714943325e-6\r