Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create Debian packages #5285

Closed
alexreinking opened this issue Sep 20, 2020 · 6 comments · Fixed by #5754
Closed

Create Debian packages #5285

alexreinking opened this issue Sep 20, 2020 · 6 comments · Fixed by #5754
Assignees
Labels
build Issues related to building Halide and with CI contributor project
Milestone

Comments

@alexreinking
Copy link
Member

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.

@alexreinking alexreinking added build Issues related to building Halide and with CI contributor project labels Sep 20, 2020
@alexreinking alexreinking self-assigned this Sep 20, 2020
@alexreinking alexreinking added this to To do in Build system improvements via automation Sep 20, 2020
@alexreinking alexreinking moved this from To do to In progress in Build system improvements Sep 20, 2020
@abadams
Copy link
Member

abadams commented Sep 20, 2020

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

@steven-johnson
Copy link
Contributor

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...

@alexreinking
Copy link
Member Author

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.

@abadams
Copy link
Member

abadams commented Sep 21, 2020

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.

@alexreinking
Copy link
Member Author

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

@alexreinking alexreinking added this to the v11.0.0 milestone Sep 21, 2020
@alexreinking alexreinking modified the milestones: v11.0.0, v12.0.0 Oct 17, 2020
Build system improvements automation moved this from In progress to Done May 17, 2021
@LebedevRI
Copy link
Contributor

Congratulations, everyone:
Accepted halide 12.0.1-1 (source amd64 all) into unstable, unstable

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
build Issues related to building Halide and with CI contributor project
Projects
Development

Successfully merging a pull request may close this issue.

4 participants