[unitrace] Support build with system installed protobuf

Aperta
#123 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
3/5
Tempo stimato
1-2 giorni
Idoneità per principianti
50/100
Tipo di issue
Funzionalità
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
cmake, cpp
Ambito
build-system

Direzione di ricerca

The protobuf dependency is fetched by git clone inside tools/unitrace/cmake/Perfetto.cmake, around line 46, which the issue links. Start by reading how that file fetches protobuf and whether it checks for an installed copy first. Done means the unitrace build uses a system protobuf when one is present, and an explicit CMake option can turn off the fallback clone.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

On:

Protobuf compiler is included into many Linux distributions. Please, support:

  1. Building unitrace with system installed version if already installed.
  2. Optionally, fallback mechanism if protobuf is not installed
    • If fallback is supported, option must be provided to explicitly disable it. Standard CMake helpers support this out-of-the-box.

https://github.com/intel/pti-gpu/blob/6c0d6b0b80c6dbac4b5902d9d5ade1c75b9e9033/tools/unitrace/cmake/Perfetto.cmake#L46

#8 12.90 Cloning into '/opt/pti-gpu/_build/protobuf'...
#8 14.97 Note: switching to 'f0dc78d7e6e331b8c6bb2d5283e06aa26883ca7c'.
#8 14.97
#8 14.97 You are in 'detached HEAD' state. You can look around, make experimental
#8 14.97 changes and commit them, and you can discard any commits you make in this
#8 14.97 state without impacting any branches by switching back to a branch.
#8 14.97
#8 14.97 If you want to create a new branch to retain commits you create, you may
#8 14.97 do so (now or later) by using -c with the switch command. Example:
#8 14.97
#8 14.97   git switch -c <new-branch-name>
#8 14.97
#8 14.97 Or undo this operation with:
#8 14.97
#8 14.97   git switch -
#8 14.97
#8 14.97 Turn off this advice by setting config variable advice.detachedHead to false

Configuration and build example:

FROM ubuntu:26.10

RUN apt-get update && apt-get install -y --no-install-recommends \
    ca-certificates \
    cmake \
    dpclang-7 \
    git \
    libxptifw-dev \
    libze-dev \
    ocl-icd-opencl-dev \
    pkg-config \
    python3 \
    python3-dev \
    ninja-build && \
  rm -rf /var/lib/apt/lists/*

RUN cd /opt && git clone https://github.com/intel/pti-gpu.git
RUN cd /opt/pti-gpu && git reset --hard 6c0d6b0b80c6dbac4b5902d9d5ade1c75b9e9033

RUN cd /opt/pti-gpu && cmake -B _build -S . -G Ninja \
    -DBUILD_WITH_ITT=0 \
    -DBUILD_WITH_OMP=0 \
    -DCMAKE_BUILD_TYPE=Release \
    -DCMAKE_C_COMPILER=dpclang \
    -DCMAKE_CXX_COMPILER=dpclang++ \
    -DCMAKE_INSTALL_PREFIX=/opt/install
RUN cd /opt/pti-gpu && cmake --build _build
RUN cd /opt/pti-gpu && cmake --install _build

CC: @mschilling0

Lingua principale
C++
Stelle
278
Fork
75
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di intel/pti-gpu

Tutte le issue di intel/pti-gpu

Issue simili

Altre issue su C++

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.