halide / Halide

a language for fast, portable data-parallel computation

Home Page:https://halide-lang.org

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Create Debian packages

alexreinking opened this issue · comments

It would be nice for users of Debian and/or Ubuntu to simply run:

$ sudo apt install libhalide libhalide-dev libhalide-doc

However, the rules for getting a package upstreamed are stringent and there's a veritable book of package guidelines for Debian, here:

https://www.debian.org/doc/manuals/debmake-doc/

and Ubuntu extends it here:

https://packaging.ubuntu.com/html/index.html

However, PPAs are more "anything goes". I think the right strategy is to figure out deb packaging enough that we get an established user base on the PPA and then try to make the package conform to upstream guidelines, possibly with some help from maintainers.


Even with the flexible Ubuntu PPA rules, there are a few things that we do need to keep in mind to be good citizens:

  1. We should build and link against Ubuntu's own shared libraries. This just means LLVM.
  2. We need to split our library across three packages:
    a. libhalide which includes the .so [1] and the autoscheduler modules.
    b. libhalide-dev which includes most other things: .a, headers, tools, etc.
    c. libhalide-doc which includes the tutorials and the doxygen documentation.
  3. We need to list libjpeg-dev, libpng-dev as "recommended" packages of libhalide-dev
  4. We need to list libhalide as a dependency of libhalide-dev and libhalide-doc as a suggested package for libhalide-dev.
  5. libhalide-doc shouldn't have any dependencies.
  6. We need to package from inside a chroot with a minimal environment.

[1] I did an apt-file search for every .a in my /usr directory and of the 500+ static libs there, all but 47 were in the corresponding -dev package. The others were from liblld-10, which I'm nearly certain is mis-packaged; ocaml-nox, which I'm guessing needs them for linking; and valgrind, pristine-tar, and python3-numpy for unknown reasons.

Not sure I understand where to draw the line between -dev and not. Does llvm distinguish between libllvm and libllvm-dev?

What version(s) of LLVM does Ubuntu include? Since we don't support anything older than LLVM9 (and will soon be dropping that), that could be a problem...

Not sure I understand where to draw the line between -dev and not. Does llvm distinguish between libllvm and libllvm-dev?

-dev is meant to enable the development of new software with that library. The plain package includes shared libraries only so that applications that link against them don't need to install all the developer tools too. The Ubuntu packages do distinguish between llvm and llvm-dev.

What version(s) of LLVM does Ubuntu include? Since we don't support anything older than LLVM9 (and will soon be dropping that), that could be a problem...

Ubuntu 20.04 LTS includes 10.0.0, which is fine.

I asked because I couldn't think of a case where libhalide.so is useful to anyone without the headers too, but I guess libhalide without the -dev is useful for some hypothetical application that wants to use halide for jit internally.

Right. Developers will install libhalide-dev. Applications that want to use Halide in JIT mode can take libhalide as a dep.