Supress MEX warning: f951: Warning: Nonexistent include directory ‘MATLABROO​T/simulink​/include’ [-Wmissing-include-dirs]

25 views (last 30 days)
I have MATLAB 2019b but not simulink installed on my computer (ubuntu 16.04). When trying
mex(fullfile(matlabroot, 'extern', 'examples', 'refbook', 'timestwo.F'));
I got the following
warning: f951: Warning: Nonexistent include directory 'MATLABROOT/simulink/include' [-Wmissing-include-dirs]
where MATLABROOT represents the root path of matlab on my computer. Nevertheless, the resultant timestwo.mexa64 works without any problem. I suppose simulink is not needed at all for timestwo.
I am writing a script for mexifying a few Fortran functions of my own, and the same warning pops up inevitably. However, my functions do not rely on simulink in any way. How could I suppress this warning?
Thank you very much!
------
In case needed (even though not likely), here is the output of mex -v -setup FORTRAN. It containts nothing strange and nothing related to simulink.
Verbose mode is on.
... Looking for compiler 'gfortran6-' ...
... Executing command 'which gfortran' ...Yes ('/usr/bin/gfortran').
... Looking for folder '/usr/bin' ...Yes.
... Executing command 'which gfortran' ...Yes ('/usr/bin/gfortran').
... Executing command 'gfortran -print-file-name=libgfortran.so' ...Yes ('/usr/lib/gcc/x86_64-linux-gnu/5/libgfortran.so').
... Looking for folder '/usr/lib/x86_64-linux-gnu' ...Yes.
... Executing command 'which gfortran' ...Yes ('/usr/bin/gfortran').
... Executing command 'gfortran -print-file-name=libgfortranbegin.a' ...Yes ('/usr/lib/gcc/x86_64-linux-gnu/5/libgfortranbegin.a').
... Looking for folder '/usr/lib/gcc/x86_64-linux-gnu/5' ...Yes.
... Executing command 'which gfortran' ...Yes ('/usr/bin/gfortran').
... Executing command 'gfortran -dumpversion' ...Yes ('5.5.0').
Found installed compiler 'gfortran6-'.
... Looking for compiler 'gfortran' ...
... Executing command 'which gfortran' ...Yes ('/usr/bin/gfortran').
... Looking for folder '/usr/bin' ...Yes.
... Executing command 'which gfortran' ...Yes ('/usr/bin/gfortran').
... Executing command 'gfortran -print-file-name=libgfortran.so' ...Yes ('/usr/lib/gcc/x86_64-linux-gnu/5/libgfortran.so').
... Looking for folder '/usr/lib/x86_64-linux-gnu' ...Yes.
... Executing command 'which gfortran' ...Yes ('/usr/bin/gfortran').
... Executing command 'gfortran -dumpversion | awk -F '.' '$1>=6' ' ...No.
Did not find installed compiler 'gfortran'.
... Looking for compiler 'gfortran6-' ...
... Executing command 'which gfortran' ...Yes ('/usr/bin/gfortran').
... Looking for folder '/usr/bin' ...Yes.
... Executing command 'which gfortran' ...Yes ('/usr/bin/gfortran').
... Executing command 'gfortran -print-file-name=libgfortran.so' ...Yes ('/usr/lib/gcc/x86_64-linux-gnu/5/libgfortran.so').
... Looking for folder '/usr/lib/x86_64-linux-gnu' ...Yes.
... Executing command 'which gfortran' ...Yes ('/usr/bin/gfortran').
... Executing command 'gfortran -print-file-name=libgfortranbegin.a' ...Yes ('/usr/lib/gcc/x86_64-linux-gnu/5/libgfortranbegin.a').
... Looking for folder '/usr/lib/gcc/x86_64-linux-gnu/5' ...Yes.
... Executing command 'which gfortran' ...Yes ('/usr/bin/gfortran').
... Executing command 'gfortran -dumpversion' ...Yes ('5.5.0').
Found installed compiler 'gfortran6-'.
MEX configured to use 'gfortran6-' for FORTRAN language compilation.

Answers (1)

Josh G.
Josh G. on 22 May 2020
Usually you could just pass a compiler option that would disable this warning, but a bug in gfortran causes the -Wno-missing-include-dirs option not to work.
The only other way to remove this warning is to stop mex from trying to include that directory. Open your mex_FORTRAN_glnxa64.xml file, find the part starting with "INCLUDE=" and remove the following:
-I"$MATLABROOT/simulink/include"

Categories

Find more on Introduction to Installation and Licensing in Help Center and File Exchange

Tags

Products


Release

R2019b

Community Treasure Hunt

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

Start Hunting!