Skip to content

Update cxxopts to v3.3.1 - #132

Open
vishesh9131 wants to merge 1 commit into
prabhuomkar:masterfrom
vishesh9131:update-cxxopts
Open

vishesh9131 wants to merge 1 commit into
prabhuomkar:masterfrom
vishesh9131:update-cxxopts

Conversation

@vishesh9131

Copy link
Copy Markdown

Description of the change

Configuring the project with CMake 4.x fails inside extern/cxxopts:

CMake Error at extern/cxxopts/CMakeLists.txt:20 (cmake_minimum_required):
  Compatibility with CMake < 3.5 has been removed from CMake.

cxxopts v2.2.0 declares cmake_minimum_required(VERSION 3.1). This updates it to v3.3.1 (the latest release, which declares 3.5...3.19), so the project configures on CMake 4 without passing -DCMAKE_POLICY_VERSION_MINIMUM=3.5. The CXXOPTS_BUILD_EXAMPLES, CXXOPTS_BUILD_TESTS and CXXOPTS_ENABLE_INSTALL options set in extern/CMakeLists.txt still exist in v3.3.1.

Only the image captioning tutorial uses cxxopts, and it needs no source changes (v3's Options::parse takes const char* const*, which char** converts to).

Testing (CMake 4.4.3, GCC 11.4, Ubuntu 22.04, libtorch 2.10.0): configuring with DOWNLOAD_DATASETS=OFF and building image-captioning succeed without the policy flag. I compared the old and new binaries:

Check v2.2.0 v3.3.1
--help 48 lines 48 lines (same text, trailing whitespace on wrapped lines)
default options Vocabulary size: 4076 Vocabulary size: 4076
--min_word_frequency=5 --batch_size=8 --validate_on_epoch_end=false Vocabulary size: 2985 Vocabulary size: 2985
unknown option / malformed value uncaught option_not_exists_exception / argument_incorrect_type uncaught exceptions::no_such_option / exceptions::incorrect_argument_type

Type Of Change

  • Bug Fix (non-breaking change that fixes an issue)
  • New Feature
  • New PyTorch tutorial
  • Breaking Change (cmake changes, fix or feature that would cause existing functionality to not work as expected)

Related Issues

None; found while building the tutorials with CMake 4 (no existing issue).

Development & Code Review

  • cpplint rules passes locally (run cmake -P cpplint.cmake)
  • CI is passing
  • Changes have been reviewed by at least one of the maintainers

cxxopts v2.2.0 declares cmake_minimum_required(VERSION 3.1). CMake 4
removed compatibility with versions older than 3.5, so configuring the
project fails unless CMAKE_POLICY_VERSION_MINIMUM is set. v3.3.1 declares
3.5...3.19 and needs no source changes in the image captioning tutorial.
@prabhuomkar

Copy link
Copy Markdown
Owner

why didn't the CI catch it? anyway we can handle this on CI side as well?

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