Problems with Fortran MEX files with R2020b on Linux
Show older comments
Hello,
I wanted to try out using Fortran MEX files with Matlab R2020b on Linux (Ubuntu 20.04).
First, "mex -setup" does not detect the right compiler. On my system, I have installed both -
gfortran 9.3.0 as well as gfortran 8.4.0.
According to the list of supported compilers, R2020b supports gfortran 8.x - but
mex -setup
does not detect it.
So how can tell mex to properly use gfortran 8.4 ?
When I compile e.g. the supplied example timestwo.F, I get weird behaviour. It compiles without error, but the output values are totally wrong. E.g.
timestwo([1 2 3 4 5])
gives
ans =
2.0000 0.0000 5.0000 0.0000 0.0000
For me, this looks like a memory access problem on input or output parameters. And timestwo(1:10) crashes.
I have tried with switch -R2017a (separate complex API) as well as -R2018a (interleaved complex API), but without success and same errors.
Any ideas, what is going wrong here ?
Best regards,
Denn
Accepted Answer
More Answers (0)
Categories
Find more on Fortran Source MEX Files in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!