In MKLConfig.cmake, the compiler matching regexes:
if(CMAKE_CXX_COMPILER MATCHES ".*dpcpp[.exe]*") set(DPCPP_COMPILER ON) endif() if(CMAKE_C_COMPILER MATCHES ".*clang*") set(CLANG_COMPILER ON) endif()
aren't doing what they ought to. An optional .exe extension should be represented as:
and I believe that ".*clang*" would match any compiler path with "clan" somewhere in it.
Thank you for posting on Intel Communities.
Based on the revised snippet shared by you(".*dpcpp(\\.exe)?$"), you mean a must .exe to be expected after dpcpp and it should not accept any character. However, as per the existing exe, (.*dpcpp[.exe]*) is accepts any of the mentioned characters within the braces. Could you please let me know if my understanding correct?
Square brackets in a regular expression indicate a set of acceptable characters, *not* a group, which is what is intended here. For example:
"(\\.exe)?" would match zero or one instances of the string ".exe" at the end of a path - in other words it defines an optional .exe suffix
"[.exe]*" defines a set of characters ".", "e", "x", "e", and states that zero or more of these characters is acceptable. Furthermore, because the period is not escaped with \\, the "." character actually matches any character. This means that "[.exe]*" is actually equivalent to "[.]*". And given that the expression "[.exe]*" isn't followed by any other character/requirement, the entire "[.exe]*" is actually redundant, because it says "we are looking for zero or more of any character".