Skip to content
Snippets Groups Projects

Add MUSIC package and optional dependency from NEST

Open Dennis Terhorst requested to merge add-music into master
2 unresolved threads
Compare and
3 files
+ 100
2
Compare changes
  • Side-by-side
  • Inline
Files
3
# 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)
# ----------------------------------------------------------------------------
# If you submit this package back to Spack as a pull request,
# please first remove this boilerplate and all FIXME comments.
#
# This is a template package file for Spack. We've put "FIXME"
# next to all the things you'll want to change. Once you've handled
# them, you can save this file and test your package like this:
#
# spack install multi-simulation-coordinator
#
# You can edit this file again by typing:
#
# spack edit multi-simulation-coordinator
#
# See the Spack documentation for more information on packaging.
# ----------------------------------------------------------------------------
from spack.package import *
class MultiSimulationCoordinator(AutotoolsPackage): # name is NOT MUSIC, because that's taken in Spack upstream
"""
Multi-simulation coordinator
MUSIC provides a standardized software interface (API) on top of the
message-passing interface (MPI) for communication among parallel
applications for large-scale computational neuroscience simulations.
"""
# Add a proper url for your package's homepage here.
homepage = "https://github.com/INCF/MUSIC"
url = "https://github.com/INCF/MUSIC/archive/refs/tags/1.2.1.tar.gz"
# Add a list of GitHub accounts to notify when the package is updated.
maintainers("mdjurfeldt", "terhorstd")
# Add the SPDX identifier of the project's license below.
# See https://spdx.org/licenses/ for a list. Upon manually verifying
# the license, set checked_by to your Github username.
license("GPL-3.0-or-later")
version("1.2.1", sha256="7bf8160ba4f261b8fa14bf8ceab318912b8b8d8a1d8e653c6fbdd45eb27a51c7")
version("1.2.0", sha256="7eb852fd7c8ab51a08a33fcb1018f297ff4c9a5cd1e6a028d911c6c54d4bc545")
version("1.1.17", sha256="331be9c493c8454888f04acae57050a892af12435aa5f2814758248929836663")
variant("python", default=True, description="Install MUSIC Python bindings")
variant("viewevents", default=False, description="Include building the visualization tool `viewevents'")
depends_on("autoconf", type="build")
depends_on("automake", type="build")
depends_on("libtool", type="build")
depends_on("m4", type="build")
depends_on("freeglut", when="+viewevents", type=("build", "run"))
depends_on("python", when="+python", type=("build", "run"))
depends_on("mpi", type=("build", "run", "test"))
depends_on("py-mpi4py", when="+python", type=("build", "run", "test"))
depends_on("py-cython", when="+python", type="build")
def autoreconf(self, spec, prefix):
# FIXME: Modify the autoreconf method as necessary
autoreconf("--install", "--verbose", "--force")
def configure_args(self):
# Add arguments other than --prefix
print("### SPEC ###", self.spec)
args = []
print("'mpi*' variables in spec of MPI metapackage:")
[print(f"{x} = {getattr(self.spec['mpi'], x)}") for x in dir(self.spec['mpi']) if x.startswith("mpi")]
# Variables used in ./configure:
# MPI_CXX The compiler to use for MPI code
# MPI_CXXFLAGS C++ compilation flags
# MPI_CFLAGS C compilation flags
# MPI_LDFLAGS Linking flags
args.append(f'MPI_CXX=mpiCC') # this is hardcoded to OpenMPI because detection inside package fails.
args.append(f'MPI_CXXFLAGS=-g -O3 -I{self.spec["mpi"].prefix}/include')
args.append(f'MPI_CFLAGS=-g -O3 -I{self.spec["mpi"].prefix}/include')
if "~python" in self.spec:
args.append("--without-python")
print("### DEBUG ###", args)
return args