2023-02-22 10:55:15 +00:00
|
|
|
{ lib
|
|
|
|
, stdenv
|
|
|
|
, fetchFromGitHub
|
|
|
|
, testers
|
|
|
|
, cmake
|
|
|
|
, gsl
|
|
|
|
, libtool
|
2023-03-04 12:14:45 +00:00
|
|
|
, findutils
|
|
|
|
, llvmPackages
|
2023-02-22 10:55:15 +00:00
|
|
|
, mpi
|
|
|
|
, nest
|
|
|
|
, pkg-config
|
2023-03-04 12:14:45 +00:00
|
|
|
, boost
|
2023-02-22 10:55:15 +00:00
|
|
|
, python3
|
|
|
|
, readline
|
|
|
|
, autoPatchelfHook
|
|
|
|
, withPython ? false
|
|
|
|
, withMpi ? false
|
|
|
|
}:
|
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "nest";
|
2023-07-15 17:15:38 +00:00
|
|
|
version = "3.5";
|
2023-02-22 10:55:15 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "nest";
|
|
|
|
repo = "nest-simulator";
|
|
|
|
rev = "v${version}";
|
2023-07-15 17:15:38 +00:00
|
|
|
hash = "sha256-PPUIXlU6noJRAa/twNSKVxPgIvbWl0OillEJRDzt+4s=";
|
2023-02-22 10:55:15 +00: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-03-04 12:14:45 +00:00
|
|
|
findutils
|
2023-02-22 10:55:15 +00:00
|
|
|
];
|
|
|
|
|
|
|
|
buildInputs = [
|
|
|
|
gsl
|
|
|
|
readline
|
|
|
|
libtool # libltdl
|
2023-03-04 12:14:45 +00:00
|
|
|
boost
|
2023-02-22 10:55:15 +00:00
|
|
|
] ++ lib.optionals withPython [
|
|
|
|
python3
|
|
|
|
python3.pkgs.cython
|
2023-03-04 12:14:45 +00:00
|
|
|
] ++ lib.optional withMpi mpi
|
|
|
|
++ lib.optional stdenv.isDarwin llvmPackages.openmp;
|
|
|
|
|
|
|
|
propagatedBuildInputs = with python3.pkgs; [
|
|
|
|
numpy
|
|
|
|
];
|
2023-02-22 10:55:15 +00:00
|
|
|
|
|
|
|
cmakeFlags = [
|
|
|
|
"-Dwith-python=${if withPython then "ON" else "OFF"}"
|
|
|
|
"-Dwith-mpi=${if withMpi then "ON" else "OFF"}"
|
2023-03-04 12:14:45 +00:00
|
|
|
"-Dwith-openmp=ON"
|
2023-02-22 10:55:15 +00:00
|
|
|
];
|
|
|
|
|
2023-03-04 12:14:45 +00:00
|
|
|
postInstall = ''
|
|
|
|
# Alternative to autoPatchElf, moves libraries where
|
|
|
|
# Nest expects them to be
|
2023-03-24 00:07:29 +00:00
|
|
|
find $out/lib/nest -exec ln -s {} $out/lib \;
|
2023-03-04 12:14:45 +00:00
|
|
|
'';
|
|
|
|
|
2023-02-22 10:55:15 +00:00
|
|
|
passthru.tests.version = testers.testVersion {
|
|
|
|
package = nest;
|
|
|
|
command = "nest --version";
|
|
|
|
};
|
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
description = "NEST is a command line tool for simulating neural networks";
|
|
|
|
homepage = "https://www.nest-simulator.org/";
|
2023-03-24 00:07:29 +00:00
|
|
|
changelog = "https://github.com/nest/nest-simulator/releases/tag/v${version}";
|
|
|
|
license = licenses.gpl2Plus;
|
2023-03-04 12:14:45 +00:00
|
|
|
maintainers = with maintainers; [ jiegec davidcromp ];
|
2023-02-22 10:55:15 +00:00
|
|
|
platforms = platforms.unix;
|
|
|
|
};
|
|
|
|
}
|