Compare commits

...

20 Commits

Author SHA1 Message Date
Satish Balay
05de2b1ba1 petsc: fix compilers listed in pkgconfig/petsc.pc (#48201)
* petsc: fix compilers listed in pkgconfig/petsc.pc

* Also fix reconfigure*.py
2024-12-27 22:09:00 -06:00
Chris Marsh
f57d7fb952 gsl: update patch for 2.8
The 2.7 patch does not apply on gsl@2.8.
This is a manual fix of the 2.6 patch to update it to clealy apply to gsl@2.8
2024-12-28 00:49:03 +01:00
Karol Krizka
e76f8fda2d openloops: use cmodel small on aarch64 instead of large (#48299) 2024-12-27 09:07:54 -07:00
Juan Miguel Carceller
66a00fe103 freeglut: add v3.6.0 (#48292)
* freeglut: add v3.6.0

* Change the version range for the patch

---------

Co-authored-by: jmcarcell <jmcarcell@users.noreply.github.com>
2024-12-26 09:07:50 -07:00
dependabot[bot]
15124d7c73 build(deps): bump urllib3 from 2.2.3 to 2.3.0 in /lib/spack/docs (#48278)
Bumps [urllib3](https://github.com/urllib3/urllib3) from 2.2.3 to 2.3.0.
- [Release notes](https://github.com/urllib3/urllib3/releases)
- [Changelog](https://github.com/urllib3/urllib3/blob/main/CHANGES.rst)
- [Commits](https://github.com/urllib3/urllib3/compare/2.2.3...2.3.0)

---
updated-dependencies:
- dependency-name: urllib3
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-12-26 09:03:38 -07:00
Karol Krizka
a14f10e882 openloops: Fix configuration of cmodel setting for gfortran (#48288)
* openloops: Add cmodel to user config file to override setting added in 2.1.2.

* openloops: Change cmodel from small to large following author recommendation.
2024-12-26 08:44:08 -06:00
Joseph Wang
16d3de4540 opendatadetector: fix attribute for libs (#48290) 2024-12-26 08:35:04 -06:00
psakievich
78bd905fe0 Ensure command_line scope is always last (#48255) 2024-12-25 14:32:31 -07:00
Harmen Stoppels
e9cdcc4af0 build caches: collect files to relocate while tarballing w/o file (#48212)
A few changes to tarball creation (for build caches):
- do not run file to distinguish binary from text
- file is slow, even when running it in a batched fashion -- it usually reads all bytes and has slow logic to categorize specific types
- we don't need a highly detailed file categorization; a crude categorization of elf, mach-o, text suffices.
detecting elf and mach-o is straightforward and cheap
- detecting utf-8 (and with that ascii) is highly accurate: false positive rate decays exponentially as file size increases. Further it's not only the most common encoding, but the most common file type in package prefixes.
iso-8859-1 is cheaply (but heuristically) detected too, and sufficiently accurate after binaries and utf-8 files are classified earlier
- remove file as a dependency of Spack in general, which makes Spack itself easier to install
- detect file type and need to relocate as part of creating the tarball, which is more cache friendly and thus faster
2024-12-24 10:53:13 -07:00
Massimiliano Culpo
aca469b329 mpi: remove setting unused monkey patched variable (#48275)
mpicxx_shared_libraries seems a relic of #1550, and is
not currently used by any builtin package.

Thus, cleanup the recipes, and avoid monkey-patching
spec objects.
2024-12-24 14:29:53 +01:00
Wouter Deconinck
c65a0e03c4 doc: ensure getting_started has bootstrap list output in correct place (#48281) 2024-12-24 04:48:02 -07:00
Wouter Deconinck
b02340724d gaudi: Fix nonexistent 'libs' (#48274) 2024-12-23 12:57:42 -07:00
Philipp Edelmann
250de0cdf2 fix spack external find for Python >= 3.13 (#48170)
Python >= 3.13 does not have the crypt variant anymore. Still no matter
if the test for crypt succeeds (which it can on Fedora providing its own
crypt module for Python 3.13) or fails, it will add +crypt or ~crypt,
which both fail because the variant only exists until Python 3.12.

Co-authored-by: Richard Berger <rberger@lanl.gov>
2024-12-23 10:56:13 -08:00
Carson Woods
da97e9eaa7 py-fitter: add v1.5.2, v1.6.0 (#41035) 2024-12-23 18:29:14 +01:00
Massimiliano Culpo
a3322459fe bootstrap mirror: fix references from v0.4 to v0.6 (#48235) 2024-12-23 14:06:48 +01:00
Olivier Cessenat
88d5393570 silo: variant python needs python (#48257)
* silo: variant python needs python

* Dependency to Python did not resolve the "Python.h" header not being found

Added the -I path to Python header to the compiler.
Having silo depend on python was not sufficient to get the path to python.
Maybe there is a smarter way to do that, but this one works.

* Update var/spack/repos/builtin/packages/silo/package.py

Co-authored-by: Wouter Deconinck <wdconinc@gmail.com>

* Update var/spack/repos/builtin/packages/silo/package.py

Co-authored-by: Wouter Deconinck <wdconinc@gmail.com>

* Update var/spack/repos/builtin/packages/silo/package.py

Co-authored-by: Wouter Deconinck <wdconinc@gmail.com>

---------

Co-authored-by: Wouter Deconinck <wdconinc@gmail.com>
2024-12-22 19:13:23 -06:00
Thomas Madlener
d1d61820f4 herwig, thepeg: Add latest version and specify rivet dependencies better (#48142)
* thepeg: Correctly specify rivet version for dependency

* herwig3: Add latest version 7.3.0

* thepeg: Make sure to have consistent hepmc version

rivet and thepeg need to have the same hepmc version otherwise things
will not compile
2024-12-22 15:36:14 -06:00
prakash
858c7ca1a2 Updates to AMR-Wind: adding new releases and an option to enable new spec option (#48229) 2024-12-22 10:25:53 -07:00
Elliott Slaughter
5b1394f1cf legion: Add 24.12.0. (#48221) 2024-12-21 20:00:25 -07:00
Christophe Prud'homme
9554f8802b libzip: links with external libs found on host and new version (#47230)
* libzip links with external libs found on host feelpp/spack#6

* add maintainers

* fix style

* use multi-build system

/cc @wdconinc

* fix style

* rm space and rename variant bz2 to bzip2

/cc @wdconinc

* fix variant name for bzip2

* zstd is supported in libzip@:1.8

* fix style

* fix style

* fix style

* rm deprecated version and versions that cannot be found easily

use only cmake from now on

* fix style

* fix style

* use variant when option for zstd

* Update var/spack/repos/builtin/packages/libzip/package.py

Co-authored-by: Wouter Deconinck <wdconinc@gmail.com>

* fix style

/cc @wdconinc

---------

Co-authored-by: Wouter Deconinck <wdconinc@gmail.com>
2024-12-21 19:22:50 -06:00
47 changed files with 712 additions and 512 deletions

View File

@@ -161,11 +161,7 @@ jobs:
source share/spack/setup-env.sh
spack -d gpg list
tree $HOME/.spack/bootstrap/store/
- name: Bootstrap File
run: |
source share/spack/setup-env.sh
spack -d python share/spack/qa/bootstrap-file.py
tree $HOME/.spack/bootstrap/store/
windows:
runs-on: "windows-latest"
@@ -196,9 +192,3 @@ jobs:
spack -d gpg list
./share/spack/qa/validate_last_exit.ps1
tree $env:userprofile/.spack/bootstrap/store/
- name: Bootstrap File
run: |
./share/spack/setup-env.ps1
spack -d python share/spack/qa/bootstrap-file.py
./share/spack/qa/validate_last_exit.ps1
tree $env:userprofile/.spack/bootstrap/store/

View File

@@ -140,7 +140,7 @@ jobs:
- name: Install dependencies
run: |
dnf install -y \
bzip2 curl file gcc-c++ gcc gcc-gfortran git gnupg2 gzip \
bzip2 curl gcc-c++ gcc gcc-gfortran git gnupg2 gzip \
make patch tcl unzip which xz
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
- name: Setup repo and non-root user

View File

@@ -35,7 +35,7 @@ A build matrix showing which packages are working on which systems is shown belo
.. code-block:: console
apt update
apt install bzip2 ca-certificates file g++ gcc gfortran git gzip lsb-release patch python3 tar unzip xz-utils zstd
apt install bzip2 ca-certificates g++ gcc gfortran git gzip lsb-release patch python3 tar unzip xz-utils zstd
.. tab-item:: RHEL
@@ -148,20 +148,22 @@ The first time you concretize a spec, Spack will bootstrap automatically:
--------------------------------
zlib@1.2.13%gcc@9.4.0+optimize+pic+shared build_system=makefile arch=linux-ubuntu20.04-icelake
The default bootstrap behavior is to use pre-built binaries. You can verify the
active bootstrap repositories with:
.. command-output:: spack bootstrap list
If for security concerns you cannot bootstrap ``clingo`` from pre-built
binaries, you have to disable fetching the binaries we generated with Github Actions.
.. code-block:: console
$ spack bootstrap disable github-actions-v0.4
==> "github-actions-v0.4" is now disabled and will not be used for bootstrapping
$ spack bootstrap disable github-actions-v0.3
==> "github-actions-v0.3" is now disabled and will not be used for bootstrapping
You can verify that the new settings are effective with:
.. command-output:: spack bootstrap list
$ spack bootstrap disable github-actions-v0.6
==> "github-actions-v0.6" is now disabled and will not be used for bootstrapping
$ spack bootstrap disable github-actions-v0.5
==> "github-actions-v0.5" is now disabled and will not be used for bootstrapping
You can verify that the new settings are effective with ``spack bootstrap list``.
.. note::

View File

@@ -5,7 +5,7 @@ sphinx-rtd-theme==3.0.2
python-levenshtein==0.26.1
docutils==0.21.2
pygments==2.18.0
urllib3==2.2.3
urllib3==2.3.0
pytest==8.3.4
isort==5.13.2
black==24.10.0

View File

@@ -8,7 +8,6 @@ unzip, , , Compress/Decompress archives
bzip2, , , Compress/Decompress archives
xz, , , Compress/Decompress archives
zstd, , Optional, Compress/Decompress archives
file, , , Create/Use Buildcaches
lsb-release, , , Linux: identify operating system version
gnupg2, , , Sign/Verify Buildcaches
git, , , Manage Software Repositories
1 Name Supported Versions Notes Requirement Reason
8 bzip2 Compress/Decompress archives
9 xz Compress/Decompress archives
10 zstd Optional Compress/Decompress archives
file Create/Use Buildcaches
11 lsb-release Linux: identify operating system version
12 gnupg2 Sign/Verify Buildcaches
13 git Manage Software Repositories

View File

@@ -863,8 +863,10 @@ def elide_list(line_list: List[str], max_num: int = 10) -> List[str]:
if sys.version_info >= (3, 9):
PatternStr = re.Pattern[str]
PatternBytes = re.Pattern[bytes]
else:
PatternStr = typing.Pattern[str]
PatternBytes = typing.Pattern[bytes]
def fnmatch_translate_multiple(named_patterns: Dict[str, str]) -> str:

View File

@@ -24,13 +24,12 @@
import urllib.request
import warnings
from contextlib import closing
from typing import Dict, Iterable, List, NamedTuple, Optional, Set, Tuple, Union
from typing import IO, Dict, Iterable, List, NamedTuple, Optional, Set, Tuple, Union
import llnl.util.filesystem as fsys
import llnl.util.lang
import llnl.util.tty as tty
from llnl.util.filesystem import BaseDirectoryVisitor, mkdirp, visit_directory_tree
from llnl.util.symlink import readlink
from llnl.util.filesystem import mkdirp
import spack.caches
import spack.config as config
@@ -54,7 +53,6 @@
import spack.util.archive
import spack.util.crypto
import spack.util.file_cache as file_cache
import spack.util.filesystem as ssys
import spack.util.gpg
import spack.util.parallel
import spack.util.path
@@ -587,129 +585,11 @@ def read_buildinfo_file(prefix):
return syaml.load(f)
class BuildManifestVisitor(BaseDirectoryVisitor):
"""Visitor that collects a list of files and symlinks
that can be checked for need of relocation. It knows how
to dedupe hardlinks and deal with symlinks to files and
directories."""
def __init__(self):
# Save unique identifiers of hardlinks to avoid relocating them multiple times
self.visited = set()
# Lists of files we will check
self.files = []
self.symlinks = []
def seen_before(self, root, rel_path):
stat_result = os.lstat(os.path.join(root, rel_path))
if stat_result.st_nlink == 1:
return False
identifier = (stat_result.st_dev, stat_result.st_ino)
if identifier in self.visited:
return True
else:
self.visited.add(identifier)
return False
def visit_file(self, root, rel_path, depth):
if self.seen_before(root, rel_path):
return
self.files.append(rel_path)
def visit_symlinked_file(self, root, rel_path, depth):
# Note: symlinks *can* be hardlinked, but it is unclear if
# symlinks can be relinked in-place (preserving inode).
# Therefore, we do *not* de-dupe hardlinked symlinks.
self.symlinks.append(rel_path)
def before_visit_dir(self, root, rel_path, depth):
return os.path.basename(rel_path) not in (".spack", "man")
def before_visit_symlinked_dir(self, root, rel_path, depth):
# Treat symlinked directories simply as symlinks.
self.visit_symlinked_file(root, rel_path, depth)
# Never recurse into symlinked directories.
return False
def file_matches(path, regex):
with open(path, "rb") as f:
contents = f.read()
return bool(regex.search(contents))
def get_buildfile_manifest(spec):
"""
Return a data structure with information about a build, including
text_to_relocate, binary_to_relocate, binary_to_relocate_fullpath
link_to_relocate, and other, which means it doesn't fit any of previous
checks (and should not be relocated). We exclude docs (man) and
metadata (.spack). This can be used to find a particular kind of file
in spack, or to generate the build metadata.
"""
data = {
"text_to_relocate": [],
"binary_to_relocate": [],
"link_to_relocate": [],
"other": [],
"binary_to_relocate_fullpath": [],
"hardlinks_deduped": True,
}
# Guard against filesystem footguns of hardlinks and symlinks by using
# a visitor to retrieve a list of files and symlinks, so we don't have
# to worry about hardlinks of symlinked dirs and what not.
visitor = BuildManifestVisitor()
root = spec.prefix
visit_directory_tree(root, visitor)
# Collect a list of prefixes for this package and it's dependencies, Spack will
# look for them to decide if text file needs to be relocated or not
prefixes = [d.prefix for d in spec.traverse(root=True, deptype="all") if not d.external]
prefixes.append(spack.hooks.sbang.sbang_install_path())
prefixes.append(str(spack.store.STORE.layout.root))
# Create a giant regex that matches all prefixes
regex = utf8_paths_to_single_binary_regex(prefixes)
# Symlinks.
# Obvious bugs:
# 1. relative links are not relocated.
# 2. paths are used as strings.
for rel_path in visitor.symlinks:
abs_path = os.path.join(root, rel_path)
link = readlink(abs_path)
if os.path.isabs(link) and link.startswith(spack.store.STORE.layout.root):
data["link_to_relocate"].append(rel_path)
# Non-symlinks.
for rel_path in visitor.files:
abs_path = os.path.join(root, rel_path)
m_type, m_subtype = ssys.mime_type(abs_path)
if relocate.needs_binary_relocation(m_type, m_subtype):
# Why is this branch not part of needs_binary_relocation? :(
if (
(
m_subtype in ("x-executable", "x-sharedlib", "x-pie-executable")
and sys.platform != "darwin"
)
or (m_subtype in ("x-mach-binary") and sys.platform == "darwin")
or (not rel_path.endswith(".o"))
):
data["binary_to_relocate"].append(rel_path)
data["binary_to_relocate_fullpath"].append(abs_path)
continue
elif relocate.needs_text_relocation(m_type, m_subtype) and file_matches(abs_path, regex):
data["text_to_relocate"].append(rel_path)
continue
data["other"].append(abs_path)
return data
def file_matches(f: IO[bytes], regex: llnl.util.lang.PatternBytes) -> bool:
try:
return bool(regex.search(f.read()))
finally:
f.seek(0)
def deps_to_relocate(spec):
@@ -742,17 +622,15 @@ def deps_to_relocate(spec):
def get_buildinfo_dict(spec):
"""Create metadata for a tarball"""
manifest = get_buildfile_manifest(spec)
return {
"sbang_install_path": spack.hooks.sbang.sbang_install_path(),
"buildpath": spack.store.STORE.layout.root,
"spackprefix": spack.paths.prefix,
"relative_prefix": os.path.relpath(spec.prefix, spack.store.STORE.layout.root),
"relocate_textfiles": manifest["text_to_relocate"],
"relocate_binaries": manifest["binary_to_relocate"],
"relocate_links": manifest["link_to_relocate"],
"hardlinks_deduped": manifest["hardlinks_deduped"],
# "relocate_textfiles": [],
# "relocate_binaries": [],
# "relocate_links": [],
"hardlinks_deduped": True,
"hash_to_prefix": {d.dag_hash(): str(d.prefix) for d in deps_to_relocate(spec)},
}
@@ -1042,7 +920,55 @@ def generate_key_index(key_prefix: str, tmpdir: str) -> None:
) from e
def tarfile_of_spec_prefix(tar: tarfile.TarFile, prefix: str) -> None:
class FileTypes:
BINARY = 0
TEXT = 1
UNKNOWN = 2
NOT_ISO8859_1_TEXT = re.compile(b"[\x00\x7F-\x9F]")
def file_type(f: IO[bytes]) -> int:
try:
# first check if this is an ELF or mach-o binary.
magic = f.read(8)
if len(magic) < 8:
return FileTypes.UNKNOWN
elif relocate.is_elf_magic(magic) or relocate.is_macho_magic(magic):
return FileTypes.BINARY
f.seek(0)
# Then try utf-8, which has a fast exponential decay in false positive rate with file size.
# Use chunked reads for fast early exit.
f_txt = io.TextIOWrapper(f, encoding="utf-8", errors="strict")
try:
while f_txt.read(1024):
pass
return FileTypes.TEXT
except UnicodeError:
f_txt.seek(0)
pass
finally:
f_txt.detach()
# Finally try iso-8859-1 heuristically. In Python, all possible 256 byte values are valid.
# We classify it as text if it does not contain any control characters / null bytes.
data = f.read(1024)
while data:
if NOT_ISO8859_1_TEXT.search(data):
break
data = f.read(1024)
else:
return FileTypes.TEXT
return FileTypes.UNKNOWN
finally:
f.seek(0)
def tarfile_of_spec_prefix(
tar: tarfile.TarFile, prefix: str, prefixes_to_relocate: List[str]
) -> dict:
"""Create a tarfile of an install prefix of a spec. Skips existing buildinfo file.
Args:
@@ -1058,6 +984,33 @@ def tarfile_of_spec_prefix(tar: tarfile.TarFile, prefix: str) -> None:
except OSError:
skip = lambda entry: False
binary_regex = utf8_paths_to_single_binary_regex(prefixes_to_relocate)
relocate_binaries = []
relocate_links = []
relocate_textfiles = []
# use callbacks to add files and symlinks, so we can register which files need relocation upon
# extraction.
def add_file(tar: tarfile.TarFile, info: tarfile.TarInfo, path: str):
with open(path, "rb") as f:
relpath = os.path.relpath(path, prefix)
# no need to relocate anything in the .spack directory
if relpath.split(os.sep, 1)[0] == ".spack":
tar.addfile(info, f)
return
f_type = file_type(f)
if f_type == FileTypes.BINARY:
relocate_binaries.append(os.path.relpath(path, prefix))
elif f_type == FileTypes.TEXT and file_matches(f, binary_regex):
relocate_textfiles.append(os.path.relpath(path, prefix))
tar.addfile(info, f)
def add_symlink(tar: tarfile.TarFile, info: tarfile.TarInfo, path: str):
if os.path.isabs(info.linkname) and binary_regex.match(info.linkname.encode("utf-8")):
relocate_links.append(os.path.relpath(path, prefix))
tar.addfile(info)
spack.util.archive.reproducible_tarfile_from_prefix(
tar,
prefix,
@@ -1065,29 +1018,51 @@ def tarfile_of_spec_prefix(tar: tarfile.TarFile, prefix: str) -> None:
# used in runtimes like AWS lambda.
include_parent_directories=True,
skip=skip,
add_file=add_file,
add_symlink=add_symlink,
)
return {
"relocate_binaries": relocate_binaries,
"relocate_links": relocate_links,
"relocate_textfiles": relocate_textfiles,
}
def create_tarball(spec: spack.spec.Spec, tarfile_path: str) -> Tuple[str, str]:
"""Create a tarball of a spec and return the checksums of the compressed tarfile and the
uncompressed tarfile."""
return _do_create_tarball(
tarfile_path,
spec.prefix,
buildinfo=get_buildinfo_dict(spec),
prefixes_to_relocate=prefixes_to_relocate(spec),
)
def _do_create_tarball(tarfile_path: str, binaries_dir: str, buildinfo: dict):
def _do_create_tarball(
tarfile_path: str, prefix: str, buildinfo: dict, prefixes_to_relocate: List[str]
) -> Tuple[str, str]:
with spack.util.archive.gzip_compressed_tarfile(tarfile_path) as (
tar,
inner_checksum,
outer_checksum,
tar_gz_checksum,
tar_checksum,
):
# Tarball the install prefix
tarfile_of_spec_prefix(tar, binaries_dir)
files_to_relocate = tarfile_of_spec_prefix(tar, prefix, prefixes_to_relocate)
buildinfo.update(files_to_relocate)
# Serialize buildinfo for the tarball
bstring = syaml.dump(buildinfo, default_flow_style=True).encode("utf-8")
tarinfo = tarfile.TarInfo(
name=spack.util.archive.default_path_to_name(buildinfo_file_name(binaries_dir))
name=spack.util.archive.default_path_to_name(buildinfo_file_name(prefix))
)
tarinfo.type = tarfile.REGTYPE
tarinfo.size = len(bstring)
tarinfo.mode = 0o644
tar.addfile(tarinfo, io.BytesIO(bstring))
return inner_checksum.hexdigest(), outer_checksum.hexdigest()
return tar_gz_checksum.hexdigest(), tar_checksum.hexdigest()
class ExistsInBuildcache(NamedTuple):
@@ -1137,6 +1112,13 @@ def _exists_in_buildcache(spec: spack.spec.Spec, tmpdir: str, out_url: str) -> E
return ExistsInBuildcache(signed, unsigned, tarball)
def prefixes_to_relocate(spec):
prefixes = [s.prefix for s in deps_to_relocate(spec)]
prefixes.append(spack.hooks.sbang.sbang_install_path())
prefixes.append(str(spack.store.STORE.layout.root))
return prefixes
def _url_upload_tarball_and_specfile(
spec: spack.spec.Spec,
tmpdir: str,
@@ -1146,7 +1128,7 @@ def _url_upload_tarball_and_specfile(
):
files = BuildcacheFiles(spec, tmpdir, out_url)
tarball = files.local_tarball()
checksum, _ = _do_create_tarball(tarball, spec.prefix, get_buildinfo_dict(spec))
checksum, _ = create_tarball(spec, tarball)
spec_dict = spec.to_dict(hash=ht.dag_hash)
spec_dict["buildcache_layout_version"] = CURRENT_BUILD_CACHE_LAYOUT_VERSION
spec_dict["binary_cache_checksum"] = {"hash_algorithm": "sha256", "hash": checksum}
@@ -1470,13 +1452,11 @@ def _oci_push_pkg_blob(
filename = os.path.join(tmpdir, f"{spec.dag_hash()}.tar.gz")
# Create an oci.image.layer aka tarball of the package
compressed_tarfile_checksum, tarfile_checksum = _do_create_tarball(
filename, spec.prefix, get_buildinfo_dict(spec)
)
tar_gz_checksum, tar_checksum = create_tarball(spec, filename)
blob = spack.oci.oci.Blob(
Digest.from_sha256(compressed_tarfile_checksum),
Digest.from_sha256(tarfile_checksum),
Digest.from_sha256(tar_gz_checksum),
Digest.from_sha256(tar_checksum),
os.path.getsize(filename),
)
@@ -2435,6 +2415,14 @@ def _tar_strip_component(tar: tarfile.TarFile, prefix: str):
yield m
def extract_buildcache_tarball(tarfile_path: str, destination: str) -> None:
with closing(tarfile.open(tarfile_path, "r")) as tar:
# Remove common prefix from tarball entries and directly extract them to the install dir.
tar.extractall(
path=destination, members=_tar_strip_component(tar, prefix=_ensure_common_prefix(tar))
)
def extract_tarball(spec, download_result, force=False, timer=timer.NULL_TIMER):
"""
extract binary tarball for given package into install area
@@ -2504,12 +2492,7 @@ def extract_tarball(spec, download_result, force=False, timer=timer.NULL_TIMER):
tarfile_path, size, contents, "sha256", expected, local_checksum
)
try:
with closing(tarfile.open(tarfile_path, "r")) as tar:
# Remove install prefix from tarfil to extract directly into spec.prefix
tar.extractall(
path=spec.prefix,
members=_tar_strip_component(tar, prefix=_ensure_common_prefix(tar)),
)
extract_buildcache_tarball(tarfile_path, destination=spec.prefix)
except Exception:
shutil.rmtree(spec.prefix, ignore_errors=True)
_delete_staged_downloads(download_result)

View File

@@ -9,7 +9,6 @@
all_core_root_specs,
ensure_clingo_importable_or_raise,
ensure_core_dependencies,
ensure_file_in_path_or_raise,
ensure_gpg_in_path_or_raise,
ensure_patchelf_in_path_or_raise,
)
@@ -20,7 +19,6 @@
"is_bootstrapping",
"ensure_bootstrap_configuration",
"ensure_core_dependencies",
"ensure_file_in_path_or_raise",
"ensure_gpg_in_path_or_raise",
"ensure_clingo_importable_or_raise",
"ensure_patchelf_in_path_or_raise",

View File

@@ -481,19 +481,6 @@ def ensure_gpg_in_path_or_raise() -> None:
)
def file_root_spec() -> str:
"""Return the root spec used to bootstrap file"""
root_spec_name = "win-file" if IS_WINDOWS else "file"
return _root_spec(root_spec_name)
def ensure_file_in_path_or_raise() -> None:
"""Ensure file is in the PATH or raise"""
return ensure_executables_in_path_or_raise(
executables=["file"], abstract_spec=file_root_spec()
)
def patchelf_root_spec() -> str:
"""Return the root spec used to bootstrap patchelf"""
# 0.13.1 is the last version not to require C++17.
@@ -577,15 +564,13 @@ def ensure_core_dependencies() -> None:
"""Ensure the presence of all the core dependencies."""
if sys.platform.lower() == "linux":
ensure_patchelf_in_path_or_raise()
elif sys.platform == "win32":
ensure_file_in_path_or_raise()
ensure_gpg_in_path_or_raise()
ensure_clingo_importable_or_raise()
def all_core_root_specs() -> List[str]:
"""Return a list of all the core root specs that may be used to bootstrap Spack"""
return [clingo_root_spec(), gnupg_root_spec(), patchelf_root_spec(), file_root_spec()]
return [clingo_root_spec(), gnupg_root_spec(), patchelf_root_spec()]
def bootstrapping_sources(scope: Optional[str] = None):

View File

@@ -3,8 +3,8 @@
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
"""Query the status of bootstrapping on this machine"""
import platform
from typing import List, Optional, Sequence, Tuple, Union
import sys
from typing import Dict, List, Optional, Sequence, Tuple, Union
import spack.util.executable
@@ -72,7 +72,7 @@ def _core_requirements() -> List[RequiredResponseType]:
"bzip2": _missing("bzip2", "required to compress/decompress code archives"),
"git": _missing("git", "required to fetch/manage git repositories"),
}
if platform.system().lower() == "linux":
if sys.platform == "linux":
_core_system_exes["xz"] = _missing("xz", "required to compress/decompress code archives")
# Executables that are not bootstrapped yet
@@ -87,17 +87,16 @@ def _core_requirements() -> List[RequiredResponseType]:
def _buildcache_requirements() -> List[RequiredResponseType]:
_buildcache_exes = {
"file": _missing("file", "required to analyze files for buildcaches", system_only=False),
("gpg2", "gpg"): _missing("gpg2", "required to sign/verify buildcaches", False),
_buildcache_exes: Dict[ExecutablesType, str] = {
("gpg2", "gpg"): _missing("gpg2", "required to sign/verify buildcaches", False)
}
if platform.system().lower() == "darwin":
if sys.platform == "darwin":
_buildcache_exes["otool"] = _missing("otool", "required to relocate binaries")
# Executables that are not bootstrapped yet
result = [_required_system_executable(exe, msg) for exe, msg in _buildcache_exes.items()]
if platform.system().lower() == "linux":
if sys.platform == "linux":
result.append(
_required_executable(
"patchelf",

View File

@@ -29,7 +29,7 @@
# Tarball to be downloaded if binary packages are requested in a local mirror
BINARY_TARBALL = "https://github.com/spack/spack-bootstrap-mirrors/releases/download/v0.4/bootstrap-buildcache.tar.gz"
BINARY_TARBALL = "https://github.com/spack/spack-bootstrap-mirrors/releases/download/v0.6/bootstrap-buildcache.tar.gz"
#: Subdirectory where to create the mirror
LOCAL_MIRROR_DIR = "bootstrap_cache"
@@ -51,9 +51,9 @@
},
}
CLINGO_JSON = "$spack/share/spack/bootstrap/github-actions-v0.4/clingo.json"
GNUPG_JSON = "$spack/share/spack/bootstrap/github-actions-v0.4/gnupg.json"
PATCHELF_JSON = "$spack/share/spack/bootstrap/github-actions-v0.4/patchelf.json"
CLINGO_JSON = "$spack/share/spack/bootstrap/github-actions-v0.6/clingo.json"
GNUPG_JSON = "$spack/share/spack/bootstrap/github-actions-v0.6/gnupg.json"
PATCHELF_JSON = "$spack/share/spack/bootstrap/github-actions-v0.6/patchelf.json"
# Metadata for a generated source mirror
SOURCE_METADATA = {

View File

@@ -529,6 +529,7 @@ def __call__(self, parser, namespace, values, option_string):
# the const from the constructor or a value from the CLI.
# Note that this is only called if the argument is actually
# specified on the command line.
spack.config.CONFIG.ensure_scope_ordering()
spack.config.set(self.config_path, self.const, scope="command_line")

View File

@@ -431,6 +431,19 @@ def ensure_unwrapped(self) -> "Configuration":
"""Ensure we unwrap this object from any dynamic wrapper (like Singleton)"""
return self
def highest(self) -> ConfigScope:
"""Scope with highest precedence"""
return next(reversed(self.scopes.values())) # type: ignore
@_config_mutator
def ensure_scope_ordering(self):
"""Ensure that scope order matches documented precedent"""
# FIXME: We also need to consider that custom configurations and other orderings
# may not be preserved correctly
if "command_line" in self.scopes:
# TODO (when dropping python 3.6): self.scopes.move_to_end
self.scopes["command_line"] = self.remove_scope("command_line")
@_config_mutator
def push_scope(self, scope: ConfigScope) -> None:
"""Add a higher precedence scope to the Configuration."""

View File

@@ -3043,11 +3043,13 @@ def prepare_config_scope(self) -> None:
"""Add the manifest's scopes to the global configuration search path."""
for scope in self.env_config_scopes:
spack.config.CONFIG.push_scope(scope)
spack.config.CONFIG.ensure_scope_ordering()
def deactivate_config_scope(self) -> None:
"""Remove any of the manifest's scopes from the global config path."""
for scope in self.env_config_scopes:
spack.config.CONFIG.remove_scope(scope.name)
spack.config.CONFIG.ensure_scope_ordering()
@contextlib.contextmanager
def use_config(self):

View File

@@ -103,7 +103,7 @@
from spack.phase_callbacks import run_after, run_before
from spack.spec import InvalidSpecDetected, Spec
from spack.util.executable import *
from spack.util.filesystem import file_command, fix_darwin_install_name, mime_type
from spack.util.filesystem import fix_darwin_install_name
from spack.variant import any_combination_of, auto_or_any_combination_of, disjoint_sets
from spack.version import Version, ver

View File

@@ -23,7 +23,6 @@
import spack.store
import spack.util.elf as elf
import spack.util.executable as executable
import spack.util.filesystem as ssys
from .relocate_text import BinaryFilePrefixReplacer, TextFilePrefixReplacer
@@ -350,32 +349,6 @@ def _set_elf_rpaths_and_interpreter(
return None
def needs_binary_relocation(m_type, m_subtype):
"""Returns True if the file with MIME type/subtype passed as arguments
needs binary relocation, False otherwise.
Args:
m_type (str): MIME type of the file
m_subtype (str): MIME subtype of the file
"""
subtypes = ("x-executable", "x-sharedlib", "x-mach-binary", "x-pie-executable")
if m_type == "application":
if m_subtype in subtypes:
return True
return False
def needs_text_relocation(m_type, m_subtype):
"""Returns True if the file with MIME type/subtype passed as arguments
needs text relocation, False otherwise.
Args:
m_type (str): MIME type of the file
m_subtype (str): MIME subtype of the file
"""
return m_type == "text"
def relocate_macho_binaries(
path_names, old_layout_root, new_layout_root, prefix_to_prefix, rel, old_prefix, new_prefix
):
@@ -623,24 +596,32 @@ def relocate_text_bin(binaries, prefixes):
return BinaryFilePrefixReplacer.from_strings_or_bytes(prefixes).apply(binaries)
def is_binary(filename):
"""Returns true if a file is binary, False otherwise
def is_macho_magic(magic: bytes) -> bool:
return (
# In order of popularity: 64-bit mach-o le/be, 32-bit mach-o le/be.
magic.startswith(b"\xCF\xFA\xED\xFE")
or magic.startswith(b"\xFE\xED\xFA\xCF")
or magic.startswith(b"\xCE\xFA\xED\xFE")
or magic.startswith(b"\xFE\xED\xFA\xCE")
# universal binaries: 0xcafebabe be (most common?) or 0xbebafeca le (not sure if exists).
# Here we need to disambiguate mach-o and JVM class files. In mach-o the next 4 bytes are
# the number of binaries; in JVM class files it's the java version number. We assume there
# are less than 10 binaries in a universal binary.
or (magic.startswith(b"\xCA\xFE\xBA\xBE") and int.from_bytes(magic[4:8], "big") < 10)
or (magic.startswith(b"\xBE\xBA\xFE\xCA") and int.from_bytes(magic[4:8], "little") < 10)
)
Args:
filename: file to be tested
Returns:
True or False
"""
m_type, _ = ssys.mime_type(filename)
def is_elf_magic(magic: bytes) -> bool:
return magic.startswith(b"\x7FELF")
msg = "[{0}] -> ".format(filename)
if m_type == "application":
tty.debug(msg + "BINARY FILE")
return True
tty.debug(msg + "TEXT FILE")
return False
def is_binary(filename: str) -> bool:
"""Returns true iff a file is likely binary"""
with open(filename, "rb") as f:
magic = f.read(8)
return is_macho_magic(magic) or is_elf_magic(magic)
# Memoize this due to repeated calls to libraries in the same directory.
@@ -649,6 +630,14 @@ def _exists_dir(dirname):
return os.path.isdir(dirname)
def is_macho_binary(path):
try:
with open(path, "rb") as f:
return is_macho_magic(f.read(4))
except OSError:
return False
def fixup_macos_rpath(root, filename):
"""Apply rpath fixups to the given file.
@@ -660,7 +649,8 @@ def fixup_macos_rpath(root, filename):
True if fixups were applied, else False
"""
abspath = os.path.join(root, filename)
if ssys.mime_type(abspath) != ("application", "x-mach-binary"):
if not is_macho_binary(abspath):
return False
# Get Mach-O header commands

View File

@@ -4,12 +4,8 @@
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
import os
import re
import shutil
import tempfile
from collections import OrderedDict
from llnl.util.symlink import readlink, symlink
import spack.binary_distribution as bindist
import spack.deptypes as dt
@@ -20,19 +16,6 @@
import spack.store
def _relocate_spliced_links(links, orig_prefix, new_prefix):
"""Re-linking function which differs from `relocate.relocate_links` by
reading the old link rather than the new link, since the latter wasn't moved
in our case. This still needs to be called after the copy to destination
because it expects the new directory structure to be in place."""
for link in links:
link_target = readlink(os.path.join(orig_prefix, link))
link_target = re.sub("^" + orig_prefix, new_prefix, link_target)
new_link_path = os.path.join(new_prefix, link)
os.unlink(new_link_path)
symlink(link_target, new_link_path)
def rewire(spliced_spec):
"""Given a spliced spec, this function conducts all the rewiring on all
nodes in the DAG of that spec."""
@@ -54,13 +37,17 @@ def rewire_node(spec, explicit):
the splice. The resulting package is then 'installed.'"""
tempdir = tempfile.mkdtemp()
# copy anything installed to a temporary directory
shutil.copytree(spec.build_spec.prefix, os.path.join(tempdir, spec.dag_hash()))
# Copy spec.build_spec.prefix to spec.prefix through a temporary tarball
tarball = os.path.join(tempdir, f"{spec.dag_hash()}.tar.gz")
bindist.create_tarball(spec.build_spec, tarball)
spack.hooks.pre_install(spec)
bindist.extract_buildcache_tarball(tarball, destination=spec.prefix)
buildinfo = bindist.read_buildinfo_file(spec.prefix)
# compute prefix-to-prefix for every node from the build spec to the spliced
# spec
prefix_to_prefix = OrderedDict({spec.build_spec.prefix: spec.prefix})
prefix_to_prefix = {spec.build_spec.prefix: spec.prefix}
build_spec_ids = set(id(s) for s in spec.build_spec.traverse(deptype=dt.ALL & ~dt.BUILD))
for s in bindist.deps_to_relocate(spec):
analog = s
@@ -77,19 +64,17 @@ def rewire_node(spec, explicit):
prefix_to_prefix[analog.prefix] = s.prefix
manifest = bindist.get_buildfile_manifest(spec.build_spec)
platform = spack.platforms.by_name(spec.platform)
text_to_relocate = [
os.path.join(tempdir, spec.dag_hash(), rel_path)
for rel_path in manifest.get("text_to_relocate", [])
os.path.join(spec.prefix, rel_path) for rel_path in buildinfo["relocate_textfiles"]
]
if text_to_relocate:
relocate.relocate_text(files=text_to_relocate, prefixes=prefix_to_prefix)
links = [os.path.join(spec.prefix, f) for f in buildinfo["relocate_links"]]
relocate.relocate_links(links, prefix_to_prefix)
bins_to_relocate = [
os.path.join(tempdir, spec.dag_hash(), rel_path)
for rel_path in manifest.get("binary_to_relocate", [])
os.path.join(spec.prefix, rel_path) for rel_path in buildinfo["relocate_binaries"]
]
if bins_to_relocate:
if "macho" in platform.binary_formats:
@@ -113,22 +98,18 @@ def rewire_node(spec, explicit):
spec.prefix,
)
relocate.relocate_text_bin(binaries=bins_to_relocate, prefixes=prefix_to_prefix)
# Copy package into place, except for spec.json (because spec.json
# describes the old spec and not the new spliced spec).
shutil.copytree(
os.path.join(tempdir, spec.dag_hash()),
spec.prefix,
ignore=shutil.ignore_patterns("spec.json", "install_manifest.json"),
)
if manifest.get("link_to_relocate"):
_relocate_spliced_links(
manifest.get("link_to_relocate"), spec.build_spec.prefix, spec.prefix
)
shutil.rmtree(tempdir)
# Above, we did not copy spec.json: instead, here we write the new
# (spliced) spec into spec.json, without this, Database.add would fail on
# the next line (because it checks the spec.json in the prefix against the
# spec being added to look for mismatches)
install_manifest = os.path.join(
spec.prefix,
spack.store.STORE.layout.metadata_dir,
spack.store.STORE.layout.manifest_file_name,
)
try:
os.unlink(install_manifest)
except FileNotFoundError:
pass
# Write the spliced spec into spec.json. Without this, Database.add would fail because it
# checks the spec.json in the prefix against the spec being added to look for mismatches
spack.store.STORE.layout.write_spec(spec, spack.store.STORE.layout.spec_file_path(spec))
# add to database, not sure about explicit
spack.store.STORE.db.add(spec, explicit=explicit)

View File

@@ -23,7 +23,7 @@
import archspec.cpu
from llnl.util.filesystem import copy_tree, join_path, visit_directory_tree
from llnl.util.filesystem import copy_tree, join_path
from llnl.util.symlink import readlink
import spack.binary_distribution as bindist
@@ -43,7 +43,7 @@
import spack.util.spack_yaml as syaml
import spack.util.url as url_util
import spack.util.web as web_util
from spack.binary_distribution import CannotListKeys, GenerateIndexError, get_buildfile_manifest
from spack.binary_distribution import CannotListKeys, GenerateIndexError
from spack.directory_layout import DirectoryLayout
from spack.paths import test_path
from spack.spec import Spec
@@ -623,60 +623,21 @@ def test_FetchCacheError_pretty_printing_single():
assert str_e.rstrip() == str_e
def test_build_manifest_visitor(tmpdir):
dir = "directory"
file = os.path.join("directory", "file")
with tmpdir.as_cwd():
# Create a file inside a directory
os.mkdir(dir)
with open(file, "wb") as f:
f.write(b"example file")
# Symlink the dir
os.symlink(dir, "symlink_to_directory")
# Symlink the file
os.symlink(file, "symlink_to_file")
# Hardlink the file
os.link(file, "hardlink_of_file")
# Hardlinked symlinks: seems like this is only a thing on Linux,
# on Darwin the symlink *target* is hardlinked, on Linux the
# symlink *itself* is hardlinked.
if sys.platform.startswith("linux"):
os.link("symlink_to_file", "hardlink_of_symlink_to_file")
os.link("symlink_to_directory", "hardlink_of_symlink_to_directory")
visitor = bindist.BuildManifestVisitor()
visit_directory_tree(str(tmpdir), visitor)
# We de-dupe hardlinks of files, so there should really be just one file
assert len(visitor.files) == 1
# We do not de-dupe symlinks, cause it's unclear how to update symlinks
# in-place, preserving inodes.
if sys.platform.startswith("linux"):
assert len(visitor.symlinks) == 4 # includes hardlinks of symlinks.
else:
assert len(visitor.symlinks) == 2
with tmpdir.as_cwd():
assert not any(os.path.islink(f) or os.path.isdir(f) for f in visitor.files)
assert all(os.path.islink(f) for f in visitor.symlinks)
def test_text_relocate_if_needed(install_mockery, temporary_store, mock_fetch, monkeypatch, capfd):
def test_text_relocate_if_needed(install_mockery, temporary_store, mock_fetch, tmp_path):
install_cmd("needs-text-relocation")
spec = temporary_store.db.query_one("needs-text-relocation")
tgz_path = tmp_path / "relocatable.tar.gz"
bindist.create_tarball(spec, str(tgz_path))
specs = temporary_store.db.query("needs-text-relocation")
assert len(specs) == 1
manifest = get_buildfile_manifest(specs[0])
# extract the .spack/binary_distribution file
with tarfile.open(tgz_path) as tar:
entry_name = next(x for x in tar.getnames() if x.endswith(".spack/binary_distribution"))
bd_file = tar.extractfile(entry_name)
manifest = syaml.load(bd_file)
assert join_path("bin", "exe") in manifest["text_to_relocate"]
assert join_path("bin", "otherexe") not in manifest["text_to_relocate"]
assert join_path("bin", "secretexe") not in manifest["text_to_relocate"]
assert join_path("bin", "exe") in manifest["relocate_textfiles"]
assert join_path("bin", "otherexe") not in manifest["relocate_textfiles"]
assert join_path("bin", "secretexe") not in manifest["relocate_textfiles"]
def test_etag_fetching_304():
@@ -917,7 +878,7 @@ def test_tarball_doesnt_include_buildinfo_twice(tmp_path: Path):
tarball = str(tmp_path / "prefix.tar.gz")
bindist._do_create_tarball(
tarfile_path=tarball, binaries_dir=str(p), buildinfo={"metadata": "new"}
tarfile_path=tarball, prefix=str(p), buildinfo={"metadata": "new"}, prefixes_to_relocate=[]
)
expected_prefix = str(p).lstrip("/")
@@ -926,7 +887,10 @@ def test_tarball_doesnt_include_buildinfo_twice(tmp_path: Path):
# and that the tarball contains the new one, not the old one.
with tarfile.open(tarball) as tar:
assert syaml.load(tar.extractfile(f"{expected_prefix}/.spack/binary_distribution")) == {
"metadata": "new"
"metadata": "new",
"relocate_binaries": [],
"relocate_textfiles": [],
"relocate_links": [],
}
assert tar.getnames() == [
*_all_parents(expected_prefix),
@@ -951,11 +915,15 @@ def test_reproducible_tarball_is_reproducible(tmp_path: Path):
# Create a tarball with a certain mtime of bin/app
os.utime(app, times=(0, 0))
bindist._do_create_tarball(tarball_1, binaries_dir=str(p), buildinfo=buildinfo)
bindist._do_create_tarball(
tarball_1, prefix=str(p), buildinfo=buildinfo, prefixes_to_relocate=[]
)
# Do it another time with different mtime of bin/app
os.utime(app, times=(10, 10))
bindist._do_create_tarball(tarball_2, binaries_dir=str(p), buildinfo=buildinfo)
bindist._do_create_tarball(
tarball_2, prefix=str(p), buildinfo=buildinfo, prefixes_to_relocate=[]
)
# They should be bitwise identical:
assert filecmp.cmp(tarball_1, tarball_2, shallow=False)
@@ -1001,7 +969,7 @@ def test_tarball_normalized_permissions(tmpdir):
) as f:
f.write("hello world")
bindist._do_create_tarball(tarball, binaries_dir=p.strpath, buildinfo={})
bindist._do_create_tarball(tarball, prefix=p.strpath, buildinfo={}, prefixes_to_relocate=[])
expected_prefix = p.strpath.lstrip("/")
@@ -1120,7 +1088,7 @@ def test_tarfile_of_spec_prefix(tmpdir):
file = tmpdir.join("example.tar")
with tarfile.open(file, mode="w") as tar:
bindist.tarfile_of_spec_prefix(tar, prefix.strpath)
bindist.tarfile_of_spec_prefix(tar, prefix.strpath, prefixes_to_relocate=[])
expected_prefix = prefix.strpath.lstrip("/")

View File

@@ -1441,3 +1441,30 @@ def test_config_path_dsl(path, it_should_work, expected_parsed):
else:
with pytest.raises(ValueError):
spack.config.ConfigPath._validate(path)
@pytest.mark.regression("48254")
def test_env_activation_preserves_config_scopes(mutable_mock_env_path):
"""Check that the "command_line" scope remains the highest priority scope, when we activate,
or deactivate, environments.
"""
expected_cl_scope = spack.config.CONFIG.highest()
assert expected_cl_scope.name == "command_line"
# Creating an environment pushes a new scope
ev.create("test")
with ev.read("test"):
assert spack.config.CONFIG.highest() == expected_cl_scope
# No active environment pops the scope
with ev.no_active_environment():
assert spack.config.CONFIG.highest() == expected_cl_scope
assert spack.config.CONFIG.highest() == expected_cl_scope
# Switch the environment to another one
ev.create("test-2")
with ev.read("test-2"):
assert spack.config.CONFIG.highest() == expected_cl_scope
assert spack.config.CONFIG.highest() == expected_cl_scope
assert spack.config.CONFIG.highest() == expected_cl_scope

View File

@@ -36,8 +36,6 @@
macho_find_paths,
macho_make_paths_normal,
macho_make_paths_relative,
needs_binary_relocation,
needs_text_relocation,
relocate_links,
relocate_text,
)
@@ -193,16 +191,6 @@ def test_relocate_links(tmpdir):
assert readlink("to_self_but_relative") == "relative"
def test_needs_relocation():
assert needs_binary_relocation("application", "x-sharedlib")
assert needs_binary_relocation("application", "x-executable")
assert not needs_binary_relocation("application", "x-octet-stream")
assert not needs_binary_relocation("text", "x-")
assert needs_text_relocation("text", "x-")
assert not needs_text_relocation("symbolic link to", "x-")
assert needs_binary_relocation("application", "x-mach-binary")
def test_replace_paths(tmpdir):
with tmpdir.as_cwd():
suffix = "dylib" if platform.system().lower() == "darwin" else "so"

View File

@@ -10,7 +10,7 @@
import tarfile
from contextlib import closing, contextmanager
from gzip import GzipFile
from typing import Callable, Dict, Tuple
from typing import Callable, Dict, List, Tuple
from llnl.util.symlink import readlink
@@ -130,6 +130,15 @@ def default_path_to_name(path: str) -> str:
return pathlib.PurePath(*p.parts[1:]).as_posix() if p.is_absolute() else p.as_posix()
def default_add_file(tar: tarfile.TarFile, file_info: tarfile.TarInfo, path: str) -> None:
with open(path, "rb") as f:
tar.addfile(file_info, f)
def default_add_link(tar: tarfile.TarFile, file_info: tarfile.TarInfo, path: str) -> None:
tar.addfile(file_info)
def reproducible_tarfile_from_prefix(
tar: tarfile.TarFile,
prefix: str,
@@ -137,6 +146,9 @@ def reproducible_tarfile_from_prefix(
include_parent_directories: bool = False,
skip: Callable[[os.DirEntry], bool] = lambda entry: False,
path_to_name: Callable[[str], str] = default_path_to_name,
add_file: Callable[[tarfile.TarFile, tarfile.TarInfo, str], None] = default_add_file,
add_symlink: Callable[[tarfile.TarFile, tarfile.TarInfo, str], None] = default_add_link,
add_hardlink: Callable[[tarfile.TarFile, tarfile.TarInfo, str], None] = default_add_link,
) -> None:
"""Create a tarball from a given directory. Only adds regular files, symlinks and dirs.
Skips devices, fifos. Preserves hardlinks. Normalizes permissions like git. Tar entries are
@@ -170,8 +182,10 @@ def reproducible_tarfile_from_prefix(
tar.addfile(dir_info)
dir_stack = [prefix]
new_dirs: List[str] = []
while dir_stack:
dir = dir_stack.pop()
new_dirs.clear()
# Add the dir before its contents
dir_info = tarfile.TarInfo(path_to_name(dir))
@@ -183,7 +197,6 @@ def reproducible_tarfile_from_prefix(
with os.scandir(dir) as it:
entries = sorted(it, key=lambda entry: entry.name)
new_dirs = []
for entry in entries:
if skip(entry):
continue
@@ -201,7 +214,7 @@ def reproducible_tarfile_from_prefix(
# st_mode field of the stat structure is unspecified." So we set it to
# something sensible without lstat'ing the link.
file_info.mode = 0o755
tar.addfile(file_info)
add_symlink(tar, file_info, entry.path)
elif entry.is_file(follow_symlinks=False):
# entry.stat has zero (st_ino, st_dev, st_nlink) on Windows: use lstat.
@@ -216,15 +229,13 @@ def reproducible_tarfile_from_prefix(
if ident in hardlink_to_tarinfo_name:
file_info.type = tarfile.LNKTYPE
file_info.linkname = hardlink_to_tarinfo_name[ident]
tar.addfile(file_info)
add_hardlink(tar, file_info, entry.path)
continue
hardlink_to_tarinfo_name[ident] = file_info.name
# If file not yet seen, copy it
file_info.type = tarfile.REGTYPE
file_info.size = s.st_size
with open(entry.path, "rb") as f:
tar.addfile(file_info, f)
add_file(tar, file_info, entry.path)
dir_stack.extend(reversed(new_dirs)) # we pop, so reverse to stay alphabetical

View File

@@ -10,62 +10,10 @@
import glob
import os
import sys
from llnl.util import tty
from llnl.util.filesystem import edit_in_place_through_temporary_file
from llnl.util.lang import memoized
from spack.util.executable import Executable, which
def _ensure_file_on_win():
"""Ensures the file command is available on Windows
If not, it is bootstrapped.
No-op on all other platforms"""
if sys.platform != "win32":
return
import spack.bootstrap
with spack.bootstrap.ensure_bootstrap_configuration():
spack.bootstrap.ensure_file_in_path_or_raise()
@memoized
def file_command(*args):
"""Creates entry point to `file` system command with provided arguments"""
_ensure_file_on_win()
file_cmd = which("file", required=True)
for arg in args:
file_cmd.add_default_arg(arg)
return file_cmd
@memoized
def _get_mime_type():
"""Generate method to call `file` system command to aquire mime type
for a specified path
"""
if sys.platform == "win32":
# -h option (no-dereference) does not exist in Windows
return file_command("-b", "--mime-type")
else:
return file_command("-b", "-h", "--mime-type")
def mime_type(filename):
"""Returns the mime type and subtype of a file.
Args:
filename: file to be analyzed
Returns:
Tuple containing the MIME type and subtype
"""
output = _get_mime_type()(filename, output=str, error=str).strip()
tty.debug("==> " + output)
type, _, subtype = output.partition("/")
return type, subtype
from spack.util.executable import Executable
def fix_darwin_install_name(path):

View File

@@ -1,4 +0,0 @@
from spack.util.filesystem import file_command
if __name__ == "__main__":
file_command()

View File

@@ -21,6 +21,11 @@ class AmrWind(CMakePackage, CudaPackage, ROCmPackage):
license("BSD-3-Clause")
version("main", branch="main", submodules=True)
version("3.3.1", tag="v3.3.1", submodules=True)
version("3.3.0", tag="v3.3.0", submodules=True)
version("3.2.3", tag="v3.2.3", submodules=True)
version("3.2.2", tag="v3.2.2", submodules=True)
version("3.2.1", tag="v3.2.1", submodules=True)
version("3.2.0", tag="v3.2.0", submodules=True)
version("3.1.7", tag="v3.1.7", submodules=True)
version("3.1.6", tag="v3.1.6", submodules=True)
@@ -77,6 +82,7 @@ class AmrWind(CMakePackage, CudaPackage, ROCmPackage):
variant(
"waves2amr", default=False, description="Enable Waves2AMR support for ocean wave input"
)
variant("fft", default=False, description="Enable FFT support for MAC projection")
depends_on("mpi", when="+mpi")
depends_on("hdf5~mpi", when="+hdf5~mpi")
@@ -102,6 +108,7 @@ class AmrWind(CMakePackage, CudaPackage, ROCmPackage):
depends_on("helics@:3.3.2", when="+helics")
depends_on("helics@:3.3.2+mpi", when="+helics+mpi")
depends_on("fftw", when="@2.1: +waves2amr")
depends_on("fftw", when="@3.3.1: +fft")
for arch in CudaPackage.cuda_arch_values:
depends_on("hypre+cuda cuda_arch=%s" % arch, when="+cuda+hypre cuda_arch=%s" % arch)
@@ -137,6 +144,10 @@ def cmake_args(self):
"rocm",
"tests",
"tiny_profile",
"fft",
"helics",
"umpire",
"sycl",
]
args = [self.define_from_variant("AMR_WIND_ENABLE_%s" % v.upper(), v) for v in vs]
@@ -161,19 +172,19 @@ def cmake_args(self):
args.append("-DAMReX_AMD_ARCH=" + ";".join(str(x) for x in targets))
if spec.satisfies("+umpire"):
args.append(self.define_from_variant("AMR_WIND_ENABLE_UMPIRE", "umpire"))
args.append(define("UMPIRE_DIR", spec["umpire"].prefix))
if spec.satisfies("+helics"):
args.append(self.define_from_variant("AMR_WIND_ENABLE_HELICS", "helics"))
args.append(define("HELICS_DIR", spec["helics"].prefix))
if spec.satisfies("+waves2amr"):
args.append(self.define_from_variant("AMR_WIND_ENABLE_W2A", "waves2amr"))
args.append(define("FFTW_DIR", spec["fftw"].prefix))
if spec.satisfies("+fft"):
args.append(define("FFTW_DIR", spec["fftw"].prefix))
if spec.satisfies("+sycl"):
args.append(define("AMR_WIND_ENABLE_SYCL", True))
requires(
"%dpcpp",
"%oneapi",

View File

@@ -53,11 +53,6 @@ def setup_dependent_package(self, module, dependent_spec):
spec.mpifc = dependent_module.spack_fc
spec.mpif77 = dependent_module.spack_f77
spec.mpicxx_shared_libs = [
join_path(self.prefix.lib, "libmpicxx.{0}".format(dso_suffix)),
join_path(self.prefix.lib, "libmpi.{0}".format(dso_suffix)),
]
def install(self, spec, prefix):
raise InstallError(
self.spec.format(

View File

@@ -15,6 +15,7 @@ class Freeglut(CMakePackage, SourceforgePackage):
license("MIT")
version("3.6.0", sha256="9c3d4d6516fbfa0280edc93c77698fb7303e443c1aaaf37d269e3288a6c3ea52")
version("3.2.2", sha256="c5944a082df0bba96b5756dddb1f75d0cd72ce27b5395c6c1dde85c2ff297a50")
version("3.2.1", sha256="d4000e02102acaf259998c870e25214739d1f16f67f99cb35e4f46841399da68")
version("3.0.0", sha256="2a43be8515b01ea82bcfa17d29ae0d40bd128342f0930cd1f375f1ff999f76a2")
@@ -42,17 +43,17 @@ class Freeglut(CMakePackage, SourceforgePackage):
patch(
"https://gitweb.gentoo.org/repo/gentoo.git/plain/media-libs/freeglut/files/freeglut-3.2.1-gcc10-fno-common.patch?id=f9102571b69d9fc05471a592fda252681fdfdef1",
sha256="898e8fb314cbe728d791e9ea69829313143cda039c008f0ca06c1b5730922aa7",
when="@3.2.1 %gcc@10.0:",
when="@3:3.2.1 %gcc@10.0:",
)
patch(
"https://gitweb.gentoo.org/repo/gentoo.git/plain/media-libs/freeglut/files/freeglut-3.2.1-gcc10-fno-common.patch?id=f9102571b69d9fc05471a592fda252681fdfdef1",
sha256="898e8fb314cbe728d791e9ea69829313143cda039c008f0ca06c1b5730922aa7",
when="@3.2.1 %clang@11.0:",
when="@3:3.2.1 %clang@11.0:",
)
patch(
"https://gitweb.gentoo.org/repo/gentoo.git/plain/media-libs/freeglut/files/freeglut-3.2.1-gcc10-fno-common.patch?id=f9102571b69d9fc05471a592fda252681fdfdef1",
sha256="898e8fb314cbe728d791e9ea69829313143cda039c008f0ca06c1b5730922aa7",
when="@3.2.1 %aocc@2.3.0:",
when="@3:3.2.1 %aocc@2.3.0:",
)
def cmake_args(self):

View File

@@ -169,8 +169,12 @@ def setup_run_environment(self, env):
# environment as in Gaudi.xenv
env.prepend_path("PATH", self.prefix.scripts)
env.prepend_path("PYTHONPATH", self.prefix.python)
for d in self.libs.directories:
env.prepend_path("LD_LIBRARY_PATH", d)
# Note: ROOT dependency automatically sets up ROOT environment vars
# ...but Gaudi additionally requires a path variable about itself
for lib_path in [self.prefix.lib, self.prefix.lib64]:
env.prepend_path("LD_LIBRARY_PATH", lib_path)
def url_for_version(self, version):
major = str(version[0])

View File

@@ -0,0 +1,323 @@
Makefile.am | 8 +-
ax_cblas.m4 | 69 +++++
bspline/Makefile.am | 2 +-
configure.ac | 10 +
eigen/Makefile.am | 2 +-
gsl-config.in | 4 +-
gsl.pc.in | 2 +-
interpolation/Makefile.am | 2 +-
linalg/Makefile.am | 2 +-
multifit/Makefile.am | 4 +-
multimin/Makefile.am | 4 +-
multiroots/Makefile.am | 2 +-
ode-initval/Makefile.am | 2 +-
poly/Makefile.am | 2 +-
specfunc/Makefile.am | 2 +-
wavelet/Makefile.am | 2 +-
31 files changed, 1157 insertions(+), 19 deletions(-)
diff --git a/Makefile.am b/Makefile.am
index c522001..4513bc8 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -19,7 +19,7 @@ EXTRA_DIST = autogen.sh gsl-config.in gsl.pc.in configure.ac THANKS BUGS gsl.spe
lib_LTLIBRARIES = libgsl.la
libgsl_la_SOURCES = version.c
-libgsl_la_LIBADD = $(GSL_LIBADD) $(SUBLIBS)
+libgsl_la_LIBADD = $(GSL_LIBADD) $(SUBLIBS) @CBLAS_LINK_LIBS@
libgsl_la_LDFLAGS = $(GSL_LDFLAGS) -version-info $(GSL_LT_VERSION)
noinst_HEADERS = templates_on.h templates_off.h build.h
@@ -29,10 +29,10 @@ m4data_DATA = gsl.m4
bin_PROGRAMS = gsl-randist gsl-histogram
gsl_randist_SOURCES = gsl-randist.c
-gsl_randist_LDADD = libgsl.la cblas/libgslcblas.la
+gsl_randist_LDADD = libgsl.la
gsl_histogram_SOURCES = gsl-histogram.c
-gsl_histogram_LDADD = libgsl.la cblas/libgslcblas.la
+gsl_histogram_LDADD = libgsl.la
check_SCRIPTS = test_gsl_histogram.sh pkgconfig.test
TESTS = test_gsl_histogram.sh pkgconfig.test
@@ -51,6 +51,8 @@ edit = $(SED) \
-e 's|@GSL_CFLAGS[@]|$(GSL_CFLAGS)|g' \
-e 's|@GSL_LIBM[@]|$(GSL_LIBM)|g' \
-e 's|@GSL_LIBS[@]|$(GSL_LIBS)|g' \
+ -e 's|@CBLAS_CFLAGS[@]|$(CBLAS_CFLAGS)|g' \
+ -e 's|@CBLAS_LIBS[@]|$(CBLAS_LIBS)|g' \
-e 's|@LIBS[@]|$(LIBS)|g' \
-e 's|@VERSION[@]|$(VERSION)|g'
diff --git a/ax_cblas.m4 b/ax_cblas.m4
new file mode 100644
index 0000000..6ef143a
--- /dev/null
+++ b/ax_cblas.m4
@@ -0,0 +1,69 @@
+AC_DEFUN([AX_CBLAS],[
+
+ ext_cblas=no
+ ext_cblas_libs="-lcblas"
+ ext_cblas_cflags=""
+
+ AC_ARG_WITH(cblas-external,
+ [AS_HELP_STRING([--with-cblas-external],
+ [Use external CBLAS library (default is no)])],
+ [with_ext_cblas=$withval],
+ [with_ext_cblas=no])
+
+ case $with_ext_cblas in
+ no) ext_cblas=no ;;
+ yes) ext_cblas=yes ;;
+ -* | */* | *.a | *.so | *.so.* | *.o)
+ ext_cblas=yes
+ ext_cblas_libs="$with_cblas" ;;
+ *) ext_cblas=yes
+ ext_cblas_libs="-l$with_cblas" ;;
+ esac
+
+ AC_ARG_WITH(cblas-external-libs,
+ [AS_HELP_STRING([--with-cblas-external-libs=<libs>],
+ [External cblas libraries to link with (default is "$ext_cblas_libs")])],
+ [ext_cblas_libs=$withval],
+ [])
+
+ AC_ARG_WITH(cblas-external-cflags,
+ [AS_HELP_STRING([--with-cblas-external-cflags=<flags>],
+ [Pre-processing flags to compile with external cblas ("-I<dir>")])],
+ [ext_cblas_cflags=$withval],
+ [])
+
+ if test x$ext_cblas != xno; then
+ if test "x$CBLAS_LIBS" = x; then
+ CBLAS_LIBS="$ext_cblas_libs"
+ fi
+ if test "x$CBLAS_CFLAGS" = x; then
+ CBLAS_CFLAGS="$ext_cblas_cflags"
+ fi
+
+ CFLAGS_sav="$CFLAGS"
+ CFLAGS="$CFLAGS $CBLAS_CFLAGS"
+ AC_CHECK_HEADER(cblas.h, ,
+ [AC_MSG_ERROR([
+ *** Header file cblas.h not found.
+ *** If you installed cblas header in a non standard place,
+ *** specify its install prefix using the following option
+ *** --with-cblas-external-cflags="-I<include_dir>"])
+ ])
+ CFLAGS="$CFLAGS_sav"
+
+ LIBS_sav="$LIBS"
+ LIBS="$LIBS $CBLAS_LIBS -lm"
+ AC_MSG_CHECKING([for cblas_sgemm in $CBLAS_LIBS])
+ AC_TRY_LINK_FUNC(cblas_sgemm, [ext_cblas=yes],
+ [AC_MSG_ERROR([
+ *** Linking with cblas with $LIBS failed.
+ *** If you installed cblas library in a non standard place,
+ *** specify its install prefix using the following option
+ *** --with-cblas-external-libs="-L<lib_dir> -l<lib>"])
+ ])
+ AC_MSG_RESULT($ext_cblas)
+ LIBS="$LIBS_sav"
+ AC_SUBST([CBLAS_CFLAGS])
+ AC_SUBST([CBLAS_LIBS])
+ fi
+])
diff --git a/bspline/Makefile.am b/bspline/Makefile.am
index 3f4f950..d413036 100644
--- a/bspline/Makefile.am
+++ b/bspline/Makefile.am
@@ -12,6 +12,6 @@ check_PROGRAMS = test
TESTS = $(check_PROGRAMS)
-test_LDADD = libgslbspline.la ../multifit/libgslmultifit.la ../linalg/libgsllinalg.la ../permutation/libgslpermutation.la ../blas/libgslblas.la ../matrix/libgslmatrix.la ../vector/libgslvector.la ../block/libgslblock.la ../complex/libgslcomplex.la ../cblas/libgslcblas.la ../ieee-utils/libgslieeeutils.la ../err/libgslerr.la ../test/libgsltest.la ../sys/libgslsys.la ../utils/libutils.la ../statistics/libgslstatistics.la ../poly/libgslpoly.la ../integration/libgslintegration.la ../rng/libgslrng.la ../sort/libgslsort.la
+test_LDADD = libgslbspline.la ../multifit/libgslmultifit.la ../linalg/libgsllinalg.la ../permutation/libgslpermutation.la ../blas/libgslblas.la ../matrix/libgslmatrix.la ../vector/libgslvector.la ../block/libgslblock.la ../complex/libgslcomplex.la @CBLAS_LINK_LIBS@ ../ieee-utils/libgslieeeutils.la ../err/libgslerr.la ../test/libgsltest.la ../sys/libgslsys.la ../utils/libutils.la ../statistics/libgslstatistics.la ../poly/libgslpoly.la ../integration/libgslintegration.la ../rng/libgslrng.la ../sort/libgslsort.la
test_SOURCES = test.c
diff --git a/configure.ac b/configure.ac
index a26fc1e..564d426 100644
--- a/configure.ac
+++ b/configure.ac
@@ -208,6 +208,16 @@ if test "x$LIBS" = "x" ; then
AC_CHECK_LIB(m, cos)
fi
+sinclude(ax_cblas.m4)
+AX_CBLAS
+if test "x$CBLAS_LIBS" != "x"; then
+ CBLAS_LINK_LIBS="$CBLAS_LIBS"
+else
+ CBLAS_LINK_LIBS="\$(top_builddir)/cblas/libgslcblas.la"
+ CBLAS_LIBS="-lgslcblas"
+fi
+AC_SUBST(CBLAS_LINK_LIBS)
+
dnl Remember to put a definition in acconfig.h for each of these
AC_CHECK_DECLS(feenableexcept,,,[#define _GNU_SOURCE 1
#include <fenv.h>])
diff --git a/eigen/Makefile.am b/eigen/Makefile.am
index c28bfde..14197a4 100644
--- a/eigen/Makefile.am
+++ b/eigen/Makefile.am
@@ -11,7 +11,7 @@ noinst_HEADERS = qrstep.c
TESTS = $(check_PROGRAMS)
-test_LDADD = libgsleigen.la ../test/libgsltest.la ../linalg/libgsllinalg.la ../permutation/libgslpermutation.la ../blas/libgslblas.la ../cblas/libgslcblas.la ../matrix/libgslmatrix.la ../vector/libgslvector.la ../block/libgslblock.la ../complex/libgslcomplex.la ../ieee-utils/libgslieeeutils.la ../sys/libgslsys.la ../err/libgslerr.la ../utils/libutils.la ../rng/libgslrng.la ../sort/libgslsort.la
+test_LDADD = libgsleigen.la ../test/libgsltest.la ../linalg/libgsllinalg.la ../permutation/libgslpermutation.la ../blas/libgslblas.la @CBLAS_LINK_LIBS@ ../matrix/libgslmatrix.la ../vector/libgslvector.la ../block/libgslblock.la ../complex/libgslcomplex.la ../ieee-utils/libgslieeeutils.la ../sys/libgslsys.la ../err/libgslerr.la ../utils/libutils.la ../rng/libgslrng.la ../sort/libgslsort.la
test_SOURCES = test.c
diff --git a/gsl-config.in b/gsl-config.in
old mode 100755
new mode 100644
index 3f3fa61..c9c4262
--- a/gsl-config.in
+++ b/gsl-config.in
@@ -58,11 +58,11 @@ while test $# -gt 0; do
;;
--cflags)
- echo @GSL_CFLAGS@
+ echo @GSL_CFLAGS@ @CBLAS_CFLAGS@
;;
--libs)
- : ${GSL_CBLAS_LIB=-lgslcblas}
+ : ${GSL_CBLAS_LIB=@CBLAS_LIBS@}
echo @GSL_LIBS@ $GSL_CBLAS_LIB @GSL_LIBM@
;;
diff --git a/gsl.pc.in b/gsl.pc.in
index 5e9ef21..5a7a0f3 100644
--- a/gsl.pc.in
+++ b/gsl.pc.in
@@ -2,7 +2,7 @@ prefix=@prefix@
exec_prefix=@exec_prefix@
libdir=@libdir@
includedir=@includedir@
-GSL_CBLAS_LIB=-lgslcblas
+GSL_CBLAS_LIB=@CBLAS_LIBS@
Name: GSL
Description: GNU Scientific Library
diff --git a/interpolation/Makefile.am b/interpolation/Makefile.am
index 1d80755..e45bd51 100644
--- a/interpolation/Makefile.am
+++ b/interpolation/Makefile.am
@@ -12,7 +12,7 @@ AM_CPPFLAGS = -I$(top_srcdir)
TESTS = $(check_PROGRAMS)
-test_LDADD = libgslinterpolation.la ../poly/libgslpoly.la ../linalg/libgsllinalg.la ../permutation/libgslpermutation.la ../blas/libgslblas.la ../matrix/libgslmatrix.la ../vector/libgslvector.la ../block/libgslblock.la ../complex/libgslcomplex.la ../cblas/libgslcblas.la ../ieee-utils/libgslieeeutils.la ../err/libgslerr.la ../test/libgsltest.la ../sys/libgslsys.la ../utils/libutils.la
+test_LDADD = libgslinterpolation.la ../poly/libgslpoly.la ../linalg/libgsllinalg.la ../permutation/libgslpermutation.la ../blas/libgslblas.la ../matrix/libgslmatrix.la ../vector/libgslvector.la ../block/libgslblock.la ../complex/libgslcomplex.la @CBLAS_LINK_LIBS@ ../ieee-utils/libgslieeeutils.la ../err/libgslerr.la ../test/libgsltest.la ../sys/libgslsys.la ../utils/libutils.la
test_SOURCES = test.c
diff --git a/linalg/Makefile.am b/linalg/Makefile.am
index a6c15b0..447ebbe 100644
--- a/linalg/Makefile.am
+++ b/linalg/Makefile.am
@@ -13,4 +13,4 @@ TESTS = $(check_PROGRAMS)
check_PROGRAMS = test
test_SOURCES = test.c
-test_LDADD = libgsllinalg.la ../blas/libgslblas.la ../cblas/libgslcblas.la ../permutation/libgslpermutation.la ../matrix/libgslmatrix.la ../vector/libgslvector.la ../block/libgslblock.la ../complex/libgslcomplex.la ../ieee-utils/libgslieeeutils.la ../err/libgslerr.la ../test/libgsltest.la ../sys/libgslsys.la ../utils/libutils.la ../rng/libgslrng.la
+test_LDADD = libgsllinalg.la ../blas/libgslblas.la @CBLAS_LINK_LIBS@ ../permutation/libgslpermutation.la ../matrix/libgslmatrix.la ../vector/libgslvector.la ../block/libgslblock.la ../complex/libgslcomplex.la ../ieee-utils/libgslieeeutils.la ../err/libgslerr.la ../test/libgsltest.la ../sys/libgslsys.la ../utils/libutils.la ../rng/libgslrng.la
diff --git a/multifit/Makefile.am b/multifit/Makefile.am
index 988614e..793b485 100644
--- a/multifit/Makefile.am
+++ b/multifit/Makefile.am
@@ -67,8 +67,8 @@ check_PROGRAMS = test #demo
TESTS = $(check_PROGRAMS)
test_SOURCES = test.c
-test_LDADD = libgslmultifit.la ../linalg/libgsllinalg.la ../permutation/libgslpermutation.la ../blas/libgslblas.la ../cblas/libgslcblas.la ../matrix/libgslmatrix.la ../sort/libgslsort.la ../statistics/libgslstatistics.la ../vector/libgslvector.la ../block/libgslblock.la ../complex/libgslcomplex.la ../ieee-utils/libgslieeeutils.la ../err/libgslerr.la ../test/libgsltest.la ../utils/libutils.la ../sys/libgslsys.la ../rng/libgslrng.la ../specfunc/libgslspecfunc.la ../min/libgslmin.la
+test_LDADD = libgslmultifit.la ../linalg/libgsllinalg.la ../permutation/libgslpermutation.la ../blas/libgslblas.la @CBLAS_LINK_LIBS@ ../matrix/libgslmatrix.la ../sort/libgslsort.la ../statistics/libgslstatistics.la ../vector/libgslvector.la ../block/libgslblock.la ../complex/libgslcomplex.la ../ieee-utils/libgslieeeutils.la ../err/libgslerr.la ../test/libgsltest.la ../utils/libutils.la ../sys/libgslsys.la ../rng/libgslrng.la ../specfunc/libgslspecfunc.la ../min/libgslmin.la
#demo_SOURCES = demo.c
-#demo_LDADD = libgslmultifit.la ../linalg/libgsllinalg.la ../permutation/libgslpermutation.la ../blas/libgslblas.la ../cblas/libgslcblas.la ../matrix/libgslmatrix.la ../vector/libgslvector.la ../block/libgslblock.la ../randist/libgslrandist.la ../rng/libgslrng.la ../complex/libgslcomplex.la ../ieee-utils/libgslieeeutils.la ../err/libgslerr.la ../test/libgsltest.la ../utils/libutils.la ../sys/libgslsys.la
+#demo_LDADD = libgslmultifit.la ../linalg/libgsllinalg.la ../permutation/libgslpermutation.la ../blas/libgslblas.la @CBLAS_LINK_LIBS@ ../matrix/libgslmatrix.la ../vector/libgslvector.la ../block/libgslblock.la ../randist/libgslrandist.la ../rng/libgslrng.la ../complex/libgslcomplex.la ../ieee-utils/libgslieeeutils.la ../err/libgslerr.la ../test/libgsltest.la ../utils/libutils.la ../sys/libgslsys.la
diff --git a/multimin/Makefile.am b/multimin/Makefile.am
index 7071359..65a488a 100644
--- a/multimin/Makefile.am
+++ b/multimin/Makefile.am
@@ -13,8 +13,8 @@ check_PROGRAMS = test #demo
TESTS = $(check_PROGRAMS)
test_SOURCES = test.c test_funcs.c test_funcs.h
-test_LDADD = libgslmultimin.la ../min/libgslmin.la ../poly/libgslpoly.la ../blas/libgslblas.la ../cblas/libgslcblas.la ../linalg/libgsllinalg.la ../permutation/libgslpermutation.la ../matrix/libgslmatrix.la ../vector/libgslvector.la ../block/libgslblock.la ../complex/libgslcomplex.la ../ieee-utils/libgslieeeutils.la ../err/libgslerr.la ../test/libgsltest.la ../sys/libgslsys.la ../utils/libutils.la
+test_LDADD = libgslmultimin.la ../min/libgslmin.la ../poly/libgslpoly.la ../blas/libgslblas.la @CBLAS_LINK_LIBS@ ../linalg/libgsllinalg.la ../permutation/libgslpermutation.la ../matrix/libgslmatrix.la ../vector/libgslvector.la ../block/libgslblock.la ../complex/libgslcomplex.la ../ieee-utils/libgslieeeutils.la ../err/libgslerr.la ../test/libgsltest.la ../sys/libgslsys.la ../utils/libutils.la
#demo_SOURCES = demo.c
-#demo_LDADD = libgslmultimin.la ../min/libgslmin.la ../blas/libgslblas.la ../cblas/libgslcblas.la ../linalg/libgsllinalg.la ../matrix/libgslmatrix.la ../vector/libgslvector.la ../block/libgslblock.la ../complex/libgslcomplex.la ../ieee-utils/libgslieeeutils.la ../err/libgslerr.la ../test/libgsltest.la ../sys/libgslsys.la ../utils/libutils.la
+#demo_LDADD = libgslmultimin.la ../min/libgslmin.la ../blas/libgslblas.la @CBLAS_LINK_LIBS@ ../linalg/libgsllinalg.la ../matrix/libgslmatrix.la ../vector/libgslvector.la ../block/libgslblock.la ../complex/libgslcomplex.la ../ieee-utils/libgslieeeutils.la ../err/libgslerr.la ../test/libgsltest.la ../sys/libgslsys.la ../utils/libutils.la
diff --git a/multiroots/Makefile.am b/multiroots/Makefile.am
index a351c3f..6178448 100644
--- a/multiroots/Makefile.am
+++ b/multiroots/Makefile.am
@@ -15,5 +15,5 @@ check_PROGRAMS = test
TESTS = $(check_PROGRAMS)
test_SOURCES = test.c test_funcs.c test_funcs.h
-test_LDADD = libgslmultiroots.la ../linalg/libgsllinalg.la ../blas/libgslblas.la ../cblas/libgslcblas.la ../permutation/libgslpermutation.la ../matrix/libgslmatrix.la ../vector/libgslvector.la ../block/libgslblock.la ../complex/libgslcomplex.la ../ieee-utils/libgslieeeutils.la ../err/libgslerr.la ../test/libgsltest.la ../sys/libgslsys.la ../utils/libutils.la
+test_LDADD = libgslmultiroots.la ../linalg/libgsllinalg.la ../blas/libgslblas.la @CBLAS_LINK_LIBS@ ../permutation/libgslpermutation.la ../matrix/libgslmatrix.la ../vector/libgslvector.la ../block/libgslblock.la ../complex/libgslcomplex.la ../ieee-utils/libgslieeeutils.la ../err/libgslerr.la ../test/libgsltest.la ../sys/libgslsys.la ../utils/libutils.la
diff --git a/ode-initval/Makefile.am b/ode-initval/Makefile.am
index 9c774b5..346c381 100644
--- a/ode-initval/Makefile.am
+++ b/ode-initval/Makefile.am
@@ -12,7 +12,7 @@ check_PROGRAMS = test
TESTS = $(check_PROGRAMS)
-test_LDADD = libgslodeiv.la ../linalg/libgsllinalg.la ../blas/libgslblas.la ../cblas/libgslcblas.la ../matrix/libgslmatrix.la ../permutation/libgslpermutation.la ../vector/libgslvector.la ../block/libgslblock.la ../complex/libgslcomplex.la ../ieee-utils/libgslieeeutils.la ../err/libgslerr.la ../test/libgsltest.la ../sys/libgslsys.la ../utils/libutils.la
+test_LDADD = libgslodeiv.la ../linalg/libgsllinalg.la ../blas/libgslblas.la @CBLAS_LINK_LIBS@ ../matrix/libgslmatrix.la ../permutation/libgslpermutation.la ../vector/libgslvector.la ../block/libgslblock.la ../complex/libgslcomplex.la ../ieee-utils/libgslieeeutils.la ../err/libgslerr.la ../test/libgsltest.la ../sys/libgslsys.la ../utils/libutils.la
test_SOURCES = test.c
diff --git a/poly/Makefile.am b/poly/Makefile.am
index f1dae5d..e0f8e83 100644
--- a/poly/Makefile.am
+++ b/poly/Makefile.am
@@ -10,7 +10,7 @@ noinst_HEADERS = balance.c companion.c qr.c
TESTS = $(check_PROGRAMS)
-check_PROGRAMS = test
+#check_PROGRAMS = test
test_SOURCES = test.c
test_LDADD = libgslpoly.la ../ieee-utils/libgslieeeutils.la ../err/libgslerr.la ../test/libgsltest.la ../sys/libgslsys.la ../utils/libutils.la ../sort/libgslsort.la
diff --git a/specfunc/Makefile.am b/specfunc/Makefile.am
index eba9ab2..772cc7e 100644
--- a/specfunc/Makefile.am
+++ b/specfunc/Makefile.am
@@ -12,7 +12,7 @@ TESTS = $(check_PROGRAMS)
check_PROGRAMS = test
-test_LDADD = libgslspecfunc.la ../eigen/libgsleigen.la ../linalg/libgsllinalg.la ../sort/libgslsort.la ../matrix/libgslmatrix.la ../vector/libgslvector.la ../blas/libgslblas.la ../cblas/libgslcblas.la ../block/libgslblock.la ../complex/libgslcomplex.la ../poly/libgslpoly.la ../ieee-utils/libgslieeeutils.la ../err/libgslerr.la ../test/libgsltest.la ../sys/libgslsys.la ../utils/libutils.la
+test_LDADD = libgslspecfunc.la ../eigen/libgsleigen.la ../linalg/libgsllinalg.la ../sort/libgslsort.la ../matrix/libgslmatrix.la ../vector/libgslvector.la ../blas/libgslblas.la @CBLAS_LINK_LIBS@ ../block/libgslblock.la ../complex/libgslcomplex.la ../poly/libgslpoly.la ../ieee-utils/libgslieeeutils.la ../err/libgslerr.la ../test/libgsltest.la ../sys/libgslsys.la ../utils/libutils.la
test_SOURCES = test_sf.c test_sf.h test_airy.c test_bessel.c test_coulomb.c test_dilog.c test_gamma.c test_hyperg.c test_legendre.c test_mathieu.c
diff --git a/wavelet/Makefile.am b/wavelet/Makefile.am
index 9da20d8..8cdbd77 100644
--- a/wavelet/Makefile.am
+++ b/wavelet/Makefile.am
@@ -10,7 +10,7 @@ check_PROGRAMS = test
TESTS = $(check_PROGRAMS)
-test_LDADD = libgslwavelet.la ../matrix/libgslmatrix.la ../vector/libgslvector.la ../blas/libgslblas.la ../cblas/libgslcblas.la ../block/libgslblock.la ../ieee-utils/libgslieeeutils.la ../err/libgslerr.la ../test/libgsltest.la ../sys/libgslsys.la ../utils/libutils.la
+test_LDADD = libgslwavelet.la ../matrix/libgslmatrix.la ../vector/libgslvector.la ../blas/libgslblas.la @CBLAS_LINK_LIBS@ ../block/libgslblock.la ../ieee-utils/libgslieeeutils.la ../err/libgslerr.la ../test/libgsltest.la ../sys/libgslsys.la ../utils/libutils.la
test_SOURCES = test.c

View File

@@ -39,7 +39,8 @@ class Gsl(AutotoolsPackage, GNUMirrorPackage):
# from https://dev.gentoo.org/~mgorny/dist/gsl-2.3-cblas.patch.bz2
patch("gsl-2.3-cblas.patch", when="@2.3:2.5+external-cblas")
patch("gsl-2.6-cblas.patch", when="@2.6: +external-cblas")
patch("gsl-2.6-cblas.patch", when="@2.6:2.7 +external-cblas")
patch("gsl-2.8-cblas.patch", when="@2.8: +external-cblas")
conflicts("+external-cblas", when="@:2.2")

View File

@@ -16,6 +16,7 @@ class Herwig3(AutotoolsPackage):
license("GPL-3.0-only")
version("7.3.0", sha256="2624819d2dff105ba952ea1b5cf12eb6f4926d4951774a41907699e2f567686c")
version("7.2.3", sha256="5599899379b01b09e331a2426d78d39b7f6ec126db2543e9d340aefe6aa50f84")
version("7.2.2", sha256="53e06b386df5bc20fe268b6c8ba50f1e62b6744e577d383ec836ea3fc672c383")
version("7.2.1", sha256="d4fff32f21c5c08a4b2e563c476b079859c2c8e3b78d853a8a60da96d5eea686")
@@ -33,6 +34,7 @@ class Herwig3(AutotoolsPackage):
depends_on("thepeg@2.2.1", when="@7.2.1")
depends_on("thepeg@2.2.2", when="@7.2.2")
depends_on("thepeg@2.2.3", when="@7.2.3")
depends_on("thepeg@2.3.0", when="@7.3.0")
depends_on("evtgen")
depends_on("boost +math+test")

View File

@@ -29,6 +29,7 @@ class Legion(CMakePackage, ROCmPackage):
maintainers("pmccormick", "streichler", "elliottslaughter")
tags = ["e4s"]
version("24.12.0", tag="legion-24.12.0", commit="2f087ebe433a19f9a3abd05382f951027933bad9")
version("24.09.0", tag="legion-24.09.0", commit="4a03402467547b99530042cfe234ceec2cd31b2e")
version("24.06.0", tag="legion-24.06.0", commit="3f27977943626ef23038ef0049b7ad1b389caad1")
version("24.03.0", tag="legion-24.03.0", commit="c61071541218747e35767317f6f89b83f374f264")

View File

@@ -6,15 +6,16 @@
from spack.package import *
class Libzip(CMakePackage, AutotoolsPackage):
class Libzip(CMakePackage):
"""libzip is a C library for reading, creating,
and modifying zip archives."""
homepage = "https://libzip.org/"
maintainers("prudhomm")
license("BSD-3-Clause")
# current versions are released on GitHub
version("1.11.1", sha256="c0e6fa52a62ba11efd30262290dc6970947aef32e0cc294ee50e9005ceac092a")
version("1.10.1", sha256="9669ae5dfe3ac5b3897536dc8466a874c8cf2c0e3b1fdd08d75b273884299363")
version("1.9.2", sha256="fd6a7f745de3d69cf5603edc9cb33d2890f0198e415255d0987a0cf10d824c6f")
version("1.8.0", sha256="30ee55868c0a698d3c600492f2bea4eb62c53849bcf696d21af5eb65f3f3839e")
@@ -24,17 +25,6 @@ class Libzip(CMakePackage, AutotoolsPackage):
sha256="06eb8e9141fd19e2788cabaea9c9c2fd4d488d9e1484eb474bbfcac78e7b1d88",
url="https://github.com/nih-at/libzip/releases/download/rel-1-6-1/libzip-1.6.1.tar.gz",
)
# older releases are available on libzip.org
version(
"1.3.2",
sha256="ab4c34eb6c3a08b678cd0f2450a6c57a13e9618b1ba34ee45d00eb5327316457",
deprecated=True,
)
version(
"1.2.0",
sha256="6cf9840e427db96ebf3936665430bab204c9ebbd0120c326459077ed9c907d9f",
deprecated=True,
)
depends_on("c", type="build") # generated
depends_on("cxx", type="build") # generated
@@ -46,14 +36,25 @@ def url_for_version(self, version):
depends_on("zlib-api")
# Build system
build_system(
conditional("cmake", when="@1.4:"), conditional("autotools", when="@:1.3"), default="cmake"
)
variant("gnutls", default=True, description="Enable gnutls support")
variant("bzip2", default=True, description="Enable bzip2 support")
variant("lzma", default=True, description="Enable lzma support")
variant("openssl", default=True, description="Enable openssl support")
variant("zstd", default=True, description="Enable zstd support", when="@1.8:")
variant("mbedtls", default=True, description="Enable mbedtls support")
depends_on("gnutls", when="+gnutls")
depends_on("bzip2", when="+bzip2")
depends_on("lzma", when="+lzma")
depends_on("openssl", when="+openssl")
depends_on("mbedtls", when="+mbedtls")
depends_on("zstd", when="+zstd")
@property
def headers(self):
# Up to version 1.3.0 zipconf.h was installed outside of self.prefix.include
return find_all_headers(
self.prefix if self.spec.satisfies("@:1.3.0") else self.prefix.include
)
def cmake_args(self):
return [
self.define_from_variant("ENABLE_GNUTLS", "gnutls"),
self.define_from_variant("ENABLE_MBEDTLS", "mbedtls"),
self.define_from_variant("ENABLE_OPENSSL", "openssl"),
self.define_from_variant("ENABLE_BZIP2", "bzip2"),
self.define_from_variant("ENABLE_LZMA", "lzma"),
self.define_from_variant("ENABLE_ZSTD", "zstd"),
]

View File

@@ -8,7 +8,6 @@
import sys
import spack.compilers
from spack.build_environment import dso_suffix
from spack.package import *
@@ -482,11 +481,6 @@ def setup_dependent_package(self, module, dependent_spec):
spec.mpifc = join_path(self.prefix.bin, "mpif90")
spec.mpif77 = join_path(self.prefix.bin, "mpif77")
spec.mpicxx_shared_libs = [
join_path(self.prefix.lib, "libmpicxx.{0}".format(dso_suffix)),
join_path(self.prefix.lib, "libmpi.{0}".format(dso_suffix)),
]
def autoreconf(self, spec, prefix):
"""Not needed usually, configure should be already there"""
# If configure exists nothing needs to be done

View File

@@ -4,7 +4,6 @@
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
import itertools
import os.path
import re
import sys
@@ -242,10 +241,6 @@ def setup_dependent_package(self, module, dependent_spec):
self.spec.mpicxx = join_path(self.prefix.bin, "mpicxx")
self.spec.mpifc = join_path(self.prefix.bin, "mpif90")
self.spec.mpif77 = join_path(self.prefix.bin, "mpif77")
self.spec.mpicxx_shared_libs = [
os.path.join(self.prefix.lib, "libmpicxx.{0}".format(dso_suffix)),
os.path.join(self.prefix.lib, "libmpi.{0}".format(dso_suffix)),
]
@run_before("configure")
def die_without_fortran(self):

View File

@@ -3,7 +3,6 @@
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
import os.path
import sys
from spack.package import *
@@ -184,10 +183,6 @@ def setup_dependent_package(self, module, dependent_spec):
self.spec.mpicxx = join_path(self.prefix.bin, "mpicxx")
self.spec.mpifc = join_path(self.prefix.bin, "mpif90")
self.spec.mpif77 = join_path(self.prefix.bin, "mpif77")
self.spec.mpicxx_shared_libs = [
os.path.join(self.prefix.lib, "libmpicxx.{0}".format(dso_suffix)),
os.path.join(self.prefix.lib, "libmpi.{0}".format(dso_suffix)),
]
def configure_args(self):
spec = self.spec

View File

@@ -399,10 +399,6 @@ def setup_dependent_package(self, module, dependent_spec):
self.spec.mpicxx = join_path(self.prefix.bin, "mpicxx")
self.spec.mpifc = join_path(self.prefix.bin, "mpif90")
self.spec.mpif77 = join_path(self.prefix.bin, "mpif77")
self.spec.mpicxx_shared_libs = [
os.path.join(self.prefix.lib, "libmpicxx.{0}".format(dso_suffix)),
os.path.join(self.prefix.lib, "libmpi.{0}".format(dso_suffix)),
]
@run_before("configure")
def die_without_fortran(self):

View File

@@ -3,7 +3,6 @@
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
import os.path
import sys
from spack.package import *
@@ -239,10 +238,6 @@ def setup_dependent_package(self, module, dependent_spec):
self.spec.mpicxx = join_path(self.prefix.bin, "mpicxx")
self.spec.mpifc = join_path(self.prefix.bin, "mpif90")
self.spec.mpif77 = join_path(self.prefix.bin, "mpif77")
self.spec.mpicxx_shared_libs = [
os.path.join(self.prefix.lib, "libmpicxx.{0}".format(dso_suffix)),
os.path.join(self.prefix.lib, "libmpi.{0}".format(dso_suffix)),
]
def configure_args(self):
spec = self.spec

View File

@@ -36,5 +36,5 @@ def cmake_args(self):
def setup_run_environment(self, env):
env.set("OPENDATADETECTOR_DATA", join_path(self.prefix.share, "OpenDataDetector"))
for d in self.libs.directories:
env.prepend_path("LD_LIBRARY_PATH", d)
for lib_path in [self.prefix.lib, self.prefix.lib64]:
env.prepend_path("LD_LIBRARY_PATH", lib_path)

View File

@@ -274,12 +274,16 @@ def configure(self, spec, prefix):
f.write("fortran_compiler = {0}\n".format(env["SPACK_FC"]))
if self.spec.satisfies("@1.3.1") and not is_intel:
f.write("gfortran_f_flags = -ffree-line-length-none\n")
if self.spec.satisfies("@2.1.1:") and not is_intel:
if self.spec.satisfies("@2.1.1") and not is_intel:
f.write("gfortran_f_flags = -ffree-line-length-none " + "-fdollar-ok ")
if self.spec.target.family == "aarch64":
f.write("-mcmodel=small\n")
else:
f.write("-mcmodel=medium\n")
if self.spec.satisfies("@2.1.2:") and not is_intel:
f.write("gfortran_f_flags = -ffree-line-length-none " + "-fdollar-ok\n")
if self.spec.target.family == "aarch64":
f.write("cmodel = small\n")
if self.spec.satisfies("@:1 processes=lcg.coll"):
copy(join_path(os.path.dirname(__file__), "sft1.coll"), "lcg.coll")

View File

@@ -931,10 +931,6 @@ def setup_dependent_package(self, module, dependent_spec):
self.spec.mpicxx = join_path(self.prefix.bin, "mpic++")
self.spec.mpifc = join_path(self.prefix.bin, "mpif90")
self.spec.mpif77 = join_path(self.prefix.bin, "mpif77")
self.spec.mpicxx_shared_libs = [
join_path(self.prefix.lib, "libmpi_cxx.{0}".format(dso_suffix)),
join_path(self.prefix.lib, "libmpi.{0}".format(dso_suffix)),
]
# Most of the following with_or_without methods might seem redundant
# because Spack compiler wrapper adds the required -I and -L flags, which

View File

@@ -302,7 +302,8 @@ class Petsc(Package, CudaPackage, ROCmPackage):
# older versions of petsc did not support mumps when +int64
conflicts("+mumps", when="@:3.12+int64")
filter_compiler_wrappers("petscvariables", relative_root="lib/petsc/conf")
filter_compiler_wrappers("petscvariables", "reconfigure*.py", relative_root="lib/petsc/conf")
filter_compiler_wrappers("petsc.pc", "PETSc.pc", relative_root="lib/pkgconfig")
@run_before("configure")
def check_fortran_compiler(self):

View File

@@ -12,20 +12,23 @@ class PyFitter(PythonPackage):
most probable distribution and the best parameters."""
homepage = "https://github.com/cokelaer/fitter"
pypi = "fitter/fitter-1.5.1.tar.gz"
pypi = "fitter/fitter-1.6.0.tar.gz"
maintainers("carsonwoods")
license("GPL-3.0-or-later")
version("1.6.0", sha256="908223d75b35d3846984bfb2fed1d2a926da5a30b95b704aa95b2a894227c0af")
version("1.5.2", sha256="afb33a8b1e24cdbc9318f55be72534e07028f25240ab76a4b081d27d1ed677d9")
version("1.5.1", sha256="893b35ad0a84c3b96b63ec203a6a79effdba98777aed966ae61709f5e1e8cf99")
depends_on("py-setuptools", type="build")
depends_on("py-pandas", type=("build", "run"))
depends_on("py-numpy", type=("build", "run"))
depends_on("py-scipy@0.18:", type=("build", "run"))
depends_on("py-tqdm", type=("build", "run"))
depends_on("py-joblib", type=("build", "run"))
depends_on("py-click", type=("build", "run"))
depends_on("py-matplotlib", type=("build", "run"))
depends_on("py-poetry-core@1:", when="@1.6:", type="build")
depends_on("py-setuptools", when="@:1.6", type="build")
depends_on("python@3.8:3", type=("build", "run"))
depends_on("py-click@8.1.6:8", type=("build", "run"))
depends_on("py-joblib@1.3.1:1", type=("build", "run"))
depends_on("py-matplotlib@3.7.2:3", type=("build", "run"))
depends_on("py-numpy@1.20.0:1", type=("build", "run"))
depends_on("py-pandas@0.23.4:2", type=("build", "run"))
depends_on("py-scipy@0.18:1", type=("build", "run"))
depends_on("py-tqdm@4.65.1:4", type=("build", "run"))

View File

@@ -364,7 +364,7 @@ def determine_variants(cls, exes, version_str):
variants += "~tix"
# Some modules are platform-dependent
if sys.platform != "win32":
if sys.platform != "win32" and Version(version_str) < Version("3.13"):
try:
python("-c", "import crypt", error=os.devnull)
variants += "+crypt"

View File

@@ -869,6 +869,6 @@ def setup_dependent_run_environment(
# automatically prepending dependent package library paths to
# ROOT_LIBRARY_PATH (for @6.26:) or LD_LIBRARY_PATH (for older
# versions).
for lib_path in (dependent_spec.prefix.lib, dependent_spec.prefix.lib64):
for lib_path in [dependent_spec.prefix.lib, dependent_spec.prefix.lib64]:
if os.path.exists(lib_path):
env.prepend_path(self.root_library_path, lib_path)

View File

@@ -65,6 +65,7 @@ class Silo(AutotoolsPackage):
variant("hzip", default=True, description="Enable hzip support")
variant("fpzip", default=True, description="Enable fpzip support")
depends_on("python", type=("build", "link"), when="+python")
depends_on("perl", type="build")
depends_on("m4", type="build", when="+shared")
depends_on("autoconf", type="build", when="+shared")
@@ -129,6 +130,8 @@ def flag_handler(self, name, flags):
if spec.satisfies("%oneapi"):
flags.append("-Wno-error=int")
flags.append("-Wno-error=int-conversion")
if spec.satisfies("+python"):
flags.append(f"-I {spec['python'].headers.directories[0]}")
if "+hdf5" in spec:
# @:4.10 can use up to the 1.10 API
if "@:4.10" in spec:

View File

@@ -71,7 +71,8 @@ class Thepeg(AutotoolsPackage):
depends_on("hepmc3", when="hepmc=3")
conflicts("hepmc=3", when="@:2.1", msg="HepMC3 support was added in 2.2.0")
depends_on("fastjet", when="@2.0.0:")
depends_on("rivet", when="@2.0.3: +rivet")
depends_on("rivet@:3 hepmc=2", when="@2.0.3: +rivet hepmc=2")
depends_on("rivet@:3 hepmc=3", when="@2.0.3: +rivet hepmc=3")
depends_on("boost +test", when="@2.1.1:")
depends_on("autoconf", type="build")

View File

@@ -93,11 +93,6 @@ def setup_dependent_package(self, module, dependent_spec):
self.spec.mpifc = join_path(self.prefix.bin, "mpif90")
self.spec.mpif77 = join_path(self.prefix.bin, "mpif77")
self.spec.mpicxx_shared_libs = [
join_path(self.prefix.lib, "libmpicxx.{0}".format(dso_suffix)),
join_path(self.prefix.lib, "libmpi.{0}".format(dso_suffix)),
]
def autoreconf(self, spec, prefix):
"""Not needed usually, configure should be already there"""
# If configure exists nothing needs to be done