From 2a251419d0cb0b83ed429680539e9fd868988fd7 Mon Sep 17 00:00:00 2001 From: Laszlo Nagy Date: Tue, 24 Jul 2018 08:22:11 +1000 Subject: [PATCH] use full path to pick the right mpi compiler --- libscanbuild/compilation.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/libscanbuild/compilation.py b/libscanbuild/compilation.py index 4650e89..48470ee 100644 --- a/libscanbuild/compilation.py +++ b/libscanbuild/compilation.py @@ -220,7 +220,9 @@ def is_cxx_compiler(cmd): return ('c', parameters) if result is None else result # MPI compiler wrappers add extra parameters elif is_mpi_wrapper(executable): - mpi_call = get_mpi_call(executable) # type: List[str] + # Pass the executable with full path to avoid pick different + # executable from PATH. + mpi_call = get_mpi_call(command[0]) # type: List[str] return cls._split_compiler(mpi_call + parameters, cc, cxx) # and 'compiler' 'parameters' is valid. elif is_c_compiler(executable):