nixpkgs-suyu/pkgs/development/ocaml-modules/torch/default.nix

61 lines
1 KiB
Nix
Raw Normal View History

2020-06-24 09:52:44 +02:00
{ lib
, stdenv
2020-01-31 21:30:02 +01:00
, buildDunePackage
, fetchFromGitHub
, cmdliner
, ctypes
2020-12-12 16:36:41 +01:00
, dune-configurator
2020-01-31 21:30:02 +01:00
, npy
, ocaml-compiler-libs
, ppx_custom_printf
, ppx_expect
, ppx_sexp_conv
, sexplib
, stdio
, pytorch
}:
buildDunePackage rec {
pname = "torch";
2021-08-22 22:37:32 +02:00
version = "0.13";
2020-01-31 21:30:02 +01:00
2020-12-12 16:36:41 +01:00
useDune2 = true;
2021-08-22 22:37:32 +02:00
minimalOCamlVersion = "4.08";
2020-01-31 21:30:02 +01:00
src = fetchFromGitHub {
2020-06-24 09:52:44 +02:00
owner = "LaurentMazare";
2020-01-31 21:30:02 +01:00
repo = "ocaml-${pname}";
rev = version;
2021-08-22 22:37:32 +02:00
sha256 = "0528h1mkrqbmbf7hy91dsnxcg0k55m3jgharr71c652xyd847yz7";
2020-01-31 21:30:02 +01:00
};
2020-12-12 16:36:41 +01:00
buildInputs = [ dune-configurator ];
2020-01-31 21:30:02 +01:00
propagatedBuildInputs = [
cmdliner
ctypes
npy
ocaml-compiler-libs
pytorch
pytorch.dev
ppx_custom_printf
ppx_expect
ppx_sexp_conv
sexplib
stdio
];
preBuild = "export LIBTORCH=${pytorch.dev}/";
2020-01-31 21:30:02 +01:00
doCheck = !stdenv.isAarch64;
2020-01-31 21:30:02 +01:00
checkPhase = "dune runtest";
2020-06-24 09:52:44 +02:00
meta = with lib; {
2020-01-31 21:30:02 +01:00
inherit (src.meta) homepage;
description = "Ocaml bindings to Pytorch";
maintainers = [ maintainers.bcdarwin ];
license = licenses.asl20;
};
}