Skip to content

Commit

Permalink
240420.111132.HKT add macos silicon to compile_mex.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
zaikunzhang committed Apr 20, 2024
1 parent cb57af9 commit 53aca58
Showing 1 changed file with 44 additions and 23 deletions.
67 changes: 44 additions & 23 deletions .github/workflows/compile_mex.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,13 @@ on:
# Show the git ref in the workflow name if it is invoked manually.
run-name: ${{ github.event_name == 'workflow_dispatch' && format('Manual run {0}', inputs.git-ref) || '' }}

env:
MATLAB_VERSION: R2023b
MATLAB: /Applications/MATLAB_R2023b.app/bin/matlab

jobs:
test:

mex:
name: Compile MEX
runs-on: ${{ matrix.os }}
strategy:
Expand Down Expand Up @@ -75,27 +79,6 @@ jobs:
- name: Miscellaneous setup
run: bash .github/scripts/misc_setup

- name: Revise fmxapi.F90
shell: bash
run: |
cd matlab/mex_gateways/
$SEDI "s|\(.*maybe due to overflow.*$\)|\1\nwrite(*,*) 'x = ', x; write(*,*) 'x_dp = ', x_dp|" fmxapi.F90
cat fmxapi.F90
- name: Revise postprima.m
shell: bash
run: |
cd matlab/interfaces/private/
$SEDI "s/max(\[0, chist\]) > 0)/max(\[0, chist\]) > 0)\nprobinfo.raw_data\noutput\nchist/" postprima.m
cat postprima.m
# - name: Revise cobylb.f
# shell: bash
# run: |
# cd fortran/classical/cobyla/
# $SEDI "s/cstrv = maxval(\[ZERO, -constr\])/cstrv = maxval([\ZERO, -constr\])\n write(*,*) 'x = ', x(1:n)\n write(*,*) 'f = ', f\n write(*,*) 'constr = ', constr(1:m)\n write(*,*) 'cstrv = ', cstrv/" cobylb.f
# cat cobylb.f

- name: Link gfortran for MATLAB on Linux
if: startsWith(matrix.os, 'ubuntu')
run: |
Expand Down Expand Up @@ -141,7 +124,45 @@ jobs:
- name: Store artifacts
uses: actions/upload-artifact@v4.3.1
with:
name: ${{ matrix.os }}-${{ matrix.matlab }}
name: prima-${{ matrix.os }}-${{ matrix.matlab }}
path: |
./*
!./benchmark
!./.*
!./*.log
!./*.dot
!./*.json
mex_mac_silicon:
name: Compile MEX, macOS ARM64
runs-on: [self-hosted, macOS, ARM64]
strategy:
fail-fast: false

steps:
- name: Clone Repository (Latest)
uses: actions/checkout@v4
if: github.event.inputs.git-ref == ''
with:
submodules: recursive
- name: Clone Repository (Custom Ref)
uses: actions/checkout@v4
if: github.event.inputs.git-ref != ''
with:
ref: ${{ github.event.inputs.git-ref }}
submodules: recursive

- name: Miscellaneous setup
run: bash .github/scripts/misc_setup

- name: Conduct the test # We do not use matlab-actions/run-command, which is not supported on macOS ARM64 as of 20240119
run: ${{ env.MATLAB }} -batch "options.debug = true; options.single = true; options.quadruple = true; options.classical = false; options.verbose = true; setup(options); testprima; cd matlab/examples; rosenbrock_example;"

- name: Store artifacts
uses: actions/upload-artifact@v4.3.1
with:
name: prima-macos-arm64-${{ env.MATLAB_VERSION }}
path: |
./*
!./benchmark
Expand Down

0 comments on commit 53aca58

Please sign in to comment.