## START: Set by rpmautospec ## (rpmautospec version 0.3.5) ## RPMAUTOSPEC: autorelease, autochangelog %define autorelease(e:s:pb:n) %{?-p:0.}%{lua: release_number = 2; base_release_number = tonumber(rpm.expand("%{?-b*}%{!?-b:1}")); print(release_number + base_release_number - 1); }%{?-e:.%{-e*}}%{?-s:.%{-s*}}%{!?-n:%{?dist}} ## END: Set by rpmautospec %bcond_with mpich %bcond_with openmpi # Issue filed about warnings while compiling NEURON mod files: # https://github.com/NeuralEnsemble/PyNN/issues/707 # Exclude privately used libnrnmech from provides %global __provides_exclude ^libnrnmech\\.so.*$ %global __requires_exclude ^libnrnmech\\.so.*$ %global _description %{expand: PyNN (pronounced 'pine') is a simulator-independent language for building neuronal network models. In other words, you can write the code for a model once, using the PyNN API and the Python programming language, and then run it without modification on any simulator that PyNN supports (currently NEURON, NEST and Brian) and on a number of neuromorphic hardware systems. The PyNN API aims to support modelling at a high-level of abstraction (populations of neurons, layers, columns and the connections between them) while still allowing access to the details of individual neurons and synapses when required. PyNN provides a library of standard neuron, synapse and synaptic plasticity models, which have been verified to work the same on the different supported simulators. PyNN also provides a set of commonly-used connectivity algorithms (e.g. all-to-all, random, distance-dependent, small-world) but makes it easy to provide your own connectivity in a simulator-independent way. Even if you don’t wish to run simulations on multiple simulators, you may benefit from writing your simulation code using PyNN’s powerful, high-level interface. In this case, you can use any neuron or synapse model supported by your simulator, and are not restricted to the standard models. Documentation: http://neuralensemble.org/docs/PyNN/ Mailing list: https://groups.google.com/forum/?fromgroups#!forum/neuralensemble This package supports the NEURON, NEST, and Brian simulators.} %global forgeurl https://github.com/NeuralEnsemble/PyNN Name: python-pynn Version: 0.12.1 %global tag %{version} %forgemeta Release: %autorelease Summary: A package for simulator-independent specification of neuronal network models # SPDX License: CECILL-2.0 URL: http://neuralensemble.org/PyNN/ Source: %forgesource # https://github.com/sanjayankur31/PyNN/tree/feat/v0.12.1 # submitted upstream as: https://github.com/NeuralEnsemble/PyNN/pull/794 Patch: 0001-fix-nest-correctly-use-namespaces.patch # Random123 does not build on these, so neither can NEURON, so nothing that # depends on NEURON supports them either # https://github.com/neuronsimulator/nrn/issues/114 # # python-pyedflib does not support s390x, so the complete dep tree needs to also exclude it # https://src.fedoraproject.org/rpms/python-pyedflib/blob/rawhide/f/python-pyedflib.spec # # python-pynn: Build hangs on i686 # https://bugzilla.redhat.com/show_bug.cgi?id=2155635 # https://fedoraproject.org/wiki/Changes/EncourageI686LeafRemoval ExcludeArch: mips64r2 mips32r2 s390x %{ix86} # For extensions BuildRequires: boost-devel BuildRequires: cmake BuildRequires: gcc-c++ BuildRequires: git-core BuildRequires: gsl-devel BuildRequires: libneurosim-devel BuildRequires: ncurses-devel BuildRequires: nest-devel >= 3.4 BuildRequires: neuron-devel BuildRequires: libtool-ltdl-devel BuildRequires: readline-devel BuildRequires: python3-brian2 BuildRequires: python3-cheetah BuildRequires: %{py3_dist h5py} BuildRequires: %{py3_dist lazyarray} BuildRequires: %{py3_dist matplotlib} BuildRequires: %{py3_dist morphio} BuildRequires: %{py3_dist mock} BuildRequires: %{py3_dist neo} BuildRequires: %{py3_dist numpy} BuildRequires: python3-nest >= 3.4 BuildRequires: nest >= 3.4 BuildRequires: python3-neuron BuildRequires: %{py3_dist quantities} BuildRequires: %{py3_dist pytest} %if %{with mpich} BuildRequires: python3-mpi4py-mpich BuildRequires: python3-nest-mpich >= 3.4 BuildRequires: nest-mpich >= 3.4 BuildRequires: python3-neuron-mpich BuildRequires: rpm-mpi-hooks BuildRequires: mpich BuildRequires: mpich-devel %endif %if %{with openmpi} BuildRequires: python3-mpi4py-openmpi BuildRequires: python3-nest-openmpi >= 3.4 BuildRequires: nest-openmpi >= 3.4 BuildRequires: python3-neuron-openmpi BuildRequires: rpm-mpi-hooks BuildRequires: openmpi BuildRequires: openmpi-devel %endif %{?python_enable_dependency_generator} %description %_description %package devel Summary: %{summary} Requires: python3-pynn%{?_isa} = %{version}-%{release} %description devel %_description %package -n python3-pynn Summary: %{summary} BuildRequires: python3-devel BuildRequires: python3-setuptools %description -n python3-pynn %_description %package doc Summary: %{summary} BuildArch: noarch %description doc Documentation for %{name}. %prep %forgeautosetup -S git rm -rfv PyNN-%{version}/pyNN.egg-info # we install NEST libraries in standard directories, and that's where NEST expects to find extensions also sed -i 's|\${NEST_LIBDIR}/nest|\${NEST_LIBDIR}|' pyNN/nest/extensions/CMakeLists.txt %build # TODO: investigate using pyproject macros, or other new non setup.py tools %py3_build pushd ./build/lib/pyNN/neuron/nmodl/ || exit 1 nrnivmodl . popd # The tests however, look for these here, so we also build them pushd pyNN/neuron/nmodl || exit 1 nrnivmodl . popd # NEST extensions: we build and install them ourselves pushd ./build/lib/pyNN/nest/extensions/ || exit 1 %cmake -Dwith-nest=%{_bindir}/nest-config %cmake_build popd %install %py3_install # Includes compiled arch specific files but installs in /lib # Manually move to arch specific folder %if "%{python3_sitelib}" != "%{python3_sitearch}" mkdir -p 0644 $RPM_BUILD_ROOT/%{python3_sitearch}/ mv $RPM_BUILD_ROOT/%{python3_sitelib}/pyNN $RPM_BUILD_ROOT/%{python3_sitearch}/ mv $RPM_BUILD_ROOT/%{python3_sitelib}/PyNN-%{version}-py%{python3_version}.egg-info $RPM_BUILD_ROOT/%{python3_sitearch}/ %endif # NEST extensions pushd ./build/lib/pyNN/nest/extensions/ || exit 1 %cmake_install popd # remove temporary build files rm -rf $RPM_BUILD_ROOT%{python3_sitearch}/pyNN/nest/extensions/redhat-linux-build/ rm -rf $RPM_BUILD_ROOT%{python3_sitearch}/pyNN/nest/_build %check # skip pyNN.nest because it looks for nest extensions outside the buildroot %py3_check_import pyNN pyNN.neuron pyNN.brian2 %pytest test/unittests -k "not test_partitioning" %if %{with mpich} %{_mpich_load} export PYTHONPATH=$PYTHONPATH:$RPM_BUILD_ROOT/%{python3_sitearch}:$RPM_BUILD_ROOT/%{python3_sitelib}:$RPM_BUILD_ROOT/$MPI_PYTHON3_SITEARCH:$MPI_PYTHON3_SITEARCH %py3_check_import pyNN pyNN.nest pyNN.neuron pyNN.brian2 %pytest test/unittests unset PYTHONPATH %{_mpich_unload} %endif %if %{with openmpi} %{_openmpi_load} export PYTHONPATH=$PYTHONPATH:$RPM_BUILD_ROOT/%{python3_sitearch}:$RPM_BUILD_ROOT/%{python3_sitelib}:$RPM_BUILD_ROOT/$MPI_PYTHON3_SITEARCH:$MPI_PYTHON3_SITEARCH %py3_check_import pyNN pyNN.nest pyNN.neuron pyNN.brian2 %pytest test/unittests unset PYTHONPATH %{_openmpi_unload} %endif # These files are NEURON files that are required by PyNN to run bits using the NEURON backend # The libnrnmech.so file, along with the .libs/libnrnmech.so symlink are both required # So is the "special" script that loads these libraries # We can remove some temporary compilation files, though: find $RPM_BUILD_ROOT/%{python3_sitearch}/pyNN/neuron/nmodl/*/ -name "*.c" -o -name "*.c" -o -name "*.mod" -delete %files -n python3-pynn %license LICENSE %doc README.rst AUTHORS changelog %{_libdir}/*pynn*so %{_datadir}/nest/sli/pynn_extensions-init.sli %{python3_sitearch}/pyNN %{python3_sitearch}/PyNN-%{version}-py%{python3_version}.egg-info %files devel %{_includedir}/pynn_extensions.h %files doc %license LICENSE %doc examples %changelog * Mon Feb 12 2024 Ankur Sinha (Ankur Sinha Gmail) - 0.12.1-2 - fix: add patch to fix nest extensions (fixes rh#2263339, rh#2241443) * Mon Feb 12 2024 Ankur Sinha (Ankur Sinha Gmail) - 0.12.1-1 - WIP: does not build * Mon Feb 12 2024 Ankur Sinha (Ankur Sinha Gmail) - 0.11.0-5 - fix: packit config * Mon Feb 12 2024 Ankur Sinha (Ankur Sinha Gmail) - 0.11.0-4 - chore: add packit * Fri Jan 26 2024 Fedora Release Engineering - 0.11.0-3 - Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild * Mon Jan 22 2024 Fedora Release Engineering - 0.11.0-2 - Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild * Thu Jul 27 2023 Ankur Sinha (Ankur Sinha Gmail) - 0.11.0-1 - feat: update to 0.11.0 (fixes rhbz#2209829) * Wed Jul 26 2023 Mamoru TASAKA - 0.10.1-5 - Backport upstream patch to build with nest-simulator 3.4 - Also filter out libnrnmech.so Requires * Fri Jul 21 2023 Fedora Release Engineering - 0.10.1-4 - Rebuilt for https://fedoraproject.org/wiki/Fedora_39_Mass_Rebuild * Wed Jul 12 2023 Python Maint - 0.10.1-3 - Rebuilt for Python 3.12 * Fri Jan 20 2023 Fedora Release Engineering - 0.10.1-2 - Rebuilt for https://fedoraproject.org/wiki/Fedora_38_Mass_Rebuild * Fri Jan 13 2023 Ankur Sinha (Ankur Sinha Gmail) - 0.10.1-1 - feat: update to 0.10.1 (fixes rhbz#2134727) * Thu Dec 22 2022 Benjamin A. Beasley - 0.10.0-8 - Leaf package: drop support for i686 (fix RHBZ#2155635) * Wed Dec 21 2022 Florian Weimer - 0.10.0-7 - Apply upstream patch to fix C99 compatibility issue * Sun Oct 09 2022 Ankur Sinha (Ankur Sinha Gmail) - 0.10.0-6 - feat: exclude s390x * Tue Aug 23 2022 Mamoru TASAKA - 0.10.0-5 - Rebuild for gsl-2.7.1 * Fri Jul 22 2022 Fedora Release Engineering - 0.10.0-4 - Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild * Sun Jul 03 2022 Mamoru TASAKA - 0.10.0-3 - Fix invocation of %%%%cmake macro * Fri Jan 21 2022 Fedora Release Engineering - 0.10.0-2 - Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild * Fri Dec 31 2021 Ankur Sinha (Ankur Sinha Gmail) - 0.10.0-1 - feat: update to 0.10.0 * Mon Dec 27 2021 Ankur Sinha - 0.9.6-4 - Remove excess macros for package name * Fri Jul 23 2021 Fedora Release Engineering - 0.9.6-3 - Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild * Fri Jun 04 2021 Python Maint - 0.9.6-2 - Rebuilt for Python 3.10 * Tue Feb 09 2021 Ankur Sinha - 0.9.6-1 - Remove duplicate neuron-devel BR - Add patch to correct python operator usage - Use arch dependent and version specific requirement on base package - Add comment about NEURON files - Filter out private libnrnmech from provides * Fri Jan 08 2021 Ankur Sinha - 0.9.6-1 - Initial build