Skip to content

Refactor CMake with JRL CMake Modules v2#612

Draft
ahoarau wants to merge 64 commits into
stack-of-tasks:develfrom
ahoarau:jrl-next
Draft

Refactor CMake with JRL CMake Modules v2#612
ahoarau wants to merge 64 commits into
stack-of-tasks: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
  • c++17 minimum required
  • reorder tests to separate python and cpp tests
  • 🚧 NIX CI is temporarily disabled

@ahoarau ahoarau marked this pull request as draft December 11, 2025 16:38
@ManifoldFR ManifoldFR marked this pull request as ready for review December 17, 2025 15:02
@ManifoldFR ManifoldFR marked this pull request as draft December 17, 2025 15:02
@ahoarau ahoarau force-pushed the jrl-next branch 2 times, most recently from e114b10 to 7d7943a Compare December 22, 2025 13:28

@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, the CMakeLists are way clearer.

Comment thread unittest/cpp/CMakeLists.txt Outdated
Comment thread unittest/cpp/boost_optional.cpp Outdated
Comment thread unittest/cpp/.clang-format-ignore Outdated
Comment thread unittest/cpp/boost_variant.cpp Outdated
Comment thread unittest/cpp/std_optional.cpp Outdated
Comment thread CMakeLists.txt
Comment thread CMakeLists.txt Outdated
Comment thread unittest/cpp/CMakeLists.txt Outdated
Comment thread CMakeLists.txt
Comment thread CMakeLists.txt
@ahoarau ahoarau force-pushed the jrl-next branch 2 times, most recently from b8cf5d4 to c8bb47e Compare February 11, 2026 09:46
@ahoarau ahoarau force-pushed the jrl-next branch 2 times, most recently from 82e628b to d588970 Compare March 24, 2026 09:03
@ahoarau ahoarau force-pushed the jrl-next branch 3 times, most recently from 567f237 to 41bfb1e Compare April 15, 2026 14:31
Comment thread CMakeLists.txt
Comment on lines -149 to -150
set(CMAKE_MODULE_PATH ${JRL_CMAKE_MODULES}/find-external/CHOLMOD
${CMAKE_MODULE_PATH})

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.

CHOLMODConfig.cmake is not packaged on Ubuntu 22.04 (libsuitesparse-dev).
We must provide it to avoid regressions.
To avoid using our custom CHOMODConfig.cmake on all system we can use the same strategy than aligator : creating an explicit EIGENPY_BUILD_WITH_UBUNTU_22_COMPATIBILITY option that must be activated on this system.

Comment thread CMakeLists.txt
Comment on lines +333 to +334
INSTALL_CPP_PACKAGE_FILES [[NOT BUILD_STANDALONE_PYTHON_INTERFACE]]
INSTALL_PYTHON_PACKAGE_FILES [[BUILD_PYTHON_INTERFACE]]

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
INSTALL_CPP_PACKAGE_FILES [[NOT BUILD_STANDALONE_PYTHON_INTERFACE]]
INSTALL_PYTHON_PACKAGE_FILES [[BUILD_PYTHON_INTERFACE]]
INSTALL_CPP_PACKAGE_FILES ON
INSTALL_PYTHON_PACKAGE_FILES ON

There is no BUILD_STANDALONE_PYTHON_INTERFACE and BUILD_PYTHON_INTERFACE

set(script_path ${CMAKE_CURRENT_SOURCE_DIR}/test_${name}.py)
endif()

set(test_name "Eigenpy: test_${name}.py")

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
set(test_name "Eigenpy: test_${name}.py")
set(test_name "eigenpy: test_${name}.py")

for consistency with cpp test and other project tests

- run: sudo apt install libboost-all-dev libeigen3-dev python3-numpy python3-scipy
- run: cmake -B build -S eigenpy
- run: grep -qvz CMAKE_PROJECT_VERSION:STATIC=0.0 build/CMakeCache.txt
repository: ahoarau/jrl-cmakemodules

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.

Update after jrl-next release

matrix:
python: [3]
ubuntu: [22, 24]
os: [ubuntu-22.04, ubuntu-24.04]

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.

Use docker container ubuntu:22.04 and `ubuntu:24.04' instead of Github image to have right package version.

- run: make -j2
- run: ctest --output-on-failure
path: ${{ env.CCACHE_DIR }}
key: ccache-${{ matrix.os }}-${{ matrix.build_type }}-${{ github.sha }}

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.

Find an unique prefix (cf github cache discussion in macos-linux-windows-pixi workflow)

env:
CMAKE_BUILD_PARALLEL_LEVEL: 2
run: |
pixi run -e ${{ matrix.environment }} build --verbose --parallel 2

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.

By running pixi run build you will rerun pixi run configure.
Pixi can't detect this first step is already done.

endif()

# Fallback to FetchContent if not found
set(JRL_GIT_REPOSITORY "https://github.com/ahoarau/jrl-cmakemodules.git")

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.

To update after jrl-next release

Comment thread pixi.toml
numpy = ">=1.22.0"
python = ">=3.9.0"
python = ">=3.10"
scipy = ">=1.10.0"

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.

Add jrl-cmakemodules = ">=2.0" when jrl-next is released

Comment thread pixi.toml
@@ -48,19 +47,19 @@ extra-args = [
pkg-config = ">=0.29.2"

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.

Remove pkg-config and add jrl-cmakemodules = ">=2.0" when jrl-next is released

add_test(NAME ${test_name} COMMAND $<TARGET_FILE:Python::Interpreter> ${script_path})
set_tests_properties(
${test_name}
PROPERTIES ENVIRONMENT PYTHONPATH=$<TARGET_FILE_DIR:eigenpy_pywrap>/.. DEPENDS eigenpy_pywrap

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.

It's better to use ENVIRONMENT_MODIFICATION to avoid issue with some package manager or custom installation path:

      ENVIRONMENT_MODIFICATION
        "PYTHONPATH=path_list_prepend:$<TARGET_FILE_DIR:eigenpy_pywrap>/.."

@jorisv jorisv mentioned this pull request Jun 5, 2026
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.

3 participants