diff --git a/.coveragerc b/.coveragerc deleted file mode 100644 index 94d38d7a2e5..00000000000 --- a/.coveragerc +++ /dev/null @@ -1,38 +0,0 @@ -# -*- conf -*- -# .coveragerc to control coverage.py -[run] -parallel = True -concurrency = multiprocessing -branch = True -source = - bin - lib -omit = - lib/spack/spack/test/* - lib/spack/docs/* - lib/spack/external/* - share/spack/qa/* - -[report] -# Regexes for lines to exclude from consideration -exclude_lines = - # Have to re-enable the standard pragma - pragma: no cover - - # Don't complain about missing debug-only code: - def __repr__ - if self\.debug - - # Don't complain if tests don't hit defensive assertion code: - raise AssertionError - raise NotImplementedError - - # Don't complain if non-runnable code isn't run: - if 0: - if False: - if __name__ == .__main__.: - -ignore_errors = True - -[html] -directory = htmlcov diff --git a/.github/workflows/unit_tests.yaml b/.github/workflows/unit_tests.yaml index 365716c02a3..32b1baf39a5 100644 --- a/.github/workflows/unit_tests.yaml +++ b/.github/workflows/unit_tests.yaml @@ -39,7 +39,7 @@ jobs: python-version: 3.9 - name: Install Python packages run: | - pip install --upgrade pip six setuptools flake8 isort>=4.3.5 mypy>=0.800 black types-six + pip install --upgrade pip six setuptools types-six - name: Setup git configuration run: | # Need this for the git tests to succeed. @@ -130,14 +130,19 @@ jobs: sudo apt-get -y update # Needed for unit tests sudo apt-get -y install \ - coreutils cvs gfortran graphviz gnupg2 mercurial ninja-build \ + coreutils cvs gfortran graphviz gnupg2 mercurial ninja-build \ patchelf # Needed for kcov sudo apt-get -y install cmake binutils-dev libcurl4-openssl-dev sudo apt-get -y install zlib1g-dev libdw-dev libiberty-dev - name: Install Python packages run: | - pip install --upgrade pip six setuptools codecov coverage + pip install --upgrade pip six setuptools codecov coverage[toml] + # ensure style checks are not skipped in unit tests for python >= 3.6 + # note that true/false (i.e., 1/0) are opposite in conditions in python and bash + if python -c 'import sys; sys.exit(not sys.version_info >= (3, 6))'; then + pip install --upgrade flake8 isort>=4.3.5 mypy>=0.900 black + fi - name: Setup git configuration run: | # Need this for the git tests to succeed. @@ -180,7 +185,7 @@ jobs: SPACK_TEST_SOLVER: ${{ matrix.concretizer }} run: | share/spack/qa/run-unit-tests - - uses: codecov/codecov-action@v1 + - uses: codecov/codecov-action@v2.0.2 if: ${{ needs.changes.outputs.with_coverage == 'true' }} with: flags: unittests,linux,${{ matrix.concretizer }} @@ -205,7 +210,7 @@ jobs: sudo apt-get -y install zlib1g-dev libdw-dev libiberty-dev - name: Install Python packages run: | - pip install --upgrade pip six setuptools codecov coverage + pip install --upgrade pip six setuptools codecov coverage[toml] - name: Setup git configuration run: | # Need this for the git tests to succeed. @@ -232,7 +237,7 @@ jobs: COVERAGE: true run: | share/spack/qa/run-shell-tests - - uses: codecov/codecov-action@v1 + - uses: codecov/codecov-action@v2.0.2 if: ${{ needs.changes.outputs.with_coverage == 'true' }} with: flags: shelltests,linux @@ -326,7 +331,7 @@ jobs: make -C ${KCOV_ROOT}/build && sudo make -C ${KCOV_ROOT}/build install - name: Install Python packages run: | - pip install --upgrade pip six setuptools codecov coverage clingo + pip install --upgrade pip six setuptools codecov coverage[toml] clingo - name: Setup git configuration run: | # Need this for the git tests to succeed. @@ -348,7 +353,7 @@ jobs: SPACK_TEST_SOLVER: clingo run: | share/spack/qa/run-unit-tests - - uses: codecov/codecov-action@v1 + - uses: codecov/codecov-action@v2.0.2 if: ${{ needs.changes.outputs.with_coverage == 'true' }} with: flags: unittests,linux,clingo @@ -369,8 +374,7 @@ jobs: - name: Install Python packages run: | pip install --upgrade pip six setuptools - pip install --upgrade codecov coverage - pip install --upgrade flake8 isort>=4.3.5 mypy>=0.800 + pip install --upgrade codecov coverage[toml] - name: Setup Homebrew packages run: | brew install dash fish gcc gnupg2 kcov @@ -384,12 +388,15 @@ jobs: coverage run $(which spack) unit-test -x coverage combine coverage xml + # Delete the symlink going from ./lib/spack/docs/_spack_root back to + # the initial directory, since it causes ELOOP errors with codecov/actions@2 + rm lib/spack/docs/_spack_root else echo "ONLY PACKAGE RECIPES CHANGED [skipping coverage]" $(which spack) unit-test -x -m "not maybeslow" -k "package_sanity" fi - - uses: codecov/codecov-action@v1 + - uses: codecov/codecov-action@v2.0.2 if: ${{ needs.changes.outputs.with_coverage == 'true' }} with: - file: ./coverage.xml + files: ./coverage.xml flags: unittests,macos diff --git a/.mypy.ini b/.mypy.ini deleted file mode 100644 index 4257b1bd3fb..00000000000 --- a/.mypy.ini +++ /dev/null @@ -1,35 +0,0 @@ -[mypy] -python_version = 3.7 -files=lib/spack/llnl/**/*.py,lib/spack/spack/**/*.py -mypy_path=bin,lib/spack,lib/spack/external,var/spack/repos/builtin -# This and a generated import file allows supporting packages -namespace_packages=True -# To avoid re-factoring all the externals, ignore errors and missing imports -# globally, then turn back on in spack and spack submodules -ignore_errors=True -ignore_missing_imports=True - -[mypy-spack.*] -ignore_errors=False -ignore_missing_imports=False - -[mypy-packages.*] -ignore_errors=False -ignore_missing_imports=False - -[mypy-llnl.*] -ignore_errors=False -ignore_missing_imports=False - -[mypy-spack.test.packages] -ignore_errors=True - -# ignore errors in fake import path for packages -[mypy-spack.pkg.*] -ignore_errors=True -ignore_missing_imports=True - -# jinja has syntax in it that requires python3 and causes a parse error -# skip importing it -[mypy-jinja2] -follow_imports=skip diff --git a/README.md b/README.md index dcf9f0dcea0..964637da168 100644 --- a/README.md +++ b/README.md @@ -36,6 +36,8 @@ Documentation [**Full documentation**](https://spack.readthedocs.io/) is available, or run `spack help` or `spack help --all`. +For a cheat sheet on Spack syntax, run `spack help --spec`. + Tutorial ---------------- diff --git a/etc/spack/defaults/bootstrap.yaml b/etc/spack/defaults/bootstrap.yaml new file mode 100644 index 00000000000..78bb43f4b17 --- /dev/null +++ b/etc/spack/defaults/bootstrap.yaml @@ -0,0 +1,7 @@ +bootstrap: + # If set to false Spack will not bootstrap missing software, + # but will instead raise an error. + enable: true + # Root directory for bootstrapping work. The software bootstrapped + # by Spack is installed in a "store" subfolder of this root directory + root: ~/.spack/bootstrap diff --git a/etc/spack/defaults/packages.yaml b/etc/spack/defaults/packages.yaml index 0a5e00ce088..aeed54fd085 100644 --- a/etc/spack/defaults/packages.yaml +++ b/etc/spack/defaults/packages.yaml @@ -43,6 +43,7 @@ packages: opencl: [pocl] onedal: [intel-oneapi-dal] osmesa: [mesa+osmesa, mesa18+osmesa] + pbs: [openpbs, torque] pil: [py-pillow] pkgconfig: [pkgconf, pkg-config] rpc: [libtirpc] diff --git a/lib/spack/docs/Makefile b/lib/spack/docs/Makefile index 1a8c13e8fb4..d86faa6ad46 100644 --- a/lib/spack/docs/Makefile +++ b/lib/spack/docs/Makefile @@ -2,7 +2,7 @@ # # You can set these variables from the command line. -SPHINXOPTS = -W +SPHINXOPTS = -W --keep-going SPHINXBUILD = sphinx-build PAPER = BUILDDIR = _build diff --git a/lib/spack/docs/build_systems/cmakepackage.rst b/lib/spack/docs/build_systems/cmakepackage.rst index a3282514e87..3c3c96f92c2 100644 --- a/lib/spack/docs/build_systems/cmakepackage.rst +++ b/lib/spack/docs/build_systems/cmakepackage.rst @@ -130,8 +130,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 :py:meth:`~.CMakePackage.define` and -:py:meth:`~.CMakePackage.define_from_variant` helper functions: +and without the :meth:`~spack.build_systems.cmake.CMakePackage.define` and +:meth:`~spack.build_systems.cmake.CMakePackage.define_from_variant` helper functions: .. code-block:: python diff --git a/lib/spack/docs/conf.py b/lib/spack/docs/conf.py index 38d75747e36..5e2795cf49c 100644 --- a/lib/spack/docs/conf.py +++ b/lib/spack/docs/conf.py @@ -97,15 +97,18 @@ def setup(sphinx): # -- General configuration ----------------------------------------------------- # If your documentation needs a minimal Sphinx version, state it here. -needs_sphinx = '1.8' +needs_sphinx = '3.4' # Add any Sphinx extension module names here, as strings. They can be extensions # coming with Sphinx (named 'sphinx.ext.*') or your custom ones. -extensions = ['sphinx.ext.autodoc', - 'sphinx.ext.graphviz', - 'sphinx.ext.napoleon', - 'sphinx.ext.todo', - 'sphinxcontrib.programoutput'] +extensions = [ + 'sphinx.ext.autodoc', + 'sphinx.ext.graphviz', + 'sphinx.ext.intersphinx', + 'sphinx.ext.napoleon', + 'sphinx.ext.todo', + 'sphinxcontrib.programoutput', +] # Set default graphviz options graphviz_dot_args = [ @@ -164,6 +167,19 @@ def setup(sphinx): # directories to ignore when looking for source files. exclude_patterns = ['_build', '_spack_root', '.spack-env'] +nitpicky = True +nitpick_ignore = [ + # Python classes that intersphinx is unable to resolve + ('py:class', 'argparse.HelpFormatter'), + ('py:class', 'contextlib.contextmanager'), + ('py:class', 'module'), + ('py:class', '_io.BufferedReader'), + ('py:class', 'unittest.case.TestCase'), + ('py:class', '_frozen_importlib_external.SourceFileLoader'), + # Spack classes that are private and we don't want to expose + ('py:class', 'spack.provider_index._IndexBase'), +] + # The reST default role (used for this markup: `text`) to use for all documents. #default_role = None @@ -358,3 +374,11 @@ class SpackStyle(DefaultStyle): # How to display URL addresses: 'footnote', 'no', or 'inline'. #texinfo_show_urls = 'footnote' + + +# -- Extension configuration ------------------------------------------------- + +# sphinx.ext.intersphinx +intersphinx_mapping = { + "python": ("https://docs.python.org/3", None), +} diff --git a/lib/spack/docs/developer_guide.rst b/lib/spack/docs/developer_guide.rst index 0ceb5d84a14..71aac1fd93f 100644 --- a/lib/spack/docs/developer_guide.rst +++ b/lib/spack/docs/developer_guide.rst @@ -108,9 +108,9 @@ with a high level view of Spack's directory structure: spack/ <- spack module; contains Python code analyzers/ <- modules to run analysis on installed packages - build_systems/ <- modules for different build systems + build_systems/ <- modules for different build systems cmd/ <- each file in here is a spack subcommand - compilers/ <- compiler description files + compilers/ <- compiler description files container/ <- module for spack containerize hooks/ <- hook modules to run at different points modules/ <- modules for lmod, tcl, etc. @@ -151,24 +151,22 @@ Package-related modules ^^^^^^^^^^^^^^^^^^^^^^^ :mod:`spack.package` - Contains the :class:`Package ` class, which + Contains the :class:`~spack.package.Package` class, which is the superclass for all packages in Spack. Methods on ``Package`` implement all phases of the :ref:`package lifecycle ` and manage the build process. -:mod:`spack.packages` - Contains all of the packages in Spack and methods for managing them. - Functions like :func:`packages.get ` and - :func:`class_name_for_package_name - ` handle mapping package module - names to class names and dynamically instantiating packages by name - from module files. +:mod:`spack.util.naming` + Contains functions for mapping between Spack package names, + Python module names, and Python class names. Functions like + :func:`~spack.util.naming.mod_to_class` handle mapping package + module names to class names. -:mod:`spack.relations` - *Relations* are relationships between packages, like - :func:`depends_on ` and :func:`provides - `. See :ref:`dependencies` and - :ref:`virtual-dependencies`. +:mod:`spack.directives` + *Directives* are functions that can be called inside a package definition + to modify the package, like :func:`~spack.directives.depends_on` + and :func:`~spack.directives.provides`. See :ref:`dependencies` + and :ref:`virtual-dependencies`. :mod:`spack.multimethod` Implementation of the :func:`@when ` @@ -180,31 +178,27 @@ Spec-related modules ^^^^^^^^^^^^^^^^^^^^ :mod:`spack.spec` - Contains :class:`Spec ` and :class:`SpecParser - `. Also implements most of the logic for - normalization and concretization of specs. + Contains :class:`~spack.spec.Spec` and :class:`~spack.spec.SpecParser`. + Also implements most of the logic for normalization and concretization + of specs. :mod:`spack.parse` Contains some base classes for implementing simple recursive descent - parsers: :class:`Parser ` and :class:`Lexer - `. Used by :class:`SpecParser - `. + parsers: :class:`~spack.parse.Parser` and :class:`~spack.parse.Lexer`. + Used by :class:`~spack.spec.SpecParser`. :mod:`spack.concretize` - Contains :class:`DefaultConcretizer - ` implementation, which allows - site administrators to change Spack's :ref:`concretization-policies`. + Contains :class:`~spack.concretize.Concretizer` implementation, + which allows site administrators to change Spack's :ref:`concretization-policies`. :mod:`spack.version` - Implements a simple :class:`Version ` class - with simple comparison semantics. Also implements - :class:`VersionRange ` and - :class:`VersionList `. All three are - comparable with each other and offer union and intersection - operations. Spack uses these classes to compare versions and to - manage version constraints on specs. Comparison semantics are - similar to the ``LooseVersion`` class in ``distutils`` and to the - way RPM compares version strings. + Implements a simple :class:`~spack.version.Version` class with simple + comparison semantics. Also implements :class:`~spack.version.VersionRange` + and :class:`~spack.version.VersionList`. All three are comparable with each + other and offer union and intersection operations. Spack uses these classes + to compare versions and to manage version constraints on specs. Comparison + semantics are similar to the ``LooseVersion`` class in ``distutils`` and to + the way RPM compares version strings. :mod:`spack.compilers` Submodules contains descriptors for all valid compilers in Spack. @@ -232,7 +226,7 @@ Build environment :mod:`spack.stage` Handles creating temporary directories for builds. -:mod:`spack.compilation` +:mod:`spack.build_environment` This contains utility functions used by the compiler wrapper script, ``cc``. @@ -257,22 +251,19 @@ Unit tests Implements Spack's test suite. Add a module and put its name in the test suite in ``__init__.py`` to add more unit tests. -:mod:`spack.test.mock_packages` - This is a fake package hierarchy used to mock up packages for - Spack's test suite. - ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Research and Monitoring Modules ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ :mod:`spack.monitor` - Contains :class:`SpackMonitor `. This is accessed - from the ``spack install`` and ``spack analyze`` commands to send build - and package metadada up to a `Spack Monitor `_ server. + Contains :class:`~spack.monitor.SpackMonitorClient`. This is accessed from + the ``spack install`` and ``spack analyze`` commands to send build and + package metadata up to a `Spack Monitor + `_ server. :mod:`spack.analyzers` - A module folder with a :class:`AnalyzerBase ` + A module folder with a :class:`~spack.analyzers.analyzer_base.AnalyzerBase` that provides base functions to run, save, and (optionally) upload analysis results to a `Spack Monitor `_ server. @@ -286,7 +277,7 @@ Other Modules tarball URLs. :mod:`spack.error` - :class:`SpackError `, the base class for + :class:`~spack.error.SpackError`, the base class for Spack's exception hierarchy. :mod:`llnl.util.tty` @@ -335,8 +326,8 @@ Writing analyzers To write an analyzer, you should add a new python file to the analyzers module directory at ``lib/spack/spack/analyzers`` . Your analyzer should be a subclass of the :class:`AnalyzerBase `. For example, if you want -to add an analyzer class ``Myanalyzer`` you woul write to -``spack/analyzers/myanalyzer.py`` and import and +to add an analyzer class ``Myanalyzer`` you would write to +``spack/analyzers/myanalyzer.py`` and import and use the base as follows: .. code-block:: python @@ -347,7 +338,7 @@ use the base as follows: Note that the class name is your module file name, all lowercase -except for the first capital letter. You can look at other analyzers in +except for the first capital letter. You can look at other analyzers in that analyzer directory for examples. The guide here will tell you about the basic functions needed. ^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -356,13 +347,13 @@ Analyzer Output Directory By default, when you run ``spack analyze run`` an analyzer output directory will be created in your spack user directory in your ``$HOME``. The reason we output here -is because the install directory might not always be writable. +is because the install directory might not always be writable. .. code-block:: console ~/.spack/ analyzers - + Result files will be written here, organized in subfolders in the same structure as the package, with each analyzer owning it's own subfolder. for example: @@ -380,11 +371,11 @@ as the package, with each analyzer owning it's own subfolder. for example: │   └── spack-analyzer-install-files.json └── libabigail └── lib - └── spack-analyzer-libabigail-libz.so.1.2.11.xml + └── spack-analyzer-libabigail-libz.so.1.2.11.xml Notice that for the libabigail analyzer, since results are generated per object, -we honor the object's folder in case there are equivalently named files in +we honor the object's folder in case there are equivalently named files in different folders. The result files are typically written as json so they can be easily read and uploaded in a future interaction with a monitor. @@ -426,7 +417,7 @@ and then return the object with a key as the analyzer name. The result data should be a list of objects, each with a name, ``analyzer_name``, ``install_file``, and one of ``value`` or ``binary_value``. The install file should be for a relative path, and not the absolute path. For example, let's say we extract a metric called -``metric`` for ``bin/wget`` using our analyzer ``thebest-analyzer``. +``metric`` for ``bin/wget`` using our analyzer ``thebest-analyzer``. We might have data that looks like this: .. code-block:: python @@ -482,7 +473,7 @@ Saving Analyzer Results The analyzer will have ``save_result`` called, with the result object generated to save it to the filesystem, and if the user has added the ``--monitor`` flag to upload it to a monitor server. If your result follows an accepted result -format and you don't need to parse it further, you don't need to add this +format and you don't need to parse it further, you don't need to add this function to your class. However, if your result data is large or otherwise needs additional parsing, you can define it. If you define the function, it is useful to know about the ``output_dir`` property, which you can join @@ -548,7 +539,7 @@ each one (separately) to the monitor: Notice that this function, if you define it, requires a result object (generated by ``run()``, a monitor (if you want to send), and a boolean ``overwrite`` to be used -to check if a result exists first, and not write to it if the result exists and +to check if a result exists first, and not write to it if the result exists and overwrite is False. Also notice that since we already saved these files to the analyzer metadata folder, we return early if a monitor isn't defined, because this function serves to send results to the monitor. If you haven't saved anything to the analyzer metadata folder yet, you might want to do that here. You should also use ``tty.info`` to give the user a message of "Writing result to $DIRNAME." @@ -616,7 +607,7 @@ types of hooks in the ``__init__.py``, and then python files in that folder can use hook functions. The files are automatically parsed, so if you write a new file for some integration (e.g., ``lib/spack/spack/hooks/myintegration.py`` you can then write hook functions in that file that will be automatically detected, -and run whenever your hook is called. This section will cover the basic kind +and run whenever your hook is called. This section will cover the basic kind of hooks, and how to write them. ^^^^^^^^^^^^^^ @@ -624,7 +615,7 @@ Types of Hooks ^^^^^^^^^^^^^^ The following hooks are currently implemented to make it easy for you, -the developer, to add hooks at different stages of a spack install or similar. +the developer, to add hooks at different stages of a spack install or similar. If there is a hook that you would like and is missing, you can propose to add a new one. """"""""""""""""""""" @@ -632,9 +623,9 @@ If there is a hook that you would like and is missing, you can propose to add a """"""""""""""""""""" A ``pre_install`` hook is run within an install subprocess, directly before -the install starts. It expects a single argument of a spec, and is run in +the install starts. It expects a single argument of a spec, and is run in a multiprocessing subprocess. Note that if you see ``pre_install`` functions associated with packages these are not hooks -as we have defined them here, but rather callback functions associated with +as we have defined them here, but rather callback functions associated with a package install. @@ -657,7 +648,7 @@ here. This hook is run at the beginning of ``lib/spack/spack/installer.py``, in the install function of a ``PackageInstaller``, and importantly is not part of a build process, but before it. This is when -we have just newly grabbed the task, and are preparing to install. If you +we have just newly grabbed the task, and are preparing to install. If you write a hook of this type, you should provide the spec to it. .. code-block:: python @@ -666,7 +657,7 @@ write a hook of this type, you should provide the spec to it. """On start of an install, we want to... """ print('on_install_start') - + """""""""""""""""""""""""""" ``on_install_success(spec)`` @@ -744,8 +735,8 @@ to trigger after anything is written to a logger. You would add it as follows: post_install = HookRunner('post_install') # hooks related to logging - post_log_write = HookRunner('post_log_write') # <- here is my new hook! - + post_log_write = HookRunner('post_log_write') # <- here is my new hook! + You then need to decide what arguments my hook would expect. Since this is related to logging, let's say that you want a message and level. That means @@ -775,7 +766,7 @@ In this example, we use it outside of a logger that is already defined: This is not to say that this would be the best way to implement an integration with the logger (you'd probably want to write a custom logger, or you could -have the hook defined within the logger) but serves as an example of writing a hook. +have the hook defined within the logger) but serves as an example of writing a hook. ---------- Unit tests @@ -785,6 +776,38 @@ Unit tests Unit testing ------------ +--------------------- +Developer environment +--------------------- + +.. warning:: + + This is an experimental feature. It is expected to change and you should + not use it in a production environment. + + +When installing a package, we currently have support to export environment +variables to specify adding debug flags to the build. By default, a package +install will build without any debug flag. However, if you want to add them, +you can export: + +.. code-block:: console + + export SPACK_ADD_DEBUG_FLAGS=true + spack install zlib + + +If you want to add custom flags, you should export an additional variable: + +.. code-block:: console + + export SPACK_ADD_DEBUG_FLAGS=true + export SPACK_DEBUG_FLAGS="-g" + spack install zlib + +These environment variables will eventually be integrated into spack so +they are set from the command line. + ------------------ Developer commands ------------------ @@ -795,6 +818,29 @@ Developer commands ``spack doc`` ^^^^^^^^^^^^^ +.. _cmd-spack-style: + +^^^^^^^^^^^^^^^ +``spack style`` +^^^^^^^^^^^^^^^ + +spack style exists to help the developer user to check imports and style with +mypy, flake8, isort, and (soon) black. To run all style checks, simply do: + +.. code-block:: console + + $ spack style + +To run automatic fixes for isort you can do: + +.. code-block:: console + + $ spack style --fix + +You do not need any of these Python packages installed on your system for +the checks to work! Spack will bootstrap install them from packages for +your use. + ^^^^^^^^^^^^^^^^^^^ ``spack unit-test`` ^^^^^^^^^^^^^^^^^^^ @@ -873,7 +919,7 @@ just like you would with the normal ``python`` command. ^^^^^^^^^^^^^^^ Spack blame is a way to quickly see contributors to packages or files -in the spack repository. You should provide a target package name or +in the spack repository. You should provide a target package name or file name to the command. Here is an example asking to see contributions for the package "python": @@ -883,8 +929,8 @@ for the package "python": LAST_COMMIT LINES % AUTHOR EMAIL 2 weeks ago 3 0.3 Mickey Mouse a month ago 927 99.7 Minnie Mouse - - 2 weeks ago 930 100.0 + + 2 weeks ago 930 100.0 By default, you will get a table view (shown above) sorted by date of contribution, @@ -1255,7 +1301,7 @@ Publishing a release on GitHub #. Create the release in GitHub. - * Go to + * Go to `github.com/spack/spack/releases `_ and click ``Draft a new release``. diff --git a/lib/spack/docs/getting_started.rst b/lib/spack/docs/getting_started.rst index bd57e64f2bb..3d0e90d3ab7 100644 --- a/lib/spack/docs/getting_started.rst +++ b/lib/spack/docs/getting_started.rst @@ -777,7 +777,7 @@ an OpenMPI installed in /opt/local, one would use: buildable: False In general, Spack is easier to use and more reliable if it builds all of -its own dependencies. However, there are two packages for which one +its own dependencies. However, there are several packages for which one commonly needs to use system versions: ^^^ diff --git a/lib/spack/docs/packaging_guide.rst b/lib/spack/docs/packaging_guide.rst index 59dad4f966c..6616d2a331a 100644 --- a/lib/spack/docs/packaging_guide.rst +++ b/lib/spack/docs/packaging_guide.rst @@ -2884,52 +2884,52 @@ The package base class, usually specialized for a given build system, determines actual set of entities available for overriding. The classes that are currently provided by Spack are: - +-------------------------------+----------------------------------+ - | **Base Class** | **Purpose** | - +===============================+==================================+ - | :py:class:`.Package` | General base class not | - | | specialized for any build system | - +-------------------------------+----------------------------------+ - | :py:class:`.MakefilePackage` | Specialized class for packages | - | | built invoking | - | | hand-written Makefiles | - +-------------------------------+----------------------------------+ - | :py:class:`.AutotoolsPackage` | Specialized class for packages | - | | built using GNU Autotools | - +-------------------------------+----------------------------------+ - | :py:class:`.CMakePackage` | Specialized class for packages | - | | built using CMake | - +-------------------------------+----------------------------------+ - | :py:class:`.CudaPackage` | A helper class for packages that | - | | use CUDA | - +-------------------------------+----------------------------------+ - | :py:class:`.QMakePackage` | Specialized class for packages | - | | build using QMake | - +-------------------------------+----------------------------------+ - | :py:class:`.ROCmPackage` | A helper class for packages that | - | | use ROCm | - +-------------------------------+----------------------------------+ - | :py:class:`.SConsPackage` | Specialized class for packages | - | | built using SCons | - +-------------------------------+----------------------------------+ - | :py:class:`.WafPackage` | Specialized class for packages | - | | built using Waf | - +-------------------------------+----------------------------------+ - | :py:class:`.RPackage` | Specialized class for | - | | :py:class:`.R` extensions | - +-------------------------------+----------------------------------+ - | :py:class:`.OctavePackage` | Specialized class for | - | | :py:class:`.Octave` packages | - +-------------------------------+----------------------------------+ - | :py:class:`.PythonPackage` | Specialized class for | - | | :py:class:`.Python` extensions | - +-------------------------------+----------------------------------+ - | :py:class:`.PerlPackage` | Specialized class for | - | | :py:class:`.Perl` extensions | - +-------------------------------+----------------------------------+ - | :py:class:`.IntelPackage` | Specialized class for licensed | - | | Intel software | - +-------------------------------+----------------------------------+ ++-------------------------=--------------------------------+----------------------------------+ +| **Base Class** | **Purpose** | ++==========================================================+==================================+ +| :class:`~spack.package.Package` | General base class not | +| | specialized for any build system | ++----------------------------------------------------------+----------------------------------+ +| :class:`~spack.build_systems.makefile.MakefilePackage` | Specialized class for packages | +| | built invoking | +| | hand-written Makefiles | ++----------------------------------------------------------+----------------------------------+ +| :class:`~spack.build_systems.autotools.AutotoolsPackage` | Specialized class for packages | +| | built using GNU Autotools | ++----------------------------------------------------------+----------------------------------+ +| :class:`~spack.build_systems.cmake.CMakePackage` | Specialized class for packages | +| | built using CMake | ++----------------------------------------------------------+----------------------------------+ +| :class:`~spack.build_systems.cuda.CudaPackage` | A helper class for packages that | +| | use CUDA | ++----------------------------------------------------------+----------------------------------+ +| :class:`~spack.build_systems.qmake.QMakePackage` | Specialized class for packages | +| | built using QMake | ++----------------------------------------------------------+----------------------------------+ +| :class:`~spack.build_systems.rocm.ROCmPackage` | A helper class for packages that | +| | use ROCm | ++----------------------------------------------------------+----------------------------------+ +| :class:`~spack.build_systems.scons.SConsPackage` | Specialized class for packages | +| | built using SCons | ++----------------------------------------------------------+----------------------------------+ +| :class:`~spack.build_systems.waf.WafPackage` | Specialized class for packages | +| | built using Waf | ++----------------------------------------------------------+----------------------------------+ +| :class:`~spack.build_systems.r.RPackage` | Specialized class for | +| | R extensions | ++----------------------------------------------------------+----------------------------------+ +| :class:`~spack.build_systems.octave.OctavePackage` | Specialized class for | +| | Octave packages | ++----------------------------------------------------------+----------------------------------+ +| :class:`~spack.build_systems.python.PythonPackage` | Specialized class for | +| | Python extensions | ++----------------------------------------------------------+----------------------------------+ +| :class:`~spack.build_systems.perl.PerlPackage` | Specialized class for | +| | Perl extensions | ++----------------------------------------------------------+----------------------------------+ +| :class:`~spack.build_systems.intel.IntelPackage` | Specialized class for licensed | +| | Intel software | ++----------------------------------------------------------+----------------------------------+ .. note:: @@ -2939,7 +2939,7 @@ The classes that are currently provided 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 :py:class:`.CMakePackage`. + subclass from :class:`~spack.build_systems.cmake.CMakePackage`. ^^^^^^^^^^^^^^^^^^^^^ Installation pipeline @@ -4079,7 +4079,7 @@ prefix **before** ``make install``. Builds like this can falsely report success when an error occurs before the installation is complete. Simple sanity checks can be used to identify files and or directories that are required of a successful installation. Spack checks for the presence of -the files and directories after ``install()`` runs. +the files and directories after ``install()`` runs. If any of the listed files or directories are missing, then the build will fail and the install prefix will be removed. If they all exist, then Spack @@ -4193,7 +4193,7 @@ need to use two decorators for each phase test method: The first decorator tells Spack when in the installation process to run your test method installation process; namely *after* the provided installation phase. The second decorator tells Spack to only run the -checks when the ``--test`` option is provided on the command line. +checks when the ``--test`` option is provided on the command line. .. note:: @@ -4267,17 +4267,17 @@ tests can be performed days, even weeks, after the software is installed. Stand-alone tests are checks that should run relatively quickly -- as in on the order of at most a few minutes -- and ideally execute all -aspects of the installed software, or at least key functionality. +aspects of the installed software, or at least key functionality. .. note:: Execution speed is important because these tests are intended to quickly assess whether the installed software works on the system. - + Failing stand-alone tests indicate that there is no reason to proceed with more resource-intensive tests. - + Passing stand-alone (or smoke) tests can lead to more thorough testing, such as extensive unit or regression tests, or tests that run at scale. Spack support for more thorough testing is @@ -4307,7 +4307,7 @@ file such that: test_stage: /path/to/stage The package can access this path **during test processing** using -`self.test_suite.stage`. +`self.test_suite.stage`. .. note:: @@ -4388,7 +4388,7 @@ can be implemented as shown below. @run_after('install') def copy_test_sources(self): srcs = ['tests', - join_path('examples', 'foo.c'), + join_path('examples', 'foo.c'), join_path('examples', 'bar.c')] self.cache_extra_test_sources(srcs) @@ -4446,7 +4446,7 @@ Examples include: - expected test output These extra files should be added to the ``test`` subdirectory of the -package in the Spack repository. +package in the Spack repository. Spack will **automatically copy** the contents of that directory to the test staging directory for stand-alone testing. The ``test`` method can @@ -4471,7 +4471,7 @@ The signature for ``get_escaped_text_output`` is: where ``filename`` is the path to the file containing the expected output. -The ``filename`` for a :ref:`custom file ` can be +The ``filename`` for a :ref:`custom file ` can be accessed and used as illustrated by a simplified version of an ``sqlite`` package check: @@ -4591,10 +4591,10 @@ where each argument has the following meaning: Options are a list of strings to be passed to the executable when it runs. - + The default is ``[]``, which means no options are provided to the executable. - + * ``expected`` is an optional list of expected output strings. Spack requires every string in ``expected`` to be a regex matching @@ -4605,31 +4605,31 @@ where each argument has the following meaning: The expected output can be :ref:`read from a file `. - + The default is ``expected=[]``, so Spack will not check the output. - + * ``status`` is the optional expected return code(s). A list of return codes corresponding to successful execution can be provided (e.g., ``status=[0,3,7]``). Support for non-zero return codes allows for basic **expected failure** tests as well as different return codes across versions of the software. - + The default is ``status=[0]``, which corresponds to **successful** execution in the sense that the executable does not exit with a failure code or raise an exception. - + * ``installed`` is used to require ``exe`` to be within the package prefix. - + If ``True``, then the path for ``exe`` is required to be within the package prefix; otherwise, the path is not constrained. - + The default is ``False``, so the fully qualified path for ``exe`` does **not** need to be within the installation directory. - + * ``purpose`` is an optional heading describing the the test part. - + Output from the test is written to a test log file so this argument serves as a searchable heading in text logs to highlight the start of the test part. Having a description can be helpful when debugging @@ -4644,10 +4644,10 @@ where each argument has the following meaning: The default is ``False``, which means the test executable must be present for any installable version of the software. - + * ``work_dir`` is the path to the directory from which the executable will run. - + The default of ``None`` corresponds to the current directory (``'.'``). """"""""""""""""""""""""""""""""""""""""" @@ -4754,7 +4754,7 @@ where only the outputs for the first of each set are shown: Copyright (C) 2018 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - + PASSED ... ==> [2021-04-26-17:35:20.493921] test: checking mpirun output @@ -4915,7 +4915,7 @@ This is already part of the boilerplate for packages created with Filtering functions ^^^^^^^^^^^^^^^^^^^ -:py:func:`filter_file(regex, repl, *filenames, **kwargs) ` +:py:func:`filter_file(regex, repl, *filenames, **kwargs) ` Works like ``sed`` but with Python regular expression syntax. Takes a regular expression, a replacement, and a set of files. ``repl`` can be a raw string or a callable function. If it is a raw string, @@ -4953,7 +4953,7 @@ Filtering functions filter_file('CXX="c++"', 'CXX="%s"' % self.compiler.cxx, prefix.bin.mpicxx) -:py:func:`change_sed_delimiter(old_delim, new_delim, *filenames) ` +:py:func:`change_sed_delimiter(old_delim, new_delim, *filenames) ` Some packages, like TAU, have a build system that can't install into directories with, e.g. '@' in the name, because they use hard-coded ``sed`` commands in their build. @@ -4975,14 +4975,14 @@ Filtering functions File functions ^^^^^^^^^^^^^^ -:py:func:`ancestor(dir, n=1) ` +:py:func:`ancestor(dir, n=1) ` Get the n\ :sup:`th` ancestor of the directory ``dir``. -:py:func:`can_access(path) ` +:py:func:`can_access(path) ` True if we can read and write to the file at ``path``. Same as native python ``os.access(file_name, os.R_OK|os.W_OK)``. -:py:func:`install(src, dest) ` +:py:func:`install(src, dest) ` Install a file to a particular location. For example, install a header into the ``include`` directory under the install ``prefix``: @@ -4990,14 +4990,14 @@ File functions install('my-header.h', prefix.include) -:py:func:`join_path(*paths) ` +:py:func:`join_path(*paths) ` An alias for ``os.path.join``. This joins paths using the OS path separator. -:py:func:`mkdirp(*paths) ` +:py:func:`mkdirp(*paths) ` Create each of the directories in ``paths``, creating any parent directories if they do not exist. -:py:func:`working_dir(dirname, kwargs) ` +:py:func:`working_dir(dirname, kwargs) ` This is a Python `Context Manager `_ that makes it easier to work with subdirectories in builds. You use this with the @@ -5039,7 +5039,7 @@ File functions The ``create=True`` keyword argument causes the command to create the directory if it does not exist. -:py:func:`touch(path) ` +:py:func:`touch(path) ` Create an empty file at ``path``. .. _make-package-findable: diff --git a/lib/spack/docs/requirements.txt b/lib/spack/docs/requirements.txt index f5c50b01991..5eee3b8b5ab 100644 --- a/lib/spack/docs/requirements.txt +++ b/lib/spack/docs/requirements.txt @@ -1,7 +1,7 @@ # These dependencies should be installed using pip in order # to build the documentation. -sphinx +sphinx>=3.4,!=4.1.2 sphinxcontrib-programoutput sphinx-rtd-theme python-levenshtein diff --git a/lib/spack/docs/spack.yaml b/lib/spack/docs/spack.yaml index 69d0e301fdc..8f3fd53e8bb 100644 --- a/lib/spack/docs/spack.yaml +++ b/lib/spack/docs/spack.yaml @@ -8,12 +8,20 @@ # these commands in this directory to install Sphinx and its plugins, # then build the docs: # -# spack install # spack env activate . +# spack install # make # spack: specs: - - py-sphinx + # Sphinx + - "py-sphinx@3.4:4.1.1,4.1.3:" - py-sphinxcontrib-programoutput - py-sphinx-rtd-theme + # VCS + - git + - mercurial + - subversion + # Plotting + - graphviz + concretization: together diff --git a/lib/spack/env/cc b/lib/spack/env/cc index bd479f05ecb..5157a5f3815 100755 --- a/lib/spack/env/cc +++ b/lib/spack/env/cc @@ -40,6 +40,14 @@ parameters=( SPACK_SYSTEM_DIRS ) +# Optional parameters that aren't required to be set + +# Boolean (true/false/custom) if we want to add debug flags +# SPACK_ADD_DEBUG_FLAGS + +# If a custom flag is requested, it will be defined +# SPACK_DEBUG_FLAGS + # The compiler input variables are checked for sanity later: # SPACK_CC, SPACK_CXX, SPACK_F77, SPACK_FC # The default compiler flags are passed from these variables: @@ -87,6 +95,25 @@ for param in "${parameters[@]}"; do fi done +# Check if optional parameters are defined +# If we aren't asking for debug flags, don't add them +if [[ -z ${SPACK_ADD_DEBUG_FLAGS+x} ]]; then + SPACK_ADD_DEBUG_FLAGS="false" +fi + +# SPACK_ADD_DEBUG_FLAGS must be true/false/custom +is_valid="false" +for param in "true" "false" "custom"; do + if [ "$param" == "$SPACK_ADD_DEBUG_FLAGS" ]; then + is_valid="true" + fi +done + +# Exit with error if we are given an incorrect value +if [ "$is_valid" == "false" ]; then + die "SPACK_ADD_DEBUG_FLAGS, if defined, must be one of 'true' 'false' or 'custom'" +fi + # Figure out the type of compiler, the language, and the mode so that # the compiler script knows what to do. # @@ -106,30 +133,35 @@ comp="CC" case "$command" in cpp) mode=cpp + debug_flags="-g" ;; cc|c89|c99|gcc|clang|armclang|icc|icx|pgcc|nvc|xlc|xlc_r|fcc) command="$SPACK_CC" language="C" comp="CC" lang_flags=C + debug_flags="-g" ;; c++|CC|g++|clang++|armclang++|icpc|icpx|pgc++|nvc++|xlc++|xlc++_r|FCC) command="$SPACK_CXX" language="C++" comp="CXX" lang_flags=CXX + debug_flags="-g" ;; ftn|f90|fc|f95|gfortran|flang|armflang|ifort|ifx|pgfortran|nvfortran|xlf90|xlf90_r|nagfor|frt) command="$SPACK_FC" language="Fortran 90" comp="FC" lang_flags=F + debug_flags="-g" ;; f77|xlf|xlf_r|pgf77) command="$SPACK_F77" language="Fortran 77" comp="F77" lang_flags=F + debug_flags="-g" ;; ld) mode=ld @@ -415,6 +447,16 @@ done # flags=() +# Add debug flags +if [ "${SPACK_ADD_DEBUG_FLAGS}" == "true" ]; then + flags=("${flags[@]}" "${debug_flags}") + +# If a custom flag is requested, derive from environment +elif [ "$SPACK_ADD_DEBUG_FLAGS" == "custom" ]; then + IFS=' ' read -ra SPACK_DEBUG_FLAGS <<< "$SPACK_DEBUG_FLAGS" + flags=("${flags[@]}" "${SPACK_DEBUG_FLAGS[@]}") +fi + # Fortran flags come before CPPFLAGS case "$mode" in cc|ccld) diff --git a/lib/spack/external/__init__.py b/lib/spack/external/__init__.py index 8adc4e12714..7ae506a46b3 100644 --- a/lib/spack/external/__init__.py +++ b/lib/spack/external/__init__.py @@ -11,7 +11,7 @@ * Homepage: https://pypi.python.org/pypi/archspec * Usage: Labeling, comparison and detection of microarchitectures -* Version: 0.1.2 (commit 26dec9d47e509daf8c970de4c89da200da52ad20) +* Version: 0.1.2 (commit 4dbf253daf37e4a008e4beb6489f347b4a35aed4) argparse -------- diff --git a/lib/spack/external/archspec/json/cpu/microarchitectures.json b/lib/spack/external/archspec/json/cpu/microarchitectures.json index e34bf9e1791..40f59bfd9e7 100644 --- a/lib/spack/external/archspec/json/cpu/microarchitectures.json +++ b/lib/spack/external/archspec/json/cpu/microarchitectures.json @@ -1942,6 +1942,12 @@ "versions": "5:", "flags" : "-march=armv8.2-a+fp16+rcpc+dotprod+crypto" } + ], + "arm" : [ + { + "versions": "20:", + "flags" : "-march=armv8.2-a+fp16+rcpc+dotprod+crypto" + } ] } }, diff --git a/lib/spack/llnl/util/argparsewriter.py b/lib/spack/llnl/util/argparsewriter.py index 6d44713e39d..1ba5bd5c372 100644 --- a/lib/spack/llnl/util/argparsewriter.py +++ b/lib/spack/llnl/util/argparsewriter.py @@ -326,7 +326,7 @@ def end_function(self, prog=None): """Returns the syntax needed to end a function definition. Parameters: - prog (str, optional): the command name + prog (str or None): the command name Returns: str: the function definition ending diff --git a/lib/spack/llnl/util/filesystem.py b/lib/spack/llnl/util/filesystem.py index 0ebc35a0409..3cf6553165a 100644 --- a/lib/spack/llnl/util/filesystem.py +++ b/lib/spack/llnl/util/filesystem.py @@ -444,7 +444,7 @@ def copy_tree(src, dest, symlinks=True, ignore=None, _permissions=False): src (str): the directory to copy dest (str): the destination directory symlinks (bool): whether or not to preserve symlinks - ignore (function): function indicating which files to ignore + ignore (typing.Callable): function indicating which files to ignore _permissions (bool): for internal use only Raises: @@ -518,7 +518,7 @@ def install_tree(src, dest, symlinks=True, ignore=None): src (str): the directory to install dest (str): the destination directory symlinks (bool): whether or not to preserve symlinks - ignore (function): function indicating which files to ignore + ignore (typing.Callable): function indicating which files to ignore Raises: IOError: if *src* does not match any files or directories @@ -557,12 +557,12 @@ def mkdirp(*paths, **kwargs): paths (str): paths to create with mkdirp Keyword Aguments: - mode (permission bits or None, optional): optional permissions to set + mode (permission bits or None): optional permissions to set on the created directory -- use OS default if not provided - group (group name or None, optional): optional group for permissions of + group (group name or None): optional group for permissions of final created directory -- use OS default if not provided. Only used if world write permissions are not set - default_perms ('parents' or 'args', optional): The default permissions + default_perms (str or None): one of 'parents' or 'args'. The default permissions that are set for directories that are not themselves an argument for mkdirp. 'parents' means intermediate directories get the permissions of their direct parent directory, 'args' means @@ -866,7 +866,7 @@ def traverse_tree(source_root, dest_root, rel_path='', **kwargs): Keyword Arguments: order (str): Whether to do pre- or post-order traversal. Accepted values are 'pre' and 'post' - ignore (function): function indicating which files to ignore + ignore (typing.Callable): function indicating which files to ignore follow_nonexisting (bool): Whether to descend into directories in ``src`` that do not exit in ``dest``. Default is True follow_links (bool): Whether to descend into symlinks in ``src`` @@ -1114,11 +1114,11 @@ def find(root, files, recursive=True): Parameters: root (str): The root directory to start searching from files (str or Sequence): Library name(s) to search for - recurse (bool, optional): if False search only root folder, + recursive (bool): if False search only root folder, if True descends top-down from the root. Defaults to True. Returns: - list of strings: The files that have been found + list: The files that have been found """ if isinstance(files, six.string_types): files = [files] @@ -1200,7 +1200,7 @@ def directories(self): ['/dir1', '/dir2'] Returns: - list of strings: A list of directories + list: A list of directories """ return list(dedupe( os.path.dirname(x) for x in self.files if os.path.dirname(x) @@ -1218,7 +1218,7 @@ def basenames(self): ['a.h', 'b.h'] Returns: - list of strings: A list of base-names + list: A list of base-names """ return list(dedupe(os.path.basename(x) for x in self.files)) @@ -1305,7 +1305,7 @@ def headers(self): """Stable de-duplication of the headers. Returns: - list of strings: A list of header files + list: A list of header files """ return self.files @@ -1318,7 +1318,7 @@ def names(self): ['a', 'b'] Returns: - list of strings: A list of files without extensions + list: A list of files without extensions """ names = [] @@ -1409,9 +1409,9 @@ def find_headers(headers, root, recursive=False): ======= ==================================== Parameters: - headers (str or list of str): Header name(s) to search for + headers (str or list): Header name(s) to search for root (str): The root directory to start searching from - recursive (bool, optional): if False search only root folder, + recursive (bool): if False search only root folder, if True descends top-down from the root. Defaults to False. Returns: @@ -1447,7 +1447,7 @@ def find_all_headers(root): in the directory passed as argument. Args: - root (path): directory where to look recursively for header files + root (str): directory where to look recursively for header files Returns: List of all headers found in ``root`` and subdirectories. @@ -1467,7 +1467,7 @@ def libraries(self): """Stable de-duplication of library files. Returns: - list of strings: A list of library files + list: A list of library files """ return self.files @@ -1480,7 +1480,7 @@ def names(self): ['a', 'b'] Returns: - list of strings: A list of library names + list: A list of library names """ names = [] @@ -1565,8 +1565,8 @@ def find_system_libraries(libraries, shared=True): ======= ==================================== Parameters: - libraries (str or list of str): Library name(s) to search for - shared (bool, optional): if True searches for shared libraries, + libraries (str or list): Library name(s) to search for + shared (bool): if True searches for shared libraries, otherwise for static. Defaults to True. Returns: @@ -1616,11 +1616,11 @@ def find_libraries(libraries, root, shared=True, recursive=False): ======= ==================================== Parameters: - libraries (str or list of str): Library name(s) to search for + libraries (str or list): Library name(s) to search for root (str): The root directory to start searching from - shared (bool, optional): if True searches for shared libraries, + shared (bool): if True searches for shared libraries, otherwise for static. Defaults to True. - recursive (bool, optional): if False search only root folder, + recursive (bool): if False search only root folder, if True descends top-down from the root. Defaults to False. Returns: diff --git a/lib/spack/llnl/util/lang.py b/lib/spack/llnl/util/lang.py index 00b0490600c..3e81a34422b 100644 --- a/lib/spack/llnl/util/lang.py +++ b/lib/spack/llnl/util/lang.py @@ -573,8 +573,8 @@ def pretty_date(time, now=None): """Convert a datetime or timestamp to a pretty, relative date. Args: - time (datetime or int): date to print prettily - now (datetime): dateimte for 'now', i.e. the date the pretty date + time (datetime.datetime or int): date to print prettily + now (datetime.datetime): datetime for 'now', i.e. the date the pretty date is relative to (default is datetime.now()) Returns: @@ -648,7 +648,7 @@ def pretty_string_to_date(date_str, now=None): or be a *pretty date* (like ``yesterday`` or ``two months ago``) Returns: - (datetime): datetime object corresponding to ``date_str`` + (datetime.datetime): datetime object corresponding to ``date_str`` """ pattern = {} diff --git a/lib/spack/llnl/util/lock.py b/lib/spack/llnl/util/lock.py index cd390693c4f..0c0cc7f634e 100644 --- a/lib/spack/llnl/util/lock.py +++ b/lib/spack/llnl/util/lock.py @@ -14,9 +14,19 @@ import spack.util.string -__all__ = ['Lock', 'LockTransaction', 'WriteTransaction', 'ReadTransaction', - 'LockError', 'LockTimeoutError', - 'LockPermissionError', 'LockROFileError', 'CantCreateLockError'] +__all__ = [ + 'Lock', + 'LockDowngradeError', + 'LockUpgradeError', + 'LockTransaction', + 'WriteTransaction', + 'ReadTransaction', + 'LockError', + 'LockTimeoutError', + 'LockPermissionError', + 'LockROFileError', + 'CantCreateLockError' +] #: Mapping of supported locks to description lock_type = {fcntl.LOCK_SH: 'read', fcntl.LOCK_EX: 'write'} @@ -401,7 +411,7 @@ def release_read(self, release_fn=None): """Releases a read lock. Arguments: - release_fn (callable): function to call *before* the last recursive + release_fn (typing.Callable): function to call *before* the last recursive lock (read or write) is released. If the last recursive lock will be released, then this will call @@ -437,7 +447,7 @@ def release_write(self, release_fn=None): """Releases a write lock. Arguments: - release_fn (callable): function to call before the last recursive + release_fn (typing.Callable): function to call before the last recursive write is released. If the last recursive *write* lock will be released, then this @@ -533,10 +543,10 @@ class LockTransaction(object): Arguments: lock (Lock): underlying lock for this transaction to be accquired on enter and released on exit - acquire (callable or contextmanager): function to be called after lock - is acquired, or contextmanager to enter after acquire and leave + acquire (typing.Callable or contextlib.contextmanager): function to be called + after lock is acquired, or contextmanager to enter after acquire and leave before release. - release (callable): function to be called before release. If + release (typing.Callable): function to be called before release. If ``acquire`` is a contextmanager, this will be called *after* exiting the nexted context and before the lock is released. timeout (float): number of seconds to set for the timeout when diff --git a/lib/spack/llnl/util/tty/colify.py b/lib/spack/llnl/util/tty/colify.py index ca157e33037..22b824ac0c0 100644 --- a/lib/spack/llnl/util/tty/colify.py +++ b/lib/spack/llnl/util/tty/colify.py @@ -109,19 +109,17 @@ def colify(elts, **options): using ``str()``. Keyword Arguments: - output (stream): A file object to write to. Default is ``sys.stdout`` - indent (int): Optionally indent all columns by some number of spaces - padding (int): Spaces between columns. Default is 2 - width (int): Width of the output. Default is 80 if tty not detected - cols (int): Force number of columns. Default is to size to - terminal, or single-column if no tty - tty (bool): Whether to attempt to write to a tty. Default is to - autodetect a tty. Set to False to force single-column - output - method (str): Method to use to fit columns. Options are variable or - uniform. Variable-width columns are tighter, uniform - columns are all the same width and fit less data on - the screen + output (typing.IO): A file object to write to. Default is ``sys.stdout`` + indent (int): Optionally indent all columns by some number of spaces + padding (int): Spaces between columns. Default is 2 + width (int): Width of the output. Default is 80 if tty not detected + cols (int): Force number of columns. Default is to size to terminal, or + single-column if no tty + tty (bool): Whether to attempt to write to a tty. Default is to autodetect a + tty. Set to False to force single-column output + method (str): Method to use to fit columns. Options are variable or uniform. + Variable-width columns are tighter, uniform columns are all the same width + and fit less data on the screen """ # Get keyword arguments or set defaults cols = options.pop("cols", 0) diff --git a/lib/spack/llnl/util/tty/log.py b/lib/spack/llnl/util/tty/log.py index 947e79b8c98..f081893c85e 100644 --- a/lib/spack/llnl/util/tty/log.py +++ b/lib/spack/llnl/util/tty/log.py @@ -436,7 +436,7 @@ class log_output(object): """ def __init__(self, file_like=None, echo=False, debug=0, buffer=False, - env=None): + env=None, filter_fn=None): """Create a new output log context manager. Args: @@ -446,6 +446,8 @@ def __init__(self, file_like=None, echo=False, debug=0, buffer=False, debug (int): positive to enable tty debug mode during logging buffer (bool): pass buffer=True to skip unbuffering output; note this doesn't set up any *new* buffering + filter_fn (callable, optional): Callable[str] -> str to filter each + line of output log_output can take either a file object or a filename. If a filename is passed, the file will be opened and closed entirely @@ -465,6 +467,7 @@ def __init__(self, file_like=None, echo=False, debug=0, buffer=False, self.debug = debug self.buffer = buffer self.env = env # the environment to use for _writer_daemon + self.filter_fn = filter_fn self._active = False # used to prevent re-entry @@ -543,7 +546,7 @@ def __enter__(self): target=_writer_daemon, args=( input_multiprocess_fd, read_multiprocess_fd, write_fd, - self.echo, self.log_file, child_pipe + self.echo, self.log_file, child_pipe, self.filter_fn ) ) self.process.daemon = True # must set before start() @@ -667,7 +670,7 @@ def force_echo(self): def _writer_daemon(stdin_multiprocess_fd, read_multiprocess_fd, write_fd, echo, - log_file_wrapper, control_pipe): + log_file_wrapper, control_pipe, filter_fn): """Daemon used by ``log_output`` to write to a log file and to ``stdout``. The daemon receives output from the parent process and writes it both @@ -712,6 +715,7 @@ def _writer_daemon(stdin_multiprocess_fd, read_multiprocess_fd, write_fd, echo, log_file_wrapper (FileWrapper): file to log all output control_pipe (Pipe): multiprocessing pipe on which to send control information to the parent + filter_fn (callable, optional): function to filter each line of output """ # If this process was forked, then it will inherit file descriptors from @@ -784,7 +788,10 @@ def _writer_daemon(stdin_multiprocess_fd, read_multiprocess_fd, write_fd, echo, # Echo to stdout if requested or forced. if echo or force_echo: - sys.stdout.write(clean_line) + output_line = clean_line + if filter_fn: + output_line = filter_fn(clean_line) + sys.stdout.write(output_line) # Stripped output to log file. log_file.write(_strip(clean_line)) diff --git a/lib/spack/spack/__init__.py b/lib/spack/spack/__init__.py index a17fc1dfc1a..1b14a7d5ff6 100644 --- a/lib/spack/spack/__init__.py +++ b/lib/spack/spack/__init__.py @@ -3,7 +3,6 @@ # # SPDX-License-Identifier: (Apache-2.0 OR MIT) - #: major, minor, patch version for Spack, in a tuple spack_version_info = (0, 16, 1) diff --git a/lib/spack/spack/architecture.py b/lib/spack/spack/architecture.py index 951109c892b..17fbc0e2f14 100644 --- a/lib/spack/spack/architecture.py +++ b/lib/spack/spack/architecture.py @@ -193,8 +193,8 @@ def optimization_flags(self, compiler): the compiler passed as argument. Args: - compiler (CompilerSpec or Compiler): object that contains both the - name and the version of the compiler we want to use + compiler (spack.spec.CompilerSpec or spack.compiler.Compiler): object that + contains both the name and the version of the compiler we want to use """ # Mixed toolchains are not supported yet import spack.compilers diff --git a/lib/spack/spack/binary_distribution.py b/lib/spack/spack/binary_distribution.py index 6ca15df1229..647b71cfe3e 100644 --- a/lib/spack/spack/binary_distribution.py +++ b/lib/spack/spack/binary_distribution.py @@ -13,6 +13,7 @@ import sys import tarfile import tempfile +import traceback from contextlib import closing import ruamel.yaml as yaml @@ -27,6 +28,7 @@ import spack.config as config import spack.database as spack_db import spack.fetch_strategy as fs +import spack.hash_types as ht import spack.mirror import spack.relocate as relocate import spack.util.file_cache as file_cache @@ -204,7 +206,7 @@ def find_built_spec(self, spec): The cache can be updated by calling ``update()`` on the cache. Args: - spec (Spec): Concrete spec to find + spec (spack.spec.Spec): Concrete spec to find Returns: An list of objects containing the found specs and mirror url where @@ -581,7 +583,7 @@ def get_buildfile_manifest(spec): added = True if relocate.needs_binary_relocation(m_type, m_subtype): - if ((m_subtype in ('x-executable', 'x-sharedlib') + if ((m_subtype in ('x-executable', 'x-sharedlib', 'x-pie-executable') and sys.platform != 'darwin') or (m_subtype in ('x-mach-binary') and sys.platform == 'darwin') or @@ -709,12 +711,6 @@ def generate_package_index(cache_prefix): cache_prefix. This page contains a link for each binary package (.yaml) under cache_prefix. """ - tmpdir = tempfile.mkdtemp() - db_root_dir = os.path.join(tmpdir, 'db_root') - db = spack_db.Database(None, db_dir=db_root_dir, - enable_transaction_locking=False, - record_fields=['spec', 'ref_count', 'in_buildcache']) - try: file_list = ( entry @@ -735,22 +731,90 @@ def generate_package_index(cache_prefix): tty.debug('Retrieving spec.yaml files from {0} to build index'.format( cache_prefix)) + + all_mirror_specs = {} + for file_path in file_list: try: yaml_url = url_util.join(cache_prefix, file_path) tty.debug('fetching {0}'.format(yaml_url)) _, _, yaml_file = web_util.read_from_url(yaml_url) yaml_contents = codecs.getreader('utf-8')(yaml_file).read() - # yaml_obj = syaml.load(yaml_contents) - # s = Spec.from_yaml(yaml_obj) + spec_dict = syaml.load(yaml_contents) s = Spec.from_yaml(yaml_contents) - db.add(s, None) - db.mark(s, 'in_buildcache', True) + all_mirror_specs[s.dag_hash()] = { + 'yaml_url': yaml_url, + 'spec': s, + 'num_deps': len(list(s.traverse(root=False))), + 'binary_cache_checksum': spec_dict['binary_cache_checksum'], + 'buildinfo': spec_dict['buildinfo'], + } except (URLError, web_util.SpackWebError) as url_err: tty.error('Error reading spec.yaml: {0}'.format(file_path)) tty.error(url_err) + sorted_specs = sorted(all_mirror_specs.keys(), + key=lambda k: all_mirror_specs[k]['num_deps']) + + tmpdir = tempfile.mkdtemp() + db_root_dir = os.path.join(tmpdir, 'db_root') + db = spack_db.Database(None, db_dir=db_root_dir, + enable_transaction_locking=False, + record_fields=['spec', 'ref_count', 'in_buildcache']) + try: + tty.debug('Specs sorted by number of dependencies:') + for dag_hash in sorted_specs: + spec_record = all_mirror_specs[dag_hash] + s = spec_record['spec'] + num_deps = spec_record['num_deps'] + tty.debug(' {0}/{1} -> {2}'.format( + s.name, dag_hash[:7], num_deps)) + if num_deps > 0: + # Check each of this spec's dependencies (which we have already + # processed), as they are the source of truth for their own + # full hash. If the full hash we have for any deps does not + # match what those deps have themselves, then we need to splice + # this spec with those deps, and push this spliced spec + # (spec.yaml file) back to the mirror, as well as update the + # all_mirror_specs dictionary with this spliced spec. + to_splice = [] + for dep in s.dependencies(): + dep_dag_hash = dep.dag_hash() + if dep_dag_hash in all_mirror_specs: + true_dep = all_mirror_specs[dep_dag_hash]['spec'] + if true_dep.full_hash() != dep.full_hash(): + to_splice.append(true_dep) + + if to_splice: + tty.debug(' needs the following deps spliced:') + for true_dep in to_splice: + tty.debug(' {0}/{1}'.format( + true_dep.name, true_dep.dag_hash()[:7])) + s = s.splice(true_dep, True) + + # Push this spliced spec back to the mirror + spliced_yaml = s.to_dict(hash=ht.full_hash) + for key in ['binary_cache_checksum', 'buildinfo']: + spliced_yaml[key] = spec_record[key] + + temp_yaml_path = os.path.join(tmpdir, 'spliced.spec.yaml') + with open(temp_yaml_path, 'w') as fd: + fd.write(syaml.dump(spliced_yaml)) + + spliced_yaml_url = spec_record['yaml_url'] + web_util.push_to_url( + temp_yaml_path, spliced_yaml_url, keep_original=False) + tty.debug(' spliced and wrote {0}'.format( + spliced_yaml_url)) + spec_record['spec'] = s + + db.add(s, None) + db.mark(s, 'in_buildcache', True) + + # Now that we have fixed any old spec yamls that might have had the wrong + # full hash for their dependencies, we can generate the index, compute + # the hash, and push those files to the mirror. index_json_path = os.path.join(db_root_dir, 'index.json') with open(index_json_path, 'w') as f: db._write_to_file(f) @@ -782,6 +846,7 @@ def generate_package_index(cache_prefix): msg = 'Encountered problem pushing package index to {0}: {1}'.format( cache_prefix, err) tty.warn(msg) + tty.debug('\n' + traceback.format_exc()) finally: shutil.rmtree(tmpdir) @@ -1014,14 +1079,14 @@ def download_tarball(spec, preferred_mirrors=None): path to downloaded tarball if successful, None otherwise. Args: - spec (Spec): Concrete spec + spec (spack.spec.Spec): Concrete spec preferred_mirrors (list): If provided, this is a list of preferred - mirror urls. Other configured mirrors will only be used if the - tarball can't be retrieved from one of these. + mirror urls. Other configured mirrors will only be used if the + tarball can't be retrieved from one of these. Returns: Path to the downloaded tarball, or ``None`` if the tarball could not - be downloaded from any configured mirrors. + be downloaded from any configured mirrors. """ if not spack.mirror.MirrorCollection(): tty.die("Please add a spack mirror to allow " + @@ -1390,7 +1455,7 @@ def get_mirrors_for_spec(spec=None, full_hash_match=False, indicating the mirrors on which it can be found Args: - spec (Spec): The spec to look for in binary mirrors + spec (spack.spec.Spec): The spec to look for in binary mirrors full_hash_match (bool): If True, only includes mirrors where the spec full hash matches the locally computed full hash of the ``spec`` argument. If False, any mirror which has a matching DAG hash @@ -1667,11 +1732,11 @@ def check_specs_against_mirrors(mirrors, specs, output_file=None, Arguments: mirrors (dict): Mirrors to check against - specs (iterable): Specs to check against mirrors - output_file (string): Path to output file to be written. If provided, + specs (typing.Iterable): Specs to check against mirrors + output_file (str): Path to output file to be written. If provided, mirrors with missing or out-of-date specs will be formatted as a JSON object and written to this file. - rebuild_on_errors (boolean): Treat any errors encountered while + rebuild_on_errors (bool): Treat any errors encountered while checking specs as a signal to rebuild package. Returns: 1 if any spec was out-of-date on any mirror, 0 otherwise. diff --git a/lib/spack/spack/bootstrap.py b/lib/spack/spack/bootstrap.py index 86c3110983b..92bbb2fa420 100644 --- a/lib/spack/spack/bootstrap.py +++ b/lib/spack/spack/bootstrap.py @@ -25,6 +25,7 @@ import spack.store import spack.user_environment as uenv import spack.util.executable +import spack.util.path from spack.util.environment import EnvironmentModifications @@ -92,17 +93,14 @@ def make_module_available(module, spec=None, install=False): for ispec in installed_specs: # TODO: make sure run-environment is appropriate - module_path = os.path.join(ispec.prefix, - ispec['python'].package.site_packages_dir) - module_path_64 = module_path.replace('/lib/', '/lib64/') + module_path = ispec['python'].package.get_python_lib(prefix=ispec.prefix) try: sys.path.append(module_path) - sys.path.append(module_path_64) __import__(module) return except ImportError: tty.warn("Spec %s did not provide module %s" % (ispec, module)) - sys.path = sys.path[:-2] + sys.path = sys.path[:-1] def _raise_error(module_name, module_spec): error_msg = 'cannot import module "{0}"'.format(module_name) @@ -119,16 +117,13 @@ def _raise_error(module_name, module_spec): spec.concretize() spec.package.do_install() - module_path = os.path.join(spec.prefix, - spec['python'].package.site_packages_dir) - module_path_64 = module_path.replace('/lib/', '/lib64/') + module_path = spec['python'].package.get_python_lib(prefix=spec.prefix) try: sys.path.append(module_path) - sys.path.append(module_path_64) __import__(module) return except ImportError: - sys.path = sys.path[:-2] + sys.path = sys.path[:-1] _raise_error(module, spec) @@ -137,7 +132,7 @@ def get_executable(exe, spec=None, install=False): Args: exe (str): needed executable name - spec (Spec or str): spec to search for exe in (default exe) + spec (spack.spec.Spec or str): spec to search for exe in (default exe) install (bool): install spec if not available When ``install`` is True, Spack will use the python used to run Spack as an @@ -216,9 +211,10 @@ def _bootstrap_config_scopes(): @contextlib.contextmanager def ensure_bootstrap_configuration(): + bootstrap_store_path = store_path() with spack.architecture.use_platform(spack.architecture.real_platform()): with spack.repo.use_repositories(spack.paths.packages_path): - with spack.store.use_store(spack.paths.user_bootstrap_store): + with spack.store.use_store(bootstrap_store_path): # Default configuration scopes excluding command line # and builtin but accounting for platform specific scopes config_scopes = _bootstrap_config_scopes() @@ -227,6 +223,23 @@ def ensure_bootstrap_configuration(): yield +def store_path(): + """Path to the store used for bootstrapped software""" + enabled = spack.config.get('bootstrap:enable', True) + if not enabled: + msg = ('bootstrapping is currently disabled. ' + 'Use "spack bootstrap enable" to enable it') + raise RuntimeError(msg) + + bootstrap_root_path = spack.config.get( + 'bootstrap:root', spack.paths.user_bootstrap_path + ) + bootstrap_store_path = spack.util.path.canonicalize_path( + os.path.join(bootstrap_root_path, 'store') + ) + return bootstrap_store_path + + def clingo_root_spec(): # Construct the root spec that will be used to bootstrap clingo spec_str = 'clingo-bootstrap@spack+python' diff --git a/lib/spack/spack/build_environment.py b/lib/spack/spack/build_environment.py index c9be0bc1d84..7e99dc6441e 100644 --- a/lib/spack/spack/build_environment.py +++ b/lib/spack/spack/build_environment.py @@ -455,11 +455,11 @@ def determine_number_of_jobs( cap to the number of CPUs available to avoid oversubscription. Parameters: - parallel (bool): true when package supports parallel builds - command_line (int/None): command line override - config_default (int/None): config default number of jobs - max_cpus (int/None): maximum number of CPUs available. When None, this - value is automatically determined. + parallel (bool or None): true when package supports parallel builds + command_line (int or None): command line override + config_default (int or None): config default number of jobs + max_cpus (int or None): maximum number of CPUs available. When None, this + value is automatically determined. """ if not parallel: return 1 @@ -685,14 +685,14 @@ def get_std_cmake_args(pkg): """List of standard arguments used if a package is a CMakePackage. Returns: - list of str: standard arguments that would be used if this + list: standard arguments that would be used if this package were a CMakePackage instance. Args: - pkg (PackageBase): package under consideration + pkg (spack.package.PackageBase): package under consideration Returns: - list of str: arguments for cmake + list: arguments for cmake """ return spack.build_systems.cmake.CMakePackage._std_args(pkg) @@ -701,14 +701,14 @@ def get_std_meson_args(pkg): """List of standard arguments used if a package is a MesonPackage. Returns: - list of str: standard arguments that would be used if this + list: standard arguments that would be used if this package were a MesonPackage instance. Args: - pkg (PackageBase): package under consideration + pkg (spack.package.PackageBase): package under consideration Returns: - list of str: arguments for meson + list: arguments for meson """ return spack.build_systems.meson.MesonPackage._std_args(pkg) @@ -738,7 +738,7 @@ def load_external_modules(pkg): associated with them. Args: - pkg (PackageBase): package to load deps for + pkg (spack.package.PackageBase): package to load deps for """ for dep in list(pkg.spec.traverse()): external_modules = dep.external_modules or [] @@ -864,7 +864,7 @@ def modifications_from_dependencies(spec, context, custom_mods_only=True): CMAKE_PREFIX_PATH, or PKG_CONFIG_PATH). Args: - spec (Spec): spec for which we want the modifications + spec (spack.spec.Spec): spec for which we want the modifications context (str): either 'build' for build-time modifications or 'run' for run-time modifications """ @@ -1062,9 +1062,9 @@ def start_build_process(pkg, function, kwargs): Args: - pkg (PackageBase): package whose environment we should set up the + pkg (spack.package.PackageBase): package whose environment we should set up the child process for. - function (callable): argless function to run in the child + function (typing.Callable): argless function to run in the child process. Usage:: @@ -1149,7 +1149,7 @@ def get_package_context(traceback, context=3): """Return some context for an error message when the build fails. Args: - traceback (traceback): A traceback from some exception raised during + traceback: A traceback from some exception raised during install context (int): Lines of context to show before and after the line diff --git a/lib/spack/spack/build_systems/autotools.py b/lib/spack/spack/build_systems/autotools.py index 7ded0245de1..03923e3e518 100644 --- a/lib/spack/spack/build_systems/autotools.py +++ b/lib/spack/spack/build_systems/autotools.py @@ -30,7 +30,7 @@ class AutotoolsPackage(PackageBase): They all have sensible defaults and for many packages the only thing necessary will be to override the helper method - :py:meth:`~.AutotoolsPackage.configure_args`. + :meth:`~spack.build_systems.autotools.AutotoolsPackage.configure_args`. For a finer tuning you may also override: +-----------------------------------------------+--------------------+ @@ -331,7 +331,7 @@ def flags_to_build_system_args(self, flags): def configure(self, spec, prefix): """Runs configure with the arguments specified in - :py:meth:`~.AutotoolsPackage.configure_args` + :meth:`~spack.build_systems.autotools.AutotoolsPackage.configure_args` and an appropriately set prefix. """ options = getattr(self, 'configure_flag_args', []) @@ -376,8 +376,8 @@ def _activate_or_not( activation_value=None ): """This function contains the current implementation details of - :py:meth:`~.AutotoolsPackage.with_or_without` and - :py:meth:`~.AutotoolsPackage.enable_or_disable`. + :meth:`~spack.build_systems.autotools.AutotoolsPackage.with_or_without` and + :meth:`~spack.build_systems.autotools.AutotoolsPackage.enable_or_disable`. Args: name (str): name of the variant that is being processed @@ -385,7 +385,7 @@ def _activate_or_not( case of ``with_or_without``) deactivation_word (str): the default deactivation word ('without' in the case of ``with_or_without``) - activation_value (callable): callable that accepts a single + activation_value (typing.Callable): callable that accepts a single value. This value is either one of the allowed values for a multi-valued variant or the name of a bool-valued variant. Returns the parameter to be used when the value is activated. @@ -420,7 +420,7 @@ def _activate_or_not( for `` foo=x +bar`` Returns: - list of strings that corresponds to the activation/deactivation + list: list of strings that corresponds to the activation/deactivation of the variant that has been processed Raises: @@ -501,7 +501,7 @@ def with_or_without(self, name, activation_value=None): Args: name (str): name of a valid multi-valued variant - activation_value (callable): callable that accepts a single + activation_value (typing.Callable): callable that accepts a single value and returns the parameter to be used leading to an entry of the type ``--with-{name}={parameter}``. @@ -514,12 +514,13 @@ def with_or_without(self, name, activation_value=None): return self._activate_or_not(name, 'with', 'without', activation_value) def enable_or_disable(self, name, activation_value=None): - """Same as :py:meth:`~.AutotoolsPackage.with_or_without` but substitute - ``with`` with ``enable`` and ``without`` with ``disable``. + """Same as + :meth:`~spack.build_systems.autotools.AutotoolsPackage.with_or_without` + but substitute ``with`` with ``enable`` and ``without`` with ``disable``. Args: name (str): name of a valid multi-valued variant - activation_value (callable): if present accepts a single value + activation_value (typing.Callable): if present accepts a single value and returns the parameter to be used leading to an entry of the type ``--enable-{name}={parameter}`` diff --git a/lib/spack/spack/build_systems/cached_cmake.py b/lib/spack/spack/build_systems/cached_cmake.py index c143c824de6..faaabb184f3 100644 --- a/lib/spack/spack/build_systems/cached_cmake.py +++ b/lib/spack/spack/build_systems/cached_cmake.py @@ -108,21 +108,6 @@ def initconfig_compiler_entries(self): if fflags: entries.append(cmake_cache_string("CMAKE_Fortran_FLAGS", fflags)) - # Override XL compiler family - familymsg = ("Override to proper compiler family for XL") - if "xlf" in (self.compiler.fc or ''): # noqa: F821 - entries.append(cmake_cache_string( - "CMAKE_Fortran_COMPILER_ID", "XL", - familymsg)) - if "xlc" in self.compiler.cc: # noqa: F821 - entries.append(cmake_cache_string( - "CMAKE_C_COMPILER_ID", "XL", - familymsg)) - if "xlC" in self.compiler.cxx: # noqa: F821 - entries.append(cmake_cache_string( - "CMAKE_CXX_COMPILER_ID", "XL", - familymsg)) - return entries def initconfig_mpi_entries(self): diff --git a/lib/spack/spack/build_systems/cmake.py b/lib/spack/spack/build_systems/cmake.py index acf4a9dc531..a3a1bb51e33 100644 --- a/lib/spack/spack/build_systems/cmake.py +++ b/lib/spack/spack/build_systems/cmake.py @@ -236,7 +236,7 @@ def define_from_variant(self, cmake_var, variant=None): of ``cmake_var``. This utility function is similar to - :py:meth:`~.AutotoolsPackage.with_or_without`. + :meth:`~spack.build_systems.autotools.AutotoolsPackage.with_or_without`. Examples: diff --git a/lib/spack/spack/build_systems/intel.py b/lib/spack/spack/build_systems/intel.py index 2049669aeac..427cb75e492 100644 --- a/lib/spack/spack/build_systems/intel.py +++ b/lib/spack/spack/build_systems/intel.py @@ -368,7 +368,7 @@ def normalize_suite_dir(self, suite_dir_name, version_globs=['*.*.*']): toplevel psxevars.sh or equivalent file to source (and thus by the modulefiles that Spack produces). - version_globs (list of str): Suffix glob patterns (most specific + version_globs (list): Suffix glob patterns (most specific first) expected to qualify suite_dir_name to its fully version-specific install directory (as opposed to a compatibility directory or symlink). diff --git a/lib/spack/spack/build_systems/oneapi.py b/lib/spack/spack/build_systems/oneapi.py index c429092cb67..0ff77d729b0 100644 --- a/lib/spack/spack/build_systems/oneapi.py +++ b/lib/spack/spack/build_systems/oneapi.py @@ -69,6 +69,9 @@ def install(self, spec, prefix, installer_path=None): # Installer writes files in ~/intel set HOME so it goes to prefix bash.add_default_env('HOME', prefix) + # Installer checks $XDG_RUNTIME_DIR/.bootstrapper_lock_file as well + bash.add_default_env('XDG_RUNTIME_DIR', + join_path(self.stage.path, 'runtime')) bash(installer_path, '-s', '-a', '-s', '--action', 'install', diff --git a/lib/spack/spack/build_systems/python.py b/lib/spack/spack/build_systems/python.py index b4f55ab7074..27b1d4a10c4 100644 --- a/lib/spack/spack/build_systems/python.py +++ b/lib/spack/spack/build_systems/python.py @@ -127,24 +127,22 @@ def import_modules(self): list: list of strings of module names """ modules = [] + root = self.spec['python'].package.get_python_lib(prefix=self.prefix) - # Python libraries may be installed in lib or lib64 - # See issues #18520 and #17126 - for lib in ['lib', 'lib64']: - root = os.path.join(self.prefix, lib, 'python{0}'.format( - self.spec['python'].version.up_to(2)), 'site-packages') - # Some Python libraries are packages: collections of modules - # distributed in directories containing __init__.py files - for path in find(root, '__init__.py', recursive=True): - modules.append(path.replace(root + os.sep, '', 1).replace( - os.sep + '__init__.py', '').replace('/', '.')) - # Some Python libraries are modules: individual *.py files - # found in the site-packages directory - for path in find(root, '*.py', recursive=False): - modules.append(path.replace(root + os.sep, '', 1).replace( - '.py', '').replace('/', '.')) + # Some Python libraries are packages: collections of modules + # distributed in directories containing __init__.py files + for path in find(root, '__init__.py', recursive=True): + modules.append(path.replace(root + os.sep, '', 1).replace( + os.sep + '__init__.py', '').replace('/', '.')) + + # Some Python libraries are modules: individual *.py files + # found in the site-packages directory + for path in find(root, '*.py', recursive=False): + modules.append(path.replace(root + os.sep, '', 1).replace( + '.py', '').replace('/', '.')) tty.debug('Detected the following modules: {0}'.format(modules)) + return modules def setup_file(self): @@ -254,15 +252,12 @@ def install_args(self, spec, prefix): # Get all relative paths since we set the root to `prefix` # We query the python with which these will be used for the lib and inc # directories. This ensures we use `lib`/`lib64` as expected by python. - python = spec['python'].package.command - command_start = 'print(distutils.sysconfig.' - commands = ';'.join([ - 'import distutils.sysconfig', - command_start + 'get_python_lib(plat_specific=False, prefix=""))', - command_start + 'get_python_lib(plat_specific=True, prefix=""))', - command_start + 'get_python_inc(plat_specific=True, prefix=""))']) - pure_site_packages_dir, plat_site_packages_dir, inc_dir = python( - '-c', commands, output=str, error=str).strip().split('\n') + pure_site_packages_dir = spec['python'].package.get_python_lib( + plat_specific=False, prefix='') + plat_site_packages_dir = spec['python'].package.get_python_lib( + plat_specific=True, prefix='') + inc_dir = spec['python'].package.get_python_inc( + plat_specific=True, prefix='') args += ['--root=%s' % prefix, '--install-purelib=%s' % pure_site_packages_dir, diff --git a/lib/spack/spack/build_systems/sip.py b/lib/spack/spack/build_systems/sip.py index c32c46ec467..744989e2d6e 100644 --- a/lib/spack/spack/build_systems/sip.py +++ b/lib/spack/spack/build_systems/sip.py @@ -64,24 +64,22 @@ def import_modules(self): list: list of strings of module names """ modules = [] + root = self.spec['python'].package.get_python_lib(prefix=self.prefix) - # Python libraries may be installed in lib or lib64 - # See issues #18520 and #17126 - for lib in ['lib', 'lib64']: - root = os.path.join(self.prefix, lib, 'python{0}'.format( - self.spec['python'].version.up_to(2)), 'site-packages') - # Some Python libraries are packages: collections of modules - # distributed in directories containing __init__.py files - for path in find(root, '__init__.py', recursive=True): - modules.append(path.replace(root + os.sep, '', 1).replace( - os.sep + '__init__.py', '').replace('/', '.')) - # Some Python libraries are modules: individual *.py files - # found in the site-packages directory - for path in find(root, '*.py', recursive=False): - modules.append(path.replace(root + os.sep, '', 1).replace( - '.py', '').replace('/', '.')) + # Some Python libraries are packages: collections of modules + # distributed in directories containing __init__.py files + for path in find(root, '__init__.py', recursive=True): + modules.append(path.replace(root + os.sep, '', 1).replace( + os.sep + '__init__.py', '').replace('/', '.')) + + # Some Python libraries are modules: individual *.py files + # found in the site-packages directory + for path in find(root, '*.py', recursive=False): + modules.append(path.replace(root + os.sep, '', 1).replace( + '.py', '').replace('/', '.')) tty.debug('Detected the following modules: {0}'.format(modules)) + return modules def python(self, *args, **kwargs): diff --git a/lib/spack/spack/ci.py b/lib/spack/spack/ci.py index 2ebbb842c5e..7f3d88a9257 100644 --- a/lib/spack/spack/ci.py +++ b/lib/spack/spack/ci.py @@ -1395,7 +1395,7 @@ def push_mirror_contents(env, spec, yaml_path, mirror_url, sign_binaries): # BaseException # object err_msg = 'Error msg: {0}'.format(inst) - if 'Access Denied' in err_msg: + if any(x in err_msg for x in ['Access Denied', 'InvalidAccessKeyId']): tty.msg('Permission problem writing to {0}'.format( mirror_url)) tty.msg(err_msg) diff --git a/lib/spack/spack/cmd/__init__.py b/lib/spack/spack/cmd/__init__.py index fc6b8603507..3944d5450e5 100644 --- a/lib/spack/spack/cmd/__init__.py +++ b/lib/spack/spack/cmd/__init__.py @@ -216,10 +216,10 @@ def disambiguate_spec(spec, env, local=False, installed=True, first=False): spec (spack.spec.Spec): a spec to disambiguate env (spack.environment.Environment): a spack environment, if one is active, or None if no environment is active - local (boolean, default False): do not search chained spack instances - installed (boolean or any, or spack.database.InstallStatus or iterable - of spack.database.InstallStatus): install status argument passed to - database query. See ``spack.database.Database._query`` for details. + local (bool): do not search chained spack instances + installed (bool or spack.database.InstallStatus or typing.Iterable): + install status argument passed to database query. + See ``spack.database.Database._query`` for details. """ hashes = env.all_hashes() if env else None return disambiguate_spec_from_hashes(spec, hashes, local, installed, first) @@ -231,11 +231,11 @@ def disambiguate_spec_from_hashes(spec, hashes, local=False, Arguments: spec (spack.spec.Spec): a spec to disambiguate - hashes (iterable): a set of hashes of specs among which to disambiguate - local (boolean, default False): do not search chained spack instances - installed (boolean or any, or spack.database.InstallStatus or iterable - of spack.database.InstallStatus): install status argument passed to - database query. See ``spack.database.Database._query`` for details. + hashes (typing.Iterable): a set of hashes of specs among which to disambiguate + local (bool): do not search chained spack instances + installed (bool or spack.database.InstallStatus or typing.Iterable): + install status argument passed to database query. + See ``spack.database.Database._query`` for details. """ if local: matching_specs = spack.store.db.query_local(spec, hashes=hashes, @@ -333,9 +333,8 @@ def display_specs(specs, args=None, **kwargs): namespace. Args: - specs (list of spack.spec.Spec): the specs to display - args (optional argparse.Namespace): namespace containing - formatting arguments + specs (list): the specs to display + args (argparse.Namespace or None): namespace containing formatting arguments Keyword Args: paths (bool): Show paths with each displayed spec @@ -348,9 +347,9 @@ def display_specs(specs, args=None, **kwargs): indent (int): indent each line this much groups (bool): display specs grouped by arch/compiler (default True) decorators (dict): dictionary mappng specs to decorators - header_callback (function): called at start of arch/compiler groups + header_callback (typing.Callable): called at start of arch/compiler groups all_headers (bool): show headers even when arch/compiler aren't defined - output (stream): A file object to write to. Default is ``sys.stdout`` + output (typing.IO): A file object to write to. Default is ``sys.stdout`` """ def get_arg(name, default=None): diff --git a/lib/spack/spack/cmd/analyze.py b/lib/spack/spack/cmd/analyze.py index c2a6ec6a27d..0bdf47e73f6 100644 --- a/lib/spack/spack/cmd/analyze.py +++ b/lib/spack/spack/cmd/analyze.py @@ -58,9 +58,9 @@ def analyze_spec(spec, analyzers=None, outdir=None, monitor=None, overwrite=Fals analyze_spec(spec, args.analyzers, args.outdir, monitor) Args: - spec (Spec): spec object of installed package + spec (spack.spec.Spec): spec object of installed package analyzers (list): list of analyzer (keys) to run - monitor (monitor.SpackMonitorClient): a monitor client + monitor (spack.monitor.SpackMonitorClient): a monitor client overwrite (bool): overwrite result if already exists """ analyzers = analyzers or list(spack.analyzers.analyzer_types.keys()) diff --git a/lib/spack/spack/cmd/bootstrap.py b/lib/spack/spack/cmd/bootstrap.py new file mode 100644 index 00000000000..2c95da117cb --- /dev/null +++ b/lib/spack/spack/cmd/bootstrap.py @@ -0,0 +1,110 @@ +# Copyright 2013-2021 Lawrence Livermore National Security, LLC and other +# Spack Project Developers. See the top-level COPYRIGHT file for details. +# +# SPDX-License-Identifier: (Apache-2.0 OR MIT) +import os.path +import shutil + +import llnl.util.tty + +import spack.cmd.common.arguments +import spack.config +import spack.main +import spack.util.path + +description = "manage bootstrap configuration" +section = "system" +level = "long" + + +def _add_scope_option(parser): + scopes = spack.config.scopes() + scopes_metavar = spack.config.scopes_metavar + parser.add_argument( + '--scope', choices=scopes, metavar=scopes_metavar, + help="configuration scope to read/modify" + ) + + +def setup_parser(subparser): + sp = subparser.add_subparsers(dest='subcommand') + + enable = sp.add_parser('enable', help='enable bootstrapping') + _add_scope_option(enable) + + disable = sp.add_parser('disable', help='disable bootstrapping') + _add_scope_option(disable) + + reset = sp.add_parser( + 'reset', help='reset bootstrapping configuration to Spack defaults' + ) + spack.cmd.common.arguments.add_common_arguments( + reset, ['yes_to_all'] + ) + + root = sp.add_parser( + 'root', help='get/set the root bootstrap directory' + ) + _add_scope_option(root) + root.add_argument( + 'path', nargs='?', default=None, + help='set the bootstrap directory to this value' + ) + + +def _enable_or_disable(args): + # Set to True if we called "enable", otherwise set to false + value = args.subcommand == 'enable' + spack.config.set('bootstrap:enable', value, scope=args.scope) + + +def _reset(args): + if not args.yes_to_all: + msg = [ + "Bootstrapping configuration is being reset to Spack's defaults. " + "Current configuration will be lost.\n", + "Do you want to continue?" + ] + ok_to_continue = llnl.util.tty.get_yes_or_no( + ''.join(msg), default=True + ) + if not ok_to_continue: + raise RuntimeError('Aborting') + + for scope in spack.config.config.file_scopes: + # The default scope should stay untouched + if scope.name == 'defaults': + continue + + # If we are in an env scope we can't delete a file, but the best we + # can do is nullify the corresponding configuration + if (scope.name.startswith('env') and + spack.config.get('bootstrap', scope=scope.name)): + spack.config.set('bootstrap', {}, scope=scope.name) + continue + + # If we are outside of an env scope delete the bootstrap.yaml file + bootstrap_yaml = os.path.join(scope.path, 'bootstrap.yaml') + backup_file = bootstrap_yaml + '.bkp' + if os.path.exists(bootstrap_yaml): + shutil.move(bootstrap_yaml, backup_file) + + +def _root(args): + if args.path: + spack.config.set('bootstrap:root', args.path, scope=args.scope) + + root = spack.config.get('bootstrap:root', default=None, scope=args.scope) + if root: + root = spack.util.path.canonicalize_path(root) + print(root) + + +def bootstrap(parser, args): + callbacks = { + 'enable': _enable_or_disable, + 'disable': _enable_or_disable, + 'reset': _reset, + 'root': _root + } + callbacks[args.subcommand](args) diff --git a/lib/spack/spack/cmd/buildcache.py b/lib/spack/spack/cmd/buildcache.py index ebad6bb4b7b..ea1297c726c 100644 --- a/lib/spack/spack/cmd/buildcache.py +++ b/lib/spack/spack/cmd/buildcache.py @@ -239,12 +239,13 @@ def find_matching_specs(pkgs, allow_multiple_matches=False, env=None): concretized specs given from cli Args: - pkgs (string): spec to be matched against installed packages + pkgs (str): spec to be matched against installed packages allow_multiple_matches (bool): if True multiple matches are admitted - env (Environment): active environment, or ``None`` if there is not one + env (spack.environment.Environment or None): active environment, or ``None`` + if there is not one Return: - list of specs + list: list of specs """ hashes = env.all_hashes() if env else None diff --git a/lib/spack/spack/cmd/clean.py b/lib/spack/spack/cmd/clean.py index 273b1789ade..3b663582939 100644 --- a/lib/spack/spack/cmd/clean.py +++ b/lib/spack/spack/cmd/clean.py @@ -9,6 +9,7 @@ import llnl.util.tty as tty +import spack.bootstrap import spack.caches import spack.cmd.common.arguments as arguments import spack.cmd.test @@ -102,7 +103,7 @@ def clean(parser, args): if args.bootstrap: msg = 'Removing software in "{0}"' - tty.msg(msg.format(spack.paths.user_bootstrap_store)) - with spack.store.use_store(spack.paths.user_bootstrap_store): + tty.msg(msg.format(spack.bootstrap.store_path())) + with spack.store.use_store(spack.bootstrap.store_path()): uninstall = spack.main.SpackCommand('uninstall') uninstall('-a', '-y') diff --git a/lib/spack/spack/cmd/create.py b/lib/spack/spack/cmd/create.py index a6808486736..bccf3bf66d8 100644 --- a/lib/spack/spack/cmd/create.py +++ b/lib/spack/spack/cmd/create.py @@ -636,7 +636,7 @@ def get_name(args): provided, extract the name from that. Otherwise, use a default. Args: - args (param argparse.Namespace): The arguments given to + args (argparse.Namespace): The arguments given to ``spack create`` Returns: @@ -709,8 +709,7 @@ def get_versions(args, name): name (str): The name of the package Returns: - str and BuildSystemGuesser: Versions and hashes, and a - BuildSystemGuesser object + tuple: versions and hashes, and a BuildSystemGuesser object """ # Default version with hash @@ -794,7 +793,8 @@ def get_repository(args, name): name (str): The name of the package to create Returns: - Repo: A Repo object capable of determining the path to the package file + spack.repo.Repo: A Repo object capable of determining the path to the + package file """ spec = Spec(name) # Figure out namespace for spec diff --git a/lib/spack/spack/cmd/dependents.py b/lib/spack/spack/cmd/dependents.py index 242a07da368..6097f46ff91 100644 --- a/lib/spack/spack/cmd/dependents.py +++ b/lib/spack/spack/cmd/dependents.py @@ -59,7 +59,7 @@ def get_dependents(pkg_name, ideps, transitive=False, dependents=None): Args: pkg_name (str): name of the package whose dependents should be returned ideps (dict): dictionary of dependents, from inverted_dependencies() - transitive (bool, optional): return transitive dependents when True + transitive (bool or None): return transitive dependents when True """ if dependents is None: dependents = set() diff --git a/lib/spack/spack/cmd/find.py b/lib/spack/spack/cmd/find.py index f532b684bd4..875c236164d 100644 --- a/lib/spack/spack/cmd/find.py +++ b/lib/spack/spack/cmd/find.py @@ -13,6 +13,7 @@ import llnl.util.tty as tty import llnl.util.tty.color as color +import spack.bootstrap import spack.cmd as cmd import spack.cmd.common.arguments as arguments import spack.environment as ev @@ -207,9 +208,10 @@ def find(parser, args): q_args = query_arguments(args) # Query the current store or the internal bootstrap store if required if args.bootstrap: + bootstrap_store_path = spack.bootstrap.store_path() msg = 'Showing internal bootstrap store at "{0}"' - tty.msg(msg.format(spack.paths.user_bootstrap_store)) - with spack.store.use_store(spack.paths.user_bootstrap_store): + tty.msg(msg.format(bootstrap_store_path)) + with spack.store.use_store(bootstrap_store_path): results = args.specs(**q_args) else: results = args.specs(**q_args) diff --git a/lib/spack/spack/cmd/install.py b/lib/spack/spack/cmd/install.py index 5a452a9232c..f71a788ec1a 100644 --- a/lib/spack/spack/cmd/install.py +++ b/lib/spack/spack/cmd/install.py @@ -198,9 +198,9 @@ def install_specs(cli_args, kwargs, specs): """Do the actual installation. Args: - cli_args (Namespace): argparse namespace with command arguments + cli_args (argparse.Namespace): argparse namespace with command arguments kwargs (dict): keyword arguments - specs (list of tuples): list of (abstract, concrete) spec tuples + specs (list): list of (abstract, concrete) spec tuples """ # handle active environment, if any diff --git a/lib/spack/spack/cmd/style.py b/lib/spack/spack/cmd/style.py index 0eceb4dc2d7..b2961261161 100644 --- a/lib/spack/spack/cmd/style.py +++ b/lib/spack/spack/cmd/style.py @@ -14,6 +14,7 @@ import llnl.util.tty.color as color from llnl.util.filesystem import working_dir +import spack.bootstrap import spack.paths from spack.util.executable import which @@ -38,15 +39,20 @@ def grouper(iterable, n, fillvalue=None): yield filter(None, group) -#: directory where spack style started, for relativizing paths -initial_working_dir = None +#: List of directories to exclude from checks -- relative to spack root +exclude_directories = [ + os.path.relpath(spack.paths.external_path, spack.paths.prefix), +] -#: List of directories to exclude from checks. -exclude_directories = [spack.paths.external_path] - -#: order in which tools should be run. flake8 is last so that it can +#: Order in which tools should be run. flake8 is last so that it can #: double-check the results of other tools (if, e.g., --fix was provided) -tool_order = ["isort", "mypy", "black", "flake8"] +#: The list maps an executable name to a spack spec needed to install it. +tool_order = [ + ("isort", "py-isort@4.3.5:"), + ("mypy", "py-mypy@0.900:"), + ("black", "py-black"), + ("flake8", "py-flake8"), +] #: tools we run in spack style tools = {} @@ -59,7 +65,7 @@ def is_package(f): packages, since we allow `from spack import *` and poking globals into packages. """ - return f.startswith("var/spack/repos/") or "docs/tutorial/examples" in f + return f.startswith("var/spack/repos/") #: decorator for adding tools to the list @@ -73,14 +79,29 @@ def __call__(self, fun): return fun -def changed_files(base=None, untracked=True, all_files=False): - """Get list of changed files in the Spack repository.""" +def changed_files(base="develop", untracked=True, all_files=False, root=None): + """Get list of changed files in the Spack repository. + + Arguments: + base (str): name of base branch to evaluate differences with. + untracked (bool): include untracked files in the list. + all_files (bool): list all files in the repository. + root (str): use this directory instead of the Spack prefix. + """ + if root is None: + root = spack.paths.prefix git = which("git", required=True) - # GITHUB_BASE_REF is set to the base branch for pull request actions - if base is None: - base = os.environ.get("GITHUB_BASE_REF", "develop") + # ensure base is in the repo + git("show-ref", "--verify", "--quiet", "refs/heads/%s" % base, + fail_on_error=False) + if git.returncode != 0: + tty.die( + "This repository does not have a '%s' branch." % base, + "spack style needs this branch to determine which files changed.", + "Ensure that '%s' exists, or specify files to check explicitly." % base + ) range = "{0}...".format(base) @@ -101,7 +122,10 @@ def changed_files(base=None, untracked=True, all_files=False): if all_files: git_args.append(["ls-files", "--exclude-standard"]) - excludes = [os.path.realpath(f) for f in exclude_directories] + excludes = [ + os.path.realpath(os.path.join(root, f)) + for f in exclude_directories + ] changed = set() for arg_list in git_args: @@ -126,8 +150,8 @@ def setup_parser(subparser): "-b", "--base", action="store", - default=None, - help="select base branch for collecting list of modified files", + default="develop", + help="branch to compare against to determine changed files (default: develop)", ) subparser.add_argument( "-a", @@ -181,14 +205,20 @@ def setup_parser(subparser): action="store_true", help="run black if available (default: skip black)", ) + subparser.add_argument( + "--root", + action="store", + default=None, + help="style check a different spack instance", + ) subparser.add_argument( "files", nargs=argparse.REMAINDER, help="specific files to check" ) -def cwd_relative(path): +def cwd_relative(path, args): """Translate prefix-relative path to current working directory-relative.""" - return os.path.relpath(os.path.join(spack.paths.prefix, path), initial_working_dir) + return os.path.relpath(os.path.join(args.root, path), args.initial_working_dir) def rewrite_and_print_output( @@ -198,7 +228,7 @@ def rewrite_and_print_output( # print results relative to current working directory def translate(match): return replacement.format( - cwd_relative(match.group(1)), *list(match.groups()[1:]) + cwd_relative(match.group(1), args), *list(match.groups()[1:]) ) for line in output.split("\n"): @@ -210,15 +240,15 @@ def translate(match): def print_style_header(file_list, args): - tools = [tool for tool in tool_order if getattr(args, tool)] - tty.msg("Running style checks on spack:", "selected: " + ", ".join(tools)) + tools = [tool for tool, _ in tool_order if getattr(args, tool)] + tty.msg("Running style checks on spack", "selected: " + ", ".join(tools)) # translate modified paths to cwd_relative if needed paths = [filename.strip() for filename in file_list] if not args.root_relative: - paths = [cwd_relative(filename) for filename in paths] + paths = [cwd_relative(filename, args) for filename in paths] - tty.msg("Modified files:", *paths) + tty.msg("Modified files", *paths) sys.stdout.flush() @@ -242,12 +272,9 @@ def run_flake8(flake8_cmd, file_list, args): # run in chunks of 100 at a time to avoid line length limit # filename parameter in config *does not work* for this reliably for chunk in grouper(file_list, 100): - output = flake8_cmd( - # use .flake8 implicitly to work around bug in flake8 upstream - # append-config is ignored if `--config` is explicitly listed - # see: https://gitlab.com/pycqa/flake8/-/issues/455 - # "--config=.flake8", + # always run with config from running spack prefix + "--config=%s" % os.path.join(spack.paths.prefix, ".flake8"), *chunk, fail_on_error=False, output=str @@ -262,12 +289,18 @@ def run_flake8(flake8_cmd, file_list, args): @tool("mypy") def run_mypy(mypy_cmd, file_list, args): - mpy_args = ["--package", "spack", "--package", "llnl", "--show-error-codes"] + # always run with config from running spack prefix + mypy_args = [ + "--config-file", os.path.join(spack.paths.prefix, "pyproject.toml"), + "--package", "spack", + "--package", "llnl", + "--show-error-codes", + ] # not yet, need other updates to enable this # if any([is_package(f) for f in file_list]): - # mpy_args.extend(["--package", "packages"]) + # mypy_args.extend(["--package", "packages"]) - output = mypy_cmd(*mpy_args, fail_on_error=False, output=str) + output = mypy_cmd(*mypy_args, fail_on_error=False, output=str) returncode = mypy_cmd.returncode rewrite_and_print_output(output, args) @@ -278,13 +311,16 @@ def run_mypy(mypy_cmd, file_list, args): @tool("isort") def run_isort(isort_cmd, file_list, args): - check_fix_args = () if args.fix else ("--check", "--diff") + # always run with config from running spack prefix + isort_args = ("--settings-file", os.path.join(spack.paths.prefix, "pyproject.toml")) + if not args.fix: + isort_args += ("--check", "--diff") pat = re.compile("ERROR: (.*) Imports are incorrectly sorted") replacement = "ERROR: {0} Imports are incorrectly sorted" returncode = 0 for chunk in grouper(file_list, 100): - packed_args = check_fix_args + tuple(chunk) + packed_args = isort_args + tuple(chunk) output = isort_cmd(*packed_args, fail_on_error=False, output=str, error=str) returncode |= isort_cmd.returncode @@ -296,7 +332,12 @@ def run_isort(isort_cmd, file_list, args): @tool("black") def run_black(black_cmd, file_list, args): - check_fix_args = () if args.fix else ("--check", "--diff", "--color") + # always run with config from running spack prefix + black_args = ("--config", os.path.join(spack.paths.prefix, "pyproject.toml")) + if not args.fix: + black_args += ("--check", "--diff") + if color.get_color_when(): # only show color when spack would + black_args += ("--color",) pat = re.compile("would reformat +(.*)") replacement = "would reformat {0}" @@ -305,50 +346,77 @@ def run_black(black_cmd, file_list, args): # run in chunks of 100 at a time to avoid line length limit # filename parameter in config *does not work* for this reliably for chunk in grouper(file_list, 100): - packed_args = check_fix_args + tuple(chunk) + packed_args = black_args + tuple(chunk) output = black_cmd(*packed_args, fail_on_error=False, output=str, error=str) returncode |= black_cmd.returncode rewrite_and_print_output(output, args, pat, replacement) print_tool_result("black", returncode) + return returncode def style(parser, args): + # ensure python version is new enough + if sys.version_info < (3, 6): + tty.die("spack style requires Python 3.6 or later.") + # save initial working directory for relativizing paths later - global initial_working_dir - initial_working_dir = os.getcwd() + args.initial_working_dir = os.getcwd() + + # ensure that the config files we need actually exist in the spack prefix. + # assertions b/c users should not ever see these errors -- they're checked in CI. + assert os.path.isfile(os.path.join(spack.paths.prefix, "pyproject.toml")) + assert os.path.isfile(os.path.join(spack.paths.prefix, ".flake8")) + + # validate spack root if the user provided one + args.root = os.path.realpath(args.root) if args.root else spack.paths.prefix + spack_script = os.path.join(args.root, "bin", "spack") + if not os.path.exists(spack_script): + tty.die( + "This does not look like a valid spack root.", + "No such file: '%s'" % spack_script + ) file_list = args.files if file_list: def prefix_relative(path): - return os.path.relpath( - os.path.abspath(os.path.realpath(path)), spack.paths.prefix - ) + return os.path.relpath(os.path.abspath(os.path.realpath(path)), args.root) file_list = [prefix_relative(p) for p in file_list] returncode = 0 - with working_dir(spack.paths.prefix): + with working_dir(args.root): if not file_list: file_list = changed_files(args.base, args.untracked, args.all) print_style_header(file_list, args) # run tools in order defined in tool_order returncode = 0 - for tool_name in tool_order: + for tool_name, tool_spec in tool_order: if getattr(args, tool_name): run_function, required = tools[tool_name] print_tool_header(tool_name) - cmd = which(tool_name, required=required) - if not cmd: - color.cprint(" @y{%s not in PATH, skipped}" % tool_name) - continue + try: + # Bootstrap tools so we don't need to require install + with spack.bootstrap.ensure_bootstrap_configuration(): + spec = spack.spec.Spec(tool_spec) + cmd = None + cmd = spack.bootstrap.get_executable( + tool_name, spec=spec, install=True + ) + if not cmd: + color.cprint(" @y{%s not in PATH, skipped}" % tool_name) + continue + returncode |= run_function(cmd, file_list, args) - returncode |= run_function(cmd, file_list, args) + except Exception as e: + raise spack.error.SpackError( + "Couldn't bootstrap %s:" % tool_name, str(e) + ) if returncode == 0: tty.msg(color.colorize("@*{spack style checks were clean}")) diff --git a/lib/spack/spack/cmd/uninstall.py b/lib/spack/spack/cmd/uninstall.py index 9d787a70a2e..ead4f8ac84c 100644 --- a/lib/spack/spack/cmd/uninstall.py +++ b/lib/spack/spack/cmd/uninstall.py @@ -69,12 +69,13 @@ def find_matching_specs(env, specs, allow_multiple_matches=False, force=False): concretized specs given from cli Args: - env (Environment): active environment, or ``None`` if there is not one + env (spack.environment.Environment): active environment, or ``None`` + if there is not one specs (list): list of specs to be matched against installed packages allow_multiple_matches (bool): if True multiple matches are admitted Return: - list of specs + list: list of specs """ # constrain uninstall resolution to current environment if one is active hashes = env.all_hashes() if env else None @@ -118,15 +119,13 @@ def installed_dependents(specs, env): Args: specs (list): list of Specs - env (Environment): the active environment, or None + env (spack.environment.Environment or None): the active environment, or None Returns: - (tuple of dicts): two mappings: one from specs to their dependent - environments in the active environment (or global scope if - there is no environment), and one from specs to their - dependents in *inactive* environments (empty if there is no - environment - + tuple: two mappings: one from specs to their dependent environments in the + active environment (or global scope if there is no environment), and one from + specs to their dependents in *inactive* environments (empty if there is no + environment """ active_dpts = {} inactive_dpts = {} @@ -155,9 +154,9 @@ def dependent_environments(specs): Args: specs (list): list of Specs - Returns: - (dict): mapping from spec to lists of dependent Environments + Returns: + dict: mapping from spec to lists of dependent Environments """ dependents = {} for env in ev.all_environments(): @@ -176,9 +175,10 @@ def inactive_dependent_environments(spec_envs): have no dependent environments. Return the result. Args: - (dict): mapping from spec to lists of dependent Environments + spec_envs (dict): mapping from spec to lists of dependent Environments + Returns: - (dict): mapping from spec to lists of *inactive* dependent Environments + dict: mapping from spec to lists of *inactive* dependent Environments """ spec_inactive_envs = {} for spec, de_list in spec_envs.items(): @@ -203,7 +203,8 @@ def do_uninstall(env, specs, force): """Uninstalls all the specs in a list. Args: - env (Environment): active environment, or ``None`` if there is not one + env (spack.environment.Environment or None): active environment, or ``None`` + if there is not one specs (list): list of specs to be uninstalled force (bool): force uninstallation (boolean) """ diff --git a/lib/spack/spack/cmd/url.py b/lib/spack/spack/cmd/url.py index 1576a4f7627..8d9232203f5 100644 --- a/lib/spack/spack/cmd/url.py +++ b/lib/spack/spack/cmd/url.py @@ -502,7 +502,7 @@ def remove_separators(version): Unfortunately, this also means that 1.23 and 12.3 are equal. Args: - version (str or Version): A version + version (str or spack.version.Version): A version Returns: str: The version with all separator characters removed diff --git a/lib/spack/spack/compilers/__init__.py b/lib/spack/spack/compilers/__init__.py index 537e8211c33..d60ab971bc3 100644 --- a/lib/spack/spack/compilers/__init__.py +++ b/lib/spack/spack/compilers/__init__.py @@ -135,8 +135,8 @@ def add_compilers_to_config(compilers, scope=None, init_config=True): """Add compilers to the config for the specified architecture. Arguments: - - compilers: a list of Compiler objects. - - scope: configuration scope to modify. + compilers: a list of Compiler objects. + scope: configuration scope to modify. """ compiler_config = get_compiler_config(scope, init_config) for compiler in compilers: @@ -151,8 +151,8 @@ def remove_compiler_from_config(compiler_spec, scope=None): """Remove compilers from the config, by spec. Arguments: - - compiler_specs: a list of CompilerSpec objects. - - scope: configuration scope to modify. + compiler_specs: a list of CompilerSpec objects. + scope: configuration scope to modify. """ # Need a better way for this global _cache_config_file @@ -544,8 +544,8 @@ def arguments_to_detect_version_fn(operating_system, paths): function by providing a method called with the same name. Args: - operating_system (OperatingSystem): the operating system on which - we are looking for compilers + operating_system (spack.architecture.OperatingSystem): the operating system + on which we are looking for compilers paths: paths to search for compilers Returns: @@ -649,7 +649,7 @@ def make_compiler_list(detected_versions): valid version Returns: - list of Compiler objects + list: list of Compiler objects """ group_fn = lambda x: (x.id, x.variation, x.language) sorted_compilers = sorted(detected_versions, key=group_fn) @@ -715,7 +715,7 @@ def is_mixed_toolchain(compiler): False otherwise. Args: - compiler (Compiler): a valid compiler object + compiler (spack.compiler.Compiler): a valid compiler object """ cc = os.path.basename(compiler.cc or '') cxx = os.path.basename(compiler.cxx or '') diff --git a/lib/spack/spack/config.py b/lib/spack/spack/config.py index 038a879a817..93399efb03c 100644 --- a/lib/spack/spack/config.py +++ b/lib/spack/spack/config.py @@ -17,8 +17,8 @@ And corresponding :ref:`per-platform scopes `. Important functions in this module are: -* :py:func:`get_config` -* :py:func:`update_config` +* :func:`~spack.config.Configuration.get_config` +* :func:`~spack.config.Configuration.update_config` ``get_config`` reads in YAML data for a particular scope and returns it. Callers can then modify the data and write it back with @@ -51,6 +51,7 @@ import spack.compilers import spack.paths import spack.schema +import spack.schema.bootstrap import spack.schema.compilers import spack.schema.config import spack.schema.env @@ -74,6 +75,7 @@ 'modules': spack.schema.modules.schema, 'config': spack.schema.config.schema, 'upstreams': spack.schema.upstreams.schema, + 'bootstrap': spack.schema.bootstrap.schema } # Same as above, but including keys for environments @@ -720,7 +722,7 @@ def override(path_or_scope, value=None): Arguments: path_or_scope (ConfigScope or str): scope or single option to override - value (object, optional): value for the single option + value (object or None): value for the single option Temporarily push a scope on the current configuration, then remove it after the context completes. If a single option is provided, create @@ -1161,7 +1163,7 @@ def default_modify_scope(section='config'): priority scope. Arguments: - section (boolean): Section for which to get the default scope. + section (bool): Section for which to get the default scope. If this is not 'compilers', a general (non-platform) scope is used. """ if section == 'compilers': diff --git a/lib/spack/spack/database.py b/lib/spack/spack/database.py index 60e93ed49b9..251d3964bcb 100644 --- a/lib/spack/spack/database.py +++ b/lib/spack/spack/database.py @@ -171,13 +171,13 @@ class InstallRecord(object): dependents left. Args: - spec (Spec): spec tracked by the install record + spec (spack.spec.Spec): spec tracked by the install record path (str): path where the spec has been installed installed (bool): whether or not the spec is currently installed ref_count (int): number of specs that depend on this one - explicit (bool, optional): whether or not this spec was explicitly + explicit (bool or None): whether or not this spec was explicitly installed, or pulled-in as a dependency of something else - installation_time (time, optional): time of the installation + installation_time (datetime.datetime or None): time of the installation """ def __init__( @@ -256,36 +256,36 @@ def __getattribute__(self, name): database. If it is a spec, we'll evaluate ``spec.satisfies(query_spec)`` - known (bool or any, optional): Specs that are "known" are those + known (bool or None): Specs that are "known" are those for which Spack can locate a ``package.py`` file -- i.e., Spack "knows" how to install them. Specs that are unknown may represent packages that existed in a previous version of Spack, but have since either changed their name or been removed - installed (bool or any, or InstallStatus or iterable of - InstallStatus, optional): if ``True``, includes only installed + installed (bool or InstallStatus or typing.Iterable or None): + if ``True``, includes only installed specs in the search; if ``False`` only missing specs, and if ``any``, all specs in database. If an InstallStatus or iterable of InstallStatus, returns specs whose install status (installed, deprecated, or missing) matches (one of) the InstallStatus. (default: True) - explicit (bool or any, optional): A spec that was installed + explicit (bool or None): A spec that was installed following a specific user request is marked as explicit. If instead it was pulled-in as a dependency of a user requested spec it's considered implicit. - start_date (datetime, optional): filters the query discarding - specs that have been installed before ``start_date``. + start_date (datetime.datetime or None): filters the query + discarding specs that have been installed before ``start_date``. - end_date (datetime, optional): filters the query discarding + end_date (datetime.datetime or None): filters the query discarding specs that have been installed after ``end_date``. - hashes (container): list or set of hashes that we can use to + hashes (typing.Container): list or set of hashes that we can use to restrict the search - in_buildcache (bool or any, optional): Specs that are marked in + in_buildcache (bool or None): Specs that are marked in this database as part of an associated binary cache are ``in_buildcache``. All other specs are not. This field is used for querying mirror indices. Default is ``any``. @@ -449,7 +449,7 @@ def clear_failure(self, spec, force=False): see `mark_failed()`. Args: - spec (Spec): the spec whose failure indicators are being removed + spec (spack.spec.Spec): the spec whose failure indicators are being removed force (bool): True if the failure information should be cleared when a prefix failure lock exists for the file or False if the failure should not be cleared (e.g., it may be @@ -1391,10 +1391,10 @@ def get_by_hash_local(self, *args, **kwargs): Arguments: dag_hash (str): hash (or hash prefix) to look up - default (object, optional): default value to return if dag_hash is + default (object or None): default value to return if dag_hash is not in the DB (default: None) - installed (bool or any, or InstallStatus or iterable of - InstallStatus, optional): if ``True``, includes only installed + installed (bool or InstallStatus or typing.Iterable or None): + if ``True``, includes only installed specs in the search; if ``False`` only missing specs, and if ``any``, all specs in database. If an InstallStatus or iterable of InstallStatus, returns specs whose install status @@ -1417,14 +1417,13 @@ def get_by_hash(self, dag_hash, default=None, installed=any): Arguments: dag_hash (str): hash (or hash prefix) to look up - default (object, optional): default value to return if dag_hash is + default (object or None): default value to return if dag_hash is not in the DB (default: None) - installed (bool or any, or InstallStatus or iterable of - InstallStatus, optional): if ``True``, includes only installed - specs in the search; if ``False`` only missing specs, and if - ``any``, all specs in database. If an InstallStatus or iterable - of InstallStatus, returns specs whose install status - (installed, deprecated, or missing) matches (one of) the + installed (bool or InstallStatus or typing.Iterable or None): + if ``True``, includes only installed specs in the search; if ``False`` + only missing specs, and if ``any``, all specs in database. If an + InstallStatus or iterable of InstallStatus, returns specs whose install + status (installed, deprecated, or missing) matches (one of) the InstallStatus. (default: any) ``installed`` defaults to ``any`` so that we can refer to any @@ -1596,7 +1595,7 @@ def update_explicit(self, spec, explicit): Update the spec's explicit state in the database. Args: - spec (Spec): the spec whose install record is being updated + spec (spack.spec.Spec): the spec whose install record is being updated explicit (bool): ``True`` if the package was requested explicitly by the user, ``False`` if it was pulled in as a dependency of an explicit package. diff --git a/lib/spack/spack/directives.py b/lib/spack/spack/directives.py index d9195d9ecdd..91deedbb5af 100644 --- a/lib/spack/spack/directives.py +++ b/lib/spack/spack/directives.py @@ -54,7 +54,7 @@ class OpenMpi(Package): from collections import Sequence -__all__ = [] +__all__ = ['DirectiveError', 'DirectiveMeta'] #: These are variant names used by Spack internally; packages can't use them reserved_names = ['patches', 'dev_path'] @@ -85,7 +85,7 @@ def make_when_spec(value): as part of concretization. Arguments: - value (Spec or bool): a conditional Spec or a constant ``bool`` + value (spack.spec.Spec or bool): a conditional Spec or a constant ``bool`` value indicating when a directive should be applied. """ @@ -187,12 +187,16 @@ def directive(dicts=None): Here's an example directive: + .. code-block:: python + @directive(dicts='versions') version(pkg, ...): ... This directive allows you write: + .. code-block:: python + class Foo(Package): version(...) @@ -392,8 +396,8 @@ def conflicts(conflict_spec, when=None, msg=None): conflicts('%intel', when='+foo') Args: - conflict_spec (Spec): constraint defining the known conflict - when (Spec): optional constraint that triggers the conflict + conflict_spec (spack.spec.Spec): constraint defining the known conflict + when (spack.spec.Spec): optional constraint that triggers the conflict msg (str): optional user defined message """ def _execute_conflicts(pkg): @@ -413,11 +417,11 @@ def depends_on(spec, when=None, type=default_deptype, patches=None): """Creates a dict of deps with specs defining when they apply. Args: - spec (Spec or str): the package and constraints depended on - when (Spec or str): when the dependent satisfies this, it has + spec (spack.spec.Spec or str): the package and constraints depended on + when (spack.spec.Spec or str): when the dependent satisfies this, it has the dependency represented by ``spec`` - type (str or tuple of str): str or tuple of legal Spack deptypes - patches (obj or list): single result of ``patch()`` directive, a + type (str or tuple): str or tuple of legal Spack deptypes + patches (typing.Callable or list): single result of ``patch()`` directive, a ``str`` to be passed to ``patch``, or a list of these This directive is to be used inside a Package definition to declare @@ -495,7 +499,7 @@ def patch(url_or_filename, level=1, when=None, working_dir=".", **kwargs): Args: url_or_filename (str): url or relative filename of the patch level (int): patch level (as in the patch shell command) - when (Spec): optional anonymous spec that specifies when to apply + when (spack.spec.Spec): optional anonymous spec that specifies when to apply the patch working_dir (str): dir to change to before applying @@ -559,12 +563,12 @@ def variant( specified otherwise the default will be False for a boolean variant and 'nothing' for a multi-valued variant description (str): description of the purpose of the variant - values (tuple or callable): either a tuple of strings containing the + values (tuple or typing.Callable): either a tuple of strings containing the allowed values, or a callable accepting one value and returning True if it is valid multi (bool): if False only one value per spec is allowed for this variant - validator (callable): optional group validator to enforce additional + validator (typing.Callable): optional group validator to enforce additional logic. It receives the package name, the variant name and a tuple of values and should raise an instance of SpackError if the group doesn't meet the additional constraints diff --git a/lib/spack/spack/environment.py b/lib/spack/spack/environment.py index c41d567bce1..f2ed7f39b08 100644 --- a/lib/spack/spack/environment.py +++ b/lib/spack/spack/environment.py @@ -116,11 +116,12 @@ def activate( use_env_repo (bool): use the packages exactly as they appear in the environment's repository add_view (bool): generate commands to add view to path variables - shell (string): One of `sh`, `csh`, `fish`. - prompt (string): string to add to the users prompt, or None + shell (str): One of `sh`, `csh`, `fish`. + prompt (str): string to add to the users prompt, or None Returns: - cmds: Shell commands to activate environment. + str: Shell commands to activate environment. + TODO: environment to use the activated spack environment. """ global _active_environment @@ -198,10 +199,10 @@ def deactivate(shell='sh'): """Undo any configuration or repo settings modified by ``activate()``. Arguments: - shell (string): One of `sh`, `csh`, `fish`. Shell style to use. + shell (str): One of `sh`, `csh`, `fish`. Shell style to use. Returns: - (string): shell commands for `shell` to undo environment variables + str: shell commands for `shell` to undo environment variables """ global _active_environment @@ -272,7 +273,7 @@ def find_environment(args): If an environment is found, read it in. If not, return None. Arguments: - args (Namespace): argparse namespace wtih command arguments + args (argparse.Namespace): argparse namespace wtih command arguments Returns: (Environment): a found environment, or ``None`` @@ -322,7 +323,7 @@ def get_env(args, cmd_name, required=False): message that says the calling command *needs* an active environment. Arguments: - args (Namespace): argparse namespace wtih command arguments + args (argparse.Namespace): argparse namespace wtih command arguments cmd_name (str): name of calling command required (bool): if ``True``, raise an exception when no environment is found; if ``False``, just return ``None`` @@ -550,7 +551,7 @@ def view(self, new=None): Raise if new is None and there is no current view Arguments: - new (string or None): If a string, create a FilesystemView + new (str or None): If a string, create a FilesystemView rooted at that path. Default None. This should only be used to regenerate the view, and cannot be used to access specs. """ @@ -851,7 +852,7 @@ def clear(self, re_read=False): """Clear the contents of the environment Arguments: - re_read (boolean): If True, do not clear ``new_specs`` nor + re_read (bool): If True, do not clear ``new_specs`` nor ``new_installs`` values. These values cannot be read from yaml, and need to be maintained when re-reading an existing environment. @@ -1119,11 +1120,11 @@ def develop(self, spec, path, clone=False): """Add dev-build info for package Args: - spec (Spec): Set constraints on development specs. Must include a + spec (spack.spec.Spec): Set constraints on development specs. Must include a concrete version. - path (string): Path to find code for developer builds. Relative + path (str): Path to find code for developer builds. Relative paths will be resolved relative to the environment. - clone (bool, default False): Clone the package code to the path. + clone (bool): Clone the package code to the path. If clone is False Spack will assume the code is already present at ``path``. @@ -1552,7 +1553,7 @@ def install_all(self, args=None, **install_args): that needs to be done separately with a call to write(). Args: - args (Namespace): argparse namespace with command arguments + args (argparse.Namespace): argparse namespace with command arguments install_args (dict): keyword install arguments """ self.install_specs(None, args=args, **install_args) diff --git a/lib/spack/spack/fetch_strategy.py b/lib/spack/spack/fetch_strategy.py index 3eee59349ee..f5eecdcb5d5 100644 --- a/lib/spack/spack/fetch_strategy.py +++ b/lib/spack/spack/fetch_strategy.py @@ -1254,8 +1254,9 @@ def __init__(self, **kwargs): @property def hg(self): - """:returns: The hg executable - :rtype: Executable + """ + Returns: + Executable: the hg executable """ if not self._hg: self._hg = which('hg', required=True) @@ -1405,7 +1406,7 @@ def from_kwargs(**kwargs): ``version()`` directive in a package. Returns: - fetch_strategy: The fetch strategy that matches the args, based + typing.Callable: The fetch strategy that matches the args, based on attribute names (e.g., ``git``, ``hg``, etc.) Raises: diff --git a/lib/spack/spack/hash_types.py b/lib/spack/spack/hash_types.py index 554665e24a9..5e122c308b5 100644 --- a/lib/spack/spack/hash_types.py +++ b/lib/spack/spack/hash_types.py @@ -19,12 +19,15 @@ class SpecHashDescriptor(object): We currently use different hashes for different use cases. """ - hash_types = ('_dag_hash', '_build_hash', '_full_hash') + hash_types = ('_dag_hash', '_build_hash', '_full_hash', '_package_hash') - def __init__(self, deptype=('link', 'run'), package_hash=False, attr=None): + def __init__(self, deptype=('link', 'run'), package_hash=False, attr=None, + override=None): self.deptype = dp.canonical_deptype(deptype) self.package_hash = package_hash self.attr = attr + # Allow spec hashes to have an alternate computation method + self.override = override #: Default Hash descriptor, used by Spec.dag_hash() and stored in the DB. @@ -40,3 +43,9 @@ def __init__(self, deptype=('link', 'run'), package_hash=False, attr=None): #: Full hash used in build pipelines to determine when to rebuild packages. full_hash = SpecHashDescriptor( deptype=('build', 'link', 'run'), package_hash=True, attr='_full_hash') + + +#: Package hash used as part of full hash +package_hash = SpecHashDescriptor( + deptype=(), package_hash=True, attr='_package_hash', + override=lambda s: s.package.content_hash()) diff --git a/lib/spack/spack/install_test.py b/lib/spack/spack/install_test.py index 9142bb448c7..200eaed4ec7 100644 --- a/lib/spack/spack/install_test.py +++ b/lib/spack/spack/install_test.py @@ -28,7 +28,7 @@ def get_escaped_text_output(filename): filename (str): path to the file Returns: - (list of str): escaped text lines read from the file + list: escaped text lines read from the file """ with open(filename, 'r') as f: # Ensure special characters are escaped as needed diff --git a/lib/spack/spack/installer.py b/lib/spack/spack/installer.py index c6eebf30410..1d0b2212577 100644 --- a/lib/spack/spack/installer.py +++ b/lib/spack/spack/installer.py @@ -93,7 +93,7 @@ def _check_last_phase(pkg): package already. Args: - pkg (PackageBase): the package being installed + pkg (spack.package.PackageBase): the package being installed Raises: ``BadInstallPhase`` if stop_before or last phase is invalid @@ -115,10 +115,11 @@ def _handle_external_and_upstream(pkg, explicit): database if it is external package. Args: - pkg (Package): the package whose installation is under consideration + pkg (spack.package.Package): the package whose installation is under + consideration explicit (bool): the package was explicitly requested by the user Return: - (bool): ``True`` if the package is external or upstream (so not to + bool: ``True`` if the package is external or upstream (so not to be installed locally), otherwise, ``True`` """ # For external packages the workflow is simplified, and basically @@ -148,7 +149,7 @@ def _do_fake_install(pkg): and libraries. Args: - pkg (PackageBase): the package whose installation is to be faked + pkg (spack.package.PackageBase): the package whose installation is to be faked """ command = pkg.name @@ -194,15 +195,14 @@ def _packages_needed_to_bootstrap_compiler(compiler, architecture, pkgs): compiler (CompilerSpec): the compiler to bootstrap architecture (ArchSpec): the architecture for which to boostrap the compiler - pkgs (list of PackageBase): the packages that may need their compiler + pkgs (list): the packages that may need their compiler installed Return: - (list) list of tuples, (PackageBase, bool), for concretized compiler- - -related packages that need to be installed and bool values - specify whether the package is the bootstrap compiler - (``True``) or one of its dependencies (``False``). The list - will be empty if there are no compilers. + list: list of tuples, (PackageBase, bool), for concretized compiler-related + packages that need to be installed and bool values specify whether the + package is the bootstrap compiler (``True``) or one of its dependencies + (``False``). The list will be empty if there are no compilers. """ tty.debug('Bootstrapping {0} compiler'.format(compiler)) compilers = spack.compilers.compilers_for_spec( @@ -260,7 +260,7 @@ def _install_from_cache(pkg, cache_only, explicit, unsigned=False, Extract the package from binary cache Args: - pkg (PackageBase): the package to install from the binary cache + pkg (spack.package.PackageBase): the package to install from the binary cache cache_only (bool): only extract from binary cache explicit (bool): ``True`` if installing the package was explicitly requested by the user, otherwise, ``False`` @@ -268,7 +268,7 @@ def _install_from_cache(pkg, cache_only, explicit, unsigned=False, otherwise, ``False`` Return: - (bool) ``True`` if the package was extract from binary cache, + bool: ``True`` if the package was extract from binary cache, ``False`` otherwise """ installed_from_cache = _try_install_from_binary_cache( @@ -350,8 +350,8 @@ def _process_binary_cache_tarball(pkg, binary_spec, explicit, unsigned, Process the binary cache tarball. Args: - pkg (PackageBase): the package being installed - binary_spec (Spec): the spec whose cache has been confirmed + pkg (spack.package.PackageBase): the package being installed + binary_spec (spack.spec.Spec): the spec whose cache has been confirmed explicit (bool): the package was explicitly requested by the user unsigned (bool): ``True`` if binary package signatures to be checked, otherwise, ``False`` @@ -359,7 +359,7 @@ def _process_binary_cache_tarball(pkg, binary_spec, explicit, unsigned, attempting to download the tarball Return: - (bool) ``True`` if the package was extracted from binary cache, + bool: ``True`` if the package was extracted from binary cache, else ``False`` """ tarball = binary_distribution.download_tarball( @@ -385,7 +385,7 @@ def _try_install_from_binary_cache(pkg, explicit, unsigned=False, Try to extract the package from binary cache. Args: - pkg (PackageBase): the package to be extracted from binary cache + pkg (spack.package.PackageBase): the package to be extracted from binary cache explicit (bool): the package was explicitly requested by the user unsigned (bool): ``True`` if binary package signatures to be checked, otherwise, ``False`` @@ -423,7 +423,7 @@ def combine_phase_logs(phase_log_files, log_path): Args: phase_log_files (list): a list or iterator of logs to combine - log_path (path): the path to combine them to + log_path (str): the path to combine them to """ with open(log_path, 'w') as log_file: @@ -441,7 +441,7 @@ def dump_packages(spec, path): node in the DAG. Args: - spec (Spec): the Spack spec whose package information is to be dumped + spec (spack.spec.Spec): the Spack spec whose package information is to be dumped path (str): the path to the build packages directory """ fs.mkdirp(path) @@ -498,10 +498,10 @@ def get_dependent_ids(spec): Return a list of package ids for the spec's dependents Args: - spec (Spec): Concretized spec + spec (spack.spec.Spec): Concretized spec Returns: - (list of str): list of package ids + list: list of package ids """ return [package_id(d.package) for d in spec.dependents()] @@ -512,10 +512,10 @@ def install_msg(name, pid): Args: name (str): Name/id of the package being installed - pid (id): id of the installer process + pid (int): id of the installer process Return: - (str) Colorized installing message + str: Colorized installing message """ pre = '{0}: '.format(pid) if tty.show_pid() else '' return pre + colorize('@*{Installing} @*g{%s}' % name) @@ -526,7 +526,7 @@ def log(pkg): Copy provenance into the install directory on success Args: - pkg (Package): the package that was built and installed + pkg (spack.package.Package): the package that was built and installed """ packages_dir = spack.store.layout.build_packages_path(pkg.spec) @@ -608,7 +608,8 @@ def package_id(pkg): and packages for combinatorial environments. Args: - pkg (PackageBase): the package from which the identifier is derived + pkg (spack.package.PackageBase): the package from which the identifier is + derived """ if not pkg.spec.concrete: raise ValueError("Cannot provide a unique, readable id when " @@ -631,11 +632,11 @@ def __init__(self, installs=[]): """ Initialize the installer. Args: - installs (list of (pkg, install_args)): list of tuples, where each + installs (list): list of tuples, where each tuple consists of a package (PackageBase) and its associated install arguments (dict) Return: - (PackageInstaller) instance + PackageInstaller: instance """ # List of build requests self.build_requests = [BuildRequest(pkg, install_args) @@ -691,7 +692,8 @@ def _add_bootstrap_compilers( Args: compiler: the compiler to boostrap architecture: the architecture for which to bootstrap the compiler - pkgs (PackageBase): the package with possible compiler dependencies + pkgs (spack.package.PackageBase): the package with possible compiler + dependencies request (BuildRequest): the associated install request all_deps (defaultdict(set)): dictionary of all dependencies and associated dependents @@ -707,7 +709,7 @@ def _add_init_task(self, pkg, request, is_compiler, all_deps): Creates and queus the initial build task for the package. Args: - pkg (Package): the package to be built and installed + pkg (spack.package.Package): the package to be built and installed request (BuildRequest or None): the associated install request where ``None`` can be used to indicate the package was explicitly requested by the user @@ -726,7 +728,7 @@ def _check_db(self, spec): """Determine if the spec is flagged as installed in the database Args: - spec (Spec): spec whose database install status is being checked + spec (spack.spec.Spec): spec whose database install status is being checked Return: (rec, installed_in_db) tuple where rec is the database record, or @@ -887,7 +889,7 @@ def _cleanup_task(self, pkg): Cleanup the build task for the spec Args: - pkg (PackageBase): the package being installed + pkg (spack.package.PackageBase): the package being installed """ self._remove_task(package_id(pkg)) @@ -901,7 +903,7 @@ def _ensure_install_ready(self, pkg): already locked. Args: - pkg (PackageBase): the package being locally installed + pkg (spack.package.PackageBase): the package being locally installed """ pkg_id = package_id(pkg) pre = "{0} cannot be installed locally:".format(pkg_id) @@ -933,7 +935,7 @@ def _ensure_locked(self, lock_type, pkg): Args: lock_type (str): 'read' for a read lock, 'write' for a write lock - pkg (PackageBase): the package whose spec is being installed + pkg (spack.package.PackageBase): the package whose spec is being installed Return: (lock_type, lock) tuple where lock will be None if it could not @@ -1294,7 +1296,7 @@ def _setup_install_dir(self, pkg): Write a small metadata file with the current spack environment. Args: - pkg (Package): the package to be built and installed + pkg (spack.package.Package): the package to be built and installed """ if not os.path.exists(pkg.spec.prefix): tty.verbose('Creating the installation directory {0}' @@ -1369,9 +1371,9 @@ def _flag_installed(self, pkg, dependent_ids=None): known dependents. Args: - pkg (Package): Package that has been installed locally, externally - or upstream - dependent_ids (list of str or None): list of the package's + pkg (spack.package.Package): Package that has been installed locally, + externally or upstream + dependent_ids (list or None): list of the package's dependent ids, or None if the dependent ids are limited to those maintained in the package (dependency DAG) """ @@ -1422,7 +1424,7 @@ def install(self): Install the requested package(s) and or associated dependencies. Args: - pkg (Package): the package to be built and installed""" + pkg (spack.package.Package): the package to be built and installed""" self._init_queue() fail_fast_err = 'Terminating after first install failure' @@ -1692,6 +1694,12 @@ def build_process(pkg, kwargs): verbose = kwargs.get('verbose', False) timer = Timer() + + # If we are using a padded path, filter the output to compress padded paths + # The real log still has full-length paths. + filter_padding = spack.config.get("config:install_tree:padded_length", None) + filter_fn = spack.util.path.padding_filter if filter_padding else None + if not fake: if not skip_patch: pkg.do_patch() @@ -1764,8 +1772,10 @@ def build_process(pkg, kwargs): try: # DEBUGGING TIP - to debug this section, insert an IPython # embed here, and run the sections below without log capture - with log_output(log_file, echo, True, - env=unmodified_env) as logger: + with log_output( + log_file, echo, True, env=unmodified_env, + filter_fn=filter_fn + ) as logger: with logger.force_echo(): inner_debug_level = tty.debug_level() @@ -1825,7 +1835,7 @@ def __init__(self, pkg, request, compiler, start, attempts, status, Instantiate a build task for a package. Args: - pkg (Package): the package to be built and installed + pkg (spack.package.Package): the package to be built and installed request (BuildRequest or None): the associated install request where ``None`` can be used to indicate the package was explicitly requested by the user @@ -1833,7 +1843,7 @@ def __init__(self, pkg, request, compiler, start, attempts, status, start (int): the initial start time for the package, in seconds attempts (int): the number of attempts to install the package status (str): the installation status - installed (list of str): the identifiers of packages that have + installed (list): the identifiers of packages that have been installed so far """ @@ -1975,7 +1985,7 @@ def flag_installed(self, installed): Ensure the dependency is not considered to still be uninstalled. Args: - installed (list of str): the identifiers of packages that have + installed (list): the identifiers of packages that have been installed so far """ now_installed = self.uninstalled_deps & set(installed) @@ -2016,7 +2026,7 @@ def __init__(self, pkg, install_args): Instantiate a build request for a package. Args: - pkg (Package): the package to be built and installed + pkg (spack.package.Package): the package to be built and installed install_args (dict): the install arguments associated with ``pkg`` """ # Ensure dealing with a package that has a concrete spec @@ -2091,10 +2101,11 @@ def get_deptypes(self, pkg): """Determine the required dependency types for the associated package. Args: - pkg (PackageBase): explicit or implicit package being installed + pkg (spack.package.PackageBase): explicit or implicit package being + installed Returns: - (tuple) required dependency type(s) for the package + tuple: required dependency type(s) for the package """ deptypes = ['link', 'run'] include_build_deps = self.install_args.get('include_build_deps') @@ -2113,10 +2124,11 @@ def run_tests(self, pkg): """Determine if the tests should be run for the provided packages Args: - pkg (PackageBase): explicit or implicit package being installed + pkg (spack.package.PackageBase): explicit or implicit package being + installed Returns: - (bool) ``True`` if they should be run; ``False`` otherwise + bool: ``True`` if they should be run; ``False`` otherwise """ tests = self.install_args.get('tests', False) return tests is True or (tests and pkg.name in tests) diff --git a/lib/spack/spack/main.py b/lib/spack/spack/main.py index ea65ab99df9..d237db8904d 100644 --- a/lib/spack/spack/main.py +++ b/lib/spack/spack/main.py @@ -530,7 +530,7 @@ def __call__(self, *argv, **kwargs): """Invoke this SpackCommand. Args: - argv (list of str): command line arguments. + argv (list): command line arguments. Keyword Args: fail_on_error (optional bool): Don't raise an exception on error @@ -625,7 +625,7 @@ def print_setup_info(*info): """Print basic information needed by setup-env.[c]sh. Args: - info (list of str): list of things to print: comma-separated list + info (list): list of things to print: comma-separated list of 'csh', 'sh', or 'modules' This is in ``main.py`` to make it fast; the setup scripts need to @@ -689,7 +689,7 @@ def main(argv=None): """This is the entry point for the Spack command. Args: - argv (list of str or None): command line arguments, NOT including + argv (list or None): command line arguments, NOT including the executable name. If None, parses from sys.argv. """ # Create a parser with a simple positional argument first. We'll @@ -782,7 +782,10 @@ def main(argv=None): raise sys.stderr.write('\n') tty.error("Keyboard interrupt.") - return signal.SIGINT.value + if sys.version_info >= (3, 5): + return signal.SIGINT.value + else: + return signal.SIGINT except SystemExit as e: if spack.config.get('config:debug'): diff --git a/lib/spack/spack/mixins.py b/lib/spack/spack/mixins.py index 596aabebecb..7a3c03d4e3c 100644 --- a/lib/spack/spack/mixins.py +++ b/lib/spack/spack/mixins.py @@ -19,7 +19,8 @@ import llnl.util.filesystem __all__ = [ - 'filter_compiler_wrappers' + 'filter_compiler_wrappers', + 'PackageMixinsMeta', ] diff --git a/lib/spack/spack/modules/lmod.py b/lib/spack/spack/modules/lmod.py index 38b1dd1705b..0dcd78c20c5 100644 --- a/lib/spack/spack/modules/lmod.py +++ b/lib/spack/spack/modules/lmod.py @@ -30,7 +30,7 @@ def configuration(module_set_name): return config -#: Caches the configuration {spec_hash: configuration} +# Caches the configuration {spec_hash: configuration} configuration_registry = {} # type: Dict[str, Any] diff --git a/lib/spack/spack/modules/tcl.py b/lib/spack/spack/modules/tcl.py index 8b5e823e5e1..ee6e31a7eeb 100644 --- a/lib/spack/spack/modules/tcl.py +++ b/lib/spack/spack/modules/tcl.py @@ -29,7 +29,7 @@ def configuration(module_set_name): return config -#: Caches the configuration {spec_hash: configuration} +# Caches the configuration {spec_hash: configuration} configuration_registry = {} # type: Dict[str, Any] diff --git a/lib/spack/spack/package.py b/lib/spack/spack/package.py index e3299b3bdcd..2f63af13773 100644 --- a/lib/spack/spack/package.py +++ b/lib/spack/spack/package.py @@ -465,7 +465,7 @@ def test_log_pathname(test_stage, spec): Args: test_stage (str): path to the test stage directory - spec (Spec): instance of the spec under test + spec (spack.spec.Spec): instance of the spec under test Returns: (str): the pathname of the test log file @@ -725,14 +725,14 @@ def possible_dependencies( """Return dict of possible dependencies of this package. Args: - transitive (bool, optional): return all transitive dependencies if + transitive (bool or None): return all transitive dependencies if True, only direct dependencies if False (default True).. - expand_virtuals (bool, optional): expand virtual dependencies into + expand_virtuals (bool or None): expand virtual dependencies into all possible implementations (default True) - deptype (str or tuple, optional): dependency types to consider - visited (dicct, optional): dict of names of dependencies visited so + deptype (str or tuple or None): dependency types to consider + visited (dict or None): dict of names of dependencies visited so far, mapped to their immediate dependencies' names. - missing (dict, optional): dict to populate with packages and their + missing (dict or None): dict to populate with packages and their *missing* dependencies. virtuals (set): if provided, populate with virtuals seen so far. @@ -1756,7 +1756,7 @@ def cache_extra_test_sources(self, srcs): during install testing. Args: - srcs (str or list of str): relative path for files and or + srcs (str or list): relative path for files and or subdirectories located in the staged source path that are to be copied to the corresponding location(s) under the install testing directory. @@ -1803,10 +1803,10 @@ def run_test(self, exe, options=[], expected=[], status=0, Args: exe (str): the name of the executable - options (str or list of str): list of options to pass to the runner - expected (str or list of str): list of expected output strings. + options (str or list): list of options to pass to the runner + expected (str or list): list of expected output strings. Each string is a regex expected to match part of the output. - status (int or list of int): possible passing status values + status (int or list): possible passing status values with 0 meaning the test is expected to succeed installed (bool): if ``True``, the executable must be in the install prefix @@ -2010,9 +2010,9 @@ def setup_build_environment(self, env): Spack's store. Args: - env (EnvironmentModifications): environment modifications to be - applied when the package is built. Package authors can call - methods on it to alter the build environment. + env (spack.util.environment.EnvironmentModifications): environment + modifications to be applied when the package is built. Package authors + can call methods on it to alter the build environment. """ legacy_fn = self._get_legacy_environment_method('setup_environment') if legacy_fn: @@ -2023,9 +2023,9 @@ def setup_run_environment(self, env): """Sets up the run environment for a package. Args: - env (EnvironmentModifications): environment modifications to be - applied when the package is run. Package authors can call - methods on it to alter the run environment. + env (spack.util.environment.EnvironmentModifications): environment + modifications to be applied when the package is run. Package authors + can call methods on it to alter the run environment. """ legacy_fn = self._get_legacy_environment_method('setup_environment') if legacy_fn: @@ -2052,11 +2052,11 @@ def setup_dependent_build_environment(self, env, dependent_spec): variable. Args: - env (EnvironmentModifications): environment modifications to be - applied when the dependent package is built. Package authors - can call methods on it to alter the build environment. + env (spack.util.environment.EnvironmentModifications): environment + modifications to be applied when the dependent package is built. + Package authors can call methods on it to alter the build environment. - dependent_spec (Spec): the spec of the dependent package + dependent_spec (spack.spec.Spec): the spec of the dependent package about to be built. This allows the extendee (self) to query the dependent's state. Note that *this* package's spec is available as ``self.spec`` @@ -2079,11 +2079,11 @@ def setup_dependent_run_environment(self, env, dependent_spec): for dependencies. Args: - env (EnvironmentModifications): environment modifications to be - applied when the dependent package is run. Package authors - can call methods on it to alter the build environment. + env (spack.util.environment.EnvironmentModifications): environment + modifications to be applied when the dependent package is run. + Package authors can call methods on it to alter the build environment. - dependent_spec (Spec): The spec of the dependent package + dependent_spec (spack.spec.Spec): The spec of the dependent package about to be run. This allows the extendee (self) to query the dependent's state. Note that *this* package's spec is available as ``self.spec`` @@ -2125,7 +2125,7 @@ def setup_dependent_package(self, module, dependent_spec): object of the dependent package. Packages can use this to set module-scope variables for the dependent to use. - dependent_spec (Spec): The spec of the dependent package + dependent_spec (spack.spec.Spec): The spec of the dependent package about to be built. This allows the extendee (self) to query the dependent's state. Note that *this* package's spec is available as ``self.spec``. diff --git a/lib/spack/spack/patch.py b/lib/spack/spack/patch.py index 68691554f4d..a273514636d 100644 --- a/lib/spack/spack/patch.py +++ b/lib/spack/spack/patch.py @@ -28,7 +28,7 @@ def apply_patch(stage, patch_path, level=1, working_dir='.'): Args: stage (spack.stage.Stage): stage with code that will be patched patch_path (str): filesystem location for the patch to apply - level (int, optional): patch level (default 1) + level (int or None): patch level (default 1) working_dir (str): relative path *within* the stage to change to (default '.') """ diff --git a/lib/spack/spack/paths.py b/lib/spack/spack/paths.py index 6b41049de85..76eb9dfdac9 100644 --- a/lib/spack/spack/paths.py +++ b/lib/spack/spack/paths.py @@ -11,10 +11,10 @@ """ import os -from llnl.util.filesystem import ancestor +import llnl.util.filesystem #: This file lives in $prefix/lib/spack/spack/__file__ -prefix = ancestor(__file__, 4) +prefix = llnl.util.filesystem.ancestor(__file__, 4) #: synonym for prefix spack_root = prefix @@ -53,7 +53,6 @@ #: User configuration location user_config_path = os.path.expanduser('~/.spack') user_bootstrap_path = os.path.join(user_config_path, 'bootstrap') -user_bootstrap_store = os.path.join(user_bootstrap_path, 'store') reports_path = os.path.join(user_config_path, "reports") monitor_path = os.path.join(reports_path, "monitor") diff --git a/lib/spack/spack/relocate.py b/lib/spack/spack/relocate.py index ef1d2e9456d..c6af4d96e73 100644 --- a/lib/spack/spack/relocate.py +++ b/lib/spack/spack/relocate.py @@ -869,7 +869,7 @@ def is_relocatable(spec): """Returns True if an installed spec is relocatable. Args: - spec (Spec): spec to be analyzed + spec (spack.spec.Spec): spec to be analyzed Returns: True if the binaries of an installed spec diff --git a/lib/spack/spack/repo.py b/lib/spack/spack/repo.py index 706fe40dd26..ef1d684cadd 100644 --- a/lib/spack/spack/repo.py +++ b/lib/spack/spack/repo.py @@ -662,7 +662,7 @@ def repo_for_pkg(self, spec): if namespace: fullspace = get_full_namespace(namespace) if fullspace not in self.by_namespace: - raise UnknownNamespaceError(spec.namespace) + raise UnknownNamespaceError(namespace) return self.by_namespace[fullspace] # If there's no namespace, search in the RepoPath. diff --git a/lib/spack/spack/schema/bootstrap.py b/lib/spack/spack/schema/bootstrap.py new file mode 100644 index 00000000000..0505f090033 --- /dev/null +++ b/lib/spack/spack/schema/bootstrap.py @@ -0,0 +1,26 @@ +# Copyright 2013-2021 Lawrence Livermore National Security, LLC and other +# Spack Project Developers. See the top-level COPYRIGHT file for details. +# +# SPDX-License-Identifier: (Apache-2.0 OR MIT) +"""Schema for bootstrap.yaml configuration file.""" + +properties = { + 'bootstrap': { + 'type': 'object', + 'properties': { + 'enable': {'type': 'boolean'}, + 'root': { + 'type': 'string' + }, + } + } +} + +#: Full schema with metadata +schema = { + '$schema': 'http://json-schema.org/schema#', + 'title': 'Spack bootstrap configuration file schema', + 'type': 'object', + 'additionalProperties': False, + 'properties': properties, +} diff --git a/lib/spack/spack/schema/merged.py b/lib/spack/spack/schema/merged.py index 9555f7b1947..11db4f78df7 100644 --- a/lib/spack/spack/schema/merged.py +++ b/lib/spack/spack/schema/merged.py @@ -10,6 +10,7 @@ """ from llnl.util.lang import union_dicts +import spack.schema.bootstrap import spack.schema.cdash import spack.schema.compilers import spack.schema.config @@ -23,6 +24,7 @@ #: Properties for inclusion in other schemas properties = union_dicts( + spack.schema.bootstrap.properties, spack.schema.cdash.properties, spack.schema.compilers.properties, spack.schema.config.properties, diff --git a/lib/spack/spack/solver/asp.py b/lib/spack/spack/solver/asp.py index bb83fd4b5c4..2fb20d914ad 100644 --- a/lib/spack/spack/solver/asp.py +++ b/lib/spack/spack/solver/asp.py @@ -679,14 +679,14 @@ def condition(self, required_spec, imposed_spec=None, name=None): """Generate facts for a dependency or virtual provider condition. Arguments: - required_spec (Spec): the spec that triggers this condition - imposed_spec (optional, Spec): the sepc with constraints that + required_spec (spack.spec.Spec): the spec that triggers this condition + imposed_spec (spack.spec.Spec or None): the sepc with constraints that are imposed when this condition is triggered - name (optional, str): name for `required_spec` (required if + name (str or None): name for `required_spec` (required if required_spec is anonymous, ignored if not) Returns: - (int): id of the condition created by this function + int: id of the condition created by this function """ named_cond = required_spec.copy() named_cond.name = named_cond.name or name @@ -922,7 +922,7 @@ def spec_clauses(self, spec, body=False, transitive=True): """Return a list of clauses for a spec mandates are true. Arguments: - spec (Spec): the spec to analyze + spec (spack.spec.Spec): the spec to analyze body (bool): if True, generate clauses to be used in rule bodies (final values) instead of rule heads (setters). transitive (bool): if False, don't generate clauses from diff --git a/lib/spack/spack/spec.py b/lib/spack/spack/spec.py index 7a69dad8819..af282e44254 100644 --- a/lib/spack/spack/spec.py +++ b/lib/spack/spack/spec.py @@ -122,7 +122,9 @@ __all__ = [ + 'CompilerSpec', 'Spec', + 'SpecParser', 'parse', 'SpecParseError', 'DuplicateDependencyError', @@ -143,7 +145,9 @@ 'AmbiguousHashError', 'InvalidHashError', 'NoSuchHashError', - 'RedundantSpecError'] + 'RedundantSpecError', + 'SpecDeprecatedError', +] #: Valid pattern for an identifier in Spack identifier_re = r'\w[\w-]*' @@ -1030,9 +1034,8 @@ class Spec(object): #: Cache for spec's prefix, computed lazily in the corresponding property _prefix = None - def __init__(self, spec_like=None, - normal=False, concrete=False, external_path=None, - external_modules=None, full_hash=None): + def __init__(self, spec_like=None, normal=False, + concrete=False, external_path=None, external_modules=None): """Create a new Spec. Arguments: @@ -1046,8 +1049,6 @@ def __init__(self, spec_like=None, self._concrete = concrete self.external_path = external_path self.external_module = external_module - self._full_hash = full_hash - """ # Copy if spec_like is a Spec. @@ -1068,6 +1069,8 @@ def __init__(self, spec_like=None, self._hash = None self._build_hash = None + self._full_hash = None + self._package_hash = None self._dunder_hash = None self._package = None @@ -1082,7 +1085,6 @@ def __init__(self, spec_like=None, self._concrete = concrete self.external_path = external_path self.external_modules = Spec._format_module_list(external_modules) - self._full_hash = full_hash # Older spack versions did not compute full_hash or build_hash, # and we may not have the necessary information to recompute them @@ -1497,10 +1499,12 @@ def _spec_hash(self, hash): """Utility method for computing different types of Spec hashes. Arguments: - hash (SpecHashDescriptor): type of hash to generate. + hash (spack.hash_types.SpecHashDescriptor): type of hash to generate. """ # TODO: curently we strip build dependencies by default. Rethink # this when we move to using package hashing on all specs. + if hash.override is not None: + return hash.override(self) node_dict = self.to_node_dict(hash=hash) yaml_text = syaml.dump(node_dict, default_flow_style=True) return spack.util.hash.b32_hash(yaml_text) @@ -1513,7 +1517,7 @@ def _cached_hash(self, hash, length=None): in the supplied attribute on this spec. Arguments: - hash (SpecHashDescriptor): type of hash to generate. + hash (spack.hash_types.SpecHashDescriptor): type of hash to generate. """ if not hash.attr: return self._spec_hash(hash)[:length] @@ -1528,6 +1532,10 @@ def _cached_hash(self, hash, length=None): return hash_string[:length] + def package_hash(self): + """Compute the hash of the contents of the package for this node""" + return self._cached_hash(ht.package_hash) + def dag_hash(self, length=None): """This is Spack's default hash, used to identify installations. @@ -1611,7 +1619,7 @@ def to_node_dict(self, hash=ht.dag_hash): hashes). Arguments: - hash (SpecHashDescriptor) type of hash to generate. + hash (spack.hash_types.SpecHashDescriptor) type of hash to generate. """ d = syaml.syaml_dict() @@ -1653,7 +1661,7 @@ def to_node_dict(self, hash=ht.dag_hash): d['patches'] = variant._patches_in_order_of_appearance if hash.package_hash: - package_hash = self.package.content_hash() + package_hash = self.package_hash() # Full hashes are in bytes if (not isinstance(package_hash, six.text_type) @@ -1822,6 +1830,7 @@ def from_node_dict(node): spec._hash = node.get('hash', None) spec._build_hash = node.get('build_hash', None) spec._full_hash = node.get('full_hash', None) + spec._package_hash = node.get('package_hash', None) if 'version' in node or 'versions' in node: spec.versions = vn.VersionList.from_dict(node) @@ -2982,7 +2991,7 @@ def ensure_valid_variants(spec): spec (Spec): spec to be analyzed Raises: - UnknownVariantError: on the first unknown variant found + spack.variant.UnknownVariantError: on the first unknown variant found """ pkg_cls = spec.package_class pkg_variants = pkg_cls.variants @@ -3441,12 +3450,14 @@ def _dup(self, other, deps=True, cleardeps=True, caches=None): self._dunder_hash = other._dunder_hash self._normal = other._normal self._full_hash = other._full_hash + self._package_hash = other._package_hash else: self._hash = None self._build_hash = None self._dunder_hash = None self._normal = False self._full_hash = None + self._package_hash = None return changed @@ -4281,19 +4292,22 @@ def splice(self, other, transitive): # _dependents of these specs should not be trusted. # Variants may also be ignored here for now... + # Keep all cached hashes because we will invalidate the ones that need + # invalidating later, and we don't want to invalidate unnecessarily + if transitive: - self_nodes = dict((s.name, s.copy(deps=False)) + self_nodes = dict((s.name, s.copy(deps=False, caches=True)) for s in self.traverse(root=True) if s.name not in other) - other_nodes = dict((s.name, s.copy(deps=False)) + other_nodes = dict((s.name, s.copy(deps=False, caches=True)) for s in other.traverse(root=True)) else: # If we're not doing a transitive splice, then we only want the # root of other. - self_nodes = dict((s.name, s.copy(deps=False)) + self_nodes = dict((s.name, s.copy(deps=False, caches=True)) for s in self.traverse(root=True) if s.name != other.name) - other_nodes = {other.name: other.copy(deps=False)} + other_nodes = {other.name: other.copy(deps=False, caches=True)} nodes = other_nodes.copy() nodes.update(self_nodes) @@ -4314,17 +4328,41 @@ def splice(self, other, transitive): if any(dep not in other_nodes for dep in dependencies): nodes[name].build_spec = other[name].build_spec - # Clear cached hashes - nodes[self.name].clear_cached_hashes() + ret = nodes[self.name] + + # Clear cached hashes for all affected nodes + # Do not touch unaffected nodes + for dep in ret.traverse(root=True, order='post'): + opposite = other_nodes if dep.name in self_nodes else self_nodes + if any(name in dep for name in opposite.keys()): + # Record whether hashes are already cached + # So we don't try to compute a hash from insufficient + # provenance later + has_build_hash = getattr(dep, ht.build_hash.attr, None) + has_full_hash = getattr(dep, ht.full_hash.attr, None) + + # package hash cannot be affected by splice + dep.clear_cached_hashes(ignore=['_package_hash']) + + # Since this is a concrete spec, we want to make sure hashes + # are cached writing specs only writes cached hashes in case + # the spec is too old to have full provenance for these hashes, + # so we can't rely on doing it at write time. + if has_build_hash: + _ = dep.build_hash() + if has_full_hash: + _ = dep.full_hash() + return nodes[self.name] - def clear_cached_hashes(self): + def clear_cached_hashes(self, ignore=()): """ Clears all cached hashes in a Spec, while preserving other properties. """ for attr in ht.SpecHashDescriptor.hash_types: - if hasattr(self, attr): - setattr(self, attr, None) + if attr not in ignore: + if hasattr(self, attr): + setattr(self, attr, None) def __hash__(self): # If the spec is concrete, we leverage the DAG hash and just use @@ -4403,6 +4441,7 @@ def __init__(self): class SpecParser(spack.parse.Parser): + """Parses specs.""" def __init__(self, initial_spec=None): """Construct a new SpecParser. diff --git a/lib/spack/spack/stage.py b/lib/spack/spack/stage.py index 1ca2ed5637a..e4d34a20df3 100644 --- a/lib/spack/spack/stage.py +++ b/lib/spack/spack/stage.py @@ -565,8 +565,9 @@ def cache_mirror(self, mirror, stats): """Perform a fetch if the resource is not already cached Arguments: - mirror (MirrorCache): the mirror to cache this Stage's resource in - stats (MirrorStats): this is updated depending on whether the + mirror (spack.caches.MirrorCache): the mirror to cache this Stage's + resource in + stats (spack.mirror.MirrorStats): this is updated depending on whether the caching operation succeeded or failed """ if isinstance(self.default_fetcher, fs.BundleFetchStrategy): @@ -835,7 +836,7 @@ def get_checksums_for_versions( Args: url_dict (dict): A dictionary of the form: version -> URL name (str): The name of the package - first_stage_function (callable): function that takes a Stage and a URL; + first_stage_function (typing.Callable): function that takes a Stage and a URL; this is run on the stage of the first URL downloaded keep_stage (bool): whether to keep staging area when command completes batch (bool): whether to ask user how many versions to fetch (false) diff --git a/lib/spack/spack/store.py b/lib/spack/spack/store.py index 4fcd96cdd87..a04ece20275 100644 --- a/lib/spack/spack/store.py +++ b/lib/spack/spack/store.py @@ -193,6 +193,7 @@ def deserialize(token): def _store(): """Get the singleton store instance.""" + import spack.bootstrap config_dict = spack.config.get('config') root, unpadded_root, projections = parse_install_tree(config_dict) hash_length = spack.config.get('config:install_hash_length') @@ -201,7 +202,8 @@ def _store(): # reserved by Spack to bootstrap its own dependencies, since this would # lead to bizarre behaviors (e.g. cleaning the bootstrap area would wipe # user installed software) - if spack.paths.user_bootstrap_store == root: + enable_bootstrap = spack.config.get('bootstrap:enable', True) + if enable_bootstrap and spack.bootstrap.store_path() == root: msg = ('please change the install tree root "{0}" in your ' 'configuration [path reserved for Spack internal use]') raise ValueError(msg.format(root)) diff --git a/lib/spack/spack/test/bindist.py b/lib/spack/spack/test/bindist.py index 2e6d5994224..76d51aa3f2c 100644 --- a/lib/spack/spack/test/bindist.py +++ b/lib/spack/spack/test/bindist.py @@ -10,12 +10,15 @@ import py import pytest +import llnl.util.filesystem as fs + import spack.binary_distribution as bindist import spack.config import spack.hooks.sbang as sbang import spack.main import spack.mirror import spack.repo +import spack.spec as spec import spack.store import spack.util.gpg import spack.util.web as web_util @@ -589,3 +592,55 @@ def test_update_sbang(tmpdir, test_mirror): open(str(installed_script_style_2_path)).read() uninstall_cmd('-y', '/%s' % new_spec.dag_hash()) + + +@pytest.mark.usefixtures( + 'install_mockery_mutable_config', 'mock_packages', 'mock_fetch', +) +def test_update_index_fix_deps(monkeypatch, tmpdir, mutable_config): + """Ensure spack buildcache update-index properly fixes up spec.yaml + files on the mirror when updating the buildcache index.""" + + # Create a temp mirror directory for buildcache usage + mirror_dir = tmpdir.join('mirror_dir') + mirror_url = 'file://{0}'.format(mirror_dir.strpath) + spack.config.set('mirrors', {'test': mirror_url}) + + a = Spec('a').concretized() + b = Spec('b').concretized() + new_b_full_hash = 'abcdef' + + # Install package a with dep b + install_cmd('--no-cache', a.name) + + # Create a buildcache for a and its dep b, and update index + buildcache_cmd('create', '-uad', mirror_dir.strpath, a.name) + buildcache_cmd('update-index', '-d', mirror_dir.strpath) + + # Simulate an update to b that only affects full hash by simply overwriting + # the full hash in the spec.yaml file on the mirror + b_spec_yaml_name = bindist.tarball_name(b, '.spec.yaml') + b_spec_yaml_path = os.path.join(mirror_dir.strpath, + bindist.build_cache_relative_path(), + b_spec_yaml_name) + fs.filter_file(r"full_hash:\s[^\s]+$", + "full_hash: {0}".format(new_b_full_hash), + b_spec_yaml_path) + + # When we update the index, spack should notice that a's notion of the + # full hash of b doesn't match b's notion of it's own full hash, and as + # a result, spack should fix the spec.yaml for a + buildcache_cmd('update-index', '-d', mirror_dir.strpath) + + # Read in the concrete spec yaml of a + a_spec_yaml_name = bindist.tarball_name(a, '.spec.yaml') + a_spec_yaml_path = os.path.join(mirror_dir.strpath, + bindist.build_cache_relative_path(), + a_spec_yaml_name) + + # Turn concrete spec yaml into a concrete spec (a) + with open(a_spec_yaml_path) as fd: + a_prime = spec.Spec.from_yaml(fd.read()) + + # Make sure the full hash of b in a's spec yaml matches the new value + assert(a_prime[b.name].full_hash() == new_b_full_hash) diff --git a/lib/spack/spack/test/bootstrap.py b/lib/spack/spack/test/bootstrap.py index 97687ddb4df..fccf67e569c 100644 --- a/lib/spack/spack/test/bootstrap.py +++ b/lib/spack/spack/test/bootstrap.py @@ -6,6 +6,7 @@ import spack.bootstrap import spack.store +import spack.util.path @pytest.mark.regression('22294') @@ -22,5 +23,29 @@ def test_store_is_restored_correctly_after_bootstrap(mutable_config, tmpdir): # Test that within the context manager we use the bootstrap store # and that outside we restore the correct location with spack.bootstrap.ensure_bootstrap_configuration(): - assert spack.store.root == spack.paths.user_bootstrap_store + assert spack.store.root == spack.bootstrap.store_path() assert spack.store.root == user_path + + +@pytest.mark.parametrize('config_value,expected', [ + # Absolute path without expansion + ('/opt/spack/bootstrap', '/opt/spack/bootstrap/store'), + # Path with placeholder + ('$spack/opt/bootstrap', '$spack/opt/bootstrap/store'), +]) +def test_store_path_customization(config_value, expected, mutable_config): + # Set the current configuration to a specific value + spack.config.set('bootstrap:root', config_value) + + # Check the store path + current = spack.bootstrap.store_path() + assert current == spack.util.path.canonicalize_path(expected) + + +def test_raising_exception_if_bootstrap_disabled(mutable_config): + # Disable bootstrapping in config.yaml + spack.config.set('bootstrap:enable', False) + + # Check the correct exception is raised + with pytest.raises(RuntimeError, match='bootstrapping is currently disabled'): + spack.bootstrap.store_path() diff --git a/lib/spack/spack/test/cmd/bootstrap.py b/lib/spack/spack/test/cmd/bootstrap.py new file mode 100644 index 00000000000..0537d85faa4 --- /dev/null +++ b/lib/spack/spack/test/cmd/bootstrap.py @@ -0,0 +1,101 @@ +# Copyright 2013-2021 Lawrence Livermore National Security, LLC and other +# Spack Project Developers. See the top-level COPYRIGHT file for details. +# +# SPDX-License-Identifier: (Apache-2.0 OR MIT) +import os.path + +import pytest + +import spack.config +import spack.environment +import spack.main + +_bootstrap = spack.main.SpackCommand('bootstrap') + + +@pytest.mark.parametrize('scope', [ + None, 'site', 'system', 'user' +]) +def test_enable_and_disable(mutable_config, scope): + scope_args = [] + if scope: + scope_args = ['--scope={0}'.format(scope)] + + _bootstrap('enable', *scope_args) + assert spack.config.get('bootstrap:enable', scope=scope) is True + + _bootstrap('disable', *scope_args) + assert spack.config.get('bootstrap:enable', scope=scope) is False + + +@pytest.mark.parametrize('scope', [ + None, 'site', 'system', 'user' +]) +def test_root_get_and_set(mutable_config, scope): + scope_args, path = [], '/scratch/spack/bootstrap' + if scope: + scope_args = ['--scope={0}'.format(scope)] + + _bootstrap('root', path, *scope_args) + out = _bootstrap('root', *scope_args, output=str) + assert out.strip() == path + + +@pytest.mark.parametrize('scopes', [ + ('site',), + ('system', 'user') +]) +def test_reset_in_file_scopes(mutable_config, scopes): + # Assert files are created in the right scopes + bootstrap_yaml_files = [] + for s in scopes: + _bootstrap('disable', '--scope={0}'.format(s)) + scope_path = spack.config.config.scopes[s].path + bootstrap_yaml = os.path.join( + scope_path, 'bootstrap.yaml' + ) + assert os.path.exists(bootstrap_yaml) + bootstrap_yaml_files.append(bootstrap_yaml) + + _bootstrap('reset', '-y') + for bootstrap_yaml in bootstrap_yaml_files: + assert not os.path.exists(bootstrap_yaml) + + +def test_reset_in_environment(mutable_mock_env_path, mutable_config): + env = spack.main.SpackCommand('env') + env('create', 'bootstrap-test') + current_environment = spack.environment.read('bootstrap-test') + + with current_environment: + _bootstrap('disable') + assert spack.config.get('bootstrap:enable') is False + _bootstrap('reset', '-y') + # We have no default settings in tests + assert spack.config.get('bootstrap:enable') is None + + # Check that reset didn't delete the entire file + spack_yaml = os.path.join(current_environment.path, 'spack.yaml') + assert os.path.exists(spack_yaml) + + +def test_reset_in_file_scopes_overwrites_backup_files(mutable_config): + # Create a bootstrap.yaml with some config + _bootstrap('disable', '--scope=site') + scope_path = spack.config.config.scopes['site'].path + bootstrap_yaml = os.path.join(scope_path, 'bootstrap.yaml') + assert os.path.exists(bootstrap_yaml) + + # Reset the bootstrap configuration + _bootstrap('reset', '-y') + backup_file = bootstrap_yaml + '.bkp' + assert not os.path.exists(bootstrap_yaml) + assert os.path.exists(backup_file) + + # Iterate another time + _bootstrap('disable', '--scope=site') + assert os.path.exists(bootstrap_yaml) + assert os.path.exists(backup_file) + _bootstrap('reset', '-y') + assert not os.path.exists(bootstrap_yaml) + assert os.path.exists(backup_file) diff --git a/lib/spack/spack/test/cmd/style.py b/lib/spack/spack/test/cmd/style.py index ceaae5f694d..65a301bc273 100644 --- a/lib/spack/spack/test/cmd/style.py +++ b/lib/spack/spack/test/cmd/style.py @@ -3,6 +3,7 @@ # # SPDX-License-Identifier: (Apache-2.0 OR MIT) +import filecmp import os import shutil import sys @@ -17,8 +18,20 @@ from spack.cmd.style import changed_files from spack.util.executable import which +#: directory with sample style files +style_data = os.path.join(spack.paths.test_path, 'data', 'style') + + style = spack.main.SpackCommand("style") +# spack style requires git to run -- skip the tests if it's not there +pytestmark = pytest.mark.skipif(not which('git'), reason='requires git') + +# The style tools have requirements to use newer Python versions. We simplify by +# requiring Python 3.6 or higher to run spack style. +skip_old_python = pytest.mark.skipif( + sys.version_info < (3, 6), reason='requires Python 3.6 or higher') + @pytest.fixture(scope="function") def flake8_package(): @@ -50,6 +63,9 @@ def flake8_package_with_errors(scope="function"): shutil.copy(filename, tmp) package = FileFilter(filename) package.filter("state = 'unmodified'", "state = 'modified'", string=True) + package.filter( + "from spack import *", "from spack import *\nimport os", string=True + ) yield filename finally: shutil.move(tmp, filename) @@ -65,6 +81,24 @@ def test_changed_files(flake8_package): assert flake8_package in files +def test_changed_no_base(tmpdir, capfd): + """Ensure that we fail gracefully with no base branch.""" + tmpdir.join("bin").ensure("spack") + git = which("git", required=True) + with tmpdir.as_cwd(): + git("init") + git("config", "user.name", "test user") + git("config", "user.email", "test@user.com") + git("add", ".") + git("commit", "-m", "initial commit") + + with pytest.raises(SystemExit): + changed_files(base="foobar") + + out, err = capfd.readouterr() + assert "This repository does not have a 'foobar' branch." in err + + def test_changed_files_all_files(flake8_package): # it's hard to guarantee "all files", so do some sanity checks. files = set([ @@ -92,12 +126,134 @@ def test_changed_files_all_files(flake8_package): assert not any(f.startswith(spack.paths.external_path) for f in files) -# As of flake8 3.0.0, Python 2.6 and 3.3 are no longer supported -# http://flake8.pycqa.org/en/latest/release-notes/3.0.0.html -skip_old_python = pytest.mark.skipif( - sys.version_info[:2] <= (2, 6) or (3, 0) <= sys.version_info[:2] <= (3, 3), - reason="flake8 no longer supports Python 2.6 or 3.3 and older", -) +@pytest.mark.skipif(sys.version_info >= (3, 6), reason="doesn't apply to newer python") +def test_fail_on_old_python(): + """Ensure that `spack style` runs but fails with older python.""" + style(fail_on_error=False) + assert style.returncode != 0 + + +@skip_old_python +def test_bad_root(tmpdir): + """Ensure that `spack style` doesn't run on non-spack directories.""" + style("--root", str(tmpdir), fail_on_error=False) + assert style.returncode != 0 + + +def test_style_is_package(tmpdir): + """Ensure the is_package() function works.""" + assert spack.cmd.style.is_package( + "var/spack/repos/builtin/packages/hdf5/package.py" + ) + assert spack.cmd.style.is_package( + "var/spack/repos/builtin/packages/zlib/package.py" + ) + assert not spack.cmd.style.is_package("lib/spack/spack/spec.py") + assert not spack.cmd.style.is_package("lib/spack/external/pytest.py") + + +@skip_old_python +def test_bad_bootstrap(monkeypatch): + """Ensure we fail gracefully when we can't bootstrap spack style.""" + monkeypatch.setattr(spack.cmd.style, "tool_order", [ + ("foobartool", "foobartool"), # bad package to force concretization failure + ]) + style(fail_on_error=False) + assert style.returncode != 0 + + +@pytest.fixture +def external_style_root(flake8_package_with_errors, tmpdir): + """Create a mock git repository for running spack style.""" + git = which("git", required=True) + + # create a sort-of spack-looking directory + script = tmpdir / "bin" / "spack" + script.ensure() + spack_dir = tmpdir / "lib" / "spack" / "spack" + spack_dir.ensure("__init__.py") + llnl_dir = tmpdir / "lib" / "spack" / "llnl" + llnl_dir.ensure("__init__.py") + + # create a base develop branch + with tmpdir.as_cwd(): + git("init") + git("config", "user.name", "test user") + git("config", "user.email", "test@user.com") + git("add", ".") + git("commit", "-m", "initial commit") + git("branch", "-m", "develop") + git("checkout", "-b", "feature") + + # copy the buggy package in + py_file = spack_dir / "dummy.py" + py_file.ensure() + shutil.copy(flake8_package_with_errors, str(py_file)) + + # add the buggy file on the feature branch + with tmpdir.as_cwd(): + git("add", str(py_file)) + git("commit", "-m", "add new file") + + yield tmpdir, py_file + + +@skip_old_python +@pytest.mark.skipif(not which("black"), reason="black is not installed.") +@pytest.mark.skipif(not which("flake8"), reason="flake8 is not installed.") +def test_fix_style(external_style_root): + """Make sure spack style --fix works.""" + tmpdir, py_file = external_style_root + + broken_dummy = os.path.join(style_data, "broken.dummy") + broken_py = str(tmpdir / "lib" / "spack" / "spack" / "broken.py") + fixed_py = os.path.join(style_data, "fixed.py") + + shutil.copy(broken_dummy, broken_py) + assert not filecmp.cmp(broken_py, fixed_py) + + output = style( + "--root", str(tmpdir), + "--no-mypy", # mypy doesn't fix, so skip it + "--no-flake8", # flake8 doesn't fix, so skip it + "--black", + "--fix", + ) + print(output) + assert filecmp.cmp(broken_py, fixed_py) + + +@skip_old_python +@pytest.mark.skipif(not which("flake8"), reason="flake8 is not installed.") +@pytest.mark.skipif(not which("isort"), reason="isort is not installed.") +@pytest.mark.skipif(not which("mypy"), reason="mypy is not installed.") +@pytest.mark.skipif(not which("black"), reason="black is not installed.") +def test_external_root(external_style_root): + """Ensure we can run in a separate root directory w/o configuration files.""" + tmpdir, py_file = external_style_root + + # make sure tools are finding issues with external root, + # not the real one. + output = style( + "--root-relative", "--black", "--root", str(tmpdir), + fail_on_error=False + ) + + # make sure it failed + assert style.returncode != 0 + + # isort error + assert "%s Imports are incorrectly sorted" % str(py_file) in output + + # mypy error + assert 'lib/spack/spack/dummy.py:10: error: Name "Package" 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:7: [F401] 'os' imported but unused" in output @skip_old_python @@ -138,7 +294,7 @@ def test_style_with_errors(flake8_package_with_errors): root_relative = os.path.relpath(flake8_package_with_errors, spack.paths.prefix) output = style("--root-relative", flake8_package_with_errors, fail_on_error=False) assert root_relative in output - assert style.returncode == 1 + assert style.returncode != 0 assert "spack style found errors" in output @@ -148,5 +304,5 @@ def test_style_with_errors(flake8_package_with_errors): def test_style_with_black(flake8_package_with_errors): output = style("--black", flake8_package_with_errors, fail_on_error=False) assert "black found errors" in output - assert style.returncode == 1 + assert style.returncode != 0 assert "spack style found errors" in output diff --git a/lib/spack/spack/test/data/style/broken.dummy b/lib/spack/spack/test/data/style/broken.dummy new file mode 100644 index 00000000000..5044a2f476c --- /dev/null +++ b/lib/spack/spack/test/data/style/broken.dummy @@ -0,0 +1,12 @@ +# Copyright 2013-2021 Lawrence Livermore National Security, LLC and other +# Spack Project Developers. See the top-level COPYRIGHT file for details. +# +# SPDX-License-Identifier: (Apache-2.0 OR MIT) + +import sys +import os + +def this_is_a_function(): + """This is a docstring.""" + def this_should_be_offset(): + sys.stdout.write(os.name) diff --git a/lib/spack/spack/test/data/style/fixed.py b/lib/spack/spack/test/data/style/fixed.py new file mode 100644 index 00000000000..76eec009c65 --- /dev/null +++ b/lib/spack/spack/test/data/style/fixed.py @@ -0,0 +1,14 @@ +# Copyright 2013-2021 Lawrence Livermore National Security, LLC and other +# Spack Project Developers. See the top-level COPYRIGHT file for details. +# +# SPDX-License-Identifier: (Apache-2.0 OR MIT) + +import os +import sys + + +def this_is_a_function(): + """This is a docstring.""" + + def this_should_be_offset(): + sys.stdout.write(os.name) diff --git a/lib/spack/spack/test/installer.py b/lib/spack/spack/test/installer.py index 76dddc9a4f1..485fbb1536b 100644 --- a/lib/spack/spack/test/installer.py +++ b/lib/spack/spack/test/installer.py @@ -65,7 +65,7 @@ def create_build_task(pkg, install_args={}): Create a built task for the given (concretized) package Args: - pkg (PackageBase): concretized package associated with the task + pkg (spack.package.PackageBase): concretized package associated with the task install_args (dict): dictionary of kwargs (or install args) Return: @@ -80,10 +80,10 @@ def create_installer(installer_args): Create an installer using the concretized spec for each arg Args: - installer_args (list of tuples): the list of (spec name, kwargs) tuples + installer_args (list): the list of (spec name, kwargs) tuples Return: - installer (PackageInstaller): the associated package installer + spack.installer.PackageInstaller: the associated package installer """ const_arg = [(spec.package, kwargs) for spec, kwargs in installer_args] return inst.PackageInstaller(const_arg) @@ -93,11 +93,11 @@ def installer_args(spec_names, kwargs={}): """Return a the installer argument with each spec paired with kwargs Args: - spec_names (list of str): list of spec names + spec_names (list): list of spec names kwargs (dict or None): install arguments to apply to all of the specs Returns: - list of (spec, kwargs): the installer constructor argument + list: list of (spec, kwargs), the installer constructor argument """ arg = [] for name in spec_names: diff --git a/lib/spack/spack/test/llnl/util/tty/log.py b/lib/spack/spack/test/llnl/util/tty/log.py index 279985001dc..a65073e6571 100644 --- a/lib/spack/spack/test/llnl/util/tty/log.py +++ b/lib/spack/spack/test/llnl/util/tty/log.py @@ -78,6 +78,39 @@ def test_log_python_output_and_echo_output(capfd, tmpdir): assert capfd.readouterr()[0] == 'force echo\n' +def _log_filter_fn(string): + return string.replace("foo", "bar") + + +def test_log_output_with_filter(capfd, tmpdir): + with tmpdir.as_cwd(): + with log_output('foo.txt', filter_fn=_log_filter_fn): + print('foo blah') + print('blah foo') + print('foo foo') + + # foo.txt output is not filtered + with open('foo.txt') as f: + assert f.read() == 'foo blah\nblah foo\nfoo foo\n' + + # output is not echoed + assert capfd.readouterr()[0] == '' + + # now try with echo + with tmpdir.as_cwd(): + with log_output('foo.txt', echo=True, filter_fn=_log_filter_fn): + print('foo blah') + print('blah foo') + print('foo foo') + + # foo.txt output is still not filtered + with open('foo.txt') as f: + assert f.read() == 'foo blah\nblah foo\nfoo foo\n' + + # echoed output is filtered. + assert capfd.readouterr()[0] == 'bar blah\nblah bar\nbar bar\n' + + @pytest.mark.skipif(not which('echo'), reason="needs echo command") def test_log_subproc_and_echo_output_no_capfd(capfd, tmpdir): echo = which('echo') diff --git a/lib/spack/spack/test/spec_semantics.py b/lib/spack/spack/test/spec_semantics.py index c21be384911..acf0116cfb0 100644 --- a/lib/spack/spack/test/spec_semantics.py +++ b/lib/spack/spack/test/spec_semantics.py @@ -1027,6 +1027,36 @@ def test_splice(self, transitive): # Finally, the spec should know it's been spliced: assert out.spliced + @pytest.mark.parametrize('transitive', [True, False]) + def test_splice_with_cached_hashes(self, transitive): + spec = Spec('splice-t') + dep = Spec('splice-h+foo') + spec.concretize() + dep.concretize() + + # monkeypatch hashes so we can test that they are cached + spec._full_hash = 'aaaaaa' + spec._build_hash = 'aaaaaa' + dep._full_hash = 'bbbbbb' + dep._build_hash = 'bbbbbb' + spec['splice-h']._full_hash = 'cccccc' + spec['splice-h']._build_hash = 'cccccc' + spec['splice-z']._full_hash = 'dddddd' + spec['splice-z']._build_hash = 'dddddd' + dep['splice-z']._full_hash = 'eeeeee' + dep['splice-z']._build_hash = 'eeeeee' + + out = spec.splice(dep, transitive=transitive) + out_z_expected = (dep if transitive else spec)['splice-z'] + + assert out.full_hash() != spec.full_hash() + assert (out['splice-h'].full_hash() == dep.full_hash()) == transitive + assert out['splice-z'].full_hash() == out_z_expected.full_hash() + + assert out.build_hash() != spec.build_hash() + assert (out['splice-h'].build_hash() == dep.build_hash()) == transitive + assert out['splice-z'].build_hash() == out_z_expected.build_hash() + @pytest.mark.parametrize('transitive', [True, False]) def test_splice_input_unchanged(self, transitive): spec = Spec('splice-t').concretized() diff --git a/lib/spack/spack/test/util/path.py b/lib/spack/spack/test/util/path.py new file mode 100644 index 00000000000..532bf031782 --- /dev/null +++ b/lib/spack/spack/test/util/path.py @@ -0,0 +1,59 @@ +# Copyright 2013-2021 Lawrence Livermore National Security, LLC and other +# Spack Project Developers. See the top-level COPYRIGHT file for details. +# +# SPDX-License-Identifier: (Apache-2.0 OR MIT) + +import pytest + +import spack.util.path as sup + +#: Some lines with lots of placeholders +padded_lines = [ + "==> [2021-06-23-15:59:05.020387] './configure' '--prefix=/Users/gamblin2/padding-log-test/opt/__spack_path_placeholder__/__spack_path_placeholder__/__spack_path_placeholder__/__spack_path_placeholder__/__spack_path_placeholder__/__spack_path_placeholder__/__spack_path_placeholder__/__spack_path_placeholder__/__spack_path_placeholder__/__spack_path_placeholder__/__spack_path_placeholder__/__spack_path_placeholder__/__spack_path_placeholder__/__spack_path_placeholder__/__spack_path_placeholder__/__spack_path_placeholder__/__spack_path_placeholder__/__spack_path_pla/darwin-bigsur-skylake/apple-clang-12.0.5/zlib-1.2.11-74mwnxgn6nujehpyyalhwizwojwn5zga", # noqa: E501 + "/Users/gamblin2/Workspace/spack/lib/spack/env/clang/clang -dynamiclib -install_name /Users/gamblin2/padding-log-test/opt/__spack_path_placeholder__/__spack_path_placeholder__/__spack_path_placeholder__/__spack_path_placeholder__/__spack_path_placeholder__/__spack_path_placeholder__/__spack_path_placeholder__/__spack_path_placeholder__/__spack_path_placeholder__/__spack_path_placeholder__/__spack_path_placeholder__/__spack_path_placeholder__/__spack_path_placeholder__/__spack_path_placeholder__/__spack_path_placeholder__/__spack_path_placeholder__/__spack_path_placeholder__/__spack_path_pla/darwin-bigsur-skylake/apple-clang-12.0.5/zlib-1.2.11-74mwnxgn6nujehpyyalhwizwojwn5zga/lib/libz.1.dylib -compatibility_version 1 -current_version 1.2.11 -fPIC -O2 -fPIC -DHAVE_HIDDEN -o libz.1.2.11.dylib adler32.lo crc32.lo deflate.lo infback.lo inffast.lo inflate.lo inftrees.lo trees.lo zutil.lo compress.lo uncompr.lo gzclose.lo gzlib.lo gzread.lo gzwrite.lo -lc", # noqa: E501 + "rm -f /Users/gamblin2/padding-log-test/opt/__spack_path_placeholder__/__spack_path_placeholder__/__spack_path_placeholder__/__spack_path_placeholder__/__spack_path_placeholder__/__spack_path_placeholder__/__spack_path_placeholder__/__spack_path_placeholder__/__spack_path_placeholder__/__spack_path_placeholder__/__spack_path_placeholder__/__spack_path_placeholder__/__spack_path_placeholder__/__spack_path_placeholder__/__spack_path_placeholder__/__spack_path_placeholder__/__spack_path_placeholder__/__spack_path_pla/darwin-bigsur-skylake/apple-clang-12.0.5/zlib-1.2.11-74mwnxgn6nujehpyyalhwizwojwn5zga/lib/libz.a", # noqa: E501 +] + + +#: unpadded versions of padded_lines, with [padded-to-X-chars] replacing the padding +fixed_lines = [ + "==> [2021-06-23-15:59:05.020387] './configure' '--prefix=/Users/gamblin2/padding-log-test/opt/[padded-to-512-chars]/darwin-bigsur-skylake/apple-clang-12.0.5/zlib-1.2.11-74mwnxgn6nujehpyyalhwizwojwn5zga", # noqa: E501 + "/Users/gamblin2/Workspace/spack/lib/spack/env/clang/clang -dynamiclib -install_name /Users/gamblin2/padding-log-test/opt/[padded-to-512-chars]/darwin-bigsur-skylake/apple-clang-12.0.5/zlib-1.2.11-74mwnxgn6nujehpyyalhwizwojwn5zga/lib/libz.1.dylib -compatibility_version 1 -current_version 1.2.11 -fPIC -O2 -fPIC -DHAVE_HIDDEN -o libz.1.2.11.dylib adler32.lo crc32.lo deflate.lo infback.lo inffast.lo inflate.lo inftrees.lo trees.lo zutil.lo compress.lo uncompr.lo gzclose.lo gzlib.lo gzread.lo gzwrite.lo -lc", # noqa: E501 + "rm -f /Users/gamblin2/padding-log-test/opt/[padded-to-512-chars]/darwin-bigsur-skylake/apple-clang-12.0.5/zlib-1.2.11-74mwnxgn6nujehpyyalhwizwojwn5zga/lib/libz.a", # noqa: E501 +] + + +@pytest.mark.parametrize("padded,fixed", zip(padded_lines, fixed_lines)) +def test_padding_substitution(padded, fixed): + """Ensure that all padded lines are unpadded correctly.""" + assert fixed == sup.padding_filter(padded) + + +def test_no_substitution(): + """Ensure that a line not containing one full path placeholder is not modified.""" + partial = "--prefix=/Users/gamblin2/padding-log-test/opt/__spack_path_pla/darwin-bigsur-skylake/apple-clang-12.0.5/zlib-1.2.11-74mwnxgn6nujehpyyalhwizwojwn5zga'" # noqa: E501 + assert sup.padding_filter(partial) == partial + + +def test_short_substitution(): + """Ensure that a single placeholder path component is replaced""" + short = "--prefix=/Users/gamblin2/padding-log-test/opt/__spack_path_placeholder__/darwin-bigsur-skylake/apple-clang-12.0.5/zlib-1.2.11-74mwnxgn6nujehpyyalhwizwojwn5zga'" # noqa: E501 + short_subst = "--prefix=/Users/gamblin2/padding-log-test/opt/[padded-to-63-chars]/darwin-bigsur-skylake/apple-clang-12.0.5/zlib-1.2.11-74mwnxgn6nujehpyyalhwizwojwn5zga'" # noqa: E501 + assert short_subst == sup.padding_filter(short) + + +def test_partial_substitution(): + """Ensure that a single placeholder path component is replaced""" + short = "--prefix=/Users/gamblin2/padding-log-test/opt/__spack_path_placeholder__/__spack_p/darwin-bigsur-skylake/apple-clang-12.0.5/zlib-1.2.11-74mwnxgn6nujehpyyalhwizwojwn5zga'" # noqa: E501 + short_subst = "--prefix=/Users/gamblin2/padding-log-test/opt/[padded-to-73-chars]/darwin-bigsur-skylake/apple-clang-12.0.5/zlib-1.2.11-74mwnxgn6nujehpyyalhwizwojwn5zga'" # noqa: E501 + assert short_subst == sup.padding_filter(short) + + +def test_longest_prefix_re(): + """Test that longest_prefix_re generates correct regular expressions.""" + assert "(s(?:t(?:r(?:i(?:ng?)?)?)?)?)" == sup.longest_prefix_re( + "string", capture=True + ) + assert "(?:s(?:t(?:r(?:i(?:ng?)?)?)?)?)" == sup.longest_prefix_re( + "string", capture=False + ) diff --git a/lib/spack/spack/test/web.py b/lib/spack/spack/test/web.py index c0ed098b2aa..2ccbf512254 100644 --- a/lib/spack/spack/test/web.py +++ b/lib/spack/spack/test/web.py @@ -279,3 +279,8 @@ def mock_create_s3_session(url): fake_s3_url_does_not_exist = 's3://my-bucket/subdirectory/my-notfound-file' assert(not spack.util.web.url_exists(fake_s3_url_does_not_exist)) + + +def test_s3_url_parsing(): + assert(spack.util.s3._parse_s3_endpoint_url("example.com") == 'https://example.com') + assert(spack.util.s3._parse_s3_endpoint_url("http://example.com") == 'http://example.com') diff --git a/lib/spack/spack/url.py b/lib/spack/spack/url.py index 770c5bd4c04..bfe74318f6b 100644 --- a/lib/spack/spack/url.py +++ b/lib/spack/spack/url.py @@ -417,11 +417,11 @@ def parse_version_offset(path): path (str): The filename or URL for the package Returns: - tuple of (Version, int, int, int, str): A tuple containing: + tuple: A tuple containing: version of the package, first index of version, length of version string, - the index of the matching regex + the index of the matching regex, the matching regex Raises: @@ -632,11 +632,11 @@ def parse_name_offset(path, v=None): v (str): The version of the package Returns: - tuple of (str, int, int, int, str): A tuple containing: + tuple: A tuple containing: name of the package, first index of name, length of name, - the index of the matching regex + the index of the matching regex, the matching regex Raises: @@ -774,9 +774,7 @@ def parse_name_and_version(path): path (str): The filename or URL for the package Returns: - tuple of (str, Version)A tuple containing: - The name of the package - The version of the package + tuple: a tuple containing the package (name, version) Raises: UndetectableVersionError: If the URL does not match any regexes diff --git a/lib/spack/spack/user_environment.py b/lib/spack/spack/user_environment.py index 005c6351b59..23fb6529d87 100644 --- a/lib/spack/spack/user_environment.py +++ b/lib/spack/spack/user_environment.py @@ -18,7 +18,7 @@ def prefix_inspections(platform): """Get list of prefix inspections for platform Arguments: - platform (string): the name of the platform to consider. The platform + platform (str): the name of the platform to consider. The platform determines what environment variables Spack will use for some inspections. diff --git a/lib/spack/spack/util/editor.py b/lib/spack/spack/util/editor.py index 400c4eb63aa..02e59a45f03 100644 --- a/lib/spack/spack/util/editor.py +++ b/lib/spack/spack/util/editor.py @@ -64,7 +64,7 @@ def editor(*args, **kwargs): searching the full list above, we'll raise an error. Arguments: - args (list of str): args to pass to editor + args (list): args to pass to editor Optional Arguments: _exec_func (function): invoke this function instead of ``os.execv()`` diff --git a/lib/spack/spack/util/environment.py b/lib/spack/spack/util/environment.py index f33e3c0b8f9..073f60334e1 100644 --- a/lib/spack/spack/util/environment.py +++ b/lib/spack/spack/util/environment.py @@ -623,7 +623,7 @@ def from_sourcing_file(filename, *arguments, **kwargs): Args: filename (str): the file to be sourced - *arguments (list of str): arguments to pass on the command line + *arguments (list): arguments to pass on the command line Keyword Args: shell (str): the shell to use (default: ``bash``) @@ -867,7 +867,7 @@ def inspect_path(root, inspections, exclude=None): modifications are not performed immediately, but stored in a command object that is returned to client - exclude (callable): optional callable. If present it must accept an + exclude (typing.Callable): optional callable. If present it must accept an absolute path and return True if it should be excluded from the inspection @@ -920,7 +920,7 @@ def preserve_environment(*variables): explicitly unset on exit. Args: - variables (list of str): list of environment variables to be preserved + variables (list): list of environment variables to be preserved """ cache = {} for var in variables: @@ -1031,9 +1031,9 @@ def sanitize(environment, blacklist, whitelist): Args: environment (dict): input dictionary - blacklist (list of str): literals or regex patterns to be + blacklist (list): literals or regex patterns to be blacklisted - whitelist (list of str): literals or regex patterns to be + whitelist (list): literals or regex patterns to be whitelisted """ diff --git a/lib/spack/spack/util/executable.py b/lib/spack/spack/util/executable.py index 084ca481471..1074a96cf7b 100644 --- a/lib/spack/spack/util/executable.py +++ b/lib/spack/spack/util/executable.py @@ -297,7 +297,7 @@ def which(*args, **kwargs): *args (str): One or more executables to search for Keyword Arguments: - path (:func:`list` or str): The path to search. Defaults to ``PATH`` + path (list or str): The path to search. Defaults to ``PATH`` required (bool): If set to True, raise an error if executable not found Returns: diff --git a/lib/spack/spack/util/imp/imp_importer.py b/lib/spack/spack/util/imp/imp_importer.py index a9b5cd641a4..d41d28928bb 100644 --- a/lib/spack/spack/util/imp/imp_importer.py +++ b/lib/spack/spack/util/imp/imp_importer.py @@ -28,11 +28,11 @@ def load_source(full_name, path, prepend=None): Args: full_name (str): full name of the module to be loaded path (str): path to the file that should be loaded - prepend (str, optional): some optional code to prepend to the + prepend (str or None): some optional code to prepend to the loaded module; e.g., can be used to inject import statements Returns: - (ModuleType): the loaded module + the loaded module """ with import_lock(): if prepend is None: diff --git a/lib/spack/spack/util/imp/importlib_importer.py b/lib/spack/spack/util/imp/importlib_importer.py index 4c8a2673e54..161e278e909 100644 --- a/lib/spack/spack/util/imp/importlib_importer.py +++ b/lib/spack/spack/util/imp/importlib_importer.py @@ -37,11 +37,11 @@ def load_source(full_name, path, prepend=None): Args: full_name (str): full name of the module to be loaded path (str): path to the file that should be loaded - prepend (str, optional): some optional code to prepend to the + prepend (str or None): some optional code to prepend to the loaded module; e.g., can be used to inject import statements Returns: - (ModuleType): the loaded module + the loaded module """ # use our custom loader loader = PrependFileLoader(full_name, path, prepend) diff --git a/lib/spack/spack/util/log_parse.py b/lib/spack/spack/util/log_parse.py index ccfde6d2794..11692b0afb5 100644 --- a/lib/spack/spack/util/log_parse.py +++ b/lib/spack/spack/util/log_parse.py @@ -20,7 +20,7 @@ def parse_log_events(stream, context=6, jobs=None, profile=False): """Extract interesting events from a log file as a list of LogEvent. Args: - stream (str or fileobject): build log name or file object + stream (str or typing.IO): build log name or file object context (int): lines of context to extract around each log event jobs (int): number of jobs to parse with; default ncpus profile (bool): print out profile information for parsing @@ -60,7 +60,7 @@ def make_log_context(log_events, width=None): """Get error context from a log file. Args: - log_events (list of LogEvent): list of events created by + log_events (list): list of events created by ``ctest_log_parser.parse()`` width (int or None): wrap width; ``0`` for no limit; ``None`` to auto-size for terminal diff --git a/lib/spack/spack/util/package_hash.py b/lib/spack/spack/util/package_hash.py index 05d7abe056a..bb9ad40e457 100644 --- a/lib/spack/spack/util/package_hash.py +++ b/lib/spack/spack/util/package_hash.py @@ -49,10 +49,10 @@ def is_directive(self, node): callbacks are sometimes represented). Args: - node (AST): the AST node being checked + node (ast.AST): the AST node being checked Returns: - (bool): ``True`` if the node represents a known directive, + bool: ``True`` if the node represents a known directive, ``False`` otherwise """ return (isinstance(node, ast.Expr) and diff --git a/lib/spack/spack/util/path.py b/lib/spack/spack/util/path.py index b13814f4e3f..1848af1440a 100644 --- a/lib/spack/spack/util/path.py +++ b/lib/spack/spack/util/path.py @@ -44,7 +44,11 @@ # --------------------- # total -> 300 SPACK_MAX_INSTALL_PATH_LENGTH = 300 -SPACK_PATH_PADDING_CHARS = 'spack_path_placeholder' + +#: Padded paths comprise directories with this name (or some prefix of it). : +#: It starts with two underscores to make it unlikely that prefix matches would +#: include some other component of the intallation path. +SPACK_PATH_PADDING_CHARS = '__spack_path_placeholder__' @memoized @@ -158,3 +162,73 @@ def canonicalize_path(path): tty.debug("Using current working directory as base for abspath") return os.path.normpath(path) + + +def longest_prefix_re(string, capture=True): + """Return a regular expression that matches a the longest possible prefix of string. + + i.e., if the input string is ``the_quick_brown_fox``, then:: + + m = re.compile(longest_prefix('the_quick_brown_fox')) + m.match('the_').group(1) == 'the_' + m.match('the_quick').group(1) == 'the_quick' + m.match('the_quick_brown_fox').group(1) == 'the_quick_brown_fox' + m.match('the_xquick_brown_fox').group(1) == 'the_' + m.match('the_quickx_brown_fox').group(1) == 'the_quick' + + """ + if len(string) < 2: + return string + + return "(%s%s%s?)" % ( + "" if capture else "?:", + string[0], + longest_prefix_re(string[1:], capture=False) + ) + + +#: regex cache for padding_filter function +_filter_re = None + + +def padding_filter(string): + """Filter used to reduce output from path padding in log output. + + This turns paths like this: + + /foo/bar/__spack_path_placeholder__/__spack_path_placeholder__/... + + Into paths like this: + + /foo/bar/[padded-to-512-chars]/... + + Where ``padded-to-512-chars`` indicates that the prefix was padded with + placeholders until it hit 512 characters. The actual value of this number + depends on what the `install_tree``'s ``padded_length`` is configured to. + + For a path to match and be filtered, the placeholder must appear in its + entirety at least one time. e.g., "/spack/" would not be filtered, but + "/__spack_path_placeholder__/spack/" would be. + + """ + global _filter_re + + pad = spack.util.path.SPACK_PATH_PADDING_CHARS + if not _filter_re: + longest_prefix = longest_prefix_re(pad) + regex = ( + r"((?:/[^/\s]*)*?)" # zero or more leading non-whitespace path components + r"(/{pad})+" # the padding string repeated one or more times + r"(/{longest_prefix})?(?=/)" # trailing prefix of padding as path component + ) + regex = regex.replace("/", os.sep) + regex = regex.format(pad=pad, longest_prefix=longest_prefix) + _filter_re = re.compile(regex) + + def replacer(match): + return "%s%s[padded-to-%d-chars]" % ( + match.group(1), + os.sep, + len(match.group(0)) + ) + return _filter_re.sub(replacer, string) diff --git a/lib/spack/spack/util/pattern.py b/lib/spack/spack/util/pattern.py index 655172886b7..0ddc51a1654 100644 --- a/lib/spack/spack/util/pattern.py +++ b/lib/spack/spack/util/pattern.py @@ -41,7 +41,7 @@ def composite(interface=None, method_list=None, container=list): interface (type): class exposing the interface to which the composite object must conform. Only non-private and non-special methods will be taken into account - method_list (list of str): names of methods that should be part + method_list (list): names of methods that should be part of the composite container (MutableSequence): container for the composite object (default = list). Must fulfill the MutableSequence diff --git a/lib/spack/spack/util/s3.py b/lib/spack/spack/util/s3.py index 31a18093e12..b9b56e04981 100644 --- a/lib/spack/spack/util/s3.py +++ b/lib/spack/spack/util/s3.py @@ -11,6 +11,13 @@ import spack.util.url as url_util +def _parse_s3_endpoint_url(endpoint_url): + if not urllib_parse.urlparse(endpoint_url, scheme='').scheme: + endpoint_url = '://'.join(('https', endpoint_url)) + + return endpoint_url + + def create_s3_session(url): url = url_util.parse(url) if url.scheme != 's3': @@ -30,10 +37,7 @@ def create_s3_session(url): endpoint_url = os.environ.get('S3_ENDPOINT_URL') if endpoint_url: - if urllib_parse.urlparse(endpoint_url, scheme=None).scheme is None: - endpoint_url = '://'.join(('https', endpoint_url)) - - s3_client_args['endpoint_url'] = endpoint_url + s3_client_args['endpoint_url'] = _parse_s3_endpoint_url(endpoint_url) # if no access credentials provided above, then access anonymously if not session.get_credentials(): diff --git a/lib/spack/spack/util/string.py b/lib/spack/spack/util/string.py index 6137c32d5a2..e132404e180 100644 --- a/lib/spack/spack/util/string.py +++ b/lib/spack/spack/util/string.py @@ -41,7 +41,7 @@ def plural(n, singular, plural=None, show_n=True): Arguments: n (int): number of things there are singular (str): singular form of word - plural (str, optional): optional plural form, for when it's not just + plural (str or None): optional plural form, for when it's not just singular + 's' show_n (bool): whether to include n in the result string (default True) diff --git a/lib/spack/spack/util/web.py b/lib/spack/spack/util/web.py index 4787e33dd68..34140ed74a0 100644 --- a/lib/spack/spack/util/web.py +++ b/lib/spack/spack/util/web.py @@ -367,7 +367,7 @@ def spider(root_urls, depth=0, concurrency=32): up to levels of links from each root. Args: - root_urls (str or list of str): root urls used as a starting point + root_urls (str or list): root urls used as a starting point for spidering depth (int): level of recursion into links concurrency (int): number of simultaneous requests that can be sent diff --git a/lib/spack/spack/variant.py b/lib/spack/spack/variant.py index 9b7d8779fe1..3badd30c202 100644 --- a/lib/spack/spack/variant.py +++ b/lib/spack/spack/variant.py @@ -94,8 +94,8 @@ def validate_or_raise(self, vspec, pkg=None): exception if any error is found. Args: - vspec (VariantSpec): instance to be validated - pkg (Package): the package that required the validation, + vspec (Variant): instance to be validated + pkg (spack.package.Package): the package that required the validation, if available Raises: @@ -254,7 +254,7 @@ def value(self): the variant. Returns: - tuple of str: values stored in the variant + tuple: values stored in the variant """ return self._value @@ -296,7 +296,7 @@ def copy(self): """Returns an instance of a variant equivalent to self Returns: - any variant type: a copy of self + AbstractVariant: a copy of self >>> a = MultiValuedVariant('foo', True) >>> b = a.copy() @@ -667,7 +667,7 @@ class DisjointSetsOfValues(Sequence): and therefore no other set can contain the item ``'none'``. Args: - *sets (list of tuples): mutually exclusive sets of values + *sets (list): mutually exclusive sets of values """ _empty_set = set(('none',)) diff --git a/pyproject.toml b/pyproject.toml index fc8dd4e428e..d09e589bed0 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -12,3 +12,83 @@ known_archspec = "archspec" known_llnl = "llnl" src_paths = "lib" honor_noqa = true + +[tool.mypy] +python_version = 3.7 +files = ['lib/spack/llnl/**/*.py', 'lib/spack/spack/**/*.py'] +mypy_path = ['bin', 'lib/spack', 'lib/spack/external', 'var/spack/repos/builtin'] + +# This and a generated import file allows supporting packages +namespace_packages = true + +# To avoid re-factoring all the externals, ignore errors and missing imports +# globally, then turn back on in spack and spack submodules +ignore_errors = true +ignore_missing_imports = true + + [[tool.mypy.overrides]] + module = 'spack.*' + ignore_errors = false + ignore_missing_imports = false + + [[tool.mypy.overrides]] + module = 'packages.*' + ignore_errors = false + ignore_missing_imports = false + + [[tool.mypy.overrides]] + module = 'llnl.*' + ignore_errors = false + ignore_missing_imports = false + + [[tool.mypy.overrides]] + module = 'spack.test.packages' + ignore_errors = true + + # ignore errors in fake import path for packages + [[tool.mypy.overrides]] + module = 'spack.pkg.*' + ignore_errors = true + ignore_missing_imports = true + + # jinja has syntax in it that requires python3 and causes a parse error + # skip importing it + [[tool.mypy.overrides]] + module = 'jinja2' + follow_imports = 'skip' + +[tool.coverage.run] +parallel = true +concurrency = ["multiprocessing"] +branch = true +source = ["bin", "lib"] +omit = [ + 'lib/spack/spack/test/*', + 'lib/spack/docs/*', + 'lib/spack/external/*', + 'share/spack/qa/*', +] + +[tool.coverage.report] +# Regexes for lines to exclude from consideration +exclude_lines = [ + # Have to re-enable the standard pragma + 'pragma: no cover', + + # Don't complain about missing debug-only code: + 'def __repr__', + 'if self\.debug', + + # Don't complain if tests don't hit defensive assertion code: + 'raise AssertionError', + 'raise NotImplementedError', + + # Don't complain if non-runnable code isn't run: + 'if 0:', + 'if False:', + 'if __name__ == .__main__.:', +] +ignore_errors = true + +[tool.coverage.html] +directory = "htmlcov" diff --git a/share/spack/docker/centos-6.dockerfile b/share/spack/docker/centos-6.dockerfile index 1ba58d66af1..b0186f2ff83 100644 --- a/share/spack/docker/centos-6.dockerfile +++ b/share/spack/docker/centos-6.dockerfile @@ -9,6 +9,9 @@ ENV DOCKERFILE_BASE=centos \ CURRENTLY_BUILDING_DOCKER_IMAGE=1 \ container=docker +# Make yum usable again with CentOS 6 +RUN curl https://www.getpagespeed.com/files/centos6-eol.repo --output /etc/yum.repos.d/CentOS-Base.repo + RUN yum update -y \ && yum install -y epel-release \ && yum update -y \ @@ -32,7 +35,6 @@ RUN yum update -y \ tcl \ unzip \ which \ - && pip install boto3 \ && rm -rf /var/cache/yum \ && yum clean all diff --git a/share/spack/gitlab/cloud_pipelines/stacks/e4s-on-power/spack.yaml b/share/spack/gitlab/cloud_pipelines/stacks/e4s-on-power/spack.yaml index a006afcd0b2..a131d8402ec 100644 --- a/share/spack/gitlab/cloud_pipelines/stacks/e4s-on-power/spack.yaml +++ b/share/spack/gitlab/cloud_pipelines/stacks/e4s-on-power/spack.yaml @@ -61,7 +61,7 @@ spack: variants: +bzip2 ~nls +xz expat: version: - - 2.3.0 + - 2.4.1 findutils: version: - 4.8.0 @@ -283,7 +283,7 @@ spack: # - sz # - tasmanian # - tau - # - trilinos + #- trilinos@13.0.1 +amesos +amesos2 +anasazi +aztec +belos +epetra +epetraext +ifpack +ifpack2 +intrepid +intrepid2 +isorropia +kokkos +ml +minitensor +muelu +nox +piro +phalanx +rol +rythmos +sacado +stk +shards +shylu +stokhos +stratimikos +teko +tempus +tpetra +trilinoscouplings +zoltan +zoltan2 +boost +superlu-dist gotype=long # - turbine # - umap # - unifyfs@0.9.1 diff --git a/share/spack/gitlab/cloud_pipelines/stacks/e4s/spack.yaml b/share/spack/gitlab/cloud_pipelines/stacks/e4s/spack.yaml index 62dd50dccf9..470f72259a2 100644 --- a/share/spack/gitlab/cloud_pipelines/stacks/e4s/spack.yaml +++ b/share/spack/gitlab/cloud_pipelines/stacks/e4s/spack.yaml @@ -58,7 +58,7 @@ spack: variants: +bzip2 ~nls +xz expat: version: - - 2.3.0 + - 2.4.1 findutils: version: - 4.8.0 @@ -284,8 +284,7 @@ spack: - sz - tasmanian - tau - - trilinos - - trilinos +nox +superlu-dist + - trilinos@13.0.1 +amesos +amesos2 +anasazi +aztec +belos +epetra +epetraext +ifpack +ifpack2 +intrepid +intrepid2 +isorropia +kokkos +ml +minitensor +muelu +nox +piro +phalanx +rol +rythmos +sacado +stk +shards +shylu +stokhos +stratimikos +teko +tempus +tpetra +trilinoscouplings +zoltan +zoltan2 +boost +superlu-dist gotype=long - turbine - umap - unifyfs@0.9.1 diff --git a/share/spack/qa/run-shell-tests b/share/spack/qa/run-shell-tests index 83838ff5ef4..22bf4b8abab 100755 --- a/share/spack/qa/run-shell-tests +++ b/share/spack/qa/run-shell-tests @@ -56,3 +56,9 @@ fish "$QA_DIR/setup-env-test.fish" # run csh and tcsh tests csh "$QA_DIR/setup-env-test.csh" tcsh "$QA_DIR/setup-env-test.csh" + +# Delete the symlink going from ./lib/spack/docs/_spack_root back to +# the initial directory, since it causes ELOOP errors with codecov/actions@2 +if [[ "$COVERAGE" == "true" ]]; then + rm lib/spack/docs/_spack_root +fi diff --git a/share/spack/qa/run-style-tests b/share/spack/qa/run-style-tests index 4eb503dae28..72c47ff0555 100755 --- a/share/spack/qa/run-style-tests +++ b/share/spack/qa/run-style-tests @@ -15,10 +15,14 @@ # run-flake8-tests # . "$(dirname $0)/setup.sh" -check_dependencies flake8 mypy + +BASE="" +if [ -n "$GITHUB_BASE_REF" ]; then + BASE="--base ${GITHUB_BASE_REF}" +fi # verify that the code style is correct -spack style --root-relative +spack style --root-relative $BASE # verify that the license headers are present spack license verify diff --git a/share/spack/qa/run-unit-tests b/share/spack/qa/run-unit-tests index 8384edee0c5..935b1905d1a 100755 --- a/share/spack/qa/run-unit-tests +++ b/share/spack/qa/run-unit-tests @@ -48,3 +48,10 @@ if [[ "$ONLY_PACKAGES" == "true" ]]; then fi $coverage_run $(which spack) unit-test -x --verbose + +# Delete the symlink going from ./lib/spack/docs/_spack_root back to +# the initial directory, since it causes ELOOP errors with codecov/actions@2 +if [[ "$COVERAGE" == "true" ]]; then + rm lib/spack/docs/_spack_root +fi + diff --git a/share/spack/spack-completion.bash b/share/spack/spack-completion.bash index cd5a01c42da..bf2a488a85d 100755 --- a/share/spack/spack-completion.bash +++ b/share/spack/spack-completion.bash @@ -333,7 +333,7 @@ _spack() { then SPACK_COMPREPLY="-h --help -H --all-help --color -c --config -C --config-scope -d --debug --timestamp --pdb -e --env -D --env-dir -E --no-env --use-env-repo -k --insecure -l --enable-locks -L --disable-locks -m --mock -p --profile --sorted-profile --lines -v --verbose --stacktrace -V --version --print-shell-vars" else - SPACK_COMPREPLY="activate add analyze arch audit blame build-env buildcache cd checksum ci clean clone commands compiler compilers concretize config containerize create deactivate debug dependencies dependents deprecate dev-build develop docs edit env extensions external fetch find flake8 gc gpg graph help info install license list load location log-parse maintainers mark mirror module monitor patch pkg providers pydoc python reindex remove rm repo resource restage solve spec stage style test test-env tutorial undevelop uninstall unit-test unload url verify versions view" + SPACK_COMPREPLY="activate add analyze arch audit blame bootstrap build-env buildcache cd checksum ci clean clone commands compiler compilers concretize config containerize create deactivate debug dependencies dependents deprecate dev-build develop docs edit env extensions external fetch find flake8 gc gpg graph help info install license list load location log-parse maintainers mark mirror module monitor patch pkg providers pydoc python reindex remove rm repo resource restage solve spec stage style test test-env tutorial undevelop uninstall unit-test unload url verify versions view" fi } @@ -416,6 +416,36 @@ _spack_blame() { fi } +_spack_bootstrap() { + if $list_options + then + SPACK_COMPREPLY="-h --help" + else + SPACK_COMPREPLY="enable disable reset root" + fi +} + +_spack_bootstrap_enable() { + SPACK_COMPREPLY="-h --help --scope" +} + +_spack_bootstrap_disable() { + SPACK_COMPREPLY="-h --help --scope" +} + +_spack_bootstrap_reset() { + SPACK_COMPREPLY="-h --help -y --yes-to-all" +} + +_spack_bootstrap_root() { + if $list_options + then + SPACK_COMPREPLY="-h --help --scope" + else + SPACK_COMPREPLY="" + fi +} + _spack_build_env() { if $list_options then @@ -978,7 +1008,7 @@ _spack_find() { _spack_flake8() { if $list_options then - SPACK_COMPREPLY="-h --help -b --base -a --all -r --root-relative -U --no-untracked -f --fix --no-isort --no-flake8 --no-mypy --black" + SPACK_COMPREPLY="-h --help -b --base -a --all -r --root-relative -U --no-untracked -f --fix --no-isort --no-flake8 --no-mypy --black --root" else SPACK_COMPREPLY="" fi @@ -1584,7 +1614,7 @@ _spack_stage() { _spack_style() { if $list_options then - SPACK_COMPREPLY="-h --help -b --base -a --all -r --root-relative -U --no-untracked -f --fix --no-isort --no-flake8 --no-mypy --black" + SPACK_COMPREPLY="-h --help -b --base -a --all -r --root-relative -U --no-untracked -f --fix --no-isort --no-flake8 --no-mypy --black --root" else SPACK_COMPREPLY="" fi diff --git a/var/spack/repos/builtin/packages/abinit/package.py b/var/spack/repos/builtin/packages/abinit/package.py index 39be0efd34d..939118efa24 100644 --- a/var/spack/repos/builtin/packages/abinit/package.py +++ b/var/spack/repos/builtin/packages/abinit/package.py @@ -51,6 +51,10 @@ class Abinit(AutotoolsPackage): variant('libxml2', default=False, description='Enable libxml2 support, used by multibinit') + variant('optimization-flavor', default='standard', multi=False, + values=('safe', 'standard', 'aggressive'), + description='Select the optimization flavor to use.') + # Add dependencies depends_on('atompaw') depends_on('blas') @@ -75,7 +79,7 @@ class Abinit(AutotoolsPackage): depends_on('libxc@:2', when='@:8') # libxml2 - depends_on('libxml2', when='@9:') + depends_on('libxml2', when='@9:+libxml2') # Cannot ask for +scalapack if it does not depend on MPI conflicts('+scalapack', when='~mpi') @@ -122,6 +126,8 @@ def configure_args(self): options += self.with_or_without('libxml2') oapp = options.append + oapp('--with-optim-flavor={0}' + .format(self.spec.variants['optimization-flavor'].value)) if '+wannier90' in spec: if '@:8' in spec: @@ -190,48 +196,38 @@ def configure_args(self): oapp('--with-linalg-flavor={0}'.format(linalg_flavor)) - # FFTW3: use sequential from fftw3 or MKL - if '@:8' in spec: + if '^mkl' in spec: + fftflavor = 'dfti' + elif '^fftw' in spec: if '+openmp' in spec: fftflavor, fftlibs = 'fftw3-threads', '-lfftw3_omp -lfftw3 -lfftw3f' + else: + fftflavor, fftlibs = 'fftw3', '-lfftw3 -lfftw3f' + + oapp('--with-fft-flavor={0}'.format(fftflavor)) + + if '@:8' in spec: + if '^mkl' in spec: + oapp('--with-fft-incs={0}'.format(spec['fftw-api'].headers.cpp_flags)) + oapp('--with-fft-libs={0}'.format(spec['fftw-api'].libs.ld_flags)) + elif '^fftw' in spec: options.extend([ '--with-fft-incs={0}'.format(spec['fftw'].headers.cpp_flags), '--with-fft-libs=-L{0} {1}'.format( spec['fftw'].prefix.lib, fftlibs), ]) - else: - oapp('--with-fft-incs={0}'.format(spec['fftw-api'].headers.cpp_flags)) - if '^mkl' in spec: - fftflavor = 'dfti' - oapp('--with-fft-libs={0}'.format(spec['fftw-api'].libs.ld_flags)) - elif '^fftw' in spec: - fftflavor, fftlibs = 'fftw3', '-lfftw3 -lfftw3f' - oapp('--with-fft-libs=-L{0} {1}'.format( - spec['fftw-api'].prefix.lib, fftlibs)) else: - if '+openmp' in spec: - fftflavor, fftlibs = 'fftw3-threads', '-lfftw3_omp -lfftw3 -lfftw3f' + if '^mkl' in spec: + options.extend([ + 'FFT_CPPFLAGS={0}'.format(spec['fftw-api'].headers.cpp_flags), + 'FFT_LIBs={0}'.format(spec['fftw-api'].libs.ld_flags), + ]) + elif '^fftw' in spec: options.extend([ 'FFTW3_CPPFLAGS={0}'.format(spec['fftw'].headers.cpp_flags), 'FFTW3_LIBS=-L{0} {1}'.format( spec['fftw'].prefix.lib, fftlibs), ]) - else: - if '^mkl' in spec: - fftflavor = 'dfti' - options.extend([ - 'FFT_CPPFLAGS={0}'.format(spec['fftw-api'].headers.cpp_flags), - 'FFT_LIBs={0}'.format(spec['fftw-api'].libs.ld_flags), - ]) - elif '^fftw' in spec: - fftflavor, fftlibs = 'fftw3', '-lfftw3 -lfftw3f' - options.extend([ - 'FFTW3_CPPFLAGS={0}'.format(spec['fftw-api'].headers.cpp_flags), - 'FFTW3_LIBS=-L{0} {1}'.format( - spec['fftw-api'].prefix.lib, fftlibs), - ]) - - oapp('--with-fft-flavor={0}'.format(fftflavor)) # LibXC library libxc = spec['libxc:fortran'] @@ -274,4 +270,9 @@ def check(self): explicitly activated by user. """ make('check') - make('tests_in') + + # the tests directly execute abinit. thus failing with MPI + # TODO: run tests in tests/ via the builtin runtests.py + # requires Python with numpy, pyyaml, pandas + if '~mpi' in self.spec: + make('tests_in') diff --git a/var/spack/repos/builtin/packages/abseil-cpp/package.py b/var/spack/repos/builtin/packages/abseil-cpp/package.py index 0bf28861a74..f58e6af372e 100644 --- a/var/spack/repos/builtin/packages/abseil-cpp/package.py +++ b/var/spack/repos/builtin/packages/abseil-cpp/package.py @@ -31,8 +31,14 @@ class AbseilCpp(CMakePackage): conflicts('+shared', when='@:20190808') + variant('cxxstd', values=('11', '14', '17', '20'), default='11', + description="C++ standard used during compilation") + def cmake_args(self): - args = ["-DBUILD_TESTING=OFF", "-DCMAKE_CXX_STANDARD=11"] - args.append('-DBUILD_SHARED_LIBS:Bool={0}'.format( - 'ON' if '+shared' in self.spec else 'OFF')) - return args + shared = 'ON' if '+shared' in self.spec else 'OFF' + cxxstd = self.spec.variants['cxxstd'].value + return [ + self.define('BUILD_TESTING', 'OFF'), + self.define('BUILD_SHARED_LIBS:Bool', shared), + self.define('CMAKE_CXX_STANDARD', cxxstd) + ] diff --git a/var/spack/repos/builtin/packages/acts/package.py b/var/spack/repos/builtin/packages/acts/package.py index 605f7ce232b..c7d6119c920 100644 --- a/var/spack/repos/builtin/packages/acts/package.py +++ b/var/spack/repos/builtin/packages/acts/package.py @@ -38,6 +38,8 @@ class Acts(CMakePackage, CudaPackage): # Supported Acts versions version('main', branch='main') version('master', branch='main', deprecated=True) # For compatibility + version('9.02.0', commit='c438ee490e94eaf1c854a336ef54f398da637a48') + version('9.01.0', commit='bf8fd4c03dd94f497d8501df510d8f6a48434afd') version('9.00.1', commit='7d59bc508d898d2cb67ba05a7150a978b9fcc32d') version('9.00.0', commit='e6e3092bf3a9411aac7c11a24d7586abddb75d59') version('8.03.0', commit='601c0a18b6738cae81c3e23422cfeb3ec7bddce9') diff --git a/var/spack/repos/builtin/packages/aluminum/package.py b/var/spack/repos/builtin/packages/aluminum/package.py index 113564de5ba..ea8d9e83172 100644 --- a/var/spack/repos/builtin/packages/aluminum/package.py +++ b/var/spack/repos/builtin/packages/aluminum/package.py @@ -69,8 +69,8 @@ def cmake_args(self): args.append('-DCMAKE_CUDA_STANDARD=14') archs = spec.variants['cuda_arch'].value if archs != 'none': - arch_str = ",".join(archs) - args.append('-DCMAKE_CUDA_ARCHITECTURES=%s' % arch_str) + arch_str = ";".join(archs) + args.append('-DCMAKE_CUDA_ARCHITECTURES=%s' % arch_str) if spec.satisfies('@0.5:'): args.extend([ diff --git a/var/spack/repos/builtin/packages/aml/package.py b/var/spack/repos/builtin/packages/aml/package.py index e647f26938b..f282067300b 100644 --- a/var/spack/repos/builtin/packages/aml/package.py +++ b/var/spack/repos/builtin/packages/aml/package.py @@ -3,6 +3,8 @@ # # SPDX-License-Identifier: (Apache-2.0 OR MIT) +import os + from spack import * @@ -13,6 +15,8 @@ class Aml(AutotoolsPackage): url = "https://www.mcs.anl.gov/research/projects/argo/downloads/aml-0.1.0.tar.gz" git = "https://xgitlab.cels.anl.gov/argo/aml.git" + test_requires_compiler = True + version('0.1.0', sha256='cc89a8768693f1f11539378b21cdca9f0ce3fc5cb564f9b3e4154a051dcea69b') version('develop', branch='staging', submodules=True) version('master', branch='master', submodules=True) @@ -23,3 +27,39 @@ class Aml(AutotoolsPackage): depends_on('autoconf', type='build') depends_on('automake', type='build') depends_on('libtool', type='build') + + @run_after('install') + def cache_test_sources(self): + """Copy the example source files after the package is installed to an + install test subdirectory for use during `spack test run`.""" + self.cache_extra_test_sources(['tests', join_path('include', 'config.h')]) + + def run_area_test(self): + """Run stand alone test: test_area""" + + test_dir = join_path(self.test_suite.current_test_cache_dir, 'tests', 'area') + + if not os.path.exists(test_dir): + print('Skipping aml test') + return + + exe = 'test_area' + + self.run_test('gcc', + options=['-o', exe, join_path(test_dir, 'test_area.c'), + '-I{0}'.format(join_path( + self.test_suite.current_test_cache_dir, + 'include')), + '-I{0}'.format(self.prefix.include), + '-I{0}'.format(self.spec['numactl'].prefix.include), + '-L{0}'.format(self.prefix.lib), + '-laml', '-lexcit', '-lpthread'], + purpose='test: compile {0} example'.format(exe), + work_dir=test_dir) + + self.run_test(exe, + purpose='test: run {0} example'.format(exe), + work_dir=test_dir) + + def test(self): + self.run_area_test() diff --git a/var/spack/repos/builtin/packages/ampl/package.py b/var/spack/repos/builtin/packages/ampl/package.py new file mode 100644 index 00000000000..6672dc04c11 --- /dev/null +++ b/var/spack/repos/builtin/packages/ampl/package.py @@ -0,0 +1,58 @@ +# Copyright 2013-2021 Lawrence Livermore National Security, LLC and other +# Spack Project Developers. See the top-level COPYRIGHT file for details. +# +# SPDX-License-Identifier: (Apache-2.0 OR MIT) + +import os + +from spack import * + + +class Ampl(Package): + """AMPL integrates a modeling language for describing optimization data, variables, + objectives, and constraints; a command language for debugging models and analyzing + results; and a scripting language for manipulating data and implementing + optimization strategies.""" + + homepage = "https://ampl.com/" + manual_download = True + + # Use the version as you would expect the user to know it, not necessarily the + # version as it appears in the file name. To get the checksum, use sha256sum. + version('20210226', sha256='d9ffaed591c0491e311a44c2b246d9d81785f6c0b2747a7e32a783e522e18450') + version('20190529', sha256='c35a87d85055ae5fe41b68d4b4458f1fdbf80643890501eeaad35b134cb11a2d') + + # Licensing + license_required = True + license_comment = '#' + license_files = ['ampl.lic'] + license_url = 'https://ampl.com/resources/floating-licenses/installation/' + + resourceList = [ + # [version, name, destination, placement, url ,sha256sum] + ('20210226', 'amplapi', '', 'amplapi', 'file://{0}/amplapi-linux64.2.0.0.zip'.format(os.getcwd()), 'a4abe111f142b862f11fcd8700f964b688d5d2291e9e055f6e7adbd92b0e243a'), + ('20210226', 'amplide', '', 'amplide', 'file://{0}/amplide-linux64.3.5.tgz'.format(os.getcwd()), 'c2163896df672b71901d2e46cd5cf1c1c4f0451e478ef32d0971705aaf86d6ac'), + ('20190529', 'amplapi', '', 'amplapi', 'file://{0}/amplapi-linux64.2.0.0.zip'.format(os.getcwd()), 'a4abe111f142b862f11fcd8700f964b688d5d2291e9e055f6e7adbd92b0e243a'), + ('20190529', 'amplide', '', 'amplide', 'file://{0}/amplide-linux64.3.5.tgz'.format(os.getcwd()), 'c2163896df672b71901d2e46cd5cf1c1c4f0451e478ef32d0971705aaf86d6ac'), + ] + + for rsver, rsname, rsdest, rsplace, rsurl, rschecksum in resourceList: + resource(when='@{0}'.format(rsver), + name=rsname, + url=rsurl, + sha256=rschecksum, + destination=rsdest, + placement=rsplace + ) + + def url_for_version(self, version): + return "file://{0}/ampl.linux-intel64.{1}.tgz".format(os.getcwd(), version) + + def setup_run_environment(self, env): + env.prepend_path("PATH", self.prefix) + env.prepend_path("PATH", join_path(self.prefix, 'amplide')) + + def install(self, spec, prefix): + install_tree('.', prefix) + install_tree('amplapi', prefix) + install_tree('amplide', prefix) diff --git a/var/spack/repos/builtin/packages/amrex/package.py b/var/spack/repos/builtin/packages/amrex/package.py index c0ebe8b5216..c0f5419f7d9 100644 --- a/var/spack/repos/builtin/packages/amrex/package.py +++ b/var/spack/repos/builtin/packages/amrex/package.py @@ -65,6 +65,8 @@ class Amrex(CMakePackage, CudaPackage, ROCmPackage): description='Build data services') variant('particles', default=False, description='Build particle classes') + variant('plotfile_tools', default=False, + description='Build plotfile_tools like fcompare') variant('sundials', default=False, description='Build AMReX with SUNDIALS support') variant('hdf5', default=False, @@ -168,6 +170,7 @@ def cmake_args(self): 'linear_solvers'), self.define_from_variant('AMReX_AMRDATA', 'amrdata'), self.define_from_variant('AMReX_PARTICLES', 'particles'), + self.define_from_variant('AMReX_PLOTFILE_TOOLS', 'plotfile_tools'), self.define_from_variant('AMReX_HDF5', 'hdf5'), self.define_from_variant('AMReX_HYPRE', 'hypre'), self.define_from_variant('AMReX_PETSC', 'petsc'), diff --git a/var/spack/repos/builtin/packages/apr-util/package.py b/var/spack/repos/builtin/packages/apr-util/package.py index 061beaefd81..a08f110a7c5 100644 --- a/var/spack/repos/builtin/packages/apr-util/package.py +++ b/var/spack/repos/builtin/packages/apr-util/package.py @@ -32,6 +32,14 @@ class AprUtil(AutotoolsPackage): depends_on('sqlite', when='+sqlite') depends_on('unixodbc', when='+odbc') + @property + def libs(self): + return find_libraries( + ['libaprutil-{0}'.format(self.version.up_to(1))], + root=self.prefix, + recursive=True, + ) + def configure_args(self): spec = self.spec diff --git a/var/spack/repos/builtin/packages/apr/package.py b/var/spack/repos/builtin/packages/apr/package.py index f2d90352ab7..cf2417d51e2 100644 --- a/var/spack/repos/builtin/packages/apr/package.py +++ b/var/spack/repos/builtin/packages/apr/package.py @@ -19,3 +19,11 @@ class Apr(AutotoolsPackage): patch('missing_includes.patch', when='@1.7.0') depends_on('uuid', type='link') + + @property + def libs(self): + return find_libraries( + ['libapr-{0}'.format(self.version.up_to(1))], + root=self.prefix, + recursive=True, + ) diff --git a/var/spack/repos/builtin/packages/archer/package.py b/var/spack/repos/builtin/packages/archer/package.py index bb593b27668..a04f74d0987 100644 --- a/var/spack/repos/builtin/packages/archer/package.py +++ b/var/spack/repos/builtin/packages/archer/package.py @@ -4,6 +4,8 @@ # SPDX-License-Identifier: (Apache-2.0 OR MIT) +import os + from spack import * @@ -13,6 +15,8 @@ class Archer(CMakePackage): homepage = "https://github.com/PRUNERS/ARCHER" url = "https://github.com/PRUNERS/archer/archive/v1.0.0.tar.gz" + test_requires_compiler = True + version('2.0.0', sha256='3241cadb0078403368b69166b27f815e12c350486d4ceb3fb33147895b9ebde8') version('1.0.0', sha256='df814a475606b83c659932caa30a68bed1c62e713386b375c1b78eb8d60e0d15') @@ -35,3 +39,33 @@ def cmake_args(self): '-DCMAKE_CXX_COMPILER=clang++', '-DOMP_PREFIX:PATH=%s' % self.spec['llvm-openmp-ompt'].prefix, ] + + @run_after('install') + def cache_test_sources(self): + """Copy the example source files after the package is installed to an + install test subdirectory for use during `spack test run`.""" + self.cache_extra_test_sources(['test']) + + def run_parallel_example_test(self): + """Run stand alone test: parallel-simple""" + + test_dir = join_path(self.test_suite.current_test_cache_dir, 'test', 'parallel') + + if not os.path.exists(test_dir): + print('Skipping archer test') + return + + exe = 'parallel-simple' + + self.run_test('clang-archer', + options=['-o', exe, + '{0}'.format(join_path(test_dir, 'parallel-simple.c'))], + purpose='test: compile {0} example'.format(exe), + work_dir=test_dir) + + self.run_test(exe, + purpose='test: run {0} example'.format(exe), + work_dir=test_dir) + + def test(self): + self.run_parallel_example_test() diff --git a/var/spack/repos/builtin/packages/ascent/package.py b/var/spack/repos/builtin/packages/ascent/package.py index 2dc5dff55bf..16226a36208 100644 --- a/var/spack/repos/builtin/packages/ascent/package.py +++ b/var/spack/repos/builtin/packages/ascent/package.py @@ -76,7 +76,6 @@ class Ascent(Package, CudaPackage): variant("openmp", default=(sys.platform != 'darwin'), description="build openmp support") - variant("cuda", default=False, description="Build cuda support") variant("mfem", default=False, description="Build MFEM filter support") variant("adios", default=False, description="Build Adios filter support") variant("dray", default=False, description="Build with Devil Ray support") diff --git a/var/spack/repos/builtin/packages/asdf-cxx/package.py b/var/spack/repos/builtin/packages/asdf-cxx/package.py index ffb871ad327..742d939666b 100644 --- a/var/spack/repos/builtin/packages/asdf-cxx/package.py +++ b/var/spack/repos/builtin/packages/asdf-cxx/package.py @@ -45,5 +45,6 @@ class AsdfCxx(CMakePackage): # An error in the cmake script requires swig all the time, not only when # Python bindings are used depends_on('swig @3.0.0:3.999.999', type='build') - depends_on('yaml-cpp') + # Neither earlier nor later versions of yaml-cpp work + depends_on('yaml-cpp @0.6.3') depends_on('zlib') diff --git a/var/spack/repos/builtin/packages/aspect/package.py b/var/spack/repos/builtin/packages/aspect/package.py index efb17a0be65..92da16cf2e1 100644 --- a/var/spack/repos/builtin/packages/aspect/package.py +++ b/var/spack/repos/builtin/packages/aspect/package.py @@ -17,6 +17,7 @@ class Aspect(CMakePackage): maintainers = ['tjhei'] version('develop', branch='master') + version('2.3.0', sha256='d97885e502e99ca22af3933c3b1c0b30b0b5e4dc0421e7f6e4d6b378e997faf8') version('2.2.0', sha256='6dc31c4b991c8a96495ba0e9a3c92e57f9305ba94b8dbed3c8c5cfbab91ec5c1') version('2.1.0', sha256='bd574d60ed9df1f4b98e68cd526a074d0527c0792763187c9851912327d861a3') version('2.0.1', sha256='0bf5600c42afce9d39c1d285b0654ecfdeb0f30e9f3421651c95f54ca01ac165') diff --git a/var/spack/repos/builtin/packages/atompaw/atompaw-4.1.1.0-fix-ifort.patch b/var/spack/repos/builtin/packages/atompaw/atompaw-4.1.1.0-fix-ifort.patch new file mode 100644 index 00000000000..59ace7cb0f8 --- /dev/null +++ b/var/spack/repos/builtin/packages/atompaw/atompaw-4.1.1.0-fix-ifort.patch @@ -0,0 +1,15 @@ +diff --git a/src/io_tools.F90 b/src/io_tools.F90 +index fe94582..5da3abc 100644 +--- a/src/io_tools.F90 ++++ b/src/io_tools.F90 +@@ -8,7 +8,9 @@ + #endif + + MODULE io_tools +- ++#if defined (__INTEL_COMPILER) ++ USE IFPORT ++#endif + IMPLICIT NONE + + PRIVATE diff --git a/var/spack/repos/builtin/packages/atompaw/package.py b/var/spack/repos/builtin/packages/atompaw/package.py index ed4f7f68111..f7b27516343 100644 --- a/var/spack/repos/builtin/packages/atompaw/package.py +++ b/var/spack/repos/builtin/packages/atompaw/package.py @@ -29,6 +29,8 @@ class Atompaw(Package): depends_on('libxc') depends_on('libxc@:2', when='@:4.0') + patch('atompaw-4.1.1.0-fix-ifort.patch', when='@4.1.1.0:') + def install(self, spec, prefix): options = ['--prefix=%s' % prefix] diff --git a/var/spack/repos/builtin/packages/aws-parallelcluster/package.py b/var/spack/repos/builtin/packages/aws-parallelcluster/package.py index 30655c66f84..6c8cf3697b6 100644 --- a/var/spack/repos/builtin/packages/aws-parallelcluster/package.py +++ b/var/spack/repos/builtin/packages/aws-parallelcluster/package.py @@ -13,12 +13,14 @@ class AwsParallelcluster(PythonPackage): tool to deploy and manage HPC clusters in the AWS cloud.""" homepage = "https://github.com/aws/aws-parallelcluster" - pypi = "aws-parallelcluster/aws-parallelcluster-2.10.4.tar.gz" + pypi = "aws-parallelcluster/aws-parallelcluster-2.11.1.tar.gz" maintainers = [ - 'demartinofra', 'enrico-usai', 'lukeseawalker', 'rexcsn', 'tilne' + 'demartinofra', 'enrico-usai', 'lukeseawalker', 'tilne' ] + version('2.11.1', sha256='dc102eeb0db30fb183c1ee076e340223095fde7d9079004fde401b7ad658242d') + version('2.11.0', sha256='ec2f54f752a355649ca065a41fa4ac19697f570a136e10e0a6548f5abad3ea8a') version('2.10.4', sha256='487dbf3e79f3e9b6750b1075cef4eb24956f7b310e5bd8de662b98d87491736c') version('2.10.3', sha256='02016358932375c1abb566c6b7f1c891fa617fc4a4ec4ce9969f87758d4039c7') version('2.10.2', sha256='95853535b82e8087c6635a946556ed886e68d3a77d67a375830c57d80f2bbd6e') @@ -34,14 +36,16 @@ class AwsParallelcluster(PythonPackage): version('2.5.1', sha256='4fd6e14583f8cf81f9e4aa1d6188e3708d3d14e6ae252de0a94caaf58be76303') version('2.5.0', sha256='3b0209342ea0d9d8cc95505456103ad87c2d4e35771aa838765918194efd0ad3') - depends_on('python@2.7:2.8,3.4:', type=('build', 'run')) + depends_on('python@3.6:', when='@2.11:', type=('build', 'run')) + depends_on('python@2.7:2.8,3.4:', when='@:2.10', type=('build', 'run')) - depends_on('py-future@0.16.0:0.18.2', type=('build', 'run')) + depends_on('py-future@0.16.0:0.18.2', when='@:2.10', type=('build', 'run')) depends_on('py-ipaddress@1.0.22:', type=('build', 'run')) depends_on('py-configparser@3.5.0:3.8.1', when='^python@:2', type=('build', 'run')) + depends_on('py-tabulate@0.8.2:0.8.9', when='@2.11:', type=('build', 'run')) depends_on('py-tabulate@0.8.2:0.8.3', when='@:2.8', type=('build', 'run')) depends_on('py-tabulate@0.8.5', when='@2.9: ^python@3.0:3.4', type=('build', 'run')) depends_on('py-tabulate@0.8.2:0.8.7', when='@2.9: ^python@:2,3.5:', type=('build', 'run')) diff --git a/var/spack/repos/builtin/packages/axom/package.py b/var/spack/repos/builtin/packages/axom/package.py index 6381989c4b1..b97a5985d28 100644 --- a/var/spack/repos/builtin/packages/axom/package.py +++ b/var/spack/repos/builtin/packages/axom/package.py @@ -274,15 +274,20 @@ def initconfig_hardware_entries(self): # Fix for working around CMake adding implicit link directories # returned by the BlueOS compilers to link executables with # non-system default stdlib - _gcc_prefix = "/usr/tce/packages/gcc/gcc-4.9.3/lib64" - if os.path.exists(_gcc_prefix): - _gcc_prefix2 = pjoin( - _gcc_prefix, - "gcc/powerpc64le-unknown-linux-gnu/4.9.3") - _link_dirs = "{0};{1}".format(_gcc_prefix, _gcc_prefix2) + _roots = ["/usr/tce/packages/gcc/gcc-4.9.3", + "/usr/tce/packages/gcc/gcc-4.9.3/gnu"] + _subdirs = ["lib64", + "lib64/gcc/powerpc64le-unknown-linux-gnu/4.9.3"] + _existing_paths = [] + for root in _roots: + for subdir in _subdirs: + _curr_path = pjoin(root, subdir) + if os.path.exists(_curr_path): + _existing_paths.append(_curr_path) + if _existing_paths: entries.append(cmake_cache_string( "BLT_CMAKE_IMPLICIT_LINK_DIRECTORIES_EXCLUDE", - _link_dirs)) + ";".join(_existing_paths))) return entries diff --git a/var/spack/repos/builtin/packages/bedops/package.py b/var/spack/repos/builtin/packages/bedops/package.py index a4a688e31e8..4dbaf8179ea 100644 --- a/var/spack/repos/builtin/packages/bedops/package.py +++ b/var/spack/repos/builtin/packages/bedops/package.py @@ -15,6 +15,7 @@ class Bedops(MakefilePackage): homepage = "https://bedops.readthedocs.io" url = "https://github.com/bedops/bedops/archive/v2.4.39.tar.gz" + version('2.4.40', sha256='0670f9ce2da4b68ab13f82c023c84509c7fce5aeb5df980c385fac76eabed4fb') version('2.4.39', sha256='f8bae10c6e1ccfb873be13446c67fc3a54658515fb5071663883f788fc0e4912') version('2.4.35', sha256='da0265cf55ef5094834318f1ea4763d7a3ce52a6900e74f532dd7d3088c191fa') version('2.4.34', sha256='533a62a403130c048d3378e6a975b73ea88d156d4869556a6b6f58d90c52ed95') diff --git a/var/spack/repos/builtin/packages/blast-plus/package.py b/var/spack/repos/builtin/packages/blast-plus/package.py index 3fb2d4a85b5..2bc4e1e7831 100644 --- a/var/spack/repos/builtin/packages/blast-plus/package.py +++ b/var/spack/repos/builtin/packages/blast-plus/package.py @@ -21,8 +21,11 @@ class BlastPlus(AutotoolsPackage): """Basic Local Alignment Search Tool.""" homepage = "http://blast.ncbi.nlm.nih.gov/" - url = "https://ftp.ncbi.nlm.nih.gov/blast/executables/blast+/2.11.0/ncbi-blast-2.11.0+-src.tar.gz" + url = "https://ftp.ncbi.nlm.nih.gov/blast/executables/blast+/2.12.0/ncbi-blast-2.12.0+-src.tar.gz" + maintainers = ['weijianwen'] + + version('2.12.0', sha256='fda3c9c9d488cad6c1880a98a236d842bcf3610e3e702af61f7a48cf0a714b88') version('2.11.0', sha256='d88e1858ae7ce553545a795a2120e657a799a6d334f2a07ef0330cc3e74e1954') version('2.9.0', sha256='a390cc2d7a09422759fc178db84de9def822cbe485916bbb2ec0d215dacdc257') version('2.8.1', sha256='e03dd1a30e37cb8a859d3788a452c5d70ee1f9102d1ee0f93b2fbd145925118f') diff --git a/var/spack/repos/builtin/packages/blt/package.py b/var/spack/repos/builtin/packages/blt/package.py index 372f6a92b05..a461a5d4428 100644 --- a/var/spack/repos/builtin/packages/blt/package.py +++ b/var/spack/repos/builtin/packages/blt/package.py @@ -18,10 +18,11 @@ class Blt(Package): version('develop', branch='develop') version('main', branch='main') - # Note: 0.4.0 contains a breaking change to BLT created targets + # Note: 0.4.0+ contains a breaking change to BLT created targets # if you export targets this could cause problems in downstream # projects if not handled properly. More info here: # https://llnl-blt.readthedocs.io/en/develop/tutorial/exporting_targets.html + version('0.4.1', sha256='16cc3e067ddcf48b99358107e5035a17549f52dcc701a35cd18a9d9f536826c1') version('0.4.0', sha256='f3bc45d28b9b2eb6df43b75d4f6f89a1557d73d012da7b75bac1be0574767193') version('0.3.6', sha256='6276317c29e7ff8524fbea47d9288ddb40ac06e9f9da5e878bf9011e2c99bf71') version('0.3.5', sha256='68a1c224bb9203461ae6f5ab0ff3c50b4a58dcce6c2d2799489a1811f425fb84') diff --git a/var/spack/repos/builtin/packages/bolt/package.py b/var/spack/repos/builtin/packages/bolt/package.py index c3f7870f3f6..3b7b775ca31 100644 --- a/var/spack/repos/builtin/packages/bolt/package.py +++ b/var/spack/repos/builtin/packages/bolt/package.py @@ -3,6 +3,8 @@ # # SPDX-License-Identifier: (Apache-2.0 OR MIT) +import os + from spack import * @@ -27,6 +29,8 @@ class Bolt(CMakePackage): version("1.0.1", sha256="769e30dfc4042cee7ebbdadd23cf08796c03bcd8b335f516dc8cbc3f8adfa597") version("1.0", sha256="1c0d2f75597485ca36335d313a73736594e75c8a36123c5a6f54d01b5ba5c384") + test_requires_compiler = True + depends_on('argobots') depends_on('autoconf', type='build') depends_on('automake', type='build') @@ -40,3 +44,37 @@ def cmake_args(self): ] return options + + @run_after('install') + def cache_test_sources(self): + """Copy the example source files after the package is installed to an + install test subdirectory for use during `spack test run`.""" + self.cache_extra_test_sources(['examples']) + + def run_sample_nested_example(self): + """Run stand alone test: sample_nested""" + + test_dir = join_path(self.test_suite.current_test_cache_dir, 'examples') + + if not os.path.exists(test_dir): + print('Skipping bolt test') + return + + exe = 'sample_nested' + + # TODO: Either change to use self.compiler.cc (so using the build-time compiler) + # or add test parts that compile with the different supported compilers. + self.run_test('gcc', + options=['-lomp', '-o', exe, + '-L{0}'.format(join_path(self.prefix, 'lib')), + '{0}'.format(join_path(test_dir, 'sample_nested.c'))], + purpose='test: compile {0} example'.format(exe), + work_dir=test_dir) + + self.run_test(exe, + purpose='test: run {0} example'.format(exe), + work_dir=test_dir) + + def test(self): + print("Running bolt test") + self.run_sample_nested_example() diff --git a/var/spack/repos/builtin/packages/boost/context-macho-gcc.patch b/var/spack/repos/builtin/packages/boost/context-macho-gcc.patch new file mode 100644 index 00000000000..f36f86a2ebb --- /dev/null +++ b/var/spack/repos/builtin/packages/boost/context-macho-gcc.patch @@ -0,0 +1,22 @@ +diff --git a/build/Jamfile.v2 b/build/Jamfile.v2 +index eb83bbb..8d8dac8 100644 +--- a/libs/context/build/Jamfile.v2 ++++ b/libs/context/build/Jamfile.v2 +@@ -646,6 +646,17 @@ alias asm_sources + clang + ; + ++alias asm_sources ++ : asm/make_x86_64_sysv_macho_gas.S ++ asm/jump_x86_64_sysv_macho_gas.S ++ asm/ontop_x86_64_sysv_macho_gas.S ++ : sysv ++ 64 ++ x86 ++ mach-o ++ gcc ++ ; ++ + alias asm_sources + : asm/make_x86_64_sysv_macho_gas.S + asm/jump_x86_64_sysv_macho_gas.S diff --git a/var/spack/repos/builtin/packages/boost/package.py b/var/spack/repos/builtin/packages/boost/package.py index d68db911624..ff5f1b71947 100644 --- a/var/spack/repos/builtin/packages/boost/package.py +++ b/var/spack/repos/builtin/packages/boost/package.py @@ -198,6 +198,14 @@ def libs(self): # Container's Extended Allocators were not added until 1.56.0 conflicts('+container', when='@:1.55.99') + # Boost.System till 1.76 (included) was relying on mutex, which was not + # detected correctly on Darwin platform when using GCC + # + # More details here: + # https://github.com/STEllAR-GROUP/hpx/issues/5442#issuecomment-878889166 + # https://github.com/STEllAR-GROUP/hpx/issues/5442#issuecomment-878913339 + conflicts('%gcc', when='@:1.76 +system platform=darwin') + # Patch fix from https://svn.boost.org/trac/boost/ticket/11856 patch('boost_11856.patch', when='@1.60.0%gcc@4.4.7') @@ -277,6 +285,11 @@ def libs(self): # and https://github.com/spack/spack/pull/21408 patch("bootstrap-toolset.patch", when="@1.75") + # Allow building context asm sources with GCC on Darwin + # See https://github.com/spack/spack/pull/24889 + # and https://github.com/boostorg/context/issues/177 + patch("context-macho-gcc.patch", when="@1.65:1.76 +context platform=darwin %gcc") + def patch(self): # Disable SSSE3 and AVX2 when using the NVIDIA compiler if self.spec.satisfies('%nvhpc'): @@ -551,6 +564,10 @@ def install(self, spec, prefix): threading_opts = self.determine_b2_options(spec, b2_options) + # Create headers if building from a git checkout + if '@develop' in spec: + b2('headers', *b2_options) + b2('--clean', *b2_options) # In theory it could be done on one call but it fails on diff --git a/var/spack/repos/builtin/packages/c-blosc2/package.py b/var/spack/repos/builtin/packages/c-blosc2/package.py index 82206d28fe6..ee3c7021cce 100644 --- a/var/spack/repos/builtin/packages/c-blosc2/package.py +++ b/var/spack/repos/builtin/packages/c-blosc2/package.py @@ -11,13 +11,14 @@ class CBlosc2(CMakePackage): other bells and whistles""" homepage = "http://www.blosc.org" - url = "https://github.com/Blosc/c-blosc2/archive/refs/tags/v2.0.0.rc1.tar.gz" + url = "https://github.com/Blosc/c-blosc2/archive/refs/tags/v2.0.1.tar.gz" git = "https://github.com/Blosc/c-blosc2.git" - maintainers = ['ax3l'] + maintainers = ['ax3l', 'robert-mijakovic'] version('develop', branch='master') - version('2.0.0.rc1', sha256='c30b72af5446f052bad1791000e5a44d156c96b0e39b4bc8e9f97a013c7d1b69') + version('2.0.2', sha256='fba51ba601610441eea6046e384284b2d8d7884922060cf15369d01d713b9b77') + version('2.0.1', sha256='35b93dfed479b1dfd9372d41d7843b60254ed1d71792577b95e489c28705874f') variant('avx2', default=True, description='Enable AVX2 support') diff --git a/var/spack/repos/builtin/packages/caffe/package.py b/var/spack/repos/builtin/packages/caffe/package.py index 1dab412e956..b2f54a3d2d9 100644 --- a/var/spack/repos/builtin/packages/caffe/package.py +++ b/var/spack/repos/builtin/packages/caffe/package.py @@ -6,7 +6,7 @@ from spack import * -class Caffe(CMakePackage): +class Caffe(CMakePackage, CudaPackage): """Caffe is a deep learning framework made with expression, speed, and modularity in mind. It is developed by the Berkeley Vision and Learning Center (BVLC) and by community contributors.""" @@ -43,7 +43,7 @@ class Caffe(CMakePackage): depends_on('hdf5 +hl +cxx') # Optional dependencies - depends_on('opencv@3.2.0+core+highgui+imgproc', when='+opencv') + depends_on('opencv@3.2.0:3.4.12+core+highgui+imgproc+imgcodecs', when='+opencv') depends_on('leveldb', when='+leveldb') depends_on('lmdb', when='+lmdb') depends_on('python@2.7:', when='+python') @@ -87,4 +87,10 @@ def cmake_args(self): '-DCMAKE_CXX_COMPILER={0}'.format(self.spec['mpi'].mpicxx) ]) + if '+cuda' in spec: + if spec.variants['cuda_arch'].value[0] != 'none': + cuda_arch = spec.variants['cuda_arch'].value + args.append(self.define('CUDA_ARCH_NAME', 'Manual')) + args.append(self.define('CUDA_ARCH_BIN', ' '.join(cuda_arch))) + return args diff --git a/var/spack/repos/builtin/packages/camellia/package.py b/var/spack/repos/builtin/packages/camellia/package.py index 857fe5ec690..654c3a8dfba 100644 --- a/var/spack/repos/builtin/packages/camellia/package.py +++ b/var/spack/repos/builtin/packages/camellia/package.py @@ -20,7 +20,7 @@ class Camellia(CMakePackage): variant('moab', default=True, description='Compile with MOAB to include support for reading standard mesh formats') - depends_on('trilinos+amesos+amesos2+belos+epetra+epetraext+exodus+ifpack+ifpack2+intrepid+intrepid2+kokkos+ml+muelu+sacado+shards+teuchos+tpetra+zoltan+mumps+superlu-dist+hdf5+zlib+pnetcdf@master,12.12.1:') + depends_on('trilinos+amesos+amesos2+belos+epetra+epetraext+exodus+ifpack+ifpack2+intrepid+intrepid2+kokkos+ml+muelu+sacado+shards+tpetra+zoltan+mumps+superlu-dist+hdf5+zlib+mpi+netcdf+pnetcdf@master,12.12.1:') depends_on('moab@:4', when='+moab') # Cameilla needs hdf5 but the description "hdf5@:1.8" is diff --git a/var/spack/repos/builtin/packages/cppunit/package.py b/var/spack/repos/builtin/packages/cppunit/package.py index 13eac4bc3a0..03f29c0f10d 100644 --- a/var/spack/repos/builtin/packages/cppunit/package.py +++ b/var/spack/repos/builtin/packages/cppunit/package.py @@ -26,3 +26,7 @@ def setup_build_environment(self, env): cxxstdflag = '' if cxxstd == 'default' else \ getattr(self.compiler, 'cxx{0}_flag'.format(cxxstd)) env.append_flags('CXXFLAGS', cxxstdflag) + + def configure_args(self): + args = ["--disable-doxygen"] + return args diff --git a/var/spack/repos/builtin/packages/cuda/package.py b/var/spack/repos/builtin/packages/cuda/package.py index a0ba20759cb..b4d966c4845 100644 --- a/var/spack/repos/builtin/packages/cuda/package.py +++ b/var/spack/repos/builtin/packages/cuda/package.py @@ -25,6 +25,10 @@ # format returned by platform.system() and 'arch' by platform.machine() _versions = { + '11.4.0': { + 'Linux-aarch64': ('f0c8e80d98a601ddca031b6764459984366008c7d3847e7c7f99b36bd4438e3c', 'https://developer.download.nvidia.com/compute/cuda/11.4.0/local_installers/cuda_11.4.0_470.42.01_linux_sbsa.run'), + 'Linux-x86_64': ('d219db30f7415a115a4ea22bdbb5984b0a18f7f891cad6074c5da45d223aaa4b', 'https://developer.download.nvidia.com/compute/cuda/11.4.0/local_installers/cuda_11.4.0_470.42.01_linux.run'), + 'Linux-ppc64le': ('6eb2fd0d9d5bc39fb243b5e1789ff827f325d098cd1fbb828a0499552b9544cc', 'https://developer.download.nvidia.com/compute/cuda/11.4.0/local_installers/cuda_11.4.0_470.42.01_linux_ppc64le.run')}, '11.3.1': { 'Linux-aarch64': ('39990d3da88b21289ac20850bc183f0b66275f32e1f562b551c05843bf506e4c', 'https://developer.download.nvidia.com/compute/cuda/11.3.1/local_installers/cuda_11.3.1_465.19.01_linux_sbsa.run'), 'Linux-x86_64': ('ad93ea98efced35855c58d3a0fc326377c60917cb3e8c017d3e6d88819bf2934', 'https://developer.download.nvidia.com/compute/cuda/11.3.1/local_installers/cuda_11.3.1_465.19.01_linux.run'), diff --git a/var/spack/repos/builtin/packages/cudnn/package.py b/var/spack/repos/builtin/packages/cudnn/package.py index 52ee22ec8a3..d6608ebcd04 100644 --- a/var/spack/repos/builtin/packages/cudnn/package.py +++ b/var/spack/repos/builtin/packages/cudnn/package.py @@ -13,7 +13,7 @@ '8.2.0.53-11.3': { 'Linux-x86_64': '7a195dc93a7cda2bdd4d9b73958d259c784be422cd941a9a625aab75309f19dc', 'Linux-ppc64le': 'cfe06735671a41a5e25fc7542d740177ac8eab1ab146bd30f19e0fa836895611', - 'Linux-aarch64sbsa': '0f44af94eef7826dc7b41f92aade3d5210891cdb10858bc0a28ba7167909ab7c'}, + 'Linux-aarch64': '0f44af94eef7826dc7b41f92aade3d5210891cdb10858bc0a28ba7167909ab7c'}, '8.2.0.53-10.2': { 'Linux-x86_64': '6ecbc98b3795e940ce0831ffb7cd2c0781830fdd6b1911f950bcaf6d569f807c'}, @@ -21,7 +21,7 @@ '8.1.1.33-11.2': { 'Linux-x86_64': '98a8784e92862f20018d20c281b30d4a0cd951f93694f6433ccf4ae9c502ba6a', 'Linux-ppc64le': 'c3e535a5d633ad8f4d50be0b6f8efd084c6c6ed3525c07cbd89fc508b1d76c7a', - 'Linux-aarch64sbsa': '4f7e4f5698539659d51f28dff0da11e5445a5ae58439af1d8a8e9f2d93535245'}, + 'Linux-aarch64': '4f7e4f5698539659d51f28dff0da11e5445a5ae58439af1d8a8e9f2d93535245'}, '8.1.1.33-10.2': { 'Linux-x86_64': '2a4a7b99a6e9bfa690eb19bb41e49553f2a7a491a5b3abfcae900e166c5b6ebd'}, @@ -29,14 +29,14 @@ '8.1.0.77-11.2': { 'Linux-x86_64': 'dbe82faf071d91ba9bcf00480146ad33f462482dfee56caf4479c1b8dabe3ecb', 'Linux-ppc64le': '0d3f8fa21959e9f94889841cc8445aecf41d2f3c557091b447313afb43034037', - 'Linux-aarch64sbsa': 'ba16ff486b68a8b50b69b32702612634954de529f39cfff68c12b8bfc1958499'}, + 'Linux-aarch64': 'ba16ff486b68a8b50b69b32702612634954de529f39cfff68c12b8bfc1958499'}, '8.1.0.77-10.2': { 'Linux-x86_64': 'c5bc617d89198b0fbe485156446be15a08aee37f7aff41c797b120912f2b14b4'}, # cuDNN 8.0.5 '8.0.5.39-11.1': { 'Linux-x86_64': '1d046bfa79399dabcc6f6cb1507918754439442ea0ca9e0fbecdd446f9b00cce', - 'Linux-aarch64sbsa': '0c3542c51b42131247cd9f839d0ebefe4e02bb46d1716be1682cb2919278085a'}, + 'Linux-aarch64': '0c3542c51b42131247cd9f839d0ebefe4e02bb46d1716be1682cb2919278085a'}, '8.0.5.39-11.0': { 'Linux-x86_64': '4e16ee7895deb4a8b1c194b812ba49586ef7d26902051401d3717511898a9b73', 'Linux-ppc64le': '05207a02c0b4f22464dbb0ee646693df4a70ae557640ba576ba8678c26393004'}, @@ -189,7 +189,6 @@ class Cudnn(Package): # https://developer.nvidia.com/rdp/cudnn-archive # Note that download links don't work from command line, # need to use modified URLs like in url_for_version. - maintainers = ['adamjstewart', 'bvanessen'] for ver, packages in _versions.items(): @@ -209,7 +208,8 @@ def url_for_version(self, version): # Get the system and machine arch for building the file path sys = "{0}-{1}".format(platform.system(), platform.machine()) # Munge it to match Nvidia's naming scheme - sys_key = sys.lower().replace('x86_64', 'x64').replace('darwin', 'osx') + sys_key = sys.lower().replace('x86_64', 'x64').replace('darwin', 'osx') \ + .replace('aarch64', 'aarch64sbsa') if version >= Version('7.2'): directory = version[:3] diff --git a/var/spack/repos/builtin/packages/darshan-runtime/package.py b/var/spack/repos/builtin/packages/darshan-runtime/package.py index 31c9f056029..5f4a84d0d29 100644 --- a/var/spack/repos/builtin/packages/darshan-runtime/package.py +++ b/var/spack/repos/builtin/packages/darshan-runtime/package.py @@ -8,7 +8,7 @@ from spack import * -class DarshanRuntime(Package): +class DarshanRuntime(AutotoolsPackage): """Darshan (runtime) is a scalable HPC I/O characterization tool designed to capture an accurate picture of application I/O behavior, including properties such as patterns of access within files, with @@ -21,6 +21,8 @@ class DarshanRuntime(Package): maintainers = ['shanedsnyder', 'carns'] + test_requires_compiler = True + version('main', branch='main', submodules=True) version('3.3.1', sha256='281d871335977d0592a49d053df93d68ce1840f6fdec27fea7a59586a84395f7') version('3.3.0', sha256='2e8bccf28acfa9f9394f2084ec18122c66e45d966087fa2e533928e824fcb57a') @@ -38,6 +40,10 @@ class DarshanRuntime(Package): depends_on('zlib') depends_on('hdf5', when='+hdf5') depends_on('papi', when='+apxc') + depends_on('autoconf', type='build', when='@main') + depends_on('automake', type='build', when='@main') + depends_on('libtool', type='build', when='@main') + depends_on('m4', type='build', when='@main') variant('mpi', default=True, description='Compile with MPI support') variant('hdf5', default=False, description='Compile with HDF5 module') @@ -61,7 +67,13 @@ class DarshanRuntime(Package): conflicts('+apxc', when='@:3.2.1', msg='+apxc variant only available starting from version 3.3.0') - def install(self, spec, prefix): + @property + def configure_directory(self): + return 'darshan-runtime' + + def configure_args(self): + spec = self.spec + extra_args = [] job_id = 'NONE' if '+slurm' in spec: @@ -73,36 +85,107 @@ def install(self, spec, prefix): if '+sge' in spec: job_id = 'JOB_ID' - # TODO: BG-Q and other platform configure options - options = [] - if '+mpi' in spec: - options = ['CC=%s' % spec['mpi'].mpicc] - else: - options = ['--without-mpi'] - if '+hdf5' in spec: - options.extend(['--enable-hdf5-mod=%s' % spec['hdf5'].prefix]) - + if self.version < Version('3.3.2'): + extra_args.append('--enable-hdf5-mod=%s' % spec['hdf5'].prefix) + else: + extra_args.append('--enable-hdf5-mod') if '+apmpi' in spec: - options.extend(['--enable-apmpi-mod']) + extra_args.append('--enable-apmpi-mod') if '+apmpi_sync' in spec: - options.extend(['--enable-apmpi-mod', - '--enable-apmpi-coll-sync']) + extra_args.append(['--enable-apmpi-mod', + '--enable-apmpi-coll-sync']) if '+apxc' in spec: - options.extend(['--enable-apxc-mod']) + extra_args.append(['--enable-apxc-mod']) - options.extend(['--with-mem-align=8', - '--with-log-path-by-env=DARSHAN_LOG_DIR_PATH', - '--with-jobid-env=%s' % job_id, - '--with-zlib=%s' % spec['zlib'].prefix]) + extra_args.append('--with-mem-align=8') + extra_args.append('--with-log-path-by-env=DARSHAN_LOG_DIR_PATH') + extra_args.append('--with-jobid-env=%s' % job_id) + extra_args.append('--with-zlib=%s' % spec['zlib'].prefix) - with working_dir('spack-build', create=True): - configure = Executable('../darshan-runtime/configure') - configure('--prefix=%s' % prefix, *options) - make() - make('install') + if '+mpi' in spec: + extra_args.append('CC=%s' % self.spec['mpi'].mpicc) + else: + extra_args.append('CC=%s' % self.compiler.cc) + extra_args.append('--without-mpi') + + return extra_args def setup_run_environment(self, env): # default path for log file, could be user or site specific setting darshan_log_dir = os.environ['HOME'] env.set('DARSHAN_LOG_DIR_PATH', darshan_log_dir) + + @property + def basepath(self): + return join_path('darshan-test', + join_path('regression', + join_path('test-cases', 'src'))) + + @run_after('install') + def _copy_test_inputs(self): + test_inputs = [ + join_path(self.basepath, 'mpi-io-test.c')] + self.cache_extra_test_sources(test_inputs) + + def _test_intercept(self): + testdir = "intercept-test" + with working_dir(testdir, create=True): + if '+mpi' in self.spec: + # compile a test program + logname = join_path(os.getcwd(), "test.darshan") + fname = join_path(self.test_suite.current_test_cache_dir, + join_path(self.basepath, 'mpi-io-test.c')) + cc = Executable(self.spec['mpi'].mpicc) + compile_opt = ['-c', fname] + link_opt = ['-o', "mpi-io-test", 'mpi-io-test.o'] + cc(*(compile_opt)) + cc(*(link_opt)) + + # run test program and intercept + purpose = "Test running code built against darshan" + exe = "./mpi-io-test" + options = ['-f', 'tmp.dat'] + status = [0] + installed = False + expected_output = [r"Write bandwidth = \d+.\d+ Mbytes/sec", + r"Read bandwidth = \d+.\d+ Mbytes/sec"] + env['LD_PRELOAD'] = 'libdarshan.so' + env['DARSHAN_LOGFILE'] = logname + self.run_test(exe, + options, + expected_output, + status, + installed, + purpose, + skip_missing=False, + work_dir=None) + env.pop('LD_PRELOAD') + + import llnl.util.tty as tty + + # verify existence of log and size is > 0 + tty.msg("Test for existince of log:") + if os.path.exists(logname): + sr = os.stat(logname) + print("PASSED") + tty.msg("Test for size of log:") + if not sr.st_size > 0: + exc = BaseException('log size is 0') + m = None + if spack.config.get('config:fail_fast', False): + raise TestFailure([(exc, m)]) + else: + self.test_failures.append((exc, m)) + else: + print("PASSED") + else: + exc = BaseException('log does not exist') + m = None + if spack.config.get('config:fail_fast', False): + raise TestFailure([(exc, m)]) + else: + self.test_failures.append((exc, m)) + + def test(self): + self._test_intercept() diff --git a/var/spack/repos/builtin/packages/darshan-util/package.py b/var/spack/repos/builtin/packages/darshan-util/package.py index b5adebc1d2c..8ca7915e31a 100644 --- a/var/spack/repos/builtin/packages/darshan-util/package.py +++ b/var/spack/repos/builtin/packages/darshan-util/package.py @@ -6,7 +6,7 @@ from spack import * -class DarshanUtil(Package): +class DarshanUtil(AutotoolsPackage): """Darshan (util) is collection of tools for parsing and summarizing log files produced by Darshan (runtime) instrumentation. This package is typically installed on systems (front-end) where you intend to analyze @@ -32,12 +32,15 @@ class DarshanUtil(Package): version('3.0.0', sha256='95232710f5631bbf665964c0650df729c48104494e887442596128d189da43e0') variant('bzip2', default=False, description="Enable bzip2 compression") - variant('shared', default=True, description='Build shared libraries') variant('apmpi', default=False, description='Compile with AutoPerf MPI module support') variant('apxc', default=False, description='Compile with AutoPerf XC module support') depends_on('zlib') depends_on('bzip2', when="+bzip2", type=("build", "link", "run")) + depends_on('autoconf', type='build', when='@main') + depends_on('automake', type='build', when='@main') + depends_on('libtool', type='build', when='@main') + depends_on('m4', type='build', when='@main') patch('retvoid.patch', when='@3.2.0:3.2.1') @@ -46,20 +49,66 @@ class DarshanUtil(Package): conflicts('+apxc', when='@:3.2.1', msg='+apxc variant only available starting from version 3.3.0') - def install(self, spec, prefix): + @property + def configure_directory(self): + return 'darshan-util' - options = ['CC=%s' % self.compiler.cc, - '--with-zlib=%s' % spec['zlib'].prefix] - if '+shared' in spec: - options.extend(['--enable-shared']) + def configure_args(self): + spec = self.spec + extra_args = [] + extra_args.append('CC=%s' % self.compiler.cc) + extra_args.append('--with-zlib=%s' % spec['zlib'].prefix) if '+apmpi' in spec: - options.extend(['--enable-autoperf-apmpi']) + if self.version < Version('3.3.2'): + extra_args.append('--enable-autoperf-apmpi') + else: + extra_args.append('--enable-apmpi-mod') if '+apxc' in spec: - options.extend(['--enable-autoperf-apxc']) + if self.version < Version('3.3.2'): + extra_args.append('--enable-autoperf-apxc') + else: + extra_args.append('--enable-apxc-mod') - with working_dir('spack-build', create=True): - configure = Executable('../darshan-util/configure') - configure('--prefix=%s' % prefix, *options) - make() - make('install') + return extra_args + + @property + def basepath(self): + return join_path('darshan-test', 'example-output') + + @run_after('install') + def _copy_test_inputs(self): + # add darshan-test/example-output/mpi-io-test-spack-expected.txt" + test_inputs = [ + join_path(self.basepath, + "mpi-io-test-x86_64-{0}.darshan".format(self.spec.version))] + self.cache_extra_test_sources(test_inputs) + + def _test_parser(self): + purpose = "Verify darshan-parser can parse an example log \ + from the current version and check some expected counter values" + # Switch to loading the expected strings from the darshan source in future + # filename = self.test_suite.current_test_cache_dir. + # join(join_path(self.basepath, "mpi-io-test-spack-expected.txt")) + # expected_output = self.get_escaped_text_output(filename) + expected_output = [r"POSIX\s+-1\s+\w+\s+POSIX_OPENS\s+\d+", + r"MPI-IO\s+-1\s+\w+\s+MPIIO_INDEP_OPENS\s+\d+", + r"STDIO\s+0\s+\w+\s+STDIO_OPENS\s+\d+"] + logname = self.test_suite.current_test_cache_dir.join( + join_path(self.basepath, + "mpi-io-test-x86_64-{0}.darshan".format(self.spec.version))) + exe = 'darshan-parser' + options = [logname] + status = [0] + installed = True + self.run_test(exe, + options, + expected_output, + status, + installed, + purpose, + skip_missing=False, + work_dir=None) + + def test(self): + self._test_parser() diff --git a/var/spack/repos/builtin/packages/datatransferkit/package.py b/var/spack/repos/builtin/packages/datatransferkit/package.py index 8cc72a2da54..42698cc1722 100644 --- a/var/spack/repos/builtin/packages/datatransferkit/package.py +++ b/var/spack/repos/builtin/packages/datatransferkit/package.py @@ -27,9 +27,10 @@ class Datatransferkit(CMakePackage): description='enable the build of shared lib') depends_on('arborx@1.0:', when='+external-arborx') + depends_on('boost') depends_on('cmake', type='build') - depends_on('trilinos+intrepid2+shards~dtk', when='+serial') - depends_on('trilinos+intrepid2+shards+openmp~dtk', when='+openmp') + depends_on('trilinos+intrepid2+shards~dtk') + depends_on('trilinos+openmp', when='+openmp') depends_on('trilinos+stratimikos+belos', when='@master') depends_on('trilinos@13:13.99', when='@3.1-rc2') diff --git a/var/spack/repos/builtin/packages/dealii/package.py b/var/spack/repos/builtin/packages/dealii/package.py index 644fd32eda3..7c34fc1d1a9 100644 --- a/var/spack/repos/builtin/packages/dealii/package.py +++ b/var/spack/repos/builtin/packages/dealii/package.py @@ -210,16 +210,11 @@ class Dealii(CMakePackage, CudaPackage): depends_on('symengine@0.6:', when='@9.2:+symengine') depends_on('tbb', when='+threads') # do not require +rol to make concretization of xsdk possible - depends_on('trilinos+amesos+aztec+epetra+ifpack+ml+muelu+sacado+teuchos', - when='+trilinos+mpi~int64~cuda') - depends_on('trilinos+amesos+aztec+epetra+ifpack+ml+muelu+sacado+teuchos~hypre', - when='+trilinos+mpi+int64~cuda') + depends_on('trilinos+amesos+aztec+epetra+ifpack+ml+muelu+sacado', when='+trilinos') + depends_on('trilinos~hypre', when='+trilinos+int64') # TODO: temporary disable Tpetra when using CUDA due to # namespace "Kokkos::Impl" has no member "cuda_abort" - depends_on('trilinos@master+amesos+aztec+epetra+ifpack+ml+muelu+rol+sacado+teuchos~amesos2~ifpack2~intrepid2~kokkos~tpetra~zoltan2', - when='+trilinos+mpi~int64+cuda') - depends_on('trilinos@master+amesos+aztec+epetra+ifpack+ml+muelu+rol+sacado+teuchos~hypre~amesos2~ifpack2~intrepid2~kokkos~tpetra~zoltan2', - when='+trilinos+mpi+int64+cuda') + depends_on('trilinos@master+rol~amesos2~ifpack2~intrepid2~kokkos~tpetra~zoltan2', when='+trilinos+cuda') # Explicitly provide a destructor in BlockVector, # otherwise deal.II may fail to build with Intel compilers. diff --git a/var/spack/repos/builtin/packages/dihydrogen/package.py b/var/spack/repos/builtin/packages/dihydrogen/package.py index 0bd36298d24..4a133c0a059 100644 --- a/var/spack/repos/builtin/packages/dihydrogen/package.py +++ b/var/spack/repos/builtin/packages/dihydrogen/package.py @@ -159,8 +159,8 @@ def cmake_args(self): args.append('-DCMAKE_CUDA_STANDARD=14') archs = spec.variants['cuda_arch'].value if archs != 'none': - arch_str = ",".join(archs) - args.append('-DCMAKE_CUDA_ARCHITECTURES=%s' % arch_str) + arch_str = ";".join(archs) + args.append('-DCMAKE_CUDA_ARCHITECTURES=%s' % arch_str) if '+cuda' in spec or '+distconv' in spec: args.append('-DcuDNN_DIR={0}'.format( diff --git a/var/spack/repos/builtin/packages/dssp/package.py b/var/spack/repos/builtin/packages/dssp/package.py index 21284677148..b9487741df9 100644 --- a/var/spack/repos/builtin/packages/dssp/package.py +++ b/var/spack/repos/builtin/packages/dssp/package.py @@ -43,8 +43,13 @@ def edit(self): @run_after('install') def cache_test_sources(self): + """Save off the pdb sources for stand-alone testing.""" self.cache_extra_test_sources('pdb') def test(self): - pdb_path = join_path(self.install_test_root, 'pdb') - self.run_test('mkdssp', options=['1ALK.pdb', '1alk.dssp'], work_dir=pdb_path) + """Perform stand-alone/smoke test on installed package.""" + pdb_path = join_path(self.test_suite.current_test_cache_dir, 'pdb') + self.run_test('mkdssp', options=['1ALK.pdb', '1alk.dssp'], + purpose='test: calculating structure for example', + installed=True, + work_dir=pdb_path) diff --git a/var/spack/repos/builtin/packages/eigenexa/package.py b/var/spack/repos/builtin/packages/eigenexa/package.py index 265c48b35dc..8371985eeef 100644 --- a/var/spack/repos/builtin/packages/eigenexa/package.py +++ b/var/spack/repos/builtin/packages/eigenexa/package.py @@ -52,18 +52,33 @@ def setup_build_environment(self, env): @run_after('install') def cache_test_sources(self): + """Save off benchmark files for stand-alone tests.""" self.cache_extra_test_sources("benchmark") def test(self): - test_dir = self.test_suite.current_test_data_dir - exe_name = join_path(test_dir, "run-test.sh") - mpi_name = self.spec["mpi"].prefix.bin.mpirun - test_file = join_path( - self.install_test_root, "benchmark", "eigenexa_benchmark" + """Perform stand-alone/smoke tests using pre-built benchmarks.""" + # NOTE: This package would ideally build the test program using + # the installed software *each* time the tests are run since + # this package installs a library. + + test_cache_dir = join_path( + self.test_suite.current_test_cache_dir, + "benchmark" ) - input_file = join_path(self.install_test_root, "benchmark", "IN") - opts = [exe_name, mpi_name, '-n', '1', test_file, '-f', input_file] + test_data_dir = self.test_suite.current_test_data_dir + + opts = [ + "run-test.sh", + self.spec["mpi"].prefix.bin.mpirun, + '-n', '1', + join_path(test_cache_dir, "eigenexa_benchmark"), + '-f', join_path(test_cache_dir, "IN") + ] env["OMP_NUM_THREADS"] = "1" self.run_test( - "sh", options=opts, expected="EigenExa Test Passed !", work_dir=test_dir + "sh", + options=opts, + expected="EigenExa Test Passed !", + purpose="test: running benchmark checks", + work_dir=test_data_dir ) diff --git a/var/spack/repos/builtin/packages/environment-modules/package.py b/var/spack/repos/builtin/packages/environment-modules/package.py index e3f9a4616f2..2af0caadff9 100644 --- a/var/spack/repos/builtin/packages/environment-modules/package.py +++ b/var/spack/repos/builtin/packages/environment-modules/package.py @@ -10,10 +10,11 @@ class EnvironmentModules(Package): """ homepage = 'https://cea-hpc.github.io/modules/' - url = 'https://github.com/cea-hpc/modules/releases/download/v4.7.1/modules-4.7.1.tar.gz' + url = 'https://github.com/cea-hpc/modules/releases/download/v4.8.0/modules-4.8.0.tar.gz' maintainers = ['xdelaruelle'] + version('4.8.0', sha256='d6b45cadc2146ed5e0b25a96d44643ad516054eb7745acb14a1dc7bf30744f6e') version('4.7.1', sha256='ee7ecd62bbbde6d51e30788a97800c39e72515b6a910839fb84041b35ba42b4d') version('4.7.0', sha256='3ab0a649e23b4dd00963e4cae60e573b449194ecb4035c5ce487330b272b4d06') version('4.6.1', sha256='3445df39abe5838b94552b53e7dbff56ada8347b9fdc6c04a72297d5b04af76f') diff --git a/var/spack/repos/builtin/packages/enzyme/package.py b/var/spack/repos/builtin/packages/enzyme/package.py new file mode 100644 index 00000000000..2e43e2c9703 --- /dev/null +++ b/var/spack/repos/builtin/packages/enzyme/package.py @@ -0,0 +1,69 @@ + +# Copyright 2013-2020 Lawrence Livermore National Security, LLC and other +# Spack Project Developers. See the top-level COPYRIGHT file for details. +# +# SPDX-License-Identifier: (Apache-2.0 OR MIT) + +from spack import * + + +class Enzyme(CMakePackage): + """ + The Enzyme project is a tool for performing reverse-mode automatic + differentiation (AD) of statically-analyzable LLVM IR. + This allows developers to use Enzyme to automatically create gradients + of their source code without much additional work. + """ + + homepage = "https://enzyme.mit.edu" + url = "https://github.com/wsmoses/Enzyme/archive/v0.0.15.tar.gz" + list_url = "https://github.com/wsmoses/Enzyme/releases" + git = "https://github.com/wsmoses/Enzyme" + + maintainers = ['wsmoses', 'vchuravy', 'tgymnich'] + + root_cmakelists_dir = 'enzyme' + + version('main', branch='main') + version('0.0.15', + sha256='1ec27db0d790c4507b2256d851b256bf7e074eec933040e9e375d6e352a3c159') + version('0.0.14', + sha256='740641eeeeadaf47942ac88cc52e62ddc0e8c25767a501bed36ec241cf258b8d') + version('0.0.13', + sha256='d4a53964ec1f763772db2c56e6734269b7656c8b2ecd41fa7a41315bcd896b5a') + + variant( + 'build_type', + default='Release', + description='CMake build type', + values=('Debug', 'Release', 'RelWithDebInfo', 'MinSizeRel') + ) + + depends_on('llvm@7:12') + depends_on('cmake@3.9:', type='build') + + def cmake_args(self): + spec = self.spec + args = [ + "-DLLVM_DIR=" + spec["llvm"].prefix.lib + "/cmake/llvm" + ] + return args + + @property + def libs(self): + ver = self.spec['llvm'].version.up_to(1) + libs = [ + 'LLVMEnzyme-{0}'.format(ver), + 'ClangEnzyme-{0}'.format(ver) + ] + return find_libraries(libs, root=self.prefix, recursive=True) + + def setup_dependent_build_environment(self, env, dependent_spec): + # Get the LLVMEnzyme and ClangEnzyme lib paths + llvm, clang = self.libs + + if "LLVMEnzyme-" in clang: + llvm, clang = clang, llvm + + env.set('LLVMENZYME', llvm) + env.set('CLANGENZYME', clang) diff --git a/var/spack/repos/builtin/packages/exempi/package.py b/var/spack/repos/builtin/packages/exempi/package.py new file mode 100644 index 00000000000..4f1ddff54a1 --- /dev/null +++ b/var/spack/repos/builtin/packages/exempi/package.py @@ -0,0 +1,35 @@ +# Copyright 2013-2021 Lawrence Livermore National Security, LLC and other +# Spack Project Developers. See the top-level COPYRIGHT file for details. +# +# SPDX-License-Identifier: (Apache-2.0 OR MIT) + +from spack import * + + +class Exempi(AutotoolsPackage): + """exempi is a port of Adobe XMP SDK to work on UNIX and to be build with + GNU automake. + + It includes XMPCore and XMPFiles, libexempi, a C-based API and exempi + a command line tool. + """ + + homepage = "http://libopenraw.freedesktop.org/wiki/Exempi" + url = "https://libopenraw.freedesktop.org/download/exempi-2.5.2.tar.bz2" + + version('2.5.2', sha256='52f54314aefd45945d47a6ecf4bd21f362e6467fa5d0538b0d45a06bc6eaaed5') + + depends_on('zlib') + depends_on('iconv') + depends_on('boost@1.48.0:') + depends_on('pkgconfig') + + conflicts('%gcc@:4.5') + + def configure_args(self): + args = ['--with-boost={0}'.format(self.spec['boost'].prefix)] + + if self.spec.satisfies('polatform=darwin'): + args += ['--with-darwinports', '--with-fink'] + + return args diff --git a/var/spack/repos/builtin/packages/expat/package.py b/var/spack/repos/builtin/packages/expat/package.py index ddc6f8bc85c..799928b11a2 100644 --- a/var/spack/repos/builtin/packages/expat/package.py +++ b/var/spack/repos/builtin/packages/expat/package.py @@ -14,9 +14,13 @@ class Expat(AutotoolsPackage): homepage = "https://libexpat.github.io/" url = "https://github.com/libexpat/libexpat/releases/download/R_2_2_9/expat-2.2.9.tar.bz2" - version('2.3.0', sha256='f122a20eada303f904d5e0513326c5b821248f2d4d2afbf5c6f1339e511c0586') - version('2.2.10', sha256='b2c160f1b60e92da69de8e12333096aeb0c3bf692d41c60794de278af72135a5') - version('2.2.9', sha256='f1063084dc4302a427dabcca499c8312b3a32a29b7d2506653ecc8f950a9a237') + version('2.4.1', sha256='2f9b6a580b94577b150a7d5617ad4643a4301a6616ff459307df3e225bcfbf40') + version('2.4.0', sha256='8c59142ef88913bc0a8b6e4c58970c034210ca552e6271f52f6cd6cce3708424') + # deprecate all releases before 2.4.0 because of CVE-2013-0340 + # ("billion laughs attack") + version('2.3.0', sha256='f122a20eada303f904d5e0513326c5b821248f2d4d2afbf5c6f1339e511c0586', deprecated=True) + version('2.2.10', sha256='b2c160f1b60e92da69de8e12333096aeb0c3bf692d41c60794de278af72135a5', deprecated=True) + version('2.2.9', sha256='f1063084dc4302a427dabcca499c8312b3a32a29b7d2506653ecc8f950a9a237', deprecated=True) version('2.2.6', sha256='17b43c2716d521369f82fc2dc70f359860e90fa440bea65b3b85f0b246ea81f2', deprecated=True) version('2.2.5', sha256='d9dc32efba7e74f788fcc4f212a43216fc37cf5f23f4c2339664d473353aedf6', deprecated=True) version('2.2.2', sha256='4376911fcf81a23ebd821bbabc26fd933f3ac74833f74924342c29aad2c86046', deprecated=True) diff --git a/var/spack/repos/builtin/packages/faodel/package.py b/var/spack/repos/builtin/packages/faodel/package.py index 56e14951413..047ea718759 100644 --- a/var/spack/repos/builtin/packages/faodel/package.py +++ b/var/spack/repos/builtin/packages/faodel/package.py @@ -37,7 +37,7 @@ class Faodel(CMakePackage): depends_on('hdf5+mpi', when='+hdf5+mpi') depends_on('hdf5~mpi', when='+hdf5~mpi') depends_on('libfabric@1.5.3:', when='network=libfabric') - depends_on('googletest@1.7.0:', type='build') + depends_on('googletest@1.7.0:1.10', type='test') # FAODEL requires C++11 support which starts with gcc 4.8.1 conflicts('%gcc@:4.8.0') @@ -62,20 +62,24 @@ class Faodel(CMakePackage): def cmake_args(self): spec = self.spec + build_tests = self.run_tests and '+mpi' in spec + args = [ self.define_from_variant('BUILD_SHARED_LIBS', 'shared'), - self.define_from_variant('BUILD_TESTS', 'mpi'), - '-DBOOST_ROOT:PATH={0}'.format(spec['boost'].prefix), - '-DGTEST_ROOT:PATH={0}'.format(spec['googletest'].prefix), - '-DBUILD_DOCS:BOOL=OFF', + self.define('BOOST_ROOT', spec['boost'].prefix), + self.define('BUILD_DOCS', False), + self.define('BUILD_TESTS', build_tests), self.define_from_variant('Faodel_ENABLE_IOM_HDF5', 'hdf5'), # self.define_from_variant('Faodel_ENABLE_IOM_LEVELDB', 'leveldb'), self.define_from_variant('Faodel_ENABLE_MPI_SUPPORT', 'mpi'), self.define_from_variant('Faodel_ENABLE_TCMALLOC', 'tcmalloc'), - '-DFaodel_LOGGING_METHOD:STRING={0}'.format( - spec.variants['logging'].value), - '-DFaodel_NETWORK_LIBRARY:STRING={0}'.format( - spec.variants['network'].value), - self.define_from_variant('Faodel_ENABLE_CEREAL', 'cereal') + self.define_from_variant('Faodel_LOGGING_METHOD', 'logging'), + self.define_from_variant('Faodel_NETWORK_LIBRARY', 'network'), + self.define_from_variant('Faodel_ENABLE_CEREAL', 'cereal'), ] + if build_tests: + args.extend([ + self.define('GTEST_ROOT', spec['googletest'].prefix) + ]) + return args diff --git a/var/spack/repos/builtin/packages/fenics-basix/package.py b/var/spack/repos/builtin/packages/fenics-basix/package.py index dc7f01367ce..47fced6e742 100644 --- a/var/spack/repos/builtin/packages/fenics-basix/package.py +++ b/var/spack/repos/builtin/packages/fenics-basix/package.py @@ -12,7 +12,7 @@ class FenicsBasix(CMakePackage): homepage = "https://github.com/FEniCS/basix" url = "https://github.com/FEniCS/basix/archive/0.1.0.tar.gz" git = "https://github.com/FEniCS/basix.git" - maintainers = ["mscroggs", "chrisrichardson"] + maintainers = ["mscroggs", "chrisrichardson", "garth-wells"] version("main", branch="main") version("0.1.0", sha256="2ab41fe6ad4f6c42f01b17a6e7c39debb4e0ae61c334d1caebee78b741bca4e7") diff --git a/var/spack/repos/builtin/packages/fenics-dolfinx/package.py b/var/spack/repos/builtin/packages/fenics-dolfinx/package.py index 7c1b52a4b67..a8c0acec74c 100644 --- a/var/spack/repos/builtin/packages/fenics-dolfinx/package.py +++ b/var/spack/repos/builtin/packages/fenics-dolfinx/package.py @@ -12,7 +12,7 @@ class FenicsDolfinx(CMakePackage): homepage = "https://github.com/FEniCS/dolfinx" git = "https://github.com/FEniCS/dolfinx.git" url = "https://github.com/FEniCS/dolfinx/archive/0.1.0.tar.gz" - maintainers = ["js947", "chrisrichardson"] + maintainers = ["js947", "chrisrichardson", "garth-wells"] version("main", branch="main") version("0.1.0", sha256="0269379769b5b6d4d1864ded64402ecaea08054c2a5793c8685ea15a59af5e33") @@ -21,25 +21,29 @@ class FenicsDolfinx(CMakePackage): variant("parmetis", default=False, description="parmetis support") variant("slepc", default=False, description="slepc support") - depends_on("cmake@3.9:", type="build") + depends_on("cmake@3.12:") depends_on("pkgconfig", type="build") depends_on("mpi") depends_on("hdf5") depends_on("boost@1.7.0:+filesystem+program_options+timer") - depends_on("petsc+mpi+shared", when="@main") - depends_on("petsc+mpi+shared@3.15.0", when="@0.1.0") + depends_on("petsc+mpi+shared") + depends_on("petsc+mpi+shared@3.15.0:", when="@0.1.0") depends_on("scotch+mpi") depends_on("kahip", when="+kahip") depends_on("parmetis", when="+parmetis") depends_on("slepc", when="+slepc") - depends_on("py-fenics-ffcx", type=("build", "run"), when="@main") + depends_on("py-fenics-ffcx", type=("build", "run")) + depends_on("py-fenics-ffcx@main", type=("build", "run"), when="@main") depends_on("py-fenics-ffcx@0.1.0", type=("build", "run"), when="@0.1.0") - depends_on("fenics-basix", type=("build", "run"), when="@main") + depends_on("fenics-basix", type=("build", "run")) + depends_on("fenics-basix@main", type=("build", "run"), when="@main") depends_on("fenics-basix@0.1.0", type=("build", "run"), when="@0.1.0") - depends_on("py-fenics-basix", type=("build", "run"), when="@main") + + depends_on("py-fenics-basix", type=("build", "run")) + depends_on("py-fenics-basix@main", type=("build", "run"), when="@main") depends_on("py-fenics-basix@0.1.0", type=("build", "run"), when="@0.1.0") conflicts('%gcc@:8', msg='Improved C++17 support required') diff --git a/var/spack/repos/builtin/packages/fenics/package.py b/var/spack/repos/builtin/packages/fenics/package.py index 01a2f16019f..36eeaef4702 100644 --- a/var/spack/repos/builtin/packages/fenics/package.py +++ b/var/spack/repos/builtin/packages/fenics/package.py @@ -131,6 +131,7 @@ def cmake_args(self): self.define_from_variant('DOLFIN_ENABLE_OPENMP', 'openmp'), self.define_from_variant('DOLFIN_ENABLE_CHOLMOD', 'suite-sparse'), self.define_from_variant('DOLFIN_ENABLE_HDF5', 'hdf5'), + self.define_from_variant('HDF5_NO_FIND_PACKAGE_CONFIG_FILE', 'hdf5'), self.define_from_variant('DOLFIN_ENABLE_MPI', 'mpi'), self.define_from_variant('DOLFIN_ENABLE_PARMETIS', 'parmetis'), self.define_from_variant('DOLFIN_ENABLE_PETSC', 'petsc'), diff --git a/var/spack/repos/builtin/packages/flecsi/package.py b/var/spack/repos/builtin/packages/flecsi/package.py index 7f5f4454277..e7cee1bf744 100644 --- a/var/spack/repos/builtin/packages/flecsi/package.py +++ b/var/spack/repos/builtin/packages/flecsi/package.py @@ -64,17 +64,19 @@ class Flecsi(CMakePackage, CudaPackage): variant('openmp', default=False, description='Enable OpenMP Support') - # All Current FLecsi Releases + # All Current FleCSI Releases for level in ('low', 'medium', 'high'): - depends_on('caliper', when='caliper_detail=%s' % level) - depends_on('caliper@2.0.1~adiak', when='@:1.9 caliper_detail=%s' % level) + depends_on('caliper@2.0.1~adiak~libdw', when='@:1.9 caliper_detail=%s' % level) + depends_on('caliper@2.4.0~libdw', when='@2.0: caliper_detail=%s' % level) depends_on('graphviz', when='+graphviz') - depends_on('hdf5+mpi', when='+hdf5') + depends_on('hdf5+hl+mpi', when='+hdf5') depends_on('metis@5.1.0:') depends_on('parmetis@4.0.3:') depends_on('boost@1.70.0: cxxstd=17 +program_options') + depends_on('openmpi+legacylaunchers', when='+unit_tests ^openmpi') + depends_on('legion network=gasnet', when='backend=legion') - # Flecsi@1.x + # FleCSI@1.x depends_on('cmake@3.12:', when='@:1.9') # Requires cinch > 1.0 due to cinchlog installation issue depends_on('cinch@1.01:', type='build', when='+external_cinch @:1.9') @@ -84,55 +86,58 @@ class Flecsi(CMakePackage, CudaPackage): depends_on('legion+shared', when='backend=legion @:1.9') depends_on('legion+hdf5', when='backend=legion +hdf5 @:1.9') depends_on('legion build_type=Debug', when='backend=legion +debug_backend @:1.9') + depends_on('legion@ctrl-rep-7', when='backend=legion @:1.9') depends_on('hpx@1.4.1 cxxstd=17 malloc=system max_cpu_count=128', when='backend=hpx @:1.9') depends_on('hpx build_type=Debug', when='backend=hpx +debug_backend @:1.9') depends_on('googletest@1.8.1+gmock', when='@:1.9') - depends_on('hdf5+hl', when='+hdf5 @:1.9') depends_on('python@3.0:', when='+tutorial @:1.9') depends_on('doxygen', when='+doxygen @:1.9') depends_on('llvm', when='+flecstan @:1.9') depends_on('pfunit@3.0:3.99', when='@:1.9') depends_on('py-gcovr', when='+coverage @:1.9') - # Flecsi@2.x + # FleCSI@2.x depends_on('cmake@3.15:', when='@2.0:') - depends_on('boost@1.70.0 +atomic +filesystem +regex +system', when='@2.0:') + depends_on('boost +atomic +filesystem +regex +system', when='@2.0:') depends_on('kokkos@3.2.00:', when='+kokkos @2.0:') depends_on('legion@ctrl-rep-9:ctrl-rep-99', when='backend=legion @2.0:') depends_on('legion+hdf5', when='backend=legion +hdf5 @2.0:') depends_on('hdf5@1.10.7:', when='backend=legion +hdf5 @2.0:') depends_on('hpx@1.3.0 cxxstd=17 malloc=system', when='backend=hpx @2.0:') depends_on('kokkos@3.2.00:', when='+kokkos @2.0:') - depends_on('mpich@3.4.1', when='@2.0: ^mpich') - depends_on('openmpi@4.1.0', when='@2.0: ^openmpi') + depends_on('mpich@3.4.1:', when='@2.0: ^mpich') + depends_on('openmpi@4.1.0:', when='@2.0: ^openmpi') conflicts('+tutorial', when='backend=hpx') - # Flecsi@2: no longer supports serial or charmpp backends + # FleCSI@2: no longer supports serial or charmpp backends conflicts('backend=serial', when='@2.0:') conflicts('backend=charmpp', when='@2.0:') - # FLecsi@2: no longer expects to control how backend is built + # FleCSI@2: no longer expects to control how backend is built conflicts('+debug_backend', when='@2.0:') - # Flecsi@2: No longer supports previous TPL related flags + # FleCSI@2: No longer supports previous TPL related flags conflicts('+disable_metis', when='@2.0:') - # Flecsi@2: no longer provides documentation variants + # FleCSI@2: no longer provides documentation variants conflicts('+doxygen', when='@2.0:') conflicts('+doc', when='@2.0:') - # Flecsi@2: no longer provides coverage variants + # FleCSI@2: no longer provides coverage variants conflicts('+coverage', when='@2.0:') - # Flecsi@2: no longer provides tutorial variants + # FleCSI@2: no longer provides tutorial variants conflicts('+tutorial', when='@2.0:') - # Flecsi@2: no longer supports flecstan + # FleCSI@2: no longer supports flecstan conflicts('+flecstan', when='@2.0:') - # Flecsi@2: integrates cinch and no longer depends on external installs + # FleCSI@2: integrates cinch and no longer depends on external installs conflicts('+external_cinch', when='@2.0:') - # Current Flecsi@:1.9 releases do not support kokkos, omp, or cuda + # Current FleCSI@:1.9 releases do not support kokkos, omp, or cuda conflicts('+kokkos', when='@:1.9') conflicts('+openmp', when='@:1.9') conflicts('+cuda', when='@:1.9') # Unit tests require flog support conflicts('+unit_tests', when='~flog') - # Disallow network=none when using legion as a backend - conflicts('legion network=none', when='backend=legion @:1.9') + # Disallow conduit=none when using legion as a backend + conflicts('legion conduit=none', when='backend=legion') + # Due to overhauls of Legion and Gasnet spackages + # flecsi@:1.9 can no longer be built with a usable legion + conflicts('backend=legion', when='@:1.9') def cmake_args(self): spec = self.spec diff --git a/var/spack/repos/builtin/packages/flecsph/package.py b/var/spack/repos/builtin/packages/flecsph/package.py index bf4c7a275c0..d79442f6af5 100644 --- a/var/spack/repos/builtin/packages/flecsph/package.py +++ b/var/spack/repos/builtin/packages/flecsph/package.py @@ -22,10 +22,10 @@ class Flecsph(CMakePackage): variant('test', default=True, description='Adding tests') depends_on('cmake@3.15:', type='build') - depends_on('boost@1.70.0: cxxstd=14 +program_options') + depends_on('boost@1.70.0: cxxstd=17 +program_options') depends_on('mpi') depends_on('hdf5+hl@1.8:') - depends_on('flecsi@1 +cinch backend=mpi') + depends_on('flecsi@1.4.2 +external_cinch backend=mpi') depends_on('gsl') depends_on('googletest', when='+test') depends_on("pkgconfig", type='build') diff --git a/var/spack/repos/builtin/packages/flux-core/package.py b/var/spack/repos/builtin/packages/flux-core/package.py index 2593b184acb..71357bdabd4 100644 --- a/var/spack/repos/builtin/packages/flux-core/package.py +++ b/var/spack/repos/builtin/packages/flux-core/package.py @@ -17,6 +17,7 @@ class FluxCore(AutotoolsPackage): maintainers = ['SteVwonder'] version('master', branch='master') + version('0.28.0', sha256='9a784def7186b0036091bd8d6d8fe5bc3425ab2927e1465e1c9ad266631c285d') version('0.27.0', sha256='abd46d38081ba6b501adb1c111374b39d6ae72ac1aec9fbbf31943a856541d3a') version('0.26.0', sha256='58bfd4742c59364b13cd83214e8f70735952d01793800b149cae056fddfeeff1') version('0.25.0', sha256='3c97e21eaec51e8aa0eaee6aa8eb23246650d102a6b6a5c9943cd69e3c8e1008') @@ -56,6 +57,7 @@ class FluxCore(AutotoolsPackage): depends_on("py-pyyaml") depends_on("py-jsonschema") depends_on("jansson") + depends_on("jansson@2.10:", when="@0.21.0:") depends_on("pkgconfig") depends_on("yaml-cpp") depends_on("lz4") diff --git a/var/spack/repos/builtin/packages/flux-sched/package.py b/var/spack/repos/builtin/packages/flux-sched/package.py index 9fa525cf6e0..6378cb044f2 100644 --- a/var/spack/repos/builtin/packages/flux-sched/package.py +++ b/var/spack/repos/builtin/packages/flux-sched/package.py @@ -17,6 +17,7 @@ class FluxSched(AutotoolsPackage): maintainers = ['SteVwonder'] version('master', branch='master') + version('0.17.0', sha256='5acfcb757e2294a92eaa91be58ba9b42736b88b42d2937de4a78f4642b1c4933') version('0.16.0', sha256='08313976161c141b9b34e2d44d5a08d1b11302e22d60aeaf878eef84d4bd2884') version('0.15.0', sha256='ff24d26997f91af415f98734b8117291f5a5001e86dac865b56b3d72980c80c8') version('0.14.0', sha256='2808f42032b917823d69cd26103c9238694416e2f30c6d39c11c670927ed232a') @@ -46,6 +47,7 @@ class FluxSched(AutotoolsPackage): depends_on("flux-core@0.22.0", when='@0.14.0', type=('build', 'run', 'link')) depends_on("flux-core@0.23.0:0.25.99", when='@0.15.0', type=('build', 'run', 'link')) depends_on("flux-core@0.26.0:", when='@0.16.0', type=('build', 'run', 'link')) + depends_on("flux-core@0.28.0:", when='@0.17.0', type=('build', 'run', 'link')) depends_on("flux-core@master", when='@master', type=('build', 'run', 'link')) # Need autotools when building on master: diff --git a/var/spack/repos/builtin/packages/folly/package.py b/var/spack/repos/builtin/packages/folly/package.py index 86e8d54332b..c76a5f3901a 100644 --- a/var/spack/repos/builtin/packages/folly/package.py +++ b/var/spack/repos/builtin/packages/folly/package.py @@ -7,7 +7,7 @@ from spack import * -class Folly(AutotoolsPackage): +class Folly(CMakePackage): """Folly (acronymed loosely after Facebook Open Source Library) is a library of C++11 components designed with practicality and efficiency in mind. @@ -18,29 +18,31 @@ class Folly(AutotoolsPackage): """ homepage = "https://github.com/facebook/folly" - url = "https://github.com/facebook/folly/archive/v2017.06.05.00.tar.gz" + url = "https://github.com/facebook/folly/releases/download/v2021.05.24.00/folly-v2021.05.24.00.tar.gz" + version('2021.05.24.00', sha256='9d308adefe4670637f5c7d96309b3b394ac3fa129bc954f5dfbdd8b741c02aad') - version('2017.06.05.00', sha256='d22ceda4dfe33583828be1193fa3929d70c51998f0797236e293c44ef828c6d0') - version('2016.11.14.00', sha256='cde5b3e1a38d181f7c4e52d590de1c1aca58da7b27b3020d08e9aa45b4c3ed74') - version('2016.11.07.00', sha256='4400d7f0fead90d88ce4caee9f0e9aeb8008c9954ea9034e19ae7226175206ba') - version('2016.10.31.00', sha256='7bef9ee956248f68f1c4e96be67561842ee6cc030a58e132b93b9be57b6b29ea') - version('2016.10.24.00', sha256='d54b609d3750a6a1cfbda7c62e1457af60cf5efc48d7a8e6552d67909e064757') - version('2016.10.17.00', sha256='0f83685016d020111ba54ddc48c0cf33e1e0b9b35cee5ae82d5f2cbc5f6b0e82') - - depends_on('m4', type='build') - depends_on('autoconf', type='build') - depends_on('automake', type='build') - depends_on('libtool', type='build') + # CMakePackage Dependency depends_on('pkgconfig', type='build') - # TODO: folly requires gcc 4.9+ and a version of boost compiled with - # TODO: C++14 support (but there's no neat way to check that these - # TODO: constraints are met right now) - depends_on('boost') + # folly requires gcc 4.9+ and a version of boost compiled with >= C++14 + # TODO: Specify the boost components + variant('cxxstd', default='14', values=('14', '17'), multi=False, description='Use the specified C++ standard when building.') + depends_on('boost+context+container cxxstd=14', when='cxxstd=14') + depends_on('boost+context+container cxxstd=17', when='cxxstd=17') + # required dependencies depends_on('gflags') depends_on('glog') depends_on('double-conversion') depends_on('libevent') + depends_on('fmt') + + # optional dependencies + variant('libdwarf', default=False, description="Optional Dependency") + variant('elfutils', default=False, description="Optional Dependency") + variant('libunwind', default=False, description="Optional Dependency") + depends_on('libdwarf', when='+libdwarf') + depends_on('elfutils', when='+elfutils') + depends_on('libunwind', when='+libunwind') configure_directory = 'folly' diff --git a/var/spack/repos/builtin/packages/fortrilinos/package.py b/var/spack/repos/builtin/packages/fortrilinos/package.py index bd0da8b8e21..3e13fe156e2 100644 --- a/var/spack/repos/builtin/packages/fortrilinos/package.py +++ b/var/spack/repos/builtin/packages/fortrilinos/package.py @@ -55,7 +55,7 @@ class Fortrilinos(CMakePackage): depends_on('trilinos@12.17.1', when='@2.0.dev1') # Baseline trilinos dependencies - depends_on('trilinos+teuchos gotype=long_long') + depends_on('trilinos gotype=long_long') # Full trilinos dependencies depends_on('trilinos+amesos2+anasazi+belos+kokkos+ifpack2+muelu+nox+tpetra' '+stratimikos', when='+hl') diff --git a/var/spack/repos/builtin/packages/freetype/package.py b/var/spack/repos/builtin/packages/freetype/package.py index d65bb4afdc5..6eaf50ae2c8 100644 --- a/var/spack/repos/builtin/packages/freetype/package.py +++ b/var/spack/repos/builtin/packages/freetype/package.py @@ -15,6 +15,9 @@ class Freetype(AutotoolsPackage): homepage = "https://www.freetype.org/index.html" url = "https://download.savannah.gnu.org/releases/freetype/freetype-2.10.1.tar.gz" + maintainers = ['michaelkuhn'] + + version('2.11.0', sha256='a45c6b403413abd5706f3582f04c8339d26397c4304b78fa552f2215df64101f') version('2.10.4', sha256='5eab795ebb23ac77001cfb68b7d4d50b5d6c7469247b0b01b2c953269f658dac') version('2.10.2', sha256='e09aa914e4f7a5d723ac381420949c55c0b90b15744adce5d1406046022186ab') version('2.10.1', sha256='3a60d391fd579440561bf0e7f31af2222bc610ad6ce4d9d7bd2165bca8669110') diff --git a/var/spack/repos/builtin/packages/gaudi/package.py b/var/spack/repos/builtin/packages/gaudi/package.py index cecd49277d9..d2d5937bb70 100644 --- a/var/spack/repos/builtin/packages/gaudi/package.py +++ b/var/spack/repos/builtin/packages/gaudi/package.py @@ -16,6 +16,7 @@ class Gaudi(CMakePackage): tags = ['hep'] version('master', branch='master') + version('36.0', sha256='8a0458cef5b616532f9db7cca9fa0e892e602b64c9e93dc0cc6d972e03034830') version('35.0', sha256='c01b822f9592a7bf875b9997cbeb3c94dea97cb13d523c12649dbbf5d69b5fa6') version('34.0', sha256='28fc4abb5a6b08da5a6b1300451c7e8487f918b055939877219d454abf7668ae') version('33.2', sha256='26aaf9c4ff237a60ec79af9bd18ad249fc91c16e297ba77e28e4a256123db6e5') diff --git a/var/spack/repos/builtin/packages/gcc/package.py b/var/spack/repos/builtin/packages/gcc/package.py index 68073d58d6b..03fc883abde 100644 --- a/var/spack/repos/builtin/packages/gcc/package.py +++ b/var/spack/repos/builtin/packages/gcc/package.py @@ -29,6 +29,7 @@ class Gcc(AutotoolsPackage, GNUMirrorPackage): version('master', branch='master') + version('11.2.0', sha256='d08edc536b54c372a1010ff6619dd274c0f1603aa49212ba20f7aa2cda36fa8b') version('11.1.0', sha256='4c4a6fb8a8396059241c2e674b85b351c26a5d678274007f076957afa1cc9ddf') version('10.3.0', sha256='64f404c1a650f27fc33da242e1f2df54952e3963a49e06e73f6940f3223ac344') diff --git a/var/spack/repos/builtin/packages/gchp/package.py b/var/spack/repos/builtin/packages/gchp/package.py index 89e39591d16..6b5e7235365 100644 --- a/var/spack/repos/builtin/packages/gchp/package.py +++ b/var/spack/repos/builtin/packages/gchp/package.py @@ -12,10 +12,13 @@ class Gchp(CMakePackage): """GEOS-Chem High Performance model of atmospheric chemistry""" homepage = "https://gchp.readthedocs.io/" - url = "https://github.com/geoschem/GCHP/archive/13.0.1.tar.gz" + url = "https://github.com/geoschem/GCHP/archive/13.1.2.tar.gz" git = "https://github.com/geoschem/GCHP.git" - maintainers = ['williamdowns'] + maintainers = ['lizziel'] + version('13.1.2', commit='106b8f783cafabd699e53beec3a4dd8aee45234b', submodules=True) + version('13.1.1', commit='a17361a78aceab947ca51aa1ecd3391beaa3fcb2', submodules=True) + version('13.1.0', commit='4aca45370738e48623e61e38b26d981d3e20be76', submodules=True) version('13.0.2', commit='017ad7276a801ab7b3d6945ad24602eb9927cf01', submodules=True) version('13.0.1', commit='f40a2476fda901eacf78c0972fdb6c20e5a06700', submodules=True) version('13.0.0', commit='1f5a5c5630c5d066ff8306cbb8b83e267ca7c265', submodules=True) diff --git a/var/spack/repos/builtin/packages/genesis/package.py b/var/spack/repos/builtin/packages/genesis/package.py index 3711fa4e9f8..942c334a3bc 100644 --- a/var/spack/repos/builtin/packages/genesis/package.py +++ b/var/spack/repos/builtin/packages/genesis/package.py @@ -18,12 +18,25 @@ class Genesis(AutotoolsPackage, CudaPackage): git = "https://github.com/genesis-release-r-ccs/genesis-2.0.git" version("master", branch="master") + version( + "1.6.0", + sha256="d0185a5464ed4231f6ee81f6dcaa15935a99fa30b96658d2b7c25d7fbc5b38e9", + url="https://www.r-ccs.riken.jp/labs/cbrt/wp-content/uploads/2020/12/genesis-1.6.0.tar.bz2", + ) version( "1.5.1", sha256="62a453a573c36779484b4ffed2dfa56ea03dfe1308d631b33ef03f733259b3ac", url="https://www.r-ccs.riken.jp/labs/cbrt/wp-content/uploads/2020/09/genesis-1.5.1.tar.bz2", ) + resource( + when="@1.6.0", + name="user_guide", + url="https://www.r-ccs.riken.jp/labs/cbrt/wp-content/uploads/2020/12/GENESIS-1.6.0.pdf", + sha256="4a6d54eb8f66edde57a4099cdac40cc8e0e2fd6bdb84946da6bf2b3ed84a4ba1", + expand=False, + placement="doc", + ) resource( when="@1.5.1", name="user_guide", @@ -92,21 +105,37 @@ def install(self, spec, prefix): make("install") install_tree("doc", prefix.share.doc) + @property + def cached_tests_work_dir(self): + """The working directory for cached test sources.""" + return join_path(self.test_suite.current_test_cache_dir, + "tests") + @run_after("install") def cache_test_sources(self): + """Copy test files after the package is installed for test().""" if self.spec.satisfies("@master"): self.cache_extra_test_sources(["tests"]) def test(self): - if self.spec.satisfies("@master"): - exe_name = self.spec["python"].command.path - test_name = join_path( - self.install_test_root, "tests", "regression_test", "test.py" - ) - bin_name = join_path(self.prefix.bin, "spdyn") - opts = [ - test_name, - self.spec["mpi"].prefix.bin.mpirun + " -np 8 " + bin_name, - ] - env["OMP_NUM_THREADS"] = "1" - self.run_test(exe_name, options=opts, expected="Passed 53 / 53") + """Perform stand-alone/smoke tests using installed package.""" + if not self.spec.satisfies("@master"): + print('Skipping: Tests are only available for the master branch') + return + + test_name = join_path( + self.cached_tests_work_dir, "regression_test", "test.py" + ) + bin_name = join_path(self.prefix.bin, "spdyn") + opts = [ + test_name, + self.spec["mpi"].prefix.bin.mpirun + " -np 8 " + bin_name, + ] + env["OMP_NUM_THREADS"] = "1" + self.run_test( + self.spec["python"].command.path, + options=opts, + expected="Passed 53 / 53", + purpose="test: running regression test", + work_dir=self.cached_tests_work_dir + ) diff --git a/var/spack/repos/builtin/packages/global/package.py b/var/spack/repos/builtin/packages/global/package.py index 6f8ed605127..1d078b21fab 100644 --- a/var/spack/repos/builtin/packages/global/package.py +++ b/var/spack/repos/builtin/packages/global/package.py @@ -14,6 +14,10 @@ class Global(Package): homepage = "http://www.gnu.org/software/global" url = "http://tamacom.com/global/global-6.5.tar.gz" + maintainers = ['gaber'] + + version('6.6.7', sha256='69a0f77f53827c5568176c1d382166df361e74263a047f0b3058aa2f2ad58a3c') + version('6.6.6', sha256='758078afff98d4c051c58785c7ada3ed1977fabb77f8897ff657b71cc62d4d5d') version('6.6.4', sha256='987e8cb956c53f8ebe4453b778a8fde2037b982613aba7f3e8e74bcd05312594') version('6.5', sha256='4afd12db1aa600277b39113cc2d61dc59bd6c6b4ee8033da8bb6dd0c39a4c6a9') diff --git a/var/spack/repos/builtin/packages/glvis/package.py b/var/spack/repos/builtin/packages/glvis/package.py index 16e25b847ea..3a912c24086 100644 --- a/var/spack/repos/builtin/packages/glvis/package.py +++ b/var/spack/repos/builtin/packages/glvis/package.py @@ -12,7 +12,7 @@ class Glvis(MakefilePackage): homepage = "http://glvis.org" git = "https://github.com/glvis/glvis.git" - maintainers = ['goxberry', 'v-dobrev', 'tzanio'] + maintainers = ['goxberry', 'v-dobrev', 'tzanio', 'tomstitt'] # glvis (like mfem) is downloaded from a URL shortener at request # of upstream author Tzanio Kolev . See here: @@ -32,9 +32,17 @@ class Glvis(MakefilePackage): # # If this quick verification procedure fails, additional discussion # will be required to verify the new version. + # + # glvis does not need mfem+mpi but will build that by default, to just build + # a serial mfem: `spack install glvis ^mfem~mpi~metis' version('develop', branch='master') + version('4.0', + sha256='68331eaea8b93968ed6bf395388c2730b27bbcb4b7809ce44277726edccd9f08', + url='https://bit.ly/glvis-4-0', + extension='.tar.gz') + version('3.4', sha256='289fbd2e09d4456e5fee6162bdc3e0b4c8c8d54625f3547ad2a69fef319279e7', url='https://bit.ly/glvis-3-4', @@ -63,6 +71,7 @@ class Glvis(MakefilePackage): description='Use antialiased fonts via freetype & fontconfig') depends_on('mfem@develop', when='@develop') + depends_on('mfem@4.0.0:', when='@4.0') depends_on('mfem@3.4.0', when='@3.4') depends_on('mfem@3.3', when='@3.3') depends_on('mfem@3.2', when='@3.2') @@ -70,12 +79,20 @@ class Glvis(MakefilePackage): depends_on('gl') depends_on('glu') - depends_on('libx11') + depends_on('libx11', when='@:3.5') + + depends_on('sdl2', when='@4.0:,develop') + depends_on('glm', when='@4.0:,develop') + depends_on('glew', when='@4.0:,develop') depends_on('libpng', when='screenshots=png') depends_on('libtiff', when='screenshots=tiff') depends_on('freetype', when='+fonts') + depends_on('freetype', when='@4.0:,develop') depends_on('fontconfig', when='+fonts') + depends_on('fontconfig', when='@4.0:,develop') + + depends_on('uuid', when='platform=linux') def edit(self, spec, prefix): @@ -85,41 +102,65 @@ def yes_no(s): mfem = spec['mfem'] config_mk = mfem.package.config_mk - gl_libs = spec['glu'].libs + spec['gl'].libs + spec['libx11'].libs args = ['CC={0}'.format(env['CC']), 'PREFIX={0}'.format(prefix.bin), 'MFEM_DIR={0}'.format(mfem.prefix), - 'CONFIG_MK={0}'.format(config_mk), - 'GL_OPTS=-I{0} -I{1} -I{2}'.format( - spec['libx11'].prefix.include, - spec['gl'].prefix.include, - spec['glu'].prefix.include), + 'CONFIG_MK={0}'.format(config_mk)] + + png_args = ['PNG_OPTS=-DGLVIS_USE_LIBPNG -I{0}'.format( + spec['libpng'].prefix.include), + 'PNG_LIBS={0}'.format( + spec['libpng'].libs.ld_flags)] if 'screenshots=png' in spec else [] + + tiff_args = ['TIFF_OPTS=-DGLVIS_USE_LIBTIFF -I{0}'.format( + spec['libtiff'].prefix.include), + 'TIFF_LIBS={0}'.format( + spec['libtiff'].libs.ld_flags)] if 'screenshots=tiff' in spec else [] + + if "@4.0:" in spec or "@develop" in spec: + # TODO: glu and fontconfig dirs + args += ['GLM_DIR={0}'.format(spec['glm'].prefix), + 'SDL_DIR={0}'.format(spec['sdl2'].prefix), + 'GLEW_DIR={0}'.format(spec['glew'].prefix), + 'FREETYPE_DIR={0}'.format(spec['freetype'].prefix), + 'OPENGL_DIR={0}'.format(spec['gl'].prefix)] + + if 'screenshots=png' in spec: + args += ['GLVIS_USE_LIBPNG=YES', 'GLVIS_USE_LIBTIFF=NO'] + args.extend(png_args) + elif 'screenshots=tiff' in spec: + args += ['GLVIS_USE_LIBPNG=NO', 'GLVIS_USE_LIBTIFF=YES'] + args.extend(tiff_args) + else: + args += ['GLVIS_USE_LIBPNG=NO', 'GLVIS_USE_LIBTIFF=NO'] + + else: + gl_libs = spec['glu'].libs + spec['gl'].libs + spec['libx11'].libs + + args += ['GL_OPTS=-I{0} -I{1} -I{2}'.format( + spec['libx11'].prefix.include, + spec['gl'].prefix.include, + spec['glu'].prefix.include), 'GL_LIBS={0}'.format(gl_libs.ld_flags)] - if 'screenshots=png' in spec: - args += [ - 'USE_LIBPNG=YES', 'USE_LIBTIFF=NO', - 'PNG_OPTS=-DGLVIS_USE_LIBPNG -I{0}'.format( - spec['libpng'].prefix.include), - 'PNG_LIBS={0}'.format(spec['libpng'].libs.ld_flags)] - elif 'screenshots=tiff' in spec: - args += [ - 'USE_LIBPNG=NO', 'USE_LIBTIFF=YES', - 'TIFF_OPTS=-DGLVIS_USE_LIBTIFF -I{0}'.format( - spec['libtiff'].prefix.include), - 'TIFF_LIBS={0}'.format(spec['libtiff'].libs.ld_flags)] - else: - args += ['USE_LIBPNG=NO', 'USE_LIBTIFF=NO'] + if 'screenshots=png' in spec: + args += ['USE_LIBPNG=YES', 'USE_LIBTIFF=NO'] + args.extend(png_args) + elif 'screenshots=tiff' in spec: + args += ['USE_LIBPNG=NO', 'USE_LIBTIFF=YES'] + args.extend(tiff_args) + else: + args += ['USE_LIBPNG=NO', 'USE_LIBTIFF=NO'] - args.append('USE_FREETYPE={0}'.format(yes_no('+fonts'))) - if '+fonts' in spec: - args += [ - 'FT_OPTS=-DGLVIS_USE_FREETYPE {0} -I{1}'.format( - spec['freetype'].headers.include_flags, - spec['fontconfig'].prefix.include), - 'FT_LIBS={0} {1}'.format( - spec['freetype'].libs.ld_flags, - spec['fontconfig'].libs.ld_flags)] + args.append('USE_FREETYPE={0}'.format(yes_no('+fonts'))) + if '+fonts' in spec: + args += [ + 'FT_OPTS=-DGLVIS_USE_FREETYPE {0} -I{1}'.format( + spec['freetype'].headers.include_flags, + spec['fontconfig'].prefix.include), + 'FT_LIBS={0} {1}'.format( + spec['freetype'].libs.ld_flags, + spec['fontconfig'].libs.ld_flags)] self.build_targets = args self.install_targets += args diff --git a/var/spack/repos/builtin/packages/go/package.py b/var/spack/repos/builtin/packages/go/package.py index 9466dfe32f4..a8c4e15a531 100644 --- a/var/spack/repos/builtin/packages/go/package.py +++ b/var/spack/repos/builtin/packages/go/package.py @@ -35,52 +35,56 @@ class Go(Package): """The golang compiler and build environment""" homepage = "https://golang.org" - url = 'https://dl.google.com/go/go1.12.6.src.tar.gz' + url = "https://dl.google.com/go/go1.16.6.src.tar.gz" + git = "https://go.googlesource.com/go.git" extendable = True executables = ['^go$'] - version('1.16.5', sha256='7bfa7e5908c7cc9e75da5ddf3066d7cbcf3fd9fa51945851325eebc17f50ba80') - version('1.16.4', sha256='ae4f6b6e2a1677d31817984655a762074b5356da50fb58722b99104870d43503') - version('1.16.3', sha256='b298d29de9236ca47a023e382313bcc2d2eed31dfa706b60a04103ce83a71a25') - version('1.16.2', sha256='37ca14287a23cb8ba2ac3f5c3dd8adbc1f7a54b9701a57824bf19a0b271f83ea') - version('1.16', sha256='7688063d55656105898f323d90a79a39c378d86fe89ae192eb3b7fc46347c95a') + maintainers = ['alecbcs'] + + version('1.16.6', sha256='a3a5d4bc401b51db065e4f93b523347a4d343ae0c0b08a65c3423b05a138037d') + version('1.16.5', sha256='7bfa7e5908c7cc9e75da5ddf3066d7cbcf3fd9fa51945851325eebc17f50ba80') + version('1.16.4', sha256='ae4f6b6e2a1677d31817984655a762074b5356da50fb58722b99104870d43503') + version('1.16.3', sha256='b298d29de9236ca47a023e382313bcc2d2eed31dfa706b60a04103ce83a71a25') + version('1.16.2', sha256='37ca14287a23cb8ba2ac3f5c3dd8adbc1f7a54b9701a57824bf19a0b271f83ea') + version('1.16', sha256='7688063d55656105898f323d90a79a39c378d86fe89ae192eb3b7fc46347c95a') version('1.15.13', sha256='99069e7223479cce4553f84f874b9345f6f4045f27cf5089489b546da619a244') version('1.15.12', sha256='1c6911937df4a277fa74e7b7efc3d08594498c4c4adc0b6c4ae3566137528091') version('1.15.11', sha256='f25b2441d4c76cf63cde94d59bab237cc33e8a2a139040d904c8630f46d061e5') - version('1.15.8', sha256='540c0ab7781084d124991321ed1458e479982de94454a98afab6acadf38497c2') - version('1.15.7', sha256='8631b3aafd8ecb9244ec2ffb8a2a8b4983cf4ad15572b9801f7c5b167c1a2abc') - version('1.15.6', sha256='890bba73c5e2b19ffb1180e385ea225059eb008eb91b694875dd86ea48675817') - version('1.15.5', sha256='c1076b90cf94b73ebed62a81d802cd84d43d02dea8c07abdc922c57a071c84f1') - version('1.15.2', sha256='28bf9d0bcde251011caae230a4a05d917b172ea203f2a62f2c2f9533589d4b4d') - version('1.15.1', sha256='d3743752a421881b5cc007c76b4b68becc3ad053e61275567edab1c99e154d30') - version('1.15', sha256='69438f7ed4f532154ffaf878f3dfd83747e7a00b70b3556eddabf7aaee28ac3a') + version('1.15.8', sha256='540c0ab7781084d124991321ed1458e479982de94454a98afab6acadf38497c2') + version('1.15.7', sha256='8631b3aafd8ecb9244ec2ffb8a2a8b4983cf4ad15572b9801f7c5b167c1a2abc') + version('1.15.6', sha256='890bba73c5e2b19ffb1180e385ea225059eb008eb91b694875dd86ea48675817') + version('1.15.5', sha256='c1076b90cf94b73ebed62a81d802cd84d43d02dea8c07abdc922c57a071c84f1') + version('1.15.2', sha256='28bf9d0bcde251011caae230a4a05d917b172ea203f2a62f2c2f9533589d4b4d') + version('1.15.1', sha256='d3743752a421881b5cc007c76b4b68becc3ad053e61275567edab1c99e154d30') + version('1.15', sha256='69438f7ed4f532154ffaf878f3dfd83747e7a00b70b3556eddabf7aaee28ac3a') version('1.14.14', sha256='6204bf32f58fae0853f47f1bd0c51d9e0ac11f1ffb406bed07a0a8b016c8a76f') version('1.14.13', sha256='ba1d244c6b5c0ed04aa0d7856d06aceb89ed31b895de6ff783efb1cc8ab6b177') version('1.14.12', sha256='b34f4b7ad799eab4c1a52bdef253602ce957125a512f5a1b28dce43c6841b971') - version('1.14.9', sha256='c687c848cc09bcabf2b5e534c3fc4259abebbfc9014dd05a1a2dc6106f404554') - version('1.14.8', sha256='d9a613fb55f508cf84e753456a7c6a113c8265839d5b7fe060da335c93d6e36a') - version('1.14.6', sha256='73fc9d781815d411928eccb92bf20d5b4264797be69410eac854babe44c94c09') - version('1.14.5', sha256='ca4c080c90735e56152ac52cd77ae57fe573d1debb1a58e03da9cc362440315c') - version('1.14.4', sha256='7011af3bbc2ac108d1b82ea8abb87b2e63f78844f0259be20cde4d42c5c40584') - version('1.14.3', sha256='93023778d4d1797b7bc6a53e86c3a9b150c923953225f8a48a2d5fabc971af56') - version('1.14.2', sha256='98de84e69726a66da7b4e58eac41b99cbe274d7e8906eeb8a5b7eb0aadee7f7c') - version('1.14.1', sha256='2ad2572115b0d1b4cb4c138e6b3a31cee6294cb48af75ee86bec3dca04507676') - version('1.14', sha256='6d643e46ad565058c7a39dac01144172ef9bd476521f42148be59249e4b74389') + version('1.14.9', sha256='c687c848cc09bcabf2b5e534c3fc4259abebbfc9014dd05a1a2dc6106f404554') + version('1.14.8', sha256='d9a613fb55f508cf84e753456a7c6a113c8265839d5b7fe060da335c93d6e36a') + version('1.14.6', sha256='73fc9d781815d411928eccb92bf20d5b4264797be69410eac854babe44c94c09') + version('1.14.5', sha256='ca4c080c90735e56152ac52cd77ae57fe573d1debb1a58e03da9cc362440315c') + version('1.14.4', sha256='7011af3bbc2ac108d1b82ea8abb87b2e63f78844f0259be20cde4d42c5c40584') + version('1.14.3', sha256='93023778d4d1797b7bc6a53e86c3a9b150c923953225f8a48a2d5fabc971af56') + version('1.14.2', sha256='98de84e69726a66da7b4e58eac41b99cbe274d7e8906eeb8a5b7eb0aadee7f7c') + version('1.14.1', sha256='2ad2572115b0d1b4cb4c138e6b3a31cee6294cb48af75ee86bec3dca04507676') + version('1.14', sha256='6d643e46ad565058c7a39dac01144172ef9bd476521f42148be59249e4b74389') version('1.13.14', sha256='197333e97290e9ea8796f738d61019dcba1c377c2f3961fd6a114918ecc7ab06') version('1.13.13', sha256='ab7e44461e734ce1fd5f4f82c74c6d236e947194d868514d48a2b1ea73d25137') version('1.13.12', sha256='17ba2c4de4d78793a21cc659d9907f4356cd9c8de8b7d0899cdedcef712eba34') version('1.13.11', sha256='89ed1abce25ad003521c125d6583c93c1280de200ad221f961085200a6c00679') version('1.13.10', sha256='eb9ccc8bf59ed068e7eff73e154e4f5ee7eec0a47a610fb864e3332a2fdc8b8c') - version('1.13.9', sha256='34bb19d806e0bc4ad8f508ae24bade5e9fedfa53d09be63b488a9314d2d4f31d') - version('1.13.8', sha256='b13bf04633d4d8cf53226ebeaace8d4d2fd07ae6fa676d0844a688339debec34') - version('1.13.7', sha256='e4ad42cc5f5c19521fbbbde3680995f2546110b5c6aa2b48c3754ff7af9b41f4') - version('1.13.6', sha256='aae5be954bdc40bcf8006eb77e8d8a5dde412722bc8effcdaf9772620d06420c') - version('1.13.5', sha256='27d356e2a0b30d9983b60a788cf225da5f914066b37a6b4f69d457ba55a626ff') - version('1.13.4', sha256='95dbeab442ee2746b9acf0934c8e2fc26414a0565c008631b04addb8c02e7624') - version('1.13.3', sha256='4f7123044375d5c404280737fbd2d0b17064b66182a65919ffe20ffe8620e3df') - version('1.13.2', sha256='1ea68e01472e4276526902b8817abd65cf84ed921977266f0c11968d5e915f44') - version('1.13.1', sha256='81f154e69544b9fa92b1475ff5f11e64270260d46e7e36c34aafc8bc96209358') + version('1.13.9', sha256='34bb19d806e0bc4ad8f508ae24bade5e9fedfa53d09be63b488a9314d2d4f31d') + version('1.13.8', sha256='b13bf04633d4d8cf53226ebeaace8d4d2fd07ae6fa676d0844a688339debec34') + version('1.13.7', sha256='e4ad42cc5f5c19521fbbbde3680995f2546110b5c6aa2b48c3754ff7af9b41f4') + version('1.13.6', sha256='aae5be954bdc40bcf8006eb77e8d8a5dde412722bc8effcdaf9772620d06420c') + version('1.13.5', sha256='27d356e2a0b30d9983b60a788cf225da5f914066b37a6b4f69d457ba55a626ff') + version('1.13.4', sha256='95dbeab442ee2746b9acf0934c8e2fc26414a0565c008631b04addb8c02e7624') + version('1.13.3', sha256='4f7123044375d5c404280737fbd2d0b17064b66182a65919ffe20ffe8620e3df') + version('1.13.2', sha256='1ea68e01472e4276526902b8817abd65cf84ed921977266f0c11968d5e915f44') + version('1.13.1', sha256='81f154e69544b9fa92b1475ff5f11e64270260d46e7e36c34aafc8bc96209358') version('1.13', sha256='3fc0b8b6101d42efd7da1da3029c0a13f22079c0c37ef9730209d8ec665bf122') version('1.12.17', sha256='de878218c43aa3c3bad54c1c52d95e3b0e5d336e1285c647383e775541a28b25') version('1.12.15', sha256='8aba74417e527524ad5724e6e6c21016795d1017692db76d1b0851c6bdec84c3') @@ -89,31 +93,31 @@ class Go(Package): version('1.12.12', sha256='fcb33b5290fa9bcc52be3211501540df7483d7276b031fc77528672a3c705b99') version('1.12.11', sha256='fcf58935236802929f5726e96cd1d900853b377bec2c51b2e37219c658a4950f') version('1.12.10', sha256='f56e48fce80646d3c94dcf36d3e3f490f6d541a92070ad409b87b6bbb9da3954') - version('1.12.9', sha256='ab0e56ed9c4732a653ed22e232652709afbf573e710f56a07f7fdeca578d62fc') - version('1.12.8', sha256='11ad2e2e31ff63fcf8a2bdffbe9bfa2e1845653358daed593c8c2d03453c9898') - version('1.12.6', sha256='c96c5ccc7455638ae1a8b7498a030fe653731c8391c5f8e79590bce72f92b4ca') - version('1.12.5', sha256='2aa5f088cbb332e73fc3def546800616b38d3bfe6b8713b8a6404060f22503e8') + version('1.12.9', sha256='ab0e56ed9c4732a653ed22e232652709afbf573e710f56a07f7fdeca578d62fc') + version('1.12.8', sha256='11ad2e2e31ff63fcf8a2bdffbe9bfa2e1845653358daed593c8c2d03453c9898') + version('1.12.6', sha256='c96c5ccc7455638ae1a8b7498a030fe653731c8391c5f8e79590bce72f92b4ca') + version('1.12.5', sha256='2aa5f088cbb332e73fc3def546800616b38d3bfe6b8713b8a6404060f22503e8') version('1.11.13', sha256='5032095fd3f641cafcce164f551e5ae873785ce7b07ca7c143aecd18f7ba4076') version('1.11.11', sha256='1fff7c33ef2522e6dfaf6ab96ec4c2a8b76d018aae6fc88ce2bd40f2202d0f8c') version('1.11.10', sha256='df27e96a9d1d362c46ecd975f1faa56b8c300f5c529074e9ea79bdd885493c1b') - version('1.11.5', sha256='bc1ef02bb1668835db1390a2e478dcbccb5dd16911691af9d75184bbe5aa943e') - version('1.11.4', sha256='4cfd42720a6b1e79a8024895fa6607b69972e8e32446df76d6ce79801bbadb15') - version('1.11.2', sha256='042fba357210816160341f1002440550e952eb12678f7c9e7e9d389437942550') - version('1.11.1', sha256='558f8c169ae215e25b81421596e8de7572bd3ba824b79add22fba6e284db1117') - version('1.11', sha256='afc1e12f5fe49a471e3aae7d906c73e9d5b1fdd36d52d72652dde8f6250152fb') - version('1.10.3', sha256='567b1cc66c9704d1c019c50bef946272e911ec6baf244310f87f4e678be155f2') - version('1.10.2', sha256='6264609c6b9cd8ed8e02ca84605d727ce1898d74efa79841660b2e3e985a98bd') - version('1.10.1', sha256='589449ff6c3ccbff1d391d4e7ab5bb5d5643a5a41a04c99315e55c16bbf73ddc') - version('1.9.5', sha256='f1c2bb7f32bbd8fa7a19cc1608e0d06582df32ff5f0340967d83fb0017c49fbc') - version('1.9.2', sha256='665f184bf8ac89986cfd5a4460736976f60b57df6b320ad71ad4cef53bb143dc') - version('1.9.1', sha256='a84afc9dc7d64fe0fa84d4d735e2ece23831a22117b50dafc75c1484f1cb550e') - version('1.9', sha256='a4ab229028ed167ba1986825751463605264e44868362ca8e7accc8be057e993') - version('1.8.3', sha256='5f5dea2447e7dcfdc50fa6b94c512e58bfba5673c039259fd843f68829d99fa6') - version('1.8.1', sha256='33daf4c03f86120fdfdc66bddf6bfff4661c7ca11c5da473e537f4d69b470e57') - version('1.8', sha256='406865f587b44be7092f206d73fc1de252600b79b3cacc587b74b5ef5c623596') - version('1.7.5', sha256='4e834513a2079f8cbbd357502cccaac9507fd00a1efe672375798858ff291815') - version('1.7.4', sha256='4c189111e9ba651a2bb3ee868aa881fab36b2f2da3409e80885ca758a6b614cc') - version('1.6.4', sha256='8796cc48217b59595832aa9de6db45f58706dae68c9c7fbbd78c9fdbe3cd9032') + version('1.11.5', sha256='bc1ef02bb1668835db1390a2e478dcbccb5dd16911691af9d75184bbe5aa943e') + version('1.11.4', sha256='4cfd42720a6b1e79a8024895fa6607b69972e8e32446df76d6ce79801bbadb15') + version('1.11.2', sha256='042fba357210816160341f1002440550e952eb12678f7c9e7e9d389437942550') + version('1.11.1', sha256='558f8c169ae215e25b81421596e8de7572bd3ba824b79add22fba6e284db1117') + version('1.11', sha256='afc1e12f5fe49a471e3aae7d906c73e9d5b1fdd36d52d72652dde8f6250152fb') + version('1.10.3', sha256='567b1cc66c9704d1c019c50bef946272e911ec6baf244310f87f4e678be155f2') + version('1.10.2', sha256='6264609c6b9cd8ed8e02ca84605d727ce1898d74efa79841660b2e3e985a98bd') + version('1.10.1', sha256='589449ff6c3ccbff1d391d4e7ab5bb5d5643a5a41a04c99315e55c16bbf73ddc') + version('1.9.5', sha256='f1c2bb7f32bbd8fa7a19cc1608e0d06582df32ff5f0340967d83fb0017c49fbc') + version('1.9.2', sha256='665f184bf8ac89986cfd5a4460736976f60b57df6b320ad71ad4cef53bb143dc') + version('1.9.1', sha256='a84afc9dc7d64fe0fa84d4d735e2ece23831a22117b50dafc75c1484f1cb550e') + version('1.9', sha256='a4ab229028ed167ba1986825751463605264e44868362ca8e7accc8be057e993') + version('1.8.3', sha256='5f5dea2447e7dcfdc50fa6b94c512e58bfba5673c039259fd843f68829d99fa6') + version('1.8.1', sha256='33daf4c03f86120fdfdc66bddf6bfff4661c7ca11c5da473e537f4d69b470e57') + version('1.8', sha256='406865f587b44be7092f206d73fc1de252600b79b3cacc587b74b5ef5c623596') + version('1.7.5', sha256='4e834513a2079f8cbbd357502cccaac9507fd00a1efe672375798858ff291815') + version('1.7.4', sha256='4c189111e9ba651a2bb3ee868aa881fab36b2f2da3409e80885ca758a6b614cc') + version('1.6.4', sha256='8796cc48217b59595832aa9de6db45f58706dae68c9c7fbbd78c9fdbe3cd9032') provides('golang') diff --git a/var/spack/repos/builtin/packages/googletest/package.py b/var/spack/repos/builtin/packages/googletest/package.py index 7690ec0170c..f6fa0d28945 100644 --- a/var/spack/repos/builtin/packages/googletest/package.py +++ b/var/spack/repos/builtin/packages/googletest/package.py @@ -10,8 +10,11 @@ class Googletest(CMakePackage): """Google test framework for C++. Also called gtest.""" homepage = "https://github.com/google/googletest" url = "https://github.com/google/googletest/tarball/release-1.10.0" + git = "https://github.com/google/googletest" - version('1.10.0', sha256='e4a7cd97c903818abe7ddb129db9c41cc9fd9e2ded654be57ced26d45c72e4c9') + version('master', branch='master') + version('1.11.0', sha256='07b0896360f8e14414a8419e35515da0be085c5b4547c914ab8f4684ef0a3a8e') + version('1.10.0', sha256='e4a7cd97c903818abe7ddb129db9c41cc9fd9e2ded654be57ced26d45c72e4c9', preferred=True) version('1.8.1', sha256='8e40a005e098b1ba917d64104549e3da274e31261dedc57d6250fe91391b2e84') version('1.8.0', sha256='d8c33605d23d303b08a912eaee7f84c4e091d6e3d90e9a8ec8aaf7450dfe2568') version('1.7.0', sha256='9639cf8b7f37a4d0c6575f52c01ef167c5f11faee65252296b3ffc2d9acd421b') diff --git a/var/spack/repos/builtin/packages/gperftools/package.py b/var/spack/repos/builtin/packages/gperftools/package.py index 908ef57fe3d..cfe07715f3f 100644 --- a/var/spack/repos/builtin/packages/gperftools/package.py +++ b/var/spack/repos/builtin/packages/gperftools/package.py @@ -15,6 +15,7 @@ class Gperftools(AutotoolsPackage): homepage = "https://github.com/gperftools/gperftools" url = "https://github.com/gperftools/gperftools/releases/download/gperftools-2.7/gperftools-2.7.tar.gz" + version('2.9.1', sha256='ea566e528605befb830671e359118c2da718f721c27225cbbc93858c7520fee3') version('2.8.1', sha256='12f07a8ba447f12a3ae15e6e3a6ad74de35163b787c0c7b76288d7395f2f74e0') version('2.7', sha256='1ee8c8699a0eff6b6a203e59b43330536b22bbcbe6448f54c7091e5efb0763c9') version('2.4', sha256='982a37226eb42f40714e26b8076815d5ea677a422fb52ff8bfca3704d9c30a2d') diff --git a/var/spack/repos/builtin/packages/graphviz/package.py b/var/spack/repos/builtin/packages/graphviz/package.py index 7274f79ad1e..70d19853846 100644 --- a/var/spack/repos/builtin/packages/graphviz/package.py +++ b/var/spack/repos/builtin/packages/graphviz/package.py @@ -116,6 +116,8 @@ class Graphviz(AutotoolsPackage): depends_on('sed', type='build') depends_on('libtool', type='build') depends_on('pkgconfig', type='build') + # to process f-strings used in gen_version.py + depends_on('python@3.6:', when='@2.47:', type='build') conflicts('~doc', when='@:2.45', diff --git a/var/spack/repos/builtin/packages/grass/package.py b/var/spack/repos/builtin/packages/grass/package.py index 17325d2b5c7..588de1ad47e 100644 --- a/var/spack/repos/builtin/packages/grass/package.py +++ b/var/spack/repos/builtin/packages/grass/package.py @@ -13,13 +13,14 @@ class Grass(AutotoolsPackage): graphics and maps production, spatial modeling, and visualization.""" homepage = "https://grass.osgeo.org" - url = "https://grass.osgeo.org/grass78/source/grass-7.8.2.tar.gz" + url = "https://grass.osgeo.org/grass78/source/grass-7.8.5.tar.gz" list_url = "https://grass.osgeo.org/download/software/sources/" git = "https://github.com/OSGeo/grass.git" maintainers = ['adamjstewart'] version('master', branch='master') + version('7.8.5', sha256='a359bb665524ecccb643335d70f5436b1c84ffb6a0e428b78dffebacd983ff37') version('7.8.2', sha256='33576f7078f805b39ca20c2fa416ac79c64260c0581072a6dc7d813f53aa9abb') version('7.8.1', sha256='6ae578fd67afcce7abec4ba4505dcc55b3d2dfe0ca46b99d966cb148c654abb3') version('7.8.0', sha256='4b1192294e959ffd962282344e4ff325c4472f73abe605e246a1da3beda7ccfa') @@ -93,7 +94,7 @@ class Grass(AutotoolsPackage): depends_on('opencl', when='+opencl') depends_on('bzip2', when='+bzlib') depends_on('zstd', when='+zstd') - depends_on('gdal', when='+gdal') # required? + depends_on('gdal@:3.2.999', when='+gdal') depends_on('liblas', when='+liblas') depends_on('wxwidgets', when='+wxwidgets') depends_on('py-wxpython@2.8.10.1:', when='+wxwidgets', type=('build', 'run')) diff --git a/var/spack/repos/builtin/packages/gromacs/package.py b/var/spack/repos/builtin/packages/gromacs/package.py index 30c2acd61e5..5b0a87a66e5 100644 --- a/var/spack/repos/builtin/packages/gromacs/package.py +++ b/var/spack/repos/builtin/packages/gromacs/package.py @@ -94,17 +94,53 @@ class Gromacs(CMakePackage): description='Enables cycle subcounters') depends_on('mpi', when='+mpi') - # define matching plumed versions - depends_on('plumed@2.6.0:2.6.9+mpi', when='@2020.2+plumed+mpi') - depends_on('plumed@2.6.0:2.6.9~mpi', when='@2020.2+plumed~mpi') - depends_on('plumed@2.6.0:2.6.9+mpi', when='@2019.6+plumed+mpi') - depends_on('plumed@2.6.0:2.6.9~mpi', when='@2019.6+plumed~mpi') - depends_on('plumed@2.5.0:2.5.9+mpi', when='@2019.4+plumed+mpi') - depends_on('plumed@2.5.0:2.5.9~mpi', when='@2019.4+plumed~mpi') - depends_on('plumed@2.5.0:2.5.9+mpi', when='@2018.6+plumed+mpi') - depends_on('plumed@2.5.0:2.5.9~mpi', when='@2018.6+plumed~mpi') + + # Plumed 2.7.1 needs Gromacs 2021, 2020.5, 2019.6 + # Plumed 2.7.0 needs Gromacs 2020.4, 2019.6 + # Plumed 2.6.3 needs Gromacs 2020.4, 2019.6, 2018.8 + # Plumed 2.6.2 needs Gromacs 2020.4, 2019.6, 2018.8 + # Plumed 2.6.1 needs Gromacs 2020.2, 2019.6, 2018.8 + # Plumed 2.6.0 needs Gromacs 2019.4, 2018.8 + # Plumed 2.5.7 needs Gromacs 2019.4, 2018.8, 2016.6 + # Plumed 2.5.6 needs Gromacs 2019.4, 2018.8, 2016.6 + # Plumed 2.5.5 needs Gromacs 2019.4, 2018.8, 2016.6 + # Plumed 2.5.4 needs Gromacs 2019.4, 2018.8, 2016.6 + # Plumed 2.5.3 needs Gromacs 2019.4, 2018.8, 2016.6 + # Plumed 2.5.2 needs Gromacs 2019.2, 2018.6, 2016.6 + # Plumed 2.5.1 needs Gromacs 2018.6, 2016.6 + # Plumed 2.5.0 needs Gromacs 2018.4, 2016.5 + + # Above dependencies can be verified, and new versions added, by going to + # https://github.com/plumed/plumed2/tree/v2.7.1/patches + # and switching tags. + depends_on('plumed+mpi', when='+plumed+mpi') depends_on('plumed~mpi', when='+plumed~mpi') + depends_on('plumed@2.7.1+mpi', when='@2021+plumed+mpi') + depends_on('plumed@2.7.1~mpi', when='@2021+plumed~mpi') + depends_on('plumed@2.7.1+mpi', when='@2020.5+plumed+mpi') + depends_on('plumed@2.7.1~mpi', when='@2020.5+plumed~mpi') + depends_on('plumed@2.6.2:2.7.0+mpi', when='@2020.4+plumed+mpi') + depends_on('plumed@2.6.2:2.7.0~mpi', when='@2020.4+plumed~mpi') + depends_on('plumed@2.6.1+mpi', when='@2020.2+plumed+mpi') + depends_on('plumed@2.6.1~mpi', when='@2020.2+plumed~mpi') + depends_on('plumed@2.6.1:2.7.1+mpi', when='@2019.6+plumed+mpi') + depends_on('plumed@2.6.1:2.7.1~mpi', when='@2019.6+plumed~mpi') + depends_on('plumed@2.5.3:2.6.0+mpi', when='@2019.4+plumed+mpi') + depends_on('plumed@2.5.3:2.6.0~mpi', when='@2019.4+plumed~mpi') + depends_on('plumed@2.5.2+mpi', when='@2019.2+plumed+mpi') + depends_on('plumed@2.5.2~mpi', when='@2019.2+plumed~mpi') + depends_on('plumed@2.5.3:2.6.99+mpi', when='@2018.8+plumed+mpi') + depends_on('plumed@2.5.3:2.6.99~mpi', when='@2018.8+plumed~mpi') + depends_on('plumed@2.5.1:2.5.2+mpi', when='@2018.6+plumed+mpi') + depends_on('plumed@2.5.1:2.5.2~mpi', when='@2018.6+plumed~mpi') + depends_on('plumed@2.5.0+mpi', when='@2018.4+plumed+mpi') + depends_on('plumed@2.5.0~mpi', when='@2018.4+plumed~mpi') + depends_on('plumed@2.5.1:2.5.99+mpi', when='@2016.6+plumed+mpi') + depends_on('plumed@2.5.1:2.5.99~mpi', when='@2016.6+plumed~mpi') + depends_on('plumed@2.5.0+mpi', when='@2016.5+plumed+mpi') + depends_on('plumed@2.5.0~mpi', when='@2016.5+plumed~mpi') + depends_on('fftw-api@3') depends_on('cmake@2.8.8:3.99.99', type='build') depends_on('cmake@3.4.3:3.99.99', type='build', when='@2018:') diff --git a/var/spack/repos/builtin/packages/grpc/package.py b/var/spack/repos/builtin/packages/grpc/package.py index 1e57f061c2d..bdc62ac9308 100644 --- a/var/spack/repos/builtin/packages/grpc/package.py +++ b/var/spack/repos/builtin/packages/grpc/package.py @@ -11,8 +11,15 @@ class Grpc(CMakePackage): maintainers = ['nazavode'] homepage = "https://grpc.io" - url = "https://github.com/grpc/grpc/archive/v1.33.1.tar.gz" + url = "https://github.com/grpc/grpc/archive/v1.39.0.tar.gz" + version('1.39.0', sha256='b16992aa1c949c10d5d5ce2a62f9d99fa7de77da2943e643fb66dcaf075826d6') + version('1.38.1', sha256='f60e5b112913bf776a22c16a3053cc02cf55e60bf27a959fd54d7aaf8e2da6e8') + version('1.38.0', sha256='abd9e52c69000f2c051761cfa1f12d52d8b7647b6c66828a91d462e796f2aede') + version('1.37.1', sha256='acf247ec3a52edaee5dee28644a4e485c5e5badf46bdb24a80ca1d76cb8f1174') + version('1.37.0', sha256='c2dc8e876ea12052d6dd16704492fd8921df8c6d38c70c4708da332cf116df22') + version('1.36.4', sha256='8eb9d86649c4d4a7df790226df28f081b97a62bf12c5c5fe9b5d31a29cd6541a') + version('1.36.3', sha256='bb6de0544adddd54662ba1c314eff974e84c955c39204a4a2b733ccd990354b7') version('1.33.1', sha256='58eaee5c0f1bd0b92ebe1fa0606ec8f14798500620e7444726afcaf65041cb63') version('1.32.0', sha256='f880ebeb2ccf0e47721526c10dd97469200e40b5f101a0d9774eb69efa0bd07a') version('1.31.0', sha256='1236514199d3deb111a6dd7f6092f67617cd2b147f7eda7adbafccea95de7381') @@ -39,6 +46,7 @@ class Grpc(CMakePackage): depends_on('zlib') depends_on('c-ares') depends_on('abseil-cpp', when='@1.27:') + depends_on('re2', when='@1.33.1:') def cmake_args(self): args = [ @@ -62,4 +70,6 @@ def cmake_args(self): ] if self.spec.satisfies('@1.27.0:'): args.append('-DgRPC_ABSL_PROVIDER:String=package') + if self.spec.satisfies('@1.33.1:'): + args.append('-DgRPC_RE2_PROVIDER:String=package') return args diff --git a/var/spack/repos/builtin/packages/gurobi/package.py b/var/spack/repos/builtin/packages/gurobi/package.py index 287ff210dad..849096076d6 100644 --- a/var/spack/repos/builtin/packages/gurobi/package.py +++ b/var/spack/repos/builtin/packages/gurobi/package.py @@ -11,33 +11,50 @@ class Gurobi(Package): """The Gurobi Optimizer was designed from the ground up to be the fastest, most powerful solver available for your LP, QP, QCP, and MIP (MILP, MIQP, - and MIQCP) problems. + and MIQCP) problems.""" - Note: Gurobi is licensed software. You will need to create an account on - the Gurobi homepage and download Gurobi Optimizer yourself. Spack will - search your current directory for the download file. Alternatively, add - this file to a mirror so that Spack can find it. For instructions on how to - set up a mirror, see http://spack.readthedocs.io/en/latest/mirrors.html - - Please set the path to licence file with the following command (for bash) - export GRB_LICENSE_FILE=/path/to/gurobi/license/. See section 4 in - $GUROBI_HOME/docs/quickstart_linux.pdf for more details.""" + # Note: Gurobi is licensed software. You will need to create an account on + # the Gurobi homepage and download Gurobi Optimizer yourself. Spack will + # search your current directory for the download file. Alternatively, add + # this file to a mirror so that Spack can find it. For instructions on how + # to set up a mirror, see + # http://spack.readthedocs.io/en/latest/mirrors.html homepage = "http://www.gurobi.com/index" manual_download = True + maintainers = ['glennpj'] + + version('9.1.2', sha256='7f60bd675f79476bb2b32cd632aa1d470f8246f2b033b7652d8de86f6e7e429b') version('7.5.2', '01f6dbb8d165838cca1664a1a14e4a85') # Licensing license_required = True + license_files = ['gurobi.lic'] license_vars = ['GRB_LICENSE_FILE'] license_url = 'http://www.gurobi.com/downloads/download-center' + extends('python') + depends_on('python@2.7,3.6:') + def url_for_version(self, version): return "file://{0}/gurobi{1}_linux64.tar.gz".format(os.getcwd(), version) + def patch(self): + # Strip out existing PYTHONPATH as the presence of that will generally + # break given that Spack has likely set that for a different Python. + gurobi_shell = join_path('linux64', 'bin', 'gurobi.sh') + filter_file(r':\$PYTHONPATH', '', gurobi_shell) + def setup_run_environment(self, env): env.set('GUROBI_HOME', self.prefix) + env.set('GRB_LICENSE_FILE', join_path(self.prefix, 'gurobi.lic')) def install(self, spec, prefix): install_tree('linux64', prefix) + + @run_after('install') + def gurobipy(self): + with working_dir('linux64'): + python = which('python') + python('setup.py', 'install', '--prefix={0}'.format(self.prefix)) diff --git a/var/spack/repos/builtin/packages/hdf5/package.py b/var/spack/repos/builtin/packages/hdf5/package.py index e2910bfb5c6..f110700efbc 100644 --- a/var/spack/repos/builtin/packages/hdf5/package.py +++ b/var/spack/repos/builtin/packages/hdf5/package.py @@ -33,6 +33,7 @@ class Hdf5(CMakePackage): version('develop-1.10', branch='hdf5_1_10') version('develop-1.8', branch='hdf5_1_8') + version('1.12.1', sha256='79c66ff67e666665369396e9c90b32e238e501f345afd2234186bfb8331081ca') version('1.12.0', sha256='a62dcb276658cb78e6795dd29bf926ed7a9bc4edf6e77025cd2c689a8f97c17a') # HDF5 1.12 broke API compatibility, so we currently prefer the latest # 1.10 release. packages that want later versions of HDF5 should specify, diff --git a/var/spack/repos/builtin/packages/heffte/package.py b/var/spack/repos/builtin/packages/heffte/package.py index 881280847b7..a253a6cd238 100644 --- a/var/spack/repos/builtin/packages/heffte/package.py +++ b/var/spack/repos/builtin/packages/heffte/package.py @@ -6,7 +6,7 @@ from spack import * -class Heffte(CMakePackage): +class Heffte(CMakePackage, CudaPackage, ROCmPackage): """Highly Efficient FFT for Exascale""" homepage = "https://bitbucket.org/icl/heffte" @@ -18,6 +18,7 @@ class Heffte(CMakePackage): test_requires_compiler = True version('develop', branch='master') + version('2.1.0', sha256='527a3e21115231715a0342afdfaf6a8878d2dd0f02f03c92b53692340fd940b9') version('2.0.0', sha256='12f2b49a1a36c416eac174cf0cc50e729d56d68a9f68886d8c34bd45a0be26b6') version('1.0', sha256='0902479fb5b1bad01438ca0a72efd577a3529c3d8bad0028f3c18d3a4935ca74') version('0.2', sha256='4e76ae60982b316c2e873b2e5735669b22620fefa1fc82f325cdb6989bec78d1') @@ -29,7 +30,6 @@ class Heffte(CMakePackage): variant('shared', default=True, description='Builds with shared libraries') variant('fftw', default=False, description='Builds with support for FFTW backend') variant('mkl', default=False, description='Builds with support for MKL backend') - variant('cuda', default=False, description='Builds with support for GPUs via CUDA') variant('magma', default=False, description='Use helper methods from the UTK MAGMA library') variant('python', default=False, description='Install the Python bindings') variant('fortran', default=False, description='Install the Fortran modules') @@ -40,10 +40,11 @@ class Heffte(CMakePackage): depends_on('py-numba', when='+python+cuda', type=('build', 'run')) extends('python', when='+python', type=('build', 'run')) - conflicts('~fftw', when='~mkl~cuda') # requires at least one backend + conflicts('~fftw', when='@:2.1.0~mkl~cuda') # requires at least one backend conflicts('+fftw', when='+mkl@:1.0') # old API supports at most one CPU backend conflicts('^openmpi~cuda', when='+cuda') # +cuda requires CUDA enabled OpenMPI conflicts('~cuda', when='+magma') # magma requires CUDA or HIP + conflicts('+rocm', when='@:2.1.0') # heffte+rocm is in in development in spack conflicts('+python', when="@:1.0") # python support was added post v1.0 conflicts('+fortran', when="@:1.0") # fortran support was added post v1.0 conflicts('+magma', when="@:1.0") # magma support was added post v1.0 @@ -51,14 +52,19 @@ class Heffte(CMakePackage): depends_on('mpi', type=('build', 'run')) depends_on('fftw@3.3.8:', when="+fftw", type=('build', 'run')) - depends_on('intel@16.0:', when="+mkl", type=('build', 'run')) + depends_on('intel-mkl@2018.0.128:', when="+mkl", type=('build', 'run')) depends_on('cuda@8.0:', when="+cuda", type=('build', 'run')) + depends_on('hip@3.8.0:', when='+rocm') + depends_on('rocfft@3.8.0:', when='+rocm') depends_on('magma@2.5.3:', when="+cuda+magma", type=('build', 'run')) + examples_src_dir = 'examples' + def cmake_args(self): - return [ + args = [ self.define_from_variant('BUILD_SHARED_LIBS', 'shared'), self.define_from_variant('Heffte_ENABLE_CUDA', 'cuda'), + self.define_from_variant('Heffte_ENABLE_ROCM', 'rocm'), self.define_from_variant('Heffte_ENABLE_FFTW', 'fftw'), self.define_from_variant('Heffte_ENABLE_MKL', 'mkl'), self.define_from_variant('Heffte_ENABLE_MAGMA', 'magma'), @@ -68,7 +74,23 @@ def cmake_args(self): 'ON' if ('+cuda' in self.spec and '+fftw' in self.spec) else 'OFF'), ] - examples_src_dir = 'examples' + if '+cuda' in self.spec: + cuda_arch = self.spec.variants['cuda_arch'].value + if len(cuda_arch) > 0 or cuda_arch[0] != 'none': + nvcc_flags = "" + for nvflag in self.cuda_flags(cuda_arch): + nvcc_flags += "{0};".format(nvflag) + + args.append('-DCUDA_NVCC_FLAGS={0}'.format(nvcc_flags)) + + if '+rocm' in self.spec: + args.append('-DCMAKE_CXX_COMPILER={0}'.format(self.spec['hip'].hipcc)) + + rocm_arch = self.spec.variants['amdgpu_target'].value + if 'none' not in rocm_arch: + args.append('-DCMAKE_CXX_FLAGS={0}'.format(self.hip_flags(rocm_arch))) + + return args @run_after('install') def cache_test_sources(self): diff --git a/var/spack/repos/builtin/packages/helics/package.py b/var/spack/repos/builtin/packages/helics/package.py index 21872534a31..18dba96442a 100644 --- a/var/spack/repos/builtin/packages/helics/package.py +++ b/var/spack/repos/builtin/packages/helics/package.py @@ -18,7 +18,8 @@ class Helics(CMakePackage): maintainers = ['nightlark'] version('develop', branch='develop', submodules=True) - version('master', branch='master', submodules=True) + version('main', branch='main', submodules=True) + version('master', branch='main', submodules=True) version('2.7.1', sha256='872d415959e9d97069b06327410af00e7daae8dbeb9f050b26632eca924ea23c') version('2.7.0', sha256='ad005c0948ef4284417d429112772d0b63ebfbc62c9093c02ac10f4a333d70f4') version('2.6.1', sha256='4b9a733a568ae8e6492f93abcd43f1aa9c53b233edcbeb0ab188dcc0d73ac928') diff --git a/var/spack/repos/builtin/packages/hepmc3/package.py b/var/spack/repos/builtin/packages/hepmc3/package.py index 54996b5ca38..34cfc7be330 100644 --- a/var/spack/repos/builtin/packages/hepmc3/package.py +++ b/var/spack/repos/builtin/packages/hepmc3/package.py @@ -18,6 +18,7 @@ class Hepmc3(CMakePackage): maintainers = ['vvolkl'] + version('3.2.4', sha256='e088fccfd1a6c2f8e1089f457101bee1e5c7a9777e9d51c6419c8a288a49e1bb') version('3.2.3', sha256='8caadacc2c969883cd1f994b622795fc885fb4b15dad8c8ae64bcbdbf0cbd47d') version('3.2.2', sha256='0e8cb4f78f804e38f7d29875db66f65e4c77896749d723548cc70fb7965e2d41') version('3.2.1', sha256='6e4e4bb5708af105d4bf74efc2745e6efe704e942d46a8042f7dcae37a4739fe') @@ -42,8 +43,6 @@ class Hepmc3(CMakePackage): def cmake_args(self): spec = self.spec args = [ - '-Dmomentum:STRING=GEV', - '-Dlength:STRING=MM', '-DHEPMC3_ENABLE_PYTHON={0}'.format(spec.satisfies('+python')), '-DHEPMC3_ENABLE_ROOTIO={0}'.format(spec.satisfies('+rootio')), '-DHEPMC3_INSTALL_INTERFACES={0}'.format( @@ -61,4 +60,5 @@ def cmake_args(self): if self.spec.satisfies('+rootio'): args.append('-DROOT_DIR={0}'.format(self.spec['root'].prefix)) + args.append("-DHEPMC3_ENABLE_TEST={0}".format(self.run_tests)) return args diff --git a/var/spack/repos/builtin/packages/hip-rocclr/package.py b/var/spack/repos/builtin/packages/hip-rocclr/package.py index a82d19ee14b..a62d6657470 100644 --- a/var/spack/repos/builtin/packages/hip-rocclr/package.py +++ b/var/spack/repos/builtin/packages/hip-rocclr/package.py @@ -59,65 +59,34 @@ def url_for_version(self, version): placement='opencl-on-vdi', when='@3.5.0') - resource(name='opencl-on-vdi', - url='https://github.com/RadeonOpenCompute/ROCm-OpenCL-Runtime/archive/rocm-3.7.0.tar.gz', - sha256='283e1dfe4c3d2e8af4d677ed3c20e975393cdb0856e3ccd77b9c7ed2a151650b', - expand=True, - destination='', - placement='opencl-on-vdi', - when='@3.7.0') + # Add opencl sources thru the below + for d_version, d_shasum in [ + ('4.2.0', '18133451948a83055ca5ebfb5ba1bd536ed0bcb611df98829f1251a98a38f730'), + ('4.1.0', '0729e6c2adf1e3cf649dc6e679f9cb936f4f423f4954ad9852857c0a53ef799c'), + ('4.0.0', 'd43ea5898c6b9e730b5efabe8367cc136a9260afeac5d0fe85b481d625dd7df1'), + ('3.10.0', '3aa9dc5a5f570320b04b35ee129ce9ff21062d2770df934c6c307913f975e93d'), + ('3.9.0', '286ff64304905384ce524cd8794c28aee216befd6c9267d4187a12e5a21e2daf'), + ('3.8.0', '7f75dd1abf3d771d554b0e7b0a7d915ab5f11a74962c92b013ee044a23c1270a'), + ('3.7.0', '283e1dfe4c3d2e8af4d677ed3c20e975393cdb0856e3ccd77b9c7ed2a151650b') + ]: + resource( + name='opencl-on-vdi', + url='https://github.com/RadeonOpenCompute/ROCm-OpenCL-Runtime/archive/rocm-{0}.tar.gz'.format(d_version), + sha256=d_shasum, + expand=True, + destination='', + placement='opencl-on-vdi', + when='@{0}'.format(d_version) + ) - resource(name='opencl-on-vdi', - url='https://github.com/RadeonOpenCompute/ROCm-OpenCL-Runtime/archive/rocm-3.8.0.tar.gz', - sha256='7f75dd1abf3d771d554b0e7b0a7d915ab5f11a74962c92b013ee044a23c1270a', - expand=True, - destination='', - placement='opencl-on-vdi', - when='@3.8.0') - - resource(name='opencl-on-vdi', - url='https://github.com/RadeonOpenCompute/ROCm-OpenCL-Runtime/archive/rocm-3.9.0.tar.gz', - sha256='286ff64304905384ce524cd8794c28aee216befd6c9267d4187a12e5a21e2daf', - expand=True, - destination='', - placement='opencl-on-vdi', - when='@3.9.0') - - resource(name='opencl-on-vdi', - url='https://github.com/RadeonOpenCompute/ROCm-OpenCL-Runtime/archive/rocm-3.10.0.tar.gz', - sha256='3aa9dc5a5f570320b04b35ee129ce9ff21062d2770df934c6c307913f975e93d', - expand=True, - destination='', - placement='opencl-on-vdi', - when='@3.10.0') - - resource(name='opencl-on-vdi', - url='https://github.com/RadeonOpenCompute/ROCm-OpenCL-Runtime/archive/rocm-4.0.0.tar.gz', - sha256='d43ea5898c6b9e730b5efabe8367cc136a9260afeac5d0fe85b481d625dd7df1', - expand=True, - destination='', - placement='opencl-on-vdi', - when='@4.0.0') - - resource(name='opencl-on-vdi', - url='https://github.com/RadeonOpenCompute/ROCm-OpenCL-Runtime/archive/rocm-4.1.0.tar.gz', - sha256='0729e6c2adf1e3cf649dc6e679f9cb936f4f423f4954ad9852857c0a53ef799c', - expand=True, - destination='', - placement='opencl-on-vdi', - when='@4.1.0') - resource(name='opencl-on-vdi', - url='https://github.com/RadeonOpenCompute/ROCm-OpenCL-Runtime/archive/rocm-4.2.0.tar.gz', - sha256='18133451948a83055ca5ebfb5ba1bd536ed0bcb611df98829f1251a98a38f730', - expand=True, - destination='', - placement='opencl-on-vdi', - when='@4.2.0') - resource(name='opencl-on-vdi', - git='https://github.com/RadeonOpenCompute/ROCm-OpenCL-Runtime.git', - destination='', - placement='opencl-on-vdi', - when='@master') + resource( + name='opencl-on-vdi', + git='https://github.com/RadeonOpenCompute/ROCm-OpenCL-Runtime.git', + destination='', + placement='opencl-on-vdi', + branch='main', + when='@master' + ) @run_after('install') def deploy_missing_files(self): diff --git a/var/spack/repos/builtin/packages/hip/package.py b/var/spack/repos/builtin/packages/hip/package.py index 0f0568bdca7..2343c4d6028 100644 --- a/var/spack/repos/builtin/packages/hip/package.py +++ b/var/spack/repos/builtin/packages/hip/package.py @@ -41,6 +41,7 @@ class Hip(CMakePackage): depends_on('comgr@' + ver, when='@' + ver) depends_on('llvm-amdgpu@{0} +rocm-device-libs'.format(ver), when='@' + ver) depends_on('rocminfo@' + ver, when='@' + ver) + depends_on('roctracer-dev-api@' + ver, when='@' + ver) # hipcc likes to add `-lnuma` by default :( # ref https://github.com/ROCm-Developer-Tools/HIP/pull/2202 @@ -234,6 +235,8 @@ def flag_handler(self, name, flags): def cmake_args(self): args = [ + self.define('PROF_API_HEADER_PATH', join_path( + self.spec['roctracer-dev-api'].prefix, 'roctracer', 'inc', 'ext')), self.define('HIP_COMPILER', 'clang'), self.define('HSA_PATH', self.spec['hsa-rocr-dev'].prefix) ] diff --git a/var/spack/repos/builtin/packages/hohqmesh/package.py b/var/spack/repos/builtin/packages/hohqmesh/package.py index 2bf9d5dd3d1..0fb03d2cb11 100644 --- a/var/spack/repos/builtin/packages/hohqmesh/package.py +++ b/var/spack/repos/builtin/packages/hohqmesh/package.py @@ -16,6 +16,7 @@ class Hohqmesh(CMakePackage): maintainers = ['schoonovernumerics'] version('main', branch='main') + version('v1.0.1', tag='v1.0.1') depends_on('ftobjectlibrary') diff --git a/var/spack/repos/builtin/packages/hpx/package.py b/var/spack/repos/builtin/packages/hpx/package.py index a2230c605cf..0269a4b47b6 100644 --- a/var/spack/repos/builtin/packages/hpx/package.py +++ b/var/spack/repos/builtin/packages/hpx/package.py @@ -18,6 +18,7 @@ class Hpx(CMakePackage, CudaPackage): version('master', git='https://github.com/STEllAR-GROUP/hpx.git', branch='master') version('stable', git='https://github.com/STEllAR-GROUP/hpx.git', tag='stable') + version('1.7.0', sha256='05099b860410aa5d8a10d6915b1a8818733aa1aa2d5f2b9774730ca7e6de5fac') version('1.6.0', sha256='4ab715613c1e1808edc93451781cc9bc98feec4e422ccd4322858a680f6d9017') version('1.5.1', sha256='b2f9358ce2a9446b9d8fb1998c30913e7199b007aa82e46d0aa05c763331c635') version('1.5.0', sha256='de2901d8ae017592c513e0af9cf58de295abc9802e55ece00424cbd8a3801920') @@ -96,6 +97,11 @@ class Hpx(CMakePackage, CudaPackage): _msg_generic_coroutines = 'This platform requires +generic_coroutines' conflicts('~generic_coroutines', when='platform=darwin', msg=_msg_generic_coroutines) + # Asio + depends_on('asio cxxstd=11', when='@1.7: cxxstd=11') + depends_on('asio cxxstd=14', when='@1.7: cxxstd=14') + depends_on('asio cxxstd=17', when='@1.7: cxxstd=17') + # CXX Standard depends_on('boost cxxstd=11', when='cxxstd=11') depends_on('boost cxxstd=14', when='cxxstd=14') diff --git a/var/spack/repos/builtin/packages/hydrogen/package.py b/var/spack/repos/builtin/packages/hydrogen/package.py index 7fb8f1b5f4f..61394c48180 100644 --- a/var/spack/repos/builtin/packages/hydrogen/package.py +++ b/var/spack/repos/builtin/packages/hydrogen/package.py @@ -164,8 +164,8 @@ def cmake_args(self): args.append('-DCMAKE_CUDA_STANDARD=14') archs = spec.variants['cuda_arch'].value if archs != 'none': - arch_str = ",".join(archs) - args.append('-DCMAKE_CUDA_ARCHITECTURES=%s' % arch_str) + arch_str = ";".join(archs) + args.append('-DCMAKE_CUDA_ARCHITECTURES=%s' % arch_str) if '+rocm' in spec: args.extend([ diff --git a/var/spack/repos/builtin/packages/hypre/package.py b/var/spack/repos/builtin/packages/hypre/package.py index 3986bd194f0..674cf7f98c3 100644 --- a/var/spack/repos/builtin/packages/hypre/package.py +++ b/var/spack/repos/builtin/packages/hypre/package.py @@ -23,6 +23,8 @@ class Hypre(Package, CudaPackage): test_requires_compiler = True version('develop', branch='master') + version('2.22.0', sha256='2c786eb5d3e722d8d7b40254f138bef4565b2d4724041e56a8fa073bda5cfbb5') + version('2.21.0', sha256='e380f914fe7efe22afc44cdf553255410dc8a02a15b2e5ebd279ba88817feaf5') version('2.20.0', sha256='5be77b28ddf945c92cde4b52a272d16fb5e9a7dc05e714fc5765948cba802c01') version('2.19.0', sha256='466b19d8a86c69989a237f6f03f20d35c0c63a818776d2cd071b0a084cffeba5') version('2.18.2', sha256='28007b5b584eaf9397f933032d8367788707a2d356d78e47b99e551ab10cc76a') diff --git a/var/spack/repos/builtin/packages/intel-oneapi-dpl/package.py b/var/spack/repos/builtin/packages/intel-oneapi-dpl/package.py new file mode 100644 index 00000000000..fa027629890 --- /dev/null +++ b/var/spack/repos/builtin/packages/intel-oneapi-dpl/package.py @@ -0,0 +1,37 @@ +# Copyright 2013-2021 Lawrence Livermore National Security, LLC and other +# Spack Project Developers. See the top-level COPYRIGHT file for details. +# +# SPDX-License-Identifier: (Apache-2.0 OR MIT) + + +import platform + +from spack import * + + +class IntelOneapiDpl(IntelOneApiLibraryPackage): + """Intel oneAPI DPL.""" + + maintainers = ['rscohn2', 'danvev'] + + homepage = 'https://github.com/oneapi-src/oneDPL' + + if platform.system() == 'Linux': + version('2021.4.0', + url='https://registrationcenter-download.intel.com/akdlm/irc_nas/17889/l_oneDPL_p_2021.4.0.337_offline.sh', + sha256='540ef0d308c4b0f13ea10168a90edd42a56dc0883024f6f1a678b94c10b5c170', + expand=False) + + @property + def component_dir(self): + return 'dpl' + + @property + def headers(self): + include_path = join_path(self.component_path, 'linux', 'include') + headers = find_headers('*', include_path, recursive=True) + # Force this directory to be added to include path, even + # though no files are here because all includes are relative + # to this path + headers.directories = [include_path] + return headers diff --git a/var/spack/repos/builtin/packages/julia/package.py b/var/spack/repos/builtin/packages/julia/package.py index e02f1f9ecec..c2af83df20b 100644 --- a/var/spack/repos/builtin/packages/julia/package.py +++ b/var/spack/repos/builtin/packages/julia/package.py @@ -19,6 +19,7 @@ class Julia(Package): maintainers = ['glennpj'] version('master', branch='master') + version('1.6.2', sha256='01241120515cb9435b96179cf301fbd2c24d4405f252588108d13ceac0f41c0a') version('1.6.1', sha256='71d8e40611361370654e8934c407b2dec04944cf3917c5ecb6482d6b85ed767f') version('1.6.0', sha256='1b05f42c9368bc2349c47363b7ddc175a2da3cd162d52b6e24c4f5d4d6e1232c') version('1.5.4', sha256='dbfb8cd544b223eff70f538da7bb9d5b6f76fd0b00dd2385e6254e74ad4e892f') diff --git a/var/spack/repos/builtin/packages/kassiopeia/package.py b/var/spack/repos/builtin/packages/kassiopeia/package.py index 20656a951e9..8050a2092aa 100644 --- a/var/spack/repos/builtin/packages/kassiopeia/package.py +++ b/var/spack/repos/builtin/packages/kassiopeia/package.py @@ -17,6 +17,9 @@ class Kassiopeia(CMakePackage): maintainers = ['wdconinc'] + version("main", branch="main") + version('3.7.7', sha256='b5f62b2e796fac57698794b46b63acbc47ce02010bd1f716996918a550b22a21') + version('3.7.6', sha256='fa20cf0f29ee2312bf96b07661d7b5c9303782d907671acd01032cc1f13edd55') version('3.7.5', sha256='8f28d08c7ef51e64221e0a4705f3cee3a5d738b8cdde5ce9fa58a3a0dd14ae05') version('3.7.4', sha256='c1514163a084530930be10dbe487fb1950ccbc9662a4a190bdecffbd84a71fd4') version('3.7.3', sha256='a8753585b9fa0903e1f5f821c4ced3cddd72792ad7e6075a7e25318f81ad9eaa') @@ -47,21 +50,15 @@ class Kassiopeia(CMakePackage): depends_on('opencl', when='+opencl') def cmake_args(self): - args = [] - if self.spec.satisfies('+vtk'): - args.append('-DKASPER_USE_VTK=ON') + if '+root' in self.spec: + cxxstd = self.spec['root'].variants['cxxstd'].value else: - args.append('-DKASPER_USE_VTK=OFF') - if self.spec.satisfies('+tbb'): - args.append('-DKASPER_USE_TBB=ON') - else: - args.append('-DKASPER_USE_TBB=OFF') - if self.spec.satisfies('+mpi'): - args.append('-DKEMField_USE_MPI=ON') - else: - args.append('-DKEMField_USE_MPI=OFF') - if self.spec.satisfies('+opencl'): - args.append('-DKEMField_USE_OPENCL=ON') - else: - args.append('-DKEMField_USE_OPENCL=OFF') + cxxstd = '14' + args = [ + self.define_from_variant("KASPER_USE_VTK", "vtk"), + self.define_from_variant("KASPER_USE_TBB", "tbb"), + self.define_from_variant("KEMField_USE_MPI", "mpi"), + self.define_from_variant("KEMField_USE_OPENCL", "opencl"), + self.define("CMAKE_CXX_STANDARD", cxxstd) + ] return args diff --git a/var/spack/repos/builtin/packages/kokkos/package.py b/var/spack/repos/builtin/packages/kokkos/package.py index 36abe73ffd4..27ce2ad5d8d 100644 --- a/var/spack/repos/builtin/packages/kokkos/package.py +++ b/var/spack/repos/builtin/packages/kokkos/package.py @@ -197,7 +197,7 @@ class Kokkos(CMakePackage, CudaPackage, ROCmPackage): variant("pic", default=False, description="Build position independent code") # nvcc does not currently work with C++17 or C++20 - conflicts("+cuda", when="std=17") + conflicts("+cuda", when="std=17 ^cuda@:10.99.99") conflicts("+cuda", when="std=20") variant('shared', default=True, description='Build shared libraries') diff --git a/var/spack/repos/builtin/packages/latex2html/package.py b/var/spack/repos/builtin/packages/latex2html/package.py new file mode 100644 index 00000000000..ee43ba07a8d --- /dev/null +++ b/var/spack/repos/builtin/packages/latex2html/package.py @@ -0,0 +1,93 @@ +# Copyright 2013-2021 Lawrence Livermore National Security, LLC and other +# Spack Project Developers. See the top-level COPYRIGHT file for details. +# +# SPDX-License-Identifier: (Apache-2.0 OR MIT) + +import os +import platform + +from spack import * + + +class Latex2html(AutotoolsPackage): + """LaTeX2HTML is a utility that converts LaTeX documents to web pages in HTML.""" + + homepage = "https://www.latex2html.org/" + url = "https://github.com/latex2html/latex2html/archive/refs/tags/v2021.tar.gz" + git = "https://github.com/latex2html/latex2html.git" + + maintainers = ['cessenat'] + + version('master', branch='master') + version('2021', sha256='872fe7a53f91ababaafc964847639e3644f2b9fab3282ea059788e4e18cbba47') + version('2017', sha256='28a5d4b8f14b1f95928da281b6332559bcd83349ba439b2fa43655b2e21c83ab') + + variant('svg', default=True, description='Enable SVG images') + variant('png', default=True, description='Enable PNG images') + variant('gif', default=True, description='Enable GIF images') + + depends_on('ghostscript', type=('build', 'run')) + depends_on('perl', type=('build', 'run')) + # Provides pdfcrop scheme=full + depends_on('texlive', type=('build', 'run')) + + depends_on('netpbm', type=('build', 'run')) + # Provides pdftocairo + depends_on('poppler+glib', type=('build', 'run'), when='+svg') + + # A copy of texlive function as long as it does not provide the + # bin env to dependent package: + def tex_arch(self): + tex_arch = '{0}-{1}'.format(platform.machine(), + platform.system().lower()) + return tex_arch + + def configure_args(self): + spec = self.spec + args = ['--with-perl={0}'.format(spec['perl'].command.path)] + args.extend(self.enable_or_disable('png')) + args.extend(self.enable_or_disable('gif')) + args.extend(self.enable_or_disable('svg')) + + # Since packages do not always provide a proper dependent_build_environment, + # one needs to guess where the bins are since latex2html configure wants to + # hard set the bins location once for all: + for p in ['gs', 'ps2pdf']: + exe = join_path(spec['ghostscript'].prefix.bin, p) + if os.path.exists(exe): + args.append('--with-{0}={1}'.format(p, exe)) + pnms = ['pnmcrop', 'pnmflip', 'ppmquant', 'pnmfile', 'pnmcat', 'pbmmake', + 'ppmtogif', 'pnmtopng', 'ppmtojpeg', 'pnmcut', 'pnmpad', 'pnmrotate', + 'pnmscale', 'giftopnm', 'jpegtopnm', 'pngtopnm', 'tifftopnm', + 'anytopnm', 'bmptoppm', 'pcxtoppm', 'sgitopnm', 'xbmtopbm', 'xwdtopnm'] + for p in pnms: + exe = join_path(spec['netpbm'].prefix.bin, p) + if os.path.exists(exe): + args.append('--with-{0}={1}'.format(p, exe)) + + # PR #24102 at https://github.com/spack/spack/pull/24102 + # should make this useless ; but at least it lets us know which are the + # texlive bins that latex2html may use. + lats = ['pdfcrop', 'tex', 'initex', 'latex', 'dvips', 'dvipng', 'pdflatex', + 'lualatex', 'dvilualatex', 'kpsewhich', 'mktexlsr'] + for p in lats: + exe = join_path(spec['texlive'].prefix.bin, self.tex_arch(), p) + if os.path.exists(exe): + args.append('--with-{0}={1}'.format(p, exe)) + else: + # This should be the only needed code if texlive where + # to set its proper dependent_build_environment + exe = which(p) + if exe: + args.append('--with-{0}={1}'.format(p, str(exe))) + if '+svg' in spec: + p = 'pdftocairo' + exe = join_path(spec['poppler'].prefix.bin, p) + if os.path.exists(exe): + args.append('--with-{0}={1}'.format(p, exe)) + else: + exe = which(p) + if exe: + args.append('--with-{0}={1}'.format(p, str(exe))) + + return args diff --git a/var/spack/repos/builtin/packages/lbann/package.py b/var/spack/repos/builtin/packages/lbann/package.py index 772b117a1db..e1a965c6161 100644 --- a/var/spack/repos/builtin/packages/lbann/package.py +++ b/var/spack/repos/builtin/packages/lbann/package.py @@ -4,6 +4,7 @@ # SPDX-License-Identifier: (Apache-2.0 OR MIT) import os +import sys from spack import * @@ -111,7 +112,8 @@ class Lbann(CMakePackage, CudaPackage, ROCmPackage): depends_on('hydrogen@1.5.0:', when='@:0.90,0.102:') # Add Hydrogen variants - depends_on('hydrogen +openmp +openmp_blas +shared +int64') + depends_on('hydrogen +openmp +shared +int64') + depends_on('hydrogen +openmp_blas', when=sys.platform != 'darwin') depends_on('hydrogen ~al', when='~al') depends_on('hydrogen +al', when='+al') depends_on('hydrogen ~cuda', when='~cuda') @@ -138,6 +140,7 @@ class Lbann(CMakePackage, CudaPackage, ROCmPackage): depends_on('dihydrogen@0.2.0:', when='@:0.90,0.102:') depends_on('dihydrogen +openmp', when='+dihydrogen') + depends_on('dihydrogen +openmp_blas', when=sys.platform != 'darwin') depends_on('dihydrogen ~cuda', when='+dihydrogen ~cuda') depends_on('dihydrogen +cuda', when='+dihydrogen +cuda') depends_on('dihydrogen ~al', when='+dihydrogen ~al') @@ -222,6 +225,7 @@ class Lbann(CMakePackage, CudaPackage, ROCmPackage): depends_on('protobuf+shared@3.10.0', when='@:0.90,0.99:') depends_on('py-breathe', type='build', when='+docs') + depends_on('py-sphinx-rtd-theme', type='build', when='+docs') depends_on('doxygen', type='build', when='+docs') depends_on('py-m2r', type='build', when='+docs') @@ -319,8 +323,8 @@ def cmake_args(self): args.append('-DCMAKE_CUDA_STANDARD=14') archs = spec.variants['cuda_arch'].value if archs != 'none': - arch_str = ",".join(archs) - args.append('-DCMAKE_CUDA_ARCHITECTURES=%s' % arch_str) + arch_str = ";".join(archs) + args.append('-DCMAKE_CUDA_ARCHITECTURES=%s' % arch_str) if spec.satisfies('@:0.90') or spec.satisfies('@0.95:'): args.append( diff --git a/var/spack/repos/builtin/packages/libdc1394/package.py b/var/spack/repos/builtin/packages/libdc1394/package.py new file mode 100644 index 00000000000..59c24f47dd0 --- /dev/null +++ b/var/spack/repos/builtin/packages/libdc1394/package.py @@ -0,0 +1,26 @@ +# Copyright 2013-2021 Lawrence Livermore National Security, LLC and other +# Spack Project Developers. See the top-level COPYRIGHT file for details. +# +# SPDX-License-Identifier: (Apache-2.0 OR MIT) + +from spack import * + + +class Libdc1394(AutotoolsPackage): + """Library providing an API for IEEE 1394 cameras.""" + + homepage = "https://damien.douxchamps.net/ieee1394/libdc1394/" + url = "https://downloads.sourceforge.net/project/libdc1394/libdc1394-2/2.2.6/libdc1394-2.2.6.tar.gz" + + maintainers = ['traversaro'] + + version('2.2.6', sha256='2b905fc9aa4eec6bdcf6a2ae5f5ba021232739f5be047dec8fe8dd6049c10fed') + + depends_on('libusb') + + def configure_args(self): + args = [] + args.append('--disable-dependency-tracking') + args.append('--disable-examples') + args.append('--disable-sdltest') + return args diff --git a/var/spack/repos/builtin/packages/libfuse/package.py b/var/spack/repos/builtin/packages/libfuse/package.py index a24244274b8..4f69d2bdcdc 100644 --- a/var/spack/repos/builtin/packages/libfuse/package.py +++ b/var/spack/repos/builtin/packages/libfuse/package.py @@ -72,9 +72,9 @@ def meson(self, spec, prefix): "INIT_D_PATH={0}".format(self.prefix.etc), ] - args.append('--enable-static' if 'libs=static' in self.spec + args.append('--enable-static' if 'default_library=static' in self.spec else '--disable-static') - args.append('--enable-shared' if 'libs=shared' in self.spec + args.append('--enable-shared' if 'default_library=shared' in self.spec else '--disable-shared') configure(*args) diff --git a/var/spack/repos/builtin/packages/libint/package.py b/var/spack/repos/builtin/packages/libint/package.py index 854849ac339..5a24da60713 100644 --- a/var/spack/repos/builtin/packages/libint/package.py +++ b/var/spack/repos/builtin/packages/libint/package.py @@ -28,6 +28,8 @@ class Libint(AutotoolsPackage): homepage = "https://github.com/evaleev/libint" url = "https://github.com/evaleev/libint/archive/v2.1.0.tar.gz" + maintainers = ['dev-zero'] + version('2.6.0', sha256='4ae47e8f0b5632c3d2a956469a7920896708e9f0e396ec10071b8181e4c8d9fa') version('2.4.2', sha256='86dff38065e69a3a51d15cfdc638f766044cb87e5c6682d960c14f9847e2eac3') version('2.4.1', sha256='0513be124563fdbbc7cd3c7043e221df1bda236a037027ba9343429a27db8ce4') @@ -37,11 +39,16 @@ class Libint(AutotoolsPackage): version('1.1.6', sha256='f201b0c621df678cfe8bdf3990796b8976ff194aba357ae398f2f29b0e2985a6') version('1.1.5', sha256='ec8cd4a4ba1e1a98230165210c293632372f0e573acd878ed62e5ec6f8b6174b') + variant('debug', default=False, + description='Enable building with debug symbols') variant('fortran', default=False, description='Build & install Fortran bindings') variant('tune', default='none', multi=False, values=TUNE_VARIANTS, description='Tune libint for use with the given package') + variant('fma', default=False, + description=('Generate code utilizing FMA' + ' (requires capable CPU and recent enough compiler)')) # Build dependencies depends_on('autoconf@2.52:', type='build') @@ -120,6 +127,9 @@ def configure_args(self): if '@2.6.0:' in self.spec: config_args += ['--with-libint-exportdir=generated'] + config_args += self.enable_or_disable( + 'debug', activation_value=lambda x: 'opt') + config_args += self.enable_or_disable('fma') tune_value = self.spec.variants['tune'].value if tune_value.startswith('cp2k'): @@ -168,30 +178,41 @@ def build_targets(self): return [] @when('@2.6.0:') - def install(self, spec, prefix): + def build(self, spec, prefix): """ Starting from libint 2.6.0 we're using the 2-stage build to get support for the Fortran bindings, required by some packages (CP2K notably). """ + super(Libint, self).build(spec, prefix) + # upstream says that using configure/make for the generated code # is deprecated and one should use CMake, but with the currently # recent 2.7.0.b1 it still doesn't work with working_dir(os.path.join(self.build_directory, 'generated')): # straight from the AutotoolsPackage class: - options = [ + config_args = [ '--prefix={0}'.format(prefix), '--enable-shared', '--with-cxx-optflags={0}'.format(self.optflags), ] - - if '+fortran' in spec: - options += ['--enable-fortran'] + config_args += self.enable_or_disable( + 'debug', activation_value=lambda x: 'opt') + config_args += self.enable_or_disable('fortran') configure = Executable('./configure') - configure(*options) + configure(*config_args) make() + + @when('@2.6.0:') + def check(self): + with working_dir(os.path.join(self.build_directory, 'generated')): + make('check') + + @when('@2.6.0:') + def install(self, spec, prefix): + with working_dir(os.path.join(self.build_directory, 'generated')): make('install') def patch(self): diff --git a/var/spack/repos/builtin/packages/libnids/package.py b/var/spack/repos/builtin/packages/libnids/package.py new file mode 100644 index 00000000000..95fc287aef0 --- /dev/null +++ b/var/spack/repos/builtin/packages/libnids/package.py @@ -0,0 +1,23 @@ +# Copyright 2013-2021 Lawrence Livermore National Security, LLC and other +# Spack Project Developers. See the top-level COPYRIGHT file for details. +# +# SPDX-License-Identifier: (Apache-2.0 OR MIT) + +from spack import * + + +class Libnids(AutotoolsPackage): + """Libnids is a library that provides a functionality of one of + NIDS (Network Intrusion Detection System) components, namely + E-component.""" + + homepage = "http://libnids.sourceforge.net/" + url = "https://github.com/MITRECND/libnids/archive/1.25.tar.gz" + git = "https://github.com/MITRECND/libnids.git" + + version('master', branch='master') + version('1.25', sha256='47aa634bd0cdad81e092fac3aef6f12ee346c2f536a1eff4d3d5dacdb6dfcec1') + + depends_on('libpcap') + depends_on('libnet') + depends_on('glib@2.2.0:') diff --git a/var/spack/repos/builtin/packages/libpmemobj-cpp/package.py b/var/spack/repos/builtin/packages/libpmemobj-cpp/package.py index 53906cb2ce2..443a79e5305 100644 --- a/var/spack/repos/builtin/packages/libpmemobj-cpp/package.py +++ b/var/spack/repos/builtin/packages/libpmemobj-cpp/package.py @@ -34,3 +34,7 @@ class LibpmemobjCpp(CMakePackage): depends_on('pmdk@1.8:', when='@1.9:') depends_on('pmdk@1.7:', when='@1.8:') depends_on('pmdk@1.4:', when='@1.5:') + + def cmake_args(self): + args = ['-DTESTS_USE_VALGRIND=OFF'] + return args diff --git a/var/spack/repos/builtin/packages/libpng/package.py b/var/spack/repos/builtin/packages/libpng/package.py index c9b7c601688..584688a3a86 100644 --- a/var/spack/repos/builtin/packages/libpng/package.py +++ b/var/spack/repos/builtin/packages/libpng/package.py @@ -10,10 +10,10 @@ class Libpng(AutotoolsPackage): """libpng is the official PNG reference library.""" homepage = "http://www.libpng.org/pub/png/libpng.html" - url = "https://github.com/glennrp/libpng/archive/v1.6.37.tar.gz" + url = "https://prdownloads.sourceforge.net/libpng/libpng-1.6.37.tar.xz" git = "https://github.com/glennrp/libpng.git" - version('1.6.37', sha256='ca74a0dace179a8422187671aee97dd3892b53e168627145271cad5b5ac81307') + version('1.6.37', sha256='505e70834d35383537b6491e7ae8641f1a4bed1876dbfe361201fc80868d88ca') # From http://www.libpng.org/pub/png/libpng.html (2019-04-15) # libpng versions 1.6.36 and earlier have a use-after-free bug in the # simplified libpng API png_image_free(). It has been assigned ID @@ -21,7 +21,7 @@ class Libpng(AutotoolsPackage): # released on 15 April 2019. # Required for qt@3 - version('1.2.57', sha256='7f415186d38ca71c23058386d7cf5135c8beda821ee1beecdc2a7a26c0356615') + version('1.2.57', sha256='0f4620e11fa283fedafb474427c8e96bf149511a1804bdc47350963ae5cf54d8') depends_on('zlib@1.0.4:') # 1.2.5 or later recommended diff --git a/var/spack/repos/builtin/packages/libspatialindex/package.py b/var/spack/repos/builtin/packages/libspatialindex/package.py index cc2ff83297c..151576143c3 100644 --- a/var/spack/repos/builtin/packages/libspatialindex/package.py +++ b/var/spack/repos/builtin/packages/libspatialindex/package.py @@ -10,6 +10,15 @@ class Libspatialindex(CMakePackage): """C++ implementation of R*-tree, an MVR-tree and a TPR-tree with C API.""" homepage = "https://libspatialindex.org/" - url = "https://github.com/libspatialindex/libspatialindex/tarball/1.8.5" + url = "https://github.com/libspatialindex/libspatialindex/archive/refs/tags/1.8.5.tar.gz" - version('1.8.5', sha256='271f0d1425c527fd7d8b4be45b27e9383b244047b5918225877105616e7c0ad2') + version('1.9.3', sha256='7b44340a3edc55c11abfc453bb60f148b29f569cef9e1148583e76132e9c7379') + version('1.8.5', sha256='93cce77269612f45287b521d5afdfb245be2b93b8b6438d92f8b9e0bdb37059d') + + depends_on('cmake@3.5.0:', type='build') + + @property + def libs(self): + return find_libraries( + ['libspatialindex_c'], root=self.prefix, recursive=True, shared=True + ) diff --git a/var/spack/repos/builtin/packages/libtirpc/libtirpc-remove-pipe-flag-for-nvhpc.patch b/var/spack/repos/builtin/packages/libtirpc/libtirpc-remove-pipe-flag-for-nvhpc.patch new file mode 100644 index 00000000000..b7a8f00cebd --- /dev/null +++ b/var/spack/repos/builtin/packages/libtirpc/libtirpc-remove-pipe-flag-for-nvhpc.patch @@ -0,0 +1,24 @@ +diff -Naur spack-src/src/Makefile.am spack-src.patch/src/Makefile.am +--- spack-src/src/Makefile.am 2020-04-07 09:24:34.000000000 -0400 ++++ spack-src.patch/src/Makefile.am 2021-07-09 10:52:47.702886134 -0400 +@@ -8,7 +8,7 @@ + noinst_HEADERS = rpc_com.h debug.h + + AM_CPPFLAGS = -I$(top_srcdir)/tirpc -include config.h -DPORTMAP -DINET6 \ +- -D_GNU_SOURCE -Wall -pipe ++ -D_GNU_SOURCE -Wall + + lib_LTLIBRARIES = libtirpc.la + +diff -Naur spack-src/src/Makefile.in spack-src.patch/src/Makefile.in +--- spack-src/src/Makefile.in 2020-04-07 09:26:28.000000000 -0400 ++++ spack-src.patch/src/Makefile.in 2021-07-09 10:52:55.102361747 -0400 +@@ -455,7 +455,7 @@ + top_srcdir = @top_srcdir@ + noinst_HEADERS = rpc_com.h debug.h + AM_CPPFLAGS = -I$(top_srcdir)/tirpc -include config.h -DPORTMAP -DINET6 \ +- -D_GNU_SOURCE -Wall -pipe ++ -D_GNU_SOURCE -Wall + + lib_LTLIBRARIES = libtirpc.la + libtirpc_la_LDFLAGS = @LDFLAG_NOUNDEFINED@ -no-undefined -lpthread \ diff --git a/var/spack/repos/builtin/packages/libtirpc/package.py b/var/spack/repos/builtin/packages/libtirpc/package.py index 94b4667594a..dc7aba62552 100644 --- a/var/spack/repos/builtin/packages/libtirpc/package.py +++ b/var/spack/repos/builtin/packages/libtirpc/package.py @@ -20,6 +20,9 @@ class Libtirpc(AutotoolsPackage): provides('rpc') + # Remove -pipe flag to compiler in Makefiles when using nvhpc + patch('libtirpc-remove-pipe-flag-for-nvhpc.patch', when='%nvhpc') + # FIXME: build error on macOS # auth_none.c:81:9: error: unknown type name 'mutex_t' conflicts('platform=darwin', msg='Does not build on macOS') diff --git a/var/spack/repos/builtin/packages/libxc/package.py b/var/spack/repos/builtin/packages/libxc/package.py index 6340e6e1a5e..eeec410f9d5 100644 --- a/var/spack/repos/builtin/packages/libxc/package.py +++ b/var/spack/repos/builtin/packages/libxc/package.py @@ -13,6 +13,7 @@ class Libxc(AutotoolsPackage, CudaPackage): homepage = "https://tddft.org/programs/libxc/" url = "https://www.tddft.org/programs/libxc/down.php?file=2.2.2/libxc-2.2.2.tar.gz" + version('5.1.5', sha256='02e4615a22dc3ec87a23efbd3d9be5bfad2445337140bad1720699571c45c3f9') version('5.1.3', sha256='0350defdd6c1b165e4cf19995f590eee6e0b9db95a6b221d28cecec40f4e85cd') version('5.1.2', sha256='180d52b5552921d1fac8a10869dd30708c0fb41dc202a3bbee0e36f43872718a') version('5.1.0', sha256='f67b6e518372871d9eed6e5dba77c3ab5ea030c229ba7a7d44bcf51f3258373f') diff --git a/var/spack/repos/builtin/packages/libxslt/package.py b/var/spack/repos/builtin/packages/libxslt/package.py index c42240f303b..cecd64d4776 100644 --- a/var/spack/repos/builtin/packages/libxslt/package.py +++ b/var/spack/repos/builtin/packages/libxslt/package.py @@ -57,3 +57,8 @@ def import_module_test(self): if '+python' in self.spec: with working_dir('spack-test', create=True): python('-c', 'import libxslt') + + def patch(self): + # Remove flags not recognized by the NVIDIA compiler + if self.spec.satisfies('%nvhpc'): + filter_file('-Wmissing-format-attribute', '', 'configure') diff --git a/var/spack/repos/builtin/packages/llvm/package.py b/var/spack/repos/builtin/packages/llvm/package.py index 96245b2be7f..4c55482347c 100644 --- a/var/spack/repos/builtin/packages/llvm/package.py +++ b/var/spack/repos/builtin/packages/llvm/package.py @@ -29,6 +29,7 @@ class Llvm(CMakePackage, CudaPackage): # fmt: off version('main', branch='main') + version('12.0.1', sha256='66b64aa301244975a4aea489f402f205cde2f53dd722dad9e7b77a0459b4c8df') version('12.0.0', sha256='8e6c99e482bb16a450165176c2d881804976a2d770e0445af4375e78a1fbf19c') version('11.1.0', sha256='53a0719f3f4b0388013cfffd7b10c7d5682eece1929a9553c722348d1f866e79') version('11.0.1', sha256='9c7ad8e8ec77c5bde8eb4afa105a318fd1ded7dff3747d14f012758719d7171b') diff --git a/var/spack/repos/builtin/packages/lorene/local_settings.template b/var/spack/repos/builtin/packages/lorene/local_settings.template new file mode 100644 index 00000000000..03ede31fee8 --- /dev/null +++ b/var/spack/repos/builtin/packages/lorene/local_settings.template @@ -0,0 +1,20 @@ +CXX = @CXX@ +CXXFLAGS = @CXXFLAGS@ +CXXFLAGS_G = @CXXFLAGS_G@ + +F77 = @F77@ +F77FLAGS = @F77FLAGS@ +F77FLAGS_G = @F77FLAGS_G@ + +INC = @INC@ +RANLIB = @RANLIB@ + +MAKEDEPEND = @MAKEDEPEND@ +DEPDIR = .deps + +FFT_DIR = @FFT_DIR@ +LIB_CXX = @LIB_CXX@ + +LIB_GSL = @LIB_GSL@ +LIB_LAPACK = @LIB_LAPACK@ +LIB_PGPLOT = @LIB_PGPLOT@ diff --git a/var/spack/repos/builtin/packages/lorene/package.py b/var/spack/repos/builtin/packages/lorene/package.py new file mode 100644 index 00000000000..d8cef6630ee --- /dev/null +++ b/var/spack/repos/builtin/packages/lorene/package.py @@ -0,0 +1,109 @@ +# Copyright 2013-2021 Lawrence Livermore National Security, LLC and other +# Spack Project Developers. See the top-level COPYRIGHT file for details. +# +# SPDX-License-Identifier: (Apache-2.0 OR MIT) + +import inspect +import os + +from spack import * + + +class Lorene(MakefilePackage): + """LORENE: Langage Objet pour la RElativite NumeriquE + + LORENE is a set of C++ classes to solve various problems + arising in numerical relativity, and more generally in + computational astrophysics. It provides tools to solve + partial differential equations by means of multi-domain + spectral methods.""" + + homepage = "https://lorene.obspm.fr/index.html" + cvs = ":pserver:anonymous:anonymous@octane.obspm.fr:/cvsroot%module=Lorene" + + maintainers = ['eschnett'] + + version('2021.4.22', date='2021-04-22') + + variant('fftw', default=True, + description='Use external FFTW for spectral transformations') + variant('bin_star', default=True, + description='Build Bin_star solver for binary neutron star systems') + + depends_on('blas') + depends_on('fftw @3:', when='+fftw') + depends_on('gsl') + depends_on('lapack') + depends_on('pgplot') + + parallel = False + + def edit(self, spec, prefix): + blas_libs = spec['lapack'].libs.link_flags + fftw_incdirs = "-I" + spec['fftw'].prefix.include if '+fftw' in spec else "" + fftw_libdirs = "-L" + spec['fftw'].prefix.lib if '+fftw' in spec else "" + fftw_libs = spec['fftw'].libs.link_flags + gsl_incdirs = "-I" + spec['gsl'].prefix.include + gsl_libdirs = "-L" + spec['gsl'].prefix.lib + gsl_libs = spec['gsl'].libs.link_flags + lapack_libs = spec['lapack'].libs.link_flags + pgplot_incdirs = "-I" + spec['pgplot'].prefix.include + pgplot_libdirs = "-L" + spec['pgplot'].prefix.lib + pgplot_libs = spec['pgplot'].libs.link_flags + + substitutions = [ + ('@CXX@', self.compiler.cxx), + ('@CXXFLAGS@', "-g -I$(HOME_LORENE)/C++/Include -O3 -DNDEBUG"), + ('@CXXFLAGS_G@', "-g -I$(HOME_LORENE)/C++/Include"), + ('@F77@', self.compiler.f77), + ('@F77FLAGS@', "-ffixed-line-length-none -g -O3"), + ('@F77FLAGS_G@', "-ffixed-line-length-none -g"), + ('@INC@', + ("-I$(HOME_LORENE)/C++/Include " + + "-I$(HOME_LORENE)/C++/Include_extra " + + fftw_incdirs + " " + gsl_incdirs + " " + pgplot_incdirs)), + ('@RANLIB@', "ls"), + ('@MAKEDEPEND@', "cpp $(INC) -M >> $(df).d $<"), + ('@FFT_DIR@', "FFTW3"), + ('@LIB_CXX@', fftw_libdirs + " " + fftw_libs + " -lgfortran"), + ('@LIB_GSL@', gsl_libdirs + " " + gsl_libs), + ('@LIB_LAPACK@', lapack_libs + " " + blas_libs), + ('@LIB_PGPLOT@', pgplot_libdirs + " " + pgplot_libs), + ] + local_settings_template = join_path( + os.path.dirname(inspect.getmodule(self).__file__), + 'local_settings.template' + ) + local_settings = join_path( + self.stage.source_path, 'local_settings' + ) + copy(local_settings_template, local_settings) + for key, value in substitutions: + filter_file(key, value, local_settings) + + def build(self, spec, prefix): + args = ['HOME_LORENE=' + self.build_directory] + # (We could build the documentation as well.) + # (We could circumvent the build system and simply compile all + # source files, and do so in parallel.) + make('cpp', 'fortran', 'export', *args) + if '+bin_star' in spec: + with working_dir(join_path('Codes', 'Bin_star')): + make('-f', 'Makefile_O2', + 'coal', 'lit_bin', 'init_bin', 'coal_regu', 'init_bin_regu', + 'analyse', 'prepare_seq', + *args) + + def install(self, spec, prefix): + mkdirp(prefix.lib) + install_tree('Lib', prefix.lib) + mkdirp(prefix.bin) + if '+bin_star' in spec: + install_tree(join_path('Codes', 'Bin_star'), prefix.bin) + + @property + def libs(self): + shared = "+shared" in self.spec + return find_libraries( + "liblorene*", root=self.prefix, shared=shared, recursive=True + ) diff --git a/var/spack/repos/builtin/packages/lua-sol2/package.py b/var/spack/repos/builtin/packages/lua-sol2/package.py new file mode 100644 index 00000000000..96678debf25 --- /dev/null +++ b/var/spack/repos/builtin/packages/lua-sol2/package.py @@ -0,0 +1,29 @@ +# Copyright 2013-2021 Lawrence Livermore National Security, LLC and other +# Spack Project Developers. See the top-level COPYRIGHT file for details. +# +# SPDX-License-Identifier: (Apache-2.0 OR MIT) + +from spack import * + + +class LuaSol2(CMakePackage): + """sol2 is a C++ library binding to Lua.""" + + homepage = "https://github.com/ThePhD/sol2" + url = "https://github.com/ThePhD/sol2/archive/refs/tags/v3.2.2.tar.gz" + git = "https://github.com/ThePhD/sol2.git" + + version('develop', branch='develop') + version('3.2.3', sha256='f74158f92996f476786be9c9e83f8275129bb1da2a8d517d050421ac160a4b9e') + version('3.2.2', sha256='141790dae0c1821dd2dbac3595433de49ba72545845efc3ec7d88de8b0a3b2da') + version('3.2.1', sha256='b10f88dc1246f74a10348faef7d2c06e2784693307df74dcd87c4641cf6a6828') + version('3.2.0', sha256='733f03d82df6e0e8a15967831840d240dcb2c606982bec753bd173a9cc1b3435') + version('3.0.3', sha256='bf089e50387edfc70063e24fd7fbb693cceba4a50147d864fabedd1b33483582') + version('3.0.2', sha256='3f5f369eae6732ae9a315fe4370bbdc9900d2f2f4f291206aeb5b2d5533f0c99') + + # Lua is not needed when building, since sol2 is headers-only + depends_on('lua', type=('link', 'run')) + + def cmake_args(self): + args = ['-DSOL2_ENABLE_INSTALL=ON'] + return args diff --git a/var/spack/repos/builtin/packages/magma/package.py b/var/spack/repos/builtin/packages/magma/package.py index 787e42714ad..15aef600967 100644 --- a/var/spack/repos/builtin/packages/magma/package.py +++ b/var/spack/repos/builtin/packages/magma/package.py @@ -21,6 +21,7 @@ class Magma(CMakePackage, CudaPackage, ROCmPackage): test_requires_compiler = True version('master', branch='master') + version('2.6.1', sha256='6cd83808c6e8bc7a44028e05112b3ab4e579bcc73202ed14733f66661127e213') version('2.6.0', sha256='50cdd384f44f06a34469e7125f8b2ffae13c1975d373c3f1510d91be2b7638ec') version('2.5.4', sha256='7734fb417ae0c367b418dea15096aef2e278a423e527c615aab47f0683683b67') version('2.5.3', sha256='c602d269a9f9a3df28f6a4f593be819abb12ed3fa413bba1ff8183de721c5ef6') @@ -150,20 +151,19 @@ def cache_test_sources(self): def test(self): test_dir = join_path(self.install_test_root, self.test_src_dir) with working_dir(test_dir, create=False): - magma_dir = 'MAGMADIR={0}'.format(self.prefix) - cuda_dir = 'CUDADIR={0}'.format(self.spec['cuda'].prefix) - blas_dir = 'OPENBLASDIR={0}'.format(self.spec['blas'].prefix) - make(magma_dir, cuda_dir, blas_dir, 'c') - self.run_test('./example_sparse', - purpose='MAGMA smoke test - sparse solver') - self.run_test('./example_sparse_operator', - purpose='MAGMA smoke test - sparse operator') - self.run_test('./example_v1', - purpose='MAGMA smoke test - legacy v1 interface') - self.run_test('./example_v2', - purpose='MAGMA smoke test - v2 interface') - if '+fortran' in self.spec: - make(magma_dir, cuda_dir, blas_dir, 'fortran') - self.run_test('./example_f', - purpose='MAGMA smoke test - Fortran interface') - make('clean') + pkg_config_path = '{0}/lib/pkgconfig'.format(self.prefix) + with spack.util.environment.set_env(PKG_CONFIG_PATH=pkg_config_path): + make('c') + self.run_test('./example_sparse', + purpose='MAGMA smoke test - sparse solver') + self.run_test('./example_sparse_operator', + purpose='MAGMA smoke test - sparse operator') + self.run_test('./example_v1', + purpose='MAGMA smoke test - legacy v1 interface') + self.run_test('./example_v2', + purpose='MAGMA smoke test - v2 interface') + if '+fortran' in self.spec: + make('fortran') + self.run_test('./example_f', + purpose='MAGMA smoke test - Fortran interface') + make('clean') diff --git a/var/spack/repos/builtin/packages/mash/package.py b/var/spack/repos/builtin/packages/mash/package.py new file mode 100644 index 00000000000..bebcdd69af5 --- /dev/null +++ b/var/spack/repos/builtin/packages/mash/package.py @@ -0,0 +1,34 @@ +# Copyright 2013-2021 Lawrence Livermore National Security, LLC and other +# Spack Project Developers. See the top-level COPYRIGHT file for details. +# +# SPDX-License-Identifier: (Apache-2.0 OR MIT) + +from spack import * + + +class Mash(AutotoolsPackage): + """ + Fast genome and metagenome distance estimation using MinHash. + """ + + homepage = "http://mash.readthedocs.org/" + url = "https://github.com/marbl/Mash/archive/refs/tags/v2.3.tar.gz" + + maintainers = ['marcusboden'] + + version('2.3', sha256='f96cf7305e010012c3debed966ac83ceecac0351dbbfeaa6cd7ad7f068d87fe1') + + conflicts('%gcc@11:', msg='mash cannot be build with gcc >= 11') + + depends_on("autoconf", type='build') + depends_on("automake", type='build') + depends_on("libtool", type='build') + depends_on("m4", type='build') + depends_on("capnproto") + depends_on("gsl") + + def configure_args(self): + args = [] + args.append("--with-capnp=" + self.spec['capnproto'].prefix) + args.append("--with-gsl=" + self.spec['gsl'].prefix) + return args diff --git a/var/spack/repos/builtin/packages/meson/package.py b/var/spack/repos/builtin/packages/meson/package.py index ea6dcf19cb9..87cdf6e4528 100644 --- a/var/spack/repos/builtin/packages/meson/package.py +++ b/var/spack/repos/builtin/packages/meson/package.py @@ -16,6 +16,8 @@ class Meson(PythonPackage): maintainers = ['michaelkuhn'] + version('0.59.0', sha256='fdbbe8ea8a47f9e21cf4f578f85be8ec3d9c030df3d8cb17df1ae59d8683813a') + version('0.58.1', sha256='78e0f553dd3bc632d5f96ab943b1bbccb599c2c84ff27c5fb7f7fff9c8a3f6b4') version('0.58.0', sha256='991b882bfe4d37acc23c064a29ca209458764a580d52f044f3d50055a132bed4') version('0.57.2', sha256='cd3773625253df4fd1c380faf03ffae3d02198d6301e7c8bc7bba6c66af66096') version('0.57.1', sha256='0c043c9b5350e9087cd4f6becf6c0d10b1d618ca3f919e0dcca2cdf342360d5d') diff --git a/var/spack/repos/builtin/packages/metall/package.py b/var/spack/repos/builtin/packages/metall/package.py index d42b6fe13ce..ee9495733f1 100644 --- a/var/spack/repos/builtin/packages/metall/package.py +++ b/var/spack/repos/builtin/packages/metall/package.py @@ -9,13 +9,14 @@ class Metall(CMakePackage): homepage = "https://github.com/LLNL/metall" git = "https://github.com/LLNL/metall.git" - url = "https://github.com/LLNL/metall/archive/v0.2.tar.gz" + url = "https://github.com/LLNL/metall/archive/v0.15.tar.gz" maintainers = ['KIwabuchi', 'rogerpearce', 'mayagokhale'] version('master', branch='master') version('develop', branch='develop') + version('0.15', sha256='a1ea475ce1297b0c4cdf450544dc60ecf1b0a30c548b08ba77ccda5585df7248') version('0.13', sha256='959d37d0a7e7e5b4d5e6c0334aaaeef1b463e855fa8e807042f662c993ed60b1') version('0.12', sha256='b757b354b355e866bd6d42da53b0160442f3b7f663a19ba113da1ffc1a76176e') version('0.11', sha256='7cfa6a7eaaeb7fd11ecfbe43a172a36c8cde200601d6cd3b309d7a0acf752f3c') diff --git a/var/spack/repos/builtin/packages/metis/package.py b/var/spack/repos/builtin/packages/metis/package.py index 36a1336bbd3..193b41a6e26 100644 --- a/var/spack/repos/builtin/packages/metis/package.py +++ b/var/spack/repos/builtin/packages/metis/package.py @@ -53,6 +53,17 @@ def setup_build_environment(self, env): # Ignore warnings/errors re unrecognized omp pragmas on %intel if '%intel@14:' in self.spec: env.append_flags('CFLAGS', '-diag-disable 3180') + # Ignore some warnings to get it to compile with %nvhpc + # 111: statement is unreachable + # 177: variable "foo" was declared but never referenced + # 188: enumerated type mixed with another type + # 550: variable "foo" was set but never used + if '%nvhpc' in self.spec: + env.append_flags('CFLAGS', '--display_error_number') + env.append_flags('CFLAGS', '--diag_suppress 111') + env.append_flags('CFLAGS', '--diag_suppress 177') + env.append_flags('CFLAGS', '--diag_suppress 188') + env.append_flags('CFLAGS', '--diag_suppress 550') @when('@5:') def patch(self): diff --git a/var/spack/repos/builtin/packages/migraphx/package.py b/var/spack/repos/builtin/packages/migraphx/package.py index ece84969dd0..7261e464b29 100644 --- a/var/spack/repos/builtin/packages/migraphx/package.py +++ b/var/spack/repos/builtin/packages/migraphx/package.py @@ -43,6 +43,7 @@ def url_for_version(self, version): depends_on('nlohmann-json', type='link') depends_on('msgpack-c', type='link') depends_on('half@1.12.0', type='link') + depends_on('python@3:', type='build') depends_on('py-pybind11', type='build', when='@:4.0.0') depends_on('py-pybind11@2.6:', type='build', when='@4.1.0:') @@ -54,6 +55,17 @@ def url_for_version(self, version): depends_on('rocblas@' + ver, when='@' + ver) depends_on('miopen-hip@' + ver, when='@' + ver) + @property + def cmake_python_hints(self): + """Include the python include path to the + CMake based on current spec + """ + python_spec = self.spec['python'] + include_dir = python_spec.package.get_python_inc() + return [ + self.define('Python_INCLUDE_DIR', include_dir) + ] + def cmake_args(self): args = [ '-DCMAKE_CXX_COMPILER={0}/bin/clang++' @@ -63,4 +75,6 @@ def cmake_args(self): args.append('-DNLOHMANN_JSON_INCLUDE={0}'.format( self.spec['nlohmann-json'].prefix.include)) + if self.spec['cmake'].satisfies('@3.16.0:'): + args += self.cmake_python_hints return args diff --git a/var/spack/repos/builtin/packages/minc-toolkit/package.py b/var/spack/repos/builtin/packages/minc-toolkit/package.py index bce163e2eb9..442af8b88f3 100644 --- a/var/spack/repos/builtin/packages/minc-toolkit/package.py +++ b/var/spack/repos/builtin/packages/minc-toolkit/package.py @@ -15,6 +15,8 @@ class MincToolkit(CMakePackage): version('1.9.18.1', commit="38597c464b6e93eda680ab4a9e903366d53d7737", submodules=True) + variant('shared', default=True, + description="Build shared libraries") variant('visualisation', default=False, description="Build visual tools (Display, register, etc.)") @@ -25,7 +27,8 @@ class MincToolkit(CMakePackage): depends_on('freeglut', when="+visualisation") def cmake_args(self): - return [self.define_from_variant('MT_BUILD_VISUAL_TOOLS', 'visualisation'), + return [self.define_from_variant('MT_BUILD_SHARED_LIBS', 'shared'), + self.define_from_variant('MT_BUILD_VISUAL_TOOLS', 'visualisation'), # newer ANTs packaged separately "-DMT_BUILD_ANTS=OFF", # build error; should package newer c3d separately diff --git a/var/spack/repos/builtin/packages/mpas-model/package.py b/var/spack/repos/builtin/packages/mpas-model/package.py index 1a14b800f05..0fb7683da53 100644 --- a/var/spack/repos/builtin/packages/mpas-model/package.py +++ b/var/spack/repos/builtin/packages/mpas-model/package.py @@ -14,6 +14,7 @@ class MpasModel(MakefilePackage): homepage = "https://mpas-dev.github.io/" url = "https://github.com/MPAS-Dev/MPAS-Model/archive/v7.0.tar.gz" + maintainers = ['t-brown'] version('7.0', sha256='f898ce257e66cff9e29320458870570e55721d16cb000de7f2cc27de7fdef14f') version('6.3', sha256='e7f1d9ebfeb6ada37d42a286aaedb2e69335cbc857049dc5c5544bb51e7a8db8') @@ -55,6 +56,12 @@ def target(self, model, action): '-Fwide', '-CcdRR8', ]) + elif satisfies('%intel'): + fflags.extend([ + '-r8', + '-convert big_endian', + '-FR', + ]) cppflags.append('-DUNDERSCORE') targets = [ 'FC_PARALLEL={0}'.format(spec['mpi'].mpifc), diff --git a/var/spack/repos/builtin/packages/mvapich2-gdr/package.py b/var/spack/repos/builtin/packages/mvapich2-gdr/package.py index c58490d825b..10d9f4c5f12 100755 --- a/var/spack/repos/builtin/packages/mvapich2-gdr/package.py +++ b/var/spack/repos/builtin/packages/mvapich2-gdr/package.py @@ -19,7 +19,7 @@ class Mvapich2Gdr(AutotoolsPackage): homepage = 'http://mvapich.cse.ohio-state.edu' url = 'http://mvapich.cse.ohio-state.edu/download/mvapich/spack-mirror/mvapich2-gdr/mvapich2-gdr-2.3.5.tar.gz' - maintainers = ['apreifsteck', 'nithintsk', 'harisubramoni'] + maintainers = ['ndcontini', 'natshineman', 'harisubramoni'] version('2.3.5', sha256='bcfe8197875405af0ddbf6462e585efc21668108bec9b481fe53616ad36a98b4') version('2.3.4', sha256='ed78101e6bb807e979213006ee5f20ff466369b01f96b6d1cf0c471baf7e35aa') @@ -92,8 +92,7 @@ class Mvapich2Gdr(AutotoolsPackage): depends_on('libxml2@2.9.10') depends_on('cuda@9.2.88:11.1.1', when='+cuda') depends_on('pmix@3.1.3', when='pmi_version=pmix') - - depends_on('hip@3.9.0', when='+rocm') + depends_on('hip@3.9.0:4.0.0', when='+rocm') filter_compiler_wrappers( 'mpicc', 'mpicxx', 'mpif77', 'mpif90', 'mpifort', relative_root='bin' diff --git a/var/spack/repos/builtin/packages/mvapich2/package.py b/var/spack/repos/builtin/packages/mvapich2/package.py index 6c6cc08a61c..faf1d696e0e 100644 --- a/var/spack/repos/builtin/packages/mvapich2/package.py +++ b/var/spack/repos/builtin/packages/mvapich2/package.py @@ -17,7 +17,7 @@ class Mvapich2(AutotoolsPackage): url = "http://mvapich.cse.ohio-state.edu/download/mvapich/mv2/mvapich2-2.3.6.tar.gz" list_url = "http://mvapich.cse.ohio-state.edu/downloads/" - maintainers = ['natshineman', 'harisubramoni'] + maintainers = ['natshineman', 'harisubramoni', 'ndcontini'] executables = ['^mpiname$'] diff --git a/var/spack/repos/builtin/packages/mvapich2x/package.py b/var/spack/repos/builtin/packages/mvapich2x/package.py index 87084bbc95c..0c12ddef598 100755 --- a/var/spack/repos/builtin/packages/mvapich2x/package.py +++ b/var/spack/repos/builtin/packages/mvapich2x/package.py @@ -21,7 +21,7 @@ class Mvapich2x(AutotoolsPackage): homepage = "http://mvapich.cse.ohio-state.edu" url = "http://mvapich.cse.ohio-state.edu/download/mvapich/spack-mirror/mvapich2x/mvapich2x-2.3.tar.gz" - maintainers = ['nithintsk', 'harisubramoni'] + maintainers = ['natshineman', 'harisubramoni', 'ndcontini'] version('2.3', sha256='fc47070e2e9fac09b97022be2320200d732a0a4a820a2b51532b88f8ded14536', preferred=True) version('2.3rc3', sha256='85a9f1ea1a837d487e356f021ef6f3a4661ad270a0c5f54777b362ee4d45166f') diff --git a/var/spack/repos/builtin/packages/n2p2/libnnp-makefile212.patch b/var/spack/repos/builtin/packages/n2p2/libnnp-makefile212.patch new file mode 100644 index 00000000000..d48955d48f5 --- /dev/null +++ b/var/spack/repos/builtin/packages/n2p2/libnnp-makefile212.patch @@ -0,0 +1,30 @@ +--- a/src/libnnp/makefile ++++ b/src/libnnp/makefile +@@ -72,11 +72,11 @@ headers: version + + version: + @$(eval GIT_VERSION = $(shell git describe --tags --always)) +- @sed -i.bak -E "s/(N2P2_GIT_VERSION) .*/\1 \"$(GIT_VERSION)\"/" version.h ++ @sed -i.bak -E "s|(N2P2_GIT_VERSION) .*|\1 \"$(GIT_VERSION)\"|" version.h + @$(eval GIT_REV = $(shell git rev-parse HEAD)) +- @sed -i.bak -E "s/(N2P2_GIT_REV) .*/\1 \"$(GIT_REV)\"/" version.h ++ @sed -i.bak -E "s|(N2P2_GIT_REV) .*|\1 \"$(GIT_REV)\"|" version.h + @$(eval GIT_BRANCH = $(shell git rev-parse --abbrev-ref HEAD)) +- @sed -i.bak -E "s/(N2P2_GIT_BRANCH) .*/\1 \"$(GIT_BRANCH)\"/" version.h ++ @sed -i.bak -E "s|(N2P2_GIT_BRANCH) .*|\1 \"$(GIT_BRANCH)\"|" version.h + @rm version.h.bak + + $(LIB).so: CFLAGS+= -fPIC +@@ -97,9 +97,9 @@ clean: clean-version clean-headers + $(RM) $(PROJECT_LIB)/$(LIB).so $(PROJECT_LIB)/$(LIB).a + + clean-version: +- @sed -i.bak -E "s/(N2P2_GIT_VERSION) .*/\1 \"\"/" version.h +- @sed -i.bak -E "s/(N2P2_GIT_REV) .*/\1 \"\"/" version.h +- @sed -i.bak -E "s/(N2P2_GIT_BRANCH) .*/\1 \"\"/" version.h ++ @sed -i.bak -E "s|(N2P2_GIT_VERSION) .*|\1 \"\"|" version.h ++ @sed -i.bak -E "s|(N2P2_GIT_REV) .*|\1 \"\"|" version.h ++ @sed -i.bak -E "s|(N2P2_GIT_BRANCH) .*|\1 \"\"|" version.h + @rm version.h.bak + + clean-headers: diff --git a/var/spack/repos/builtin/packages/n2p2/package.py b/var/spack/repos/builtin/packages/n2p2/package.py index 0d8ffda8e44..6fb12e5880a 100644 --- a/var/spack/repos/builtin/packages/n2p2/package.py +++ b/var/spack/repos/builtin/packages/n2p2/package.py @@ -14,6 +14,10 @@ class N2p2(MakefilePackage): homepage = "https://github.com/CompPhysVienna/n2p2" url = "https://github.com/CompPhysVienna/n2p2/archive/v2.1.0.tar.gz" + version( + "2.1.4", + sha256="f1672c09af4ed16a7f396606977e4675a0fee98f04bfd9574907fba4b83a14ef", + ) version( "2.1.1", sha256="90fbc0756132984d0d7e6d92d2f53358c120e75f148910d90c027158163251b9", @@ -26,8 +30,9 @@ class N2p2(MakefilePackage): variant("doc", default=False, description="build documentation with Doxygen") patch("interface-makefile.patch", when="@2.1.0") - patch("interface-makefile211.patch", when="@2.1.1") - patch("libnnp-makefile.patch") + patch("interface-makefile211.patch", when="@2.1.1:") + patch("libnnp-makefile.patch", when="@:2.1.1") + patch("libnnp-makefile212.patch", when="@2.1.2:") patch("nnp_test.h.patch") depends_on("mpi") diff --git a/var/spack/repos/builtin/packages/nalu-wind/package.py b/var/spack/repos/builtin/packages/nalu-wind/package.py index d845a6ea62f..203d69b8306 100644 --- a/var/spack/repos/builtin/packages/nalu-wind/package.py +++ b/var/spack/repos/builtin/packages/nalu-wind/package.py @@ -52,19 +52,21 @@ class NaluWind(CMakePackage, CudaPackage): depends_on('mpi') depends_on('yaml-cpp@0.5.3:') - depends_on('trilinos@master,develop ~cuda~wrapper+exodus+tpetra+muelu+belos+ifpack2+amesos2+zoltan+stk+boost~superlu-dist~superlu+hdf5+zlib+pnetcdf+shards~hypre cxxstd=14', when='~cuda') - # Cannot build Trilinos as a shared library with STK on Darwin - # https://github.com/trilinos/Trilinos/issues/2994 - depends_on('trilinos@master,develop ~cuda~wrapper+exodus+tpetra+muelu+belos+ifpack2+amesos2+zoltan+stk+boost~superlu-dist~superlu+hdf5+zlib+pnetcdf+shards~hypre~shared cxxstd=14', when=(sys.platform == 'darwin')) depends_on('openfast@master,develop +cxx', when='+openfast') depends_on('tioga@master,develop', when='+tioga') depends_on('hypre@develop,2.18.2: +int64+mpi~superlu-dist', when='+hypre') depends_on('kokkos-nvcc-wrapper', type='build', when='+cuda') + depends_on('trilinos@master,develop +exodus+tpetra+muelu+belos+ifpack2+amesos2+zoltan+stk+boost~superlu-dist~superlu+hdf5+zlib+pnetcdf+shards~hypre cxxstd=14') + # Cannot build Trilinos as a shared library with STK on Darwin + # https://github.com/trilinos/Trilinos/issues/2994 + depends_on('trilinos~shared', when=(sys.platform == 'darwin')) + # Propagate cuda options to trilinos and hypre + depends_on('trilinos~cuda~wrapper', when='~cuda') + depends_on('trilinos+cuda+wrapper+cuda_rdc', when='+cuda') + depends_on('hypre@develop +cuda', when='+cuda') for _arch in CudaPackage.cuda_arch_values: - depends_on('trilinos@master,develop ~shared+exodus+tpetra+muelu+belos+ifpack2+amesos2+zoltan+stk+boost~superlu-dist~superlu+hdf5+zlib+pnetcdf+shards~hypre+cuda+cuda_rdc+wrapper cxxstd=14 cuda_arch={0}'.format(_arch), - when='+cuda cuda_arch={0}'.format(_arch)) - depends_on('hypre@develop +mpi+cuda+int64~superlu-dist cuda_arch={0}'.format(_arch), - when='+hypre+cuda cuda_arch={0}'.format(_arch)) + depends_on('trilinos cuda_arch=' + _arch, when='+cuda cuda_arch=' + _arch) + depends_on('hypre cuda_arch=' + _arch, when='+hypre+cuda cuda_arch=' + _arch) depends_on('trilinos-catalyst-ioss-adapter', when='+catalyst') depends_on('fftw+mpi', when='+fftw') depends_on('boost cxxstd=14', when='+boost') diff --git a/var/spack/repos/builtin/packages/nalu/package.py b/var/spack/repos/builtin/packages/nalu/package.py index 44c8357d499..acda4934e68 100644 --- a/var/spack/repos/builtin/packages/nalu/package.py +++ b/var/spack/repos/builtin/packages/nalu/package.py @@ -35,7 +35,7 @@ class Nalu(CMakePackage): # Cannot build Trilinos as a shared library with STK on Darwin # which is why we have a 'shared' variant for Nalu # https://github.com/trilinos/Trilinos/issues/2994 - depends_on('trilinos+exodus+tpetra+muelu+belos+ifpack2+amesos2+zoltan+stk+boost~superlu-dist+superlu+hdf5+zlib+pnetcdf+shards~hypre@master,develop', when='+shared') + depends_on('trilinos+mpi+netcdf+exodus+tpetra+muelu+belos+ifpack2+amesos2+zoltan+stk+boost~superlu-dist+superlu+hdf5+zlib+pnetcdf+shards~hypre@master,develop', when='+shared') depends_on('trilinos~shared+exodus+tpetra+muelu+belos+ifpack2+amesos2+zoltan+stk+boost~superlu-dist+superlu+hdf5+zlib+pnetcdf+shards~hypre@master,develop', when='~shared') # Optional dependencies depends_on('tioga', when='+tioga+shared') diff --git a/var/spack/repos/builtin/packages/ncbi-rmblastn/package.py b/var/spack/repos/builtin/packages/ncbi-rmblastn/package.py index e7ef8bf8975..95f3a14b14b 100644 --- a/var/spack/repos/builtin/packages/ncbi-rmblastn/package.py +++ b/var/spack/repos/builtin/packages/ncbi-rmblastn/package.py @@ -34,6 +34,7 @@ class NcbiRmblastn(AutotoolsPackage): archive_sha256='e746ee480ade608052306fd21f015c8a323f27029f65399275216f9a4c882d59', when='@2.9.0' ) + depends_on('cpio', type='build') configure_directory = 'c++' diff --git a/var/spack/repos/builtin/packages/nut/package.py b/var/spack/repos/builtin/packages/nut/package.py index 1c833bc892e..257adb8c210 100644 --- a/var/spack/repos/builtin/packages/nut/package.py +++ b/var/spack/repos/builtin/packages/nut/package.py @@ -24,11 +24,13 @@ class Nut(CMakePackage): depends_on('cmake@3.0:', type='build') depends_on('random123') + # The conflict with %nvhpc is inherited from random123, + # which is a C++ template library + conflicts('%nvhpc') conflicts('%intel', when='@serial') conflicts('%pgi', when='@serial') conflicts('%xl', when='@serial') conflicts('%nag', when='@serial') - build_targets = ['VERBOSE=on'] def setup_build_environment(self, env): diff --git a/var/spack/repos/builtin/packages/nvhpc/package.py b/var/spack/repos/builtin/packages/nvhpc/package.py index 768305a9fbb..cda878e4b62 100644 --- a/var/spack/repos/builtin/packages/nvhpc/package.py +++ b/var/spack/repos/builtin/packages/nvhpc/package.py @@ -22,6 +22,10 @@ # - package key must be in the form '{os}-{arch}' where 'os' is in the # format returned by platform.system() and 'arch' by platform.machine() _versions = { + '21.7': { + 'Linux-aarch64': ('73eb3513845b59645f118b1e313472f54519dc252d5f5c32a05df2a2a8a19878', 'https://developer.download.nvidia.com/hpc-sdk/21.7/nvhpc_2021_217_Linux_aarch64_cuda_multi.tar.gz'), + 'Linux-ppc64le': ('37ea23b5a9c696fb3fdb82855643afc4e02aea618102ec801206441f10fc9fba', 'https://developer.download.nvidia.com/hpc-sdk/21.7/nvhpc_2021_217_Linux_ppc64le_cuda_multi.tar.gz'), + 'Linux-x86_64': ('49d6e23492d131474698cf12971722d42e13a54a4eddec382e66e1053b4ac902', 'https://developer.download.nvidia.com/hpc-sdk/21.7/nvhpc_2021_217_Linux_x86_64_cuda_multi.tar.gz')}, '21.5': { 'Linux-aarch64': ('1a1748cd7cf538199d92ab3b1208935fa4a62708ba21125aeadb328ddc7380d4', 'https://developer.download.nvidia.com/hpc-sdk/21.5/nvhpc_2021_215_Linux_aarch64_cuda_multi.tar.gz'), 'Linux-ppc64le': ('4674931a5ce28724308cb9cebd546eefa3f0646d3d08adbea28ba5ad27f0c163', 'https://developer.download.nvidia.com/hpc-sdk/21.5/nvhpc_2021_215_Linux_ppc64le_cuda_multi.tar.gz'), diff --git a/var/spack/repos/builtin/packages/nvshmem/package.py b/var/spack/repos/builtin/packages/nvshmem/package.py index f55ce169e13..3e2f619b6a4 100644 --- a/var/spack/repos/builtin/packages/nvshmem/package.py +++ b/var/spack/repos/builtin/packages/nvshmem/package.py @@ -41,44 +41,30 @@ def url_for_version(self, version): depends_on('nccl', when='+nccl') def setup_build_environment(self, env): - env.append_flags( - 'CUDA_HOME', self.spec['cuda'].prefix) - env.append_flags( - 'NVSHMEM_PREFIX', self.prefix) + env.set('CUDA_HOME', self.spec['cuda'].prefix) + env.set('NVSHMEM_PREFIX', self.prefix) if '+ucx' in self.spec: - env.append_flags( - 'NVSHMEM_UCX_SUPPORT', '1') - env.append_flags( - 'UCX_HOME', self.spec['ucx'].prefix) + env.set('NVSHMEM_UCX_SUPPORT', '1') + env.set('UCX_HOME', self.spec['ucx'].prefix) if '+gdrcopy' in self.spec: - env.append_flags( - 'NVSHMEM_USE_GDRCOPY', '1') - env.append_flags( - 'GDRCOPY_HOME', self.spec['gdrcopy'].prefix) + env.set('NVSHMEM_USE_GDRCOPY', '1') + env.set('GDRCOPY_HOME', self.spec['gdrcopy'].prefix) if '+nccl' in self.spec: - env.append_flags( - 'NVSHMEM_USE_NCCL', '1') - env.append_flags( - 'NCCL_HOME', self.spec['nccl'].prefix) + env.set('NVSHMEM_USE_NCCL', '1') + env.set('NCCL_HOME', self.spec['nccl'].prefix) if '+mpi' in self.spec: - env.append_flags( - 'NVSHMEM_MPI_SUPPORT', '1') - env.append_flags( - 'MPI_HOME', self.spec['mpi'].prefix) + env.set('NVSHMEM_MPI_SUPPORT', '1') + env.set('MPI_HOME', self.spec['mpi'].prefix) if self.spec.satisfies('^spectrum-mpi') or self.spec.satisfies('^openmpi'): - env.append_flags( - 'NVSHMEM_MPI_IS_OMPI', '1') + env.set('NVSHMEM_MPI_IS_OMPI', '1') else: - env.append_flags( - 'NVSHMEM_MPI_IS_OMPI', '0') + env.set('NVSHMEM_MPI_IS_OMPI', '0') if '+shmem' in self.spec: - env.append_flags( - 'NVSHMEM_SHMEM_SUPPORT', '1') - env.append_flags( - 'SHMEM_HOME', self.spec['mpi'].prefix) + env.set('NVSHMEM_SHMEM_SUPPORT', '1') + env.set('SHMEM_HOME', self.spec['mpi'].prefix) diff --git a/var/spack/repos/builtin/packages/octave/package.py b/var/spack/repos/builtin/packages/octave/package.py index 7dcdeed439c..ba6709c8225 100644 --- a/var/spack/repos/builtin/packages/octave/package.py +++ b/var/spack/repos/builtin/packages/octave/package.py @@ -26,6 +26,7 @@ class Octave(AutotoolsPackage, GNUMirrorPackage): extendable = True + version('6.3.0', sha256='232065f3a72fc3013fe9f17f429a3df69d672c1f6b6077029a31c8f3cd58a66e') version('6.2.0', sha256='457d1fda8634a839e2fd7cfc55b98bd56f36b6ae73d31bb9df43dde3012caa7c') version('6.1.0', sha256='6ff34e401658622c44094ecb67e497672e4337ca2d36c0702d0403ecc60b0a57') version('5.2.0', sha256='2fea62b3c78d6f38e9451da8a4d26023840725977dffee5250d3d180f56595e1') diff --git a/var/spack/repos/builtin/packages/octopus/package.py b/var/spack/repos/builtin/packages/octopus/package.py index edd3046cc90..d5aa933ff37 100644 --- a/var/spack/repos/builtin/packages/octopus/package.py +++ b/var/spack/repos/builtin/packages/octopus/package.py @@ -15,6 +15,7 @@ class Octopus(Package): homepage = "https://octopus-code.org/" url = "http://octopus-code.org/down.php?file=6.0/octopus-6.0.tar.gz" + version('10.5', sha256='deb92e3491b0c6ac5736960d075b44cab466f528b69715ed44968ecfe2953ec4') version('10.0', sha256='ccf62200e3f37911bfff6d127ebe74220996e9c09383a10b1420c81d931dcf23') version('7.3', sha256='ad843d49d4beeed63e8b9a2ca6bfb2f4c5a421f13a4f66dc7b02f6d6a5c4d742') version('6.0', sha256='4a802ee86c1e06846aa7fa317bd2216c6170871632c9e03d020d7970a08a8198') @@ -37,10 +38,10 @@ class Octopus(Package): depends_on('libxc@2:2.99', when='@:5.99') depends_on('libxc@2:3.99', when='@6:7.99') depends_on('libxc@2:4.99', when='@8:9.99') - depends_on('libxc@3:5.0.0', when='@10.0') + depends_on('libxc@3:5.0.0', when='@10:') depends_on('mpi') - depends_on('fftw@3:+mpi+openmp', when='@:9.99') - depends_on('fftw-api@3:', when='@10.0:') + depends_on('fftw@3:+mpi+openmp', when='@8:9.99') + depends_on('fftw-api@3:', when='@10:') depends_on('metis@5:', when='+metis') depends_on('parmetis', when='+parmetis') depends_on('scalapack', when='+scalapack') diff --git a/var/spack/repos/builtin/packages/omega-h/package.py b/var/spack/repos/builtin/packages/omega-h/package.py index b5a01bfad5c..9fb8185edff 100644 --- a/var/spack/repos/builtin/packages/omega-h/package.py +++ b/var/spack/repos/builtin/packages/omega-h/package.py @@ -41,7 +41,7 @@ class OmegaH(CMakePackage): depends_on('gmsh', when='+examples', type='build') depends_on('mpi', when='+mpi') - depends_on('trilinos +kokkos +teuchos', when='+trilinos') + depends_on('trilinos +kokkos', when='+trilinos') depends_on('zlib', when='+zlib') # https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86610 diff --git a/var/spack/repos/builtin/packages/openblas/package.py b/var/spack/repos/builtin/packages/openblas/package.py index 2e28011a8e1..337aad641c5 100644 --- a/var/spack/repos/builtin/packages/openblas/package.py +++ b/var/spack/repos/builtin/packages/openblas/package.py @@ -18,6 +18,8 @@ class Openblas(MakefilePackage): git = 'https://github.com/xianyi/OpenBLAS.git' version('develop', branch='develop') + version('0.3.17', sha256='df2934fa33d04fd84d839ca698280df55c690c86a5a1133b3f7266fce1de279f') + version('0.3.16', sha256='fa19263c5732af46d40d3adeec0b2c77951b67687e670fb6ba52ea3950460d79') version('0.3.15', sha256='30a99dec977594b387a17f49904523e6bc8dd88bd247266e83485803759e4bbe') version('0.3.14', sha256='d381935d26f9cae8e4bbd7d7f278435adf8e3a90920edf284bb9ad789ee9ad60') version('0.3.13', sha256='79197543b17cc314b7e43f7a33148c308b0807cd6381ee77f77e15acf3e6459e') diff --git a/var/spack/repos/builtin/packages/openmpi/package.py b/var/spack/repos/builtin/packages/openmpi/package.py index a1d6bc57b83..d98d829c04b 100644 --- a/var/spack/repos/builtin/packages/openmpi/package.py +++ b/var/spack/repos/builtin/packages/openmpi/package.py @@ -284,6 +284,7 @@ class Openmpi(AutotoolsPackage): depends_on('hwloc@:1.999', when='@:3.999.999 ~internal-hwloc') depends_on('hwloc +cuda', when='+cuda ~internal-hwloc') + depends_on('cuda', when='+cuda') depends_on('java', when='+java') depends_on('sqlite', when='+sqlite3@:1.11') depends_on('zlib', when='@3.0.0:') @@ -306,7 +307,7 @@ class Openmpi(AutotoolsPackage): depends_on('knem', when='fabrics=knem') depends_on('lsf', when='schedulers=lsf') - depends_on('openpbs', when='schedulers=tm') + depends_on('pbs', when='schedulers=tm') depends_on('slurm', when='schedulers=slurm') depends_on('openssh', type='run') @@ -587,7 +588,7 @@ def with_or_without_lsf(self, activated): def with_or_without_tm(self, activated): if not activated: return '--without-tm' - return '--with-tm={0}'.format(self.spec['openpbs'].prefix) + return '--with-tm={0}'.format(self.spec['pbs'].prefix) @run_before('autoreconf') def die_without_fortran(self): diff --git a/var/spack/repos/builtin/packages/openpmd-api/package.py b/var/spack/repos/builtin/packages/openpmd-api/package.py index 43ac393d294..61f0cea5cab 100644 --- a/var/spack/repos/builtin/packages/openpmd-api/package.py +++ b/var/spack/repos/builtin/packages/openpmd-api/package.py @@ -16,7 +16,7 @@ class OpenpmdApi(CMakePackage): maintainers = ['ax3l'] # C++14 up until here - version('dev', branch='dev') + version('develop', branch='dev') # temporary, pre 0.14.0 version for HiPACE++ version('hipace', commit='ac083025ee662469b8cad1adf93eef48cde35f58') version('0.13.4', sha256='46c013be5cda670f21969675ce839315d4f5ada0406a6546a91ec3441402cf5e') diff --git a/var/spack/repos/builtin/packages/paraview/package.py b/var/spack/repos/builtin/packages/paraview/package.py index 91291e38ead..ad321736d31 100644 --- a/var/spack/repos/builtin/packages/paraview/package.py +++ b/var/spack/repos/builtin/packages/paraview/package.py @@ -142,6 +142,10 @@ class Paraview(CMakePackage, CudaPackage): # Can't contretize with python2 and py-pillow@7.0.0: depends_on('pil@:6', when='+python') + # ParaView depends on cli11 due to changes in MR + # https://gitlab.kitware.com/paraview/paraview/-/merge_requests/4951 + depends_on('cli11@1.9.1', when='@5.10:') + patch('stl-reader-pv440.patch', when='@4.4.0') # Broken gcc-detection - improved in 5.1.0, redundant later @@ -269,6 +273,9 @@ def nvariant_bool(feature): '-DBUILD_TESTING:BOOL=OFF', '-DOpenGL_GL_PREFERENCE:STRING=LEGACY'] + if spec.satisfies('@5.10:'): + cmake_args.append('-DVTK_MODULE_USE_EXTERNAL_ParaView_vtkcatalyst:BOOL=OFF') + if spec.satisfies('@:5.7') and spec['cmake'].satisfies('@3.17:'): cmake_args.append('-DFPHSA_NAME_MISMATCHED:BOOL=ON') diff --git a/var/spack/repos/builtin/packages/pdc/package.py b/var/spack/repos/builtin/packages/pdc/package.py new file mode 100644 index 00000000000..2f96d12d793 --- /dev/null +++ b/var/spack/repos/builtin/packages/pdc/package.py @@ -0,0 +1,42 @@ +# Copyright 2013-2021 Lawrence Livermore National Security, LLC and other +# Spack Project Developers. See the top-level COPYRIGHT file for details. +# +# SPDX-License-Identifier: (Apache-2.0 OR MIT) + +from spack import * + + +class Pdc(CMakePackage): + """Proactive Data Containers (PDC) software provides an object-centric + API and a runtime system with a set of data object management services. + These services allow placing data in the memory and storage hierarchy, + performing data movement asynchronously, and providing scalable + metadata operations to find data objects.""" + + homepage = "https://pdc.readthedocs.io/en/latest/" + url = "https://github.com/hpc-io/pdc/archive/refs/tags/0.1.tar.gz" + + maintainers = ['houjun', 'sbyna'] + + version('0.1', sha256='01b4207ecf71594a7f339c315f2869b3fa8fbd34b085963dc4c1bdc5b66bb93e') + + conflicts('%clang') + depends_on('libfabric') + depends_on('mercury') + depends_on('mpi') + + root_cmakelists_dir = 'src' + + def cmake_args(self): + args = [ + self.define('MPI_C_COMPILER', self.spec['mpi'].mpicc), + self.define('BUILD_MPI_TESTING', 'ON'), + self.define('BUILD_SHARED_LIBS', 'ON'), + self.define('BUILD_TESTING', 'ON'), + self.define('PDC_ENABLE_MPI', 'ON'), + self.define('CMAKE_C_COMPILER', self.spec['mpi'].mpicc) + ] + + if self.spec.satisfies('platform=cray'): + args.append("-DRANKSTR_LINK_STATIC=ON") + return args diff --git a/var/spack/repos/builtin/packages/percept/package.py b/var/spack/repos/builtin/packages/percept/package.py index a33c2f36673..99e204a7d29 100644 --- a/var/spack/repos/builtin/packages/percept/package.py +++ b/var/spack/repos/builtin/packages/percept/package.py @@ -25,7 +25,7 @@ class Percept(CMakePackage): depends_on('opennurbs@percept') depends_on('boost+graph+mpi') depends_on('yaml-cpp+pic~shared@0.5.3:') - depends_on('trilinos~shared+exodus+tpetra+epetra+epetraext+muelu+belos+ifpack2+amesos2+zoltan+stk+boost~superlu-dist+superlu+hdf5+zlib+pnetcdf+aztec+sacado~openmp+shards+intrepid+cgns@master,12.14.1:') + depends_on('trilinos~shared+exodus+netcdf+mpi+tpetra+epetra+epetraext+muelu+belos+ifpack2+amesos2+zoltan+stk+boost~superlu-dist+superlu+hdf5+zlib+pnetcdf+aztec+sacado~openmp+shards+intrepid+cgns@master,12.14.1:') def cmake_args(self): spec = self.spec diff --git a/var/spack/repos/builtin/packages/petsc/package.py b/var/spack/repos/builtin/packages/petsc/package.py index 9fbf97ea75a..1ee1a3825f3 100644 --- a/var/spack/repos/builtin/packages/petsc/package.py +++ b/var/spack/repos/builtin/packages/petsc/package.py @@ -19,6 +19,7 @@ class Petsc(Package, CudaPackage, ROCmPackage): version('main', branch='main') version('xsdk-0.2.0', tag='xsdk-0.2.0') + version('3.15.2', sha256='3b10c19c69fc42e01a38132668724a01f1da56f5c353105cd28f1120cc9041d8') version('3.15.1', sha256='c0ac6566e69d1d70b431e07e7598e9de95e84891c2452db1367c846b75109deb') version('3.15.0', sha256='ac46db6bfcaaec8cd28335231076815bd5438f401a4a05e33736b4f9ff12e59a') version('3.14.6', sha256='4de0c8820419fb15bc683b780127ff57067b62ca18749e864a87c6d7c93f1230') @@ -431,6 +432,15 @@ def install(self, spec, prefix): library=petsclibname, path=spec[library].prefix) ) + if '+cuda' in spec: + if not spec.satisfies('cuda_arch=none'): + cuda_arch = spec.variants['cuda_arch'].value + if spec.satisfies('@3.14:'): + options.append('--with-cuda-gencodearch={0}'.format(cuda_arch[0])) + else: + options.append('CUDAFLAGS=-gencode arch=compute_{0},code=sm_{0}' + .format(cuda_arch[0])) + # PETSc does not pick up SuperluDist from the dir as they look for # superlu_dist_4.1.a if 'superlu-dist' in spec: diff --git a/var/spack/repos/builtin/packages/pgplot/g77_gcc.conf.patch b/var/spack/repos/builtin/packages/pgplot/g77_gcc.conf.patch new file mode 100644 index 00000000000..e41e387cad1 --- /dev/null +++ b/var/spack/repos/builtin/packages/pgplot/g77_gcc.conf.patch @@ -0,0 +1,55 @@ +diff -ruN a/sys_linux/g77_gcc.conf b/sys_linux/g77_gcc.conf +--- a/sys_linux/g77_gcc.conf 1969-12-31 19:00:00.000000000 -0500 ++++ b/sys_linux/g77_gcc.conf 2021-04-22 16:48:45.000000000 -0400 +@@ -34,13 +34,13 @@ + # Mandatory. + # The FORTRAN compiler to use. + +- FCOMPL="g77" ++ FCOMPL="@FCOMPL@" + + # Mandatory. + # The FORTRAN compiler flags to use when compiling the pgplot library. + # (NB. makemake prepends -c to $FFLAGC where needed) + +- FFLAGC="-u -Wall -fPIC -O" ++ FFLAGC="@FFLAGC@" + + # Mandatory. + # The FORTRAN compiler flags to use when compiling fortran demo programs. +@@ -52,12 +52,12 @@ + # Mandatory. + # The C compiler to use. + +- CCOMPL="gcc" ++ CCOMPL="@CCOMPL@" + + # Mandatory. + # The C compiler flags to use when compiling the pgplot library. + +- CFLAGC="-Wall -fPIC -DPG_PPU -O" ++ CFLAGC="@CFLAGC@" + + # Mandatory. + # The C compiler flags to use when compiling C demo programs. +@@ -73,9 +73,9 @@ + # Mandatory. + # The library-specification flags to use when linking normal pgplot + # demo programs. + +- LIBS="-L/usr/X11R6/lib -lX11" ++ LIBS="@LIBS@" + + # Optional: Needed by XMDRIV (/xmotif). + # The library-specification flags to use when linking motif + # demo programs. +@@ -108,8 +108,8 @@ + # Optional: Needed if SHARED_LIB is set. + # How to create a shared library from a trailing list of object files. + +- SHARED_LD="gcc -shared -o $SHARED_LIB" ++ SHARED_LD="@SHARED_LD@" + + # Optional: + # On systems such as Solaris 2.x, that allow specification of the + # libraries that a shared library needs to be linked with when a diff --git a/var/spack/repos/builtin/packages/pgplot/package.py b/var/spack/repos/builtin/packages/pgplot/package.py new file mode 100644 index 00000000000..ac5011cdb76 --- /dev/null +++ b/var/spack/repos/builtin/packages/pgplot/package.py @@ -0,0 +1,92 @@ +# Copyright 2013-2021 Lawrence Livermore National Security, LLC and other +# Spack Project Developers. See the top-level COPYRIGHT file for details. +# +# SPDX-License-Identifier: (Apache-2.0 OR MIT) + +from spack import * + + +class Pgplot(MakefilePackage): + """PGPLOT Graphics Subroutine Library + + The PGPLOT Graphics Subroutine Library is a Fortran- or + C-callable, device-independent graphics package for making + simple scientific graphs. It is intended for making + graphical images of publication quality with minimum effort + on the part of the user. For most applications, the program + can be device-independent, and the output can be directed to + the appropriate device at run time.""" + + homepage = "https://sites.astro.caltech.edu/~tjp/pgplot/" + url = "ftp://ftp.astro.caltech.edu/pub/pgplot/pgplot5.2.tar.gz" + + maintainers = ['eschnett'] + + version('5.2.2', + url="ftp://ftp.astro.caltech.edu/pub/pgplot/pgplot5.2.tar.gz", + sha256='a5799ff719a510d84d26df4ae7409ae61fe66477e3f1e8820422a9a4727a5be4') + + # Replace hard-coded compilers and options by tokens, so that Spack can + # edit the file more easily + patch('g77_gcc.conf.patch') + + parallel = False + + def edit(self, spec, prefix): + substitutions = [ + ('@CCOMPL@', self.compiler.cc), + ('@CFLAGC@', ("-Wall -fPIC -DPG_PPU -O -std=c89 " + + "-Wno-error=implicit-function-declaration")), + ('@FCOMPL@', self.compiler.f77), + ('@FFLAGC@', "-Wall -fPIC -O -ffixed-line-length-none" + + (" -fallow-invalid-boz" if spec.satisfies('%gcc@10:') else "")), + ('@LIBS@', "-lgfortran"), + ('@SHARED_LD@', self.compiler.cc + " -shared -o $SHARED_LIB -lgfortran"), + ] + conf = join_path( + self.stage.source_path, 'sys_linux/g77_gcc.conf' + ) + for key, value in substitutions: + filter_file(key, value, conf) + + def build(self, spec, prefix): + makemake = which('./makemake') + makemake(self.build_directory, 'linux', 'g77_gcc') + make() + make('clean') + make('cpg') + + def install(self, spec, prefix): + mkdirp(prefix.bin) + install('cpgdemo', prefix.bin) + install('pgbind', prefix.bin) + install('pgdemo1', prefix.bin) + install('pgdemo2', prefix.bin) + install('pgdemo3', prefix.bin) + install('pgdemo4', prefix.bin) + install('pgdemo5', prefix.bin) + install('pgdemo6', prefix.bin) + install('pgdemo7', prefix.bin) + install('pgdemo8', prefix.bin) + install('pgdemo9', prefix.bin) + install('pgdemo10', prefix.bin) + install('pgdemo11', prefix.bin) + install('pgdemo12', prefix.bin) + install('pgdemo13', prefix.bin) + install('pgdemo14', prefix.bin) + install('pgdemo15', prefix.bin) + install('pgdemo16', prefix.bin) + install('pgdemo17', prefix.bin) + mkdirp(prefix.include) + install('cpgplot.h', prefix.include) + mkdirp(prefix.lib) + install('libcpgplot.a', prefix.lib) + install('libpgplot.a', prefix.lib) + install('libpgplot.so', prefix.lib) + + @property + def libs(self): + shared = "+shared" in self.spec + return find_libraries( + "lib*pgplot", root=self.prefix, shared=shared, recursive=True + ) diff --git a/var/spack/repos/builtin/packages/phist/package.py b/var/spack/repos/builtin/packages/phist/package.py index 9d1a40e5296..1883a3ec57b 100644 --- a/var/spack/repos/builtin/packages/phist/package.py +++ b/var/spack/repos/builtin/packages/phist/package.py @@ -124,7 +124,7 @@ class Phist(CMakePackage): depends_on('eigen', when='kernel_lib=eigen') depends_on('ghost', when='kernel_lib=ghost') - depends_on('trilinos+anasazi+belos+teuchos', when='+trilinos') + depends_on('trilinos+anasazi+belos', when='+trilinos') depends_on('parmetis+int64', when='+parmetis+int64') depends_on('parmetis~int64', when='+parmetis~int64') diff --git a/var/spack/repos/builtin/packages/picard/package.py b/var/spack/repos/builtin/packages/picard/package.py index de180d22754..9abbc3cf38d 100644 --- a/var/spack/repos/builtin/packages/picard/package.py +++ b/var/spack/repos/builtin/packages/picard/package.py @@ -22,6 +22,14 @@ class Picard(Package): # They started distributing a single jar file at v2.6.0, prior to # that it was a .zip file with multiple .jar and .so files + version('2.25.7', sha256='dc0e830d3e838dee2b4f4aa1c9631fb3a4c3ec982de8dfe5145fc748104c7146', expand=False) + version('2.25.6', sha256='768709826514625381e6fa3920945360167f4e830bf72f79eb070da059676f02', expand=False) + version('2.25.5', sha256='f7fa9784b84d384abfcbd77076f5ceab7b2797dc863ac35fd41470daa3efe3a5', expand=False) + version('2.25.4', sha256='c3ac14471e48e28e24201ae5515f828ffa45db7ac3e37173251a672845b4a9b3', expand=False) + version('2.25.3', sha256='1d4dbfcb36d23fde11f173ab0de8a99835e04161efb04f246bbcbfc0bee3b493', expand=False) + version('2.25.2', sha256='aead4baf12028a5d2b9ef70e00c93e4bba8f6bece0b9a7104b89b842a8e0326f', expand=False) + version('2.25.1', sha256='6d6e622d6b465f9fc704c37bcba55b0dac5ad14d07088bbdbdfade5cd027ee1c', expand=False) + version('2.25.0', sha256='faf2434da84fe21b516d57817767920fdedfc19ebdc01d9cae8d6d3314f7e897', expand=False) version('2.24.0', sha256='70e91039bccc6f6db60f18c41713218a8cdf45f591f02c1012c062152b27cd7b', expand=False) version('2.20.8', sha256='aff92d618ee9e6bafc1ab4fbfa89fc557a0dbe596ae4b92fe3bf93ebf95c7105', expand=False) version('2.19.0', sha256='f97fc3f7a73b55cceea8b6a6488efcf1b2fbf8cad61d88645704ddd45a8c5950', expand=False) diff --git a/var/spack/repos/builtin/packages/pinentry/package.py b/var/spack/repos/builtin/packages/pinentry/package.py index 01fce6c5ea3..7b226f2cbe3 100644 --- a/var/spack/repos/builtin/packages/pinentry/package.py +++ b/var/spack/repos/builtin/packages/pinentry/package.py @@ -20,27 +20,35 @@ class Pinentry(AutotoolsPackage): version('1.1.1', sha256='cd12a064013ed18e2ee8475e669b9f58db1b225a0144debdb85a68cecddba57f') version('1.1.0', sha256='68076686fa724a290ea49cdf0d1c0c1500907d1b759a3bcbfbec0293e8f56570') + supported_guis = [ + 'curses', 'tty', 'emacs', 'efl', 'gtk2', 'gnome3', 'qt', 'qt5', 'tqt', 'fltk' + ] + + # Default to 'tty' as it has no additional dependencies + variant('gui', default='tty', description='GUI to use for passphrase entry', + values=supported_guis, multi=True) + depends_on('libgpg-error@1.16:') depends_on('libassuan@2.1.0:') + # Optional GUI dependencies + depends_on('ncurses', when='gui=curses') + depends_on('emacs', when='gui=emacs') + # depends_on('efl@1.18:', when='gui=efl') # Enlightenment + depends_on('gtkplus@2:', when='gui=gtk2') + # depends_on('gnome@3:', when='gui=gnome3') # GNOME + depends_on('qt@4.4.0:', when='gui=qt') + depends_on('qt@5.0:5.999', when='gui=qt5') + # depends_on('tqt', when='gui=tqt') # Trinity QT + depends_on('fltk@1.3:', when='gui=fltk') + + # TODO: add packages for these optional GUIs + conflicts('gui=efl') + conflicts('gui=gnome3') + conflicts('gui=tqt') + def configure_args(self): - return [ - '--enable-static', - '--enable-shared', - # Autotools automatically enables these if dependencies found - # TODO: add variants for these - '--disable-pinentry-curses', - '--disable-pinentry-emacs', - '--disable-pinentry-gtk2', - '--disable-pinentry-gnome3', - '--disable-pinentry-qt', - '--disable-pinentry-qt5', - '--disable-pinentry-tqt', - '--disable-pinentry-fltk', - - # No dependencies, simplest installation - '--enable-pinentry-tty', - + args = [ # Disable extra features '--disable-fallback-curses', '--disable-inside-emacs', @@ -50,3 +58,27 @@ def configure_args(self): '--with-gpg-error-prefix=' + self.spec['libgpg-error'].prefix, '--with-libassuan-prefix=' + self.spec['libassuan'].prefix, ] + + if 'gui=curses' in self.spec: + args.append('--with-ncurses-include-dir=' + + self.spec['ncurses'].headers.directories[0]) + + for gui in self.supported_guis: + if 'gui=' + gui in self.spec: + args.append('--enable-pinentry-' + gui) + else: + args.append('--disable-pinentry-' + gui) + + return args + + def test(self): + kwargs = { + 'exe': self.prefix.bin.pinentry, + 'options': ['--version'], + 'expected': [str(self.version)], + } + self.run_test(**kwargs) + for gui in self.supported_guis: + if 'gui=' + gui in self.spec: + kwargs['exe'] = self.prefix.bin.pinentry + '-' + gui + self.run_test(**kwargs) diff --git a/var/spack/repos/builtin/packages/plumed/package.py b/var/spack/repos/builtin/packages/plumed/package.py index c6be801b065..78c3c30c9c1 100644 --- a/var/spack/repos/builtin/packages/plumed/package.py +++ b/var/spack/repos/builtin/packages/plumed/package.py @@ -21,14 +21,18 @@ class Plumed(AutotoolsPackage): and C/C++ codes. """ homepage = 'http://www.plumed.org/' - url = 'https://github.com/plumed/plumed2/archive/v2.5.3.tar.gz' + url = 'https://github.com/plumed/plumed2/archive/v2.6.3.tar.gz' git = 'https://github.com/plumed/plumed2.git' version('master', branch='master') + version('2.7.1', sha256='cb8b5735d8dd61980fa6441f3dde3f33544240ae4177da0f529fb5abb355cd4a') version('2.7.0', sha256='14450ea566c25ac9bf71fd77bb9c0c95e9038462b5739c73a515be82e2011cd6') - version('2.6.2', preferred=True, sha256='bbc2ef0cb08d404513b8b737c72333b6656389e15effd6a0f9ace2a5758c9a4a') + version('2.6.3', preferred=True, sha256='d05b9e4a4c1329fc932d5bdd04f20419be230f98159bdc012a91716461ab4a2f') + version('2.6.2', sha256='bbc2ef0cb08d404513b8b737c72333b6656389e15effd6a0f9ace2a5758c9a4a') version('2.6.1', sha256='c1b3c397b2d971140aa240dde50e48a04ce78e3dedb02b6dca80fa53f8026e4e') version('2.6.0', sha256='3d57ae460607a49547ef38a52c4ac93493a3966857c352280a9c05f5dcdb1820') + version('2.5.7', sha256='aa10d2879c3edeaef9d5a530fe8b05f67ecfbec2e9423e0f95701d0bc54826c7') + version('2.5.6', sha256='1bc29b0274196fb553cdf7ba8ecb7a93a91d60a920d99863edbcd536d618ce8c') version('2.5.5', sha256='70faa9ff1938e286dc388cb793b39840953e5646855b684f48df1bc864b737e8') version('2.5.4', sha256='a1647e598191f261e75d06351e607475d395af481315052a4c28563ac9989a7f') version('2.5.3', sha256='543288be667dc4201fc461ecd2dd4878ddfbeac682d0c021c99ea8e501c7c9dc') diff --git a/var/spack/repos/builtin/packages/pmdk/package.py b/var/spack/repos/builtin/packages/pmdk/package.py index 9653653f8d2..b600886fdb4 100644 --- a/var/spack/repos/builtin/packages/pmdk/package.py +++ b/var/spack/repos/builtin/packages/pmdk/package.py @@ -17,11 +17,17 @@ class Pmdk(Package): git = "https://github.com/pmem/pmdk.git" version('master', branch='master') - version('1.9', sha256='2c8a148070f4bbf9f82e2ca63d2f84cb5101fc6e72c1ba93cc673ca3b7b95467') - version('1.8', sha256='a241ea76ef76d233cb92826b6823ed48091a2fb6963282a4fea848dbce68aa21') - version('1.7', sha256='865ce1b422bc83109cb4a63dcff8fd1077eea3617e668faf6a043208d8be03ca') - version('1.6', sha256='3b99e6c30709326a94d2e73a9247a8dfb58d0a394c5b7714e5c3d8a3ad2e2e9f') - version('1.5', sha256='6b069d7207febeb62440e89245e8b18fcdf40b6170d2ec2ef33c252ed16db2d4') + version('1.11.0', sha256='bfbc82e6bfd788c8bcb380da76172b83732d12775a719c9c423eb2fadc78bb3a') + version('1.10', sha256='06edcd43ef267c4cc70754d5d1a5d88aeb9f2086bc014bf2594df4c5efd8cc4e') + version('1.9.2', sha256='6bca98ecf9e036603951024b7436d688cd1907b2d8c428373697fafff4096a4f') + version('1.9.1', sha256='3d0ea15099d6dc7b454a67ecd0ed04d7426ff05ee0331a221cb384e293d841f0') + version('1.9', sha256='2c8a148070f4bbf9f82e2ca63d2f84cb5101fc6e72c1ba93cc673ca3b7b95467') + version('1.8.1', sha256='ee4e93bbf29976eac2444e4eb04a862f38b8446f7400f8f7cdcf58febf6f6ba2') + version('1.8', sha256='a241ea76ef76d233cb92826b6823ed48091a2fb6963282a4fea848dbce68aa21') + version('1.7.1', sha256='7e98c0522a3e96b64822902c66024e24455f4742246c679cc0f46036ef4685bc') + version('1.7', sha256='865ce1b422bc83109cb4a63dcff8fd1077eea3617e668faf6a043208d8be03ca') + version('1.6', sha256='3b99e6c30709326a94d2e73a9247a8dfb58d0a394c5b7714e5c3d8a3ad2e2e9f') + version('1.5', sha256='6b069d7207febeb62440e89245e8b18fcdf40b6170d2ec2ef33c252ed16db2d4') variant('ndctl', default=False, description='Build components requiring ndctl') variant('doc', default=False, description='Build documentation') diff --git a/var/spack/repos/builtin/packages/poppler/package.py b/var/spack/repos/builtin/packages/poppler/package.py index 6123ff06a11..a3004b2725b 100644 --- a/var/spack/repos/builtin/packages/poppler/package.py +++ b/var/spack/repos/builtin/packages/poppler/package.py @@ -10,11 +10,12 @@ class Poppler(CMakePackage): """Poppler is a PDF rendering library based on the xpdf-3.0 code base.""" homepage = "https://poppler.freedesktop.org" - url = "https://poppler.freedesktop.org/poppler-0.77.0.tar.xz" + url = "https://poppler.freedesktop.org/poppler-21.07.0.tar.xz" list_url = "https://poppler.freedesktop.org/releases.html" git = "https://gitlab.freedesktop.org/poppler/poppler.git" version('master', branch='master') + version('21.07.0', sha256='e26ab29f68065de4d6562f0a3e2b5435a83ca92be573b99a1c81998fa286a4d4') version('0.90.1', sha256='984d82e72e91418d280885298c8bdc855a2fd92665fd52a1345b27235e0c71c4') version('0.87.0', sha256='6f602b9c24c2d05780be93e7306201012e41459f289b8279a27a79431ad4150e') version('0.79.0', sha256='f985a4608fe592d2546d9d37d4182e502ff6b4c42f8db4be0a021a1c369528c8') @@ -24,6 +25,7 @@ class Poppler(CMakePackage): version('0.64.0', sha256='b21df92ca99f78067785cf2dc8e06deb04726b62389c0ee1f5d8b103c77f64b1') version('0.61.1', sha256='1266096343f5163c1a585124e9a6d44474e1345de5cdfe55dc7b47357bcfcda9') + variant('boost', default=False, description='Enable Boost for Splash') variant('cms', default=False, description='Use color management system') variant('cpp', default=False, description='Compile poppler cpp wrapper') variant('glib', default=False, description='Compile poppler glib wrapper') @@ -43,6 +45,7 @@ class Poppler(CMakePackage): depends_on('fontconfig') depends_on('freetype') + depends_on('boost@1.58.0:', when='+boost') depends_on('lcms', when='+cms') depends_on('glib@2.41:', when='+glib') depends_on('gobject-introspection', when='+gobject') @@ -63,7 +66,7 @@ class Poppler(CMakePackage): # a small section of code in the QT5 wrappers that expects it # to be present. patch('poppler_page_splash.patch', when='@0.64.0:0.90.0 ^qt@5.0:') - patch('poppler_page_splash.0.90.1.patch', when='@0.90.1: ^qt@5.0:') + patch('poppler_page_splash.0.90.1.patch', when='@0.90.1:21.06 ^qt@5.0:') # Only needed to run `make test` resource( @@ -86,6 +89,11 @@ def cmake_args(self): # Install header files args.append('-DENABLE_UNSTABLE_API_ABI_HEADERS=ON') + if '+boost' in spec: + args.append('-DENABLE_BOOST=ON') + else: + args.append('-DENABLE_BOOST=OFF') + if '+cms' in spec: args.append('-DENABLE_CMS=lcms2') else: diff --git a/var/spack/repos/builtin/packages/proj/package.py b/var/spack/repos/builtin/packages/proj/package.py index a0a8f336c4b..9bf97455479 100644 --- a/var/spack/repos/builtin/packages/proj/package.py +++ b/var/spack/repos/builtin/packages/proj/package.py @@ -20,6 +20,9 @@ class Proj(AutotoolsPackage): # Version 6 removes projects.h, while version 7 removes proj_api.h. # Many packages that depend on proj do not yet support the newer API. # See https://github.com/OSGeo/PROJ/wiki/proj.h-adoption-status + version('8.1.0', sha256='22c5cdc5aa0832077b16c95ebeec748a0942811c1c3438c33d43c8d2ead59f48') + version('8.0.1', sha256='e0463a8068898785ca75dd49a261d3d28b07d0a88f3b657e8e0089e16a0375fa') + version('8.0.0', sha256='aa5d4b934450149a350aed7e5fbac880e2f7d3fa2f251c26cb64228f96a2109e') version('7.2.1', sha256='b384f42e5fb9c6d01fe5fa4d31da2e91329668863a684f97be5d4760dbbf0a14') version('7.2.0', sha256='2957798e5fe295ff96a2af1889d0428e486363d210889422f76dd744f7885763') version('7.1.0', sha256='876151e2279346f6bdbc63bd59790b48733496a957bccd5e51b640fdd26eaa8d') @@ -104,3 +107,17 @@ def configure_args(self): args.append('--without-curl') return args + + def setup_run_environment(self, env): + # PROJ_LIB doesn't need to be set. However, it may be set by conda. + # If an incompatible version of PROJ is found in PROJ_LIB, it can + # cause the package to fail at run-time. See the following for details: + # * https://proj.org/usage/environmentvars.html + # * https://rasterio.readthedocs.io/en/latest/faq.html + env.set('PROJ_LIB', self.prefix.share.proj) + + def setup_dependent_build_environment(self, env, dependent_spec): + self.setup_run_environment(env) + + def setup_dependent_run_environment(self, env, dependent_spec): + self.setup_run_environment(env) diff --git a/var/spack/repos/builtin/packages/protobuf/package.py b/var/spack/repos/builtin/packages/protobuf/package.py index ab3c8591a13..7c1c0763d84 100644 --- a/var/spack/repos/builtin/packages/protobuf/package.py +++ b/var/spack/repos/builtin/packages/protobuf/package.py @@ -13,8 +13,20 @@ class Protobuf(Package): """Google's data interchange format.""" homepage = "https://developers.google.com/protocol-buffers" - url = "https://github.com/protocolbuffers/protobuf/archive/v3.12.2.tar.gz" + url = "https://github.com/protocolbuffers/protobuf/archive/v3.17.3.tar.gz" + version('3.17.3', sha256='c6003e1d2e7fefa78a3039f19f383b4f3a61e81be8c19356f85b6461998ad3db') + version('3.17.0', sha256='eaba1dd133ac5167e8b08bc3268b2d33c6e9f2dcb14ec0f97f3d3eed9b395863') + version('3.16.0', sha256='7892a35d979304a404400a101c46ce90e85ec9e2a766a86041bb361f626247f5') + version('3.15.7', sha256='efdd6b932a2c0a88a90c4c80f88e4b2e1bf031e7514dbb5a5db5d0bf4f295504') + version('3.15.5', sha256='bc3dbf1f09dba1b2eb3f2f70352ee97b9049066c9040ce0c9b67fb3294e91e4b') + version('3.15.4', sha256='07f8a02afc14a657f727ed89a8ec5627b9ecc47116d60acaabaa1da233bd2e8f') + version('3.15.2', sha256='3c85fdac243dab1f6cd725eb58e361cdbb3ec4480052ac90b1ab55c608112cd0') + version('3.15.1', sha256='f18a40816260a9a3190a94efb0fc26270b244a2436681602f0a944739095d632') + version('3.15.0', sha256='6aff9834fd7c540875e1836967c8d14c6897e3785a2efac629f69860fb7834ff') + version('3.14.0', sha256='d0f5f605d0d656007ce6c8b5a82df3037e1d8fe8b121ed42e536f569dec16113') + version('3.13.0', sha256='9b4ee22c250fe31b16f1a24d61467e40780a3fbb9b91c3b65be2a376ed913a1a') + version('3.12.3', sha256='71030a04aedf9f612d2991c1c552317038c3c5a2b578ac4745267a45e7037c29') version('3.12.2', sha256='bb8ce9ba11eb7bccf080599fe7cad9cc461751c8dd1ba61701c0070d58cde973') version('3.12.1', sha256='cb9b3f9d625b5739a358268eb3421de11cacd90025f5f7672c3930553eca810e') version('3.12.0', sha256='946ba5371e423e1220d2cbefc1f65e69a1e81ca5bab62a03d66894172983cfcd') diff --git a/var/spack/repos/builtin/packages/pthreadpool/package.py b/var/spack/repos/builtin/packages/pthreadpool/package.py index b884dc96cbc..a2e7756065d 100644 --- a/var/spack/repos/builtin/packages/pthreadpool/package.py +++ b/var/spack/repos/builtin/packages/pthreadpool/package.py @@ -50,6 +50,7 @@ class Pthreadpool(CMakePackage): def cmake_args(self): return [ + self.define('BUILD_SHARED_LIBS', True), self.define('FXDIV_SOURCE_DIR', join_path(self.stage.source_path, 'deps', 'fxdiv')), self.define('GOOGLETEST_SOURCE_DIR', diff --git a/var/spack/repos/builtin/packages/pvm/package.py b/var/spack/repos/builtin/packages/pvm/package.py index 75b61871c80..fe740619225 100644 --- a/var/spack/repos/builtin/packages/pvm/package.py +++ b/var/spack/repos/builtin/packages/pvm/package.py @@ -21,6 +21,9 @@ class Pvm(MakefilePackage): depends_on('m4', type='build') depends_on('libtirpc', type='link') + variant('fpic', default=False, + description='Enables -fPIC compilation flag on static libraries.') + parallel = False @property @@ -34,6 +37,17 @@ def edit(self, spec, prefix): # variable "PVM_ROOT" to the path where PVM resides env['PVM_ROOT'] = self.stage.source_path + def patch(self): + + pvm_arch = self.pvm_arch + + if '+fpic' in self.spec: + filter_file( + '^SHAREDCFLAGS =', + 'SHAREDCFLAGS = -fPIC', + join_path('conf', pvm_arch + '.def') + ) + def setup_build_environment(self, env): tirpc = self.spec['libtirpc'].prefix env.prepend_path( diff --git a/var/spack/repos/builtin/packages/py-absl-py/package.py b/var/spack/repos/builtin/packages/py-absl-py/package.py index 80692b16357..bf7fbb8c578 100644 --- a/var/spack/repos/builtin/packages/py-absl-py/package.py +++ b/var/spack/repos/builtin/packages/py-absl-py/package.py @@ -16,6 +16,9 @@ class PyAbslPy(PythonPackage): pypi = "absl-py/absl-py-0.7.0.tar.gz" + version('0.13.0', sha256='6953272383486044699fd0e9f00aad167a27e08ce19aae66c6c4b10e7e767793') + version('0.12.0', sha256='b44f68984a5ceb2607d135a615999b93924c771238a63920d17d3387b0d229d5') + version('0.11.0', sha256='673cccb88d810e5627d0c1c818158485d106f65a583880e2f730c997399bcfa7') version('0.10.0', sha256='b20f504a7871a580be5268a18fbad48af4203df5d33dbc9272426cb806245a45') version('0.7.1', sha256='b943d1c567743ed0455878fcd60bc28ac9fae38d129d1ccfad58079da00b8951') version('0.7.0', sha256='8718189e4bd6013bf79910b9d1cb0a76aecad8ce664f78e1144980fabdd2cd23') diff --git a/var/spack/repos/builtin/packages/py-aniso8601/package.py b/var/spack/repos/builtin/packages/py-aniso8601/package.py new file mode 100644 index 00000000000..e94e71d9789 --- /dev/null +++ b/var/spack/repos/builtin/packages/py-aniso8601/package.py @@ -0,0 +1,17 @@ +# Copyright 2013-2021 Lawrence Livermore National Security, LLC and other +# Spack Project Developers. See the top-level COPYRIGHT file for details. +# +# SPDX-License-Identifier: (Apache-2.0 OR MIT) + +from spack import * + + +class PyAniso8601(PythonPackage): + """A library for parsing ISO 8601 strings.""" + + homepage = "https://bitbucket.org/nielsenb/aniso8601" + pypi = "aniso8601/aniso8601-9.0.1.tar.gz" + + version('9.0.1', sha256='72e3117667eedf66951bb2d93f4296a56b94b078a8a95905a052611fb3f1b973') + + depends_on('py-setuptools', type='build') diff --git a/var/spack/repos/builtin/packages/py-annexremote/package.py b/var/spack/repos/builtin/packages/py-annexremote/package.py new file mode 100644 index 00000000000..8187b70fdc7 --- /dev/null +++ b/var/spack/repos/builtin/packages/py-annexremote/package.py @@ -0,0 +1,18 @@ +# Copyright 2013-2021 Lawrence Livermore National Security, LLC and other +# Spack Project Developers. See the top-level COPYRIGHT file for details. +# +# SPDX-License-Identifier: (Apache-2.0 OR MIT) + +from spack import * + + +class PyAnnexremote(PythonPackage): + """git annex special remotes made easy.""" + + homepage = "https://github.com/Lykos153/AnnexRemote" + pypi = "annexremote/annexremote-1.5.0.tar.gz" + + version('1.5.0', sha256='92f32b6f5461cbaeefe0c60b32f9c1e0c1dbe4e57b8ee425affb56f4060f64ef') + + depends_on('py-setuptools', type='build') + depends_on('py-future', type=('build', 'run')) diff --git a/var/spack/repos/builtin/packages/py-antlr4-python3-runtime/package.py b/var/spack/repos/builtin/packages/py-antlr4-python3-runtime/package.py index 0689270ff15..c25210e03bb 100644 --- a/var/spack/repos/builtin/packages/py-antlr4-python3-runtime/package.py +++ b/var/spack/repos/builtin/packages/py-antlr4-python3-runtime/package.py @@ -15,7 +15,9 @@ class PyAntlr4Python3Runtime(PythonPackage): homepage = "https://www.antlr.org" pypi = "antlr4-python3-runtime/antlr4-python3-runtime-4.7.2.tar.gz" + version('4.8', sha256='15793f5d0512a372b4e7d2284058ad32ce7dd27126b105fb0b2245130445db33') version('4.7.2', sha256='168cdcec8fb9152e84a87ca6fd261b3d54c8f6358f42ab3b813b14a7193bb50b') depends_on('python@3:', type=('build', 'run')) depends_on('py-setuptools', type='build') + depends_on('py-typing', when='^python@:3.4', type=('build', 'run')) diff --git a/var/spack/repos/builtin/packages/py-anyio/package.py b/var/spack/repos/builtin/packages/py-anyio/package.py new file mode 100644 index 00000000000..c7838e82287 --- /dev/null +++ b/var/spack/repos/builtin/packages/py-anyio/package.py @@ -0,0 +1,25 @@ +# Copyright 2013-2021 Lawrence Livermore National Security, LLC and other +# Spack Project Developers. See the top-level COPYRIGHT file for details. +# +# SPDX-License-Identifier: (Apache-2.0 OR MIT) + +from spack import * + + +class PyAnyio(PythonPackage): + """High level compatibility layer for multiple asynchronous event loop + implementations.""" + + homepage = "https://github.com/agronholm/anyio" + pypi = "anyio/anyio-3.2.1.tar.gz" + + version('3.2.1', sha256='07968db9fa7c1ca5435a133dc62f988d84ef78e1d9b22814a59d1c62618afbc5') + + depends_on('python@3.6.2:', type=('build', 'run')) + depends_on('py-setuptools@42:', type='build') + depends_on('py-setuptools-scm+toml@3.4:', type='build') + depends_on('py-async-generator', when='^python@:3.6.999', type=('build', 'run')) + depends_on('py-dataclasses', when='^python@:3.6.999', type=('build', 'run')) + depends_on('py-idna@2.8:', type=('build', 'run')) + depends_on('py-sniffio@1.1:', type=('build', 'run')) + depends_on('py-typing-extensions', when='^python@:3.7.999', type=('build', 'run')) diff --git a/var/spack/repos/builtin/packages/py-awkward/package.py b/var/spack/repos/builtin/packages/py-awkward/package.py index 309d74dfb33..7d8b0cfa03f 100644 --- a/var/spack/repos/builtin/packages/py-awkward/package.py +++ b/var/spack/repos/builtin/packages/py-awkward/package.py @@ -15,6 +15,8 @@ class PyAwkward(PythonPackage): maintainers = ['vvolkl'] + version('1.4.0', sha256='25ae6114d5962c717cb87e3bc30a2f6eaa232b252cf8c51ba805b8f04664ae0d') + version('1.3.0', sha256='b6021694adec9813842bad1987b837e439dabaf5b0dff9041201d238fca71fb4') version('1.2.3', sha256='7d727542927a926f488fa62d04e2c5728c72660f17f822e627f349285f295063') version('1.2.2', sha256='89f126a072d3a6eee091e1afeed87e0b2ed3c34ed31a1814062174de3cab8d9b') version('1.1.2', sha256='4ae8371d9e6d5bd3e90f3686b433cebc0541c88072655d2c75ec58e79b5d6943') @@ -24,7 +26,7 @@ class PyAwkward(PythonPackage): depends_on('py-setuptools', type='build') - depends_on('python@3.6:', type=('build', 'run')) + depends_on('python@2.7:2.8,3.5:', type=('build', 'run')) depends_on('py-numpy@1.13.1:', type=('build', 'run')) depends_on('py-pybind11', type=('build', 'link')) depends_on('dlpack', when="@1.0.0:") diff --git a/var/spack/repos/builtin/packages/py-bandit/package.py b/var/spack/repos/builtin/packages/py-bandit/package.py new file mode 100644 index 00000000000..f7408ec2802 --- /dev/null +++ b/var/spack/repos/builtin/packages/py-bandit/package.py @@ -0,0 +1,23 @@ +# Copyright 2013-2021 Lawrence Livermore National Security, LLC and other +# Spack Project Developers. See the top-level COPYRIGHT file for details. +# +# SPDX-License-Identifier: (Apache-2.0 OR MIT) + +from spack import * + + +class PyBandit(PythonPackage): + """Security oriented static analyser for python code.""" + + homepage = "https://bandit.readthedocs.io/en/latest/" + pypi = "bandit/bandit-1.7.0.tar.gz" + + version('1.7.0', sha256='8a4c7415254d75df8ff3c3b15cfe9042ecee628a1e40b44c15a98890fbfc2608') + + depends_on('python@3.5:', type=('build', 'run')) + depends_on('py-pbr@2.0.0:', type='build') + depends_on('py-gitpython@1.0.1:', type=('build', 'run')) + depends_on('py-pyyaml@5.3.1:', type=('build', 'run')) + depends_on('py-six@1.10.0:', type=('build', 'run')) + depends_on('py-stevedore@1.20.0:', type=('build', 'run')) + depends_on('py-colorama@0.3.9:', when='platform=win32', type=('build', 'run')) diff --git a/var/spack/repos/builtin/packages/py-beautifulsoup4/package.py b/var/spack/repos/builtin/packages/py-beautifulsoup4/package.py index db9b938ae09..ac89f255f53 100644 --- a/var/spack/repos/builtin/packages/py-beautifulsoup4/package.py +++ b/var/spack/repos/builtin/packages/py-beautifulsoup4/package.py @@ -14,10 +14,19 @@ class PyBeautifulsoup4(PythonPackage): homepage = "https://www.crummy.com/software/BeautifulSoup" pypi = "beautifulsoup4/beautifulsoup4-4.8.0.tar.gz" + version('4.9.3', sha256='84729e322ad1d5b4d25f805bfa05b902dd96450f43842c4e99067d5e1369eb25') version('4.8.0', sha256='25288c9e176f354bf277c0a10aa96c782a6a18a17122dba2e8cec4a97e03343b') version('4.5.3', sha256='b21ca09366fa596043578fd4188b052b46634d22059e68dd0077d9ee77e08a3e') version('4.5.1', sha256='3c9474036afda9136aac6463def733f81017bf9ef3510d25634f335b0c87f5e1') version('4.4.1', sha256='87d4013d0625d4789a4f56b8d79a04d5ce6db1152bb65f1d39744f7709a366b4') + variant('lxml', default=False, description='Enable lxml parser') + variant('html5lib', default=False, description='Enable html5lib parser') + depends_on('py-setuptools', type='build') + depends_on('py-soupsieve@1.3:', when='@4.9.0: ^python@3:', type=('build', 'run')) + depends_on('py-soupsieve@1.3:1.99', when='@4.9.0: ^python@:2.8', type=('build', 'run')) depends_on('py-soupsieve@1.2:', when='@4.7.0:', type=('build', 'run')) + + depends_on('py-lxml', when='+lxml', type=('build', 'run')) + depends_on('py-html5lib', when='+html5lib', type=('build', 'run')) diff --git a/var/spack/repos/builtin/packages/py-beniget/package.py b/var/spack/repos/builtin/packages/py-beniget/package.py index aed35762a3d..a9a58e5ca0d 100644 --- a/var/spack/repos/builtin/packages/py-beniget/package.py +++ b/var/spack/repos/builtin/packages/py-beniget/package.py @@ -12,8 +12,12 @@ class PyBeniget(PythonPackage): homepage = "https://github.com/serge-sans-paille/beniget/" pypi = "beniget/beniget-0.3.0.tar.gz" + version('0.4.0', sha256='72bbd47b1ae93690f5fb2ad3902ce1ae61dcd868ce6cfbf33e9bad71f9ed8749') version('0.3.0', sha256='062c893be9cdf87c3144fb15041cce4d81c67107c1591952cd45fdce789a0ff1') + version('0.2.3', sha256='350422b0598c92fcc5f8bcaf77f2a62f6744fb8f2fb495b10a50176c1283639f') depends_on('python@2.7:2.8,3.4:', type=('build', 'run')) depends_on('py-setuptools', type='build') - depends_on('py-gast@0.4.0:0.4.999', type=('build', 'run')) + depends_on('py-gast@0.5.0:0.5.999', when='@0.4.0:', type=('build', 'run')) + depends_on('py-gast@0.4.0:0.4.999', when='@0.3.0:0.3.999', type=('build', 'run')) + depends_on('py-gast@0.3.3:0.3.999', when='@:0.2.999', type=('build', 'run')) diff --git a/var/spack/repos/builtin/packages/py-bids-validator/package.py b/var/spack/repos/builtin/packages/py-bids-validator/package.py new file mode 100644 index 00000000000..6d388424b16 --- /dev/null +++ b/var/spack/repos/builtin/packages/py-bids-validator/package.py @@ -0,0 +1,17 @@ +# Copyright 2013-2021 Lawrence Livermore National Security, LLC and other +# Spack Project Developers. See the top-level COPYRIGHT file for details. +# +# SPDX-License-Identifier: (Apache-2.0 OR MIT) + +from spack import * + + +class PyBidsValidator(PythonPackage): + """Validator for the Brain Imaging Data Structure""" + + homepage = "https://github.com/bids-standard/bids-validator" + pypi = "bids-validator/bids-validator-1.7.2.tar.gz" + + version('1.7.2', sha256='12398831a3a3a2ed7c67e693cf596610c23dd23e0889bfeae0830bbd1d41e5b9') + + depends_on('py-setuptools', type='build') diff --git a/var/spack/repos/builtin/packages/py-citeproc-py/package.py b/var/spack/repos/builtin/packages/py-citeproc-py/package.py new file mode 100644 index 00000000000..af5311cf4bc --- /dev/null +++ b/var/spack/repos/builtin/packages/py-citeproc-py/package.py @@ -0,0 +1,20 @@ +# Copyright 2013-2021 Lawrence Livermore National Security, LLC and other +# Spack Project Developers. See the top-level COPYRIGHT file for details. +# +# SPDX-License-Identifier: (Apache-2.0 OR MIT) + +from spack import * + + +class PyCiteprocPy(PythonPackage): + """Citations and bibliography formatter.""" + + homepage = "https://github.com/brechtm/citeproc-py" + pypi = "citeproc-py/citeproc-py-0.6.0.tar.gz" + + version('0.6.0', sha256='d9e3a224f936fe2e5033b5d9ffdacab769cedb61d96c4e0cf2f0b488f1d24b4e') + + depends_on('python@3.6:', type=('build', 'run')) + depends_on('py-setuptools', type='build') + depends_on('py-rnc2rng@2.6.1,2.6.3:', type='build') + depends_on('py-lxml', type=('build', 'run')) diff --git a/var/spack/repos/builtin/packages/py-cryptography/package.py b/var/spack/repos/builtin/packages/py-cryptography/package.py index ccd240519a3..5c80b4aa342 100644 --- a/var/spack/repos/builtin/packages/py-cryptography/package.py +++ b/var/spack/repos/builtin/packages/py-cryptography/package.py @@ -14,24 +14,31 @@ class PyCryptography(PythonPackage): homepage = "https://github.com/pyca/cryptography" pypi = "cryptography/cryptography-1.8.1.tar.gz" + version('3.4.7', sha256='3d10de8116d25649631977cb37da6cbdd2d6fa0e0281d014a5b7d337255ca713') version('2.7', sha256='e6347742ac8f35ded4a46ff835c60e68c22a536a8ae5c4422966d06946b6d4c6') version('2.3.1', sha256='8d10113ca826a4c29d5b85b2c4e045ffa8bad74fb525ee0eceb1d38d4c70dfd6') version('1.8.1', sha256='323524312bb467565ebca7e50c8ae5e9674e544951d28a2904a50012a8828190') variant('idna', default=False, description='Deprecated U-label support') - conflicts('+idna', when='@:2.4') + conflicts('+idna', when='@:2.4,3.1:') # dependencies taken from https://github.com/pyca/cryptography/blob/master/setup.py - depends_on('python@2.6:2.8,3.4:', type=('build', 'run')) + depends_on('python@3.6:', when='@3.4:', type=('build', 'run')) depends_on('python@2.7:2.8,3.4:', when='@2.3.1:', type=('build', 'run')) + depends_on('python@2.6:2.8,3.4:', type=('build', 'run')) - depends_on('py-setuptools@20.5:', type='build') + depends_on('py-setuptools@40.6:', when='@2.7:', type='build') + depends_on('py-setuptools@18.5:', when='@2.2:2.6', type='build') + depends_on('py-setuptools@11.3:', when='@:2.1', type='build') + depends_on('py-setuptools-rust@0.11.4:', when='@3.4:', type=('build', 'run')) - depends_on('py-cffi@1.4.1:', type=('build', 'run')) - depends_on('py-cffi@1.8:1.11.2,1.11.4:', type=('build', 'run'), when='@2.7:') + depends_on('py-cffi@1.12:', when='@3.3:', type=('build', 'run')) + depends_on('py-cffi@1.8:1.11.2,1.11.4:', when='@2.5:3.2', type=('build', 'run')) + depends_on('py-cffi@1.7:1.11.2,1.11.4:', when='@1.9:2.4.2', type=('build', 'run')) + depends_on('py-cffi@1.4.1:', type=('build', 'run')) - depends_on('py-asn1crypto@0.21.0:', type=('build', 'run')) - depends_on('py-six@1.4.1:', type=('build', 'run')) + depends_on('py-asn1crypto@0.21.0:', type=('build', 'run'), when='@:2.7') + depends_on('py-six@1.4.1:', type=('build', 'run'), when='@:3.3') depends_on('py-idna@2.1:', type=('build', 'run'), when='@:2.4') # deprecated depends_on('py-idna@2.1:', type=('build', 'run'), when='@2.5: +idna') # deprecated depends_on('py-enum34', type=('build', 'run'), when='^python@:3.4') diff --git a/var/spack/repos/builtin/packages/py-cython/package.py b/var/spack/repos/builtin/packages/py-cython/package.py index 98c3242feca..834087f5399 100644 --- a/var/spack/repos/builtin/packages/py-cython/package.py +++ b/var/spack/repos/builtin/packages/py-cython/package.py @@ -11,6 +11,7 @@ class PyCython(PythonPackage): pypi = "cython/Cython-0.29.21.tar.gz" + version('0.29.23', sha256='6a0d31452f0245daacb14c979c77e093eb1a546c760816b5eed0047686baad8e') version('0.29.22', sha256='df6b83c7a6d1d967ea89a2903e4a931377634a297459652e4551734c48195406') version('0.29.21', sha256='e57acb89bd55943c8d8bf813763d20b9099cc7165c0f16b707631a7654be9cad') version('0.29.20', sha256='22d91af5fc2253f717a1b80b8bb45acb655f643611983fd6f782b9423f8171c7') diff --git a/var/spack/repos/builtin/packages/py-dask/package.py b/var/spack/repos/builtin/packages/py-dask/package.py index 20900d20c31..4358b7c2580 100644 --- a/var/spack/repos/builtin/packages/py-dask/package.py +++ b/var/spack/repos/builtin/packages/py-dask/package.py @@ -14,6 +14,7 @@ class PyDask(PythonPackage): maintainers = ['skosukhin'] + version('2021.6.2', sha256='8588fcd1a42224b7cfcd2ebc8ad616734abb6b1a4517efd52d89c7dd66eb91f8') version('2020.12.0', sha256='43e745afd4b464e6c0113131e430a16dce6ac42460b06e24d799093d098f7ab0') version('2.16.0', sha256='2af5b0dcd48ce679ce0321cf91de623f4fe376262789b951fefa3c334002f350') version('1.2.2', sha256='5e7876bae2a01b355d1969b73aeafa23310febd8c353163910b73e93dc7e492c') @@ -30,57 +31,75 @@ class PyDask(PythonPackage): variant('delayed', default=True, description='Install requirements for dask.delayed (dask.imperative)') variant('yaml', default=True, description='Ensure support for YAML configuration files') + conflicts('~bag', when='@2021.3.1:') conflicts('+distributed', when='@:0.4.0,0.7.6:0.8.1') conflicts('+diagnostics', when='@:0.5.0') + conflicts('~delayed', when='@2021.3.1:') conflicts('+yaml', when='@:0.17.5') conflicts('~yaml', when='@2.17.1:') depends_on('python@2.7:2.8,3.5:', type=('build', 'run')) depends_on('python@3.5:', type=('build', 'run'), when='@2.0.0:') depends_on('python@3.6:', type=('build', 'run'), when='@2.7.0:') + depends_on('python@3.7:', type=('build', 'run'), when='@2021.3.1:') depends_on('py-setuptools', type='build') + # Common requirements + depends_on('py-pyyaml', type=('build', 'run'), when='@2.17.1:') + depends_on('py-cloudpickle@1.1.1:', type=('build', 'run'), when='@2021.3.1:') + depends_on('py-fsspec@0.6.0:', type=('build', 'run'), when='@2021.3.1:') + depends_on('py-toolz@0.8.2:', type=('build', 'run'), when='@2021.3.1:') + depends_on('py-partd@0.3.10:', type=('build', 'run'), when='@2021.3.1:') + # Requirements for dask.array - depends_on('py-numpy@1.10.4:', type=('build', 'run'), when='+array') + depends_on('py-numpy', type=('build', 'run'), when='@:0.17.1 +array') + depends_on('py-numpy@1.10.4:', type=('build', 'run'), when='@0.17.2: +array') depends_on('py-numpy@1.11.0:', type=('build', 'run'), when='@0.17.3: +array') depends_on('py-numpy@1.13.0:', type=('build', 'run'), when='@1.2.1: +array') depends_on('py-numpy@1.15.1:', type=('build', 'run'), when='@2020.12.0: +array') + depends_on('py-numpy@1.16.0:', type=('build', 'run'), when='@2021.3.1: +array') - depends_on('py-toolz', type=('build', 'run'), when='+array') + depends_on('py-toolz', type=('build', 'run'), when='@:0.6.1 +array') depends_on('py-toolz@0.7.2:', type=('build', 'run'), when='@0.7.0: +array') depends_on('py-toolz@0.7.3:', type=('build', 'run'), when='@0.14.1: +array') - depends_on('py-toolz@0.8.2:', type=('build', 'run'), when='@2.13.0: +array') + # The dependency on py-toolz is non-optional starting version 2021.3.1 + depends_on('py-toolz@0.8.2:', type=('build', 'run'), when='@2.13.0:2021.3.0 +array') # Requirements for dask.bag depends_on('py-dill', type=('build', 'run'), when='@:0.7.5 +bag') depends_on('py-cloudpickle', type=('build', 'run'), when='@0.7.6: +bag') depends_on('py-cloudpickle@0.2.1:', type=('build', 'run'), when='@0.8.2: +bag') - depends_on('py-cloudpickle@0.2.2:', type=('build', 'run'), when='@2.13.0: +bag') + # The dependency on py-cloudpickle is non-optional starting version 2021.3.1 + depends_on('py-cloudpickle@0.2.2:', type=('build', 'run'), when='@2.13.0:2021.3.0 +bag') depends_on('py-fsspec@0.3.3:', type=('build', 'run'), when='@2.2.0: +bag') depends_on('py-fsspec@0.5.1:', type=('build', 'run'), when='@2.5.0: +bag') - depends_on('py-fsspec@0.6.0:', type=('build', 'run'), when='@2.8.0: +bag') + # The dependency on py-fsspec is non-optional starting version 2021.3.1 + depends_on('py-fsspec@0.6.0:', type=('build', 'run'), when='@2.8.0:2021.3.0 +bag') - depends_on('py-toolz', type=('build', 'run'), when='+bag') + depends_on('py-toolz', type=('build', 'run'), when='@:0.6.1 +bag') depends_on('py-toolz@0.7.2:', type=('build', 'run'), when='@0.7.0: +bag') depends_on('py-toolz@0.7.3:', type=('build', 'run'), when='@0.14.1: +bag') - depends_on('py-toolz@0.8.2:', type=('build', 'run'), when='@2.13.0: +bag') + # The dependency on py-toolz is non-optional starting version 2021.3.1 + depends_on('py-toolz@0.8.2:', type=('build', 'run'), when='@2.13.0:2021.3.0 +bag') - depends_on('py-partd', type=('build', 'run'), when='+bag') depends_on('py-partd@0.3.2:', type=('build', 'run'), when='@0.6.0: +bag') depends_on('py-partd@0.3.3:', type=('build', 'run'), when='@0.9.0: +bag') depends_on('py-partd@0.3.5:', type=('build', 'run'), when='@0.10.2: +bag') depends_on('py-partd@0.3.6:', type=('build', 'run'), when='@0.12.0: +bag') depends_on('py-partd@0.3.7:', type=('build', 'run'), when='@0.13.0: +bag') depends_on('py-partd@0.3.8:', type=('build', 'run'), when='@0.15.0: +bag') - depends_on('py-partd@0.3.10:', type=('build', 'run'), when='@2.0.0: +bag') + # The dependency on py-partd is non-optional starting version 2021.3.1 + depends_on('py-partd@0.3.10:', type=('build', 'run'), when='@2.0.0:2021.3.0 +bag') # Requirements for dask.dataframe - depends_on('py-numpy@1.10.4:', type=('build', 'run'), when='+dataframe') + depends_on('py-numpy', type=('build', 'run'), when='@:0.17.1 +dataframe') + depends_on('py-numpy@1.10.4:', type=('build', 'run'), when='@0.17.2: +dataframe') depends_on('py-numpy@1.11.0:', type=('build', 'run'), when='@0.17.3: +dataframe') depends_on('py-numpy@1.13.0:', type=('build', 'run'), when='@1.2.1: +dataframe') depends_on('py-numpy@1.15.1:', type=('build', 'run'), when='@2020.12.0: +dataframe') + depends_on('py-numpy@1.16.0:', type=('build', 'run'), when='@2021.3.1: +dataframe') depends_on('py-pandas@0.16.0:', type=('build', 'run'), when='+dataframe') depends_on('py-pandas@0.18.0:', type=('build', 'run'), when='@0.9.0: +dataframe') @@ -89,24 +108,27 @@ class PyDask(PythonPackage): depends_on('py-pandas@0.23.0:', type=('build', 'run'), when='@2.11.0: +dataframe') depends_on('py-pandas@0.25.0:', type=('build', 'run'), when='@2020.12.0: +dataframe') - depends_on('py-toolz', type=('build', 'run'), when='+dataframe') + depends_on('py-toolz', type=('build', 'run'), when='@:0.6.1 +dataframe') depends_on('py-toolz@0.7.2:', type=('build', 'run'), when='@0.7.0: +dataframe') depends_on('py-toolz@0.7.3:', type=('build', 'run'), when='@0.14.1: +dataframe') - depends_on('py-toolz@0.8.2:', type=('build', 'run'), when='@2.13.0: +dataframe') + # The dependency on py-toolz is non-optional starting version 2021.3.1 + depends_on('py-toolz@0.8.2:', type=('build', 'run'), when='@2.13.0:2021.3.0 +dataframe') - depends_on('py-partd', type=('build', 'run'), when='+dataframe') depends_on('py-partd@0.3.2:', type=('build', 'run'), when='@0.6.0: +dataframe') depends_on('py-partd@0.3.3:', type=('build', 'run'), when='@0.9.0: +dataframe') depends_on('py-partd@0.3.5:', type=('build', 'run'), when='@0.10.2: +dataframe') depends_on('py-partd@0.3.7:', type=('build', 'run'), when='@0.13.0: +dataframe') depends_on('py-partd@0.3.8:', type=('build', 'run'), when='@0.15.0: +dataframe') depends_on('py-partd@0.3.10:', type=('build', 'run'), when='@2.0.0: +dataframe') + # The dependency on py-partd is non-optional starting version 2021.3.1 + depends_on('py-partd@0.3.10:', type=('build', 'run'), when='@2.0.0:2021.3.0 +dataframe') depends_on('py-cloudpickle@0.2.1:', type=('build', 'run'), when='@0.8.2:2.6.0 +dataframe') depends_on('py-fsspec@0.3.3:', type=('build', 'run'), when='@2.2.0: +dataframe') depends_on('py-fsspec@0.5.1:', type=('build', 'run'), when='@2.5.0: +dataframe') - depends_on('py-fsspec@0.6.0:', type=('build', 'run'), when='@2.8.0: +dataframe') + # The dependency on py-fsspec is non-optional starting version 2021.3.1 + depends_on('py-fsspec@0.6.0:', type=('build', 'run'), when='@2.8.0:2021.3.0 +dataframe') # Requirements for dask.distributed depends_on('py-dill', type=('build', 'run'), when='@:0.7.5 +distributed') @@ -121,22 +143,26 @@ class PyDask(PythonPackage): depends_on('py-distributed@1.21:', type=('build', 'run'), when='@0.17.0: +distributed') depends_on('py-distributed@1.22:', type=('build', 'run'), when='@0.18.0: +distributed') depends_on('py-distributed@2.0:', type=('build', 'run'), when='@2.0.0: +distributed') + depends_on('py-distributed@2020.12.0:', type=('build', 'run'), when='@2020.12.0: +distributed') + depends_on('py-distributed@2021.6.2:', type=('build', 'run'), when='@2021.6.2: +distributed') # Requirements for dask.diagnostics - depends_on('py-bokeh', type=('build', 'run'), when='+diagnostics') depends_on('py-bokeh@1.0.0:', type=('build', 'run'), when='@2.0.0: +diagnostics') depends_on('py-bokeh@1.0.0:1.999,2.0.1:', type=('build', 'run'), when='@2.26.0: +diagnostics') # Requirements for dask.delayed - depends_on('py-cloudpickle@0.2.1:', type=('build', 'run'), when='@2,7.0: +delayed') - depends_on('py-cloudpickle@0.2.2:', type=('build', 'run'), when='@2.13.0: +delayed') + depends_on('py-cloudpickle@0.2.1:', type=('build', 'run'), when='@2.7.0: +delayed') + # The dependency on py-cloudpickle is non-optional starting version 2021.3.1 + depends_on('py-cloudpickle@0.2.2:', type=('build', 'run'), when='@2.13.0:2021.3.0 +delayed') depends_on('py-toolz@0.7.2:', type=('build', 'run'), when='@0.8.1: +delayed') depends_on('py-toolz@0.7.3:', type=('build', 'run'), when='@0.14.1: +delayed') - depends_on('py-toolz@0.8.2:', type=('build', 'run'), when='@2.13.0: +delayed') + # The dependency on py-toolz is non-optional starting version 2021.3.1 + depends_on('py-toolz@0.8.2:', type=('build', 'run'), when='@2.13.0:2021.3.0 +delayed') # Support for YAML configuration files - depends_on('py-pyyaml', type=('build', 'run'), when='+yaml') + # The dependency on py-pyyaml is non-optional starting version 2.17.1 + depends_on('py-pyyaml', type=('build', 'run'), when='@0.18.0:2.17.0 +yaml') @property def import_modules(self): diff --git a/var/spack/repos/builtin/packages/py-distributed/package.py b/var/spack/repos/builtin/packages/py-distributed/package.py index d70656dd424..aec2bd45833 100644 --- a/var/spack/repos/builtin/packages/py-distributed/package.py +++ b/var/spack/repos/builtin/packages/py-distributed/package.py @@ -22,6 +22,7 @@ class PyDistributed(PythonPackage): 'distributed.http.worker', 'distributed.diagnostics' ] + version('2021.6.2', sha256='d7d112a86ab049dcefa3b21fd1baea4212a2c03d22c24bd55ad38d21a7f5d148') version('2020.12.0', sha256='2a0b6acc921cd4e0143a7c4383cdcbed7defbc4bd9dc3aab0c7f1c45f14f80e1') version('2.10.0', sha256='2f8cca741a20f776929cbad3545f2df64cf60207fb21f774ef24aad6f6589e8b') version('1.28.1', sha256='3bd83f8b7eb5938af5f2be91ccff8984630713f36f8f66097e531a63f141c48a') diff --git a/var/spack/repos/builtin/packages/py-duecredit/package.py b/var/spack/repos/builtin/packages/py-duecredit/package.py new file mode 100644 index 00000000000..ec1ac2ce6cb --- /dev/null +++ b/var/spack/repos/builtin/packages/py-duecredit/package.py @@ -0,0 +1,22 @@ +# Copyright 2013-2021 Lawrence Livermore National Security, LLC and other +# Spack Project Developers. See the top-level COPYRIGHT file for details. +# +# SPDX-License-Identifier: (Apache-2.0 OR MIT) + +from spack import * + + +class PyDuecredit(PythonPackage): + """Publications (and donations) tracer.""" + + homepage = "https://github.com/duecredit/duecredit" + pypi = "duecredit/duecredit-0.9.1.tar.gz" + + version('0.9.1', sha256='f6192ce9315b35f6a67174761291e61d0831e496e8ff4acbc061731e7604faf8') + + depends_on('python@3.6:', type=('build', 'run')) + depends_on('py-setuptools', type='build') + depends_on('py-requests', type=('build', 'run')) + depends_on('py-citeproc-py@0.4:', type=('build', 'run')) + depends_on('py-six', type=('build', 'run')) + depends_on('py-importlib-metadata', when='python@:3.7', type=('build', 'run')) diff --git a/var/spack/repos/builtin/packages/py-efficientnet-pytorch/package.py b/var/spack/repos/builtin/packages/py-efficientnet-pytorch/package.py new file mode 100644 index 00000000000..1da4280680a --- /dev/null +++ b/var/spack/repos/builtin/packages/py-efficientnet-pytorch/package.py @@ -0,0 +1,19 @@ +# Copyright 2013-2021 Lawrence Livermore National Security, LLC and other +# Spack Project Developers. See the top-level COPYRIGHT file for details. +# +# SPDX-License-Identifier: (Apache-2.0 OR MIT) + +from spack import * + + +class PyEfficientnetPytorch(PythonPackage): + """EfficientNet implemented in PyTorch.""" + + homepage = "https://github.com/lukemelas/efficientnet_pytorch" + pypi = "efficientnet_pytorch/efficientnet_pytorch-0.6.3.tar.gz" + + version('0.6.3', sha256='6667459336893e9bf6367de3788ba449fed97f65da3b6782bf2204b6273a319f') + + depends_on('python@3.5.0:', type=('build', 'run')) + depends_on('py-setuptools', type='build') + depends_on('py-torch', type=('build', 'run')) diff --git a/var/spack/repos/builtin/packages/py-exifread/package.py b/var/spack/repos/builtin/packages/py-exifread/package.py new file mode 100644 index 00000000000..05e104f1646 --- /dev/null +++ b/var/spack/repos/builtin/packages/py-exifread/package.py @@ -0,0 +1,17 @@ +# Copyright 2013-2021 Lawrence Livermore National Security, LLC and other +# Spack Project Developers. See the top-level COPYRIGHT file for details. +# +# SPDX-License-Identifier: (Apache-2.0 OR MIT) + +from spack import * + + +class PyExifread(PythonPackage): + """Read Exif metadata from tiff and jpeg files.""" + + homepage = "https://github.com/ianare/exif-py" + pypi = "ExifRead/ExifRead-2.3.2.tar.gz" + + version('2.3.2', sha256='a0f74af5040168d3883bbc980efe26d06c89f026dc86ba28eb34107662d51766') + + depends_on('py-setuptools', type='build') diff --git a/var/spack/repos/builtin/packages/py-fenics-basix/package.py b/var/spack/repos/builtin/packages/py-fenics-basix/package.py index 75dca03d9dd..0cfca370c32 100644 --- a/var/spack/repos/builtin/packages/py-fenics-basix/package.py +++ b/var/spack/repos/builtin/packages/py-fenics-basix/package.py @@ -13,7 +13,7 @@ class PyFenicsBasix(PythonPackage): homepage = "https://github.com/FEniCS/basix" url = "https://github.com/FEniCS/basix/archive/0.1.0.tar.gz" git = "https://github.com/FEniCS/basix.git" - maintainers = ["chrisrichardson", "mscroggs"] + maintainers = ["chrisrichardson", "mscroggs", "garth-wells"] version("main", branch="main") version("0.1.0", sha256="2ab41fe6ad4f6c42f01b17a6e7c39debb4e0ae61c334d1caebee78b741bca4e7") @@ -21,10 +21,10 @@ class PyFenicsBasix(PythonPackage): depends_on("fenics-basix@main", type=("build", "run"), when="@main") depends_on("fenics-basix@0.1.0", type=("build", "run"), when="@0.1.0") - depends_on("python@3.6:", type=('build', 'run')) + depends_on("python@3.7:", type=('build', 'run')) depends_on("py-setuptools", type="build") depends_on("cmake@3.18:", type="build") - depends_on("py-pybind11@2.6.1:2.6.99", type="build") + depends_on("py-pybind11@2.6.2:", type="build") phases = ['build_ext', 'build', 'install'] diff --git a/var/spack/repos/builtin/packages/py-fenics-dolfinx/package.py b/var/spack/repos/builtin/packages/py-fenics-dolfinx/package.py index ec4f268a4da..56b0608a93d 100644 --- a/var/spack/repos/builtin/packages/py-fenics-dolfinx/package.py +++ b/var/spack/repos/builtin/packages/py-fenics-dolfinx/package.py @@ -13,28 +13,29 @@ class PyFenicsDolfinx(PythonPackage): homepage = "https://github.com/FEniCS/dolfinx" url = "https://github.com/FEniCS/dolfinx/archive/0.1.0.tar.gz" git = "https://github.com/FEniCS/dolfinx.git" - maintainers = ["js947", "chrisrichardson"] + maintainers = ["js947", "chrisrichardson", "garth-wells"] version("main", branch="main") version("0.1.0", sha256="0269379769b5b6d4d1864ded64402ecaea08054c2a5793c8685ea15a59af5e33") - depends_on("cmake@3.9:", type="build") + depends_on("cmake@3.12:", type="build") + depends_on("hdf5", type="build") depends_on("pkgconfig", type=("build", "run")) - depends_on('python@3.5:', type=('build', 'run')) + depends_on('python@3.7:', type=('build', 'run')) depends_on("py-setuptools", type="build") - depends_on("fenics-dolfinx", when="@main") + depends_on("fenics-dolfinx@main", when="@main") depends_on("fenics-dolfinx@0.1.0", when="@0.1.0") - depends_on("fenics-basix", type=("build", "run"), when="@main") + depends_on("fenics-basix@main", type=("build", "run"), when="@main") depends_on("fenics-basix@0.1.0", type=("build", "run"), when="@0.1.0") depends_on("py-mpi4py", type=("build", "run")) depends_on("py-petsc4py", type=("build", "run")) - depends_on("py-pybind11@2.6.1:2.6.99", type=("build", "run")) + depends_on("py-pybind11@2.6.2:", type=("build", "run")) - depends_on("py-fenics-ffcx", type=("run")) + depends_on("py-fenics-ffcx@main", type=("run"), when="@main") depends_on("py-fenics-ffcx@0.1.0", type=("run"), when="@0.1.0") - depends_on("py-fenics-basix", type=("run")) + depends_on("py-fenics-basix", type=("run"), when="@main") depends_on("py-fenics-basix@0.1.0", type=("run"), when="@0.1.0") - depends_on("py-fenics-ufl", type=("run")) + depends_on("py-fenics-ufl@main", type=("run"), when="@main") depends_on("py-fenics-ufl@2021.1.0", type=("run"), when="@0.1.0") depends_on("py-cffi", type=("run")) diff --git a/var/spack/repos/builtin/packages/py-fenics-ffcx/package.py b/var/spack/repos/builtin/packages/py-fenics-ffcx/package.py index 8272b7efe6e..e9b2d989b98 100644 --- a/var/spack/repos/builtin/packages/py-fenics-ffcx/package.py +++ b/var/spack/repos/builtin/packages/py-fenics-ffcx/package.py @@ -12,7 +12,7 @@ class PyFenicsFfcx(PythonPackage): homepage = "https://github.com/FEniCS/ffcx" url = "https://github.com/FEniCS/ffcx/archive/0.1.0.tar.gz" git = "https://github.com/FEniCS/ffcx.git" - maintainers = ["js947", "chrisrichardson"] + maintainers = ["js947", "chrisrichardson", "garth-wells"] version('main', branch='main') version('0.1.0', sha256='98a47906146ac892fb4a358e04cbfd04066f12d0a4cdb505a6b08ff0b1a17e89') @@ -21,10 +21,10 @@ class PyFenicsFfcx(PythonPackage): depends_on('py-setuptools', type=('build', 'run')) depends_on('py-cffi', type=('build', 'run')) - depends_on('py-fenics-ufl', type=('build', 'run'), when='@main') + depends_on('py-fenics-ufl@main', type=('build', 'run'), when='@main') depends_on('py-fenics-ufl@2021.1.0', type=('build', 'run'), when='@0.1.0') - depends_on('py-fenics-basix', type=('build', 'run'), when='@main') + depends_on('py-fenics-basix@main', type=('build', 'run'), when='@main') depends_on('py-fenics-basix@0.1.0', type=('build', 'run'), when='@0.1.0') depends_on('py-numpy', type=('build', 'run')) diff --git a/var/spack/repos/builtin/packages/py-fenics-ufl/package.py b/var/spack/repos/builtin/packages/py-fenics-ufl/package.py index 6b60848a301..757937beffe 100644 --- a/var/spack/repos/builtin/packages/py-fenics-ufl/package.py +++ b/var/spack/repos/builtin/packages/py-fenics-ufl/package.py @@ -16,7 +16,7 @@ class PyFenicsUfl(PythonPackage): homepage = "https://fenicsproject.org/" url = "https://github.com/FEniCS/ufl/archive/2019.1.0.tar.gz" git = "https://github.com/FEniCS/ufl.git" - maintainers = ["js947", "chrisrichardson"] + maintainers = ["js947", "chrisrichardson", "garth-wells"] version("main", branch="main") version('2021.1.0', sha256='130fdc09bb7fcd39dcd2618426912b8a25a03431d94575711068b38c666b4337') diff --git a/var/spack/repos/builtin/packages/py-flask-restful/package.py b/var/spack/repos/builtin/packages/py-flask-restful/package.py new file mode 100644 index 00000000000..0a56189471f --- /dev/null +++ b/var/spack/repos/builtin/packages/py-flask-restful/package.py @@ -0,0 +1,21 @@ +# Copyright 2013-2021 Lawrence Livermore National Security, LLC and other +# Spack Project Developers. See the top-level COPYRIGHT file for details. +# +# SPDX-License-Identifier: (Apache-2.0 OR MIT) + +from spack import * + + +class PyFlaskRestful(PythonPackage): + """Simple framework for creating REST APIs""" + + homepage = "https://www.github.com/flask-restful/flask-restful/" + pypi = "Flask-RESTful/Flask-RESTful-0.3.8.tar.gz" + + version('0.3.9', sha256='ccec650b835d48192138c85329ae03735e6ced58e9b2d9c2146d6c84c06fa53e') + + depends_on('py-setuptools', type='build') + depends_on('py-aniso8601@0.82:', type=('build', 'run')) + depends_on('py-flask@0.8:', type=('build', 'run')) + depends_on('py-six@1.3.0:', type=('build', 'run')) + depends_on('py-pytz', type=('build', 'run')) diff --git a/var/spack/repos/builtin/packages/py-fsspec/package.py b/var/spack/repos/builtin/packages/py-fsspec/package.py index e52ee16a0d9..bafd1887b01 100644 --- a/var/spack/repos/builtin/packages/py-fsspec/package.py +++ b/var/spack/repos/builtin/packages/py-fsspec/package.py @@ -12,6 +12,7 @@ class PyFsspec(PythonPackage): homepage = "https://github.com/intake/filesystem_spec" pypi = "fsspec/fsspec-0.4.4.tar.gz" + version('2021.7.0', sha256='792ebd3b54de0b30f1ce73f0ba0a8bcc864724f2d9f248cb8d0ece47db0cbde8') version('2021.4.0', sha256='8b1a69884855d1a8c038574292e8b861894c3373282d9a469697a2b41d5289a6') version('0.8.0', sha256='176f3fc405471af0f1f1e14cffa3d53ab8906577973d068b976114433c010d9d') version('0.7.3', sha256='1b540552c93b47e83c568e87507d6e02993e6d1b30bc7285f2336c81c5014103') diff --git a/var/spack/repos/builtin/packages/py-fuzzywuzzy/package.py b/var/spack/repos/builtin/packages/py-fuzzywuzzy/package.py new file mode 100644 index 00000000000..f002467a9aa --- /dev/null +++ b/var/spack/repos/builtin/packages/py-fuzzywuzzy/package.py @@ -0,0 +1,21 @@ +# Copyright 2013-2021 Lawrence Livermore National Security, LLC and other +# Spack Project Developers. See the top-level COPYRIGHT file for details. +# +# SPDX-License-Identifier: (Apache-2.0 OR MIT) + +from spack import * + + +class PyFuzzywuzzy(PythonPackage): + """Fuzzy string matching in python.""" + + homepage = "https://github.com/seatgeek/fuzzywuzzy" + pypi = "fuzzywuzzy/fuzzywuzzy-0.18.0.tar.gz" + + version('0.18.0', sha256='45016e92264780e58972dca1b3d939ac864b78437422beecebb3095f8efd00e8') + + variant('speedup', default=False, description='Provide a 4-10x speedup') + + depends_on('python@2.7:2.8,3.4:', type=('build', 'run')) + depends_on('py-setuptools', type='build') + depends_on('py-python-levenshtein@0.12:', when='+speedup', type=('build', 'run')) diff --git a/var/spack/repos/builtin/packages/py-gast/package.py b/var/spack/repos/builtin/packages/py-gast/package.py index 4ceb0eaa43d..12260e33c62 100644 --- a/var/spack/repos/builtin/packages/py-gast/package.py +++ b/var/spack/repos/builtin/packages/py-gast/package.py @@ -12,6 +12,7 @@ class PyGast(PythonPackage): homepage = "https://github.com/serge-sans-paille/gast" pypi = "gast/gast-0.3.2.tar.gz" + version('0.5.0', sha256='8109cbe7aa0f7bf7e4348379da05b8137ea1f059f073332c3c1cedd57db8541f') version('0.4.0', sha256='40feb7b8b8434785585ab224d1568b857edb18297e5a3047f1ba012bc83b42c1') version('0.3.3', sha256='b881ef288a49aa81440d2c5eb8aeefd4c2bb8993d5f50edae7413a85bfdb3b57') version('0.3.2', sha256='5c7617f1f6c8b8b426819642b16b9016727ddaecd16af9a07753e537eba8a3a5') diff --git a/var/spack/repos/builtin/packages/py-greenlet/package.py b/var/spack/repos/builtin/packages/py-greenlet/package.py index 9af8f00180a..43d9f197f2e 100644 --- a/var/spack/repos/builtin/packages/py-greenlet/package.py +++ b/var/spack/repos/builtin/packages/py-greenlet/package.py @@ -12,7 +12,10 @@ class PyGreenlet(PythonPackage): homepage = "https://github.com/python-greenlet/greenlet" pypi = "greenlet/greenlet-0.4.17.tar.gz" + version('1.1.0', sha256='c87df8ae3f01ffb4483c796fe1b15232ce2b219f0b18126948616224d3f658ee') version('0.4.17', sha256='41d8835c69a78de718e466dd0e6bfd4b46125f21a67c3ff6d76d8d8059868d6b') version('0.4.13', sha256='0fef83d43bf87a5196c91e73cb9772f945a4caaff91242766c5916d1dd1381e4') - depends_on('python', type=('build', 'link', 'run')) + depends_on('python@2.7:2.8,3.5:', when='@1:', type=('build', 'link', 'run')) + depends_on('python', when='@:0.9', type=('build', 'link', 'run')) + depends_on('py-setuptools', when='@1:', type='build') diff --git a/var/spack/repos/builtin/packages/py-grpcio/package.py b/var/spack/repos/builtin/packages/py-grpcio/package.py index 88fc4891ac5..d33a1aa0432 100644 --- a/var/spack/repos/builtin/packages/py-grpcio/package.py +++ b/var/spack/repos/builtin/packages/py-grpcio/package.py @@ -10,6 +10,17 @@ class PyGrpcio(PythonPackage): homepage = "https://grpc.io/" pypi = "grpcio/grpcio-1.32.0.tar.gz" + version('1.39.0', sha256='57974361a459d6fe04c9ae0af1845974606612249f467bbd2062d963cb90f407') + version('1.38.1', sha256='1f79d8a24261e3c12ec3a6c25945ff799ae09874fd24815bc17c2dc37715ef6c') + version('1.38.0', sha256='abbf9c8c3df4d5233d5888c6cfa85c1bb68a6923749bd4dd1abc6e1e93986f17') + version('1.37.1', sha256='df8305806311d3fe913d4f7eb3ef28e2072159ea12f95baab5d447f1380a71e3') + version('1.37.0', sha256='b3ce16aa91569760fdabd77ca901b2288152eb16941d28edd9a3a75a0c4a8a85') + version('1.36.0', sha256='70b11805bc9385fcd24e15bcdc5bd8bed463026cd2227d9fdd1ebda612ba0cd9') + version('1.35.0', sha256='7bd0ebbb14dde78bf66a1162efd29d3393e4e943952e2f339757aa48a184645c') + version('1.34.1', sha256='1c746a3cd8a830d8d916a9d0476a786aaa98c5cc2a096344af2be955e439f8ac') + version('1.34.0', sha256='f98f746cacbaa681de0bcd90d7aa77b440e3e1327a9988f6a2b580d54e27d4c3') + version('1.33.2', sha256='21265511880056d19ce4f809ce3fbe2a3fa98ec1fc7167dbdf30a80d3276202e') + version('1.33.1', sha256='f19782ec5104599382a0f73f2dfea465d0e65f6818bb3c49ca672b97034c64c3') version('1.32.0', sha256='01d3046fe980be25796d368f8fc5ff34b7cf5e1444f3789a017a7fe794465639') version('1.30.0', sha256='e8f2f5d16e0164c415f1b31a8d9a81f2e4645a43d1b261375d6bab7b0adf511f') version('1.29.0', sha256='a97ea91e31863c9a3879684b5fb3c6ab4b17c5431787548fc9f52b9483ea9c25') diff --git a/var/spack/repos/builtin/packages/py-h5py/h5py-3-setuprequires.patch b/var/spack/repos/builtin/packages/py-h5py/h5py-3-setuprequires.patch deleted file mode 100644 index c8c66547362..00000000000 --- a/var/spack/repos/builtin/packages/py-h5py/h5py-3-setuprequires.patch +++ /dev/null @@ -1,21 +0,0 @@ -diff -Naur h5py-3.1.0/setup.py h5py-3.1.0.patch/setup.py ---- h5py-3.1.0/setup.py 2020-11-06 14:25:11.000000000 +0000 -+++ h5py-3.1.0.patch/setup.py 2021-03-04 20:12:19.913405154 +0000 -@@ -49,14 +49,14 @@ - f"Cython >=0.29; python_version<'3.8'", - f"Cython >=0.29.14; python_version>='3.8'", - ] + [ -- f"numpy =={np_min}; python_version{py_condition}" -+ f"numpy >={np_min}; python_version{py_condition}" - for np_min, py_condition in NUMPY_MIN_VERSIONS - ] - - if setup_configure.mpi_enabled(): - RUN_REQUIRES.append('mpi4py >=3.0.0') -- SETUP_REQUIRES.append("mpi4py ==3.0.0; python_version<'3.8'") -- SETUP_REQUIRES.append("mpi4py ==3.0.3; python_version>='3.8'") -+ SETUP_REQUIRES.append("mpi4py >=3.0.0; python_version<'3.8'") -+ SETUP_REQUIRES.append("mpi4py >=3.0.3; python_version>='3.8'") - - # Set the environment variable H5PY_SETUP_REQUIRES=0 if we need to skip - # setup_requires for any reason. diff --git a/var/spack/repos/builtin/packages/py-h5py/package.py b/var/spack/repos/builtin/packages/py-h5py/package.py index a1351d47970..bab55b7fe14 100644 --- a/var/spack/repos/builtin/packages/py-h5py/package.py +++ b/var/spack/repos/builtin/packages/py-h5py/package.py @@ -11,11 +11,12 @@ class PyH5py(PythonPackage): HDF5 library from Python.""" homepage = "http://www.h5py.org/" - pypi = "h5py/h5py-3.2.1.tar.gz" + pypi = "h5py/h5py-3.3.0.tar.gz" git = "https://github.com/h5py/h5py.git" - maintainers = ['bryanherman'] + maintainers = ['bryanherman', 'takluyver'] version('master', branch='master') + version('3.3.0', sha256='e0dac887d779929778b3cfd13309a939359cc9e74756fc09af7c527a82797186') version('3.2.1', sha256='89474be911bfcdb34cbf0d98b8ec48b578c27a89fdb1ae4ee7513f1ef8d9249e') version('3.2.0', sha256='4271c1a4b7d87aa76fe96d016368beb05a6c389d64882d58036964ce7d2d03c1') version('3.1.0', sha256='1e2516f190652beedcb8c7acfa1c6fa92d99b42331cbef5e5c7ec2d65b0fc3c2') @@ -61,13 +62,10 @@ class PyH5py(PythonPackage): depends_on('hdf5+mpi', when='+mpi') depends_on('mpi', when='+mpi') depends_on('py-mpi4py', when='@:2.99 +mpi', type=('build', 'run')) - depends_on('py-mpi4py@3.0.0:', when='@3.0.0:+mpi^python@3.0.0:3.7.99', type=('build', 'run')) + depends_on('py-mpi4py@3.0.0:', when='@3.0.0:3.2.99+mpi^python@3.0.0:3.7.99', type=('build', 'run')) + depends_on('py-mpi4py@3.0.2:', when='@3.3.0:+mpi^python@3.0.0:3.7.99', type=('build', 'run')) depends_on('py-mpi4py@3.0.3:', when='@3.0.0:+mpi^python@3.8.0:', type=('build', 'run')) - # For version 3+, patch setup.py to allow setup_requires list to be more abstract. - # Required for offline installations with version 3+ - patch('h5py-3-setuprequires.patch', when="@3.0.0:") - phases = ['configure', 'install'] def setup_build_environment(self, env): @@ -76,6 +74,10 @@ def setup_build_environment(self, env): env.set('CC', self.spec['mpi'].mpicc) env.set('HDF5_MPI', 'ON') + # Disable build requirements meant for Python build tools, which pin + # versions of numpy & mpi4py. + env.set('H5PY_SETUP_REQUIRES', '0') + @when('@3.0.0:') def configure(self, spec, prefix): pass diff --git a/var/spack/repos/builtin/packages/py-hepunits/package.py b/var/spack/repos/builtin/packages/py-hepunits/package.py index 5b364756fbe..b11427a94fd 100644 --- a/var/spack/repos/builtin/packages/py-hepunits/package.py +++ b/var/spack/repos/builtin/packages/py-hepunits/package.py @@ -18,6 +18,7 @@ class PyHepunits(PythonPackage): maintainers = ['vvolkl'] version('master', branch='master') + version('2.1.1', sha256='21b18bbf82ade5e429e2c71ec41bc5ae8005b275466bdaef0159ddc4f8085b31') version('2.1.0', sha256='9e8da814c242579ad1fde6ccff0514195c70ab6d232eab8ff0ad675239686ef6') version('1.2.1', sha256='b05b0dda32bf797806d506d7508d4eb23b78f34d67bbba9348a2b4a9712666fa') diff --git a/var/spack/repos/builtin/packages/py-httpretty/package.py b/var/spack/repos/builtin/packages/py-httpretty/package.py new file mode 100644 index 00000000000..03980d7b236 --- /dev/null +++ b/var/spack/repos/builtin/packages/py-httpretty/package.py @@ -0,0 +1,18 @@ +# Copyright 2013-2021 Lawrence Livermore National Security, LLC and other +# Spack Project Developers. See the top-level COPYRIGHT file for details. +# +# SPDX-License-Identifier: (Apache-2.0 OR MIT) + +from spack import * + + +class PyHttpretty(PythonPackage): + """HTTP client mock for Python.""" + + homepage = "https://httpretty.readthedocs.io/en/latest/" + pypi = "httpretty/httpretty-1.1.3.tar.gz" + + version('1.1.3', sha256='229ade39175ea4324e767f29dc24e5f846fbc72bf80e1a919b2547a6574ff601') + + depends_on('python@3:', type=('build', 'run')) + depends_on('py-setuptools', type='build') diff --git a/var/spack/repos/builtin/packages/py-jeepney/package.py b/var/spack/repos/builtin/packages/py-jeepney/package.py index d202a5e9f95..e4004afe8ab 100644 --- a/var/spack/repos/builtin/packages/py-jeepney/package.py +++ b/var/spack/repos/builtin/packages/py-jeepney/package.py @@ -10,6 +10,8 @@ class PyJeepney(PythonPackage): homepage = "https://gitlab.com/takluyver/jeepney" pypi = "jeepney/jeepney-0.4.3.tar.gz" + version('0.6.0', sha256='7d59b6622675ca9e993a6bd38de845051d315f8b0c72cca3aef733a20b648657') version('0.4.3', sha256='3479b861cc2b6407de5188695fa1a8d57e5072d7059322469b62628869b8e36e') - depends_on('python@3.5:', type=('build', 'run')) + depends_on('python@3.6:', when='@0.5:', type=('build', 'run')) + depends_on('python@3.5:', when='@:0.4', type=('build', 'run')) diff --git a/var/spack/repos/builtin/packages/py-jinja2/package.py b/var/spack/repos/builtin/packages/py-jinja2/package.py index 73e073aa1bf..9367d18aa99 100644 --- a/var/spack/repos/builtin/packages/py-jinja2/package.py +++ b/var/spack/repos/builtin/packages/py-jinja2/package.py @@ -14,6 +14,7 @@ class PyJinja2(PythonPackage): homepage = "https://palletsprojects.com/p/jinja/" pypi = "Jinja2/Jinja2-2.10.3.tar.gz" + version('3.0.1', sha256='703f484b47a6af502e743c9122595cc812b0271f661722403114f71a79d0f5a4') version('2.11.3', sha256='a6d58433de0ae800347cab1fa3043cebbabe8baa9d29e668f1c768cb87a333c6') version('2.10.3', sha256='9fe95f19286cfefaa917656583d020be14e7859c6b0252588391e47db34527de') version('2.10.1', sha256='065c4f02ebe7f7cf559e49ee5a95fb800a9e4528727aec6f24402a5374c65013') @@ -25,7 +26,12 @@ class PyJinja2(PythonPackage): version('2.7.1', sha256='5cc0a087a81dca1c08368482fb7a92fe2bdd8cfbb22bc0fccfe6c85affb04c8b') version('2.7', sha256='474f1518d189ae7e318b139fecc1d30b943f124448cfa0f09582ca23e069fa4d') + variant('i18n', default=False, description="Enables I18N support with Babel") + + depends_on('python@3.6:', when='@3:', type=('build', 'run')) depends_on('python@2.7:2.8,3.5:', type=('build', 'run')) depends_on('py-setuptools', type='build') + depends_on('py-markupsafe@2.0:', when='@3:', type=('build', 'run')) depends_on('py-markupsafe@0.23:', type=('build', 'run')) - depends_on('py-babel@0.8:', type=('build', 'run')) # optional, required for i18n + depends_on('py-babel@2.7:', when='@3:+i18n', type=('build', 'run')) + depends_on('py-babel@0.8:', when='+i18n', type=('build', 'run')) diff --git a/var/spack/repos/builtin/packages/py-jupyter-core/package.py b/var/spack/repos/builtin/packages/py-jupyter-core/package.py index 647d86b1259..88b7c8e8af4 100644 --- a/var/spack/repos/builtin/packages/py-jupyter-core/package.py +++ b/var/spack/repos/builtin/packages/py-jupyter-core/package.py @@ -12,6 +12,7 @@ class PyJupyterCore(PythonPackage): homepage = "http://jupyter-core.readthedocs.io/" pypi = "jupyter-core/jupyter_core-4.6.0.tar.gz" + version('4.7.1', sha256='79025cb3225efcd36847d0840f3fc672c0abd7afd0de83ba8a1d3837619122b4') version('4.6.3', sha256='394fd5dd787e7c8861741880bdf8a00ce39f95de5d18e579c74b882522219e7e') version('4.6.1', sha256='a183e0ec2e8f6adddf62b0a3fc6a2237e3e0056d381e536d3e7c7ecc3067e244') version('4.6.0', sha256='85103cee6548992780912c1a0a9ec2583a4a18f1ef79a248ec0db4446500bce3') @@ -27,7 +28,9 @@ class PyJupyterCore(PythonPackage): version('4.0.1', sha256='7c165f7de7a063596f8be1bcfc86e9ba6897e38baf24e8510514690963600122') version('4.0.0', sha256='9025208cdfc40718c7e3ab62b5e17aacf68e3fc66e34ff21fe032d553620122a') + depends_on('python@3.6:', when='@4.7:', type=('build', 'run')) + depends_on('python@2.7:2.8,3.5:', when='@4.6.2:', type=('build', 'run')) depends_on('python@2.7:2.8,3.3:', type=('build', 'run')) - depends_on('python@2.7:2.8,3.5:', type=('build', 'run'), when='@4.6.2:') depends_on('py-setuptools', when='@4.5.0:', type=('build', 'run')) depends_on('py-traitlets', type=('build', 'run')) + # additional pywin32>=1.0 dependency for windows diff --git a/var/spack/repos/builtin/packages/py-jupyter-packaging/package.py b/var/spack/repos/builtin/packages/py-jupyter-packaging/package.py new file mode 100644 index 00000000000..7875ec2b5d8 --- /dev/null +++ b/var/spack/repos/builtin/packages/py-jupyter-packaging/package.py @@ -0,0 +1,22 @@ +# Copyright 2013-2021 Lawrence Livermore National Security, LLC and other +# Spack Project Developers. See the top-level COPYRIGHT file for details. +# +# SPDX-License-Identifier: (Apache-2.0 OR MIT) + +from spack import * + + +class PyJupyterPackaging(PythonPackage): + """Jupyter Packaging Utilities.""" + + homepage = "https://github.com/jupyter/jupyter-packaging" + pypi = "jupyter_packaging/jupyter_packaging-0.10.4.tar.gz" + + version('0.10.4', sha256='589db027cb85a92612f9bcfaeecaa8a9072ac8a4bddaf827f648664258e587c4') + + depends_on('python@3.6:', type=('build', 'run')) + depends_on('py-setuptools@46.4.0:', type=('build', 'run')) + depends_on('py-packaging', type=('build', 'run')) + depends_on('py-tomlkit', type=('build', 'run')) + depends_on('py-wheel', type=('build', 'run')) + depends_on('py-deprecation', type=('build', 'run')) diff --git a/var/spack/repos/builtin/packages/py-jupyter-server/package.py b/var/spack/repos/builtin/packages/py-jupyter-server/package.py new file mode 100644 index 00000000000..3301cf8205c --- /dev/null +++ b/var/spack/repos/builtin/packages/py-jupyter-server/package.py @@ -0,0 +1,36 @@ +# Copyright 2013-2021 Lawrence Livermore National Security, LLC and other +# Spack Project Developers. See the top-level COPYRIGHT file for details. +# +# SPDX-License-Identifier: (Apache-2.0 OR MIT) + +from spack import * + + +class PyJupyterServer(PythonPackage): + """The Jupyter Server provides the backend (i.e. the core services, APIs, + and REST endpoints) for Jupyter web applications like Jupyter notebook, + JupyterLab, and Voila.""" + + homepage = "https://github.com/jupyter-server/jupyter_server" + pypi = "jupyter_server/jupyter_server-1.9.0.tar.gz" + + version('1.9.0', sha256='7d19006380f6217458a9db309b54e3dab87ced6c06329c61823907bef2a6f51b') + + depends_on('python@3.6:', type=('build', 'run')) + depends_on('py-setuptools', type='build') + depends_on('py-jinja2', type=('build', 'run')) + depends_on('py-tornado@6.1:', type=('build', 'run')) + depends_on('py-pyzmq@17:', type=('build', 'run')) + depends_on('py-argon2-cffi', type=('build', 'run')) + depends_on('py-ipython-genutils', type=('build', 'run')) + depends_on('py-traitlets@4.2.1:', type=('build', 'run')) + depends_on('py-jupyter-core@4.6.0:', type=('build', 'run')) + depends_on('py-jupyter-client@6.1.1:', type=('build', 'run')) + depends_on('py-nbformat', type=('build', 'run')) + depends_on('py-nbconvert', type=('build', 'run')) + depends_on('py-send2trash', type=('build', 'run')) + depends_on('py-terminado@0.8.3:', type=('build', 'run')) + depends_on('py-prometheus-client', type=('build', 'run')) + depends_on('py-anyio@3.1.0:3.99', type=('build', 'run')) + depends_on('py-websocket-client', type=('build', 'run')) + depends_on('py-requests-unixsocket', type=('build', 'run')) diff --git a/var/spack/repos/builtin/packages/py-jupyterlab-server/package.py b/var/spack/repos/builtin/packages/py-jupyterlab-server/package.py index 35496e3a419..3252bfc45ec 100644 --- a/var/spack/repos/builtin/packages/py-jupyterlab-server/package.py +++ b/var/spack/repos/builtin/packages/py-jupyterlab-server/package.py @@ -8,16 +8,22 @@ class PyJupyterlabServer(PythonPackage): """A set of server components for JupyterLab and JupyterLab like applications""" + homepage = "https://github.com/jupyterlab/jupyterlab_server" pypi = "jupyterlab_server/jupyterlab_server-1.2.0.tar.gz" + version('2.6.0', sha256='f300adf6bb0a952bebe9c807a3b2a345d62da39b476b4f69ea0dc6b5f3f6b97d') version('1.2.0', sha256='5431d9dde96659364b7cc877693d5d21e7b80cea7ae3959ecc2b87518e5f5d8c') version('1.1.0', sha256='bac27e2ea40f686e592d6429877e7d46947ea76c08c878081b028c2c89f71733') + depends_on('python@3.6:', when='@2.5:', type=('build', 'run')) depends_on('python@3.5:', type=('build', 'run')) depends_on('py-setuptools', type='build') depends_on('py-requests', type=('build', 'run')) depends_on('py-json5', type=('build', 'run')) depends_on('py-jsonschema@3.0.1:', type=('build', 'run')) - depends_on('py-notebook@4.2.0:', type=('build', 'run')) depends_on('py-jinja2@2.10:', type=('build', 'run')) + depends_on('py-babel', when='@2.5.1:', type=('build', 'run')) + depends_on('py-packaging', when='@2.5.1:', type=('build', 'run')) + depends_on('py-jupyter-server@1.4:1.99', when='@2.5.1:', type=('build', 'run')) + depends_on('py-notebook@4.2.0:', when='@:2.5.0', type=('build', 'run')) diff --git a/var/spack/repos/builtin/packages/py-jupyterlab/package.py b/var/spack/repos/builtin/packages/py-jupyterlab/package.py index 69fbc175ca1..2cd581cae3c 100644 --- a/var/spack/repos/builtin/packages/py-jupyterlab/package.py +++ b/var/spack/repos/builtin/packages/py-jupyterlab/package.py @@ -8,15 +8,38 @@ class PyJupyterlab(PythonPackage): """JupyterLab is the next-generation web-based user interface for Project Jupyter.""" - homepage = "https://jupyterlab.readthedocs.io/" + homepage = "https://github.com/jupyterlab/jupyterlab" pypi = "jupyterlab/jupyterlab-2.2.7.tar.gz" + version('3.0.16', sha256='7ad4fbe1f6d38255869410fd151a8b15692a663ca97c0a8146b3f5c40e275c23') version('2.2.7', sha256='a72ffd0d919cba03a5ef8422bc92c3332a957ff97b0490494209c83ad93826da') version('2.1.0', sha256='8c239aababf5baa0b3d36e375fddeb9fd96f3a9a24a8cda098d6a414f5bbdc81') + depends_on('python@3.6:', when='@3:', type=('build', 'run')) depends_on('python@3.5:', type=('build', 'run')) depends_on('py-setuptools', type=('build', 'run')) - depends_on('py-notebook@4.3.1:', type=('build', 'run')) - depends_on('py-tornado@:5,6.0.3:', type=('build', 'run')) - depends_on('py-jupyterlab-server@1.1.5:1.999', type=('build', 'run')) + depends_on('py-jupyter-packaging@0.9:1.999', when='@3.0.15:', type='build') + depends_on('py-jupyter-packaging@0.7.3:0.7.999', when='@3.0.0:3.0.14', type='build') + # dependency on py-jinja2@2.1 seems to be a migration issue from the switch + # to setup.cfg in 3.0.15, leave it a 2.10 depends_on('py-jinja2@2.10:', type=('build', 'run')) + + # @3: + depends_on('py-ipython', when='@3:', type=('build', 'run')) + depends_on('py-packaging', when='@3:', type=('build', 'run')) + depends_on('py-tornado@6.1:', when='@3:', type=('build', 'run')) + depends_on('py-jupyter-core', when='@3:', type=('build', 'run')) + depends_on('py-jupyterlab-server@2.3:2.999', when='@3.0.9:', type=('build', 'run')) + depends_on('py-jupyterlab-server@2.0:2.999', when='@3.0.0:3.0.8', type=('build', 'run')) + depends_on('py-jupyter-server@1.4:1.999', when='@3.0.9:', type=('build', 'run')) + depends_on('py-jupyter-server@1.2:1.999', when='@3.0.3:3.0.8', type=('build', 'run')) + depends_on('py-jupyter-server@1.1:1.999', when='@3.0.0:3.0.2', type=('build', 'run')) + depends_on('py-nbclassic@0.2.0:0.999', when='@3:', type=('build', 'run')) + + # @:3 + depends_on('py-notebook@4.3.1:', when='@:2.99', type=('build', 'run')) + depends_on('py-tornado@:5,6.0.3:', when='@:2.99', type=('build', 'run')) + depends_on('py-jupyterlab-server@1.1.5:1.999', when='@:2.99', type=('build', 'run')) + + def setup_run_environment(self, env): + env.set('JUPYTERLAB_DIR', self.prefix.share.jupyter.lab) diff --git a/var/spack/repos/builtin/packages/py-lmfit/package.py b/var/spack/repos/builtin/packages/py-lmfit/package.py index 668de222c25..907d7d32d03 100644 --- a/var/spack/repos/builtin/packages/py-lmfit/package.py +++ b/var/spack/repos/builtin/packages/py-lmfit/package.py @@ -12,17 +12,22 @@ class PyLmfit(PythonPackage): homepage = "http://lmfit.github.io/lmfit-py/" pypi = "lmfit/lmfit-0.9.5.tar.gz" + version('1.0.2', sha256='67090ce56685cf7f92bd7358a1e7d4ad862b3758988109ec440e9825e5184b45') version('1.0.1', sha256='d249eb756899360f4d2a544c9458f47fc8f765ac22c09e099530585fd64e286e') version('0.9.15', sha256='cd7bdf47c09a3d49f30dff9a1c7f778973d15d1e1b5dc642f14c22f6630eaf2f') version('0.9.5', sha256='eebc3c34ed9f3e51bdd927559a5482548c423ad5a0690c6fdcc414bfb5be6667') - depends_on('python@3.5:', type=('build', 'run'), when='@1:') + depends_on('python@3.6:', type=('build', 'run'), when='@1:') depends_on('python@2.7:2.8,3.5:', type=('build', 'run'), when='@0.9.15') - depends_on('py-asteval@0.9.16', type=('build', 'run'), when='@0.9.15:') + + depends_on('py-asteval@0.9.16:', type=('build', 'run'), when='@0.9.15:') + depends_on('py-numpy@1.5:', type=('build', 'run'), when='@0.9.5:') depends_on('py-numpy@1.16:', type=('build', 'run'), when='@0.9.15:') + depends_on('py-scipy@0.14:', type=('build', 'run'), when='@0.9.5') depends_on('py-scipy@1.2:', type=('build', 'run'), when='@0.9.15:') + depends_on('py-setuptools', type='build') depends_on('py-six@1.11:', type=('build', 'run'), when='@0.9.15') depends_on('py-uncertainties@3.0.1:', type=('build', 'run'), when='@0.9.15:') diff --git a/var/spack/repos/builtin/packages/py-markupsafe/package.py b/var/spack/repos/builtin/packages/py-markupsafe/package.py index ae95876b9d1..c6c5157dce2 100644 --- a/var/spack/repos/builtin/packages/py-markupsafe/package.py +++ b/var/spack/repos/builtin/packages/py-markupsafe/package.py @@ -12,9 +12,10 @@ class PyMarkupsafe(PythonPackage): implement automatic string escaping. It is used by Jinja 2, the Mako templating engine, the Pylons web framework and many more.""" - homepage = "http://www.pocoo.org/projects/markupsafe/" + homepage = "https://markupsafe.palletsprojects.com" pypi = "MarkupSafe/MarkupSafe-1.1.1.tar.gz" + version('2.0.1', sha256='594c67807fb16238b30c44bdf74f36c02cdf22d1c8cda91ef8a0ed8dabf5620a') version('1.1.1', sha256='29872e92839765e546828bb7754a68c418d927cd064fd4708fab9fe9c8bb116b') version('1.0', sha256='a6be69091dac236ea9c6bc7d012beab42010fa914c459791d627dad4910eb665') version('0.23', sha256='a4ec1aff59b95a14b45eb2e23761a0179e98319da5a7eb76b56ea8cdc7b871c3') @@ -23,5 +24,6 @@ class PyMarkupsafe(PythonPackage): version('0.20', sha256='f6cf3bd233f9ea6147b21c7c02cac24e5363570ce4fd6be11dab9f499ed6a7d8') version('0.19', sha256='62fcc5d641df8b5ad271ebbd6b77a19cd92eceba1e1a990de4e96c867789f037') + depends_on('python@3.6:', when='@2:', type=('build', 'run')) depends_on('python@2.7:2.8,3.4:', type=('build', 'run')) depends_on('py-setuptools', type='build') diff --git a/var/spack/repos/builtin/packages/py-multiprocess/package.py b/var/spack/repos/builtin/packages/py-multiprocess/package.py index c4ff2c84878..6e92fe6db9b 100644 --- a/var/spack/repos/builtin/packages/py-multiprocess/package.py +++ b/var/spack/repos/builtin/packages/py-multiprocess/package.py @@ -12,21 +12,24 @@ class PyMultiprocess(PythonPackage): homepage = "https://github.com/uqfoundation/multiprocess" pypi = "multiprocess/multiprocess-0.70.5.zip" + version('0.70.12.2', sha256='206bb9b97b73f87fec1ed15a19f8762950256aa84225450abc7150d02855a083') version('0.70.9', sha256='9fd5bd990132da77e73dec6e9613408602a4612e1d73caf2e2b813d2b61508e5') version('0.70.7', sha256='3394f1fbd0d87112690a877e49eb7917d851ee8d822294d522dd4deae12febdb') version('0.70.5', sha256='c4c196f3c4561dc1d78139c3e73709906a222d2fc166ef3eef895d8623df7267') version('0.70.4', sha256='a692c6dc8392c25b29391abb58a9fbdc1ac38bca73c6f27d787774201e68e12c') depends_on('python@2.5:2.8,3.1:', type=('build', 'run')) + depends_on('python@2.7:2.8,3.6:', when='@0.70.12.2:', type=('build', 'run')) depends_on('py-setuptools@0.6:', type='build') depends_on('py-dill@0.2.6:', type=('build', 'run')) depends_on('py-dill@0.2.9:', type=('build', 'run'), when='@0.70.7:') depends_on('py-dill@0.3.1:', type=('build', 'run'), when='@0.70.9:') + depends_on('py-dill@0.3.4:', type=('build', 'run'), when='@0.70.12.2:') def url_for_version(self, version): url = self.url.rsplit('/', 1)[0] - if version >= Version('0.70.7'): + if Version('0.70.12.2') > version >= Version('0.70.7'): url += '/multiprocess-{0}.tar.gz' else: url += '/multiprocess-{0}.zip' diff --git a/var/spack/repos/builtin/packages/py-mutagen/package.py b/var/spack/repos/builtin/packages/py-mutagen/package.py new file mode 100644 index 00000000000..3befa29a163 --- /dev/null +++ b/var/spack/repos/builtin/packages/py-mutagen/package.py @@ -0,0 +1,18 @@ +# Copyright 2013-2021 Lawrence Livermore National Security, LLC and other +# Spack Project Developers. See the top-level COPYRIGHT file for details. +# +# SPDX-License-Identifier: (Apache-2.0 OR MIT) + +from spack import * + + +class PyMutagen(PythonPackage): + """Read and write audio tags for many formats.""" + + homepage = "https://github.com/quodlibet/mutagen" + pypi = "mutagen/mutagen-1.45.1.tar.gz" + + version('1.45.1', sha256='6397602efb3c2d7baebd2166ed85731ae1c1d475abca22090b7141ff5034b3e1') + + depends_on('python@3.5:3.99', type=('build', 'run')) + depends_on('py-setuptools', type='build') diff --git a/var/spack/repos/builtin/packages/py-mypy/package.py b/var/spack/repos/builtin/packages/py-mypy/package.py index a5d2cc15e3b..1725986b4fa 100644 --- a/var/spack/repos/builtin/packages/py-mypy/package.py +++ b/var/spack/repos/builtin/packages/py-mypy/package.py @@ -13,15 +13,15 @@ class PyMypy(PythonPackage): pypi = "mypy/mypy-0.740.tar.gz" version('0.910', sha256='704098302473cb31a218f1775a873b376b30b4c18229421e9e9dc8916fd16150') + version('0.900', sha256='65c78570329c54fb40f956f7645e2359af5da9d8c54baa44f461cdc7f4984108') version('0.800', sha256='e0202e37756ed09daf4b0ba64ad2c245d357659e014c3f51d8cd0681ba66940a') version('0.740', sha256='48c8bc99380575deb39f5d3400ebb6a8a1cb5cc669bbba4d3bb30f904e0a0e7d') variant('python2', default=False, description='Enable checking of python 2 type annotations') - depends_on('python@3.5:', type=('build', 'run')) + depends_on("python@3.5:", type=("build", "run")) depends_on('py-setuptools', type=('build', 'run')) - depends_on('py-typed-ast@1.4.0:1.4.999', when='@0.900:+python2', type=('build', 'run')) - depends_on('py-typed-ast@1.4.0:1.4.999', when='@:899', type=('build', 'run')) + depends_on('py-typed-ast@1.4.0:1.4.999', type=('build', 'run')) depends_on('py-typing-extensions@3.7.4:', type=('build', 'run')) depends_on('py-mypy-extensions@0.4.3:0.4.999', type=('build', 'run')) depends_on('py-toml', when='@0.900:', type=('build', 'run')) diff --git a/var/spack/repos/builtin/packages/py-nbclassic/package.py b/var/spack/repos/builtin/packages/py-nbclassic/package.py new file mode 100644 index 00000000000..ab98af4ddf8 --- /dev/null +++ b/var/spack/repos/builtin/packages/py-nbclassic/package.py @@ -0,0 +1,20 @@ +# Copyright 2013-2021 Lawrence Livermore National Security, LLC and other +# Spack Project Developers. See the top-level COPYRIGHT file for details. +# +# SPDX-License-Identifier: (Apache-2.0 OR MIT) + +from spack import * + + +class PyNbclassic(PythonPackage): + """Jupyter Notebook as a Jupyter Server Extension.""" + + homepage = "https://github.com/jupyterlab/nbclassic" + pypi = "nbclassic/nbclassic-0.3.1.tar.gz" + + version('0.3.1', sha256='f920f8d09849bea7950e1017ff3bd101763a8d68f565a51ce053572e65aa7947') + + depends_on('python@3.6:', type=('build', 'run')) + depends_on('py-setuptools', type='build') + depends_on('py-jupyter-server@1.8:1.999', type=('build', 'run')) + depends_on('py-notebook@:6.999', type=('build', 'run')) diff --git a/var/spack/repos/builtin/packages/py-numpy/package.py b/var/spack/repos/builtin/packages/py-numpy/package.py index 3d98db542b7..d13f08813c2 100644 --- a/var/spack/repos/builtin/packages/py-numpy/package.py +++ b/var/spack/repos/builtin/packages/py-numpy/package.py @@ -24,6 +24,7 @@ class PyNumpy(PythonPackage): version('main', branch='main') version('master', branch='main', deprecated=True) + version('1.21.1', sha256='dff4af63638afcc57a3dfb9e4b26d434a7a602d225b42d746ea7fe2edf1342fd') version('1.21.0', sha256='e80fe25cba41c124d04c662f33f6364909b985f2eb5998aaa5ae4b9587242cce') version('1.20.3', sha256='e55185e51b18d788e49fe8305fd73ef4470596b33fc2c1ceb304566b99c71a69') version('1.20.2', sha256='878922bf5ad7550aa044aa9301d417e2d3ae50f0f577de92051d739ac6096cee') diff --git a/var/spack/repos/builtin/packages/py-omegaconf/package.py b/var/spack/repos/builtin/packages/py-omegaconf/package.py new file mode 100644 index 00000000000..418e3e8f5d6 --- /dev/null +++ b/var/spack/repos/builtin/packages/py-omegaconf/package.py @@ -0,0 +1,28 @@ + +# Copyright 2013-2021 Lawrence Livermore National Security, LLC and other +# Spack Project Developers. See the top-level COPYRIGHT file for details. +# +# SPDX-License-Identifier: (Apache-2.0 OR MIT) + +from spack import * + + +class PyOmegaconf(PythonPackage): + """A hierarchical configuration system, with support for merging configurations from + multiple sources (YAML config files, dataclasses/objects and CLI arguments) + providing a consistent API regardless of how the configuration was created. + """ + + homepage = "https://github.com/omry/omegaconf" + url = 'https://github.com/omry/omegaconf/archive/refs/tags/v2.1.0.tar.gz' + + maintainers = ['calebrob6'] + + version('2.1.0', sha256='0168f962822b7059c7553c4346541596ea48c0b542628d41a348a12eeaf971ff') + + depends_on('python@3.6:', type=('build', 'run')) + depends_on('py-setuptools', type='build') + depends_on('py-antlr4-python3-runtime@4.8', type=('build', 'run')) + depends_on('py-pyyaml@5.1.0:', type=('build', 'run')) + depends_on('py-dataclasses', when='^python@:3.6', type=('build', 'run')) + depends_on('java', type='build') diff --git a/var/spack/repos/builtin/packages/py-pandas/package.py b/var/spack/repos/builtin/packages/py-pandas/package.py index ce99acdbbda..2fc49754e85 100644 --- a/var/spack/repos/builtin/packages/py-pandas/package.py +++ b/var/spack/repos/builtin/packages/py-pandas/package.py @@ -29,6 +29,7 @@ class PyPandas(PythonPackage): 'pandas._config' ] + version('1.3.1', sha256='341935a594db24f3ff07d1b34d1d231786aa9adfa84b76eab10bf42907c8aed3') version('1.3.0', sha256='c554e6c9cf2d5ea1aba5979cc837b3649539ced0e18ece186f055450c86622e2') version('1.2.5', sha256='14abb8ea73fce8aebbb1fb44bec809163f1c55241bcc1db91c2c780e97265033') version('1.2.4', sha256='649ecab692fade3cbfcf967ff936496b0cfba0af00a55dfaacd82bdda5cb2279') diff --git a/var/spack/repos/builtin/packages/py-particle/package.py b/var/spack/repos/builtin/packages/py-particle/package.py index 2a53657f35a..d16ea9eccc1 100644 --- a/var/spack/repos/builtin/packages/py-particle/package.py +++ b/var/spack/repos/builtin/packages/py-particle/package.py @@ -27,7 +27,8 @@ class PyParticle(PythonPackage): depends_on('py-setuptools', type='build') depends_on('py-attrs@19.2.0:', type=('build', 'run')) - depends_on('py-hepunits@1.2.0:', type=('build', 'run')) + depends_on('py-hepunits@1.2.0:', when='@:0.12', type=('build', 'run')) + depends_on('py-hepunits@2.0.0:', when='@0.13:', type=('build', 'run')) depends_on('py-importlib-resources@1.0:', when='^python@:3.6', type=('build', 'run')) depends_on('py-enum34@1.1:', when='^python@:3.3', type=('build', 'run')) diff --git a/var/spack/repos/builtin/packages/py-pathos/package.py b/var/spack/repos/builtin/packages/py-pathos/package.py index d79aeb9c722..da3de4f513f 100644 --- a/var/spack/repos/builtin/packages/py-pathos/package.py +++ b/var/spack/repos/builtin/packages/py-pathos/package.py @@ -12,20 +12,26 @@ class PyPathos(PythonPackage): homepage = "https://github.com/uqfoundation/pathos" pypi = "pathos/pathos-0.2.3.tar.gz" + version('0.2.8', sha256='1f0f27a90f7ab66c423ba796529000fde9360d17b2d8e50097641ff405fc6f15') version('0.2.3', sha256='954c5b0a8b257c375e35d311c65fa62a210a3d65269195557de38418ac9f61f9') version('0.2.0', sha256='2f4e67e7914c95fb0cce766bab173eb2c5860ee420108fa183099557ac2e50e9') - depends_on('python@2.6:2.8,3.1:') + depends_on('python@2.6:2.8,3.1:', type=('build', 'run')) + depends_on('python@2.7:2.8,3.6:', when='@0.2.8:', type=('build', 'run')) depends_on('py-setuptools@0.6:', type='build') depends_on('py-multiprocess@0.70.7:', type=('build', 'run')) depends_on('py-pox@0.2.5:', type=('build', 'run')) + depends_on('py-pox@0.3.0:', type=('build', 'run'), when='@0.2.8:') depends_on('py-ppft@1.6.4.9:', type=('build', 'run')) + depends_on('py-ppft@1.6.6.4:', type=('build', 'run'), when='@0.2.8:') depends_on('py-dill@0.2.9:', type=('build', 'run')) + depends_on('py-dill@0.3.4:', type=('build', 'run'), when='@0.2.8:') + depends_on('py-multiprocess@0.70.12:', type=('build', 'run'), when='@0.2.8:') def url_for_version(self, version): url = self.url.rsplit('/', 1)[0] - if version >= Version('0.2.2'): + if Version('0.2.8') > version >= Version('0.2.2'): url += '/pathos-{0}.tar.gz' else: url += '/pathos-{0}.zip' diff --git a/var/spack/repos/builtin/packages/py-petsc4py/package.py b/var/spack/repos/builtin/packages/py-petsc4py/package.py index 21adeb3d1cd..2b02c4f0f6e 100644 --- a/var/spack/repos/builtin/packages/py-petsc4py/package.py +++ b/var/spack/repos/builtin/packages/py-petsc4py/package.py @@ -14,9 +14,10 @@ class PyPetsc4py(PythonPackage): url = "http://ftp.mcs.anl.gov/pub/petsc/release-snapshots/petsc4py-3.15.0.tar.gz" git = "https://gitlab.com/petsc/petsc.git" - maintainers = ['dalcinl', 'balay'] + maintainers = ['balay'] version('main', branch='main') + version('3.15.2', sha256='d7ed1d79d88b35da563d25e733f276595ba538c52756225f79ba92e1cc4658d3') version('3.15.1', sha256='4ec8f42081e4d6a61157b32869b352dcb18c69077f2d1e4160f3837efd9e150f') version('3.15.0', sha256='87dcc5ef63a1f0e1a963619f7527e623f52341b2806056b0ef5fdfb0b8b287ad') version('3.14.1', sha256='f5f8daf3a4cd1dfc945876b0d83a05b25f3c54e08046312eaa3e3036b24139c0') diff --git a/var/spack/repos/builtin/packages/py-pox/package.py b/var/spack/repos/builtin/packages/py-pox/package.py index ca2debbd75b..b9d1bcd628f 100644 --- a/var/spack/repos/builtin/packages/py-pox/package.py +++ b/var/spack/repos/builtin/packages/py-pox/package.py @@ -12,18 +12,20 @@ class PyPox(PythonPackage): homepage = "https://github.com/uqfoundation/pox" pypi = "pox/pox-0.2.5.tar.gz" + version('0.3.0', sha256='cb968350b186466bb4905a21084587ec3aa6fd7aa0ef55d416ee0d523e2abe31') version('0.2.5', sha256='2b53fbdf02596240483dc2cb94f94cc21252ad1b1858c7b1c151afeec9022cc8') version('0.2.3', sha256='d3e8167a1ebe08ae56262a0b9359118d90bc4648cd284b5d10ae240343100a75') version('0.2.2', sha256='c0b88e59ef0e4f2fa4839e11bf90d2c32d6ceb5abaf01f0c8138f7558e6f87c1') version('0.2.1', sha256='580bf731fee233c58eac0974011b5bf0698efb7337b0a1696d289043b4fcd7f4') - depends_on('python@2.5:2.8,3.1:') + depends_on('python@2.5:2.8,3.1:', type=('build', 'run')) + depends_on('python@2.7:2.8,3.6:', when='@0.3.0:', type=('build', 'run')) depends_on('py-setuptools@0.6:', type='build') def url_for_version(self, version): url = "https://pypi.io/packages/source/p/pox/" - if version >= Version('0.2.4'): + if Version('0.3.0') > version >= Version('0.2.4'): url += 'pox-{0}.tar.gz' else: url += 'pox-{0}.zip' diff --git a/var/spack/repos/builtin/packages/py-ppft/package.py b/var/spack/repos/builtin/packages/py-ppft/package.py index b59359b1d61..758280ed5ca 100644 --- a/var/spack/repos/builtin/packages/py-ppft/package.py +++ b/var/spack/repos/builtin/packages/py-ppft/package.py @@ -12,20 +12,23 @@ class PyPpft(PythonPackage): homepage = "https://github.com/uqfoundation/ppft" pypi = "ppft/ppft-1.6.4.9.tar.gz" + version('1.6.6.4', sha256='473442cc6731856990bd25bd6b454bb98720007de4523a73c560bdd0060463d2') version('1.6.4.9', sha256='5537b00afb7b247da0f59cc57ee5680178be61c8b2e21b5a0672b70a3d247791') version('1.6.4.7.1', sha256='f94b26491b4a36adc975fc51dba7568089a24756007a3a4ef3414a98d7337651') version('1.6.4.6', sha256='92d09061f5425634c43dbf99c5558f2cf2a2e1e351929f8da7e85f4649c11095') version('1.6.4.5', sha256='d47da9d2e553848b75727ce7c510f9e149965d5c68f9fc56c774a7c6a3d18214') - depends_on('python@2.5:2.8,3.1:') + depends_on('python@2.5:2.8,3.1:', type=('build', 'run')) + depends_on('python@2.7:2.8,3.6:', when='@1.6.6.4:', type=('build', 'run')) depends_on('py-setuptools@0.6:', type='build') depends_on('py-six@1.7.3:', type=('build', 'run')) depends_on('py-dill@0.2.6:', type=('build', 'run')) + depends_on('py-dill@0.3.4:', type=('build', 'run'), when='@1.6.6.4:') def url_for_version(self, version): url = "https://pypi.io/packages/source/p/ppft/" - if version >= Version('1.6.4.8'): + if Version('1.6.6.4') > version >= Version('1.6.4.8'): url += 'ppft-{0}.tar.gz' else: url += 'ppft-{0}.zip' diff --git a/var/spack/repos/builtin/packages/py-pretrainedmodels/package.py b/var/spack/repos/builtin/packages/py-pretrainedmodels/package.py new file mode 100644 index 00000000000..64171f11b9e --- /dev/null +++ b/var/spack/repos/builtin/packages/py-pretrainedmodels/package.py @@ -0,0 +1,21 @@ +# Copyright 2013-2021 Lawrence Livermore National Security, LLC and other +# Spack Project Developers. See the top-level COPYRIGHT file for details. +# +# SPDX-License-Identifier: (Apache-2.0 OR MIT) + +from spack import * + + +class PyPretrainedmodels(PythonPackage): + """Pretrained models for Pytorch.""" + + homepage = "https://github.com/cadene/pretrained-models.pytorch" + pypi = "pretrainedmodels/pretrainedmodels-0.7.4.tar.gz" + + version('0.7.4', sha256='7e77ead4619a3e11ab3c41982c8ad5b86edffe37c87fd2a37ec3c2cc6470b98a') + + depends_on('py-setuptools', type='build') + depends_on('py-torch', type=('build', 'run')) + depends_on('py-torchvision', type=('build', 'run')) + depends_on('py-munch', type=('build', 'run')) + depends_on('py-tqdm', type=('build', 'run')) diff --git a/var/spack/repos/builtin/packages/py-pybids/package.py b/var/spack/repos/builtin/packages/py-pybids/package.py new file mode 100644 index 00000000000..2706af23cd9 --- /dev/null +++ b/var/spack/repos/builtin/packages/py-pybids/package.py @@ -0,0 +1,27 @@ +# Copyright 2013-2021 Lawrence Livermore National Security, LLC and other +# Spack Project Developers. See the top-level COPYRIGHT file for details. +# +# SPDX-License-Identifier: (Apache-2.0 OR MIT) + +from spack import * + + +class PyPybids(PythonPackage): + """bids: interface with datasets conforming to BIDS""" + + homepage = "http://github.com/bids-standard/pybids" + pypi = "pybids/pybids-0.13.1.tar.gz" + + version('0.13.1', sha256='c920e1557e1dae8b671625d70cafbdc28437ba2822b2db9da4c2587a7625e3ba') + + depends_on('python@3.5:', type=('build', 'run')) + depends_on('py-setuptools@30.3.0:', type='build') + depends_on('py-numpy', type=('build', 'run')) + depends_on('py-scipy', type=('build', 'run')) + depends_on('py-nibabel@2.1:', type=('build', 'run')) + depends_on('py-pandas@0.23:', type=('build', 'run')) + depends_on('py-patsy', type=('build', 'run')) + depends_on('py-sqlalchemy@:1.3.999', type=('build', 'run')) + depends_on('py-bids-validator', type=('build', 'run')) + depends_on('py-num2words', type=('build', 'run')) + depends_on('py-click', type=('build', 'run')) diff --git a/var/spack/repos/builtin/packages/py-pybind11/package.py b/var/spack/repos/builtin/packages/py-pybind11/package.py index 77f3475dc1e..f3b60ffa217 100644 --- a/var/spack/repos/builtin/packages/py-pybind11/package.py +++ b/var/spack/repos/builtin/packages/py-pybind11/package.py @@ -25,6 +25,7 @@ class PyPybind11(CMakePackage): maintainers = ['ax3l'] version('master', branch='master') + version('2.7.0', sha256='6cd73b3d0bf3daf415b5f9b87ca8817cc2e2b64c275d65f9500250f9fee1677e') version('2.6.2', sha256='8ff2fff22df038f5cd02cea8af56622bc67f5b64534f1b83b9f133b8366acff2') version('2.6.1', sha256='cdbe326d357f18b83d10322ba202d69f11b2f49e2d87ade0dc2be0c5c34f8e2a') version('2.5.0', sha256='97504db65640570f32d3fdf701c25a340c8643037c3b69aec469c10c93dc8504', preferred=True) diff --git a/var/spack/repos/builtin/packages/py-pydocstyle/package.py b/var/spack/repos/builtin/packages/py-pydocstyle/package.py new file mode 100644 index 00000000000..12c50b83eb0 --- /dev/null +++ b/var/spack/repos/builtin/packages/py-pydocstyle/package.py @@ -0,0 +1,22 @@ +# Copyright 2013-2021 Lawrence Livermore National Security, LLC and other +# Spack Project Developers. See the top-level COPYRIGHT file for details. +# +# SPDX-License-Identifier: (Apache-2.0 OR MIT) + +from spack import * + + +class PyPydocstyle(PythonPackage): + """Python docstring style checker.""" + + homepage = "https://github.com/PyCQA/pydocstyle/" + pypi = "pydocstyle/pydocstyle-6.1.1.tar.gz" + + version('6.1.1', sha256='1d41b7c459ba0ee6c345f2eb9ae827cab14a7533a88c5c6f7e94923f72df92dc') + + variant('toml', default=True, description='Allow pydocstyle to read pyproject.toml') + + depends_on('python@3.6:', type=('build', 'run')) + depends_on('py-setuptools', type=('build', 'run')) + depends_on('py-snowballstemmer', type=('build', 'run')) + depends_on('py-toml', when='+toml', type=('build', 'run')) diff --git a/var/spack/repos/builtin/packages/py-pygithub/package.py b/var/spack/repos/builtin/packages/py-pygithub/package.py new file mode 100644 index 00000000000..da6c3aac82a --- /dev/null +++ b/var/spack/repos/builtin/packages/py-pygithub/package.py @@ -0,0 +1,22 @@ +# Copyright 2013-2021 Lawrence Livermore National Security, LLC and other +# Spack Project Developers. See the top-level COPYRIGHT file for details. +# +# SPDX-License-Identifier: (Apache-2.0 OR MIT) + +from spack import * + + +class PyPygithub(PythonPackage): + """Use the full Github API v3""" + + homepage = "https://pygithub.readthedocs.io/" + pypi = "PyGithub/PyGithub-1.54.1.tar.gz" + + version('1.55', sha256='1bbfff9372047ff3f21d5cd8e07720f3dbfdaf6462fcaed9d815f528f1ba7283') + + depends_on('python@3.6:', type=('build', 'run')) + depends_on('py-setuptools', type='build') + depends_on('py-deprecated', type=('build', 'run')) + depends_on('py-pyjwt@2:', type=('build', 'run')) + depends_on('py-pynacl@1.4.0:', type=('build', 'run')) + depends_on('py-requests@2.14.0:', type=('build', 'run')) diff --git a/var/spack/repos/builtin/packages/py-pyperclip/package.py b/var/spack/repos/builtin/packages/py-pyperclip/package.py index 1d0ac973cfc..f1947cc507c 100644 --- a/var/spack/repos/builtin/packages/py-pyperclip/package.py +++ b/var/spack/repos/builtin/packages/py-pyperclip/package.py @@ -12,6 +12,8 @@ class PyPyperclip(PythonPackage): homepage = "https://github.com/asweigart/pyperclip" pypi = "pyperclip/pyperclip-1.7.0.tar.gz" + version('1.8.2', sha256='105254a8b04934f0bc84e9c24eb360a591aaf6535c9def5f29d92af107a9bf57') version('1.7.0', sha256='979325468ccf682104d5dcaf753f869868100631301d3e72f47babdea5700d1c') depends_on('py-setuptools', type='build') + depends_on('xclip', type='run', when='platform=linux') diff --git a/var/spack/repos/builtin/packages/py-pyprecice/deactivate-version-check-via-pip.patch b/var/spack/repos/builtin/packages/py-pyprecice/deactivate-version-check-via-pip.patch deleted file mode 100644 index e7b13aa6663..00000000000 --- a/var/spack/repos/builtin/packages/py-pyprecice/deactivate-version-check-via-pip.patch +++ /dev/null @@ -1,32 +0,0 @@ -diff --git a/setup.py b/setup.py -index 9282639..d69c285 100644 ---- a/setup.py -+++ b/setup.py -@@ -1,15 +1,20 @@ - import os - import subprocess - import warnings --from packaging import version --import pip -+from setuptools._vendor.packaging import version -+ -+# If installed with pip we need to check its version -+try: -+ import pip -+ if version.parse(pip.__version__) < version.parse("19.0"): -+ # version 19.0 is required, since we are using pyproject.toml for definition of build-time depdendencies. See https://pip.pypa.io/en/stable/news/#id209 -+ warnings.warn("You are using pip version {}. However, pip version > 19.0 is recommended. You can continue with the installation, but installation problems can occour. Please refer to https://github.com/precice/python-bindings#build-time-dependencies-cython-numpy-defined-in-pyprojecttoml-are-not-installed-automatically for help.".format(pip.__version__)) - --if version.parse(pip.__version__) < version.parse("19.0"): -- # version 19.0 is required, since we are using pyproject.toml for definition of build-time depdendencies. See https://pip.pypa.io/en/stable/news/#id209 -- warnings.warn("You are using pip version {}. However, pip version > 19.0 is recommended. You can continue with the installation, but installation problems can occour. Please refer to https://github.com/precice/python-bindings#build-time-dependencies-cython-numpy-defined-in-pyprojecttoml-are-not-installed-automatically for help.".format(pip.__version__)) -+ if version.parse(pip.__version__) < version.parse("10.0.1"): -+ warnings.warn("You are using pip version {}. However, pip version > 10.0.1 is required. If you continue with installation it is likely that you will face an error. See https://github.com/precice/python-bindings#version-of-pip3-is-too-old".format(pip.__version__)) -+except: -+ warnings.warn("Assuming that you are not using pip!") - --if version.parse(pip.__version__) < version.parse("10.0.1"): -- warnings.warn("You are using pip version {}. However, pip version > 10.0.1 is required. If you continue with installation it is likely that you will face an error. See https://github.com/precice/python-bindings#version-of-pip3-is-too-old".format(pip.__version__)) - - from enum import Enum - from setuptools import setup diff --git a/var/spack/repos/builtin/packages/py-pyprecice/package.py b/var/spack/repos/builtin/packages/py-pyprecice/package.py index 422873d350a..792802fe31a 100644 --- a/var/spack/repos/builtin/packages/py-pyprecice/package.py +++ b/var/spack/repos/builtin/packages/py-pyprecice/package.py @@ -30,11 +30,6 @@ class PyPyprecice(PythonPackage): version("2.0.0.2", sha256="5f055d809d65ec2e81f4d001812a250f50418de59990b47d6bcb12b88da5f5d7") version("2.0.0.1", sha256="96eafdf421ec61ad6fcf0ab1d3cf210831a815272984c470b2aea57d4d0c9e0e") - # Older versions of the bindings checked versions via pip. This patch - # removes the pip dependency. - # See also https://github.com/spack/spack/pull/19558 - patch("deactivate-version-check-via-pip.patch", when="@:2.1.1.1") - depends_on("precice@develop", when="@develop") depends_on("precice@2.2.1", when="@2.2.1.1:2.2.1.99") depends_on("precice@2.2.0", when="@2.2.0.1:2.2.0.99") @@ -44,22 +39,16 @@ class PyPyprecice(PythonPackage): depends_on("precice@2.0.1", when="@2.0.1.1:2.0.1.99") depends_on("precice@2.0.0", when="@2.0.0.1:2.0.0.99") - depends_on("python@3:", type=("build", "run")) + depends_on("python@3:", type=("build", "link", "run")) depends_on("py-setuptools", type="build") - depends_on("py-numpy", type=("build", "run")) + depends_on("py-numpy", type=("build", "link", "run")) depends_on("py-mpi4py", type=("build", "run")) - depends_on("py-cython@0.29:", type=("build")) + depends_on("py-cython@0.29:", type="build") + depends_on("py-packaging", when="@:2.1", type="build") + depends_on("py-pip", when="@:2.1", type="build") - phases = ['install_lib', 'build_ext', 'install'] - - def build_ext_args(self, spec, prefix): - return [ - "--include-dirs=" + spec["precice"].headers.directories[0], - "--library-dirs=" + spec["precice"].libs.directories[0] - ] - - def install(self, spec, prefix): - # Older versions of the bindings had a non-standard installation routine - # See also https://github.com/spack/spack/pull/19558#discussion_r513123239 - if self.version <= Version("2.1.1.1"): - self.setup_py("install", "--prefix={0}".format(prefix)) + @when("@:2.1") + def patch(self): + filter_file( + "distutils.command.install", "setuptools.command.install", "setup.py" + ) diff --git a/var/spack/repos/builtin/packages/py-pyproj/package.py b/var/spack/repos/builtin/packages/py-pyproj/package.py index c7f00b4fc7e..01dc4cccdf3 100644 --- a/var/spack/repos/builtin/packages/py-pyproj/package.py +++ b/var/spack/repos/builtin/packages/py-pyproj/package.py @@ -7,7 +7,8 @@ class PyPyproj(PythonPackage): - """Python interface to the PROJ.4 Library.""" + """Python interface to PROJ (cartographic projections and + coordinate transformations library).""" homepage = "https://github.com/pyproj4/pyproj" pypi = "pyproj/pyproj-2.2.0.tar.gz" @@ -15,23 +16,44 @@ class PyPyproj(PythonPackage): maintainers = ['citibeth', 'adamjstewart'] + version('3.1.0', sha256='67b94f4e694ae33fc90dfb7da0e6b5ed5f671dd0acc2f6cf46e9c39d56e16e1a') + version('3.0.1', sha256='bfbac35490dd17f706700673506eeb8170f8a2a63fb5878171d4e6eef242d141') + version('3.0.0', sha256='539e320d06e5441edadad2e2ab276e1877445eca384fc1c056b5501453d433c2') + version('2.6.1', sha256='52556f245f1112f121091937b47738d1fbcbd0f13be6fb32689de31ab0975d24') version('2.6.0', sha256='977542d2f8cf2981cf3ad72cedfebcd6ac56977c7aa830d9b49fa7888b56e83d') version('2.2.0', sha256='0a4f793cc93539c2292638c498e24422a2ec4b25cb47545addea07724b2a56e5') version('2.1.3', sha256='99c52788b01a7bb9a88024bf4d40965c0a66a93d654600b5deacf644775f424d') - version('1.9.6', sha256='e0c02b1554b20c710d16d673817b2a89ff94738b0b537aead8ecb2edc4c4487b') - version('1.9.5.1', sha256='53fa54c8fa8a1dfcd6af4bf09ce1aae5d4d949da63b90570ac5ec849efaf3ea8') + version('1.9.6', sha256='e0c02b1554b20c710d16d673817b2a89ff94738b0b537aead8ecb2edc4c4487b', deprecated=True) + version('1.9.5.1', sha256='53fa54c8fa8a1dfcd6af4bf09ce1aae5d4d949da63b90570ac5ec849efaf3ea8', deprecated=True) - depends_on('python@:2', when='@:1.9.5.1') - depends_on('python@3:', when='@2.3:') - depends_on('python@3.5:', when='@2.6.0:') - depends_on('py-setuptools', type='build') - depends_on('py-cython', type='build') - depends_on('py-cython@0.28:', when='@2.6.0:') - depends_on('py-aenum', type=('build', 'run'), when='@2.2:^python@:3.5') + # In setup.cfg and setup.py + depends_on('python@3.7:', when='@3.1:', type=('build', 'link', 'run')) + depends_on('python@3.6:', when='@3.0:', type=('build', 'link', 'run')) + depends_on('python@3.5:', when='@2.3:', type=('build', 'link', 'run')) + depends_on('python@2.7:2.8,3.5:', when='@2.2:', type=('build', 'link', 'run')) + depends_on('python@2.6:2.8,3.3:', type=('build', 'link', 'run')) + + # In setup.py + # https://pyproj4.github.io/pyproj/stable/installation.html#installing-from-source depends_on('proj') - depends_on('proj@:5', when='@:1') - depends_on('proj@6.1:', when='@2.2:') - depends_on('proj@6.0:', when='@2.0:') + depends_on('proj@7.2:', when='@3.0.1:') + depends_on('proj@7.2.0:7.2.999', when='@3.0.0') + depends_on('proj@6.2:7.0', when='@2.4:2.6') + depends_on('proj@6.1:7.0', when='@2.2:2.3') + depends_on('proj@6.0:6.999', when='@2.0:2.1') + depends_on('proj@:5.2', when='@:1.9') + + # In setup.py + depends_on('py-setuptools', type='build') + depends_on('py-certifi', when='@3.0:', type=('build', 'run')) + depends_on('py-aenum', when='@2.2.0:2.2.999 ^python@:3.5.999', type=('build', 'run')) + + # In pyproject.toml + depends_on('py-cython@0.28.4:', when='@2.0:') def setup_build_environment(self, env): + # https://pyproj4.github.io/pyproj/stable/installation.html#pyproj-build-environment-variables + env.set('PROJ_VERSION', self.spec['proj'].version) env.set('PROJ_DIR', self.spec['proj'].prefix) + env.set('PROJ_LIBDIR', self.spec['proj'].libs.directories[0]) + env.set('PROJ_INCDIR', self.spec['proj'].headers.directories[0]) diff --git a/var/spack/repos/builtin/packages/py-pyrsistent/package.py b/var/spack/repos/builtin/packages/py-pyrsistent/package.py index 72708b8fab5..5bf81eb4c96 100644 --- a/var/spack/repos/builtin/packages/py-pyrsistent/package.py +++ b/var/spack/repos/builtin/packages/py-pyrsistent/package.py @@ -16,6 +16,6 @@ class PyPyrsistent(PythonPackage): version('0.15.7', sha256='cdc7b5e3ed77bed61270a47d35434a30617b9becdf2478af76ad2c6ade307280') - depends_on('python@2.7:2.8,3.5:', type=('build', 'run')) + depends_on('python@2.7:2.8,3.5:', type=('build', 'link', 'run')) depends_on('py-setuptools', type='build') depends_on('py-six', type=('build', 'run')) diff --git a/var/spack/repos/builtin/packages/py-python-xmp-toolkit/package.py b/var/spack/repos/builtin/packages/py-python-xmp-toolkit/package.py new file mode 100644 index 00000000000..1c31bf028ea --- /dev/null +++ b/var/spack/repos/builtin/packages/py-python-xmp-toolkit/package.py @@ -0,0 +1,20 @@ +# Copyright 2013-2021 Lawrence Livermore National Security, LLC and other +# Spack Project Developers. See the top-level COPYRIGHT file for details. +# +# SPDX-License-Identifier: (Apache-2.0 OR MIT) + +from spack import * + + +class PyPythonXmpToolkit(PythonPackage): + """Python XMP Toolkit for working with metadata.""" + + homepage = "https://github.com/python-xmp-toolkit/python-xmp-toolkit" + pypi = "python-xmp-toolkit/python-xmp-toolkit-2.0.1.tar.gz" + + version('2.0.1', sha256='f8d912946ff9fd46ed5c7c355aa5d4ea193328b3f200909ef32d9a28a1419a38') + + depends_on('python@2.6:2.7,3.3:', type=('build', 'run')) + depends_on('py-setuptools', type='build') + depends_on('py-pytz', type=('build', 'run')) + depends_on('exempi@2.2.0:', type=('build', 'run')) diff --git a/var/spack/repos/builtin/packages/py-pythran/package.py b/var/spack/repos/builtin/packages/py-pythran/package.py index dcefa7818c0..121eee704c8 100644 --- a/var/spack/repos/builtin/packages/py-pythran/package.py +++ b/var/spack/repos/builtin/packages/py-pythran/package.py @@ -12,14 +12,33 @@ class PyPythran(PythonPackage): homepage = "https://github.com/serge-sans-paille/pythran" pypi = "pythran/pythran-0.9.11.tar.gz" + version('0.9.12', sha256='5d50dc74dca1d3f902941865acbae981fc24cceeb9d54673d68d6b5c8c1b0001') version('0.9.11', sha256='a317f91e2aade9f6550dc3bf40b5caeb45b7e012daf27e2b3e4ad928edb01667') + version('0.9.10', sha256='8fa1d19624cb2950e5a18974fdcb0dffc57e1a821049dc95df09563edd673915') + version('0.9.9', sha256='aaabc97f30ad46d1d62303323de6697d2933779afa4666c15b0f433cb50825b1') + version('0.9.8', sha256='81c10a16fce9ed41211fb70e82fda6984e93f4602a164934648db8cbb08156b3') + version('0.9.7', sha256='ac36a94bd862e3c80dae585158b90d3e7c5c05fd252819f3ca7d880a1c7c1012') + version('0.9.6', sha256='2d102a55d9d53f77cf0f4a904eeb5cbaa8fe76e4892319a859fc618401e2f6ba') + version('0.9.5', sha256='815a778d6889593c0b8ddf08052cff36a504ce4cc8bd8d7bfb856a212f91486e') + version('0.9.4', sha256='ec9c91f5331454263b064027292556a184a9f55a50f8615e09b08f57a4909855') + version('0.9.3', sha256='217427a8225a331fdc8f3efe57871aed775cdf2c6e847a0a83df0aaae4b02493') + depends_on('python@3:', when='@0.9.6:', type=('build', 'run')) + depends_on('python@2.7:', when='@:0.9.5', type=('build', 'run')) depends_on('py-setuptools', type='build') depends_on('py-pytest-runner', type='build') depends_on('py-ply@3.4:', type=('build', 'run')) - depends_on('py-networkx@2:', type=('build', 'run')) - depends_on('py-decorator', type=('build', 'run')) - depends_on('py-gast@0.4.0:0.4.999', type=('build', 'run')) - depends_on('py-six', type=('build', 'run')) + depends_on('py-networkx@2:', when='@:0.9.11', type=('build', 'run')) + depends_on('py-decorator', when='@:0.9.11', type=('build', 'run')) + depends_on('py-gast@0.5.0:0.5.999', when='@0.9.12:', type=('build', 'run')) + depends_on('py-gast@0.4.0:0.4.999', when='@0.9.7:0.9.11', type=('build', 'run')) + depends_on('py-gast@0.3.3:0.3.999', when='@0.9.6', type=('build', 'run')) + depends_on('py-gast@0.3.0:', when='@0.9.4:0.9.5', type=('build', 'run')) + depends_on('py-gast', when='@:0.9.3', type=('build', 'run')) + depends_on('py-six', when='@:0.9.11', type=('build', 'run')) depends_on('py-numpy', type=('build', 'run')) - depends_on('py-beniget@0.3.0:0.3.999', type=('build', 'run')) + depends_on('py-beniget@0.4.0:0.4.999', when='@0.9.12:', type=('build', 'run')) + depends_on('py-beniget@0.3.0:0.3.999', when='@0.9.7:0.9.11', type=('build', 'run')) + depends_on('py-beniget@0.2.1:0.2.999', when='@0.9.6', type=('build', 'run')) + depends_on('py-beniget@0.2.0:', when='@0.9.4:0.9.5', type=('build', 'run')) + depends_on('py-beniget', when='@:0.9.3', type=('build', 'run')) diff --git a/var/spack/repos/builtin/packages/py-pytorch-lightning/package.py b/var/spack/repos/builtin/packages/py-pytorch-lightning/package.py index 982362e9669..7dd74c3b597 100644 --- a/var/spack/repos/builtin/packages/py-pytorch-lightning/package.py +++ b/var/spack/repos/builtin/packages/py-pytorch-lightning/package.py @@ -12,20 +12,24 @@ class PyPytorchLightning(PythonPackage): homepage = "https://github.com/PyTorchLightning/pytorch-lightning" pypi = "pytorch-lightning/pytorch-lightning-1.2.10.tar.gz" + version('1.3.8', sha256='60b0a3e464d394864dae4c8d251afa7aa453644a19bb7672f5ee400343cdf7b0') version('1.2.10', sha256='2d8365e30ded0c20e73ce6e5b6028478ae460b8fd33727df2275666df005a301') - conflicts('py-pyyaml@5.4') # OmegaConf requirement >=5.1 - conflicts('py-tensorboard@2.5.0') # 2.5.0 GPU CI error: Couldn't build proto file into descriptor pool! - - # requirements from setup.py - depends_on('py-setuptools', type='build') - depends_on('python@3.6:', type=('build', 'run')) - depends_on('py-torch@1.4:', type=('build', 'run')) - depends_on('py-numpy@1.16.6:', type=('build', 'run')) - depends_on('py-future@0.17.1:', type=('build', 'run')) - depends_on('py-pyyaml@5.1:', type=('build', 'run')) - depends_on('py-tqdm@4.41.0:', type=('build', 'run')) - depends_on('py-fsspec@0.8.1:+http', type=('build', 'run')) - depends_on('py-tensorboard@2.2.0:', type=('build', 'run')) - depends_on('py-torchmetrics@0.2.0', type=('build', 'run')) - depends_on('py-packaging', type=('build', 'run')) + depends_on('python@3.6:', type=('build', 'run')) + depends_on('py-setuptools', type='build') + depends_on('py-numpy@1.17.2:', when='@1.3:', type=('build', 'run')) + depends_on('py-numpy@1.16.6:', when='@:1.2', type=('build', 'run')) + depends_on('py-torch@1.4:', type=('build', 'run')) + depends_on('py-future@0.17.1:', type=('build', 'run')) + depends_on('py-tqdm@4.41.0:', type=('build', 'run')) + depends_on('py-pyyaml@5.1:5.4.1', when='@1.3:', type=('build', 'run')) + depends_on('py-pyyaml@5.1:5.3,5.5:', when='@:1.2', type=('build', 'run')) + depends_on('py-fsspec@2021.05.0:2021.05.999,2021.06.1:', when='@1.3:', type=('build', 'run')) + depends_on('py-fsspec@0.8.1:+http', when='@:1.2', type=('build', 'run')) + depends_on('py-tensorboard@2.2.0:2.4.999,2.5.1:', type=('build', 'run')) + depends_on('py-torchmetrics@0.2.0:', when='@1.3:', type=('build', 'run')) + depends_on('py-torchmetrics@0.2.0', when='@:1.2', type=('build', 'run')) + depends_on('py-pydeprecate@0.3.0', when='@1.3:', type=('build', 'run')) + depends_on('py-packaging@17.0:', when='@1.3:', type=('build', 'run')) + depends_on('py-packaging', type=('build', 'run')) + depends_on('pil@:8.2.999,8.3.1:', when='@1.3:', type=('build', 'run')) diff --git a/var/spack/repos/builtin/packages/py-requests-ftp/package.py b/var/spack/repos/builtin/packages/py-requests-ftp/package.py new file mode 100644 index 00000000000..b61c3a51225 --- /dev/null +++ b/var/spack/repos/builtin/packages/py-requests-ftp/package.py @@ -0,0 +1,18 @@ +# Copyright 2013-2021 Lawrence Livermore National Security, LLC and other +# Spack Project Developers. See the top-level COPYRIGHT file for details. +# +# SPDX-License-Identifier: (Apache-2.0 OR MIT) + +from spack import * + + +class PyRequestsFtp(PythonPackage): + """FTP Transport Adapter for Requests..""" + + homepage = "https://github.com/Lukasa/requests-ftp" + pypi = "requests-ftp/requests-ftp-0.3.1.tar.gz" + + version('0.3.1', sha256='7504ceb5cba8a5c0135ed738596820a78c5f2be92d79b29f96ba99b183d8057a') + + depends_on('py-setuptools', type='build') + depends_on('py-requests', type=('build', 'run')) diff --git a/var/spack/repos/builtin/packages/py-requests-unixsocket/package.py b/var/spack/repos/builtin/packages/py-requests-unixsocket/package.py new file mode 100644 index 00000000000..f8e3fee7b1c --- /dev/null +++ b/var/spack/repos/builtin/packages/py-requests-unixsocket/package.py @@ -0,0 +1,19 @@ +# Copyright 2013-2021 Lawrence Livermore National Security, LLC and other +# Spack Project Developers. See the top-level COPYRIGHT file for details. +# +# SPDX-License-Identifier: (Apache-2.0 OR MIT) + +from spack import * + + +class PyRequestsUnixsocket(PythonPackage): + """Use requests to talk HTTP via a UNIX domain socket.""" + + homepage = "https://github.com/msabramo/requests-unixsocket" + pypi = "requests-unixsocket/requests-unixsocket-0.2.0.tar.gz" + + version('0.2.0', sha256='9e5c1a20afc3cf786197ae59c79bcdb0e7565f218f27df5f891307ee8817c1ea') + + depends_on('py-setuptools', type='build') + depends_on('py-requests@1.1:', type=('build', 'run')) + depends_on('py-urllib3@1.8:', type=('build', 'run')) diff --git a/var/spack/repos/builtin/packages/py-rnc2rng/package.py b/var/spack/repos/builtin/packages/py-rnc2rng/package.py new file mode 100644 index 00000000000..d9282d36b37 --- /dev/null +++ b/var/spack/repos/builtin/packages/py-rnc2rng/package.py @@ -0,0 +1,18 @@ +# Copyright 2013-2021 Lawrence Livermore National Security, LLC and other +# Spack Project Developers. See the top-level COPYRIGHT file for details. +# +# SPDX-License-Identifier: (Apache-2.0 OR MIT) + +from spack import * + + +class PyRnc2rng(PythonPackage): + """RELAX NG Compact to regular syntax conversion library.""" + + homepage = "https://github.com/djc/rnc2rng" + pypi = "rnc2rng/rnc2rng-2.6.5.tar.gz" + + version('2.6.5', sha256='d354afcf0bf8e3b1e8f8d37d71a8fe5b1c0cf75cbd4b71364a9d90b5108a16e5') + + depends_on('py-setuptools', type='build') + depends_on('py-rply', type=('build', 'run')) diff --git a/var/spack/repos/builtin/packages/py-rply/package.py b/var/spack/repos/builtin/packages/py-rply/package.py new file mode 100644 index 00000000000..7fd1505a85e --- /dev/null +++ b/var/spack/repos/builtin/packages/py-rply/package.py @@ -0,0 +1,18 @@ +# Copyright 2013-2021 Lawrence Livermore National Security, LLC and other +# Spack Project Developers. See the top-level COPYRIGHT file for details. +# +# SPDX-License-Identifier: (Apache-2.0 OR MIT) + +from spack import * + + +class PyRply(PythonPackage): + """A pure Python Lex/Yacc that works with RPython.""" + + homepage = "https://github.com/alex/rply/" + pypi = "rply/rply-0.7.8.tar.gz" + + version('0.7.8', sha256='2a808ac25a4580a9991fc304d64434e299a8fc75760574492f242cbb5bb301c9') + + depends_on('py-setuptools', type='build') + depends_on('py-appdirs', type=('build', 'run')) diff --git a/var/spack/repos/builtin/packages/py-rtree/package.py b/var/spack/repos/builtin/packages/py-rtree/package.py index ea156016983..4550ba88414 100644 --- a/var/spack/repos/builtin/packages/py-rtree/package.py +++ b/var/spack/repos/builtin/packages/py-rtree/package.py @@ -7,18 +7,21 @@ class PyRtree(PythonPackage): - """Python interface to the RTREE.4 Library.""" - homepage = "http://toblerity.org/rtree/" + """R-Tree spatial index for Python GIS.""" + + homepage = "https://github.com/Toblerity/rtree" pypi = "Rtree/Rtree-0.8.3.tar.gz" + version('0.9.7', sha256='be8772ca34699a9ad3fb4cfe2cfb6629854e453c10b3328039301bbfc128ca3e') version('0.8.3', sha256='6cb9cf3000963ea6a3db777a597baee2bc55c4fc891e4f1967f262cc96148649') + depends_on('python@3:', when='@0.9.4:', type=('build', 'run')) depends_on('py-setuptools', type='build') - depends_on('libspatialindex') + depends_on('py-wheel', when='@0.9.4:', type='build') + depends_on('libspatialindex@1.8.5:') def setup_build_environment(self, env): - lib = self.spec['libspatialindex'].prefix.lib - env.set('SPATIALINDEX_LIBRARY', - join_path(lib, 'libspatialindex.%s' % dso_suffix)) - env.set('SPATIALINDEX_C_LIBRARY', - join_path(lib, 'libspatialindex_c.%s' % dso_suffix)) + env.set('SPATIALINDEX_C_LIBRARY', self.spec['libspatialindex'].libs[0]) + + def setup_run_environment(self, env): + self.setup_build_environment(env) diff --git a/var/spack/repos/builtin/packages/py-salib/package.py b/var/spack/repos/builtin/packages/py-salib/package.py new file mode 100644 index 00000000000..cdc49ccc9b3 --- /dev/null +++ b/var/spack/repos/builtin/packages/py-salib/package.py @@ -0,0 +1,24 @@ +# Copyright 2013-2021 Lawrence Livermore National Security, LLC and other +# Spack Project Developers. See the top-level COPYRIGHT file for details. +# +# SPDX-License-Identifier: (Apache-2.0 OR MIT) + +from spack import * + + +class PySalib(PythonPackage): + """Python implementations of commonly used sensitivity analysis methods.""" + + homepage = "http://salib.readthedocs.org" + pypi = "SALib/SALib-1.4.0.1.tar.gz" + + maintainers = ['schmitts'] + + version('1.4.0.1', sha256='dbf6e865af9f3be82a79cf64889ed66d6d3b6803f0c22a242a112876789d49e7') + + depends_on('py-setuptools@38.3:', type=('build', 'run')) + depends_on('py-numpy@1.16.5:', type=('build', 'run')) + depends_on('py-scipy@1.5.2:', type=('build', 'run')) + depends_on('py-matplotlib@3.2.2:', type=('build', 'run')) + depends_on('py-pandas@1.1.2:', type=('build', 'run')) + depends_on('py-pathos@0.2.5:', type=('build', 'run')) diff --git a/var/spack/repos/builtin/packages/py-segmentation-models-pytorch/package.py b/var/spack/repos/builtin/packages/py-segmentation-models-pytorch/package.py new file mode 100644 index 00000000000..11bfd998e98 --- /dev/null +++ b/var/spack/repos/builtin/packages/py-segmentation-models-pytorch/package.py @@ -0,0 +1,22 @@ +# Copyright 2013-2021 Lawrence Livermore National Security, LLC and other +# Spack Project Developers. See the top-level COPYRIGHT file for details. +# +# SPDX-License-Identifier: (Apache-2.0 OR MIT) + +from spack import * + + +class PySegmentationModelsPytorch(PythonPackage): + """Python library with Neural Networks for Image Segmentation based on PyTorch.""" + + homepage = "https://github.com/qubvel/segmentation_models.pytorch" + pypi = "segmentation_models_pytorch/segmentation_models_pytorch-0.2.0.tar.gz" + + version('0.2.0', sha256='247266722c23feeef16b0862456c5ce815e5f0a77f95c2cd624a71bf00d955df') + + depends_on('python@3:', type=('build', 'run')) + depends_on('py-setuptools', type='build') + depends_on('py-torchvision@0.5.0:', type=('build', 'run')) + depends_on('py-pretrainedmodels@0.7.4', type=('build', 'run')) + depends_on('py-efficientnet-pytorch@0.6.3', type=('build', 'run')) + depends_on('py-timm@0.4.12', type=('build', 'run')) diff --git a/var/spack/repos/builtin/packages/py-setuptools-rust/package.py b/var/spack/repos/builtin/packages/py-setuptools-rust/package.py index b7f36d6b019..868bc5007a2 100644 --- a/var/spack/repos/builtin/packages/py-setuptools-rust/package.py +++ b/var/spack/repos/builtin/packages/py-setuptools-rust/package.py @@ -3,16 +3,35 @@ # # SPDX-License-Identifier: (Apache-2.0 OR MIT) +from spack import * + class PySetuptoolsRust(PythonPackage): """Setuptools rust extension plugin.""" homepage = "https://github.com/PyO3/setuptools-rust" - url = "https://github.com/PyO3/setuptools-rust/archive/v0.10.6.tar.gz" + pypi = "setuptools-rust/setuptools-rust-0.12.1.tar.gz" - version('0.10.6', sha256='1446d3985e4aaf4cc679fda8a48a73ac1390b627c8ae1bebe7d9e08bb3b33769') + version('0.12.1', sha256='647009e924f0ae439c7f3e0141a184a69ad247ecb9044c511dabde232d3d570e') + # Version 0.10.6 is not available on pypi and can only be found on github + version('0.10.6', sha256='1446d3985e4aaf4cc679fda8a48a73ac1390b627c8ae1bebe7d9e08bb3b33769', + # version specific url is not used here because spack checksum would + # use it instead of pypi (see #24668) + # url="https://github.com/PyO3/setuptools-rust/archive/v0.10.6.tar.gz", + deprecated=True) + depends_on('python@3.6:', when='@0.12:', type=('build', 'run')) + depends_on('py-setuptools@46.1:', when='@0.11.6:', type='build') depends_on('py-setuptools', type='build') + depends_on('py-setuptools-scm+toml@3.4.3:', when='@0.11:', type='build') depends_on('py-semantic-version@2.6.0:', type=('build', 'run')) depends_on('py-toml@0.9.0:', type=('build', 'run')) depends_on('rust', type='run') + + # when #24668 is fixed remove url_for_version and use url= (see above) for + # version 0.10.6 + def url_for_version(self, version): + if version >= Version('0.12.0'): + return 'https://files.pythonhosted.org/packages/source/s/setuptools-rust/setuptools-rust-{0}.tar.gz'.format(version) + else: + return 'https://github.com/PyO3/setuptools-rust/archive/v{0}.tar.gz'.format(version) diff --git a/var/spack/repos/builtin/packages/py-setuptools-scm/package.py b/var/spack/repos/builtin/packages/py-setuptools-scm/package.py index dcfe7287266..8997a449189 100644 --- a/var/spack/repos/builtin/packages/py-setuptools-scm/package.py +++ b/var/spack/repos/builtin/packages/py-setuptools-scm/package.py @@ -19,7 +19,7 @@ class PySetuptoolsScm(PythonPackage): version('3.1.0', sha256='1191f2a136b5e86f7ca8ab00a97ef7aef997131f1f6d4971be69a1ef387d8b40') version('1.15.6', sha256='49ab4685589986a42da85706b3311a2f74f1af567d39fee6cb1e088d7a75fb5f') - variant('toml', default=False, description='Build with TOML support') + variant('toml', default=True, description='Build with TOML support') depends_on('python@2.7:2.8,3.4:', type=('build', 'run')) depends_on('python@2.7:2.8,3.5:', when='@4:', type=('build', 'run')) diff --git a/var/spack/repos/builtin/packages/py-slepc4py/package.py b/var/spack/repos/builtin/packages/py-slepc4py/package.py index 4598a62a082..80ea5eb0d64 100644 --- a/var/spack/repos/builtin/packages/py-slepc4py/package.py +++ b/var/spack/repos/builtin/packages/py-slepc4py/package.py @@ -14,7 +14,7 @@ class PySlepc4py(PythonPackage): url = "https://slepc.upv.es/download/distrib/slepc4py-3.15.1.tar.gz" git = "https://gitlab.com/slepc/slepc.git" - maintainers = ['dalcinl', 'joseeroman', 'balay'] + maintainers = ['joseeroman', 'balay'] version('main', branch='main') version('3.15.1', sha256='bcdab6d2101ae00e189f4b33072805358cee2dda806a6b6a8e3c2f1b9f619dfd') diff --git a/var/spack/repos/builtin/packages/py-soupsieve/package.py b/var/spack/repos/builtin/packages/py-soupsieve/package.py index 4b147e9c0a3..534cd2007fe 100644 --- a/var/spack/repos/builtin/packages/py-soupsieve/package.py +++ b/var/spack/repos/builtin/packages/py-soupsieve/package.py @@ -12,7 +12,11 @@ class PySoupsieve(PythonPackage): homepage = "https://github.com/facelessuser/soupsieve" pypi = "soupsieve/soupsieve-1.9.3.tar.gz" + version('2.2.1', sha256='052774848f448cf19c7e959adf5566904d525f33a3f8b6ba6f6f8f26ec7de0cc') + version('1.9.6', sha256='7985bacc98c34923a439967c1a602dc4f1e15f923b6fcf02344184f86cc7efaa') version('1.9.3', sha256='8662843366b8d8779dec4e2f921bebec9afd856a5ff2e82cd419acc5054a1a92') + depends_on('python@3.6:', when='@2.2:', type=('build', 'run')) depends_on('py-setuptools', type='build') + depends_on('py-setuptools@42:', when='@2.2:', type='build') depends_on('py-backports-functools-lru-cache', when='^python@:2', type=('build', 'run')) diff --git a/var/spack/repos/builtin/packages/py-sphinx/package.py b/var/spack/repos/builtin/packages/py-sphinx/package.py index e191cf7e5ab..6385811c24c 100644 --- a/var/spack/repos/builtin/packages/py-sphinx/package.py +++ b/var/spack/repos/builtin/packages/py-sphinx/package.py @@ -12,10 +12,15 @@ class PySphinx(PythonPackage): homepage = "https://sphinx-doc.org/" pypi = "Sphinx/Sphinx-3.2.0.tar.gz" + version('4.1.2', sha256='3092d929cd807926d846018f2ace47ba2f3b671b309c7a89cd3306e80c826b13') + version('4.1.1', sha256='23c846a1841af998cb736218539bb86d16f5eb95f5760b1966abcd2d584e62b8') version('4.0.2', sha256='b5c2ae4120bf00c799ba9b3699bc895816d272d120080fbc967292f29b52b48c') + version('3.5.4', sha256='19010b7b9fa0dc7756a6e105b2aacd3a80f798af3c25c273be64d7beeb482cb1') version('3.2.0', sha256='cf2d5bc3c6c930ab0a1fbef3ad8a82994b1bf4ae923f8098a05c7e5516f07177') version('3.0.0', sha256='6a099e6faffdc3ceba99ca8c2d09982d43022245e409249375edf111caf79ed3') + version('2.4.4', sha256='b4c750d546ab6d7e05bdff6ac24db8ae3e8b8253a3569b754e445110a0a12b66') version('2.2.0', sha256='0d586b0f8c2fc3cc6559c5e8fd6124628110514fda0e5d7c82e682d749d2e845') + version('1.8.5', sha256='c7658aab75c920288a8cf6f09f244c6cfdae30d82d803ac1634d9f223a80ca08') version('1.8.4', sha256='c1c00fc4f6e8b101a0d037065043460dffc2d507257f2f11acaed71fd2b0c83c') version('1.8.2', sha256='120732cbddb1b2364471c3d9f8bfd4b0c5b550862f99a65736c77f970b142aea') version('1.7.4', sha256='e9b1a75a3eae05dded19c80eb17325be675e0698975baae976df603b6ed1eb10') @@ -39,13 +44,16 @@ class PySphinx(PythonPackage): depends_on('py-sphinxcontrib-applehelp', when='@2:', type=('build', 'run')) depends_on('py-sphinxcontrib-devhelp', when='@2:', type=('build', 'run')) depends_on('py-sphinxcontrib-jsmath', when='@2:', type=('build', 'run')) + depends_on('py-sphinxcontrib-htmlhelp@2.0.0:', when='@4.1.1:', type=('build', 'run')) depends_on('py-sphinxcontrib-htmlhelp', when='@2:', type=('build', 'run')) + depends_on('py-sphinxcontrib-serializinghtml@1.1.5:', when='@4.1.1:', type=('build', 'run')) depends_on('py-sphinxcontrib-serializinghtml', when='@2:', type=('build', 'run')) depends_on('py-sphinxcontrib-qthelp', when='@2:', type=('build', 'run')) depends_on('py-six@1.5:', when='@:1', type=('build', 'run')) depends_on('py-jinja2@2.3:', type=('build', 'run')) + depends_on('py-jinja2@2.3:2.999', when='@:4.0.1', type=('build', 'run')) depends_on('py-pygments@2.0:', type=('build', 'run')) - depends_on('py-docutils@0.14:1.17', when='@4:', type=('build', 'run')) + depends_on('py-docutils@0.14:0.17', when='@4:', type=('build', 'run')) depends_on('py-docutils@0.12:', when='@:3', type=('build', 'run')) depends_on('py-snowballstemmer@1.1:', type=('build', 'run')) depends_on('py-babel@1.3:1.999,2.1:', type=('build', 'run')) diff --git a/var/spack/repos/builtin/packages/py-sphinxcontrib-htmlhelp/package.py b/var/spack/repos/builtin/packages/py-sphinxcontrib-htmlhelp/package.py index db7cd3884a2..1684148c34e 100644 --- a/var/spack/repos/builtin/packages/py-sphinxcontrib-htmlhelp/package.py +++ b/var/spack/repos/builtin/packages/py-sphinxcontrib-htmlhelp/package.py @@ -18,7 +18,9 @@ class PySphinxcontribHtmlhelp(PythonPackage): # import any modules. import_modules = [] + version('2.0.0', sha256='f5f8bb2d0d629f398bf47d0d69c07bc13b65f75a81ad9e2f71a63d4b7a2f6db2') version('1.0.2', sha256='4670f99f8951bd78cd4ad2ab962f798f5618b17675c35c5ac3b2132a14ea8422') + depends_on('python@3.6:', when='@2:', type=('build', 'run')) depends_on('python@3.5:', type=('build', 'run')) depends_on('py-setuptools', type='build') diff --git a/var/spack/repos/builtin/packages/py-sphinxcontrib-serializinghtml/package.py b/var/spack/repos/builtin/packages/py-sphinxcontrib-serializinghtml/package.py index ba89a9b8888..09025564ac7 100644 --- a/var/spack/repos/builtin/packages/py-sphinxcontrib-serializinghtml/package.py +++ b/var/spack/repos/builtin/packages/py-sphinxcontrib-serializinghtml/package.py @@ -18,6 +18,7 @@ class PySphinxcontribSerializinghtml(PythonPackage): # to import any modules. import_modules = [] + version('1.1.5', sha256='aa5f6de5dfdf809ef505c4895e51ef5c9eac17d0f287933eb49ec495280b6952') version('1.1.3', sha256='c0efb33f8052c04fd7a26c0a07f1678e8512e0faec19f4aa8f2473a8b81d5227') depends_on('python@3.5:', type=('build', 'run')) diff --git a/var/spack/repos/builtin/packages/py-sphobjinv/package.py b/var/spack/repos/builtin/packages/py-sphobjinv/package.py new file mode 100644 index 00000000000..d70185b7ff5 --- /dev/null +++ b/var/spack/repos/builtin/packages/py-sphobjinv/package.py @@ -0,0 +1,22 @@ +# Copyright 2013-2021 Lawrence Livermore National Security, LLC and other +# Spack Project Developers. See the top-level COPYRIGHT file for details. +# +# SPDX-License-Identifier: (Apache-2.0 OR MIT) + +from spack import * + + +class PySphobjinv(PythonPackage): + """Sphinx objects.inv Inspection/Manipulation Tool.""" + + homepage = "https://github.com/bskinn/sphobjinv" + url = "https://github.com/bskinn/sphobjinv/archive/refs/tags/v2.1.tar.gz" + + version('2.1', sha256='e41950a578dfd5acae24f12c7fe12b8d5e44f9162487aaa27189ca2e5c45d30c') + + depends_on('python@3.6:', type=('build', 'run')) + depends_on('py-setuptools', type=('build', 'run')) + depends_on('py-attrs@19.2:', type=('build', 'run')) + depends_on('py-certifi', type=('build', 'run')) + depends_on('py-fuzzywuzzy@0.8:', type=('build', 'run')) + depends_on('py-jsonschema@3.0:', type=('build', 'run')) diff --git a/var/spack/repos/builtin/packages/py-sqlalchemy/package.py b/var/spack/repos/builtin/packages/py-sqlalchemy/package.py index 6633e253c68..8e342fd7384 100644 --- a/var/spack/repos/builtin/packages/py-sqlalchemy/package.py +++ b/var/spack/repos/builtin/packages/py-sqlalchemy/package.py @@ -25,6 +25,7 @@ class PySqlalchemy(PythonPackage): 'sqlalchemy.engine', 'sqlalchemy.pool', 'sqlalchemy.event', 'sqlalchemy.sql' ] + version('1.4.20', sha256='38ee3a266afef2978e82824650457f70c5d74ec0cadec1b10fe5ed6f038eb5d0') version('1.3.19', sha256='3bba2e9fbedb0511769780fe1d63007081008c5c2d7d715e91858c94dbaa260e') version('1.3.9', sha256='272a835758908412e75e87f75dd0179a51422715c125ce42109632910526b1fd') version('1.2.19', sha256='5bb2c4fc2bcc3447ad45716c66581eab982c007dcf925482498d8733f86f17c7') @@ -32,12 +33,23 @@ class PySqlalchemy(PythonPackage): version('1.1.18', sha256='8b0ec71af9291191ba83a91c03d157b19ab3e7119e27da97932a4773a3f664a9') version('1.0.12', sha256='6679e20eae780b67ba136a4a76f83bb264debaac2542beefe02069d0206518d1') - depends_on('python@2.7:2.8,3.4:', type=('build', 'run')) + depends_on('python@2.7:2.8,3.6:', when='@1.4:', type=('build', 'run')) + depends_on('python@2.7:2.8,3.4:', when='@:1.3', type=('build', 'run')) depends_on('py-setuptools', type='build') + depends_on('py-importlib-metadata', when='@1.4.0: ^python@:3.7', type='run') + depends_on('py-greenlet@:0.4.16,0.4.18:', when='@1.4.0: ^python@3:', type='run') variant('backend', description='Python modules for database access', values=any_combination_of('mysql', 'pymysql', 'postgresql')) - depends_on('py-mysqlclient', when='backend=mysql', type=('build', 'run')) - depends_on('py-pymysql', when='backend=pymysql', type=('build', 'run')) - depends_on('py-psycopg2', when='backend=postgresql', type=('build', 'run')) + # >=1.4.0 + depends_on('py-mysqlclient@1.4:', when='backend=mysql @1.4: ^python@3:', type=('build', 'run')) + depends_on('py-mysqlclient@1.4:,:1.99', when='backend=mysql @1.4: ^python@:2.7', type=('build', 'run')) + depends_on('py-pymysql', when='backend=pymysql @1.4: ^python@3:', type=('build', 'run')) + depends_on('py-pymysql@:0.999', when='backend=pymysql @1.4: ^python@:2.7', type=('build', 'run')) + depends_on('py-psycopg2@2.7:', when='backend=postgresql @1.4:', type=('build', 'run')) + + # < 1.4.0 + depends_on('py-mysqlclient', when='backend=mysql @:1.3', type=('build', 'run')) + depends_on('py-pymysql', when='backend=pymysql @:1.3', type=('build', 'run')) + depends_on('py-psycopg2', when='backend=postgresql @:1.3', type=('build', 'run')) diff --git a/var/spack/repos/builtin/packages/py-tensorboard-plugin-wit/package.py b/var/spack/repos/builtin/packages/py-tensorboard-plugin-wit/package.py index cc6fce343ab..74775535b0b 100644 --- a/var/spack/repos/builtin/packages/py-tensorboard-plugin-wit/package.py +++ b/var/spack/repos/builtin/packages/py-tensorboard-plugin-wit/package.py @@ -25,7 +25,9 @@ class PyTensorboardPluginWit(Package): version('1.8.0', sha256='1e4de1bbf6ae61c4d27b114ec2e1093bc4765b8c2bbb2cc5d43e2075b08a5fea') version('1.7.0', sha256='30dcab9065b02c3f1476f4fb92b27f6feb6c00cdb281699c44d8e69c86745247') - depends_on('bazel@:2.1.0', type='build') + # Bazel 3.7+ does not work + # https://github.com/PAIR-code/what-if-tool/issues/140 + depends_on('bazel@0.26.1:3.6', type='build') depends_on('py-setuptools@36.2.0:', type='build') depends_on('python@2.7:2.8,3.2:', type=('build', 'run')) depends_on('py-wheel', type='build') @@ -34,6 +36,11 @@ class PyTensorboardPluginWit(Package): patch('tboard_shellenv.patch') + # On Ubuntu, sh -> dash, and the script contains tools like pushd that require bash + patch('https://patch-diff.githubusercontent.com/raw/PAIR-code/what-if-tool/pull/154.patch', + sha256='b40fbc73fb07ed933f9d845b65fdbf7a94644f7ec7ca8637eda002171e71bbb6', + when='@:1.8.0') + phases = ['setup', 'build', 'install'] def setup_build_environment(self, env): diff --git a/var/spack/repos/builtin/packages/py-timm/package.py b/var/spack/repos/builtin/packages/py-timm/package.py new file mode 100644 index 00000000000..3799ca3aeae --- /dev/null +++ b/var/spack/repos/builtin/packages/py-timm/package.py @@ -0,0 +1,20 @@ +# Copyright 2013-2021 Lawrence Livermore National Security, LLC and other +# Spack Project Developers. See the top-level COPYRIGHT file for details. +# +# SPDX-License-Identifier: (Apache-2.0 OR MIT) + +from spack import * + + +class PyTimm(PythonPackage): + """(Unofficial) PyTorch Image Models.""" + + homepage = "https://github.com/rwightman/pytorch-image-models" + pypi = "timm/timm-0.4.12.tar.gz" + + version('0.4.12', sha256='b14be70dbd4528b5ca8657cf5bc2672c7918c3d9ebfbffe80f4785b54e884b1e') + + depends_on('python@3.6:', type=('build', 'run')) + depends_on('py-setuptools', type='build') + depends_on('py-torch@1.4:', type=('build', 'run')) + depends_on('py-torchvision', type=('build', 'run')) diff --git a/var/spack/repos/builtin/packages/py-torch/package.py b/var/spack/repos/builtin/packages/py-torch/package.py index 63c7cac7ccc..468f1100b5f 100644 --- a/var/spack/repos/builtin/packages/py-torch/package.py +++ b/var/spack/repos/builtin/packages/py-torch/package.py @@ -50,6 +50,7 @@ class PyTorch(PythonPackage, CudaPackage): # All options are defined in CMakeLists.txt. # Some are listed in setup.py, but not all. variant('caffe2', default=True, description='Build Caffe2') + variant('test', default=False, description='Build C++ test binaries') variant('cuda', default=not is_darwin, description='Use CUDA') variant('rocm', default=False, description='Use ROCm') variant('cudnn', default=not is_darwin, description='Use cuDNN') @@ -131,12 +132,14 @@ class PyTorch(PythonPackage, CudaPackage): # depends_on('cpuinfo@master', when='@master') # depends_on('cpuinfo@2020-12-17', when='@1.8.0:1.9.999') # depends_on('cpuinfo@2020-06-11', when='@1.6.0:1.7.999') - depends_on('sleef@master', when='@master') - depends_on('sleef@3.5.1_2020-12-22', when='@1.8.0:1.9.999') + # https://github.com/shibatch/sleef/issues/427 + # depends_on('sleef@master', when='@master') + # depends_on('sleef@3.5.1_2020-12-22', when='@1.8.0:1.9.999') # https://github.com/pytorch/pytorch/issues/60334 # depends_on('sleef@3.4.0_2019-07-30', when='@1.6.0:1.7.999') - depends_on('fp16@master', when='@master') - depends_on('fp16@2020-05-14', when='@1.6.0:1.9.999') + # https://github.com/Maratyszcza/FP16/issues/18 + # depends_on('fp16@master', when='@master') + # depends_on('fp16@2020-05-14', when='@1.6.0:1.9.999') depends_on('pthreadpool@master', when='@master') depends_on('pthreadpool@2021-04-13', when='@1.9.0:1.9.999') depends_on('pthreadpool@2020-10-05', when='@1.8.0:1.8.999') @@ -145,11 +148,12 @@ class PyTorch(PythonPackage, CudaPackage): depends_on('psimd@2020-05-17', when='@1.6.0:1.9.999') depends_on('fxdiv@master', when='@master') depends_on('fxdiv@2020-04-17', when='@1.6.0:1.9.999') - depends_on('benchmark', when='@1.6:') + depends_on('benchmark', when='@1.6:+test') # Optional dependencies depends_on('cuda@7.5:', when='+cuda', type=('build', 'link', 'run')) depends_on('cuda@9:', when='@1.1:+cuda', type=('build', 'link', 'run')) + depends_on('cuda@9.2:', when='@1.6:+cuda', type=('build', 'link', 'run')) depends_on('cudnn@6.0:7.999', when='@:1.0.999+cudnn') depends_on('cudnn@7.0:7.999', when='@1.1.0:1.5.999+cudnn') depends_on('cudnn@7.0:', when='@1.6.0:+cudnn') @@ -202,7 +206,7 @@ class PyTorch(PythonPackage, CudaPackage): # Fixes fatal error: sleef.h: No such file or directory # https://github.com/pytorch/pytorch/pull/35359 # https://github.com/pytorch/pytorch/issues/26555 - patch('sleef.patch', when='@1.0.0:1.5.999') + # patch('sleef.patch', when='@1.0.0:1.5.999') # Fixes compilation with Clang 9.0.0 and Apple Clang 11.0.3 # https://github.com/pytorch/pytorch/pull/37086 @@ -286,6 +290,9 @@ def enable_or_disable(variant, keyword='USE', var=None, newer=False): # Spack logs have trouble handling colored output env.set('COLORIZE_OUTPUT', 'OFF') + if self.spec.satisfies('@0.4:'): + enable_or_disable('test', keyword='BUILD') + if self.spec.satisfies('@1.7:'): enable_or_disable('caffe2', keyword='BUILD') @@ -392,15 +399,16 @@ def enable_or_disable(variant, keyword='USE', var=None, newer=False): if self.spec.satisfies('@1.10:'): env.set('USE_SYSTEM_PYBIND11', 'ON') # https://github.com/pytorch/pytorch/issues/60334 - if self.spec.satisfies('@1.8:'): - env.set('USE_SYSTEM_SLEEF', 'ON') + # if self.spec.satisfies('@1.8:'): + # env.set('USE_SYSTEM_SLEEF', 'ON') if self.spec.satisfies('@1.6:'): # env.set('USE_SYSTEM_LIBS', 'ON') # https://github.com/pytorch/pytorch/issues/60329 # env.set('USE_SYSTEM_CPUINFO', 'ON') # https://github.com/pytorch/pytorch/issues/60270 # env.set('USE_SYSTEM_GLOO', 'ON') - env.set('USE_SYSTEM_FP16', 'ON') + # https://github.com/Maratyszcza/FP16/issues/18 + # env.set('USE_SYSTEM_FP16', 'ON') env.set('USE_SYSTEM_PTHREADPOOL', 'ON') env.set('USE_SYSTEM_PSIMD', 'ON') env.set('USE_SYSTEM_FXDIV', 'ON') diff --git a/var/spack/repos/builtin/packages/py-torchmeta/package.py b/var/spack/repos/builtin/packages/py-torchmeta/package.py new file mode 100644 index 00000000000..e2400926ab8 --- /dev/null +++ b/var/spack/repos/builtin/packages/py-torchmeta/package.py @@ -0,0 +1,28 @@ +# Copyright 2013-2021 Lawrence Livermore National Security, LLC and other +# Spack Project Developers. See the top-level COPYRIGHT file for details. +# +# SPDX-License-Identifier: (Apache-2.0 OR MIT) + +from spack import * + + +class PyTorchmeta(PythonPackage): + """A collection of extensions and data-loaders for few-shot learning & + meta-learning in PyTorch. Torchmeta contains popular meta-learning + benchmarks, fully compatible with both torchvision and PyTorch's DataLoader.""" + + homepage = "https://github.com/tristandeleu/pytorch-meta" + pypi = "torchmeta/torchmeta-1.7.0.tar.gz" + + version('1.7.0', sha256='148d42b6a1ec27970408f7bcb97cf1cb203f8699214e06424fe43d78faa848d9') + + depends_on('python@3.6:', type=('build', 'run')) + depends_on('py-setuptools', type='build') + depends_on('py-numpy@1.14:', type=('build', 'run')) + depends_on('py-torch@1.4.0:1.8.999', type=('build', 'run')) + depends_on('py-torchvision@0.5.0:0.9.999', type=('build', 'run')) + depends_on('pil@7.0:', type=('build', 'run')) + depends_on('py-h5py', type=('build', 'run')) + depends_on('py-tqdm@4.0.0:', type=('build', 'run')) + depends_on('py-requests', type=('build', 'run')) + depends_on('py-ordered-set', type=('build', 'run')) diff --git a/var/spack/repos/builtin/packages/py-torchmetrics/package.py b/var/spack/repos/builtin/packages/py-torchmetrics/package.py index c7da4fa0a56..bd2f03448f1 100644 --- a/var/spack/repos/builtin/packages/py-torchmetrics/package.py +++ b/var/spack/repos/builtin/packages/py-torchmetrics/package.py @@ -12,11 +12,13 @@ class PyTorchmetrics(PythonPackage): homepage = "https://github.com/PyTorchLightning/metrics" pypi = "torchmetrics/torchmetrics-0.3.1.tar.gz" + version('0.4.1', sha256='2fc50f812210c33b8c2649dbb1482e3c47e93cae33e4b3d0427fb830384effbd') version('0.3.1', sha256='78f4057db53f7c219fdf9ec9eed151adad18dd43488a44e5c780806d218e3f1d') version('0.2.0', sha256='481a28759acd2d77cc088acba6bc7dc4a356c7cb767da2e1495e91e612e2d548') - depends_on('python@3.6:', type=('build', 'run')) - depends_on('py-setuptools', type='build') - depends_on('py-numpy', type=('build', 'run'), when='@0.3.0:') + depends_on('python@3.6:', type=('build', 'run')) + depends_on('py-setuptools', type='build') + depends_on('py-numpy@1.17.2:', when='@0.4:', type=('build', 'run')) + depends_on('py-numpy', when='@0.3:', type=('build', 'run')) depends_on('py-torch@1.3.1:', type=('build', 'run')) - depends_on('py-packaging', type=('build', 'run'), when='@0.3.0:') + depends_on('py-packaging', when='@0.3:', type=('build', 'run')) diff --git a/var/spack/repos/builtin/packages/py-tornado/package.py b/var/spack/repos/builtin/packages/py-tornado/package.py index b6ac7cfc635..8a827392503 100644 --- a/var/spack/repos/builtin/packages/py-tornado/package.py +++ b/var/spack/repos/builtin/packages/py-tornado/package.py @@ -9,20 +9,21 @@ class PyTornado(PythonPackage): """Tornado is a Python web framework and asynchronous networking library.""" - homepage = "https://github.com/tornadoweb/tornado" - url = "https://github.com/tornadoweb/tornado/archive/v6.0.3.tar.gz" - version('6.0.3', sha256='a97ac3b8c95867e534b48cb6fbbf156f5ca5b20c423bb06894c17b240d7a18fc') - version('5.1.1', sha256='a1da335a2978b9a8c3544cab10076d799442d7988ed0b4f2be035fe4388ca8dd') - version('4.4.0', sha256='ae556a0848e5d428d00597a18b38b9ca9d20f4600535e1dd33b3a576ab234194') + homepage = "https://github.com/tornadoweb/tornado" + pypi = "tornado/tornado-6.1.tar.gz" + + version('6.1', sha256='33c6e81d7bd55b468d2e793517c909b139960b6c790a60b7991b9b6b76fb9791') + version('6.0.3', sha256='c845db36ba616912074c5b1ee897f8e0124df269468f25e4fe21fe72f6edd7a9') + version('5.1.1', sha256='4e5158d97583502a7e2739951553cbd88a72076f152b4b11b64b9a10c4c49409') + version('4.4', sha256='3176545b6cb2966870db4def4f646da6ab7a0c19400576969c57279a7561ab02') depends_on('py-setuptools', type='build') - # requirements from setup.py - depends_on('python@3.5:', when='@6:', type=('build', 'run')) + depends_on('python@3.5.2:', when='@6:', type=('build', 'run')) depends_on('python@2.7:2.8,3.4:', type=('build', 'run')) depends_on('py-backports-ssl-match-hostname', when='@:4 ^python@:2.7.8', type=('build', 'run')) - depends_on('py-singledispatch', when='^python@:3.3', type=('build', 'run')) + depends_on('py-singledispatch', when='@:5.99 ^python@:3.3', type=('build', 'run')) depends_on('py-certifi', when='@:4 ^python@:3.3', type=('build', 'run')) - depends_on('py-backports-abc@0.4:', when='^python@:3.4', type=('build', 'run')) - depends_on('py-futures', when='@5: ^python@:3.1', type=('build', 'run')) + depends_on('py-backports-abc@0.4:5.99', when='^python@:3.4', type=('build', 'run')) + depends_on('py-futures', when='@5:5.99 ^python@:3.1', type=('build', 'run')) diff --git a/var/spack/repos/builtin/packages/py-transformers/package.py b/var/spack/repos/builtin/packages/py-transformers/package.py index 732347591be..422f61f01d0 100644 --- a/var/spack/repos/builtin/packages/py-transformers/package.py +++ b/var/spack/repos/builtin/packages/py-transformers/package.py @@ -13,17 +13,29 @@ class PyTransformers(PythonPackage): maintainers = ['adamjstewart'] + version('4.6.1', sha256='83dbff763b7e7dc57cbef1a6b849655d4fcab6bffdd955c5e8bea12a4f76dc10') version('2.8.0', sha256='b9f29cdfd39c28f29e0806c321270dea337d6174a7aa60daf9625bf83dbb12ee') depends_on('python@3.6:', type=('build', 'run')) depends_on('py-setuptools', type='build') + depends_on('py-numpy', type=('build', 'run')) - depends_on('py-tokenizers@0.5.2', type=('build', 'run')) + depends_on('py-numpy@1.17:', when='@4.6.1:', type=('build', 'run')) + + depends_on('py-tokenizers', type=('build', 'run')) + depends_on('py-tokenizers@0.10.1:0.10.999', when='@4.6.1:', type=('build', 'run')) + depends_on('py-dataclasses', when='^python@:3.6', type=('build', 'run')) - depends_on('py-boto3', type=('build', 'run')) + depends_on('py-boto3', when='@2.8.0', type=('build', 'run')) depends_on('py-filelock', type=('build', 'run')) depends_on('py-requests', type=('build', 'run')) depends_on('py-tqdm@4.27:', type=('build', 'run')) depends_on('py-regex@:2019.12.16,2019.12.18:', type=('build', 'run')) + depends_on('py-sentencepiece', type=('build', 'run')) + depends_on('py-sentencepiece@0.1.91', when='@4.6.1:', type=('build', 'run')) + depends_on('py-sacremoses', type=('build', 'run')) + depends_on('py-importlib-metadata', when='@4.6.1: ^python@:3.7.999', type=('build', 'run')) + depends_on('py-huggingface-hub@0.0.8', when='@4.6.1:', type=('build', 'run')) + depends_on('py-packaging', when='@4.6.1:', type=('build', 'run')) diff --git a/var/spack/repos/builtin/packages/py-typed-ast/package.py b/var/spack/repos/builtin/packages/py-typed-ast/package.py index 18a28505a82..2de58678a3a 100644 --- a/var/spack/repos/builtin/packages/py-typed-ast/package.py +++ b/var/spack/repos/builtin/packages/py-typed-ast/package.py @@ -12,7 +12,11 @@ class PyTypedAst(PythonPackage): homepage = "https://github.com/python/typed_ast" pypi = "typed-ast/typed_ast-1.4.0.tar.gz" + version('1.4.3', sha256='fb1bbeac803adea29cedd70781399c99138358c26d05fcbd23c13016b7f5ec65') + version('1.4.2', sha256='9fc0b3cb5d1720e7141d103cf4819aea239f7d136acf9ee4a69b047b7986175a') + version('1.4.1', sha256='8c8aaad94455178e3187ab22c8b01a3837f8ee50e09cf31f1ba129eb293ec30b') version('1.4.0', sha256='66480f95b8167c9c5c5c87f32cf437d585937970f3fc24386f313a4c97b44e34') - depends_on('python@3.3:', type=('build', 'run')) + depends_on('python@3.3:', type=('build', 'link', 'run')) + depends_on('python@:3.8', when="@:1.4.0") # build errors with 3.9 until 1.4.1 depends_on('py-setuptools', type='build') diff --git a/var/spack/repos/builtin/packages/py-uproot/package.py b/var/spack/repos/builtin/packages/py-uproot/package.py index 4cf493f500b..2d911e9d05e 100644 --- a/var/spack/repos/builtin/packages/py-uproot/package.py +++ b/var/spack/repos/builtin/packages/py-uproot/package.py @@ -23,8 +23,12 @@ class PyUproot(PythonPackage): tags = ['hep'] - version('4.0.7', sha256='7adb688601fda1e9ab8eeb9a9de681f645827dac0943c6180cf85f03f73fb789') - version('4.0.6', sha256='1bea2ccc899c6959fb2af69d7e5d1e2df210caab30d3510e26f3fc07c143c37e') + version('4.0.11', sha256='5c8f62c7eeaa50e1315e05469580130d0bcc50a6cb4456825777f73cfaf5938a') + version('4.0.10', sha256='b7f9786d87227fcdc6b84305a6219cd615844f934e3b7c2509e2d4ed095950ab') + version('4.0.9', sha256='345c20dd4e1921e3493200bf9ed4079909fb1277d02faf3136e19f4b90f8aa86') + version('4.0.8', sha256='98282142725d678815ec6f8c76f42cfb3539c9c3d5b5561b8ef2129ac5a86bcd') + version('4.0.7', sha256='7adb688601fda1e9ab8eeb9a9de681f645827dac0943c6180cf85f03f73fb789') + version('4.0.6', sha256='1bea2ccc899c6959fb2af69d7e5d1e2df210caab30d3510e26f3fc07c143c37e') variant('xrootd', default=True, description='Build with xrootd support ') diff --git a/var/spack/repos/builtin/packages/py-vcrpy/package.py b/var/spack/repos/builtin/packages/py-vcrpy/package.py new file mode 100644 index 00000000000..120e9b8767f --- /dev/null +++ b/var/spack/repos/builtin/packages/py-vcrpy/package.py @@ -0,0 +1,23 @@ +# Copyright 2013-2021 Lawrence Livermore National Security, LLC and other +# Spack Project Developers. See the top-level COPYRIGHT file for details. +# +# SPDX-License-Identifier: (Apache-2.0 OR MIT) + +from spack import * + + +class PyVcrpy(PythonPackage): + """Automatically mock your HTTP interactions to simplify and speed up testing.""" + + homepage = "https://github.com/kevin1024/vcrpy" + pypi = "vcrpy/vcrpy-4.1.1.tar.gz" + + version('4.1.1', sha256='57095bf22fc0a2d99ee9674cdafebed0f3ba763018582450706f7d3a74fff599') + + depends_on('python@3.5:', type=('build', 'run')) + depends_on('py-setuptools', type='build') + depends_on('py-pyyaml', type=('build', 'run')) + depends_on('py-wrapt', type=('build', 'run')) + depends_on('py-six@1.5:', type=('build', 'run')) + depends_on('py-yarl', when='^python@3.6:', type=('build', 'run')) + depends_on('py-yarl@:1.3', when='^python@3.5', type=('build', 'run')) diff --git a/var/spack/repos/builtin/packages/py-warpx/package.py b/var/spack/repos/builtin/packages/py-warpx/package.py index 9d0a9607bec..0936da9b2f4 100644 --- a/var/spack/repos/builtin/packages/py-warpx/package.py +++ b/var/spack/repos/builtin/packages/py-warpx/package.py @@ -25,6 +25,7 @@ class PyWarpx(PythonPackage): # NOTE: if you update the versions here, also see warpx version('develop', branch='development') + version('21.07', sha256='a8740316d813c365715f7471201499905798b50bd94950d33f1bd91478d49561') version('21.06', sha256='a26039dc4061da45e779dd5002467c67a533fc08d30841e01e7abb3a890fbe30') version('21.05', sha256='f835f0ae6c5702550d23191aa0bb0722f981abb1460410e3d8952bc3d945a9fc') version('21.04', sha256='51d2d8b4542eada96216e8b128c0545c4b7527addc2038efebe586c32c4020a0') @@ -32,7 +33,7 @@ class PyWarpx(PythonPackage): variant('mpi', default=True, description='Enable MPI support') - for v in ['21.05', '21.04', 'develop']: + for v in ['21.07', '21.06', '21.05', '21.04', 'develop']: depends_on('warpx@{0}'.format(v), when='@{0}'.format(v), type=['build', 'link']) diff --git a/var/spack/repos/builtin/packages/python/package.py b/var/spack/repos/builtin/packages/python/package.py index 62805e12a1f..61f42aaad39 100644 --- a/var/spack/repos/builtin/packages/python/package.py +++ b/var/spack/repos/builtin/packages/python/package.py @@ -711,23 +711,53 @@ def get_makefile_filename(self): return self.command('-c', cmd, output=str).strip() - def get_python_inc(self): + def get_python_inc(self, plat_specific=False, prefix=None): """Return the directory for either the general or platform-dependent C include files. Wrapper around ``distutils.sysconfig.get_python_inc()``. + + Parameters: + plat_specific (bool): if true, the platform-dependent include directory + is returned, else the platform-independent directory is returned + prefix (str): prefix to use instead of ``distutils.sysconfig.PREFIX`` + + Returns: + str: include files directory """ + # Wrap strings in quotes + if prefix is not None: + prefix = '"{0}"'.format(prefix) + + args = 'plat_specific={0}, prefix={1}'.format(plat_specific, prefix) cmd = 'from distutils.sysconfig import get_python_inc; ' - cmd += self.print_string('get_python_inc()') + cmd += self.print_string('get_python_inc({0})'.format(args)) return self.command('-c', cmd, output=str).strip() - def get_python_lib(self): + def get_python_lib(self, plat_specific=False, standard_lib=False, prefix=None): """Return the directory for either the general or platform-dependent - library installation. Wrapper around - ``distutils.sysconfig.get_python_lib()``.""" + library installation. Wrapper around ``distutils.sysconfig.get_python_lib()``. + + Parameters: + plat_specific (bool): if true, the platform-dependent library directory + is returned, else the platform-independent directory is returned + standard_lib (bool): if true, the directory for the standard library is + returned rather than the directory for the installation of + third-party extensions + prefix (str): prefix to use instead of ``distutils.sysconfig.PREFIX`` + + Returns: + str: library installation directory + """ + # Wrap strings in quotes + if prefix is not None: + prefix = '"{0}"'.format(prefix) + + args = 'plat_specific={0}, standard_lib={1}, prefix={2}'.format( + plat_specific, standard_lib, prefix) cmd = 'from distutils.sysconfig import get_python_lib; ' - cmd += self.print_string('get_python_lib()') + cmd += self.print_string('get_python_lib({0})'.format(args)) return self.command('-c', cmd, output=str).strip() @@ -827,16 +857,71 @@ def headers(self): return headers @property - def python_lib_dir(self): - return join_path('lib', 'python{0}'.format(self.version.up_to(2))) + def python_include_dir(self): + """Directory for the include files. + + On most systems, and for Spack-installed Python, this will look like: + + ``include/pythonX.Y`` + + However, some systems append a ``m`` to the end of this path. + + Returns: + str: include files directory + """ + try: + return self.get_python_inc(prefix='') + except (ProcessError, RuntimeError): + return os.path.join('include', 'python{0}'.format(self.version.up_to(2))) @property - def python_include_dir(self): - return join_path('include', 'python{0}'.format(self.version.up_to(2))) + def python_lib_dir(self): + """Directory for the standard library. + + On most systems, and for Spack-installed Python, this will look like: + + ``lib/pythonX.Y`` + + On RHEL/CentOS/Fedora, when using the system Python, this will look like: + + ``lib64/pythonX.Y`` + + On Debian/Ubuntu, when using the system Python, this will look like: + + ``lib/pythonX`` + + Returns: + str: standard library directory + """ + try: + return self.get_python_lib(standard_lib=True, prefix='') + except (ProcessError, RuntimeError): + return os.path.join('lib', 'python{0}'.format(self.version.up_to(2))) @property def site_packages_dir(self): - return join_path(self.python_lib_dir, 'site-packages') + """Directory where third-party extensions should be installed. + + On most systems, and for Spack-installed Python, this will look like: + + ``lib/pythonX.Y/site-packages`` + + On RHEL/CentOS/Fedora, when using the system Python, this will look like: + + ``lib64/pythonX.Y/site-packages`` + + On Debian/Ubuntu, when using the system Python, this will look like: + + ``lib/pythonX/dist-packages`` + + Returns: + str: site-packages directory + """ + try: + return self.get_python_lib(prefix='') + except (ProcessError, RuntimeError): + return os.path.join( + 'lib', 'python{0}'.format(self.version.up_to(2)), 'site-packages') @property def easy_install_file(self): @@ -848,8 +933,8 @@ def setup_run_environment(self, env): def setup_dependent_build_environment(self, env, dependent_spec): """Set PYTHONPATH to include the site-packages directory for the - extension and any other python extensions it depends on.""" - + extension and any other python extensions it depends on. + """ # If we set PYTHONHOME, we must also ensure that the corresponding # python is found in the build environment. This to prevent cases # where a system provided python is run against the standard libraries @@ -860,18 +945,10 @@ def setup_dependent_build_environment(self, env, dependent_spec): if not is_system_path(path): env.prepend_path('PATH', path) - python_paths = [] - for d in dependent_spec.traverse(deptype=('build', 'run', 'test')): + for d in dependent_spec.traverse(deptype=('build', 'run', 'test'), root=True): if d.package.extends(self.spec): - # Python libraries may be installed in lib or lib64 - # See issues #18520 and #17126 - for lib in ['lib', 'lib64']: - python_paths.append(join_path( - d.prefix, lib, 'python' + str(self.version.up_to(2)), - 'site-packages')) - - pythonpath = ':'.join(python_paths) - env.set('PYTHONPATH', pythonpath) + env.prepend_path('PYTHONPATH', join_path( + d.prefix, self.site_packages_dir)) # We need to make sure that the extensions are compiled and linked with # the Spack wrapper. Paths to the executables that are used for these @@ -929,27 +1006,16 @@ def setup_dependent_build_environment(self, env, dependent_spec): env.set(link_var, new_link) def setup_dependent_run_environment(self, env, dependent_spec): - python_paths = [] - for d in dependent_spec.traverse(deptype='run'): + """Set PYTHONPATH to include the site-packages directory for the + extension and any other python extensions it depends on. + """ + for d in dependent_spec.traverse(deptype=('run'), root=True): if d.package.extends(self.spec): - # Python libraries may be installed in lib or lib64 - # See issues #18520 and #17126 - for lib in ['lib', 'lib64']: - root = join_path( - d.prefix, lib, 'python' + str(self.version.up_to(2)), - 'site-packages') - if os.path.exists(root): - python_paths.append(root) - - pythonpath = ':'.join(python_paths) - env.prepend_path('PYTHONPATH', pythonpath) + env.prepend_path('PYTHONPATH', join_path( + d.prefix, self.site_packages_dir)) def setup_dependent_package(self, module, dependent_spec): - """Called before python modules' install() methods. - - In most cases, extensions will only need to have one line:: - - setup_py('install', '--prefix={0}'.format(prefix))""" + """Called before python modules' install() methods.""" module.python = self.command module.setup_py = Executable( @@ -978,17 +1044,17 @@ def python_ignore(self, ext_pkg, args): ignore_arg = args.get('ignore', lambda f: False) # Always ignore easy-install.pth, as it needs to be merged. - patterns = [r'site-packages/easy-install\.pth$'] + patterns = [r'(site|dist)-packages/easy-install\.pth$'] # Ignore pieces of setuptools installed by other packages. # Must include directory name or it will remove all site*.py files. if ext_pkg.name != 'py-setuptools': patterns.extend([ r'bin/easy_install[^/]*$', - r'site-packages/setuptools[^/]*\.egg$', - r'site-packages/setuptools\.pth$', - r'site-packages/site[^/]*\.pyc?$', - r'site-packages/__pycache__/site[^/]*\.pyc?$' + r'(site|dist)-packages/setuptools[^/]*\.egg$', + r'(site|dist)-packages/setuptools\.pth$', + r'(site|dist)-packages/site[^/]*\.pyc?$', + r'(site|dist)-packages/__pycache__/site[^/]*\.pyc?$' ]) if ext_pkg.name != 'py-pygments': patterns.append(r'bin/pygmentize$') diff --git a/var/spack/repos/builtin/packages/quinoa/package.py b/var/spack/repos/builtin/packages/quinoa/package.py index 8b3996181d5..aabda89fac5 100644 --- a/var/spack/repos/builtin/packages/quinoa/package.py +++ b/var/spack/repos/builtin/packages/quinoa/package.py @@ -21,7 +21,7 @@ class Quinoa(CMakePackage): depends_on('hdf5+mpi') depends_on("charmpp backend=mpi") - depends_on("trilinos+exodus") + depends_on("trilinos+exodus+mpi+netcdf") depends_on("boost") depends_on("hypre~internal-superlu") depends_on("random123") diff --git a/var/spack/repos/builtin/packages/rclone/package.py b/var/spack/repos/builtin/packages/rclone/package.py index 5fada5f9e83..2a508155be4 100644 --- a/var/spack/repos/builtin/packages/rclone/package.py +++ b/var/spack/repos/builtin/packages/rclone/package.py @@ -13,6 +13,11 @@ class Rclone(Package): homepage = "http://rclone.org" url = "https://github.com/ncw/rclone/releases/download/v1.43/rclone-v1.43.tar.gz" + maintainers = ['alecbcs'] + + version('1.56.0', sha256='81d2eda23ebaad0a355aab6ff030712470a42505b94c01c9bb5a9ead9168cedb') + version('1.55.1', sha256='25da7fc5c9269b3897f27b0d946919df595c6dda1b127085fda0fe32aa59d29d') + version('1.55.0', sha256='75accdaedad3b82edc185dc8824a19a59c30dc6392de7074b6cd98d1dc2c9040') version('1.51.0', sha256='3eb5b7ffce17e56fadb29bf854666723a14c93fedc02046c7f34c792dbd227ee') version('1.50.2', sha256='6dd8998a72514d3820d241ae46dc609c0305b742aee3db6aaf6017b46c996091') version('1.50.1', sha256='48d6c80883427469682b4d97099d7631cf3b67aa85e652c254423bd1422ce216') diff --git a/var/spack/repos/builtin/packages/re2/package.py b/var/spack/repos/builtin/packages/re2/package.py index 5be8f32d103..61a5d595ef5 100644 --- a/var/spack/repos/builtin/packages/re2/package.py +++ b/var/spack/repos/builtin/packages/re2/package.py @@ -13,5 +13,15 @@ class Re2(CMakePackage): homepage = "https://github.com/google/re2" url = "https://github.com/google/re2/archive/2020-08-01.tar.gz" + version('2021-06-01', sha256='26155e050b10b5969e986dab35654247a3b1b295e0532880b5a9c13c0a700ceb') version('2020-08-01', sha256='6f4c8514249cd65b9e85d3e6f4c35595809a63ad71c5d93083e4d1dcdf9e0cd6') version('2020-04-01', sha256='98794bc5416326817498384a9c43cbb5a406bab8da9f84f83c39ecad43ed5cea') + + variant('shared', default=False, + description='Build shared instead of static libraries') + + def cmake_args(self): + args = [ + self.define_from_variant('BUILD_SHARED_LIBS', 'shared') + ] + return args diff --git a/var/spack/repos/builtin/packages/reframe/package.py b/var/spack/repos/builtin/packages/reframe/package.py index 252e94af897..81d9cbaf8dd 100644 --- a/var/spack/repos/builtin/packages/reframe/package.py +++ b/var/spack/repos/builtin/packages/reframe/package.py @@ -24,6 +24,7 @@ class Reframe(Package): maintainers = ['victorusu', 'vkarak'] version('master', branch='master') + version('3.6.3', sha256='3616478c886c89385385d04f5bce625a690eec6bdca603cd5ac3a6f443168ac2') version('3.6.2', sha256='b4725e434f4cd721ca825a56a652e67aa77e7af5ed7ca00f281747585827060d') version('3.6.1', sha256='1ee35a2de42cdd2476c17cc15caf6a7795d976ba7b058d518da7d314e7af2136') version('3.6.0', sha256='de1e0ea2677f2a49af4b64544379579515db36c2164f6dc647c3fbaab5f78462') diff --git a/var/spack/repos/builtin/packages/rocm-smi-lib/package.py b/var/spack/repos/builtin/packages/rocm-smi-lib/package.py index 53cae447114..00a6b57b403 100644 --- a/var/spack/repos/builtin/packages/rocm-smi-lib/package.py +++ b/var/spack/repos/builtin/packages/rocm-smi-lib/package.py @@ -4,6 +4,7 @@ # SPDX-License-Identifier: (Apache-2.0 OR MIT) +import os import shutil from spack import * @@ -45,3 +46,6 @@ def post_install(self): shutil.rmtree(self.prefix.lib) install_tree(self.prefix.rocm_smi, self.prefix) shutil.rmtree(self.prefix.rocm_smi) + os.remove(join_path(self.prefix.bin, 'rsmiBindings.py')) + symlink('../bindings/rsmiBindings.py', + join_path(self.prefix.bin, 'rsmiBindings.py')) diff --git a/var/spack/repos/builtin/packages/rocprofiler-dev/fix-includes.patch b/var/spack/repos/builtin/packages/rocprofiler-dev/fix-includes.patch new file mode 100644 index 00000000000..c4a9dc10974 --- /dev/null +++ b/var/spack/repos/builtin/packages/rocprofiler-dev/fix-includes.patch @@ -0,0 +1,25 @@ +From 9b7edb39207cb040093ffdd7d99c9d6e56807c95 Mon Sep 17 00:00:00 2001 +From: Harmen Stoppels +Date: Wed, 21 Jul 2021 12:00:52 +0200 +Subject: [PATCH] C to C++ includes, fix build issue with gcc 9 + +--- + test/ctrl/test_kernel.h | 5 +++-- + 1 file changed, 3 insertions(+), 2 deletions(-) + +diff --git a/test/ctrl/test_kernel.h b/test/ctrl/test_kernel.h +index 95da162..596d029 100644 +--- a/test/ctrl/test_kernel.h ++++ b/test/ctrl/test_kernel.h +@@ -23,8 +23,9 @@ THE SOFTWARE. + #ifndef TEST_CTRL_TEST_KERNEL_H_ + #define TEST_CTRL_TEST_KERNEL_H_ + +-#include +-#include ++#include ++#include ++#include + #include + + // Class implements kernel test diff --git a/var/spack/repos/builtin/packages/rocprofiler-dev/package.py b/var/spack/repos/builtin/packages/rocprofiler-dev/package.py index b1a74d2b005..c7e6cd5962c 100644 --- a/var/spack/repos/builtin/packages/rocprofiler-dev/package.py +++ b/var/spack/repos/builtin/packages/rocprofiler-dev/package.py @@ -31,68 +31,10 @@ class RocprofilerDev(CMakePackage): depends_on('hsakmt-roct@' + ver, when='@' + ver) depends_on('hsa-rocr-dev@' + ver, when='@' + ver) depends_on('rocminfo@' + ver, when='@' + ver) + depends_on('roctracer-dev-api@' + ver, when='@' + ver) - resource(name='roctracer-dev', - url='https://github.com/ROCm-Developer-Tools/roctracer/archive/rocm-3.5.0.tar.gz', - sha256='7af5326c9ca695642b4265232ec12864a61fd6b6056aa7c4ecd9e19c817f209e', - expand=True, - destination='', - placement='roctracer', - when='@3.5.0') - - resource(name='roctracer-dev', - url='https://github.com/ROCm-Developer-Tools/roctracer/archive/rocm-3.7.0.tar.gz', - sha256='6fa5b771e990f09c242237ab334b9f01039ec7d54ccde993e719c5d6577d1518', - expand=True, - destination='', - placement='roctracer', - when='@3.7.0') - - resource(name='roctracer-dev', - url='https://github.com/ROCm-Developer-Tools/roctracer/archive/rocm-3.8.0.tar.gz', - sha256='5154a84ce7568cd5dba756e9508c34ae9fc62f4b0b5731f93c2ad68b21537ed1', - expand=True, - destination='', - placement='roctracer', - when='@3.8.0') - - resource(name='roctracer-dev', - url='https://github.com/ROCm-Developer-Tools/roctracer/archive/rocm-3.9.0.tar.gz', - sha256='0678f9faf45058b16923948c66d77ba2c072283c975d167899caef969169b292', - expand=True, - destination='', - placement='roctracer', - when='@3.9.0') - - resource(name='roctracer-dev', - url='https://github.com/ROCm-Developer-Tools/roctracer/archive/rocm-3.10.0.tar.gz', - sha256='ac4a1d059fc34377e906071fd0e56f5434a7e0e4ded9db8faf9217a115239dec', - expand=True, - destination='', - placement='roctracer', - when='@3.10.0') - - resource(name='roctracer-dev', - url='https://github.com/ROCm-Developer-Tools/roctracer/archive/rocm-4.0.0.tar.gz', - sha256='f47859a46173228b597c463eda850b870e810534af5efd5f2a746067ef04edee', - expand=True, - destination='', - placement='roctracer', - when='@4.0.0') - resource(name='roctracer-dev', - url='https://github.com/ROCm-Developer-Tools/roctracer/archive/rocm-4.1.0.tar.gz', - sha256='5d93de4e92895b6eb5f9d098f5dbd182d33923bd9b2ab69cf5a1abbf91d70695', - expand=True, - destination='', - placement='roctracer', - when='@4.1.0') - resource(name='roctracer-dev', - url='https://github.com/ROCm-Developer-Tools/roctracer/archive/rocm-4.2.0.tar.gz', - sha256='62a9c0cb1ba50b1c39a0636c886ac86e75a1a71cbf5fec05801517ceb0e67a37', - expand=True, - destination='', - placement='roctracer', - when='@4.2.0') + # See https://github.com/ROCm-Developer-Tools/rocprofiler/pull/50 + patch('fix-includes.patch') def patch(self): filter_file('${HSA_RUNTIME_LIB_PATH}/../include', @@ -100,9 +42,10 @@ def patch(self): /include', 'test/CMakeLists.txt', string=True) def cmake_args(self): - args = ['-DPROF_API_HEADER_PATH={0}/roctracer/inc/ext'.format( - self.stage.source_path), - '-DROCM_ROOT_DIR:STRING={0}/include'.format( - self.spec['hsakmt-roct'].prefix) - ] - return args + return [ + self.define( + 'PROF_API_HEADER_PATH', + self.spec['roctracer-dev-api'].prefix.roctracer.inc.ext + ), + self.define('ROCM_ROOT_DIR', self.spec['hsakmt-roct'].prefix.include) + ] diff --git a/var/spack/repos/builtin/packages/roctracer-dev-api/package.py b/var/spack/repos/builtin/packages/roctracer-dev-api/package.py new file mode 100644 index 00000000000..eb23b4f152b --- /dev/null +++ b/var/spack/repos/builtin/packages/roctracer-dev-api/package.py @@ -0,0 +1,39 @@ +# Copyright 2013-2021 Lawrence Livermore National Security, LLC and other +# Spack Project Developers. See the top-level COPYRIGHT file for details. +# +# SPDX-License-Identifier: (Apache-2.0 OR MIT) + +from spack import * + + +class RoctracerDevApi(Package): + """ROC-tracer API. Installs the API header files of the roctracer-dev + package, mainly to avoid circular dependencies in the ROCm ecosystem. + For the ROC-tracer library, please check out roctracer-dev.""" + + homepage = "https://github.com/ROCm-Developer-Tools/roctracer" + git = "https://github.com/ROCm-Developer-Tools/roctracer.git" + url = "https://github.com/ROCm-Developer-Tools/roctracer/archive/rocm-4.2.0.tar.gz" + + maintainers = ['srekolam', 'arjun-raj-kuppala'] + + version('4.2.0', sha256='62a9c0cb1ba50b1c39a0636c886ac86e75a1a71cbf5fec05801517ceb0e67a37') + version('4.1.0', sha256='5d93de4e92895b6eb5f9d098f5dbd182d33923bd9b2ab69cf5a1abbf91d70695') + version('4.0.0', sha256='f47859a46173228b597c463eda850b870e810534af5efd5f2a746067ef04edee') + version('3.10.0', sha256='ac4a1d059fc34377e906071fd0e56f5434a7e0e4ded9db8faf9217a115239dec') + version('3.9.0', sha256='0678f9faf45058b16923948c66d77ba2c072283c975d167899caef969169b292') + version('3.8.0', sha256='5154a84ce7568cd5dba756e9508c34ae9fc62f4b0b5731f93c2ad68b21537ed1') + version('3.7.0', sha256='6fa5b771e990f09c242237ab334b9f01039ec7d54ccde993e719c5d6577d1518') + version('3.5.0', sha256='7af5326c9ca695642b4265232ec12864a61fd6b6056aa7c4ecd9e19c817f209e') + + def install(self, spec, prefix): + source_directory = self.stage.source_path + include = join_path(source_directory, 'inc') + + def only_headers(p): + return (p.endswith('CMakeLists.txt') or + p.endswith('RPM') or + p.endswith('DEBIAN')) + + mkdirp(prefix.roctracer.inc) + install_tree(include, prefix.roctracer.inc, ignore=only_headers) diff --git a/var/spack/repos/builtin/packages/roctracer-dev/package.py b/var/spack/repos/builtin/packages/roctracer-dev/package.py index 78d60c5577e..f02f0f715d0 100644 --- a/var/spack/repos/builtin/packages/roctracer-dev/package.py +++ b/var/spack/repos/builtin/packages/roctracer-dev/package.py @@ -28,7 +28,6 @@ class RoctracerDev(CMakePackage): version('3.5.0', sha256='7af5326c9ca695642b4265232ec12864a61fd6b6056aa7c4ecd9e19c817f209e') depends_on('cmake@3:', type='build') - depends_on('py-setuptools@:44', type='build') depends_on('python@:2', type='build', when='@:4.1.0') depends_on('python@3:', type='build', when='@4.2.0:') depends_on('py-cppheaderparser', type='build') diff --git a/var/spack/repos/builtin/packages/rstudio/package.py b/var/spack/repos/builtin/packages/rstudio/package.py new file mode 100644 index 00000000000..fabfe23a566 --- /dev/null +++ b/var/spack/repos/builtin/packages/rstudio/package.py @@ -0,0 +1,124 @@ +# Copyright 2013-2021 Lawrence Livermore National Security, LLC and other +# Spack Project Developers. See the top-level COPYRIGHT file for details. +# +# SPDX-License-Identifier: (Apache-2.0 OR MIT) + +import os + +from spack import * + + +class Rstudio(CMakePackage): + """RStudio is an integrated development environment (IDE) for R.""" + + homepage = "www.rstudio.com/products/rstudio/" + url = "https://github.com/rstudio/rstudio/archive/refs/tags/v1.4.1717.tar.gz" + + version('1.4.1717', sha256='3af234180fd7cef451aef40faac2c7b52860f14a322244c1c7aede029814d261') + + variant('notebook', default=False, description='Enable notebook support.') + + depends_on('r@3.0.1:', type=('build', 'run')) + depends_on('cmake@3.4.3:', type='build') + depends_on('pkgconfig', type='build') + depends_on('ant', type='build') + depends_on('boost+pic@1.69:') + depends_on('qt+webkit@5.12:') + depends_on('patchelf@0.9:') + depends_on('yaml-cpp@:0.6.3') # find_package fails with newest version + depends_on('node-js') + depends_on('yarn') + depends_on('pandoc@2.11.4:') + depends_on('icu4c') + depends_on('soci~static+boost+postgresql+sqlite') + depends_on('java@8:') + + with when('+notebook'): + depends_on('r-base64enc') + depends_on('r-digest') + depends_on('r-evaluate') + depends_on('r-glue') + depends_on('r-highr') + depends_on('r-htmltools') + depends_on('r-jsonlite') + depends_on('r-knitr') + depends_on('r-magrittr') + depends_on('r-markdown') + depends_on('r-mime') + depends_on('r-rmarkdown') + depends_on('r-stringi') + depends_on('r-stringr') + depends_on('r-tinytex') + depends_on('r-xfun') + depends_on('r-yaml') + + # to use node-js provided by spack + patch('https://src.fedoraproject.org/rpms/rstudio/raw/5bda2e290c9e72305582f2011040938d3e356906/f/0004-use-system-node.patch', + sha256='4a6aff2b586ddfceb7c59215e5f4a03f25b08fcc55687acaa6ae23c11d75d0e8') + + def cmake_args(self): + args = [ + '-DRSTUDIO_TARGET=Desktop', + '-DRSTUDIO_PACKAGE_BUILD=Yes', + '-DRSTUDIO_USE_SYSTEM_YAML_CPP=Yes', + '-DRSTUDIO_USE_SYSTEM_BOOST=Yes', + '-DRSTUDIO_USE_SYSTEM_SOCI=Yes', + '-DQT_QMAKE_EXECUTABLE="{0}"'.format(self.spec['qt'].prefix.bin.qmake), + ] + + return args + + def setup_build_environment(self, env): + env.set('RSTUDIO_TOOLS_ROOT', self.prefix.tools) + + def patch(self): + # fix hardcoded path for node-js in use_system_node patch + filter_file('', + ''.format( + self.spec['node-js'].prefix.bin.node), + 'src/gwt/build.xml', + string=True) + + # remove hardcoded soci path to use spack soci + if self.spec['soci'].version <= Version('4.0.0'): + soci_lib = self.spec['soci'].prefix.lib64 + else: + soci_lib = self.spec['soci'].prefix.lib + filter_file('set(SOCI_LIBRARY_DIR "/usr/lib")', + 'set(SOCI_LIBRARY_DIR "{0}")'.format(soci_lib), + 'src/cpp/CMakeLists.txt', + string=True) + + # unbundle icu libraries + filter_file('${QT_LIBRARY_DIR}/${ICU_LIBRARY}.so', + join_path(self.spec['icu4c'].prefix.lib, '${ICU_LIBRARY}.so'), + 'src/cpp/desktop/CMakeLists.txt', + string=True) + + @run_before('cmake') + def install_deps(self): + deps = Executable('./dependencies/common/install-dictionaries') + deps() + deps = Executable('./dependencies/common/install-mathjax') + deps() + + # two methods for pandoc + # 1) replace install-pandoc: + # - link pandoc into tools/pandoc/$PANDOC_VERSION + # (this is what install-pandoc would do) + # - cmake then installs pandoc files from there into bin + # 2) remove install-pandoc and cmake install step + link directly into bin + + # method 1) + filter_file('set(PANDOC_VERSION "2.11.4" CACHE INTERNAL "Pandoc version")', + 'set(PANDOC_VERSION "{0}" CACHE INTERNAL "Pandoc version")'.format( + self.spec['pandoc'].version), + 'src/cpp/session/CMakeLists.txt', + string=True) + + pandoc_dir = join_path(self.prefix.tools, 'pandoc', self.spec['pandoc'].version) + os.makedirs(pandoc_dir) + with working_dir(pandoc_dir): + os.symlink(self.spec['pandoc'].prefix.bin.pandoc, 'pandoc') + os.symlink(os.path.join(self.spec['pandoc'].prefix.bin, 'pandoc-citeproc'), + 'pandoc-citeproc') diff --git a/var/spack/repos/builtin/packages/ruby/package.py b/var/spack/repos/builtin/packages/ruby/package.py index b8ff3c3aa13..c0deb2d5b32 100644 --- a/var/spack/repos/builtin/packages/ruby/package.py +++ b/var/spack/repos/builtin/packages/ruby/package.py @@ -15,6 +15,7 @@ class Ruby(AutotoolsPackage): list_url = "http://cache.ruby-lang.org/pub/ruby/" list_depth = 1 + version('3.0.2', sha256='5085dee0ad9f06996a8acec7ebea4a8735e6fac22f22e2d98c3f2bc3bef7e6f1') version('3.0.1', sha256='369825db2199f6aeef16b408df6a04ebaddb664fb9af0ec8c686b0ce7ab77727') version('3.0.0', sha256='a13ed141a1c18eb967aac1e33f4d6ad5f21be1ac543c344e0d6feeee54af8e28') version('2.7.2', sha256='6e5706d0d4ee4e1e2f883db9d768586b4d06567debea353c796ec45e8321c3d4') diff --git a/var/spack/repos/builtin/packages/rust/package.py b/var/spack/repos/builtin/packages/rust/package.py index b13a5057f1f..ca3f6f33945 100644 --- a/var/spack/repos/builtin/packages/rust/package.py +++ b/var/spack/repos/builtin/packages/rust/package.py @@ -2,6 +2,9 @@ # Spack Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) + +import re + from six import iteritems @@ -459,6 +462,14 @@ class Rust(Package): ) ) + executables = ['^rustc$'] + + @classmethod + def determine_version(csl, exe): + output = Executable(exe)('--version', output=str, error=str) + match = re.match(r'rustc (\S+)', output) + return match.group(1) if match else None + # This routine returns the target architecture we intend to build for. def get_rust_target(self): if 'platform=linux' in self.spec or 'platform=cray' in self.spec: diff --git a/var/spack/repos/builtin/packages/scotch/package.py b/var/spack/repos/builtin/packages/scotch/package.py index 770f2f4858b..7aa55290c95 100644 --- a/var/spack/repos/builtin/packages/scotch/package.py +++ b/var/spack/repos/builtin/packages/scotch/package.py @@ -10,11 +10,13 @@ class Scotch(Package): """Scotch is a software package for graph and mesh/hypergraph partitioning, graph clustering, and sparse matrix ordering.""" - homepage = "http://scotch.gforge.inria.fr/" + homepage = "https://gitlab.inria.fr/scotch/scotch" git = "https://gitlab.inria.fr/scotch/scotch.git" - url = "http://gforge.inria.fr/frs/download.php/latestfile/298/scotch_6.0.4.tar.gz" - list_url = "http://gforge.inria.fr/frs/?group_id=248" + url = "https://gforge.inria.fr/frs/download.php/latestfile/298/scotch_6.0.4.tar.gz" + list_url = "https://gforge.inria.fr/frs/?group_id=248" + version('6.1.1', sha256='39052f59ff474a4a69cefc25cf3caf8429400889deba010ee6403ca188f8b311') + version('6.1.0', sha256='a3bc3fa3b243fcb52f8d68de4272562a0328afb18a96f535724d284e36730485') version('6.0.10', sha256='fd8b707b8200823312a1571d97d3776ff3dfd3280cfa4b6e38987153cea5dbda') version('6.0.9', sha256='622b4143cf01c480bb15708b3651b29c25e4aeb00c8c6447ff196aca2eca5c93') version('6.0.8', sha256='0ba3f145026174304f910c8770a3cbb034f213c91d939573751cfbb4fd46d45e') @@ -33,8 +35,8 @@ class Scotch(Package): description='Activate the compilation of esmumps needed by mumps') variant('shared', default=True, description='Build a shared version of the library') - variant('metis', default=True, - description='Build metis and parmetis wrapper libraries') + variant('metis', default=False, + description='Expose vendored METIS/ParMETIS libraries and wrappers') variant('int64', default=False, description='Use int64_t for SCOTCH_Num typedef') @@ -51,6 +53,11 @@ class Scotch(Package): patch('libscotchmetis-return-6.0.5a.patch', when='@6.0.5a') + # Vendored dependency of METIS/ParMETIS conflicts with standard + # installations + conflicts('^metis', when='+metis') + conflicts('^parmetis', when='+metis') + # NOTE: In cross-compiling environment parallel build # produces weird linker errors. parallel = False @@ -63,7 +70,7 @@ class Scotch(Package): # always grab these versions for older Scotch versions for simplicity. @when('@:6.0.0') def url_for_version(self, version): - url = "http://gforge.inria.fr/frs/download.php/latestfile/298/scotch_{0}_esmumps.tar.gz" + url = "https://gforge.inria.fr/frs/download.php/latestfile/298/scotch_{0}_esmumps.tar.gz" return url.format(version) @property @@ -116,6 +123,12 @@ def configure(self): '-Drestrict=__restrict' ]) + if '~metis' in self.spec: + # Scotch requires METIS to build, but includes its own patched, + # vendored dependency. Prefix its internal symbols so they won't + # conflict with another installation. + cflags.append('-DSCOTCH_METIS_PREFIX') + # Library Build Type # if '+shared' in self.spec: if self.spec.satisfies('platform=darwin'): @@ -215,7 +228,7 @@ def install(self, spec, prefix): with working_dir('src'): for target in targets: - # It seams that building ptesmumps in parallel fails, for + # It seems that building ptesmumps in parallel fails, for # version prior to 6.0.0 there is no separated targets force # ptesmumps, this library is built by the ptscotch target. This # should explain the test for the can_make_parallel variable @@ -226,7 +239,7 @@ def install(self, spec, prefix): make(target, parallel=can_make_parallel) lib_ext = dso_suffix if '+shared' in self.spec else 'a' - # It seams easier to remove metis wrappers from the folder that will be + # It seems easier to remove metis wrappers from the folder that will be # installed than to tweak the Makefiles if '+metis' not in self.spec: with working_dir('lib'): diff --git a/var/spack/repos/builtin/packages/sdl2/package.py b/var/spack/repos/builtin/packages/sdl2/package.py index 28828668964..d81a5802ada 100644 --- a/var/spack/repos/builtin/packages/sdl2/package.py +++ b/var/spack/repos/builtin/packages/sdl2/package.py @@ -14,6 +14,7 @@ class Sdl2(CMakePackage): homepage = "https://wiki.libsdl.org/FrontPage" url = "https://libsdl.org/release/SDL2-2.0.5.tar.gz" + version('2.0.14', sha256='d8215b571a581be1332d2106f8036fcb03d12a70bae01e20f424976d275432bc') version('2.0.5', sha256='442038cf55965969f2ff06d976031813de643af9c9edc9e331bd761c242e8785') depends_on('cmake@2.8.5:', type='build') diff --git a/var/spack/repos/builtin/packages/serf/package.py b/var/spack/repos/builtin/packages/serf/package.py index fa272fd1a56..8d15cbdb014 100644 --- a/var/spack/repos/builtin/packages/serf/package.py +++ b/var/spack/repos/builtin/packages/serf/package.py @@ -25,43 +25,42 @@ class Serf(SConsPackage): depends_on('apr-util') depends_on('openssl') depends_on('zlib') + depends_on('uuid') patch('py3syntax.patch') def build_args(self, spec, prefix): - args = [ - 'PREFIX={0}'.format(prefix), - 'APR={0}'.format(spec['apr'].prefix), - 'APU={0}'.format(spec['apr-util'].prefix), - 'OPENSSL={0}'.format(spec['openssl'].prefix), - 'ZLIB={0}'.format(spec['zlib'].prefix), - ] - - # ZLIB variable is ignored on non-Windows platforms before and - # including the version 1.3.9: - # https://www.mail-archive.com/dev@serf.apache.org/msg01359.html - # The issue is fixed in the trunk. Hopefully, the next stable version - # will work properly. - if '@:1.3.9' in self.spec: - zlib_spec = self.spec['zlib'] - link_flags = [zlib_spec.libs.search_flags] - link_flags.extend([self.compiler.cc_rpath_arg + d - for d in zlib_spec.libs.directories]) - args.append('LINKFLAGS=' + ' '.join(link_flags)) - args.append('CPPFLAGS=' + zlib_spec.headers.cpp_flags) - - if '+debug' in spec: - args.append('DEBUG=yes') - else: - args.append('DEBUG=no') + args = { + 'PREFIX': prefix, + 'APR': spec['apr'].prefix, + 'APU': spec['apr-util'].prefix, + 'OPENSSL': spec['openssl'].prefix, + 'ZLIB': spec['zlib'].prefix, + 'DEBUG': 'yes' if '+debug' in spec else 'no', + } # SCons doesn't pass Spack environment variables to the # execution environment. Therefore, we can't use Spack's compiler # wrappers. Use the actual compilers. SCons seems to RPATH things # on its own anyway. - args.append('CC={0}'.format(self.compiler.cc)) + args['CC'] = self.compiler.cc - return args + # Old versions of serf ignore the ZLIB variable on non-Windows platforms. + # Also, there is no UUID variable to specify its installation location. + # Pass explicit link flags for both. + library_dirs = [] + include_dirs = [] + for dep in spec.dependencies(deptype='link'): + query = self.spec[dep.name] + library_dirs.extend(query.libs.directories) + include_dirs.extend(query.headers.directories) + + rpath = self.compiler.cc_rpath_arg + args['LINKFLAGS'] = '-L' + ' -L'.join(library_dirs) + args['LINKFLAGS'] += ' ' + rpath + (' ' + rpath).join(library_dirs) + args['CPPFLAGS'] = '-I' + ' -I'.join(include_dirs) + + return [key + '=' + value for key, value in args.items()] def build_test(self): # FIXME: Several test failures: diff --git a/var/spack/repos/builtin/packages/sgpp/package.py b/var/spack/repos/builtin/packages/sgpp/package.py index a37086d7ae8..d5b18472f2b 100644 --- a/var/spack/repos/builtin/packages/sgpp/package.py +++ b/var/spack/repos/builtin/packages/sgpp/package.py @@ -19,6 +19,7 @@ class Sgpp(SConsPackage): # Versions with Python 3 bindings: version('master', branch='master') + version('3.4.0', sha256='450d4002850b0a48c561abe221b634261ca44eee111ca605c3e80797182f40b3') version('3.3.0', sha256='ca4d5b79f315b425ce69b04940c141451a76848bf1bd7b96067217304c68e2d4') version('3.2.0', sha256='dab83587fd447f92ed8546eacaac6b8cbe65b8db5e860218c0fa2e42f776962d') # Versions with Python 2 bindings: @@ -81,9 +82,8 @@ class Sgpp(SConsPackage): extends('python', when='+python') depends_on('py-setuptools', when='+python', type=('build')) # Python 3 support was added in version 3.2.0 - depends_on('python', when='+python', type=('build', 'run')) depends_on('python@2.7:2.8', when='@1.0.0:3.1.0+python', type=('build', 'run')) - depends_on('python@3:', when='@3.2.0:+python', type=('build', 'run')) + depends_on('python@3.7:', when='@3.2.0:+python', type=('build', 'run')) depends_on('swig@3:', when='+python', type=('build')) # Python libraries (version depends on whether we use Python 2 or 3) depends_on('py-numpy', when='+python', type=('build', 'run')) diff --git a/var/spack/repos/builtin/packages/simmetrix-simmodsuite/package.py b/var/spack/repos/builtin/packages/simmetrix-simmodsuite/package.py index 4dd5fb50833..801f95f15eb 100644 --- a/var/spack/repos/builtin/packages/simmetrix-simmodsuite/package.py +++ b/var/spack/repos/builtin/packages/simmetrix-simmodsuite/package.py @@ -10,6 +10,42 @@ def simmodsuite_releases(): releases = [ + { + 'version': '16.0-210623', + 'components': { + 'gmadv': ['c40dac44695db6e97c4d4c06d1eb6eac93518c93d7860c77a69f3ea30fea3b90', 'advmodel'], + 'msparallelmesh': ['57d710b74887731ea0e664a154489747033af433852809181c11e8065752eaf4', 'parallelmesh'], + 'gmcore': ['5bd04f175fdf5a088140af5ca3fa03934251c097044b47fdf3ea2cd0afc28547', 'base'], + 'pskrnl': ['87957818b20839d3835a343894c396f7c591d1f0bfd728d33ad21b1adb4e887c', 'parasolid'], + 'msadapt': ['5ba66819bb2c56eb1e07e6c2659afc8c971005b08ed059f8c62a185236e45dac', 'base'], + 'gmvoxel': ['15dfc389665086ea37b9835fecd6b46070572878308796afa960077cc2bf7e0a', 'voxel'], + 'msparalleladapt': ['1db2c34a398c5965a2a675006c96a3603e0124188b52159776b7c616efa48457', 'paralleladapt'], + 'mscore': ['7029871c52d6c3bb782ae2acb7360130105649cd9cf63815ae95cf4089cb786d', 'base'], + 'psint': ['c8a3dbacafa70b13bc9fb8322699a1cfc812b2cfd3ea05cba9135623eae761d8', 'parasolid'], + 'fdcore': ['75f9bcd7cb9ab9dedb73166539c08b53bd8e91c5619d3dce605ba19c63d1ee5c', 'base'], + 'msadv': ['0018e0a6b9d7724867f7379bc619269481c318ee4dfd0724511c032534ae04a1', 'adv'], + 'aciskrnl': ['2a9b9da9b0c09857de7fef0dea0e96222bd30e297bd37bea962751dab6762500', 'acis'], + 'discrete': ['f17cd198f8749c763cc8e200cfd6734604e1d316a48d7d0e537a9a890d884904', 'discrete'], + 'gmabstract': ['068d0309d5ff9668fc0474edf7f4e20503827400e34492e2ed55b46a0c9e1858', 'abstract'], + }, + 'docs': { + 'GeomSimAdvanced': ['02e4566042ae4de10c4acb577142e82d15f32caa296fe1b578c62a38da707066', 'advmodel'], + 'MeshSim': ['cc1dc77cece7aac6ded003c872c651ad8321bc9ce931ad141b17d2de7bf513c5', 'base'], + 'GeomSimVoxel': ['49b8f85f59acc8c973bf46c1f999a0ae64cdf129371587879de056c0ac3500d8', 'voxel'], + 'MeshSimAdvanced': ['2d2689979104414d91d804ca3c34a69104e572b8f231c4e324b09e57675b61cc', 'adv'], + 'GeomSimGranite': ['17f18831a12b06c0e085486d94d3a4275d7ed94ad53fec689e8877217856c750', 'granite'], + 'GeomSimParasolid': ['492bd311cc42dadd1f76064c57d35e886b9a7da4c48576ec4d34844fcdaddb8d', 'parasolid'], + 'GeomSimAcis': ['341c6aeda7f9189f4e886cb75c5989cb9ece6ecba1b1c9d5273b94f74a3dd40b', 'acis'], + 'GeomSimDiscrete': ['e9d42da613a3acadbcdee5d8d6fc3b093f58b51d158f2a392b7da0e5f74e0388', 'discrete'], + 'MeshSimAdapt': ['e27510e588105bdb0ca62c2629dfd41dfca6039b7b2ff0298ef83d3a48d7dd23', 'base'], + 'GeomSimAbstract': ['398c1a15efcddd3b86a7b0334af6f8b529710f815f73f5655d3c7271e92b194e', 'abstract'], + 'GeomSimDiscreteModeling': ['f444aed59569731f65eea920322adcc224c67b715ecba85a1898cf418de58237', 'discrete'], + 'FieldSim': ['bac947998d4de1c4edba271645310d4784290bec30bf0cf41d00ae6ea8b27c97', 'base'], + 'GeomSim': ['95cb24165d47701daa8da7131ca1173d38f4dab80c1ca0d75843b464fed92097', 'base'], + 'ParallelMeshSim': ['fb1e3ac0ab7208d771057880c693e529e7c821772265b89125d371a1b34fa651', 'parallelmesh'], + 'ParallelMeshSimAdapt': ['246c5c8b30194239f41a79f2ffd205fd9ae69bcb8127d19a94f12c278a27f106', 'paralleladapt'], + } + }, { 'version': '14.0-191122', 'components': { @@ -138,6 +174,7 @@ class SimmetrixSimmodsuite(Package): of sources """ + maintainers = ['cwsmith'] homepage = "http://www.simmetrix.com/products/SimulationModelingSuite/main.html" manual_download = True diff --git a/var/spack/repos/builtin/packages/simsipm/package.py b/var/spack/repos/builtin/packages/simsipm/package.py new file mode 100644 index 00000000000..9db1d87c82d --- /dev/null +++ b/var/spack/repos/builtin/packages/simsipm/package.py @@ -0,0 +1,38 @@ +# Copyright 2013-2021 Lawrence Livermore National Security, LLC and other +# Spack Project Developers. See the top-level COPYRIGHT file for details. +# +# SPDX-License-Identifier: (Apache-2.0 OR MIT) + +from spack import * + + +class Simsipm(CMakePackage): + """SimSiPM is a simple and easy to use C++ library providing a set of + object-oriented tools with all the functionality needed to describe + and simulate Silicon PhotonMultipliers (SiPM) sensors.""" + + url = "https://github.com/EdoPro98/SimSiPM/archive/refs/tags/v1.2.4.tar.gz" + homepage = "https://github.com/EdoPro98/SimSiPM/" + git = "https://github.com/EdoPro98/SimSiPM.git" + + tags = ['hep'] + + maintainers = ['vvolkl'] + + version('1.2.4', sha256='1c633bebb19c490b5e6dfa5ada4a6bc7ec36348237c2626d57843a25af923211') + + variant('python', default=False, description="Build pybind11-based python bindings") + variant('openmp', default=False, description="Use OpenMP") + + extends('python', when='+python') + depends_on('python@3.6:', when="+python", type=('build', 'run')) + depends_on('py-pybind11', when="+python", type=('build', 'link')) + + def cmake_args(self): + args = [ + self.define_from_variant("SIPM_BUILD_PYTHON", "python"), + self.define_from_variant("SIPM_ENABLE_OPENMP", "openmp"), + self.define("SIPM_ENABLE_TEST", self.run_tests), + + ] + return args diff --git a/var/spack/repos/builtin/packages/sombrero/package.py b/var/spack/repos/builtin/packages/sombrero/package.py index c834df6134f..8e117a1e2cb 100644 --- a/var/spack/repos/builtin/packages/sombrero/package.py +++ b/var/spack/repos/builtin/packages/sombrero/package.py @@ -12,15 +12,25 @@ class Sombrero(MakefilePackage): "A next-generation conjugate gradient benchmark from computational particle physics" homepage = "https://github.com/sa2c/sombrero" - url = "https://github.com/sa2c/sombrero/archive/refs/tags/1.0.tar.gz" + url = "https://github.com/sa2c/sombrero/archive/refs/tags/1.0.tar.gz" - version('1.0', sha256='423a631c86f0e5f14dea186228871099ca0374dc07bf1bb24b6be17f79784682') + version('2021-07-08', + sha256='816b0f0a684a421fa620f11c21649ac162e85d1febd6a7e10cfd07604760c0d6') + + # Version 1 is incompatible with spack + # as CFLAGS and the like are hardcoded in the makefile. + version('1.0', + sha256='423a631c86f0e5f14dea186228871099ca0374dc07bf1bb24b6be17f79784682', + deprecated=True) depends_on('mpi') + maintainers = ['mmesiti', 'edbennett'] + def edit(self, spec, prefix): # Make the `sombrero.sh` driver relocatable - sombrero_sh = FileFilter(join_path(self.stage.source_path, 'sombrero.sh')) + sombrero_sh = FileFilter( + join_path(self.stage.source_path, 'sombrero.sh')) sombrero_dir = join_path(prefix.bin, 'sombrero') sombrero_sh.filter('sombrero/', '{0}/'.format(sombrero_dir)) diff --git a/var/spack/repos/builtin/packages/spfft/package.py b/var/spack/repos/builtin/packages/spfft/package.py index 4660ce30ca6..a5e6448e82d 100644 --- a/var/spack/repos/builtin/packages/spfft/package.py +++ b/var/spack/repos/builtin/packages/spfft/package.py @@ -17,6 +17,7 @@ class Spfft(CMakePackage, CudaPackage): version('develop', branch='develop') version('master', branch='master') + version('1.0.4', sha256='41e63880d95343da0d8c3dbe5bfb3d46a1d612199cc9cc13a936f1628a7fdb8e') version('1.0.3', sha256='4f87734e3582ef96ddc0402d0db78cfc173bed9cab3e0d9c6a6bf8b660d69559') version('1.0.2', sha256='9b1296bda0b9ec3d37c74fd64354a01ebc6e2da7cb026c1f821882160b03c692') version('1.0.1', sha256='f8ab706309776cfbd2bfd8e29a6a9ffb5c8f3cd62399bf82db1e416ae5c490c8') diff --git a/var/spack/repos/builtin/packages/spla/package.py b/var/spack/repos/builtin/packages/spla/package.py index d4d12379098..544cf974cd0 100644 --- a/var/spack/repos/builtin/packages/spla/package.py +++ b/var/spack/repos/builtin/packages/spla/package.py @@ -15,6 +15,7 @@ class Spla(CMakePackage): url = "https://github.com/eth-cscs/spla/archive/v1.0.0.tar.gz" git = 'https://github.com/eth-cscs/spla.git' + version('1.5.1', sha256='2021a30b7cbb10bd660e5d94e1cc7bc6a428c87ea507e09d1e57e455685da421') version('1.5.0', sha256='bea782d46ce615e1c40efc2bfb19d95e3b59f332fc9ca83ac7e6684b8ac2dd93') version('1.4.0', sha256='364a9fe759fddec8a0839cf79f1cf0619fc36f4d4c15f1c2b1f437249d7840c6') version('1.3.0', sha256='ff05a22bd655607ff941f3228ac8605a813e1eec6eaa49fbcf7b58a3a4cf5f00') diff --git a/var/spack/repos/builtin/packages/ssht/package.py b/var/spack/repos/builtin/packages/ssht/package.py index ed05965812d..db8bb435be6 100644 --- a/var/spack/repos/builtin/packages/ssht/package.py +++ b/var/spack/repos/builtin/packages/ssht/package.py @@ -21,6 +21,7 @@ class Ssht(CMakePackage): maintainers = ['eschnett'] + version('1.4.0', sha256='b33f1b763a240df773a1900139aad6f6b5c676bb2b64a8c1062077fd95c08769') version('1.3.7', sha256='947c11b104734acb124171ff5115d14279b4d09bc297ac989204633919df422e') version('1.3.6', sha256='db652e0f550229a630643bbf4bdb270def25c158be5ccdcf594a24fd8054430d') version('1.3.5', sha256='2f71690cbd00f4969d7377e586022397bfb8efb107f7b13bf849a65e61362350') diff --git a/var/spack/repos/builtin/packages/strumpack/package.py b/var/spack/repos/builtin/packages/strumpack/package.py index b8cf21116be..e949db7dad7 100644 --- a/var/spack/repos/builtin/packages/strumpack/package.py +++ b/var/spack/repos/builtin/packages/strumpack/package.py @@ -147,11 +147,13 @@ def cmake_args(self): args.append('-DHIP_HIPCC_FLAGS=--amdgpu-target={0}'. format(",".join(rocm_archs))) + if self.spec.satisfies('@:5.1.1'): + self.test_data_dir = 'examples/data' + else: + self.test_data_dir = 'examples/sparse/data' + self.test_src_dir = 'test' return args - test_data_dir = 'examples/data' - test_src_dir = 'test' - @run_after('install') def cache_test_sources(self): """Copy the example source files after the package is installed to an @@ -185,7 +187,7 @@ def test(self): test_dir = join_path(self.install_test_root, self.test_src_dir) test_exe = 'test_sparse_seq' test_exe_mpi = 'test_sparse_mpi' - exe_arg = ['../../examples/data/pde900.mtx'] + exe_arg = [join_path('..', '..', self.test_data_dir, 'pde900.mtx')] if '+mpi' in self.spec: test_args = ['-n', '4', test_exe_mpi] test_args.extend(exe_arg) diff --git a/var/spack/repos/builtin/packages/sz/package.py b/var/spack/repos/builtin/packages/sz/package.py index bd743ed4f10..9972aafbbe8 100644 --- a/var/spack/repos/builtin/packages/sz/package.py +++ b/var/spack/repos/builtin/packages/sz/package.py @@ -15,6 +15,7 @@ class Sz(CMakePackage): maintainers = ['disheng222', 'robertu94'] version('master', branch='master') + version('2.1.12', sha256='3712b2cd7170d1511569e48a208f02dfb72ecd7ad053c321e2880b9083e150de') version('2.1.11.1', sha256='e6fa5c969b012782b1e5e9fbd1cd7d1c0ace908d9ec982e78b2910ec5c2161ac') version('2.1.11', sha256='85b8ef99344a3317ba9ee63ca4b9d99a51d1832d4d8880e01c7c56b3a69cacc9') version('2.1.10', sha256='3aba7619bdb5412218f162696f946c9d3a3df5acf128ddc685b21e45c11f6ae3', diff --git a/var/spack/repos/builtin/packages/tau/package.py b/var/spack/repos/builtin/packages/tau/package.py index 486b6734c9f..ae20635829a 100644 --- a/var/spack/repos/builtin/packages/tau/package.py +++ b/var/spack/repos/builtin/packages/tau/package.py @@ -331,3 +331,36 @@ def setup_run_environment(self, env): # in the latter case. if files: env.set('TAU_MAKEFILE', files[0]) + + matmult_test = join_path('examples', 'mm') + + @run_after('install') + def setup_build_tests(self): + """Copy the build test files after the package is installed to an + install test subdirectory for use during `spack test run`.""" + self.cache_extra_test_sources(self.matmult_test) + + def _run_matmult_test(self): + mm_dir = join_path(self.test_suite.current_test_cache_dir, self.matmult_test) + self.run_test('make', ['all'], [], 0, False, + 'Instrument and build matrix multiplication test code', + False, mm_dir) + test_exe = 'matmult' + if '+mpi' in self.spec: + test_args = ['-n', '4', test_exe] + mpiexe_list = ['mpirun', 'mpiexec', 'srun'] + for mpiexe in mpiexe_list: + if which(mpiexe) is not None: + self.run_test(mpiexe, test_args, [], 0, False, + 'Run matmult test with mpi', False, mm_dir) + break + else: + self.run_test(test_exe, [], [], 0, False, + 'Run sequential matmult test', False, mm_dir) + self.run_test('pprof', [], [], 0, False, + 'Run pprof profile analysis tool on profile output', + False, mm_dir) + + def test(self): + # Run mm test program pulled from the build + self._run_matmult_test() diff --git a/var/spack/repos/builtin/packages/tesseract/java_Makefile.patch b/var/spack/repos/builtin/packages/tesseract/java_Makefile.patch new file mode 100644 index 00000000000..aed17e854c0 --- /dev/null +++ b/var/spack/repos/builtin/packages/tesseract/java_Makefile.patch @@ -0,0 +1,28 @@ +--- a/java/Makefile.am 2019-12-26 08:21:51.000000000 -0600 ++++ b/java/Makefile.am 2021-06-11 17:30:44.522469994 -0500 +@@ -36,11 +36,11 @@ + com/google/scrollview/ScrollView.class + + SCROLLVIEW_LIBS = \ +- piccolo2d-core-3.0.jar \ +- piccolo2d-extras-3.0.jar \ ++ piccolo2d-core-3.0.1.jar \ ++ piccolo2d-extras-3.0.1.jar \ + jaxb-api-2.3.1.jar + +-CLASSPATH = piccolo2d-core-3.0.jar:piccolo2d-extras-3.0.jar:jaxb-api-2.3.1.jar ++CLASSPATH = piccolo2d-core-3.0.1.jar:piccolo2d-extras-3.0.1.jar:jaxb-api-2.3.1.jar + + ScrollView.jar : $(SCROLLVIEW_CLASSES) + $(JAR) cfm $@ $(srcdir)/Manifest.txt com/google/scrollview/*.class \ +@@ -51,8 +51,8 @@ + + .PHONY: fetch-jars + fetch-jars $(SCROLLVIEW_LIBS): +- curl -L http://search.maven.org/remotecontent?filepath=org/piccolo2d/piccolo2d-core/3.0/piccolo2d-core-3.0.jar > piccolo2d-core-3.0.jar +- curl -L http://search.maven.org/remotecontent?filepath=org/piccolo2d/piccolo2d-extras/3.0/piccolo2d-extras-3.0.jar > piccolo2d-extras-3.0.jar ++ curl -L http://search.maven.org/remotecontent?filepath=org/piccolo2d/piccolo2d-core/3.0.1/piccolo2d-core-3.0.1.jar > piccolo2d-core-3.0.1.jar ++ curl -L http://search.maven.org/remotecontent?filepath=org/piccolo2d/piccolo2d-extras/3.0.1/piccolo2d-extras-3.0.1.jar > piccolo2d-extras-3.0.1.jar + curl -L http://search.maven.org/remotecontent?filepath=javax/xml/bind/jaxb-api/2.3.1/jaxb-api-2.3.1.jar > jaxb-api-2.3.1.jar + + .PHONY: install-jars diff --git a/var/spack/repos/builtin/packages/tesseract/package.py b/var/spack/repos/builtin/packages/tesseract/package.py index 165ccc2d079..cee0285c56a 100644 --- a/var/spack/repos/builtin/packages/tesseract/package.py +++ b/var/spack/repos/builtin/packages/tesseract/package.py @@ -16,14 +16,69 @@ class Tesseract(AutotoolsPackage): version('4.1.0', sha256='5c5ed5f1a76888dc57a83704f24ae02f8319849f5c4cf19d254296978a1a1961') version('4.0.0', sha256='a1f5422ca49a32e5f35c54dee5112b11b99928fc9f4ee6695cdc6768d69f61dd') + # do not fetch the jar files from Makefile + patch('java_Makefile.patch') + + jars = [ + 'piccolo2d-core-3.0.1', + 'piccolo2d-extras-3.0.1', + 'jaxb-api-2.3.1' + ] + resource( + name=jars[0], + url='https://search.maven.org/remotecontent?filepath=org/piccolo2d/piccolo2d-core/3.0.1/piccolo2d-core-3.0.1.jar', + sha256='9acad723136ddb996e96f5d488b9b046753a1d4c60ea639d5e3f9701deaf60ad', + placement=jars[0], + expand=False, + ) + resource( + name=jars[1], + url='https://search.maven.org/remotecontent?filepath=org/piccolo2d/piccolo2d-extras/3.0.1/piccolo2d-extras-3.0.1.jar', + sha256='ba45f343e9ebc06c9b4ce165c8bb539b11cbf59e93d1df48489ab173f74375a8', + placement=jars[1], + expand=False, + ) + resource( + name=jars[2], + url='http://search.maven.org/remotecontent?filepath=javax/xml/bind/jaxb-api/2.3.1/jaxb-api-2.3.1.jar', + sha256='88b955a0df57880a26a74708bc34f74dcaf8ebf4e78843a28b50eae945732b06', + placement=jars[2], + expand=False, + ) + depends_on('autoconf', type='build') depends_on('automake', type='build') depends_on('libtool', type='build') depends_on('m4', type='build') + depends_on('doxygen', type='build') + depends_on('asciidoc', type='build') + depends_on('libxslt', type='build') + depends_on('pkgconfig', type='build') depends_on('leptonica') depends_on('libarchive') + depends_on('curl') + depends_on('icu4c') + depends_on('cairo') + depends_on('pango') + depends_on('java') - @when('@:4.0.0') - def configure_args(self): - args = ['LDFLAGS=-lz'] - return args + def autoreconf(self, spec, prefix): + autogen = Executable(join_path('.', 'autogen.sh')) + autogen() + + def setup_run_environment(self, env): + env.set('SCROLLVIEW_PATH', prefix.share.tessdata) + + @run_after('install') + def training(self): + make('training') + make('training-install') + + # move the jar files to the java directory + for jar in self.jars: + src = '{0}/{1}/{2}.jar'.format(self.stage.source_path, jar, jar) + dest = '{0}/java/{1}.jar'.format(self.stage.source_path, jar) + copy(src, dest) + + with working_dir('java'): + make('install-jars') diff --git a/var/spack/repos/builtin/packages/timemory/package.py b/var/spack/repos/builtin/packages/timemory/package.py index 814dbf4a344..4eeb39efc34 100644 --- a/var/spack/repos/builtin/packages/timemory/package.py +++ b/var/spack/repos/builtin/packages/timemory/package.py @@ -8,8 +8,9 @@ from spack import * -class Timemory(CMakePackage): - """Timing + Memory + Hardware Counter Utilities for C/C++/CUDA/Python""" +class Timemory(CMakePackage, PythonPackage): + '''Modular profiling toolkit and suite of libraries and tools + for C/C++/Fortran/CUDA/Python''' homepage = 'https://timemory.readthedocs.io/en/latest/' git = 'https://github.com/NERSC/timemory.git' @@ -17,21 +18,46 @@ class Timemory(CMakePackage): version('master', branch='master', submodules=True) version('develop', branch='develop', submodules=True) - version('3.0.1', commit='ef638e1cde90275ce7c0e12fc4902c27bcbdeefd', - submodules=True) - version('3.0.0', commit='b36b1673b2c6b7ff3126d8261bef0f8f176c7beb', - submodules=True) + version('3.2.3', commit='d535e478646e331a4c65cfd8c8f759c9a363ccc9', submodules=True) + version('3.2.2', commit='4725f4e4a3eea3b80b50a01ea088b5d5a1cf40ab', submodules=True) + version('3.2.1', commit='76ff978d9b1568b7f88a3de82bb84a2042003630', submodules=True) + version('3.2.0', commit='2bdd28e87224558060e27da90f9b6fcfb20dd324', submodules=True) + version('3.1.0', commit='b12de7eeed699d820693fecd6136daff744f21b6', submodules=True) + version('3.0.1', commit='ef638e1cde90275ce7c0e12fc4902c27bcbdeefd', submodules=True) + version('3.0.0', commit='b36b1673b2c6b7ff3126d8261bef0f8f176c7beb', submodules=True) variant('shared', default=True, description='Build shared libraries') variant('static', default=False, description='Build static libraries') + variant('pic', default=True, description='Build position independent code') + variant('install_headers', default=True, description='Install headers') + variant( + 'install_config', default=True, description='Install cmake configuration files' + ) variant('python', default=False, description='Enable Python support') - variant('python_deps', default=False, - description='Install non-critical python dependencies ' - '(may significantly increase spack install time)') - variant('mpi', default=False, - description='Enable support for MPI aggregation') - variant('nccl', default=False, - description='Enable support for wrapping NCCL functions') + variant( + 'python_hatchet', + default=False, + description='Build Python hatchet submodule ' + '(does not conflict with py-hatchet)', + ) + variant( + 'python_line_profiler', + default=False, + description=( + 'Build timemorys extended version of py-line-profiler ' + '(does not conflict with py-line-profiler)' + ), + ) + variant( + 'python_deps', + default=False, + description='Install non-critical python dependencies ' + '(may significantly increase spack install time)', + ) + variant('mpi', default=False, description='Enable support for MPI aggregation') + variant( + 'nccl', default=False, description='Enable support for wrapping NCCL functions' + ) variant('tau', default=False, description='Enable TAU support') variant('papi', default=False, description='Enable PAPI support') variant('cuda', default=False, description='Enable CUDA support') @@ -40,67 +66,157 @@ class Timemory(CMakePackage): variant('vtune', default=False, description='Enable VTune support') variant('upcxx', default=False, description='Enable UPC++ support') variant('gotcha', default=False, description='Enable GOTCHA support') - variant('likwid', default=False, description='Enable LIKWID support') + variant( + 'likwid', + default=False, + description='Enable LIKWID CPU marker API support (perfmon)', + ) + variant( + 'likwid_nvmon', + default=False, + description='Enable LIKWID GPU marker API support (nvmon)', + ) variant('caliper', default=False, description='Enable Caliper support') - variant('dyninst', default=False, - description='Build dynamic instrumentation tools') + variant('dyninst', default=False, description='Build dynamic instrumentation tools') variant('examples', default=False, description='Build/install examples') - variant('gperftools', default=False, - description='Enable gperftools support') - variant('kokkos_tools', default=False, - description=('Build generic kokkos-tools libraries, e.g. ' - 'kp_timemory, kp_timemory_filter')) - variant('kokkos_build_config', default=False, - description=('Build pre-configured (i.e. dedicated) kokkos-tools ' - 'libraries, e.g. kp_timemory_cpu_flops')) - variant('cuda_arch', default='auto', description='CUDA architecture name', - values=('auto', 'kepler', 'tesla', 'maxwell', 'pascal', - 'volta', 'turing'), multi=False) - variant('cpu_target', default='auto', - description=('Build for specific cpu architecture (specify ' - 'cpu-model)')) - variant('use_arch', default=False, - description=('Build all of timemory w/ cpu_target architecture ' - 'flags (default: roofline toolkit only)')) - variant('tls_model', default='global-dynamic', - description='Thread-local static model', multi=False, - values=('global-dynamic', 'local-dynamic', 'initial-exec', - 'local-exec')) - variant('lto', default=False, - description='Build w/ link-time optimization') - variant('statistics', default=True, - description=('Build components w/ support for statistics ' - '(min/max/stddev)')) - variant('extra_optimizations', default=True, - description='Build timemory with extra optimization flags') - variant('cxxstd', default='14', description='C++ language standard', - values=('14', '17', '20'), multi=False) - variant('mpip_library', default=False, - description='Build stand-alone timemory-mpip GOTCHA library') + variant('gperftools', default=False, description='Enable gperftools support') + variant( + 'kokkos_tools', + default=False, + description=( + 'Build generic kokkos-tools libraries, e.g. ' + 'kp_timemory, kp_timemory_filter' + ), + ) + variant( + 'kokkos_build_config', + default=False, + description=( + 'Build pre-configured (i.e. dedicated) kokkos-tools ' + 'libraries, e.g. kp_timemory_cpu_flops' + ), + ) + variant( + 'cuda_arch', + default='auto', + description='CUDA architecture name', + values=( + 'auto', + 'kepler', + 'kepler30', + 'kepler32', + 'kepler35', + 'kepler37', + 'tesla', + 'maxwell', + 'maxwell50', + 'maxwell52', + 'maxwell53', + 'pascal', + 'pascal60', + 'pascal61', + 'volta', + 'volta70', + 'volta72', + 'turing', + 'turing75', + 'ampere', + 'ampere80', + 'ampere86', + ), + multi=True, + ) + variant( + 'cpu_target', + default='auto', + description=('Build for specific cpu architecture (specify ' 'cpu-model)'), + ) + variant( + 'use_arch', + default=False, + description=( + 'Build all of timemory w/ cpu_target architecture ' + 'flags (default: roofline toolkit only)' + ), + ) + variant( + 'tls_model', + default='global-dynamic', + description='Thread-local static model', + multi=False, + values=('global-dynamic', 'local-dynamic', 'initial-exec', 'local-exec'), + ) + variant('lto', default=False, description='Build with link-time optimization') + variant( + 'statistics', + default=True, + description=('Build components w/ support for statistics ' '(min/max/stddev)'), + ) + variant( + 'extra_optimizations', + default=True, + description='Build timemory with extra optimization flags', + ) + variant( + 'cxxstd', + default='14', + description='C++ language standard', + values=('14', '17', '20'), + multi=False, + ) + variant( + 'cudastd', + default='14', + description='CUDA language standard', + values=('14', '17'), + multi=False, + ) + variant( + 'unity_build', + default=True, + description='Build with CMAKE_UNITY_BUILD=ON for faster builds ' + 'but larger memory consumption', + ) + variant( + 'mpip_library', + default=False, + description='Build stand-alone timemory-mpip GOTCHA library', + ) variant('ompt', default=False, description=('Enable OpenMP tools support')) - variant('ompt_standalone', default=False, - description=('Enable OpenMP tools support via drop-in ' - 'replacement of libomp/libgomp/libiomp5')) - variant('ompt_llvm', default=False, - description='Enable OpenMP tools support as part of llvm build') - variant('ompt_library', default=False, - description='Build stand-alone timemory-ompt library') - variant('allinea_map', default=False, - description='Enable Allinea ARM-MAP support') - variant('require_packages', default=True, - description=('find_package(...) resulting in NOTFOUND ' - 'generates error')) - - depends_on('cmake@3.11:', type='build') + variant( + 'ompt_library', + default=False, + description='Build stand-alone timemory-ompt library', + ) + variant('allinea_map', default=False, description='Enable Allinea ARM-MAP support') + variant( + 'require_packages', + default=True, + description=('find_package(...) resulting in NOTFOUND ' 'generates error'), + ) + variant( + 'compiler', default=True, description='Enable compiler instrumentation support' + ) + variant( + 'ert', + default=True, + description='Enable extern templates for empirical roofline toolkit (ERT)', + ) extends('python', when='+python') + depends_on('cmake@3.15:', type='build') depends_on('python@3:', when='+python', type=('build', 'run')) - depends_on('py-cython', when='+python', type=('build')) + depends_on('py-cython', when='+python_hatchet', type=('build')) + depends_on('py-cython', when='+python_line_profiler', type=('build')) depends_on('pil', when='+python+python_deps', type=('run')) depends_on('py-numpy', when='+python+python_deps', type=('run')) + depends_on('py-hatchet', when='+python+python_deps', type=('run')) depends_on('py-matplotlib', when='+python+python_deps', type=('run')) - depends_on('py-ipython', when='+python+python_deps', type=('run')) depends_on('py-mpi4py', when='+python+mpi+python_deps', type=('run')) + depends_on('py-pandas', when='+python_deps+python_hatchet', type=('run')) + depends_on('py-pydot', when='+python_deps+python_hatchet', type=('run')) + depends_on('py-pyyaml', when='+python_deps+python_hatchet', type=('run')) + depends_on('py-multiprocess', when='+python_deps+python_hatchet', type=('run')) depends_on('mpi', when='+mpi') depends_on('nccl', when='+nccl') depends_on('tau', when='+tau') @@ -108,117 +224,149 @@ class Timemory(CMakePackage): depends_on('cuda', when='+cuda') depends_on('cuda', when='+cupti') depends_on('upcxx', when='+upcxx') - depends_on('likwid', when='+likwid') + depends_on('likwid', when='+likwid~likwid_nvmon') + depends_on('likwid+cuda', when='+likwid+likwid_nvmon') depends_on('gotcha', when='+gotcha') depends_on('caliper', when='+caliper') depends_on('dyninst', when='+dyninst') depends_on('gperftools', when='+gperftools') depends_on('intel-parallel-studio', when='+vtune') - depends_on('llvm-openmp-ompt+standalone', when='+ompt_standalone') - depends_on('llvm-openmp-ompt~standalone', when='+ompt_llvm') depends_on('arm-forge', when='+allinea_map') - conflicts('+python', when='~shared', - msg='+python requires building shared libraries') + conflicts( + '+python', + when='~shared~static', + msg='+python requires building shared or static libraries', + ) + conflicts( + '~pic', + '~shared+static+python', + msg='Python bindings cannot be be linked to static libs w/o +pic', + ) conflicts('+python_deps', when='~python') conflicts('+cupti', when='~cuda', msg='CUPTI requires CUDA') - conflicts('+kokkos_tools', when='~tools', - msg='+kokkos_tools requires +tools') - conflicts('+kokkos_build_config', when='~tools', - msg='+kokkos_build_config requires +tools') - conflicts('+kokkos_build_config', when='~kokkos_tools', - msg='+kokkos_build_config requires +kokkos_tools') - conflicts('tls_model=local-dynamic', when='+python', - msg='+python require tls_model=global-dynamic') - conflicts('tls_model=initial-exec', when='+python', - msg='+python require tls_model=global-dynamic') - conflicts('tls_model=local-exec', when='+python', - msg='+python require tls_model=global-dynamic') - conflicts('+nccl', when='~gotcha', - msg='+nccl requires +gotcha') + conflicts('+kokkos_tools', when='~tools', msg='+kokkos_tools requires +tools') + conflicts( + '+kokkos_build_config', + when='~tools~kokkos_tools', + msg='+kokkos_build_config requires +tools+kokkos_tools', + ) + conflicts( + 'tls_model=local-dynamic', + when='+python', + msg='+python require tls_model=global-dynamic', + ) + conflicts( + 'tls_model=initial-exec', + when='+python', + msg='+python require tls_model=global-dynamic', + ) + conflicts( + 'tls_model=local-exec', + when='+python', + msg='+python require tls_model=global-dynamic', + ) + conflicts('+nccl', when='~gotcha', msg='+nccl requires +gotcha') + conflicts( + '+nccl', + when='~shared~static', + msg='+nccl requires building shared or static libraries', + ) conflicts('+mpip_library', when='~mpi', msg='+mpip_library requires +mpi') - conflicts('+mpip_library', when='~gotcha', - msg='+mpip_library requires +gotcha') - conflicts('+mpip_library', when='~shared', - msg='+mpip_library requires building shared libraries') - conflicts('+ompt_standalone', when='~ompt', - msg='+ompt_standalone requires +ompt') - conflicts('+ompt_llvm', when='~ompt', - msg='+ompt_llvm requires +ompt') - conflicts('+ompt_library', when='~ompt', - msg='+ompt_library requires +ompt') - conflicts('+ompt_library', when='~shared~static', - msg='+ompt_library requires building shared or static libraries') - conflicts('+ompt_standalone+ompt_llvm', - msg=('+ompt_standalone and +ompt_llvm are not compatible. Use ' - '+ompt_llvm~ompt_standalone if building LLVM, use ' - '~ompt_llvm+ompt_standalone if ompt.h is not provided by ' - 'the compiler')) + conflicts('+mpip_library', when='~gotcha', msg='+mpip_library requires +gotcha') + conflicts( + '+mpip_library', + when='~shared~static', + msg='+mpip_library requires building shared or static libraries', + ) + conflicts('+ompt_library', when='~ompt', msg='+ompt_library requires +ompt') + conflicts( + '+ompt_library', + when='~shared~static', + msg='+ompt_library requires building shared or static libraries', + ) + conflicts('+likwid_nvmon', when='~likwid', msg='+likwid_nvmon requires +likwid') def cmake_args(self): spec = self.spec args = [ - '-DTIMEMORY_BUILD_PYTHON=ON', - '-DTIMEMORY_BUILD_TESTING=OFF', - '-DCMAKE_INSTALL_RPATH_USE_LINK_PATH=ON', + self.define('SPACK_BUILD', True), + self.define('TIMEMORY_BUILD_OMPT', False), # disable submodule + self.define('TIMEMORY_BUILD_PYTHON', True), + self.define('TIMEMORY_BUILD_GOTCHA', False), # disable submodule + self.define('TIMEMORY_BUILD_CALIPER', False), # disable submodule + self.define('TIMEMORY_BUILD_TESTING', False), + self.define('TIMEMORY_USE_MPI_LINK_FLAGS', False), + self.define('CMAKE_INSTALL_RPATH_USE_LINK_PATH', True), + self.define_from_variant('BUILD_SHARED_LIBS', 'shared'), + self.define_from_variant('BUILD_STATIC_LIBS', 'static'), + self.define_from_variant('CMAKE_CXX_STANDARD', 'cxxstd'), + self.define_from_variant('CMAKE_CUDA_STANDARD', 'cudastd'), + self.define_from_variant('CMAKE_POSITION_INDEPENDENT_CODE', 'pic'), + self.define_from_variant('CpuArch_TARGET', 'cpu_target'), + self.define_from_variant('TIMEMORY_TLS_MODEL', 'tls_model'), + self.define_from_variant('TIMEMORY_UNITY_BUILD', 'unity_build'), + self.define_from_variant('TIMEMORY_REQUIRE_PACKAGES', 'require_packages'), + self.define_from_variant('TIMEMORY_INSTALL_HEADERS', 'install_headers'), + self.define_from_variant('TIMEMORY_INSTALL_CONFIG', 'install_config'), + self.define_from_variant('TIMEMORY_BUILD_ERT', 'ert'), + self.define_from_variant( + 'TIMEMORY_BUILD_COMPILER_INSTRUMENTATION', 'compiler' + ), + self.define_from_variant('TIMEMORY_BUILD_LTO', 'lto'), + self.define_from_variant('TIMEMORY_BUILD_TOOLS', 'tools'), + self.define_from_variant('TIMEMORY_BUILD_EXAMPLES', 'examples'), + self.define_from_variant('TIMEMORY_BUILD_NCCLP_LIBRARY', 'nccl'), + self.define_from_variant('TIMEMORY_BUILD_MALLOCP_LIBRARY', 'gotcha'), + self.define_from_variant('TIMEMORY_BUILD_MPIP_LIBRARY', 'mpip_library'), + self.define_from_variant('TIMEMORY_BUILD_OMPT_LIBRARY', 'ompt_library'), + self.define_from_variant('TIMEMORY_BUILD_KOKKOS_TOOLS', 'kokkos_tools'), + self.define_from_variant( + 'TIMEMORY_BUILD_KOKKOS_CONFIG', 'kokkos_build_config' + ), + self.define_from_variant( + 'TIMEMORY_BUILD_EXTRA_OPTIMIZATIONS', 'extra_optimizations' + ), + self.define_from_variant('TIMEMORY_BUILD_PYTHON_HATCHET', 'python_hatchet'), + self.define_from_variant( + 'TIMEMORY_BUILD_PYTHON_LINE_PROFILER', 'python_line_profiler' + ), + self.define_from_variant('TIMEMORY_USE_MPI', 'mpi'), + self.define_from_variant('TIMEMORY_USE_TAU', 'tau'), + self.define_from_variant('TIMEMORY_USE_ARCH', 'use_arch'), + self.define_from_variant('TIMEMORY_USE_PAPI', 'papi'), + self.define_from_variant('TIMEMORY_USE_OMPT', 'ompt'), + self.define_from_variant('TIMEMORY_USE_CUDA', 'cuda'), + self.define_from_variant('TIMEMORY_USE_NCCL', 'nccl'), + self.define_from_variant('TIMEMORY_USE_CUPTI', 'cupti'), + self.define_from_variant('TIMEMORY_USE_VTUNE', 'vtune'), + self.define_from_variant('TIMEMORY_USE_UPCXX', 'upcxx'), + self.define_from_variant('TIMEMORY_USE_PYTHON', 'python'), + self.define_from_variant('TIMEMORY_USE_GOTCHA', 'gotcha'), + self.define_from_variant('TIMEMORY_USE_LIKWID', 'likwid'), + self.define_from_variant('TIMEMORY_USE_LIKWID_PERFMON', 'likwid'), + self.define_from_variant('TIMEMORY_USE_LIKWID_NVMON', 'likwid_nvmon'), + self.define_from_variant('TIMEMORY_USE_DYNINST', 'dyninst'), + self.define_from_variant('TIMEMORY_USE_CALIPER', 'caliper'), + self.define_from_variant('TIMEMORY_USE_GPERFTOOLS', 'gperftools'), + self.define_from_variant('TIMEMORY_USE_STATISTICS', 'statistics'), + self.define_from_variant('TIMEMORY_USE_ALLINEA_MAP', 'allinea_map'), ] - cxxstd = spec.variants['cxxstd'].value - args.append('-DCMAKE_CXX_STANDARD={0}'.format(cxxstd)) - - tls = spec.variants['tls_model'].value - args.append('-DTIMEMORY_TLS_MODEL={0}'.format(tls)) - if '+python' in spec: - args.append('-DPYTHON_EXECUTABLE={0}'.format( - spec['python'].command.path)) - - if '+nccl' in spec: - args.append('-DTIMEMORY_USE_NCCL=ON') - args.append('-DTIMEMORY_BUILD_NCCLP_LIBRARY=ON') + pyexe = spec['python'].command.path + args.append(self.define('PYTHON_EXECUTABLE=', pyexe)) + args.append(self.define('Python3_EXECUTABLE', pyexe)) if '+mpi' in spec: - args.append('-DTIMEMORY_USE_MPI_LINK_FLAGS=OFF') - args.append('-DMPI_C_COMPILER={0}'.format(spec['mpi'].mpicc)) - args.append('-DMPI_CXX_COMPILER={0}'.format(spec['mpi'].mpicxx)) + args.append(self.define('MPI_C_COMPILER', spec['mpi'].mpicc)) + args.append(self.define('MPI_CXX_COMPILER', spec['mpi'].mpicxx)) if '+cuda' in spec: - targ = spec.variants['cuda_arch'].value - key = '' if spec.satisfies('@:3.0.1') else 'TIMEMORY_' # newer versions use 'TIMEMORY_CUDA_ARCH' - args.append('-D{0}CUDA_ARCH={1}'.format(key, targ)) - - cpu_target = spec.variants['cpu_target'].value - if cpu_target == 'auto': - args.append('-DCpuArch_TARGET={0}'.format(cpu_target)) - - # forced disabling of submodule builds - for dep in ('caliper', 'gotcha', 'ompt'): - args.append('-DTIMEMORY_BUILD_{0}=OFF'.format(dep.upper())) - - # spack options which translate to TIMEMORY_