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

Limit number of files to merge together in unity build #27869

Open
hugary1995 opened this issue Jun 11, 2024 · 2 comments
Open

Limit number of files to merge together in unity build #27869

hugary1995 opened this issue Jun 11, 2024 · 2 comments
Labels
C: Framework T: task An enhancement to the software.

Comments

@hugary1995
Copy link
Contributor

Motivation

Unity build is great. But over the years the unity files are growing larger and larger. It is now at a point where certain unity files are too big. For example the materials_unity in the solid mechanics module and the userobjects_unity in the framework.

Design

The solid mechanics module addresses this issue by splitting up the materials directory into sub-directories. While I think that is a valid approach, a framework-level more general approach could be to limit the number of files to "unify". CMake has a similar option UNITY_BUILD_BATCH_SIZE. It would be nice if we can support something like that.

Impact

Faster iteration while developing. For example if I only modify a single source file, I would only have to recompile a subset of the userobjects_unity file.

@hugary1995 hugary1995 added the T: task An enhancement to the software. label Jun 11, 2024
@GiudGiud
Copy link
Contributor

This is a good idea. The default size could be chosen based on how much memory one has on their system too, with a rough heuristic.

@hugary1995
Copy link
Contributor Author

Yeah, that's a good point. This could offer finer control for machines with less memory, instead of going all the way to MOOSE_UNITY=0.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C: Framework T: task An enhancement to the software.
Projects
None yet
Development

No branches or pull requests

2 participants