StollLab / EasySpin

MATLAB toolbox for Electron Paramagnetic Resonance (EPR) spectroscopy
http://easyspin.org
MIT License
49 stars 26 forks source link

generate mex files on build #162

Open spribitzer opened 5 years ago

spribitzer commented 5 years ago

The platform (Windows, Unix, MacOS) dependent mex files need to be compiled manually every time their source code is changed. Is there a way to automatize it?

  1. On every push to master a GitHub action can run that checks if the source code has changed. If yes, mex files are compiled on all three platforms and pushed to the repository for a new commit.

  2. Keep mex files outside of source control and only create and package them up with builds. This has the disadvantage developers need to manually generate them after cloning the repo.

spribitzer commented 4 years ago

this can be revisited once we have the new windows and macOS machines

cerium1925 commented 2 months ago

The generation of this mex file may be related to its generation environment and platform, such as MATLAB's parallel mode: Threads or processes, C/C++'s corresponding mex compiler, Intel oneapi or VS studio? After my personal test, the most basic MATLAB parallel mode is different, the mex cannot be called. Therefore, this part needs to be standardized and rigorously tested.

error code:

Parallel pool is ready. Error using LineShapes (line 61) Use of MEX functions is not supported on a thread-based worker. Use a PARPOOL('Processes') process-based pool or a different process-based pool instead.

Error in field2line (line 46) [ranges, Ints] = LineShapes(x0, field, int, Sys);