[PR #4801] [Engine] CMakeLists: DeepSeek HIP builds from a path with a space #5189

Open
opened 2026-11-07 16:33:20 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/Niko1221/Strata/pull/4801
Author: @Cayaf89
Created: 10/31/2026
Status: 🔄 Open

Base: main ← Head: f-engine-hip-include-spaced


📝 Commits (1)

  • a07cb0a [Engine] CMakeLists: DeepSeek HIP builds from a path with a space

📊 Changes

1 file changed (+9 additions, -4 deletions)

View changed files

📝 CMakeLists.txt (+9 -4)

📄 Description

Problem and result

strata-dsv41 could not be built from a checkout whose path contains a space. Four target_compile_options lines spelled the force-include of include/strata/dsv41/hip_extra.h as "$<COMPILE_LANGUAGE:HIP,CXX>:SHELL:-include <path>" (ds4_tq_test_portable, ds4_tq_test, ds4_iq_test, and the loop over strata_dsv41_kernels and strata-dsv41). CMake writes that form into build.ninja unquoted, so with a space in the path the compiler receives -include, one piece of the path, and the rest as plain input files, which a -c -o compile cannot take. On this machine, a checkout under a folder named with a space, the HIP and CXX objects of those targets stopped with

clang++: error: cannot specify -o when generating multiple output files

and the target never linked. Written as one joined option, -include<path>, the same tree configures and cmake --build build-hip --target strata-dsv41 -j 6 ends with exit 0. For a path without a space the two forms give the same option, so the packaged builds do not move.

None opened. This is the build fix that let the machine in #4800 compile the engine at all; that report stays a separate results-only PR as CONTRIBUTING.md asks.

Approach

One option is what CMake quotes and what the front ends here accept. cmake/hip_backend.cmake:113-121 already splits its own shim include into a flag option and a path option for the same reason, and uses /FI on MSVC-style front ends; the joined form reaches the same end in one option. The four lines sit inside if(STRATA_ENABLE_HIP) under if(STRATA_BUILD_DSV41 AND NOT STRATA_HIP_GFX906) and name only DeepSeek targets, so no CUDA, SYCL, Metal or non-DeepSeek target is touched, and nothing changes for a checkout without a space in its path.

Validation

Passed:

  • A scratch cmake project under a path with a space (configure exit 0) prints both renderings in build.ninja: SHELL:-include <path> comes out as -include /tmp/sp cmake test/proj/include/.../extra.h, where the space splits it into arguments, and -include<path> comes out quoted as "-include/tmp/sp cmake test/proj/include/.../extra.h", one argument.
  • One test file that compiles only if the force-include works, built six ways: c++, the install's lib/llvm/bin/clang++, and hipcc, each plain and as -x hip --offload-arch=gfx1100, with -include joined to a path whose folders contain spaces: exit 0 in every case. Handing the split argv to the same clang++ fails on the pieces (no such file or directory for each fragment), which is what the old form hands over.
  • The real build, on this machine, gfx1100, TheRock ROCm 10.2.0: cmake --build build-hip --target strata-dsv41 -j 6 exited 0, engine/strata-dsv41 --version prints strata-dsv41 0.1.54 build 870aedd9e, ldd reports no missing library, grep -o gfx1100 finds 21 code-object markers, and build.ninja carries the option quoted in 36 rules with no SHELL:-include left in CMakeLists.txt.
  • That binary served the whole suite in #4800 (36 measured requests, failures []): the engine this option made possible ran real requests.

Failed:

  • Before the change, same tree, same generator: the HIP and CXX objects of the five DeepSeek targets stopped with the error quoted above and strata-dsv41 did not link. Nothing else failed.

Not run:

  • CUDA and SYCL: the edited block is inside if(STRATA_ENABLE_HIP) and names only DeepSeek targets, so those backends never compile these four lines. Nothing is claimed for them.
  • HIP builds for the other architectures the tree knows (gfx1201, gfx1030, gfx1151 and the rest): only gfx1100 was built here.
  • A Windows HIP build: cmake/hip_backend.cmake:113-115 uses /FI for MSVC-style front ends, and this part of CMakeLists.txt was not exercised on Windows.
  • Makefile generators: only Ninja was used.
  • A build of the tree at the current main with this patch: it was compiled from 870aedd9e, the commit the engine in #4800 came from; the four lines and their surrounding block are unchanged between that commit and main, which is why the patch applies cleanly here.

Limits

HIP only, five targets, four lines. For a checkout without a space the option is the same bytes as before, so the default path does not move. The binary this produced was run for --version, ldd and a real benchmark, not for correctness by this change, and the option form was checked on Ninja with three front ends rather than on every generator or platform the tree supports.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/Niko1221/Strata/pull/4801 **Author:** [@Cayaf89](https://github.com/Cayaf89) **Created:** 10/31/2026 **Status:** 🔄 Open **Base:** `main` ← **Head:** `f-engine-hip-include-spaced` --- ### 📝 Commits (1) - [`a07cb0a`](https://github.com/Niko1221/Strata/commit/a07cb0a5fc425904d63c4682eaf005aed42f9572) [Engine] CMakeLists: DeepSeek HIP builds from a path with a space ### 📊 Changes **1 file changed** (+9 additions, -4 deletions) <details> <summary>View changed files</summary> 📝 `CMakeLists.txt` (+9 -4) </details> ### 📄 Description ## Problem and result `strata-dsv41` could not be built from a checkout whose path contains a space. Four `target_compile_options` lines spelled the force-include of `include/strata/dsv41/hip_extra.h` as `"$<COMPILE_LANGUAGE:HIP,CXX>:SHELL:-include <path>"` (`ds4_tq_test_portable`, `ds4_tq_test`, `ds4_iq_test`, and the loop over `strata_dsv41_kernels` and `strata-dsv41`). CMake writes that form into `build.ninja` unquoted, so with a space in the path the compiler receives `-include`, one piece of the path, and the rest as plain input files, which a `-c -o` compile cannot take. On this machine, a checkout under a folder named with a space, the HIP and CXX objects of those targets stopped with clang++: error: cannot specify -o when generating multiple output files and the target never linked. Written as one joined option, `-include<path>`, the same tree configures and `cmake --build build-hip --target strata-dsv41 -j 6` ends with exit 0. For a path without a space the two forms give the same option, so the packaged builds do not move. ## Related discussion None opened. This is the build fix that let the machine in #4800 compile the engine at all; that report stays a separate results-only PR as `CONTRIBUTING.md` asks. ## Approach One option is what CMake quotes and what the front ends here accept. `cmake/hip_backend.cmake:113-121` already splits its own shim include into a flag option and a path option for the same reason, and uses `/FI` on MSVC-style front ends; the joined form reaches the same end in one option. The four lines sit inside `if(STRATA_ENABLE_HIP)` under `if(STRATA_BUILD_DSV41 AND NOT STRATA_HIP_GFX906)` and name only DeepSeek targets, so no CUDA, SYCL, Metal or non-DeepSeek target is touched, and nothing changes for a checkout without a space in its path. ## Validation **Passed:** - A scratch cmake project under a path with a space (configure exit 0) prints both renderings in `build.ninja`: `SHELL:-include <path>` comes out as `-include /tmp/sp cmake test/proj/include/.../extra.h`, where the space splits it into arguments, and `-include<path>` comes out quoted as `"-include/tmp/sp cmake test/proj/include/.../extra.h"`, one argument. - One test file that compiles only if the force-include works, built six ways: `c++`, the install's `lib/llvm/bin/clang++`, and `hipcc`, each plain and as `-x hip --offload-arch=gfx1100`, with `-include` joined to a path whose folders contain spaces: exit 0 in every case. Handing the split argv to the same `clang++` fails on the pieces (`no such file or directory` for each fragment), which is what the old form hands over. - The real build, on this machine, `gfx1100`, TheRock ROCm 10.2.0: `cmake --build build-hip --target strata-dsv41 -j 6` exited 0, `engine/strata-dsv41 --version` prints `strata-dsv41 0.1.54 build 870aedd9e`, `ldd` reports no missing library, `grep -o gfx1100` finds 21 code-object markers, and `build.ninja` carries the option quoted in 36 rules with no `SHELL:-include` left in `CMakeLists.txt`. - That binary served the whole suite in #4800 (36 measured requests, `failures []`): the engine this option made possible ran real requests. **Failed:** - Before the change, same tree, same generator: the HIP and CXX objects of the five DeepSeek targets stopped with the error quoted above and `strata-dsv41` did not link. Nothing else failed. **Not run:** - CUDA and SYCL: the edited block is inside `if(STRATA_ENABLE_HIP)` and names only DeepSeek targets, so those backends never compile these four lines. Nothing is claimed for them. - HIP builds for the other architectures the tree knows (`gfx1201`, `gfx1030`, `gfx1151` and the rest): only `gfx1100` was built here. - A Windows HIP build: `cmake/hip_backend.cmake:113-115` uses `/FI` for MSVC-style front ends, and this part of `CMakeLists.txt` was not exercised on Windows. - Makefile generators: only Ninja was used. - A build of the tree at the current `main` with this patch: it was compiled from `870aedd9e`, the commit the engine in #4800 came from; the four lines and their surrounding block are unchanged between that commit and `main`, which is why the patch applies cleanly here. ## Limits HIP only, five targets, four lines. For a checkout without a space the option is the same bytes as before, so the default path does not move. The binary this produced was run for `--version`, `ldd` and a real benchmark, not for correctness by this change, and the option form was checked on Ninja with three front ends rather than on every generator or platform the tree supports. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Niko1221/Strata#5189
No description provided.