From d52d77417d7b1dd474c7c660be76b9a8ca37e673 Mon Sep 17 00:00:00 2001 From: Olivier Roussel Date: Fri, 10 Jan 2025 13:15:55 +0100 Subject: [PATCH 1/6] fix usage of proxsuite is lib used as 3rd party (#51) --- SoftRobots.InverseConfig.cmake.in | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/SoftRobots.InverseConfig.cmake.in b/SoftRobots.InverseConfig.cmake.in index 54f7093..1c66f9f 100644 --- a/SoftRobots.InverseConfig.cmake.in +++ b/SoftRobots.InverseConfig.cmake.in @@ -10,7 +10,9 @@ find_package(Sofa.Component.SolidMechanics.FEM.Elastic QUIET REQUIRED) find_package(libqpOASES REQUIRED) include_directories(${OASES_INCLUDE_DIRS}) -find_package(proxsuite REQUIRED) +if(SOFTROBOTSINVERSE_ENABLE_PROXQP) + find_package(proxsuite QUIET REQUIRED) +endif() if(NOT TARGET @PROJECT_NAME@) include("${CMAKE_CURRENT_LIST_DIR}/@PROJECT_NAME@Targets.cmake") From 5ad98ed3839fef7906150865efb62008af3b490f Mon Sep 17 00:00:00 2001 From: Olivier Roussel Date: Wed, 15 Jan 2025 17:39:21 +0100 Subject: [PATCH 2/6] adds a conda based CI workflow --- .github/workflows/ci-conda.yml | 97 ++++++++++++++++++++++++++++++++++ 1 file changed, 97 insertions(+) create mode 100644 .github/workflows/ci-conda.yml diff --git a/.github/workflows/ci-conda.yml b/.github/workflows/ci-conda.yml new file mode 100644 index 0000000..8b094ed --- /dev/null +++ b/.github/workflows/ci-conda.yml @@ -0,0 +1,97 @@ +name: CI - Linux/OSX/Windows - Conda + +on: + workflow_dispatch: + push: + pull_request: + +jobs: + build-with-conda-and-test: + name: Run on ${{ matrix.os }} using Conda with SOFA ${{ matrix.sofa_branch }} + runs-on: ${{ matrix.os }} + strategy: + fail-fast: false + matrix: + os: [ubuntu-22.04, macos-13, windows-2022] + python_version: ["3.10", "3.11", "3.12", "3.13"] + build_type: ["Release"] + + steps: + - name: Install miniconda [Linux & macOS & Windows] + uses: conda-incubator/setup-miniconda@v3 + with: + activate-environment: sofa + auto-update-conda: true + miniforge-version: latest + python-version: ${{ matrix.python_version }} + channels: conda-forge + conda-remove-defaults: "true" + + - name: Checkout source code + uses: actions/checkout@v4 + + - name: Install SOFA from nightly packages [Conda] + shell: bash -l {0} + run: | + conda install sofa-devel sofa-python3 sofa-stlib sofa-softrobots -c sofa-framework-nightly + + - name: Install openGL dependencies [Conda / Linux x64] + if: contains(matrix.os, 'ubuntu') + shell: bash -l {0} + run: | + conda install mesa-libgl-devel-cos7-x86_64 + + - name: Install dependencies [Conda] + shell: bash -l {0} + run: | + # Compilation related dependencies + conda install cmake compilers make pkg-config doxygen ninja + # Build dependencies + conda install eigen libboost-headers pybind11 cxxopts + + - name: Print environment [Conda] + shell: bash -l {0} + run: | + conda info + conda list + env + + # TODO enable TUs + - name: Configure [Conda / Linux & macOS] + if: contains(matrix.os, 'macos') || contains(matrix.os, 'ubuntu') + shell: bash -l {0} + run: | + mkdir build + cd build + cmake .. -GNinja \ + -DCMAKE_INSTALL_PREFIX=${CONDA_PREFIX} \ + -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} \ + -DPython_EXECUTABLE:PATH=${CONDA_PREFIX}/bin/python \ + -DSOFTROBOTSINVERSE_BUILD_TESTS:BOOL=OFF + + - name: Configure [Conda / Windows] + if: contains(matrix.os, 'windows') + shell: bash -l {0} + run: | + mkdir build + cd build + cmake .. -G"Visual Studio 17 2022" -T "v143" \ + -DCMAKE_GENERATOR_PLATFORM=x64 \ + -DCMAKE_INSTALL_PREFIX=${CONDA_PREFIX} \ + -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} \ + -DPython_EXECUTABLE:PATH=${CONDA_PREFIX}/python.exe \ + -DSOFTROBOTSINVERSE_BUILD_TESTS:BOOL=OFF + + - name: Build [Conda] + shell: bash -l {0} + run: | + cd build + cmake --build . --config ${{ matrix.build_type }} -v -j 2 + + - name: Install [Conda] + shell: bash -l {0} + run: | + cd build + cmake --install . --config ${{ matrix.build_type }} + + # TODO: testing \ No newline at end of file From e2faff8f3aad4209d2bce2d0fc7d8146bfbf1a5e Mon Sep 17 00:00:00 2001 From: Olivier Roussel Date: Thu, 16 Jan 2025 10:46:57 +0100 Subject: [PATCH 3/6] ensure vs2022 is used on windows --- .github/workflows/ci-conda.yml | 22 ++++++++++++++++------ 1 file changed, 16 insertions(+), 6 deletions(-) diff --git a/.github/workflows/ci-conda.yml b/.github/workflows/ci-conda.yml index 8b094ed..95b4a83 100644 --- a/.github/workflows/ci-conda.yml +++ b/.github/workflows/ci-conda.yml @@ -7,7 +7,7 @@ on: jobs: build-with-conda-and-test: - name: Run on ${{ matrix.os }} using Conda with SOFA ${{ matrix.sofa_branch }} + name: "[conda:${{ matrix.os }}:py${{ matrix.python_version }}]" runs-on: ${{ matrix.os }} strategy: fail-fast: false @@ -35,19 +35,29 @@ jobs: run: | conda install sofa-devel sofa-python3 sofa-stlib sofa-softrobots -c sofa-framework-nightly - - name: Install openGL dependencies [Conda / Linux x64] + - name: Install compilation environment [Conda / Linux] if: contains(matrix.os, 'ubuntu') shell: bash -l {0} run: | + conda install cmake compilers make ninja conda install mesa-libgl-devel-cos7-x86_64 + - name: Install compilation environment [Conda / macOS] + if: contains(matrix.os, 'macos') + shell: bash -l {0} + run: | + conda install cmake compilers make ninja + + - name: Install compilation environment [Conda / Windows] + if: contains(matrix.os, 'windows') + shell: bash -l {0} + run: | + conda install cmake vs2022_win-64 + - name: Install dependencies [Conda] shell: bash -l {0} run: | - # Compilation related dependencies - conda install cmake compilers make pkg-config doxygen ninja - # Build dependencies - conda install eigen libboost-headers pybind11 cxxopts + conda install eigen libboost-headers pybind11 cxxopts - name: Print environment [Conda] shell: bash -l {0} From 577daa6f047a7de0ba3ab537ec3637a2d78ca6a3 Mon Sep 17 00:00:00 2001 From: Olivier Roussel Date: Thu, 16 Jan 2025 11:38:40 +0100 Subject: [PATCH 4/6] Enable unit tests --- .github/workflows/ci-conda.yml | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci-conda.yml b/.github/workflows/ci-conda.yml index 95b4a83..8316551 100644 --- a/.github/workflows/ci-conda.yml +++ b/.github/workflows/ci-conda.yml @@ -66,7 +66,6 @@ jobs: conda list env - # TODO enable TUs - name: Configure [Conda / Linux & macOS] if: contains(matrix.os, 'macos') || contains(matrix.os, 'ubuntu') shell: bash -l {0} @@ -77,7 +76,7 @@ jobs: -DCMAKE_INSTALL_PREFIX=${CONDA_PREFIX} \ -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} \ -DPython_EXECUTABLE:PATH=${CONDA_PREFIX}/bin/python \ - -DSOFTROBOTSINVERSE_BUILD_TESTS:BOOL=OFF + -DSOFTROBOTSINVERSE_BUILD_TESTS:BOOL=ON - name: Configure [Conda / Windows] if: contains(matrix.os, 'windows') @@ -90,7 +89,7 @@ jobs: -DCMAKE_INSTALL_PREFIX=${CONDA_PREFIX} \ -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} \ -DPython_EXECUTABLE:PATH=${CONDA_PREFIX}/python.exe \ - -DSOFTROBOTSINVERSE_BUILD_TESTS:BOOL=OFF + -DSOFTROBOTSINVERSE_BUILD_TESTS:BOOL=ON - name: Build [Conda] shell: bash -l {0} @@ -104,4 +103,8 @@ jobs: cd build cmake --install . --config ${{ matrix.build_type }} - # TODO: testing \ No newline at end of file + - name: Test [Conda] + shell: bash -l {0} + run: | + cd build + ctest --output-on-failure -C ${{ matrix.build_type }} From 43edb64f896c5cb5a23acca6092a25d9edaa5fcd Mon Sep 17 00:00:00 2001 From: Olivier Roussel Date: Thu, 16 Jan 2025 11:52:31 +0100 Subject: [PATCH 5/6] Limit build matrix to latest python version --- .github/workflows/ci-conda.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci-conda.yml b/.github/workflows/ci-conda.yml index 8316551..ee52fec 100644 --- a/.github/workflows/ci-conda.yml +++ b/.github/workflows/ci-conda.yml @@ -13,7 +13,7 @@ jobs: fail-fast: false matrix: os: [ubuntu-22.04, macos-13, windows-2022] - python_version: ["3.10", "3.11", "3.12", "3.13"] + python_version: ["3.13"] build_type: ["Release"] steps: From 4e2a496c3e8739513bfba203e320bf15a5cd4e60 Mon Sep 17 00:00:00 2001 From: Olivier Roussel Date: Thu, 16 Jan 2025 11:54:35 +0100 Subject: [PATCH 6/6] enable macos-14 arm64 runner --- .github/workflows/ci-conda.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci-conda.yml b/.github/workflows/ci-conda.yml index ee52fec..9c5fe13 100644 --- a/.github/workflows/ci-conda.yml +++ b/.github/workflows/ci-conda.yml @@ -12,7 +12,7 @@ jobs: strategy: fail-fast: false matrix: - os: [ubuntu-22.04, macos-13, windows-2022] + os: [ubuntu-22.04, macos-13, macos-14, windows-2022] python_version: ["3.13"] build_type: ["Release"]