build: Check if allow-run-as-root is an mpi option by executing cmake instead of dir
This commit is contained in:
6
ns3
6
ns3
@@ -1540,7 +1540,11 @@ def run_step(args, target_to_run, target_args):
|
|||||||
if target_to_run in ["mpiexec", "mpirun"] and os.getenv("MPI_CI"):
|
if target_to_run in ["mpiexec", "mpirun"] and os.getenv("MPI_CI"):
|
||||||
if shutil.which("ompi_info"):
|
if shutil.which("ompi_info"):
|
||||||
try:
|
try:
|
||||||
subprocess.check_call([target_to_run, "--allow-run-as-root", "dir"])
|
subprocess.check_call(
|
||||||
|
[target_to_run, "--allow-run-as-root", "cmake", "--version"],
|
||||||
|
stdout=subprocess.DEVNULL,
|
||||||
|
stderr=subprocess.DEVNULL,
|
||||||
|
)
|
||||||
target_args = ["--allow-run-as-root"] + target_args
|
target_args = ["--allow-run-as-root"] + target_args
|
||||||
except subprocess.CalledProcessError:
|
except subprocess.CalledProcessError:
|
||||||
pass
|
pass
|
||||||
|
|||||||
Reference in New Issue
Block a user