Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found

Target

Select target project
  • rshimoura/ebrains-spack-builds
  • ziaee/ebrains-spack-builds
  • hl11/ebrains-spack-builds
  • filippomarchetti/ebrains-spack-builds
  • jkaiser/ebrains-spack-builds
  • hjorth/ebrains-spack-builds-sept-2024
  • dsegebarth/ebrains-spack-builds
  • kozlov/ebrains-spack-builds
  • dsegebarth/ebrains-spack-builds-na-3
  • ansimsek/ebrains-spack-builds
  • lupoc/ebrains-spack-builds
  • hartmut/ebrains-spack-builds
  • ri/tech-hub/platform/esd/ebrains-spack-builds
  • lcalori0/ebrains-spack-builds
  • deepu/ebrains-spack-builds
  • noelp/ebrains-spack-builds
16 results
Show changes
Showing
with 765 additions and 233 deletions
diff -Naur a/tools/cpp/unix_cc_configure.bzl b/tools/cpp/unix_cc_configure.bzl
--- a/tools/cpp/unix_cc_configure.bzl 1980-01-01 00:00:00.000000000 -0800
+++ b/tools/cpp/unix_cc_configure.bzl 2022-06-30 23:53:17.000000000 -0700
@@ -379,7 +379,7 @@
"",
False,
), ":")
- gold_linker_path = _find_gold_linker_path(repository_ctx, cc)
+ gold_linker_path = None
cc_path = repository_ctx.path(cc)
if not str(cc_path).startswith(str(repository_ctx.path(".")) + "/"):
# cc is outside the repository, set -B
@@ -468,7 +468,6 @@
# Security hardening requires optimization.
# We need to undef it as some distributions now have it enabled by default.
"-U_FORTIFY_SOURCE",
- "-fstack-protector",
# All warnings are enabled. Maybe enable -Werror as well?
"-Wall",
# Enable a few more warnings that aren't part of -Wall.
diff -Naur a/tools/cpp/unix_cc_configure.bzl b/tools/cpp/unix_cc_configure.bzl
--- a/tools/cpp/unix_cc_configure.bzl 1980-01-01 00:00:00.000000000 -0800
+++ b/tools/cpp/unix_cc_configure.bzl 2022-06-30 23:35:14.000000000 -0700
@@ -417,10 +417,7 @@
bazel_linklibs,
False,
), ":")
- gold_or_lld_linker_path = (
- _find_linker_path(repository_ctx, cc, "lld", is_clang) or
- _find_linker_path(repository_ctx, cc, "gold", is_clang)
- )
+ gold_or_lld_linker_path = None
cc_path = repository_ctx.path(cc)
if not str(cc_path).startswith(str(repository_ctx.path(".")) + "/"):
# cc is outside the repository, set -B
@@ -531,7 +528,6 @@
# Security hardening requires optimization.
# We need to undef it as some distributions now have it enabled by default.
"-U_FORTIFY_SOURCE",
- "-fstack-protector",
# All warnings are enabled. Maybe enable -Werror as well?
"-Wall",
# Enable a few more warnings that aren't part of -Wall.
diff -Naur a/tools/cpp/unix_cc_configure.bzl b/tools/cpp/unix_cc_configure.bzl
--- a/tools/cpp/unix_cc_configure.bzl 1980-01-01 00:00:00.000000000 -0800
+++ b/tools/cpp/unix_cc_configure.bzl 2022-06-30 23:58:26.945067883 -0700
@@ -419,10 +419,7 @@
bazel_linklibs,
False,
), ":")
- gold_or_lld_linker_path = (
- _find_linker_path(repository_ctx, cc, "lld", is_clang) or
- _find_linker_path(repository_ctx, cc, "gold", is_clang)
- )
+ gold_or_lld_linker_path = None
cc_path = repository_ctx.path(cc)
if not str(cc_path).startswith(str(repository_ctx.path(".")) + "/"):
# cc is outside the repository, set -B
@@ -530,7 +527,6 @@
"%{cxx_builtin_include_directories}": get_starlark_list(builtin_include_directories),
"%{compile_flags}": get_starlark_list(
[
- "-fstack-protector",
# All warnings are enabled. Maybe enable -Werror as well?
"-Wall",
# Enable a few more warnings that aren't part of -Wall.
# Copyright 2013-2021 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 BiobbCommon(PythonPackage):
"""Biobb_common is the base package required to use the biobb packages"""
# Homepage and download url
homepage = "https://github.com/bioexcel/biobb_common"
#url = "https://github.com/bioexcel/biobb_common/tarball/v3.7.0"
git = 'https://github.com/bioexcel/biobb_common.git'
# FIXME: Add a list of GitHub accounts to
# notify when the package is updated.
# maintainers = ['github_user1', 'github_user2']
# Versions
version('3.8.1', branch='master')
# Dependencies
depends_on('py-setuptools')
depends_on('python@3.8:', type=('build', 'run'))
depends_on('py-pyyaml', type=('build', 'run'))
depends_on('py-requests', type=('build', 'run'))
depends_on('py-biopython@1.78:1.80', type=('build', 'run'))
from spack import *
class BiobbGromacs(PythonPackage):
"""Biobb_gromacs is the Biobb module collection to perform molecular
dynamics simulations using Gromacs"""
# Homepage and download url
homepage = "https://github.com/bioexcel/biobb_gromacs"
git = 'https://github.com/bioexcel/biobb_gromacs.git'
# Versions
version('3.8.0', branch='master')
# Dependencies
depends_on('python@3.8:', type=('build', 'run'))
depends_on('biobb-common')
depends_on('gromacs')
# Copyright 2013-2024 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)
import os
import unittest.mock
import xml.etree.ElementTree as ET
from spack.package import *
from spack.util.environment import EnvironmentModifications
import spack.build_environment
class BuildBrainscales(WafPackage):
"""Common stuff for BrainScaleS packages..."""
version(
"10.0-a1",
git="https://github.com/electronicvisions/releases-ebrains",
tag="ebrains-10.0-a1",
commit="d9bd675b446be8f313972aef2d6657ffbbb91ed2",
submodules=True,
)
version(
"9.0-a9",
git="https://github.com/electronicvisions/releases-ebrains",
tag="ebrains-9.0-a9",
commit="41d2597bd6c1c20aee4d538c42c248195a133680",
submodules=True,
)
version(
"9.0-a8",
git="https://github.com/electronicvisions/releases-ebrains",
tag="ebrains-9.0-a8",
commit="44323be431da4b4b43890815f453c27207dee0b2",
submodules=True,
)
version(
"9.0-a7",
git="https://github.com/electronicvisions/releases-ebrains",
tag="ebrains-9.0-a7",
commit="2337adc6a33f907900d2b8be5d9f0b15872a200a",
submodules=True,
)
version(
"9.0-a6",
git="https://github.com/electronicvisions/releases-ebrains",
tag="ebrains-9.0-a6",
commit="e9b6746edb5e8465ae2848556b70e4edd555182e",
submodules=True,
)
version(
"9.0-a5",
git="https://github.com/electronicvisions/releases-ebrains",
tag="ebrains-9.0-a5",
commit="5fcb0682626d83c089e016aaf433e0938e921634",
submodules=True,
)
version(
"9.0-a4",
git="https://github.com/electronicvisions/releases-ebrains",
tag="ebrains-9.0-a4",
commit="8d5be2a23ac1eb0129bdf1f83fb0a1c5193c4c85",
submodules=True,
)
# common dependencies of BuildBrainscales-derived packages
depends_on('oppulance@9.0-a9', when='@10.0-a1', type=('build', 'link', 'run', 'test')) # keep the old one for now
depends_on('oppulance@9.0-a9', when='@9.0-a9', type=('build', 'link', 'run', 'test'))
depends_on('oppulance@9.0-a8', when='@9.0-a8', type=('build', 'link', 'run', 'test'))
depends_on('oppulance@9.0-a7', when='@9.0-a7', type=('build', 'link', 'run', 'test'))
depends_on('oppulance@9.0-a6', when='@9.0-a6', type=('build', 'link', 'run', 'test'))
depends_on('oppulance@9.0-a5', when='@9.0-a5', type=('build', 'link', 'run', 'test'))
depends_on('oppulance@9.0-a4', when='@9.0-a4', type=('build', 'link', 'run', 'test'))
# waf setup performs git clone and might query gerrit
depends_on('git', type=('build', 'link'))
depends_on('py-git-review', type=('build', 'link'))
# old BrainScaleS EBRAINS releases used `waf setup --project=X` to download
# sources of the dependent repositories
@when("@:8")
def do_fetch(self, mirror_only=False):
"""Setup the project."""
self.stage.create()
self.stage.fetch(mirror_only)
# if fetcher didn't do anything, it's cached already
if not os.path.exists(self.stage.source_path):
return
with working_dir(self.stage.source_path):
python = which('python3')
if self.spec.satisfies('@:7'):
python('./waf', 'setup', '--repo-db-url=https://github.com/electronicvisions/projects',
'--clone-depth=2',
'--without-munge',
'--without-hxcomm-hostarq',
'--without-hxcomm-extoll',
'--project=' + str(self.spec.name),
'--release-branch=ebrains-' + str(self.spec.version)
)
else:
python('./waf', 'setup', '--repo-db-url=https://github.com/electronicvisions/projects',
'--clone-depth=2',
'--without-munge',
'--without-hxcomm-hostarq',
'--project=' + str(self.spec.name),
'--release-branch=ebrains-' + str(self.spec.version)
)
# in the configure step, we need access to all archived .git folders
def custom_archive(self, destination):
super(spack.fetch_strategy.GitFetchStrategy, self).archive(destination)
with unittest.mock.patch('spack.fetch_strategy.GitFetchStrategy.archive', new=custom_archive):
self.stage.cache_local()
# new BrainScaleS EBRAINS releases use git submodules to download sources;
# we still need to keep the `.git/` folders of the submodules in the source cache though
@when("@9:")
def do_fetch(self, mirror_only=False):
# in the configure step, we need access to all archived .git folders
def custom_archive(self, destination):
super(spack.fetch_strategy.GitFetchStrategy, self).archive(destination)
with unittest.mock.patch('spack.fetch_strategy.GitFetchStrategy.archive', new=custom_archive):
super(BuildBrainscales, self).do_fetch(mirror_only)
def _setup_common_env(self, env):
# 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)
ppu_include_dirs.extend(list(dep_include_dirs))
for dir in reversed(ppu_include_dirs):
env.prepend_path("C_INCLUDE_PATH", dir)
env.prepend_path("CPLUS_INCLUDE_PATH", dir)
def setup_build_environment(self, env):
my_envmod = EnvironmentModifications(env)
spack.build_environment.set_wrapper_variables(self, my_envmod)
my_env = {}
my_envmod.apply_modifications(my_env)
def get_path(env, name):
path = env.get(name, "").strip()
if path:
return path.split(os.pathsep)
return []
# spack tries to find headers and libraries by itself (i.e. it's not
# relying on the compiler to find it); we explicitly expose the
# spack-provided env vars that contain include and library paths
if 'SPACK_STORE_INCLUDE_DIRS' in my_env:
for dir in reversed(get_path(my_env, "SPACK_STORE_INCLUDE_DIRS")):
env.prepend_path("C_INCLUDE_PATH", dir)
env.prepend_path("CPLUS_INCLUDE_PATH", dir)
if 'SPACK_INCLUDE_DIRS' in my_env:
for dir in reversed(get_path(my_env, "SPACK_INCLUDE_DIRS")):
env.prepend_path("C_INCLUDE_PATH", dir)
env.prepend_path("CPLUS_INCLUDE_PATH", dir)
if 'SPACK_STORE_LINK_DIRS' in my_env:
for dir in reversed(get_path(my_env, "SPACK_STORE_LINK_DIRS")):
env.prepend_path("LIBRARY_PATH", dir)
env.prepend_path("LD_LIBRARY_PATH", dir)
if 'SPACK_LINK_DIRS' in my_env:
for dir in reversed(get_path(my_env, "SPACK_LINK_DIRS")):
env.prepend_path("LIBRARY_PATH", dir)
env.prepend_path("LD_LIBRARY_PATH", dir)
for dir in reversed(self.compiler.implicit_rpaths()):
env.prepend_path("LIBRARY_PATH", dir)
# technically this is probably not needed for the non-configure steps
env.prepend_path("LD_LIBRARY_PATH", dir)
def setup_dependent_build_environment(self, env, dependent_spec):
self._setup_common_env(env)
def setup_run_environment(self, env):
self._setup_common_env(env)
def setup_dependent_run_environment(self, env, dependent_spec):
self._setup_common_env(env)
# override configure step as we perform a project setup first
def configure(self, spec, prefix):
"""Configure the project."""
args = ['--prefix={0}'.format(self.prefix)]
args += self.configure_args()
if spec.version >= Version("9"):
self.waf('setup', '--directory=' + str(spec.name), '--repo-db-url=https://github.com/electronicvisions/projects')
self.waf('configure', '--build-profile=release', '--disable-doxygen', *args)
def build_args(self):
args = ['--keep', '--test-execnone', '-v']
return args
def build_test(self):
self.builder.waf('build', '--test-execall')
copy_tree('build/test_results', join_path(self.prefix, '.build'))
copy_tree('build/test_results', join_path(self.stage.path, ".install_time_tests"))
# propagate failures from junit output to spack
tree = ET.parse('build/test_results/summary.xml')
for testsuite in tree.getroot():
for testcase in testsuite:
if (testcase.get('name').startswith("pycodestyle") or
testcase.get('name').startswith("pylint")):
continue
for elem in testcase:
if (elem.tag == 'failure') and not (
elem.get('message').startswith("pylint:") or
elem.get('message').startswith("pycodestyle:") or
"catchsegv: not found" in elem.get('message') or
("OK" in elem.get('message') and "Segmentation fault" in elem.get('message'))):
raise RuntimeError("Failed test found: {}".format(testcase.get('name')))
def install_args(self):
args = ['--test-execnone']
return args
from spack import *
# Copyright 2013-2024 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.package import *
# Usage
# from clb_nb_utils import oauth
......
from spack import *
class Funniest1022(PythonPackage):
pypi = 'funniest1022/funniest1022-0.3.tar.gz'
maintainers = ['akarmas']
version('0.3', '248ec9320ad80dc4b05dca73e4deff78')
depends_on('python@3.8:', type=('build','run'))
depends_on('py-pandas', type=('build','run'))
##############################################################################
# Copyright (c) 2013-2017, Lawrence Livermore National Security, LLC.
# Produced at the Lawrence Livermore National Laboratory.
# Copyright 2013-2024 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# This file is part of Spack.
# Created by Todd Gamblin, tgamblin@llnl.gov, All rights reserved.
# LLNL-CODE-647188
#
# For details, see https://github.com/spack/spack
# Please also see the NOTICE and LICENSE files for our notice and the LGPL.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License (as
# published by the Free Software Foundation) version 2.1, February 1999.
#
# This program is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the IMPLIED WARRANTY OF
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the terms and
# conditions of the GNU Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public
# License along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
##############################################################################
from spack import *
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
from spack.package import *
class Genpybind(WafPackage):
......@@ -40,16 +21,24 @@ class Genpybind(WafPackage):
version('develop', branch='develop')
version('visions', branch='master', git='https://github.com/electronicvisions/genpybind')
# good for ebrains-10.0 too…
version('ebrains-llvm15', tag='ebrains-9.0-a9', git='https://github.com/electronicvisions/genpybind')
version('ebrains', tag='ebrains_release-1-rc1', git='https://github.com/electronicvisions/genpybind')
depends_on(
'llvm+clang+python+visionary@5.0.0:',
type=('build', 'link', 'run'))
type=('build', 'link'))
depends_on('binutils', type='build')
depends_on('python@2.7:', type=('build', 'run'))
extends('python')
patch('v0.2.1-python3.10.patch', when='@:0.2.1 ^python@3.10:')
# llvm-config needs to be found at build time of packages using genpybind
def setup_dependent_build_environment(self, env, dependent_spec):
env.prepend_path("PATH", self.spec["llvm"].prefix.bin)
def configure_args(self):
args = super(Genpybind, self).configure_args()
......
diff --git a/genpybind/annotations.py b/genpybind/annotations.py
index 1dfd1f4..871ef4d 100644
--- a/genpybind/annotations.py
+++ b/genpybind/annotations.py
@@ -3,7 +3,7 @@
from __future__ import unicode_literals
import ast
-import collections
+from collections.abc import Sequence
from clang.cindex import CursorKind
@@ -25,7 +25,7 @@ LOZENGE = u"◊"
SPECIAL_NAMES = {"true": True, "false": False, "default": None, "none": None}
-class Annotations(collections.Sequence):
+class Annotations(Sequence):
def __init__(self, annotations=None):
# type: (Union[None, Text, Iterable[Text]]) -> None
self._annotations = [] # type: List[AnnotationT]
diff --git a/genpybind/registry.py b/genpybind/registry.py
index 4f66ace..75ba7a9 100644
--- a/genpybind/registry.py
+++ b/genpybind/registry.py
@@ -1,6 +1,6 @@
from __future__ import unicode_literals
-import collections
+from collections.abc import Mapping
import re
from clang import cindex
@@ -16,7 +16,7 @@ if False: # pylint: disable=using-constant-test
RE_NON_IDENTIFIER = re.compile(r"[^a-zA-Z0-9_]+")
-class Registry(collections.Mapping):
+class Registry(Mapping):
def __init__(self, tags=None):
# type: (Optional[Iterable[Text]]) -> None
self._declarations = {} # type: Dict[Text, Optional[Declaration]]
# Copyright 2013-2024 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.package import *
class Glfw(CMakePackage):
"""GLFW is an Open Source, multi-platform library for
OpenGL, OpenGL ES and Vulkan development on the desktop. It
provides a simple API for creating windows, contexts and
surfaces, receiving input and events."""
homepage = "https://www.glfw.org/"
url = "https://github.com/glfw/glfw/archive/3.3.2.tar.gz"
license("Zlib")
# begin EBRAINS (added): new version
version("3.4", sha256="c038d34200234d071fae9345bc455e4a8f2f544ab60150765d7704e08f3dac01")
# end EBRAINS
version("3.3.8", sha256="f30f42e05f11e5fc62483e513b0488d5bceeab7d9c5da0ffe2252ad81816c713")
version("3.3.2", sha256="98768e12e615fbe9f3386f5bbfeb91b5a3b45a8c4c77159cef06b1f6ff749537")
version("3.3.1", sha256="6bca16e69361798817a4b62a5239a77253c29577fcd5d52ae8b85096e514177f")
version("3.3", sha256="81bf5fde487676a8af55cb317830703086bb534c53968d71936e7b48ee5a0f3e")
version("3.2.1", sha256="e10f0de1384d75e6fc210c53e91843f6110d6c4f3afbfb588130713c2f9d8fe8")
version("3.2", sha256="cb3aab46757981a39ae108e5207a1ecc4378e68949433a2b040ce2e17d8f6aa6")
version("3.1.2", sha256="6ac642087682aaf7f8397761a41a99042b2c656498217a1c63ba9706d1eef122")
version("3.1.1", sha256="4de311ec9bf43bfdc8423ddf93b91dc54dc73dcfbedfb0991b6fbb3a9baf245f")
version("3.1", sha256="2140f4c532e7ce4c84cb7e4c419d0979d5954fa1ce204b7646491bd2cc5bf308")
version("3.0.4", sha256="a4e7c57db2086803de4fc853bd472ff8b6d2639b9aa16e6ac6b19ffb53958caf")
version("3.0.3", sha256="7a182047ba6b1fdcda778b79aac249bb2328b6d141188cb5df29560715d01693")
depends_on("c", type="build") # generated
variant("doc", default=False, description="Build documentation")
variant("shared", default=False, description="Builds a shared version of the library")
# dependencies
depends_on("doxygen", type="build", when="+doc")
# linux only dependencies
depends_on("libxrandr", when="platform=linux")
depends_on("libxinerama", when="platform=linux")
depends_on("libxcursor", when="platform=linux")
depends_on("libxdamage", when="platform=linux")
depends_on("libxft", when="platform=linux")
depends_on("libxi", when="platform=linux")
depends_on("libxmu", when="platform=linux")
depends_on("freetype", when="platform=linux")
depends_on("fontconfig", when="platform=linux")
depends_on("pkgconfig", type="build", when="platform=linux")
# begin EBRAINS (added): missing dependency
depends_on("wayland", when="platform=linux")
depends_on("libxkbcommon", when="platform=linux")
# end EBRAINS
def cmake_args(self):
return [self.define_from_variant("BUILD_SHARED_LIBS", "shared")]
diff --git a/src/hxtorch/spiking/types.cpp b/src/hxtorch/spiking/types.cpp
index aaf670f..39322c8 100644
--- a/hxtorch/src/hxtorch/spiking/types.cpp
+++ b/hxtorch/src/hxtorch/spiking/types.cpp
@@ -2,7 +2,12 @@
#include "grenade/vx/common/time.h"
#include "hxtorch/spiking/detail/to_dense.h"
#include <ATen/Functions.h>
+#if __has_include(<ATen/native/SparseTensorUtils.h>)
+// moved in py-torch@2.1
+#include <ATen/native/SparseTensorUtils.h>
+#else
#include <ATen/SparseTensorUtils.h>
+#endif
#include <log4cxx/logger.h>
namespace hxtorch::spiking {
# Copyright 2013-2022 Lawrence Livermore National Security, LLC and other
# Copyright 2013-2024 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 *
import os
import unittest.mock
import xml.etree.ElementTree as ET
from spack.package import *
from spack.util.environment import EnvironmentModifications
import spack.build_environment
import importlib
build_brainscales = importlib.import_module("spack.pkg.ebrains-spack-builds.build_brainscales")
class Hxtorch(WafPackage):
class Hxtorch(build_brainscales.BuildBrainscales):
"""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
# This repo provides a custom waf binary used for the build below
git = "https://github.com/electronicvisions/pynn-brainscales.git"
version('3.0-a1', branch='waf')
# PPU compiler dependencies
depends_on('oppulance@2.0:')
maintainers = ["emuller", "muffgaga"]
# newer versions are defined in the common base package
version('8.0-a5', tag='hxtorch-8.0-a5')
version('8.0-a4', tag='hxtorch-8.0-a4')
version('8.0-a3', tag='hxtorch-8.0-a3')
version('8.0-a2', tag='hxtorch-8.0-a2')
version('8.0-a1', tag='hxtorch-8.0-a1')
version('7.0-rc1-fixup3', tag='hxtorch-7.0-rc1-fixup3')
version('7.0-rc1-fixup2', tag='hxtorch-7.0-rc1-fixup2')
version('7.0-rc1-fixup1', branch='waf')
deps_hxtorch_core = [
# compiler for the BrainScaleS-2 embedded processor ("PPU"); needed for
# building/linking, at runtime and for testing
# (BTW. modern oppulance dependency via BuildBrainscales)
('oppulance@8.0-a5', { "when":'@8.0-a5', "type": ('build', 'link', 'run', 'test') } ),
('oppulance@8.0-a4', { "when":'@8.0-a4', "type": ('build', 'link', 'run', 'test') } ),
('oppulance@8.0-a3', { "when":'@8.0-a3', "type": ('build', 'link', 'run', 'test') } ),
('oppulance@8.0-a2', { "when":'@8.0-a2', "type": ('build', 'link', 'run', 'test') } ),
('oppulance@8.0-a1', { "when":'@8.0-a1', "type": ('build', 'link', 'run', 'test') } ),
('oppulance@7.0-rc1-fixup3', { "when":'@7.0-rc1-fixup3', "type": ('build', 'link', 'run', 'test') } ),
('oppulance@7.0-rc1-fixup2', { "when":'@7.0-rc1-fixup2', "type": ('build', 'link', 'run', 'test') } ),
('oppulance@7.0-rc1-fixup1', { "when":'@7.0-rc1-fixup1', "type": ('build', 'link', 'run', 'test') } ),
# host software dependencies
('bitsery', { "type": ('build', 'link', 'run', 'test') } ),
('binutils+gold+ld+plugins', { "type": ('build', 'link', 'run') } ), # specialize
('boost@1.69.0: +graph+icu+mpi+numpy+coroutine+context+filesystem+python+serialization+system+thread+program_options cxxstd=17', { "type": ('build', 'link', 'run', 'test') } ),
('cereal', { "type": ('build', 'link', 'run', 'test') } ),
('cppcheck', { "type": ('build', 'link', 'run') } ),
('genpybind@ebrains-llvm15', { "type": ('build', 'link') } ),
('gflags', { "type": ('build', 'link', 'run') } ),
('googletest@1.11.0:+gmock', { "type": ('build', 'link', 'run') } ), # variadic templates needed
('inja', { "type": ('build', 'link', 'run', 'test') } ),# template engine for PPU source jit generation
('intel-tbb', { "type": ('build', 'link', 'run') } ), # ppu gdbserver
('libelf', { "type": ('build', 'link', 'run') } ),
('liblockfile', { "type": ('build', 'link', 'run') } ),
('log4cxx@0.12.1:1.0', { "when": "@:8.0-a3", "type": ('build', 'link', 'run') } ),
('log4cxx@1.1: +events_at_exit', { "when": "@8.0-a4:", "type": ('build', 'link', 'run') } ),
('pkgconfig', { "type": ('build', 'link', 'run') } ),
('psmisc', { "type": ('run', 'test') } ),
('python@3.7.0:', { "type": ('build', 'link', 'run') } ), # BrainScaleS-2 only supports Python >= 3.7
('py-h5py', { "type": ('build', 'link', 'run') } ), # PyNN tests need it
('py-matplotlib', { "type": ('build', 'link', 'run') } ),
('py-networkx', { "type": ('build', 'link', 'run') } ),
('py-nose', { "type": ('build', 'link', 'run') } ),
('py-numpy', { "type": ('build', 'link', 'run') } ),
('py-pybind11', { "type": ('build', 'link', 'run') } ),
('py-pybind11-stubgen', { "type": ('build', 'link', 'run') } ),
('py-pycodestyle', { "type": ('build', 'link', 'run') } ),
('py-pyelftools', { "type": ('build', 'link', 'run') } ),
('py-pylint', { "type": ('build', 'link', 'run') } ),
('py-pytest', { "type": ('build', 'link', 'run') } ),
('py-torch@1.9.1:', { "type": ('build', 'link', 'run', 'test') } ),
('py-torchvision', { "type": ('run') } ), # for demos
('py-pyyaml', { "type": ('build', 'link', 'run') } ),
('py-quantities@0.12.1:', { "type": ('build', 'link', 'run') } ), # PyNN-like interfacing of things?
('py-scipy', { "type": ('build', 'link', 'run') } ),
('py-sqlalchemy', { "type": ('build', 'link', 'run') } ),
('util-linux', { "type": ('build', 'link', 'run') } ),
('yaml-cpp+shared', { "type": ('build', 'link', 'run') } ),
]
for dep, dep_kw in deps_hxtorch_core:
depends_on(dep, **dep_kw)
# 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:
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:
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:
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 (', 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))
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', '--build-profile=release', *args)
# some versions of dependencies are broken
conflicts("boost@1.86.0") # sha1 digest changed length, but boost::compute didn't adapt
def build_args(self):
args = ['--keep', '--test-execnone', '-v']
patch("include-SparseTensorUtils.patch", when="@:8.0-a5")
return args
def install_test(self):
with working_dir('spack-test', create=True):
old_pythonpath = os.environ.get('PYTHONPATH', '')
os.environ['PYTHONPATH'] = ':'.join([str(self.prefix.lib), old_pythonpath])
bash = which("bash")
# ignore segfaults for now (exit code 139)
bash('-c', '(python -c "import hxtorch; print(hxtorch.__file__)" || ( test $? -eq 139 && echo "segfault")) || exit $?')
# Copyright 2013-2024 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.package import *
class Inja(CMakePackage):
"""Inja is a template engine for modern C++, loosely inspired by jinja for
python."""
homepage = "https://github.com/pantor/inja"
url = "https://github.com/pantor/inja/archive/refs/tags/v3.3.0.tar.gz"
version('3.3.0', sha256='e628d994762dcdaa9a97f63a9b8b73d9af51af0ffa5acea6bdbba0aceaf8ee25')
depends_on('nlohmann-json@3.8.0:')
def cmake_args(self):
args = [
'-DINJA_USE_EMBEDDED_JSON:BOOL=OFF',
'-DINJA_BUILD_TESTS:BOOL=OFF',
'-DBUILD_BENCHMARK:BOOL=OFF',
'-DCOVERALLS:BOOL=OFF',
]
return args
diff --git a/src/hxtorch/spiking/types.cpp b/src/hxtorch/spiking/types.cpp
index aaf670f..39322c8 100644
--- a/hxtorch/src/hxtorch/spiking/types.cpp
+++ b/hxtorch/src/hxtorch/spiking/types.cpp
@@ -2,7 +2,12 @@
#include "grenade/vx/common/time.h"
#include "hxtorch/spiking/detail/to_dense.h"
#include <ATen/Functions.h>
+#if __has_include(<ATen/native/SparseTensorUtils.h>)
+// moved in py-torch@2.1
+#include <ATen/native/SparseTensorUtils.h>
+#else
#include <ATen/SparseTensorUtils.h>
+#endif
#include <log4cxx/logger.h>
namespace hxtorch::spiking {
# Copyright 2013-2024 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)
import os
import unittest.mock
import xml.etree.ElementTree as ET
from spack.package import *
from spack.util.environment import EnvironmentModifications
import spack.build_environment
import importlib
build_brainscales = importlib.import_module("spack.pkg.ebrains-spack-builds.build_brainscales")
hxtorch = importlib.import_module("spack.pkg.ebrains-spack-builds.hxtorch")
class Jaxsnn(build_brainscales.BuildBrainscales):
"""jaxsnn is an event-based approach to machine-learning-inspired training
and simulation of SNNs, including support for the BrainScaleS-2
neuromorphic backend."""
homepage = "https://github.com/electronicvisions/jaxsnn"
# This repo provides a custom waf binary used for the build below
git = "https://github.com/electronicvisions/pynn-brainscales.git"
maintainers = ["emuller", "muffgaga"]
# newer versions are defined in the common base package
version('8.0-a5', tag='jaxsnn-8.0-a5')
version('8.0-a4', tag='jaxsnn-8.0-a4')
version('8.0-a3', tag='jaxsnn-8.0-a3')
version('8.0-a2', tag='jaxsnn-8.0-a2')
version('8.0-a1', tag='jaxsnn-8.0-a1')
# dependencies inherited from hxtorch.core
for dep, dep_kw in hxtorch.Hxtorch.deps_hxtorch_core:
depends_on(dep, **dep_kw)
# main dependencies w/o hxtorch.core dependencies (those come via hxtorch above)
depends_on('py-jax@0.4.13:', type=('build', 'link', 'run'))
depends_on('py-matplotlib', type=('build', 'link', 'run'))
depends_on('py-optax', type=('build', 'link', 'run'))
depends_on('py-tree-math', type=('build', 'link', 'run'))
extends('python')
patch("include-SparseTensorUtils.patch", when="@:8.0-a5")
def install_test(self):
with working_dir('spack-test', create=True):
old_pythonpath = os.environ.get('PYTHONPATH', '')
os.environ['PYTHONPATH'] = ':'.join([str(self.prefix.lib), old_pythonpath])
bash = which("bash")
# ignore segfaults for now (exit code 139)
bash('-c', '(python -c "import jaxsnn; print(jaxsnn.__file__)" || ( test $? -eq 139 && echo "segfault")) || exit $?')
# Copyright 2013-2024 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.package import *
class Libvips(AutotoolsPackage):
"""libvips is a demand-driven, horizontally threaded image processing
library. Compared to similar libraries, libvips runs quickly and uses
little memory."""
homepage = "https://libvips.github.io/libvips/"
url = "https://github.com/libvips/libvips/releases/download/v8.15.3/vips-8.15.3.tar.xz"
git = "https://github.com/libvips/libvips.git"
license("LGPL-2.1-or-later", checked_by="wdconinc")
version("8.15.3", sha256="3e27d9f536eafad64013958fe9e8a1964c90b564c731d49db7c1a1c11b1052a0")
version("8.13.3", sha256="4eff5cdc8dbe1a05a926290a99014e20ba386f5dcca38d9774bef61413435d4c")
version("8.10.5", sha256="a4eef2f5334ab6dbf133cd3c6d6394d5bdb3e76d5ea4d578b02e1bc3d9e1cfd8")
version("8.9.1", sha256="45633798877839005016c9d3494e98dee065f5cb9e20f4552d3b315b8e8bce91")
version("8.9.0", sha256="97334a5e70aff343d2587f23cb8068fc846a58cd937c89a446142ccf00ea0349")
build_system(
conditional("autotools", when="@:8.13"),
conditional("meson", when="@8.13:"),
default="meson",
)
depends_on("c", type="build") # generated
depends_on("cxx", type="build") # generated
variant("fftw", default=True, description="Uses FFTW3 for fourier transforms.")
variant("jpeg", default=False, description="Enable JPEG support")
variant("tiff", default=False, description="Enable TIFF support")
variant("png", default=False, description="Enable pngfile support")
variant("poppler", default=False, description="Enable PDF rendering via poppler")
# TODO: Add more variants!
depends_on("pkgconfig", type="build")
depends_on("glib")
depends_on("expat")
depends_on("fftw", when="+fftw")
depends_on("libjpeg", when="+jpeg")
depends_on("libtiff", when="+tiff")
depends_on("libpng", when="+png")
depends_on("poppler +glib", when="+poppler")
# begin EBRAINS (added): to fix build errors
depends_on("gobject-introspection")
depends_on("cfitsio")
depends_on("pango")
depends_on("libtiff")
# end EBRAINS
def url_for_version(self, version):
ext = "xz" if version >= Version("8.14") else "gz"
return f"https://github.com/libvips/libvips/releases/download/v{version}/vips-{version}.tar.{ext}"
# Copyright 2013-2024 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.package import *
class Libxcb(AutotoolsPackage, XorgPackage):
"""The X protocol C-language Binding (XCB) is a replacement
for Xlib featuring a small footprint, latency hiding, direct
access to the protocol, improved threading support, and
extensibility."""
homepage = "https://xcb.freedesktop.org/"
xorg_mirror_path = "lib/libxcb-1.14.tar.xz"
license("MIT")
maintainers("wdconinc")
version("1.17.0", sha256="599ebf9996710fea71622e6e184f3a8ad5b43d0e5fa8c4e407123c88a59a6d55")
version("1.16.1", sha256="f24d187154c8e027b358fc7cb6588e35e33e6a92f11c668fe77396a7ae66e311")
version("1.16", sha256="4348566aa0fbf196db5e0a576321c65966189210cb51328ea2bb2be39c711d71")
version("1.15", sha256="cc38744f817cf6814c847e2df37fcb8997357d72fa4bcbc228ae0fe47219a059")
version("1.14", sha256="a55ed6db98d43469801262d81dc2572ed124edc3db31059d4e9916eb9f844c34")
version(
"1.13",
sha256="0bb3cfd46dbd90066bf4d7de3cad73ec1024c7325a4a0cbf5f4a0d4fa91155fb",
url="https://xcb.freedesktop.org/dist/libxcb-1.13.tar.gz",
deprecated=True,
)
depends_on("c", type="build") # generated
depends_on("libpthread-stubs")
depends_on("libxau@0.99.2:")
depends_on("libxdmcp")
# libxcb 1.X requires xcb-proto >= 1.X
depends_on("xcb-proto", type="build")
depends_on("xcb-proto@1.17:", when="@1.17", type="build")
depends_on("xcb-proto@1.16:", when="@1.16", type="build")
depends_on("xcb-proto@1.15:", when="@1.15", type="build")
depends_on("xcb-proto@1.14:", when="@1.14", type="build")
depends_on("xcb-proto@1.13:", when="@1.13", type="build")
# begin EBRAINS (deleted): break cyclic dependency in python+tkinter
# depends_on("python", type="build")
# end EBRAINS
depends_on("pkgconfig", type="build")
depends_on("util-macros", type="build")
def configure_args(self):
config_args = []
# -Werror flags are not properly interpreted by the NVIDIA compiler
if self.spec.satisfies("%nvhpc@:20.11"):
config_args.append("--disable-selective-werror")
return config_args
def patch(self):
filter_file("typedef struct xcb_auth_info_t {", "typedef struct {", "src/xcb.h")
# libxcb fails to build with non-UTF-8 locales, see:
# https://www.linuxfromscratch.org/blfs/view/git/x/libxcb.html
# https://gitlab.freedesktop.org/xorg/lib/libxcb/-/merge_requests/53 (merged in 1.17.0)
# https://gitlab.freedesktop.org/xorg/lib/libxcb/-/merge_requests/60
# If a newer release can be verified to build with LC_ALL=en_US.ISO-8859-1,
# then we can limit the following function, e.g.
# when("@:1.17")
def setup_build_environment(self, env):
env.set("LC_ALL", "C.UTF-8")
# begin EBRAINS (deleted): break cyclic dependency in python+tkinter
# depends_on("python", type="build")
# end EBRAINS