MEX for different platforms - deployment question.
조회 수: 7 (최근 30일)
이전 댓글 표시
HI,
I have some software than will be used by different members of a team. Everyone has matlab, but annoyingly on different platforms (i.e. Linux, Win and OSX).
There is some fortran mex involved, which compiles without problem on Linux, but annoyingly we don't have compatible Fortran compilers on Windows (or MAc, but that's probably in Xcode somewhere I guess).
My question is can you use mex to compile for different targets? So on the linux machine (gfortran) it makes xxxx.mexa64, is it possible to get it to make xxxx.mexw64 and xxxx.mexmaci with some switch or something?
I have coder, but don't see how that would help because the source is Fortran.
My third option would be maybe to build the Fortran as a shared library in each case and try 'loadlibrary' maybe?
So basically, I'm developing on Linux, the code needs a Fortran mex but I need to be able to deploy on Mac and Windows also. What's considered best practice for this kind of thing?
Cheers,
Arwel
댓글 수: 1
Walter Roberson
2019년 3월 20일
편집: Walter Roberson
2019년 3월 20일
Note: the only supported Fortran for Mac is Intel Parallel Studios https://www.mathworks.com/content/dam/mathworks/mathworks-dot-com/support/sysreq/files/system-requirements-release-2018b-supported-compilers.pdf . You might be able to hack g77 to work, but it is not supported.
답변 (1개)
Walter Roberson
2019년 3월 20일
No; you have to compile on a compatible system. The only cross-compilation support that existed historically was that you used to be able to target Windows 32 bit systems while running on Windows 64 bit.
On Linux you just might be able to work something out involving Vine or similar to run Windows in parallel, but it would probably be a nuisance.
댓글 수: 0
참고 항목
카테고리
Help Center 및 File Exchange에서 Fortran with MATLAB에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!