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 multi-core link time optimization #6181

Merged
merged 1 commit into from
Jun 8, 2023

Conversation

roehling
Copy link
Contributor

@roehling roehling commented May 27, 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

GCC runs LTO on a single core by default, making the final build step for the Python module needlessly long.

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

The PR sets the optional auto argument for the -flto option, which will distribute the workload among the available jobs from GNU make (or, as fallback if GNU make is not used, the number of detected CPU cores).


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 ssheorey self-requested a review May 30, 2023 18:34
@@ -66,6 +66,7 @@ elseif (UNIX) # Linux
};]=])
target_link_options(pybind PRIVATE $<$<CONFIG:Release>:
"-Wl,--version-script=${CMAKE_CURRENT_BINARY_DIR}/pybind.map" >)
target_link_options(pybind PRIVATE "-flto=auto")
Copy link
Member

Choose a reason for hiding this comment

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

Hi @roehling Is this something we can have for the Open3D DSO as well? (in cpp/open3d/CMakeLists.txt)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, but only after #4747 has been resolved.

@ssheorey ssheorey merged commit 96cc475 into isl-org:master Jun 8, 2023
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.

2 participants