libmexclass #593
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: "libmexclass" | |
on: | |
push: | |
schedule: | |
- cron: '0 23 * * *' | |
jobs: | |
linux: | |
runs-on: ubuntu-22.04 | |
env: | |
LIBMEXCLASS_INSTALL_PREFIX: "/home/runner/work/install" | |
SYSTEM_LIBSTDCPP_PATH: "/usr/lib/x86_64-linux-gnu/libstdc++.so.6" | |
steps: | |
- name: Download libmexclass source code | |
uses: actions/checkout@v4 | |
- name: Install MATLAB | |
uses: matlab-actions/setup-matlab@v2 | |
with: | |
release: R2024b | |
cache: true | |
- name: Build Example | |
run: | | |
cd example | |
cmake -S . -B build -D CMAKE_INSTALL_PREFIX=${{ env.LIBMEXCLASS_INSTALL_PREFIX }} -D LIBMEXCLASS_FETCH_CONTENT_GIT_TAG=${{ github.sha }} | |
cmake --build build --config Release --target install | |
- name: Run Example | |
uses: matlab-actions/run-command@v2 | |
env: | |
# The version of libstdc++ that is bundled with MATLAB is used when building MEX files. | |
# This version of libstdc++ is incompatible with the system version of libstdc++. | |
# As a workaround, set LD_PRELOAD to use the system version of libstdc++ with MATLAB. | |
LD_PRELOAD: ${{ env.SYSTEM_LIBSTDCPP_PATH }} | |
with: | |
command: addpath(fullfile("${{ env.LIBMEXCLASS_INSTALL_PREFIX }}")), addpath(fullfile("example", "matlab")), c = example.Car("A", "B", "C") | |
mac: | |
runs-on: macos-14 | |
env: | |
LIBMEXCLASS_INSTALL_PREFIX: "~/install" | |
steps: | |
- name: Download libmexclass source code | |
uses: actions/checkout@v4 | |
- name: Install MATLAB | |
uses: matlab-actions/setup-matlab@v2 | |
with: | |
release: R2024b | |
cache: true | |
- name: Build Example | |
run: | | |
cd example | |
cmake -S . -B build -D CMAKE_INSTALL_PREFIX=${{ env.LIBMEXCLASS_INSTALL_PREFIX }} -D LIBMEXCLASS_FETCH_CONTENT_GIT_TAG=${{ github.sha }} | |
cmake --build build --config Release --target install | |
- name: Run Example | |
uses: matlab-actions/run-command@v2 | |
with: | |
command: addpath(fullfile("${{ env.LIBMEXCLASS_INSTALL_PREFIX }}")), addpath(fullfile("example", "matlab")), c = example.Car("A", "B", "C") | |
windows: | |
runs-on: windows-2022 | |
env: | |
LIBMEXCLASS_INSTALL_PREFIX: ${{ vars.RUNNER_TEMP }}/install | |
# Use the commit SHA that triggered the workflow to run the example on latest changes. | |
LIBMEXCLASS_GIT_TAG: ${{ vars.GITHUB_SHA }} | |
steps: | |
- name: Download libmexclass source code | |
uses: actions/checkout@v4 | |
- name: Install MATLAB | |
uses: matlab-actions/setup-matlab@v2 | |
with: | |
release: R2024b | |
cache: true | |
- name: Build Example | |
run: | | |
cd example | |
echo "LIBMEXCLASS_INSTALL_PREFIX= ${{ env.LIBMEXCLASS_GIT_TAG }}" | |
cmake -S . -B build -D CMAKE_INSTALL_PREFIX=${{ env.LIBMEXCLASS_INSTALL_PREFIX }} -D LIBMEXCLASS_FETCH_CONTENT_GIT_TAG=${{ github.sha }} | |
cmake --build build --config Release --target install | |
- name: Run Example | |
uses: matlab-actions/run-command@v2 | |
with: | |
command: addpath(fullfile("${{ env.LIBMEXCLASS_INSTALL_PREFIX }}")), addpath(fullfile("example", "matlab")), c = example.Car("A", "B", "C") |