]> git.donarmstrong.com Git - libparallel-mpi-simple-perl.git/commitdiff
Now works on Win32 with mpich 1.1.1
authorAlex Gough <alex@earth.li>
Mon, 6 Jun 2011 06:28:53 +0000 (18:28 +1200)
committerAlex Gough <alex@earth.li>
Mon, 6 Jun 2011 06:28:53 +0000 (18:28 +1200)
Makefile.PL
test.pl

index 2891e9163e4b3286a21a2dd1108cf8659bb02ba8..a50377a70fb7bda0efe8a02f0885215cb6ab94a9 100644 (file)
@@ -67,8 +67,8 @@ else { # windows, look for mpich2
   foreach my $try (@potential) {
     if (-f "$try\\bin\\mpiexec.exe") {
       $mpirun = "$try\\bin\\mpiexec.exe";
-      $libs = qq{-L "$try\\lib\\" -lmpi};
-      $ccflags = qq{-I "$try\\include\\" -L "$try\\lib" -lmpi};
+      $libs = qq{"-L$try\\lib" -lmpi};
+      $ccflags = qq{"-I$try\\include" "-L$try\\lib" -lmpi};
     }
   }
 }
diff --git a/test.pl b/test.pl
index 98001a9cee8ac56ed07e4109f8c69155a03f6b98..a55463e95acc115e42a4f32ed2f1d14acdb6dd0e 100644 (file)
--- a/test.pl
+++ b/test.pl
@@ -1,15 +1,15 @@
-my $mpirun = "mpirun"; # fallback
+my $mpirun = "";
 foreach my $mpi_try (qw(mpiexec mpirun)) {
-    my $test = join("",`$mpi_try -n 1 echo test`);
-    $mpirun = $mpi_try unless $! =~ /No such file or directory/;
+    my $test = join("",`$mpi_try -n 1 perl -e "print qq{honk},qq{honk\n}"`);
+    $mpirun = $mpi_try if $test =~ /honkhonk/;
     last if $mpirun;
 }
-
+$mpirun = $mpirun || "mpirun"; # fallback
 my $incs;
 $incs .= " -I$_" foreach @INC;
 my @newout = sort {
     (($a =~ /(\d+)/g)[0] <=> ($b =~ /(\d+)/g)[0])
-} `mpirun -np 2 $^X $incs ic.pl`;
+} `$mpirun -np 2 $^X $incs ic.pl`;
 print "1..24\n";
 if (@newout < 24) {
     print "not ok 1 # mpirun failed.  Do you need to start mpd?\n";