Skip to content
Snippets Groups Projects

Update BrainScaleS and add hxtorch

2 unresolved threads
3 files
+ 44
8
Compare changes
  • Side-by-side
  • Inline
Files
3
@@ -3,6 +3,7 @@
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
from spack import *
import os
class Hxtorch(WafPackage):
@@ -12,7 +13,7 @@ class Hxtorch(WafPackage):
# 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')
version('2.0-rc8', branch='waf')
# PPU compiler dependencies
depends_on('oppulance@2.0:')
@@ -60,33 +61,67 @@ class Hxtorch(WafPackage):
for dep in self.spec.traverse(deptype='build'):
query = self.spec[dep.name]
try:
if dep.name in ['pthreadpool', 'fxdiv']:
print('skipping {} in SPACK_INCLUDE_DIRS/CPATH/C{,_PLUS}_INCLUDE_PATH\n'.format(dep.name))
    • You can't see any errors in the logs because it's inside the try/except:pass, but this line gets a KeyError: ',_PLUS' because the curly brackets need escaping and the PATHS are not modified as expected.

Please register or sign in to reply
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:', query.headers.directories, "\n")
print('headers (', dep.name, '):', query.headers.directories, "\n")
except:
pass
library = []
for dep in self.spec.traverse(deptype=('link', 'run')):
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:
library.extend(query.libs.directories)
print('libs:', query.libs.directories, "\n")
print('libs (', dep.name, '):', query.libs.directories, "\n")
# extend at front
library = query.libs.directories + library
except:
pass
path = []
for dep in self.spec.traverse(deptype=('build', 'link', 'run')):
if dep.name in ['pthreadpool', 'fxdiv']:
print('skipping {} for bin'.format(dep.name))
continue
query = self.spec[dep.name]
try:
path.append(query.prefix.bin)
print('bin:', query.prefix.bin, "\n")
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):
print("libs: manually adding ", self.spec['llvm'].prefix.lib)
library.append(self.spec['llvm'].prefix.lib)
# explicitly add googletest library if it isn't found above;
# adding in front of the list of libraries is a hack to circumvent
# issues from vendoring packages like pthreadpool
if not any('googletest' in lib for lib in library):
if os.path.isdir(self.spec['googletest'].prefix.lib64):
print("libs: manually inserting at front ", self.spec['googletest'].prefix.lib64)
library.insert(0, self.spec['googletest'].prefix.lib64)
if os.path.isdir(self.spec['googletest'].prefix.lib):
print("libs: manually inserting at front ", self.spec['googletest'].prefix.lib)
library.insert(0, self.spec['googletest'].prefix.lib)
env.set('CPATH', ':'.join(include))
env.set('C_INCLUDE_PATH', ':'.join(include))
env.set('CPLUS_INCLUDE_PATH', ':'.join(include))