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

Enable shared library linking for open3d*.wheel #5931

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

yuecideng
Copy link
Collaborator

@yuecideng yuecideng commented Feb 18, 2023

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 PR aims at solving the issue mentioned at #5904.

steps:

cd Open3D
mkdir build && cd build
cmake .. -DBUILD_SHARED_LIBS=ON
make 
make install-pip-package

The c++ lib and include will be installed inside the open3d package , which is in the current python environment.
The open3d/cpu/pybind*.so (eg. ubuntu, cpu version) will is linked with the open3d/lib/libOpen3D.so

I have tested the change on macos and ubuntu 20.04. Windows is not yet tested. I will follow up if the CI fail.

TODO:

  • Add changes to CI, such that the wheels are built with -DBUILD_SHARD_LIBS=ON.
  • Add variable to open3d to indicate the path of cmake config.

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.
  • [x ] I will follow up and update the code if CI fails.
  • For fork PRs, I have selected Allow edits from maintainers.

Description


This change is Reviewable

@update-docs
Copy link

update-docs bot commented Feb 18, 2023

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

@yuecideng
Copy link
Collaborator Author

Previously, Open3D builds wheel with both cpu and cuda, so there are two folder cpu and cuda inside the wheel produced in CI. For static library, it is ok for user to import (with or without cuda in the machine). Now we want to use shared library, what is the best way to organize the folder structure such that we can achieve the same behaviour? @yxlao @ssheorey

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant