nixpkgs-suyu/pkgs/development/ocaml-modules/torch/default.nix
2021-08-24 09:40:26 +02:00

60 lines
1 KiB
Nix

{ lib
, stdenv
, buildDunePackage
, fetchFromGitHub
, cmdliner
, ctypes
, dune-configurator
, npy
, ocaml-compiler-libs
, ppx_custom_printf
, ppx_expect
, ppx_sexp_conv
, sexplib
, stdio
, pytorch
}:
buildDunePackage rec {
pname = "torch";
version = "0.13";
useDune2 = true;
minimalOCamlVersion = "4.08";
src = fetchFromGitHub {
owner = "LaurentMazare";
repo = "ocaml-${pname}";
rev = version;
sha256 = "0528h1mkrqbmbf7hy91dsnxcg0k55m3jgharr71c652xyd847yz7";
};
buildInputs = [ dune-configurator ];
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}/";
doCheck = !stdenv.isAarch64;
checkPhase = "dune runtest";
meta = with lib; {
inherit (src.meta) homepage;
description = "Ocaml bindings to Pytorch";
maintainers = [ maintainers.bcdarwin ];
license = licenses.asl20;
};
}