Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ENH cmake: Target per Python command #3068

Open
Lestropie opened this issue Feb 18, 2025 · 2 comments
Open

ENH cmake: Target per Python command #3068

Lestropie opened this issue Feb 18, 2025 · 2 comments
Assignees
Labels

Comments

@Lestropie
Copy link
Member

On dev it's possible to build only one specific C++ binary (and all requisite dependencies to do so) by specifying --target at the command-line. This however can't be done for Python commands: everything is all done within a small number of targets: copying / linking API files, copying / linking source files, generating version file, building executable Python files.

It would be preferable to have one target per command, so that --target works as expected. Doing so would still need to compile all C++ binaries, copy / link all API files, and generate the version file, but would only copy / link source files and generate the executable Python file for that one command.

@daljit46 Is this something you could take on?

@daljit46
Copy link
Member

Sure, happy to help. I think this is a good idea and will make our build code more consistent. BTW, what's your rationale for wanting this? Generally speaking, I only build individual C++ targets to reduce compilation time, but that wouldn't apply here since Python commands have no "compilation" step.

@Lestropie
Copy link
Member Author

Mostly on principle. I have a couple of projects where I'm building multiple different versions of the software within a single container, and want full control over what I build within each. It makes more sense to me to have each individual commands show up in the build progress / logs. Also I'm getting into the routine of using cmake --target when doing development work on specific commands, and it makes sense if testing changes to a Python command to be able to do the same.

It'd be more effective if we had the ability to explicitly specify for each Python command which MRtrix C++ binaries are required, such that if a build nominates a specific Python command target, only those MRtrix C++ commands potentially invoked by that command need be built. Slightly trickier so deferring on that for now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants