diff --git a/packages/hxtorch/package.py b/packages/hxtorch/package.py new file mode 100644 index 0000000000000000000000000000000000000000..dc584e262ee3dbc0a005992a299fbb566936dcdb --- /dev/null +++ b/packages/hxtorch/package.py @@ -0,0 +1,135 @@ +# Copyright 2013-2022 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 Hxtorch(WafPackage): + """hxtorch --- a PyTorch-based toplevel for the BrainScaleS-2 neuromorphic hardware systems""" + + homepage = "https://github.com/electronicvisions/hxtorch" + # This repo provides a waf binary used for the build below + git = "https://github.com/electronicvisions/pynn-brainscales.git" + + version('2.0-rc6', branch='waf') + + # PPU compiler dependencies + depends_on('oppulance@2.0:') + + # host software dependencies + depends_on('bitsery', type=('build', 'link', 'run')) + depends_on('binutils+gold+ld+plugins', type=('build', 'link', 'run')) # specialize + depends_on('boost@1.69.0: +graph+icu+mpi+python+numpy+coroutine+context cxxstd=17', type=('build', 'link', 'run')) # specialize boost (non-clingo, type=('build', 'link', 'run')) + depends_on('cereal', type=('build', 'link', 'run')) + depends_on('cppcheck', type=('build', 'link', 'run')) + depends_on('doxygen+graphviz', type=('build', 'link', 'run')) + depends_on('genpybind@ebrains', type=('build', 'link', 'run')) + depends_on('gflags', type=('build', 'link', 'run')) + depends_on('googletest@1.11.0: +gmock', type=('build', 'link', 'run')) # variadic templates needed + depends_on('intel-tbb', type=('build', 'link', 'run')) # ppu gdbserver + depends_on('libelf', type=('build', 'link', 'run')) + depends_on('liblockfile', type=('build', 'link', 'run')) + depends_on('llvm', type=('build', 'link', 'run')) + depends_on('log4cxx', type=('build', 'link', 'run')) + depends_on('pkg-config', type=('build', 'link', 'run')) + depends_on('python@3.7.0:', type=('build', 'link', 'run')) # BrainScaleS(-2, type=('build', 'link', 'run')) only supports Python >= 3.7 + depends_on('py-h5py', type=('build', 'link', 'run')) # PyNN tests need it + depends_on('py-matplotlib', type=('build', 'link', 'run')) + depends_on('py-nose', type=('build', 'link', 'run')) + depends_on('py-numpy', type=('build', 'link', 'run')) + depends_on('py-pybind11', type=('build', 'link', 'run')) + depends_on('py-pybind11-stubgen', type=('build', 'link', 'run')) + depends_on('py-pycodestyle', type=('build', 'link', 'run')) + depends_on('py-pyelftools', type=('build', 'link', 'run')) + depends_on('py-pylint', type=('build', 'link', 'run')) + depends_on('py-torch', type=('build', 'link', 'run')) + depends_on('py-pyyaml', type=('build', 'link', 'run')) + depends_on('py-scipy', type=('build', 'link', 'run')) + depends_on('py-sqlalchemy', type=('build', 'link', 'run')) + depends_on('util-linux', type=('build', 'link', 'run')) + depends_on('yaml-cpp+shared', type=('build', 'link', 'run')) + extends('python') + + def setup_build_environment(self, env): + """waf needs to find headers and libraries by itself (mostly `boost` + tool, but also `gtest`); it also needs to run executables during + configuration.""" + + include = [] + for dep in self.spec.traverse(deptype='build'): + query = self.spec[dep.name] + try: + include.extend(query.headers.directories) + print('headers:', query.headers.directories, "\n") + except: + pass + + library = [] + for dep in self.spec.traverse(deptype=('link', 'run')): + query = self.spec[dep.name] + try: + library.extend(query.libs.directories) + print('libs:', query.libs.directories, "\n") + except: + pass + + path = [] + for dep in self.spec.traverse(deptype=('build', 'link', 'run')): + query = self.spec[dep.name] + try: + path.append(query.prefix.bin) + print('bin:', query.prefix.bin, "\n") + except: + pass + + # llvm might be built with ~shared_libs but still builds shared libs + if not any('llvm' in lib for lib in library): + library.append(self.spec['llvm'].prefix.lib) + + env.set('CPATH', ':'.join(include)) + env.set('C_INCLUDE_PATH', ':'.join(include)) + env.set('CPLUS_INCLUDE_PATH', ':'.join(include)) + env.set('LIBRARY_PATH', ':'.join(library)) + env.set('LD_LIBRARY_PATH', ':'.join(library)) + env.prepend_path('PATH', ':'.join(path)) + + def setup_run_environment(self, env): + env.prepend_path('PYTHONPATH', self.prefix.lib) + + # override configure step as we perform a project setup first + def configure(self, spec, prefix): + """Setup and configure the project.""" + + self.waf('setup', '--repo-db-url=https://github.com/electronicvisions/projects', '--without-munge', + '--project=hxtorch@ebrains-' + str(spec.version), + '--project=haldls@ebrains-' + str(spec.version), + '--project=grenade@ebrains-' + str(spec.version), + '--project=code-format@ebrains-' + str(spec.version), + '--project=logger@ebrains-' + str(spec.version), + '--project=halco@ebrains-' + str(spec.version), + '--project=hate@ebrains-' + str(spec.version), + '--project=fisch@ebrains-' + str(spec.version), + '--project=ztl@ebrains-' + str(spec.version), + '--project=hxcomm@ebrains-' + str(spec.version), + '--project=rant@ebrains-' + str(spec.version), + '--project=pywrap@ebrains-' + str(spec.version), + '--project=lib-boost-patches@ebrains-' + str(spec.version), + '--project=sctrltp@ebrains-' + str(spec.version), + '--project=hwdb@ebrains-' + str(spec.version), + '--project=visions-slurm@ebrains-' + str(spec.version), + '--project=flange@ebrains-' + str(spec.version), + '--project=lib-rcf@ebrains-' + str(spec.version), + '--project=bss-hw-params@ebrains-' + str(spec.version), + '--project=libnux@ebrains-' + str(spec.version) + ) + + args = ['--prefix={0}'.format(self.prefix)] + args += self.configure_args() + + self.waf('configure', *args) + + def build_args(self): + args = ['--keep', '--test-execnone', '-v'] + + return args 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-pynn/package.py b/packages/py-pynn/package.py index 3f14ed7b1ddce44f5cdb96d52149ff1a5de81705..52a88ae29dd4a93a8cda1bfa5c9527a932a6f83a 100644 --- a/packages/py-pynn/package.py +++ b/packages/py-pynn/package.py @@ -12,32 +12,39 @@ class PyPynn(PythonPackage): """ homepage = "http://neuralensemble.org/PyNN/" - pypi = "PyNN/PyNN-0.8.3.tar.gz" - git = "https://github.com/NeuralEnsemble/PyNN.git" + pypi = "PyNN/PyNN-0.10.0.tar.gz" + git = "https://github.com/NeuralEnsemble/PyNN.git" + version('0.10.0', sha256='04120fe0e03260d664b337e0ac29d985c3fb3684ef35b1add93a66739891c98f') version('0.9.6', sha256='d85226800e30bc1692d3f84485c3fa20b921c2ab55f1201d0a3bf23432e16cd2') version('0.9.5', sha256='91af2126b639a6a795bfc2709ac49423278c4794b6d0da143908b9afcb415f80') - version('0.9.1', sha256='bbc60fea3235427191feb2daa0e2fa07eb1c3946104c068ac8a2a0501263b0b1') - version('0.8.3', sha256='9d59e6cffa4714f0c892ec6b32d1f5f8f75ba3a20d8635bac50c047aa6f2537e') - version('0.8beta', commit='ffb0cb1661f2b0f2778db8f71865978fe7a7a6a4') - version('0.8.1', sha256='ce94246284588414d1570c1d5d697805f781384e771816727c830b01ee30fe39') - version('0.7.5', sha256='15f75f422f3b71c6129ecef23f29d8baeb3ed6502e7a321b8a2596c78ef7e03c') variant('mpi', default=False, description='Enable MPI support') + depends_on('python@2.7:2.8,3.3:', when="@0.9.5") + depends_on('python@2.7:2.8,3.6:', when="@0.9.6") + depends_on('python@3.7:', when="@0.10.0:") - depends_on('python@2.6:2.8,3.3:') depends_on('py-jinja2@2.7:', type=('build', 'run')) depends_on('py-docutils@0.10:', type=('build', 'run')) - depends_on('py-numpy@1.5:', type=('build', 'run')) - depends_on('py-quantities@0.10:', type=('build', 'run')) - depends_on('py-lazyarray@0.2.9:', type=('build', 'run')) - depends_on('py-neo@0.3:0.4.1', type=('build', 'run'), when="@:0.8.3") - depends_on('py-neo@0.5.0:', type=('build', 'run'), when="@0.9.0:") - depends_on('py-lazyarray', type=('build', 'run'), when="@0.9.0:") + depends_on('py-numpy@1.8.2:', type=('build', 'run'), when="@0.9.5") + depends_on('py-numpy@1.13.0:', type=('build', 'run'), when="@0.9.6") + depends_on('py-numpy@1.16.1:', type=('build', 'run'), when="@0.10.0:") - depends_on('mpi', when='+mpi') depends_on('py-mpi4py', type=('build', 'run'), when='+mpi') + depends_on('py-quantities@0.12.1:', type=('build', 'run'), when="@0.9.5:") + + depends_on('py-lazyarray@0.3.2:', type=('build', 'run'), when="@0.9.5") + depends_on('py-lazyarray@0.3.4:', type=('build', 'run'), when="@0.9.6") + depends_on('py-lazyarray@0.5.0:', type=('build', 'run'), when="@0.10.0:") + + depends_on('py-neo@0.5.2:', type=('build', 'run'), when="@0.9.5") + depends_on('py-neo@0.8.0', type=('build', 'run'), when="@0.9.6") + depends_on('py-neo@0.10.0:', type=('build', 'run'), when="@0.10.0:") + + depends_on('py-lazyarray@0.3.2:', type=('build', 'run'), when="@0.9.5") + depends_on('py-lazyarray@0.3.4:', type=('build', 'run'), when="@0.9.6") + depends_on('py-lazyarray@0.5.0:', type=('build', 'run'), when="@0.10.0:") depends_on('py-mock@1.0:', type='test') 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 63% rename from packages/snudda/package.py rename to packages/py-snudda/package.py index 3ba55c98e191002241ea03f18b8a9792ed93c0b2..9f741f99bf1d201e311c55c07450712d750a57f3 100644 --- a/packages/snudda/package.py +++ b/packages/py-snudda/package.py @@ -1,8 +1,8 @@ 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' + url = 'https://files.pythonhosted.org/packages/py3/s/snudda/snudda-1.2.9-py3-none-any.whl' list_url = 'https://pypi.org/simple/snudda/' maintainers = ['hjorth','akarmas'] @@ -12,20 +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-setuptools', type=('build','run')) + depends_on('py-pyswarms', type=('build','run')) + depends_on('py-setuptools', type=('build')) depends_on('py-psutil', type=('build','run')) depends_on('py-cython', type=('build','run')) depends_on('py-numba', type=('build','run')) diff --git a/packages/pynn-brainscales/package.py b/packages/pynn-brainscales/package.py index 0cb2c05025977d0eeef82dc787ae42e196fafb32..bc16c0af0ac63be9dfe9e3a8c210f4c3a63569f6 100644 --- a/packages/pynn-brainscales/package.py +++ b/packages/pynn-brainscales/package.py @@ -11,7 +11,7 @@ class PynnBrainscales(WafPackage): homepage = "https://github.com/electronicvisions/pynn-brainscales" git = "https://github.com/electronicvisions/pynn-brainscales.git" - version('2.0-rc5', branch='waf') + version('2.0-rc6', branch='waf') # PPU compiler dependencies depends_on('oppulance@2.0:') diff --git a/spack.yaml b/spack.yaml index 60a65fdba64664f1a61367033aa31318d999fee5..e4231356d231b69d3ed06a7075f7c6f91e78ae65 100644 --- a/spack.yaml +++ b/spack.yaml @@ -21,14 +21,16 @@ spack: - nest@3.3 +python +gsl +mpi - arbor +python +mpi ^python@3:3.9 - neuron +mpi - - py-pynn@0.9.6 + # - py-pynn@0.9.6 + - py-pynn@0.10.0 +mpi - tvb-data - tvb-library ^py-numba@0.54.0 ^binutils+ld+gold - tvb-storage ^binutils+ld+gold - py-pyaescrypt - py-formencode - tvb-framework ^binutils+ld+gold - - pynn-brainscales@2.0-rc5 ^log4cxx@0.10.0 ^googletest@1.11.0:+gmock + - pynn-brainscales@2.0-rc6 ^log4cxx@0.10.0 ^googletest@1.11.0:+gmock + #- hxtorch@2.0-rc6 ^log4cxx@0.10.0 ^googletest@1.11.0:+gmock - py-neo #- py-cerebstats #- py-cerebunit @@ -50,10 +52,11 @@ spack: - py-lfpy@2.2.6 - py-elephant - py-frites + #- py-snudda #- biobb-common #- biobb-md #- apbs - - py-pdb2pqr + #- py-pdb2pqr #- sda # demo for codejam12 #- funniest1022