Repository navigation
Makefile testing Add Makefile CI: configure-based dependency detection, build, and test - #442
Conversation
Signed-off-by: zichguan-amd <zichuan.guan@amd.com> (cherry picked from commit b185e37)
- Replace HIP_ARCHITECTURES (unused by individual example Makefiles) with CXXFLAGS="--offload-arch=..." which is how hipcc receives the target arch - Add if: cancelled guard so Makefile build runs even when ctest fails, preventing test failures from masking Makefile build results Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Replace hardcoded `ROCM_INSTALL_DIR ?= /opt/rocm` with `ROCM_INSTALL_DIR := $(or $(ROCM_PATH),/opt/rocm)` across all 378 leaf Makefiles. This allows TheRock CI to set ROCM_PATH in the environment while preserving /opt/rocm as the default fallback. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
The Makefile build unconditionally tried to compile all libraries, failing when optional dependencies (rocALUTION, MIVisionX, rocAL, hipTensor, MIGraphX, rocCV) aren't installed in the CI environment. Add wildcard header checks to mirror the CMake find_package() behavior. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Add RPP to conditional header checks (rpp/rpp.h missing in wheel env) - Skip rocProfiler-SDK openmp_target example when ENABLE_OPENMP=OFF (wheel installs lack amdllvm needed for OpenMP offloading) Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Set HIPCC_COMPILE_FLAGS_APPEND env var in CI to ensure all hipcc compilations target the correct GPU architecture. This fixes ~370 leaf Makefiles that don't pass --offload-arch, without affecting g++/amdclang++ examples since only hipcc reads this env var. Guard openmp_target behind an amdclang++ existence check so tarball installs that lack amdclang++ don't fail the Makefile build. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Skip opengl_interop, vulkan_interop, and sobel_filter when glfw3/vulkan pkg-config packages are not available. Guard rocDecode and rocJPEG behind header existence checks, matching the pattern used for other optional libraries like hipTensor, MIGraphX, and rocAL. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
pkg-config is not installed in SLES and AlmaLinux CI containers, causing make to exit with code 2. Use $(wildcard ...) header detection instead, matching the pattern already used in Libraries/Makefile. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Two failures in the Makefile build step: 1. rocDecode examples link against FFmpeg (-lavcodec, -lavformat, -lavutil) which is not installed in CI containers. The rocdecode header check alone is insufficient — also check for FFmpeg headers before including rocDecode in the build. 2. rocProfiler-SDK/code_object_tracing fails with undefined symbol pthread_join — add missing -lpthread to the link command. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Add configure.sh and Common/require_deps.mk to detect external dependencies (FFmpeg, OpenCV, GLFW3, Vulkan, glslangValidator) before build. Each leaf Makefile declares REQUIRED_DEPS and cleanly skips when dependencies are missing, preventing link-time failures in CI. - configure.sh: probes deps via pkg-config with fallbacks, writes config.mk - require_deps.mk: checks REQUIRED_DEPS, sets SKIP_BUILD=1 if unmet - run_makefile_tests.sh: finds and runs Makefile-built executables with timeout and skip-file support - Update 27 leaf Makefiles (rocDecode, rocCV, RPP, opengl/vulkan_interop, sobel_filter) to use the new dependency gating - Remove FFmpeg guard from Libraries/Makefile (let leaves decide) - Update CI workflow: run configure.sh before make, run Makefile tests before CMake build - Fix rocProfiler-SDK/code_object_tracing: add -lpthread to ILDLIBS Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
The code_object_isa_decode example links -ldw and -lamd_comgr which are not available in all CI containers (e.g. AlmaLinux). Add LIBDW and AMD_COMGR to the configure detection system and skip the example when either is missing. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Show (N/total) counter for each test like ctest does, e.g.: (1/42) RUN hip_device_query (1/42) PASS hip_device_query (2/42) SKIP rccl_allgather Also print total test count and skip file info upfront, and show a single summary line at the end. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Run each test from its own directory so data files (test.jpg, graph4096.txt, etc.) are found via relative paths - Support TEST_ARGS variable in Makefiles for tests needing arguments (e.g. hip_bfs requires graph4096.txt as input) - Add AlmaLinux 8 skip entries for GLIBC_2.34 incompatible binaries (warp_size_reduction) and missing hipSPARSELt Tensile libraries Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Only run Makefile-built tests that are also registered as ctest tests. This ensures the Makefile test runner exercises exactly the same set of examples that CMake validates, avoiding failures from examples that need special arguments, scripts, or aren't meant to run standalone. - Add --allow-file option to run_makefile_tests.sh: filters Makefile executables to only those present in the allow list - Move Makefile tests step after ctest in CI workflow - Extract ctest test names via `ctest -N` and pass as the allow file Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
rocdecode_rocdec_decode requires -i <frames_dir> which is only available via ROCDECODE_TEST_FRAMES_DIR set during CMake configure. Add a MAKEFILE_SKIP_TESTS list to generate_skip_tests.py and a --makefile flag to include these skips. The CI Makefile tests step now regenerates the skip list with --makefile before running. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
On SLES 15.7 the FFmpeg development headers exist at /usr/include/libavcodec/avcodec.h but the shared libraries are not installed, causing link failures. The header-only fallback in both configure.sh and require_deps.mk now also verifies the library is in ldconfig before reporting the dependency as available. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
The header-only fallback (checking /usr/include for headers) causes false positives on SLES where dev headers exist but libraries don't. Rely solely on pkg-config, which only succeeds when dev packages are properly installed with both headers and linkable libraries. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…add -lstdc++fs rocdec_decode had inline pkg-config FFmpeg detection that bypassed the configure system. On SLES, pkg-config found .pc files but libraries couldn't actually be linked. Now uses HAVE_FFMPEG from config.mk/ require_deps.mk instead. Also adds -lstdc++fs to rocdec_decode and video_to_sequence for std::experimental::filesystem symbols needed on older toolchains. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…ev packages On SLES, FFmpeg .pc files exist (runtime packages) but the actual libraries cannot be linked (-dev packages missing). pkg-config --exists succeeds but linking fails. Now both configure.sh and the require_deps.mk fallback verify that pkg-config libraries can actually be linked by compiling a trivial C program with the reported -l flags. Also integrates rocdec_decode with the configure system (HAVE_FFMPEG) instead of its own inline pkg-config detection. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
The SLES wheel containers may not have cc/gcc. Try multiple compilers in order, including the ROCm-bundled clang as last resort. If no compiler is found, conservatively report the dependency as missing. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…format/-lavutil On SLES tarball, FFmpeg is installed under /usr/local/lib. pkg-config returns -L/usr/local/lib along with the -l flags, but the Makefiles were hardcoding just -lavcodec -lavformat -lavutil without the -L path. The ROCm linker (ld.lld) doesn't search /usr/local/lib by default, so linking failed. Now all 8 rocDecode Makefiles use $(FFMPEG_LIBS) which includes the correct -L path from pkg-config. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Replace `ctest -N` + grep/sed (which listed *registered* tests) with `ctest --output-junit` + a Python script that parses the JUnit XML to extract tests that ctest *actually ran*. This ensures true parity between CMake and Makefile test sets. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…ails) Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Move Test summary step after Makefile tests so it covers both - Add CMake and Makefile test results to the GitHub step summary - Upload Makefile test output as a separate artifact - Remove duplicate skipped-tests output from ctest step (now in summary) Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Collect Makefile-built executables into a staging directory and upload them as a separate artifact, matching the CMake build artifact upload. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Ensures subsequent steps (CMake, tests, uploads) still run even if the Makefile build fails, while still marking the workflow as failed. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Move CMake and Makefile build uploads to the same location, after both CMake and Makefile builds finish, so artifacts are logically grouped. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
zichguan-amd
left a comment
There was a problem hiding this comment.
Sorry for the late review, here's some general comment:
- copyright year should be 2026
- let's remove the ctest-related script and logic
- some binary files are included in the PR, please remove that and check if gitignore is properly configured
- scripts should be in the Scripts folder
As of testing design, it would be great if we can keep the Make testing independent of ctest. The configuration logics for dependency detection is great, just need to decouple the testing part. So, I'm more leaning toward this PR than the other approach. What I'm looking for is:
- leaf Makefiles should be runnable standalone
- CI only orchestrates, testing logic should be handled by Make (test command, args, timeout, etc)
This PR is good with 1. For number 2, we could require a test target that depends on the build target for each leaf Makefile and cascade the test target from root level so that we can simply run make test to build and run the tests. Test target can be a no-op for targets that don't build.
For skipping tests, I'm not sure if it's easy to do within Make, but we could have a list of directories to skip and only build & test others at leaf Makefile level by iterating through Makefiles.
Lemme know what you think and we can discuss offline. This might be too many changes. We can get the configure and build part merged in first due to time constraints.
|
Sounds good, going to attempt to implement the changes today. Let's hope its not too challenging so that I may finish before my term ends. I'll make sure to update EOD. |
|
Lemme know if you need any help, really want to get this merged for you even if it's only partial solution. |
- Bump copyright 2025 -> 2026 in new files (Scripts/configure.sh,
Common/require_deps.mk).
- Remove committed build artifacts (hip_template_warp_size_reduction,
hip_warp_size_reduction, hip_calling_global_functions, graphgen,
rocgdb-matmul) and fix the per-directory .gitignore entries that
were missing or named the wrong binary, allowing those files to be
committed. Adds Tools/ROCgdb/.gitignore.
- Move configure.sh -> Scripts/configure.sh; update root Makefile
configure target and CI workflow path. Script now writes config.mk
to the repo root regardless of its own location.
- Strip the ctest-coupled Makefile testing layer:
- Delete run_makefile_tests.sh and
.github/build_tools/parse_ctest_results.py.
- Revert .github/build_tools/generate_skip_tests.py to amd-staging
(drops MAKEFILE_SKIP_TESTS / --makefile flag).
- Drop "Makefile tests" and "Upload Makefile test logs" workflow
steps; revert Test summary to the amd-staging form.
- The Makefile build, artifact collection, and Makefile-build
artifact upload steps are kept.
- Drop the unused TEST_ARGS line from
HIP-Doc/Tutorials/Programming-Patterns/bfs/Makefile.
Make-native test target and dependency-aware skip mechanism are
deferred to a follow-up PR.
Co-Authored-By: Claude Opus 4 (1M context) <noreply@anthropic.com>
- Workflow "Collect Makefile build artifacts" step was exiting 1 on the very first parent Makefile (e.g. ./Makefile, ./Applications/Makefile) that doesn't declare EXAMPLE :=. Under bash --noprofile --norc -e -o pipefail, grep returning 1 (no match) propagated through the pipeline in $(...), and set -e killed the script before any leaf binary was copied. Append || true so the assignment yields an empty example_name and the iteration is skipped, letting the loop continue. - AlmaLinux 8 Dockerfile was missing pkg-config, so Scripts/configure.sh couldn't detect FFmpeg/OpenCV/GLFW3/Vulkan via pkg-config and every REQUIRED_DEPS check failed. Added pkgconf-pkg-config to the dnf install list and extended PKG_CONFIG_PATH with /usr/local/lib(64)/ pkgconfig so source-built FFmpeg and GLFW are discovered. Co-Authored-By: Claude Opus 4 (1M context) <noreply@anthropic.com>
Resolves 378 leaf-Makefile conflicts produced by upstream PR ROCm#440 which renamed ROCM_INSTALL_DIR -> ROCM_PATH and changed the assignment style from `:=` with `$(or ...)` to `?=`. Every conflict block was identical in shape, so the resolution is uniform: take upstream's ROCM_PATH form. Additional follow-up renames not covered by upstream's PR: - Common/require_deps.mk: rename internal ROCM_INSTALL_DIR -> ROCM_PATH in the amd_comgr fallback detection block. - Libraries/Makefile: same rename in the parent dispatch Makefile. - .github/workflows/build-rocm-examples-reusable.yml: drop redundant `ROCM_INSTALL_DIR=${ROCM_PATH}` env exports and the `make ROCM_INSTALL_DIR=...` argument; ROCM_PATH is already exported in the env and consumed directly by the leaf Makefiles. REQUIRED_DEPS / SKIP_BUILD wrappers added by this branch are preserved unchanged where they auto-merged cleanly. Co-Authored-By: Claude Opus 4 (1M context) <noreply@anthropic.com>
…kefile The Makefile declared EXAMPLE := hip_calling_global_functions (a copy-paste from the sibling example), so `make` produced a binary with the wrong name and the directory's correct .gitignore (hip_identifying_host_device_compilation_pass) didn't match it — which is how the binary slipped into git in the first place. An earlier cleanup commit on this branch flipped .gitignore to match the broken Makefile name; reverting that and fixing the Makefile to match the CMakeLists' example_name (hip_identifying_host_device_compilation_pass) instead. Per review feedback from @zichguan-amd. Co-Authored-By: Claude Opus 4 (1M context) <noreply@anthropic.com>
|
Updated the PR description (part 1 of 2 PRs for testing) |
|
Couple tests failing with hipcc not found Some ROCM_PATH change might have been missed |
These leaf Makefiles were missed by upstream PR ROCm#440 (which renamed ROCM_INSTALL_DIR -> ROCM_PATH and switched := to ?= for env override support). They kept `ROCM_PATH := /opt/rocm` (hard assignment), so the CI's exported ROCM_PATH=/therock-tarball/install was overridden back to /opt/rocm and the build invoked /opt/rocm/bin/hipcc which doesn't exist in the runner container, surfacing as: make[2]: /opt/rocm/bin/hipcc: Command not found make[1]: *** [Makefile:39: ROCgdb] Error 2 Affected categories: HIP-Doc/Tutorials/Programming-Patterns (bfs, histogram_atomics, image_convolution, kmeans, matrix_multiplication), Libraries/{MIGraphX, MIVisionX, RCCL, RPP, rocAL, rocCV, rocJPEG, hipBLASLt/gemm_clamp_bias}, Tools/ROCgdb. Bulk-replaced with `?= /opt/rocm` so ROCM_PATH from env wins. Same fix that upstream PR ROCm#440 applied to the rest of the tree. Co-Authored-By: Claude Opus 4 (1M context) <noreply@anthropic.com>
Markdown lint (markdownlint-cli2) caught one MD012/no-multiple-blanks violation at README.md:63 introduced by the previous documentation update. Collapse to a single blank line. Co-Authored-By: Claude Opus 4 (1M context) <noreply@anthropic.com>
Missed by the previous sweep because this Makefile uses `ROCM_PATH := /opt/rocm` (multiple spaces around :=) instead of the single-space form the grep pattern was matching. Same problem as the prior 48-file fix: hard `:=` assignment overrode the env-provided ROCM_PATH=/therock-tarball/install in CI, so the build invoked /opt/rocm/bin/hipcc which doesn't exist. Verified no other variants remain via lenient regex: grep -nE '^ROCM_PATH[[:space:]]*:=[[:space:]]*/' '*/Makefile' Co-Authored-By: Claude Opus 4 (1M context) <noreply@anthropic.com>
SLES 15.7 ships GCC 7.5 by default; std::experimental::filesystem implementation lives in a separate libstdc++fs there, so linking rocDecode examples that use it (directly or via the shared roc_video_dec.cpp from the SDK) needs an extra -lstdc++fs flag. Ubuntu 22.04 (GCC 11) and AlmaLinux 8 (gcc-toolset-13) have it in libstdc++ proper and don't need the flag. Mirrors what Common/FindFilesystem.cmake does for the CMake build: probe with the system C++ compiler, set CXX_FS_LIB to either "-lstdc++fs" or empty depending on what links cleanly. Apply uniformly to all 10 rocDecode leaf Makefiles. Replaces the prior one-off `-lstdc++fs` literal in video_decode_batch/Makefile (commit 66e13e6e8) so all rocDecode leaves use the same probe. Surfaced by SLES tarball CI failures on PR ROCm#442: ld.lld: error: undefined symbol: std::experimental::filesystem:: v1::__cxx11::directory_iterator::directory_iterator(...) Co-Authored-By: Claude Opus 4 (1M context) <noreply@anthropic.com>
Closes the testing half of the Make-build CI work that was deferred from PR1 (ROCm#442). With this commit `make test` from the repo root builds and runs every leaf example that registered an add_test in CMake, matching the existing CMake/CTest coverage. CI just orchestrates; all test command/args/timeout logic lives in the Makefiles. Per mentor (@zichguan-amd) design: - Each leaf Makefile gains a `test:` target depending on its build target. Default invocation: `./$(EXAMPLE) $(TEST_ARGS)`. Most leaves set no args. - bfs sets `TEST_ARGS := graph4096.txt` (mirrors its CMake add_test). - Leaves whose CMakeLists has no add_test() get an empty no-op `test:` (HIP-Basic/{opengl_interop,vulkan_interop,static_device_library} and Libraries/MIVisionX/{canny,mv_objdetect,opencv_orb} and three rocDecode examples that don't register). - REQUIRED_DEPS leaves (~28) extend their existing SKIP_BUILD `else` no-op block with `test:` alongside `all:`/`clean:`. Cascade: each parent Makefile (root + ~80 intermediates) declares `SKIP_FROM_TEST :=` and: test: TARGET=test test: $(filter-out $(SKIP_FROM_TEST),$(EXAMPLES)) So `make test` cascades through the tree, skipping any subdirs the parent has explicitly excluded. `Libraries/rocDecode/Makefile` populates `SKIP_FROM_TEST := $(EXAMPLES)`: all rocDecode examples need test data (videos under `$(ROCM_PATH)/share/rocdecode/`) that ctest currently guards behind `if(EXISTS …)` checks. Encoding that conditional logic in Make is doable but noisy; deferring to a follow-up. The leaf rocDecode Makefiles still have working `test:` targets so they can be run standalone via `cd Libraries/rocDecode/<example> && make test`. Out of scope (per plan, can land later): - Per-GPU-arch test skipping (`generate_skip_tests.py` is still used by the existing ctest step; PR2's per-directory `SKIP_FROM_TEST` is coarser). - Reduction tutorial gtest binaries (`Tutorials/reduction/test/*.hip`) — no Makefile builds them today. Workflow: adds `Makefile test` step after the existing test steps and `Upload Makefile test logs` artifact upload. Both gated with `if: !cancelled()` to mirror the rest of the test-side steps. Co-Authored-By: Claude Opus 4 (1M context) <noreply@anthropic.com>
* Add Make-native `test` target across all examples Closes the testing half of the Make-build CI work that was deferred from PR1 (#442). With this commit `make test` from the repo root builds and runs every leaf example that registered an add_test in CMake, matching the existing CMake/CTest coverage. CI just orchestrates; all test command/args/timeout logic lives in the Makefiles. Per mentor (@zichguan-amd) design: - Each leaf Makefile gains a `test:` target depending on its build target. Default invocation: `./$(EXAMPLE) $(TEST_ARGS)`. Most leaves set no args. - bfs sets `TEST_ARGS := graph4096.txt` (mirrors its CMake add_test). - Leaves whose CMakeLists has no add_test() get an empty no-op `test:` (HIP-Basic/{opengl_interop,vulkan_interop,static_device_library} and Libraries/MIVisionX/{canny,mv_objdetect,opencv_orb} and three rocDecode examples that don't register). - REQUIRED_DEPS leaves (~28) extend their existing SKIP_BUILD `else` no-op block with `test:` alongside `all:`/`clean:`. Cascade: each parent Makefile (root + ~80 intermediates) declares `SKIP_FROM_TEST :=` and: test: TARGET=test test: $(filter-out $(SKIP_FROM_TEST),$(EXAMPLES)) So `make test` cascades through the tree, skipping any subdirs the parent has explicitly excluded. `Libraries/rocDecode/Makefile` populates `SKIP_FROM_TEST := $(EXAMPLES)`: all rocDecode examples need test data (videos under `$(ROCM_PATH)/share/rocdecode/`) that ctest currently guards behind `if(EXISTS …)` checks. Encoding that conditional logic in Make is doable but noisy; deferring to a follow-up. The leaf rocDecode Makefiles still have working `test:` targets so they can be run standalone via `cd Libraries/rocDecode/<example> && make test`. Out of scope (per plan, can land later): - Per-GPU-arch test skipping (`generate_skip_tests.py` is still used by the existing ctest step; PR2's per-directory `SKIP_FROM_TEST` is coarser). - Reduction tutorial gtest binaries (`Tutorials/reduction/test/*.hip`) — no Makefile builds them today. Workflow: adds `Makefile test` step after the existing test steps and `Upload Makefile test logs` artifact upload. Both gated with `if: !cancelled()` to mirror the rest of the test-side steps. Co-Authored-By: Claude Opus 4 (1M context) <noreply@anthropic.com> * Convert 19 remaining hard-coded -lstdc++fs to find_filesystem.mk probe Same conversion as the rocDecode leaves: replace literal `-lstdc++fs` with `$(CXX_FS_LIB)` and include `Common/find_filesystem.mk`. Keeps all leaves consistent and surfaces what's actually needed via probe rather than blanket-adding the flag everywhere. Affected: - Applications/fdtd - HIP-Basic/module_api - HIP-Doc/.../linker_apis_file - Libraries/rocJPEG/{rocjpeg_decode, rocjpeg_decode_batched, rocjpeg_decode_perf} - Libraries/rocProfiler-SDK/{api_buffered_tracing, code_object_isa_decode, code_object_tracing, external_correlation_id_request, intercept_table, openmp_target, pc_sampling, thread_trace, counter_collection/{buffer, buffer_device_serialization, device_profiling, device_profiling_sync, print_functional_counters}} These currently work on all three CI distros (libstdc++fs is available as either a stub or the real lib), so this is hygiene rather than a bug fix. Aligns with the rocDecode probe conversion in the parent Make-test-target commit. Co-Authored-By: Claude Opus 4 (1M context) <noreply@anthropic.com> * Fix two PR2 bugs surfaced by latest CI run 1. linker_apis_file/Makefile was missing COMMON_INCLUDE_DIR. The prior hygiene cleanup (commit converting hard-coded -lstdc++fs to the Common/find_filesystem.mk probe) added an `include $(COMMON_INCLUDE_DIR)/find_filesystem.mk` line, but this leaf never defined COMMON_INCLUDE_DIR (its example doesn't reference any common headers). The include silently failed, make exited 2, parent cascade reported `Error 2`. Add the missing definition. 2. Workflow "Makefile test" step now passes HIP_ARCHITECTURES="${{ matrix.gpu_config.gpu_target }}" so leaf Makefiles using it (e.g. assembly_to_executable's multi-arch build) target only the matrix's arch instead of falling back to their full hardcoded default list. Without this, the `--cuda-device-only -S --offload-arch=<X>` recipe collided with CI's HIPCC_COMPILE_FLAGS_APPEND=--offload-arch=gfx1100 env, producing two `--offload-arch` flags and: clang++: error: cannot specify -o when generating multiple output files Co-Authored-By: Claude Opus 4 (1M context) <noreply@anthropic.com> * Fix HIP-Graphs/Makefile orphaned EXAMPLES continuation The PR2 parent-Makefile updater script regex didn't account for trailing whitespace on the last line of the EXAMPLES continuation in the original (` graph_creation \n`), so the regex stopped matching after `graph_capture \` and inserted SKIP_FROM_TEST in the middle of the multi-line assignment. Result: EXAMPLES := \ graph_capture \ SKIP_FROM_TEST := graph_creation ← orphaned, "missing separator" at line 27 Restore the continuation so EXAMPLES contains both children. HIP-Graphs is the only Makefile that hit this — verified with `make -n` from each parent: 0 syntax errors tree-wide. Co-Authored-By: Claude Opus 4 (1M context) <noreply@anthropic.com> * rocDecode: align Make `test` recipes with ctest invocations For the 7 rocDecode leaves whose CMake `add_test` actually passes positional args, replace the bare `./$(EXAMPLE) $(TEST_ARGS)` template with custom recipes that mirror ctest exactly: - Single-variant leaves (rocdec_decode, video_decode_mem, video_decode_perf, video_decode_batch): probe `[ -e <test data> ]` and skip cleanly with a "Skipping (not found)" message if the ctest data path doesn't exist, mirroring CMake's `if(EXISTS …)` register-time guard. Otherwise run the binary with the same `-i <path>` (and `-t 2` for batch) ctest passes. - Multi-variant leaves: ctest registers one test per codec. - video_decode → HEVC, AVC, AV1, VP9 mp4 - video_decode_raw → HEVC, AVC, AV1, VP9 raw bitstreams - video_decode_rgb → default + `-resize 640x360` Recipe loops through every variant ctest registers, runs each one whose input file exists, skips the rest, and returns the worst exit code (so a failing AVC doesn't mask a failing AV1 the way fail-fast `&&` would). Per @zichguan-amd review feedback that "TEST_ARGS might need to be aligned with ctest". TEST_ARGS as a single-string knob doesn't map cleanly to multi-variant ctest tests; a custom recipe with `$(ROCM_PATH)` deferred-expanded at use time is the closer parity. These 7 leaves are still parent-skipped via Libraries/rocDecode/ Makefile's `SKIP_FROM_TEST := $(EXAMPLES)` so the root `make test` cascade doesn't try them in CI. They become useful when run standalone (`cd Libraries/rocDecode/<example> && make test`) on a machine with the rocDecode test data installed under `$(ROCM_PATH)/share/rocdecode/`. README also gains a short paragraph documenting the env / CLI override pattern (`TEST_ARGS=foo make test`). Co-Authored-By: Claude Opus 4 (1M context) <noreply@anthropic.com> * README: drop `$` prefix from shell examples (MD014) markdownlint-cli2 MD014/commands-show-output was firing on the two TEST_ARGS override examples introduced in the prior commit: $ make test TEST_ARGS="--size=8192 --verbose" $ TEST_ARGS="-i /path/to/video.mp4" make test The `$` prompt prefix is meant for examples that show command output; for bare invocations it's just noise that markdownlint flags. Drop it. The earlier `$` prefixes (lines 56-58, the git/cd/configure chain) are inside bullet list items and aren't flagged. Co-Authored-By: Claude Opus 4 (1M context) <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4 (1M context) <noreply@anthropic.com>
Motivation
Mirror of #441 with a different implementation approach. Adds a Makefile build path to CI alongside the existing CMake/CTest flow, so the standalone
makeworkflow stays exercised on every commit.Technical Details
A
Scripts/configure.shscript probes the system for external libraries (FFmpeg, OpenCV, GLFW3, Vulkan, libdw, amd_comgr, glslangValidator) viapkg-configand link tests, then writes aconfig.mkat the repo root. Each leaf Makefile that has external dependencies declares them (REQUIRED_DEPS := GLFW3) and includesCommon/require_deps.mk, which setsSKIP_BUILD := 1when any required dependency is missing. Examples without external dependencies are unaffected.This PR scope (PR1): configure + Make build only. The Make-native test target and dependency-aware skip mechanism are deferred to a follow-up PR per review feedback.
Added
Scripts/configure.sh— pkg-config + link-test probe for FFmpeg, OpenCV, GLFW3, Vulkan, libdw, amd_comgr, glslangValidator. Writesconfig.mkat repo root.Common/require_deps.mk— leaf Makefiles declareREQUIRED_DEPS; build is skipped if any are missing. Has an inline pkg-config fallback so leaf Makefiles still work standalone without a priorconfigure.shrun.Tools/ROCgdb/.gitignore— was missing entirely, allowedrocgdb-matmulto slip into the tree.Modified
REQUIRED_DEPSand wrap their build rules inifneq ($(SKIP_BUILD),1). The rest are unchanged in behaviour (touched only by the merge from upstream'sROCM_PATHrename).Dockerfiles/almalinux-8.Dockerfile— addspkgconf-pkg-config(was missing, so every pkg-config probe failed on AlmaLinux 8) and extendsPKG_CONFIG_PATHto include/usr/local/lib(64)/pkgconfigfor source-built FFmpeg / GLFW..github/workflows/build-rocm-examples-reusable.yml— adds a Makefile build step before CMake configure, plus separate "Collect Makefile build artifacts" / "Upload Makefile build artifacts" steps so Makefile-built binaries ship as their own artifact.Makefile(root) —make configureshortcut that callsScripts/configure.sh.HIP-Doc/Programming-Guide/Porting-CUDA-code-to-HIP/identifying_host_device_compilation_pass/Makefile— fixed wrongEXAMPLE :=(waship_calling_global_functions, a copy-paste from a sibling; now matches its CMakeLists'example_name)..gitignorecorrections in twowarp_size_reductiondirs whose entries were swapped.Removed
.gitignoreentries:hip_template_warp_size_reduction,hip_warp_size_reduction,hip_calling_global_functions,graphgen,rocgdb-matmul.Workflow changes
Makefile build,Collect Makefile build artifacts,Upload Makefile build artifacts.if: !cancelled()so the CMake side still runs to completion if the Makefile build fails (for visibility).Deferred to follow-up PR
testtarget on each leaf Makefile (depends on the build target; encodes test command, args, timeout).make testfrom the root Makefile.Test Plan
rccl_device_api,rccl_send_recv) that already fail onamd-staging.ROCDEC_ERR/TOSTRmacros undefined) that affects both the CMake and Makefile build paths equally; not introduced by this PR.Test Result
amd-stagingbaseline (same 2 rccl failures).amd-stagingproduces on the same commit.Added/Updated documentation?
Included Visual Studio files?
Submission Checklist
REQUIRED_DEPS/SKIP_BUILD)