diff options
author | Michael Hirsch, Ph.D <10931741+scivision@users.noreply.github.com> | 2019-08-23 19:33:54 -0400 |
---|---|---|
committer | Jussi Pakkanen <jpakkane@gmail.com> | 2019-08-24 02:33:54 +0300 |
commit | e3b21de5630e009f130d2e160a6fc125b5f84e31 (patch) | |
tree | 68bb7eb855cec2fb4d99317a7def5ada24794495 /run_tests.py | |
parent | 110b56293059999231d5b32cbf552c7845375cb0 (diff) | |
download | meson-e3b21de5630e009f130d2e160a6fc125b5f84e31.zip meson-e3b21de5630e009f130d2e160a6fc125b5f84e31.tar.gz meson-e3b21de5630e009f130d2e160a6fc125b5f84e31.tar.bz2 |
Intel-Cl tests: increase robustness of Windows Intel compilers detection (#5828)
* intel-cl tests: more rigorous detection of intent to use Intel Windows compilers
* fortran coarray test: make skipping more robust in that underlying MPI stack is .run()
This is useful for any Fortran coarray work, and especially for intel-cl where multiple Intel compiler
versions are often installed, and the wrong underlying MPI library may be dynamically linked,
and so a runtime check is needed to exercise the MPI stack underlying Fortran coarray.
This is done by
fc.run('sync all; end', dependencies: coarray)
* pep8
Diffstat (limited to 'run_tests.py')
-rwxr-xr-x | run_tests.py | 30 |
1 files changed, 27 insertions, 3 deletions
diff --git a/run_tests.py b/run_tests.py index 7e95643..dbb21df 100755 --- a/run_tests.py +++ b/run_tests.py @@ -38,9 +38,7 @@ def guess_backend(backend, msbuild_exe: str): # Auto-detect backend if unspecified backend_flags = [] if backend is None: - if (msbuild_exe is not None and - mesonlib.is_windows() and not - (os.environ.get('CC') == 'icl' or os.environ.get('CXX') == 'icl' or os.environ.get('FC') == 'ifort')): + if msbuild_exe is not None and (mesonlib.is_windows() and not _using_intelcl()): backend = 'vs' # Meson will auto-detect VS version to use else: backend = 'ninja' @@ -59,6 +57,32 @@ def guess_backend(backend, msbuild_exe: str): return (backend, backend_flags) +def _using_intelcl() -> bool: + """ + detect if intending to using Intel-Cl compilers (Intel compilers on Windows) + Sufficient evidence of intent is that user is working in the Intel compiler + shell environment, otherwise this function returns False + """ + if not mesonlib.is_windows(): + return False + # handle where user tried to "blank" MKLROOT and left space(s) + if not os.environ.get('MKLROOT', '').strip(): + return False + if (os.environ.get('CC') == 'icl' or + os.environ.get('CXX') == 'icl' or + os.environ.get('FC') == 'ifort'): + return True + # Intel-Cl users might not have the CC,CXX,FC envvars set, + # but because they're in Intel shell, the exe's below are on PATH + if shutil.which('icl') or shutil.which('ifort'): + return True + mlog.warning('It appears you might be intending to use Intel compiler on Windows ' + 'since non-empty environment variable MKLROOT is set to {} ' + 'However, Meson cannot find the Intel WIndows compiler executables (icl,ifort).' + 'Please try using the Intel shell.'.format(os.environ.get('MKLROOT'))) + return False + + # Fake classes and objects for mocking class FakeBuild: def __init__(self, env): |