From: Alex Gough Date: Mon, 6 Jun 2011 06:28:53 +0000 (+1200) Subject: Now works on Win32 with mpich 1.1.1 X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=d0d2507b0b34770c26e18ae86a68fd8abe9dedfe;p=libparallel-mpi-simple-perl.git Now works on Win32 with mpich 1.1.1 --- diff --git a/Makefile.PL b/Makefile.PL index 2891e91..a50377a 100644 --- a/Makefile.PL +++ b/Makefile.PL @@ -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 98001a9..a55463e 100644 --- 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";