Skip to content
Snippets Groups Projects

update branch

Merged Eleni Mathioulaki requested to merge master into test-spacktests-workaround
20 files
+ 709
316
Compare changes
  • Side-by-side
  • Inline
Files
20
+ 41
39
@@ -5,7 +5,6 @@
import os
from spack import *
from spack.pkg.builtin.boost import Boost
class Hxtorch(WafPackage):
@@ -15,27 +14,26 @@ class Hxtorch(WafPackage):
# This repo provides a waf binary used for the build below
git = "https://github.com/electronicvisions/pynn-brainscales.git"
version('4.0-a3', branch='waf')
version('4.0-a4', branch='waf')
# PPU compiler dependencies
depends_on('oppulance@4.0-a3')
depends_on('oppulance@4.0-a4')
# host software dependencies
depends_on('bitsery', type=('build', 'link', 'run'))
depends_on('binutils+gold+ld+plugins', type=('build', 'link', 'run')) # specialize
depends_on(Boost.with_default_variants)
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('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('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('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('log4cxx@0.12.1:', type=('build', 'link', 'run'))
depends_on('pkgconfig', 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
@@ -47,7 +45,8 @@ class Hxtorch(WafPackage):
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-torch@1.9.1:', type=('build', 'link', 'run'))
depends_on('py-torchvision', type=('run')) # for demos
depends_on('py-pyyaml', type=('build', 'link', 'run'))
depends_on('py-scipy', type=('build', 'link', 'run'))
depends_on('py-sqlalchemy', type=('build', 'link', 'run'))
@@ -61,53 +60,46 @@ class Hxtorch(WafPackage):
configuration."""
include = []
for dep in self.spec.traverse(deptype='build'):
include_exclude_dirs = set(['/usr/include'])
for dep in self.spec.traverse(deptype='build', root=False):
query = self.spec[dep.name]
if dep.name in ['pthreadpool', 'fxdiv']:
print('skipping {} in SPACK_INCLUDE_DIRS/CPATH/C{{,_PLUS}}_INCLUDE_PATH\n'.format(dep.name))
for d in query.headers.directories:
if os.path.exists(d):
env.remove_path('SPACK_INCLUDE_DIRS', d)
continue
try:
if dep.name in ['pthreadpool', 'fxdiv']:
print('skipping {} in SPACK_INCLUDE_DIRS/CPATH/C{{,_PLUS}}_INCLUDE_PATH\n'.format(dep.name))
for d in query.headers.directories:
if os.path.exists(d):
env.remove_path('SPACK_INCLUDE_DIRS', d)
continue
include.extend(query.headers.directories)
print('headers (', dep.name, '):', query.headers.directories, "\n")
except:
include_dirs = set(query.headers.directories)
include_dirs -= include_exclude_dirs
print('headers (', dep.name, '):', include_dirs, "\n")
include.extend(list(include_dirs))
except spack.error.NoHeadersError:
# we don't care if no header directories are found
pass
library = []
for dep in self.spec.traverse(deptype=('link', 'run')):
library_exclude_dirs = set(['/lib', '/lib64', '/usr/lib', '/usr/lib64'])
for dep in self.spec.traverse(deptype=('link', 'run'), root=False):
query = self.spec[dep.name]
# we probably should skip/remove the entries for the same
# dependencies as above; however, ".libs" relies on the package
# name being the same as the library name (e.g. approx.
# libPACKAGE.so) so we are just moving googletest to the front
if dep.name == 'googletest':
for d in [self.spec['googletest'].prefix.lib64, self.spec['googletest'].prefix.lib]:
if os.path.exists(d):
print('moving to front of SPACK_{LINK,RPATH}_DIRS\n', d)
env.remove_path('SPACK_LINK_DIRS', d)
env.prepend_path('SPACK_LINK_DIRS', d)
env.remove_path('SPACK_RPATH_DIRS', d)
env.prepend_path('SPACK_RPATH_DIRS', d)
try:
print('libs (', dep.name, '):', query.libs.directories, "\n")
# extend at front
library = query.libs.directories + library
except:
library_dirs = set(query.libs.directories)
library_dirs -= library_exclude_dirs
print('libs (', dep.name, '):', library_dirs, "\n")
library.extend(list(library_dirs))
except spack.error.NoLibrariesError:
# we don't care if no library directories are found
pass
path = []
for dep in self.spec.traverse(deptype=('build', 'link', 'run')):
for dep in self.spec.traverse(deptype=('build', 'link', 'run'), root=False):
if dep.name in ['pthreadpool', 'fxdiv']:
print('skipping {} for bin'.format(dep.name))
continue
query = self.spec[dep.name]
try:
if os.path.exists(self.prefix.bin):
path.append(query.prefix.bin)
print('bin (', dep.name, '):', 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):
@@ -171,5 +163,15 @@ class Hxtorch(WafPackage):
def build_args(self):
args = ['--keep', '--test-execnone', '-v']
return args
def build_test(self):
self.waf('install', '--test-execall')
def install_args(self):
args = ['--test-execnone']
return args
def install_test(self):
with working_dir('spack-test', create=True):
python('-c', 'import hxtorch; print(hxtorch.__file__)')