bfgroup / b2

B2 makes it easy to build C++ projects, everywhere.
https://www.bfgroup.xyz/b2/
Boost Software License 1.0
76 stars 228 forks source link

Use env variables instead of hardcoded paths for ms-mpi search #327

Closed maksim-petukhov closed 1 year ago

maksim-petukhov commented 1 year ago

Proposed changes

Microsoft MPI Redist and SDK installers set environment variables (MSMPI_BIN, MSMPI_INC, MSMPI_LIB32, MSMPI_LIB64) that described in the example in Microsoft MPI repository. These environment variables are widely used. For example, CMake uses them in it's FindMPI module there and there, Meson also uses these variables to locate MS-MPI.

This PR changes the way MS-MPI is searched. Instead of hardcoded paths to MS-MPI Redist and SDK, paths from environment variables mentioned above are used. This allows to use MS-MPI Redist and SDK installed to custom path.

I tested these changes with the latest MS-MPI Redist and SDK installed to the default path and to custom path.

Types of changes

What types of changes does your code introduce?

Put an x in the boxes that apply

Checklist

Put an x in the boxes that apply. You can also fill these out after creating the PR. If you're unsure about any of them, don't hesitate to ask. We're here to help! This is simply a reminder of what we are going to look for before merging your code.

maksim-petukhov commented 1 year ago

@grafikrobot could you please review this PR?