f



Mex yprime.c compile failed matlab r2010a mac os x 10.6.6 xcode 4 gcc v4.2.1

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
 
0
3/14/2011 10:57:04 AM
comp.soft-sys.matlab 211266 articles. 23 followers. lunamoonmoon (257) is leader. Post Follow

9 Replies
1437 Views

Similar Articles

[PageSpeed] 49

Xcode 4 is not supported with MATLAB R2010a.  For the supported 
compilers list, please see:
http://www.mathworks.com/support/compilers/R2010a/maci64.html

To get the supported version of Xcode, click on the link that says 
"Looking for Xcode 3? Download Now" at the bottom right of this page:
http://developer.apple.com/xcode/

Hope that helps.

Gadi

0
greinhorn (41)
3/14/2011 12:10:08 PM
"Ning" wrote in message <ilksa0$9fe$1@fred.mathworks.com>...
> 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,
> 
 
>     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
>  

Hi Ning,

I am not using 2010a yet, but I was able to get my mex to work with Xcode 4 with the following set in my mexopts

    ;;
maci64)
#----------------------------------------------------------------------------
CC=gcc
SDKROOT='/Developer/SDKs/MacOSX10.6.sdk'
MACOSX_DEPLOYMENT_TARGET='10.6'
ARCHS='x86_64'
CFLAGS="-fno-common -no-cpp-precomp -arch $ARCHS -mmacosx-version-min=$MACOSX_DEPLOYMENT_TARGET" 
CFLAGS="$CFLAGS  -fexceptions"
CLIBS="$MLIBS"
COPTIMFLAGS='-O2 -DNDEBUG'
CDEBUGFLAGS='-g'
#
CLIBS="$CLIBS -lstdc++"

CXX=g++
CXXFLAGS="-fno-common -no-cpp-precomp -fexceptions -arch $ARCHS  -mmacosx-version-min=$MACOSX_DEPLOYMENT_TARGET" 
CXXLIBS="$MLIBS -lstdc++"
CXXOPTIMFLAGS='-O2 -DNDEBUG'
CXXDEBUGFLAGS='-g'

I changed the target to 10.6 and I got rid of the -isysroot

Hope that helps.

Jake
0
3/29/2011 4:10:14 PM
"Ning" wrote in message <ilksa0$9fe$1@fred.mathworks.com>...
> 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
>  

Hello Ning,

I have the same issue. I can run mex (fortran-matlab) in version R2008a but cannot run the same set-up in R2010a. I did the following:

I have installed MSYS, MinGW and gfortran. I have also downloaded and extracted gnumex in the c:\documents\MATLAB folder. I entered gnumex to run the installation settings. At this point, I see a window pop-up and I entered the following:
a) MinGW's root directory ---> Pointed towards c:\mingw
b) Cygwin's root directory -----> left blank
c) Path to g95.exe ------> c:\mingw\bin
d) path to gfortran.exe ------> c:\program files\gfortran\bin
e) path to gnumex utilities ------> c:\users.....\matlab\gnumex
f) environment linking type ------> MinGW
g) generate mex dll or engine -----> mex
h) language for compilation -------> fortran 77
i) add stub ------> no
k) optimization level -----> -O3

l) path for libraries and .def files
c:\users...\Roaming\MathWorks\MATLAB\R2010a\gnumex

m) Mex options file to create:
c\users\...\Roaming\MathWorks\MATLAB\R2010a\mexopts.bat

The above is my installation setup for mex with gnumex. When I hit make options file, an warning message pops out which says
" cannot corret mex.pl .....
"cannot open c:\...\R2010a\bin\mex.pl for writing"

and when I hit ok, again it pops out saying to confirm overwrite of mexopts.bat .
I hit confirm and the opt file is created. 

At this point I should have my mex setup ready. But, when I run the fortran mex examples xtimesy.f, etc.. ( I use mex filename.f) I get the following error

g77: getValidInputLinkLibraries: No such file or directory
c:\prog~1\MATLAB\R2010A\BIN\MEX.PL: Error: Link of 'xtimesy.mexw32' failed.
Error using ---> mex at 222
unable to complete successfully.

Did you get through this issue. Please let us know..

Thanks and regards,
Subhash
0
subash057 (2)
4/6/2011 12:43:04 AM
Hey Ning, 

the solution was rather simple in my case (R2010a).
I was really forced to figure it out, not wanting to remove the new and shiny XCode 4 :)

