nixpkgs/pkgs/development/python-modules/pytorch
Daniël de Kok 2611e96bf3 python3Packages.pytorch: create separate lib output
At some point pytorch.dev was added to expose the libtorch headers and
libraries to non-Python users of libtorch. However, this output
currently has two disadvantages:

1. An application that compiles against the dev output will also have
   the libtorch header files in its closure. This is not so nice when
   e.g. building Docker images of applications that use libtorch.
2. The dev output has a large transitive closure with many dependencies
   that are not necessary when compiling against libtorch.

This change adds the `lib` output so that applications that only link
against libtorch libraries have a small closure.

Before this change, the libtorch dependency adds 746MiB:

% nix path-info -S `realpath result-dev`
/nix/store/10rmy81bjk628sfpbj2szxlws6brq1xn-python3.8-pytorch-1.5.1-dev   782203848

With this change it is reduced to 196MiB:

% nix path-info -S `realpath result-lib`
/nix/store/bck65lf0z7gdhcf89w1zs5nz333lhgwa-python3.8-pytorch-1.5.1-lib   205865056
2020-07-12 08:34:19 +02:00
..
default.nix python3Packages.pytorch: create separate lib output 2020-07-12 08:34:19 +02:00