diff --git a/.github/workflows/conda/environment_linux.yml b/.github/workflows/conda/environment_linux.yml new file mode 100644 index 0000000000..0ee6f44a19 --- /dev/null +++ b/.github/workflows/conda/environment_linux.yml @@ -0,0 +1,19 @@ +name: visp +channels: + - conda-forge +dependencies: + - cxx-compiler + - cmake + - ninja + - xorg-libx11 + - xorg-libxfixes + - mesa-libegl-cos7-x86_64 + - libxml2 + - libdc1394 >=2.2.6 + - librealsense + - libgomp + - eigen + - libjpeg-turbo + - libpng + - mkl-devel + - pybind11 diff --git a/.github/workflows/conda/environment_macos.yml b/.github/workflows/conda/environment_macos.yml new file mode 100644 index 0000000000..e0c9093308 --- /dev/null +++ b/.github/workflows/conda/environment_macos.yml @@ -0,0 +1,19 @@ +name: visp +channels: + - conda-forge +dependencies: + - cxx-compiler + - cmake + - ninja + - xorg-libx11 + - xorg-libxfixes + - libxml2 + - libdc1394 >=2.2.6 + - librealsense + - libopencv + - eigen + - libjpeg-turbo + - libpng + - libopenblas + - llvm-openmp + - pybind11 \ No newline at end of file diff --git a/.github/workflows/conda/environment_windows.yml b/.github/workflows/conda/environment_windows.yml new file mode 100644 index 0000000000..03836476ca --- /dev/null +++ b/.github/workflows/conda/environment_windows.yml @@ -0,0 +1,17 @@ +name: visp +channels: + - conda-forge +dependencies: + - cxx-compiler + - cmake + - clang + - ninja + - llvm-openmp + - openmp + - pthreads-win32 + - libopencv + - eigen + - libjpeg-turbo + - libpng + - mkl-devel + - pybind11 diff --git a/.github/workflows/macos-linux-conda.yml b/.github/workflows/macos-linux-conda.yml new file mode 100644 index 0000000000..1bb7047061 --- /dev/null +++ b/.github/workflows/macos-linux-conda.yml @@ -0,0 +1,103 @@ +name: MacOS-Linux-conda-CI + +on: [push,pull_request] +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +jobs: + visp-conda: + name: ${{ matrix.os }} - Python ${{ matrix.python-version }} ${{ matrix.build_type }} ${{ matrix.cxx_options }} + runs-on: ${{ matrix.os }} + + strategy: + fail-fast: false + matrix: + os: ["ubuntu-latest", "macos-latest"] + build_type: [Release] + python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"] + + steps: + - name: Checkout code + uses: actions/checkout@v4 + with: + submodules: recursive + + - name: Install miniconda on ubuntu + uses: conda-incubator/setup-miniconda@v3 + if: startsWith(matrix.os,'ubuntu') == true + with: + activate-environment: visp + auto-update-conda: true + environment-file: .github/workflows/conda/environment_linux.yml + python-version: ${{ matrix.python-version }} + auto-activate-base: false + + - name: Install miniconda on macOS + uses: conda-incubator/setup-miniconda@v3 + if: startsWith(matrix.os,'macos') == true + with: + activate-environment: visp + auto-update-conda: true + environment-file: .github/workflows/conda/environment_macos.yml + python-version: ${{ matrix.python-version }} + auto-activate-base: false + + - name: Show conda config + shell: bash -el {0} + run: | + conda info + conda list + conda config --show-sources + conda config --show + printenv | sort + + - name: Determine number of processor on Ubuntu + if: matrix.os == 'ubuntu-latest' + run: | + echo "NPROC=$(nproc)" >> $GITHUB_ENV + + - name: Determine number of processor on MacOS + if: matrix.os == 'macos-latest' + run: | + echo "NPROC=$(sysctl -n hw.logicalcpu)" >> $GITHUB_ENV + + - name: Build visp python bindings + shell: bash -el {0} + run: | + echo "Number of processors: ${NPROC}" + + mkdir build + cd build + + cmake .. \ + -G "Ninja" \ + -DCMAKE_PREFIX_PATH=$CONDA_PREFIX \ + -DCMAKE_INSTALL_PREFIX=$CONDA_PREFIX \ + -DBUILD_TESTS=OFF \ + -DBUILD_EXAMPLES=OFF \ + -DBUILD_TUTORIALS=OFF \ + -DBUILD_APPS=OFF \ + -DBUILD_DEMOS=OFF \ + -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} + + # Build + cmake --build . --parallel ${NPROC} --target visp_python_bindings + + # Tests + cmake --build . --parallel ${NPROC} --target visp_python_bindings_test + + check: + if: always() + name: check-macos-linux-conda + + needs: + - visp-conda + + runs-on: Ubuntu-latest + + steps: + - name: Decide whether the needed jobs succeeded or failed + uses: re-actors/alls-green@release/v1 + with: + jobs: ${{ toJSON(needs) }} diff --git a/.github/workflows/windows-conda.yml b/.github/workflows/windows-conda.yml new file mode 100644 index 0000000000..410d323c62 --- /dev/null +++ b/.github/workflows/windows-conda.yml @@ -0,0 +1,94 @@ +name: Windows-conda-CI + +on: [push,pull_request] +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +jobs: + visp-conda: + name: ${{ matrix.os }} ${{ matrix.compiler }} - Python ${{ matrix.python-version }} ${{ matrix.build_type }} ${{ matrix.cxx_options }} + runs-on: ${{ matrix.os }} + + strategy: + fail-fast: false + matrix: + os: ["windows-latest"] + compiler: ["cl", "clang-cl"] + build_type: [Release] + python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"] + + steps: + - name: Checkout code + uses: actions/checkout@v4 + with: + submodules: recursive + + - name: Install miniconda on windows + uses: conda-incubator/setup-miniconda@v3 + with: + activate-environment: visp + auto-update-conda: true + environment-file: .github/workflows/conda/environment_windows.yml + python-version: ${{ matrix.python-version }} + auto-activate-base: false + + - name: Show conda config + shell: cmd /C CALL {0} + run: | + conda info + conda list + conda config --show-sources + conda config --show + + - name: Build visp python bindings + shell: cmd /C CALL {0} + env: + CC: ${{ matrix.compiler }} + CXX: ${{ matrix.compiler }} + run: | + :: start building + call "%programfiles%\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvarsall.bat" amd64 + if errorlevel 1 exit 1 + + mkdir build + cd build + + cmake .. ^ + -G "Ninja" ^ + -DCMAKE_PREFIX_PATH=%CONDA_PREFIX% ^ + -DCMAKE_INSTALL_PREFIX=%CONDA_PREFIX%\Library ^ + -DVISP_LIB_INSTALL_PATH="lib" ^ + -DVISP_BIN_INSTALL_PATH="bin" ^ + -DVISP_CONFIG_INSTALL_PATH="cmake" ^ + -DBUILD_TESTS=OFF ^ + -DBUILD_EXAMPLES=OFF ^ + -DBUILD_TUTORIALS=OFF ^ + -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} + if errorlevel 1 exit 1 + + :: Build visp libs & install them + cmake --build . --target install + + :: Build bindings + cmake --build . --target visp_python_bindings + if errorlevel 1 exit 1 + + :: Tests + cmake --build . --target visp_python_bindings_test + if errorlevel 1 exit 1 + + check: + if: always() + name: check-windows-conda + + needs: + - visp-conda + + runs-on: Ubuntu-latest + + steps: + - name: Decide whether the needed jobs succeeded or failed + uses: re-actors/alls-green@release/v1 + with: + jobs: ${{ toJSON(needs) }} diff --git a/ChangeLog.txt b/ChangeLog.txt index 1c7b5945be..8b069dd5c4 100644 --- a/ChangeLog.txt +++ b/ChangeLog.txt @@ -8,7 +8,7 @@ ViSP 3.x.x (Version in development) - Contributors: . Fabien Spindler, Romain Lagneau, Pierre Perraud, Florent Lamiraux, Samuel Felton, François Chaumette, - Souriya Trinh + Souriya Trinh, Olivier Roussel - New classes . vpPololu and vpRobotPololuPtu to control respectively a servo motor using a pololu maestro board or a 3D printed 2 dof pan-tilt unit. Visual servoing example provided in example/servo-pololu-ptu. Tests available in