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

Add BUILD_DEBIAN_PACKAGE option for Debian package support #6982

Open
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

meetgandhi-dev
Copy link

Introduced the BUILD_DEBIAN_PACKAGE CMake option to enable building a Debian package for the library. When this option is enabled and the host system supports Debian, the library will be packaged accordingly.

Usage:
To enable debian package building:
`cmake -DBUILD_DEBIAN_PACKAGE=ON <other_config_options> ..

To build debian package:
make package
or
cpack

Type

  • Bug fix (non-breaking change which fixes an issue): Fixes #
  • New feature (non-breaking change which adds functionality). Resolves #
  • Breaking change (fix or feature that would cause existing functionality to not work as expected) Resolves #

Motivation and Context

This feature simplifies installation by allowing users to generate a Debian package directly through CMake, adhering to standard packaging conventions and enabling seamless integration with package management tools like apt. By streamlining the development workflow, we empower developers to focus on feature enhancement while encouraging community contributions and customisation. Overall, this initiative broadens our library's reach and strengthens its position within the open-source ecosystem, making it more user-friendly and accessible.

Checklist:

  • I have run python util/check_style.py --apply to apply Open3D code style
    to my code.
  • This PR changes Open3D behavior or adds new functionality.
    • Both C++ (Doxygen) and Python (Sphinx / Google style) documentation is
      updated accordingly.
    • I have added or updated C++ and / or Python unit tests OR included test
      results
      (e.g. screenshots or numbers) here.
  • I will follow up and update the code if CI fails.
  • For fork PRs, I have selected Allow edits from maintainers.

Here is the summary of different outouts:

$ cmake -DBUILD_DEBIAN_PACKAGE=ON ..

configure.log

cpack

$ cpack
CPack: Create package using DEB
CPack: Install projects
CPack: - Run preinstall target for: Open3D
CPack: - Install project: Open3D []
CPack: Create package
CPackDeb: - Generating dependency list
CPack: - package: /home/meet/Open3D/build/package/open3d_0.18.0_amd64.deb generated.

Install manifests:

install_manifest.txt

Introduced the `BUILD_DEBIAN_PACKAGE` CMake option to enable building a Debian package for the library.
When this option is enabled and the host system supports Debian, the library will be packaged accordingly.

Usage:
To enable debian package building:
`cmake -DBUILD_DEBIAN_PACKAGE=ON <other_config_options> ..

To build debian package:
`make package`
or
`cpack`

Signed-off-by: Meet Gandhi <[email protected]>
Copy link

update-docs bot commented Sep 23, 2024

Thanks for submitting this pull request! The maintainers of this repository would appreciate if you could update the CHANGELOG.md based on your changes.

@ssheorey ssheorey self-requested a review September 23, 2024 23:23
@ssheorey
Copy link
Member

Hi @meetgandhi-dev This is a really useful PR. Can you add this to the CI, so we can test the resulting deb package?

Screenshot 2024-09-27 at 6 03 06 PM

You can add to the CI here. Essentially, just copy the steps we do for make package (tar.xz) (copying out of the docker container and uploading to github later, etc.). Let me know if you need help with this and I can help as well.

- Enabled `BUILD_DEBIAN_PACKAGE` to ensure Debian package creation if supported.
- Previously, TXZ (.tar.xz) packaging was disabled, which could break dependent pipelines.

Signed-off-by: Meet Gandhi <[email protected]>
@meetgandhi-dev
Copy link
Author

Hello @ssheorey
I have made the required changes as per my understanding. Let me know your feedback!

- Used the same name format for the Debian package to differentiate between different build options.
- Added logic to copy the Debian package (if generated) to the root directory.
- Updated CI pipeline to upload the generated Debian package as artifact.

Signed-off-by: Meet Gandhi <[email protected]>
@ssheorey
Copy link
Member

Hi @meetgandhi-dev can you check the CI? The deb package was not created (The CI runs on Ubuntu 20.04).

https://github.com/isl-org/Open3D/actions/runs/11086074701/job/30938149427?pr=6982#step:4:13576

@ssheorey ssheorey added the status / needs info Waiting for information from reporter / author label Oct 21, 2024
@meetgandhi-dev
Copy link
Author

Hello @ssheorey ,
I’ve attempted to resolve the issue. Could you please check again with the latest version?

Signed-off-by: Meet Gandhi <[email protected]>
@ssheorey
Copy link
Member

HI @meetgandhi-dev thanks for the update. I can now locally build the deb package and install it. One issue with the deb package is libtbb.so. Currently, we only package .tar.gz binary archives that are "all inclusive" and are locally installed. deb packages must however work with the OS, i.e. not conflict with other packages in the system. Currently, open3d will install libtbb.so, which conflicts with the system package libtbb. We need to make this change:

  • Do not install libtbb for the deb package. It should still be included in the tar.xz package as before.
  • Add a dependence for open3d on libtbb12, so that apt will install it for us.

@meetgandhi-dev
Copy link
Author

@ssheorey Thanks for the heads up! When we disable the tbb build by setting -DUSE_SYSTEM_TBB=ON, it isn't being installed. Should we skip the installation even if USE_SYSTEM_TBB is set to OFF and TBB_BUILD is set to ON?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status / needs info Waiting for information from reporter / author
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants