Compare commits
63 Commits
develop-20
...
hs/fix/ven
Author | SHA1 | Date | |
---|---|---|---|
![]() |
8c8d54db5d | ||
![]() |
0107792a9e | ||
![]() |
de6f07094e | ||
![]() |
63c60c18c7 | ||
![]() |
f01a442ad4 | ||
![]() |
cca0eb6873 | ||
![]() |
c39725a9e6 | ||
![]() |
e58351f421 | ||
![]() |
2a028144ba | ||
![]() |
22a7419235 | ||
![]() |
7e21357045 | ||
![]() |
cf7e1643c3 | ||
![]() |
158ddf72cf | ||
![]() |
9567b13b4f | ||
![]() |
f6da60b541 | ||
![]() |
3caff2c5a0 | ||
![]() |
091a8a4734 | ||
![]() |
cfcee7d092 | ||
![]() |
c6d04286c5 | ||
![]() |
3c3e1c6d30 | ||
![]() |
3669f0356b | ||
![]() |
dd72df89d6 | ||
![]() |
445667adbe | ||
![]() |
3ec4797513 | ||
![]() |
50e8f6395c | ||
![]() |
bf9426a48d | ||
![]() |
bf08b1e2c6 | ||
![]() |
687137a057 | ||
![]() |
6c4c9985d5 | ||
![]() |
2927e708bc | ||
![]() |
a9d3bd8d7f | ||
![]() |
64fc66ab48 | ||
![]() |
c86b2860aa | ||
![]() |
d991ebbe09 | ||
![]() |
3f00eeabd2 | ||
![]() |
b77d9b87f8 | ||
![]() |
e46dae9eb6 | ||
![]() |
760fc05da3 | ||
![]() |
e07503e4ac | ||
![]() |
aba8d85b4d | ||
![]() |
546625cdb8 | ||
![]() |
d951c4f112 | ||
![]() |
ef2b596e3f | ||
![]() |
f07789febf | ||
![]() |
4316c4fb00 | ||
![]() |
72871ebde8 | ||
![]() |
3b2163c718 | ||
![]() |
16067871e2 | ||
![]() |
53ae44163d | ||
![]() |
02880a866c | ||
![]() |
a242e77e81 | ||
![]() |
e9b822a86a | ||
![]() |
3ea16482a6 | ||
![]() |
a13557ac94 | ||
![]() |
69e9841262 | ||
![]() |
65279dc6f3 | ||
![]() |
3623d5d20e | ||
![]() |
50cc87500c | ||
![]() |
b4e039ad7b | ||
![]() |
6227bd7986 | ||
![]() |
da9fa24d15 | ||
![]() |
2929ea02a1 | ||
![]() |
c99e654650 |
1
.github/workflows/import-check.yaml
vendored
1
.github/workflows/import-check.yaml
vendored
@@ -6,6 +6,7 @@ on:
|
||||
jobs:
|
||||
# Check we don't make the situation with circular imports worse
|
||||
import-check:
|
||||
continue-on-error: true
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: julia-actions/setup-julia@v2
|
||||
|
2
.github/workflows/sync-packages.yaml
vendored
2
.github/workflows/sync-packages.yaml
vendored
@@ -28,7 +28,7 @@ jobs:
|
||||
run: |
|
||||
cd spack-packages
|
||||
git-filter-repo --quiet --source ../spack \
|
||||
--subdirectory-filter var/spack/repos \
|
||||
--path var/spack/repos/ --path-rename var/spack/repos/:python/ \
|
||||
--path share/spack/gitlab/cloud_pipelines/ --path-rename share/spack/gitlab/cloud_pipelines/:.ci/gitlab/ \
|
||||
--refs develop
|
||||
- name: Push
|
||||
|
@@ -276,7 +276,7 @@ remove dependent packages *before* removing their dependencies or use the
|
||||
Garbage collection
|
||||
^^^^^^^^^^^^^^^^^^
|
||||
|
||||
When Spack builds software from sources, if often installs tools that are needed
|
||||
When Spack builds software from sources, it often installs tools that are needed
|
||||
just to build or test other software. These are not necessary at runtime.
|
||||
To support cases where removing these tools can be a benefit Spack provides
|
||||
the ``spack gc`` ("garbage collector") command, which will uninstall all unneeded packages:
|
||||
|
@@ -89,7 +89,7 @@ You can see that the mirror is added with ``spack mirror list`` as follows:
|
||||
spack-public https://spack-llnl-mirror.s3-us-west-2.amazonaws.com/
|
||||
|
||||
|
||||
At this point, you've create a buildcache, but spack hasn't indexed it, so if
|
||||
At this point, you've created a buildcache, but Spack hasn't indexed it, so if
|
||||
you run ``spack buildcache list`` you won't see any results. You need to index
|
||||
this new build cache as follows:
|
||||
|
||||
@@ -318,7 +318,7 @@ other system dependencies. However, they are still compatible with tools like
|
||||
``skopeo``, ``podman``, and ``docker`` for pulling and pushing.
|
||||
|
||||
.. note::
|
||||
The docker ``overlayfs2`` storage driver is limited to 128 layers, above which a
|
||||
The Docker ``overlayfs2`` storage driver is limited to 128 layers, above which a
|
||||
``max depth exceeded`` error may be produced when pulling the image. There
|
||||
are `alternative drivers <https://docs.docker.com/storage/storagedriver/>`_.
|
||||
|
||||
|
@@ -14,7 +14,7 @@ is an entire command dedicated to the management of every aspect of bootstrappin
|
||||
|
||||
.. command-output:: spack bootstrap --help
|
||||
|
||||
Spack is configured to bootstrap its dependencies lazily by default; i.e. the first time they are needed and
|
||||
Spack is configured to bootstrap its dependencies lazily by default; i.e., the first time they are needed and
|
||||
can't be found. You can readily check if any prerequisite for using Spack is missing by running:
|
||||
|
||||
.. code-block:: console
|
||||
@@ -36,8 +36,8 @@ can't be found. You can readily check if any prerequisite for using Spack is mis
|
||||
|
||||
In the case of the output shown above Spack detected that both ``clingo`` and ``gnupg``
|
||||
are missing and it's giving detailed information on why they are needed and whether
|
||||
they can be bootstrapped. The return code of this command summarizes the results, if any
|
||||
dependencies are missing the return code is ``1``, otherwise ``0``. Running a command that
|
||||
they can be bootstrapped. The return code of this command summarizes the results; if any
|
||||
dependencies are missing, the return code is ``1``, otherwise ``0``. Running a command that
|
||||
concretizes a spec, like:
|
||||
|
||||
.. code-block:: console
|
||||
|
@@ -66,7 +66,7 @@ on these ideas for each distinct build system that Spack supports:
|
||||
build_systems/rocmpackage
|
||||
build_systems/sourceforgepackage
|
||||
|
||||
For reference, the :py:mod:`Build System API docs <spack.build_systems>`
|
||||
For reference, the :py:mod:`Build System API docs <spack_repo.builtin.build_systems>`
|
||||
provide a list of build systems and methods/attributes that can be
|
||||
overridden. If you are curious about the implementation of a particular
|
||||
build system, you can view the source code by running:
|
||||
@@ -90,7 +90,7 @@ packages. You can quickly find examples by running:
|
||||
You can then view these packages with ``spack edit``.
|
||||
|
||||
This guide is intended to supplement the
|
||||
:py:mod:`Build System API docs <spack.build_systems>` with examples of
|
||||
:py:mod:`Build System API docs <spack_repo.builtin.build_systems>` with examples of
|
||||
how to override commonly used methods. It also provides rules of thumb
|
||||
and suggestions for package developers who are unfamiliar with a
|
||||
particular build system.
|
||||
|
@@ -129,8 +129,8 @@ Adding flags to cmake
|
||||
To add additional flags to the ``cmake`` call, simply override the
|
||||
``cmake_args`` function. The following example defines values for the flags
|
||||
``WHATEVER``, ``ENABLE_BROKEN_FEATURE``, ``DETECT_HDF5``, and ``THREADS`` with
|
||||
and without the :meth:`~spack.build_systems.cmake.CMakeBuilder.define` and
|
||||
:meth:`~spack.build_systems.cmake.CMakeBuilder.define_from_variant` helper functions:
|
||||
and without the :meth:`~spack_repo.builtin.build_systems.cmake.CMakeBuilder.define` and
|
||||
:meth:`~spack_repo.builtin.build_systems.cmake.CMakeBuilder.define_from_variant` helper functions:
|
||||
|
||||
.. code-block:: python
|
||||
|
||||
|
@@ -36,6 +36,7 @@
|
||||
os.symlink(os.path.abspath("../../.."), link_name, target_is_directory=True)
|
||||
sys.path.insert(0, os.path.abspath("_spack_root/lib/spack/external"))
|
||||
sys.path.append(os.path.abspath("_spack_root/lib/spack/"))
|
||||
sys.path.append(os.path.abspath("_spack_root/var/spack/repos/"))
|
||||
|
||||
# Add the Spack bin directory to the path so that we can use its output in docs.
|
||||
os.environ["SPACK_ROOT"] = os.path.abspath("_spack_root")
|
||||
@@ -75,11 +76,20 @@
|
||||
apidoc_args
|
||||
+ [
|
||||
"_spack_root/lib/spack/spack",
|
||||
"_spack_root/lib/spack/spack/package.py", # sphinx struggles with os.chdir re-export.
|
||||
"_spack_root/lib/spack/spack/test/*.py",
|
||||
"_spack_root/lib/spack/spack/test/cmd/*.py",
|
||||
]
|
||||
)
|
||||
sphinx_apidoc(apidoc_args + ["_spack_root/lib/spack/llnl"])
|
||||
sphinx_apidoc(
|
||||
apidoc_args
|
||||
+ [
|
||||
"--implicit-namespaces",
|
||||
"_spack_root/var/spack/repos/spack_repo",
|
||||
"_spack_root/var/spack/repos/spack_repo/builtin/packages",
|
||||
]
|
||||
)
|
||||
|
||||
# Enable todo items
|
||||
todo_include_todos = True
|
||||
@@ -208,7 +218,7 @@ def setup(sphinx):
|
||||
# Spack classes that are private and we don't want to expose
|
||||
("py:class", "spack.provider_index._IndexBase"),
|
||||
("py:class", "spack.repo._PrependFileLoader"),
|
||||
("py:class", "spack.build_systems._checks.BuilderWithDefaults"),
|
||||
("py:class", "spack_repo.builtin.build_systems._checks.BuilderWithDefaults"),
|
||||
# Spack classes that intersphinx is unable to resolve
|
||||
("py:class", "spack.version.StandardVersion"),
|
||||
("py:class", "spack.spec.DependencySpec"),
|
||||
@@ -218,7 +228,7 @@ def setup(sphinx):
|
||||
("py:class", "spack.install_test.Pb"),
|
||||
("py:class", "spack.filesystem_view.SimpleFilesystemView"),
|
||||
("py:class", "spack.traverse.EdgeAndDepth"),
|
||||
("py:class", "archspec.cpu.microarchitecture.Microarchitecture"),
|
||||
("py:class", "_vendoring.archspec.cpu.microarchitecture.Microarchitecture"),
|
||||
("py:class", "spack.compiler.CompilerCache"),
|
||||
# TypeVar that is not handled correctly
|
||||
("py:class", "llnl.util.lang.T"),
|
||||
|
@@ -148,8 +148,8 @@ this can expose you to attacks. Use at your own risk.
|
||||
``ssl_certs``
|
||||
--------------------
|
||||
|
||||
Path to custom certificats for SSL verification. The value can be a
|
||||
filesytem path, or an environment variable that expands to an absolute file path.
|
||||
Path to custom certificates for SSL verification. The value can be a
|
||||
filesystem path, or an environment variable that expands to an absolute file path.
|
||||
The default value is set to the environment variable ``SSL_CERT_FILE``
|
||||
to use the same syntax used by many other applications that automatically
|
||||
detect custom certificates.
|
||||
|
@@ -11,7 +11,7 @@ Container Images
|
||||
Spack :ref:`environments` can easily be turned into container images. This page
|
||||
outlines two ways in which this can be done:
|
||||
|
||||
1. By installing the environment on the host system, and copying the installations
|
||||
1. By installing the environment on the host system and copying the installations
|
||||
into the container image. This approach does not require any tools like Docker
|
||||
or Singularity to be installed.
|
||||
2. By generating a Docker or Singularity recipe that can be used to build the
|
||||
@@ -56,8 +56,8 @@ environment roots and its runtime dependencies.
|
||||
|
||||
.. note::
|
||||
|
||||
When using registries like GHCR and Docker Hub, the ``--oci-password`` flag is not
|
||||
the password for your account, but a personal access token you need to generate separately.
|
||||
When using registries like GHCR and Docker Hub, the ``--oci-password`` flag specifies not
|
||||
the password for your account, but rather a personal access token you need to generate separately.
|
||||
|
||||
The specified ``--base-image`` should have a libc that is compatible with the host system.
|
||||
For example if your host system is Ubuntu 20.04, you can use ``ubuntu:20.04``, ``ubuntu:22.04``
|
||||
|
@@ -20,7 +20,7 @@ be present on the machine where Spack is run:
|
||||
:header-rows: 1
|
||||
|
||||
These requirements can be easily installed on most modern Linux systems;
|
||||
on macOS, the Command Line Tools package is required, and a full XCode suite
|
||||
on macOS, the Command Line Tools package is required, and a full Xcode suite
|
||||
may be necessary for some packages such as Qt and apple-gl. Spack is designed
|
||||
to run on HPC platforms like Cray. Not all packages should be expected
|
||||
to work on all platforms.
|
||||
|
@@ -103,6 +103,7 @@ or refer to the full manual below.
|
||||
:caption: API Docs
|
||||
|
||||
Spack API Docs <spack>
|
||||
Spack Builtin Repo <spack_repo>
|
||||
LLNL API Docs <llnl>
|
||||
|
||||
==================
|
||||
|
@@ -8,7 +8,7 @@
|
||||
Modules (modules.yaml)
|
||||
======================
|
||||
|
||||
The use of module systems to manage user environment in a controlled way
|
||||
The use of module systems to manage user environments in a controlled way
|
||||
is a common practice at HPC centers that is sometimes embraced also by
|
||||
individual programmers on their development machines. To support this
|
||||
common practice Spack integrates with `Environment Modules
|
||||
@@ -490,7 +490,7 @@ that are already in the Lmod hierarchy.
|
||||
|
||||
|
||||
.. note::
|
||||
Tcl and Lua modules also allow for explicit conflicts between modulefiles.
|
||||
Tcl and Lua modules also allow for explicit conflicts between module files.
|
||||
|
||||
.. code-block:: yaml
|
||||
|
||||
@@ -513,7 +513,7 @@ that are already in the Lmod hierarchy.
|
||||
:meth:`~spack.spec.Spec.format` method.
|
||||
|
||||
For Lmod and Environment Modules versions prior 4.2, it is important to
|
||||
express the conflict on both modulefiles conflicting with each other.
|
||||
express the conflict on both module files conflicting with each other.
|
||||
|
||||
|
||||
.. note::
|
||||
@@ -550,7 +550,7 @@ that are already in the Lmod hierarchy.
|
||||
|
||||
.. warning::
|
||||
Consistency of Core packages
|
||||
The user is responsible for maintining consistency among core packages, as ``core_specs``
|
||||
The user is responsible for maintaining consistency among core packages, as ``core_specs``
|
||||
bypasses the hierarchy that allows Lmod to safely switch between coherent software stacks.
|
||||
|
||||
.. warning::
|
||||
|
@@ -69,7 +69,7 @@ An example for ``CMake`` is, for instance:
|
||||
|
||||
The predefined steps for each build system are called "phases".
|
||||
In general, the name and order in which the phases will be executed can be
|
||||
obtained by either reading the API docs at :py:mod:`~.spack.build_systems`, or
|
||||
obtained by either reading the API docs at :py:mod:`~.spack_repo.builtin.build_systems`, or
|
||||
using the ``spack info`` command:
|
||||
|
||||
.. code-block:: console
|
||||
@@ -158,7 +158,7 @@ builder class explicitly. Using the same example as above, this reads:
|
||||
url_fmt = "https://github.com/uclouvain/openjpeg/archive/version.{0}.tar.gz"
|
||||
return url_fmt.format(version)
|
||||
|
||||
class CMakeBuilder(spack.build_systems.cmake.CMakeBuilder):
|
||||
class CMakeBuilder(spack_repo.builtin.build_systems.cmake.CMakeBuilder):
|
||||
def cmake_args(self):
|
||||
args = [
|
||||
self.define_from_variant("BUILD_CODEC", "codec"),
|
||||
@@ -179,7 +179,7 @@ Spack can be found at :ref:`package_class_structure`.
|
||||
|
||||
.. code-block:: python
|
||||
|
||||
class Foo(CmakePackage):
|
||||
class Foo(CMakePackage):
|
||||
def cmake_args(self):
|
||||
...
|
||||
|
||||
@@ -256,7 +256,7 @@ for details):
|
||||
#
|
||||
# See the Spack documentation for more information on packaging.
|
||||
# ----------------------------------------------------------------------------
|
||||
import spack.build_systems.autotools
|
||||
import spack_repo.builtin.build_systems.autotools
|
||||
from spack.package import *
|
||||
|
||||
|
||||
@@ -1212,7 +1212,7 @@ class-level tarball URL and VCS. For example:
|
||||
version("master", branch="master")
|
||||
version("12.12.1", md5="ecd4606fa332212433c98bf950a69cc7")
|
||||
version("12.10.1", md5="667333dbd7c0f031d47d7c5511fd0810")
|
||||
version("12.8.1", "9f37f683ee2b427b5540db8a20ed6b15")
|
||||
version("12.8.1", md5="9f37f683ee2b427b5540db8a20ed6b15")
|
||||
|
||||
If a package contains both a ``url`` and ``git`` class-level attribute,
|
||||
Spack decides which to use based on the arguments to the ``version()``
|
||||
@@ -1343,7 +1343,7 @@ Submodules
|
||||
|
||||
version("1.0.1", tag="v1.0.1", submodules=True)
|
||||
|
||||
If a package has needs more fine-grained control over submodules, define
|
||||
If a package needs more fine-grained control over submodules, define
|
||||
``submodules`` to be a callable function that takes the package instance as
|
||||
its only argument. The function should return a list of submodules to be fetched.
|
||||
|
||||
@@ -2308,31 +2308,19 @@ looks like this:
|
||||
|
||||
parallel = False
|
||||
|
||||
Similarly, you can disable parallel builds only for specific make
|
||||
commands, as ``libdwarf`` does:
|
||||
You can also disable parallel builds only for specific make
|
||||
invocation:
|
||||
|
||||
.. code-block:: python
|
||||
:emphasize-lines: 9, 12
|
||||
:emphasize-lines: 5
|
||||
:linenos:
|
||||
|
||||
class Libelf(Package):
|
||||
...
|
||||
|
||||
def install(self, spec, prefix):
|
||||
configure("--prefix=" + prefix,
|
||||
"--enable-shared",
|
||||
"--disable-dependency-tracking",
|
||||
"--disable-debug")
|
||||
make()
|
||||
|
||||
# The mkdir commands in libelf's install can fail in parallel
|
||||
make("install", parallel=False)
|
||||
|
||||
The first make will run in parallel here, but the second will not. If
|
||||
you set ``parallel`` to ``False`` at the package level, then each call
|
||||
to ``make()`` will be sequential by default, but packagers can call
|
||||
``make(parallel=True)`` to override it.
|
||||
|
||||
Note that the ``--jobs`` option works out of the box for all standard
|
||||
build systems. If you are using a non-standard build system instead, you
|
||||
can use the variable ``make_jobs`` to extract the number of jobs specified
|
||||
@@ -2507,7 +2495,7 @@ necessary when there are breaking changes in the dependency that the
|
||||
package cannot handle. In Spack we often add forward compatibility
|
||||
bounds only at the time a new, breaking version of a dependency is
|
||||
released. As with backward compatibility, it is typical to see a list
|
||||
of forward compatibility bounds in a package file as seperate lines:
|
||||
of forward compatibility bounds in a package file as separate lines:
|
||||
|
||||
.. code-block:: python
|
||||
|
||||
@@ -3383,7 +3371,7 @@ the above attribute implementations:
|
||||
"/opt/spack/linux-fedora35-haswell/gcc-11.3.1/foo-1.0-ca3rczp5omy7dfzoqw4p7oc2yh3u7lt6/baz/lib/libFooBaz.so"
|
||||
])
|
||||
|
||||
# baz library directories in the baz subdirectory of the foo porefix
|
||||
# baz library directories in the baz subdirectory of the foo prefix
|
||||
>>> spec["baz"].libs.directories
|
||||
[
|
||||
"/opt/spack/linux-fedora35-haswell/gcc-11.3.1/foo-1.0-ca3rczp5omy7dfzoqw4p7oc2yh3u7lt6/baz/lib"
|
||||
@@ -3697,60 +3685,57 @@ the build system. The build systems currently supported by Spack are:
|
||||
+----------------------------------------------------------+----------------------------------+
|
||||
| **API docs** | **Description** |
|
||||
+==========================================================+==================================+
|
||||
| :class:`~spack.build_systems.generic` | Generic build system without any |
|
||||
| :class:`~spack_repo.builtin.build_systems.generic` | Generic build system without any |
|
||||
| | base implementation |
|
||||
+----------------------------------------------------------+----------------------------------+
|
||||
| :class:`~spack.build_systems.makefile` | Specialized build system for |
|
||||
| :class:`~spack_repo.builtin.build_systems.makefile` | Specialized build system for |
|
||||
| | software built invoking |
|
||||
| | hand-written Makefiles |
|
||||
+----------------------------------------------------------+----------------------------------+
|
||||
| :class:`~spack.build_systems.autotools` | Specialized build system for |
|
||||
| :class:`~spack_repo.builtin.build_systems.autotools` | Specialized build system for |
|
||||
| | software built using |
|
||||
| | GNU Autotools |
|
||||
+----------------------------------------------------------+----------------------------------+
|
||||
| :class:`~spack.build_systems.cmake` | Specialized build system for |
|
||||
| :class:`~spack_repo.builtin.build_systems.cmake` | Specialized build system for |
|
||||
| | software built using CMake |
|
||||
+----------------------------------------------------------+----------------------------------+
|
||||
| :class:`~spack.build_systems.maven` | Specialized build system for |
|
||||
| :class:`~spack_repo.builtin.build_systems.maven` | Specialized build system for |
|
||||
| | software built using Maven |
|
||||
+----------------------------------------------------------+----------------------------------+
|
||||
| :class:`~spack.build_systems.meson` | Specialized build system for |
|
||||
| :class:`~spack_repo.builtin.build_systems.meson` | Specialized build system for |
|
||||
| | software built using Meson |
|
||||
+----------------------------------------------------------+----------------------------------+
|
||||
| :class:`~spack.build_systems.nmake` | Specialized build system for |
|
||||
| :class:`~spack_repo.builtin.build_systems.nmake` | Specialized build system for |
|
||||
| | software built using NMake |
|
||||
+----------------------------------------------------------+----------------------------------+
|
||||
| :class:`~spack.build_systems.qmake` | Specialized build system for |
|
||||
| :class:`~spack_repo.builtin.build_systems.qmake` | Specialized build system for |
|
||||
| | software built using QMake |
|
||||
+----------------------------------------------------------+----------------------------------+
|
||||
| :class:`~spack.build_systems.scons` | Specialized build system for |
|
||||
| :class:`~spack_repo.builtin.build_systems.scons` | Specialized build system for |
|
||||
| | software built using SCons |
|
||||
+----------------------------------------------------------+----------------------------------+
|
||||
| :class:`~spack.build_systems.waf` | Specialized build system for |
|
||||
| :class:`~spack_repo.builtin.build_systems.waf` | Specialized build system for |
|
||||
| | software built using Waf |
|
||||
+----------------------------------------------------------+----------------------------------+
|
||||
| :class:`~spack.build_systems.r` | Specialized build system for |
|
||||
| :class:`~spack_repo.builtin.build_systems.r` | Specialized build system for |
|
||||
| | R extensions |
|
||||
+----------------------------------------------------------+----------------------------------+
|
||||
| :class:`~spack.build_systems.octave` | Specialized build system for |
|
||||
| :class:`~spack_repo.builtin.build_systems.octave` | Specialized build system for |
|
||||
| | Octave packages |
|
||||
+----------------------------------------------------------+----------------------------------+
|
||||
| :class:`~spack.build_systems.python` | Specialized build system for |
|
||||
| :class:`~spack_repo.builtin.build_systems.python` | Specialized build system for |
|
||||
| | Python extensions |
|
||||
+----------------------------------------------------------+----------------------------------+
|
||||
| :class:`~spack.build_systems.perl` | Specialized build system for |
|
||||
| :class:`~spack_repo.builtin.build_systems.perl` | Specialized build system for |
|
||||
| | Perl extensions |
|
||||
+----------------------------------------------------------+----------------------------------+
|
||||
| :class:`~spack.build_systems.ruby` | Specialized build system for |
|
||||
| :class:`~spack_repo.builtin.build_systems.ruby` | Specialized build system for |
|
||||
| | Ruby extensions |
|
||||
+----------------------------------------------------------+----------------------------------+
|
||||
| :class:`~spack.build_systems.intel` | Specialized build system for |
|
||||
| | licensed Intel software |
|
||||
+----------------------------------------------------------+----------------------------------+
|
||||
| :class:`~spack.build_systems.oneapi` | Specialized build system for |
|
||||
| :class:`~spack_repo.builtin.build_systems.oneapi` | Specialized build system for |
|
||||
| | Intel oneAPI software |
|
||||
+----------------------------------------------------------+----------------------------------+
|
||||
| :class:`~spack.build_systems.aspell_dict` | Specialized build system for |
|
||||
| :class:`~spack_repo.builtin.build_systems.aspell_dict` | Specialized build system for |
|
||||
| | Aspell dictionaries |
|
||||
+----------------------------------------------------------+----------------------------------+
|
||||
|
||||
@@ -3762,7 +3747,7 @@ the build system. The build systems currently supported by Spack are:
|
||||
rare cases where manual intervention is needed we need to stress that a
|
||||
package base class depends on the *build system* being used, not the language of the package.
|
||||
For example, a Python extension installed with CMake would ``extends("python")`` and
|
||||
subclass from :class:`~spack.build_systems.cmake.CMakePackage`.
|
||||
subclass from :class:`~spack_repo.builtin.build_systems.cmake.CMakePackage`.
|
||||
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
Overriding builder methods
|
||||
@@ -3770,7 +3755,7 @@ Overriding builder methods
|
||||
|
||||
Build-system "phases" have default implementations that fit most of the common cases:
|
||||
|
||||
.. literalinclude:: _spack_root/lib/spack/spack/build_systems/autotools.py
|
||||
.. literalinclude:: _spack_root/var/spack/repos/spack_repo/builtin/build_systems/autotools.py
|
||||
:pyobject: AutotoolsBuilder.configure
|
||||
:linenos:
|
||||
|
||||
@@ -3784,7 +3769,7 @@ configure arguments:
|
||||
|
||||
Each specific build system has a list of attributes and methods that can be overridden to
|
||||
fine-tune the installation of a package without overriding an entire phase. To
|
||||
have more information on them the place to go is the API docs of the :py:mod:`~.spack.build_systems`
|
||||
have more information on them the place to go is the API docs of the :py:mod:`~.spack_repo.builtin.build_systems`
|
||||
module.
|
||||
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
@@ -3826,7 +3811,7 @@ If the ``package.py`` has build instructions in a separate
|
||||
|
||||
.. code-block:: python
|
||||
|
||||
class CMakeBuilder(spack.build_systems.cmake.CMakeBuilder):
|
||||
class CMakeBuilder(spack_repo.builtin.build_systems.cmake.CMakeBuilder):
|
||||
def install(self, pkg, spec, prefix):
|
||||
...
|
||||
|
||||
@@ -3839,31 +3824,32 @@ Mixin base classes
|
||||
Besides build systems, there are other cases where common metadata and behavior can be extracted
|
||||
and reused by many packages. For instance, packages that depend on ``Cuda`` or ``Rocm``, share
|
||||
common dependencies and constraints. To factor these attributes into a single place, Spack provides
|
||||
a few mixin classes in the ``spack.build_systems`` module:
|
||||
a few mixin classes in the ``spack_repo.builtin.build_systems`` module:
|
||||
|
||||
+---------------------------------------------------------------+----------------------------------+
|
||||
| **API docs** | **Description** |
|
||||
+===============================================================+==================================+
|
||||
| :class:`~spack.build_systems.cuda.CudaPackage` | A helper class for packages that |
|
||||
| | use CUDA |
|
||||
+---------------------------------------------------------------+----------------------------------+
|
||||
| :class:`~spack.build_systems.rocm.ROCmPackage` | A helper class for packages that |
|
||||
| | use ROCm |
|
||||
+---------------------------------------------------------------+----------------------------------+
|
||||
| :class:`~spack.build_systems.gnu.GNUMirrorPackage` | A helper class for GNU packages |
|
||||
+---------------------------------------------------------------+----------------------------------+
|
||||
| :class:`~spack.build_systems.python.PythonExtension` | A helper class for Python |
|
||||
| | extensions |
|
||||
+---------------------------------------------------------------+----------------------------------+
|
||||
| :class:`~spack.build_systems.sourceforge.SourceforgePackage` | A helper class for packages |
|
||||
| | from sourceforge.org |
|
||||
+---------------------------------------------------------------+----------------------------------+
|
||||
| :class:`~spack.build_systems.sourceware.SourcewarePackage` | A helper class for packages |
|
||||
| | from sourceware.org |
|
||||
+---------------------------------------------------------------+----------------------------------+
|
||||
| :class:`~spack.build_systems.xorg.XorgPackage` | A helper class for x.org |
|
||||
| | packages |
|
||||
+---------------------------------------------------------------+----------------------------------+
|
||||
+----------------------------------------------------------------------------+----------------------------------+
|
||||
| **API docs** | **Description** |
|
||||
+============================================================================+==================================+
|
||||
| :class:`~spack_repo.builtin.build_systems.cuda.CudaPackage` | A helper class for packages that |
|
||||
| | use CUDA |
|
||||
+----------------------------------------------------------------------------+----------------------------------+
|
||||
| :class:`~spack_repo.builtin.build_systems.rocm.ROCmPackage` | A helper class for packages that |
|
||||
| | use ROCm |
|
||||
+----------------------------------------------------------------------------+----------------------------------+
|
||||
| :class:`~spack_repo.builtin.build_systems.gnu.GNUMirrorPackage` | A helper class for GNU packages |
|
||||
| | |
|
||||
+----------------------------------------------------------------------------+----------------------------------+
|
||||
| :class:`~spack_repo.builtin.build_systems.python.PythonExtension` | A helper class for Python |
|
||||
| | extensions |
|
||||
+----------------------------------------------------------------------------+----------------------------------+
|
||||
| :class:`~spack_repo.builtin.build_systems.sourceforge.SourceforgePackage` | A helper class for packages |
|
||||
| | from sourceforge.org |
|
||||
+----------------------------------------------------------------------------+----------------------------------+
|
||||
| :class:`~spack_repo.builtin.build_systems.sourceware.SourcewarePackage` | A helper class for packages |
|
||||
| | from sourceware.org |
|
||||
+----------------------------------------------------------------------------+----------------------------------+
|
||||
| :class:`~spack_repo.builtin.build_systems.xorg.XorgPackage` | A helper class for x.org |
|
||||
| | packages |
|
||||
+----------------------------------------------------------------------------+----------------------------------+
|
||||
|
||||
These classes should be used by adding them to the inheritance tree of the package that needs them,
|
||||
for instance:
|
||||
@@ -3907,13 +3893,13 @@ Additional build instructions are split into separate builder classes:
|
||||
|
||||
.. code-block:: python
|
||||
|
||||
class CMakeBuilder(spack.build_systems.cmake.CMakeBuilder):
|
||||
class CMakeBuilder(spack_repo.builtin.build_systems.cmake.CMakeBuilder):
|
||||
def cmake_args(self):
|
||||
return [
|
||||
self.define_from_variant("MY_FEATURE", "my_feature")
|
||||
]
|
||||
|
||||
class AutotoolsBuilder(spack.build_systems.autotools.AutotoolsBuilder):
|
||||
class AutotoolsBuilder(spack_repo.builtin.build_systems.autotools.AutotoolsBuilder):
|
||||
def configure_args(self):
|
||||
return self.with_or_without("my-feature", variant="my_feature")
|
||||
|
||||
@@ -5742,7 +5728,7 @@ running each executable, ``foo`` and ``bar``, as independent test parts.
|
||||
.. note::
|
||||
|
||||
The method name ``copy_test_files`` here is for illustration purposes.
|
||||
You are free to use a name that is more suited to your package.
|
||||
You are free to use a name that is better suited to your package.
|
||||
|
||||
The key to copying files for stand-alone testing at build time is use
|
||||
of the ``run_after`` directive, which ensures the associated files are
|
||||
@@ -7251,7 +7237,7 @@ which are not, there is the `checked_by` parameter in the license directive:
|
||||
|
||||
license("<license>", when="<when>", checked_by="<github username>")
|
||||
|
||||
When you have validated a github license, either when doing so explicitly or
|
||||
When you have validated a package license, either when doing so explicitly or
|
||||
as part of packaging a new package, please set the `checked_by` parameter
|
||||
to your Github username to signal that the license has been manually
|
||||
verified.
|
||||
|
@@ -214,7 +214,7 @@ package versions, simply run the following commands:
|
||||
|
||||
Running ``spack mark -i --all`` tells Spack to mark all of the existing
|
||||
packages within an environment as "implicitly" installed. This tells
|
||||
spack's garbage collection system that these packages should be cleaned up.
|
||||
Spack's garbage collection system that these packages should be cleaned up.
|
||||
|
||||
Don't worry however, this will not remove your entire environment.
|
||||
Running ``spack install`` will reexamine your spack environment after
|
||||
|
@@ -1 +0,0 @@
|
||||
from _pyrsistent_version import *
|
1
lib/spack/external/_vendoring/altgraph.pyi
vendored
1
lib/spack/external/_vendoring/altgraph.pyi
vendored
@@ -1 +0,0 @@
|
||||
from altgraph import *
|
@@ -1,3 +1,3 @@
|
||||
"""Init file to avoid namespace packages"""
|
||||
|
||||
__version__ = "0.2.4"
|
||||
__version__ = "0.2.5"
|
@@ -9,8 +9,8 @@
|
||||
import argparse
|
||||
import typing
|
||||
|
||||
import archspec
|
||||
import archspec.cpu
|
||||
from . import __version__ as archspec_version
|
||||
from .cpu import host
|
||||
|
||||
|
||||
def _make_parser() -> argparse.ArgumentParser:
|
||||
@@ -24,7 +24,7 @@ def _make_parser() -> argparse.ArgumentParser:
|
||||
"-V",
|
||||
help="Show the version and exit.",
|
||||
action="version",
|
||||
version=f"archspec, version {archspec.__version__}",
|
||||
version=f"archspec, version {archspec_version}",
|
||||
)
|
||||
parser.add_argument("--help", "-h", help="Show the help and exit.", action="help")
|
||||
|
||||
@@ -47,7 +47,7 @@ def _make_parser() -> argparse.ArgumentParser:
|
||||
def cpu() -> int:
|
||||
"""Run the `archspec cpu` subcommand."""
|
||||
try:
|
||||
print(archspec.cpu.host())
|
||||
print(host())
|
||||
except FileNotFoundError as exc:
|
||||
print(exc)
|
||||
return 1
|
@@ -6,12 +6,11 @@
|
||||
import functools
|
||||
import platform
|
||||
import re
|
||||
import sys
|
||||
import warnings
|
||||
from typing import IO, List, Set, Tuple
|
||||
|
||||
import archspec
|
||||
import archspec.cpu.alias
|
||||
import archspec.cpu.schema
|
||||
|
||||
from . import schema
|
||||
from .alias import FEATURE_ALIASES
|
||||
from .schema import LazyDictionary
|
||||
|
||||
@@ -67,7 +66,7 @@ class Microarchitecture:
|
||||
cpu_part (str): cpu part of the architecture, if relevant.
|
||||
"""
|
||||
|
||||
# pylint: disable=too-many-arguments,too-many-instance-attributes
|
||||
# pylint: disable=too-many-arguments,too-many-positional-arguments,too-many-instance-attributes
|
||||
#: Aliases for micro-architecture's features
|
||||
feature_aliases = FEATURE_ALIASES
|
||||
|
||||
@@ -150,17 +149,25 @@ def __ge__(self, other):
|
||||
return (self == other) or (self > other)
|
||||
|
||||
def __repr__(self):
|
||||
cls_name = self.__class__.__name__
|
||||
fmt = (
|
||||
cls_name + "({0.name!r}, {0.parents!r}, {0.vendor!r}, "
|
||||
"{0.features!r}, {0.compilers!r}, generation={0.generation!r}, "
|
||||
"cpu_part={0.cpu_part!r})"
|
||||
)
|
||||
return fmt.format(self)
|
||||
return f"{self.__class__.__name__}({self.name!r})"
|
||||
|
||||
def __str__(self):
|
||||
return self.name
|
||||
|
||||
def tree(self, fp: IO[str] = sys.stdout, indent: int = 4) -> None:
|
||||
"""Format the partial order of ancestors of this microarchitecture as a tree."""
|
||||
seen: Set[str] = set()
|
||||
stack: List[Tuple[int, Microarchitecture]] = [(0, self)]
|
||||
while stack:
|
||||
level, current = stack.pop()
|
||||
print(f"{'':>{level}}{current.name}", file=fp)
|
||||
|
||||
if current.name in seen:
|
||||
continue
|
||||
|
||||
for parent in reversed(current.parents):
|
||||
stack.append((level + indent, parent))
|
||||
|
||||
def __contains__(self, feature):
|
||||
# Feature must be of a string type, so be defensive about that
|
||||
if not isinstance(feature, str):
|
||||
@@ -384,7 +391,7 @@ def fill_target_from_dict(name, data, targets):
|
||||
)
|
||||
|
||||
known_targets = {}
|
||||
data = archspec.cpu.schema.TARGETS_JSON["microarchitectures"]
|
||||
data = schema.TARGETS_JSON["microarchitectures"]
|
||||
for name in data:
|
||||
if name in known_targets:
|
||||
# name was already brought in as ancestor to a target
|
@@ -131,4 +131,4 @@
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
File diff suppressed because it is too large
Load Diff
@@ -110,4 +110,4 @@
|
||||
"additionalProperties": false
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
20
lib/spack/external/_vendoring/archspec/vendor/cpuid/LICENSE
vendored
Normal file
20
lib/spack/external/_vendoring/archspec/vendor/cpuid/LICENSE
vendored
Normal file
@@ -0,0 +1,20 @@
|
||||
The MIT License (MIT)
|
||||
|
||||
Copyright (c) 2014 Anders Høst
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy of
|
||||
this software and associated documentation files (the "Software"), to deal in
|
||||
the Software without restriction, including without limitation the rights to
|
||||
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
|
||||
the Software, and to permit persons to whom the Software is furnished to do so,
|
||||
subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
|
||||
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
|
||||
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
|
||||
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
||||
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
1
lib/spack/external/_vendoring/jsonschema.pyi
vendored
1
lib/spack/external/_vendoring/jsonschema.pyi
vendored
@@ -1 +0,0 @@
|
||||
from jsonschema import *
|
1
lib/spack/external/_vendoring/macholib.pyi
vendored
1
lib/spack/external/_vendoring/macholib.pyi
vendored
@@ -1 +0,0 @@
|
||||
from macholib import *
|
@@ -1,213 +0,0 @@
|
||||
# flake8: noqa: E704
|
||||
# from https://gist.github.com/WuTheFWasThat/091a17d4b5cab597dfd5d4c2d96faf09
|
||||
# Stubs for pyrsistent (Python 3.6)
|
||||
|
||||
from typing import Any
|
||||
from typing import AnyStr
|
||||
from typing import Callable
|
||||
from typing import Iterable
|
||||
from typing import Iterator
|
||||
from typing import List
|
||||
from typing import Optional
|
||||
from typing import Mapping
|
||||
from typing import MutableMapping
|
||||
from typing import Sequence
|
||||
from typing import Set
|
||||
from typing import Union
|
||||
from typing import Tuple
|
||||
from typing import Type
|
||||
from typing import TypeVar
|
||||
from typing import overload
|
||||
|
||||
# see commit 08519aa for explanation of the re-export
|
||||
from pyrsistent.typing import CheckedKeyTypeError as CheckedKeyTypeError
|
||||
from pyrsistent.typing import CheckedPMap as CheckedPMap
|
||||
from pyrsistent.typing import CheckedPSet as CheckedPSet
|
||||
from pyrsistent.typing import CheckedPVector as CheckedPVector
|
||||
from pyrsistent.typing import CheckedType as CheckedType
|
||||
from pyrsistent.typing import CheckedValueTypeError as CheckedValueTypeError
|
||||
from pyrsistent.typing import InvariantException as InvariantException
|
||||
from pyrsistent.typing import PClass as PClass
|
||||
from pyrsistent.typing import PBag as PBag
|
||||
from pyrsistent.typing import PDeque as PDeque
|
||||
from pyrsistent.typing import PList as PList
|
||||
from pyrsistent.typing import PMap as PMap
|
||||
from pyrsistent.typing import PMapEvolver as PMapEvolver
|
||||
from pyrsistent.typing import PSet as PSet
|
||||
from pyrsistent.typing import PSetEvolver as PSetEvolver
|
||||
from pyrsistent.typing import PTypeError as PTypeError
|
||||
from pyrsistent.typing import PVector as PVector
|
||||
from pyrsistent.typing import PVectorEvolver as PVectorEvolver
|
||||
|
||||
T = TypeVar('T')
|
||||
KT = TypeVar('KT')
|
||||
VT = TypeVar('VT')
|
||||
|
||||
def pmap(initial: Union[Mapping[KT, VT], Iterable[Tuple[KT, VT]]] = {}, pre_size: int = 0) -> PMap[KT, VT]: ...
|
||||
def m(**kwargs: VT) -> PMap[str, VT]: ...
|
||||
|
||||
def pvector(iterable: Iterable[T] = ...) -> PVector[T]: ...
|
||||
def v(*iterable: T) -> PVector[T]: ...
|
||||
|
||||
def pset(iterable: Iterable[T] = (), pre_size: int = 8) -> PSet[T]: ...
|
||||
def s(*iterable: T) -> PSet[T]: ...
|
||||
|
||||
# see class_test.py for use cases
|
||||
Invariant = Tuple[bool, Optional[Union[str, Callable[[], str]]]]
|
||||
|
||||
@overload
|
||||
def field(
|
||||
type: Union[Type[T], Sequence[Type[T]]] = ...,
|
||||
invariant: Callable[[Any], Union[Invariant, Iterable[Invariant]]] = lambda _: (True, None),
|
||||
initial: Any = object(),
|
||||
mandatory: bool = False,
|
||||
factory: Callable[[Any], T] = lambda x: x,
|
||||
serializer: Callable[[Any, T], Any] = lambda _, value: value,
|
||||
) -> T: ...
|
||||
# The actual return value (_PField) is irrelevant after a PRecord has been instantiated,
|
||||
# see https://github.com/tobgu/pyrsistent/blob/master/pyrsistent/_precord.py#L10
|
||||
@overload
|
||||
def field(
|
||||
type: Any = ...,
|
||||
invariant: Callable[[Any], Union[Invariant, Iterable[Invariant]]] = lambda _: (True, None),
|
||||
initial: Any = object(),
|
||||
mandatory: bool = False,
|
||||
factory: Callable[[Any], Any] = lambda x: x,
|
||||
serializer: Callable[[Any, Any], Any] = lambda _, value: value,
|
||||
) -> Any: ...
|
||||
|
||||
# Use precise types for the simplest use cases, but fall back to Any for
|
||||
# everything else. See record_test.py for the wide range of possible types for
|
||||
# item_type
|
||||
@overload
|
||||
def pset_field(
|
||||
item_type: Type[T],
|
||||
optional: bool = False,
|
||||
initial: Iterable[T] = ...,
|
||||
) -> PSet[T]: ...
|
||||
@overload
|
||||
def pset_field(
|
||||
item_type: Any,
|
||||
optional: bool = False,
|
||||
initial: Any = (),
|
||||
) -> PSet[Any]: ...
|
||||
|
||||
@overload
|
||||
def pmap_field(
|
||||
key_type: Type[KT],
|
||||
value_type: Type[VT],
|
||||
optional: bool = False,
|
||||
invariant: Callable[[Any], Tuple[bool, Optional[str]]] = lambda _: (True, None),
|
||||
) -> PMap[KT, VT]: ...
|
||||
@overload
|
||||
def pmap_field(
|
||||
key_type: Any,
|
||||
value_type: Any,
|
||||
optional: bool = False,
|
||||
invariant: Callable[[Any], Tuple[bool, Optional[str]]] = lambda _: (True, None),
|
||||
) -> PMap[Any, Any]: ...
|
||||
|
||||
@overload
|
||||
def pvector_field(
|
||||
item_type: Type[T],
|
||||
optional: bool = False,
|
||||
initial: Iterable[T] = ...,
|
||||
) -> PVector[T]: ...
|
||||
@overload
|
||||
def pvector_field(
|
||||
item_type: Any,
|
||||
optional: bool = False,
|
||||
initial: Any = (),
|
||||
) -> PVector[Any]: ...
|
||||
|
||||
def pbag(elements: Iterable[T]) -> PBag[T]: ...
|
||||
def b(*elements: T) -> PBag[T]: ...
|
||||
|
||||
def plist(iterable: Iterable[T] = (), reverse: bool = False) -> PList[T]: ...
|
||||
def l(*elements: T) -> PList[T]: ...
|
||||
|
||||
def pdeque(iterable: Optional[Iterable[T]] = None, maxlen: Optional[int] = None) -> PDeque[T]: ...
|
||||
def dq(*iterable: T) -> PDeque[T]: ...
|
||||
|
||||
@overload
|
||||
def optional(type: T) -> Tuple[T, Type[None]]: ...
|
||||
@overload
|
||||
def optional(*typs: Any) -> Tuple[Any, ...]: ...
|
||||
|
||||
T_PRecord = TypeVar('T_PRecord', bound='PRecord')
|
||||
class PRecord(PMap[AnyStr, Any]):
|
||||
_precord_fields: Mapping
|
||||
_precord_initial_values: Mapping
|
||||
|
||||
def __hash__(self) -> int: ...
|
||||
def __init__(self, **kwargs: Any) -> None: ...
|
||||
def __iter__(self) -> Iterator[Any]: ...
|
||||
def __len__(self) -> int: ...
|
||||
@classmethod
|
||||
def create(
|
||||
cls: Type[T_PRecord],
|
||||
kwargs: Mapping,
|
||||
_factory_fields: Optional[Iterable] = None,
|
||||
ignore_extra: bool = False,
|
||||
) -> T_PRecord: ...
|
||||
# This is OK because T_PRecord is a concrete type
|
||||
def discard(self: T_PRecord, key: KT) -> T_PRecord: ...
|
||||
def remove(self: T_PRecord, key: KT) -> T_PRecord: ...
|
||||
|
||||
def serialize(self, format: Optional[Any] = ...) -> MutableMapping: ...
|
||||
|
||||
# From pyrsistent documentation:
|
||||
# This set function differs slightly from that in the PMap
|
||||
# class. First of all it accepts key-value pairs. Second it accepts multiple key-value
|
||||
# pairs to perform one, atomic, update of multiple fields.
|
||||
@overload
|
||||
def set(self, key: KT, val: VT) -> Any: ...
|
||||
@overload
|
||||
def set(self, **kwargs: VT) -> Any: ...
|
||||
|
||||
def immutable(
|
||||
members: Union[str, Iterable[str]] = '',
|
||||
name: str = 'Immutable',
|
||||
verbose: bool = False,
|
||||
) -> Tuple: ... # actually a namedtuple
|
||||
|
||||
# ignore mypy warning "Overloaded function signatures 1 and 5 overlap with
|
||||
# incompatible return types"
|
||||
@overload
|
||||
def freeze(o: Mapping[KT, VT]) -> PMap[KT, VT]: ... # type: ignore
|
||||
@overload
|
||||
def freeze(o: List[T]) -> PVector[T]: ... # type: ignore
|
||||
@overload
|
||||
def freeze(o: Tuple[T, ...]) -> Tuple[T, ...]: ...
|
||||
@overload
|
||||
def freeze(o: Set[T]) -> PSet[T]: ... # type: ignore
|
||||
@overload
|
||||
def freeze(o: T) -> T: ...
|
||||
|
||||
|
||||
@overload
|
||||
def thaw(o: PMap[KT, VT]) -> MutableMapping[KT, VT]: ... # type: ignore
|
||||
@overload
|
||||
def thaw(o: PVector[T]) -> List[T]: ... # type: ignore
|
||||
@overload
|
||||
def thaw(o: Tuple[T, ...]) -> Tuple[T, ...]: ...
|
||||
# collections.abc.MutableSet is kind of garbage:
|
||||
# https://stackoverflow.com/questions/24977898/why-does-collections-mutableset-not-bestow-an-update-method
|
||||
@overload
|
||||
def thaw(o: PSet[T]) -> Set[T]: ... # type: ignore
|
||||
@overload
|
||||
def thaw(o: T) -> T: ...
|
||||
|
||||
def mutant(fn: Callable) -> Callable: ...
|
||||
|
||||
def inc(x: int) -> int: ...
|
||||
@overload
|
||||
def discard(evolver: PMapEvolver[KT, VT], key: KT) -> None: ...
|
||||
@overload
|
||||
def discard(evolver: PVectorEvolver[T], key: int) -> None: ...
|
||||
@overload
|
||||
def discard(evolver: PSetEvolver[T], key: T) -> None: ...
|
||||
def rex(expr: str) -> Callable[[Any], bool]: ...
|
||||
def ny(_: Any) -> bool: ...
|
||||
|
||||
def get_in(keys: Iterable, coll: Mapping, default: Optional[Any] = None, no_default: bool = False) -> Any: ...
|
1
lib/spack/external/_vendoring/ruamel.pyi
vendored
1
lib/spack/external/_vendoring/ruamel.pyi
vendored
@@ -1 +0,0 @@
|
||||
from ruamel import *
|
@@ -1 +0,0 @@
|
||||
from six import *
|
@@ -1 +0,0 @@
|
||||
from six.moves import *
|
@@ -1 +0,0 @@
|
||||
from six.moves.configparser import *
|
81
lib/spack/external/archspec/README.md
vendored
81
lib/spack/external/archspec/README.md
vendored
@@ -1,81 +0,0 @@
|
||||
[](https://github.com/archspec/archspec/actions)
|
||||
[](https://codecov.io/gh/archspec/archspec)
|
||||
[](https://archspec.readthedocs.io/en/latest/?badge=latest)
|
||||
|
||||
|
||||
# Archspec (Python bindings)
|
||||
|
||||
Archspec aims at providing a standard set of human-understandable labels for
|
||||
various aspects of a system architecture like CPU, network fabrics, etc. and
|
||||
APIs to detect, query and compare them.
|
||||
|
||||
This project grew out of [Spack](https://spack.io/) and is currently under
|
||||
active development. At present it supports APIs to detect and model
|
||||
compatibility relationships among different CPU microarchitectures.
|
||||
|
||||
## Getting started with development
|
||||
|
||||
The `archspec` Python package needs [poetry](https://python-poetry.org/) to
|
||||
be installed from VCS sources. The preferred method to install it is via
|
||||
its custom installer outside of any virtual environment:
|
||||
```console
|
||||
$ curl -sSL https://raw.githubusercontent.com/python-poetry/poetry/master/get-poetry.py | python
|
||||
```
|
||||
You can refer to [Poetry's documentation](https://python-poetry.org/docs/#installation)
|
||||
for further details or for other methods to install this tool. You'll also need `tox`
|
||||
to run unit test:
|
||||
```console
|
||||
$ pip install --user tox
|
||||
```
|
||||
Finally you'll need to clone the repository:
|
||||
```console
|
||||
$ git clone --recursive https://github.com/archspec/archspec.git
|
||||
```
|
||||
|
||||
### Running unit tests
|
||||
Once you have your environment ready you can run `archspec` unit tests
|
||||
using ``tox`` from the root of the repository:
|
||||
```console
|
||||
$ tox
|
||||
[ ... ]
|
||||
py27: commands succeeded
|
||||
py35: commands succeeded
|
||||
py36: commands succeeded
|
||||
py37: commands succeeded
|
||||
py38: commands succeeded
|
||||
pylint: commands succeeded
|
||||
flake8: commands succeeded
|
||||
black: commands succeeded
|
||||
congratulations :)
|
||||
```
|
||||
|
||||
## Citing Archspec
|
||||
|
||||
If you are referencing `archspec` in a publication, please cite the following
|
||||
paper:
|
||||
|
||||
* Massimiliano Culpo, Gregory Becker, Carlos Eduardo Arango Gutierrez, Kenneth
|
||||
Hoste, and Todd Gamblin.
|
||||
[**`archspec`: A library for detecting, labeling, and reasoning about
|
||||
microarchitectures**](https://tgamblin.github.io/pubs/archspec-canopie-hpc-2020.pdf).
|
||||
In *2nd International Workshop on Containers and New Orchestration Paradigms
|
||||
for Isolated Environments in HPC (CANOPIE-HPC'20)*, Online Event, November
|
||||
12, 2020.
|
||||
|
||||
## License
|
||||
|
||||
Archspec is distributed under the terms of both the MIT license and the
|
||||
Apache License (Version 2.0). Users may choose either license, at their
|
||||
option.
|
||||
|
||||
All new contributions must be made under both the MIT and Apache-2.0
|
||||
licenses.
|
||||
|
||||
See [LICENSE-MIT](https://github.com/archspec/archspec/blob/master/LICENSE-MIT),
|
||||
[LICENSE-APACHE](https://github.com/archspec/archspec/blob/master/LICENSE-APACHE),
|
||||
[COPYRIGHT](https://github.com/archspec/archspec/blob/master/COPYRIGHT), and
|
||||
[NOTICE](https://github.com/archspec/archspec/blob/master/NOTICE) for details.
|
||||
|
||||
SPDX-License-Identifier: (Apache-2.0 OR MIT)
|
||||
|
||||
LLNL-CODE-811653
|
22
lib/spack/external/archspec/json/COPYRIGHT
vendored
22
lib/spack/external/archspec/json/COPYRIGHT
vendored
@@ -1,22 +0,0 @@
|
||||
Intellectual Property Notice
|
||||
------------------------------
|
||||
|
||||
Archspec is licensed under the Apache License, Version 2.0 (LICENSE-APACHE
|
||||
or http://www.apache.org/licenses/LICENSE-2.0) or the MIT license,
|
||||
(LICENSE-MIT or http://opensource.org/licenses/MIT), at your option.
|
||||
|
||||
Copyrights and patents in the Archspec project are retained by contributors.
|
||||
No copyright assignment is required to contribute to Archspec.
|
||||
|
||||
|
||||
SPDX usage
|
||||
------------
|
||||
|
||||
Individual files contain SPDX tags instead of the full license text.
|
||||
This enables machine processing of license information based on the SPDX
|
||||
License Identifiers that are available here: https://spdx.org/licenses/
|
||||
|
||||
Files that are dual-licensed as Apache-2.0 OR MIT contain the following
|
||||
text in the license header:
|
||||
|
||||
SPDX-License-Identifier: (Apache-2.0 OR MIT)
|
1
lib/spack/external/vendor.txt
vendored
1
lib/spack/external/vendor.txt
vendored
@@ -9,3 +9,4 @@ macholib==1.16.2
|
||||
altgraph==0.17.3
|
||||
ruamel.yaml==0.17.21
|
||||
typing_extensions==4.1.1
|
||||
archspec @ git+https://github.com/archspec/archspec.git@77f3f81df3dd80b7e538e2e41bc4485fbec2dbaa
|
||||
|
@@ -12,10 +12,9 @@
|
||||
import warnings
|
||||
from typing import Optional, Sequence, Union
|
||||
|
||||
import _vendoring.archspec.cpu
|
||||
from _vendoring.typing_extensions import TypedDict
|
||||
|
||||
import archspec.cpu
|
||||
|
||||
import llnl.util.filesystem as fs
|
||||
from llnl.util import tty
|
||||
|
||||
@@ -138,7 +137,7 @@ def _fix_ext_suffix(candidate_spec: "spack.spec.Spec"):
|
||||
}
|
||||
|
||||
# If the current architecture is not problematic return
|
||||
generic_target = archspec.cpu.host().family
|
||||
generic_target = _vendoring.archspec.cpu.host().family
|
||||
if str(generic_target) not in _suffix_to_be_checked:
|
||||
return
|
||||
|
||||
@@ -235,7 +234,7 @@ def _root_spec(spec_str: str) -> str:
|
||||
platform = str(spack.platforms.host())
|
||||
|
||||
spec_str += f" platform={platform}"
|
||||
target = archspec.cpu.host().family
|
||||
target = _vendoring.archspec.cpu.host().family
|
||||
spec_str += f" target={target}"
|
||||
|
||||
tty.debug(f"[BOOTSTRAP ROOT SPEC] {spec_str}")
|
||||
|
@@ -13,7 +13,7 @@
|
||||
import sys
|
||||
from typing import Dict, Optional, Tuple
|
||||
|
||||
import archspec.cpu
|
||||
import _vendoring.archspec.cpu
|
||||
|
||||
import spack.compilers.config
|
||||
import spack.compilers.libraries
|
||||
@@ -30,7 +30,7 @@ class ClingoBootstrapConcretizer:
|
||||
def __init__(self, configuration):
|
||||
self.host_platform = spack.platforms.host()
|
||||
self.host_os = self.host_platform.default_operating_system()
|
||||
self.host_target = archspec.cpu.host().family
|
||||
self.host_target = _vendoring.archspec.cpu.host().family
|
||||
self.host_architecture = spack.spec.ArchSpec.default_arch()
|
||||
self.host_architecture.target = str(self.host_target)
|
||||
self.host_compiler = self._valid_compiler_or_raise()
|
||||
|
@@ -8,7 +8,7 @@
|
||||
import sys
|
||||
from typing import Iterable, List
|
||||
|
||||
import archspec.cpu
|
||||
import _vendoring.archspec.cpu
|
||||
|
||||
from llnl.util import tty
|
||||
|
||||
@@ -51,7 +51,7 @@ def environment_root(cls) -> pathlib.Path:
|
||||
"""Environment root directory"""
|
||||
bootstrap_root_path = root_path()
|
||||
python_part = spec_for_current_python().replace("@", "")
|
||||
arch_part = archspec.cpu.host().family
|
||||
arch_part = _vendoring.archspec.cpu.host().family
|
||||
interpreter_part = hashlib.md5(sys.exec_prefix.encode()).hexdigest()[:5]
|
||||
environment_dir = f"{python_part}-{arch_part}-{interpreter_part}"
|
||||
return pathlib.Path(
|
||||
@@ -112,7 +112,7 @@ def _write_spack_yaml_file(self) -> None:
|
||||
context = {
|
||||
"python_spec": spec_for_current_python(),
|
||||
"python_prefix": sys.exec_prefix,
|
||||
"architecture": archspec.cpu.host().family,
|
||||
"architecture": _vendoring.archspec.cpu.host().family,
|
||||
"environment_path": self.environment_root(),
|
||||
"environment_specs": self.spack_dev_requirements(),
|
||||
"store_path": store_path(),
|
||||
|
@@ -59,7 +59,7 @@
|
||||
overload,
|
||||
)
|
||||
|
||||
import archspec.cpu
|
||||
import _vendoring.archspec.cpu
|
||||
|
||||
import llnl.util.tty as tty
|
||||
from llnl.string import plural
|
||||
@@ -440,10 +440,12 @@ def optimization_flags(compiler, target):
|
||||
# Try to check if the current compiler comes with a version number or
|
||||
# has an unexpected suffix. If so, treat it as a compiler with a
|
||||
# custom spec.
|
||||
version_number, _ = archspec.cpu.version_components(compiler.version.dotted_numeric_string)
|
||||
version_number, _ = _vendoring.archspec.cpu.version_components(
|
||||
compiler.version.dotted_numeric_string
|
||||
)
|
||||
try:
|
||||
result = target.optimization_flags(compiler.name, version_number)
|
||||
except (ValueError, archspec.cpu.UnsupportedMicroarchitecture):
|
||||
except (ValueError, _vendoring.archspec.cpu.UnsupportedMicroarchitecture):
|
||||
result = ""
|
||||
|
||||
return result
|
||||
|
@@ -1,660 +0,0 @@
|
||||
====================================
|
||||
Development Notes on Intel Packages
|
||||
====================================
|
||||
|
||||
These are notes for concepts and development of
|
||||
lib/spack/spack/build_systems/intel.py .
|
||||
|
||||
For documentation on how to *use* ``IntelPackage``, see
|
||||
lib/spack/docs/build_systems/intelpackage.rst .
|
||||
|
||||
-------------------------------------------------------------------------------
|
||||
Installation and path handling as implemented in ./intel.py
|
||||
-------------------------------------------------------------------------------
|
||||
|
||||
|
||||
***************************************************************************
|
||||
Prefix differences between Spack-external and Spack-internal installations
|
||||
***************************************************************************
|
||||
|
||||
|
||||
Problem summary
|
||||
~~~~~~~~~~~~~~~~
|
||||
|
||||
For Intel packages that were installed external to Spack, ``self.prefix`` will
|
||||
be a *component-specific* path (e.g. to an MKL-specific dir hierarchy), whereas
|
||||
for a package installed by Spack itself, ``self.prefix`` will be a
|
||||
*vendor-level* path that holds one or more components (or parts thereof), and
|
||||
must be further qualified down to a particular desired component.
|
||||
|
||||
It is possible that a similar conceptual difference is inherent to other
|
||||
package families that use a common vendor-style installer.
|
||||
|
||||
|
||||
Description
|
||||
~~~~~~~~~~~~
|
||||
|
||||
Spack makes packages available through two routes, let's call them A and B:
|
||||
|
||||
A. Packages pre-installed external to Spack and configured *for* Spack
|
||||
B. Packages built and installed *by* Spack.
|
||||
|
||||
For a user who is interested in building end-user applications, it should not
|
||||
matter through which route any of its dependent packages has been installed.
|
||||
Most packages natively support a ``prefix`` concept which unifies the two
|
||||
routes just fine.
|
||||
|
||||
Intel packages, however, are more complicated because they consist of a number
|
||||
of components that are released as a suite of varying extent, like "Intel
|
||||
Parallel Studio *Foo* Edition", or subsetted into products like "MKL" or "MPI",
|
||||
each of which also contain libraries from other components like the compiler
|
||||
runtime and multithreading libraries. For this reason, an Intel package is
|
||||
"anchored" during installation at a directory level higher than just the
|
||||
user-facing directory that has the conventional hierarchy of ``bin``, ``lib``,
|
||||
and others relevant for the end-product.
|
||||
|
||||
As a result, internal to Spack, there is a conceptual difference in what
|
||||
``self.prefix`` represents for the two routes.
|
||||
|
||||
For route A, consider MKL installed outside of Spack. It will likely be one
|
||||
product component among other products, at one particular release among others
|
||||
that are installed in sibling or cousin directories on the local system.
|
||||
Therefore, the path given to Spack in ``packages.yaml`` should be a
|
||||
*product-specific and fully version-specific* directory. E.g., for an
|
||||
``intel-mkl`` package, ``self.prefix`` should look like::
|
||||
|
||||
/opt/intel/compilers_and_libraries_2018.1.163/linux/mkl
|
||||
|
||||
In this route, the interaction point with the user is encapsulated in an
|
||||
environment variable which will be (in pseudo-code)::
|
||||
|
||||
MKLROOT := {self.prefix}
|
||||
|
||||
For route B, a Spack-based installation of MKL will be placed in the directory
|
||||
given to the ``./install.sh`` script of Intel's package distribution. This
|
||||
directory is taken to be the *vendor*-specific anchor directory, playing the
|
||||
same role as the default ``/opt/intel``. In this case, ``self.prefix`` will
|
||||
be::
|
||||
|
||||
$SPACK_ROOT/opt/spack/linux-centos6-x86_64/gcc-4.9.3/intel-mkl-2018.1.163-<HASH>
|
||||
|
||||
However, now the environment variable will have to be constructed as *several
|
||||
directory levels down*::
|
||||
|
||||
MKLROOT := {self.prefix}/compilers_and_libraries_2018.1.163/linux/mkl
|
||||
|
||||
A recent post on the Spack mailing list illustrates the confusion when route A
|
||||
was taken while route B was the only one that was coded in Spack:
|
||||
https://groups.google.com/d/msg/spack/x28qlmqPAys/Ewx6220uAgAJ
|
||||
|
||||
|
||||
Solution
|
||||
~~~~~~~~~
|
||||
|
||||
Introduce a series of functions which will return the appropriate
|
||||
directories, regardless of whether the Intel package has been installed
|
||||
external or internal to Spack:
|
||||
|
||||
========================== ==================================================
|
||||
Function Example return values
|
||||
-------------------------- --------------------------------------------------
|
||||
normalize_suite_dir() Spack-external installation:
|
||||
/opt/intel/compilers_and_libraries_2018.1.163
|
||||
Spack-internal installation:
|
||||
$SPACK_ROOT/...<HASH>/compilers_and_libraries_2018.1.163
|
||||
-------------------------- --------------------------------------------------
|
||||
normalize_path('mkl') <suite_dir>/linux/mkl
|
||||
component_bin_dir() <suite_dir>/linux/mkl/bin
|
||||
component_lib_dir() <suite_dir>/linux/mkl/lib/intel64
|
||||
-------------------------- --------------------------------------------------
|
||||
normalize_path('mpi') <suite_dir>/linux/mpi
|
||||
component_bin_dir('mpi') <suite_dir>/linux/mpi/intel64/bin
|
||||
component_lib_dir('mpi') <suite_dir>/linux/mpi/intel64/lib
|
||||
========================== ==================================================
|
||||
|
||||
|
||||
*********************************
|
||||
Analysis of directory layouts
|
||||
*********************************
|
||||
|
||||
Let's look at some sample directory layouts, using ``ls -lF``,
|
||||
but focusing on names and symlinks only.
|
||||
|
||||
Spack-born installation of ``intel-mkl@2018.1.163``
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
::
|
||||
|
||||
$ ls -l <prefix>
|
||||
|
||||
bin/
|
||||
- compilervars.*sh (symlinked) ONLY
|
||||
|
||||
compilers_and_libraries -> compilers_and_libraries_2018
|
||||
- generically-named entry point, stable across versions (one hopes)
|
||||
|
||||
compilers_and_libraries_2018/
|
||||
- vaguely-versioned dirname, holding a stub hierarchy --ignorable
|
||||
|
||||
$ ls -l compilers_and_libraries_2018/linux/
|
||||
bin - actual compilervars.*sh (reg. files) ONLY
|
||||
documentation -> ../../documentation_2018/
|
||||
lib -> ../../compilers_and_libraries_2018.1.163/linux/compiler/lib/
|
||||
mkl -> ../../compilers_and_libraries_2018.1.163/linux/mkl/
|
||||
pkg_bin -> ../../compilers_and_libraries_2018.1.163/linux/bin/
|
||||
samples -> ../../samples_2018/
|
||||
tbb -> ../../compilers_and_libraries_2018.1.163/linux/tbb/
|
||||
|
||||
compilers_and_libraries_2018.1.163/
|
||||
- Main "product" + a minimal set of libs from related products
|
||||
|
||||
$ ls -l compilers_and_libraries_2018.1.163/linux/
|
||||
bin/ - compilervars.*sh, link_install*sh ONLY
|
||||
mkl/ - Main Product ==> to be assigned to MKLROOT
|
||||
compiler/ - lib/intel64_lin/libiomp5* ONLY
|
||||
tbb/ - tbb/lib/intel64_lin/gcc4.[147]/libtbb*.so* ONLY
|
||||
|
||||
parallel_studio_xe_2018 -> parallel_studio_xe_2018.1.038/
|
||||
parallel_studio_xe_2018.1.038/
|
||||
- Alternate product packaging - ignorable
|
||||
|
||||
$ ls -l parallel_studio_xe_2018.1.038/
|
||||
bin/ - actual psxevars.*sh (reg. files)
|
||||
compilers_and_libraries_2018 -> <full_path>/comp...aries_2018.1.163
|
||||
documentation_2018 -> <full_path_prefix>/documentation_2018
|
||||
samples_2018 -> <full_path_prefix>/samples_2018
|
||||
...
|
||||
|
||||
documentation_2018/
|
||||
samples_2018/
|
||||
lib -> compilers_and_libraries/linux/lib/
|
||||
mkl -> compilers_and_libraries/linux/mkl/
|
||||
tbb -> compilers_and_libraries/linux/tbb/
|
||||
- auxiliaries and convenience links
|
||||
|
||||
Spack-external installation of Intel-MPI 2018
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
For MPI, the layout is slightly different than MKL. The prefix will have to
|
||||
include an architecture directory (typically ``intel64``), which then contains
|
||||
bin/, lib/, ..., all without further architecture branching. The environment
|
||||
variable ``I_MPI_ROOT`` from the API documentation, however, must be the
|
||||
package's top directory, not including the architecture.
|
||||
|
||||
FIXME: For MANPATH, need the parent dir.
|
||||
|
||||
::
|
||||
|
||||
$ ls -lF /opt/intel/compilers_and_libraries_2018.1.163/linux/mpi/
|
||||
bin64 -> intel64/bin/
|
||||
etc64 -> intel64/etc/
|
||||
include64 -> intel64/include/
|
||||
lib64 -> intel64/lib/
|
||||
|
||||
benchmarks/
|
||||
binding/
|
||||
intel64/
|
||||
man/
|
||||
test/
|
||||
|
||||
The package contains an MPI-2019 preview; Curiously, its release notes contain
|
||||
the tag: "File structure clean-up." I could not find further documentation on
|
||||
this, however, so it is unclear what, if any, changes will make it to release.
|
||||
|
||||
https://software.intel.com/en-us/articles/restoring-legacy-path-structure-on-intel-mpi-library-2019
|
||||
|
||||
::
|
||||
|
||||
$ ls -lF /opt/intel/compilers_and_libraries_2018.1.163/linux/mpi_2019/
|
||||
binding/
|
||||
doc/
|
||||
imb/
|
||||
intel64/
|
||||
man/
|
||||
test/
|
||||
|
||||
Spack-external installation of Intel Parallel Studio 2018
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
This is the main product bundle that I actually downloaded and installed on my
|
||||
system. Its nominal installation directory mostly holds merely symlinks
|
||||
to components installed in sibling dirs::
|
||||
|
||||
$ ls -lF /opt/intel/parallel_studio_xe_2018.1.038/
|
||||
advisor_2018 -> /opt/intel/advisor_2018/
|
||||
clck_2018 -> /opt/intel/clck/2018.1/
|
||||
compilers_and_libraries_2018 -> /opt/intel/comp....aries_2018.1.163/
|
||||
documentation_2018 -> /opt/intel/documentation_2018/
|
||||
ide_support_2018 -> /opt/intel/ide_support_2018/
|
||||
inspector_2018 -> /opt/intel/inspector_2018/
|
||||
itac_2018 -> /opt/intel/itac/2018.1.017/
|
||||
man -> /opt/intel/man/
|
||||
samples_2018 -> /opt/intel/samples_2018/
|
||||
vtune_amplifier_2018 -> /opt/intel/vtune_amplifier_2018/
|
||||
|
||||
psxevars.csh -> ./bin/psxevars.csh*
|
||||
psxevars.sh -> ./bin/psxevars.sh*
|
||||
bin/ - *vars.*sh scripts + sshconnectivity.exp ONLY
|
||||
|
||||
licensing/
|
||||
uninstall*
|
||||
|
||||
The only relevant regular files are ``*vars.*sh``, but those also just churn
|
||||
through the subordinate vars files of the components.
|
||||
|
||||
Installation model
|
||||
~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
Intel packages come with an ``install.sh`` script that is normally run
|
||||
interactively (in either text or GUI mode) but can run unattended with a
|
||||
``--silent <file>`` option, which is of course what Spack uses.
|
||||
|
||||
Format of configuration file
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
The configuration file is conventionally called ``silent.cfg`` and has a simple
|
||||
``token=value`` syntax. Before using the configuration file, the installer
|
||||
calls ``<staging_dir>/pset/check.awk`` to validate it. Example paths to the
|
||||
validator are::
|
||||
|
||||
.../l_mkl_2018.1.163/pset/check.awk .
|
||||
.../parallel_studio_xe_2018_update1_cluster_edition/pset/check.awk
|
||||
|
||||
The tokens that are accepted in the configuration file vary between packages.
|
||||
Tokens not supported for a given package **will cause the installer to stop
|
||||
and fail.** This is particularly relevant for license-related tokens, which are
|
||||
accepted only for packages that actually require a license.
|
||||
|
||||
Reference: [Intel's documentation](https://software.intel.com/en-us/articles/configuration-file-format)
|
||||
|
||||
See also: https://software.intel.com/en-us/articles/silent-installation-guide-for-intel-parallel-studio-xe-composer-edition-for-os-x
|
||||
|
||||
The following is from ``.../parallel_studio_xe_2018_update1_cluster_edition/pset/check.awk``:
|
||||
|
||||
* Tokens valid for all packages encountered::
|
||||
|
||||
ACCEPT_EULA {accept, decline}
|
||||
CONTINUE_WITH_OPTIONAL_ERROR {yes, no}
|
||||
PSET_INSTALL_DIR {/opt/intel, , filepat}
|
||||
CONTINUE_WITH_INSTALLDIR_OVERWRITE {yes, no}
|
||||
COMPONENTS {ALL, DEFAULTS, , anythingpat}
|
||||
PSET_MODE {install, repair, uninstall}
|
||||
NONRPM_DB_DIR {, filepat}
|
||||
|
||||
SIGNING_ENABLED {yes, no}
|
||||
ARCH_SELECTED {IA32, INTEL64, ALL}
|
||||
|
||||
* Mentioned but unexplained in ``check.awk``::
|
||||
|
||||
NO_VALIDATE (?!)
|
||||
|
||||
* Only for licensed packages::
|
||||
|
||||
ACTIVATION_SERIAL_NUMBER {, snpat}
|
||||
ACTIVATION_LICENSE_FILE {, lspat, filepat}
|
||||
ACTIVATION_TYPE {exist_lic, license_server,
|
||||
license_file, trial_lic,
|
||||
|
||||
PHONEHOME_SEND_USAGE_DATA {yes, no}
|
||||
serial_number}
|
||||
|
||||
* Only for Amplifier (obviously)::
|
||||
|
||||
AMPLIFIER_SAMPLING_DRIVER_INSTALL_TYPE {build, kit}
|
||||
AMPLIFIER_DRIVER_ACCESS_GROUP {, anythingpat, vtune}
|
||||
AMPLIFIER_DRIVER_PERMISSIONS {, anythingpat, 666}
|
||||
AMPLIFIER_LOAD_DRIVER {yes, no}
|
||||
AMPLIFIER_C_COMPILER {, filepat, auto, none}
|
||||
AMPLIFIER_KERNEL_SRC_DIR {, filepat, auto, none}
|
||||
AMPLIFIER_MAKE_COMMAND {, filepat, auto, none}
|
||||
AMPLIFIER_INSTALL_BOOT_SCRIPT {yes, no}
|
||||
AMPLIFIER_DRIVER_PER_USER_MODE {yes, no}
|
||||
|
||||
* Only for MKL and Studio::
|
||||
|
||||
CLUSTER_INSTALL_REMOTE {yes, no}
|
||||
CLUSTER_INSTALL_TEMP {, filepat}
|
||||
CLUSTER_INSTALL_MACHINES_FILE {, filepat}
|
||||
|
||||
* "backward compatibility" (?)::
|
||||
|
||||
INSTALL_MODE {RPM, NONRPM}
|
||||
download_only {yes}
|
||||
download_dir {, filepat}
|
||||
|
||||
|
||||
Details for licensing tokens
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
Quoted from
|
||||
https://software.intel.com/en-us/articles/configuration-file-format,
|
||||
for reference:
|
||||
|
||||
[ed. note: As of 2018-05, the page incorrectly references ``ACTIVATION``, which
|
||||
was used only until about 2012; this is corrected to ``ACTIVATION_TYPE`` here.]
|
||||
|
||||
...
|
||||
|
||||
``ACTIVATION_TYPE=exist_lic``
|
||||
This directive tells the install program to look for an existing
|
||||
license during the install process. This is the preferred method for
|
||||
silent installs. Take the time to register your serial number and get
|
||||
a license file (see below). Having a license file on the system
|
||||
simplifies the process. In addition, as an administrator it is good
|
||||
practice to know WHERE your licenses are saved on your system.
|
||||
License files are plain text files with a .lic extension. By default
|
||||
these are saved in /opt/intel/licenses which is searched by default.
|
||||
If you save your license elsewhere, perhaps under an NFS folder, set
|
||||
environment variable **INTEL_LICENSE_FILE** to the full path to your
|
||||
license file prior to starting the installation or use the
|
||||
configuration file directive ``ACTIVATION_LICENSE_FILE`` to specify the
|
||||
full pathname to the license file.
|
||||
|
||||
Options for ``ACTIVATION_TYPE`` are ``{ exist_lic, license_file, server_lic,
|
||||
serial_number, trial_lic }``
|
||||
|
||||
``exist_lic``
|
||||
directs the installer to search for a valid license on the server.
|
||||
Searches will utilize the environment variable **INTEL_LICENSE_FILE**,
|
||||
search the default license directory /opt/intel/licenses, or use the
|
||||
``ACTIVATION_LICENSE_FILE`` directive to find a valid license file.
|
||||
|
||||
``license_file``
|
||||
is similar to exist_lic but directs the installer to use
|
||||
``ACTIVATION_LICENSE_FILE`` to find the license file.
|
||||
|
||||
``server_lic``
|
||||
is similar to exist_lic and exist_lic but directs the installer that
|
||||
this is a client installation and a floating license server will be
|
||||
contacted to active the product. This option will contact your
|
||||
floating license server on your network to retrieve the license
|
||||
information. BEFORE using this option make sure your client is
|
||||
correctly set up for your network including all networking, routing,
|
||||
name service, and firewall configuration. Insure that your client has
|
||||
direct access to your floating license server and that firewalls are
|
||||
set up to allow TCP/IP access for the 2 license server ports.
|
||||
server_lic will use **INTEL_LICENSE_FILE** containing a port@host format
|
||||
OR a client license file. The formats for these are described here
|
||||
https://software.intel.com/en-us/articles/licensing-setting-up-the-client-floating-license
|
||||
|
||||
``serial_number``
|
||||
directs the installer to use directive ``ACTIVATION_SERIAL_NUMBER`` for
|
||||
activation. This method will require the installer to contact an
|
||||
external Intel activation server over the Internet to confirm your
|
||||
serial number. Due to user and company firewalls, this method is more
|
||||
complex and hence error prone of the available activation methods. We
|
||||
highly recommend using a license file or license server for activation
|
||||
instead.
|
||||
|
||||
``trial_lic``
|
||||
is used only if you do not have an existing license and intend to
|
||||
temporarily evaluate the compiler. This method creates a temporary
|
||||
trial license in Trusted Storage on your system.
|
||||
|
||||
...
|
||||
|
||||
*******************
|
||||
vars files
|
||||
*******************
|
||||
|
||||
Intel's product packages contain a number of shell initialization files let's call them vars files.
|
||||
|
||||
There are three kinds:
|
||||
|
||||
#. Component-specific vars files, such as `mklvars` or `tbbvars`.
|
||||
#. Toplevel vars files such as "psxevars". They will scan for all
|
||||
component-specific vars files associated with the product, and source them
|
||||
if found.
|
||||
#. Symbolic links to either of them. Links may appear under a different name
|
||||
for backward compatibility.
|
||||
|
||||
At present, IntelPackage class is only concerned with the toplevel vars files,
|
||||
generally found in the product's toplevel bin/ directory.
|
||||
|
||||
For reference, here is an overview of the names and locations of the vars files
|
||||
in the 2018 product releases, as seen for Spack-native installation. NB: May be
|
||||
incomplete as some components may have been omitted during installation.
|
||||
|
||||
Names of vars files seen::
|
||||
|
||||
$ cd opt/spack/linux-centos6-x86_64
|
||||
$ find intel* -name \*vars.sh -printf '%f\n' | sort -u | nl
|
||||
1 advixe-vars.sh
|
||||
2 amplxe-vars.sh
|
||||
3 apsvars.sh
|
||||
4 compilervars.sh
|
||||
5 daalvars.sh
|
||||
6 debuggervars.sh
|
||||
7 iccvars.sh
|
||||
8 ifortvars.sh
|
||||
9 inspxe-vars.sh
|
||||
10 ippvars.sh
|
||||
11 mklvars.sh
|
||||
12 mpivars.sh
|
||||
13 pstlvars.sh
|
||||
14 psxevars.sh
|
||||
15 sep_vars.sh
|
||||
16 tbbvars.sh
|
||||
|
||||
Names and locations of vars files, sorted by Spack package name::
|
||||
|
||||
$ cd opt/spack/linux-centos6-x86_64
|
||||
$ find intel* -name \*vars.sh -printf '%y\t%-15f\t%h\n' \
|
||||
| cut -d/ -f1,4- \
|
||||
| sed '/iccvars\|ifortvars/d; s,/,\t\t,; s,\.sh,,; s, */\(intel[/-]\),\1,' \
|
||||
| sort -k3,3 -k2,2 \
|
||||
| nl \
|
||||
| awk '{printf "%6i %-2s %-16s %-24s %s\n", $1, $2, $3, $4, $5}'
|
||||
|
||||
--------------------------------------------------------------------------------------------------------
|
||||
item no.
|
||||
file or link
|
||||
name of vars file
|
||||
Spack package name
|
||||
dir relative to Spack install dir
|
||||
--------------------------------------------------------------------------------------------------------
|
||||
|
||||
1 f mpivars intel compilers_and_libraries_2018.1.163/linux/mpi/intel64/bin
|
||||
2 f mpivars intel compilers_and_libraries_2018.1.163/linux/mpirt/bin/ia32_lin
|
||||
3 f tbbvars intel compilers_and_libraries_2018.1.163/linux/tbb/bin
|
||||
4 f pstlvars intel compilers_and_libraries_2018.1.163/linux/pstl/bin
|
||||
5 f compilervars intel compilers_and_libraries_2018.1.163/linux/bin
|
||||
6 f compilervars intel compilers_and_libraries_2018/linux/bin
|
||||
7 l compilervars intel bin
|
||||
8 f daalvars intel-daal compilers_and_libraries_2018.2.199/linux/daal/bin
|
||||
9 f psxevars intel-daal parallel_studio_xe_2018.2.046/bin
|
||||
10 l psxevars intel-daal parallel_studio_xe_2018.2.046
|
||||
11 f compilervars intel-daal compilers_and_libraries_2018.2.199/linux/bin
|
||||
12 f compilervars intel-daal compilers_and_libraries_2018/linux/bin
|
||||
13 l compilervars intel-daal bin
|
||||
14 f ippvars intel-ipp compilers_and_libraries_2018.2.199/linux/ipp/bin
|
||||
15 f psxevars intel-ipp parallel_studio_xe_2018.2.046/bin
|
||||
16 l psxevars intel-ipp parallel_studio_xe_2018.2.046
|
||||
17 f compilervars intel-ipp compilers_and_libraries_2018.2.199/linux/bin
|
||||
18 f compilervars intel-ipp compilers_and_libraries_2018/linux/bin
|
||||
19 l compilervars intel-ipp bin
|
||||
20 f mklvars intel-mkl compilers_and_libraries_2018.2.199/linux/mkl/bin
|
||||
21 f psxevars intel-mkl parallel_studio_xe_2018.2.046/bin
|
||||
22 l psxevars intel-mkl parallel_studio_xe_2018.2.046
|
||||
23 f compilervars intel-mkl compilers_and_libraries_2018.2.199/linux/bin
|
||||
24 f compilervars intel-mkl compilers_and_libraries_2018/linux/bin
|
||||
25 l compilervars intel-mkl bin
|
||||
26 f mpivars intel-mpi compilers_and_libraries_2018.2.199/linux/mpi_2019/intel64/bin
|
||||
27 f mpivars intel-mpi compilers_and_libraries_2018.2.199/linux/mpi/intel64/bin
|
||||
28 f psxevars intel-mpi parallel_studio_xe_2018.2.046/bin
|
||||
29 l psxevars intel-mpi parallel_studio_xe_2018.2.046
|
||||
30 f compilervars intel-mpi compilers_and_libraries_2018.2.199/linux/bin
|
||||
31 f compilervars intel-mpi compilers_and_libraries_2018/linux/bin
|
||||
32 l compilervars intel-mpi bin
|
||||
33 f apsvars intel-parallel-studio vtune_amplifier_2018.1.0.535340
|
||||
34 l apsvars intel-parallel-studio performance_snapshots_2018.1.0.535340
|
||||
35 f ippvars intel-parallel-studio compilers_and_libraries_2018.1.163/linux/ipp/bin
|
||||
36 f ippvars intel-parallel-studio composer_xe_2015.6.233/ipp/bin
|
||||
37 f mklvars intel-parallel-studio compilers_and_libraries_2018.1.163/linux/mkl/bin
|
||||
38 f mklvars intel-parallel-studio composer_xe_2015.6.233/mkl/bin
|
||||
39 f mpivars intel-parallel-studio compilers_and_libraries_2018.1.163/linux/mpi/intel64/bin
|
||||
40 f mpivars intel-parallel-studio compilers_and_libraries_2018.1.163/linux/mpirt/bin/ia32_lin
|
||||
41 f tbbvars intel-parallel-studio compilers_and_libraries_2018.1.163/linux/tbb/bin
|
||||
42 f tbbvars intel-parallel-studio composer_xe_2015.6.233/tbb/bin
|
||||
43 f daalvars intel-parallel-studio compilers_and_libraries_2018.1.163/linux/daal/bin
|
||||
44 f pstlvars intel-parallel-studio compilers_and_libraries_2018.1.163/linux/pstl/bin
|
||||
45 f psxevars intel-parallel-studio parallel_studio_xe_2018.1.038/bin
|
||||
46 l psxevars intel-parallel-studio parallel_studio_xe_2018.1.038
|
||||
47 f sep_vars intel-parallel-studio vtune_amplifier_2018.1.0.535340
|
||||
48 f sep_vars intel-parallel-studio vtune_amplifier_2018.1.0.535340/target/android_v4.1_x86_64
|
||||
49 f advixe-vars intel-parallel-studio advisor_2018.1.1.535164
|
||||
50 f amplxe-vars intel-parallel-studio vtune_amplifier_2018.1.0.535340
|
||||
51 f inspxe-vars intel-parallel-studio inspector_2018.1.1.535159
|
||||
52 f compilervars intel-parallel-studio compilers_and_libraries_2018.1.163/linux/bin
|
||||
53 f compilervars intel-parallel-studio compilers_and_libraries_2018/linux/bin
|
||||
54 l compilervars intel-parallel-studio bin
|
||||
55 f debuggervars intel-parallel-studio debugger_2018/bin
|
||||
|
||||
|
||||
********************
|
||||
MPI linkage
|
||||
********************
|
||||
|
||||
|
||||
Library selection
|
||||
~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
In the Spack code so far, the library selections for MPI are:
|
||||
|
||||
::
|
||||
|
||||
libnames = ['libmpifort', 'libmpi']
|
||||
if 'cxx' in self.spec.last_query.extra_parameters:
|
||||
libnames = ['libmpicxx'] + libnames
|
||||
return find_libraries(libnames,
|
||||
root=self.component_lib_dir('mpi'),
|
||||
shared=True, recursive=False)
|
||||
|
||||
The problem is that there are multiple library versions under ``component_lib_dir``::
|
||||
|
||||
$ cd $I_MPI_ROOT
|
||||
$ find . -name libmpi.so | sort
|
||||
./intel64/lib/debug/libmpi.so
|
||||
./intel64/lib/debug_mt/libmpi.so
|
||||
./intel64/lib/libmpi.so
|
||||
./intel64/lib/release/libmpi.so
|
||||
./intel64/lib/release_mt/libmpi.so
|
||||
|
||||
"mt" refers to multi-threading, not in the explicit sense but in the sense of being thread-safe::
|
||||
|
||||
$ mpiifort -help | grep mt
|
||||
-mt_mpi link the thread safe version of the Intel(R) MPI Library
|
||||
|
||||
Well, why should we not inspect what the canonical script does? The wrapper
|
||||
has its own hardcoded "prefix=..." and can thus tell us what it will do, from a
|
||||
*wiped environment* no less!::
|
||||
|
||||
$ env - intel64/bin/mpiicc -show hello.c | ld-unwrap-args
|
||||
icc 'hello.c' \
|
||||
-I/opt/intel/compilers_and_libraries_2018.1.163/linux/mpi/intel64/include \
|
||||
-L/opt/intel/compilers_and_libraries_2018.1.163/linux/mpi/intel64/lib/release_mt \
|
||||
-L/opt/intel/compilers_and_libraries_2018.1.163/linux/mpi/intel64/lib \
|
||||
-Xlinker --enable-new-dtags \
|
||||
-Xlinker -rpath=/opt/intel/compilers_and_libraries_2018.1.163/linux/mpi/intel64/lib/release_mt \
|
||||
-Xlinker -rpath=/opt/intel/compilers_and_libraries_2018.1.163/linux/mpi/intel64/lib \
|
||||
-Xlinker -rpath=/opt/intel/mpi-rt/2017.0.0/intel64/lib/release_mt \
|
||||
-Xlinker -rpath=/opt/intel/mpi-rt/2017.0.0/intel64/lib \
|
||||
-lmpifort \
|
||||
-lmpi \
|
||||
-lmpigi \
|
||||
-ldl \
|
||||
-lrt \
|
||||
-lpthread
|
||||
|
||||
|
||||
MPI Wrapper options
|
||||
~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
For reference, here's the wrapper's builtin help output::
|
||||
|
||||
$ mpiifort -help
|
||||
Simple script to compile and/or link MPI programs.
|
||||
Usage: mpiifort [options] <files>
|
||||
----------------------------------------------------------------------------
|
||||
The following options are supported:
|
||||
-fc=<name> | -f90=<name>
|
||||
specify a FORTRAN compiler name: i.e. -fc=ifort
|
||||
-echo print the scripts during their execution
|
||||
-show show command lines without real calling
|
||||
-config=<name> specify a configuration file: i.e. -config=ifort for mpif90-ifort.conf file
|
||||
-v print version info of mpiifort and its native compiler
|
||||
-profile=<name> specify a profile configuration file (an MPI profiling
|
||||
library): i.e. -profile=myprofile for the myprofile.cfg file.
|
||||
As a special case, lib<name>.so or lib<name>.a may be used
|
||||
if the library is found
|
||||
-check_mpi link against the Intel(R) Trace Collector (-profile=vtmc).
|
||||
-static_mpi link the Intel(R) MPI Library statically
|
||||
-mt_mpi link the thread safe version of the Intel(R) MPI Library
|
||||
-ilp64 link the ILP64 support of the Intel(R) MPI Library
|
||||
-no_ilp64 disable ILP64 support explicitly
|
||||
-fast the same as -static_mpi + pass -fast option to a compiler.
|
||||
-t or -trace
|
||||
link against the Intel(R) Trace Collector
|
||||
-trace-imbalance
|
||||
link against the Intel(R) Trace Collector imbalance library
|
||||
(-profile=vtim)
|
||||
-dynamic_log link against the Intel(R) Trace Collector dynamically
|
||||
-static use static linkage method
|
||||
-nostrip turn off the debug information stripping during static linking
|
||||
-O enable optimization
|
||||
-link_mpi=<name>
|
||||
link against the specified version of the Intel(R) MPI Library
|
||||
All other options will be passed to the compiler without changing.
|
||||
----------------------------------------------------------------------------
|
||||
The following environment variables are used:
|
||||
I_MPI_ROOT the Intel(R) MPI Library installation directory path
|
||||
I_MPI_F90 or MPICH_F90
|
||||
the path/name of the underlying compiler to be used
|
||||
I_MPI_FC_PROFILE or I_MPI_F90_PROFILE or MPIF90_PROFILE
|
||||
the name of profile file (without extension)
|
||||
I_MPI_COMPILER_CONFIG_DIR
|
||||
the folder which contains configuration files *.conf
|
||||
I_MPI_TRACE_PROFILE
|
||||
specify a default profile for the -trace option
|
||||
I_MPI_CHECK_PROFILE
|
||||
specify a default profile for the -check_mpi option
|
||||
I_MPI_CHECK_COMPILER
|
||||
enable compiler setup checks
|
||||
I_MPI_LINK specify the version of the Intel(R) MPI Library
|
||||
I_MPI_DEBUG_INFO_STRIP
|
||||
turn on/off the debug information stripping during static linking
|
||||
I_MPI_FCFLAGS
|
||||
special flags needed for compilation
|
||||
I_MPI_LDFLAGS
|
||||
special flags needed for linking
|
||||
----------------------------------------------------------------------------
|
||||
|
||||
|
||||
Side Note: MPI version divergence in 2015 release
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
The package `intel-parallel-studio@cluster.2015.6` contains both a full MPI
|
||||
development version in `$prefix/impi` and an MPI Runtime under the
|
||||
`composer_xe*` suite directory. Curiously, these have *different versions*,
|
||||
with a release date nearly 1 year apart::
|
||||
|
||||
$ $SPACK_ROOT/...uaxaw7/impi/5.0.3.049/intel64/bin/mpiexec --version
|
||||
Intel(R) MPI Library for Linux* OS, Version 5.0 Update 3 Build 20150804 (build id: 12452)
|
||||
Copyright (C) 2003-2015, Intel Corporation. All rights reserved.
|
||||
|
||||
$ $SPACK_ROOT/...uaxaw7/composer_xe_2015.6.233/mpirt/bin/intel64/mpiexec --version
|
||||
Intel(R) MPI Library for Linux* OS, Version 5.0 Update 1 Build 20140709
|
||||
Copyright (C) 2003-2014, Intel Corporation. All rights reserved.
|
||||
|
||||
I'm not sure what to make of it.
|
||||
|
||||
|
||||
**************
|
||||
macOS support
|
||||
**************
|
||||
|
||||
- On macOS, the Spack methods here only include support to integrate an
|
||||
externally installed MKL.
|
||||
|
||||
- URLs in child packages will be Linux-specific; macOS download packages
|
||||
are located in differently numbered dirs and are named m_*.dmg.
|
File diff suppressed because it is too large
Load Diff
@@ -23,7 +23,7 @@
|
||||
_BUILDERS: Dict[int, "Builder"] = {}
|
||||
|
||||
|
||||
def builder(build_system_name: str):
|
||||
def register_builder(build_system_name: str):
|
||||
"""Class decorator used to register the default builder
|
||||
for a given build-system.
|
||||
|
||||
|
@@ -5,7 +5,7 @@
|
||||
import collections
|
||||
import warnings
|
||||
|
||||
import archspec.cpu
|
||||
import _vendoring.archspec.cpu
|
||||
|
||||
import llnl.util.tty.colify as colify
|
||||
import llnl.util.tty.color as color
|
||||
@@ -92,11 +92,11 @@ def display_target_group(header, target_group):
|
||||
def arch(parser, args):
|
||||
if args.generic_target:
|
||||
# TODO: add deprecation warning in 0.24
|
||||
print(archspec.cpu.host().generic)
|
||||
print(_vendoring.archspec.cpu.host().generic)
|
||||
return
|
||||
|
||||
if args.known_targets:
|
||||
display_targets(archspec.cpu.TARGETS)
|
||||
display_targets(_vendoring.archspec.cpu.TARGETS)
|
||||
return
|
||||
|
||||
if args.frontend:
|
||||
|
@@ -52,6 +52,7 @@
|
||||
# See the Spack documentation for more information on packaging.
|
||||
# ----------------------------------------------------------------------------
|
||||
|
||||
{package_class_import}
|
||||
from spack.package import *
|
||||
|
||||
|
||||
@@ -85,6 +86,7 @@ class BundlePackageTemplate:
|
||||
"""
|
||||
|
||||
base_class_name = "BundlePackage"
|
||||
package_class_import = "from spack_repo.builtin.build_systems.bundle import BundlePackage"
|
||||
|
||||
dependencies = """\
|
||||
# FIXME: Add dependencies if required.
|
||||
@@ -114,6 +116,7 @@ def write(self, pkg_path):
|
||||
name=self.name,
|
||||
class_name=self.class_name,
|
||||
base_class_name=self.base_class_name,
|
||||
package_class_import=self.package_class_import,
|
||||
url_def=self.url_def,
|
||||
versions=self.versions,
|
||||
dependencies="\n".join(all_deps),
|
||||
@@ -126,6 +129,7 @@ class PackageTemplate(BundlePackageTemplate):
|
||||
"""Provides the default values to be used for the package file template"""
|
||||
|
||||
base_class_name = "Package"
|
||||
package_class_import = "from spack_repo.builtin.build_systems.generic import Package"
|
||||
|
||||
body_def = """\
|
||||
def install(self, spec, prefix):
|
||||
@@ -146,6 +150,9 @@ class AutotoolsPackageTemplate(PackageTemplate):
|
||||
that *do* come with a ``configure`` script"""
|
||||
|
||||
base_class_name = "AutotoolsPackage"
|
||||
package_class_import = (
|
||||
"from spack_repo.builtin.build_systems.autotools import AutotoolsPackage"
|
||||
)
|
||||
|
||||
body_def = """\
|
||||
def configure_args(self):
|
||||
@@ -160,6 +167,9 @@ class AutoreconfPackageTemplate(PackageTemplate):
|
||||
that *do not* come with a ``configure`` script"""
|
||||
|
||||
base_class_name = "AutotoolsPackage"
|
||||
package_class_import = (
|
||||
"from spack_repo.builtin.build_systems.autotools import AutotoolsPackage"
|
||||
)
|
||||
|
||||
dependencies = """\
|
||||
depends_on("autoconf", type="build")
|
||||
@@ -186,6 +196,7 @@ class CargoPackageTemplate(PackageTemplate):
|
||||
"""Provides appropriate overrides for cargo-based packages"""
|
||||
|
||||
base_class_name = "CargoPackage"
|
||||
package_class_import = "from spack_repo.builtin.build_systems.cargo import CargoPackage"
|
||||
|
||||
body_def = ""
|
||||
|
||||
@@ -194,6 +205,7 @@ class CMakePackageTemplate(PackageTemplate):
|
||||
"""Provides appropriate overrides for CMake-based packages"""
|
||||
|
||||
base_class_name = "CMakePackage"
|
||||
package_class_import = "from spack_repo.builtin.build_systems.cmake import CMakePackage"
|
||||
|
||||
body_def = """\
|
||||
def cmake_args(self):
|
||||
@@ -208,6 +220,7 @@ class GoPackageTemplate(PackageTemplate):
|
||||
"""Provides appropriate overrides for Go-module-based packages"""
|
||||
|
||||
base_class_name = "GoPackage"
|
||||
package_class_import = "from spack_repo.builtin.build_systems.go import GoPackage"
|
||||
|
||||
body_def = ""
|
||||
|
||||
@@ -216,6 +229,7 @@ class LuaPackageTemplate(PackageTemplate):
|
||||
"""Provides appropriate overrides for LuaRocks-based packages"""
|
||||
|
||||
base_class_name = "LuaPackage"
|
||||
package_class_import = "from spack_repo.builtin.build_systems.lua import LuaPackage"
|
||||
|
||||
body_def = """\
|
||||
def luarocks_args(self):
|
||||
@@ -237,6 +251,7 @@ class MesonPackageTemplate(PackageTemplate):
|
||||
"""Provides appropriate overrides for meson-based packages"""
|
||||
|
||||
base_class_name = "MesonPackage"
|
||||
package_class_import = "from spack_repo.builtin.build_systems.meson import MesonPackage"
|
||||
|
||||
body_def = """\
|
||||
def meson_args(self):
|
||||
@@ -249,6 +264,7 @@ class QMakePackageTemplate(PackageTemplate):
|
||||
"""Provides appropriate overrides for QMake-based packages"""
|
||||
|
||||
base_class_name = "QMakePackage"
|
||||
package_class_import = "from spack_repo.builtin.build_systems.qmake import QMakePackage"
|
||||
|
||||
body_def = """\
|
||||
def qmake_args(self):
|
||||
@@ -261,6 +277,7 @@ class MavenPackageTemplate(PackageTemplate):
|
||||
"""Provides appropriate overrides for Maven-based packages"""
|
||||
|
||||
base_class_name = "MavenPackage"
|
||||
package_class_import = "from spack_repo.builtin.build_systems.maven import MavenPackage"
|
||||
|
||||
body_def = """\
|
||||
def build(self, spec, prefix):
|
||||
@@ -272,6 +289,7 @@ class SconsPackageTemplate(PackageTemplate):
|
||||
"""Provides appropriate overrides for SCons-based packages"""
|
||||
|
||||
base_class_name = "SConsPackage"
|
||||
package_class_import = "from spack_repo.builtin.build_systems.scons import SConsPackage"
|
||||
|
||||
body_def = """\
|
||||
def build_args(self, spec, prefix):
|
||||
@@ -285,6 +303,7 @@ class WafPackageTemplate(PackageTemplate):
|
||||
"""Provides appropriate override for Waf-based packages"""
|
||||
|
||||
base_class_name = "WafPackage"
|
||||
package_class_import = "from spack_repo.builtin.build_systems.waf import WafPackage"
|
||||
|
||||
body_def = """\
|
||||
# FIXME: Override configure_args(), build_args(),
|
||||
@@ -308,6 +327,7 @@ class RacketPackageTemplate(PackageTemplate):
|
||||
"""Provides approriate overrides for Racket extensions"""
|
||||
|
||||
base_class_name = "RacketPackage"
|
||||
package_class_import = "from spack_repo.builtin.build_systems.racket import RacketPackage"
|
||||
|
||||
url_line = """\
|
||||
# FIXME: set the proper location from which to fetch your package
|
||||
@@ -345,6 +365,7 @@ class PythonPackageTemplate(PackageTemplate):
|
||||
"""Provides appropriate overrides for python extensions"""
|
||||
|
||||
base_class_name = "PythonPackage"
|
||||
package_class_import = "from spack_repo.builtin.build_systems.python import PythonPackage"
|
||||
|
||||
dependencies = """\
|
||||
# FIXME: Only add the python/pip/wheel dependencies if you need specific versions
|
||||
@@ -432,6 +453,7 @@ class RPackageTemplate(PackageTemplate):
|
||||
"""Provides appropriate overrides for R extensions"""
|
||||
|
||||
base_class_name = "RPackage"
|
||||
package_class_import = "from spack_repo.builtin.build_systems.r import RPackage"
|
||||
|
||||
dependencies = """\
|
||||
# FIXME: Add dependencies if required.
|
||||
@@ -472,6 +494,7 @@ class PerlmakePackageTemplate(PackageTemplate):
|
||||
that come with a Makefile.PL"""
|
||||
|
||||
base_class_name = "PerlPackage"
|
||||
package_class_import = "from spack_repo.builtin.build_systems.perl import PerlPackage"
|
||||
|
||||
dependencies = """\
|
||||
# FIXME: Add dependencies if required:
|
||||
@@ -509,6 +532,7 @@ class OctavePackageTemplate(PackageTemplate):
|
||||
"""Provides appropriate overrides for octave packages"""
|
||||
|
||||
base_class_name = "OctavePackage"
|
||||
package_class_import = "from spack_repo.builtin.build_systems.octave import OctavePackage"
|
||||
|
||||
dependencies = """\
|
||||
extends("octave")
|
||||
@@ -531,6 +555,7 @@ class RubyPackageTemplate(PackageTemplate):
|
||||
"""Provides appropriate overrides for Ruby packages"""
|
||||
|
||||
base_class_name = "RubyPackage"
|
||||
package_class_import = "from spack_repo.builtin.build_systems.ruby import RubyPackage"
|
||||
|
||||
dependencies = """\
|
||||
# FIXME: Add dependencies if required. Only add the ruby dependency
|
||||
@@ -559,6 +584,7 @@ class MakefilePackageTemplate(PackageTemplate):
|
||||
"""Provides appropriate overrides for Makefile packages"""
|
||||
|
||||
base_class_name = "MakefilePackage"
|
||||
package_class_import = "from spack_repo.builtin.build_systems.makefile import MakefilePackage"
|
||||
|
||||
body_def = """\
|
||||
def edit(self, spec, prefix):
|
||||
@@ -573,6 +599,7 @@ class IntelPackageTemplate(PackageTemplate):
|
||||
"""Provides appropriate overrides for licensed Intel software"""
|
||||
|
||||
base_class_name = "IntelOneApiPackage"
|
||||
package_class_import = "from spack_repo.builtin.build_systems.oneapi import IntelOneApiPackage"
|
||||
|
||||
body_def = """\
|
||||
# FIXME: Override `setup_environment` if necessary."""
|
||||
@@ -582,6 +609,7 @@ class SIPPackageTemplate(PackageTemplate):
|
||||
"""Provides appropriate overrides for SIP packages."""
|
||||
|
||||
base_class_name = "SIPPackage"
|
||||
package_class_import = "from spack_repo.builtin.build_systems.sip import SIPPackage"
|
||||
|
||||
body_def = """\
|
||||
def configure_args(self, spec, prefix):
|
||||
|
@@ -28,7 +28,7 @@ def setup_parser(subparser):
|
||||
"--build-system",
|
||||
dest="path",
|
||||
action="store_const",
|
||||
const=spack.paths.build_systems_path,
|
||||
const=os.path.join(spack.repo.PATH.repos[0].root, "build_systems"),
|
||||
help="edit the build system with the supplied name",
|
||||
)
|
||||
excl_args.add_argument(
|
||||
|
@@ -514,17 +514,18 @@ def extend_with_dependencies(specs):
|
||||
|
||||
|
||||
def concrete_specs_from_cli_or_file(args):
|
||||
tty.msg("Concretizing input specs")
|
||||
if args.specs:
|
||||
specs = spack.cmd.parse_specs(args.specs, concretize=True)
|
||||
specs = spack.cmd.parse_specs(args.specs, concretize=False)
|
||||
if not specs:
|
||||
raise SpackError("unable to parse specs from command line")
|
||||
|
||||
if args.file:
|
||||
specs = specs_from_text_file(args.file, concretize=True)
|
||||
specs = specs_from_text_file(args.file, concretize=False)
|
||||
if not specs:
|
||||
raise SpackError("unable to parse specs from file '{}'".format(args.file))
|
||||
return specs
|
||||
|
||||
concrete_specs = spack.cmd.matching_specs_from_env(specs)
|
||||
return concrete_specs
|
||||
|
||||
|
||||
class IncludeFilter:
|
||||
@@ -607,11 +608,6 @@ def process_mirror_stats(present, mirrored, error):
|
||||
|
||||
def mirror_create(args):
|
||||
"""create a directory to be used as a spack mirror, and fill it with package archives"""
|
||||
if args.specs and args.all:
|
||||
raise SpackError(
|
||||
"cannot specify specs on command line if you chose to mirror all specs with '--all'"
|
||||
)
|
||||
|
||||
if args.file and args.all:
|
||||
raise SpackError(
|
||||
"cannot specify specs with a file if you chose to mirror all specs with '--all'"
|
||||
|
@@ -183,7 +183,7 @@ def pkg_grep(args, unknown_args):
|
||||
grep.add_default_arg("--color=auto")
|
||||
|
||||
# determines number of files to grep at a time
|
||||
grouper = lambda e: e[0] // 500
|
||||
grouper = lambda e: e[0] // 100
|
||||
|
||||
# set up iterator and save the first group to ensure we don't end up with a group of size 1
|
||||
groups = itertools.groupby(enumerate(spack.repo.PATH.all_package_paths()), grouper)
|
||||
|
@@ -332,18 +332,8 @@ def process_files(file_list, is_args):
|
||||
|
||||
rewrite_and_print_output(output, args, pat, replacement)
|
||||
|
||||
packages_isort_args = (
|
||||
"--rm",
|
||||
"spack.pkgkit",
|
||||
"--rm",
|
||||
"spack.package_defs",
|
||||
"-a",
|
||||
"from spack.package import *",
|
||||
)
|
||||
packages_isort_args = packages_isort_args + isort_args
|
||||
|
||||
# packages
|
||||
process_files(filter(is_package, file_list), packages_isort_args)
|
||||
process_files(filter(is_package, file_list), isort_args)
|
||||
# non-packages
|
||||
process_files(filter(lambda f: not is_package(f), file_list), isort_args)
|
||||
|
||||
|
@@ -10,7 +10,7 @@
|
||||
import warnings
|
||||
from typing import Any, Dict, List, Optional, Tuple
|
||||
|
||||
import archspec.cpu
|
||||
import _vendoring.archspec.cpu
|
||||
|
||||
import llnl.util.filesystem as fs
|
||||
import llnl.util.lang
|
||||
@@ -316,7 +316,7 @@ def from_external_yaml(config: Dict[str, Any]) -> Optional[spack.spec.Spec]:
|
||||
@staticmethod
|
||||
def _finalize_external_concretization(abstract_spec):
|
||||
if CompilerFactory._GENERIC_TARGET is None:
|
||||
CompilerFactory._GENERIC_TARGET = archspec.cpu.host().family
|
||||
CompilerFactory._GENERIC_TARGET = _vendoring.archspec.cpu.host().family
|
||||
|
||||
if abstract_spec.architecture:
|
||||
abstract_spec.architecture.complete_with_defaults()
|
||||
|
@@ -5,6 +5,7 @@
|
||||
import collections.abc
|
||||
import contextlib
|
||||
import errno
|
||||
import glob
|
||||
import os
|
||||
import pathlib
|
||||
import re
|
||||
@@ -2424,19 +2425,11 @@ def display_specs(specs):
|
||||
|
||||
def make_repo_path(root):
|
||||
"""Make a RepoPath from the repo subdirectories in an environment."""
|
||||
path = spack.repo.RepoPath(cache=spack.caches.MISC_CACHE)
|
||||
|
||||
if os.path.isdir(root):
|
||||
for repo_root in os.listdir(root):
|
||||
repo_root = os.path.join(root, repo_root)
|
||||
|
||||
if not os.path.isdir(repo_root):
|
||||
continue
|
||||
|
||||
repo = spack.repo.from_path(repo_root)
|
||||
path.put_last(repo)
|
||||
|
||||
return path
|
||||
repos = [
|
||||
spack.repo.from_path(os.path.dirname(p))
|
||||
for p in glob.glob(os.path.join(root, "**", "repo.yaml"), recursive=True)
|
||||
]
|
||||
return spack.repo.RepoPath(*repos, cache=spack.caches.MISC_CACHE)
|
||||
|
||||
|
||||
def manifest_file(env_name_or_dir):
|
||||
|
@@ -25,7 +25,7 @@
|
||||
import warnings
|
||||
from typing import List, Tuple
|
||||
|
||||
import archspec.cpu
|
||||
import _vendoring.archspec.cpu
|
||||
|
||||
import llnl.util.lang
|
||||
import llnl.util.tty as tty
|
||||
@@ -734,7 +734,7 @@ def _compatible_sys_types():
|
||||
"""
|
||||
host_platform = spack.platforms.host()
|
||||
host_os = str(host_platform.default_operating_system())
|
||||
host_target = archspec.cpu.host()
|
||||
host_target = _vendoring.archspec.cpu.host()
|
||||
compatible_targets = [host_target] + host_target.ancestors
|
||||
|
||||
compatible_archs = [
|
||||
@@ -794,7 +794,7 @@ def shell_set(var, value):
|
||||
# print environment module system if available. This can be expensive
|
||||
# on clusters, so skip it if not needed.
|
||||
if "modules" in info:
|
||||
generic_arch = archspec.cpu.host().family
|
||||
generic_arch = _vendoring.archspec.cpu.host().family
|
||||
module_spec = "environment-modules target={0}".format(generic_arch)
|
||||
specs = spack.store.STORE.db.query(module_spec)
|
||||
if specs:
|
||||
|
@@ -2,7 +2,6 @@
|
||||
#
|
||||
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
|
||||
|
||||
# flake8: noqa: F401, E402
|
||||
"""spack.package defines the public API for Spack packages, by re-exporting useful symbols from
|
||||
other modules. Packages should import this module, instead of importing from spack.* directly
|
||||
to ensure forward compatibility with future versions of Spack."""
|
||||
@@ -13,17 +12,6 @@
|
||||
# import most common types used in packages
|
||||
from typing import Dict, List, Optional
|
||||
|
||||
|
||||
class tty:
|
||||
import llnl.util.tty as _tty
|
||||
|
||||
debug = _tty.debug
|
||||
error = _tty.error
|
||||
info = _tty.info
|
||||
msg = _tty.msg
|
||||
warn = _tty.warn
|
||||
|
||||
|
||||
from llnl.util.filesystem import (
|
||||
FileFilter,
|
||||
FileList,
|
||||
@@ -61,52 +49,7 @@ class tty:
|
||||
from llnl.util.symlink import symlink
|
||||
|
||||
from spack.build_environment import MakeExecutable
|
||||
from spack.build_systems.aspell_dict import AspellDictPackage
|
||||
from spack.build_systems.autotools import AutotoolsPackage
|
||||
from spack.build_systems.bundle import BundlePackage
|
||||
from spack.build_systems.cached_cmake import (
|
||||
CachedCMakePackage,
|
||||
cmake_cache_filepath,
|
||||
cmake_cache_option,
|
||||
cmake_cache_path,
|
||||
cmake_cache_string,
|
||||
)
|
||||
from spack.build_systems.cargo import CargoPackage
|
||||
from spack.build_systems.cmake import CMakePackage, generator
|
||||
from spack.build_systems.compiler import CompilerPackage
|
||||
from spack.build_systems.cuda import CudaPackage
|
||||
from spack.build_systems.generic import Package
|
||||
from spack.build_systems.gnu import GNUMirrorPackage
|
||||
from spack.build_systems.go import GoPackage
|
||||
from spack.build_systems.intel import IntelPackage
|
||||
from spack.build_systems.lua import LuaPackage
|
||||
from spack.build_systems.makefile import MakefilePackage
|
||||
from spack.build_systems.maven import MavenPackage
|
||||
from spack.build_systems.meson import MesonPackage
|
||||
from spack.build_systems.msbuild import MSBuildPackage
|
||||
from spack.build_systems.nmake import NMakePackage
|
||||
from spack.build_systems.octave import OctavePackage
|
||||
from spack.build_systems.oneapi import (
|
||||
INTEL_MATH_LIBRARIES,
|
||||
IntelOneApiLibraryPackage,
|
||||
IntelOneApiLibraryPackageWithSdk,
|
||||
IntelOneApiPackage,
|
||||
IntelOneApiStaticLibraryList,
|
||||
)
|
||||
from spack.build_systems.perl import PerlPackage
|
||||
from spack.build_systems.python import PythonExtension, PythonPackage
|
||||
from spack.build_systems.qmake import QMakePackage
|
||||
from spack.build_systems.r import RPackage
|
||||
from spack.build_systems.racket import RacketPackage
|
||||
from spack.build_systems.rocm import ROCmPackage
|
||||
from spack.build_systems.ruby import RubyPackage
|
||||
from spack.build_systems.scons import SConsPackage
|
||||
from spack.build_systems.sip import SIPPackage
|
||||
from spack.build_systems.sourceforge import SourceforgePackage
|
||||
from spack.build_systems.sourceware import SourcewarePackage
|
||||
from spack.build_systems.waf import WafPackage
|
||||
from spack.build_systems.xorg import XorgPackage
|
||||
from spack.builder import BaseBuilder
|
||||
from spack.builder import BaseBuilder, Builder, register_builder
|
||||
from spack.config import determine_number_of_jobs
|
||||
from spack.deptypes import ALL_TYPES as all_deptypes
|
||||
from spack.directives import (
|
||||
@@ -138,7 +81,13 @@ class tty:
|
||||
)
|
||||
from spack.mixins import filter_compiler_wrappers
|
||||
from spack.multimethod import default_args, when
|
||||
from spack.package_base import build_system_flags, env_flags, inject_flags, on_package_attributes
|
||||
from spack.package_base import (
|
||||
PackageBase,
|
||||
build_system_flags,
|
||||
env_flags,
|
||||
inject_flags,
|
||||
on_package_attributes,
|
||||
)
|
||||
from spack.package_completions import (
|
||||
bash_completion_path,
|
||||
fish_completion_path,
|
||||
@@ -158,6 +107,126 @@ class tty:
|
||||
cd = chdir
|
||||
pwd = getcwd
|
||||
|
||||
|
||||
class tty:
|
||||
import llnl.util.tty as _tty
|
||||
|
||||
debug = _tty.debug
|
||||
error = _tty.error
|
||||
info = _tty.info
|
||||
msg = _tty.msg
|
||||
warn = _tty.warn
|
||||
|
||||
|
||||
__all__ = [
|
||||
"chdir",
|
||||
"environ",
|
||||
"getcwd",
|
||||
"makedirs",
|
||||
"mkdir",
|
||||
"remove",
|
||||
"removedirs",
|
||||
"move",
|
||||
"rmtree",
|
||||
"Dict",
|
||||
"List",
|
||||
"Optional",
|
||||
"FileFilter",
|
||||
"FileList",
|
||||
"HeaderList",
|
||||
"LibraryList",
|
||||
"ancestor",
|
||||
"can_access",
|
||||
"change_sed_delimiter",
|
||||
"copy",
|
||||
"copy_tree",
|
||||
"filter_file",
|
||||
"find",
|
||||
"find_all_headers",
|
||||
"find_first",
|
||||
"find_headers",
|
||||
"find_libraries",
|
||||
"find_system_libraries",
|
||||
"force_remove",
|
||||
"force_symlink",
|
||||
"install",
|
||||
"install_tree",
|
||||
"is_exe",
|
||||
"join_path",
|
||||
"keep_modification_time",
|
||||
"library_extensions",
|
||||
"mkdirp",
|
||||
"remove_directory_contents",
|
||||
"remove_linked_tree",
|
||||
"rename",
|
||||
"set_executable",
|
||||
"set_install_permissions",
|
||||
"touch",
|
||||
"working_dir",
|
||||
"symlink",
|
||||
"MakeExecutable",
|
||||
"BaseBuilder",
|
||||
"determine_number_of_jobs",
|
||||
"all_deptypes",
|
||||
"build_system",
|
||||
"can_splice",
|
||||
"conditional",
|
||||
"conflicts",
|
||||
"depends_on",
|
||||
"extends",
|
||||
"license",
|
||||
"maintainers",
|
||||
"patch",
|
||||
"provides",
|
||||
"redistribute",
|
||||
"requires",
|
||||
"resource",
|
||||
"variant",
|
||||
"version",
|
||||
"InstallError",
|
||||
"NoHeadersError",
|
||||
"NoLibrariesError",
|
||||
"SkipTest",
|
||||
"cache_extra_test_sources",
|
||||
"check_outputs",
|
||||
"find_required_file",
|
||||
"get_escaped_text_output",
|
||||
"install_test_root",
|
||||
"test_part",
|
||||
"filter_compiler_wrappers",
|
||||
"default_args",
|
||||
"when",
|
||||
"build_system_flags",
|
||||
"env_flags",
|
||||
"inject_flags",
|
||||
"on_package_attributes",
|
||||
"bash_completion_path",
|
||||
"fish_completion_path",
|
||||
"zsh_completion_path",
|
||||
"run_after",
|
||||
"run_before",
|
||||
"Spec",
|
||||
"EnvironmentModifications",
|
||||
"Executable",
|
||||
"ProcessError",
|
||||
"which",
|
||||
"which_string",
|
||||
"fix_darwin_install_name",
|
||||
"Prefix",
|
||||
"any_combination_of",
|
||||
"auto_or_any_combination_of",
|
||||
"disjoint_sets",
|
||||
"Version",
|
||||
"ver",
|
||||
"env",
|
||||
"cd",
|
||||
"pwd",
|
||||
"tty",
|
||||
"Builder",
|
||||
"PackageBase",
|
||||
"register_builder",
|
||||
]
|
||||
|
||||
# These are just here for editor support; they may be set when the build env is set up.
|
||||
configure: Executable
|
||||
make_jobs: int
|
||||
|
@@ -583,7 +583,7 @@ class PackageBase(WindowsRPath, PackageViewMixin, metaclass=PackageMeta):
|
||||
like ``homepage`` and, for a code-based package, ``url``, or functions
|
||||
such as ``install()``.
|
||||
There are many custom ``Package`` subclasses in the
|
||||
``spack.build_systems`` package that make things even easier for
|
||||
``spack_repo.builtin.build_systems`` package that make things even easier for
|
||||
specific build systems.
|
||||
|
||||
"""
|
||||
@@ -986,7 +986,9 @@ def url_for_version(self, version):
|
||||
"""
|
||||
return self._implement_all_urls_for_version(version)[0]
|
||||
|
||||
def update_external_dependencies(self, extendee_spec=None):
|
||||
def _update_external_dependencies(
|
||||
self, extendee_spec: Optional[spack.spec.Spec] = None
|
||||
) -> None:
|
||||
"""
|
||||
Method to override in package classes to handle external dependencies
|
||||
"""
|
||||
|
@@ -58,7 +58,7 @@
|
||||
repos_path = os.path.join(var_path, "repos")
|
||||
test_repos_path = os.path.join(var_path, "test_repos")
|
||||
packages_path = os.path.join(repos_path, "spack_repo", "builtin")
|
||||
mock_packages_path = os.path.join(test_repos_path, "builtin.mock")
|
||||
mock_packages_path = os.path.join(test_repos_path, "spack_repo", "builtin_mock")
|
||||
|
||||
#
|
||||
# Writable things in $spack/var/spack
|
||||
|
@@ -4,7 +4,7 @@
|
||||
import warnings
|
||||
from typing import Optional
|
||||
|
||||
import archspec.cpu
|
||||
import _vendoring.archspec.cpu
|
||||
|
||||
import llnl.util.lang
|
||||
|
||||
@@ -38,15 +38,15 @@ def __init__(self, name):
|
||||
self.name = name
|
||||
self._init_targets()
|
||||
|
||||
def add_target(self, name: str, target: archspec.cpu.Microarchitecture) -> None:
|
||||
def add_target(self, name: str, target: _vendoring.archspec.cpu.Microarchitecture) -> None:
|
||||
if name in Platform.reserved_targets:
|
||||
msg = f"{name} is a spack reserved alias and cannot be the name of a target"
|
||||
raise ValueError(msg)
|
||||
self.targets[name] = target
|
||||
|
||||
def _init_targets(self):
|
||||
self.default = archspec.cpu.host().name
|
||||
for name, microarchitecture in archspec.cpu.TARGETS.items():
|
||||
self.default = _vendoring.archspec.cpu.host().name
|
||||
for name, microarchitecture in _vendoring.archspec.cpu.TARGETS.items():
|
||||
self.add_target(name, microarchitecture)
|
||||
|
||||
def target(self, name):
|
||||
|
@@ -3,7 +3,7 @@
|
||||
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
|
||||
import platform
|
||||
|
||||
import archspec.cpu
|
||||
import _vendoring.archspec.cpu
|
||||
|
||||
import spack.operating_systems
|
||||
|
||||
@@ -28,7 +28,7 @@ def __init__(self, name=None):
|
||||
def _init_targets(self):
|
||||
targets = ("aarch64", "m1") if platform.machine() == "arm64" else ("x86_64", "core2")
|
||||
for t in targets:
|
||||
self.add_target(t, archspec.cpu.TARGETS[t])
|
||||
self.add_target(t, _vendoring.archspec.cpu.TARGETS[t])
|
||||
|
||||
@classmethod
|
||||
def detect(cls):
|
||||
|
@@ -85,7 +85,7 @@ def __init__(self, fullname: str, repo: "Repo", package_name: str) -> None:
|
||||
self.package_name = package_name
|
||||
path = repo.filename_for_package_name(package_name)
|
||||
self.fullname = fullname
|
||||
self.prepend = b"from spack.build_systems._package_api_v1 import *\n"
|
||||
self.prepend = b"from spack_repo.builtin.build_systems._package_api_v1 import *\n"
|
||||
super().__init__(self.fullname, path)
|
||||
|
||||
def path_stats(self, path):
|
||||
@@ -173,7 +173,7 @@ def compute_loader(self, fullname: str):
|
||||
def builtin_repo() -> "Repo":
|
||||
"""Get the test repo if it is active, otherwise the builtin repo."""
|
||||
try:
|
||||
return PATH.get_repo("builtin.mock")
|
||||
return PATH.get_repo("builtin_mock")
|
||||
except UnknownNamespaceError:
|
||||
return PATH.get_repo("builtin")
|
||||
|
||||
|
@@ -100,7 +100,11 @@ def migrate_v1_to_v2(
|
||||
ino_to_relpath[entry.inode()] = entry.path[prefix_len:]
|
||||
|
||||
if entry.is_symlink():
|
||||
symlink_to_ino[rel_path] = entry.stat(follow_symlinks=True).st_ino
|
||||
try:
|
||||
symlink_to_ino[rel_path] = entry.stat(follow_symlinks=True).st_ino
|
||||
except OSError:
|
||||
symlink_to_ino[rel_path] = -1 # dangling or no access
|
||||
|
||||
continue
|
||||
|
||||
elif entry.is_dir(follow_symlinks=False):
|
||||
@@ -143,9 +147,13 @@ def migrate_v1_to_v2(
|
||||
os.makedirs(new_root, exist_ok=True)
|
||||
|
||||
def _relocate(rel_path: str) -> Tuple[str, str]:
|
||||
return os.path.join(repo.root, rel_path), os.path.join(
|
||||
new_root, rename_regex.sub(lambda m: rename[m.group(0)], rel_path)
|
||||
)
|
||||
old = os.path.join(repo.root, rel_path)
|
||||
if rename:
|
||||
new_rel = rename_regex.sub(lambda m: rename[m.group(0)], rel_path)
|
||||
else:
|
||||
new_rel = rel_path
|
||||
new = os.path.join(new_root, new_rel)
|
||||
return old, new
|
||||
|
||||
if not fix:
|
||||
print("The following directories, files and symlinks will be created:\n", file=out)
|
||||
@@ -239,7 +247,6 @@ def migrate_v2_imports(
|
||||
"Package": "spack_repo.builtin.build_systems.generic",
|
||||
"GNUMirrorPackage": "spack_repo.builtin.build_systems.gnu",
|
||||
"GoPackage": "spack_repo.builtin.build_systems.go",
|
||||
"IntelPackage": "spack_repo.builtin.build_systems.intel",
|
||||
"LuaPackage": "spack_repo.builtin.build_systems.lua",
|
||||
"MakefilePackage": "spack_repo.builtin.build_systems.makefile",
|
||||
"MavenPackage": "spack_repo.builtin.build_systems.maven",
|
||||
|
@@ -34,7 +34,7 @@
|
||||
Union,
|
||||
)
|
||||
|
||||
import archspec.cpu
|
||||
import _vendoring.archspec.cpu
|
||||
|
||||
import llnl.util.lang
|
||||
import llnl.util.tty as tty
|
||||
@@ -1617,7 +1617,7 @@ def target_ranges(self, spec, single_target_fn):
|
||||
target = spec.architecture.target
|
||||
|
||||
# Check if the target is a concrete target
|
||||
if str(target) in archspec.cpu.TARGETS:
|
||||
if str(target) in _vendoring.archspec.cpu.TARGETS:
|
||||
return [single_target_fn(spec.name, target)]
|
||||
|
||||
self.target_constraints.add(target)
|
||||
@@ -2753,7 +2753,7 @@ def _supported_targets(self, compiler_name, compiler_version, targets):
|
||||
compiler_name, compiler_version.dotted_numeric_string
|
||||
)
|
||||
supported.append(target)
|
||||
except archspec.cpu.UnsupportedMicroarchitecture:
|
||||
except _vendoring.archspec.cpu.UnsupportedMicroarchitecture:
|
||||
continue
|
||||
except ValueError:
|
||||
continue
|
||||
@@ -2818,7 +2818,7 @@ def target_defaults(self, specs):
|
||||
if not spec.architecture or not spec.architecture.target:
|
||||
continue
|
||||
|
||||
target = archspec.cpu.TARGETS.get(spec.target.name)
|
||||
target = _vendoring.archspec.cpu.TARGETS.get(spec.target.name)
|
||||
if not target:
|
||||
self.target_ranges(spec, None)
|
||||
continue
|
||||
@@ -2830,7 +2830,7 @@ def target_defaults(self, specs):
|
||||
candidate_targets.append(ancestor)
|
||||
|
||||
platform = spack.platforms.host()
|
||||
uarch = archspec.cpu.TARGETS.get(platform.default)
|
||||
uarch = _vendoring.archspec.cpu.TARGETS.get(platform.default)
|
||||
best_targets = {uarch.family.name}
|
||||
for compiler in self.possible_compilers:
|
||||
supported = self._supported_targets(compiler.name, compiler.version, candidate_targets)
|
||||
@@ -2938,7 +2938,7 @@ def _all_targets_satisfiying(single_constraint):
|
||||
return [single_constraint]
|
||||
|
||||
t_min, _, t_max = single_constraint.partition(":")
|
||||
for test_target in archspec.cpu.TARGETS.values():
|
||||
for test_target in _vendoring.archspec.cpu.TARGETS.values():
|
||||
# Check lower bound
|
||||
if t_min and not t_min <= test_target:
|
||||
continue
|
||||
@@ -3894,7 +3894,7 @@ def external_spec_selected(self, node, idx):
|
||||
|
||||
if extendee_spec:
|
||||
extendee_node = SpecBuilder.make_node(pkg=extendee_spec.name)
|
||||
package.update_external_dependencies(self._specs.get(extendee_node, None))
|
||||
package._update_external_dependencies(self._specs.get(extendee_node))
|
||||
|
||||
def depends_on(self, parent_node, dependency_node, type):
|
||||
dependency_spec = self._specs[dependency_node]
|
||||
|
@@ -5,7 +5,7 @@
|
||||
import collections
|
||||
from typing import Dict, List, NamedTuple, Set, Tuple, Union
|
||||
|
||||
import archspec.cpu
|
||||
import _vendoring.archspec.cpu
|
||||
|
||||
from llnl.util import lang, tty
|
||||
|
||||
@@ -34,7 +34,7 @@ def unreachable(self, *, pkg_name: str, when_spec: spack.spec.Spec) -> bool:
|
||||
"""
|
||||
raise NotImplementedError
|
||||
|
||||
def candidate_targets(self) -> List[archspec.cpu.Microarchitecture]:
|
||||
def candidate_targets(self) -> List[_vendoring.archspec.cpu.Microarchitecture]:
|
||||
"""Returns a list of targets that are candidate for concretization"""
|
||||
raise NotImplementedError
|
||||
|
||||
@@ -70,7 +70,7 @@ def __init__(self, *, configuration: spack.config.Configuration, repo: spack.rep
|
||||
self.configuration = configuration
|
||||
self.repo = repo
|
||||
self._platform_condition = spack.spec.Spec(
|
||||
f"platform={spack.platforms.host()} target={archspec.cpu.host().family}:"
|
||||
f"platform={spack.platforms.host()} target={_vendoring.archspec.cpu.host().family}:"
|
||||
)
|
||||
|
||||
try:
|
||||
@@ -110,10 +110,10 @@ def unreachable(self, *, pkg_name: str, when_spec: spack.spec.Spec) -> bool:
|
||||
"""
|
||||
return False
|
||||
|
||||
def candidate_targets(self) -> List[archspec.cpu.Microarchitecture]:
|
||||
def candidate_targets(self) -> List[_vendoring.archspec.cpu.Microarchitecture]:
|
||||
"""Returns a list of targets that are candidate for concretization"""
|
||||
platform = spack.platforms.host()
|
||||
default_target = archspec.cpu.TARGETS[platform.default]
|
||||
default_target = _vendoring.archspec.cpu.TARGETS[platform.default]
|
||||
|
||||
# Construct the list of targets which are compatible with the host
|
||||
candidate_targets = [default_target] + default_target.ancestors
|
||||
@@ -125,7 +125,7 @@ def candidate_targets(self) -> List[archspec.cpu.Microarchitecture]:
|
||||
additional_targets_in_family = sorted(
|
||||
[
|
||||
t
|
||||
for t in archspec.cpu.TARGETS.values()
|
||||
for t in _vendoring.archspec.cpu.TARGETS.values()
|
||||
if (t.family.name == default_target.family.name and t not in candidate_targets)
|
||||
],
|
||||
key=lambda x: len(x.ancestors),
|
||||
|
@@ -74,10 +74,9 @@
|
||||
overload,
|
||||
)
|
||||
|
||||
import _vendoring.archspec.cpu
|
||||
from _vendoring.typing_extensions import Literal
|
||||
|
||||
import archspec.cpu
|
||||
|
||||
import llnl.path
|
||||
import llnl.string
|
||||
import llnl.util.filesystem as fs
|
||||
@@ -217,10 +216,12 @@ def ensure_modern_format_string(fmt: str) -> None:
|
||||
)
|
||||
|
||||
|
||||
def _make_microarchitecture(name: str) -> archspec.cpu.Microarchitecture:
|
||||
if isinstance(name, archspec.cpu.Microarchitecture):
|
||||
def _make_microarchitecture(name: str) -> _vendoring.archspec.cpu.Microarchitecture:
|
||||
if isinstance(name, _vendoring.archspec.cpu.Microarchitecture):
|
||||
return name
|
||||
return archspec.cpu.TARGETS.get(name, archspec.cpu.generic_microarchitecture(name))
|
||||
return _vendoring.archspec.cpu.TARGETS.get(
|
||||
name, _vendoring.archspec.cpu.generic_microarchitecture(name)
|
||||
)
|
||||
|
||||
|
||||
@lang.lazy_lexicographic_ordering
|
||||
@@ -364,7 +365,7 @@ def target(self, value):
|
||||
# will assumed to be the host machine's platform.
|
||||
|
||||
def target_or_none(t):
|
||||
if isinstance(t, archspec.cpu.Microarchitecture):
|
||||
if isinstance(t, _vendoring.archspec.cpu.Microarchitecture):
|
||||
return t
|
||||
if t and t != "None":
|
||||
return _make_microarchitecture(t)
|
||||
|
@@ -3,10 +3,9 @@
|
||||
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
|
||||
import platform
|
||||
|
||||
import _vendoring.archspec.cpu
|
||||
import pytest
|
||||
|
||||
import archspec.cpu
|
||||
|
||||
import spack.concretize
|
||||
import spack.operating_systems
|
||||
import spack.platforms
|
||||
@@ -125,7 +124,8 @@ def test_satisfy_strict_constraint_when_not_concrete(architecture_tuple, constra
|
||||
)
|
||||
@pytest.mark.usefixtures("mock_packages", "config")
|
||||
@pytest.mark.skipif(
|
||||
str(archspec.cpu.host().family) != "x86_64", reason="tests are for x86_64 uarch ranges"
|
||||
str(_vendoring.archspec.cpu.host().family) != "x86_64",
|
||||
reason="tests are for x86_64 uarch ranges",
|
||||
)
|
||||
def test_concretize_target_ranges(root_target_range, dep_target_range, result, monkeypatch):
|
||||
spec = spack.concretize.concretize_one(
|
||||
|
@@ -8,10 +8,9 @@
|
||||
import sys
|
||||
from typing import Dict, Optional, Tuple
|
||||
|
||||
import _vendoring.archspec.cpu
|
||||
import pytest
|
||||
|
||||
import archspec.cpu
|
||||
|
||||
from llnl.path import Path, convert_to_platform_path
|
||||
from llnl.util.filesystem import HeaderList, LibraryList
|
||||
|
||||
@@ -727,14 +726,15 @@ def test_rpath_with_duplicate_link_deps():
|
||||
@pytest.mark.filterwarnings("ignore:microarchitecture specific")
|
||||
@pytest.mark.not_on_windows("Windows doesn't support the compiler wrapper")
|
||||
def test_optimization_flags(compiler_spec, target_name, expected_flags, compiler_factory):
|
||||
target = archspec.cpu.TARGETS[target_name]
|
||||
target = _vendoring.archspec.cpu.TARGETS[target_name]
|
||||
compiler = spack.spec.parse_with_version_concrete(compiler_spec)
|
||||
opt_flags = spack.build_environment.optimization_flags(compiler, target)
|
||||
assert opt_flags == expected_flags
|
||||
|
||||
|
||||
@pytest.mark.skipif(
|
||||
str(archspec.cpu.host().family) != "x86_64", reason="tests check specific x86_64 uarch flags"
|
||||
str(_vendoring.archspec.cpu.host().family) != "x86_64",
|
||||
reason="tests check specific x86_64 uarch flags",
|
||||
)
|
||||
@pytest.mark.not_on_windows("Windows doesn't support the compiler wrapper")
|
||||
def test_optimization_flags_are_using_node_target(default_mock_concretization, monkeypatch):
|
||||
|
@@ -5,15 +5,13 @@
|
||||
import glob
|
||||
import os
|
||||
|
||||
import _vendoring.archspec.cpu
|
||||
import py.path
|
||||
import pytest
|
||||
|
||||
import archspec.cpu
|
||||
|
||||
import llnl.util.filesystem as fs
|
||||
|
||||
import spack.build_systems.autotools
|
||||
import spack.build_systems.cmake
|
||||
import spack
|
||||
import spack.builder
|
||||
import spack.concretize
|
||||
import spack.environment
|
||||
@@ -28,6 +26,8 @@
|
||||
|
||||
DATA_PATH = os.path.join(spack.paths.test_path, "data")
|
||||
|
||||
pytestmark = pytest.mark.skip(reason="build_systems module is moved out of spack")
|
||||
|
||||
|
||||
@pytest.fixture()
|
||||
def concretize_and_setup(default_mock_concretization, monkeypatch):
|
||||
@@ -216,7 +216,8 @@ def test_autotools_gnuconfig_replacement_disabled(self, mutable_database):
|
||||
|
||||
@pytest.mark.disable_clean_stage_check
|
||||
@pytest.mark.skipif(
|
||||
str(archspec.cpu.host().family) != "x86_64", reason="test data is specific for x86_64"
|
||||
str(_vendoring.archspec.cpu.host().family) != "x86_64",
|
||||
reason="test data is specific for x86_64",
|
||||
)
|
||||
def test_autotools_gnuconfig_replacement_no_gnuconfig(self, mutable_database, monkeypatch):
|
||||
"""
|
||||
|
@@ -15,7 +15,7 @@
|
||||
|
||||
@pytest.fixture()
|
||||
def builder_test_repository(config):
|
||||
builder_test_path = os.path.join(spack.paths.test_repos_path, "builder.test")
|
||||
builder_test_path = os.path.join(spack.paths.test_repos_path, "spack_repo", "builder_test")
|
||||
with spack.repo.use_repositories(builder_test_path) as mock_repo:
|
||||
yield mock_repo
|
||||
|
||||
|
@@ -549,11 +549,10 @@ def test_url_buildcache_entry_v2_exists(
|
||||
):
|
||||
"""Test existence check for v2 buildcache entries"""
|
||||
test_mirror_path = v2_buildcache_layout("unsigned")
|
||||
mirror_url = f"file://{test_mirror_path}"
|
||||
mirror_url = pathlib.Path(test_mirror_path).as_uri()
|
||||
mirror("add", "v2mirror", mirror_url)
|
||||
|
||||
with capsys.disabled():
|
||||
output = buildcache("list", "-a", "-l")
|
||||
output = buildcache("list", "-a", "-l")
|
||||
|
||||
assert "Fetching an index from a v2 binary mirror layout" in output
|
||||
assert "is deprecated" in output
|
||||
|
@@ -2,134 +2,39 @@
|
||||
#
|
||||
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
|
||||
|
||||
import os
|
||||
|
||||
import pytest
|
||||
|
||||
import spack.cmd.diff
|
||||
import spack.concretize
|
||||
import spack.main
|
||||
import spack.paths
|
||||
import spack.repo
|
||||
import spack.util.spack_json as sjson
|
||||
from spack.test.conftest import create_test_repo
|
||||
|
||||
install_cmd = spack.main.SpackCommand("install")
|
||||
diff_cmd = spack.main.SpackCommand("diff")
|
||||
find_cmd = spack.main.SpackCommand("find")
|
||||
|
||||
|
||||
_p1 = (
|
||||
"p1",
|
||||
"""\
|
||||
from spack.package import *
|
||||
|
||||
class P1(Package):
|
||||
version("1.0")
|
||||
|
||||
variant("p1var", default=True)
|
||||
variant("usev1", default=True)
|
||||
|
||||
depends_on("p2")
|
||||
depends_on("v1", when="+usev1")
|
||||
""",
|
||||
)
|
||||
|
||||
|
||||
_p2 = (
|
||||
"p2",
|
||||
"""\
|
||||
from spack.package import *
|
||||
|
||||
class P2(Package):
|
||||
version("1.0")
|
||||
|
||||
variant("p2var", default=True)
|
||||
|
||||
depends_on("p3")
|
||||
""",
|
||||
)
|
||||
|
||||
|
||||
_p3 = (
|
||||
"p3",
|
||||
"""\
|
||||
from spack.package import *
|
||||
|
||||
class P3(Package):
|
||||
version("1.0")
|
||||
|
||||
variant("p3var", default=True)
|
||||
""",
|
||||
)
|
||||
|
||||
_i1 = (
|
||||
"i1",
|
||||
"""\
|
||||
from spack.package import *
|
||||
|
||||
class I1(Package):
|
||||
version("1.0")
|
||||
|
||||
provides("v1")
|
||||
|
||||
variant("i1var", default=True)
|
||||
|
||||
depends_on("p3")
|
||||
depends_on("p4")
|
||||
""",
|
||||
)
|
||||
|
||||
_i2 = (
|
||||
"i2",
|
||||
"""\
|
||||
from spack.package import *
|
||||
|
||||
class I2(Package):
|
||||
version("1.0")
|
||||
|
||||
provides("v1")
|
||||
|
||||
variant("i2var", default=True)
|
||||
|
||||
depends_on("p3")
|
||||
depends_on("p4")
|
||||
""",
|
||||
)
|
||||
|
||||
|
||||
_p4 = (
|
||||
"p4",
|
||||
"""\
|
||||
from spack.package import *
|
||||
|
||||
class P4(Package):
|
||||
version("1.0")
|
||||
|
||||
variant("p4var", default=True)
|
||||
""",
|
||||
)
|
||||
|
||||
|
||||
# Note that the hash of p1 will differ depending on the variant chosen
|
||||
# we probably always want to omit that from diffs
|
||||
@pytest.fixture
|
||||
def _create_test_repo(tmpdir, mutable_config):
|
||||
"""
|
||||
p1____
|
||||
| \
|
||||
p2 v1
|
||||
| ____/ |
|
||||
p3 p4
|
||||
# p1____
|
||||
# | \
|
||||
# p2 v1
|
||||
# | ____/ |
|
||||
# p3 p4
|
||||
|
||||
i1 and i2 provide v1 (and both have the same dependencies)
|
||||
# i1 and i2 provide v1 (and both have the same dependencies)
|
||||
|
||||
All packages have an associated variant
|
||||
"""
|
||||
yield create_test_repo(tmpdir, [_p1, _p2, _p3, _i1, _i2, _p4])
|
||||
# All packages have an associated variant
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
def test_repo(_create_test_repo, monkeypatch, mock_stage):
|
||||
with spack.repo.use_repositories(_create_test_repo) as mock_repo_path:
|
||||
yield mock_repo_path
|
||||
def test_repo(config):
|
||||
builder_test_path = os.path.join(spack.paths.test_repos_path, "spack_repo", "diff")
|
||||
with spack.repo.use_repositories(builder_test_path) as mock_repo:
|
||||
yield mock_repo
|
||||
|
||||
|
||||
def test_diff_ignore(test_repo):
|
||||
|
@@ -6,7 +6,6 @@
|
||||
|
||||
import spack.repo
|
||||
import spack.util.editor
|
||||
from spack.build_systems import autotools, cmake
|
||||
from spack.main import SpackCommand
|
||||
|
||||
edit = SpackCommand("edit")
|
||||
@@ -29,13 +28,15 @@ def editor(*args: str, **kwargs):
|
||||
assert called
|
||||
|
||||
|
||||
def test_edit_files(monkeypatch):
|
||||
def test_edit_files(monkeypatch, mock_packages):
|
||||
"""Test spack edit --build-system autotools cmake"""
|
||||
called = False
|
||||
|
||||
def editor(*args: str, **kwargs):
|
||||
nonlocal called
|
||||
called = True
|
||||
from spack_repo.builtin_mock.build_systems import autotools, cmake # type: ignore
|
||||
|
||||
assert os.path.samefile(args[0], autotools.__file__)
|
||||
assert os.path.samefile(args[1], cmake.__file__)
|
||||
|
||||
|
@@ -886,12 +886,12 @@ def test_env_activate_broken_view(
|
||||
with spack.repo.use_repositories(mock_custom_repository):
|
||||
wrong_repo = env("activate", "--sh", "test")
|
||||
assert "Warning: could not load runtime environment" in wrong_repo
|
||||
assert "Unknown namespace: builtin.mock" in wrong_repo
|
||||
assert "Unknown namespace: builtin_mock" in wrong_repo
|
||||
|
||||
# test replacing repo fixes it
|
||||
normal_repo = env("activate", "--sh", "test")
|
||||
assert "Warning: could not load runtime environment" not in normal_repo
|
||||
assert "Unknown namespace: builtin.mock" not in normal_repo
|
||||
assert "Unknown namespace: builtin_mock" not in normal_repo
|
||||
|
||||
|
||||
def test_to_lockfile_dict():
|
||||
@@ -916,7 +916,7 @@ def test_env_repo():
|
||||
|
||||
pkg_cls = e.repo.get_pkg_class("mpileaks")
|
||||
assert pkg_cls.name == "mpileaks"
|
||||
assert pkg_cls.namespace == "builtin.mock"
|
||||
assert pkg_cls.namespace == "builtin_mock"
|
||||
|
||||
|
||||
def test_user_removed_spec(environment_from_manifest):
|
||||
|
@@ -102,25 +102,25 @@ def _determine_version(cls, exe):
|
||||
["detectable"],
|
||||
[],
|
||||
[
|
||||
"builtin.mock.cmake",
|
||||
"builtin.mock.find-externals1",
|
||||
"builtin.mock.gcc",
|
||||
"builtin.mock.intel-oneapi-compilers",
|
||||
"builtin.mock.llvm",
|
||||
"builtin.mock.mpich",
|
||||
"builtin_mock.cmake",
|
||||
"builtin_mock.find-externals1",
|
||||
"builtin_mock.gcc",
|
||||
"builtin_mock.intel-oneapi-compilers",
|
||||
"builtin_mock.llvm",
|
||||
"builtin_mock.mpich",
|
||||
],
|
||||
),
|
||||
# find --all --exclude find-externals1
|
||||
(
|
||||
None,
|
||||
["detectable"],
|
||||
["builtin.mock.find-externals1"],
|
||||
["builtin_mock.find-externals1"],
|
||||
[
|
||||
"builtin.mock.cmake",
|
||||
"builtin.mock.gcc",
|
||||
"builtin.mock.intel-oneapi-compilers",
|
||||
"builtin.mock.llvm",
|
||||
"builtin.mock.mpich",
|
||||
"builtin_mock.cmake",
|
||||
"builtin_mock.gcc",
|
||||
"builtin_mock.intel-oneapi-compilers",
|
||||
"builtin_mock.llvm",
|
||||
"builtin_mock.mpich",
|
||||
],
|
||||
),
|
||||
(
|
||||
@@ -128,11 +128,11 @@ def _determine_version(cls, exe):
|
||||
["detectable"],
|
||||
["find-externals1"],
|
||||
[
|
||||
"builtin.mock.cmake",
|
||||
"builtin.mock.gcc",
|
||||
"builtin.mock.intel-oneapi-compilers",
|
||||
"builtin.mock.llvm",
|
||||
"builtin.mock.mpich",
|
||||
"builtin_mock.cmake",
|
||||
"builtin_mock.gcc",
|
||||
"builtin_mock.intel-oneapi-compilers",
|
||||
"builtin_mock.llvm",
|
||||
"builtin_mock.mpich",
|
||||
],
|
||||
),
|
||||
# find hwloc (and mock hwloc is not detectable)
|
||||
|
@@ -14,12 +14,12 @@
|
||||
import spack.cmd.find
|
||||
import spack.concretize
|
||||
import spack.environment as ev
|
||||
import spack.paths
|
||||
import spack.repo
|
||||
import spack.store
|
||||
import spack.user_environment as uenv
|
||||
from spack.enums import InstallRecordStatus
|
||||
from spack.main import SpackCommand
|
||||
from spack.test.conftest import create_test_repo
|
||||
from spack.test.utilities import SpackCommandArgs
|
||||
from spack.util.pattern import Bunch
|
||||
|
||||
@@ -129,7 +129,7 @@ def test_tag2_tag3(parser, specs):
|
||||
@pytest.mark.db
|
||||
def test_namespaces_shown_correctly(args, with_namespace, database):
|
||||
"""Test that --namespace(s) works. Old syntax is --namespace"""
|
||||
assert ("builtin.mock.zmpi" in find(*args)) == with_namespace
|
||||
assert ("builtin_mock.zmpi" in find(*args)) == with_namespace
|
||||
|
||||
|
||||
@pytest.mark.db
|
||||
@@ -462,89 +462,16 @@ def test_environment_with_version_range_in_compiler_doesnt_fail(tmp_path, mock_p
|
||||
assert "zlib" in output
|
||||
|
||||
|
||||
_pkga = (
|
||||
"a0",
|
||||
"""\
|
||||
from spack.package import *
|
||||
|
||||
class A0(Package):
|
||||
version("1.2")
|
||||
version("1.1")
|
||||
|
||||
depends_on("b0")
|
||||
depends_on("c0")
|
||||
""",
|
||||
)
|
||||
|
||||
|
||||
_pkgb = (
|
||||
"b0",
|
||||
"""\
|
||||
from spack.package import *
|
||||
|
||||
class B0(Package):
|
||||
version("1.2")
|
||||
version("1.1")
|
||||
""",
|
||||
)
|
||||
|
||||
|
||||
_pkgc = (
|
||||
"c0",
|
||||
"""\
|
||||
from spack.package import *
|
||||
|
||||
class C0(Package):
|
||||
version("1.2")
|
||||
version("1.1")
|
||||
|
||||
tags = ["tag0", "tag1"]
|
||||
""",
|
||||
)
|
||||
|
||||
|
||||
_pkgd = (
|
||||
"d0",
|
||||
"""\
|
||||
from spack.package import *
|
||||
|
||||
class D0(Package):
|
||||
version("1.2")
|
||||
version("1.1")
|
||||
|
||||
depends_on("c0")
|
||||
depends_on("e0")
|
||||
""",
|
||||
)
|
||||
|
||||
|
||||
_pkge = (
|
||||
"e0",
|
||||
"""\
|
||||
from spack.package import *
|
||||
|
||||
class E0(Package):
|
||||
tags = ["tag1", "tag2"]
|
||||
|
||||
version("1.2")
|
||||
version("1.1")
|
||||
""",
|
||||
)
|
||||
# a0 d0
|
||||
# / \ / \
|
||||
# b0 c0 e0
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
def _create_test_repo(tmpdir, mutable_config):
|
||||
r"""
|
||||
a0 d0
|
||||
/ \ / \
|
||||
b0 c0 e0
|
||||
"""
|
||||
yield create_test_repo(tmpdir, [_pkga, _pkgb, _pkgc, _pkgd, _pkge])
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
def test_repo(_create_test_repo, monkeypatch, mock_stage):
|
||||
with spack.repo.use_repositories(_create_test_repo) as mock_repo_path:
|
||||
def test_repo(mock_stage):
|
||||
with spack.repo.use_repositories(
|
||||
os.path.join(spack.paths.test_repos_path, "spack_repo", "find")
|
||||
) as mock_repo_path:
|
||||
yield mock_repo_path
|
||||
|
||||
|
||||
|
@@ -143,13 +143,13 @@ def test_list_count():
|
||||
|
||||
def test_list_repos():
|
||||
with spack.repo.use_repositories(
|
||||
os.path.join(spack.paths.test_repos_path, "builtin.mock"),
|
||||
os.path.join(spack.paths.test_repos_path, "builder.test"),
|
||||
os.path.join(spack.paths.test_repos_path, "spack_repo", "builtin_mock"),
|
||||
os.path.join(spack.paths.test_repos_path, "spack_repo", "builder_test"),
|
||||
):
|
||||
total_pkgs = len(list().strip().split())
|
||||
mock_pkgs = len(list("-r", "builtin.mock").strip().split())
|
||||
builder_pkgs = len(list("-r", "builder.test").strip().split())
|
||||
both_repos = len(list("-r", "builtin.mock", "-r", "builder.test").strip().split())
|
||||
mock_pkgs = len(list("-r", "builtin_mock").strip().split())
|
||||
builder_pkgs = len(list("-r", "builder_test").strip().split())
|
||||
both_repos = len(list("-r", "builtin_mock", "-r", "builder_test").strip().split())
|
||||
|
||||
assert total_pkgs > mock_pkgs > builder_pkgs
|
||||
assert both_repos == total_pkgs
|
||||
|
@@ -61,6 +61,26 @@ def test_mirror_from_env(mutable_mock_env_path, tmp_path, mock_packages, mock_fe
|
||||
assert mirror_res == expected
|
||||
|
||||
|
||||
# Test for command line-specified spec in concretized environment
|
||||
def test_mirror_spec_from_env(mutable_mock_env_path, tmp_path, mock_packages, mock_fetch):
|
||||
mirror_dir = str(tmp_path / "mirror-B")
|
||||
env_name = "test"
|
||||
|
||||
env("create", env_name)
|
||||
with ev.read(env_name):
|
||||
add("simple-standalone-test@0.9")
|
||||
concretize()
|
||||
with spack.config.override("config:checksum", False):
|
||||
mirror("create", "-d", mirror_dir, "simple-standalone-test")
|
||||
|
||||
e = ev.read(env_name)
|
||||
assert set(os.listdir(mirror_dir)) == set([s.name for s in e.user_specs])
|
||||
spec = e.concrete_roots()[0]
|
||||
mirror_res = os.listdir(os.path.join(mirror_dir, spec.name))
|
||||
expected = ["%s.tar.gz" % spec.format("{name}-{version}")]
|
||||
assert mirror_res == expected
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
def source_for_pkg_with_hash(mock_packages, tmpdir):
|
||||
s = spack.concretize.concretize_one("trivial-pkg-with-valid-hash")
|
||||
@@ -401,8 +421,7 @@ def test_all_specs_with_all_versions_dont_concretize(self):
|
||||
@pytest.mark.parametrize(
|
||||
"cli_args,error_str",
|
||||
[
|
||||
# Passed more than one among -f --all and specs
|
||||
({"specs": "hdf5", "file": None, "all": True}, "cannot specify specs on command line"),
|
||||
# Passed more than one among -f --all
|
||||
(
|
||||
{"specs": None, "file": "input.txt", "all": True},
|
||||
"cannot specify specs with a file if",
|
||||
|
@@ -39,7 +39,9 @@ def install(self, spec, prefix):
|
||||
def mock_pkg_git_repo(git, tmp_path_factory):
|
||||
"""Copy the builtin.mock repo and make a mutable git repo inside it."""
|
||||
root_dir = tmp_path_factory.mktemp("mock_pkg_git_repo")
|
||||
repo_dir = root_dir / "builtin.mock"
|
||||
# create spack_repo subdir
|
||||
(root_dir / "spack_repo").mkdir()
|
||||
repo_dir = root_dir / "spack_repo" / "builtin_mock"
|
||||
shutil.copytree(spack.paths.mock_packages_path, str(repo_dir))
|
||||
|
||||
repo_cache = spack.util.file_cache.FileCache(root_dir / "cache")
|
||||
@@ -57,25 +59,25 @@ def mock_pkg_git_repo(git, tmp_path_factory):
|
||||
git("-c", "commit.gpgsign=false", "commit", "-m", "initial mock repo commit")
|
||||
|
||||
# add commit with mockpkg-a, mockpkg-b, mockpkg-c packages
|
||||
mkdirp("mockpkg-a", "mockpkg-b", "mockpkg-c")
|
||||
with open("mockpkg-a/package.py", "w", encoding="utf-8") as f:
|
||||
mkdirp("mockpkg_a", "mockpkg_b", "mockpkg_c")
|
||||
with open("mockpkg_a/package.py", "w", encoding="utf-8") as f:
|
||||
f.write(pkg_template.format(name="PkgA"))
|
||||
with open("mockpkg-b/package.py", "w", encoding="utf-8") as f:
|
||||
with open("mockpkg_b/package.py", "w", encoding="utf-8") as f:
|
||||
f.write(pkg_template.format(name="PkgB"))
|
||||
with open("mockpkg-c/package.py", "w", encoding="utf-8") as f:
|
||||
with open("mockpkg_c/package.py", "w", encoding="utf-8") as f:
|
||||
f.write(pkg_template.format(name="PkgC"))
|
||||
git("add", "mockpkg-a", "mockpkg-b", "mockpkg-c")
|
||||
git("add", "mockpkg_a", "mockpkg_b", "mockpkg_c")
|
||||
git("-c", "commit.gpgsign=false", "commit", "-m", "add mockpkg-a, mockpkg-b, mockpkg-c")
|
||||
|
||||
# remove mockpkg-c, add mockpkg-d
|
||||
with open("mockpkg-b/package.py", "a", encoding="utf-8") as f:
|
||||
with open("mockpkg_b/package.py", "a", encoding="utf-8") as f:
|
||||
f.write("\n# change mockpkg-b")
|
||||
git("add", "mockpkg-b")
|
||||
mkdirp("mockpkg-d")
|
||||
with open("mockpkg-d/package.py", "w", encoding="utf-8") as f:
|
||||
git("add", "mockpkg_b")
|
||||
mkdirp("mockpkg_d")
|
||||
with open("mockpkg_d/package.py", "w", encoding="utf-8") as f:
|
||||
f.write(pkg_template.format(name="PkgD"))
|
||||
git("add", "mockpkg-d")
|
||||
git("rm", "-rf", "mockpkg-c")
|
||||
git("add", "mockpkg_d")
|
||||
git("rm", "-rf", "mockpkg_c")
|
||||
git(
|
||||
"-c",
|
||||
"commit.gpgsign=false",
|
||||
@@ -90,7 +92,7 @@ def mock_pkg_git_repo(git, tmp_path_factory):
|
||||
|
||||
@pytest.fixture(scope="module")
|
||||
def mock_pkg_names():
|
||||
repo = spack.repo.PATH.get_repo("builtin.mock")
|
||||
repo = spack.repo.PATH.get_repo("builtin_mock")
|
||||
|
||||
# Be sure to include virtual packages since packages with stand-alone
|
||||
# tests may inherit additional tests from the virtuals they provide,
|
||||
@@ -117,22 +119,22 @@ def test_builtin_repo():
|
||||
|
||||
|
||||
def test_mock_builtin_repo(mock_packages):
|
||||
assert spack.repo.builtin_repo() is spack.repo.PATH.get_repo("builtin.mock")
|
||||
assert spack.repo.builtin_repo() is spack.repo.PATH.get_repo("builtin_mock")
|
||||
|
||||
|
||||
def test_pkg_add(git, mock_pkg_git_repo):
|
||||
with working_dir(mock_pkg_git_repo):
|
||||
mkdirp("mockpkg-e")
|
||||
with open("mockpkg-e/package.py", "w", encoding="utf-8") as f:
|
||||
mkdirp("mockpkg_e")
|
||||
with open("mockpkg_e/package.py", "w", encoding="utf-8") as f:
|
||||
f.write(pkg_template.format(name="PkgE"))
|
||||
|
||||
pkg("add", "mockpkg-e")
|
||||
|
||||
with working_dir(mock_pkg_git_repo):
|
||||
try:
|
||||
assert "A mockpkg-e/package.py" in git("status", "--short", output=str)
|
||||
assert "A mockpkg_e/package.py" in git("status", "--short", output=str)
|
||||
finally:
|
||||
shutil.rmtree("mockpkg-e")
|
||||
shutil.rmtree("mockpkg_e")
|
||||
# Removing a package mid-run disrupts Spack's caching
|
||||
if spack.repo.PATH.repos[0]._fast_package_checker:
|
||||
spack.repo.PATH.repos[0]._fast_package_checker.invalidate()
|
||||
|
@@ -48,11 +48,13 @@ def test_resource_list(mock_packages, capfd):
|
||||
assert "path:" in out
|
||||
|
||||
assert (
|
||||
os.path.join("repos", "builtin.mock", "packages", "patch-a-dependency", "libelf.patch")
|
||||
os.path.join(
|
||||
"spack_repo", "builtin_mock", "packages", "patch_a_dependency", "libelf.patch"
|
||||
)
|
||||
in out
|
||||
)
|
||||
assert "applies to: builtin.mock.libelf" in out
|
||||
assert "patched by: builtin.mock.patch-a-dependency" in out
|
||||
assert "applies to: builtin_mock.libelf" in out
|
||||
assert "patched by: builtin_mock.patch-a-dependency" in out
|
||||
|
||||
|
||||
def test_resource_list_only_hashes(mock_packages, capfd):
|
||||
@@ -74,10 +76,12 @@ def test_resource_show(mock_packages, capfd):
|
||||
|
||||
assert out.startswith(test_hash)
|
||||
assert (
|
||||
os.path.join("repos", "builtin.mock", "packages", "patch-a-dependency", "libelf.patch")
|
||||
os.path.join(
|
||||
"spack_repo", "builtin_mock", "packages", "patch_a_dependency", "libelf.patch"
|
||||
)
|
||||
in out
|
||||
)
|
||||
assert "applies to: builtin.mock.libelf" in out
|
||||
assert "patched by: builtin.mock.patch-a-dependency" in out
|
||||
assert "applies to: builtin_mock.libelf" in out
|
||||
assert "patched by: builtin_mock.patch-a-dependency" in out
|
||||
|
||||
assert len(out.strip().split("\n")) == 4
|
||||
|
@@ -241,14 +241,14 @@ def test_external_root(external_style_root, capfd):
|
||||
assert "%s Imports are incorrectly sorted" % str(py_file) in output
|
||||
|
||||
# mypy error
|
||||
assert 'lib/spack/spack/dummy.py:9: error: Name "Package" is not defined' in output
|
||||
assert 'lib/spack/spack/dummy.py:47: error: Name "version" is not defined' in output
|
||||
|
||||
# black error
|
||||
assert "--- lib/spack/spack/dummy.py" in output
|
||||
assert "+++ lib/spack/spack/dummy.py" in output
|
||||
|
||||
# flake8 error
|
||||
assert "lib/spack/spack/dummy.py:6: [F401] 'os' imported but unused" in output
|
||||
assert "lib/spack/spack/dummy.py:8: [F401] 'os' imported but unused" in output
|
||||
|
||||
|
||||
@pytest.mark.skipif(not FLAKE8, reason="flake8 is not installed.")
|
||||
@@ -311,8 +311,10 @@ def test_run_import_check(tmp_path: pathlib.Path):
|
||||
import spack.repo
|
||||
import spack.repo_utils
|
||||
|
||||
from spack_repo.builtin_mock.build_systems import autotools
|
||||
|
||||
# this comment about spack.error should not be removed
|
||||
class Example(spack.build_systems.autotools.AutotoolsPackage):
|
||||
class Example(autotools.AutotoolsPackage):
|
||||
"""this is a docstring referencing unused spack.error.SpackError, which is fine"""
|
||||
pass
|
||||
|
||||
@@ -339,7 +341,6 @@ def foo(config: "spack.error.SpackError"):
|
||||
assert "issues.py: redundant import: spack.repo" in output
|
||||
assert "issues.py: redundant import: spack.config" not in output # comment prevents removal
|
||||
assert "issues.py: missing import: spack" in output # used by spack.__version__
|
||||
assert "issues.py: missing import: spack.build_systems.autotools" in output
|
||||
assert "issues.py: missing import: spack.util.executable" in output
|
||||
assert "issues.py: missing import: spack.error" not in output # not directly used
|
||||
assert exit_code == 1
|
||||
@@ -359,7 +360,6 @@ def foo(config: "spack.error.SpackError"):
|
||||
assert exit_code == 1
|
||||
assert "issues.py: redundant import: spack.cmd" in output
|
||||
assert "issues.py: missing import: spack" in output
|
||||
assert "issues.py: missing import: spack.build_systems.autotools" in output
|
||||
assert "issues.py: missing import: spack.util.executable" in output
|
||||
|
||||
# after fix a second fix is idempotent
|
||||
@@ -380,7 +380,6 @@ def foo(config: "spack.error.SpackError"):
|
||||
new_contents = file.read_text()
|
||||
assert "import spack.cmd" not in new_contents
|
||||
assert "import spack\n" in new_contents
|
||||
assert "import spack.build_systems.autotools\n" in new_contents
|
||||
assert "import spack.util.executable\n" in new_contents
|
||||
|
||||
|
||||
|
@@ -36,7 +36,7 @@ def test_remote_versions_only():
|
||||
@pytest.mark.usefixtures("mock_packages")
|
||||
def test_new_versions_only(monkeypatch):
|
||||
"""Test a package for which new versions should be available."""
|
||||
from spack.pkg.builtin.mock.brillig import Brillig # type: ignore[import]
|
||||
from spack_repo.builtin_mock.packages.brillig.package import Brillig # type: ignore[import]
|
||||
|
||||
def mock_fetch_remote_versions(*args, **kwargs):
|
||||
mock_remote_versions = {
|
||||
|
@@ -4,10 +4,9 @@
|
||||
|
||||
import os
|
||||
|
||||
import _vendoring.archspec.cpu
|
||||
import pytest
|
||||
|
||||
import archspec.cpu
|
||||
|
||||
import spack.concretize
|
||||
import spack.config
|
||||
import spack.paths
|
||||
@@ -29,7 +28,7 @@ def _concretize_with_reuse(*, root_str, reused_str):
|
||||
|
||||
@pytest.fixture
|
||||
def runtime_repo(mutable_config):
|
||||
repo = os.path.join(spack.paths.test_repos_path, "compiler_runtime.test")
|
||||
repo = os.path.join(spack.paths.test_repos_path, "spack_repo", "compiler_runtime_test")
|
||||
with spack.repo.use_repositories(repo) as mock_repo:
|
||||
yield mock_repo
|
||||
|
||||
@@ -86,7 +85,8 @@ def test_external_nodes_do_not_have_runtimes(runtime_repo, mutable_config, tmp_p
|
||||
{"pkg-a": "gcc-runtime@9.4.0", "pkg-b": "gcc-runtime@9.4.0"},
|
||||
1,
|
||||
marks=pytest.mark.skipif(
|
||||
str(archspec.cpu.host().family) != "x86_64", reason="test data is x86_64 specific"
|
||||
str(_vendoring.archspec.cpu.host().family) != "x86_64",
|
||||
reason="test data is x86_64 specific",
|
||||
),
|
||||
),
|
||||
pytest.param(
|
||||
@@ -98,7 +98,8 @@ def test_external_nodes_do_not_have_runtimes(runtime_repo, mutable_config, tmp_p
|
||||
},
|
||||
2,
|
||||
marks=pytest.mark.skipif(
|
||||
str(archspec.cpu.host().family) != "x86_64", reason="test data is x86_64 specific"
|
||||
str(_vendoring.archspec.cpu.host().family) != "x86_64",
|
||||
reason="test data is x86_64 specific",
|
||||
),
|
||||
),
|
||||
],
|
||||
|
@@ -2,14 +2,14 @@
|
||||
#
|
||||
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
|
||||
import os
|
||||
import pathlib
|
||||
import platform
|
||||
import sys
|
||||
|
||||
import _vendoring.archspec.cpu
|
||||
import _vendoring.jinja2
|
||||
import pytest
|
||||
|
||||
import archspec.cpu
|
||||
|
||||
import llnl.util.lang
|
||||
|
||||
import spack.binary_distribution
|
||||
@@ -79,7 +79,7 @@ def binary_compatibility(monkeypatch, request):
|
||||
return
|
||||
|
||||
if "mock_packages" not in request.fixturenames:
|
||||
# Only builtin.mock has a mock glibc package
|
||||
# Only builtin_mock has a mock glibc package
|
||||
return
|
||||
|
||||
if "database" in request.fixturenames or "mutable_database" in request.fixturenames:
|
||||
@@ -145,12 +145,12 @@ def current_host(request, monkeypatch):
|
||||
|
||||
monkeypatch.setattr(spack.platforms.Test, "default", cpu)
|
||||
if not is_preference:
|
||||
target = archspec.cpu.TARGETS[cpu]
|
||||
monkeypatch.setattr(archspec.cpu, "host", lambda: target)
|
||||
target = _vendoring.archspec.cpu.TARGETS[cpu]
|
||||
monkeypatch.setattr(_vendoring.archspec.cpu, "host", lambda: target)
|
||||
yield target
|
||||
else:
|
||||
target = archspec.cpu.TARGETS["sapphirerapids"]
|
||||
monkeypatch.setattr(archspec.cpu, "host", lambda: target)
|
||||
target = _vendoring.archspec.cpu.TARGETS["sapphirerapids"]
|
||||
monkeypatch.setattr(_vendoring.archspec.cpu, "host", lambda: target)
|
||||
with spack.config.override("packages:all", {"target": [cpu]}):
|
||||
yield target
|
||||
|
||||
@@ -170,18 +170,12 @@ def reverser(pkg_name):
|
||||
|
||||
@pytest.fixture()
|
||||
def repo_with_changing_recipe(tmp_path_factory, mutable_mock_repo):
|
||||
repo_namespace = "changing"
|
||||
repo_dir = tmp_path_factory.mktemp(repo_namespace)
|
||||
repos_dir: pathlib.Path = tmp_path_factory.mktemp("repos_dir")
|
||||
root, _ = spack.repo.create_repo(str(repos_dir), "changing")
|
||||
packages_dir = pathlib.Path(root, "packages")
|
||||
|
||||
(repo_dir / "repo.yaml").write_text(
|
||||
"""
|
||||
repo:
|
||||
namespace: changing
|
||||
"""
|
||||
)
|
||||
|
||||
packages_dir = repo_dir / "packages"
|
||||
root_pkg_str = """
|
||||
from spack_repo.builtin_mock.build_systems.generic import Package
|
||||
from spack.package import *
|
||||
|
||||
class Root(Package):
|
||||
@@ -199,6 +193,7 @@ class Root(Package):
|
||||
package_py.write_text(root_pkg_str)
|
||||
|
||||
middle_pkg_str = """
|
||||
from spack_repo.builtin_mock.build_systems.generic import Package
|
||||
from spack.package import *
|
||||
|
||||
class Middle(Package):
|
||||
@@ -213,6 +208,7 @@ class Middle(Package):
|
||||
package_py.write_text(middle_pkg_str)
|
||||
|
||||
changing_template = """
|
||||
from spack_repo.builtin_mock.build_systems.generic import Package
|
||||
from spack.package import *
|
||||
|
||||
class Changing(Package):
|
||||
@@ -235,7 +231,7 @@ class Changing(Package):
|
||||
{% endif %}
|
||||
"""
|
||||
|
||||
with spack.repo.use_repositories(str(repo_dir), override=False) as repository:
|
||||
with spack.repo.use_repositories(root, override=False) as repos:
|
||||
|
||||
class _ChangingPackage:
|
||||
default_context = [
|
||||
@@ -244,27 +240,22 @@ class _ChangingPackage:
|
||||
("add_variant", False),
|
||||
]
|
||||
|
||||
def __init__(self, repo_directory):
|
||||
self.repo_dir = repo_directory
|
||||
def __init__(self):
|
||||
cache_dir = tmp_path_factory.mktemp("cache")
|
||||
self.repo_cache = spack.util.file_cache.FileCache(str(cache_dir))
|
||||
self.repo = spack.repo.Repo(str(repo_directory), cache=self.repo_cache)
|
||||
self.repo = spack.repo.Repo(root, cache=self.repo_cache)
|
||||
|
||||
def change(self, changes=None):
|
||||
changes = changes or {}
|
||||
context = dict(self.default_context)
|
||||
context.update(changes)
|
||||
# Remove the repo object and delete Python modules
|
||||
repository.remove(self.repo)
|
||||
repos.remove(self.repo)
|
||||
# TODO: this mocks a change in the recipe that should happen in a
|
||||
# TODO: different process space. Leaving this comment as a hint
|
||||
# TODO: in case tests using this fixture start failing.
|
||||
if sys.modules.get("spack.pkg.changing.changing"):
|
||||
del sys.modules["spack.pkg.changing.changing"]
|
||||
if sys.modules.get("spack.pkg.changing.root"):
|
||||
del sys.modules["spack.pkg.changing.root"]
|
||||
if sys.modules.get("spack.pkg.changing"):
|
||||
del sys.modules["spack.pkg.changing"]
|
||||
for module in [x for x in sys.modules if x.startswith("spack_repo.changing")]:
|
||||
del sys.modules[module]
|
||||
|
||||
# Change the recipe
|
||||
t = _vendoring.jinja2.Template(changing_template)
|
||||
@@ -274,10 +265,10 @@ def change(self, changes=None):
|
||||
package_py.write_text(changing_pkg_str)
|
||||
|
||||
# Re-add the repository
|
||||
self.repo = spack.repo.Repo(str(self.repo_dir), cache=self.repo_cache)
|
||||
repository.put_first(self.repo)
|
||||
self.repo = spack.repo.Repo(root, cache=self.repo_cache)
|
||||
repos.put_first(self.repo)
|
||||
|
||||
_changing_pkg = _ChangingPackage(repo_dir)
|
||||
_changing_pkg = _ChangingPackage()
|
||||
_changing_pkg.change(
|
||||
{"delete_version": False, "delete_variant": False, "add_variant": False}
|
||||
)
|
||||
@@ -374,11 +365,11 @@ def test_provides_handles_multiple_providers_of_same_version(self):
|
||||
# Note that providers are repo-specific, so we don't misinterpret
|
||||
# providers, but vdeps are not namespace-specific, so we can
|
||||
# associate vdeps across repos.
|
||||
assert Spec("builtin.mock.multi-provider-mpi@1.10.3") in providers
|
||||
assert Spec("builtin.mock.multi-provider-mpi@1.10.2") in providers
|
||||
assert Spec("builtin.mock.multi-provider-mpi@1.10.1") in providers
|
||||
assert Spec("builtin.mock.multi-provider-mpi@1.10.0") in providers
|
||||
assert Spec("builtin.mock.multi-provider-mpi@1.8.8") in providers
|
||||
assert Spec("builtin_mock.multi-provider-mpi@1.10.3") in providers
|
||||
assert Spec("builtin_mock.multi-provider-mpi@1.10.2") in providers
|
||||
assert Spec("builtin_mock.multi-provider-mpi@1.10.1") in providers
|
||||
assert Spec("builtin_mock.multi-provider-mpi@1.10.0") in providers
|
||||
assert Spec("builtin_mock.multi-provider-mpi@1.8.8") in providers
|
||||
|
||||
def test_different_compilers_get_different_flags(
|
||||
self, mutable_config, clang12_with_flags, gcc11_with_flags
|
||||
@@ -391,7 +382,7 @@ def test_different_compilers_get_different_flags(
|
||||
"gcc": {"externals": [gcc11_with_flags]},
|
||||
},
|
||||
)
|
||||
t = archspec.cpu.host().family
|
||||
t = _vendoring.archspec.cpu.host().family
|
||||
client = spack.concretize.concretize_one(
|
||||
Spec(
|
||||
f"cmake-client platform=test os=redhat6 target={t} %gcc@11.1.0"
|
||||
@@ -984,7 +975,7 @@ def test_noversion_pkg(self, spec):
|
||||
def test_adjusting_default_target_based_on_compiler(
|
||||
self, spec, compiler_spec, best_achievable, current_host, compiler_factory, mutable_config
|
||||
):
|
||||
best_achievable = archspec.cpu.TARGETS[best_achievable]
|
||||
best_achievable = _vendoring.archspec.cpu.TARGETS[best_achievable]
|
||||
expected = best_achievable if best_achievable < current_host else current_host
|
||||
mutable_config.set(
|
||||
"packages", {"gcc": {"externals": [compiler_factory(spec=f"{compiler_spec}")]}}
|
||||
@@ -1653,7 +1644,7 @@ def test_target_granularity(self):
|
||||
# The test architecture uses core2 as the default target. Check that when
|
||||
# we configure Spack for "generic" granularity we concretize for x86_64
|
||||
default_target = spack.platforms.test.Test.default
|
||||
generic_target = archspec.cpu.TARGETS[default_target].generic.name
|
||||
generic_target = _vendoring.archspec.cpu.TARGETS[default_target].generic.name
|
||||
s = Spec("python")
|
||||
assert spack.concretize.concretize_one(s).satisfies("target=%s" % default_target)
|
||||
with spack.config.override("concretizer:targets", {"granularity": "generic"}):
|
||||
@@ -1716,12 +1707,12 @@ def test_reuse_with_unknown_namespace_dont_raise(
|
||||
):
|
||||
with spack.repo.use_repositories(mock_custom_repository, override=False):
|
||||
s = spack.concretize.concretize_one("pkg-c")
|
||||
assert s.namespace != "builtin.mock"
|
||||
assert s.namespace != "builtin_mock"
|
||||
PackageInstaller([s.package], fake=True, explicit=True).install()
|
||||
|
||||
with spack.config.override("concretizer:reuse", True):
|
||||
s = spack.concretize.concretize_one("pkg-c")
|
||||
assert s.namespace == "builtin.mock"
|
||||
assert s.namespace == "builtin_mock"
|
||||
|
||||
@pytest.mark.regression("45538")
|
||||
def test_reuse_from_other_namespace_no_raise(self, tmpdir, temporary_store, monkeypatch):
|
||||
@@ -1752,7 +1743,7 @@ def test_reuse_with_unknown_package_dont_raise(self, tmpdir, temporary_store, mo
|
||||
repos.repos[0]._pkg_checker.invalidate()
|
||||
with spack.config.override("concretizer:reuse", True):
|
||||
s = spack.concretize.concretize_one("pkg-c")
|
||||
assert s.namespace == "builtin.mock"
|
||||
assert s.namespace == "builtin_mock"
|
||||
|
||||
@pytest.mark.parametrize(
|
||||
"specs,checks",
|
||||
@@ -2019,7 +2010,7 @@ def test_installed_specs_disregard_conflicts(self, mutable_database, monkeypatch
|
||||
def test_require_targets_are_allowed(self, mutable_config, mutable_database):
|
||||
"""Test that users can set target constraints under the require attribute."""
|
||||
# Configuration to be added to packages.yaml
|
||||
required_target = archspec.cpu.TARGETS[spack.platforms.test.Test.default].family
|
||||
required_target = _vendoring.archspec.cpu.TARGETS[spack.platforms.test.Test.default].family
|
||||
external_conf = {"all": {"require": f"target={required_target}"}}
|
||||
mutable_config.set("packages", external_conf)
|
||||
|
||||
@@ -2329,10 +2320,10 @@ def test_reuse_python_from_cli_and_extension_from_db(self, mutable_database):
|
||||
"spec_str,expected_namespaces",
|
||||
[
|
||||
# Single node with fully qualified namespace
|
||||
("builtin.mock.gmake", {"gmake": "builtin.mock"}),
|
||||
("builtin_mock.gmake", {"gmake": "builtin_mock"}),
|
||||
# Dependency with fully qualified namespace
|
||||
("hdf5 ^builtin.mock.gmake", {"gmake": "builtin.mock", "hdf5": "duplicates.test"}),
|
||||
("hdf5 ^gmake", {"gmake": "duplicates.test", "hdf5": "duplicates.test"}),
|
||||
("hdf5 ^builtin_mock.gmake", {"gmake": "builtin_mock", "hdf5": "duplicates_test"}),
|
||||
("hdf5 ^gmake", {"gmake": "duplicates_test", "hdf5": "duplicates_test"}),
|
||||
],
|
||||
)
|
||||
def test_select_lower_priority_package_from_repository_stack(
|
||||
@@ -2341,8 +2332,10 @@ def test_select_lower_priority_package_from_repository_stack(
|
||||
"""Tests that a user can explicitly select a lower priority, fully qualified dependency
|
||||
from cli.
|
||||
"""
|
||||
# 'builtin.mock" and "duplicates.test" share a 'gmake' package
|
||||
additional_repo = os.path.join(spack.paths.test_repos_path, "duplicates.test")
|
||||
# 'builtin_mock" and "duplicates_test" share a 'gmake' package
|
||||
additional_repo = os.path.join(
|
||||
spack.paths.test_repos_path, "spack_repo", "duplicates_test"
|
||||
)
|
||||
with spack.repo.use_repositories(additional_repo, override=False):
|
||||
s = spack.concretize.concretize_one(spec_str)
|
||||
|
||||
@@ -2586,7 +2579,7 @@ def test_correct_external_is_selected_from_packages_yaml(self, mutable_config):
|
||||
|
||||
@pytest.fixture()
|
||||
def duplicates_test_repository():
|
||||
repository_path = os.path.join(spack.paths.test_repos_path, "duplicates.test")
|
||||
repository_path = os.path.join(spack.paths.test_repos_path, "spack_repo", "duplicates_test")
|
||||
with spack.repo.use_repositories(repository_path) as mock_repo:
|
||||
yield mock_repo
|
||||
|
||||
@@ -2821,7 +2814,7 @@ def test_adding_specs(self, input_specs, default_mock_concretization):
|
||||
|
||||
@pytest.fixture()
|
||||
def edges_test_repository():
|
||||
repository_path = os.path.join(spack.paths.test_repos_path, "edges.test")
|
||||
repository_path = os.path.join(spack.paths.test_repos_path, "spack_repo", "edges_test")
|
||||
with spack.repo.use_repositories(repository_path) as mock_repo:
|
||||
yield mock_repo
|
||||
|
||||
|
@@ -46,7 +46,7 @@
|
||||
|
||||
@pytest.fixture
|
||||
def test_repo(mutable_config, monkeypatch, mock_stage):
|
||||
repo_dir = pathlib.Path(spack.paths.test_repos_path) / "flags.test"
|
||||
repo_dir = pathlib.Path(spack.paths.test_repos_path) / "spack_repo" / "flags_test"
|
||||
with spack.repo.use_repositories(str(repo_dir)) as mock_repo_path:
|
||||
yield mock_repo_path
|
||||
|
||||
|
@@ -28,7 +28,7 @@ def update_packages_config(conf_str):
|
||||
|
||||
@pytest.fixture
|
||||
def test_repo(mutable_config, monkeypatch, mock_stage):
|
||||
repo_dir = pathlib.Path(spack.paths.test_repos_path) / "requirements.test"
|
||||
repo_dir = pathlib.Path(spack.paths.test_repos_path) / "spack_repo" / "requirements_test"
|
||||
with spack.repo.use_repositories(str(repo_dir)) as mock_repo_path:
|
||||
yield mock_repo_path
|
||||
|
||||
@@ -766,21 +766,21 @@ def test_skip_requirement_when_default_requirement_condition_cannot_be_met(
|
||||
|
||||
def test_requires_directive(mock_packages, config):
|
||||
# This package requires either clang or gcc
|
||||
s = spack.concretize.concretize_one("requires_clang_or_gcc")
|
||||
s = spack.concretize.concretize_one("requires-clang-or-gcc")
|
||||
assert s.satisfies("%gcc")
|
||||
s = spack.concretize.concretize_one("requires_clang_or_gcc %gcc")
|
||||
s = spack.concretize.concretize_one("requires-clang-or-gcc %gcc")
|
||||
assert s.satisfies("%gcc")
|
||||
s = spack.concretize.concretize_one("requires_clang_or_gcc %clang")
|
||||
s = spack.concretize.concretize_one("requires-clang-or-gcc %clang")
|
||||
# Test both the real package (llvm) and its alias (clang)
|
||||
assert s.satisfies("%llvm") and s.satisfies("%clang")
|
||||
|
||||
# This package can only be compiled with clang
|
||||
s = spack.concretize.concretize_one("requires_clang")
|
||||
s = spack.concretize.concretize_one("requires-clang")
|
||||
assert s.satisfies("%llvm")
|
||||
s = spack.concretize.concretize_one("requires_clang %clang")
|
||||
s = spack.concretize.concretize_one("requires-clang %clang")
|
||||
assert s.satisfies("%llvm")
|
||||
with pytest.raises(spack.error.SpackError, match="can only be compiled with Clang"):
|
||||
spack.concretize.concretize_one("requires_clang %gcc")
|
||||
spack.concretize.concretize_one("requires-clang %gcc")
|
||||
|
||||
|
||||
@pytest.mark.parametrize(
|
||||
|
@@ -20,13 +20,12 @@
|
||||
import tempfile
|
||||
import xml.etree.ElementTree
|
||||
|
||||
import _vendoring.archspec.cpu
|
||||
import _vendoring.archspec.cpu.microarchitecture
|
||||
import _vendoring.archspec.cpu.schema
|
||||
import py
|
||||
import pytest
|
||||
|
||||
import archspec.cpu
|
||||
import archspec.cpu.microarchitecture
|
||||
import archspec.cpu.schema
|
||||
|
||||
import llnl.util.lang
|
||||
import llnl.util.lock
|
||||
import llnl.util.tty as tty
|
||||
@@ -372,12 +371,12 @@ def clean_test_environment():
|
||||
def _host():
|
||||
"""Mock archspec host so there is no inconsistency on the Windows platform
|
||||
This function cannot be local as it needs to be pickleable"""
|
||||
return archspec.cpu.Microarchitecture("x86_64", [], "generic", [], {}, 0)
|
||||
return _vendoring.archspec.cpu.Microarchitecture("x86_64", [], "generic", [], {}, 0)
|
||||
|
||||
|
||||
@pytest.fixture(scope="function")
|
||||
def archspec_host_is_spack_test_host(monkeypatch):
|
||||
monkeypatch.setattr(archspec.cpu, "host", _host)
|
||||
monkeypatch.setattr(_vendoring.archspec.cpu, "host", _host)
|
||||
|
||||
|
||||
# Hooks to add command line options or set other custom behaviors.
|
||||
@@ -654,7 +653,7 @@ def mock_pkg_install(monkeypatch):
|
||||
|
||||
@pytest.fixture(scope="function")
|
||||
def mock_packages(mock_repo_path, mock_pkg_install, request):
|
||||
"""Use the 'builtin.mock' repository instead of 'builtin'"""
|
||||
"""Use the 'builtin_mock' repository instead of 'builtin'"""
|
||||
ensure_configuration_fixture_run_before(request)
|
||||
with spack.repo.use_repositories(mock_repo_path) as mock_repo:
|
||||
yield mock_repo
|
||||
@@ -728,14 +727,14 @@ def mock_uarch_json(tmpdir_factory):
|
||||
|
||||
@pytest.fixture(scope="session")
|
||||
def mock_uarch_configuration(mock_uarch_json):
|
||||
"""Create mock dictionaries for the archspec.cpu."""
|
||||
"""Create mock dictionaries for the _vendoring.archspec.cpu."""
|
||||
|
||||
def load_json():
|
||||
with open(mock_uarch_json, encoding="utf-8") as f:
|
||||
return json.load(f)
|
||||
|
||||
targets_json = load_json()
|
||||
targets = archspec.cpu.microarchitecture._known_microarchitectures()
|
||||
targets = _vendoring.archspec.cpu.microarchitecture._known_microarchitectures()
|
||||
|
||||
yield targets_json, targets
|
||||
|
||||
@@ -744,8 +743,8 @@ def load_json():
|
||||
def mock_targets(mock_uarch_configuration, monkeypatch):
|
||||
"""Use this fixture to enable mock uarch targets for testing."""
|
||||
targets_json, targets = mock_uarch_configuration
|
||||
monkeypatch.setattr(archspec.cpu.schema, "TARGETS_JSON", targets_json)
|
||||
monkeypatch.setattr(archspec.cpu.microarchitecture, "TARGETS", targets)
|
||||
monkeypatch.setattr(_vendoring.archspec.cpu.schema, "TARGETS_JSON", targets_json)
|
||||
monkeypatch.setattr(_vendoring.archspec.cpu.microarchitecture, "TARGETS", targets)
|
||||
|
||||
|
||||
@pytest.fixture(scope="session")
|
||||
@@ -773,7 +772,7 @@ def configuration_dir(tmpdir_factory, linux_os):
|
||||
config_template = test_config / "config.yaml"
|
||||
config.write(config_template.read_text().format(install_tree_root, locks))
|
||||
|
||||
target = str(archspec.cpu.host().family)
|
||||
target = str(_vendoring.archspec.cpu.host().family)
|
||||
compilers = tmpdir.join("site", "packages.yaml")
|
||||
compilers_template = test_config / "packages.yaml"
|
||||
compilers.write(compilers_template.read_text().format(linux_os=linux_os, target=target))
|
||||
@@ -1434,7 +1433,7 @@ def mock_git_repository(git, tmpdir_factory):
|
||||
of these refers to a repository with a single commit.
|
||||
|
||||
c0, c1, and c2 include information to define explicit versions in the
|
||||
associated builtin.mock package 'git-test'. c3 is a commit in the
|
||||
associated builtin_mock package 'git-test'. c3 is a commit in the
|
||||
repository but does not have an associated explicit package version.
|
||||
"""
|
||||
suburls = []
|
||||
@@ -2100,35 +2099,6 @@ def mock_modules_root(tmp_path, monkeypatch):
|
||||
monkeypatch.setattr(spack.modules.common, "root_path", fn)
|
||||
|
||||
|
||||
_repo_name_id = 0
|
||||
|
||||
|
||||
def create_test_repo(tmpdir, pkg_name_content_tuples):
|
||||
global _repo_name_id
|
||||
|
||||
repo_path = str(tmpdir)
|
||||
repo_yaml = tmpdir.join("repo.yaml")
|
||||
with open(str(repo_yaml), "w", encoding="utf-8") as f:
|
||||
f.write(
|
||||
f"""\
|
||||
repo:
|
||||
namespace: testrepo{str(_repo_name_id)}
|
||||
"""
|
||||
)
|
||||
|
||||
_repo_name_id += 1
|
||||
|
||||
packages_dir = tmpdir.join("packages")
|
||||
for pkg_name, pkg_str in pkg_name_content_tuples:
|
||||
pkg_dir = packages_dir.ensure(pkg_name, dir=True)
|
||||
pkg_file = pkg_dir.join("package.py")
|
||||
with open(str(pkg_file), "w", encoding="utf-8") as f:
|
||||
f.write(pkg_str)
|
||||
|
||||
repo_cache = spack.util.file_cache.FileCache(str(tmpdir.join("cache")))
|
||||
return spack.repo.Repo(repo_path, cache=repo_cache)
|
||||
|
||||
|
||||
@pytest.fixture()
|
||||
def compiler_factory():
|
||||
"""Factory for a compiler dict, taking a spec and an OS as arguments."""
|
||||
@@ -2146,7 +2116,7 @@ def _factory(*, spec):
|
||||
@pytest.fixture()
|
||||
def host_architecture_str():
|
||||
"""Returns the broad architecture family (x86_64, aarch64, etc.)"""
|
||||
return str(archspec.cpu.host().family)
|
||||
return str(_vendoring.archspec.cpu.host().family)
|
||||
|
||||
|
||||
def _true(x):
|
||||
|
@@ -11,10 +11,9 @@
|
||||
import json
|
||||
import os
|
||||
|
||||
import _vendoring.archspec.cpu
|
||||
import pytest
|
||||
|
||||
import archspec.cpu
|
||||
|
||||
import spack
|
||||
import spack.cmd
|
||||
import spack.cmd.external
|
||||
@@ -104,7 +103,7 @@ def spec_json(self):
|
||||
|
||||
@pytest.fixture
|
||||
def _common_arch(test_platform):
|
||||
generic = archspec.cpu.TARGETS[test_platform.default].family
|
||||
generic = _vendoring.archspec.cpu.TARGETS[test_platform.default].family
|
||||
return JsonArchEntry(platform=test_platform.name, os="redhat6", target=generic.name)
|
||||
|
||||
|
||||
|
@@ -2,10 +2,11 @@
|
||||
#
|
||||
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
|
||||
|
||||
from spack.package_base import PackageBase
|
||||
from spack.package import *
|
||||
|
||||
|
||||
class DiffTest(AutotoolsPackage):
|
||||
class DiffTest(PackageBase):
|
||||
"""zlib replacement with optimizations for next generation systems."""
|
||||
|
||||
homepage = "https://github.com/zlib-ng/zlib-ng"
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user