diff --git a/packages/neuron/install-python-prefix-8.2.6.patch b/packages/neuron/install-python-prefix-8.2.6.patch new file mode 100644 index 0000000000000000000000000000000000000000..f0484736cf60871191d2d08fffa61014bafd9a17 --- /dev/null +++ b/packages/neuron/install-python-prefix-8.2.6.patch @@ -0,0 +1,38 @@ +diff --git a/setup.py b/setup.py +index 0ca138e60..bb85e416d 100644 +--- a/setup.py ++++ b/setup.py +@@ -487,7 +487,7 @@ def setup_package(): + extra_link_args=extra_link_args + + [ + "-Wl,-rpath,{}{}".format( +- REL_RPATH, "/../../" if just_extensions else "/.data/lib/" ++ REL_RPATH, "/../../../" if just_extensions else "/.data/lib/" + ) + ], + **extension_common_params, +@@ -518,7 +518,7 @@ def setup_package(): + extra_compile_args=extra_compile_args + + ["-O2" if "NRN_BUILD_FOR_UPLOAD" in os.environ else rx3d_opt_level], + extra_link_args=extra_link_args +- + ["-Wl,-rpath,{}".format(REL_RPATH + "/../../.data/lib/")], ++ + ["-Wl,-rpath,{}".format(REL_RPATH + "/../../../../../../" if just_extensions else "/../../.data/lib/")], + ) + ) + +diff --git a/src/nrnpython/CMakeLists.txt b/src/nrnpython/CMakeLists.txt +index 395c9e7d6..d62afce87 100644 +--- a/src/nrnpython/CMakeLists.txt ++++ b/src/nrnpython/CMakeLists.txt +@@ -231,7 +231,10 @@ if(NRN_ENABLE_MODULE_INSTALL) + endforeach(pyexe) + + add_dependencies(hoc_module nrniv_lib rxdmath ${nrnpython_lib_list}) +- install(DIRECTORY ${NRN_PYTHON_BUILD_LIB} DESTINATION lib) ++ if(NOT DEFINED NRN_PYTHON_INSTALL_DIR) ++ set(NRN_PYTHON_INSTALL_DIR "lib") ++ endif() ++ install(DIRECTORY "${NRN_PYTHON_BUILD_LIB}/neuron" DESTINATION "${NRN_PYTHON_INSTALL_DIR}") + else() + # Make sure this is included in the wheels + install(FILES "${PROJECT_BINARY_DIR}/lib/python/neuron/_config_params.py" diff --git a/packages/neuron/package.py b/packages/neuron/package.py index a429e035701ea92565788de110d90b7729643612..36845c549f44ec78510ed1546d664df1688f6321 100644 --- a/packages/neuron/package.py +++ b/packages/neuron/package.py @@ -2,6 +2,7 @@ # Spack Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) +import sys from spack.package import * @@ -16,12 +17,13 @@ class Neuron(CMakePackage): """ homepage = "https://www.neuron.yale.edu/" - url = "https://github.com/neuronsimulator/nrn/releases/download/8.2.3/full-src-package-8.2.3.tar.gz" + url = "https://github.com/neuronsimulator/nrn/releases/download/8.2.6/nrn-full-src-package-8.2.6.tar.gz" git = "https://github.com/neuronsimulator/nrn" - maintainers = ["kumbhar"] + maintainers = ["kumbhar", "jcgoran"] version("develop", branch="master", submodules="True") + version("8.2.6", tag="8.2.6", submodules="True") version("8.2.3", tag="8.2.3", submodules="True") version("8.2.2", tag="8.2.2", submodules="True") version("8.1.0", tag="8.1.0", submodules="True") @@ -41,23 +43,31 @@ class Neuron(CMakePackage): depends_on("bison", type="build") depends_on("flex", type="build") - depends_on("py-cython", when="+rx3d", type="build") + depends_on("py-cython@:2", when="@:8 +rx3d", type="build") + depends_on("py-cython", when="@9: +rx3d", type="build") depends_on("gettext") depends_on("mpi", when="+mpi") depends_on("ncurses") - depends_on("python@2.7:", when="+python") + depends_on("py-wheel", when="+python") + depends_on("py-setuptools@:59.6", when="@:8.2.1+python") + depends_on("py-setuptools@:70.3", when="+python") + depends_on("python@2.7:3.11", when="@:8.2.4 +python") + depends_on("python@2.7:3.12", when="@8.2.5:8 +python") + depends_on("python@3.9:3.13", when="@9: +python") depends_on("py-pytest", when="+python+tests") depends_on("py-mpi4py", when="+mpi+python+tests") depends_on("readline") depends_on("caliper", when="+caliper") - depends_on("py-numpy", type=("run","test")) + depends_on("py-numpy@:1", when="@:8", type=("run","test")) + depends_on("py-numpy", when="@9:", type=("run","test")) extends('python', when='+python') patch("patch-v782-git-cmake-avx512.patch", when="@7.8.2") patch("nrn_find_ncurses.patch", when="@8.2.2") - patch("install-python-prefix.patch", when="@8:9+python") + patch("install-python-prefix.patch", when="@:8.2.3+python") + patch("install-python-prefix-8.2.6.patch", when="@8.2.6:+python") def cmake_args(self): spec = self.spec @@ -98,6 +108,11 @@ class Neuron(CMakePackage): if "+caliper" in spec: args.append("-DCORENRN_CALIPER_PROFILING=ON") + # workaround for NEURON 8.2.6 installing Python components in `lib/python` + if self.version >= Version("8.2.6") and self.version < Version("9.0.0"): + py_version = f"{sys.version_info.major}.{sys.version_info.minor}" + install_dir = f"lib/python{py_version}/site-packages" + args.append(f"-DNRN_PYTHON_INSTALL_DIR={install_dir}") return args @run_after("install") diff --git a/spack.yaml b/spack.yaml index b99a827038f34fffb388af454bfc187d263cb07f..60051685974815fee9f8140c409de54b975d4aac 100644 --- a/spack.yaml +++ b/spack.yaml @@ -14,7 +14,7 @@ spack: - py-biobb-structure-utils@4.1.0 - hxtorch@10.0-a1 - nest@3.8 +sonata - - neuron@8.2.3 +mpi + - neuron@8.2.6 +mpi - jaxsnn@10.0-a1 - py-bluepyefe@2.3.6 - py-bluepymm@0.8.7