From 96692d11a5afa715b4928de7d41709b8bf3cecf4 Mon Sep 17 00:00:00 2001 From: david-cortes-intel Date: Mon, 3 Feb 2025 08:02:20 +0100 Subject: [PATCH] accept I_MPI_ROOT in place of MPIROOT (#2295) --- INSTALL.md | 2 +- setup.py | 7 ++++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/INSTALL.md b/INSTALL.md index c512afedc4..bdb216cef9 100755 --- a/INSTALL.md +++ b/INSTALL.md @@ -162,7 +162,7 @@ The build-process (using setup.py) happens in 4 stages: ### Configure the Build with Environment Variables * ``SKLEARNEX_VERSION``: sets the package version * ``DALROOT``: sets the oneAPI Data Analytics Library path -* ``MPIROOT``: sets the path to the MPI library that will be used for distributed mode support. Not used when using `NO_DIST=1` +* ``MPIROOT``: sets the path to the MPI library that will be used for distributed mode support. If this variable is not set but `I_MPI_ROOT` is found, will use `I_MPI_ROOT` instead. Not used when using `NO_DIST=1` * ``NO_DIST``: set to '1', 'yes' or alike to build without support for distributed mode * ``NO_STREAM``: set to '1', 'yes' or alike to build without support for streaming mode * ``NO_DPC``: set to '1', 'yes' or alike to build without support of oneDAL DPC++ interfaces diff --git a/setup.py b/setup.py index eacc5a8581..ca65c76078 100644 --- a/setup.py +++ b/setup.py @@ -92,7 +92,12 @@ no_stream = "NO_STREAM" in os.environ and os.environ["NO_STREAM"] in trues use_gcov = "SKLEARNEX_GCOV" in os.environ and os.environ["SKLEARNEX_GCOV"] in trues debug_build = os.getenv("DEBUG_BUILD") == "1" -mpi_root = None if no_dist else os.environ["MPIROOT"] +mpi_root = None if no_dist else os.environ.get("MPIROOT", os.environ.get("I_MPI_ROOT")) +if (not no_dist) and (mpi_root is None): + raise ValueError( + "'MPIROOT' is not set, cannot build with distributed mode." + " Use 'NO_DIST=1' to build without distributed mode." + ) dpcpp = ( shutil.which("icpx") is not None and "onedal_dpc" in get_onedal_shared_libs(dal_root)