If you run "mex -setup" the file "/.matlab/R2010a/mexopts.sh" will be created. 
Modify it, so that it says 

SDKROOT='/Developer/SDKs/MacOSX10.6.sdk'
MACOSX_DEPLOYMENT_TARGET='10.6'
 
in the maci) as well as in the maci64) subsection.

(instead of System 10.5)

Save it, and you're good to go. 

Good Luck
L
0
lri (2)
4/21/2011 4:53:05 PM
I am running R2010B on Mac, and had good success following L R's advice. Of course, the mexopts.sh file is in "~/.matlab/R2010b/" in this case.

> If you run "mex -setup" the file "/.matlab/R2010a/mexopts.sh" will be created. 
> Modify it, so that it says 
> 
> SDKROOT='/Developer/SDKs/MacOSX10.6.sdk'
> MACOSX_DEPLOYMENT_TARGET='10.6'
>  
> in the maci as well as in the maci64 subsections.
> 
> (instead of System 10.5)
> 
> Save it, and you're good to go. 
> 
> Good Luck
> L
0
4/24/2011 10:25:05 PM
Hi, 

I think that you have to use the option 1 (for gcc) when you configure the setup of mex (using mex -setup)

I hope it helps
Best regards,
María 

"Subhash " <subash057@hotmail.com> wrote in message <ingcuo$r8t$1@fred.mathworks.com>...
> "Ning" wrote in message <ilksa0$9fe$1@fred.mathworks.com>...
> > 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
> >  
> 
> Hello Ning,
> 
> I have the same issue. I can run mex (fortran-matlab) in version R2008a but cannot run the same set-up in R2010a. I did the following:
> 
> I have installed MSYS, MinGW and gfortran. I have also downloaded and extracted gnumex in the c:\documents\MATLAB folder. I entered gnumex to run the installation settings. At this point, I see a window pop-up and I entered the following:
> a) MinGW's root directory ---> Pointed towards c:\mingw
> b) Cygwin's root directory -----> left blank
> c) Path to g95.exe ------> c:\mingw\bin
> d) path to gfortran.exe ------> c:\program files\gfortran\bin
> e) path to gnumex utilities ------> c:\users.....\matlab\gnumex
> f) environment linking type ------> MinGW
> g) generate mex dll or engine -----> mex
> h) language for compilation -------> fortran 77
> i) add stub ------> no
> k) optimization level -----> -O3
> 
> l) path for libraries and .def files
> c:\users...\Roaming\MathWorks\MATLAB\R2010a\gnumex
> 
> m) Mex options file to create:
> c\users\...\Roaming\MathWorks\MATLAB\R2010a\mexopts.bat
> 
> The above is my installation setup for mex with gnumex. When I hit make options file, an warning message pops out which says
> " cannot corret mex.pl .....
> "cannot open c:\...\R2010a\bin\mex.pl for writing"
> 
> and when I hit ok, again it pops out saying to confirm overwrite of mexopts.bat .
> I hit confirm and the opt file is created. 
> 
> At this point I should have my mex setup ready. But, when I run the fortran mex examples xtimesy.f, etc.. ( I use mex filename.f) I get the following error
> 
> g77: getValidInputLinkLibraries: No such file or directory
> c:\prog~1\MATLAB\R2010A\BIN\MEX.PL: Error: Link of 'xtimesy.mexw32' failed.
> Error using ---> mex at 222
> unable to complete successfully.
> 
> Did you get through this issue. Please let us know..
> 
> Thanks and regards,
> Subhash
0
mjmarq (3)
10/21/2011 10:24:09 PM
"Art" wrote in message <ip2801$nlm$1@fred.mathworks.com>...
> I am running R2010B on Mac, and had good success following L R's advice. Of course, the mexopts.sh file is in "~/.matlab/R2010b/" in this case.

Hi

I have the same problem but using R2011a... I'm also new in the mac-world.. I can't find the path where the mexopts.sh is copied... /.matlab/R2011a/.... can you please help me here? I tried to change the file Applications/MATLAB.app/bin/mexopts.sh but that doesn't work...

