intel / pti-gpu

Profiling Tools Interfaces for GPU (PTI for GPU) is a set of Getting Started Documentation and Tools Library to start performance analysis on Intel(R) Processor Graphics easily
MIT License
202 stars 57 forks source link

Add support for systems with only Python3 #1

Closed al42and closed 3 years ago

al42and commented 3 years ago

On Ubuntu 20.04 and later, it is possible to have only Python 3 installed. For 20.10, it is the default. In such configurations, there is no python binary (unless python-is-python3 package is installed). This causes a mildly cryptic error when building samples, like:

Scanning dependencies of target ze_gen_headers
[ 50%] Generating tracing.gen
No such file or directory

In this PR, a built-in CMake mechanics to discover a Python interpreter is employed.

The find_package(PythonInterp REQUIRED) syntax is supported, albeit deprecated, in CMake after 3.12. If desired, the conditions in lines 6-11 can be replaced by a single line.

On a related note, the README says "Python (version 2.8 and above)", which is a bit confusing, since there is no Python 2.8. I'm not sure whether it meant to say 2.7, 2.7.8, or that no release from the 2.x branch is supported.

anton-v-gorshkov commented 3 years ago

Merged, thanks!