# We build the python bit separately - their build system doesn't let me build # and install separately - everything is done at install time # Doing it ourselves also tells us exactly what's going on, and ensures that # all flags are respected - we can also build the python2 and python3 bits # separately. # They run their tests per commit, so we don't need to run them here to check # it all again. # The cythonize bit needs to be run before cmake. %{!?_pkgdocdir: %global _pkgdocdir %{_docdir}/%{name}} # Git stuff %global commit0 79b2f0138993faa468ad74d112a9e07a055215f2 %global shortcommit0 %(c=%{commit0}; echo ${c:0:7}) # Switch them off if you want %global with_mpich 0 %global with_openmpi 0 Name: nest Version: 2.10.0 Release: 22.git%{shortcommit0}%{?dist} Summary: The neural simulation tool License: GPLv2+ URL: http://www.nest-simulator.org/ Source0: %{name}-%{version}-git%{shortcommit0}.tar.gz # Let it atleast build the cythonised shared object # But we still build our python modules ourselves Patch0: 0001-disable-python-build-install.patch BuildRequires: ncurses-devel gsl-devel readline-devel BuildRequires: python2-devel Cython BuildRequires: python3-devel python3-Cython BuildRequires: libtool-ltdl-devel BuildRequires: cmake libtool doxygen graphviz Requires: %{name}-common %description NEST is a simulator for spiking neural network models that focuses on the dynamics, size and structure of neural systems rather than on the exact morphology of individual neurons. The development of NEST is coordinated by the NEST Initiative. NEST is ideal for networks of spiking neurons of any size, for example: - Models of information processing e.g. in the visual or auditory cortex of mammals, - Models of network activity dynamics, e.g. laminar cortical networks or balanced random networks, - Models of learning and plasticity. %package common BuildArch: noarch Summary: Common files for %{name} %description common NEST is a simulator for spiking neural network models that focuses on the dynamics, size and structure of neural systems rather than on the exact morphology of individual neurons. The development of NEST is coordinated by the NEST Initiative. NEST is ideal for networks of spiking neurons of any size, for example: - Models of information processing e.g. in the visual or auditory cortex of mammals, - Models of network activity dynamics, e.g. laminar cortical networks or balanced random networks, - Models of learning and plasticity. %package doc BuildArch: noarch Summary: Documentation for %{name} %description doc NEST is a simulator for spiking neural network models that focuses on the dynamics, size and structure of neural systems rather than on the exact morphology of individual neurons. The development of NEST is coordinated by the NEST Initiative. NEST is ideal for networks of spiking neurons of any size, for example: - Models of information processing e.g. in the visual or auditory cortex of mammals, - Models of network activity dynamics, e.g. laminar cortical networks or balanced random networks, - Models of learning and plasticity. %package devel-doc BuildArch: noarch Summary: C++ class documentation for %{name} %description devel-doc NEST is a simulator for spiking neural network models that focuses on the dynamics, size and structure of neural systems rather than on the exact morphology of individual neurons. The development of NEST is coordinated by the NEST Initiative. NEST is ideal for networks of spiking neurons of any size, for example: - Models of information processing e.g. in the visual or auditory cortex of mammals, - Models of network activity dynamics, e.g. laminar cortical networks or balanced random networks, - Models of learning and plasticity. %package -n pynest Summary: Python2 bindings for nest Provides: python2-nest = %{version}-%{release} Requires: %{name} = %{version}-%{release} Requires: %{name}-common Requires: numpy scipy python-matplotlib python-ipython %description -n pynest NEST is a simulator for spiking neural network models that focuses on the dynamics, size and structure of neural systems rather than on the exact morphology of individual neurons. The development of NEST is coordinated by the NEST Initiative. NEST is ideal for networks of spiking neurons of any size, for example: - Models of information processing e.g. in the visual or auditory cortex of mammals, - Models of network activity dynamics, e.g. laminar cortical networks or balanced random networks, - Models of learning and plasticity. %package -n python3-pynest Summary: Python3 bindings for nest Provides: python3-nest = %{version}-%{release} Requires: %{name} = %{version}-%{release} Requires: %{name}-common Requires: python3-numpy python3-scipy python3-matplotlib python3-ipython %description -n python3-pynest NEST is a simulator for spiking neural network models that focuses on the dynamics, size and structure of neural systems rather than on the exact morphology of individual neurons. The development of NEST is coordinated by the NEST Initiative. NEST is ideal for networks of spiking neurons of any size, for example: - Models of information processing e.g. in the visual or auditory cortex of mammals, - Models of network activity dynamics, e.g. laminar cortical networks or balanced random networks, - Models of learning and plasticity. %package -n python2-connplotter Summary: A tool to create connectivity pattern tables Requires: numpy scipy python-matplotlib python-ipython BuildArch: noarch %description -n python2-connplotter NEST is a simulator for spiking neural network models that focuses on the dynamics, size and structure of neural systems rather than on the exact morphology of individual neurons. The development of NEST is coordinated by the NEST Initiative. NEST is ideal for networks of spiking neurons of any size, for example: - Models of information processing e.g. in the visual or auditory cortex of mammals, - Models of network activity dynamics, e.g. laminar cortical networks or balanced random networks, - Models of learning and plasticity. ConnPlotter is a tool to create connectivity pattern tables. %package -n python3-connplotter Summary: A tool to create connectivity pattern tables Requires: python3-numpy python3-scipy python3-matplotlib python3-ipython BuildArch: noarch %description -n python3-connplotter NEST is a simulator for spiking neural network models that focuses on the dynamics, size and structure of neural systems rather than on the exact morphology of individual neurons. The development of NEST is coordinated by the NEST Initiative. NEST is ideal for networks of spiking neurons of any size, for example: - Models of information processing e.g. in the visual or auditory cortex of mammals, - Models of network activity dynamics, e.g. laminar cortical networks or balanced random networks, - Models of learning and plasticity. ConnPlotter is a tool to create connectivity pattern tables. %if %{with_openmpi} %package openmpi BuildRequires: openmpi-devel BuildRequires: rpm-mpi-hooks Requires: openmpi Summary: %{name} built with openmpi Requires: %{name}-openmpi-common %description openmpi NEST is a simulator for spiking neural network models that focuses on the dynamics, size and structure of neural systems rather than on the exact morphology of individual neurons. The development of NEST is coordinated by the NEST Initiative. NEST is ideal for networks of spiking neurons of any size, for example: - Models of information processing e.g. in the visual or auditory cortex of mammals, - Models of network activity dynamics, e.g. laminar cortical networks or balanced random networks, - Models of learning and plasticity. %package openmpi-common BuildArch: noarch Summary: Common files for %{name} built with openmpi support %description openmpi-common NEST is a simulator for spiking neural network models that focuses on the dynamics, size and structure of neural systems rather than on the exact morphology of individual neurons. The development of NEST is coordinated by the NEST Initiative. NEST is ideal for networks of spiking neurons of any size, for example: - Models of information processing e.g. in the visual or auditory cortex of mammals, - Models of network activity dynamics, e.g. laminar cortical networks or balanced random networks, - Models of learning and plasticity. %package openmpi-doc BuildArch: noarch Summary: Documentation for %{name} built with openmpi support %description openmpi-doc NEST is a simulator for spiking neural network models that focuses on the dynamics, size and structure of neural systems rather than on the exact morphology of individual neurons. The development of NEST is coordinated by the NEST Initiative. NEST is ideal for networks of spiking neurons of any size, for example: - Models of information processing e.g. in the visual or auditory cortex of mammals, - Models of network activity dynamics, e.g. laminar cortical networks or balanced random networks, - Models of learning and plasticity. %package -n pynest-openmpi Summary: Python2 bindings for nest with openmpi support Provides: python2-nest = %{version}-%{release} Requires: nest-openmpi = %{version}-%{release} Requires: %{name}-openmpi-common Requires: openmpi Requires: numpy scipy python-matplotlib python-ipython BuildRequires: rpm-mpi-hooks %description -n pynest-openmpi NEST is a simulator for spiking neural network models that focuses on the dynamics, size and structure of neural systems rather than on the exact morphology of individual neurons. The development of NEST is coordinated by the NEST Initiative. NEST is ideal for networks of spiking neurons of any size, for example: - Models of information processing e.g. in the visual or auditory cortex of mammals, - Models of network activity dynamics, e.g. laminar cortical networks or balanced random networks, - Models of learning and plasticity. %package -n python3-pynest-openmpi Summary: Python3 bindings for nest with openmpi support Provides: python3-nest = %{version}-%{release} Requires: nest-openmpi = %{version}-%{release} Requires: %{name}-openmpi-common Requires: openmpi Requires: python3-numpy python3-scipy python3-matplotlib python3-ipython BuildRequires: rpm-mpi-hooks %description -n python3-pynest-openmpi NEST is a simulator for spiking neural network models that focuses on the dynamics, size and structure of neural systems rather than on the exact morphology of individual neurons. The development of NEST is coordinated by the NEST Initiative. NEST is ideal for networks of spiking neurons of any size, for example: - Models of information processing e.g. in the visual or auditory cortex of mammals, - Models of network activity dynamics, e.g. laminar cortical networks or balanced random networks, - Models of learning and plasticity. %endif %if %{with_mpich} %package mpich BuildRequires: mpich-devel BuildRequires: rpm-mpi-hooks Requires: mpich Requires: %{name}-mpich-common Summary: %{name} built with mpich %description mpich NEST is a simulator for spiking neural network models that focuses on the dynamics, size and structure of neural systems rather than on the exact morphology of individual neurons. The development of NEST is coordinated by the NEST Initiative. NEST is ideal for networks of spiking neurons of any size, for example: - Models of information processing e.g. in the visual or auditory cortex of mammals, - Models of network activity dynamics, e.g. laminar cortical networks or balanced random networks, - Models of learning and plasticity. %package mpich-common BuildArch: noarch Summary: Common files for %{name} built with mpich support %description mpich-common NEST is a simulator for spiking neural network models that focuses on the dynamics, size and structure of neural systems rather than on the exact morphology of individual neurons. The development of NEST is coordinated by the NEST Initiative. NEST is ideal for networks of spiking neurons of any size, for example: - Models of information processing e.g. in the visual or auditory cortex of mammals, - Models of network activity dynamics, e.g. laminar cortical networks or balanced random networks, - Models of learning and plasticity. %package mpich-doc BuildArch: noarch Summary: Documentation for %{name} built with mpich support %description mpich-doc NEST is a simulator for spiking neural network models that focuses on the dynamics, size and structure of neural systems rather than on the exact morphology of individual neurons. The development of NEST is coordinated by the NEST Initiative. NEST is ideal for networks of spiking neurons of any size, for example: - Models of information processing e.g. in the visual or auditory cortex of mammals, - Models of network activity dynamics, e.g. laminar cortical networks or balanced random networks, - Models of learning and plasticity. %package -n pynest-mpich Summary: Python2 bindings for nest with mpich support Provides: python2-nest = %{version}-%{release} Requires: %{name}-mpich = %{version}-%{release} Requires: %{name}-mpich-common Requires: mpich Requires: numpy scipy python-matplotlib python-ipython BuildRequires: rpm-mpi-hooks %description -n pynest-mpich NEST is a simulator for spiking neural network models that focuses on the dynamics, size and structure of neural systems rather than on the exact morphology of individual neurons. The development of NEST is coordinated by the NEST Initiative. NEST is ideal for networks of spiking neurons of any size, for example: - Models of information processing e.g. in the visual or auditory cortex of mammals, - Models of network activity dynamics, e.g. laminar cortical networks or balanced random networks, - Models of learning and plasticity. %package -n python3-pynest-mpich Summary: Python3 bindings for nest with mpich support Provides: python3-nest = %{version}-%{release} Requires: %{name}-mpich = %{version}-%{release} Requires: %{name}-mpich-common Requires: mpich Requires: python3-numpy python3-scipy python3-matplotlib python3-ipython BuildRequires: rpm-mpi-hooks %description -n python3-pynest-mpich NEST is a simulator for spiking neural network models that focuses on the dynamics, size and structure of neural systems rather than on the exact morphology of individual neurons. The development of NEST is coordinated by the NEST Initiative. NEST is ideal for networks of spiking neurons of any size, for example: - Models of information processing e.g. in the visual or auditory cortex of mammals, - Models of network activity dynamics, e.g. laminar cortical networks or balanced random networks, - Models of learning and plasticity. %endif %prep %setup -q -c -n %{name}-%{version}-git%{shortcommit0} # We don't have python, but we want it to go into pynest and do the cython bits # sed -i.orig '173 d' %{name}-%{version}-git%{shortcommit0}/CMakeLists.txt # sed -i.orig '175 d' %{name}-%{version}-git%{shortcommit0}/CMakeLists.txt # Setting the standard to 98 sed -i.orig '40 i SET(CMAKE_CXX_STANDARD 98)' %{name}-%{version}-git%{shortcommit0}/CMakeLists.txt # We'll set it ourselves - easier for mpi implementations sed -i.orig '/PYEXECDIR/ d' %{name}-%{version}-git%{shortcommit0}/cmake/DetermineLibraries.cmake cp -a %{name}-%{version}-git%{shortcommit0} %{name}-%{version}-git%{shortcommit0}-py3 %if %{with_mpich} cp -a %{name}-%{version}-git%{shortcommit0} %{name}-%{version}-git%{shortcommit0}-mpich cp -a %{name}-%{version}-git%{shortcommit0} %{name}-%{version}-git%{shortcommit0}-mpich-py3 %endif %if %{with_openmpi} cp -a %{name}-%{version}-git%{shortcommit0} %{name}-%{version}-git%{shortcommit0}-openmpi cp -a %{name}-%{version}-git%{shortcommit0} %{name}-%{version}-git%{shortcommit0}-openmpi-py3 %endif cp %{name}-%{version}-git%{shortcommit0}/LICENSE ./ %build %global dobuild \ export PYEXECDIR=$MPI_PYTHON2_SITEARCH \ export PYNEST_CFLAGS="%{optflags}" \ export PYNEST_CXXFLAGS="%{optflags}" \ export CFLAGS="%{optflags}" \ export CXXFLAGS="%{optflags}" \ export LDFLAGS="${LDFLAGS:--Wl,-z,relro -specs=/usr/lib/rpm/redhat/redhat-hardened-ld}" cd %{name}-%{version}-git%{shortcommit0}$MPI_COMPILE_TYPE ;\ cmake \ -DCMAKE_C_FLAGS_RELEASE:STRING="-DNDEBUG" \ -DCMAKE_CXX_FLAGS_RELEASE:STRING="-DNDEBUG" \ -DCMAKE_Fortran_FLAGS_RELEASE:STRING="-DNDEBUG" \ -DCMAKE_VERBOSE_MAKEFILE:BOOL=ON \ -DINCLUDE_INSTALL_DIR:PATH=%{_includedir} \ -DLIB_INSTALL_DIR:PATH=%{_libdir} \ -DSYSCONF_INSTALL_DIR:PATH=%{_sysconfdir}\ -DSHARE_INSTALL_PREFIX:PATH=%{_datadir} \ -Dwith-mpi:BOOL=$MPI_YES \ -Dwith-gsl:BOOL=ON \ -Dwith-python:PATH=$PYTHON_BIN \ -DPYEXECDIR:PATH=$MPI_SITEARCH \ -DCMAKE_INSTALL_PREFIX:PATH=$MPI_HOME \ -DBUILD_SHARED_LIBS:BOOL=ON ;\ #%if "lib64" == "lib64" # -DLIB_SUFFIX=64 \ #%endif make %{?_smp_mflags} ;\ cd pynest ;\ CFLAGS="%{optflags}" $PYTHON_BIN setup.py build ;\ cd ../topology ;\ CFLAGS="%{optflags}" $PYTHON_BIN setup.py build ;\ cd ../extras/ConnPlotter ;\ CFLAGS="%{optflags}" $PYTHON_BIN setup.py build ;\ cd ../../.. ; # Build serial version, dummy arguments export PYTHON_BIN="%{__python2}" export MPI_PYTHON2_SITEARCH="%{python2_sitearch}" export MPI_PYTHON3_SITEARCH="%{python3_sitearch}" export MPI_COMPILE_TYPE="" export MPI_COMPILER=serial export MPI_SUFFIX="" export MPI_HOME=%{_prefix} export MPI_BIN=%{_bindir} export MPI_YES=OFF export MPI_SITEARCH=$MPI_PYTHON2_SITEARCH %{dobuild} export MPI_COMPILE_TYPE='-py3' export PYTHON_BIN="%{__python3}" export MPI_SITEARCH=$MPI_PYTHON3_SITEARCH %{dobuild} # Build mpich version %if %{with_mpich} %{_mpich_load} export MPI_COMPILE_TYPE=-mpich export CC=mpicc export CXX=mpicxx export FC=mpif90 export F77=mpif77 export MPI_YES=ON export PYTHON_BIN="%{__python2}" export MPI_SITEARCH=$MPI_PYTHON2_SITEARCH %{dobuild} export MPI_COMPILE_TYPE=-mpich-py3 export PYTHON_BIN="%{__python3}" export MPI_SITEARCH=$MPI_PYTHON3_SITEARCH %{dobuild} %{_mpich_unload} %endif # Build OpenMPI version %if %{with_openmpi} %{_openmpi_load} export MPI_COMPILE_TYPE=-openmpi export CC=mpicc export CXX=mpicxx export FC=mpif90 export F77=mpif77 export MPI_YES=ON export MPI_SITEARCH=$MPI_PYTHON2_SITEARCH export PYTHON_BIN="%{__python2}" %{dobuild} export MPI_COMPILE_TYPE=-openmpi-py3 export PYTHON_BIN="%{__python3}" export MPI_SITEARCH=$MPI_PYTHON3_SITEARCH %{dobuild} %{_openmpi_unload} %endif # Build doc cd %{name}-%{version}-git%{shortcommit0}/doc/ make doc cd .. %install %define doinstall() \ cd %{name}-%{version}-git%{shortcommit0}$MPI_COMPILE_TYPE ;\ make install DESTDIR=%{buildroot} INSTALL="install -p" CPPROG="cp -p" ;\ cd pynest ;\ $PYTHON_BIN setup.py install --skip-build --root %{buildroot} --install-lib=$MPI_SITEARCH ;\ cd ../topology ;\ $PYTHON_BIN setup.py install --skip-build --root %{buildroot} --install-lib=$MPI_SITEARCH ;\ cd ../extras/ConnPlotter ;\ $PYTHON_BIN setup.py install --skip-build --root %{buildroot} ;\ cd ../../.. ; # Build serial version, dummy arguments export PYTHON_BIN="%{__python2}" export MPI_SITEARCH="%{python2_sitearch}" export MPI_COMPILE_TYPE="" export MPI_COMPILER=serial export MPI_SUFFIX="" export MPI_HOME=%{_prefix} export MPI_BIN=%{_bindir} export MPI_YES=OFF %doinstall export MPI_COMPILE_TYPE='-py3' export MPI_SITEARCH="%{python3_sitearch}" export PYTHON_BIN="%{__python3}" %doinstall # Install MPICH version %if %{with_mpich} %{_mpich_load} export MPI_COMPILE_TYPE=-mpich export MPI_SITEARCH=$MPI_PYTHON2_SITEARCH export PYTHON_BIN="%{__python2}" %doinstall export MPI_COMPILE_TYPE=-mpich-py3 export MPI_SITEARCH=$MPI_PYTHON3_SITEARCH export PYTHON_BIN="%{__python3}" %doinstall %{_mpich_unload} mkdir -p -m 0755 %{buildroot}/%{_libdir}/mpich/lib/ mv %{buildroot}/%{_libdir}/mpich/lib64/* %{buildroot}/%{_libdir}/mpich/lib/ %endif # Install OpenMPI version %if %{with_openmpi} %{_openmpi_load} export MPI_COMPILE_TYPE=-openmpi export MPI_SITEARCH=$MPI_PYTHON2_SITEARCH export PYTHON_BIN="%{__python2}" %doinstall export MPI_COMPILE_TYPE=-openmpi-py3 export MPI_SITEARCH=$MPI_PYTHON3_SITEARCH export PYTHON_BIN="%{__python3}" %doinstall %{_openmpi_unload} mkdir -p -m 0755 %{buildroot}/%{_libdir}/openmpi/lib/ mv %{buildroot}/%{_libdir}/openmpi/lib64/* %{buildroot}/%{_libdir}/openmpi/lib/ %endif %files %license LICENSE %{_bindir}/%{name} %{_bindir}/sli %{_bindir}/%{name}_vars.sh %{_bindir}/%{name}_serial %{_bindir}/%{name}-config %{_bindir}/%{name}_indirect %{_libdir}/*.so %files common %{_datadir}/%{name} %files doc %doc %{_pkgdocdir} %files devel-doc %doc %{name}-%{version}-git%{shortcommit0}/doc/doxygen/html %files -n pynest %{python2_sitearch}/%{name} %{python2_sitearch}/PyNEST-%{version}-py2.?.egg-info %{python2_sitearch}/Topology-%{version}-py2.?.egg-info %files -n python3-pynest %{python3_sitearch}/%{name} %{python3_sitearch}/PyNEST-%{version}-py3.?.egg-info %{python3_sitearch}/Topology-%{version}-py3.?.egg-info %files -n python2-connplotter %{python2_sitelib}/ConnPlotter %{python2_sitelib}/ConnPlotter-0.7a-py2.?.egg-info %files -n python3-connplotter %{python3_sitelib}/ConnPlotter %{python3_sitelib}/ConnPlotter-0.7a-py3.?.egg-info %if %{with_mpich} %files mpich %license LICENSE %{_libdir}/mpich/bin/%{name} %{_libdir}/mpich/bin/%{name}_vars.sh %{_libdir}/mpich/bin/%{name}_serial %{_libdir}/mpich/bin/%{name}-config %{_libdir}/mpich/bin/%{name}_indirect %{_libdir}/mpich/bin/sli %{_libdir}/mpich/lib/ %files mpich-doc %{_libdir}/mpich/share/doc/%{name} %files mpich-common %{_libdir}/mpich/share/%{name} %files -n pynest-mpich %license LICENSE %{python2_sitearch}/mpich/%{name} %{python2_sitearch}/mpich/PyNEST-%{version}-py2.?.egg-info %{python2_sitearch}/mpich/Topology-%{version}-py2.?.egg-info %files -n python3-pynest-mpich %license LICENSE %{python3_sitearch}/mpich/%{name} %{python3_sitearch}/mpich/PyNEST-%{version}-py3.?.egg-info %{python3_sitearch}/mpich/Topology-%{version}-py3.?.egg-info %endif %if %{with_openmpi} %files openmpi %license LICENSE %{_libdir}/openmpi/bin/%{name} %{_libdir}/openmpi/bin/%{name}_vars.sh %{_libdir}/openmpi/bin/%{name}_serial %{_libdir}/openmpi/bin/%{name}-config %{_libdir}/openmpi/bin/%{name}_indirect %{_libdir}/openmpi/bin/sli %{_libdir}/openmpi/lib/ %files openmpi-doc %{_libdir}/openmpi/share/doc/%{name} %files openmpi-common %{_libdir}/openmpi/share/%{name} %files -n pynest-openmpi %license LICENSE %{python2_sitearch}/openmpi/%{name} %{python2_sitearch}/openmpi/PyNEST-%{version}-py2.?.egg-info %{python2_sitearch}/openmpi/Topology-%{version}-py2.?.egg-info %files -n python3-pynest-openmpi %license LICENSE %{python3_sitearch}/openmpi/%{name} %{python3_sitearch}/openmpi/PyNEST-%{version}-py3.?.egg-info %{python3_sitearch}/openmpi/Topology-%{version}-py3.?.egg-info %endif %changelog * Mon Apr 25 2016 Ankur Sinha 2.10.0-22.git79b2f01 - Update to latest commit - test tammioppen changes * Mon Apr 25 2016 Ankur Sinha 2.10.0-21.git58fcecb - Update to latest commit