MATLAB Answers

mex -setup doesn't seem to find my compilers?

26 views (last 30 days)
David Doria
David Doria on 9 Dec 2011
I am trying to set mex to use gcc4.4 (my system default is 4.6, but I also have installed the 4.4 package). I read that 'mex -setup' is supposed to give you a list of available compilers. (from mex -help - "The -setup option causes MEX to search for installed compilers and allows you to choose an options file as the default for future invocations of MEX."). However, when I run 'mex -setup', I only see the option to copy the original mexopts.sh file:
doriad@david-lab:~/.matlab/R2011b$ ~/bin/matlab/bin/mex -setup
Options files control which compiler to use, the compiler and link command
options, and the runtime libraries to link against.
Using the 'mex -setup' command selects an options file that is
placed in /home/doriad/.matlab/R2011b and used by default for 'mex'. An options
file in the current working directory or specified on the command line
overrides the default options file in /home/doriad/.matlab/R2011b.
To override the default options file, use the 'mex -f' command
(see 'mex -help' for more information).
The options files available for mex are:
1: /home/doriad/bin/matlab/bin/mexopts.sh :
Template Options file for building gcc MEX-files
0: Exit with no changes
Enter the number of the compiler (0-1):
Can anyone tell me how to get it to find my different gcc compilers and ask me which one to use?
Thanks,
David

Answers (1)

Fangjun Jiang
Fangjun Jiang on 9 Dec 2011
What is the version of your MATLAB and what is your operating system. If you search your document (doc mex), you'll be able to find a link that tells you what compilers are supported. Or you can try this link to see if you can find the one corresponding to your version and OS.
  4 Comments
Kaustubha Govind
Kaustubha Govind on 9 Dec 2011
David: Yes, mex -setup will only find supported compilers.

Sign in to comment.

Community Treasure Hunt

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

Start Hunting!