thanks
nico
0
domeit (1)
1/4/2012 2:19:09 PM
"Art" wrote in message <ip2801$nlm$1@fred.mathworks.com>...
> I am running R2010B on Mac, and had good success following L R's advice. Of course, the mexopts.sh file is in "~/.matlab/R2010b/" in this case.
> 
> > If you run "mex -setup" the file "/.matlab/R2010a/mexopts.sh" will be created. 
> > Modify it, so that it says 
> > 
> > SDKROOT='/Developer/SDKs/MacOSX10.6.sdk'
> > MACOSX_DEPLOYMENT_TARGET='10.6'
> >  
> > in the maci as well as in the maci64 subsections.
> > 
> > (instead of System 10.5)
> > 
> > Save it, and you're good to go. 
> > 
> > Good Luck
> > L

Hi, all, 

I met the same problem as Ning said, but I am using MatlabR2011a, I followed the advice from L R but just replace 10.5 by 10.7 because my system is MacOSX10.7. But it still didn't work, and with the same error. Can anybody please help me with that?

Thanks so much!

Jianning
0
Jianning
12/25/2012 4:36:10 AM
> Hi, all, 
> 
> I met the same problem as Ning said, but I am using MatlabR2011a, I followed the advice from L R but just replace 10.5 by 10.7 because my system is MacOSX10.7. But it still didn't work, and with the same error. Can anybody please help me with that?
> 
> Thanks so much!
> 
> Jianning

Adding this here for posterity. The issue on later SDK version is documented on Matlab's site here:

Specifically, the problem stems from Apple moving the directory where the SDKs live:
http://www.mathworks.com/support/solutions/en/data/1-FR6LXJ/index.html

/Applications/MATLAB_R2012a.app/extern/include/matrix.h:852:20: error: stdlib.h: No such file or directory

This is happening because the SDKROOT directory for Xcode 4.2 and earlier are:
/Developer/SDKs/MacOSX10.7.sdk/
but Apple changed this directory to
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.7.sdk/
0
4/12/2013 3:12:07 AM
Reply:

Similar Artilces:

XCode (2.4.1) Linking issue, wx 2.8.6, OS X 10.4.10, GCC4.0
Platform: Mac mini - intel dual core. I'm working through the examples in the "Cross-Platform GUI Programming with wxWidgets" books and I'm stuck on an XCode linking issue. The demos on the base wxMac code base build and work fine. So I know it's the XCode setup. I can't find the entry where the libraries are described. I've setup XCode using the wx-config --cxxflags and wx-config --libs When building the minimal code example in chapter two, the build completes and goes to the link stage where: "Linking /Volumes//u01/work/wx - example...

wxWidgets 2.6.3 on Intel Mac with OS X 10.0.4 (Tiger), gcc 4.0.1
Hello, I have recently started porting our application to Mac OS X. Application was developed for Microsoft Windows using wxWidgets. I have installed wxWidgets 2.6.3 on my Mac using darwinports system. Compilation completed successfully and without any warnings/errors. I am able to compile same programs included in library archive, but started application does not receive ANY user input - I am even unable to move application window. Program is stripped to bare bones: #include "wx/wx.h" #include <iostream> class MyApp : public wxApp { public: virtual boo...

[wx 2.6.3, Mac OS X 10.4.8, gcc 4.0.1] extremely slow wxStyledTextCtrl::Colourise()
Hello, I'm developing a multi-platform source code editor with syntax-highlighting based on wxWidgets. I have a problem with the wxStyledTextCtrl::Colourise() function on the Mac platform. This function is extremely slow on Mac, e.g. it takes about 40 seconds to do the lexing of a file of 500 lines of c++ code, while the same function returns within 1 second on the Windows and Linux platforms using the same version of wxWidgets. (I'm using the wxSTC_LEX_CPP lexer). The problem appears when the user wants to scroll down the wxStyledTextCtrl : the slider blocks and th...

Compiling Mex file, MAC OSX 10.6, MATLAB R2010a
I am brand new to compiling and MATLAB + mex, but I can't get the example (http://www.mathworks.com/support/tech-notes/1600/1605.html#testing) to run. I have gcc installed in /usr/bin/gcc and gfortran in /usr/local/bin/gfortran. I have Xcode 3 installed, though I don't know where that plays in, but I saw some controversy over Xcode 3 and Xcode 4, so just saying... Here is my working directory: %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% >> pwd ans = /Applications/MATLAB_R2010a.app/extern/examples/mex >> ls arrayProduct.c mexeval.c mexload.c arraySize.c mexeval.m mexload.m...

