Skip to content

Refactor CMake with JRL CMake Modules v2 - #437

Draft
ahoarau wants to merge 232 commits into
Simple-Robotics:develfrom
ahoarau:jrl-next
Draft

Refactor CMake with JRL CMake Modules v2#437
ahoarau wants to merge 232 commits into
Simple-Robotics:develfrom
ahoarau:jrl-next

Conversation

@ahoarau

@ahoarau ahoarau commented Dec 11, 2025

Copy link
Copy Markdown
Collaborator

⚠️DO NOT MERGE UNTIL jrl-umi3218/jrl-cmakemodules#798 is merged ⚠️

This PR is a full rewrite of the CMake files with the JRL CMake Modules v2.

  • Full rewrite of the CMake Files in modern CMake
  • Remove submodules: archives can now be used
  • Remove external libraries
  • c++17 minimum required
  • pixi support
  • 🚧 NIX CI is temporarily disabled
  • Fix Documentation links
  • Support for find_package components
find_package(proxsuite 0.7.1 CONFIG REQUIRED COMPONENTS proxsuite vectorized)

@ahoarau
ahoarau marked this pull request as draft December 11, 2025 16:39
@ahoarau
ahoarau force-pushed the jrl-next branch 2 times, most recently from bd8de6d to c36d61e Compare December 22, 2025 14:54

@jorisv jorisv left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Nice work

Comment thread .github/workflows/conda/environment.yml Outdated
Comment thread .github/workflows/ci-linux-osx-win-conda.yml Outdated
Comment thread bindings/python/proxsuite/__init__.py
Comment thread examples/python/CMakeLists.txt
Comment thread examples/cpp/CMakeLists.txt
Comment thread CMakeLists.txt
Comment thread CMakeLists.txt
Comment thread CMakeLists.txt
Comment thread CMakeLists.txt Outdated
Comment thread CMakeLists.txt
@ahoarau
ahoarau force-pushed the jrl-next branch 6 times, most recently from 930496b to e4a6dd2 Compare January 9, 2026 07:33
@ahoarau
ahoarau force-pushed the jrl-next branch 3 times, most recently from 9920160 to 7ce7cbf Compare January 23, 2026 16:09
@ahoarau
ahoarau force-pushed the jrl-next branch 2 times, most recently from f85e65e to e238efe Compare February 11, 2026 18:32
@ahoarau
ahoarau force-pushed the jrl-next branch 7 times, most recently from b2617af to b0388c0 Compare February 20, 2026 09:26
@ahoarau
ahoarau force-pushed the jrl-next branch 2 times, most recently from 7f6f202 to 3d05dbd Compare March 24, 2026 08:52
@ahoarau
ahoarau force-pushed the jrl-next branch 2 times, most recently from 28e0fd5 to b09f8a3 Compare April 16, 2026 11:14
@ahoarau
ahoarau force-pushed the jrl-next branch 2 times, most recently from a104370 to 93c8745 Compare May 11, 2026 20:36

@jorisv jorisv left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

When running tests, following tests are failing on Linux with pixi:

         33 - proxsuite-test-cpp.dense_maros_meszaros (SEGFAULT)
         34 - proxsuite-test-cpp.vectorized.dense_maros_meszaros (SEGFAULT)
         35 - proxsuite-test-cpp.sparse_maros_meszaros (SEGFAULT)
         36 - proxsuite-test-cpp.vectorized.sparse_maros_meszaros (SEGFAULT)

Comment thread .github/workflows/ci-linux.yml Outdated
Comment thread .github/workflows/ci-linux.yml
Comment thread .github/workflows/ci-pixi.yml Outdated
Comment thread .github/workflows/ci-pixi.yml Outdated
Comment thread .github/workflows/ci-ros.yml Outdated
Comment thread bindings/python/proxsuite/__init__.py
Comment thread CMakeLists.txt Outdated
Comment thread CMakeLists.txt Outdated
Comment thread pixi.toml
Comment thread .github/workflows/ci-pixi.yml Outdated
Comment thread CMakeLists.txt Outdated
Comment thread CMakeLists.txt
jrl_option(PROXSUITE_EXPORT_PACKAGE "Generate the CMake export files" ${PROJECT_IS_TOP_LEVEL})
jrl_option(BUILD_TESTING "Build the tests" OFF)
jrl_option(BUILD_EXAMPLES "Build the examples" OFF)
jrl_option(BUILD_BENCHMARKS "Build the benchmarks" OFF)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Suggested change
jrl_option(BUILD_BENCHMARKS "Build the benchmarks" OFF)
jrl_option(BUILD_BENCHMARK "Build the benchmarks" OFF)

Comment thread CMakeLists.txt

