From a401db7de939992eba29ec40846511575b1de27f Mon Sep 17 00:00:00 2001 From: James Sharpe Date: Fri, 15 Jan 2021 16:12:58 +0000 Subject: [PATCH] Add setting of MPICC to vpip --- build_tools/py/py.bzl | 1 + build_tools/py/vpip.py | 3 +++ 2 files changed, 4 insertions(+) diff --git a/build_tools/py/py.bzl b/build_tools/py/py.bzl index f3ed5f3b..ff066375 100644 --- a/build_tools/py/py.bzl +++ b/build_tools/py/py.bzl @@ -85,6 +85,7 @@ def _add_vpip_compiler_args(ctx, cc_toolchain, copts, conly, args): action_name = CPP_LINK_STATIC_LIBRARY_ACTION_NAME, ) args.add(c_compiler, format = "--compiler-executable=%s") + args.add(c_compiler, format = "--mpi-executable=%s") args.add(archiver, format = "--archiver=%s") # Add base compiler flags from the crosstool. These contain the correct diff --git a/build_tools/py/vpip.py b/build_tools/py/vpip.py index 93352cb5..5d1ca7ed 100644 --- a/build_tools/py/vpip.py +++ b/build_tools/py/vpip.py @@ -69,6 +69,8 @@ def get_unix_pip_env(venv, venv_source, execroot): env["F77"] = env["F90"] = os.path.join(os.getcwd(), ARGS.fortran_compiler) env["AR"] = os.path.join(os.getcwd(), ARGS.archiver) env["CC"] = os.path.join(os.getcwd(), ARGS.compiler_executable) + if ARGS.mpi_executable: + env["MPICC"] = os.path.join(os.getcwd(), ARGS.mpi_executable) env["LD"] = env["CC"] env["LDSHARED"] = os.path.abspath( os.path.join(os.path.dirname(__file__), "ldshared-wrapper") @@ -547,6 +549,7 @@ def main(): p.add_argument("--toolchain-root", default="/usr") p.add_argument("--archiver", help="path to unix ar tool") p.add_argument("--compiler-executable", help="C++ compiler") + p.add_argument("--mpi-executable", help="MPI compiler") p.add_argument("--fortran-compiler", help="the fortran compiler") p.add_argument( "--include-path",