EasySpin icon indicating copy to clipboard operation
EasySpin copied to clipboard

generate mex files on build

Open spribitzer opened this issue 6 years ago • 2 comments

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 avatar Nov 07 '19 07:11 spribitzer

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

spribitzer avatar Mar 02 '20 22:03 spribitzer

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);

cerium1925 avatar Sep 12 '24 13:09 cerium1925