neuron: 7.5 -> 8.2.1

This commit is contained in:
DavidCrompton1192@gmail.com 2023-02-21 13:52:34 -05:00
parent ffdae3d386
commit 77aed40027
7 changed files with 107 additions and 134 deletions

View File

@ -3404,6 +3404,12 @@
githubId = 6754950; githubId = 6754950;
name = "David Armstrong Lewis"; name = "David Armstrong Lewis";
}; };
davidcromp = {
email = "davidcrompton1192@gmail.com";
github = "DavidCromp";
githubId = 10701143;
name = "David Crompton";
};
davidrusu = { davidrusu = {
email = "davidrusu.me@gmail.com"; email = "davidrusu.me@gmail.com";
github = "davidrusu"; github = "davidrusu";

View File

@ -1,94 +1,104 @@
{ lib, stdenv { lib
, stdenv
, fetchurl , fetchurl
, pkg-config
, automake
, autoconf
, libtool
, ncurses
, readline , readline
, which , xorg
, python ? null
, useMpi ? false
, mpi , mpi
, iv , cmake
, bison
, flex
, git
, perl
, gsl
, xcbuild
, python3
, useMpi ? false
, useIv ? true
, useCore ? false
, useRx3d ? false
}: }:
stdenv.mkDerivation rec { stdenv.mkDerivation rec {
pname = "neuron${lib.optionalString useMpi "-mpi"}"; pname = "neuron";
version = "7.5"; version = "8.2.1";
nativeBuildInputs = [ which pkg-config automake autoconf libtool ]; # format is for pythonModule conversion
buildInputs = [ ncurses readline python iv ] format = "other";
++ lib.optional useMpi mpi;
src = fetchurl { nativeBuildInputs = [
url = "https://www.neuron.yale.edu/ftp/neuron/versions/v${version}/nrn-${version}.tar.gz"; cmake
sha256 = "0f26v3qvzblcdjg7isq0m9j2q8q7x3vhmkfllv8lsr3gyj44lljf"; bison
}; flex
git
] ++ lib.optional useCore [ perl gsl ]
++ lib.optional stdenv.isDarwin [ xcbuild ];
patches = (lib.optionals (stdenv.isDarwin) [ ./neuron-carbon-disable.patch ]); buildInputs = lib.optional useIv [
xorg.libX11.dev
xorg.libXcomposite.dev
xorg.libXext.dev
];
# With LLVM 3.8 and above, clang (really libc++) gets upset if you attempt to redefine these... propagatedBuildInputs = [
postPatch = lib.optionalString stdenv.cc.isClang '' readline
substituteInPlace src/gnu/neuron_gnu_builtin.h \ python3
--replace 'double abs(double arg);' "" \ python3.pkgs.wheel
--replace 'float abs(float arg);' "" \ python3.pkgs.setuptools
--replace 'short abs(short arg);' "" \ python3.pkgs.scikit-build
--replace 'long abs(long arg);' "" python3.pkgs.matplotlib
'' + lib.optionalString stdenv.isDarwin '' ] ++ lib.optional useMpi [
# we are darwin, but we don't have all the quirks the source wants to compensate for mpi
substituteInPlace src/nrnpython/setup.py.in --replace 'readline="edit"' 'readline="readline"' ] ++ lib.optional useMpi [
for f in src/nrnpython/*.[ch] ; do python3.pkgs.mpi4py
substituteInPlace $f --replace "<Python/Python.h>" "<Python.h>" ] ++ lib.optional useRx3d [
python3.pkgs.cython
python3.pkgs.numpy
];
patches = [ ./neuron_darwin_rpath.patch ];
# Patch build shells for cmake (bin, src, cmake) and submodules (external)
postPatch = ''
patchShebangs ./bin ./src ./external ./cmake
sed -e 's#DESTDIR =#DESTDIR = '"$out"'#' -i external/coreneuron/extra/nrnivmodl_core_makefile.in
'';
cmakeFlags = [
"-DNRN_ENABLE_INTERVIEWS=${if useIv then "ON" else "OFF"}"
"-DNRN_ENABLE_MPI=${if useMpi then "ON" else "OFF"}"
"-DNRN_ENABLE_CORENEURON=${if useCore then "ON" else "OFF"}"
"-DNRN_ENABLE_RX3D=${if useRx3d then "ON" else "OFF"}"
];
postInstall = ''
mkdir -p $out/${python3.sitePackages}
mv $out/lib/python/* $out/${python3.sitePackages}/
rm -rf $out/lib/python build
for entry in $out/lib/*.so; do
# remove references to build
patchelf --set-rpath $(patchelf --print-rpath $entry | tr ':' '\n' | sed '/^\/build/d' | tr '\n' ':') $entry
done done
''; '';
enableParallelBuilding = true; src = fetchurl {
url = "https://github.com/neuronsimulator/nrn/releases/download/${version}/full-src-package-${version}.tar.gz";
## neuron install by default everything under prefix/${host_arch}/* sha256 = "0kb0dn7nmivv3zflzkbj2fj3184zwp2crkxp0mdxkwm4kpnxqz0v";
## override this to support nix standard file hierarchy };
## without issues: install everything under prefix/
preConfigure = ''
./build.sh
export prefix="''${prefix} --exec-prefix=''${out}"
'';
configureFlags = with lib;
[ "--with-readline=${readline}" "--with-iv=${iv}" ]
++ optionals (python != null) [ "--with-nrnpython=${python.interpreter}" ]
++ (if useMpi then ["--with-mpi" "--with-paranrn"]
else ["--without-mpi"]);
postInstall = lib.optionalString (python != null) ''
## standardise python neuron install dir if any
if [[ -d $out/lib/python ]]; then
mkdir -p ''${out}/${python.sitePackages}
mv ''${out}/lib/python/* ''${out}/${python.sitePackages}/
fi
'';
propagatedBuildInputs = [ readline ncurses which libtool ];
meta = with lib; { meta = with lib; {
broken = stdenv.isDarwin;
description = "Simulation environment for empirically-based simulations of neurons and networks of neurons"; description = "Simulation environment for empirically-based simulations of neurons and networks of neurons";
longDescription = ''
longDescription = "NEURON is a simulation environment for developing and exercising models of NEURON is a simulation environment for developing and exercising models of
neurons and networks of neurons. It is particularly well-suited to problems where neurons and networks of neurons. It is particularly well-suited to problems where
cable properties of cells play an important role, possibly including extracellular cable properties of cells play an important role, possibly including extracellular
potential close to the membrane), and where cell membrane properties are complex, potential close to the membrane), and where cell membrane properties are complex,
involving many ion-specific channels, ion accumulation, and second messengers"; involving many ion-specific channels, ion accumulation, and second messengers
'';
sourceProvenance = with sourceTypes; [ sourceProvenance = with sourceTypes; [ fromSource ];
fromSource license = licenses.bsd3;
] ++ lib.optionals (python != null) [ homepage = "http://www.neuron.yale.edu/neuron";
binaryNativeCode # "geometry3d" bundled libraries maintainers = with maintainers; [ adev davidcromp ];
]; platforms = platforms.all;
license = licenses.bsd3;
homepage = "http://www.neuron.yale.edu/neuron";
maintainers = [ maintainers.adev ];
# source claims it's only tested for x86 and powerpc
platforms = platforms.x86_64 ++ platforms.i686;
}; };
} }

View File

@ -1,21 +0,0 @@
--- nrn-7.4/src/mac/Makefile.am 2015-11-12 21:42:45.000000000 +0100
+++ nrn-7.4.new/src/mac/Makefile.am 2016-08-24 17:43:39.000000000 +0200
@@ -15,18 +15,8 @@
host_cpu = @host_cpu@
if MAC_DARWIN
-carbon = @enable_carbon@
bin_SCRIPTS = $(launch_scripts)
install: install-am
-if UniversalMacBinary
- $(CC) -arch ppc -o aoutppc -Dcpu="\"$(host_cpu)\"" -I. $(srcdir)/launch.c $(srcdir)/mac2uxarg.c -framework Carbon
- $(CC) -arch i386 -o aouti386 -Dcpu="\"$(host_cpu)\"" -I. $(srcdir)/launch.c $(srcdir)/mac2uxarg.c -framework Carbon
- lipo aouti386 aoutppc -create -output a.out
-else
- gcc -g -arch i386 -Dncpu="\"$(host_cpu)\"" -I. $(srcdir)/launch.c $(srcdir)/mac2uxarg.c -framework Carbon
-
-endif
- carbon=$(carbon) sh $(srcdir)/launch_inst.sh "$(host_cpu)" "$(DESTDIR)$(prefix)" "$(srcdir)"
for i in $(S) ; do \
sed "s/^CPU.*/CPU=\"$(host_cpu)\"/" < $(DESTDIR)$(bindir)/$$i > temp; \
mv temp $(DESTDIR)$(bindir)/$$i; \

View File

@ -0,0 +1,11 @@
--- a/src/nrnpython/setup.py.in
+++ b/src/nrnpython/setup.py.in
@@ -124,7 +124,7 @@ libdirs = [destdir + get_escaped_path("@NRN_LIBDIR@"),
rpath_prefix_flag='-Wl,-R'
extra_link_args = [@NRN_LINK_FLAGS_COMMA_SEPARATED_STRINGS@]
@MAC_DARWIN_FALSE@extra_link_args += [rpath_prefix_flag+lib_path for lib_path in libdirs]
-@MAC_DARWIN_TRUE@extra_link_args.append("-Wl,-rpath,@loader_path/../../")
+@MAC_DARWIN_TRUE@extra_link_args.append("-Wl,-rpath,@loader_path/../../../")
@MAC_DARWIN_TRUE@extra_link_args.append("-Wl,-rpath,%s" % ivlibdir)
# as neuron module will be built during make, add build/lib

View File

@ -1,31 +0,0 @@
{ lib
, buildPythonPackage
, fetchPypi
, numpy
, matplotlib
, scipy
, isPy27
}:
buildPythonPackage rec {
pname = "neuronpy";
version = "0.1.6";
disabled = !isPy27;
src = fetchPypi {
inherit pname version;
sha256 = "1clhc2b5fy2l8nfrji4dagmj9419nj6kam090yqxhq5c28sngk25";
};
propagatedBuildInputs = [ numpy matplotlib scipy ];
#No tests included
doCheck = false;
meta = with lib; {
description = "Interfaces and utilities for the NEURON simulator and analysis of neural data";
maintainers = [ maintainers.nico202 ];
license = licenses.mit;
};
}

View File

@ -36422,11 +36422,11 @@ with pkgs;
nest-mpi = callPackage ../applications/science/biology/nest { withMpi = true; }; nest-mpi = callPackage ../applications/science/biology/nest { withMpi = true; };
neuron = callPackage ../applications/science/biology/neuron { python = null; }; neuron = callPackage ../applications/science/biology/neuron { };
neuron-mpi = neuron.override {useMpi = true; }; neuron-mpi = neuron.override {useMpi = true; };
neuron-full = neuron-mpi.override { python = python2; }; neuron-full = neuron-mpi.override { useCore = true; useRx3d = true; };
mrbayes = callPackage ../applications/science/biology/mrbayes { }; mrbayes = callPackage ../applications/science/biology/mrbayes { };

View File

@ -6334,11 +6334,9 @@ self: super: with self; {
networkx = callPackage ../development/python-modules/networkx { }; networkx = callPackage ../development/python-modules/networkx { };
neuron-mpi = toPythonModule (pkgs.neuron-mpi.override { inherit python; }); neuron-full = pkgs.neuron-full.override { python3 = python; };
neuron = toPythonModule (pkgs.neuron.override { inherit python; }); neuronpy = python.pkgs.toPythonModule neuron-full;
neuronpy = callPackage ../development/python-modules/neuronpy { };
nevow = callPackage ../development/python-modules/nevow { }; nevow = callPackage ../development/python-modules/nevow { };