I cannot even compile (mex) your (MATLAB) reference book Fortran codes :.(../exte​rn/example​s/refbook)

3 views (last 30 days)
Dear MATLAB Personnel,
I am having a deep truouble with your mex command using any *.F90 FORTRAN codes recently. I wa able to mex them when my MATLAB release was R2017 or R 2018 with Ubuntu 18 . Now I moved to Ubuntu 22 and using R2021b. However, I lost the ability to mex my old FORTRAN codes. These are mostly your reference book codes. , like xtimesy.f or such. Each time I tried to mex these codes I got this result :Building with 'gfortran'.
/usr/local/MATLAB/R2021b/extern/version/fortran_mexapi_version.F:4:27:
4 | built_by_rel(1) = z'2021b'
| 1
Error: BOZ literal constant at (1) is neither a DATA statement value nor an actual argument of INT/REAL/DBLE/CMPLX intrinsic subprogram [see ‘-fno-allow-invalid-boz’]
/usr/local/MATLAB/R2021b/extern/version/fortran_mexapi_version.F:5:29:
5 | target_api_ver(1) = FORT_MX_TARGET_API_VER
| 1
Error: BOZ literal constant at (1) is neither a DATA statement value nor an actual argument of INT/REAL/DBLE/CMPLX intrinsic subprogram [see ‘-fno-allow-invalid-boz’]
CAN YOU HELP ME ?
Regards,
Mehmet Ramazanoglu

Answers (2)

Robert
Robert on 27 Oct 2022
Try using the following compiler flags that will turn it to warnings, mex FFLAGS='$FFLAGS -fallow-argument-mismatch -fallow-invalid-boz'
  1 Comment
Robert
Robert on 27 Oct 2022
You may also need to do the following if you get the following error when running the mexfile, /usr/local/MATLAB/R2021b/bin/glnxa64/../../sys/os/glnxa64/libgfortran.so.5: version `GFORTRAN_10' not found
sudo ln -sf /usr/lib/x86_64-linux-gnu/libgfortran.so.5.0.0 "/usr/local/MATLAB/R2021b/sys/os/glnxa64/libgfortran.so.5"

Sign in to comment.


Mehmet Ramazanoglu
Mehmet Ramazanoglu on 31 Oct 2022
Dear Robert,
Yes , this new line you mentioned in your email worked with warnings however my code was mex(ed) without any errror.
Thanks.
Mmt

Categories

Find more on Fortran with MATLAB in Help Center and File Exchange

Products


Release

R2021b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!