-
Notifications
You must be signed in to change notification settings - Fork 9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Does mex
work on Windows?
#29
Comments
Hello! Very strangely and fortunately, However, now I have been trying to make it work for Fortran but failed on both Windows and macOS. How should I configure Windows and macOS runners so that they can mexify Fortran? Thank you very much again for this great facility! Best regards, |
Update: I tested MEX using another action: https://github.com/equipez/test_gactions/actions/workflows/test_matlab_mex.yml The same as the other action, MEX works for C on Windows starting from the second run of the action, but fails in the first run. This is very strange. MEX does not work for Fortran on Windows or macOS for the moment, as we can see here: https://github.com/equipez/test_gactions/actions/runs/1870818916 Thank you very much again! |
Hi @zaikunzhang, The MEX command requires the runner have a supported compiler per https://www.mathworks.com/support/requirements/supported-compilers.html.
Neither Windows nor macOS GitHub-hosted runners include a supported Fortran compiler. You would need to install a supported Fortran compiler manually during your build process before calling MEX. Below is an example config compiling C and Fortran MEX files across all platforms. Note "Intel oneAPI Toolkits" is installed on Windows and macOS to get a supported Fortran compiler. name: CI
on: [push]
jobs:
build:
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-2019]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v2
- name: Install Intel oneAPI Toolkits (macOS)
run: |
wget https://registrationcenter-download.intel.com/akdlm/irc_nas/18341/m_HPCKit_p_2022.1.0.86_offline.dmg
hdiutil attach m_HPCKit_p_2022.1.0.86_offline.dmg
cd /Volumes/m_HPCKit_p_2022.1.0.86_offline/bootstrapper.app/Contents/MacOS/
sudo ./install.sh --silent --eula accept --components intel.oneapi.mac.ifort-compiler
echo "ONEAPI_ROOT=/opt/intel/oneapi" >> $GITHUB_ENV
if: startsWith(matrix.os, 'macos')
- name: Install Intel oneAPI Toolkits (Windows)
run: |
curl.exe --output webimage.exe --url https://registrationcenter-download.intel.com/akdlm/irc_nas/18529/w_HPCKit_p_2022.1.2.116_offline.exe
start /b /wait webimage.exe -s -x -f webimage_extracted --log extract.log
del webimage.exe
webimage_extracted\bootstrapper.exe -s --action install --components=intel.oneapi.win.ifort-compiler --eula=accept -p=NEED_VS2017_INTEGRATION=0 -p=NEED_VS2019_INTEGRATION=0 --log-dir=.
echo ONEAPI_ROOT=C:\Program Files (x86)\Intel\oneAPI >> %GITHUB_ENV%
shell: cmd
if: startsWith(matrix.os, 'windows')
- name: Setup MATLAB
uses: matlab-actions/setup-matlab@v1
- name: Run MATLAB Command
uses: matlab-actions/run-command@v1
with:
command: |
mex('-setup', '-v', 'C');
mex('-v', fullfile(matlabroot,'extern','examples','refbook','timestwo.c'));
timestwo(1);
delete('timestwo.mex*');
mex('-setup', '-v', 'FORTRAN');
mex('-v', fullfile(matlabroot,'extern','examples','refbook','timestwo.F'));
timestwo(1);
delete('timestwo.mex*'); |
Hello!
First of all, thank you very much for making MATLAB available with GitHub Actions. This is life-changing. I have been using it in several research projects.
It is great that v1.1.0 now supports Windows and macOS. I have some actions involving
mex
(e.g., this one). Both the Linux and macOS versions work perfectly, but the Windows version complain thatDid I miss something? How should I configure a GiHub-hosted runner so that
mex
works?Thank you very much!
Best regards,
Zaikun
The text was updated successfully, but these errors were encountered: