Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
74 changes: 49 additions & 25 deletions scripts/firedrake-configure
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,9 @@
"""Script for preparing an environment to install Firedrake into."""

# To avoid the pitfalls inherent in having executable configuration files
# this script is intentionally extremely dumb. All configure options are computed
# 'statically' (at import) and the only run-time logic that happens is dispatching
# on the right package manager and arch.

# As a matter of policy, new package managers and archs should only be added to
# this file if they are *tested in CI*.
# this script is intentionally extremely dumb. All configure options are set
# in advance and the only run-time logic that happens is dispatching on the
# right package manager and arch.

import sys
import time
Expand Down Expand Up @@ -81,16 +78,29 @@ def main():
arch_key_str = f"{{{', '.join(f'{k.__class__.__name__}: {k.value}' for k in arch_key)}}}"
if arch_key in OFFICIAL_ARCHS:
arch = OFFICIAL_ARCHS[arch_key]
elif arch_key in RETIRED_ARCHS:
arch = RETIRED_ARCHS[arch_key]
warn(f"""\
You have selected an older configuration of Firedrake that we no longer test:

{arch_key_str} (last modified {arch.last_modified})

If you encounter issues please get in touch with the Firedrake team on GitHub or Slack.""")
elif arch_key in COMMUNITY_ARCHS:
arch = COMMUNITY_ARCHS[arch_key]
warn(f"""\
You have selected an untested, community-maintained Firedrake configuration
(last modified {arch.last_modified}), if you encounter issues please
contact {arch.maintainer} {arch.contact}""")
You have selected an untested, community-maintained Firedrake configuration:

{arch_key_str} (last modified {arch.last_modified})

If you encounter issues please contact {arch.maintainer} {arch.contact}.""")
else:
error(f"""\
Firedrake configuration not found for option set '{arch_key_str}',
please consider passing '--os unknown' or building manually""")
Firedrake configuration not found for option set:

{arch_key_str}

Please consider passing '--os unknown' or building manually.""")

if args.show_system_packages:
try:
Expand Down Expand Up @@ -344,6 +354,23 @@ class Arch:
print_and_stop(env_str)


@dataclasses.dataclass(frozen=True, kw_only=True)
class RetiredArch(Arch):
"""A configuration that Firedrake used to test but no longer does.

For example this includes older versions of Ubuntu.

"""

last_modified: str
"""Date the configuration was last modified (YYYY-MM-DD).

This is useful for judging the age, and hence likelihood to work, of
submitted configurations.

"""


@dataclasses.dataclass(frozen=True, kw_only=True)
class CommunityArch(Arch):
maintainer: str
Expand Down Expand Up @@ -885,15 +912,14 @@ OFFICIAL_ARCHS: Mapping[ArchKey, Arch] = {
}


# 'Best effort' configurations that are not tested in CI
COMMUNITY_ARCHS: Mapping[ArchKey, CommunityArch] = {
# Configurations that Firedrake used to support, these are considered
# more reliable that community configs.
RETIRED_ARCHS: Mapping[ArchKey, RetiredArch] = {

# Ubuntu 24.04 x86

(OS.UBUNTU_2404_X86_64, ScalarType.DEFAULT, GPUPlatform.NO_GPU): CommunityArch(
(OS.UBUNTU_2404_X86_64, ScalarType.DEFAULT, GPUPlatform.NO_GPU): RetiredArch(
name="default",
maintainer="the Firedrake team",
contact="on Slack",
last_modified="2026-05-13",
system_packages=[
"bison",
Expand Down Expand Up @@ -954,10 +980,8 @@ COMMUNITY_ARCHS: Mapping[ArchKey, CommunityArch] = {
],
),

(OS.UBUNTU_2404_X86_64, ScalarType.COMPLEX, GPUPlatform.NO_GPU): CommunityArch(
(OS.UBUNTU_2404_X86_64, ScalarType.COMPLEX, GPUPlatform.NO_GPU): RetiredArch(
name="complex",
maintainer="the Firedrake team",
contact="on Slack",
last_modified="2026-05-13",
system_packages=[
"bison",
Expand Down Expand Up @@ -1020,10 +1044,8 @@ COMMUNITY_ARCHS: Mapping[ArchKey, CommunityArch] = {

# Ubuntu 24.04 aarch64

(OS.UBUNTU_2404_AARCH64, ScalarType.DEFAULT, GPUPlatform.NO_GPU): CommunityArch(
(OS.UBUNTU_2404_AARCH64, ScalarType.DEFAULT, GPUPlatform.NO_GPU): RetiredArch(
name="default",
maintainer="the Firedrake team",
contact="on Slack",
last_modified="2026-05-13",
system_packages=[
"bison",
Expand Down Expand Up @@ -1084,10 +1106,8 @@ COMMUNITY_ARCHS: Mapping[ArchKey, CommunityArch] = {
],
),

(OS.UBUNTU_2404_AARCH64, ScalarType.COMPLEX, GPUPlatform.NO_GPU): CommunityArch(
(OS.UBUNTU_2404_AARCH64, ScalarType.COMPLEX, GPUPlatform.NO_GPU): RetiredArch(
name="complex",
maintainer="the Firedrake team",
contact="on Slack",
last_modified="2026-05-13",
system_packages=[
"bison",
Expand Down Expand Up @@ -1150,5 +1170,9 @@ COMMUNITY_ARCHS: Mapping[ArchKey, CommunityArch] = {
}


# 'Best effort' configurations that are not tested in CI
COMMUNITY_ARCHS: Mapping[ArchKey, CommunityArch] = {}


if __name__ == "__main__":
main()
Loading