Summary of Changes
Hello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!
This pull request introduces the capability to build COLMAP as shared libraries, offering an alternative to the default static library build. This change primarily benefits development workflows by potentially speeding up edit-compile-test cycles due to faster incremental linking. The build system has been updated to support this new option, and comprehensive documentation has been added to guide users on its usage and implications.
Highlights
- Shared Library Build Option: A new CMake option,
BUILD_SHARED_LIBS, has been introduced to allow users to build COLMAP as shared libraries instead of the default static libraries. This option is set toOFFby default. - CMake Macro Refinement: The
COLMAP_ADD_LIBRARYmacro inCMakeHelper.cmakehas been updated to dynamically determine the library type (static or shared) based on theBUILD_SHARED_LIBSoption, removing the previous hardcoded default toSTATIC. - Documentation Update: The
doc/install.rstfile now includes a dedicated section on building shared libraries, outlining the command to enable the option and discussing the trade-offs between shared and static libraries (e.g., faster incremental linking vs. runtime performance). - GTest/GMock Linking for Shared Libraries: Special handling has been added to
src/colmap/util/CMakeLists.txtto correctly linkgtestandgmockwhen building shared libraries. This involves platform-specific linker flags (-Wl,--whole-archive,/WHOLEARCHIVE,-Wl,-force_load) to ensure all symbols are available and avoid duplicate singletons. - Library Dependency Adjustments: Several
CMakeLists.txtfiles (src/colmap/retrieval,src/colmap/sensor,src/colmap/ui) have had theirPUBLIC_LINK_LIBSandPRIVATE_LINK_LIBSadjusted to correctly propagate dependencies, especially in the context of shared library builds.
- CMakeLists.txt
- Added
BUILD_SHARED_LIBSCMake option, defaulting toOFF.
- Added
- cmake/CMakeHelper.cmake
- Removed explicit default to
STATICforCOLMAP_ADD_LIBRARY_TYPE. - Modified
add_librarycall to no longer explicitly specifySTATICtype. - Removed the
FATAL_ERRORfor unknown library types.
- Removed explicit default to
- doc/install.rst
- Added a new section titled 'Shared Libraries' to the installation documentation.
- Included instructions for enabling
BUILD_SHARED_LIBS. - Provided a detailed comparison of trade-offs between static and shared libraries.
- src/colmap/retrieval/CMakeLists.txt
- Moved
colmap_util,colmap_math, andcolmap_feature_typesfromPRIVATE_LINK_LIBStoPUBLIC_LINK_LIBS.
- Moved
- src/colmap/sensor/CMakeLists.txt
- Moved
colmap_geometryandcolmap_utilfromPRIVATE_LINK_LIBStoPUBLIC_LINK_LIBS.
- Moved
- src/colmap/ui/CMakeLists.txt
- Added
colmap_mvstoPUBLIC_LINK_LIBS.
- Added
- src/colmap/util/CMakeLists.txt
- Relocated
target_sourcesfor testing files to be conditional onTESTS_ENABLED. - Implemented conditional linking logic for
gtest/gmockbased onBUILD_SHARED_LIBSforcolmap_util, using platform-specific whole-archive flags. - Adjusted
colmap_gtest_mainlinking to includecolmap_utilpublicly and conditionally linkGTest::gmock_mainfor static builds.
- Relocated
- No human activity (comments, reviews, etc.) has occurred on this pull request yet.
The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.
Invoking Gemini
You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.
| Feature | Command | Description |
|---|---|---|
| Code Review | /gemini review |
Performs a code review for the current pull request in its current state. |
| Pull Request Summary | /gemini summary |
Provides a summary of the current pull request in its current state. |
| Comment | @gemini-code-assist | Responds in comments when explicitly tagged, both in pull request comments and review comments. |
| Help | /gemini help |
Displays a list of available commands. |
Customization
To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.
Limitations & Feedback
Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with ๐ and ๐ on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.
You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.
Footnotes
-
Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution. โฉ