Add fenicsx packages (#17743)

* add py-ufl package from fenics

* add py-fiat package from fenics

* add py-ffcx package from fenics

* add py-dijitso package from fenics

* add dolfinx library from fenics

* amend ffcx to use ufl and fiat master branches

* setup variants complex and int64 of dolfinx

* add dolfinx python library as package

* add test dependencies to py-dolfinx

* remove broken doc variant

* remove test dependencies from py-dolfinx

* flake8 fixes to dolfinx and py-dolfinx

* make sure dolfinx cmake picks up the correct python version

* list build phases in py-dolfinx package

* remove unnecessary package url

* make pkgconf a build dependency

* make all python dependencies build+run

* py-ffcx needs py-setuptools to be a build/run dependency to support ffcx executable

* remove unnecessary variants from dolfinx

* add missing dependencies to py-dijitso

* remove stray line from py-dolfinx

* simplify definition of build_directory in py-dolfinx

Co-authored-by: Adam J. Stewart <ajstewart426@gmail.com>

* use depends_on("python") rather than extends("python") in py-ffcx

Co-authored-by: Adam J. Stewart <ajstewart426@gmail.com>

* use depends_on("python") rather than extends("python") in py-fiat

Co-authored-by: Adam J. Stewart <ajstewart426@gmail.com>

* use depends_on("python") rather than extends("python") in py-ufl

Co-authored-by: Adam J. Stewart <ajstewart426@gmail.com>

* rename py-fiat to py-fenics-fiat

* rename py-ufl to py-fenics-ufl

* fix error in depends_on(petsc) definition

* add missing dep on numpy to py-fenics-fiat

* specify python@3.8: as requirement for all fenics components

* use tuples rather than list for depends_on type=

* specify eigen@3.3.7: as dependency for dolfinx

* add js947 and chrisrichardson as maintainers for the fenics packages

* remove scipy dependency from py-dolfinx

* rename package py-ffcx -> py-fenics-ffcx

* rename package dolfinx -> fenics-dolfinx

* rename package py-dolfinx -> py-fenics-dolfinx

* remove pointless URL from py-fenics-dolfinx package

* rename package py-dijitso -> py-fenics-dijitso

* formatting

* remove unecessary cmake args from fenics-dolfinx

* revert py-fenics-fiat python version to 3:

Co-authored-by: Adam J. Stewart <ajstewart426@gmail.com>

* revert py-fenics-ufl python version to 3.5:

Co-authored-by: Adam J. Stewart <ajstewart426@gmail.com>

* add conflict to fenics-dolfinx for C++17 support

* revert py-fenics-ffcx python version to 3.5:

Co-authored-by: Adam J. Stewart <ajstewart426@gmail.com>
This commit is contained in:
Jeffrey Salmond 2020-08-11 03:43:43 +01:00 committed by GitHub
parent 38f2a0a92b
commit 6ccc430e8f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 193 additions and 0 deletions

View File

@ -0,0 +1,53 @@
# Copyright 2013-2019 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 FenicsDolfinx(CMakePackage):
"""Next generation FEniCS problem solving environment"""
homepage = "https://github.com/FEniCS/dolfinx"
git = "https://github.com/FEniCS/dolfinx.git"
maintainers = ["js947", "chrisrichardson"]
version("master", branch="master")
variant("kahip", default=False, description="kahip support")
variant("parmetis", default=False, description="parmetis support")
variant("slepc", default=False, description="slepc support")
depends_on("cmake@3.9:", type="build")
depends_on("pkgconfig", type="build")
depends_on("mpi")
depends_on("hdf5+hl+fortran")
depends_on("boost")
depends_on("eigen@3.3.7:")
depends_on("petsc+mpi+shared+hypre+metis")
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"])
conflicts('%gcc@:6', msg='C++17 support required')
root_cmakelists_dir = "cpp"
def cmake_args(self):
args = [
"-DDOLFINX_SKIP_BUILD_TESTS=True",
"-DDOLFINX_ENABLE_KAHIP=%s" % (
'ON' if "+kahip" in self.spec else 'OFF'),
"-DDOLFINX_ENABLE_PARMETIS=%s" % (
'ON' if "+parmetis" in self.spec else 'OFF'),
"-DDOLFINX_ENABLE_SLEPC=%s" % (
'ON' if "+slepc" in self.spec else 'OFF'),
"-DPython3_ROOT_DIR=%s" % self.spec['python'].home,
"-DPython3_FIND_STRATEGY=LOCATION",
]
return args

View File

@ -0,0 +1,25 @@
# Copyright 2013-2019 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 PyFenicsDijitso(PythonPackage):
"""A Python module for distributed just-in-time shared library building"""
homepage = "https://bitbucket.org/fenics-project/dijitso"
url = "https://bitbucket.org/fenics-project/dijitso/downloads/dijitso-2018.1.0.tar.gz"
git = "https://bitbucket.org/fenics-project/dijitso.git"
maintainers = ["js947", "chrisrichardson"]
version("master", branch="master")
version("2018.1.0", sha256="2084ada1e7bd6ecec0999b15a17db98c72e26f1ccbf3fcbe240b1a035a1a2e64")
version("2017.2.0", sha256="05a893d17f8a50067d303b232e41592dce2840d6499677ad8b457ba58a679b58")
version("2017.1.0", sha256="ef23952539d349fbd384d41302abc94413d485ca7e8c29e8a0debc2aadaf8657")
version("2016.2.0", sha256="1bfa0ac0d47dae75bbde8fabb1145d3caa2e6c28a1e4097ad5550a91a8a205e4")
depends_on("py-setuptools", type="build")
depends_on("python@3.5:", type=("build", "run"))
depends_on("py-numpy", type=("build", "run"))

View File

@ -0,0 +1,28 @@
# Copyright 2013-2019 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 PyFenicsDolfinx(PythonPackage):
"""Python interface library to Next generation FEniCS problem solving
environment"""
homepage = "https://github.com/FEniCS/dolfinx"
git = "https://github.com/FEniCS/dolfinx.git"
maintainers = ["js947", "chrisrichardson"]
version("master", branch="master")
depends_on("cmake@3.9:", type="build")
depends_on("fenics-dolfinx@master")
depends_on("py-mpi4py", type=("build", "run"))
depends_on("py-petsc4py", type=("build", "run"))
depends_on("py-pybind11", type=("build", "run"))
import_modules = ['dolfinx']
phases = ['build_ext', 'build', 'install']
build_directory = 'python'

View File

@ -0,0 +1,23 @@
# Copyright 2013-2019 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 PyFenicsFfcx(PythonPackage):
"""Next generation FEniCS Form Compiler"""
homepage = "https://github.com/FEniCS/ffcx"
git = "https://github.com/FEniCS/ffcx.git"
maintainers = ["js947", "chrisrichardson"]
version("master", branch="master")
depends_on('python@3.5:', type=('build', 'run'))
depends_on("py-setuptools", type=("build", "run"))
depends_on("py-cffi", type=("build", "run"))
depends_on("py-fenics-ufl@master", type=("build", "run"))
depends_on("py-fenics-fiat@master", type=("build", "run"))
depends_on("py-numpy", type=("build", "run"))

View File

@ -0,0 +1,34 @@
# Copyright 2013-2019 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 PyFenicsFiat(PythonPackage):
"""The FInite element Automatic Tabulator FIAT supports generation of
arbitrary order instances of the Lagrange elements on lines, triangles, and
tetrahedra. It is also capable of generating arbitrary order instances of
Jacobi-type quadrature rules on the same element shapes. Further, H(div)
and H(curl) conforming finite element spaces such as the families of
Raviart-Thomas, Brezzi-Douglas-Marini and Nedelec are supported on
triangles and tetrahedra. Upcoming versions will also support Hermite and
nonconforming elements"""
homepage = "https://fenicsproject.org/"
url = "https://github.com/FEniCS/fiat/archive/2019.1.0.tar.gz"
git = "https://github.com/FEniCS/fiat.git"
maintainers = ["js947", "chrisrichardson"]
version("master", branch="master")
version('2019.1.0', sha256='2a6d175a825ed725843918ef28846edbcf710a879c2fe8caaeda77b1ce9b9a1c')
version('2018.1.0', sha256='7468709c7aacf7dfb22c09fb5250448eb24084b9dd088ec2632a96d56c0f3830')
version('2017.2.0', sha256='e4d3ffc86a0a717b3f17b9bb2d922214c342be27e5bdfbe50f110030bfff9729')
version('2017.1.0.post1', sha256='1784fe1cb9479ca7cd85f63b0afa6e07634feec8d8e82fa8be4c480649cb9621')
version('2017.1.0', sha256='d4288401ad16c4598720f9db0810a522f7f0eadad35d8211bac7120bce5fde94')
depends_on('python@3:', type=('build', 'run'))
depends_on('py-setuptools', type="build")
depends_on('py-numpy', type=("build", "run"))
depends_on('py-sympy', type=("build", "run"))

View File

@ -0,0 +1,30 @@
# Copyright 2013-2019 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 PyFenicsUfl(PythonPackage):
"""The Unified Form Language (UFL) is a domain specific language for
declaration of finite element discretizations of variational forms. More
precisely, it defines a flexible interface for choosing finite element
spaces and defining expressions for weak forms in a notation close to
mathematical notation."""
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"]
version("master", branch="master")
version('2019.1.0', sha256='46ac0df4e96327be10b9576d2b8fa8b2c4ca62d3c681d407f5718b162d3ca22d')
version('2018.1.0', sha256='b0d4c2f43f396fd5609317b70d55b53b89c649962fc8a593f4e0e21607da211d')
version('2017.2.0.post0', sha256='111e77707cd6731584b1041f405c2fd3f1752a86c51fd9c430524bd396f293b0')
version('2017.2.0', sha256='0adff7a511185b20c38ddaccdeed6c1b2ecafe4b163c688bfd1316d5c3b1c00d')
version('2017.1.0.post1', sha256='82c8170f44c2392c7e60aa86495df22cc209af50735af8115dc35aeda4b0ca96')
depends_on("python@3.5:", type=('build', 'run'))
depends_on("py-setuptools", type="build")
depends_on("py-numpy", type=("build", "run"))