[unitrace] Build fails with -DBUILD_WITH_OMP=OFF
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 72/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Active
- Tech stack
- cmake, cpp
- Domain
- build-system, tooling
Research direction
The compile errors come from tools/unitrace/src/unitrace.cc at lines 481 and 495, where BUILD_WITH_OMP is used as a value, and from the set(BUILD_WITH_OMP ...) call near line 30 of tools/unitrace/CMakeLists.txt. Start by checking how CMake passes the value into the compile definition, then normalize OFF/ON/0/1/TRUE/FALSE to a numeric value before it reaches the source. Done means the build succeeds with -DBUILD_WITH_OMP=OFF, the other accepted spellings still work, and the printed OMP value is correct.
Written by the indexing model from the issue text.
Description
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
- Dominant language
- C++
- Stars
- 276
- Forks
- 73
- PR merge metrics
- No merged PRs in 30d
Getting set up
- No Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from intel/pti-gpu
-
Difficulty 1/5 Under an hour Newbie friendliness 92/100
-
Difficulty 4/5 3-5 days Newbie friendliness 20/100
-
Difficulty 3/5 1-2 days Newbie friendliness 50/100
-
[unitrace] Do not fetch for 3rd party projects 1) at build stage, 2) if they are already installedOpen
Difficulty 4/5 3-5 days Newbie friendliness 35/100
-
Difficulty 3/5 Half a day Newbie friendliness 45/100
Similar issues
-
ai_p1 comp-message-queues
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
ClickHouse/ClickHouse#125890 ·
Maintainers usually reply within 1 day
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
Maintainers usually reply within 1 day
-
bug
Difficulty 1/5 Under an hour Newbie friendliness 78/100
yt-project/ewah_bool_utils#215 · 1 comment ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
redis/memtier_benchmark#642 ·
Maintainers usually reply within 1 day
-
Feature Request
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
sandboxie-plus/Sandboxie#5653 ·
Maintainers usually reply within 1 day