Skip to content

Vd/build features#274

Open
DasVinch wants to merge 3 commits intoframework-devfrom
vd/build-features
Open

Vd/build features#274
DasVinch wants to merge 3 commits intoframework-devfrom
vd/build-features

Conversation

@DasVinch
Copy link
Copy Markdown
Member

@DasVinch DasVinch commented May 5, 2026

Fixed CUDA build.

Couple executables were missing linkage options. Larger diff because pre-commit doing its thing.

One path had old macro arguments that weren't compiling, for cause of farg not being defined and called cm_farg, failing CLICMD_FIELDS_DEFAULTS.
Actually upon inspection, I realize that this is because there are two function definitions in this file? With one with everything called CM and the other with everything called CO.

static const int co_nb =
    sizeof(co_b) / sizeof(FPS_CLI_BINDING);
static CLICMDARGDEF co_farg[] =
{
    FPS_PARAMS_CO(FPS_X_FARG)
};
static CLICMDDATA co_d =
{
    "", "", CLICMD_FIELDS_DEFAULTS
};

this second one is most definitely broken since CLICMD_FIELDS_DEFAULTS requires farg, which is now the former cm_farg

This raises something important: blind side effect macros are less than sub-ideal, or even macros requiring static variable names. In the best case, a macro should be an (inlinable, or constexpr if allowable in c++ areas) function; in other cases, it should take the variables it uses as arguments to avoid issues such as this.

#define CLICMD_FIELDS_FPSPROC                                                  \
    __FILE__, sizeof(farg) / sizeof(CLICMDARGDEF), farg,                       \
        CLICMDFLAG_FPS | CLICMDFLAG_PROCINFO, NULL, NULL, NULL
#define CLICMD_FIELDS_DEFAULTS                                                 \
    __FILE__, sizeof(farg) / sizeof(CLICMDARGDEF), farg, CLICMDFLAG_FPS, NULL, \
        NULL, NULL
#define CLICMD_FIELDS_NOFPS                                                    \
    __FILE__, sizeof(farg) / sizeof(CLICMDARGDEF), farg, 0, NULL, NULL, NULL

@oguyon fix requires another fix to solve intended purpose of co_farg in this file and maybe others.

@DasVinch
Copy link
Copy Markdown
Member Author

DasVinch commented May 6, 2026

Changed my mind: added parametric macros for when there would be multiple definitions in a file.

The non-parametric macro should probably just disappear for being dangerous.

@DasVinch DasVinch marked this pull request as ready for review May 6, 2026 09:02
Copilot AI review requested due to automatic review settings May 6, 2026 09:02
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates build configuration and a CUDA-related plugin area to fix CUDA build/link issues, along with some pre-commit formatting churn. It also introduces a project-level “Coverage” build type and adds new CLI macro variants intended to avoid reliance on hard-coded farg identifiers.

Changes:

  • Bump cmake_minimum_required() to 3.17 in several subdirectories and adjust minor CMake formatting.
  • Add Coverage build flags/defines and global coverage link settings in the top-level build.
  • Fix CUDA standalone executable linkage in linalgebra and update CLI macro usage in cublas_Coeff2Map_Loop.c to use the new *_W_ARG() macros.

Reviewed changes

Copilot reviewed 10 out of 11 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
src/isio-tools/isio-stream-info-1line/CMakeLists.txt Raise minimum CMake version for the tool subproject.
src/isio-tools/CMakeLists.txt Raise minimum CMake version and minor formatting cleanup.
src/engine/libfps/fps_procinfo_macros.h Add CLICMD_FIELDS_*_W_ARG() macro variants (parameterized farg).
src/cli/libmilkscript/CMakeLists.txt Raise minimum CMake version.
src/cli/libmilkscript/CLIcore_utils.h Add CLICMD_FIELDS_*_W_ARG() macro variants (parameterized farg).
src/cli/CLIcore/CMakeLists.txt Raise minimum CMake version and whitespace cleanup.
plugins/milk-extra-src/linalgebra/GPU_SVD_computeControlMatrix.c Formatting cleanup (indentation / string formatting).
plugins/milk-extra-src/linalgebra/cublas_Coeff2Map_Loop.c Switch CLI cmd init to CLICMD_FIELDS_DEFAULTS_W_ARG(...) and formatting cleanup.
plugins/milk-extra-src/linalgebra/CMakeLists.txt Add missing CUDA runtime/BLAS/Solver link libraries for selected standalone fpsexec targets.
CMakeLists.txt Add Coverage build flags and global coverage link propagation; add extra build-type logging.
.gitignore Ignore Python bytecode artifacts and coverage HTML output directories.

Comment thread src/engine/libfps/fps_procinfo_macros.h Outdated
Comment on lines +41 to +47
#define CLICMD_FIELDS_FPSPROCS_W_ARG(farg) \
__FILE__, sizeof(farg) / sizeof(CLICMDARGDEF), farg, CLICMDFLAG_FPS | CLICMDFLAG_PROCINFO, \
NULL, NULL, NULL
#define CLICMD_FIELDS_DEFAULTS_W_ARG(farg) \
__FILE__, sizeof(farg) / sizeof(CLICMDARGDEF), farg, CLICMDFLAG_FPS, NULL, NULL, NULL
#define CLICMD_FIELDS_NOFPSS_W_ARG(farg) \
__FILE__, sizeof(farg) / sizeof(CLICMDARGDEF), farg, 0, NULL, NULL, NULL
Comment thread src/cli/libmilkscript/CLIcore_utils.h Outdated
Comment on lines +32 to +40
#define CLICMD_FIELDS_FPSPROCS_W_ARG(farg) \
__FILE__, sizeof(farg) / sizeof(CLICMDARGDEF), farg, CLICMDFLAG_FPS | CLICMDFLAG_PROCINFO, \
NULL, NULL, NULL
#define CLICMD_FIELDS_DEFAULTS_W_ARG(farg) \
__FILE__, sizeof(farg) / sizeof(CLICMDARGDEF), farg, CLICMDFLAG_FPS, NULL, NULL, NULL
#define CLICMD_FIELDS_NOFPSS_W_ARG(farg) \
__FILE__, sizeof(farg) / sizeof(CLICMDARGDEF), farg, 0, NULL, NULL, NULL


Comment thread CMakeLists.txt
Comment on lines +385 to +386
add_link_options(--coverage)
link_libraries(gcov)
@DasVinch DasVinch force-pushed the vd/build-features branch from 686bda3 to 89110c5 Compare May 6, 2026 10:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants