Replies: 1 comment 2 replies
-
|
Here's the gist of a conversation I just had with @henryiii...
|
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I'm opening this Discussion to continue a conversation from the monthly conference call this morning (with JC and Christian), in which I asked for strategic advice on integrating historic practices at my organization with scikit-build-core driven build systems in the future.
tl;dr
Given the useful stash of environment-specific CMake bootstrapping information in https://github.com/LLNL/blt/tree/develop/host-configs, what's the best way to start making BLT-dependent projects work well with scikit-build-core?
(See also https://llnl-blt.readthedocs.io/en/develop/tutorial/host_configs.html)
Detail
When someone needs to provide a bunch of CMake configuration values (such as to encapsulate the differences between quirky HPC environments) three common mechanisms leap to mind.
-CCurrently, various projects that rely on BLT use initial cache files (colloquially known as host-config files) as a way to share important details for building optimal and compatible libraries in a number of computing environments. Currently, BLT needs to support CMake versions less than 3.19. Changing our practice (and documentation, tutorials, etc) from initial cache files to something else would have a lot of inertia, especially since most projects would see no initial benefit. We would not want to maintain this environment-specific knowledge in more than one place or file format, but we could conceivably use some scripting to generate different forms of configuration input files from a single source.
scikit-build-core generates its own initial cache file and calls cmake with
-Cunder the hood.I understand that toolchain files are supported by scikit-build-core, but have additional semantics beyond an initial cache file. I'm not sure if this would be an appropriate mechanism for current or future BLT based projects.
It sounds like scikit-build-core is on the verge of supporting CMake preset files. It seems plausible that BLT users might eventually want to migrate, generally, to preset files, but I expect that will be several years from now. It seems feasible that the BLT host-configs could be migrated to the preset file JSON format sooner than that and derive the traditional host-config cache files from the JSON with scripting, but that sounds like a lot of complexity that would be greeted very skeptically if proposed, so it would need to be very clearly motivated.
Some reasons scikit-build-core would not want to encourage user-provided
-Cconfigurations include potential conflicts with more explicit equivalent options (https://scikit-build-core.readthedocs.io/en/latest/reference/configs.html#cmake) or ambiguity with respect to its generated-Cconfig. Is there any chance it is reasonably simple and unambiguous to merge these configs? (If this were well-defined, I could also imagine a route to invoking scikit-build-core from CMake, which occasionally seems useful (but scary).)My expectation is that the short term solution will be to have a script that converts our cache files to
pip/buildcommand line arguments so that scikit-build-core can be invoked in the usual way and neither infrastructure project needs modification. Maybe that's the long-term solution as well.I'm also curious about the possibility (or desirability) of a plugin package that could be identified in the
pyproject.tomlto process a front-end CLI option identifying a BLT "host-config" file which it then parses to inject scikit-build-core configuration values in an appropriate way. I suspect that's not something that is already straightforward with just PEP-517 hooks. Maybe this would be more in the territory of a plugin for scikit-build-core. Do you think the necessary hooks already exist?Is it really that hard?
A bunch of
set(... ... CACHE ... ...)commands are equivalent to a bunch of-D...=...CLI flags ortool.scikit-build.cmake.definemappings.However, some initial cache files set non-cache temporary/intermediate variables, or use CMake commands like
string(REPLACE ...)to prepare the cache values. Such a host-config file would need to be pre-processed with CMake, such as in a wrapper script or PEP-517 connected code. I don't know how to do that other than to generate a dummy project, and configure it.On the other hand, the generated project could do most of the work by including something like
Beta Was this translation helpful? Give feedback.
All reactions