Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

93 lines
1.9 KiB
Nix
Raw Normal View History

2022-11-01 10:45:33 +08:00
{
lib,
stdenv,
fetchFromGitHub,
testers,
cmake,
gsl,
libtool,
findutils,
llvmPackages,
2022-11-01 10:45:33 +08:00
mpi,
nest,
pkg-config,
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";
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
findutils
2022-11-01 10:45:33 +08:00
];
buildInputs =
[
gsl
readline
libtool # libltdl
boost
2022-11-01 10:45:33 +08:00
]
++ lib.optionals withPython [
python3
python3.pkgs.cython
]
++ 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"}"
"-Dwith-openmp=ON"
2022-11-01 10:45:33 +08: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 \;
'';
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 = {
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; [
jiegec
davidcromp
];
2025-06-02 08:42:56 +02:00
platforms = lib.platforms.unix;
2022-11-01 10:45:33 +08:00
};
}