diff --git a/.github/workflows/benchmarks.yml b/.github/workflows/benchmarks.yml index 7a65fee33..9bc06c77b 100644 --- a/.github/workflows/benchmarks.yml +++ b/.github/workflows/benchmarks.yml @@ -22,7 +22,7 @@ jobs: - name: Set up cmake uses: jwlawson/actions-setup-cmake@v2.2 with: - cmake-version: 3.25.x + cmake-version: 4.x - name: Clone w/ submodules uses: actions/checkout@v6 with: diff --git a/.github/workflows/build-pip-wheels.yml b/.github/workflows/build-pip-wheels.yml index d92b0470e..3f6f8041d 100644 --- a/.github/workflows/build-pip-wheels.yml +++ b/.github/workflows/build-pip-wheels.yml @@ -67,7 +67,7 @@ jobs: - name: Update pip and setup venv run: python -m pip install --upgrade pip && python -m venv ~/env && . ~/env/bin/activate && echo PATH=$PATH >> $GITHUB_ENV - name: Get packages - run: python3 -m pip install build + run: python3 -m pip install build mpi4py - name: Get Arbor uses: actions/checkout@v6 with: diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml index 15e106478..2de357d4c 100644 --- a/.github/workflows/codeql.yml +++ b/.github/workflows/codeql.yml @@ -52,7 +52,7 @@ jobs: # Initializes the CodeQL tools for scanning. - name: Initialize CodeQL - uses: github/codeql-action/init@v3 + uses: github/codeql-action/init@v4 with: languages: ${{ matrix.language }} # If you wish to specify custom queries, you can do so here or in a config file. @@ -61,7 +61,10 @@ jobs: # For more details on CodeQL's query packs, refer to: https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs # queries: security-extended,security-and-quality - + - name: Set up cmake + uses: jwlawson/actions-setup-cmake@v2.2 + with: + cmake-version: 4.x - name: Build arbor run: | mkdir build @@ -81,6 +84,6 @@ jobs: # ./location_of_script_within_repo/buildscript.sh - name: Perform CodeQL Analysis - uses: github/codeql-action/analyze@v3 + uses: github/codeql-action/analyze@v4 with: category: "/language:${{matrix.language}}" diff --git a/.github/workflows/sanitize.yml b/.github/workflows/sanitize.yml index 57e6f438d..a0d9f96e3 100644 --- a/.github/workflows/sanitize.yml +++ b/.github/workflows/sanitize.yml @@ -38,7 +38,7 @@ jobs: - name: Set up cmake uses: jwlawson/actions-setup-cmake@v2.2 with: - cmake-version: 3.25.x + cmake-version: 4.x - name: Clone w/ submodules uses: actions/checkout@v6 with: diff --git a/.github/workflows/test-matrix.yml b/.github/workflows/test-matrix.yml index c0199fa9e..21b93c3c4 100644 --- a/.github/workflows/test-matrix.yml +++ b/.github/workflows/test-matrix.yml @@ -22,7 +22,7 @@ jobs: cc: "gcc-12", cxx: "g++-12", py: "3.10", - cmake: "3.25.x", + cmake: "4.0.x", mpi: "ON", simd: "OFF" } @@ -32,7 +32,7 @@ jobs: cc: "clang-13", cxx: "clang++-13", py: "3.10", - cmake: "3.25.x", + cmake: "4.0.x", mpi: "ON", simd: "OFF" } @@ -42,7 +42,7 @@ jobs: cc: "clang", cxx: "clang++", py: "3.10", - cmake: "3.25.x", + cmake: "4.0.x", mpi: "ON", simd: "OFF" } diff --git a/CMakeLists.txt b/CMakeLists.txt index 3c63541ad..a76c56826 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.25) +cmake_minimum_required(VERSION 4.0.0) include(CMakeDependentOption) include(CheckIPOSupported) diff --git a/VERSION b/VERSION index 20c48e996..6a805c7d8 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -0.12.0-dev +0.12.0-rc diff --git a/doc/dependencies.csv b/doc/dependencies.csv index c5dc70510..088f670ef 100644 --- a/doc/dependencies.csv +++ b/doc/dependencies.csv @@ -1,5 +1,5 @@ Build option/target,Tool name,Minimum version,Notes,Update criteria ---,CMake,3.25,,"* Is available as a module on HPC systems +--,CMake,4.0.0,,"* Is available as a module on HPC systems * When arbitrary changes in more recently released versions make supported" --,C++ compiler,,C++17 support. See below, --,GCC,12.0.0,,"* it is supported by the minimum version of CUDA. @@ -14,11 +14,11 @@ html, .. literalinclude:: ../requirements.txt,,See ``doc/requirements.txt``, unit,googletest,1.12.1,CPM, bench,Google-benchmark,1.8.3,CPM, --,json,3.12.0,CPM, ---,pugi,1.13,CPM, +--,pugi,1.15,CPM, --,random123,1.14.0,CPM, ---,fmt,10.0.0,CPM, +--,fmt,12.0.0,CPM, --,tinyopt,,CPM, --,units,0.13.1,CPM, --,unordered_dense,4.5.0,CPM, -ARB_WITH_PYTHON,pybind11,3.0.0,CPM, -ARB_WITH_PYTHON,Python,3.10,Python compatiblity is the range between the latest officially released point version and the minimum here specified.,"* it is not more advanced than the version specified by NEP 29." +ARB_WITH_PYTHON,pybind11,3.0.2,CPM, +ARB_WITH_PYTHON,Python,3.11,Python compatiblity is the range between the latest officially released point version and the minimum here specified.,"* it is not more advanced than the version specified by NEP 29." diff --git a/pyproject.toml b/pyproject.toml index d27801c6c..15fee8d9c 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -59,6 +59,7 @@ exclude = [ ".venv", ".vscode", "build", + "spack", "dist", "ext", "install-*", @@ -69,7 +70,7 @@ exclude = [ line-length = 88 indent-width = 4 -target-version = "py312" +target-version = "py314" [tool.ruff.lint] ignore = [ # for black @@ -124,7 +125,7 @@ build-frontend = "build" build = ["*linux*","*macosx*"] manylinux-x86_64-image = "manylinux_2_28" manylinux-aarch64-image = "manylinux_2_28" -skip = ["cp36*", "cp37*", "cp38*", "cp39*", "*musllinux*", "pp*"] +skip = ["cp38*", "cp39*", "cp310*", "*musllinux*", "pp*"] test-command = "python -m unittest discover -v -s {project}/python" dependency-versions = "latest" diff --git a/spack/package.py b/spack/package.py new file mode 100644 index 000000000..016832fb8 --- /dev/null +++ b/spack/package.py @@ -0,0 +1,174 @@ +# Copyright 2013-2023 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 Arbor(CMakePackage, CudaPackage): + """Arbor is a high-performance library for computational neuroscience + simulations.""" + + homepage = "https://arbor-sim.org" + git = "https://github.com/arbor-sim/arbor.git" + url = "https://github.com/arbor-sim/arbor/releases/download/v0.8.1/arbor-v0.9.0-full.tar.gz" + maintainers = ("thorstenhater", "haampie") + submodules = True + + version("master", branch="master", submodules=True) + version("develop", branch="master", submodules=True) + version( + "0.10.0", + sha256="6b6cc900b85fbf833fae94817b9406a0d690dc28", + url="https://github.com/arbor-sim/arbor/releases/download/v0.10.1/arbor-v0.10.0-full.tar.gz", + submodules=True, + ) + + version( + "0.9.0", + sha256="5f9740955c821aca81e23298c17ad64f33f635756ad9b4a0c1444710f564306a", + url="https://github.com/arbor-sim/arbor/releases/download/v0.9.0/arbor-v0.9.0-full.tar.gz", + submodules=True, + ) + version( + "0.8.1", + sha256="caebf96676ace6a9c50436541c420ca4bb53f0639dcab825de6fa370aacf6baa", + url="https://github.com/arbor-sim/arbor/releases/download/v0.8.1/arbor-v0.8.1-full.tar.gz", + ) + version( + "0.8.0", + sha256="18df5600308841616996a9de93b55a105be0f59692daa5febd3a65aae5bc2c5d", + url="https://github.com/arbor-sim/arbor/releases/download/v0.8/arbor-v0.8-full.tar.gz", + ) + version( + "0.7.0", + sha256="c3a6b7193946aee882bb85f9c38beac74209842ee94e80840968997ba3b84543", + url="https://github.com/arbor-sim/arbor/releases/download/v0.7/arbor-v0.7-full.tar.gz", + ) + version( + "0.6.0", + sha256="4cd333b18effc8833428ddc0b99e7dc976804771bc85da90034c272c7019e1e8", + url="https://github.com/arbor-sim/arbor/releases/download/v0.6/arbor-v0.6-full.tar.gz", + ) + version( + "0.5.2", + sha256="290e2ad8ca8050db1791cabb6b431e7c0409c305af31b559e397e26b300a115d", + url="https://github.com/arbor-sim/arbor/releases/download/v0.5.2/arbor-v0.5.2-full.tar.gz", + ) + + variant( + "assertions", + default=False, + description="Enable arb_assert() assertions in code.", + ) + variant("doc", default=False, description="Build documentation.") + variant("mpi", default=False, description="Enable MPI support") + variant("python", default=True, description="Enable Python frontend support") + variant( + "pystubs", default=True, when="@0.11:", description="Python stub generation" + ) + variant( + "vectorize", + default=False, + description="Enable vectorization of computational kernels", + ) + variant("hwloc", default=False, description="support for thread pinning via HWLOC") + variant( + "gpu_rng", + default=False, + description="Use GPU generated random numbers -- not bitwise equal to CPU version", + when="+cuda", + ) + + # https://docs.arbor-sim.org/en/latest/install/build_install.html#compilers + conflicts("%gcc@:8") + conflicts("%clang@:9") + # Cray compiler v9.2 and later is Clang-based. + conflicts("%cce@:9.1") + conflicts("%intel") + + depends_on("cmake@3.19:", type="build") + depends_on("c", type="build") # generated + depends_on("cxx", type="build") # generated + + # misc dependencies + depends_on("fmt@7.1:", when="@0.5.3:") # required by the modcc compiler + depends_on("fmt@9.1:", when="@0.7.1:") + depends_on("fmt@10.2:", when="@0.9.1:") + depends_on("fmt@10.2:", when="@0.10.0:") + depends_on("fmt@12.0:", when="@0.12.0:") + depends_on("googletest@1.12.1:", when="@0.7.1:") + depends_on("pugixml@1.11:", when="@0.7.1:") + depends_on("pugixml@1.13:", when="@0.9.1:") + depends_on("pugixml@1.14:", when="@0.10.0:") + depends_on("pugixml@1.15:", when="@0.12.0:") + depends_on("nlohmann-json@3.11.3:") + depends_on("nlohmann-json@3.12:", when="@0.12.0:") + depends_on("random123@1.14.0:") + with when("+cuda"): + depends_on("cuda@10:") + depends_on("cuda@11:", when="@0.7.1:") + depends_on("cuda@12:", when="@0.9.1:") + depends_on("cuda@12:", when="@0.10.0:") + + # mpi + depends_on("mpi", when="+mpi") + depends_on("py-mpi4py", when="+mpi+python", type=("build", "run")) + + # hwloc + depends_on("hwloc@2:", when="+hwloc", type=("build", "run")) + + # python (bindings) + with when("+python"): + extends("python") + depends_on("python@3.7:", type=("build", "run")) + depends_on("python@3.9:", when="@0.9.1:", type=("build", "run")) + depends_on("python@3.10:", when="@0.10.0:", type=("build", "run")) + depends_on("python@3.10:", when="@0.11.0:", type=("build", "run")) + depends_on("python@3.11:", when="@0.12.0:", type=("build", "run")) # + depends_on("py-numpy", type=("build", "run")) + depends_on("py-numpy@2.0.0:", when="@0.12.0:", type=("build", "run")) + depends_on("py-pybind11@2.6:", type="build") + depends_on("py-pybind11@2.8.1:", when="@0.5.3:", type="build") + depends_on("py-pybind11@2.10.1:", when="@0.7.1:", type="build") + depends_on("py-pybind11@2.11.1:", when="@0.9.1:", type="build") + depends_on("py-pybind11@2.10.1:", when="@0.7.1:", type="build") + depends_on("py-pybind11@3.0.2:", when="@0.12.0:", type="build") + depends_on("py-pybind11-stubgen@2.5:", when="+pystubs", type="build") + + # sphinx based documentation + with when("+doc"): + depends_on("python@3.11:", type="build") + depends_on("py-sphinx", type="build") + depends_on("py-svgwrite", type="build") + + @property + def build_targets(self): + return ["all", "html"] if "+doc" in self.spec else ["all"] + + def cmake_args(self): + spec = self.spec + args = [ + self.define_from_variant("ARB_WITH_ASSERTIONS", "assertions"), + self.define_from_variant("ARB_WITH_MPI", "mpi"), + self.define_from_variant("ARB_WITH_PYTHON", "python"), + self.define_from_variant("ARB_VECTORIZE", "vectorize"), + self.define("ARB_ARCH", "none"), + self.define("ARB_CXX_FLAGS_TARGET", optimization_flags(self.compiler, spec.target)), + ] + + if self.spec.satisfies("+cuda"): + args.extend( + [ + self.define("ARB_GPU", "cuda"), + self.define_from_variant("ARB_USE_GPU_RNG", "gpu_rng"), + ] + ) + + return args + + @run_after("install", when="+python") + @on_package_attributes(run_tests=True) + def install_test(self): + python("-c", "import arbor")