Matlab with NI GPIB-USB-HS on Mac OS X 10.6.2
I'm trying to open a GPIB connection from Matlab 2009b using a National Instruments GPIB-USB-HS converter on Mac OS X 10.6.2. Whenever I try TDR25=gpib('ni',0,25) I get the error ??? Error using ==> gpib.gpib at 142 The specified VENDOR adaptor could not be found. The offending input line is: pathToDll = localFindAdaptor(name, ext); I know that OS X 10.6.2 isn't officially supported by NI and after installing the driver (versions 2.5.5 and 2.5.6) I get the message that the system extension cannot be used. Nevertheless, I can communicate with my devices via...

can't compile bdb 0.6.5 on Mac OS X Snow Leopard (10.6.1)
I'm trying to use Ruby-WordNet on my recently-Snow-Leopard-upgraded Mac, and I'm getting an error saying that it can't find the bdb library: /Library/Ruby/Site/1.8/rubygems/custom_require.rb:31:in `gem_original_require': no such file to load -- bdb (LoadError) from /Library/Ruby/Site/1.8/rubygems/custom_require.rb:31:in `require' /Library/Ruby/Gems/1.8/gems/wordnet-0.0.5/lib/wordnet/lexicon.rb:34 [snip] Predictably, line 34 of lexicon.rb says: 34 require 'bdb' I used porticus to install the macports package for rb-bdb, and it says I have 0.6.5_0 installed: ...

Re: Subject: Building ACE 5.3.1 on Mac OS X (Tiger) 10.4.2 was [ace-users] Building ACE on Mac OSX 10.4 #2
Hi Jason, >> I know it isn't the most recent version available, but this version >> is used extensively across the corporation. Changing the version of >> ACE all these products used will cause the architect's heads to >> explode ;) >> >> Is it your opinion that 5.3.1 is hopeless cause on Tiger? It'll take some work, but companies like Riverace, Remedy, and OCI can help out with this stuff if staying with 5.3.1 is essential. Please see http://www.cs.wustl.edu/~schmidt/commercial-support.html for help with this stuff. >>...

RE: Subject: Building ACE 5.3.1 on Mac OS X (Tiger) 10.4.2 was [ace-users] Building ACE on Mac OSX 10.4 #2
Hi Doug, > > Thanks for using the PRF. > > >> ACE VERSION: 5.3.1 > > This version of ACE is ANCIENT. The forthcoming ACE 5.4.8 beta should > work "out of the box" for Mac OS X Tiger. If you want a preview, > please download the version in our CVS repo at I know it isn't the most recent version available, but this version is used extensively across the corporation. Changing the version of ACE all these products used will cause the architect's heads to explode ;) Is it your opinion that 5.3.1 is hopeless cause on ...

RE: Subject: Building ACE 5.3.1 on Mac OS X (Tiger) 10.4.2 was [ace-users] Building ACE on Mac OSX 10.4 #2
Hi Jason, > > >> ACE VERSION: 5.3.1 > > > > This version of ACE is ANCIENT. The forthcoming ACE 5.4.8 > beta should > > work "out of the box" for Mac OS X Tiger. If you want a preview, > > please download the version in our CVS repo at > > I know it isn't the most recent version available, but this > version is used > extensively across the corporation. Changing the version of > ACE all these > products used will cause the architect's heads to explode ;) ;-) Right - this is where the value...

[Matlab 2009a / Mac OS 10.6.4 / 64-bit] MEX linking problem; does not find std
I'm running Matlab 2009a in 64-bit mode on Mac OS 10.6.4. I am trying to compile/link a bunch of files, but for some reason, MEX does not appear to link against STD. Below the commands I run and the error I get: ================================== /Applications/MATLAB_R2009b.app/bin/mex -c CC=g++ CXX=g++ LD=g++ ARCH=maci64 CXXFLAGS\#'-O2 -g -I. -fPIC -D__STDC_CONSTANT_MACROS -m64 -o mexClientPopen2.mexmaci64.o' mexClientPopen2.cpp /Applications/MATLAB_R2009b.app/bin/mex -c CC=g++ CXX=g++ LD=g++ ARCH=maci64 CXXFLAGS\#'-O2 -g -I. -fPIC -D__STDC_CONSTANT_MACROS -m64 -o debug.mexma...

Mac OS X 10.6.6 and MacPyhton 2.6 idle doesn't work
I've installed MacPython 2.6 under mac os x 2.6 and the IDLE doesn't work. I post error log. Suggestions? Thanks a lot. Luca 23/06/11 19.18.01 Apple80211 framework[211] ACInterfaceGetPower called with NULL interface 23/06/11 19.18.01 [0x0-0x1f61f6].org.python.IDLE[2470] Traceback (most recent call last): 23/06/11 19.18.01 [0x0-0x1f61f6].org.python.IDLE[2470] File "/ Applications/Python 2.6/IDLE.app/Contents/Resources/idlemain.py", line 30, in <module> 23/06/11 19.18.01 [0x0-0x1f61f6].org.python.IDLE[2470] main() 23/06/11 19.18.01 [...

[ace-bugs] FW: building ACE 6.2.0/6.2.2 win XL C/C++ v12.1 on AIX7.1 results in compiler error when instantiating ace templates
--_004_80317163A516B94B988E1615F9FAFB1989DFD215otwlxg22opentex_ Content-Type: multipart/alternative; boundary="_000_80317163A516B94B988E1615F9FAFB1989DFD215otwlxg22opentex_" --_000_80317163A516B94B988E1615F9FAFB1989DFD215otwlxg22opentex_ Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable To: ace-bugs@list.isis.vanderbilt.edu<mailto:ace-bugs@list.isis.vanderbilt.= edu> Subject: [area]: [synopsis] ACE VERSION: 6.2.2 HOST MACHINE and OPERATING SYSTEM: AIX 7.1 TARGET MACHINE and OPERATING SYS...

8 second delays on Mac OS X 10.3.4 on 1.6 GHz G5 with 1GB ram, 2 * 80 GByte drives
I posted this back in Feb on comp.sys.mac.misc and got several answers, but I still haven't found the source of the problem or the fix. I don't see any disk/cpu activity at the delay times, and all the sleep functions are off. The previous thread can be found by google groups search: "mac os x 8 seconds delay". Here is what I wrote before: > I am wondering if other Mac owners are having this problem: > > I open a terminal window. I enter ls -l to look at the files in my home > directory (or any other directory). I notice that if 5 minutes (or so) > elaps...

Mac file dialog extensions [2.8.1, Mac OS-X, xCode 2.4.1]
------_=_NextPart_001_01C755D2.E5708505 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Hi Looking at the code in Mac/Carbon/FileDlg.cpp, at NavEventProc, in response to the kNavCBPopupMenuSelect event, I noticed that the code takes the LAST extension from the filter and attaches it to the file. I find this a bit strange, and I would expect the FIRST extension of each file type to be the most dominant one, so that it's used as the default extension if none is supplied. Is there any reason for using the last extension (o...

Web resources about - Mex yprime.c compile failed matlab r2010a mac os x 10.6.6 xcode 4 gcc v4.2.1 - comp.soft-sys.matlab

Compile (publisher) - Wikipedia, the free encyclopedia
Compile was a Japanese videogame developer, most notable for having developed the Puyo Puyo series, based on their Madou Monogatari franchise, ...

Information Is Power: Facebook Develops ThreatData To Compile Data On Web Threats
Part of being able to combat malware, phishing, and other online threats is gathering and consolidating as much data on those threats as possible, ...

Credit Suisse compiles yuan winners and losers list: report
... the lowers. A list of Australian winners and losers from the decision by China’s government to devalue the renminbi has reportedly been compiled ...

Beijing residents compile own death toll in flooding
Beijing residents fed up with a lack of official updates are compiling their own death tolls for last weekend's deadly floods in the capital, ...

New report compiles 25 years of UFO sightings in Canada
A Winnipeg group called Ufology Research has compiled and analyzed reported sightings of UFOs across Canada over the last 25 years.

China's nat'l library to compile book on Diaoyu Islands
China's nat'l library to compile book on Diaoyu Islands People's Daily Online ... States, Australia and the United Kingdom. The book is aimed ...

Googlers compile holiday search tips in rap video to help Santa with flight
Google is in full holiday swing (what, you haven't heard?). They just posted, on YouTube, a rap video that was put together by its employees, ...

Popular Dating Site Compiles 15 Stupid Reasons To Date A Lawyer
A new listicle describes a really horrible person to date and then says, “we think lawyers are probably this awful, go date them!” Continue ...

Author Compiles Lively L.A. Times History Lesson
Long before Eli Broad , Rupert Murdoch and people willing to pay $140 million for the Las Vegas Review-Journal, there was Harrison Gray Otis ...

Japan, China compile written pledge to improve ties ahead of summit
Japan and China reached a rare written agreement on Nov. 7 to improve relations strained by a territorial dispute over the Senkaku Islands in ...

Resources last updated: 1/29/2016 12:34:41 AM