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

Software model for "compiler as dependencies" #31357

Open
2 tasks
alalazo opened this issue Jun 29, 2022 · 0 comments
Open
2 tasks

Software model for "compiler as dependencies" #31357

alalazo opened this issue Jun 29, 2022 · 0 comments
Labels
compilers epic A high level task that is broken down into smaller, more focused, units of work

Comments

@alalazo
Copy link
Member

alalazo commented Jun 29, 2022

Short description

As a core developer I want to clearly define how Spack software model will change when compilers are turned into proper dependencies, so that I can assess its consistency with respect to relevant use cases and I can have a blueprint guiding the implementation.

Motivation and goal

Compilers in Spack are currently modeled as compulsory node attributes in the concretized DAG. This choice has historical reasons, since such a simplified model allowed to build a lot of useful features without having to deal first with the complexity of compiler runtimes and with other aspects that make compiler different from other kind of dependencies.

Nonetheless, treating compilers as node attributes has also shortcomings that are becoming more evident as the use cases that Spack can cover broaden in scope:

  1. Some languages are more equal than others, since Spack consider only C, C++ and Fortran in the definition of a "compiler spec"
  2. Enforcing a compiler on each node causes a lot of duplication when installing packages that don't need a compiler (e.g. pure Python packages, or binaries like cudatoolkit etc.). The duplication in the software model is reflected in wasted space on disk.
  3. The current definition of a "compiler spec" doesn't allow a "natural" modeling of cross-compilation, since we can't easily talk about the compiler's host architecture vs. its target architecture. Currently Spack can deal with cross-compilation in a few ad-hoc ways, e.g. on Cray machines.
  4. Spack cannot ensure any consistency among runtimes that are injected by compilers, since we don't model them. For instance, Spack cannot ensure that a single OpenMP runtime is selected in a complex DAG where multiple compilers are used.
  5. Some compilers depend on other compilers for some functionalities, for instance Intel compilers depend on GCC for some C++ features. Currently we don't keep track of any of these dependencies, and their management is completely left to users.

To deal with the problems above we want to turn compilers from being a node attribute to be fully-fledged dependencies, and use virtual dependencies to model compiled languages. In that way:

  • Packages that have no need for compilers can avoid declaring a dependency on any compiled language
  • Packages that need a compiler for a language other than C, C++ or Fortran can declare a dependency on the language they need

This epic story collects all the use case requirements that are related to this change in the software model.

Requirements and use cases

References

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
compilers epic A high level task that is broken down into smaller, more focused, units of work
Projects
Status: In Progress
Development

No branches or pull requests

1 participant