diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..30e2e1d --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +/nrn-5687519.tar.gz diff --git a/0001-Unbundle-Random123.patch b/0001-Unbundle-Random123.patch new file mode 100644 index 0000000..b03d682 --- /dev/null +++ b/0001-Unbundle-Random123.patch @@ -0,0 +1,39 @@ +From c12581ae6bff9c0068289def1b772d71ab8beda9 Mon Sep 17 00:00:00 2001 +From: "Ankur Sinha (Ankur Sinha Gmail)" +Date: Sun, 6 Jan 2019 15:06:07 +0000 +Subject: [PATCH 1/2] Unbundle Random123 + +--- + configure.ac | 2 +- + src/Makefile.am | 2 +- + 2 files changed, 2 insertions(+), 2 deletions(-) + +diff --git a/configure.ac b/configure.ac +index 57f41bf5..7d391d13 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -747,7 +747,7 @@ AC_CONFIG_HEADERS([src/ivos/ivstream.h]) + AC_CONFIG_FILES([ + nrnrpm.spec + src/sparse/Makefile src/memacs/Makefile +- src/readline/Makefile src/sparse13/Makefile src/Random123/Makefile ++ src/readline/Makefile src/sparse13/Makefile + src/oc/Makefile src/scopmath/Makefile src/nrnoc/Makefile + src/gnu/Makefile src/uxnrnbbs/Makefile src/mesch/Makefile + src/uxnrnbbs/mos2nrn.h src/nrnmpi/Makefile +diff --git a/src/Makefile.am b/src/Makefile.am +index 046f6651..25ad84c7 100755 +--- a/src/Makefile.am ++++ b/src/Makefile.am +@@ -13,7 +13,7 @@ NMODL_SUBDIRS = modlunit nmodl + else + NMODL_SUBDIRS = modlunit nmodl + endif +-NRNOC_SUBDIRS = sparse sparse13 scopmath Random123 nrnmpi oc nrnoc ++NRNOC_SUBDIRS = sparse sparse13 scopmath nrnmpi oc nrnoc + NRNIV_SUBDIRS = mesch gnu ivoc nrncvode parallel nrniv + IVOS_SUBDIRS = ivos + NRNJAVA_SUBDIRS = nrnjava +-- +2.20.1 + diff --git a/0002-Unbundle-readline.patch b/0002-Unbundle-readline.patch new file mode 100644 index 0000000..71d4d8d --- /dev/null +++ b/0002-Unbundle-readline.patch @@ -0,0 +1,68 @@ +From b416fb84413399d5b2ababc9b754e4d1b63f71e1 Mon Sep 17 00:00:00 2001 +From: "Ankur Sinha (Ankur Sinha Gmail)" +Date: Sun, 27 Jan 2019 18:43:07 +0000 +Subject: [PATCH 2/2] Unbundle readline + +--- + configure.ac | 3 +-- + src/Makefile.am | 9 +-------- + 2 files changed, 2 insertions(+), 10 deletions(-) + +diff --git a/configure.ac b/configure.ac +index 7d391d13..648d484f 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -530,7 +530,6 @@ AC_SUBST(nrndef_unix) + AC_SUBST(nrndef_mac) + AC_SUBST(nrndef_mswin) + +-AM_CONDITIONAL(BUILD_READLINE, test x$build_readline = xyes) + AM_CONDITIONAL(BUILD_NRNJAVA, test x$build_nrnjava = xyes) + AM_CONDITIONAL(BUILD_NRNIV, test x$build_nrniv = xyes) + AM_CONDITIONAL(BUILD_IVOS, test x$use_ivos = xyes) +@@ -747,7 +746,7 @@ AC_CONFIG_HEADERS([src/ivos/ivstream.h]) + AC_CONFIG_FILES([ + nrnrpm.spec + src/sparse/Makefile src/memacs/Makefile +- src/readline/Makefile src/sparse13/Makefile ++ src/sparse13/Makefile + src/oc/Makefile src/scopmath/Makefile src/nrnoc/Makefile + src/gnu/Makefile src/uxnrnbbs/Makefile src/mesch/Makefile + src/uxnrnbbs/mos2nrn.h src/nrnmpi/Makefile +diff --git a/src/Makefile.am b/src/Makefile.am +index 25ad84c7..d14d7cd7 100755 +--- a/src/Makefile.am ++++ b/src/Makefile.am +@@ -6,7 +6,6 @@ + ## The order of compilation is important in some cases. Directories are + ## searched in the order they are specified. + +-READLINE_SUBDIRS = readline + MEMACS_SUBDIRS = memacs + if BUILD_MINGW + NMODL_SUBDIRS = modlunit nmodl +@@ -31,12 +30,6 @@ else + memacsbuild = + endif + +-if BUILD_READLINE +-readlinebuild = $(READLINE_SUBDIRS) +-else +-readlinebuild = +-endif +- + if BUILD_NRNIV + nrnivbuild = $(NRNIV_SUBDIRS) + else +@@ -87,7 +80,7 @@ else + if NRNPYTHON_ONLY + SUBDIRS = $(nrnpythonbuild) mswin + else +-SUBDIRS = $(readlinebuild) $(memacsbuild) $(nmodlbuild) $(NRNOC_SUBDIRS) \ ++SUBDIRS = $(memacsbuild) $(nmodlbuild) $(NRNOC_SUBDIRS) \ + $(nrnjavabuild) $(ivosbuild) $(nrnpythonbuild) \ + $(build_6229) $(nrnivbuild) $(mos2nrnbuild) $(neuronmusicbuild) \ + mac mswin +-- +2.20.1 + diff --git a/neuron.spec b/neuron.spec new file mode 100644 index 0000000..20589d0 --- /dev/null +++ b/neuron.spec @@ -0,0 +1,274 @@ +# This is a serial build of NEURON without Python or other bindings. +# Both the MPI builds and Python bindings require NEURON to be already +# installed in the system---they are build as post-installation hooks. So, we +# first package a serial version of NEURON and then package those separately +# after using this package as a BR + +%global commit 56875193411d552eea7d4cbfe09458f3c4f76613 +%global shortcommit %(c=%{commit}; echo ${c:0:7}) + +%global desc %{expand: \ +NEURON is a simulation environment for modeling individual neurons and networks +of neurons. It provides tools for conveniently building, managing, and using +models in a way that is numerically sound and computationally efficient. It is +particularly well-suited to problems that are closely linked to experimental +data, especially those that involve cells with complex anatomical and +biophysical properties. + +This package is currently built without GUI (iv) support. +It does not include MPI support. + +Please install the %{name}-devel package to compile nmodl files and so on. +} + +%global tarname nrn + +# fails somehow, disabled by default +%bcond_with metis + +# IV uses libtiff from 1995 and threfore has not been packaged yet +%bcond_with iv + +Name: neuron +Version: 7.5 +Release: 4.20181214git%{shortcommit}%{?dist} +Summary: A flexible and powerful simulator of neurons and networks + +License: GPLv3+ +URL: http://www.neuron.yale.edu/neuron/ +# Using brunomaga's fork which updates neuron to use the current sundials +# Will be merged to neuron main eventually +# https://github.com/neuronsimulator/nrn/issues/113 +Source0: https://github.com/brunomaga/%{tarname}/archive/%{commit}/%{tarname}-%{shortcommit}.tar.gz +# Source0: https://github.com/neuronsimulator/%%{tarname}/archive/%%{commit}/%%{tarname}-%%{shortcommit}.tar.gz + +# Based on brunomega's master branch +Patch0: 0001-Unbundle-Random123.patch +# libstdc++ bundled is from 1988: seems heavily modified. Headers from there +# are not present in the current version +# https://github.com/neuronsimulator/nrn/issues/145 +# Upstream changes the soname etc., so this will not conflict with the packaged +# version +# Unbundle readline +Patch1: 0002-Unbundle-readline.patch + +# Random123 does not build on these, so neither can NEURON +# https://github.com/neuronsimulator/nrn/issues/114 +ExcludeArch: %{arm} mips64r2 mips32r2 s390 s390x + +BuildRequires: autoconf +BuildRequires: automake +BuildRequires: bison +BuildRequires: bison-devel +BuildRequires: flex +BuildRequires: flex-devel +BuildRequires: gcc +BuildRequires: gcc-c++ +BuildRequires: git +%if %{with iv} +BuildRequires: iv-static iv-devel +%endif +BuildRequires: libX11-devel +BuildRequires: libtool +%if %{with metis} +BuildRequires: metis-devel +%endif +BuildRequires: ncurses-devel +BuildRequires: readline-devel +BuildRequires: Random123-devel +BuildRequires: sundials-devel + +%description +%{desc} + +%package devel +Summary: Development files for %{name} +Requires: %{name}%{?_isa} = %{version}-%{release} + +%description devel +Headers and development shared libraries for the %{name} package + +%package doc +Summary: Documentation for %{name} +BuildArch: noarch + +%description doc +Documentation for %{name} + + +%prep +%autosetup -n %{tarname}-%{commit} -p1 -S git + +# Remove executable perms from source files +find src -type f -executable ! -name "*.sh" | xargs chmod -x + +# Remove bundled Random123 +rm -rf src/Random123 +rm -rf src/readline + +# Stop build file from generating version header +sed -i '/git2nrnversion_h.sh/ d' build.sh + +# Create version file ourselves +export TIMESTAMP=$(date +%Y-%m-%d) +export COMMIT=%{shortcommit} +cat > src/nrnoc/nrnversion.h << EOF +#define GIT_DATE "$TIMESTAMP" +#define GIT_BRANCH "master" +#define GIT_CHANGESET "$COMMIT" +#define GIT_DESCRIBE "Neuron built for Fedora" +EOF + +# Use system libtool instead of a local copy that neuron tries to install +pushd bin + for f in *_makefile.in + do + sed -i 's|\(LIBTOOL.*=.*\)$(pkgdatadir)\(.*\)|\1$(bindir)\2|' $f + done +popd + +%build +export SUNDIALS_SYSTEM_INSTALL="yes" +./build.sh + +%if !%{with iv} +%global iv_flags --without-iv --with-x +%else +%global iv_flags " " +%endif + +%if %{with metis} +%global metis_flags --with-metis +%else +%global metis_flags " " +%endif + +%configure %{iv_flags} %{metis_flags} --with-gnu-ld + +sed -i 's|^hardcode_libdir_flag_spec=.*|hardcode_libdir_flag_spec=""|g' libtool && \ +sed -i 's|^runpath_var=LD_RUN_PATH|runpath_var=DIE_RPATH_DIE|g' libtool + +%make_build + + +%install +%make_install +# Installs it even when we're not providing nrnpy +rm -fv $RPM_BUILD_ROOT/%{_bindir}/*nrnpy* -f +# Remove installed libtool copy +rm -fv $RPM_BUILD_ROOT/%{_datadir}/%{tarname}/libtool + +# Move to includedir +mv $RPM_BUILD_ROOT/%{_libdir}/nrnconf.h $RPM_BUILD_ROOT/%{_includedir}/nrnconf.h + +# Post install clean up +# Remove stray object files +# Probably worth a PR +# Must be done at end, otherwise it deletes object files required for other builds +find . $RPM_BUILD_ROOT/%{_libdir}/ -name "*.o" -exec rm -f '{}' \; +# Remove libtool archives +find . $RPM_BUILD_ROOT/%{_libdir}/ -name "*.la" -exec rm -f '{}' \; + +# Still needed on F28? +%ldconfig_scriptlets + +# The makefiles do not have shebangs +%files +%license Copyright +# Binaries, scripts and makefiles +%{_bindir}/bbswork.sh +%{_bindir}/hel2mos1.sh +%{_bindir}/ivoc +%{_bindir}/memacs +%{_bindir}/mkthreadsafe +%{_bindir}/modlunit +%{_bindir}/mos2nrn +%{_bindir}/mos2nrn2.sh +%{_bindir}/neurondemo +%{_bindir}/nocmodl +%{_bindir}/nrndiagnose.sh +%{_bindir}/nrngui +%{_bindir}/nrniv +%{_bindir}/nrniv_makefile +%{_bindir}/nrnivmodl +%{_bindir}/nrnmech_makefile +%{_bindir}/nrnoc +%{_bindir}/nrnoc_makefile +%{_bindir}/nrnocmodl +%{_bindir}/oc +%{_bindir}/sortspike +# Libs +%{_libdir}/libivoc.so.0.0.0 +%{_libdir}/libivoc.so.0 +%{_libdir}/libmemacs.so.0.0.0 +%{_libdir}/libmemacs.so.0 +%{_libdir}/libmeschach.so.0.0.0 +%{_libdir}/libmeschach.so.0 +%{_libdir}/libneuron_gnu.so.0.0.0 +%{_libdir}/libneuron_gnu.so.0 +%{_libdir}/libnrniv.so.0.0.0 +%{_libdir}/libnrniv.so.0 +%{_libdir}/libnrnmpi.so.0.0.0 +%{_libdir}/libnrnmpi.so.0 +%{_libdir}/libnrnoc.so.0.0.0 +%{_libdir}/libnrnoc.so.0 +%{_libdir}/liboc.so.0.0.0 +%{_libdir}/liboc.so.0 +%{_libdir}/libocxt.so.0.0.0 +%{_libdir}/libocxt.so.0 +%{_libdir}/libsparse13.so.0.0.0 +%{_libdir}/libsparse13.so.0 +%{_libdir}/libscopmath.so.0 +%{_libdir}/libscopmath.so.0.0.0 +%{_libdir}/libivos.so.0 +%{_libdir}/libivos.so.0.0.0 +# other hoc files and data +%dir %{_datadir}/%{tarname} +%{_datadir}/%{tarname}/lib + +%files devel +%license Copyright +%doc README.md +%{_includedir}/%{tarname} +%{_libdir}/libivoc.so +%{_libdir}/libmemacs.so +%{_libdir}/libmeschach.so +%{_libdir}/libneuron_gnu.so +%{_libdir}/libnrniv.so +%{_libdir}/libnrnmpi.so +%{_libdir}/libnrnoc.so +%{_libdir}/liboc.so +%{_libdir}/libocxt.so +%{_libdir}/libsparse13.so +%{_libdir}/libscopmath.so +%{_libdir}/libivos.so + +%{_includedir}/nrnconf.h + +%files doc +%license Copyright +%{_datadir}/%{tarname}/examples +%{_datadir}/%{tarname}/demo + +%changelog +* Thu Jan 31 2019 Ankur Sinha - 7.5-4.20181214git5687519 +- Remove libtool archives +- Remove stray comment +- Improve previous changelog + +* Sun Jan 27 2019 Ankur Sinha - 7.5-3.20181214git5687519 +- Unbundle readline +- Remove readme: only speaks about installation +- Move header to includedir +- Update license +- Remove exec permissions from source files + +* Sun Jan 06 2019 Ankur Sinha - 7.5-2.20181214git5687519 +- Put each BR on different line +- Remove unneeded comment +- Re-do random123 patch to only modify autotools files +- Remove random123 in prep + +* Fri Dec 28 2018 Ankur Sinha - 7.5-1.20181214git5687519 +- Update to latest git snapshot that uses current sundials +- Build without MPI diff --git a/sources b/sources new file mode 100644 index 0000000..1aa36c6 --- /dev/null +++ b/sources @@ -0,0 +1 @@ +SHA512 (nrn-5687519.tar.gz) = bce98e250395535b8d6a500b6753a442625ff315694727022cc6092a82ff27f317d1037107f5bbbfe4105834a1dd83975c320a8638c5d3c4cf944b6723ab19d5