|
|
c703909 |
# This is a serial build of NEURON
|
|
|
8e88850 |
%global _description %{expand:
|
|
|
b412848 |
NEURON is a simulation environment for modeling individual neurons and networks
|
|
|
b412848 |
of neurons. It provides tools for conveniently building, managing, and using
|
|
|
b412848 |
models in a way that is numerically sound and computationally efficient. It is
|
|
|
b412848 |
particularly well-suited to problems that are closely linked to experimental
|
|
|
b412848 |
data, especially those that involve cells with complex anatomical and
|
|
|
b412848 |
biophysical properties.
|
|
|
b412848 |
|
|
|
e1d5a31 |
Please install the %{name}-devel package to compile nmodl files, and please
|
|
|
e1d5a31 |
install the MPI specific sub-packages for MPICH and OpenMPI builds.
|
|
|
b412848 |
}
|
|
|
b412848 |
|
|
|
b412848 |
%global tarname nrn
|
|
|
b412848 |
|
|
|
b412848 |
# fails somehow, disabled by default
|
|
|
b412848 |
%bcond_with metis
|
|
|
b412848 |
|
|
|
c703909 |
# Music support
|
|
|
c703909 |
%bcond_with music
|
|
|
c703909 |
|
|
|
9bd556b |
%bcond_without mpich
|
|
|
a563fb8 |
%bcond_without openmpi
|
|
|
9bd556b |
|
|
|
b412848 |
Name: neuron
|
|
|
965356c |
Version: 8.2.2
|
|
|
032b020 |
Release: %autorelease
|
|
|
b412848 |
Summary: A flexible and powerful simulator of neurons and networks
|
|
|
b412848 |
|
|
|
b412848 |
License: GPLv3+
|
|
|
b412848 |
URL: http://www.neuron.yale.edu/neuron/
|
|
|
c703909 |
Source0: https://github.com/neuronsimulator/%{tarname}/archive/%{version}/%{name}-%{version}.tar.gz
|
|
|
b412848 |
|
|
|
57d58b5 |
# they bundle HPC coding conventions as a git submodule
|
|
|
965356c |
%global conv_git_commit 5d4bcd2d410e67bdc1d23d3280c08ee5c9df943b
|
|
|
57d58b5 |
%global conv_short_commit %(c=%{conv_git_commit}; echo ${c:0:7})
|
|
|
57d58b5 |
Source1: https://github.com/BlueBrain/hpc-coding-conventions/archive/%{conv_git_commit}/hpc-coding-conventions-%{conv_short_commit}.tar.gz
|
|
|
57d58b5 |
|
|
|
965356c |
%global rxd_tests_commit 2a08564a45fac78f259d23203d737db924c224c8
|
|
|
57d58b5 |
%global rxd_short_commit %(c=%{rxd_tests_commit}; echo ${c:0:7})
|
|
|
57d58b5 |
Source2: https://github.com/neuronsimulator/rxdtestdata/archive/%{rxd_tests_commit}/rxdtestdata-%{rxd_short_commit}.tar.gz
|
|
|
57d58b5 |
|
|
|
57d58b5 |
|
|
|
b412848 |
Patch0: 0001-Unbundle-Random123.patch
|
|
|
b412848 |
# libstdc++ bundled is from 1988: seems heavily modified. Headers from there
|
|
|
b412848 |
# are not present in the current version
|
|
|
b412848 |
# https://github.com/neuronsimulator/nrn/issues/145
|
|
|
b087e1f |
|
|
|
b087e1f |
# Use system copy of Catch
|
|
|
b087e1f |
Patch1: 0002-Unbundle-catch.patch
|
|
|
b087e1f |
# We install the python bits ourselves
|
|
|
b087e1f |
Patch2: 0003-Disable-python-build-and-install.patch
|
|
|
b087e1f |
# Set soversions for all shared objects
|
|
|
b087e1f |
Patch3: 0004-Set-soversions-for-libs.patch
|
|
|
0cc9008 |
# Set the right path for libdir
|
|
|
0cc9008 |
# Upstreamable
|
|
|
0cc9008 |
Patch4: 0005-Correct-librxdmath-path-for-64bit.patch
|
|
|
4c00d82 |
# stop build scripts from generating version during build
|
|
|
4c00d82 |
Patch5: 0006-Do-not-generate-version-info-at-buildtime.patch
|
|
|
577fa0d |
# Remove rpaths
|
|
|
577fa0d |
Patch6: 0007-Remove-rpaths.patch
|
|
|
57d58b5 |
# do not download data git submodule
|
|
|
57d58b5 |
Patch7: 0008-Dont-download-testdata-submodule.patch
|
|
|
e1d5a31 |
# place help file in correct location
|
|
|
e1d5a31 |
Patch8: 0009-Add-help-file-as-package-data.patch
|
|
|
965356c |
# tries to create /usr/x86_64 etc dirs
|
|
|
965356c |
Patch9: 0010-Remove-unneeded-symlinks.patch
|
|
|
ff17f0f |
# remove build time flags from the nrnmech makefile---it should not use these
|
|
|
ff17f0f |
Patch10: 0011-Strip-build-flags-from-nrnmech_makefile.patch
|
|
|
fbf7435 |
|
|
|
b412848 |
# Random123 does not build on these, so neither can NEURON
|
|
|
b412848 |
# https://github.com/neuronsimulator/nrn/issues/114
|
|
|
077de59 |
ExcludeArch: mips64r2 mips32r2
|
|
|
b412848 |
|
|
|
57d58b5 |
BuildRequires: make
|
|
|
b412848 |
BuildRequires: autoconf
|
|
|
b412848 |
BuildRequires: automake
|
|
|
b412848 |
BuildRequires: bison
|
|
|
b412848 |
BuildRequires: bison-devel
|
|
|
b087e1f |
BuildRequires: cmake
|
|
|
b087e1f |
BuildRequires: catch-devel
|
|
|
b087e1f |
# Needs to be packaged separately
|
|
|
b087e1f |
# BuildRequires: coreneuron-devel
|
|
|
b412848 |
BuildRequires: flex
|
|
|
cb64079 |
BuildRequires: (flex-devel or libfl-devel)
|
|
|
b412848 |
BuildRequires: gcc
|
|
|
b412848 |
BuildRequires: gcc-c++
|
|
|
8e88850 |
BuildRequires: git-core
|
|
|
b087e1f |
# the cmake build requires iv with cmake too
|
|
|
b087e1f |
BuildRequires: iv-devel >= 0.1
|
|
|
b412848 |
BuildRequires: libX11-devel
|
|
|
b087e1f |
BuildRequires: libXext-devel
|
|
|
b412848 |
BuildRequires: libtool
|
|
|
b412848 |
%if %{with metis}
|
|
|
b412848 |
BuildRequires: metis-devel
|
|
|
b412848 |
%endif
|
|
|
b412848 |
BuildRequires: ncurses-devel
|
|
|
b412848 |
BuildRequires: readline-devel
|
|
|
b412848 |
BuildRequires: Random123-devel
|
|
|
b412848 |
|
|
|
8e88850 |
# Bundles sundials. WIP
|
|
|
8e88850 |
# https://github.com/neuronsimulator/nrn/issues/113
|
|
|
8e88850 |
# BuildRequires: sundials-devel
|
|
|
8e88850 |
Provides: bundled(sundials) = 2.0.1
|
|
|
8e88850 |
|
|
|
8e88850 |
%description %_description
|
|
|
b412848 |
|
|
|
b412848 |
%package devel
|
|
|
b412848 |
Summary: Development files for %{name}
|
|
|
b412848 |
Requires: %{name}%{?_isa} = %{version}-%{release}
|
|
|
811d174 |
Requires: ncurses-devel
|
|
|
811d174 |
Requires: readline-devel
|
|
|
19c889e |
Requires: gcc-c++
|
|
|
5985701 |
Requires: libtool
|
|
|
19c889e |
Requires: libX11-devel
|
|
|
19c889e |
Requires: libXext-devel
|
|
|
9df0cd8 |
Requires: iv-devel
|
|
|
b412848 |
|
|
|
b412848 |
%description devel
|
|
|
b412848 |
Headers and development shared libraries for the %{name} package
|
|
|
b412848 |
|
|
|
b412848 |
%package doc
|
|
|
b412848 |
Summary: Documentation for %{name}
|
|
|
b412848 |
BuildArch: noarch
|
|
|
b412848 |
|
|
|
b412848 |
%description doc
|
|
|
b412848 |
Documentation for %{name}
|
|
|
b412848 |
|
|
|
c703909 |
%package -n python3-%{name}
|
|
|
c703909 |
Summary: Python3 interface to %{name}
|
|
|
c703909 |
Requires: %{name}%{?_isa} = %{version}-%{release}
|
|
|
c703909 |
BuildRequires: python3-devel
|
|
|
c703909 |
BuildRequires: python3-setuptools
|
|
|
c703909 |
BuildRequires: python3-Cython
|
|
|
b087e1f |
BuildRequires: python3-pytest
|
|
|
c703909 |
|
|
|
c703909 |
%description -n python3-%{name} %_description
|
|
|
c703909 |
|
|
|
9bd556b |
%if %{with mpich}
|
|
|
9bd556b |
%package mpich
|
|
|
9bd556b |
Summary: %{name} built with MPICH support
|
|
|
9bd556b |
BuildRequires: mpich-devel
|
|
|
9bd556b |
BuildRequires: rpm-mpi-hooks
|
|
|
9bd556b |
BuildRequires: python3-mpi4py-mpich
|
|
|
9bd556b |
|
|
|
9bd556b |
Requires: mpich
|
|
|
9bd556b |
Requires: python3-mpi4py-mpich
|
|
|
9bd556b |
|
|
|
9bd556b |
|
|
|
9bd556b |
%description mpich %_description
|
|
|
9bd556b |
|
|
|
9bd556b |
%package mpich-devel
|
|
|
9bd556b |
Summary: Development files for %{name}
|
|
|
9bd556b |
Requires: %{name}-mpich%{?_isa} = %{version}-%{release}
|
|
|
9bd556b |
|
|
|
9bd556b |
%description mpich-devel
|
|
|
9bd556b |
Headers and development shared libraries for the %{name} package
|
|
|
9bd556b |
|
|
|
9bd556b |
%package -n python3-%{name}-mpich
|
|
|
9bd556b |
Summary: Python3 interface to %{name}-mpich
|
|
|
9bd556b |
Requires: %{name}-mpich%{?_isa} = %{version}-%{release}
|
|
|
9bd556b |
|
|
|
57d58b5 |
%description -n python3-%{name}-mpich %_description
|
|
|
9bd556b |
%endif
|
|
|
b412848 |
|
|
|
a563fb8 |
%if %{with openmpi}
|
|
|
a563fb8 |
%package openmpi
|
|
|
a563fb8 |
Summary: %{name} built with OpenMPI support
|
|
|
a563fb8 |
BuildRequires: openmpi-devel
|
|
|
a563fb8 |
BuildRequires: rpm-mpi-hooks
|
|
|
a563fb8 |
BuildRequires: python3-mpi4py-openmpi
|
|
|
a563fb8 |
|
|
|
a563fb8 |
Requires: openmpi
|
|
|
a563fb8 |
Requires: python3-mpi4py-openmpi
|
|
|
a563fb8 |
|
|
|
a563fb8 |
|
|
|
a563fb8 |
%description openmpi %_description
|
|
|
a563fb8 |
|
|
|
a563fb8 |
%package openmpi-devel
|
|
|
a563fb8 |
Summary: Development files for %{name}
|
|
|
a563fb8 |
Requires: %{name}-openmpi%{?_isa} = %{version}-%{release}
|
|
|
a563fb8 |
|
|
|
a563fb8 |
%description openmpi-devel
|
|
|
a563fb8 |
Headers and development shared libraries for the %{name} package
|
|
|
a563fb8 |
|
|
|
a563fb8 |
%package -n python3-%{name}-openmpi
|
|
|
a563fb8 |
Summary: Python3 interface to %{name}-openmpi
|
|
|
a563fb8 |
Requires: %{name}-openmpi%{?_isa} = %{version}-%{release}
|
|
|
a563fb8 |
|
|
|
57d58b5 |
%description -n python3-%{name}-openmpi %_description
|
|
|
a563fb8 |
%endif
|
|
|
a563fb8 |
|
|
|
b412848 |
%prep
|
|
|
c703909 |
%autosetup -n %{tarname}-%{version} -S git
|
|
|
b412848 |
|
|
|
b412848 |
# Remove executable perms from source files
|
|
|
6597845 |
find src -type f -executable ! -name '*.sh' -exec chmod -x {} +
|
|
|
b412848 |
|
|
|
57d58b5 |
# remove shebangs: check again each release
|
|
|
57d58b5 |
pushd share/lib/auditscripts/
|
|
|
57d58b5 |
for f in *
|
|
|
57d58b5 |
do
|
|
|
57d58b5 |
sed -i -e "/^#!\/bin\/sh.*/ d" $f
|
|
|
57d58b5 |
done
|
|
|
57d58b5 |
popd
|
|
|
bcd0250 |
|
|
|
b412848 |
# Remove bundled Random123
|
|
|
b412848 |
rm -rf src/Random123
|
|
|
b412848 |
rm -rf src/readline
|
|
|
b412848 |
|
|
|
57d58b5 |
# extract coding convention tar
|
|
|
57d58b5 |
# can probably use setup macro etc.
|
|
|
57d58b5 |
pushd external/coding-conventions
|
|
|
57d58b5 |
cp %SOURCE1 .
|
|
|
57d58b5 |
tar -xvf hpc-coding-conventions*.tar.gz --strip-components=1
|
|
|
57d58b5 |
rm -f hpc-coding-conventions*.tar.gz
|
|
|
57d58b5 |
popd
|
|
|
57d58b5 |
|
|
|
57d58b5 |
# extract rxdtestdata tar
|
|
|
57d58b5 |
pushd test/rxd/testdata
|
|
|
57d58b5 |
cp %SOURCE2 .
|
|
|
57d58b5 |
tar -xvf rxdtestdata*.tar.gz --strip-components=1
|
|
|
57d58b5 |
rm -f rxdtestdata*.tar.gz
|
|
|
57d58b5 |
popd
|
|
|
57d58b5 |
|
|
|
b412848 |
# Create version file ourselves
|
|
|
4c00d82 |
# To create this, we run the git2version.sh script in a checked out copy of neuron
|
|
|
b412848 |
export TIMESTAMP=$(date +%Y-%m-%d)
|
|
|
b412848 |
cat > src/nrnoc/nrnversion.h << EOF
|
|
|
b412848 |
#define GIT_DATE "$TIMESTAMP"
|
|
|
b412848 |
#define GIT_BRANCH "master"
|
|
|
57d58b5 |
#define GIT_CHANGESET "f0ca745418e942ad4763bdc47459c409f0b11512"
|
|
|
57d58b5 |
#define GIT_DESCRIBE "8.0.2 (Fedora %{fedora})"
|
|
|
b412848 |
EOF
|
|
|
b412848 |
|
|
|
cb64079 |
# Stop system from using hard coded flags
|
|
|
cb64079 |
sed -i '/CompilerFlagsHelpers/ d' cmake/ReleaseDebugAutoFlags.cmake
|
|
|
cb64079 |
|
|
|
eea324b |
# Setting SETUPTOOLS_USE_DISTUTILS=stdlib does not work on Python 3.12
|
|
|
eea324b |
# https://github.com/neuronsimulator/nrn/issues/2263
|
|
|
eea324b |
#
|
|
|
eea324b |
# We change each occurrence to SETUPTOOLS_USE_DISTUTILS=local (the default).
|
|
|
eea324b |
# The find-then-modify pattern keeps us from discarding mtimes on any sources
|
|
|
eea324b |
# that do not need modification.
|
|
|
eea324b |
find . -type f -name 'CMakeLists.txt' -exec gawk \
|
|
|
eea324b |
'/export SETUPTOOLS_USE_DISTUTILS=stdlib/ { print FILENAME; nextfile }' \
|
|
|
eea324b |
'{}' '+' |
|
|
|
eea324b |
xargs -r -t sed -r -i 's/(export SETUPTOOLS_USE_DISTUTILS=)stdlib/\1local/'
|
|
|
eea324b |
|
|
|
b412848 |
%build
|
|
|
8e88850 |
# Not yet to be used
|
|
|
8e88850 |
# export SUNDIALS_SYSTEM_INSTALL="yes"
|
|
|
9bd556b |
%global do_build %{expand:
|
|
|
9bd556b |
echo
|
|
|
9bd556b |
echo "*** BUILDING %{name}-%{version}$MPI_COMPILE_TYPE ***"
|
|
|
9bd556b |
echo
|
|
|
9bd556b |
%set_build_flags
|
|
|
9bd556b |
cmake \\\
|
|
|
9bd556b |
-DCMAKE_C_FLAGS_RELEASE:STRING="-DNDEBUG" \\\
|
|
|
9bd556b |
-DCMAKE_CXX_FLAGS_RELEASE:STRING="-DNDEBUG" \\\
|
|
|
9bd556b |
-DCMAKE_Fortran_FLAGS_RELEASE:STRING="-DNDEBUG" \\\
|
|
|
9bd556b |
-DCMAKE_VERBOSE_MAKEFILE:BOOL=ON \\\
|
|
|
9bd556b |
-DCMAKE_INSTALL_INCLUDEDIR:PATH=$MPI_INCLUDE \\\
|
|
|
9bd556b |
-DCMAKE_INSTALL_LIBDIR:PATH=$MPI_LIB \\\
|
|
|
9bd556b |
-DSYSCONF_INSTALL_DIR:PATH=%{_sysconfdir} \\\
|
|
|
9bd556b |
-DSHARE_INSTALL_PREFIX:PATH=%{_datadir} \\\
|
|
|
9bd556b |
-DCMAKE_SKIP_RPATH:BOOL=ON \\\
|
|
|
9bd556b |
-DCMAKE_INSTALL_PREFIX:PATH=$MPI_HOME \\\
|
|
|
9bd556b |
-DBUILD_SHARED_LIBS:BOOL=ON \\\
|
|
|
9bd556b |
-DNRN_ENABLE_SHARED=ON \\\
|
|
|
9bd556b |
-DNRN_ENABLE_INTERVIEWS=ON \\\
|
|
|
9bd556b |
-DNRN_ENABLE_PYTHON=ON \\\
|
|
|
9bd556b |
-DNRN_ENABLE_PYTHON_DYNAMIC=OFF \\\
|
|
|
9bd556b |
-DNRN_ENABLE_THREADS=ON \\\
|
|
|
9bd556b |
-DNRN_ENABLE_MEMACS=ON \\\
|
|
|
9bd556b |
-DNRN_ENABLE_RX3D=ON \\\
|
|
|
9bd556b |
-DNRN_ENABLE_CORENEURON=OFF \\\
|
|
|
57d58b5 |
-DNRN_ENABLE_TESTS=OFF \\\
|
|
|
577fa0d |
-DNRN_ENABLE_REL_RPATH=OFF \\\
|
|
|
9bd556b |
-DNRN_ENABLE_MODULE_INSTALL=ON \\\
|
|
|
9bd556b |
-DNRN_ENABLE_INTERNAL_READLINE=OFF \\\
|
|
|
9bd556b |
-DNRN_ENABLE_MPI=$MPI_YES \\\
|
|
|
57d58b5 |
-DNEURON_CMAKE_FORMAT:BOOL=OFF \\\
|
|
|
9bd556b |
-DMPI_INCLUDE_PATH=$MPI_INCLUDE \\\
|
|
|
9bd556b |
-DMPI_LIBRARY=$MPI_LIBFILE \\\
|
|
|
9bd556b |
%if "%{_lib}" == "lib64" \
|
|
|
9bd556b |
-DLIB_SUFFIX=64 -B $MY_CMAKE_BUILDDIR && \
|
|
|
9bd556b |
%else \
|
|
|
9bd556b |
-DLIB_SUFFIX="" -B $MY_CMAKE_BUILDDIR && \
|
|
|
9bd556b |
%endif
|
|
|
5607eaa |
%__cmake --build $MY_CMAKE_BUILDDIR %{_smp_mflags} \
|
|
|
b412848 |
|
|
|
c703909 |
%if %{with music}
|
|
|
9bd556b |
pushd $MY_CMAKE_BUILDDIR/src/neuronmusic
|
|
|
5607eaa |
%__cmake --build %{_smp_mflags}
|
|
|
c703909 |
%{py3_build}
|
|
|
c703909 |
popd
|
|
|
c703909 |
%endif
|
|
|
9bd556b |
}
|
|
|
9bd556b |
|
|
|
9bd556b |
|
|
|
9bd556b |
# Serial version
|
|
|
9bd556b |
export MPI_COMPILER=serial
|
|
|
9bd556b |
export MPI_SUFFIX=""
|
|
|
9bd556b |
export MPI_HOME=%{_prefix}
|
|
|
9bd556b |
export MPI_BIN=%{_bindir}
|
|
|
9bd556b |
export MPI_INCLUDE=%{_includedir}
|
|
|
9bd556b |
export MPI_LIB="%{_libdir}"
|
|
|
9bd556b |
export MPI_LIBFILE=""
|
|
|
9bd556b |
export MPI_YES=OFF
|
|
|
9bd556b |
# Python 3
|
|
|
9bd556b |
export MPI_COMPILE_TYPE=""
|
|
|
9bd556b |
export MPI_SITEARCH="%{python3_sitearch}"
|
|
|
9bd556b |
export MY_CMAKE_BUILDDIR="%_vpath_builddir"
|
|
|
9bd556b |
%{do_build}
|
|
|
9bd556b |
|
|
|
9bd556b |
# MPICH
|
|
|
9bd556b |
%if %{with mpich}
|
|
|
9bd556b |
%{_mpich_load}
|
|
|
9bd556b |
export CC=mpicc
|
|
|
9bd556b |
export CXX=mpicxx
|
|
|
9bd556b |
export FC=mpif90
|
|
|
9bd556b |
export F77=mpif77
|
|
|
9bd556b |
export MPI_YES=ON
|
|
|
9bd556b |
# Python 3
|
|
|
9bd556b |
export MPI_COMPILE_TYPE="-mpich"
|
|
|
9bd556b |
export MY_CMAKE_BUILDDIR="%_vpath_builddir""-mpich"
|
|
|
9bd556b |
export MPI_LIBFILE="$MPI_LIB/libmpi.so"
|
|
|
9bd556b |
%{do_build}
|
|
|
9bd556b |
%{_mpich_unload}
|
|
|
9bd556b |
%endif
|
|
|
b412848 |
|
|
|
a563fb8 |
# OpenMPI
|
|
|
a563fb8 |
%if %{with openmpi}
|
|
|
a563fb8 |
%{_openmpi_load}
|
|
|
a563fb8 |
export CC=mpicc
|
|
|
a563fb8 |
export CXX=mpicxx
|
|
|
a563fb8 |
export FC=mpif90
|
|
|
a563fb8 |
export F77=mpif77
|
|
|
a563fb8 |
export MPI_YES=ON
|
|
|
a563fb8 |
# Python 3
|
|
|
a563fb8 |
export MPI_COMPILE_TYPE="-openmpi"
|
|
|
a563fb8 |
export MY_CMAKE_BUILDDIR="%_vpath_builddir""-openmpi"
|
|
|
a563fb8 |
export MPI_LIBFILE="$MPI_LIB/libmpi.so"
|
|
|
a563fb8 |
%{do_build}
|
|
|
a563fb8 |
%{_openmpi_unload}
|
|
|
a563fb8 |
%endif
|
|
|
a563fb8 |
|
|
|
b412848 |
%install
|
|
|
9bd556b |
# Install everything
|
|
|
9bd556b |
|
|
|
9bd556b |
%global do_install %{expand:
|
|
|
9bd556b |
echo
|
|
|
9bd556b |
echo "*** INSTALLING %{name}-%{version}$MPI_COMPILE_TYPE ***"
|
|
|
9bd556b |
echo
|
|
|
5607eaa |
DESTDIR=%{buildroot} %__cmake --install $MY_CMAKE_BUILDDIR
|
|
|
c703909 |
|
|
|
c703909 |
%if %{with music}
|
|
|
9bd556b |
pushd $MY_CMAKE_BUILDDIR/src/neuronmusic
|
|
|
c703909 |
%{py3_install}
|
|
|
c703909 |
popd
|
|
|
c703909 |
%endif
|
|
|
c703909 |
|
|
|
9bd556b |
# Python bits from the post install hook
|
|
|
c703909 |
# It requires the libraries before to be installed, not just built, so it must
|
|
|
c703909 |
# be done here. The only alternative is a different package that requires this,
|
|
|
c703909 |
# but this is simpler
|
|
|
9bd556b |
RPM_LD_FLAGS="%{?__global_ldflags} -L$RPM_BUILD_ROOT/$MPI_LIB"
|
|
|
9bd556b |
pushd $MY_CMAKE_BUILDDIR/src/nrnpython/
|
|
|
c703909 |
%{py3_build}
|
|
|
9bd556b |
%{py3_install "--install-lib" "$MPI_PYTHON3_SITEARCH"}
|
|
|
c703909 |
popd
|
|
|
c703909 |
|
|
|
9bd556b |
# set up second symlink for shared objects
|
|
|
9bd556b |
pushd $RPM_BUILD_ROOT/$MPI_LIB/
|
|
|
9bd556b |
ln -sv ./libnrniv.so.0.0.0 libnrniv.so.0
|
|
|
9bd556b |
ln -sv ./librxdmath.so.0.0.0 librxdmath.so.0
|
|
|
9bd556b |
popd
|
|
|
9bd556b |
}
|
|
|
b412848 |
|
|
|
a563fb8 |
%global do_post_install_tweaks %{expand:
|
|
|
5f1c3b3 |
# Remove installed libfiles
|
|
|
5f1c3b3 |
rm -rfv $RPM_BUILD_ROOT/$MPI_HOME/lib/python/neuron/
|
|
|
5f1c3b3 |
# Post install clean up: remove stray object files
|
|
|
5f1c3b3 |
# Must be done at end, otherwise it deletes object files required for other builds
|
|
|
5f1c3b3 |
find . $RPM_BUILD_ROOT/$MPI_LIB/ -name "*.o" -exec rm -f '{}' \\;
|
|
|
5f1c3b3 |
# Remove libtool archives
|
|
|
5f1c3b3 |
find . $RPM_BUILD_ROOT/$MPI_LIB/ -name "*.la" -exec rm -f '{}' \\;
|
|
|
5f1c3b3 |
# Remove installed copy of libtool
|
|
|
5f1c3b3 |
# Remove iv header provided by iv package
|
|
|
a563fb8 |
rm -rf $RPM_BUILD_ROOT/$MPI_HOME/include/ivstream.h
|
|
|
a563fb8 |
# Delete installed libtool
|
|
|
a563fb8 |
rm -fv $RPM_BUILD_ROOT/$MPI_HOME/share/%{tarname}/libtool
|
|
|
a563fb8 |
|
|
|
5bdad30 |
# remove package note flag from nrnmech_makefile
|
|
|
5bdad30 |
pushd $RPM_BUILD_ROOT/$MPI_BIN/
|
|
|
49a846e |
sed -i "s|-Wl,-dT,.*\.ld||" nrnmech_makefile
|
|
|
5bdad30 |
popd
|
|
|
a563fb8 |
# Only needed for MPI builds
|
|
|
a563fb8 |
if [ x"$MPI_SUFFIX" != "x" ]
|
|
|
a563fb8 |
then
|
|
|
a563fb8 |
# Do not install demo files for MPI packages
|
|
|
a563fb8 |
rm -rf $RPM_BUILD_ROOT/$MPI_HOME/share/%{tarname}/demo
|
|
|
a563fb8 |
# Renaming MPI bits
|
|
|
5f1c3b3 |
pushd $RPM_BUILD_ROOT/$MPI_BIN/
|
|
|
5f1c3b3 |
# Rename file references to use MPI_SUFFIX before renaming them
|
|
|
5f1c3b3 |
sed -i "s/nrniv\"/nrniv$MPI_SUFFIX\"/g" nrngui
|
|
|
5f1c3b3 |
sed -i -e "s/nrniv\"/nrniv$MPI_SUFFIX\"/g" -e "s/nrnmech_makefile/nrnmech_makefile$MPI_SUFFIX/g" -e "s/nocmodl/nocmodl$MPI_SUFFIX/g" nrnivmodl
|
|
|
5f1c3b3 |
sed -i -e "s/nocmodl/nocmodl$MPI_SUFFIX/g" nrnmech_makefile
|
|
|
5f1c3b3 |
sed -i -e "s/nocmodl/nocmodl$MPI_SUFFIX/g" mkthreadsafe
|
|
|
5f1c3b3 |
|
|
|
5f1c3b3 |
# Rename files to include $MPI_SUFFIX
|
|
|
5f1c3b3 |
for f in modlunit neurondemo nrngui nrniv sortspike mkthreadsafe nocmodl nrnivmodl nrnmech_makefile
|
|
|
5f1c3b3 |
do
|
|
|
5f1c3b3 |
mv -v "$f"{,$MPI_SUFFIX}
|
|
|
5f1c3b3 |
done
|
|
|
5f1c3b3 |
mv -v nrnpyenv{,$MPI_SUFFIX}.sh
|
|
|
5f1c3b3 |
mv -v set_nrnpyenv{,$MPI_SUFFIX}.sh
|
|
|
5f1c3b3 |
popd
|
|
|
a563fb8 |
fi
|
|
|
5f1c3b3 |
}
|
|
|
5f1c3b3 |
|
|
|
9bd556b |
# Serial
|
|
|
9bd556b |
export MPI_LIB="%{_libdir}"
|
|
|
9bd556b |
export MPI_COMPILE_TYPE=""
|
|
|
9bd556b |
export MPI_PYTHON3_SITEARCH=%{python3_sitearch}
|
|
|
9bd556b |
export MY_CMAKE_BUILDDIR="%_vpath_builddir"
|
|
|
a563fb8 |
export MPI_HOME="%{_prefix}"
|
|
|
a563fb8 |
export MPI_BIN="%{_bindir}"
|
|
|
a563fb8 |
export MPI_SUFFIX=""
|
|
|
9bd556b |
%do_install
|
|
|
a563fb8 |
%do_post_install_tweaks
|
|
|
c703909 |
# Remove duplicate files. These are installed in the correct python locations already
|
|
|
a563fb8 |
# rm -rf $RPM_BUILD_ROOT/%%{_datadir}/%%{tarname}/lib/python/%%{name}
|
|
|
b71cad2 |
|
|
|
b71cad2 |
|
|
|
b087e1f |
|
|
|
9bd556b |
# mpich
|
|
|
9bd556b |
%if %{with mpich}
|
|
|
9bd556b |
%{_mpich_load}
|
|
|
9bd556b |
export MPI_COMPILE_TYPE="-mpich"
|
|
|
9bd556b |
export MY_CMAKE_BUILDDIR="%_vpath_builddir""-mpich"
|
|
|
9bd556b |
%do_install
|
|
|
a563fb8 |
%do_post_install_tweaks
|
|
|
9bd556b |
%{_mpich_unload}
|
|
|
9bd556b |
%endif
|
|
|
cb64079 |
|
|
|
a563fb8 |
# OpenMPI
|
|
|
a563fb8 |
%if %{with openmpi}
|
|
|
a563fb8 |
%{_openmpi_load}
|
|
|
a563fb8 |
export MPI_COMPILE_TYPE="-openmpi"
|
|
|
a563fb8 |
export MY_CMAKE_BUILDDIR="%_vpath_builddir""-openmpi"
|
|
|
a563fb8 |
%do_install
|
|
|
a563fb8 |
%do_post_install_tweaks
|
|
|
a563fb8 |
%{_openmpi_unload}
|
|
|
a563fb8 |
%endif
|
|
|
a563fb8 |
|
|
|
b412848 |
# The makefiles do not have shebangs
|
|
|
b412848 |
%files
|
|
|
b412848 |
%license Copyright
|
|
|
5985701 |
%{_bindir}/modlunit
|
|
|
b412848 |
%{_bindir}/neurondemo
|
|
|
b412848 |
%{_bindir}/nrngui
|
|
|
b412848 |
%{_bindir}/nrniv
|
|
|
b412848 |
%{_bindir}/sortspike
|
|
|
5985701 |
# Not needed but I'll include them for completeness anyway
|
|
|
5985701 |
%{_bindir}/nrnpyenv.sh
|
|
|
5985701 |
%{_bindir}/set_nrnpyenv.sh
|
|
|
b412848 |
# Libs
|
|
|
b412848 |
%{_libdir}/libnrniv.so.0.0.0
|
|
|
b412848 |
%{_libdir}/libnrniv.so.0
|
|
|
c703909 |
%{_libdir}/librxdmath.so.0.0.0
|
|
|
c703909 |
%{_libdir}/librxdmath.so.0
|
|
|
b412848 |
# other hoc files and data
|
|
|
b412848 |
%dir %{_datadir}/%{tarname}
|
|
|
b412848 |
%{_datadir}/%{tarname}/lib
|
|
|
b412848 |
|
|
|
c703909 |
# Python bits
|
|
|
c703909 |
%files -n python3-%{name}
|
|
|
c703909 |
# The libraries are here
|
|
|
c703909 |
%{python3_sitearch}/%{name}
|
|
|
c703909 |
# Egg info
|
|
|
57d58b5 |
%{python3_sitearch}/NEURON-*-py%{python3_version}.egg-info
|
|
|
c703909 |
|
|
|
b412848 |
%files devel
|
|
|
b412848 |
%license Copyright
|
|
|
b412848 |
%doc README.md
|
|
|
5985701 |
%{_bindir}/mkthreadsafe
|
|
|
5985701 |
%{_bindir}/nocmodl
|
|
|
5985701 |
%{_bindir}/nrnivmodl
|
|
|
811d174 |
%{_bindir}/nrnmech_makefile
|
|
|
5985701 |
# Headers
|
|
|
b087e1f |
%{_includedir}/*.h
|
|
|
b087e1f |
%{_includedir}/nrncvode/
|
|
|
5985701 |
# Shared objects
|
|
|
b412848 |
%{_libdir}/libnrniv.so
|
|
|
c703909 |
%{_libdir}/librxdmath.so
|
|
|
9bd556b |
# required by neuron
|
|
|
9bd556b |
# https://github.com/neuronsimulator/nrn/issues/719#issuecomment-677501890
|
|
|
9bd556b |
%{_datadir}/%{tarname}/nrnmain.cpp
|
|
|
b412848 |
|
|
|
b412848 |
%files doc
|
|
|
b412848 |
%license Copyright
|
|
|
b412848 |
%{_datadir}/%{tarname}/demo
|
|
|
b412848 |
|
|
|
9bd556b |
%if %{with mpich}
|
|
|
9bd556b |
%files mpich
|
|
|
9bd556b |
%license Copyright
|
|
|
9bd556b |
%{_libdir}/mpich/bin/modlunit_mpich
|
|
|
9bd556b |
%{_libdir}/mpich/bin/neurondemo_mpich
|
|
|
9bd556b |
%{_libdir}/mpich/bin/nrngui_mpich
|
|
|
9bd556b |
%{_libdir}/mpich/bin/nrniv_mpich
|
|
|
9bd556b |
%{_libdir}/mpich/bin/sortspike_mpich
|
|
|
9bd556b |
# Not needed but I'll include them for completeness anyway
|
|
|
9bd556b |
%{_libdir}/mpich/bin/nrnpyenv_mpich.sh
|
|
|
9bd556b |
%{_libdir}/mpich/bin/set_nrnpyenv_mpich.sh
|
|
|
9bd556b |
# Libs
|
|
|
9bd556b |
%{_libdir}/mpich/lib/libnrniv.so.0.0.0
|
|
|
9bd556b |
%{_libdir}/mpich/lib/libnrniv.so.0
|
|
|
9bd556b |
%{_libdir}/mpich/lib/librxdmath.so.0.0.0
|
|
|
9bd556b |
%{_libdir}/mpich/lib/librxdmath.so.0
|
|
|
57d58b5 |
#
|
|
|
9bd556b |
%dir %{_libdir}/mpich/share/%{tarname}
|
|
|
9bd556b |
%{_libdir}/mpich/share/%{tarname}/lib
|
|
|
9bd556b |
|
|
|
9bd556b |
# Python bits
|
|
|
9bd556b |
%files -n python3-%{name}-mpich
|
|
|
9bd556b |
# The libraries are here
|
|
|
9bd556b |
%{python3_sitearch}/mpich/%{name}
|
|
|
9bd556b |
# Egg info
|
|
|
57d58b5 |
%{python3_sitearch}/mpich/NEURON-*-py%{python3_version}.egg-info
|
|
|
9bd556b |
|
|
|
9bd556b |
%files mpich-devel
|
|
|
9bd556b |
%license Copyright
|
|
|
9bd556b |
%doc README.md
|
|
|
9bd556b |
%{_libdir}/mpich/bin/mkthreadsafe_mpich
|
|
|
9bd556b |
%{_libdir}/mpich/bin/nocmodl_mpich
|
|
|
9bd556b |
%{_libdir}/mpich/bin/nrnivmodl_mpich
|
|
|
9bd556b |
%{_libdir}/mpich/bin/nrnmech_makefile_mpich
|
|
|
9bd556b |
# Headers
|
|
|
9bd556b |
%{_libdir}/mpich/include/*.h
|
|
|
9bd556b |
%{_libdir}/mpich/include/nrncvode/
|
|
|
9bd556b |
# Shared objects
|
|
|
9bd556b |
%{_libdir}/mpich/lib/libnrniv.so
|
|
|
9bd556b |
%{_libdir}/mpich/lib/librxdmath.so
|
|
|
9bd556b |
# required by neuron
|
|
|
9bd556b |
# https://github.com/neuronsimulator/nrn/issues/719#issuecomment-677501890
|
|
|
9bd556b |
%{_libdir}/mpich/share/%{tarname}/nrnmain.cpp
|
|
|
9bd556b |
%endif
|
|
|
9bd556b |
|
|
|
a563fb8 |
%if %{with openmpi}
|
|
|
a563fb8 |
%files openmpi
|
|
|
a563fb8 |
%license Copyright
|
|
|
a563fb8 |
%{_libdir}/openmpi/bin/modlunit_openmpi
|
|
|
a563fb8 |
%{_libdir}/openmpi/bin/neurondemo_openmpi
|
|
|
a563fb8 |
%{_libdir}/openmpi/bin/nrngui_openmpi
|
|
|
a563fb8 |
%{_libdir}/openmpi/bin/nrniv_openmpi
|
|
|
a563fb8 |
%{_libdir}/openmpi/bin/sortspike_openmpi
|
|
|
a563fb8 |
# Not needed but I'll include them for completeness anyway
|
|
|
a563fb8 |
%{_libdir}/openmpi/bin/nrnpyenv_openmpi.sh
|
|
|
a563fb8 |
%{_libdir}/openmpi/bin/set_nrnpyenv_openmpi.sh
|
|
|
a563fb8 |
# Libs
|
|
|
a563fb8 |
%{_libdir}/openmpi/lib/libnrniv.so.0.0.0
|
|
|
a563fb8 |
%{_libdir}/openmpi/lib/libnrniv.so.0
|
|
|
a563fb8 |
%{_libdir}/openmpi/lib/librxdmath.so.0.0.0
|
|
|
a563fb8 |
%{_libdir}/openmpi/lib/librxdmath.so.0
|
|
|
57d58b5 |
#
|
|
|
a563fb8 |
%dir %{_libdir}/openmpi/share/%{tarname}
|
|
|
a563fb8 |
%{_libdir}/openmpi/share/%{tarname}/lib
|
|
|
a563fb8 |
|
|
|
a563fb8 |
# Python bits
|
|
|
a563fb8 |
%files -n python3-%{name}-openmpi
|
|
|
a563fb8 |
# The libraries are here
|
|
|
a563fb8 |
%{python3_sitearch}/openmpi/%{name}
|
|
|
a563fb8 |
# Egg info
|
|
|
57d58b5 |
%{python3_sitearch}/openmpi/NEURON-*-py%{python3_version}.egg-info
|
|
|
a563fb8 |
|
|
|
a563fb8 |
%files openmpi-devel
|
|
|
a563fb8 |
%license Copyright
|
|
|
a563fb8 |
%doc README.md
|
|
|
a563fb8 |
%{_libdir}/openmpi/bin/mkthreadsafe_openmpi
|
|
|
a563fb8 |
%{_libdir}/openmpi/bin/nocmodl_openmpi
|
|
|
a563fb8 |
%{_libdir}/openmpi/bin/nrnivmodl_openmpi
|
|
|
a563fb8 |
%{_libdir}/openmpi/bin/nrnmech_makefile_openmpi
|
|
|
a563fb8 |
# Headers
|
|
|
a563fb8 |
%{_libdir}/openmpi/include/*.h
|
|
|
a563fb8 |
%{_libdir}/openmpi/include/nrncvode/
|
|
|
a563fb8 |
# Shared objects
|
|
|
a563fb8 |
%{_libdir}/openmpi/lib/libnrniv.so
|
|
|
a563fb8 |
%{_libdir}/openmpi/lib/librxdmath.so
|
|
|
a563fb8 |
# required by neuron
|
|
|
a563fb8 |
# https://github.com/neuronsimulator/nrn/issues/719#issuecomment-677501890
|
|
|
a563fb8 |
%{_libdir}/openmpi/share/%{tarname}/nrnmain.cpp
|
|
|
a563fb8 |
%endif
|
|
|
a563fb8 |
|
|
|
b412848 |
%changelog
|
|
|
032b020 |
%autochangelog
|