Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

[unitrace] Build fails with -DBUILD_WITH_OMP=OFF

オープン 初心者向け
#121 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
2/5
見積もり時間
1〜3時間
初心者へのやさしさ
72/100
issue の種類
バグ
明瞭さ
明確に書かれている
活発さ
活発
技術スタック
cmake, cpp

調査の方向性

コンパイルエラーは、BUILD_WITH_OMP を値として使っている tools/unitrace/src/unitrace.cc の 481 行目と 495 行目、および tools/unitrace/CMakeLists.txt の 30 行目付近にある set(BUILD_WITH_OMP ...) の呼び出しに起因します。まず、CMake がこの値をコンパイル定義にどのように渡しているかを確認してください。そのうえで、ソースに届く前に OFF/ON/0/1/TRUE/FALSE を数値に正規化します。-DBUILD_WITH_OMP=OFF でビルドが成功し、他の受け付けられる表記も引き続き動作し、出力される OMP の値が正しければ完了です。

索引モデルが issue の本文から書いたものです。

説明

On:

Project compilation fails if build is configured with -DBUILD_WITH_OMP=OFF:

#8 14.38 /usr/bin/dpclang++ -DBUILD_WITH_ITT=0 -DBUILD_WITH_L0=1 -DBUILD_WITH_MPI=0 -DBUILD_WITH_OMP=OFF -DBUILD_WITH_OPENCL=1 -DBUILD_WITH_PERFETTO=1 -DBUILD_WITH_XPTI=1 -DCXX_STD_FILESYSTEM_EXPERIMENTAL=0 -DUNITRACE_INSTALL_LIBDIR=\"lib\" -I/opt/pti-gpu/_build -I/opt/pti-gpu/tools/unitrace/src -I/opt/pti-gpu/tools/unitrace/src/levelzero -I/opt/pti-gpu/tools/unitrace/src/utils -I/opt/pti-gpu/tools/unitrace/../utils -I/opt/pti-gpu/tools/unitrace/../../utils -fvisibility=hidden -DPTI_VERSION=1.0.0 -std=c++17 -fvisibility=default -O3 -DNDEBUG -MD -MT tools/unitrace/CMakeFiles/unitrace.dir/src/unitrace.cc.o -MF tools/unitrace/CMakeFiles/unitrace.dir/src/unitrace.cc.o.d -o tools/unitrace/CMakeFiles/unitrace.dir/src/unitrace.cc.o -c /opt/pti-gpu/tools/unitrace/src/unitrace.cc
#8 14.38 /opt/pti-gpu/tools/unitrace/src/unitrace.cc:481:44: error: use of undeclared identifier 'OFF'
#8 14.38   481 |   header += ", \"OMP\": " + std::to_string(BUILD_WITH_OMP);
#8 14.38       |                                            ^~~~~~~~~~~~~~
#8 14.38 <command line>:4:24: note: expanded from macro 'BUILD_WITH_OMP'
#8 14.38     4 | #define BUILD_WITH_OMP OFF
#8 14.38       |                        ^~~
#8 14.38 /opt/pti-gpu/tools/unitrace/src/unitrace.cc:495:37: error: use of undeclared identifier 'OFF'
#8 14.38   495 |   std::cout << "BUILD_WITH_OMP=" << BUILD_WITH_OMP << ", ";
#8 14.38       |                                     ^~~~~~~~~~~~~~
#8 14.38 <command line>:4:24: note: expanded from macro 'BUILD_WITH_OMP'
#8 14.38     4 | #define BUILD_WITH_OMP OFF
#8 14.38       |                        ^~~
#8 14.38 2 errors generated.

Please, fix the build assuming that BUILD_WITH_OMP can validly be specified as OFF|ON|1|0|TRUE|FALSE.

I also recommend to align the way how unitrace options are set, i.e. consider change set(BUILD_WITH_OMP ...) to option(BUILD_WITH_OMP ...). As of now that not uniformed:
https://github.com/intel/pti-gpu/blob/6c0d6b0b80c6dbac4b5902d9d5ade1c75b9e9033/tools/unitrace/CMakeLists.txt#L30
https://github.com/intel/pti-gpu/blob/6c0d6b0b80c6dbac4b5902d9d5ade1c75b9e9033/tools/unitrace/CMakeLists.txt#L58

Example of build setup (using dpclang open source compiler, but the issue should be reproducible with oneAPI DPC++ as well):

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=OFF \
    -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

主要言語
C++
スター
276
フォーク
73
PR マージ指標
30日以内にマージされた PR はありません

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

intel/pti-gpu のほかの issue

intel/pti-gpu の issue をすべて見る

似ている issue

C++ の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。