diff --git a/.github/workflows/compile_mex.yml b/.github/workflows/compile_mex.yml index c3199f1b03..47114547e8 100644 --- a/.github/workflows/compile_mex.yml +++ b/.github/workflows/compile_mex.yml @@ -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: @@ -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: | @@ -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