diff --git a/packages/py-bluepyopt/package.py b/packages/py-bluepyopt/package.py new file mode 100644 index 0000000000000000000000000000000000000000..7c2b821b9c0da8a7a897eeb435a7e8a02b88a38a --- /dev/null +++ b/packages/py-bluepyopt/package.py @@ -0,0 +1,45 @@ +############################################################################## +# 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 PyBluepyopt(PythonPackage): + """Bluebrain Python Optimisation Library""" + + homepage = "https://github.com/BlueBrain/BluePyOpt" + pypi = "bluepyopt/bluepyopt-1.9.27.tar.gz" + + # NOTE : while adding new release check pmi_rank.patch compatibility + version('1.10.38', sha256='fb1411c6a8fbfac52d36b837225bae882fd6524acfb4d0580189312ef3c1cfcc') + version('1.9.37', sha256='4399af71de48b288832e92f0de73c431bf88d6e76e2c4ea250c3b38fb38a45a8') + version('1.9.27', sha256='4cce15b92b32311c808cae5e005b664deb6e8dc5df4ca13ea7b59252ae346522') + version('1.8.68', sha256='b9d432840aab89d4863c935d3dc604816441eba02d731422b92056cee751ca9c') + version('1.6.56', sha256='1c57c91465ca4b947fe157692e7004a3e6df02e4151e3dc77a8831382a8f1ab9') + version('1.8.68', sha256='b9d432840aab89d4863c935d3dc604816441eba02d731422b92056cee751ca9c') + version('1.9.12', sha256='7b623ab9168f460a85d952719ca5249248fc95e6f7a02658b0673b2baa0a8fc6') + + # patch required to avoid hpe-mpi linked mechanism library + patch("pmi_rank.patch", when="@1.9.27:") + + variant('neuron', default=True, description="Use BluePyOpt together with NEURON") + + depends_on('py-setuptools', type='build') + depends_on('py-pandas', type='run') + depends_on('py-numpy', type='run') + depends_on('py-efel', type='run') + depends_on('py-deap', type='run') + depends_on('py-scoop@0.7:', type='run', when='@:1.9.37') + depends_on('py-ipyparallel', type='run') + depends_on('py-pickleshare', type='run') + depends_on('py-future', type='run') + depends_on('py-jinja2', type='run') + depends_on('py-pebble@4.3.10:', type='run') + depends_on('neuron', type='run', when='+neuron') + + def setup_run_environment(self, env): + env.unset('PMI_RANK') + env.set('NEURON_INIT_MPI', "0") + env.prepend_path('PATH', self.spec['py-ipyparallel'].prefix.bin) diff --git a/packages/py-bluepyopt/pmi_rank.patch b/packages/py-bluepyopt/pmi_rank.patch new file mode 100644 index 0000000000000000000000000000000000000000..21a73849b2868389f5e05d9670adc0fb18fadab5 --- /dev/null +++ b/packages/py-bluepyopt/pmi_rank.patch @@ -0,0 +1,17 @@ +diff --git a/bluepyopt/ephys/simulators.py b/bluepyopt/ephys/simulators.py +index e71ad8b..3c93237 100644 +--- a/bluepyopt/ephys/simulators.py ++++ b/bluepyopt/ephys/simulators.py +@@ -89,6 +89,12 @@ class NrnSimulator(object): + NrnSimulator._nrn_disable_banner() + self.banner_disabled = True + ++ # certain mpi libraries (hpe-mpt) use PMI_RANK env variable to initialize ++ # MPI before calling MPI_Init (which is undesirable). Unset this variable ++ # if exist to avoid issue with loading neuron and mechanism library. ++ if 'PMI_RANK' in os.environ: ++ os.environ.pop("PMI_RANK") ++ + import neuron # NOQA + + return neuron diff --git a/packages/py-libsonata/package.py b/packages/py-libsonata/package.py new file mode 100644 index 0000000000000000000000000000000000000000..6ac7d2105103dd1609b191e7de35477cbbd70470 --- /dev/null +++ b/packages/py-libsonata/package.py @@ -0,0 +1,35 @@ +# Copyright 2013-2018 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 PyLibsonata(PythonPackage): + """SONATA files reader""" + + homepage = "https://github.com/BlueBrain/libsonata" + git = "https://github.com/BlueBrain/libsonata.git" + + version('develop', branch='master', submodules=True, get_full_repo=True) + version('0.1.12', tag='v0.1.12', submodules=True, get_full_repo=True) + version('0.1.11', tag='v0.1.11', submodules=True, get_full_repo=True) + version('0.1.10', tag='v0.1.10', submodules=True, get_full_repo=True) + # Important: v0.1.9 is not Spack-compatible (use v0.1.10: instead) + # version('0.1.9', tag='v0.1.9', submodules=True, get_full_repo=True) + version('0.1.8', tag='v0.1.8', submodules=True, get_full_repo=True) + version('0.1.6', tag='v0.1.6', submodules=True, get_full_repo=True) + version('0.1.5', tag='v0.1.5', submodules=True, get_full_repo=True) + version('0.1.4', tag='v0.1.4', submodules=True, get_full_repo=True) + version('0.1.3', tag='v0.1.3', submodules=True, get_full_repo=True) + version('0.1.0', tag='v0.1.0', submodules=True, get_full_repo=True) + version('0.0.3', tag='v0.0.3', submodules=True) + + depends_on('cmake@3.3:', type='build') + depends_on('hdf5') + depends_on('py-pybind11') + + depends_on('py-numpy@1.12:', type=('build', 'run')) + depends_on('py-setuptools', type='build', when='@0.1:') + depends_on('py-setuptools-scm', type='build', when='@0.1:') diff --git a/packages/py-pebble/package.py b/packages/py-pebble/package.py new file mode 100644 index 0000000000000000000000000000000000000000..ab9ef132377410fe695ee9f603df530860e67054 --- /dev/null +++ b/packages/py-pebble/package.py @@ -0,0 +1,21 @@ +# 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 PyPebble(PythonPackage): + """Python API to manage threads and processes within an application.""" + + homepage = "https://github.com/noxdafox/pebble" + pypi = "pebble/Pebble-4.5.0.tar.gz" + git = "https://github.com/noxdafox/pebble.git" + + version('4.5.0', sha256='2de3cd11aa068e0c4a4abbaf8d4ecfdac409d8bfb78a4c211a01f6a4fb17a35f') + version('4.4.1', sha256='7c4d68a3479140cba74d7454d8190e2cb1a93213b44b5befe3c53c201beb8317') + version('4.3.10', sha256='c39a7bf99af6525fcf0783a8859fb10a4f20f4f988ddb66fd6fa7588f9c91731') + + depends_on('py-setuptools', type=('build', 'run')) + depends_on('py-futures', type='run', when='^python@:2.9.9') diff --git a/packages/py-pyswarms/package.py b/packages/py-pyswarms/package.py new file mode 100644 index 0000000000000000000000000000000000000000..eb83ce579fc31b6af20764bcafaa74ee90e6ba10 --- /dev/null +++ b/packages/py-pyswarms/package.py @@ -0,0 +1,17 @@ +from spack import * + + +class PyPyswarms(PythonPackage): + + homepage = "https://github.com/ljvmiranda921/pyswarms" + pypi = "pyswarms/pyswarms-1.3.0.tar.gz" + + version('1.3.0', sha256='1204aa9c332c662113e3c37d1b109906f4a0859b29ded80c1582dc66387ce34b') + + depends_on('py-scipy', type=('build', 'run')) + depends_on('py-numpy', type=('build', 'run')) + depends_on('py-matplotlib@1.3.1:', type=('build', 'run')) + depends_on('py-attrs', type=('build', 'run')) + depends_on('py-tqdm', type=('build', 'run')) + depends_on('py-future', type=('build', 'run')) + depends_on('py-pyyaml', type=('build', 'run')) diff --git a/packages/snudda/package.py b/packages/py-snudda/package.py similarity index 74% rename from packages/snudda/package.py rename to packages/py-snudda/package.py index 3ba55c98e191002241ea03f18b8a9792ed93c0b2..b803c62b75ab34432f07db53c6019bb90982033f 100644 --- a/packages/snudda/package.py +++ b/packages/py-snudda/package.py @@ -1,6 +1,6 @@ from spack import * -class Snudda(Package): +class PySnudda(Package): homepage = 'https://pypi.org/project/snudda/' url = 'https://pypi.org/packages/source/s/snudda/snudda-1.2.9-py3-none-any.whl' list_url = 'https://pypi.org/simple/snudda/' @@ -12,19 +12,19 @@ class Snudda(Package): depends_on('python@3.8:', type=('build','run')) depends_on('py-pip', type='build') depends_on('unzip', type='build') - #depends_on('py-bluepyopt', type=('build','run')) must get this from BlueBrainProject https://github.com/BlueBrain/spack/tree/develop/var/spack/repos/builtin/packages/py-bluepyopt + depends_on('py-bluepyopt', type=('build','run')) # got this from BlueBrainProject https://github.com/BlueBrain/spack/tree/develop/var/spack/repos/builtin/packages/py-bluepyopt depends_on('py-h5py', type=('build','run')) depends_on('py-ipyparallel', type=('build','run')) depends_on('py-matplotlib', type=('build','run')) depends_on('py-mpi4py', type=('build','run')) depends_on('py-numpy', type=('build','run')) depends_on('py-scipy', type=('build','run')) - #depends_on('py-libsonata', type=('build','run')) - get it from https://github.com/BlueBrain/spack/tree/develop/var/spack/repos/builtin/packages/py-libsonata + depends_on('py-libsonata', type=('build','run')) # got it from https://github.com/BlueBrain/spack/tree/develop/var/spack/repos/builtin/packages/py-libsonata depends_on('py-pyzmq', type=('build','run')) depends_on('py-numexpr', type=('build','run')) depends_on('py-argparse', type=('build','run')) depends_on('neuron', type=('build','run')) - #depends_on('pyswarms', type=('build','run')) - must package this + depends_on('py-pyswarms', type=('build','run')) depends_on('py-setuptools', type=('build','run')) depends_on('py-psutil', type=('build','run')) depends_on('py-cython', type=('build','run')) diff --git a/spack.yaml b/spack.yaml index 4fd7d59500b01b29c8eca17fc2429dd6db1f70b7..123090250adbdbd5a5c3309045a8dc2c7a8ea572 100644 --- a/spack.yaml +++ b/spack.yaml @@ -52,6 +52,7 @@ spack: - py-lfpy@2.2.6 - py-elephant - py-frites + - py-snudda #- biobb-common #- biobb-md #- apbs