Skip to content
Snippets Groups Projects

feat(wf-brainscales2-demos): Enable automatic notebook testing

Merged Eric Müller requested to merge massaging_wf-brainscales2-demos into master
Files
3
+ 29
11
@@ -11,24 +11,25 @@ class Hxtorch(WafPackage):
@@ -11,24 +11,25 @@ class Hxtorch(WafPackage):
"""hxtorch --- a PyTorch-based toplevel for the BrainScaleS-2 neuromorphic hardware systems"""
"""hxtorch --- a PyTorch-based toplevel for the BrainScaleS-2 neuromorphic hardware systems"""
homepage = "https://github.com/electronicvisions/hxtorch"
homepage = "https://github.com/electronicvisions/hxtorch"
# This repo provides a waf binary used for the build below
# This repo provides a custom waf binary used for the build below
git = "https://github.com/electronicvisions/pynn-brainscales.git"
git = "https://github.com/electronicvisions/pynn-brainscales.git"
version('7.0-a1', branch='waf')
version('7.0-a1', branch='waf')
# PPU compiler dependencies
# compiler for the BrainScaleS-2 embedded processor ("PPU"); needed for
depends_on('oppulance@7.0-a1')
# building/linking, at runtime and for testing
 
depends_on('oppulance@7.0-a1', type=('build', 'link', 'run', 'test'))
# host software dependencies
# host software dependencies
depends_on('bitsery', type=('build', 'link', 'run'))
depends_on('bitsery', type=('build', 'link', 'run', 'test'))
depends_on('binutils+gold+ld+plugins', type=('build', 'link', 'run')) # specialize
depends_on('binutils+gold+ld+plugins', type=('build', 'link', 'run')) # specialize
depends_on('boost@1.69.0: +graph+icu+mpi+numpy+coroutine+context+filesystem+python+serialization+system+thread+program_options cxxstd=17', type=('build', 'link', 'run')) # specialize boost (non-clingo, type=('build', 'link', 'run'))
depends_on('boost@1.69.0: +graph+icu+mpi+numpy+coroutine+context+filesystem+python+serialization+system+thread+program_options cxxstd=17', type=('build', 'link', 'run', 'test'))
depends_on('cereal', type=('build', 'link', 'run'))
depends_on('cereal', type=('build', 'link', 'run', 'test'))
depends_on('cppcheck', type=('build', 'link', 'run'))
depends_on('cppcheck', type=('build', 'link', 'run'))
depends_on('genpybind@ebrains', type=('build', 'link', 'run'))
depends_on('genpybind@ebrains', type=('build', 'link', 'run'))
depends_on('gflags', 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('googletest@1.11.0:+gmock', type=('build', 'link', 'run')) # variadic templates needed
depends_on('inja', type=('build', 'link', 'run')) # template engine for PPU source jit generation
depends_on('inja', type=('build', 'link', 'run', 'test')) # template engine for PPU source jit generation
depends_on('intel-tbb', type=('build', 'link', 'run')) # ppu gdbserver
depends_on('intel-tbb', type=('build', 'link', 'run')) # ppu gdbserver
depends_on('libelf', type=('build', 'link', 'run'))
depends_on('libelf', type=('build', 'link', 'run'))
depends_on('liblockfile', type=('build', 'link', 'run'))
depends_on('liblockfile', type=('build', 'link', 'run'))
@@ -36,7 +37,7 @@ class Hxtorch(WafPackage):
@@ -36,7 +37,7 @@ class Hxtorch(WafPackage):
depends_on('log4cxx@0.12.1:', type=('build', 'link', 'run'))
depends_on('log4cxx@0.12.1:', type=('build', 'link', 'run'))
depends_on('pkgconfig', type=('build', 'link', 'run'))
depends_on('pkgconfig', type=('build', 'link', 'run'))
depends_on('psmisc', type=('run', 'test'))
depends_on('psmisc', type=('run', 'test'))
depends_on('python@3.7.0:', type=('build', 'link', 'run')) # BrainScaleS(-2, type=('build', 'link', 'run')) only supports Python >= 3.7
depends_on('python@3.7.0:', type=('build', 'link', 'run')) # BrainScaleS-2 only supports Python >= 3.7
depends_on('py-h5py', type=('build', 'link', 'run')) # PyNN tests need it
depends_on('py-h5py', type=('build', 'link', 'run')) # PyNN tests need it
depends_on('py-jax@0.3.25:', type=('build', 'link', 'run'))
depends_on('py-jax@0.3.25:', type=('build', 'link', 'run'))
depends_on('py-matplotlib', type=('build', 'link', 'run'))
depends_on('py-matplotlib', type=('build', 'link', 'run'))
@@ -48,7 +49,7 @@ class Hxtorch(WafPackage):
@@ -48,7 +49,7 @@ class Hxtorch(WafPackage):
depends_on('py-pycodestyle', type=('build', 'link', 'run'))
depends_on('py-pycodestyle', type=('build', 'link', 'run'))
depends_on('py-pyelftools', type=('build', 'link', 'run'))
depends_on('py-pyelftools', type=('build', 'link', 'run'))
depends_on('py-pylint', type=('build', 'link', 'run'))
depends_on('py-pylint', type=('build', 'link', 'run'))
depends_on('py-torch@1.9.1:', type=('build', 'link', 'run'))
depends_on('py-torch@1.9.1:', type=('build', 'link', 'run', 'test'))
depends_on('py-torchvision', type=('run')) # for demos
depends_on('py-torchvision', type=('run')) # for demos
depends_on('py-tree-math', type=('build', 'link', 'run'))
depends_on('py-tree-math', type=('build', 'link', 'run'))
depends_on('py-pyyaml', type=('build', 'link', 'run'))
depends_on('py-pyyaml', type=('build', 'link', 'run'))
@@ -128,11 +129,28 @@ class Hxtorch(WafPackage):
@@ -128,11 +129,28 @@ class Hxtorch(WafPackage):
env.set('WAF_CONFIGURE_LD_LIBRARY_PATH', ':'.join(library))
env.set('WAF_CONFIGURE_LD_LIBRARY_PATH', ':'.join(library))
env.prepend_path('PATH', ':'.join(path))
env.prepend_path('PATH', ':'.join(path))
def setup_dependent_build_environment(self, env, dependent_spec):
def _setup_common_env(self, env):
 
# TODO: use standard install layout for Python modules and extensions'
 
# shared objects => remove then
env.prepend_path('PYTHONPATH', self.prefix.lib)
env.prepend_path('PYTHONPATH', self.prefix.lib)
 
# grenade needs to find some libraries for the JIT-compilation of
 
# programs for BrainScaleS-2's embedded processor.
 
ppu_include_dirs = []
 
ppu_dep_names = ['bitsery', 'boost', 'cereal']
 
for ppu_dep_name in ppu_dep_names:
 
dep = self.spec[ppu_dep_name]
 
dep_include_dirs = set(dep.headers.directories)
 
print('ppu includes (', dep.name, '):', dep_include_dirs, "\n")
 
ppu_include_dirs.extend(list(dep_include_dirs))
 
env.set('C_INCLUDE_PATH', ':'.join(ppu_include_dirs))
 
env.set('CPLUS_INCLUDE_PATH', ':'.join(ppu_include_dirs))
 
 
def setup_dependent_build_environment(self, env, dependent_spec):
 
self._setup_common_env(env)
 
def setup_run_environment(self, env):
def setup_run_environment(self, env):
env.prepend_path('PYTHONPATH', self.prefix.lib)
self._setup_common_env(env)
# override configure step as we perform a project setup first
# override configure step as we perform a project setup first
def configure(self, spec, prefix):
def configure(self, spec, prefix):