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

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

69 lines
1.3 KiB
Nix
Raw Normal View History

2020-06-24 07:52:44 +00:00
{ lib
, stdenv
2020-01-31 20:30:02 +00:00
, buildDunePackage
, fetchFromGitHub
, fetchpatch
2020-01-31 20:30:02 +00:00
, cmdliner
, ctypes
2020-12-12 15:36:41 +00:00
, dune-configurator
2020-01-31 20:30:02 +00:00
, npy
, ocaml-compiler-libs
, ppx_custom_printf
, ppx_expect
, ppx_sexp_conv
, sexplib
, stdio
, torch
2020-01-31 20:30:02 +00:00
}:
buildDunePackage rec {
pname = "torch";
2023-02-09 07:10:37 +00:00
version = "0.17";
2020-12-12 15:36:41 +00:00
2023-02-09 07:10:37 +00:00
duneVersion = "3";
2021-08-22 20:37:32 +00:00
minimalOCamlVersion = "4.08";
2020-01-31 20:30:02 +00:00
src = fetchFromGitHub {
2020-06-24 07:52:44 +00:00
owner = "LaurentMazare";
repo = "ocaml-${pname}";
rev = version;
2023-02-09 07:10:37 +00:00
hash = "sha256-z/9NUBjeFWE63Z/e8OyzDiy8hrn6qzjaiBH8G9MPeos=";
2020-01-31 20:30:02 +00:00
};
patches = [
# Pytorch 2.0 support. Drop when it reaches a release
(fetchpatch {
url = "https://github.com/LaurentMazare/ocaml-torch/commit/ef7ef30cafecb09e45ec1ed8ce4bedae5947cfa5.patch";
hash = "sha256-smdwKy40iIISp/25L2J4az6KmqFS1soeChBElUyhl5A=";
})
];
2020-12-12 15:36:41 +00:00
buildInputs = [ dune-configurator ];
2020-01-31 20:30:02 +00:00
propagatedBuildInputs = [
cmdliner
ctypes
npy
ocaml-compiler-libs
ppx_custom_printf
ppx_expect
ppx_sexp_conv
sexplib
stdio
torch
torch.dev
2020-01-31 20:30:02 +00:00
];
preBuild = "export LIBTORCH=${torch.dev}/";
2020-01-31 20:30:02 +00:00
doCheck = !stdenv.isAarch64;
2020-01-31 20:30:02 +00:00
checkPhase = "dune runtest";
2020-06-24 07:52:44 +00:00
meta = with lib; {
2020-01-31 20:30:02 +00:00
inherit (src.meta) homepage;
description = "Ocaml bindings to Pytorch";
maintainers = [ maintainers.bcdarwin ];
license = licenses.asl20;
};
}