2022-11-01 10:45:33 +08:00
|
|
|
{
|
|
|
|
|
lib,
|
|
|
|
|
stdenv,
|
|
|
|
|
fetchFromGitHub,
|
|
|
|
|
testers,
|
|
|
|
|
cmake,
|
|
|
|
|
gsl,
|
|
|
|
|
libtool,
|
2023-02-23 14:52:36 -05:00
|
|
|
findutils,
|
|
|
|
|
llvmPackages,
|
2022-11-01 10:45:33 +08:00
|
|
|
mpi,
|
|
|
|
|
nest,
|
|
|
|
|
pkg-config,
|
2023-02-23 14:52:36 -05:00
|
|
|
boost,
|
2022-11-01 10:45:33 +08:00
|
|
|
python3,
|
|
|
|
|
readline,
|
|
|
|
|
withPython ? false,
|
|
|
|
|
withMpi ? false,
|
|
|
|
|
}:
|
|
|
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
|
pname = "nest";
|
2024-08-03 02:21:53 +00:00
|
|
|
version = "3.8";
|
2022-11-01 10:45:33 +08:00
|
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
|
owner = "nest";
|
|
|
|
|
repo = "nest-simulator";
|
2025-04-08 02:51:45 -04:00
|
|
|
rev = "v${version}";
|
2024-08-03 02:21:53 +00:00
|
|
|
hash = "sha256-hysOe1ZZpCClVOGo0+UeCP7imAakXrZlnJ4V95zfiyA=";
|
2022-11-01 10:45:33 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
postPatch = ''
|
|
|
|
|
patchShebangs cmake/CheckFiles/check_return_val.sh
|
|
|
|
|
# fix PyNEST installation path
|
|
|
|
|
# it expects CMAKE_INSTALL_LIBDIR to be relative
|
|
|
|
|
substituteInPlace cmake/ProcessOptions.cmake \
|
|
|
|
|
--replace "\''${CMAKE_INSTALL_LIBDIR}/python" "lib/python"
|
|
|
|
|
'';
|
|
|
|
|
|
|
|
|
|
nativeBuildInputs = [
|
|
|
|
|
cmake
|
|
|
|
|
pkg-config
|
2023-02-23 14:52:36 -05:00
|
|
|
findutils
|
2022-11-01 10:45:33 +08:00
|
|
|
];
|
|
|
|
|
|
|
|
|
|
buildInputs =
|
|
|
|
|
[
|
|
|
|
|
gsl
|
|
|
|
|
readline
|
|
|
|
|
libtool # libltdl
|
2023-02-23 14:52:36 -05:00
|
|
|
boost
|
2022-11-01 10:45:33 +08:00
|
|
|
]
|
|
|
|
|
++ lib.optionals withPython [
|
|
|
|
|
python3
|
|
|
|
|
python3.pkgs.cython
|
2023-02-23 14:52:36 -05:00
|
|
|
]
|
|
|
|
|
++ lib.optional withMpi mpi
|
|
|
|
|
++ lib.optional stdenv.hostPlatform.isDarwin llvmPackages.openmp;
|
|
|
|
|
|
|
|
|
|
propagatedBuildInputs = with python3.pkgs; [
|
|
|
|
|
numpy
|
|
|
|
|
];
|
2022-11-01 10:45:33 +08:00
|
|
|
|
|
|
|
|
cmakeFlags = [
|
|
|
|
|
"-Dwith-python=${if withPython then "ON" else "OFF"}"
|
|
|
|
|
"-Dwith-mpi=${if withMpi then "ON" else "OFF"}"
|
2023-02-23 14:52:36 -05:00
|
|
|
"-Dwith-openmp=ON"
|
2022-11-01 10:45:33 +08:00
|
|
|
];
|
|
|
|
|
|
2023-02-23 14:52:36 -05:00
|
|
|
postInstall = ''
|
|
|
|
|
# Alternative to autoPatchElf, moves libraries where
|
|
|
|
|
# Nest expects them to be
|
2023-03-18 12:13:46 +02:00
|
|
|
find $out/lib/nest -exec ln -s {} $out/lib \;
|
2023-02-23 14:52:36 -05:00
|
|
|
'';
|
|
|
|
|
|
2022-11-01 10:45:33 +08:00
|
|
|
passthru.tests.version = testers.testVersion {
|
|
|
|
|
package = nest;
|
|
|
|
|
command = "nest --version";
|
|
|
|
|
};
|
|
|
|
|
|
2025-06-02 08:42:56 +02:00
|
|
|
meta = {
|
2025-07-21 00:52:16 -07:00
|
|
|
description = "Command line tool for simulating neural networks";
|
2022-11-01 10:45:33 +08:00
|
|
|
homepage = "https://www.nest-simulator.org/";
|
2023-03-18 11:23:06 +01:00
|
|
|
changelog = "https://github.com/nest/nest-simulator/releases/tag/v${version}";
|
2025-06-02 08:42:56 +02:00
|
|
|
license = lib.licenses.gpl2Plus;
|
|
|
|
|
maintainers = with lib.maintainers; [
|
2023-02-23 14:52:36 -05:00
|
|
|
jiegec
|
|
|
|
|
davidcromp
|
|
|
|
|
];
|
2025-06-02 08:42:56 +02:00
|
|
|
platforms = lib.platforms.unix;
|
2022-11-01 10:45:33 +08:00
|
|
|
};
|
|
|
|
|
}
|