Skip to content

Commit

Permalink
Compilers: make oneapi ifx version_regex tolerant to wrappers (spack#…
Browse files Browse the repository at this point in the history
…21742)

If a user creates a wrapper for the ifx binary called ifx_orig,
this causes the ifx --version command to produce:

$ ifx --version
ifx_orig (IFORT) 2021.1 Beta 20201113
Copyright (C) 1985-2020 Intel Corporation. All rights reserved.

The regex for ifx currently expects the output to begin with
"ifx (IFORT)..." so the wrapper would not be detected as ifx. This
PR removes the need for the static "ifx" string which allows wrappers
to be detected as ifx.

In general, the Intel compiler regexes do not include the invoked
executable name (i.e., ifort, icc, icx, etc.), so this is not
expected to cause any issues.
  • Loading branch information
lee218llnl authored Feb 26, 2021
1 parent 590457c commit b56d65f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/spack/spack/compilers/oneapi.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ class Oneapi(Compiler):
PrgEnv_compiler = 'oneapi'

version_argument = '--version'
version_regex = r'(?:(?:oneAPI DPC\+\+ Compiler)|(?:ifx \(IFORT\))) (\S+)'
version_regex = r'(?:(?:oneAPI DPC\+\+ Compiler)|(?:\(IFORT\))) (\S+)'

@property
def verbose_flag(self):
Expand Down

0 comments on commit b56d65f

Please sign in to comment.