diff --git a/.github/workflows/build-containers.yml b/.github/workflows/build-containers.yml index dbf027f8c5d458..bb78fef755efe5 100644 --- a/.github/workflows/build-containers.yml +++ b/.github/workflows/build-containers.yml @@ -120,7 +120,7 @@ jobs: password: ${{ secrets.DOCKERHUB_TOKEN }} - name: Build & Deploy ${{ matrix.dockerfile[0] }} - uses: docker/build-push-action@4f58ea79222b3b9dc2c8bbdd6debcef730109a75 + uses: docker/build-push-action@48aba3b46d1b1fec4febb7c5d0c644b249a11355 with: context: dockerfiles/${{ matrix.dockerfile[0] }} platforms: ${{ matrix.dockerfile[1] }} diff --git a/.github/workflows/valid-style.yml b/.github/workflows/valid-style.yml index 05e4563e5a924e..ad96ff2cc5604c 100644 --- a/.github/workflows/valid-style.yml +++ b/.github/workflows/valid-style.yml @@ -53,7 +53,7 @@ jobs: . .github/workflows/bin/setup_git.sh - name: Run style tests run: | - share/spack/qa/run-style-tests -s import + share/spack/qa/run-style-tests audit: uses: ./.github/workflows/audit.yaml secrets: inherit diff --git a/etc/spack/defaults/packages.yaml b/etc/spack/defaults/packages.yaml index c0804c349898c3..7e40f92e1cd885 100644 --- a/etc/spack/defaults/packages.yaml +++ b/etc/spack/defaults/packages.yaml @@ -1271,6 +1271,8 @@ packages: buildable: false cray-mvapich2: buildable: false + egl: + buildable: false fujitsu-mpi: buildable: false hpcx-mpi: diff --git a/lib/spack/docs/getting_started.rst b/lib/spack/docs/getting_started.rst index 418e84b5cd92dc..2569657c9f12a2 100644 --- a/lib/spack/docs/getting_started.rst +++ b/lib/spack/docs/getting_started.rst @@ -1326,6 +1326,7 @@ Required: * Microsoft Visual Studio * Python * Git +* 7z Optional: * Intel Fortran (needed for some packages) @@ -1391,6 +1392,13 @@ as the project providing Git support on Windows. This is additionally the recomm for installing Git on Windows, a link to which can be found above. Spack requires the utilities vendored by this project. +""" +7zip +""" + +A tool for extracting ``.xz`` files is required for extracting source tarballs. The latest 7zip +can be located at https://sourceforge.net/projects/sevenzip/. + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Step 2: Install and setup Spack ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ diff --git a/lib/spack/docs/requirements.txt b/lib/spack/docs/requirements.txt index a6d86480939240..49db3d0f4fc8be 100644 --- a/lib/spack/docs/requirements.txt +++ b/lib/spack/docs/requirements.txt @@ -6,7 +6,7 @@ python-levenshtein==0.26.1 docutils==0.21.2 pygments==2.18.0 urllib3==2.2.3 -pytest==8.3.3 +pytest==8.3.4 isort==5.13.2 black==24.10.0 flake8==7.1.1 diff --git a/lib/spack/llnl/util/filesystem.py b/lib/spack/llnl/util/filesystem.py index bc70f5aa6e7499..8217dcd7712d64 100644 --- a/lib/spack/llnl/util/filesystem.py +++ b/lib/spack/llnl/util/filesystem.py @@ -24,6 +24,7 @@ Callable, Deque, Dict, + Generator, Iterable, List, Match, @@ -2772,22 +2773,6 @@ def prefixes(path): return paths -@system_path_filter -def md5sum(file): - """Compute the MD5 sum of a file. - - Args: - file (str): file to be checksummed - - Returns: - MD5 sum of the file's content - """ - md5 = hashlib.md5() - with open(file, "rb") as f: - md5.update(f.read()) - return md5.digest() - - @system_path_filter def remove_directory_contents(dir): """Remove all contents of a directory.""" @@ -2838,6 +2823,25 @@ def temporary_dir( remove_directory_contents(tmp_dir) +@contextmanager +def edit_in_place_through_temporary_file(file_path: str) -> Generator[str, None, None]: + """Context manager for modifying ``file_path`` in place, preserving its inode and hardlinks, + for functions or external tools that do not support in-place editing. Notice that this function + is unsafe in that it works with paths instead of a file descriptors, but this is by design, + since we assume the call site will create a new inode at the same path.""" + tmp_fd, tmp_path = tempfile.mkstemp( + dir=os.path.dirname(file_path), prefix=f"{os.path.basename(file_path)}." + ) + # windows cannot replace a file with open fds, so close since the call site needs to replace. + os.close(tmp_fd) + try: + shutil.copyfile(file_path, tmp_path, follow_symlinks=True) + yield tmp_path + shutil.copyfile(tmp_path, file_path, follow_symlinks=True) + finally: + os.unlink(tmp_path) + + def filesummary(path, print_bytes=16) -> Tuple[int, bytes]: """Create a small summary of the given file. Does not error when file does not exist. diff --git a/lib/spack/spack/binary_distribution.py b/lib/spack/spack/binary_distribution.py index db26f32c00885c..da8f7d03644d6b 100644 --- a/lib/spack/spack/binary_distribution.py +++ b/lib/spack/spack/binary_distribution.py @@ -2334,7 +2334,9 @@ def is_backup_file(file): if not codesign: return for binary in changed_files: - codesign("-fs-", binary) + # preserve the original inode by running codesign on a copy + with fsys.edit_in_place_through_temporary_file(binary) as tmp_binary: + codesign("-fs-", tmp_binary) # If we are installing back to the same location # relocate the sbang location if the spack directory changed diff --git a/lib/spack/spack/build_systems/cmake.py b/lib/spack/spack/build_systems/cmake.py index 2566d3888bba2c..df81678c448d07 100644 --- a/lib/spack/spack/build_systems/cmake.py +++ b/lib/spack/spack/build_systems/cmake.py @@ -9,7 +9,7 @@ import re import sys from itertools import chain -from typing import Any, List, Optional, Set, Tuple +from typing import Any, List, Optional, Tuple import archspec.cpu @@ -23,6 +23,7 @@ import spack.phase_callbacks import spack.spec import spack.util.prefix +from spack import traverse from spack.directives import build_system, conflicts, depends_on, variant from spack.multimethod import when from spack.util.environment import filter_system_paths @@ -168,15 +169,18 @@ def _values(x): def get_cmake_prefix_path(pkg: spack.package_base.PackageBase) -> List[str]: """Obtain the CMAKE_PREFIX_PATH entries for a package, based on the cmake_prefix_path package attribute of direct build/test and transitive link dependencies.""" - # Add direct build/test deps - selected: Set[str] = {s.dag_hash() for s in pkg.spec.dependencies(deptype=dt.BUILD | dt.TEST)} - # Add transitive link deps - selected.update(s.dag_hash() for s in pkg.spec.traverse(root=False, deptype=dt.LINK)) - # Separate out externals so they do not shadow Spack prefixes - externals, spack_built = stable_partition( - (s for s in pkg.spec.traverse(root=False, order="topo") if s.dag_hash() in selected), - lambda x: x.external, + edges = traverse.traverse_topo_edges_generator( + traverse.with_artificial_edges([pkg.spec]), + visitor=traverse.MixedDepthVisitor( + direct=dt.BUILD | dt.TEST, transitive=dt.LINK, key=traverse.by_dag_hash + ), + key=traverse.by_dag_hash, + root=False, + all_edges=False, # cover all nodes, not all edges ) + ordered_specs = [edge.spec for edge in edges] + # Separate out externals so they do not shadow Spack prefixes + externals, spack_built = stable_partition((s for s in ordered_specs), lambda x: x.external) return filter_system_paths( path for spec in chain(spack_built, externals) for path in spec.package.cmake_prefix_paths diff --git a/lib/spack/spack/cmd/style.py b/lib/spack/spack/cmd/style.py index 9d164875ae2400..15efb64bfa8257 100644 --- a/lib/spack/spack/cmd/style.py +++ b/lib/spack/spack/cmd/style.py @@ -323,8 +323,6 @@ def process_files(file_list, is_args): rewrite_and_print_output(output, args, pat, replacement) packages_isort_args = ( - "--rm", - "spack", "--rm", "spack.pkgkit", "--rm", diff --git a/lib/spack/spack/compilers/intel.py b/lib/spack/spack/compilers/intel.py index 3002ba7f6e72c2..46e058477880c9 100644 --- a/lib/spack/spack/compilers/intel.py +++ b/lib/spack/spack/compilers/intel.py @@ -124,8 +124,8 @@ def setup_custom_environment(self, pkg, env): # Edge cases for Intel's oneAPI compilers when using the legacy classic compilers: # Always pass flags to disable deprecation warnings, since these warnings can # confuse tools that parse the output of compiler commands (e.g. version checks). - if self.real_version >= Version("2021") and self.real_version <= Version("2023"): + if self.real_version >= Version("2021") and self.real_version < Version("2024"): env.append_flags("SPACK_ALWAYS_CFLAGS", "-diag-disable=10441") env.append_flags("SPACK_ALWAYS_CXXFLAGS", "-diag-disable=10441") - if self.real_version >= Version("2021") and self.real_version <= Version("2024"): + if self.real_version >= Version("2021") and self.real_version < Version("2025"): env.append_flags("SPACK_ALWAYS_FFLAGS", "-diag-disable=10448") diff --git a/lib/spack/spack/compilers/oneapi.py b/lib/spack/spack/compilers/oneapi.py index c06a55f39621b7..75cee851d720b7 100644 --- a/lib/spack/spack/compilers/oneapi.py +++ b/lib/spack/spack/compilers/oneapi.py @@ -155,10 +155,10 @@ def setup_custom_environment(self, pkg, env): # icx+icpx+ifx or icx+icpx+ifort. But to be on the safe side (some users may # want to try to swap icpx against icpc, for example), and since the Intel LLVM # compilers accept these diag-disable flags, we apply them for all compilers. - if self.real_version >= Version("2021") and self.real_version <= Version("2023"): + if self.real_version >= Version("2021") and self.real_version < Version("2024"): env.append_flags("SPACK_ALWAYS_CFLAGS", "-diag-disable=10441") env.append_flags("SPACK_ALWAYS_CXXFLAGS", "-diag-disable=10441") - if self.real_version >= Version("2021") and self.real_version <= Version("2024"): + if self.real_version >= Version("2021") and self.real_version < Version("2025"): env.append_flags("SPACK_ALWAYS_FFLAGS", "-diag-disable=10448") # 2024 release bumped the libsycl version because of an ABI diff --git a/lib/spack/spack/relocate.py b/lib/spack/spack/relocate.py index 627c9e2b057061..dda17a128e5d3d 100644 --- a/lib/spack/spack/relocate.py +++ b/lib/spack/spack/relocate.py @@ -13,6 +13,7 @@ import macholib.mach_o import macholib.MachO +import llnl.util.filesystem as fs import llnl.util.lang import llnl.util.tty as tty from llnl.util.lang import memoized @@ -275,10 +276,10 @@ def modify_macho_object(cur_path, rpaths, deps, idpath, paths_to_paths): # Deduplicate and flatten args = list(itertools.chain.from_iterable(llnl.util.lang.dedupe(args))) + install_name_tool = executable.Executable("install_name_tool") if args: - args.append(str(cur_path)) - install_name_tool = executable.Executable("install_name_tool") - install_name_tool(*args) + with fs.edit_in_place_through_temporary_file(cur_path) as temp_path: + install_name_tool(*args, temp_path) def macholib_get_paths(cur_path): @@ -717,8 +718,8 @@ def fixup_macos_rpath(root, filename): # No fixes needed return False - args.append(abspath) - executable.Executable("install_name_tool")(*args) + with fs.edit_in_place_through_temporary_file(abspath) as temp_path: + executable.Executable("install_name_tool")(*args, temp_path) return True diff --git a/lib/spack/spack/schema/config.py b/lib/spack/spack/schema/config.py index e1072a501bb91e..9f380da92b7cac 100644 --- a/lib/spack/spack/schema/config.py +++ b/lib/spack/spack/schema/config.py @@ -106,8 +106,8 @@ { "names": ["install_missing_compilers"], "message": "The config:install_missing_compilers option has been deprecated in " - "Spack v0.23, and is currently ignored. It will be removed from config in " - "Spack v0.25.", + "Spack v0.23, and is currently ignored. It will be removed from config after " + "Spack v1.0.", "error": False, }, ], diff --git a/lib/spack/spack/stage.py b/lib/spack/spack/stage.py index 84949c2e287295..08a6e31b93c83b 100644 --- a/lib/spack/spack/stage.py +++ b/lib/spack/spack/stage.py @@ -488,7 +488,7 @@ def _generate_fetchers(self, mirror_only=False) -> Generator["fs.FetchStrategy", # Insert fetchers in the order that the URLs are provided. fetchers[:0] = ( fs.from_url_scheme( - url_util.join(mirror.fetch_url, self.mirror_layout.path), + url_util.join(mirror.fetch_url, *self.mirror_layout.path.split(os.sep)), checksum=digest, expand=expand, extension=extension, diff --git a/lib/spack/spack/test/llnl/util/filesystem.py b/lib/spack/spack/test/llnl/util/filesystem.py index 1a32e5707c735b..8b512a2c5f3ed0 100644 --- a/lib/spack/spack/test/llnl/util/filesystem.py +++ b/lib/spack/spack/test/llnl/util/filesystem.py @@ -1249,3 +1249,14 @@ def test_find_input_types(tmp_path: pathlib.Path): with pytest.raises(TypeError): fs.find(1, "file.txt") # type: ignore + + +def test_edit_in_place_through_temporary_file(tmp_path): + (tmp_path / "example.txt").write_text("Hello") + current_ino = os.stat(tmp_path / "example.txt").st_ino + with fs.edit_in_place_through_temporary_file(tmp_path / "example.txt") as temporary: + os.unlink(temporary) + with open(temporary, "w") as f: + f.write("World") + assert (tmp_path / "example.txt").read_text() == "World" + assert os.stat(tmp_path / "example.txt").st_ino == current_ino diff --git a/lib/spack/spack/test/traverse.py b/lib/spack/spack/test/traverse.py index 62ce24d366ee1b..79aae6eb5566d8 100644 --- a/lib/spack/spack/test/traverse.py +++ b/lib/spack/spack/test/traverse.py @@ -20,9 +20,8 @@ def create_dag(nodes, edges): """ specs = {name: Spec(name) for name in nodes} for parent, child, deptypes in edges: - specs[parent].add_dependency_edge( - specs[child], depflag=dt.canonicalize(deptypes), virtuals=() - ) + depflag = deptypes if isinstance(deptypes, dt.DepFlag) else dt.canonicalize(deptypes) + specs[parent].add_dependency_edge(specs[child], depflag=depflag, virtuals=()) return specs @@ -454,3 +453,61 @@ def test_topo_is_bfs_for_trees(cover): assert list(traverse.traverse_nodes([binary_tree["A"]], order="topo", cover=cover)) == list( traverse.traverse_nodes([binary_tree["A"]], order="breadth", cover=cover) ) + + +@pytest.mark.parametrize("roots", [["A"], ["A", "B"], ["B", "A"], ["A", "B", "A"]]) +@pytest.mark.parametrize("order", ["breadth", "post", "pre"]) +@pytest.mark.parametrize("include_root", [True, False]) +def test_mixed_depth_visitor(roots, order, include_root): + """Test that the MixedDepthVisitor lists unique edges that are reachable either directly from + roots through build type edges, or transitively through link type edges. The tests ensures that + unique edges are listed exactly once.""" + my_graph = create_dag( + nodes=["A", "B", "C", "D", "E", "F", "G", "H", "I"], + edges=( + ("A", "B", dt.LINK | dt.RUN), + ("A", "C", dt.BUILD), + ("A", "D", dt.BUILD | dt.RUN), + ("A", "H", dt.LINK), + ("A", "I", dt.RUN), + ("B", "D", dt.BUILD | dt.LINK), + ("C", "E", dt.BUILD | dt.LINK | dt.RUN), + ("D", "F", dt.LINK), + ("D", "G", dt.BUILD | dt.RUN), + ("H", "B", dt.LINK), + ), + ) + starting_points = traverse.with_artificial_edges([my_graph[root] for root in roots]) + visitor = traverse.MixedDepthVisitor(direct=dt.BUILD, transitive=dt.LINK) + + if order == "pre": + edges = traverse.traverse_depth_first_edges_generator( + starting_points, visitor, post_order=False, root=include_root + ) + elif order == "post": + edges = traverse.traverse_depth_first_edges_generator( + starting_points, visitor, post_order=True, root=include_root + ) + elif order == "breadth": + edges = traverse.traverse_breadth_first_edges_generator( + starting_points, visitor, root=include_root + ) + + artificial_edges = [(None, root) for root in roots] if include_root else [] + simple_edges = [ + (None if edge.parent is None else edge.parent.name, edge.spec.name) for edge in edges + ] + + # make sure that every edge is listed exactly once and that the right edges are listed + assert len(simple_edges) == len(set(simple_edges)) + assert set(simple_edges) == { + # the roots + *artificial_edges, + ("A", "B"), + ("A", "C"), + ("A", "D"), + ("A", "H"), + ("B", "D"), + ("D", "F"), + ("H", "B"), + } diff --git a/lib/spack/spack/test/versions.py b/lib/spack/spack/test/versions.py index 734ba4ca4a40f8..4c5081e8d17d0e 100644 --- a/lib/spack/spack/test/versions.py +++ b/lib/spack/spack/test/versions.py @@ -607,6 +607,9 @@ def test_stringify_version(version_str): v.string = None assert str(v) == version_str + v.string = None + assert v.string == version_str + def test_len(): a = Version("1.2.3.4") diff --git a/lib/spack/spack/traverse.py b/lib/spack/spack/traverse.py index 158f4d892e3017..880d7f71faafb0 100644 --- a/lib/spack/spack/traverse.py +++ b/lib/spack/spack/traverse.py @@ -4,7 +4,7 @@ # SPDX-License-Identifier: (Apache-2.0 OR MIT) from collections import defaultdict -from typing import NamedTuple, Union +from typing import Any, Callable, List, NamedTuple, Set, Union import spack.deptypes as dt import spack.spec @@ -115,6 +115,64 @@ def neighbors(self, item): return self.visitor.neighbors(item) +class MixedDepthVisitor: + """Visits all unique edges of the sub-DAG induced by direct dependencies of type ``direct`` + and transitive dependencies of type ``transitive``. An example use for this is traversing build + type dependencies non-recursively, and link dependencies recursively.""" + + def __init__( + self, + *, + direct: dt.DepFlag, + transitive: dt.DepFlag, + key: Callable[["spack.spec.Spec"], Any] = id, + ) -> None: + self.direct_type = direct + self.transitive_type = transitive + self.key = key + self.seen: Set[Any] = set() + self.seen_roots: Set[Any] = set() + + def accept(self, item: EdgeAndDepth) -> bool: + # Do not accept duplicate root nodes. This only happens if the user starts iterating from + # multiple roots and lists one of the roots multiple times. + if item.edge.parent is None: + node_id = self.key(item.edge.spec) + if node_id in self.seen_roots: + return False + self.seen_roots.add(node_id) + return True + + def neighbors(self, item: EdgeAndDepth) -> List[EdgeAndDepth]: + # If we're here through an artificial source node, it's a root, and we return all + # direct_type and transitive_type edges. If we're here through a transitive_type edge, we + # return all transitive_type edges. To avoid returning the same edge twice: + # 1. If we had already encountered the current node through a transitive_type edge, we + # don't need to return transitive_type edges again. + # 2. If we encounter the current node through a direct_type edge, and we had already seen + # it through a transitive_type edge, only return the non-transitive_type, direct_type + # edges. + node_id = self.key(item.edge.spec) + seen = node_id in self.seen + is_root = item.edge.parent is None + follow_transitive = is_root or bool(item.edge.depflag & self.transitive_type) + follow = self.direct_type if is_root else dt.NONE + + if follow_transitive and not seen: + follow |= self.transitive_type + self.seen.add(node_id) + elif follow == dt.NONE: + return [] + + edges = item.edge.spec.edges_to_dependencies(depflag=follow) + + # filter direct_type edges already followed before becuase they were also transitive_type. + if seen: + edges = [edge for edge in edges if not edge.depflag & self.transitive_type] + + return sort_edges(edges) + + def get_visitor_from_args( cover, direction, depflag: Union[dt.DepFlag, dt.DepTypes], key=id, visited=None, visitor=None ): @@ -342,9 +400,7 @@ def traverse_topo_edges_generator(edges, visitor, key=id, root=True, all_edges=F # maps parent identifier to a list of edges, where None is a special identifier # for the artificial root/source. node_to_edges = defaultdict(list) - for edge in traverse_breadth_first_edges_generator( - edges, CoverEdgesVisitor(visitor, key=key), root=True, depth=False - ): + for edge in traverse_breadth_first_edges_generator(edges, visitor, root=True, depth=False): in_edge_count[key(edge.spec)] += 1 parent_id = key(edge.parent) if edge.parent is not None else None node_to_edges[parent_id].append(edge) @@ -422,9 +478,9 @@ def traverse_edges( elif order not in ("post", "pre", "breadth"): raise ValueError(f"Unknown order {order}") - # In topo traversal we need to construct a sub-DAG including all edges even if we are yielding - # a subset of them, hence "paths". - _cover = "paths" if order == "topo" else cover + # In topo traversal we need to construct a sub-DAG including all unique edges even if we are + # yielding a subset of them, hence "edges". + _cover = "edges" if order == "topo" else cover visitor = get_visitor_from_args(_cover, direction, deptype, key, visited) root_edges = with_artificial_edges(specs) diff --git a/lib/spack/spack/util/elf.py b/lib/spack/spack/util/elf.py index f0fda0778718aa..86a4e141c0faea 100644 --- a/lib/spack/spack/util/elf.py +++ b/lib/spack/spack/util/elf.py @@ -7,7 +7,7 @@ import re import struct from struct import calcsize, unpack, unpack_from -from typing import BinaryIO, Dict, List, NamedTuple, Optional, Pattern, Tuple +from typing import BinaryIO, Callable, Dict, List, NamedTuple, Optional, Pattern, Tuple class ElfHeader(NamedTuple): @@ -476,6 +476,31 @@ def get_interpreter(path: str) -> Optional[str]: return None +def _delete_dynamic_array_entry( + f: BinaryIO, elf: ElfFile, should_delete: Callable[[int, int], bool] +) -> None: + f.seek(elf.pt_dynamic_p_offset) + dynamic_array_fmt = elf.byte_order + ("qQ" if elf.is_64_bit else "lL") + dynamic_array_size = calcsize(dynamic_array_fmt) + new_offset = elf.pt_dynamic_p_offset # points to the new dynamic array + old_offset = elf.pt_dynamic_p_offset # points to the current dynamic array + for _ in range(elf.pt_dynamic_p_filesz // dynamic_array_size): + data = read_exactly(f, dynamic_array_size, "Malformed dynamic array entry") + tag, val = unpack(dynamic_array_fmt, data) + + if tag == ELF_CONSTANTS.DT_NULL or not should_delete(tag, val): + if new_offset != old_offset: + f.seek(new_offset) + f.write(data) + f.seek(old_offset + dynamic_array_size) + new_offset += dynamic_array_size + + if tag == ELF_CONSTANTS.DT_NULL: + break + + old_offset += dynamic_array_size + + def delete_rpath(path: str) -> None: """Modifies a binary to remove the rpath. It zeros out the rpath string and also drops the DT_R(UN)PATH entry from the dynamic section, so it doesn't show up in 'readelf -d file', nor @@ -492,29 +517,22 @@ def delete_rpath(path: str) -> None: f.seek(rpath_offset) f.write(new_rpath_string) - # Next update the dynamic array - f.seek(elf.pt_dynamic_p_offset) - dynamic_array_fmt = elf.byte_order + ("qQ" if elf.is_64_bit else "lL") - dynamic_array_size = calcsize(dynamic_array_fmt) - new_offset = elf.pt_dynamic_p_offset # points to the new dynamic array - old_offset = elf.pt_dynamic_p_offset # points to the current dynamic array - for _ in range(elf.pt_dynamic_p_filesz // dynamic_array_size): - data = read_exactly(f, dynamic_array_size, "Malformed dynamic array entry") - tag, _ = unpack(dynamic_array_fmt, data) - - # Overwrite any entry that is not DT_RPATH or DT_RUNPATH, including DT_NULL - if tag != ELF_CONSTANTS.DT_RPATH and tag != ELF_CONSTANTS.DT_RUNPATH: - if new_offset != old_offset: - f.seek(new_offset) - f.write(data) - f.seek(old_offset + dynamic_array_size) - new_offset += dynamic_array_size - - # End of the dynamic array - if tag == ELF_CONSTANTS.DT_NULL: - break - - old_offset += dynamic_array_size + # Delete DT_RPATH / DT_RUNPATH entries from the dynamic section + _delete_dynamic_array_entry( + f, elf, lambda tag, _: tag == ELF_CONSTANTS.DT_RPATH or tag == ELF_CONSTANTS.DT_RUNPATH + ) + + +def delete_needed_from_elf(f: BinaryIO, elf: ElfFile, needed: bytes) -> None: + """Delete a needed library from the dynamic section of an ELF file""" + if not elf.has_needed or needed not in elf.dt_needed_strs: + return + + offset = elf.dt_needed_strtab_offsets[elf.dt_needed_strs.index(needed)] + + _delete_dynamic_array_entry( + f, elf, lambda tag, val: tag == ELF_CONSTANTS.DT_NEEDED and val == offset + ) class CStringType: diff --git a/lib/spack/spack/util/filesystem.py b/lib/spack/spack/util/filesystem.py index b296438fe89e82..eac5c589188068 100644 --- a/lib/spack/spack/util/filesystem.py +++ b/lib/spack/spack/util/filesystem.py @@ -13,7 +13,7 @@ import sys from llnl.util import tty -from llnl.util.filesystem import join_path +from llnl.util.filesystem import edit_in_place_through_temporary_file from llnl.util.lang import memoized from spack.util.executable import Executable, which @@ -81,12 +81,11 @@ def fix_darwin_install_name(path): Parameters: path (str): directory in which .dylib files are located """ - libs = glob.glob(join_path(path, "*.dylib")) + libs = glob.glob(os.path.join(path, "*.dylib")) + install_name_tool = Executable("install_name_tool") + otool = Executable("otool") for lib in libs: - # fix install name first: - install_name_tool = Executable("install_name_tool") - install_name_tool("-id", lib, lib) - otool = Executable("otool") + args = ["-id", lib] long_deps = otool("-L", lib, output=str).split("\n") deps = [dep.partition(" ")[0][1::] for dep in long_deps[2:-1]] # fix all dependencies: @@ -98,5 +97,8 @@ def fix_darwin_install_name(path): # but we don't know builddir (nor how symbolic links look # in builddir). We thus only compare the basenames. if os.path.basename(dep) == os.path.basename(loc): - install_name_tool("-change", dep, loc, lib) + args.extend(("-change", dep, loc)) break + + with edit_in_place_through_temporary_file(lib) as tmp: + install_name_tool(*args, tmp) diff --git a/lib/spack/spack/version/__init__.py b/lib/spack/spack/version/__init__.py index 18d739ae0c2f77..a94f641cff3510 100644 --- a/lib/spack/spack/version/__init__.py +++ b/lib/spack/spack/version/__init__.py @@ -25,11 +25,13 @@ ) from .version_types import ( ClosedOpenRange, + ConcreteVersion, GitVersion, StandardVersion, Version, VersionList, VersionRange, + VersionType, _next_version, _prev_version, from_string, @@ -40,21 +42,23 @@ any_version: VersionList = VersionList([":"]) __all__ = [ - "Version", - "VersionRange", - "ver", - "from_string", - "is_git_version", - "infinity_versions", - "_prev_version", - "_next_version", - "VersionList", "ClosedOpenRange", - "StandardVersion", + "ConcreteVersion", + "EmptyRangeError", "GitVersion", - "VersionError", + "StandardVersion", + "Version", "VersionChecksumError", + "VersionError", + "VersionList", "VersionLookupError", - "EmptyRangeError", + "VersionRange", + "VersionType", + "_next_version", + "_prev_version", "any_version", + "from_string", + "infinity_versions", + "is_git_version", + "ver", ] diff --git a/lib/spack/spack/version/version_types.py b/lib/spack/spack/version/version_types.py index f35192192d80bd..4c7a9606f46ad9 100644 --- a/lib/spack/spack/version/version_types.py +++ b/lib/spack/spack/version/version_types.py @@ -3,10 +3,9 @@ # # SPDX-License-Identifier: (Apache-2.0 OR MIT) -import numbers import re from bisect import bisect_left -from typing import List, Optional, Tuple, Union +from typing import Dict, Iterable, Iterator, List, Optional, Tuple, Union from spack.util.spack_yaml import syaml_dict @@ -32,26 +31,44 @@ class VersionStrComponent: + """Internal representation of the string (non-integer) components of Spack versions. + + Versions comprise string and integer components (see ``SEGMENT_REGEX`` above). + + This represents a string component, which is either some component consisting only + of alphabetical characters, *or* a special "infinity version" like ``main``, + ``develop``, ``master``, etc. + + For speed, Spack versions are designed to map to Python tuples, so that we can use + Python's fast lexicographic tuple comparison on them. ``VersionStrComponent`` is + designed to work as a component in these version tuples, and as such must compare + directly with ``int`` or other ``VersionStrComponent`` objects. + + """ + __slots__ = ["data"] - def __init__(self, data): + data: Union[int, str] + + def __init__(self, data: Union[int, str]): # int for infinity index, str for literal. - self.data: Union[int, str] = data + self.data = data @staticmethod - def from_string(string): + def from_string(string: str) -> "VersionStrComponent": + value: Union[int, str] = string if len(string) >= iv_min_len: try: - string = infinity_versions.index(string) + value = infinity_versions.index(string) except ValueError: pass - return VersionStrComponent(string) + return VersionStrComponent(value) - def __hash__(self): + def __hash__(self) -> int: return hash(self.data) - def __str__(self): + def __str__(self) -> str: return ( ("infinity" if self.data >= len(infinity_versions) else infinity_versions[self.data]) if isinstance(self.data, int) @@ -61,38 +78,61 @@ def __str__(self): def __repr__(self) -> str: return f'VersionStrComponent("{self}")' - def __eq__(self, other): + def __eq__(self, other: object) -> bool: return isinstance(other, VersionStrComponent) and self.data == other.data - def __lt__(self, other): - lhs_inf = isinstance(self.data, int) + # ignore typing for certain parts of these methods b/c a) they are performance-critical, and + # b) mypy isn't smart enough to figure out that if l_inf and r_inf are the same, comparing + # self.data and other.data is type safe. + def __lt__(self, other: object) -> bool: + l_inf = isinstance(self.data, int) if isinstance(other, int): - return not lhs_inf - rhs_inf = isinstance(other.data, int) - return (not lhs_inf and rhs_inf) if lhs_inf ^ rhs_inf else self.data < other.data + return not l_inf + r_inf = isinstance(other.data, int) # type: ignore + return (not l_inf and r_inf) if l_inf ^ r_inf else self.data < other.data # type: ignore - def __le__(self, other): - return self < other or self == other - - def __gt__(self, other): - lhs_inf = isinstance(self.data, int) + def __gt__(self, other: object) -> bool: + l_inf = isinstance(self.data, int) if isinstance(other, int): - return lhs_inf - rhs_inf = isinstance(other.data, int) - return (lhs_inf and not rhs_inf) if lhs_inf ^ rhs_inf else self.data > other.data + return l_inf + r_inf = isinstance(other.data, int) # type: ignore + return (l_inf and not r_inf) if l_inf ^ r_inf else self.data > other.data # type: ignore - def __ge__(self, other): + def __le__(self, other: object) -> bool: + return self < other or self == other + + def __ge__(self, other: object) -> bool: return self > other or self == other -def parse_string_components(string: str) -> Tuple[tuple, tuple]: +# Tuple types that make up the internal representation of StandardVersion. +# We use Tuples so that Python can quickly compare versions. + +#: Version components are integers for numeric parts, VersionStrComponents for string parts. +VersionComponentTuple = Tuple[Union[int, VersionStrComponent], ...] + +#: A Prerelease identifier is a constant for alpha/beta/rc/final and one optional number. +#: Most versions will have this set to ``(FINAL,)``. Prereleases will have some other +#: initial constant followed by a number, e.g. ``(RC, 1)``. +PrereleaseTuple = Tuple[int, ...] + +#: Actual version tuple, including the split version number itself and the prerelease, +#: all represented as tuples. +VersionTuple = Tuple[VersionComponentTuple, PrereleaseTuple] + +#: Separators from a parsed version. +SeparatorTuple = Tuple[str, ...] + + +def parse_string_components(string: str) -> Tuple[VersionTuple, SeparatorTuple]: + """Parse a string into a ``VersionTuple`` and ``SeparatorTuple``.""" string = string.strip() if string and not VALID_VERSION.match(string): raise ValueError("Bad characters in version string: %s" % string) segments = SEGMENT_REGEX.findall(string) - separators = tuple(m[2] for m in segments) + separators: Tuple[str] = tuple(m[2] for m in segments) prerelease: Tuple[int, ...] # (alpha|beta|rc) @@ -109,63 +149,150 @@ def parse_string_components(string: str) -> Tuple[tuple, tuple]: else: prerelease = (FINAL,) - release = tuple(int(m[0]) if m[0] else VersionStrComponent.from_string(m[1]) for m in segments) + release: VersionComponentTuple = tuple( + int(m[0]) if m[0] else VersionStrComponent.from_string(m[1]) for m in segments + ) return (release, prerelease), separators -class ConcreteVersion: - pass +class VersionType: + """Base type for all versions in Spack (ranges, lists, regular versions, and git versions). + + Versions in Spack behave like sets, and support some basic set operations. There are + four subclasses of ``VersionType``: + + * ``StandardVersion``: a single, concrete version, e.g. 3.4.5 or 5.4b0. + * ``GitVersion``: subclass of ``StandardVersion`` for handling git repositories. + * ``ClosedOpenRange``: an inclusive version range, closed or open, e.g. ``3.0:5.0``, + ``3.0:``, or ``:5.0`` + * ``VersionList``: An ordered list of any of the above types. + + Notably, when Spack parses a version, it's always a range *unless* specified with + ``@=`` to make it concrete. + + """ + def intersection(self, other: "VersionType") -> "VersionType": + """Any versions contained in both self and other, or empty VersionList if no overlap.""" + raise NotImplementedError -def _stringify_version(versions: Tuple[tuple, tuple], separators: tuple) -> str: + def intersects(self, other: "VersionType") -> bool: + """Whether self and other overlap.""" + raise NotImplementedError + + def overlaps(self, other: "VersionType") -> bool: + """Whether self and other overlap (same as ``intersects()``).""" + return self.intersects(other) + + def satisfies(self, other: "VersionType") -> bool: + """Whether self is entirely contained in other.""" + raise NotImplementedError + + def union(self, other: "VersionType") -> "VersionType": + """Return a VersionType containing self and other.""" + raise NotImplementedError + + # We can use SupportsRichComparisonT in Python 3.8 or later, but alas in 3.6 we need + # to write all the operators out + def __eq__(self, other: object) -> bool: + raise NotImplementedError + + def __lt__(self, other: object) -> bool: + raise NotImplementedError + + def __gt__(self, other: object) -> bool: + raise NotImplementedError + + def __ge__(self, other: object) -> bool: + raise NotImplementedError + + def __le__(self, other: object) -> bool: + raise NotImplementedError + + def __hash__(self) -> int: + raise NotImplementedError + + +class ConcreteVersion(VersionType): + """Base type for versions that represents a single (non-range or list) version.""" + + +def _stringify_version(versions: VersionTuple, separators: Tuple[str, ...]) -> str: + """Create a string representation from version components.""" release, prerelease = versions - string = "" - for i in range(len(release)): - string += f"{release[i]}{separators[i]}" + + components = [f"{rel}{sep}" for rel, sep in zip(release, separators)] if prerelease[0] != FINAL: - string += f"{PRERELEASE_TO_STRING[prerelease[0]]}{separators[len(release)]}" - if len(prerelease) > 1: - string += str(prerelease[1]) - return string + components.append(PRERELEASE_TO_STRING[prerelease[0]]) + if len(prerelease) > 1: + components.append(separators[len(release)]) + components.append(str(prerelease[1])) + + return "".join(components) class StandardVersion(ConcreteVersion): """Class to represent versions""" - __slots__ = ["version", "string", "separators"] + __slots__ = ["version", "_string", "separators"] + + _string: str + version: VersionTuple + separators: Tuple[str, ...] + + def __init__(self, string: str, version: VersionTuple, separators: Tuple[str, ...]): + """Create a StandardVersion from a string and parsed version components. - def __init__(self, string: Optional[str], version: Tuple[tuple, tuple], separators: tuple): - self.string = string + Arguments: + string: The original version string, or ``""`` if the it is not available. + version: A tuple as returned by ``parse_string_components()``. Contains two tuples: + one with alpha or numeric components and another with prerelease components. + separators: separators parsed from the original version string. + + If constructed with ``string=""``, the string will be lazily constructed from components + when ``str()`` is called. + """ + self._string = string self.version = version self.separators = separators @staticmethod - def from_string(string: str): + def from_string(string: str) -> "StandardVersion": return StandardVersion(string, *parse_string_components(string)) @staticmethod - def typemin(): + def typemin() -> "StandardVersion": return _STANDARD_VERSION_TYPEMIN @staticmethod - def typemax(): + def typemax() -> "StandardVersion": return _STANDARD_VERSION_TYPEMAX - def __bool__(self): + @property + def string(self) -> str: + if not self._string: + self._string = _stringify_version(self.version, self.separators) + return self._string + + @string.setter + def string(self, string) -> None: + self._string = string + + def __bool__(self) -> bool: return True - def __eq__(self, other): + def __eq__(self, other: object) -> bool: if isinstance(other, StandardVersion): return self.version == other.version return False - def __ne__(self, other): + def __ne__(self, other: object) -> bool: if isinstance(other, StandardVersion): return self.version != other.version return True - def __lt__(self, other): + def __lt__(self, other: object) -> bool: if isinstance(other, StandardVersion): return self.version < other.version if isinstance(other, ClosedOpenRange): @@ -173,7 +300,7 @@ def __lt__(self, other): return self <= other.lo return NotImplemented - def __le__(self, other): + def __le__(self, other: object) -> bool: if isinstance(other, StandardVersion): return self.version <= other.version if isinstance(other, ClosedOpenRange): @@ -181,7 +308,7 @@ def __le__(self, other): return self <= other.lo return NotImplemented - def __ge__(self, other): + def __ge__(self, other: object) -> bool: if isinstance(other, StandardVersion): return self.version >= other.version if isinstance(other, ClosedOpenRange): @@ -189,25 +316,25 @@ def __ge__(self, other): return self > other.lo return NotImplemented - def __gt__(self, other): + def __gt__(self, other: object) -> bool: if isinstance(other, StandardVersion): return self.version > other.version if isinstance(other, ClosedOpenRange): return self > other.lo return NotImplemented - def __iter__(self): + def __iter__(self) -> Iterator: return iter(self.version[0]) - def __len__(self): + def __len__(self) -> int: return len(self.version[0]) - def __getitem__(self, idx): + def __getitem__(self, idx: Union[int, slice]): cls = type(self) release = self.version[0] - if isinstance(idx, numbers.Integral): + if isinstance(idx, int): return release[idx] elif isinstance(idx, slice): @@ -220,45 +347,38 @@ def __getitem__(self, idx): if string_arg: string_arg.pop() # We don't need the last separator - string_arg = "".join(string_arg) - return cls.from_string(string_arg) + return cls.from_string("".join(string_arg)) else: return StandardVersion.from_string("") - message = "{cls.__name__} indices must be integers" - raise TypeError(message.format(cls=cls)) + raise TypeError(f"{cls.__name__} indices must be integers or slices") - def __str__(self): - return self.string or _stringify_version(self.version, self.separators) + def __str__(self) -> str: + return self.string def __repr__(self) -> str: # Print indirect repr through Version(...) return f'Version("{str(self)}")' - def __hash__(self): + def __hash__(self) -> int: # If this is a final release, do not hash the prerelease part for backward compat. return hash(self.version if self.is_prerelease() else self.version[0]) - def __contains__(rhs, lhs): + def __contains__(rhs, lhs) -> bool: # We should probably get rid of `x in y` for versions, since # versions still have a dual interpretation as singleton sets # or elements. x in y should be: is the lhs-element in the # rhs-set. Instead this function also does subset checks. - if isinstance(lhs, (StandardVersion, ClosedOpenRange, VersionList)): + if isinstance(lhs, VersionType): return lhs.satisfies(rhs) - raise ValueError(lhs) + raise TypeError(f"'in' not supported for instances of {type(lhs)}") - def intersects(self, other: Union["StandardVersion", "GitVersion", "ClosedOpenRange"]) -> bool: + def intersects(self, other: VersionType) -> bool: if isinstance(other, StandardVersion): return self == other return other.intersects(self) - def overlaps(self, other) -> bool: - return self.intersects(other) - - def satisfies( - self, other: Union["ClosedOpenRange", "StandardVersion", "GitVersion", "VersionList"] - ) -> bool: + def satisfies(self, other: VersionType) -> bool: if isinstance(other, GitVersion): return False @@ -271,19 +391,19 @@ def satisfies( if isinstance(other, VersionList): return other.intersects(self) - return NotImplemented + raise NotImplementedError - def union(self, other: Union["ClosedOpenRange", "StandardVersion"]): + def union(self, other: VersionType) -> VersionType: if isinstance(other, StandardVersion): return self if self == other else VersionList([self, other]) return other.union(self) - def intersection(self, other: Union["ClosedOpenRange", "StandardVersion"]): + def intersection(self, other: VersionType) -> VersionType: if isinstance(other, StandardVersion): return self if self == other else VersionList() return other.intersection(self) - def isdevelop(self): + def isdevelop(self) -> bool: """Triggers on the special case of the `@develop-like` version.""" return any( isinstance(p, VersionStrComponent) and isinstance(p.data, int) for p in self.version[0] @@ -304,7 +424,7 @@ def dotted_numeric_string(self) -> str: return ".".join(str(v) for v in numeric) @property - def dotted(self): + def dotted(self) -> "StandardVersion": """The dotted representation of the version. Example: @@ -318,7 +438,7 @@ def dotted(self): return type(self).from_string(self.string.replace("-", ".").replace("_", ".")) @property - def underscored(self): + def underscored(self) -> "StandardVersion": """The underscored representation of the version. Example: @@ -333,7 +453,7 @@ def underscored(self): return type(self).from_string(self.string.replace(".", "_").replace("-", "_")) @property - def dashed(self): + def dashed(self) -> "StandardVersion": """The dashed representation of the version. Example: @@ -347,7 +467,7 @@ def dashed(self): return type(self).from_string(self.string.replace(".", "-").replace("_", "-")) @property - def joined(self): + def joined(self) -> "StandardVersion": """The joined representation of the version. Example: @@ -362,7 +482,7 @@ def joined(self): self.string.replace(".", "").replace("-", "").replace("_", "") ) - def up_to(self, index): + def up_to(self, index: int) -> "StandardVersion": """The version up to the specified component. Examples: @@ -482,7 +602,7 @@ def ref_version(self) -> StandardVersion: ) return self._ref_version - def intersects(self, other): + def intersects(self, other: VersionType) -> bool: # For concrete things intersects = satisfies = equality if isinstance(other, GitVersion): return self == other @@ -492,19 +612,14 @@ def intersects(self, other): return self.ref_version.intersects(other) if isinstance(other, VersionList): return any(self.intersects(rhs) for rhs in other) - raise ValueError(f"Unexpected type {type(other)}") + raise TypeError(f"'intersects()' not supported for instances of {type(other)}") - def intersection(self, other): + def intersection(self, other: VersionType) -> VersionType: if isinstance(other, ConcreteVersion): return self if self == other else VersionList() return other.intersection(self) - def overlaps(self, other) -> bool: - return self.intersects(other) - - def satisfies( - self, other: Union["GitVersion", StandardVersion, "ClosedOpenRange", "VersionList"] - ): + def satisfies(self, other: VersionType) -> bool: # Concrete versions mean we have to do an equality check if isinstance(other, GitVersion): return self == other @@ -514,9 +629,9 @@ def satisfies( return self.ref_version.satisfies(other) if isinstance(other, VersionList): return any(self.satisfies(rhs) for rhs in other) - raise ValueError(f"Unexpected type {type(other)}") + raise TypeError(f"'satisfies()' not supported for instances of {type(other)}") - def __str__(self): + def __str__(self) -> str: s = f"git.{self.ref}" if self.has_git_prefix else self.ref # Note: the solver actually depends on str(...) to produce the effective version. # So when a lookup is attached, we require the resolved version to be printed. @@ -534,7 +649,7 @@ def __repr__(self): def __bool__(self): return True - def __eq__(self, other): + def __eq__(self, other: object) -> bool: # GitVersion cannot be equal to StandardVersion, otherwise == is not transitive return ( isinstance(other, GitVersion) @@ -542,10 +657,10 @@ def __eq__(self, other): and self.ref_version == other.ref_version ) - def __ne__(self, other): + def __ne__(self, other: object) -> bool: return not self == other - def __lt__(self, other): + def __lt__(self, other: object) -> bool: if isinstance(other, GitVersion): return (self.ref_version, self.ref) < (other.ref_version, other.ref) if isinstance(other, StandardVersion): @@ -553,9 +668,9 @@ def __lt__(self, other): return self.ref_version < other if isinstance(other, ClosedOpenRange): return self.ref_version < other - raise ValueError(f"Unexpected type {type(other)}") + raise TypeError(f"'<' not supported between instances of {type(self)} and {type(other)}") - def __le__(self, other): + def __le__(self, other: object) -> bool: if isinstance(other, GitVersion): return (self.ref_version, self.ref) <= (other.ref_version, other.ref) if isinstance(other, StandardVersion): @@ -564,9 +679,9 @@ def __le__(self, other): if isinstance(other, ClosedOpenRange): # Equality is not a thing return self.ref_version < other - raise ValueError(f"Unexpected type {type(other)}") + raise TypeError(f"'<=' not supported between instances of {type(self)} and {type(other)}") - def __ge__(self, other): + def __ge__(self, other: object) -> bool: if isinstance(other, GitVersion): return (self.ref_version, self.ref) >= (other.ref_version, other.ref) if isinstance(other, StandardVersion): @@ -574,9 +689,9 @@ def __ge__(self, other): return self.ref_version >= other if isinstance(other, ClosedOpenRange): return self.ref_version > other - raise ValueError(f"Unexpected type {type(other)}") + raise TypeError(f"'>=' not supported between instances of {type(self)} and {type(other)}") - def __gt__(self, other): + def __gt__(self, other: object) -> bool: if isinstance(other, GitVersion): return (self.ref_version, self.ref) > (other.ref_version, other.ref) if isinstance(other, StandardVersion): @@ -584,14 +699,14 @@ def __gt__(self, other): return self.ref_version >= other if isinstance(other, ClosedOpenRange): return self.ref_version > other - raise ValueError(f"Unexpected type {type(other)}") + raise TypeError(f"'>' not supported between instances of {type(self)} and {type(other)}") def __hash__(self): # hashing should not cause version lookup return hash(self.ref) - def __contains__(self, other): - raise Exception("Not implemented yet") + def __contains__(self, other: object) -> bool: + raise NotImplementedError @property def ref_lookup(self): @@ -649,7 +764,7 @@ def up_to(self, index) -> StandardVersion: return self.ref_version.up_to(index) -class ClosedOpenRange: +class ClosedOpenRange(VersionType): def __init__(self, lo: StandardVersion, hi: StandardVersion): if hi < lo: raise EmptyRangeError(f"{lo}..{hi} is an empty range") @@ -657,14 +772,14 @@ def __init__(self, lo: StandardVersion, hi: StandardVersion): self.hi: StandardVersion = hi @classmethod - def from_version_range(cls, lo: StandardVersion, hi: StandardVersion): + def from_version_range(cls, lo: StandardVersion, hi: StandardVersion) -> "ClosedOpenRange": """Construct ClosedOpenRange from lo:hi range.""" try: return ClosedOpenRange(lo, _next_version(hi)) except EmptyRangeError as e: raise EmptyRangeError(f"{lo}:{hi} is an empty range") from e - def __str__(self): + def __str__(self) -> str: # This simplifies 3.1:<3.2 to 3.1:3.1 to 3.1 # 3:3 -> 3 hi_prev = _prev_version(self.hi) @@ -726,9 +841,9 @@ def __gt__(self, other): def __contains__(rhs, lhs): if isinstance(lhs, (ConcreteVersion, ClosedOpenRange, VersionList)): return lhs.satisfies(rhs) - raise ValueError(f"Unexpected type {type(lhs)}") + raise TypeError(f"'in' not supported between instances of {type(rhs)} and {type(lhs)}") - def intersects(self, other: Union[ConcreteVersion, "ClosedOpenRange", "VersionList"]): + def intersects(self, other: VersionType) -> bool: if isinstance(other, StandardVersion): return self.lo <= other < self.hi if isinstance(other, GitVersion): @@ -737,23 +852,18 @@ def intersects(self, other: Union[ConcreteVersion, "ClosedOpenRange", "VersionLi return (self.lo < other.hi) and (other.lo < self.hi) if isinstance(other, VersionList): return any(self.intersects(rhs) for rhs in other) - raise ValueError(f"Unexpected type {type(other)}") + raise TypeError(f"'intersects' not supported for instances of {type(other)}") - def satisfies(self, other: Union["ClosedOpenRange", ConcreteVersion, "VersionList"]): + def satisfies(self, other: VersionType) -> bool: if isinstance(other, ConcreteVersion): return False if isinstance(other, ClosedOpenRange): return not (self.lo < other.lo or other.hi < self.hi) if isinstance(other, VersionList): return any(self.satisfies(rhs) for rhs in other) - raise ValueError(other) - - def overlaps(self, other: Union["ClosedOpenRange", ConcreteVersion, "VersionList"]) -> bool: - return self.intersects(other) + raise TypeError(f"'satisfies()' not supported for instances of {type(other)}") - def _union_if_not_disjoint( - self, other: Union["ClosedOpenRange", ConcreteVersion] - ) -> Optional["ClosedOpenRange"]: + def _union_if_not_disjoint(self, other: VersionType) -> Optional["ClosedOpenRange"]: """Same as union, but returns None when the union is not connected. This function is not implemented for version lists as right-hand side, as that makes little sense.""" if isinstance(other, StandardVersion): @@ -770,9 +880,9 @@ def _union_if_not_disjoint( else None ) - raise TypeError(f"Unexpected type {type(other)}") + raise TypeError(f"'union()' not supported for instances of {type(other)}") - def union(self, other: Union["ClosedOpenRange", ConcreteVersion, "VersionList"]): + def union(self, other: VersionType) -> VersionType: if isinstance(other, VersionList): v = other.copy() v.add(self) @@ -781,35 +891,51 @@ def union(self, other: Union["ClosedOpenRange", ConcreteVersion, "VersionList"]) result = self._union_if_not_disjoint(other) return result if result is not None else VersionList([self, other]) - def intersection(self, other: Union["ClosedOpenRange", ConcreteVersion]): + def intersection(self, other: VersionType) -> VersionType: # range - version -> singleton or nothing. + if isinstance(other, ClosedOpenRange): + # range - range -> range or nothing. + max_lo = max(self.lo, other.lo) + min_hi = min(self.hi, other.hi) + return ClosedOpenRange(max_lo, min_hi) if max_lo < min_hi else VersionList() + if isinstance(other, ConcreteVersion): return other if self.intersects(other) else VersionList() - # range - range -> range or nothing. - max_lo = max(self.lo, other.lo) - min_hi = min(self.hi, other.hi) - return ClosedOpenRange(max_lo, min_hi) if max_lo < min_hi else VersionList() + raise TypeError(f"'intersection()' not supported for instances of {type(other)}") -class VersionList: +class VersionList(VersionType): """Sorted, non-redundant list of Version and ClosedOpenRange elements.""" - def __init__(self, vlist=None): - self.versions: List[Union[StandardVersion, GitVersion, ClosedOpenRange]] = [] + versions: List[VersionType] + + def __init__(self, vlist: Optional[Union[str, VersionType, Iterable]] = None): if vlist is None: - pass + self.versions = [] + elif isinstance(vlist, str): vlist = from_string(vlist) if isinstance(vlist, VersionList): self.versions = vlist.versions else: self.versions = [vlist] - else: + + elif isinstance(vlist, (ConcreteVersion, ClosedOpenRange)): + self.versions = [vlist] + + elif isinstance(vlist, VersionList): + self.versions = vlist[:] + + elif isinstance(vlist, Iterable): + self.versions = [] for v in vlist: self.add(ver(v)) - def add(self, item: Union[StandardVersion, GitVersion, ClosedOpenRange, "VersionList"]): + else: + raise TypeError(f"Cannot construct VersionList from {type(vlist)}") + + def add(self, item: VersionType) -> None: if isinstance(item, (StandardVersion, GitVersion)): i = bisect_left(self, item) # Only insert when prev and next are not intersected. @@ -865,7 +991,7 @@ def concrete_range_as_version(self) -> Optional[ConcreteVersion]: return v.lo return None - def copy(self): + def copy(self) -> "VersionList": return VersionList(self) def lowest(self) -> Optional[StandardVersion]: @@ -889,7 +1015,7 @@ def preferred(self) -> Optional[StandardVersion]: """Get the preferred (latest) version in the list.""" return self.highest_numeric() or self.highest() - def satisfies(self, other) -> bool: + def satisfies(self, other: VersionType) -> bool: # This exploits the fact that version lists are "reduced" and normalized, so we can # never have a list like [1:3, 2:4] since that would be normalized to [1:4] if isinstance(other, VersionList): @@ -898,9 +1024,9 @@ def satisfies(self, other) -> bool: if isinstance(other, (ConcreteVersion, ClosedOpenRange)): return all(lhs.satisfies(other) for lhs in self) - raise ValueError(f"Unsupported type {type(other)}") + raise TypeError(f"'satisfies()' not supported for instances of {type(other)}") - def intersects(self, other): + def intersects(self, other: VersionType) -> bool: if isinstance(other, VersionList): s = o = 0 while s < len(self) and o < len(other): @@ -915,19 +1041,16 @@ def intersects(self, other): if isinstance(other, (ClosedOpenRange, StandardVersion)): return any(v.intersects(other) for v in self) - raise ValueError(f"Unsupported type {type(other)}") + raise TypeError(f"'intersects()' not supported for instances of {type(other)}") - def overlaps(self, other) -> bool: - return self.intersects(other) - - def to_dict(self): + def to_dict(self) -> Dict: """Generate human-readable dict for YAML.""" if self.concrete: return syaml_dict([("version", str(self[0]))]) return syaml_dict([("versions", [str(v) for v in self])]) @staticmethod - def from_dict(dictionary): + def from_dict(dictionary) -> "VersionList": """Parse dict from to_dict.""" if "versions" in dictionary: return VersionList(dictionary["versions"]) @@ -935,27 +1058,29 @@ def from_dict(dictionary): return VersionList([Version(dictionary["version"])]) raise ValueError("Dict must have 'version' or 'versions' in it.") - def update(self, other: "VersionList"): - for v in other.versions: - self.add(v) + def update(self, other: "VersionList") -> None: + self.add(other) - def union(self, other: "VersionList"): + def union(self, other: VersionType) -> VersionType: result = self.copy() - result.update(other) + result.add(other) return result - def intersection(self, other: "VersionList") -> "VersionList": + def intersection(self, other: VersionType) -> "VersionList": result = VersionList() - for lhs, rhs in ((self, other), (other, self)): - for x in lhs: - i = bisect_left(rhs.versions, x) - if i > 0: - result.add(rhs[i - 1].intersection(x)) - if i < len(rhs): - result.add(rhs[i].intersection(x)) - return result + if isinstance(other, VersionList): + for lhs, rhs in ((self, other), (other, self)): + for x in lhs: + i = bisect_left(rhs.versions, x) + if i > 0: + result.add(rhs[i - 1].intersection(x)) + if i < len(rhs): + result.add(rhs[i].intersection(x)) + return result + else: + return self.intersection(VersionList(other)) - def intersect(self, other) -> bool: + def intersect(self, other: VersionType) -> bool: """Intersect this spec's list with other. Return True if the spec changed as a result; False otherwise @@ -965,6 +1090,7 @@ def intersect(self, other) -> bool: self.versions = isection.versions return changed + # typing this and getitem are a pain in Python 3.6 def __contains__(self, other): if isinstance(other, (ClosedOpenRange, StandardVersion)): i = bisect_left(self, other) @@ -978,52 +1104,52 @@ def __contains__(self, other): def __getitem__(self, index): return self.versions[index] - def __iter__(self): + def __iter__(self) -> Iterator: return iter(self.versions) - def __reversed__(self): + def __reversed__(self) -> Iterator: return reversed(self.versions) - def __len__(self): + def __len__(self) -> int: return len(self.versions) - def __bool__(self): + def __bool__(self) -> bool: return bool(self.versions) - def __eq__(self, other): + def __eq__(self, other) -> bool: if isinstance(other, VersionList): return self.versions == other.versions return False - def __ne__(self, other): + def __ne__(self, other) -> bool: if isinstance(other, VersionList): return self.versions != other.versions return False - def __lt__(self, other): + def __lt__(self, other) -> bool: if isinstance(other, VersionList): return self.versions < other.versions return NotImplemented - def __le__(self, other): + def __le__(self, other) -> bool: if isinstance(other, VersionList): return self.versions <= other.versions return NotImplemented - def __ge__(self, other): + def __ge__(self, other) -> bool: if isinstance(other, VersionList): return self.versions >= other.versions return NotImplemented - def __gt__(self, other): + def __gt__(self, other) -> bool: if isinstance(other, VersionList): return self.versions > other.versions return NotImplemented - def __hash__(self): + def __hash__(self) -> int: return hash(tuple(self.versions)) - def __str__(self): + def __str__(self) -> str: if not self.versions: return "" @@ -1031,7 +1157,7 @@ def __str__(self): f"={v}" if isinstance(v, StandardVersion) else str(v) for v in self.versions ) - def __repr__(self): + def __repr__(self) -> str: return str(self.versions) @@ -1106,12 +1232,10 @@ def _next_version(v: StandardVersion) -> StandardVersion: release = release[:-1] + (_next_version_str_component(release[-1]),) else: release = release[:-1] + (release[-1] + 1,) - components = [""] * (2 * len(release)) - components[::2] = release - components[1::2] = separators[: len(release)] - if prerelease_type != FINAL: - components.extend((PRERELEASE_TO_STRING[prerelease_type], prerelease[1])) - return StandardVersion("".join(str(c) for c in components), (release, prerelease), separators) + + # Avoid constructing a string here for performance. Instead, pass "" to + # StandardVersion to lazily stringify. + return StandardVersion("", (release, prerelease), separators) def _prev_version(v: StandardVersion) -> StandardVersion: @@ -1130,19 +1254,15 @@ def _prev_version(v: StandardVersion) -> StandardVersion: release = release[:-1] + (_prev_version_str_component(release[-1]),) else: release = release[:-1] + (release[-1] - 1,) - components = [""] * (2 * len(release)) - components[::2] = release - components[1::2] = separators[: len(release)] - if prerelease_type != FINAL: - components.extend((PRERELEASE_TO_STRING[prerelease_type], *prerelease[1:])) - # this is only used for comparison functions, so don't bother making a string - return StandardVersion(None, (release, prerelease), separators) + # Avoid constructing a string here for performance. Instead, pass "" to + # StandardVersion to lazily stringify. + return StandardVersion("", (release, prerelease), separators) -def Version(string: Union[str, int]) -> Union[GitVersion, StandardVersion]: +def Version(string: Union[str, int]) -> ConcreteVersion: if not isinstance(string, (str, int)): - raise ValueError(f"Cannot construct a version from {type(string)}") + raise TypeError(f"Cannot construct a version from {type(string)}") string = str(string) if is_git_version(string): return GitVersion(string) @@ -1155,7 +1275,7 @@ def VersionRange(lo: Union[str, StandardVersion], hi: Union[str, StandardVersion return ClosedOpenRange.from_version_range(lo, hi) -def from_string(string) -> Union[VersionList, ClosedOpenRange, StandardVersion, GitVersion]: +def from_string(string: str) -> VersionType: """Converts a string to a version object. This is private. Client code should use ver().""" string = string.replace(" ", "") @@ -1184,17 +1304,17 @@ def from_string(string) -> Union[VersionList, ClosedOpenRange, StandardVersion, return VersionRange(v, v) -def ver(obj) -> Union[VersionList, ClosedOpenRange, StandardVersion, GitVersion]: +def ver(obj: Union[VersionType, str, list, tuple, int, float]) -> VersionType: """Parses a Version, VersionRange, or VersionList from a string or list of strings. """ - if isinstance(obj, (list, tuple)): - return VersionList(obj) + if isinstance(obj, VersionType): + return obj elif isinstance(obj, str): return from_string(obj) + elif isinstance(obj, (list, tuple)): + return VersionList(obj) elif isinstance(obj, (int, float)): return from_string(str(obj)) - elif isinstance(obj, (StandardVersion, GitVersion, ClosedOpenRange, VersionList)): - return obj else: raise TypeError("ver() can't convert %s to version!" % type(obj)) diff --git a/share/spack/gitlab/cloud_pipelines/stacks/aws-pcluster-neoverse_v1/packages.yaml b/share/spack/gitlab/cloud_pipelines/stacks/aws-pcluster-neoverse_v1/packages.yaml index c5e36807382e55..7cad892b4b7aa6 100644 --- a/share/spack/gitlab/cloud_pipelines/stacks/aws-pcluster-neoverse_v1/packages.yaml +++ b/share/spack/gitlab/cloud_pipelines/stacks/aws-pcluster-neoverse_v1/packages.yaml @@ -8,8 +8,8 @@ packages: gromacs: require: - one_of: - - "gromacs@2021.3 %arm ^fftw ^openmpi" - - "gromacs@2021.3 %gcc ^armpl-gcc ^openmpi" + - "gromacs@2024.3 %arm ^fftw ^openmpi" + - "gromacs@2024.3 %gcc ^armpl-gcc ^openmpi" libfabric: buildable: true externals: diff --git a/var/spack/repos/builtin/packages/acts/package.py b/var/spack/repos/builtin/packages/acts/package.py index c2c158a17cca78..f2784fb772a8be 100644 --- a/var/spack/repos/builtin/packages/acts/package.py +++ b/var/spack/repos/builtin/packages/acts/package.py @@ -41,6 +41,7 @@ class Acts(CMakePackage, CudaPackage): # Supported Acts versions version("main", branch="main") version("master", branch="main", deprecated=True) # For compatibility + version("38.0.0", commit="0a6b5155e29e3b755bf351b8a76067fff9b4214b", submodules=True) version("37.4.0", commit="4ae9a44f54c854599d1d753222ec36e0b5b4e9c7", submodules=True) version("37.3.0", commit="b3e856d4dadcda7d1a88a9b846ce5a7acd8410c4", submodules=True) version("37.2.0", commit="821144dc40d35b44aee0d7857a0bd1c99e4a3932", submodules=True) diff --git a/var/spack/repos/builtin/packages/adol-c/package.py b/var/spack/repos/builtin/packages/adol-c/package.py index a7eff71ad55282..05528c665ed6cd 100644 --- a/var/spack/repos/builtin/packages/adol-c/package.py +++ b/var/spack/repos/builtin/packages/adol-c/package.py @@ -153,3 +153,8 @@ def install_additional_files(self): join_path(source_directory, "ADOL-C", "examples", "additional_examples") ): Executable("./checkpointing/checkpointing")() + + @property + def libs(self): + """The name of the library differs from the package name => own libs handling.""" + return find_libraries(["libadolc"], root=self.prefix, shared=True, recursive=True) diff --git a/var/spack/repos/builtin/packages/all-library/package.py b/var/spack/repos/builtin/packages/all-library/package.py index 8841584194b591..f9b372892878a7 100644 --- a/var/spack/repos/builtin/packages/all-library/package.py +++ b/var/spack/repos/builtin/packages/all-library/package.py @@ -15,21 +15,30 @@ class AllLibrary(CMakePackage): homepage = "http://slms.pages.jsc.fz-juelich.de/websites/all-website/" url = "https://gitlab.jsc.fz-juelich.de/SLMS/loadbalancing/-/archive/v0.9.2/loadbalancing-v0.9.2.tar.gz" + git = "https://gitlab.jsc.fz-juelich.de/SLMS/loadbalancing.git" maintainers("junghans") license("BSD-3-Clause", checked_by="junghans") + version("master", branch="master") version("0.9.2", sha256="2b4ef52c604c3c0c467712d0912a33c82177610b67edc14df1e034779c6ddb71") variant("fortran", default=False, description="Build with fortran support") variant("shared", default=True, description="Build shared libraries") variant("vtk", default=False, description="Build with vtk support") + variant( + "voronoi", + default=False, + description="Enable voronoi-based loadbalancing scheme", + when="@0.9.3:", + ) depends_on("c", type="build") depends_on("cxx", type="build") depends_on("fortran", type="build", when="+fortran") depends_on("vtk", when="+vtk") + depends_on("voropp", when="+voronoi") depends_on("mpi") @@ -39,6 +48,7 @@ def cmake_args(self): self.define_from_variant("CM_ALL_FORTRAN", "fortran"), self.define_from_variant("CM_ALL_USE_F08", "fortran"), self.define_from_variant("CM_ALL_VTK_OUTPUT", "vtk"), + self.define_from_variant("CM_ALL_VORONOI", "voronoi"), ] if self.run_tests: diff --git a/var/spack/repos/builtin/packages/amrex/package.py b/var/spack/repos/builtin/packages/amrex/package.py index b524b6af812cbd..0845a08ac28f18 100644 --- a/var/spack/repos/builtin/packages/amrex/package.py +++ b/var/spack/repos/builtin/packages/amrex/package.py @@ -26,6 +26,7 @@ class Amrex(CMakePackage, CudaPackage, ROCmPackage): license("BSD-3-Clause") version("develop", branch="development") + version("24.12", sha256="ca4b41ac73fabb9cf3600b530c9823eb3625f337d9b7b9699c1089e81c67fc67") version("24.11", sha256="31cc37b39f15e02252875815f6066046fc56a479bf459362b9889b0d6a202df6") version("24.10", sha256="a2d15e417bd7c41963749338e884d939c80c5f2fcae3279fe3f1b463e3e4208a") version("24.09", sha256="a1435d16532d04a1facce9a9ae35d68a57f7cd21a5f22a6590bde3c265ea1449") diff --git a/var/spack/repos/builtin/packages/aws-ofi-nccl/package.py b/var/spack/repos/builtin/packages/aws-ofi-nccl/package.py index ed1c0d7ed7b09e..d4d2ea6dd0322d 100644 --- a/var/spack/repos/builtin/packages/aws-ofi-nccl/package.py +++ b/var/spack/repos/builtin/packages/aws-ofi-nccl/package.py @@ -28,7 +28,6 @@ class AwsOfiNccl(AutotoolsPackage): version("1.9.1", sha256="3ee01258674e70d6966eb6d319461f9b882afae618e217e0ae7ec03d26169b35") version("1.9.0", sha256="8d6d0469110a89b5431836d263860fb60fde7beccb26f553de41dca1feb61b51") version("1.8.1", sha256="beb59959be0f60b891f9549f4df51b394e97e739416c88c3436e75516fe067c8") - version("1.8.1", sha256="beb59959be0f60b891f9549f4df51b394e97e739416c88c3436e75516fe067c8") version("1.8.0", sha256="a2f1750d4908924985335e513186353d0c4d9a5d27b1a759f6aa31a10e74c06d") version("1.7.4", sha256="472bbc977ce37d0cf9239b8e366f4f247226a984eb8c487aadd884af53f00e13") version("1.7.3", sha256="7a49b530eb0fa5e262c1fcf3412289bc1d538c15290435c579d5e7f08d806fd4") diff --git a/var/spack/repos/builtin/packages/benchmark/package.py b/var/spack/repos/builtin/packages/benchmark/package.py index 1c1074696d90bf..34e1eadda682d4 100644 --- a/var/spack/repos/builtin/packages/benchmark/package.py +++ b/var/spack/repos/builtin/packages/benchmark/package.py @@ -19,6 +19,7 @@ class Benchmark(CMakePackage): # first properly installed CMake config packages in # 1.2.0 release: https://github.com/google/benchmark/issues/363 version("main", branch="main") + version("1.9.1", sha256="32131c08ee31eeff2c8968d7e874f3cb648034377dfc32a4c377fa8796d84981") version("1.9.0", sha256="35a77f46cc782b16fac8d3b107fbfbb37dcd645f7c28eee19f3b8e0758b48994") version("1.8.5", sha256="d26789a2b46d8808a48a4556ee58ccc7c497fcd4c0af9b90197674a81e04798a") version("1.8.4", sha256="3e7059b6b11fb1bbe28e33e02519398ca94c1818874ebed18e504dc6f709be45") diff --git a/var/spack/repos/builtin/packages/cgns/package.py b/var/spack/repos/builtin/packages/cgns/package.py index 6ffdb0071771b1..b2eabeb52c6626 100644 --- a/var/spack/repos/builtin/packages/cgns/package.py +++ b/var/spack/repos/builtin/packages/cgns/package.py @@ -38,8 +38,8 @@ class Cgns(CMakePackage): version("3.3.1", sha256="81093693b2e21a99c5640b82b267a495625b663d7b8125d5f1e9e7aaa1f8d469") version("3.3.0", sha256="8422c67994f8dc6a2f201523a14f6c7d7e16313bdd404c460c16079dbeafc662") - depends_on("c", type="build") # generated - depends_on("fortran", type="build") # generated + depends_on("c", type="build") + depends_on("fortran", type="build", when="+fortran") variant("hdf5", default=True, description="Enable HDF5 interface") variant("fortran", default=False, description="Enable Fortran interface") diff --git a/var/spack/repos/builtin/packages/cray-libsci/package.py b/var/spack/repos/builtin/packages/cray-libsci/package.py index 4d063172049c6b..42df5aa358bb02 100644 --- a/var/spack/repos/builtin/packages/cray-libsci/package.py +++ b/var/spack/repos/builtin/packages/cray-libsci/package.py @@ -13,6 +13,8 @@ class CrayLibsci(Package): homepage = "https://docs.nersc.gov/development/libraries/libsci/" has_code = False # Skip attempts to fetch source that is not available + version("23.02.1.1") + version("22.11.1.2") version("21.08.1.2") version("20.06.1") version("20.03.1") diff --git a/var/spack/repos/builtin/packages/cray-mpich/package.py b/var/spack/repos/builtin/packages/cray-mpich/package.py index 7e8bc574421b70..d0dd2005c90d38 100644 --- a/var/spack/repos/builtin/packages/cray-mpich/package.py +++ b/var/spack/repos/builtin/packages/cray-mpich/package.py @@ -18,6 +18,10 @@ class CrayMpich(Package): maintainers("haampie") + version("8.1.25") + version("8.1.24") + version("8.1.21") + version("8.1.14") version("8.1.7") version("8.1.0") version("8.0.16") diff --git a/var/spack/repos/builtin/packages/dbcsr/package.py b/var/spack/repos/builtin/packages/dbcsr/package.py index f4917e9492581b..351ab179dd674f 100644 --- a/var/spack/repos/builtin/packages/dbcsr/package.py +++ b/var/spack/repos/builtin/packages/dbcsr/package.py @@ -3,6 +3,8 @@ # # SPDX-License-Identifier: (Apache-2.0 OR MIT) +import os + from spack.package import * @@ -126,6 +128,18 @@ class Dbcsr(CMakePackage, CudaPackage, ROCmPackage): generator("ninja") depends_on("ninja@1.10:", type="build") + @when("+rocm") + def patch(self): + for directory, subdirectory, files in os.walk(os.getcwd()): + for i in files: + file_path = os.path.join(directory, i) + filter_file("USE ISO_C_BINDING", "USE,INTRINSIC :: ISO_C_BINDING", file_path) + filter_file("USE ISO_FORTRAN_ENV", "USE,INTRINSIC :: ISO_FORTRAN_ENV", file_path) + filter_file("USE omp_lib", "USE,INTRINSIC :: omp_lib", file_path) + filter_file("USE OMP_LIB", "USE,INTRINSIC :: OMP_LIB", file_path) + filter_file("USE iso_c_binding", "USE,INTRINSIC :: iso_c_binding", file_path) + filter_file("USE iso_fortran_env", "USE,INTRINSIC :: iso_fortran_env", file_path) + def cmake_args(self): spec = self.spec diff --git a/var/spack/repos/builtin/packages/detray/package.py b/var/spack/repos/builtin/packages/detray/package.py index ab94c97a835f33..310772e79fee30 100644 --- a/var/spack/repos/builtin/packages/detray/package.py +++ b/var/spack/repos/builtin/packages/detray/package.py @@ -20,6 +20,8 @@ class Detray(CMakePackage): license("MPL-2.0", checked_by="stephenswat") + version("0.83.0", sha256="c870a0459d1f9284750f6afbb97c759392e636b56d107f32b9bc891df717a0fe") + version("0.82.0", sha256="48794d37496dd5013b755d5d401da7b9d1023fadff86b2a454e5c21e2aaf8c60") version("0.81.0", sha256="821313a7e3ea90fcf5c92153d28bba1f85844e03d7c6b6b98d0b3407adb86357") version("0.80.0", sha256="a12f3e333778ddd20a568b5c8df5b2375f9a4d74caf921822c1864b07b3f8ab7") version("0.79.0", sha256="3b9f18cb003e59795a0e4b1414069ac8558b975714626449293a71bc4398a380") diff --git a/var/spack/repos/builtin/packages/double-conversion/package.py b/var/spack/repos/builtin/packages/double-conversion/package.py index ef644be4a7d1c6..380ff36ca687ce 100644 --- a/var/spack/repos/builtin/packages/double-conversion/package.py +++ b/var/spack/repos/builtin/packages/double-conversion/package.py @@ -33,5 +33,8 @@ class DoubleConversion(CMakePackage): version("1.1.4", sha256="24b5edce8c88f0f632c83e60e0bde11252656dc3b714ba195619c1798ff28834") version("1.1.3", sha256="f0d1b8621592a3cf010c04c3e1c0f08455fc0fc7ee22e1583e2a63dc6d3e3871") + depends_on("c", type="build") + depends_on("cxx", type="build") + def cmake_args(self): return ["-DCMAKE_POSITION_INDEPENDENT_CODE:BOOL=true"] diff --git a/var/spack/repos/builtin/packages/draco/package.py b/var/spack/repos/builtin/packages/draco/package.py index b6ed230af938fc..b4079b9b183571 100644 --- a/var/spack/repos/builtin/packages/draco/package.py +++ b/var/spack/repos/builtin/packages/draco/package.py @@ -77,6 +77,7 @@ class Draco(CMakePackage): depends_on("lapack", when="+lapack") depends_on("libquo@1.3.1:", when="@7.4.0:+libquo") depends_on("metis", when="+parmetis") + depends_on("metis@5:+no_warning", when="@7.19:+parmetis") depends_on("parmetis", when="+parmetis") depends_on("qt", when="+qt", type=("build", "link", "run")) depends_on("superlu-dist@:5", when="@:7.6+superlu_dist") diff --git a/var/spack/repos/builtin/packages/eigen/package.py b/var/spack/repos/builtin/packages/eigen/package.py index 1909cdd96e8e72..5f0105c217e56d 100644 --- a/var/spack/repos/builtin/packages/eigen/package.py +++ b/var/spack/repos/builtin/packages/eigen/package.py @@ -15,6 +15,7 @@ class Eigen(CMakePackage, ROCmPackage): homepage = "https://eigen.tuxfamily.org/" git = "https://gitlab.com/libeigen/eigen.git" url = "https://gitlab.com/libeigen/eigen/-/archive/3.4.0/eigen-3.4.0.tar.gz" + maintainers("HaoZeke") license("MPL-2.0") @@ -39,9 +40,12 @@ class Eigen(CMakePackage, ROCmPackage): version("3.2.5", sha256="8068bd528a2ff3885eb55225c27237cf5cda834355599f05c2c85345db8338b4") variant("nightly", description="run Nightly test", default=False) - depends_on("c", type="build") # generated - depends_on("cxx", type="build") # generated - depends_on("fortran", type="build") # generated + + depends_on("c", type="build") + depends_on("cxx", type="build") + + # TODO: https://eigen.tuxfamily.org/dox/TopicUsingBlasLapack.html + # Older eigen releases haven't been tested with ROCm conflicts("+rocm @:3.4.0") @@ -85,13 +89,20 @@ def cmake_args(self): if self.spec.satisfies("@:3.4"): # CMake fails without this flag # https://gitlab.com/libeigen/eigen/-/issues/1656 - args += [self.define("BUILD_TESTING", "ON")] + args.extend([self.define("BUILD_TESTING", "ON")]) + if self.spec.satisfies("+rocm"): - args.append(self.define("ROCM_PATH", self.spec["hip"].prefix)) - args.append(self.define("HIP_PATH", self.spec["hip"].prefix)) - args.append(self.define("EIGEN_TEST_HIP", "ON")) + args.extend( + [ + self.define("ROCM_PATH", self.spec["hip"].prefix), + self.define("HIP_PATH", self.spec["hip"].prefix), + self.define("EIGEN_TEST_HIP", "ON"), + ] + ) + if self.spec.satisfies("@master") and self.run_tests: args.append(self.define("Boost_INCLUDE_DIR", self.spec["boost"].prefix.include)) + return args def check(self): diff --git a/var/spack/repos/builtin/packages/eospac/package.py b/var/spack/repos/builtin/packages/eospac/package.py index c245a0d50a92f8..26a6d7713ab9b1 100644 --- a/var/spack/repos/builtin/packages/eospac/package.py +++ b/var/spack/repos/builtin/packages/eospac/package.py @@ -22,6 +22,11 @@ class Eospac(Package): # previous stable release will appear first as a new beta. # - alpha and beta versions are marked with 'deprecated=True' to help # spack's version comparison. + version( + "6.5.12", + sha256="62d5f4a6a30c9acb426bd6bd972edc7fad392e5b941f950126ed0d3be5fd5162", + url="https://laws.lanl.gov/projects/data/eos/get_file.php?package=eospac&filename=eospac_v6.5.12_39364aabc75c3312022b12e6d16d6a31f1f8945f.tgz", + ) version( "6.5.11", sha256="ed821b5a1bf45df1443d5f72d86190317ed9f5bad6a7c73e23bb4365bd76e24c", diff --git a/var/spack/repos/builtin/packages/fpm/package.py b/var/spack/repos/builtin/packages/fpm/package.py index 18f179d15b29cf..5701a24e581246 100644 --- a/var/spack/repos/builtin/packages/fpm/package.py +++ b/var/spack/repos/builtin/packages/fpm/package.py @@ -41,6 +41,9 @@ class Fpm(Package): depends_on("curl", type="build") depends_on("git@1.8.5:", type="build") + depends_on("c", type="build") + depends_on("fortran", type="build") + def setup_build_environment(self, env): if self.spec.satisfies("@0.4.0"): env.set("FPM_C_COMPILER", self.compiler.cc) diff --git a/var/spack/repos/builtin/packages/gcc-runtime/package.py b/var/spack/repos/builtin/packages/gcc-runtime/package.py index 7046b8ff099f1d..551aaa57cbca8a 100644 --- a/var/spack/repos/builtin/packages/gcc-runtime/package.py +++ b/var/spack/repos/builtin/packages/gcc-runtime/package.py @@ -3,6 +3,7 @@ # # SPDX-License-Identifier: (Apache-2.0 OR MIT) +import glob import os import re @@ -11,7 +12,7 @@ from llnl.util import tty from spack.package import * -from spack.util.elf import parse_elf +from spack.util.elf import delete_needed_from_elf, parse_elf class GccRuntime(Package): @@ -72,6 +73,9 @@ def install(self, spec, prefix): for path, name in libraries: install(path, os.path.join(prefix.lib, name)) + if spec.platform in ("linux", "freebsd"): + _drop_libgfortran_zlib(prefix.lib) + def _get_libraries_macho(self): """Same as _get_libraries_elf but for Mach-O binaries""" cc = Executable(self.compiler.cc) @@ -124,6 +128,22 @@ def headers(self): return HeaderList([]) +def _drop_libgfortran_zlib(lib_dir: str) -> None: + """Due to a bug in GCC's autotools setup (https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87182), + libz sometimes appears as a redundant system dependency of libgfortran. Delete it.""" + libraries = glob.glob(os.path.join(lib_dir, "libgfortran*.so*")) + if len(libraries) == 0: + return + with open(libraries[0], "rb+") as f: + elf = parse_elf(f, dynamic_section=True) + if not elf.has_needed: + return + libz = next((x for x in elf.dt_needed_strs if x.startswith(b"libz.so")), None) + if libz is None: + return + delete_needed_from_elf(f, elf, libz) + + def get_elf_libraries(compiler, libraries): """Get the GCC runtime libraries for ELF binaries""" cc = Executable(compiler.cc) diff --git a/var/spack/repos/builtin/packages/gcc/package.py b/var/spack/repos/builtin/packages/gcc/package.py index 04b37259b1577b..8972fc46ced7b2 100644 --- a/var/spack/repos/builtin/packages/gcc/package.py +++ b/var/spack/repos/builtin/packages/gcc/package.py @@ -406,39 +406,71 @@ class Gcc(AutotoolsPackage, GNUMirrorPackage, CompilerPackage): when="@11.2.0", ) - # Apple M1 support, created from branch of Darwin maintainer for GCC: - # https://github.com/iains/gcc-11-branch + # aarch64-darwin support from Iain Sandoe's branch patch( - "https://raw.githubusercontent.com/Homebrew/formula-patches/22dec3fc/gcc/gcc-11.3.0-arm.diff", - sha256="e02006b7ec917cc1390645d95735a6a866caed0dfe506d5bef742f7862cab218", - when="@11.3.0 target=aarch64:", + "https://github.com/iains/gcc-14-branch/compare/04696df09633baf97cdbbdd6e9929b9d472161d3..gcc-14.2-darwin-r2.patch?full_index=1", + sha256="01ea668489f3f0fb2439060f6c333c4c17ef4c19c4c4e6e6aa4b8ea493e97685", + when="@14.2.0 target=aarch64:", ) - # https://github.com/iains/gcc-12-branch patch( - "https://raw.githubusercontent.com/Homebrew/formula-patches/76677f2b/gcc/gcc-12.1.0-arm.diff", - sha256="a000f1d9cb1dd98c7c4ef00df31435cd5d712d2f9d037ddc044f8bf82a16cf35", - when="@12.1.0 target=aarch64:", + "https://github.com/iains/gcc-14-branch/compare/cd0059a1976303638cea95f216de129334fc04d1..gcc-14.1-darwin-r1.patch?full_index=1", + sha256="159cc2a1077ad5d9a3cca87880cd977b8202d8fb464a6ec7b53804475d21a682", + when="@14.1.0 target=aarch64:", ) + patch( - "https://raw.githubusercontent.com/Homebrew/formula-patches/1d184289/gcc/gcc-12.2.0-arm.diff", - sha256="a7843b5c6bf1401e40c20c72af69c8f6fc9754ae980bb4a5f0540220b3dcb62d", - when="@12.2.0 target=aarch64:", + "https://github.com/iains/gcc-13-branch/compare/b71f1de6e9cf7181a288c0f39f9b1ef6580cf5c8..gcc-13.3-darwin-r1.patch?full_index=1", + sha256="d957520afc286ac46aa3c4bf9b64618d02ca0bf1466f32321b5d6beec6a396eb", + when="@13.3.0 target=aarch64:", ) patch( - "https://raw.githubusercontent.com/Homebrew/formula-patches/5c206c47/gcc/gcc-13.1.0.diff", - sha256="cb4e8a89387f748a744da0273025d0dc2e3c76780cc390b18ada704676afea11", + "https://github.com/iains/gcc-13-branch/compare/c891d8dc23e1a46ad9f3e757d09e57b500d40044..gcc-13.2-darwin-r0.patch?full_index=1", + sha256="6a49d1074d7dd2e3b76e61613a0f143c668ed648fb8d9d48ed76a6b127815c88", + when="@13.2.0 target=aarch64:", + ) + patch( + "https://github.com/iains/gcc-13-branch/compare/cc035c5d8672f87dc8c2756d9f8367903aa72d93..gcc-13.1-darwin-r0.patch?full_index=1", + sha256="36d2c04d487edb6792b48dedae6936f8b864b6f969bd3fd03763e072d471c022", when="@13.1.0 target=aarch64:", ) + patch( - "https://raw.githubusercontent.com/Homebrew/formula-patches/3c5cbc8e9cf444a1967786af48e430588e1eb481/gcc/gcc-13.2.0.diff", - sha256="2df7ef067871a30b2531a2013b3db661ec9e61037341977bfc451e30bf2c1035", - when="@13.2.0 target=aarch64:", + "https://github.com/iains/gcc-12-branch/compare/2bada4bc59bed4be34fab463bdb3c3ebfd2b41bb..gcc-12.4-darwin-r0.patch?full_index=1", + sha256="e242adf240a62ed3005da75a9e304bda980b84ce497f124b4bddc819ee821e2a", + when="@12.4.0 target=aarch64:", ) patch( - "https://raw.githubusercontent.com/Homebrew/formula-patches/82b5c1cd38826ab67ac7fc498a8fe74376a40f4a/gcc/gcc-14.1.0.diff", - sha256="1529cff128792fe197ede301a81b02036c8168cb0338df21e4bc7aafe755305a", - when="@14.1.0 target=aarch64:", + "https://github.com/iains/gcc-12-branch/compare/8fc1a49c9312b05d925b7d21f1d2145d70818151..gcc-12.3-darwin-r0.patch?full_index=1", + sha256="1ebac2010eb9ced33cf46a8d8378193671ed6830f262219aa3428de5bc9fd668", + when="@12.3.0 target=aarch64:", + ) + patch( + "https://github.com/iains/gcc-12-branch/compare/2ee5e4300186a92ad73f1a1a64cb918dc76c8d67..gcc-12.2-darwin-r0.patch?full_index=1", + sha256="16d5203ddb97cd43d6c1e9c34e0f681154aed1d127f2324b2a50006b92960cfd", + when="@12.2.0 target=aarch64:", + ) + patch( + "https://github.com/iains/gcc-12-branch/compare/1ea978e3066ac565a1ec28a96a4d61eaf38e2726..gcc-12.1-darwin-r1.patch?full_index=1", + sha256="b0a811e33c3451ebd1882eac4e2b4b32ce0b60cfa0b8ccf8c5fda7b24327c820", + when="@12.1.0 target=aarch64:", + ) + + patch( + "https://github.com/iains/gcc-11-branch/compare/5cc4c42a0d4de08715c2eef8715ad5b2e92a23b6..gcc-11.5-darwin-r0.patch?full_index=1", + sha256="6c92190a9acabd6be13bd42ca675f59f44be050a7121214abeaea99d898db30c", + when="@11.5.0 target=aarch64:", ) + patch( + "https://github.com/iains/gcc-11-branch/compare/ff4bf326d03e750a8d4905ea49425fe7d15a04b8..gcc-11.4-darwin-r0.patch?full_index=1", + sha256="05810e5cdb052c06490f7d987c66a13d47ae7bd2eb285a3a881ad4aa6dd0d13f", + when="@11.4.0 target=aarch64:", + ) + patch( + "https://github.com/iains/gcc-11-branch/compare/2d280e7eafc086e9df85f50ed1a6526d6a3a204d..gcc-11.3-darwin-r2.patch?full_index=1", + sha256="a8097c232dfb21b0e02f3d99e3c3e47443db3982dafbb584938ac1a9a4afd33d", + when="@11.3.0 target=aarch64:", + ) + conflicts("+bootstrap", when="@11.3.0,13.1: target=aarch64:") # Use -headerpad_max_install_names in the build, diff --git a/var/spack/repos/builtin/packages/gdk-pixbuf/package.py b/var/spack/repos/builtin/packages/gdk-pixbuf/package.py index 7c0c74201bea58..f5e099d6dc665a 100644 --- a/var/spack/repos/builtin/packages/gdk-pixbuf/package.py +++ b/var/spack/repos/builtin/packages/gdk-pixbuf/package.py @@ -12,33 +12,36 @@ class GdkPixbuf(MesonPackage): GTK+ 2 but it was split off into a separate package in preparation for the change to GTK+ 3.""" homepage = "https://gitlab.gnome.org/GNOME/gdk-pixbuf" - url = "https://ftp.acc.umu.se/pub/gnome/sources/gdk-pixbuf/2.40/gdk-pixbuf-2.40.0.tar.xz" git = "https://gitlab.gnome.org/GNOME/gdk-pixbuf" - list_url = "https://ftp.acc.umu.se/pub/gnome/sources/gdk-pixbuf/" + url = "https://gitlab.gnome.org/GNOME/gdk-pixbuf/-/archive/2.40.0/gdk-pixbuf-2.40.0.tar.gz" + + # Falling back to the gitlab source since the mirror here seems to be broken + # url = "https://ftp.acc.umu.se/pub/gnome/sources/gdk-pixbuf/2.40/gdk-pixbuf-2.40.0.tar.xz" + # list_url = "https://ftp.acc.umu.se/pub/gnome/sources/gdk-pixbuf/" list_depth = 1 license("LGPL-2.1-or-later", checked_by="wdconinc") - version("2.42.12", sha256="b9505b3445b9a7e48ced34760c3bcb73e966df3ac94c95a148cb669ab748e3c7") + version("2.42.12", sha256="d41966831b3d291fcdfe31f683bea4b3f03241d591ddbe550b5db873af3da364") # https://nvd.nist.gov/vuln/detail/CVE-2022-48622 version( "2.42.10", - sha256="ee9b6c75d13ba096907a2e3c6b27b61bcd17f5c7ebeab5a5b439d2f2e39fe44b", + sha256="87a086c51d9705698b22bd598a795efaccf61e4db3a96f439dcb3cd90506dab8", deprecated=True, ) version( "2.42.9", - sha256="28f7958e7bf29a32d4e963556d241d0a41a6786582ff6a5ad11665e0347fc962", + sha256="226d950375907857b23c5946ae6d30128f08cd75f65f14b14334c7a9fb686e36", deprecated=True, ) version( "2.42.6", - sha256="c4a6b75b7ed8f58ca48da830b9fa00ed96d668d3ab4b1f723dcf902f78bde77f", + sha256="c4f3a84a04bc7c5f4fbd97dce7976ab648c60628f72ad4c7b79edce2bbdb494d", deprecated=True, ) version( "2.42.2", - sha256="83c66a1cfd591d7680c144d2922c5955d38b4db336d7cd3ee109f7bcf9afef15", + sha256="249b977279f761979104d7befbb5ee23f1661e29d19a36da5875f3a97952d13f", deprecated=True, ) diff --git a/var/spack/repos/builtin/packages/gromacs/package.py b/var/spack/repos/builtin/packages/gromacs/package.py index 486c36af8e66f9..0caecfe31945d3 100644 --- a/var/spack/repos/builtin/packages/gromacs/package.py +++ b/var/spack/repos/builtin/packages/gromacs/package.py @@ -27,11 +27,29 @@ class Gromacs(CMakePackage, CudaPackage): url = "https://ftp.gromacs.org/gromacs/gromacs-2022.2.tar.gz" list_url = "https://ftp.gromacs.org/gromacs" git = "https://gitlab.com/gromacs/gromacs.git" + maintainers("mabraham", "eirrgang", "junghans") license("GPL-2.0-or-later", when="@:4.5") license("LGPL-2.1-or-later", when="@4.6:") + # Deprecation policy: + # + # GROMACS makes an annual major release and supports it with fixes + # in minor updates for about two years. Each such annual release + # series is supported in spack for those two years, then marked as + # deprecated in Spack. Deprecated versions can be removed after + # the next major release of GROMACS is supported in Spack. Users + # needing such an old version can either do a manual installation + # or get an older version of Spack. + # + # Exception: Version 2019.6 is the last version capable of tabulated + # interactions used in the so-called "group scheme." It will be marked + # as deprecated only after equivalent functionality is available in + # a major release of GROMACS, then removed as above. + # + # Exception: Otherwise, versions before 2022 will be removed when + # 2025 is supported. version("main", branch="main") version("master", branch="main", deprecated=True) version("2024.3", sha256="bbda056ee59390be7d58d84c13a9ec0d4e3635617adf2eb747034922cba1f029") @@ -51,45 +69,197 @@ class Gromacs(CMakePackage, CudaPackage): version("2022.2", sha256="656404f884d2fa2244c97d2a5b92af148d0dbea94ad13004724b3fcbf45e01bf") version("2022.1", sha256="85ddab5197d79524a702c4959c2c43be875e0fc471df3a35224939dce8512450") version("2022", sha256="fad60d606c02e6164018692c6c9f2c159a9130c2bf32e8c5f4f1b6ba2dda2b68") - version("2021.7", sha256="4db7bbbfe5424de48373686ec0e8c5bfa7175d5cd74290ef1c1e840e6df67f06") - version("2021.6", sha256="52df2c1d7586fd028d9397985c68bd6dd26e6e905ead382b7e6c473d087902c3") - version("2021.5", sha256="eba63fe6106812f72711ef7f76447b12dd1ee6c81b3d8d4d0e3098cd9ea009b6") - version("2021.4", sha256="cb708a3e3e83abef5ba475fdb62ef8d42ce8868d68f52dafdb6702dc9742ba1d") - version("2021.3", sha256="e109856ec444768dfbde41f3059e3123abdb8fe56ca33b1a83f31ed4575a1cc6") - version("2021.2", sha256="d940d865ea91e78318043e71f229ce80d32b0dc578d64ee5aa2b1a4be801aadb") - version("2021.1", sha256="bc1d0a75c134e1fb003202262fe10d3d32c59bbb40d714bc3e5015c71effe1e5") - version("2021", sha256="efa78ab8409b0f5bf0fbca174fb8fbcf012815326b5c71a9d7c385cde9a8f87b") - version("2020.7", sha256="744158d8f61b0d36ffe89ec934519b7e0981a7af438897740160da648d36c2f0") - version("2020.6", sha256="d8bbe57ed3c9925a8cb99ecfe39e217f930bed47d5268a9e42b33da544bdb2ee") - version("2020.5", sha256="7b6aff647f7c8ee1bf12204d02cef7c55f44402a73195bd5f42cf11850616478") - version("2020.4", sha256="5519690321b5500c7951aaf53ff624042c3edd1a5f5d6dd1f2d802a3ecdbf4e6") - version("2020.3", sha256="903183691132db14e55b011305db4b6f4901cc4912d2c56c131edfef18cc92a9") - version("2020.2", sha256="7465e4cd616359d84489d919ec9e4b1aaf51f0a4296e693c249e83411b7bd2f3") - version("2020.1", sha256="e1666558831a3951c02b81000842223698016922806a8ce152e8f616e29899cf") - version("2020", sha256="477e56142b3dcd9cb61b8f67b24a55760b04d1655e8684f979a75a5eec40ba01") + version( + "2021.7", + sha256="4db7bbbfe5424de48373686ec0e8c5bfa7175d5cd74290ef1c1e840e6df67f06", + deprecated=True, + ) + version( + "2021.6", + sha256="52df2c1d7586fd028d9397985c68bd6dd26e6e905ead382b7e6c473d087902c3", + deprecated=True, + ) + version( + "2021.5", + sha256="eba63fe6106812f72711ef7f76447b12dd1ee6c81b3d8d4d0e3098cd9ea009b6", + deprecated=True, + ) + version( + "2021.4", + sha256="cb708a3e3e83abef5ba475fdb62ef8d42ce8868d68f52dafdb6702dc9742ba1d", + deprecated=True, + ) + version( + "2021.3", + sha256="e109856ec444768dfbde41f3059e3123abdb8fe56ca33b1a83f31ed4575a1cc6", + deprecated=True, + ) + version( + "2021.2", + sha256="d940d865ea91e78318043e71f229ce80d32b0dc578d64ee5aa2b1a4be801aadb", + deprecated=True, + ) + version( + "2021.1", + sha256="bc1d0a75c134e1fb003202262fe10d3d32c59bbb40d714bc3e5015c71effe1e5", + deprecated=True, + ) + version( + "2021", + sha256="efa78ab8409b0f5bf0fbca174fb8fbcf012815326b5c71a9d7c385cde9a8f87b", + deprecated=True, + ) + version( + "2020.7", + sha256="744158d8f61b0d36ffe89ec934519b7e0981a7af438897740160da648d36c2f0", + deprecated=True, + ) + version( + "2020.6", + sha256="d8bbe57ed3c9925a8cb99ecfe39e217f930bed47d5268a9e42b33da544bdb2ee", + deprecated=True, + ) + version( + "2020.5", + sha256="7b6aff647f7c8ee1bf12204d02cef7c55f44402a73195bd5f42cf11850616478", + deprecated=True, + ) + version( + "2020.4", + sha256="5519690321b5500c7951aaf53ff624042c3edd1a5f5d6dd1f2d802a3ecdbf4e6", + deprecated=True, + ) + version( + "2020.3", + sha256="903183691132db14e55b011305db4b6f4901cc4912d2c56c131edfef18cc92a9", + deprecated=True, + ) + version( + "2020.2", + sha256="7465e4cd616359d84489d919ec9e4b1aaf51f0a4296e693c249e83411b7bd2f3", + deprecated=True, + ) + version( + "2020.1", + sha256="e1666558831a3951c02b81000842223698016922806a8ce152e8f616e29899cf", + deprecated=True, + ) + version( + "2020", + sha256="477e56142b3dcd9cb61b8f67b24a55760b04d1655e8684f979a75a5eec40ba01", + deprecated=True, + ) version("2019.6", sha256="bebe396dc0db11a9d4cc205abc13b50d88225617642508168a2195324f06a358") - version("2019.5", sha256="438061a4a2d45bbb5cf5c3aadd6c6df32d2d77ce8c715f1c8ffe56156994083a") - version("2019.4", sha256="ba4366eedfc8a1dbf6bddcef190be8cd75de53691133f305a7f9c296e5ca1867") - version("2019.3", sha256="4211a598bf3b7aca2b14ad991448947da9032566f13239b1a05a2d4824357573") - version("2019.2", sha256="bcbf5cc071926bc67baa5be6fb04f0986a2b107e1573e15fadcb7d7fc4fb9f7e") - version("2019.1", sha256="b2c37ed2fcd0e64c4efcabdc8ee581143986527192e6e647a197c76d9c4583ec") - version("2019", sha256="c5b281a5f0b5b4eeb1f4c7d4dc72f96985b566561ca28acc9c7c16f6ee110d0b") - version("2018.8", sha256="776923415df4bc78869d7f387c834141fdcda930b2e75be979dc59ecfa6ebecf") - version("2018.5", sha256="32261df6f7ec4149fc0508f9af416953d056e281590359838c1ed6644ba097b8") - version("2018.4", sha256="6f2ee458c730994a8549d6b4f601ecfc9432731462f8bd4ffa35d330d9aaa891") - version("2018.3", sha256="4423a49224972969c52af7b1f151579cea6ab52148d8d7cbae28c183520aa291") - version("2018.2", sha256="4bdde8120c510b6543afb4b18f82551fddb11851f7edbd814aa24022c5d37857") - version("2018.1", sha256="4d3533340499323fece83b4a2d4251fa856376f2426c541e00b8e6b4c0d705cd") - version("2018", sha256="deb5d0b749a52a0c6083367b5f50a99e08003208d81954fb49e7009e1b1fd0e9") - version("2016.6", sha256="bac0117d2cad21f9b94fe5b854fb9ae7435b098a6da4e732ee745f18e52473d7") - version("2016.5", sha256="57db26c6d9af84710a1e0c47a1f5bf63a22641456448dcd2eeb556ebd14e0b7c") - version("2016.4", sha256="4be9d3bfda0bdf3b5c53041e0b8344f7d22b75128759d9bfa9442fe65c289264") - version("2016.3", sha256="7bf00e74a9d38b7cef9356141d20e4ba9387289cbbfd4d11be479ef932d77d27") - version("5.1.5", sha256="c25266abf07690ecad16ed3996899b1d489cbb1ef733a1befb3b5c75c91a703e") - version("5.1.4", sha256="0f3793d8f1f0be747cf9ebb0b588fb2b2b5dc5acc32c3046a7bee2d2c03437bc") - version("5.1.2", sha256="39d6f1d7ae8ba38cea6089da40676bfa4049a49903d21551abc030992a58f304") - version("4.6.7", sha256="6afb1837e363192043de34b188ca3cf83db6bd189601f2001a1fc5b0b2a214d9") - version("4.5.5", sha256="e0605e4810b0d552a8761fef5540c545beeaf85893f4a6e21df9905a33f871ba") + version( + "2019.5", + sha256="438061a4a2d45bbb5cf5c3aadd6c6df32d2d77ce8c715f1c8ffe56156994083a", + deprecated=True, + ) + version( + "2019.4", + sha256="ba4366eedfc8a1dbf6bddcef190be8cd75de53691133f305a7f9c296e5ca1867", + deprecated=True, + ) + version( + "2019.3", + sha256="4211a598bf3b7aca2b14ad991448947da9032566f13239b1a05a2d4824357573", + deprecated=True, + ) + version( + "2019.2", + sha256="bcbf5cc071926bc67baa5be6fb04f0986a2b107e1573e15fadcb7d7fc4fb9f7e", + deprecated=True, + ) + version( + "2019.1", + sha256="b2c37ed2fcd0e64c4efcabdc8ee581143986527192e6e647a197c76d9c4583ec", + deprecated=True, + ) + version( + "2019", + sha256="c5b281a5f0b5b4eeb1f4c7d4dc72f96985b566561ca28acc9c7c16f6ee110d0b", + deprecated=True, + ) + version( + "2018.8", + sha256="776923415df4bc78869d7f387c834141fdcda930b2e75be979dc59ecfa6ebecf", + deprecated=True, + ) + version( + "2018.5", + sha256="32261df6f7ec4149fc0508f9af416953d056e281590359838c1ed6644ba097b8", + deprecated=True, + ) + version( + "2018.4", + sha256="6f2ee458c730994a8549d6b4f601ecfc9432731462f8bd4ffa35d330d9aaa891", + deprecated=True, + ) + version( + "2018.3", + sha256="4423a49224972969c52af7b1f151579cea6ab52148d8d7cbae28c183520aa291", + deprecated=True, + ) + version( + "2018.2", + sha256="4bdde8120c510b6543afb4b18f82551fddb11851f7edbd814aa24022c5d37857", + deprecated=True, + ) + version( + "2018.1", + sha256="4d3533340499323fece83b4a2d4251fa856376f2426c541e00b8e6b4c0d705cd", + deprecated=True, + ) + version( + "2018", + sha256="deb5d0b749a52a0c6083367b5f50a99e08003208d81954fb49e7009e1b1fd0e9", + deprecated=True, + ) + version( + "2016.6", + sha256="bac0117d2cad21f9b94fe5b854fb9ae7435b098a6da4e732ee745f18e52473d7", + deprecated=True, + ) + version( + "2016.5", + sha256="57db26c6d9af84710a1e0c47a1f5bf63a22641456448dcd2eeb556ebd14e0b7c", + deprecated=True, + ) + version( + "2016.4", + sha256="4be9d3bfda0bdf3b5c53041e0b8344f7d22b75128759d9bfa9442fe65c289264", + deprecated=True, + ) + version( + "2016.3", + sha256="7bf00e74a9d38b7cef9356141d20e4ba9387289cbbfd4d11be479ef932d77d27", + deprecated=True, + ) + version( + "5.1.5", + sha256="c25266abf07690ecad16ed3996899b1d489cbb1ef733a1befb3b5c75c91a703e", + deprecated=True, + ) + version( + "5.1.4", + sha256="0f3793d8f1f0be747cf9ebb0b588fb2b2b5dc5acc32c3046a7bee2d2c03437bc", + deprecated=True, + ) + version( + "5.1.2", + sha256="39d6f1d7ae8ba38cea6089da40676bfa4049a49903d21551abc030992a58f304", + deprecated=True, + ) + version( + "4.6.7", + sha256="6afb1837e363192043de34b188ca3cf83db6bd189601f2001a1fc5b0b2a214d9", + deprecated=True, + ) + version( + "4.5.5", + sha256="e0605e4810b0d552a8761fef5540c545beeaf85893f4a6e21df9905a33f871ba", + deprecated=True, + ) depends_on("c", type="build") # generated depends_on("cxx", type="build") # generated @@ -113,11 +283,22 @@ class Gromacs(CMakePackage, CudaPackage): variant( "heffte", default=False, - when="@2021: +sycl+mpi", + when="@2021: +mpi", description="Enable multi-GPU FFT support with HeFFTe", ) + depends_on("heffte +cuda", when="+heffte +cuda") + depends_on("heffte +sycl", when="+heffte +sycl") variant("opencl", default=False, description="Enable OpenCL support") - variant("sycl", default=False, when="@2021: %clang", description="Enable SYCL support") + variant("sycl", default=False, when="@2021:", description="Enable SYCL support") + requires( + "^intel-oneapi-runtime", + "^hipsycl %clang", + policy="one_of", + when="+sycl", + msg="GROMACS SYCL support comes either from intel-oneapi-runtime or a " + + "package that provides the virtual package `sycl`, such as AdaptiveCpp " + + "plus a clang compiler.", + ) variant( "intel-data-center-gpu-max", default=False, @@ -627,7 +808,7 @@ def cmake_args(self): options.append("-DGMX_USE_ITT=on") options.append( "-DITTNOTIFY_INCLUDE_DIR=%s" - % join_path(self.spec["intel-oneapi-vtune"].package.headers) + % self.spec["intel-oneapi-vtune"].package.headers.directories[0] ) if self.spec.satisfies("~nblib"): diff --git a/var/spack/repos/builtin/packages/hip/package.py b/var/spack/repos/builtin/packages/hip/package.py index fa2c892f16bb16..19e66d4fad518a 100644 --- a/var/spack/repos/builtin/packages/hip/package.py +++ b/var/spack/repos/builtin/packages/hip/package.py @@ -58,6 +58,9 @@ class Hip(CMakePackage): conflicts("+asan", when="os=centos7") conflicts("+asan", when="os=centos8") + depends_on("c", type="build") + depends_on("cxx", type="build") + depends_on("cuda", when="+cuda") depends_on("cmake@3.16.8:", type="build") @@ -531,12 +534,6 @@ def patch(self): "clr/hipamd/hip-config-amd.cmake", string=True, ) - filter_file( - '"${ROCM_PATH}/llvm"', - self.spec["llvm-amdgpu"].prefix, - "clr/hipamd/src/hiprtc/CMakeLists.txt", - string=True, - ) perl = self.spec["perl"].command if self.spec.satisfies("@:5.5"): @@ -561,7 +558,12 @@ def patch(self): filter_file(" -lnuma", f" -L{numactl} -lnuma", "hipBin_amd.h") def cmake_args(self): - args = [] + args = [ + # find_package(Clang) and find_package(LLVM) in clr/hipamd/src/hiprtc/CMakeLists.txt + # should find llvm-amdgpu + self.define("LLVM_ROOT", self.spec["llvm-amdgpu"].prefix), + self.define("Clang_ROOT", self.spec["llvm-amdgpu"].prefix), + ] if self.spec.satisfies("+rocm"): args.append(self.define("HSA_PATH", self.spec["hsa-rocr-dev"].prefix)) args.append(self.define("HIP_COMPILER", "clang")) diff --git a/var/spack/repos/builtin/packages/hohqmesh/package.py b/var/spack/repos/builtin/packages/hohqmesh/package.py index 15af8fb92611c2..9c1eda34a1ddbf 100644 --- a/var/spack/repos/builtin/packages/hohqmesh/package.py +++ b/var/spack/repos/builtin/packages/hohqmesh/package.py @@ -17,6 +17,10 @@ class Hohqmesh(CMakePackage): license("MIT") + version("main", branch="main") + version("1.5.3", sha256="5d6de1ff6472d5044997372111754dcf339603351d0c855664115353a085a21e") + version("1.5.2", sha256="afc749f71657fc70294a00e84891463d23a57dff0c17975445f268fb417da0cc") + version("1.5.1", sha256="3a3e0246d61d55b58f5bebc6c925f0f6df93398ad8efc52a933feab4dcf00dc1") version("1.5.0", sha256="e2a8ff604b93b49dbab101edd6f031e5032535ec96a84ea58906a326be1c8f04") version("1.4.2", sha256="656c149b510b6d3e914d1794c27b4802699c9fd209afff8aec3a219a9e7f86ff") version("1.4.1", sha256="bbfecdba3899bf124bdac2bf91f1262a8e2f224ba699d55bdf8546073fc62b21") diff --git a/var/spack/repos/builtin/packages/hypre/package.py b/var/spack/repos/builtin/packages/hypre/package.py index 8d3c262c672576..078221ba6400c9 100644 --- a/var/spack/repos/builtin/packages/hypre/package.py +++ b/var/spack/repos/builtin/packages/hypre/package.py @@ -19,7 +19,7 @@ class Hypre(AutotoolsPackage, CudaPackage, ROCmPackage): git = "https://github.com/hypre-space/hypre.git" tags = ["e4s", "radiuss"] - maintainers("ulrikeyang", "osborn9", "balay") + maintainers("ulrikeyang", "osborn9", "victorapm", "balay") test_requires_compiler = True @@ -74,6 +74,7 @@ class Hypre(AutotoolsPackage, CudaPackage, ROCmPackage): variant( "superlu-dist", default=False, description="Activates support for SuperLU_Dist library" ) + variant("lapack", default=True, description="Use external blas/lapack") variant("int64", default=False, description="Use 64bit integers") variant("mixedint", default=False, description="Use 64bit integers while reducing memory use") variant("complex", default=False, description="Use complex values") @@ -123,8 +124,8 @@ def patch(self): # fix sequential compilation in 'src/seq_mv' filter_file("\tmake", "\t$(MAKE)", "src/seq_mv/Makefile") depends_on("mpi", when="+mpi") - depends_on("blas") - depends_on("lapack") + depends_on("blas", when="+lapack") + depends_on("lapack", when="+lapack") depends_on("magma", when="+magma") depends_on("superlu-dist", when="+superlu-dist+mpi") depends_on("rocsparse", when="+rocm") @@ -198,17 +199,20 @@ def url_for_version(self, version): def configure_args(self): spec = self.spec - # Note: --with-(lapack|blas)_libs= needs space separated list of names - lapack = spec["lapack"].libs - blas = spec["blas"].libs + configure_args = [f"--prefix={prefix}"] - configure_args = [ - "--prefix=%s" % prefix, - "--with-lapack-libs=%s" % " ".join(lapack.names), - "--with-lapack-lib-dirs=%s" % " ".join(lapack.directories), - "--with-blas-libs=%s" % " ".join(blas.names), - "--with-blas-lib-dirs=%s" % " ".join(blas.directories), - ] + # Note: --with-(lapack|blas)_libs= needs space separated list of names + if spec.satisfies("+lapack"): + configure_args.append("--with-lapack") + configure_args.append("--with-blas") + configure_args.append("--with-lapack-libs=%s" % " ".join(spec["lapack"].libs.names)) + configure_args.append("--with-blas-libs=%s" % " ".join(spec["blas"].libs.names)) + configure_args.append( + "--with-lapack-lib-dirs=%s" % " ".join(spec["lapack"].libs.directories) + ) + configure_args.append( + "--with-blas-lib-dirs=%s" % " ".join(spec["blas"].libs.directories) + ) if spec.satisfies("+mpi"): os.environ["CC"] = spec["mpi"].mpicc @@ -245,7 +249,9 @@ def configure_args(self): configure_args.append("--without-superlu") # MLI and FEI do not build without superlu on Linux configure_args.append("--without-mli") - configure_args.append("--without-fei") + # FEI option was removed in hypre 2.17 + if self.version < Version("2.17.0"): + configure_args.append("--without-fei") if spec.satisfies("+superlu-dist"): configure_args.append( diff --git a/var/spack/repos/builtin/packages/intel-oneapi-compilers/package.py b/var/spack/repos/builtin/packages/intel-oneapi-compilers/package.py index 73c1e89f14b9a9..e3ec31d4b01980 100644 --- a/var/spack/repos/builtin/packages/intel-oneapi-compilers/package.py +++ b/var/spack/repos/builtin/packages/intel-oneapi-compilers/package.py @@ -10,6 +10,17 @@ from spack.package import * versions = [ + { + "version": "2025.0.3", + "cpp": { + "url": "https://registrationcenter-download.intel.com/akdlm/IRC_NAS/1cac4f39-2032-4aa9-86d7-e4f3e40e4277/intel-dpcpp-cpp-compiler-2025.0.3.9_offline.sh", + "sha256": "0ca834002b9091dc9988da6798a2eb36ebc5933d8d523ed0fa78a55744c88823", + }, + "ftn": { + "url": "https://registrationcenter-download.intel.com/akdlm/IRC_NAS/fafa2df1-4bb1-43f7-87c6-3c82f1bdc712/intel-fortran-compiler-2025.0.3.9_offline.sh", + "sha256": "1ad813cf6495ded730646d6c4fd065dcc840875fdea28fcc6bac2cafb8d22c8d", + }, + }, { "version": "2025.0.1", "cpp": { diff --git a/var/spack/repos/builtin/packages/intel-oneapi-dpl/package.py b/var/spack/repos/builtin/packages/intel-oneapi-dpl/package.py index 5f0877cf0f68df..c3fa7652204219 100644 --- a/var/spack/repos/builtin/packages/intel-oneapi-dpl/package.py +++ b/var/spack/repos/builtin/packages/intel-oneapi-dpl/package.py @@ -22,6 +22,12 @@ class IntelOneapiDpl(IntelOneApiLibraryPackage): homepage = "https://github.com/oneapi-src/oneDPL" + version( + "2022.7.1", + url="https://registrationcenter-download.intel.com/akdlm/IRC_NAS/de3c613f-829c-4bdc-aa2b-6129eece3bd9/intel-onedpl-2022.7.1.15_offline.sh", + sha256="737f8d29f50fcb26abf7a39373305c177d8b91a70dbc5fed9d41aabfcc8bad5a", + expand=False, + ) version( "2022.7.0", url="https://registrationcenter-download.intel.com/akdlm/IRC_NAS/85ad74ff-f4fa-45e2-b50d-67d637d42baa/intel-onedpl-2022.7.0.647_offline.sh", diff --git a/var/spack/repos/builtin/packages/intel-oneapi-mpi/package.py b/var/spack/repos/builtin/packages/intel-oneapi-mpi/package.py index a20a1ac41cef4f..79e44436261ed0 100644 --- a/var/spack/repos/builtin/packages/intel-oneapi-mpi/package.py +++ b/var/spack/repos/builtin/packages/intel-oneapi-mpi/package.py @@ -21,6 +21,12 @@ class IntelOneapiMpi(IntelOneApiLibraryPackage): homepage = "https://software.intel.com/content/www/us/en/develop/tools/oneapi/components/mpi-library.html" + version( + "2021.14.1", + url="https://registrationcenter-download.intel.com/akdlm/IRC_NAS/1acd5e79-796c-401a-ab31-a3dc7b20c6a2/intel-mpi-2021.14.1.7_offline.sh", + sha256="6459b9fc81fad9b9955de7fd9904e67fcf2ada3564ce0a74b9c14ea8fb533ddf", + expand=False, + ) version( "2021.14.0", url="https://registrationcenter-download.intel.com/akdlm/IRC_NAS/4b14b28c-2ca6-4559-a0ca-8a157627e0c8/intel-mpi-2021.14.0.791_offline.sh", diff --git a/var/spack/repos/builtin/packages/julia/package.py b/var/spack/repos/builtin/packages/julia/package.py index 2e489bd3a211ac..6495d8ae6febda 100644 --- a/var/spack/repos/builtin/packages/julia/package.py +++ b/var/spack/repos/builtin/packages/julia/package.py @@ -250,6 +250,9 @@ class Julia(MakefilePackage): depends_on("zlib-api") depends_on("zlib +shared +pic +optimize", when="^[virtuals=zlib-api] zlib") + # https://github.com/JuliaLang/julia/pull/45649#issuecomment-1192377430 + conflicts("%gcc@12:", when="@:1.7") + # Patches for julia patch("julia-1.6-system-libwhich-and-p7zip-symlink.patch", when="@1.6.0:1.6") patch("use-add-rpath.patch", when="@:1.8.0") diff --git a/var/spack/repos/builtin/packages/kokkos-kernels/package.py b/var/spack/repos/builtin/packages/kokkos-kernels/package.py index af6abf4c11aca1..9993e8b5fe2737 100644 --- a/var/spack/repos/builtin/packages/kokkos-kernels/package.py +++ b/var/spack/repos/builtin/packages/kokkos-kernels/package.py @@ -23,6 +23,8 @@ class KokkosKernels(CMakePackage, CudaPackage): version("develop", branch="develop") version("master", branch="master") + + version("4.5.00", sha256="94726a64e349adf6cd276e9fdc1b2bf7ff81efec833e479a5d3024b83f165a59") version("4.4.01", sha256="4a32bc8330e0113856bdf181df94cc4f9902e3cebb5dc7cea5948f30df03bfa1") version("4.4.00", sha256="66d5c3f728a8c7689159c97006996164ea00fd39702476220e3dbf2a05c49e8f") @@ -132,6 +134,7 @@ class KokkosKernels(CMakePackage, CudaPackage): depends_on("kokkos") depends_on("kokkos@master", when="@master") depends_on("kokkos@develop", when="@develop") + depends_on("kokkos@4.5.00", when="@4.5.00") depends_on("kokkos@4.4.01", when="@4.4.01") depends_on("kokkos@4.4.00", when="@4.4.00") depends_on("kokkos@4.3.01", when="@4.3.01") diff --git a/var/spack/repos/builtin/packages/kokkos/package.py b/var/spack/repos/builtin/packages/kokkos/package.py index 6492906ad76aa2..6b58c7298a5797 100644 --- a/var/spack/repos/builtin/packages/kokkos/package.py +++ b/var/spack/repos/builtin/packages/kokkos/package.py @@ -29,6 +29,7 @@ class Kokkos(CMakePackage, CudaPackage, ROCmPackage): version("master", branch="master") version("develop", branch="develop") + version("4.5.00", sha256="cbfb742feeb9e649db9eca0394e6ca9a22aa017a1e6aab8576990772a0e3135b") version("4.4.01", sha256="3413f0cb39912128d91424ebd92e8832009e7eeaf6fa8da58e99b0d37860d972") version("4.4.00", sha256="0b46372f38c48aa088411ac1b7c173a5c90f0fdb69ab40271827688fc134f58b") diff --git a/var/spack/repos/builtin/packages/libseccomp/package.py b/var/spack/repos/builtin/packages/libseccomp/package.py index abe8f14a746f26..f5ec6cbefd9788 100644 --- a/var/spack/repos/builtin/packages/libseccomp/package.py +++ b/var/spack/repos/builtin/packages/libseccomp/package.py @@ -6,7 +6,7 @@ from spack.package import * -class Libseccomp(AutotoolsPackage): +class Libseccomp(AutotoolsPackage, PythonExtension): """The main libseccomp repository""" homepage = "https://github.com/seccomp/libseccomp" @@ -18,15 +18,17 @@ class Libseccomp(AutotoolsPackage): version("2.5.3", sha256="59065c8733364725e9721ba48c3a99bbc52af921daf48df4b1e012fbc7b10a76") version("2.3.3", sha256="7fc28f4294cc72e61c529bedf97e705c3acf9c479a8f1a3028d4cd2ca9f3b155") - depends_on("c", type="build") # generated + depends_on("c", type="build") variant("python", default=True, description="Build Python bindings") depends_on("gperf", type="build", when="@2.5:") - depends_on("py-cython", type="build", when="+python") + + with when("+python"): + extends("python") + depends_on("py-cython", type="build") + # https://github.com/seccomp/libseccomp/commit/afbde6ddaec7c58c3b281d43b0b287269ffca9bd + depends_on("python@:3.11", type=("run", "link", "build"), when="@:2.5.5") def configure_args(self): - args = [] - if self.spec.satisfies("+python"): - args.append("--enable-python") - return args + return self.enable_or_disable("python", variant="python") diff --git a/var/spack/repos/builtin/packages/ltr-retriever/package.py b/var/spack/repos/builtin/packages/ltr-retriever/package.py index e54698684b56b9..73f4111eef341a 100644 --- a/var/spack/repos/builtin/packages/ltr-retriever/package.py +++ b/var/spack/repos/builtin/packages/ltr-retriever/package.py @@ -3,8 +3,6 @@ # # SPDX-License-Identifier: (Apache-2.0 OR MIT) -from os import symlink - from spack.package import * @@ -42,9 +40,7 @@ def install(self, spec, prefix): "^TEsorter=.*$", "TEsorter={}".format(spec["py-tesorter"].prefix.bin), "paths" ) - mkdirp(prefix.opt) - mkdirp(prefix.bin) - - install_tree(".", prefix.opt.ltr_retriever) + install_tree(".", prefix) - symlink(prefix.opt.ltr_retriever.LTR_retriever, prefix.bin.LTR_retriever) + def setup_run_environment(self, env): + env.prepend_path("PATH", self.prefix) diff --git a/var/spack/repos/builtin/packages/mapl/package.py b/var/spack/repos/builtin/packages/mapl/package.py index bb9941f43d2461..831fcb675005ba 100644 --- a/var/spack/repos/builtin/packages/mapl/package.py +++ b/var/spack/repos/builtin/packages/mapl/package.py @@ -383,6 +383,7 @@ def cmake_args(self): # - MVAPICH --> mvapich # - HPE MPT --> mpt # - Cray MPICH --> mpich + # - HPC-X --> openmpi if self.spec.satisfies("^mpich"): args.append(self.define("MPI_STACK", "mpich")) @@ -398,6 +399,8 @@ def cmake_args(self): args.append(self.define("MPI_STACK", "mpt")) elif self.spec.satisfies("^cray-mpich"): args.append(self.define("MPI_STACK", "mpich")) + elif self.spec.satisfies("^hpcx-mpi"): + args.append(self.define("MPI_STACK", "openmpi")) else: raise InstallError("Unsupported MPI stack") diff --git a/var/spack/repos/builtin/packages/metis/no_warning.patch b/var/spack/repos/builtin/packages/metis/no_warning.patch new file mode 100644 index 00000000000000..317150ec90ea7e --- /dev/null +++ b/var/spack/repos/builtin/packages/metis/no_warning.patch @@ -0,0 +1,13 @@ +diff --git a/libmetis/pmetis.c b/libmetis/pmetis.c +index 9174aa3..f8ced79 100644 +--- a/libmetis/pmetis.c ++++ b/libmetis/pmetis.c +@@ -163,8 +163,6 @@ idx_t MlevelRecursiveBisection(ctrl_t *ctrl, graph_t *graph, idx_t nparts, + real_t wsum, *tpwgts2; + + if ((nvtxs = graph->nvtxs) == 0) { +- printf("\t***Cannot bisect a graph with 0 vertices!\n" +- "\t***You are trying to partition a graph into too many parts!\n"); + return 0; + } + diff --git a/var/spack/repos/builtin/packages/metis/package.py b/var/spack/repos/builtin/packages/metis/package.py index 4e2f6a79b24e95..ea24d4950bc183 100644 --- a/var/spack/repos/builtin/packages/metis/package.py +++ b/var/spack/repos/builtin/packages/metis/package.py @@ -34,6 +34,13 @@ class Metis(CMakePackage, MakefilePackage): depends_on("c", type="build") depends_on("cxx", type="build") + variant( + "no_warning", + default=False, + description="Disable failed partition warning print on all ranks", + ) + patch("no_warning.patch", when="@5:+no_warning") + build_system( conditional("cmake", when="@5:"), conditional("makefile", when="@:4"), default="cmake" ) diff --git a/var/spack/repos/builtin/packages/mfem/package.py b/var/spack/repos/builtin/packages/mfem/package.py index f5d564854f81c5..93692ef580a010 100644 --- a/var/spack/repos/builtin/packages/mfem/package.py +++ b/var/spack/repos/builtin/packages/mfem/package.py @@ -702,8 +702,10 @@ def find_optional_library(name, prefix): if "+mpi" in spec: options += ["MPICXX=%s" % spec["mpi"].mpicxx] hypre = spec["hypre"] - # The hypre package always links with 'blas' and 'lapack'. - all_hypre_libs = hypre.libs + hypre["lapack"].libs + hypre["blas"].libs + all_hypre_libs = hypre.libs + if "+lapack" in hypre: + all_hypre_libs += hypre["lapack"].libs + hypre["blas"].libs + hypre_gpu_libs = "" if "+cuda" in hypre: hypre_gpu_libs = " -lcusparse -lcurand -lcublas" diff --git a/var/spack/repos/builtin/packages/miopen-hip/package.py b/var/spack/repos/builtin/packages/miopen-hip/package.py index f58acb04ddf4d0..20253e16a2fc30 100644 --- a/var/spack/repos/builtin/packages/miopen-hip/package.py +++ b/var/spack/repos/builtin/packages/miopen-hip/package.py @@ -46,7 +46,8 @@ class MiopenHip(CMakePackage): conflicts("+asan", when="os=centos7") conflicts("+asan", when="os=centos8") - depends_on("cxx", type="build") # generated + depends_on("c", type="build") + depends_on("cxx", type="build") depends_on("cmake@3.5:", type="build") depends_on("pkgconfig", type="build") diff --git a/var/spack/repos/builtin/packages/mlpack/package.py b/var/spack/repos/builtin/packages/mlpack/package.py index c2ad3aa3baf595..16b133680a177d 100644 --- a/var/spack/repos/builtin/packages/mlpack/package.py +++ b/var/spack/repos/builtin/packages/mlpack/package.py @@ -65,6 +65,8 @@ class Mlpack(CMakePackage): # ref: src/mlpack/bindings/python/PythonInstall.cmake depends_on("py-pip") depends_on("py-wheel") + # ref: src/mlpack/bindings/python/setup.py.in + depends_on("py-setuptools", type="build") with when("+r"): # ref: src/mlpack/bindings/R/CMakeLists.txt depends_on("r@4.0:") diff --git a/var/spack/repos/builtin/packages/nccl/package.py b/var/spack/repos/builtin/packages/nccl/package.py index d70ee8180da804..d12a5fa4f52bb5 100644 --- a/var/spack/repos/builtin/packages/nccl/package.py +++ b/var/spack/repos/builtin/packages/nccl/package.py @@ -17,6 +17,7 @@ class Nccl(MakefilePackage, CudaPackage): maintainers("adamjstewart") libraries = ["libnccl.so"] + version("2.23.4-1", sha256="6b946b70a9d2d01871842cbd15ec56488d358abe9a0f3767e372fddc3e241ba7") version("2.22.3-1", sha256="45151629a9494460e73375281e8b0fe379141528879301899ece9b776faca024") version("2.21.5-1", sha256="1923596984d85e310b5b6c52b2c72a1b93da57218f2bc5a5c7ac3d59297a3303") version("2.20.3-1", sha256="19456bd63ca7d23a8319cbbdbaaf6c25949dd51161a9f8809f6b7453282983dd") diff --git a/var/spack/repos/builtin/packages/netlib-scalapack/package.py b/var/spack/repos/builtin/packages/netlib-scalapack/package.py index 50c1504e89b4f1..d3b978785156e1 100644 --- a/var/spack/repos/builtin/packages/netlib-scalapack/package.py +++ b/var/spack/repos/builtin/packages/netlib-scalapack/package.py @@ -92,6 +92,8 @@ def cmake_args(self): or spec.satisfies("%apple-clang") or spec.satisfies("%oneapi") or spec.satisfies("%arm") + or spec.satisfies("%cce") + or spec.satisfies("%rocmcc") ): c_flags.append("-Wno-error=implicit-function-declaration") @@ -116,6 +118,8 @@ class NetlibScalapack(ScalapackBase): git = "https://github.com/Reference-ScaLAPACK/scalapack" tags = ["e4s"] + maintainers("etiennemlb") + license("BSD-3-Clause-Open-MPI") version("2.2.0", sha256="40b9406c20735a9a3009d863318cb8d3e496fb073d201c5463df810e01ab2a57") diff --git a/var/spack/repos/builtin/packages/nghttp2/package.py b/var/spack/repos/builtin/packages/nghttp2/package.py index e1442944b4b7da..00caddbde7a193 100644 --- a/var/spack/repos/builtin/packages/nghttp2/package.py +++ b/var/spack/repos/builtin/packages/nghttp2/package.py @@ -15,6 +15,7 @@ class Nghttp2(AutotoolsPackage): license("MIT") + version("1.64.0", sha256="20e73f3cf9db3f05988996ac8b3a99ed529f4565ca91a49eb0550498e10621e8") version("1.63.0", sha256="9318a2cc00238f5dd6546212109fb833f977661321a2087f03034e25444d3dbb") version("1.62.1", sha256="d0b0b9d00500ee4aa3bfcac00145d3b1ef372fd301c35bff96cf019c739db1b4") version("1.62.0", sha256="482e41a46381d10adbdfdd44c1942ed5fd1a419e0ab6f4a5ff5b61468fe6f00d") diff --git a/var/spack/repos/builtin/packages/nim/package.py b/var/spack/repos/builtin/packages/nim/package.py index 241ec9259e264e..ee44d646844d8f 100644 --- a/var/spack/repos/builtin/packages/nim/package.py +++ b/var/spack/repos/builtin/packages/nim/package.py @@ -13,14 +13,22 @@ class Nim(Package): """ homepage = "https://nim-lang.org/" - url = "https://nim-lang.org/download/nim-1.4.4.tar.xz" + url = "https://nim-lang.org/download/nim-2.2.0.tar.xz" + git = "https://github.com/nim-lang/Nim.git" license("MIT") + version("devel", branch="devel") + version("2.2.0", sha256="ce9842849c9760e487ecdd1cdadf7c0f2844cafae605401c7c72ae257644893c") + version("2.0.12", sha256="c4887949c5eb8d7f9a9f56f0aeb2bf2140fabf0aee0f0580a319e2a09815733a") version("2.0.4", sha256="71526bd07439dc8e378fa1a6eb407eda1298f1f3d4df4476dca0e3ca3cbe3f09") version("1.9.3", sha256="d8de7515db767f853d9b44730f88ee113bfe9c38dcccd5afabc773e2e13bf87c") + version("1.6.20", sha256="ffed047504d1fcaf610f0dd7cf3e027be91a292b0c9c51161504c2f3b984ffb9") + version("1.4.8", sha256="b798c577411d7d95b8631261dbb3676e9d1afd9e36740d044966a0555b41441a") version("1.4.4", sha256="6d73729def143f72fc2491ca937a9cab86d2a8243bd845a5d1403169ad20660e") version("1.4.2", sha256="03a47583777dd81380a3407aa6a788c9aa8a67df4821025770c9ac4186291161") + version("1.2.18", sha256="a1739185508876f6e21a13f590a20e219ce3eec1b0583ea745e9058c37ad833e") + version("1.0.10", sha256="28045fb6dcd86bd79748ead7874482d665ca25edca68f63d6cebc925b1428da5") version( "0.20.0", sha256="51f479b831e87b9539f7264082bb6a64641802b54d2691b3c6e68ac7e2699a90", @@ -44,21 +52,39 @@ class Nim(Package): depends_on("pcre") depends_on("openssl") - def patch(self): - install_sh_path = join_path(self.stage.source_path, "install.sh") - filter_file("1/nim", "1", install_sh_path) + resource( + name="csources_v2", + git="https://github.com/nim-lang/csources_v2.git", + commit="86742fb02c6606ab01a532a0085784effb2e753e", + when="@devel", + ) - def install(self, spec, prefix): + phases = ["build", "install"] + + def build(self, spec, prefix): bash = which("bash") - bash("./build.sh") + if spec.satisfies("@devel"): + with working_dir("csources_v2"): + bash("./build.sh") + else: + bash("./build.sh") nim = Executable(join_path("bin", "nim")) - nim("c", "koch") + # Separate nimcache allows parallel compilation of different versions of the Nim compiler + nim_flags = ["--skipUserCfg", "--skipParentCfg", "--nimcache:nimcache"] + nim("c", *nim_flags, "koch") koch = Executable("./koch") - koch("boot", "-d:release") - koch("tools") - koch("nimble") + koch("boot", "-d:release", *nim_flags) + koch("tools", *nim_flags) + + if spec.satisfies("@devel"): + koch("geninstall") + def install(self, spec, prefix): + filter_file("1/nim", "1", "install.sh") + + bash = which("bash") bash("./install.sh", prefix) - install(join_path("bin", "nimble"), join_path(prefix, "bin")) + + install_tree("bin", prefix.bin) diff --git a/var/spack/repos/builtin/packages/nwchem/dft-d3_url.patch b/var/spack/repos/builtin/packages/nwchem/dft-d3_url.patch deleted file mode 100644 index 66d8508823e5df..00000000000000 --- a/var/spack/repos/builtin/packages/nwchem/dft-d3_url.patch +++ /dev/null @@ -1,13 +0,0 @@ ---- a/src/nwpw/nwpwlib/nwpwxc/build_dftd3a.sh -+++ b/src/nwpw/nwpwlib/nwpwxc/build_dftd3a.sh -@@ -42,8 +42,8 @@ - check_patch - rm -f dftd3.f nwpwxc_vdw3a.F - export PATH=`pwd`:$PATH --#URL1="https://www.chemie.uni-bonn.de/pctc/mulliken-center/software/dft-d3/" --URL1="https://www.chemiebn.uni-bonn.de/pctc/mulliken-center/software/dft-d3/" -+URL1="https://www.chemie.uni-bonn.de/grimme/de/software/dft-d3/" -+#URL1="https://www.chemiebn.uni-bonn.de/pctc/mulliken-center/software/dft-d3/" - URL2="https://web.archive.org/web/20210527062154if_/https://www.chemie.uni-bonn.de/pctc/mulliken-center/software/dft-d3/" - declare -a urls=("$URL1" "$URL1" "$URL1" "$URL2" "$URL2") - TGZ=dftd3.tgz diff --git a/var/spack/repos/builtin/packages/nwchem/package.py b/var/spack/repos/builtin/packages/nwchem/package.py index a3882f55f12bbe..b7d075b8c516d1 100644 --- a/var/spack/repos/builtin/packages/nwchem/package.py +++ b/var/spack/repos/builtin/packages/nwchem/package.py @@ -41,9 +41,14 @@ class Nwchem(Package): url="https://github.com/nwchemgit/nwchem/releases/download/v7.0.2-release/nwchem-7.0.2-release.revision-b9985dfa-srconly.2020-10-12.tar.bz2", ) - depends_on("c", type="build") # generated - depends_on("cxx", type="build") # generated - depends_on("fortran", type="build") # generated + resource( + name="dftd3.tgz", + url="https://www.chemie.uni-bonn.de/grimme/de/software/dft-d3/dftd3.tgz", + destination="", + placement="dft-d3", + sha256="d97cf9758f61aa81fd85425448fbf4a6e8ce07c12e9236739831a3af32880f59", + expand=False, + ) variant("openmp", default=False, description="Enables OpenMP support") variant("f90allocatable", default=False, description="Use F90 allocatable instead of MA") @@ -80,10 +85,10 @@ class Nwchem(Package): # https://github.com/nwchemgit/nwchem/commit/c89fc9d1eca6689bce12564a63fdea95d962a123 # Prior versions of NWChem, including 7.0.2, were not able to link with FFTW patch("fftw_splans.patch", when="@7.2.0:7.2.3 +fftw3") - # This patch is for including a working link for dft-d3 download as existing link - # https://www.chemiebn.uni-bonn.de/pctc/mulliken-center/software/dft-d3//dftd3.tgz is not active - # Same is mentioned in https://metadata.ftp-master.debian.org/changelogs/main/n/nwchem/unstable_changelog - patch("dft-d3_url.patch", when="@7.2.0:7.2.2") + + depends_on("c", type="build") + depends_on("cxx", type="build") + depends_on("fortran", type="build") depends_on("blas") depends_on("lapack") @@ -96,10 +101,18 @@ class Nwchem(Package): depends_on("fftw-api@3", when="+fftw3") depends_on("libxc", when="+libxc") depends_on("elpa", when="+elpa") - depends_on("python@3:3.9", type=("build", "link", "run"), when="@:7.0.2") + depends_on("python@:3.9", type=("build", "link", "run"), when="@:7.0.2") depends_on("python@3", type=("build", "link", "run"), when="@7.2.0:") + depends_on("gmake", type="build") + # for the dftd3 resource (bash is also required, not listed here) + depends_on("tar", type="build") + depends_on("patch", type="build") + def install(self, spec, prefix): + # move the dft-d3/dftd3.tgz resource + os.rename("dft-d3/dftd3.tgz", "src/nwpw/nwpwlib/nwpwxc/dftd3.tgz") + scalapack = spec["scalapack"].libs lapack = spec["lapack"].libs blas = spec["blas"].libs diff --git a/var/spack/repos/builtin/packages/oneapi-level-zero/package.py b/var/spack/repos/builtin/packages/oneapi-level-zero/package.py index 97b67e065e3f8e..4062244e1341ca 100644 --- a/var/spack/repos/builtin/packages/oneapi-level-zero/package.py +++ b/var/spack/repos/builtin/packages/oneapi-level-zero/package.py @@ -61,4 +61,5 @@ class OneapiLevelZero(CMakePackage): version("1.3.6", sha256="c2b3bd6e4ee3cc874bdcc32bc8705bd217ffc46b194c77e27b23b8391c0c9704") version("1.2.3", sha256="69689429fcdaef74fa8395785aca65f5652e410bd6c56f47b2b64692c098892b") - depends_on("cxx", type="build") # generated + depends_on("c", type="build") + depends_on("cxx", type="build") diff --git a/var/spack/repos/builtin/packages/onnx/package.py b/var/spack/repos/builtin/packages/onnx/package.py index ec9602c14befbe..d3f764786adf31 100644 --- a/var/spack/repos/builtin/packages/onnx/package.py +++ b/var/spack/repos/builtin/packages/onnx/package.py @@ -71,7 +71,9 @@ class Onnx(CMakePackage): def patch(self): if self.spec.satisfies("@1.13:1.14 ^protobuf@3.22:"): - filter_file("CMAKE_CXX_STANDARD 11", "CMAKE_CXX_STANDARD 14", "CMakeLists.txt") + # CMAKE_CXX_STANDARD is overridden in CMakeLists.txt until 1.14 + cxxstd = self.spec["abseil-cpp"].variants["cxxstd"].value + filter_file("CMAKE_CXX_STANDARD 11", f"CMAKE_CXX_STANDARD {cxxstd}", "CMakeLists.txt") def cmake_args(self): args = [ @@ -79,4 +81,8 @@ def cmake_args(self): self.define("PY_VERSION", self.spec["python"].version.up_to(2)), self.define("ONNX_BUILD_TESTS", self.run_tests), ] + if self.spec.satisfies("@1.15: ^protobuf@3.22:"): + # CMAKE_CXX_STANDARD can be set on command line as of 1.15 + cxxstd = self.spec["abseil-cpp"].variants["cxxstd"].value + args.append(self.define("CMAKE_CXX_STANDARD", cxxstd)) return args diff --git a/var/spack/repos/builtin/packages/openscenegraph/package.py b/var/spack/repos/builtin/packages/openscenegraph/package.py index 9d257c5c71ba72..ed8cd8af661f96 100644 --- a/var/spack/repos/builtin/packages/openscenegraph/package.py +++ b/var/spack/repos/builtin/packages/openscenegraph/package.py @@ -58,8 +58,8 @@ class Openscenegraph(CMakePackage): ) # Qt windowing system was moved into separate osgQt project depends_on("qt@4:", when="@3.2:3.5.4") depends_on("qt@:4", when="@:3.1") - depends_on("libxinerama") - depends_on("libxrandr") + depends_on("libxinerama", when="platform=linux") + depends_on("libxrandr", when="platform=linux") depends_on("libpng") depends_on("jasper") depends_on("libtiff") diff --git a/var/spack/repos/builtin/packages/petsc/package.py b/var/spack/repos/builtin/packages/petsc/package.py index 9d983d254f34d4..da0e3d0be3c7d6 100644 --- a/var/spack/repos/builtin/packages/petsc/package.py +++ b/var/spack/repos/builtin/packages/petsc/package.py @@ -23,6 +23,7 @@ class Petsc(Package, CudaPackage, ROCmPackage): tags = ["e4s"] version("main", branch="main") + version("3.22.2", sha256="83624de0178b42d37ca1f7f905e1093556c6919fe5accd3e9f11d00a66e11256") version("3.22.1", sha256="7117d3ae6827f681ed9737939d4e86896b4751e27cca941bb07e5703f19a0a7b") version("3.22.0", sha256="2c03f7c0f7ad2649240d4989355cf7fb7f211b75156cd7d424e1d9dd7dfb290b") version("3.21.6", sha256="cb2dc00742a89cf8acf9ff8aae189e6864e8b90f4997f087be6e54ff39c30d74") @@ -376,6 +377,8 @@ def check_fortran_compiler(self): depends_on("kokkos", when="+kokkos") depends_on("kokkos~complex_align", when="+kokkos+complex") depends_on("kokkos-kernels", when="+kokkos") + conflicts("kokkos@4.5:", when="@:3.22") + conflicts("kokkos-kernels@4.5:", when="@:3.22") for cuda_arch in CudaPackage.cuda_arch_values: depends_on( "kokkos+cuda+cuda_lambda cuda_arch=%s" % cuda_arch, diff --git a/var/spack/repos/builtin/packages/py-joblib/package.py b/var/spack/repos/builtin/packages/py-joblib/package.py index 4e85d0030b0177..9c02f5e9221c3f 100644 --- a/var/spack/repos/builtin/packages/py-joblib/package.py +++ b/var/spack/repos/builtin/packages/py-joblib/package.py @@ -19,6 +19,7 @@ class PyJoblib(PythonPackage): license("BSD-3-Clause") + version("1.4.2", sha256="2382c5816b2636fbd20a09e0f4e9dad4736765fdfb7dca582943b9c1366b3f0e") version("1.2.0", sha256="e1cee4a79e4af22881164f218d4311f60074197fb707e082e803b61f6d137018") version("1.1.0", sha256="4158fcecd13733f8be669be0683b96ebdbbd38d23559f54dca7205aea1bf1e35") version("1.0.1", sha256="9c17567692206d2f3fb9ecf5e991084254fe631665c450b443761c4186a613f7") @@ -35,7 +36,10 @@ class PyJoblib(PythonPackage): version("0.10.2", sha256="3123553bdad83b143428033537c9e1939caf4a4d8813dade6a2246948c94494b") version("0.10.0", sha256="49b3a0ba956eaa2f077e1ebd230b3c8d7b98afc67520207ada20a4d8b8efd071") - depends_on("python@3.7:", when="@1.2:", type=("build", "run")) - depends_on("python@3.6:", when="@0.15:", type=("build", "run")) - depends_on("python@2.7:2.8,3.4:", type=("build", "run")) - depends_on("py-setuptools", type=("build", "run")) + with default_args(type=("build", "run")): + # https://github.com/joblib/joblib/pull/1361 + depends_on("python@:3.11", when="@:1.2") + + with default_args(type="build"): + depends_on("py-setuptools@61.2:", when="@1.4:") + depends_on("py-setuptools") diff --git a/var/spack/repos/builtin/packages/py-keras/package.py b/var/spack/repos/builtin/packages/py-keras/package.py index c4c5aa558574f3..4edf51a82e6d05 100644 --- a/var/spack/repos/builtin/packages/py-keras/package.py +++ b/var/spack/repos/builtin/packages/py-keras/package.py @@ -23,6 +23,7 @@ class PyKeras(PythonPackage): maintainers("adamjstewart") license("Apache-2.0") + version("3.7.0", sha256="a4451a5591e75dfb414d0b84a3fd2fb9c0240cc87ebe7e397f547ce10b0e67b7") version("3.6.0", sha256="405727525a3522ed8f9ec0b46e0667e4c65fcf714a067322c16a00d902ded41d") version("3.5.0", sha256="53ae4f9472ec9d9c6941c82a3fda86969724ace3b7630a94ba0a1f17ba1065c3") version("3.4.1", sha256="34cd9aeaa008914715149234c215657ca758e1b473bd2aab2e211ac967d1f8fe") @@ -74,10 +75,12 @@ class PyKeras(PythonPackage): ) with default_args(type="build"): + # pyproject.toml + depends_on("py-setuptools@61:", when="@3.7:") depends_on("py-setuptools") with default_args(type=("build", "run")): - # setup.py + # pyproject.toml depends_on("python@3.9:", when="@3:") depends_on("python@3.8:", when="@2.12:") depends_on("py-absl-py", when="@2.6:") @@ -98,7 +101,8 @@ class PyKeras(PythonPackage): # requirements-tensorflow-cuda.txt with when("backend=tensorflow"): - depends_on("py-tensorflow@2.17", when="@3.5:") + depends_on("py-tensorflow@2.18", when="@3.7:") + depends_on("py-tensorflow@2.17", when="@3.5:3.6") depends_on("py-tensorflow@2.16.1:2.16", when="@3.0:3.4") # requirements-jax-cuda.txt @@ -109,13 +113,15 @@ class PyKeras(PythonPackage): # requirements-torch-cuda.txt with when("backend=torch"): - depends_on("py-torch@2.4.1", when="@3.6:") + depends_on("py-torch@2.5.1", when="@3.7:") + depends_on("py-torch@2.4.1", when="@3.6") depends_on("py-torch@2.4.0", when="@3.5") depends_on("py-torch@2.2.1", when="@3.1:3.4") depends_on("py-torch@2.1.2", when="@3.0.3:3.0.5") depends_on("py-torch@2.1.1", when="@3.0.1:3.0.2") depends_on("py-torch@2.1.0", when="@3.0.0") - depends_on("py-torchvision@0.19.1", when="@3.6:") + depends_on("py-torchvision@0.20.1", when="@3.7:") + depends_on("py-torchvision@0.19.1", when="@3.6") depends_on("py-torchvision@0.19.0", when="@3.5") depends_on("py-torchvision@0.17.1", when="@3.1:3.4") depends_on("py-torchvision@0.16.2", when="@3.0.3:3.0.5") diff --git a/var/spack/repos/builtin/packages/py-mpi4py/package.py b/var/spack/repos/builtin/packages/py-mpi4py/package.py index c447e700a142de..430e32c57b65c9 100644 --- a/var/spack/repos/builtin/packages/py-mpi4py/package.py +++ b/var/spack/repos/builtin/packages/py-mpi4py/package.py @@ -2,6 +2,7 @@ # Spack Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) +import os from spack.package import * @@ -50,3 +51,35 @@ def setup_build_environment(self, env): def cythonize(self): with working_dir(self.build_directory): python(join_path("conf", "cythonize.py")) + + def create_mpi_config_file(self, cfg_fn): + """ + create mpi.cfg file introduced since version 4.0.0. + see https://mpi4py.readthedocs.io/en/stable/mpi4py.html#mpi4py.get_config + """ + mpi_spec = self.spec["mpi"] + include_dirs = mpi_spec.headers.directories + library_dirs = mpi_spec.libs.directories + with open(cfg_fn, "w") as cfg: + cfg.write("[mpi]\n") + cfg.write("mpi_dir = {}\n".format(mpi_spec.prefix)) + cfg.write("mpicc = {}\n".format(mpi_spec.mpicc)) + cfg.write("mpicxx = {}\n".format(mpi_spec.mpicxx)) + cfg.write("\n") + cfg.write("## define_macros =\n") + cfg.write("## undef_macros =\n") + cfg.write("include_dirs = {}\n".format(include_dirs)) + cfg.write("## libraries = mpi\n") + cfg.write("library_dirs = {}\n".format(library_dirs)) + cfg.write("## runtime_library_dirs = %(mpi_dir)s/lib\n") + cfg.write("\n") + cfg.write("## extra_compile_args =\n") + cfg.write("## extra_link_args =\n") + cfg.write("## extra_objects =\n") + + @run_after("install", when="@4:") + def install_cfg(self): + python_dir = join_path(self.prefix, python_platlib, "mpi4py") + cfg_fn = join_path(python_dir, "mpi.cfg") + if not os.path.isfile(cfg_fn): + self.create_mpi_config_file(cfg_fn) diff --git a/var/spack/repos/builtin/packages/py-nbdime/package.py b/var/spack/repos/builtin/packages/py-nbdime/package.py index deb6039b930aa8..e4e25dd827042a 100644 --- a/var/spack/repos/builtin/packages/py-nbdime/package.py +++ b/var/spack/repos/builtin/packages/py-nbdime/package.py @@ -12,7 +12,10 @@ class PyNbdime(PythonPackage): homepage = "https://nbdime.readthedocs.io/" pypi = "nbdime/nbdime-3.1.1.tar.gz" - version("3.1.1", sha256="67767320e971374f701a175aa59abd3a554723039d39fae908e72d16330d648b") + version("3.2.1", sha256="31409a30f848ffc6b32540697e82d5a0a1b84dcc32716ca74e78bcc4b457c453") + with default_args(deprecated=True): + # https://nvd.nist.gov/vuln/detail/CVE-2021-41134 + version("3.1.1", sha256="67767320e971374f701a175aa59abd3a554723039d39fae908e72d16330d648b") depends_on("python@3.6:", type=("build", "run")) depends_on("py-setuptools@40.8.0:", type="build") diff --git a/var/spack/repos/builtin/packages/py-nugraph/package.py b/var/spack/repos/builtin/packages/py-nugraph/package.py index 83b14447a26412..e1e7852a3ccd5e 100644 --- a/var/spack/repos/builtin/packages/py-nugraph/package.py +++ b/var/spack/repos/builtin/packages/py-nugraph/package.py @@ -9,19 +9,22 @@ class PyNugraph(PythonPackage): """Graph Neural Network for neutrino physics event reconstruction""" - pypi = "nugraph/nugraph-24.7.1.tar.gz" + homepage = "https://github.com/nugraph/nugraph" + git = "https://github.com/nugraph/nugraph" + url = "https://github.com/nugraph/nugraph/archive/v24.7.1.tar.gz" + build_directory = "nugraph" maintainers("vhewes") license("MIT", checked_by="vhewes") - version("24.7.1", sha256="e1449e4a37049cc774ad026d4f2db339eb60bb59109a11920bb65a4061915de8") - version("24.7.0", sha256="b95d93a1cbcd280a3529ce4782ef778b982d9d4edcc19f522442c38144895f65") - version("24.4.0", sha256="5f888d065819b1ec7c33e7f829ad65eb963db2cf109a5d31b4caef49c004f86f") - version("24.2.0", sha256="4765ea73b384e95a38a598499e77d805541e415049da9f6f46193f8bc281208a") - version("23.11.1", sha256="b160996fca9615b2c7e6ed02fb780af5edaa97f6cdafd45abdf65ea0c7a6f2ca") - version("23.11.0", sha256="a1e01a8c3143fc8db2cf8a3584d192a738d89eb865b1d52cd2994b24bd4175ec") - version("23.10.0", sha256="8a0219318c6bd6d0d240e419ef88cdedd7e944276f0cce430d9ece423e06f1b8") + version("main", branch="main") + version("24.7.1", sha256="a51c0576ab969c404024b734e5507712e5a9d1d29e14077fee121415779c78f0") + version("24.7.0", sha256="7e44fbc1eb75a9302d57cabfffd559ddaddb44d0b7198168cbacbeed5e11dd7e") + version("24.4.0", sha256="927da53b28630921d31ca3b71676ef392b9ff847796b76d593239c6af9276b4c") + version("24.2.0", sha256="6ff9204bc0817619e7317e7a0d7ddfbea1842b261938f1718c3949539c8719df") + version("23.11.0", sha256="db77e0c723caf4ac9fb5c41d250aee1d03e623e861c73120b23aff194902bf09") + version("23.10.0", sha256="ee36625d5215406a199420d8fa262b720c5d191c0346d2b4aaab6808b47e80ad") depends_on("py-flit-core", type="build") diff --git a/var/spack/repos/builtin/packages/py-numl/package.py b/var/spack/repos/builtin/packages/py-numl/package.py index 1c61a9d53eb0b1..af7e003e925f45 100644 --- a/var/spack/repos/builtin/packages/py-numl/package.py +++ b/var/spack/repos/builtin/packages/py-numl/package.py @@ -9,24 +9,26 @@ class PyNuml(PythonPackage): """Standardised ML input processing for particle physics""" - pypi = "pynuml/pynuml-24.7.1.tar.gz" + homepage = "https://github.com/nugraph/nugraph" + git = "https://github.com/nugraph/nugraph" + url = "https://github.com/nugraph/nugraph/archive/v24.7.1.tar.gz" + build_directory = "pynuml" maintainers("vhewes") license("MIT", checked_by="vhewes") - version("24.7.1", sha256="20d2f1a07887473e67c79ecc3804b8012e22b78883199fdb0d07bb1b725b6ab0") - version("24.7.0", sha256="d47f71ead6861278595b79d04c554da4998d5c4c50587e4c90231f50db0f2e81") - version("24.6.0", sha256="357d2b0e0b9ca179514d177278620e5ac57bed37bfb6d145c172150126432613") - version("23.11.0", sha256="1a7e61864cfeb0b27c6a93646c33e3f457bbc384eb86aee4df76b5e02898d02f") - version("23.9.0", sha256="77ea8c9df541351adeb249594cce27d742973ee82a0d7f2ad8cdcffa9d3fa6b1") - version("23.8.0", sha256="0896797f3f70b3a6d3d74f7a3e7fe5eaf59a2000a47ffc7ac08b73be0aa15706") - version("23.7.0", sha256="5449dd09a7e046d036e12c7971e61d2862cdb79c7932144b038288fc05ca50a8") - version("23.6.1", sha256="fdb23a9d4f1b83b06cc35b07608fe4c2e55f8307ac47851cccc21a20b69ab674") - version("23.6.0", sha256="fcc1546b9489584f2635f6418c5e1a43f6bdf02dd5c46b7afa09ea5f247524a2") - version("23.5.2", sha256="d83576c8e25e22cc9ba68a35b9690ea861f7a4c09db65ca134849c89fba9b330") - version("23.5.1", sha256="73ef1bea1022b9ebddec35ac7d66c1394003aa5e63a4ec99bfa14d4f833e04a4") - version("23.5.0", sha256="dccb774932813ddc788b1d27e52e251d9db6ea16b303596bfa0955ae51098674") + version("main", branch="main") + version("24.7.1", sha256="a51c0576ab969c404024b734e5507712e5a9d1d29e14077fee121415779c78f0") + version("24.7.0", sha256="7e44fbc1eb75a9302d57cabfffd559ddaddb44d0b7198168cbacbeed5e11dd7e") + version("24.4.0", sha256="927da53b28630921d31ca3b71676ef392b9ff847796b76d593239c6af9276b4c") + version("24.2.0", sha256="6ff9204bc0817619e7317e7a0d7ddfbea1842b261938f1718c3949539c8719df") + version("23.11.0", sha256="db77e0c723caf4ac9fb5c41d250aee1d03e623e861c73120b23aff194902bf09") + version("23.10.0", sha256="ee36625d5215406a199420d8fa262b720c5d191c0346d2b4aaab6808b47e80ad") + version("23.9.0", sha256="2cc77356a1061b7271c3c5da69009f0d2ef0df09a18ab6466049ea901231909c") + version("23.7.0", sha256="8598f65b7fcc76fc3f0f41f7ca44bfb134daa627693f1ada61c8106b26db4d84") + version("23.6.1", sha256="74c41b34eba1d80548a0ec1b36aee5948f3ee0e9df80d6864b38aed99964263c") + version("23.6.0", sha256="93ebbaf0a55e22d06fc06e8a93e29a0e875985f4b3801d391db853d1fceb3d6c") depends_on("py-flit-core", type="build") diff --git a/var/spack/repos/builtin/packages/py-pandas/package.py b/var/spack/repos/builtin/packages/py-pandas/package.py index 4ded508d748b9a..eade1219c2e36e 100644 --- a/var/spack/repos/builtin/packages/py-pandas/package.py +++ b/var/spack/repos/builtin/packages/py-pandas/package.py @@ -73,6 +73,7 @@ class PyPandas(PythonPackage): variant("excel", when="@1.4:", default=False, description="Build with support for Excel") depends_on("c", type="build") + depends_on("cxx", type="build") with default_args(type="build"): depends_on("py-meson-python@0.13.1:", when="@2.1:") diff --git a/var/spack/repos/builtin/packages/py-petsc4py/package.py b/var/spack/repos/builtin/packages/py-petsc4py/package.py index df4522dabc399c..16f6ac35cb8611 100644 --- a/var/spack/repos/builtin/packages/py-petsc4py/package.py +++ b/var/spack/repos/builtin/packages/py-petsc4py/package.py @@ -20,6 +20,7 @@ class PyPetsc4py(PythonPackage): license("BSD-2-Clause") version("main", branch="main") + version("3.22.2", sha256="6c56f62ae8819069062436d362a2cc7e44f700026eed72a903c3803afbe59fc3") version("3.22.1", sha256="a7fd321458b72356e46c4bc5bd93d173c9c2f91018cf21f614a631fe2aa6466a") version("3.22.0", sha256="b35fc833d41c7969be8a530494fcc81741d77e0dc33fba2f4050cdbd0ad881ae") version("3.21.6", sha256="d7a6d41e1463b04b9711b53b347d15f590f9354fae37aae14ad69100286129aa") diff --git a/var/spack/repos/builtin/packages/py-pip/package.py b/var/spack/repos/builtin/packages/py-pip/package.py index 7f63c25837bd3e..467ccf4c0d78fa 100644 --- a/var/spack/repos/builtin/packages/py-pip/package.py +++ b/var/spack/repos/builtin/packages/py-pip/package.py @@ -25,6 +25,12 @@ class PyPip(Package, PythonExtension): license("MIT") + version("24.3.1", sha256="3790624780082365f47549d032f3770eeb2b1e8bd1f7b2e02dace1afa361b4ed") + version("24.2", sha256="2cd581cf58ab7fcfca4ce8efa6dcacd0de5bf8d0a3eb9ec927e07405f4d9e2a2") + version("24.1.2", sha256="7cd207eed4c60b0f411b444cd1464198fe186671c323b6cd6d433ed80fc9d247") + version("24.0", sha256="ba0d021a166865d2265246961bec0152ff124de910c5cc39f1156ce3fa7c69dc") + version("23.3.2", sha256="5052d7889c1f9d05224cd41741acb7c5d6fa735ab34e339624a614eaaa7e7d76") + version("23.2.1", sha256="7ccf472345f20d35bdc9d1841ff5f313260c2c33fe417f48c30ac46cccabf5be") version("23.1.2", sha256="3ef6ac33239e4027d9a5598a381b9d30880a1477e50039db2eac6e8a8f6d1b18") version("23.0", sha256="b5f88adff801f5ef052bcdef3daa31b55eb67b0fccd6d0106c206fa248e0463c") version("22.2.2", sha256="b61a374b5bc40a6e982426aede40c9b5a08ff20e640f5b56977f4f91fed1e39a") @@ -40,6 +46,7 @@ class PyPip(Package, PythonExtension): version("9.0.1", sha256="690b762c0a8460c303c089d5d0be034fb15a5ea2b75bdf565f40421f542fefb0") extends("python") + depends_on("python@3.8:", when="@24.1:", type=("build", "run")) depends_on("python@3.7:", when="@22:", type=("build", "run")) # Uses collections.MutableMapping diff --git a/var/spack/repos/builtin/packages/py-pyvista/package.py b/var/spack/repos/builtin/packages/py-pyvista/package.py index 358e417dffb5d7..9b6342334338fe 100644 --- a/var/spack/repos/builtin/packages/py-pyvista/package.py +++ b/var/spack/repos/builtin/packages/py-pyvista/package.py @@ -33,7 +33,8 @@ class PyPyvista(PythonPackage): depends_on("pil", type=("build", "run")) depends_on("py-pooch", when="@0.37:", type=("build", "run")) depends_on("py-scooby@0.5.1:", type=("build", "run")) - depends_on("vtk+python", type=("build", "run")) + # https://github.com/pyvista/pyvista/issues/6857 + depends_on("vtk@:9.3+python", type=("build", "run")) depends_on("py-typing-extensions", when="^python@:3.7", type=("build", "run")) # Historical dependencies diff --git a/var/spack/repos/builtin/packages/py-rasterio/package.py b/var/spack/repos/builtin/packages/py-rasterio/package.py index 222f6d5109e49f..4362ee17d8703f 100644 --- a/var/spack/repos/builtin/packages/py-rasterio/package.py +++ b/var/spack/repos/builtin/packages/py-rasterio/package.py @@ -22,6 +22,7 @@ class PyRasterio(PythonPackage): version("main", branch="main") version("master", branch="master", deprecated=True) + version("1.4.3", sha256="201f05dbc7c4739dacb2c78a1cf4e09c0b7265b0a4d16ccbd1753ce4f2af350a") version("1.4.2", sha256="1be35ccb4d998a4c48fa51bbee9e37927ecd9b9e954a2b2581b8f3e9bb165332") version("1.4.1", sha256="d750362bb792d2311f94803ff309baec48486ecba75c9b905ea9b1f5eb06ef9f") version("1.4.0", sha256="e0d2ff540a4e06016cca2fb46691a10afe71343ea998c50ad8247bb125542133") diff --git a/var/spack/repos/builtin/packages/py-river/package.py b/var/spack/repos/builtin/packages/py-river/package.py index 26eac0748ed8a0..973411a1dda531 100644 --- a/var/spack/repos/builtin/packages/py-river/package.py +++ b/var/spack/repos/builtin/packages/py-river/package.py @@ -30,3 +30,6 @@ class PyRiver(PythonPackage): depends_on("py-numpy@1.22:", type=("build", "run")) depends_on("py-scipy@1.5:", type=("build", "run")) depends_on("py-pandas@1.3:", type=("build", "run")) + + # https://github.com/online-ml/river/pull/1632 + depends_on("py-numpy@:1", when="@:0.21", type=("build", "run")) diff --git a/var/spack/repos/builtin/packages/py-ruff/package.py b/var/spack/repos/builtin/packages/py-ruff/package.py index 81781a04b5ecfa..33c9ef094cf105 100644 --- a/var/spack/repos/builtin/packages/py-ruff/package.py +++ b/var/spack/repos/builtin/packages/py-ruff/package.py @@ -16,6 +16,7 @@ class PyRuff(PythonPackage): license("MIT") maintainers("adamjstewart") + version("0.8.1", sha256="3583db9a6450364ed5ca3f3b4225958b24f78178908d5c4bc0f46251ccca898f") version("0.8.0", sha256="a7ccfe6331bf8c8dad715753e157457faf7351c2b69f62f32c165c2dbcbacd44") version("0.6.5", sha256="4d32d87fab433c0cf285c3683dd4dae63be05fd7a1d65b3f5bf7cdd05a6b96fb") version("0.5.7", sha256="8dfc0a458797f5d9fb622dd0efc52d796f23f0a1493a9527f4e49a550ae9a7e5") diff --git a/var/spack/repos/builtin/packages/py-scooby/package.py b/var/spack/repos/builtin/packages/py-scooby/package.py index 282153cbec62ee..2651f0987d11a6 100644 --- a/var/spack/repos/builtin/packages/py-scooby/package.py +++ b/var/spack/repos/builtin/packages/py-scooby/package.py @@ -14,6 +14,10 @@ class PyScooby(PythonPackage): license("MIT") + version("0.10.0", sha256="7ea33c262c0cc6a33c6eeeb5648df787be4f22660e53c114e5fff1b811a8854f") version("0.5.7", sha256="ae2c2b6f5f5d10adf7aaab32409028f1e28d3ce833664bdd1e8c2072e8da169a") + # https://github.com/banesullivan/scooby/pull/83 + depends_on("python@:3.11", when="@:0.5", type=("build", "run")) depends_on("py-setuptools", type="build") + depends_on("py-setuptools-scm", when="@0.10:", type="build") diff --git a/var/spack/repos/builtin/packages/py-slepc4py/package.py b/var/spack/repos/builtin/packages/py-slepc4py/package.py index 41d65e294e4504..889072dc762f22 100644 --- a/var/spack/repos/builtin/packages/py-slepc4py/package.py +++ b/var/spack/repos/builtin/packages/py-slepc4py/package.py @@ -18,6 +18,7 @@ class PySlepc4py(PythonPackage): license("BSD-2-Clause") version("main", branch="main") + version("3.22.2", sha256="bd34d5560a36bafd81a0f071aca03a9fac140c6167b1b8a2f2e580b69a2a3255") version("3.22.1", sha256="056d98bf09f5202d25842d5a4a4f553445103e1e26155da52f007c508f3140f8") version("3.22.0", sha256="53db52a72e126787768732790ca73dbc6ff6e49d4d1152e9c3641ba71b97738e") version("3.21.2", sha256="f611ff74e4749f21445b2369dbd0edf404cdf639eecafd54187d0a2865d521a0") diff --git a/var/spack/repos/builtin/packages/py-torch-cluster/package.py b/var/spack/repos/builtin/packages/py-torch-cluster/package.py index 2843481d150af5..4957e6d52984bd 100644 --- a/var/spack/repos/builtin/packages/py-torch-cluster/package.py +++ b/var/spack/repos/builtin/packages/py-torch-cluster/package.py @@ -18,7 +18,8 @@ class PyTorchCluster(PythonPackage): version("1.6.3", sha256="78d5a930a5bbd0d8788df8c6d66addd68d6dd292fe3edb401e3dacba26308152") - depends_on("cxx", type="build") # generated + depends_on("c", type="build") + depends_on("cxx", type="build") depends_on("python", type=("build", "link", "run")) depends_on("py-setuptools", type="build") diff --git a/var/spack/repos/builtin/packages/py-torch-nvidia-apex/package.py b/var/spack/repos/builtin/packages/py-torch-nvidia-apex/package.py index a0ca87cd8b725a..a145e1b3ad4f82 100644 --- a/var/spack/repos/builtin/packages/py-torch-nvidia-apex/package.py +++ b/var/spack/repos/builtin/packages/py-torch-nvidia-apex/package.py @@ -26,6 +26,7 @@ class PyTorchNvidiaApex(PythonPackage, CudaPackage): version("22.03", tag="22.03") version("2020-10-19", commit="8a1ed9e8d35dfad26fb973996319965e4224dcdd") + depends_on("c", type="build") depends_on("cxx", type="build") variant("cuda", default=True, description="Build with CUDA") diff --git a/var/spack/repos/builtin/packages/py-torch-scatter/package.py b/var/spack/repos/builtin/packages/py-torch-scatter/package.py index 0e9589618d3fff..1ee6e2a69785b2 100644 --- a/var/spack/repos/builtin/packages/py-torch-scatter/package.py +++ b/var/spack/repos/builtin/packages/py-torch-scatter/package.py @@ -18,7 +18,8 @@ class PyTorchScatter(PythonPackage): version("2.1.2", sha256="69b3aa435f2424ac6a1bfb6ff702da6eb73b33ca0db38fb26989c74159258e47") - depends_on("cxx", type="build") # generated + depends_on("c", type="build") + depends_on("cxx", type="build") depends_on("python", type=("build", "link", "run")) depends_on("py-setuptools", type="build") diff --git a/var/spack/repos/builtin/packages/py-torch-sparse/package.py b/var/spack/repos/builtin/packages/py-torch-sparse/package.py index c05ce351095153..eaa3e13bfac161 100644 --- a/var/spack/repos/builtin/packages/py-torch-sparse/package.py +++ b/var/spack/repos/builtin/packages/py-torch-sparse/package.py @@ -21,7 +21,8 @@ class PyTorchSparse(PythonPackage): version("0.6.8", sha256="312fb5ae6e4e575fca4bbc0bd092af85e7679d5b8e53459f24492fc2a073c7b6") version("0.6.7", sha256="f69b2ed35baf2a9853234756a2b19e6f7ce88d2c1f029d1c7ca166d91e1adbd0") - depends_on("cxx", type="build") # generated + depends_on("c", type="build") + depends_on("cxx", type="build") depends_on("py-setuptools", type="build") depends_on("py-scipy", type=("build", "run")) diff --git a/var/spack/repos/builtin/packages/py-torch-spline-conv/package.py b/var/spack/repos/builtin/packages/py-torch-spline-conv/package.py index c91b4538206804..2328adaac66b25 100644 --- a/var/spack/repos/builtin/packages/py-torch-spline-conv/package.py +++ b/var/spack/repos/builtin/packages/py-torch-spline-conv/package.py @@ -18,7 +18,8 @@ class PyTorchSplineConv(PythonPackage): version("1.2.2", sha256="ed45a81da29f774665dbdd4709d7e534cdf16d2e7006dbd06957f35bd09661b2") - depends_on("cxx", type="build") # generated + depends_on("c", type="build") + depends_on("cxx", type="build") depends_on("python", type=("build", "link", "run")) depends_on("py-setuptools", type="build") diff --git a/var/spack/repos/builtin/packages/py-torchvision/package.py b/var/spack/repos/builtin/packages/py-torchvision/package.py index baa08a80375c38..c1df14d269839f 100644 --- a/var/spack/repos/builtin/packages/py-torchvision/package.py +++ b/var/spack/repos/builtin/packages/py-torchvision/package.py @@ -55,6 +55,7 @@ class PyTorchvision(PythonPackage): version("0.6.0", sha256="02de11b3abe6882de4032ce86dab9c7794cbc84369b44d04e667486580f0f1f7") version("0.5.0", sha256="eb9afc93df3d174d975ee0914057a9522f5272310b4d56c150b955c287a4d74d") + depends_on("c", type="build") depends_on("cxx", type="build") desc = "Enable support for native encoding/decoding of {} formats in torchvision.io" diff --git a/var/spack/repos/builtin/packages/python/package.py b/var/spack/repos/builtin/packages/python/package.py index 789cc0d0e65f97..37ca9b0ed1ca76 100644 --- a/var/spack/repos/builtin/packages/python/package.py +++ b/var/spack/repos/builtin/packages/python/package.py @@ -22,7 +22,7 @@ from spack.util.prefix import Prefix -def make_pyvenv_cfg(python_spec: "spack.spec.Spec", venv_prefix: str) -> str: +def make_pyvenv_cfg(python_spec: Spec, venv_prefix: str) -> str: """Make a pyvenv_cfg file for a given (real) python command and venv prefix.""" python_cmd = python_spec.command.path lines = [ @@ -254,7 +254,6 @@ class Python(Package): variant("ssl", default=True, description="Build ssl module") variant("sqlite3", default=True, description="Build sqlite3 module") variant("dbm", default=True, description="Build dbm module") - variant("nis", default=False, description="Build nis module") variant("zlib", default=True, description="Build zlib module") variant("bz2", default=True, description="Build bz2 module") variant("lzma", default=True, description="Build lzma module") @@ -285,7 +284,6 @@ class Python(Package): # https://docs.python.org/3.10/whatsnew/3.10.html#build-changes depends_on("sqlite@3.7.15:", when="@3.10:+sqlite3") depends_on("gdbm", when="+dbm") # alternatively ndbm or berkeley-db - depends_on("libnsl", when="+nis") depends_on("zlib-api", when="+zlib") depends_on("bzip2", when="+bz2") depends_on("xz libs=shared", when="+lzma") @@ -387,7 +385,6 @@ def determine_variants(cls, exes, version_str): "readline", "sqlite3", "dbm", - "nis", "zlib", "bz2", "lzma", @@ -448,6 +445,29 @@ def patch(self): r"^(.*)setup\.py(.*)((build)|(install))(.*)$", r"\1setup.py\2 --no-user-cfg \3\6" ) + # disable building the nis module (there is no flag to disable it). + if self.spec.satisfies("@3.8:3.10"): + filter_file( + "if MS_WINDOWS or CYGWIN or HOST_PLATFORM == 'qnx6':", + "if True:", + "setup.py", + string=True, + ) + elif self.spec.satisfies("@3.7"): + filter_file( + "if host_platform in {'win32', 'cygwin', 'qnx6'}:", + "if True:", + "setup.py", + string=True, + ) + elif self.spec.satisfies("@3.6"): + filter_file( + "if (host_platform not in ['cygwin', 'qnx6'] and", + "if False and", + "setup.py", + string=True, + ) + def setup_build_environment(self, env): spec = self.spec @@ -658,6 +678,11 @@ def configure_args(self): ] ) + # Disable the nis module in the configure script for Python 3.11 and 3.12. It is deleted + # in Python 3.13. See ``def patch`` for disabling the nis module in Python 3.10 and older. + if spec.satisfies("@3.11:3.12"): + config_args.append("py_cv_module_nis=n/a") + # https://docs.python.org/3.8/library/sqlite3.html#f1 if spec.satisfies("+sqlite3 ^sqlite+dynamic_extensions"): config_args.append("--enable-loadable-sqlite-extensions") @@ -787,10 +812,6 @@ def import_tests(self): if "+dbm" in spec: self.command("-c", "import dbm") - # Ensure that nis module works - if "+nis" in spec: - self.command("-c", "import nis") - # Ensure that zlib module works if "+zlib" in spec: self.command("-c", "import zlib") diff --git a/var/spack/repos/builtin/packages/r-rsamtools/package.py b/var/spack/repos/builtin/packages/r-rsamtools/package.py index 6ce8eae4892fcd..c831f78788b284 100644 --- a/var/spack/repos/builtin/packages/r-rsamtools/package.py +++ b/var/spack/repos/builtin/packages/r-rsamtools/package.py @@ -58,3 +58,8 @@ class RRsamtools(RPackage): # this is not a listed dependency but is needed depends_on("curl") + depends_on("zlib-api") + + def patch(self): + with working_dir("src"): + filter_file(r"(^PKG_LIBS=)(\$\(RHTSLIB_LIBS\))", "\\1\\2 -lz", "Makevars") diff --git a/var/spack/repos/builtin/packages/raylib/package.py b/var/spack/repos/builtin/packages/raylib/package.py index e7bfd6fc37914e..2c0d14cb1e53f7 100644 --- a/var/spack/repos/builtin/packages/raylib/package.py +++ b/var/spack/repos/builtin/packages/raylib/package.py @@ -17,6 +17,7 @@ class Raylib(CMakePackage): license("Zlib", checked_by="georgemalerbo") + version("5.5", sha256="aea98ecf5bc5c5e0b789a76de0083a21a70457050ea4cc2aec7566935f5e258e") version("5.0", sha256="98f049b9ea2a9c40a14e4e543eeea1a7ec3090ebdcd329c4ca2cf98bc9793482") depends_on("c", type="build") # generated diff --git a/var/spack/repos/builtin/packages/rocfft/package.py b/var/spack/repos/builtin/packages/rocfft/package.py index d0a23b1094a18b..a93af207f56b7d 100644 --- a/var/spack/repos/builtin/packages/rocfft/package.py +++ b/var/spack/repos/builtin/packages/rocfft/package.py @@ -40,7 +40,8 @@ class Rocfft(CMakePackage): version("5.3.3", sha256="678c18710578c1fb36a0009311bb79de7607c3468f9102cfba56a866ebb7ff78") version("5.3.0", sha256="d655c5541c4aff4267e80e36d002fc3a55c2f84a0ae8631197c12af3bf03fa7d") - depends_on("cxx", type="build") # generated + depends_on("c", type="build") + depends_on("cxx", type="build") amdgpu_targets = ROCmPackage.amdgpu_targets diff --git a/var/spack/repos/builtin/packages/roctracer-dev/package.py b/var/spack/repos/builtin/packages/roctracer-dev/package.py index 6b5f472f8699eb..8f861b332df70c 100644 --- a/var/spack/repos/builtin/packages/roctracer-dev/package.py +++ b/var/spack/repos/builtin/packages/roctracer-dev/package.py @@ -41,7 +41,8 @@ class RoctracerDev(CMakePackage, ROCmPackage): version("5.3.3", sha256="f2cb1e6bb69ea1a628c04f984741f781ae1d8498dc58e15795bb03015f924d13") version("5.3.0", sha256="36f1da60863a113bb9fe2957949c661f00a702e249bb0523cda1fb755c053808") - depends_on("cxx", type="build") # generated + depends_on("c", type="build") + depends_on("cxx", type="build") variant("asan", default=False, description="Build with address-sanitizer enabled or disabled") diff --git a/var/spack/repos/builtin/packages/rsync/package.py b/var/spack/repos/builtin/packages/rsync/package.py index 43c45b8c33995c..23c2ee3588277c 100644 --- a/var/spack/repos/builtin/packages/rsync/package.py +++ b/var/spack/repos/builtin/packages/rsync/package.py @@ -12,7 +12,7 @@ class Rsync(AutotoolsPackage): """An open source utility that provides fast incremental file transfer.""" homepage = "https://rsync.samba.org" - url = "https://download.samba.org/pub/rsync/src/rsync-3.2.4.tar.gz" + url = "https://download.samba.org/pub/rsync/src/rsync-3.3.0.tar.gz" license("GPL-3.0-or-later") @@ -20,16 +20,42 @@ class Rsync(AutotoolsPackage): version("3.2.7", sha256="4e7d9d3f6ed10878c58c5fb724a67dacf4b6aac7340b13e488fb2dc41346f2bb") version("3.2.6", sha256="fb3365bab27837d41feaf42e967c57bd3a47bc8f10765a3671efd6a3835454d3") version("3.2.5", sha256="2ac4d21635cdf791867bc377c35ca6dda7f50d919a58be45057fd51600c69aba") - version("3.2.4", sha256="6f761838d08052b0b6579cf7f6737d93e47f01f4da04c5d24d3447b7f2a5fad1") - version("3.2.3", sha256="becc3c504ceea499f4167a260040ccf4d9f2ef9499ad5683c179a697146ce50e") - version("3.2.2", sha256="644bd3841779507665211fd7db8359c8a10670c57e305b4aab61b4e40037afa8") - version("3.1.3", sha256="55cc554efec5fdaad70de921cd5a5eeb6c29a95524c715f3bbf849235b0800c0") - version("3.1.2", sha256="ecfa62a7fa3c4c18b9eccd8c16eaddee4bd308a76ea50b5c02a5840f09c0a1c2") - version("3.1.1", sha256="7de4364fcf5fe42f3bdb514417f1c40d10bbca896abe7e7f2c581c6ea08a2621") - depends_on("c", type="build") # generated - depends_on("cxx", type="build") # generated + # Releases before 3.2.5 are deprecated because of CVE-2022-29154 + # https://nvd.nist.gov/vuln/detail/CVE-2022-29154 + version( + "3.2.4", + sha256="6f761838d08052b0b6579cf7f6737d93e47f01f4da04c5d24d3447b7f2a5fad1", + deprecated=True, + ) + version( + "3.2.3", + sha256="becc3c504ceea499f4167a260040ccf4d9f2ef9499ad5683c179a697146ce50e", + deprecated=True, + ) + version( + "3.2.2", + sha256="644bd3841779507665211fd7db8359c8a10670c57e305b4aab61b4e40037afa8", + deprecated=True, + ) + version( + "3.1.3", + sha256="55cc554efec5fdaad70de921cd5a5eeb6c29a95524c715f3bbf849235b0800c0", + deprecated=True, + ) + version( + "3.1.2", + sha256="ecfa62a7fa3c4c18b9eccd8c16eaddee4bd308a76ea50b5c02a5840f09c0a1c2", + deprecated=True, + ) + version( + "3.1.1", + sha256="7de4364fcf5fe42f3bdb514417f1c40d10bbca896abe7e7f2c581c6ea08a2621", + deprecated=True, + ) + depends_on("c", type="build") + depends_on("cxx", type="build") depends_on("zlib-api") depends_on("popt") depends_on("openssl", when="@3.2:") diff --git a/var/spack/repos/builtin/packages/rust-bootstrap/package.py b/var/spack/repos/builtin/packages/rust-bootstrap/package.py index 73d6de12235159..1603c9e853b383 100644 --- a/var/spack/repos/builtin/packages/rust-bootstrap/package.py +++ b/var/spack/repos/builtin/packages/rust-bootstrap/package.py @@ -133,6 +133,12 @@ class RustBootstrap(Package): if os in rust_releases[release] and target in rust_releases[release][os]: version(release, sha256=rust_releases[release][os][target]) + # rust-ldd and libLLVM both depend on zlib, which is not vendored. + depends_on("zlib-api") + depends_on("zlib-ng +shared", when="^[virtuals=zlib-api] zlib-ng") + depends_on("zlib +shared", when="^[virtuals=zlib-api] zlib") + depends_on("patchelf@0.13:", when="platform=linux", type="build") + def url_for_version(self, version): if self.os not in ("linux", "darwin"): return None @@ -151,6 +157,15 @@ def url_for_version(self, version): url = "https://static.rust-lang.org/dist/rust-{0}-{1}-{2}.tar.gz" return url.format(version, target, os) + @run_before("install", when="platform=linux") + def fixup_rpaths(self): + # set rpaths of libLLVM.so and rust-ldd to zlib's lib directory + rpaths = self.spec["zlib-api"].libs.directories + + for binary in find(self.stage.source_path, ["libLLVM.so.*", "rust-lld"]): + patchelf = Executable("patchelf") + patchelf("--add-rpath", ":".join(rpaths), binary) + def install(self, spec, prefix): install_script = Executable("./install.sh") install_args = [f"--prefix={prefix}", "--without=rust-docs"] diff --git a/var/spack/repos/builtin/packages/seacas/package.py b/var/spack/repos/builtin/packages/seacas/package.py index a222024541934b..358ff1148c73a6 100644 --- a/var/spack/repos/builtin/packages/seacas/package.py +++ b/var/spack/repos/builtin/packages/seacas/package.py @@ -147,9 +147,9 @@ class Seacas(CMakePackage): deprecated=True, ) - depends_on("c", type="build") # generated - depends_on("cxx", type="build") # generated - depends_on("fortran", type="build") # generated + depends_on("c", type="build") + depends_on("cxx", type="build") + depends_on("fortran", type="build", when="+fortran") # ###################### Variants ########################## # Package options @@ -304,6 +304,9 @@ class Seacas(CMakePackage): when="@:2023-10-24", ) + # Based on install-tpl.sh script, cereal seems to only be used when faodel enabled + depends_on("cereal", when="@2021-04-02: +faodel") + def setup_run_environment(self, env): env.prepend_path("PYTHONPATH", self.prefix.lib) @@ -486,6 +489,15 @@ def cmake_args(self): if pkg.lower() in spec: options.append(define(pkg + "_ROOT", spec[pkg.lower()].prefix)) + if "+faodel" in spec: + # faodel headers are under $faodel_prefix/include/faodel but seacas + # leaves off the faodel part + faodel_incdir = spec["faodel"].prefix.include + faodel_incdir2 = spec["faodel"].prefix.include.faodel + faodel_incdirs = [faodel_incdir, faodel_incdir2] + options.append(define("Faodel_INCLUDE_DIRS", ";".join(faodel_incdirs))) + options.append(define("Faodel_LIBRARY_DIRS", spec["faodel"].prefix.lib)) + options.append(from_variant("TPL_ENABLE_ADIOS2", "adios2")) if "+adios2" in spec: options.append(define("ADIOS2_ROOT", spec["adios2"].prefix)) diff --git a/var/spack/repos/builtin/packages/siesta/package.py b/var/spack/repos/builtin/packages/siesta/package.py index e70f2f9617a50b..36a7a440d49bf9 100644 --- a/var/spack/repos/builtin/packages/siesta/package.py +++ b/var/spack/repos/builtin/packages/siesta/package.py @@ -190,9 +190,6 @@ def edit(self, spec, prefix): spec["netcdf-fortran"].prefix ) ) - libs_arg.append( - "-L{0}/lib -lhdf5_fortran -lhdf5".format(spec["hdf5"].prefix) - ) if "+metis" in spec: libs_arg.append("-L{0} -lmetis".format(self.spec["metis"].prefix.lib)) diff --git a/var/spack/repos/builtin/packages/singularity-eos/package.py b/var/spack/repos/builtin/packages/singularity-eos/package.py index 46a768ce47b18a..509a7177ee1261 100644 --- a/var/spack/repos/builtin/packages/singularity-eos/package.py +++ b/var/spack/repos/builtin/packages/singularity-eos/package.py @@ -5,6 +5,7 @@ import os +import spack import spack.version from spack.package import * diff --git a/var/spack/repos/builtin/packages/slepc/package.py b/var/spack/repos/builtin/packages/slepc/package.py index 019f676696b96a..bf41ed4b0f3f0e 100644 --- a/var/spack/repos/builtin/packages/slepc/package.py +++ b/var/spack/repos/builtin/packages/slepc/package.py @@ -22,6 +22,7 @@ class Slepc(Package, CudaPackage, ROCmPackage): test_requires_compiler = True version("main", branch="main") + version("3.22.2", sha256="b60e58b2fa5eb7db05ce5e3a585811b43b1cc7cf89c32266e37b05f0cefd8899") version("3.22.1", sha256="badb5cb038d09dbf1cc8f34d194673ab011c69cc46888101955c786d21c8d8c9") version("3.22.0", sha256="45eb4d085875b50108c91fd9168ed17bc9158cc3b1e530ac843b26d9981c3db0") version("3.21.2", sha256="306fa649750509b3957b9f9311bff5dc1d20be5c5d494dd6472584c439b931f6") diff --git a/var/spack/repos/builtin/packages/tar/package.py b/var/spack/repos/builtin/packages/tar/package.py index 5fadb4229baadc..c293f620372e18 100644 --- a/var/spack/repos/builtin/packages/tar/package.py +++ b/var/spack/repos/builtin/packages/tar/package.py @@ -21,16 +21,18 @@ class Tar(AutotoolsPackage, GNUMirrorPackage): license("GPL-3.0-or-later") + version("1.35", sha256="14d55e32063ea9526e057fbf35fcabd53378e769787eff7919c3755b02d2b57e") version("1.34", sha256="03d908cf5768cfe6b7ad588c921c6ed21acabfb2b79b788d1330453507647aed") - version("1.32", sha256="b59549594d91d84ee00c99cf2541a3330fed3a42c440503326dab767f2fbb96c") - version("1.31", sha256="b471be6cb68fd13c4878297d856aebd50551646f4e3074906b1a74549c40d5a2") - version("1.30", sha256="4725cc2c2f5a274b12b39d1f78b3545ec9ebb06a6e48e8845e1995ac8513b088") - version("1.29", sha256="cae466e6e58c7292355e7080248f244db3a4cf755f33f4fa25ca7f9a7ed09af0") - version("1.28", sha256="6a6b65bac00a127a508533c604d5bf1a3d40f82707d56f20cefd38a05e8237de") + with default_args(deprecated=True): + # https://nvd.nist.gov/vuln/detail/CVE-2019-9923 + version("1.32", sha256="b59549594d91d84ee00c99cf2541a3330fed3a42c440503326dab767f2fbb96c") + version("1.31", sha256="b471be6cb68fd13c4878297d856aebd50551646f4e3074906b1a74549c40d5a2") + version("1.30", sha256="4725cc2c2f5a274b12b39d1f78b3545ec9ebb06a6e48e8845e1995ac8513b088") + version("1.29", sha256="cae466e6e58c7292355e7080248f244db3a4cf755f33f4fa25ca7f9a7ed09af0") + version("1.28", sha256="6a6b65bac00a127a508533c604d5bf1a3d40f82707d56f20cefd38a05e8237de") - depends_on("c", type="build") # generated + depends_on("c", type="build") - # A saner default than gzip? variant( "zip", default="pigz", @@ -52,12 +54,16 @@ class Tar(AutotoolsPackage, GNUMirrorPackage): patch("se-selinux.patch", when="@:1.29") patch("argp-pgi.patch", when="@:1.29") patch("gnutar-configure-xattrs.patch", when="@1.28") + # The NVIDIA compilers do not currently support some GNU builtins. # Detect this case and use the fallback path. - patch("nvhpc-1.30.patch", when="@1.30:1.32 %nvhpc") - patch("nvhpc-1.34.patch", when="@1.34 %nvhpc") - # Workaround bug where __LONG_WIDTH__ is not defined - patch("nvhpc-long-width.patch", when="@1.34 %nvhpc") + with when("%nvhpc"): + patch("nvhpc-1.30.patch", when="@1.30:1.32") + patch("nvhpc-1.34.patch", when="@1.34") + # Workaround bug where __LONG_WIDTH__ is not defined + patch("nvhpc-long-width.patch", when="@1.34:") + # Newer versions are marked as conflict for now + conflicts("@1.35:", msg="NVHPC not yet supported for 1.35") @classmethod def determine_version(cls, exe): @@ -65,29 +71,35 @@ def determine_version(cls, exe): match = re.search(r"tar \(GNU tar\) (\S+)", output) return match.group(1) if match else None + def flag_handler(self, name, flags): + if name == "ldflags" and self.spec.satisfies("@1.35"): + # https://savannah.gnu.org/bugs/?64441 + flags.append("-liconv") + return (flags, None, None) + def configure_args(self): - spec = self.spec # Note: compression programs are passed by abs path, # so that tar can locate them when invoked without spack load. args = [ - "--with-xz={0}".format(spec["xz"].prefix.bin.xz), - "--with-lzma={0}".format(spec["xz"].prefix.bin.lzma), - "--with-bzip2={0}".format(spec["bzip2"].prefix.bin.bzip2), + "--disable-nls", + f"--with-xz={self.spec['xz'].prefix.bin.xz}", + f"--with-lzma={self.spec['xz'].prefix.bin.lzma}", + f"--with-bzip2={self.spec['bzip2'].prefix.bin.bzip2}", ] - if spec["iconv"].name == "libiconv": - args.append(f"--with-libiconv-prefix={spec['iconv'].prefix}") - else: - args.append("--without-libiconv-prefix") - - if "^zstd" in spec: - args.append("--with-zstd={0}".format(spec["zstd"].prefix.bin.zstd)) + if self.spec.dependencies("zstd"): + args.append(f"--with-zstd={self.spec['zstd'].prefix.bin.zstd}") # Choose gzip/pigz - zip = spec.variants["zip"].value + zip = self.spec.variants["zip"].value if zip == "gzip": - gzip_path = spec["gzip"].prefix.bin.gzip + gzip_path = self.spec["gzip"].prefix.bin.gzip elif zip == "pigz": - gzip_path = spec["pigz"].prefix.bin.pigz - args.append("--with-gzip={}".format(gzip_path)) + gzip_path = self.spec["pigz"].prefix.bin.pigz + args.append(f"--with-gzip={gzip_path}") + + if self.spec["iconv"].name == "libiconv": + args.append(f"--with-libiconv-prefix={self.spec['iconv'].prefix}") + else: + args.append("--without-libiconv-prefix") return args diff --git a/var/spack/repos/builtin/packages/trilinos/package.py b/var/spack/repos/builtin/packages/trilinos/package.py index 7966cb3e6790c2..0339690085777b 100644 --- a/var/spack/repos/builtin/packages/trilinos/package.py +++ b/var/spack/repos/builtin/packages/trilinos/package.py @@ -418,7 +418,7 @@ class Trilinos(CMakePackage, CudaPackage, ROCmPackage): depends_on("kokkos-kernels@4.4.01", when="@master:") depends_on("kokkos-kernels@4.3.01", when="@16") depends_on("kokkos-kernels@4.2.01", when="@15.1:15") - depends_on("kokkos-kernels@4.1.00", when="@14.4:15.0") + depends_on("kokkos-kernels@4.1.00", when="@15.0") for a in CudaPackage.cuda_arch_values: arch_str = f"+cuda cuda_arch={a}" @@ -903,6 +903,7 @@ def define_tpl(trilinos_name, spack_name, have_dep): # External Kokkos if spec.satisfies("@14.4.0: +kokkos"): options.append(define_tpl_enable("Kokkos")) + if spec.satisfies("@15.0: +kokkos"): options.append(define_tpl_enable("KokkosKernels", True)) # MPI settings diff --git a/var/spack/repos/builtin/packages/ucc/package.py b/var/spack/repos/builtin/packages/ucc/package.py index fa612b3722440b..c1427a62a3ecf7 100644 --- a/var/spack/repos/builtin/packages/ucc/package.py +++ b/var/spack/repos/builtin/packages/ucc/package.py @@ -5,7 +5,7 @@ from spack.package import * -class Ucc(AutotoolsPackage, CudaPackage): +class Ucc(AutotoolsPackage, CudaPackage, ROCmPackage): """UCC is a collective communication operations API and library that is flexible, complete, and feature-rich for current and emerging programming models and runtimes.""" @@ -23,8 +23,7 @@ class Ucc(AutotoolsPackage, CudaPackage): variant("cuda", default=False, description="Enable CUDA TL") variant("nccl", default=False, description="Enable NCCL TL", when="+cuda") - # RCCL build not tested - # variant("rccl", default=False, description="Enable RCCL TL") + variant("rccl", default=False, description="Enable RCCL TL", when="+rocm") # https://github.com/openucx/ucc/pull/847 patch( @@ -40,7 +39,7 @@ class Ucc(AutotoolsPackage, CudaPackage): depends_on("ucx") depends_on("nccl", when="+nccl") - # depends_on("rccl", when="+rccl") + depends_on("rccl", when="+rccl") with when("+nccl"): for arch in CudaPackage.cuda_arch_values: @@ -55,5 +54,26 @@ def configure_args(self): args = [] args.extend(self.with_or_without("cuda", activation_value="prefix")) args.extend(self.with_or_without("nccl", activation_value="prefix")) - # args.extend(self.with_or_without("rccl", activation_value="prefix")) + if self.spec.satisfies("+rocm"): + cppflags = " ".join( + "-I" + include_dir + for include_dir in ( + self.spec["hip"].prefix.include, + self.spec["hip"].prefix.include.hip, + self.spec["hsa-rocr-dev"].prefix.include.hsa, + ) + ) + ldflags = " ".join( + "-L" + library_dir + for library_dir in ( + self.spec["hip"].prefix.lib, + self.spec["hsa-rocr-dev"].prefix.lib, + ) + ) + args.extend(["CPPFLAGS=" + cppflags, "LDFLAGS=" + ldflags]) + args.append("--with-rocm=" + self.spec["hip"].prefix) + args.append("--with-ucx=" + self.spec["ucx"].prefix) + args.extend(self.with_or_without("rccl", activation_value="prefix")) + else: + args.append("--without-rocm") return args diff --git a/var/spack/repos/builtin/packages/utf8cpp/package.py b/var/spack/repos/builtin/packages/utf8cpp/package.py index 39d56ad06e9d5e..1d74adaae8898d 100644 --- a/var/spack/repos/builtin/packages/utf8cpp/package.py +++ b/var/spack/repos/builtin/packages/utf8cpp/package.py @@ -6,20 +6,16 @@ from spack.package import * -class Utf8cpp(Package): +class Utf8cpp(CMakePackage): """A simple, portable and lightweight generic library for handling UTF-8 encoded strings.""" - homepage = "https://utfcpp.sourceforge.net/" + homepage = "https://github.com/nemtrif/utfcpp" + url = "https://github.com/nemtrif/utfcpp/archive/refs/tags/v2.3.4.tar.gz" - version("2.3.4", sha256="3373cebb25d88c662a2b960c4d585daf9ae7b396031ecd786e7bb31b15d010ef") + version("4.0.6", sha256="6920a6a5d6a04b9a89b2a89af7132f8acefd46e0c2a7b190350539e9213816c0") + version("3.2.4", sha256="fde21a4c519eed25f095a1cd8490167409cc70d7b5e9c38756142e588ccb7c7e") + version("2.3.4", sha256="1a26d07f88d173dbd26a45f645009d0c6f6ceeb5f0fc391b9f3a769d090a66f4") - def url_for_version(self, version): - url = ( - "https://sourceforge.net/projects/utfcpp/files/utf8cpp_2x/Release%20{0}/utf8_v{1}.zip" - ) - return url.format(version, version.underscored) - - def install(self, spec, prefix): - install_tree("doc", prefix.share.doc) - install_tree("source", prefix.include) + depends_on("c", type="build") + depends_on("cxx", type="build") diff --git a/var/spack/repos/builtin/packages/vecmem/package.py b/var/spack/repos/builtin/packages/vecmem/package.py index c647e396759059..3a5f01bd4aa552 100644 --- a/var/spack/repos/builtin/packages/vecmem/package.py +++ b/var/spack/repos/builtin/packages/vecmem/package.py @@ -17,6 +17,8 @@ class Vecmem(CMakePackage, CudaPackage): license("MPL-2.0-no-copyleft-exception") + version("1.13.0", sha256="fc21cea04140e1210c83a32579b0a7194601889b6c895404214ac55ce547342b") + version("1.12.0", sha256="59a5ef061fc9949c3159cb920a717dee7aa1e9a98b3672495200071d3d4b61cf") version("1.11.0", sha256="8f4ef9b50da45ea245291e2a4fef86025245150df4a4654ecb708a20adec5c42") version("1.10.0", sha256="1fbdc599a65ad7b2cd1176844c7578da38911bc747fbe51a71e00d20e6105330") version("1.9.0", sha256="c1ddc43ff0d742306cbee71afd80efd348b6b0b1ba9e4210ca7f8b607f03bd70") diff --git a/var/spack/repos/builtin/packages/vtk/package.py b/var/spack/repos/builtin/packages/vtk/package.py index 10e941e8dc07cb..e972c5b5825d0f 100644 --- a/var/spack/repos/builtin/packages/vtk/package.py +++ b/var/spack/repos/builtin/packages/vtk/package.py @@ -87,14 +87,15 @@ class Vtk(CMakePackage): conflicts("%gcc@13", when="@9.2") - with when("+python"): - # Depend on any Python, add bounds below. - extends("python@2.7:", type=("build", "run")) - depends_on("python@:3.7", when="@:8.2.0", type=("build", "run")) - # Python 3.8 support from vtk 9 and patched 8.2 - depends_on("python@:3.8", when="@:8.2.1a", type=("build", "run")) - # Python 3.10 support from vtk 9.2 - depends_on("python@:3.9", when="@:9.1", type=("build", "run")) + # Based on PyPI wheel availability + with when("+python"), default_args(type=("build", "link", "run")): + depends_on("python@:3.13") + depends_on("python@:3.12", when="@:9.3") + depends_on("python@:3.11", when="@:9.2") + depends_on("python@:3.10", when="@:9.2.2") + depends_on("python@:3.9", when="@:9.1") + depends_on("python@:3.8", when="@:9.0.1") + depends_on("python@:3.7", when="@:8.2.0") # We need mpi4py if buidling python wrappers and using MPI depends_on("py-mpi4py", when="+python+mpi", type="run")