From 1e0912d772257c2731e9424e36464930a7a22604 Mon Sep 17 00:00:00 2001 From: Ben Darwin Date: Fri, 31 Jan 2020 15:30:02 -0500 Subject: ocamlPackages.torch: init at 0.8 --- pkgs/development/ocaml-modules/torch/default.nix | 56 ++++++++++++++++++++++++ 1 file changed, 56 insertions(+) create mode 100644 pkgs/development/ocaml-modules/torch/default.nix (limited to 'pkgs/development/ocaml-modules') diff --git a/pkgs/development/ocaml-modules/torch/default.nix b/pkgs/development/ocaml-modules/torch/default.nix new file mode 100644 index 000000000000..457259bb1bbd --- /dev/null +++ b/pkgs/development/ocaml-modules/torch/default.nix @@ -0,0 +1,56 @@ +{ stdenv +, buildDunePackage +, fetchFromGitHub +, cmdliner +, ctypes +, npy +, ocaml-compiler-libs +, ppx_custom_printf +, ppx_expect +, ppx_sexp_conv +, sexplib +, stdio +, pytorch +}: + +buildDunePackage rec { + pname = "torch"; + version = "0.8"; + + owner = "LaurentMazare"; + + minimumOCamlVersion = "4.07"; + + src = fetchFromGitHub { + inherit owner; + repo = "ocaml-${pname}"; + rev = version; + sha256 = "19w31paj24pns2ahk9j9rgpkb5hpcd41kfaarxrlddww5dl6pxvi"; + }; + + 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 = true; + checkPhase = "dune runtest"; + + meta = with stdenv.lib; { + inherit (src.meta) homepage; + description = "Ocaml bindings to Pytorch"; + maintainers = [ maintainers.bcdarwin ]; + license = licenses.asl20; + }; +} -- cgit 1.4.1