fail quietly on systems we cannot run on top of
authorAlex Gough <alex@earth.li>
Mon, 6 Jun 2011 04:29:12 +0000 (05:29 +0100)
committerAlex Gough <alex@earth.li>
Mon, 6 Jun 2011 04:29:12 +0000 (05:29 +0100)
Makefile.PL

index b6e60a4c48a31dd3a9b27f6cf3ee24780ab37e91..20a85d53001e4005ec6d31d4f7a181c75d0c34df 100644 (file)
@@ -20,6 +20,14 @@ Also, this module is very new so if you manage to get it working on one
 of the systems not listed in INSTALL I'd love to hear about it.
 ENDOFMESSAGE
 
+# do we have mpirun?
+my $test = join("",`mpirun -n 1 echo test`);
+if ($! =~ /No such file or directory/ && !$ENV{FORCE_MPIRUN}) {
+  print STDERR "Failed to run `mpirun -n 1 echo test`: $!\n";
+  print STDERR "It looks like you don't have mpi installed, re-run build with env: FORCE_MPIRUN=1 to ignore\n";
+  exit(0);
+}
+
 my ($libs, $ccflags) = ("", "");
 # try to get this information from mpicc, should quietly fail if not
 {