diff --git a/var/spack/repos/builtin/packages/openmpi/package.py b/var/spack/repos/builtin/packages/openmpi/package.py index d3991a8f21..dd8d313694 100644 --- a/var/spack/repos/builtin/packages/openmpi/package.py +++ b/var/spack/repos/builtin/packages/openmpi/package.py @@ -6,6 +6,7 @@ import os import sys +import llnl.util.tty as tty def _verbs_dir(): @@ -478,7 +479,13 @@ def delete_mpirun_mpiexec(self): # only sensible choice (orterun is still present, but normal # users don't know about that). if '@1.6: ~legacylaunchers schedulers=slurm' in self.spec: - os.remove(self.prefix.bin.mpirun) - os.remove(self.prefix.bin.mpiexec) - os.remove(self.prefix.bin.shmemrun) - os.remove(self.prefix.bin.oshrun) + exe_list = [self.prefix.bin.mpirun, + self.prefix.bin.mpiexec, + self.prefix.bin.shmemrun, + self.prefix.bin.oshrun + ] + for exe in exe_list: + try: + os.remove(exe) + except OSError: + tty.debug("File not present: " + exe)