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

Build system improvements backported from Debian #6180

Merged
merged 7 commits into from
Jun 12, 2023

Conversation

roehling
Copy link
Contributor

@roehling roehling commented May 27, 2023

Motivation and Context

These are changes to the build system which have been applied for the Debian packaging. The pull request intends to minimize divergence between upstream and Debian.

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.

Description

This PR combines multiple patches:

  • Add option USE_SYSTEM_EMBREE makes it possible to build Open3D using the system-installed Embree library
  • Add option USE_SYSTEM_STDGPU does the same for stdgpu
  • Add option USE_SYSTEM_CUTLASS does the same for cutlass
  • Add workaround for missing TBBConfig.cmake improves compatibility with a few older Debian and Ubuntu versions where the system TBB has a broken CMake configuration file.
  • Add option WITH_MINIZIP is a simple way to add the unzip.h header if the system zlib library does not provide it (OFF by default, used in the Debian build)
  • Add support to set Sphinx build date facilitates reproducible builds, the build date in the documentation can be set to the release date and is no longer dependent on the actual build time.

This change is Reviewable

@update-docs
Copy link

update-docs bot commented May 27, 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.

@ssheorey
Copy link
Member

Hi @roehling can you provide the logs for a cmake build with these new options enabled? I ran into some cmake errors when trying to build with these new options (Ubuntu 22.04):

Cannot use the deb embree package:

CMake Warning at 3rdparty/find_dependencies.cmake:290 (find_package):               
  Could not find a configuration file for package "embree" that is compatible       
  with requested version "".                                                        
                                                                                    
  The following configuration files were considered but not accepted:               
                                                                                    
    /usr/lib/x86_64-linux-gnu/cmake/embree-3.12.2/embree-config.cmake, version: 3.12.2
    /lib/x86_64-linux-gnu/cmake/embree-3.12.2/embree-config.cmake, version: 3.12.2  
                                                                                    
Call Stack (most recent call first):                                                
  3rdparty/find_dependencies.cmake:1872 (open3d_find_package_3rdparty_library)      
  CMakeLists.txt:500 (include)        

Error during cmake Generate step for cutlass:

 CMake Error: install(EXPORT "Open3DTargets" ...) includes target "Open3D" which requires target "3rdparty_cutlass" that is not in any export set.
 CMake Error in CMakeLists.txt:
   export called with target "Open3D" which requires target "3rdparty_cutlass"
   that is not in any export set.

@roehling
Copy link
Contributor Author

It looks like the embree failure is a packaging error that has been fixed in Debian bookworm and later, namely libembree-dev is missing a dependency on libtbb-dev. The cutlass error is my mistake, I usually build with -DBUILD_SHARED_LIBS=ON and failed to check that it works with static linkage, too. I'll amend the PR accordingly.

@ssheorey ssheorey self-assigned this Jun 12, 2023
Copy link
Member

@ssheorey ssheorey left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @roehling

C++ unit tests pass with cmake -DUSE_SYSTEM_EMBREE=ON -DUSE_SYSTEM_CUTLASS=ON -DWITH_MINIZIP=ON -DBUILD_CUDA_MODULE=ON ..

USE_SYSTEM_STDGPU is not tested since deb package is not available yet.

@ssheorey ssheorey merged commit ff22900 into isl-org:master Jun 12, 2023
36 checks passed
@roehling
Copy link
Contributor Author

FYI the stdgpu package with CUDA support is available in Debian unstable now:

https://packages.debian.org/source/sid/stdgpu-contrib

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.

None yet

2 participants