jrl_option(PROXSUITE_EXPORT_PACKAGE "Generate the CMake export files" ${PROJECT_IS_TOP_LEVEL})
jrl_option(BUILD_TESTING "Build the tests" OFF)
jrl_option(BUILD_EXAMPLES "Build the examples" OFF)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Suggested change
jrl_option(BUILD_EXAMPLES "Build the examples" OFF)
jrl_option(PROXSUITE_BUILD_EXAMPLES "Build the examples" OFF)

BUILD_EXAMPLES is a new options

Comment thread CMakeLists.txt
jrl_option(BUILD_EXAMPLES "Build the examples" OFF)
jrl_option(BUILD_BENCHMARKS "Build the benchmarks" OFF)
jrl_option(BUILD_DOCUMENTATION "Build the documentation" OFF)
jrl_option(BUILD_MAROS_MESZAROS_TESTS "Build the Maros-Meszaros tests, needs matio library" OFF)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Suggested change
jrl_option(BUILD_MAROS_MESZAROS_TESTS "Build the Maros-Meszaros tests, needs matio library" OFF)
jrl_option(PROXSUITE_BUILD_MAROS_MESZAROS_TESTS "Build the Maros-Meszaros tests, needs matio library" OFF)

BUILD_MAROS_MESZAROS_TESTS is a new option.

Comment thread CMakeLists.txt
Comment on lines +49 to +50
jrl_option(ENABLE_WARNINGS "Enable warnings during compilation" OFF)
jrl_option(ENABLE_WARNINGS_AS_ERRORS "Treat all warnings as errors" OFF)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Suggested change
jrl_option(ENABLE_WARNINGS "Enable warnings during compilation" OFF)
jrl_option(ENABLE_WARNINGS_AS_ERRORS "Treat all warnings as errors" OFF)
jrl_option(PROXSUITE_ENABLE_WARNINGS "Enable warnings during compilation" OFF)
jrl_option(PROXSUITE_ENABLE_WARNINGS_AS_ERRORS "Treat all warnings as errors" OFF)

ENABLE_WARNINGS* are new options.

ENABLE_WARNINGS activate jrl_target_set_default_compile_options on proxsuite traget. I think this should be done by default, why setting an option ?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

We don't want to export the warnings in the final package (it's an INTERFACE library).
These options are only meant for proxsuite dev purposes.

Comment thread CMakeLists.txt
jrl_option(TEST_JULIA_INTERFACE "Run the julia examples as unittest" OFF)
jrl_option(BUILD_WITH_OPENMP_SUPPORT "Build the library with the OpenMP support" OFF)
jrl_option(LINK_PYTHON_INTERFACE_TO_OPENMP "Link OpenMP to the Python interface" ON CONDITION "BUILD_WITH_OPENMP_SUPPORT" FALLBACK OFF)
jrl_option(BUILD_WITH_SERIALIZATION "Build with serialization support" ON)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Suggested change
jrl_option(BUILD_WITH_SERIALIZATION "Build with serialization support" ON)
jrl_option(PROXSUITE_BUILD_WITH_SERIALIZATION "Build with serialization support" ON)

New option

Comment thread CMakeLists.txt
jrl_option(LINK_PYTHON_INTERFACE_TO_OPENMP "Link OpenMP to the Python interface" ON CONDITION "BUILD_WITH_OPENMP_SUPPORT" FALLBACK OFF)
jrl_option(BUILD_WITH_SERIALIZATION "Build with serialization support" ON)
jrl_option(GENERATE_PYTHON_STUBS "Generate Python stubs" OFF)
jrl_option(PYTHON_BINDING_CUSTOM_INSTALL_DIR "Override the default <current-python-install-sitelib>/<project-name>" "")

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Never used ?

Comment thread CMakeLists.txt
jrl_option(INSTALL_DOCUMENTATION "Install the documentation" OFF)
jrl_option(INITIALIZE_EIGEN_WITH_NAN "Initialize Eigen objects with NAN values" OFF)
jrl_option(CHECK_RUNTIME_MALLOC "Check if some memory allocations are performed at runtime" OFF)
jrl_option(SUFFIX_SO_VERSION "Suffix library name with its version" ON)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This option is never used.

Comment thread CMakeLists.txt
Comment on lines +85 to +87
if(WIN32)
set(Catch2_USE_FETCHCONTENT ON)
endif()

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Can we add a guard to fetchcontent catch2 only on debug build configuration ? The CI will not have to rebuild catch 2 on release mode then.


if(LINK_PYTHON_INTERFACE_TO_OPENMP)
message(STATUS "[proxsuite] Linking python bindings to OpenMP")
target_link_libraries(proxsuite_pywrap PRIVATE OpenMP::OpenMP_CXX)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Since proxsuite already link as INTERFACE OpenMP::OpenMP_CXX this is useless.
On old version, proxsuite target never link to OpenMP. It was manually appended to tests, binding and tests.

We could create a proxsuite-parallel and proxsuite-vectorized-parallel target that link to openmp ?
Or just remove proxsuite link to OpenMP::OpenMP_CXX, but I don't like it since it allow to use part of the library without proper linking.

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