Drexel dragonThe Math ForumDonate to the Math Forum



Search All of the Math Forum:

Views expressed in these public forums are not endorsed by Drexel University or The Math Forum.


Math Forum » Discussions » Software » comp.soft-sys.matlab

Topic: Mex yprime.c compile failed matlab r2010a mac os x 10.6.6 xcode 4 gcc v4.2.1
Replies: 9   Last Post: Apr 11, 2013 11:12 PM

Advanced Search

Back to Topic List Back to Topic List Jump to Tree View Jump to Tree View   Messages: [ Previous | Next ]
Ning

Posts: 1
Registered: 3/14/11
Mex yprime.c compile failed matlab r2010a mac os x 10.6.6 xcode 4 gcc v4.2.1
Posted: Mar 14, 2011 6:57 AM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

Dear all,

I am new to this topic. I just wanted to follow the steps to build a mex file from my mac. I am using a matlab r2010a on a mac with os x 10.6.6. I have the xcode4 installed.

After typed in mex -setup in the matlab prompt, the output are as follows,

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 ~/.matlab/R2010a 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 ~/.matlab/R2010a.

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: /Applications/MATLAB_R2010a.app/bin/gccopts.sh :
Template Options file for building gcc MEX-files

2: /Applications/MATLAB_R2010a.app/bin/mexopts.sh :
Template Options file for building MEX-files via the system ANSI compiler


0: Exit with no changes

Enter the number of the compiler (0-2):
2

Overwrite /Users/neilhan0210/.matlab/R2010a/mexopts.sh ([y]/n)?
y

/Applications/MATLAB_R2010a.app/bin/mexopts.sh is being copied to
/Users/neilhan0210/.matlab/R2010a/mexopts.sh


**************************************************************************
Warning: The MATLAB C and Fortran API has changed to support MATLAB
variables with more than 2^32-1 elements. In the near future
you will be required to update your code to utilize the new
API. You can find more information about this at:
http://www.mathworks.com/support/solutions/en/data/1-5C27B9/?solution=1-5C27B9
Building with the -largeArrayDims option enables the new API.
**************************************************************************

Then I typed in mex yprime.c (it is in the current matlab directory), the results are as follows,

yprime.c:17:18: error: math.h: No such file or directory
In file included from yprime.c:18:
/Applications/MATLAB_R2010a.app/extern/include/mex.h:58: error: syntax error before 'typedef'
In file included from /Applications/MATLAB_R2010a.app/extern/include/mex.h:60,
from yprime.c:18:
/Applications/MATLAB_R2010a.app/extern/include/matrix.h:302:20: error: stddef.h: No such file or directory
In file included from /Applications/MATLAB_R2010a.app/extern/include/matrix.h:303,
from /Applications/MATLAB_R2010a.app/extern/include/mex.h:60,
from yprime.c:18:
/Applications/MATLAB_R2010a.app/extern/include/tmwtypes.h:43:20: error: limits.h: No such file or directory
/Applications/MATLAB_R2010a.app/extern/include/tmwtypes.h:46:21: error: stdbool.h: No such file or directory
/Applications/MATLAB_R2010a.app/extern/include/tmwtypes.h:61:21: error: float.h: No such file or directory
/Applications/MATLAB_R2010a.app/extern/include/tmwtypes.h:791:2: error: #error "This code must be compiled using a 2's complement representation for signed integer values"
In file included from /Applications/MATLAB_R2010a.app/extern/include/mex.h:60,
from yprime.c:18:
/Applications/MATLAB_R2010a.app/extern/include/matrix.h:330: error: syntax error before 'char16_t'
/Applications/MATLAB_R2010a.app/extern/include/matrix.h:330: warning: data definition has no type or storage class
/Applications/MATLAB_R2010a.app/extern/include/matrix.h:337: error: syntax error before 'mxChar'
/Applications/MATLAB_R2010a.app/extern/include/matrix.h:337: warning: data definition has no type or storage class
/Applications/MATLAB_R2010a.app/extern/include/matrix.h:447: error: syntax error before 'n'
/Applications/MATLAB_R2010a.app/extern/include/matrix.h:455: error: syntax error before 'n'
/Applications/MATLAB_R2010a.app/extern/include/matrix.h:469: error: syntax error before 'size_t'
/Applications/MATLAB_R2010a.app/extern/include/matrix.h:678: error: syntax error before 'mxGetNumberOfElements'
/Applications/MATLAB_R2010a.app/extern/include/matrix.h:680: warning: data definition has no type or storage class
/Applications/MATLAB_R2010a.app/extern/include/matrix.h:730: error: syntax error before '*' token
/Applications/MATLAB_R2010a.app/extern/include/matrix.h:732: warning: data definition has no type or storage class
/Applications/MATLAB_R2010a.app/extern/include/matrix.h:791: error: syntax error before 'mxGetM'
/Applications/MATLAB_R2010a.app/extern/include/matrix.h:791: warning: data definition has no type or storage class
/Applications/MATLAB_R2010a.app/extern/include/matrix.h:803: error: syntax error before 'mxGetN'
/Applications/MATLAB_R2010a.app/extern/include/matrix.h:803: warning: data definition has no type or storage class
/Applications/MATLAB_R2010a.app/extern/include/matrix.h:853: error: syntax error before 'mxGetElementSize'
/Applications/MATLAB_R2010a.app/extern/include/matrix.h:853: warning: data definition has no type or storage class
In file included from /Applications/MATLAB_R2010a.app/extern/include/mex.h:60,
from yprime.c:18:
/Applications/MATLAB_R2010a.app/extern/include/matrix.h:953:20: error: stdlib.h: No such file or directory
/Applications/MATLAB_R2010a.app/extern/include/matrix.h:1141: error: syntax error before 'm'
In file included from yprime.c:18:
/Applications/MATLAB_R2010a.app/extern/include/mex.h:93: error: syntax error before 'size_t'
/Applications/MATLAB_R2010a.app/extern/include/mex.h:93: warning: no semicolon at end of struct or union
/Applications/MATLAB_R2010a.app/extern/include/mex.h:95: error: syntax error before '}' token
/Applications/MATLAB_R2010a.app/extern/include/mex.h:95: warning: data definition has no type or storage class
/Applications/MATLAB_R2010a.app/extern/include/mex.h:124: error: syntax error before '*' token
/Applications/MATLAB_R2010a.app/extern/include/mex.h:124: error: 'mexLocalFunctionTable' declared as function returning a function
/Applications/MATLAB_R2010a.app/extern/include/mex.h:124: error: 'mexLocalFunctionTable' redeclared as different kind of symbol
/Applications/MATLAB_R2010a.app/extern/include/mex.h:95: error: previous declaration of 'mexLocalFunctionTable' was here
/Applications/MATLAB_R2010a.app/extern/include/mex.h:125: error: 'fn_mex_set_local_function_table' declared as function returning a function
In file included from yprime.c:18:
/Applications/MATLAB_R2010a.app/extern/include/mex.h:163:19: error: stdio.h: No such file or directory
yprime.c: In function 'yprime':
yprime.c:52: warning: incompatible implicit declaration of built-in function 'sqrt'

mex: compile of ' "yprime.c"' failed.

??? Error using ==> mex at 222
Unable to complete successfully.

Looks like the Matlab can't find the gcc compiler. Anyone had a similar problem and solved it please helps.

Any suggestions are appreciated.

Thanks

Ning




Point your RSS reader here for a feed of the latest messages in this topic.

[Privacy Policy] [Terms of Use]

© Drexel University 1994-2014. All Rights Reserved.
The Math Forum is a research and educational enterprise of the Drexel University School of Education.