2020-07-18 16:06:22 +00:00
|
|
|
{ lib
|
2020-08-20 17:08:02 +00:00
|
|
|
, stdenv
|
2020-05-29 06:06:01 +00:00
|
|
|
, buildDunePackage
|
|
|
|
, fetchFromGitHub
|
|
|
|
, cmdliner
|
|
|
|
, ctypes
|
2020-12-25 13:55:36 +00:00
|
|
|
, dune-configurator
|
2020-05-29 06:06:01 +00:00
|
|
|
, npy
|
|
|
|
, ocaml-compiler-libs
|
|
|
|
, ppx_custom_printf
|
|
|
|
, ppx_expect
|
|
|
|
, ppx_sexp_conv
|
|
|
|
, sexplib
|
|
|
|
, stdio
|
2022-09-09 14:08:57 +00:00
|
|
|
, torch
|
2020-05-29 06:06:01 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
buildDunePackage rec {
|
|
|
|
pname = "torch";
|
2022-03-05 16:20:37 +00:00
|
|
|
version = "0.14";
|
2020-05-29 06:06:01 +00:00
|
|
|
|
2020-12-25 13:55:36 +00:00
|
|
|
useDune2 = true;
|
|
|
|
|
2021-08-25 08:27:29 +00:00
|
|
|
minimalOCamlVersion = "4.08";
|
2020-05-29 06:06:01 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
2020-07-18 16:06:22 +00:00
|
|
|
owner = "LaurentMazare";
|
2020-05-29 06:06:01 +00:00
|
|
|
repo = "ocaml-${pname}";
|
|
|
|
rev = version;
|
2022-03-05 16:20:37 +00:00
|
|
|
sha256 = "sha256:039anfvzsalbqi5cdp95bbixcwr2ngharihgd149hcr0wa47y700";
|
2020-05-29 06:06:01 +00:00
|
|
|
};
|
|
|
|
|
2020-12-25 13:55:36 +00:00
|
|
|
buildInputs = [ dune-configurator ];
|
|
|
|
|
2020-05-29 06:06:01 +00:00
|
|
|
propagatedBuildInputs = [
|
|
|
|
cmdliner
|
|
|
|
ctypes
|
|
|
|
npy
|
|
|
|
ocaml-compiler-libs
|
|
|
|
ppx_custom_printf
|
|
|
|
ppx_expect
|
|
|
|
ppx_sexp_conv
|
|
|
|
sexplib
|
|
|
|
stdio
|
2022-09-09 14:08:57 +00:00
|
|
|
torch
|
|
|
|
torch.dev
|
2020-05-29 06:06:01 +00:00
|
|
|
];
|
|
|
|
|
2022-09-09 14:08:57 +00:00
|
|
|
preBuild = "export LIBTORCH=${torch.dev}/";
|
2020-05-29 06:06:01 +00:00
|
|
|
|
2020-08-20 17:08:02 +00:00
|
|
|
doCheck = !stdenv.isAarch64;
|
2020-05-29 06:06:01 +00:00
|
|
|
checkPhase = "dune runtest";
|
|
|
|
|
2020-07-18 16:06:22 +00:00
|
|
|
meta = with lib; {
|
2020-05-29 06:06:01 +00:00
|
|
|
inherit (src.meta) homepage;
|
|
|
|
description = "Ocaml bindings to Pytorch";
|
|
|
|
maintainers = [ maintainers.bcdarwin ];
|
|
|
|
license = licenses.asl20;
|
2022-09-09 14:08:57 +00:00
|
|
|
broken = lib.versionAtLeast torch.version "1.11";
|
2020-05-29 06:06:01 +00:00
|
|
|
};
|
|
|
|
}
|