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
  • hl11/ebrains-spack-builds
  • woodman/ebrains-spack-builds
  • filippomarchetti/ebrains-spack-builds
  • dsegebarth/ebrains-spack-builds-na-3
  • ziaee/ebrains-spack-builds
  • jkaiser/ebrains-spack-builds
  • mloshakov/ebrains-spack-builds
  • dsegebarth/ebrains-spack-builds
  • kozlov/ebrains-spack-builds
  • ansimsek/ebrains-spack-builds
  • lupoc/ebrains-spack-builds
  • rominabaila/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
18 results
Show changes
Showing
with 1152 additions and 0 deletions
diff --git a/third_party/ijar/zlib_client.h b/third_party/ijar/zlib_client.h
index c4b051e0100c..0a917ff0a99a 100644
--- a/third_party/ijar/zlib_client.h
+++ b/third_party/ijar/zlib_client.h
@@ -16,7 +16,9 @@
#define THIRD_PARTY_IJAR_ZLIB_CLIENT_H_
#include <limits.h>
+
#include <limits>
+#include <stdexcept>
#include "third_party/ijar/common.h"
diff --git a/third_party/ijar/mapped_file_unix.cc b/third_party/ijar/mapped_file_unix.cc
index 6e3a90871844..65179e3290ec 100644
--- a/third_party/ijar/mapped_file_unix.cc
+++ b/third_party/ijar/mapped_file_unix.cc
@@ -15,10 +15,11 @@
#include <errno.h>
#include <fcntl.h>
#include <stdio.h>
-#include <unistd.h>
#include <sys/mman.h>
+#include <unistd.h>
#include <algorithm>
+#include <limits>
#include "third_party/ijar/mapped_file.h"
--- a/third_party/grpc/grpc_1.33.1.patch
+++ b/third_party/grpc/grpc_1.33.1.patch
@@ -58,6 +58,14 @@ index 09fcad95a2..9b737e5deb 100644
)
native.bind(
+@@ -245,6 +245,7 @@ def grpc_deps():
+ "https://storage.googleapis.com/grpc-bazel-mirror/github.com/abseil/abseil-cpp/archive/df3ea785d8c30a9503321a3d35ee7d35808f190d.tar.gz",
+ "https://github.com/abseil/abseil-cpp/archive/df3ea785d8c30a9503321a3d35ee7d35808f190d.tar.gz",
+ ],
++ patches = ["@com_github_grpc_grpc//:third_party/abseil-cpp/absl.patch"],
+ )
+
+ if "bazel_toolchains" not in native.existing_rules():
diff --git a/bazel/grpc_extra_deps.bzl b/bazel/grpc_extra_deps.bzl
index 4c1dfad2e8..f63c54ddef 100644
--- a/bazel/grpc_extra_deps.bzl
@@ -120,3 +128,25 @@ index c047f0c515..7c24fbc617 100644
":windows": "@com_github_grpc_grpc//third_party/cares:config_windows/ares_config.h",
":android": "@com_github_grpc_grpc//third_party/cares:config_android/ares_config.h",
"//conditions:default": "@com_github_grpc_grpc//third_party/cares:config_linux/ares_config.h",
+
+--- /dev/null
++++ b/third_party/abseil-cpp/absl.patch
+@@ -0,0 +1,18 @@
++0e2c62da1dcaf6529abab952bdcc96c6de2d9506 by Abseil Team <absl-team@google.com>:
++
++Add missing <limits> include
++
++PiperOrigin-RevId: 339054753
++
++--
++
++--- absl/synchronization/internal/graphcycles.cc
+++++ absl/synchronization/internal/graphcycles.cc
++@@ -37,6 +37,7 @@
++
++ #include <algorithm>
++ #include <array>
+++#include <limits>
++ #include "absl/base/internal/hide_ptr.h"
++ #include "absl/base/internal/raw_logging.h"
++ #include "absl/base/internal/spinlock.h"
# 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 re
from spack.package import *
class Bazel(Package):
"""Bazel is an open-source build and test tool similar to Make, Maven, and
Gradle. It uses a human-readable, high-level build language. Bazel supports
projects in multiple languages and builds outputs for multiple platforms.
Bazel supports large codebases across multiple repositories, and large
numbers of users."""
homepage = "https://bazel.build/"
url = "https://github.com/bazelbuild/bazel/releases/download/3.1.0/bazel-3.1.0-dist.zip"
maintainers("LydDeb")
tags = ["build-tools"]
license("Apache-2.0")
version("7.0.2", sha256="dea2b90575d43ef3e41c402f64c2481844ecbf0b40f8548b75a204a4d504e035")
version("7.0.1", sha256="596b13e071d27c43343ec8f5d263cb5312fafe7ef8702401f7ed492f182f4e6c")
version("7.0.0", sha256="477e54f6374001f439a9471ba1de9d7824daf129db95510849ecc5e19ce88170")
version("6.5.0", sha256="fc89da919415289f29e4ff18a5e01270ece9a6fe83cb60967218bac4a3bb3ed2")
version("6.4.0", sha256="bd88ff602c8bbb29ee82ba2a6b12ad092d51ec668c6577f9628f18e48ff4e51e")
version("6.3.2", sha256="8cd7feac58193be2bcba451ba6688a46824d37ca6359ff58e0d44eb98f042948")
version("6.3.1", sha256="2676319e86c5aeab142dccd42434364a33aa330a091c13562b7de87a10e68775")
version("6.3.0", sha256="902198981b1d26112fc05913e79f1b3e9772c3f95594caf85619d041ba06ede0")
version("6.2.1", sha256="4cf4d264bff388ee0012735728630d23832d3c9d021383b2fadceadb0775dd6b")
version("6.2.0", sha256="f1e8f788637ac574d471d619d2096baaca04a19b57a034399e079633db441945")
version("6.1.2", sha256="6fb3ee22fe9fa86d82e173572d504c089f10825d749725592626e090b38c9679")
version("6.1.1", sha256="6b900f26d676c7eca1d2e7dff9b71890dabd3ff59cab2a2d2178bc8a0395342a")
version("6.1.0", sha256="c4b85675541cf66ee7cb71514097fdd6c5fc0e02527243617a4f20ca6b4f2932")
version("6.0.0", sha256="7bc0c5145c19a56d82a08fce6908c5e1a0e75e4fbfb3b6f12b4deae7f4b38cbc")
version("5.4.0", sha256="a1c62d9bcb4e03106ddf0b7bd96196ba246e1c9b7a935daf8d9beda8bbdcb8a1")
version("5.3.2", sha256="3880ad919592d1e3e40c506f13b32cd0a2e26f129d87cb6ba170f1801d7d7b82")
version("5.3.1", sha256="18486e7152ca26b26585e9b2a6f49f332b116310d3b7e5b70583f1f1f24bb8ae")
version("5.3.0", sha256="ee801491ff0ec3a562422322a033c9afe8809b64199e4a94c7433d4e14e6b921")
version("5.2.0", sha256="820a94dbb14071ed6d8c266cf0c080ecb265a5eea65307579489c4662c2d582a")
version("5.1.1", sha256="7f5d3bc1d344692b2400f3765fd4b5c0b636eb4e7a8a7b17923095c7b56a4f78")
version("5.1.0", sha256="4de301f509fc6d0cbc697b2017384ecdc94df8f36245bbcbedc7ea6780acc9f5")
version("5.0.0", sha256="072dd62d237dbc11e0bac02e118d8c2db4d0ba3ba09f1a0eb1e2a460fb8419db")
version("4.2.4", sha256="d5ba2ef28da5275f22e832aaa7f9319c61ea5db9b6a3e23b28a6a64ad03078f3")
version("4.2.3", sha256="b0e84d0538f3ec2b95a49bae31a5066f0967281a3ca99965016fbe178acd2d3d")
version("4.2.2", sha256="9981d0d53a356c4e87962847750a97c9e8054e460854748006c80f0d7e2b2d33")
version("4.2.1", sha256="12ea7aa11e2bdb12de1dceb9939a22e96f5a480437cb17c123379d8e0fdf5e82")
version("4.2.0", sha256="74814b63920aaee47dbbbee7082e5c4317e4eebaf07e03c5fb5626e1716f1034")
version("4.1.0", sha256="f377d755c96a50f6bd2f423562598d822f43356783330a0b780ad442864d6eeb")
version("4.0.0", sha256="d350f80e70654932db252db380d2ec0144a00e86f8d9f2b4c799ffdb48e9cdd1")
version("3.7.2", sha256="de255bb42163a915312df9f4b86e5b874b46d9e8d4b72604b5123c3a845ed9b1")
version("3.7.1", sha256="c9244e5905df6b0190113e26082c72d58b56b1b0dec66d076f083ce4089b0307")
version("3.7.0", sha256="63873623917c756d1be49ff4d5fc23049736180e6b9a7d5236c6f204eddae3cc")
version("3.6.0", sha256="3a18f24febb5203f11b0985b27e120ac623058d1d5ca79cd6df992e67d57240a")
version("3.5.1", sha256="67eae714578b22d24192b0eb3a2d35b07578bbd57a33c50f1e74f8acd6378b3c")
version("3.5.0", sha256="334429059cf82e222ca8a9d9dbbd26f8e1eb308613463c2b8655dd4201b127ec")
version("3.4.1", sha256="27af1f11c8f23436915925b25cf6e1fb07fccf2d2a193a307c93437c60f63ba8")
version("3.4.0", sha256="7583abf8905ba9dd5394294e815e8873635ac4e5067e63392e8a33b397e450d8")
version("3.3.1", sha256="e0f1f43c65c4e0a38522b37e81f6129d8a1f7cd3d8884847be306544a7492747")
version("3.3.0", sha256="05a03960de09d5775839c5766ad8a0a30f261feaba5fa53ce3e49168d1eee826")
version("3.2.0", sha256="44ec129436f6de45f2230e14100104919443a1364c2491f5601666b358738bfa")
version("3.1.0", sha256="d7f40d0cac95a06cea6cb5b7f7769085257caebc3ee84269dd9298da760d5615")
version("3.0.0", sha256="530f5132e0a50da7ebb0ed08d9b6f1ddfd0d7d9b5d0beb2df5d687a4c8daf6b3")
version("2.2.0", sha256="9379878a834d105a47a87d3d7b981852dd9f64bc16620eacd564b48533e169a7")
version("2.1.1", sha256="83f67f28f4e47ff69043307d1791c9bffe83949e84165d49058b84eded932647")
version("2.1.0", sha256="3371cd9050989173a3b27364668328653a65653a50a85c320adc53953b4d5f46")
version("2.0.1", sha256="a863ed9e6fc420fbd92e63a12fe1a5b9be1a7a36f11f61f1fdc582c813bbe543")
version("2.0.0", sha256="724da3c656f68e787a86ebb9844773aa1c2e3a873cc39462a8f1b336153d6cbb")
variant(
"nodepfail",
default=True,
description="Disable failing dependency checks due to injected absolute paths - "
"required for most builds using bazel with spack",
)
# begin EBRAINS (added): to provide ld via GCC_HOST_COMPILER_PREFIX
depends_on("binutils", type=("build"))
# end EBRAINS
# https://bazel.build/install/compile-source#bootstrap-unix-prereq
depends_on("java@11", when="@5.3:", type=("build", "run"))
depends_on("java@8,11", when="@3.3:5.2", type=("build", "run"))
depends_on("java@8", when="@0.6:3.2", type=("build", "run"))
depends_on("python+pythoncmd", type=("build", "run"))
depends_on("zip", when="platform=linux", type=("build", "run"))
# Pass Spack environment variables to the build
patch("bazelruleclassprovider-0.25.patch")
# Inject include paths
patch("unix_cc_configure-3.0.patch", when="@3:")
patch("unix_cc_configure-0.15.patch", when="@:2")
# Set CC and CXX
# begin EBRAINS (modified): bring upstream after checking since when this is breaking the build
patch("compile-0.29.patch", when="@:5.3")
# end EBRAINS
# Disable dependency search
patch("cppcompileaction-7.0.0.patch", when="@7: +nodepfail")
patch("cppcompileaction-0.3.2.patch", when="@:6 +nodepfail")
# https://github.com/bazelbuild/bazel/issues/17956
patch("apple-clang-14.0.3.patch", when="@:4.2.3,5:6.1.1")
# https://github.com/bazelbuild/bazel/issues/17958
patch(
"https://github.com/bazelbuild/bazel/commit/43dadb275b3f9690242bf2d94a0757c721d231a9.patch?full_index=1",
sha256="af73a49006baa05475b1b79dad83e1e014ebfe22f38aa55774f9a465404aed54",
when="@5.0:5.4.0,6.0",
)
# Fix build with Fujitsu compiler
patch("blaze_util_posix-0.29.1.patch", when="%fj")
patch("unix_cc_configure_fj-5.2.patch", when="@5.2:%fj")
patch("unix_cc_configure_fj-5.0.patch", when="@5.0:5.1%fj")
patch("unix_cc_configure_fj-0.29.1.patch", when="@:4%fj")
patch("bazelruleclassprovider_fj-0.25.patch", when="%fj")
# https://blog.bazel.build/2021/05/21/bazel-4-1.html
conflicts("platform=darwin target=aarch64:", when="@:4.0")
# https://github.com/bazelbuild/bazel/issues/18642
patch(
"https://github.com/bazelbuild/bazel/pull/20785.patch?full_index=1",
sha256="85dde31d129bbd31e004c5c87f23cdda9295fbb22946dc6d362f23d83bae1fd8",
when="@6.0:6.4",
)
conflicts("%gcc@13:", when="@:5")
# Patches for compiling various older bazels which had ICWYU violations revealed by
# (but not unique to) GCC 11 header changes. These are derived from
# https://gitlab.alpinelinux.org/alpine/aports/-/merge_requests/29084/
patch("gcc11_1.patch", when="@:4")
patch("gcc11_2.patch", when="@:4")
patch("gcc11_3.patch", when="@:4")
patch("gcc11_4.patch", when="@4.1:4")
# Bazel-4.0.0 does not compile with gcc-11
# Newer versions of grpc and abseil dependencies are needed but are not in bazel-4.0.0
conflicts("@4.0.0", when="%gcc@11:")
# https://github.com/bazelbuild/bazel/pull/23667
conflicts("%apple-clang@16:", when="@:7.3")
executables = ["^bazel$"]
# Download resources to perform offline build with bazel.
# The following URLs and sha256 are in the file distdir_deps.bzl at the root of bazel sources.
resource_dictionary = {}
resource_dictionary["bazel_skylib"] = {
"url": "https://github.com/bazelbuild/bazel-skylib/releases/download/1.0.1/bazel-skylib-1.0.1.tar.gz",
"sha256": "f1c8360c01fcf276778d3519394805dc2a71a64274a3a0908bc9edff7b5aebc8",
"when": "@4:6",
}
resource_dictionary["com_google_absl"] = {
"url": "https://github.com/abseil/abseil-cpp/archive/refs/tags/20230802.0.tar.gz",
"sha256": "59d2976af9d6ecf001a81a35749a6e551a335b949d34918cfade07737b9d93c5",
"when": "@6.0:6.4",
}
resource_dictionary["zulu_11_56_19"] = {
"url": "https://mirror.bazel.build/cdn.azul.com/zulu/bin/zulu11.56.19-ca-jdk11.0.15-linux_x64.tar.gz",
"sha256": "e064b61d93304012351242bf0823c6a2e41d9e28add7ea7f05378b7243d34247",
"when": "@6",
}
resource_dictionary["zulu_11_50_19"] = {
"url": "https://mirror.bazel.build/openjdk/azul-zulu11.50.19-ca-jdk11.0.12/zulu11.50.19-ca-jdk11.0.12-linux_x64.tar.gz",
"sha256": "b8e8a63b79bc312aa90f3558edbea59e71495ef1a9c340e38900dd28a1c579f3",
"when": "@5",
}
resource_dictionary["zulu_11_37_17"] = {
"url": "https://mirror.bazel.build/openjdk/azul-zulu11.37.17-ca-jdk11.0.6/zulu11.37.17-ca-jdk11.0.6-linux_x64.tar.gz",
"sha256": "360626cc19063bc411bfed2914301b908a8f77a7919aaea007a977fa8fb3cde1",
"when": "@4",
}
for resource_name in resource_dictionary.keys():
resource(
when=resource_dictionary[resource_name]["when"],
name=resource_name,
url=resource_dictionary[resource_name]["url"],
sha256=resource_dictionary[resource_name]["sha256"],
destination="archive",
expand=False,
)
@classmethod
def determine_version(cls, exe):
output = Executable(exe)("version", output=str, error=str)
match = re.search(r"Build label: ([\d.]+)", output)
return match.group(1) if match else None
# begin EBRAINS (added)
def setup_dependent_build_environment(self, env, dependent_spec):
env.prepend_path("GCC_HOST_COMPILER_PREFIX", self.spec['binutils'].prefix.bin)
# end EBRAINS
def setup_build_environment(self, env):
# fix the broken linking (on power9)
# https://github.com/bazelbuild/bazel/issues/10327
env.set("BAZEL_LINKOPTS", "")
env.set("BAZEL_LINKLIBS", "-lstdc++")
# .WARNING: Option 'host_javabase' is deprecated
# Use local java installation
# begin EBRAINS (modified): expose CC and CXX (the spack compiler wrappers)
args = "--color=no --define=ABSOLUTE_JAVABASE={0} --verbose_failures --action_env=CC --action_env=CXX --jobs={1}".format(
self.spec["java"].prefix, make_jobs
)
# end EBRAINS
resource_stages = self.stage[1:]
for _resource in resource_stages:
try:
resource_name = _resource.resource.name
if self.spec.satisfies(self.resource_dictionary[resource_name]["when"]):
archive_path = _resource.source_path
args += " --distdir={0}".format(archive_path)
except AttributeError:
continue
env.set("EXTRA_BAZEL_ARGS", args)
@run_before("install")
def bootstrap(self):
bash = which("bash")
bash("./compile.sh")
def install(self, spec, prefix):
mkdir(prefix.bin)
install("output/bazel", prefix.bin)
@run_after("install")
@on_package_attributes(run_tests=True)
def install_test(self):
# https://github.com/Homebrew/homebrew-core/blob/master/Formula/bazel.rb
# Bazel does not work properly on NFS, switch to /tmp
with working_dir("/tmp/spack/bazel/spack-test", create=True):
touch("WORKSPACE")
with open("ProjectRunner.java", "w") as f:
f.write(
"""\
public class ProjectRunner {
public static void main(String args[]) {
System.out.println("Hi!");
}
}"""
)
with open("BUILD", "w") as f:
f.write(
"""\
java_binary(
name = "bazel-test",
srcs = glob(["*.java"]),
main_class = "ProjectRunner",
)"""
)
# Spack's logs don't handle colored output well
bazel = Executable(self.spec["bazel"].command.path)
bazel(
"--output_user_root=/tmp/spack/bazel/spack-test",
"build",
"--color=no",
f"--jobs={make_jobs}",
"//:bazel-test",
)
exe = Executable("bazel-bin/bazel-test")
assert exe(output=str) == "Hi!\n"
def setup_dependent_package(self, module, dependent_spec):
module.bazel = Executable(self.spec["bazel"].command.path)
@property
def parallel(self):
return not self.spec.satisfies("%fj")
--- a/tools/cpp/unix_cc_configure.bzl
+++ b/tools/cpp/unix_cc_configure.bzl
@@ -145,11 +145,18 @@ def get_escaped_cxx_inc_directories(repository_ctx, cc, lang_flag, additional_fl
else:
inc_dirs = result.stderr[index1 + 1:index2].strip()
- return [
+ default_inc_directories = [
_prepare_include_path(repository_ctx, _cxx_inc_convert(p))
for p in inc_dirs.split("\n")
]
+ env = repository_ctx.os.environ
+ if "SPACK_INCLUDE_DIRS" in env:
+ for path in env["SPACK_INCLUDE_DIRS"].split(":"):
+ default_inc_directories.append(path)
+
+ return default_inc_directories
+
def _is_compiler_option_supported(repository_ctx, cc, option):
"""Checks that `option` is supported by the C compiler. Doesn't %-escape the option."""
result = repository_ctx.execute([
diff --git a/tools/cpp/unix_cc_configure.bzl b/tools/cpp/unix_cc_configure.bzl
index 5feb10b76a..cde0b8f8f1 100644
--- a/tools/cpp/unix_cc_configure.bzl
+++ b/tools/cpp/unix_cc_configure.bzl
@@ -151,8 +151,14 @@ def get_escaped_cxx_inc_directories(repository_ctx, cc, lang_flag, additional_fl
).stdout.strip() + "/share"
inc_directories.append(_prepare_include_path(repository_ctx, resource_dir))
+ env = repository_ctx.os.environ
+ if "SPACK_INCLUDE_DIRS" in env:
+ for path in env["SPACK_INCLUDE_DIRS"].split(":"):
+ inc_directories.append(path)
+
return inc_directories
+
def _is_compiler_option_supported(repository_ctx, cc, option):
"""Checks that `option` is supported by the C compiler. Doesn't %-escape the option."""
result = repository_ctx.execute([
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-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
# 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
# oauth.get_token()
class ClbNbUtils(PythonPackage):
url = 'https://github.com/HumanBrainProject/clb-nb-utils/archive/refs/heads/master.zip'
maintainers = ['akarmas']
version('0.1.0','aa079ed0a8c4806db4657a6e7b534f4d')
depends_on('python@3.8:', type=('build','run'))
depends_on('py-setuptools', type=('build','run'))
depends_on('py-requests', type=('build','run'))
# 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 Genpybind(WafPackage):
"""Autogeneration of Python bindings from manually annotated C++ headers"""
homepage = "https://github.com/kljohann/genpybind"
url = "https://github.com/kljohann/genpybind/archive/v0.1.0.tar.gz"
git = "https://github.com/kljohann/genpybind.git"
version('0.2.1', sha256='e4d993f0c65cb5cf635cec7df899cbd91af1f0bd8a3626f33e9e0925f5383384')
version('0.2.0', sha256='9d1e9d026a9e355e282aca549a2af108bedcc5bc59ba0b76a6072f88e4c0be4c')
version('0.1.1-pre', commit="9d06a3ad4b6b917c8fcc07261a97b13a3079bcba")
version('0.1.0', sha256='f25cb2b3180103cb96c42fb8d37be8b1f06b7721f6aa08841d5ae16361896407')
version('master', branch='master')
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'))
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()
if self.spec.satisfies("@visions") or self.spec.satisfies("@ebrains"):
# currently only our HEAD supports the rename
# TODO: adapt once the change is upstream
args.append("--genpybind-disable-tests")
else:
args.append("--disable-tests")
return 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-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")
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 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='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)
extends('python')
# some versions of dependencies are broken
conflicts("boost@1.86.0") # sha1 digest changed length, but boost::compute didn't adapt
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 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}"