From c9aab32e77c75c9b1a42f312fa2b5b648deebe61 Mon Sep 17 00:00:00 2001 From: Ankur Sinha (Ankur Sinha Gmail) Date: Aug 19 2018 13:24:24 +0000 Subject: Initial import --- diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..b463428 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +/nest-2.14.0.tar.gz diff --git a/nest-0000-disable-python-build-install.patch b/nest-0000-disable-python-build-install.patch new file mode 100644 index 0000000..831da83 --- /dev/null +++ b/nest-0000-disable-python-build-install.patch @@ -0,0 +1,81 @@ +diff --git a/extras/ConnPlotter/CMakeLists.txt b/extras/ConnPlotter/CMakeLists.txt +index 1f7c2b32..53be3fe1 100644 +--- a/extras/ConnPlotter/CMakeLists.txt ++++ b/extras/ConnPlotter/CMakeLists.txt +@@ -18,14 +18,14 @@ + # along with NEST. If not, see . + + if ( HAVE_PYTHON ) +- install( CODE "execute_process( +- COMMAND ${PYTHON} setup.py build --build-base=${CMAKE_CURRENT_BINARY_DIR}/build +- install --prefix=${CMAKE_INSTALL_PREFIX} +- --install-lib=${CMAKE_INSTALL_PREFIX}/${PYEXECDIR} +- --install-scripts=${CMAKE_INSTALL_FULL_BINDIR} +- --install-data=${CMAKE_INSTALL_FULL_DATADIR} +- WORKING_DIRECTORY \"${CMAKE_CURRENT_SOURCE_DIR}\")" +- ) ++ # install( CODE "execute_process( ++ # COMMAND ${PYTHON} setup.py build --build-base=${CMAKE_CURRENT_BINARY_DIR}/build ++ # install --prefix=${CMAKE_INSTALL_PREFIX} ++ # --install-lib=${CMAKE_INSTALL_PREFIX}/${PYEXECDIR} ++ # --install-scripts=${CMAKE_INSTALL_FULL_BINDIR} ++ # --install-data=${CMAKE_INSTALL_FULL_DATADIR} ++ # WORKING_DIRECTORY \"${CMAKE_CURRENT_SOURCE_DIR}\")" ++ # ) + + install( FILES examples/connplotter_tutorial.py + DESTINATION ${CMAKE_INSTALL_DOCDIR}/examples/ConnPlotter +diff --git a/pynest/CMakeLists.txt b/pynest/CMakeLists.txt +index 76482e01..0fc0c126 100644 +--- a/pynest/CMakeLists.txt ++++ b/pynest/CMakeLists.txt +@@ -72,14 +72,14 @@ if ( HAVE_PYTHON ) + -D_IS_PYNEST + ) + +- install( CODE "execute_process( +- COMMAND ${PYTHON} setup.py build --build-base=${CMAKE_CURRENT_BINARY_DIR}/build +- install --prefix=${CMAKE_INSTALL_PREFIX} +- --install-lib=${CMAKE_INSTALL_PREFIX}/${PYEXECDIR} +- --install-scripts=${CMAKE_INSTALL_FULL_BINDIR} +- --install-data=${CMAKE_INSTALL_FULL_DATADIR} +- WORKING_DIRECTORY \"${CMAKE_CURRENT_BINARY_DIR}\")" +- ) ++ # install( CODE "execute_process( ++ # COMMAND ${PYTHON} setup.py build --build-base=${CMAKE_CURRENT_BINARY_DIR}/build ++ # install --prefix=${CMAKE_INSTALL_PREFIX} ++ # --install-lib=${CMAKE_INSTALL_PREFIX}/${PYEXECDIR} ++ # --install-scripts=${CMAKE_INSTALL_FULL_BINDIR} ++ # --install-data=${CMAKE_INSTALL_FULL_DATADIR} ++ # WORKING_DIRECTORY \"${CMAKE_CURRENT_BINARY_DIR}\")" ++ # ) + install( TARGETS pynestkernel DESTINATION ${PYEXECDIR}/nest/ ) + install( FILES ${PROJECT_BINARY_DIR}/pynest/do_tests.py + DESTINATION ${CMAKE_INSTALL_DATADIR}/extras +diff --git a/topology/CMakeLists.txt b/topology/CMakeLists.txt +index da4fb703..3b9848e3 100644 +--- a/topology/CMakeLists.txt ++++ b/topology/CMakeLists.txt +@@ -81,14 +81,14 @@ install( FILES ${topo_mpitests} + ) + + if ( HAVE_PYTHON ) +- install( CODE "execute_process( +- COMMAND ${PYTHON} setup.py build --build-base=${CMAKE_CURRENT_BINARY_DIR}/build +- install --prefix=${CMAKE_INSTALL_PREFIX} +- --install-lib=${CMAKE_INSTALL_PREFIX}/${PYEXECDIR} +- --install-scripts=${CMAKE_INSTALL_FULL_BINDIR} +- --install-data=${CMAKE_INSTALL_FULL_DATADIR} +- WORKING_DIRECTORY \"${CMAKE_CURRENT_BINARY_DIR}\")" +- ) ++ # install( CODE "execute_process( ++ # COMMAND ${PYTHON} setup.py build --build-base=${CMAKE_CURRENT_BINARY_DIR}/build ++ # install --prefix=${CMAKE_INSTALL_PREFIX} ++ # --install-lib=${CMAKE_INSTALL_PREFIX}/${PYEXECDIR} ++ # --install-scripts=${CMAKE_INSTALL_FULL_BINDIR} ++ # --install-data=${CMAKE_INSTALL_FULL_DATADIR} ++ # WORKING_DIRECTORY \"${CMAKE_CURRENT_BINARY_DIR}\")" ++ # ) + + file( GLOB topo_examples "examples/*" ) + install( FILES ${topo_examples} diff --git a/nest-0001-disable-helpindex-update.patch b/nest-0001-disable-helpindex-update.patch new file mode 100644 index 0000000..7fffedc --- /dev/null +++ b/nest-0001-disable-helpindex-update.patch @@ -0,0 +1,23 @@ +diff --git a/doc/CMakeLists.txt b/doc/CMakeLists.txt +index 58c8d422..1db8759f 100644 +--- a/doc/CMakeLists.txt ++++ b/doc/CMakeLists.txt +@@ -47,12 +47,12 @@ if ( NOT CMAKE_CROSSCOMPILING ) + ) + # Update the global help index to contain all help files that are + # located in the global installation directory for documentation. +- install( CODE +- "execute_process( +- COMMAND ${PYTHON_EXECUTABLE} -B generate_helpindex.py \"${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_DOCDIR}\" +- WORKING_DIRECTORY \"${PROJECT_SOURCE_DIR}/extras/help_generator\" +- )" +- ) ++ # install( CODE ++ # "execute_process( ++ # COMMAND ${PYTHON_EXECUTABLE} -B generate_helpindex.py \"${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_DOCDIR}\" ++ # WORKING_DIRECTORY \"${PROJECT_SOURCE_DIR}/extras/help_generator\" ++ # )" ++ # ) + endif () + + endif () diff --git a/nest.spec b/nest.spec new file mode 100644 index 0000000..b97b772 --- /dev/null +++ b/nest.spec @@ -0,0 +1,742 @@ +# 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. + +# We do not build the developer documentation with doxygen. Advanced developers +# that develop based on the source git tree can build it themselves +# Switch them off if you want +%global with_mpich 1 +%global with_openmpi 1 + +%global run_tests 0 + +Name: nest +Version: 2.14.0 + +%global gittag v%{version} + +Release: 4%{?dist} +Summary: The neural simulation tool + +License: GPLv2+ +URL: http://www.nest-simulator.org/ +Source0: https://github.com/%{name}/%{name}-simulator/archive/%{gittag}/%{name}-%{version}.tar.gz + +# Let it build and install the cythonised shared object +# But we still build our python modules ourselves +Patch0: %{name}-0000-disable-python-build-install.patch + +# the helpindex must be generated after the help files have been installed to +# the install location, so we do this manually because the script doesn't +# respect rpmbuildroot and so on +Patch1: %{name}-0001-disable-helpindex-update.patch + +BuildRequires: ncurses-devel +BuildRequires: gsl-devel +BuildRequires: readline-devel +BuildRequires: python2-devel +BuildRequires: python2-Cython +BuildRequires: python2-nose +BuildRequires: python3-devel +BuildRequires: python3-Cython +BuildRequires: python3-nose +BuildRequires: libtool-ltdl-devel +BuildRequires: cmake +BuildRequires: libtool +BuildRequires: doxygen +BuildRequires: graphviz +BuildRequires: gcc-c++ +Requires: %{name}-common + +%global _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. \ +Please read the README.Fedora file provided in each package for information on \ +how these NEST packages are to be used. + +%description +%{_description} + +%package common +BuildArch: noarch +Summary: Common files for %{name} + +%description common +%{_description} + +%package doc +BuildArch: noarch +Summary: Documentation for %{name} + +%description doc +%{_description} + + +%package -n python2-%{name} +Summary: Python2 bindings for nest +Requires: %{name} = %{version}-%{release} +Requires: %{name}-common = %{version}-%{release} +Requires: %{py2_dist numpy} %{py2_dist scipy} %{py2_dist matplotlib} %{py2_dist ipython} +%{?python_provide:%python_provide python2-%{name}} + +%description -n python2-%{name} +%{_description} + + +%package -n python3-%{name} +Summary: Python3 bindings for nest +Requires: %{name} = %{version}-%{release} +Requires: %{name}-common = %{version}-%{release} +Requires: %{py3_dist numpy} %{py3_dist scipy} %{py3_dist matplotlib} %{py3_dist ipython} +%{?python_provide:%python_provide python3-%{name}} + +%description -n python3-%{name} +%{_description} + +%if %{with_openmpi} +%package openmpi +Summary: %{name} built with openmpi +BuildRequires: openmpi-devel +BuildRequires: rpm-mpi-hooks +Requires: openmpi +Requires: %{name}-openmpi-common = %{version}-%{release} + +%description openmpi +%{_description} + +%package openmpi-common +Summary: Common files for %{name} built with openmpi support + +%description openmpi-common +%{_description} + +%package -n python2-%{name}-openmpi +Summary: Python2 bindings for nest with openmpi support +BuildRequires: rpm-mpi-hooks +Requires: openmpi +Requires: %{name}-openmpi = %{version}-%{release} +Requires: %{name}-openmpi-common = %{version}-%{release} +Requires: %{py2_dist numpy} %{py2_dist scipy} %{py2_dist matplotlib} %{py2_dist ipython} +%{?python_provide:%python_provide python2-%{name}-openmpi} + +%description -n python2-%{name}-openmpi +%{_description} + +%package -n python3-%{name}-openmpi +Summary: Python3 bindings for nest with openmpi support +BuildRequires: rpm-mpi-hooks +Requires: openmpi +Requires: %{name}-openmpi = %{version}-%{release} +Requires: %{name}-openmpi-common = %{version}-%{release} +Requires: %{py3_dist numpy} %{py3_dist scipy} %{py3_dist matplotlib} %{py3_dist ipython} +%{?python_provide:%python_provide python3-%{name}-openmpi} + +%description -n python3-%{name}-openmpi +%{_description} +%endif + +%if %{with_mpich} +%package mpich +Summary: %{name} built with mpich +BuildRequires: mpich-devel +BuildRequires: rpm-mpi-hooks +Requires: mpich +Requires: %{name}-mpich-common = %{version}-%{release} + +%description mpich +%{_description} + +%package mpich-common +Summary: Common files for %{name} built with mpich support + +%description mpich-common +%{_description} + +%package -n python2-%{name}-mpich +Summary: Python2 bindings for nest with mpich support +BuildRequires: rpm-mpi-hooks +Requires: %{name}-mpich = %{version}-%{release} +Requires: %{name}-mpich-common = %{version}-%{release} +Requires: mpich +Requires: %{py2_dist numpy} %{py2_dist scipy} %{py2_dist matplotlib} %{py2_dist ipython} +%{?python_provide:%python_provide python2-%{name}-mpich} + +%description -n python2-%{name}-mpich +%{_description} + +%package -n python3-%{name}-mpich +Summary: Python3 bindings for nest with mpich support +BuildRequires: rpm-mpi-hooks +Requires: %{name}-mpich = %{version}-%{release} +Requires: %{name}-mpich-common = %{version}-%{release} +Requires: mpich +Requires: %{py3_dist numpy} %{py3_dist scipy} %{py3_dist matplotlib} %{py3_dist ipython} +%{?python_provide:%python_provide python3-%{name}-mpich} + +%description -n python3-%{name}-mpich +%{_description} +%endif + +%prep +%autosetup -n %{name}-simulator-%{version} -p1 + +cat << EOF > README.Fedora + +The Fedora packages of the NEST simulator are built to cover various +configurations and installs their files in the standard locations: + +- nest: NEST simulator without MPI support +- python2-nest: PyNEST for Python 2 without MPI support +- python3-nest: PyNEST for Python 3 without MPI support + +- nest-mpich: NEST simulator build with MPICH support +- python2-nest-mpich: PyNEST for Python 2 with MPICH support +- python3-nest-mpich: PyNEST for Python 3 with MPICH support + +- nest-openmpi: NEST simulator build with OpenMPI support +- python2-nest-openmpi: PyNEST for Python 2 with OpenMPI support +- python3-nest-openmpi: PyNEST for Python 3 with OpenMPI support + +Usage +----- + +The nest_vars.sh must be sourced to set up the environment correctly for NEST, +which makes use of a few environment variables: + +- NEST_INSTALL_DIR +- NEST_DATA_DIR +- NEST_MODULE_PATH +- NEST_PYTHON_PREFIX +- NEST_DOC_DIR + +The nest_vars.sh file is located in: + +For MPICH builds: + +source /usr/lib{,64}/mpich/bin/nest_vars.sh + +For OpenMPI builds: +source /usr/lib{,64}/openmpi/bin/nest_vars.sh + + +For non MPI builds: +source /usr/bin/nest_vars.sh + +To use an MPI build of NEST, one must also load the appropriate module. +For MPICH builds: + +module load mpi/mpich-{i686,x86_64} + +For OpenMPI builds: + +module load mpi/openmpi-{i686,x86_64} + +It is generally easier to add these lines to the ~/.bashrc file (for bash +users) so that these commands are automatically run on each login. + + +Documentation +------------- +The generated documentation is provided in the nest-doc package, and is common +for all builds. + +EOF + +# We'll set it ourselves - easier for mpi implementations +sed -i.orig '/PYEXECDIR/ d' cmake/ProcessOptions.cmake +# These files are all in standard locations so we don't need them +# Loading an MPI module sets up PATH correctly +sed -i '/PATH=/ d' extras/nest_vars.sh.in +# Set the correct PYTHONPATH using nest_vars.sh +# loading an MPI module DOES NOT seem to set the python path +sed -i 's|NEST_PYTHON_PREFIX=$NEST_INSTALL_DIR/@PYEXECDIR@|NEST_PYTHON_PREFIX=@PYEXECDIR@|' extras/nest_vars.sh.in + +cd ../ +cp -a %{name}-simulator-%{version} %{name}-simulator-%{version}-py3 +# Don't generate docs for each build +sed -i '/add_subdirectory.*doc/ d' %{name}-simulator-%{version}-py3/CMakeLists.txt +sed -i '/add_subdirectory.*examples/ d' %{name}-simulator-%{version}-py3/CMakeLists.txt + +%if %{with_mpich} + cp -a %{name}-simulator-%{version} %{name}-simulator-%{version}-mpich + cp -a %{name}-simulator-%{version} %{name}-simulator-%{version}-mpich-py3 + + # Don't generate docs for each build + sed -i '/add_subdirectory.*doc/ d' %{name}-simulator-%{version}-mpich/CMakeLists.txt + sed -i '/add_subdirectory.*doc/ d' %{name}-simulator-%{version}-mpich-py3/CMakeLists.txt + # Don't install examples and extras for each + sed -i '/add_subdirectory.*examples/ d' %{name}-simulator-%{version}-mpich/CMakeLists.txt + sed -i '/add_subdirectory.*examples/ d' %{name}-simulator-%{version}-mpich-py3/CMakeLists.txt + # Don't install tests in docdir either + sed -i '/add_subdirectory.*testsuite/ d' %{name}-simulator-%{version}-mpich/CMakeLists.txt + sed -i '/add_subdirectory.*testsuite/ d' %{name}-simulator-%{version}-mpich-py3/CMakeLists.txt +%endif + +%if %{with_openmpi} + cp -a %{name}-simulator-%{version} %{name}-simulator-%{version}-openmpi + cp -a %{name}-simulator-%{version} %{name}-simulator-%{version}-openmpi-py3 + + # Don't generate docs for these + sed -i '/add_subdirectory.*doc/ d' %{name}-simulator-%{version}-openmpi/CMakeLists.txt + sed -i '/add_subdirectory.*doc/ d' %{name}-simulator-%{version}-openmpi-py3/CMakeLists.txt + # Don't install examples and extras for each + sed -i '/add_subdirectory.*examples/ d' %{name}-simulator-%{version}-openmpi/CMakeLists.txt + sed -i '/add_subdirectory.*examples/ d' %{name}-simulator-%{version}-openmpi-py3/CMakeLists.txt + # Don't install tests in docdir either + sed -i '/add_subdirectory.*testsuite/ d' %{name}-simulator-%{version}-openmpi/CMakeLists.txt + sed -i '/add_subdirectory.*testsuite/ d' %{name}-simulator-%{version}-openmpi-py3/CMakeLists.txt +%endif + +# So that we can install it easily for all sub packages +cp %{name}-simulator-%{version}/LICENSE ./ + +%build +cd ../ + +%global do_cmake_config \ +echo \ +echo "*** BUILDING %{name}-simulator-%{version}$MPI_COMPILE_TYPE ***" \ +echo \ +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}" \ +pushd %{name}-simulator-%{version}$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} \\\ + -DCMAKE_SKIP_RPATH:BOOL=ON \\\ + -Dwith-mpi:BOOL=$MPI_YES \\\ + -Dwith-gsl:BOOL=ON \\\ + -Dwith-python:STRING=$PYTHON_VERSION \\\ + -DPYEXECDIR:PATH=$MPI_SITEARCH \\\ + -DCMAKE_INSTALL_PREFIX:PATH=$MPI_HOME \\\ + -DBUILD_SHARED_LIBS:BOOL=ON \\\ +%if "%{_lib}" == "lib64" \ + -DLIB_SUFFIX=64 && \ +%else \ + -DLIB_SUFFIX="" && \ +%endif \ +popd || exit -1; + +%global do_make_build \ + make %{?_smp_mflags} -C %{name}-simulator-%{version}$MPI_COMPILE_TYPE || exit -1 + +%global do_pybuild \ +pushd %{name}-simulator-%{version}$MPI_COMPILE_TYPE && \ + pushd pynest && \ + CFLAGS="%{optflags}" $PYTHON_BIN setup.py build \ + popd && \ + pushd topology && \ + CFLAGS="%{optflags}" $PYTHON_BIN setup.py build \ + popd && \ + pushd extras/ConnPlotter && \ + CFLAGS="%{optflags}" $PYTHON_BIN setup.py build \ + popd && \ +popd || exit -1; + +# Build serial version, dummy arguments +# Python 2 +export PYTHON_VERSION="2" +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 +%{do_cmake_config} +%{do_make_build} +%{do_pybuild} + +# Python 3 +export MPI_COMPILE_TYPE='-py3' +export PYTHON_VERSION="3" +export PYTHON_BIN="%{__python3}" +export MPI_SITEARCH=$MPI_PYTHON3_SITEARCH +%{do_cmake_config} +%{do_make_build} +%{do_pybuild} + +# Build mpich version +# Python 2 +%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_VERSION="2" +export PYTHON_BIN="%{__python2}" +export MPI_SITEARCH=$MPI_PYTHON2_SITEARCH +%{do_cmake_config} +%{do_make_build} +%{do_pybuild} + +# Python 3 +export MPI_COMPILE_TYPE=-mpich-py3 +export PYTHON_VERSION="3" +export PYTHON_BIN="%{__python3}" +export MPI_SITEARCH=$MPI_PYTHON3_SITEARCH +%{do_cmake_config} +%{do_make_build} +%{do_pybuild} + +%{_mpich_unload} +%endif + +# Build OpenMPI version +%if %{with_openmpi} +%{_openmpi_load} +# Python 2 +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_VERSION="2" +export PYTHON_BIN="%{__python2}" +%{do_cmake_config} +%{do_make_build} +%{do_pybuild} + +# Python 3 +export MPI_COMPILE_TYPE=-openmpi-py3 +export PYTHON_VERSION="3" +export PYTHON_BIN="%{__python3}" +export MPI_SITEARCH=$MPI_PYTHON3_SITEARCH +%{do_cmake_config} +%{do_make_build} +%{do_pybuild} + +%{_openmpi_unload} +%endif + +%install +cd ../ + +%global do_install \ +echo \ +echo "*** INSTALLING %{name}-simulator-%{version}$MPI_COMPILE_TYPE ***" \ +echo \ + make install DESTDIR=$RPM_BUILD_ROOT INSTALL="install -p" CPPROG="cp -p" -C %{name}-simulator-%{version}$MPI_COMPILE_TYPE || exit -1 + + +%global do_pynestkernel_install \ +pushd %{name}-simulator-%{version}$MPI_COMPILE_TYPE && \ + pushd pynest && \ + install -m 0755 -p -D -t $RPM_BUILD_ROOT/$MPI_SITEARCH/%{name} pynestkernel.so \ + popd && \ +popd || exit -1; + +%global do_pyinstall \ +pushd %{name}-simulator-%{version}$MPI_COMPILE_TYPE && \ + pushd pynest && \ + $PYTHON_BIN setup.py install --skip-build --root $RPM_BUILD_ROOT --install-lib=$MPI_SITEARCH && \ + popd && \ + pushd topology && \ + $PYTHON_BIN setup.py install --skip-build --root $RPM_BUILD_ROOT --install-lib=$MPI_SITEARCH && \ + popd && \ + pushd extras/ConnPlotter && \ + $PYTHON_BIN setup.py install --skip-build --root $RPM_BUILD_ROOT && \ + popd && \ +popd || exit -1; + + +# install serial version +export MPI_SUFFIX="" +export MPI_HOME=%{_prefix} +export MPI_BIN=%{_bindir} +export MPI_YES=OFF +# Python 2 +export MPI_COMPILE_TYPE="" +export MPI_SITEARCH="%{python2_sitearch}" +export PYTHON_BIN="%{__python2}" +export MPI_COMPILER=serial +%{do_install} +%{do_pyinstall} +# Python 3 +export MPI_COMPILE_TYPE='-py3' +export MPI_SITEARCH="%{python3_sitearch}" +export PYTHON_BIN="%{__python3}" +%{do_pynestkernel_install} +%{do_pyinstall} + +# Update the helpindex manually +# Should this go in %%post of the doc package maybe? +pushd %{name}-simulator-%{version}/extras/help_generator + %{__python2} -B generate_helpindex.py $RPM_BUILD_ROOT/%{_docdir}/%{name}/ +popd + +# Install MPICH version +%if %{with_mpich} +%{_mpich_load} +# Python 2 +export MPI_COMPILE_TYPE='-mpich' +export MPI_SITEARCH=$MPI_PYTHON2_SITEARCH +export PYTHON_BIN="%{__python2}" +%{do_install} +%{do_pyinstall} +# Python 3 +export MPI_COMPILE_TYPE='-mpich-py3' +export MPI_SITEARCH=$MPI_PYTHON3_SITEARCH +export PYTHON_BIN="%{__python3}" +%{do_pynestkernel_install} +%{do_pyinstall} + +# Remove duplicated docs +rm -rf $RPM_BUILD_ROOT/%{_libdir}/mpich/share/doc/%{name} +# Remove unneeded scripts +rm -rf $RPM_BUILD_ROOT/%{_libdir}/mpich/share/%{name}/{extras,help_generator} + +# Place in correct mpi libdir +%if %{_lib} == lib64 + mv -v $RPM_BUILD_ROOT/%{_libdir}/mpich/lib64 $RPM_BUILD_ROOT/$MPI_LIB/ +%endif +%{_mpich_unload} +%endif + +# Install OpenMPI version +%if %{with_openmpi} +%{_openmpi_load} +# Python 2 +export MPI_COMPILE_TYPE='-openmpi' +export MPI_SITEARCH=$MPI_PYTHON2_SITEARCH +export PYTHON_BIN="%{__python2}" +%{do_install} +%{do_pyinstall} +# Python 3 +export MPI_COMPILE_TYPE='-openmpi-py3' +export MPI_SITEARCH=$MPI_PYTHON3_SITEARCH +export PYTHON_BIN="%{__python3}" +%{do_pynestkernel_install} +%{do_pyinstall} + +# Remove duplicated docs +rm -rf $RPM_BUILD_ROOT/%{_libdir}/openmpi/share/doc/%{name} +# Remove duplicated scripts +rm -rf $RPM_BUILD_ROOT/%{_libdir}/openmpi/share/%{name}/{extras,help_generator} + +%if %{_lib} == lib64 + mv -v $RPM_BUILD_ROOT/%{_libdir}/openmpi/lib64 $RPM_BUILD_ROOT/$MPI_LIB/ +%endif +%{_openmpi_unload} +%endif + + +%if %{run_tests} +%check +cd ../ + +%global do_tests \ +echo \ +echo "*** TESTING %{name}-simulator-%{version}$MPI_COMPILE_TYPE ***" \ +echo \ +source $RPM_BUILD_ROOT/$NEST_BINDIR/nest_vars.sh \ +export NEST_DOC_DIR=$RPM_BUILD_ROOT/$NEST_DOC_DIR +export NEST_DATA_DIR=$RPM_BUILD_ROOT/$NEST_DATA_DIR +PATH=$RPM_BUILD_ROOT/$NEST_BINDIR/:$PATH $RPM_BUILD_ROOT/$NEST_DATA_DIR/extras/do_tests.sh --source-dir=SKIP \ +nosetests $NEST_PYTHONDIR/nest/tests $NEST_PYTHONDIR/nest/topology/tests + +# No sli suite here, since we didn't build it for py3 +%global do_tests_3 \ +echo \ +echo "*** TESTING %{name}-simulator-%{version}$MPI_COMPILE_TYPE ***" \ +echo \ +nosetests-3 $NEST_PYTHONDIR/nest/tests $NEST_PYTHONDIR/nest/topology/tests + + +# override MPI_BIN +export MPI_COMPILE_TYPE="" +export NEST_BINDIR="%{_bindir}" +export PYTHON_VERSION="2" +export PYTHON_BIN="%{__python2}" +export NEST_PYTHONDIR=%{python2_sitearch} +%{do_tests} + +export MPI_COMPILE_TYPE=-py3 +export NEST_BINDIR="%{_bindir}" +export PYTHON_VERSION="3" +export PYTHON_BIN="%{__python3}" +export NEST_PYTHONDIR=%{python3_sitearch} +%{do_tests_3} + +# Build mpich version +# Python 2 +%if %{with_mpich} +%{_mpich_load} +export MPI_COMPILE_TYPE=-mpich +export NEST_BINDIR=$MPI_BIN +export NEST_PYTHONDIR=$MPI_PYTHON2_SITEARCH +export PYTHON_VERSION="2" +export PYTHON_BIN="%{__python2}" +%{do_tests} + +# Python 3 +export MPI_COMPILE_TYPE=-mpich-py3 +export NEST_BINDIR=$MPI_BIN +export NEST_PYTHONDIR=$MPI_PYTHON3_SITEARCH +export PYTHON_VERSION="3" +export PYTHON_BIN="%{__python3}" +%{do_tests_3} + +%{_mpich_unload} +%endif + +# Build OpenMPI version +%if %{with_openmpi} +%{_openmpi_load} +# Python 2 +export MPI_COMPILE_TYPE=-openmpi +export MPI_SITEARCH=$MPI_PYTHON2_SITEARCH +export PYTHON_VERSION="2" +export PYTHON_BIN="%{__python2}" +%{do_tests} + +# Python 3 +export MPI_COMPILE_TYPE=-openmpi-py3 +export PYTHON_VERSION="3" +export PYTHON_BIN="%{__python3}" +export MPI_SITEARCH=$MPI_PYTHON3_SITEARCH +%{do_tests_3} + +%{_openmpi_unload} +%endif +%endif + +%files +%license LICENSE +%doc README.Fedora +%{_bindir}/%{name} +%{_bindir}/sli +%{_bindir}/%{name}_vars.sh +%{_bindir}/%{name}-config +%{_bindir}/%{name}_serial +%{_bindir}/%{name}_indirect +%{_libdir}/*.so + +%files common +%{_datadir}/%{name} + +%files doc +%doc %{_pkgdocdir} + +%files -n python2-%{name} +%{python2_sitearch}/%{name} +%{python2_sitearch}/PyNEST-%{version}-py2.?.egg-info +%{python2_sitearch}/Topology-%{version}-py2.?.egg-info +%{python2_sitelib}/ConnPlotter +%{python2_sitelib}/ConnPlotter-0.7a-py2.?.egg-info + +%files -n python3-%{name} +%{python3_sitearch}/%{name} +%{python3_sitearch}/PyNEST-%{version}-py3.?.egg-info +%{python3_sitearch}/Topology-%{version}-py3.?.egg-info +%{python3_sitelib}/ConnPlotter +%{python3_sitelib}/ConnPlotter-0.7a-py3.?.egg-info + +%if %{with_mpich} +%files mpich +%license LICENSE +%doc README.Fedora +%{_libdir}/mpich/bin/%{name} +%{_libdir}/mpich/bin/%{name}_vars.sh +%{_libdir}/mpich/bin/%{name}-config +%{_libdir}/mpich/bin/%{name}_serial +%{_libdir}/mpich/bin/%{name}_indirect +%{_libdir}/mpich/bin/sli +%{_libdir}/mpich/lib/ + +%files mpich-common +%{_libdir}/mpich/share/%{name} + +%files -n python2-%{name}-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-%{name}-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 +%doc README.Fedora +%{_libdir}/openmpi/bin/%{name} +%{_libdir}/openmpi/bin/%{name}_vars.sh +%{_libdir}/openmpi/bin/%{name}-config +%{_libdir}/openmpi/bin/%{name}_serial +%{_libdir}/openmpi/bin/%{name}_indirect +%{_libdir}/openmpi/bin/sli +%{_libdir}/openmpi/lib/ + +%files openmpi-common +%{_libdir}/openmpi/share/%{name} + +%files -n python2-%{name}-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-%{name}-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 +* Fri Jul 27 2018 Ankur Sinha - 2.14.0-4 +- Improve readme +- Disable tests for the time being while I check builds + +* Thu Jul 26 2018 Ankur Sinha - 2.14.0-3 +- Enable tests +- Use autosetup +- Improve description +- Improve make usage + +* Tue Jul 24 2018 Ankur Sinha - 2.14.0-2 +- Enable mpi builds +- Do not make mpi packages noarch, since MPI_HOME is arch dependent +- Do not remove nest config files---the environment variables are used by programs + +* Sun Jun 24 2018 Ankur Sinha - 2.14.0-1 +- Update to latest release +- remove developer docs +- fix build +- improve commands + +* 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 diff --git a/sources b/sources new file mode 100644 index 0000000..8576bfb --- /dev/null +++ b/sources @@ -0,0 +1 @@ +SHA512 (nest-2.14.0.tar.gz) = 968efa6877677a76da8fb24b4584f333dc22ae46f1f3b7daed705f7fae21d77d8bc07732dc121157b676b5f2f0ad39146be2418826193406a3ab7ffcbb65406a