From: Patrice on
Hello

I am trying to build an executable file which can be run on computers which does not have matlab installed in it. I am working with a trial version of the compiler toolbox on Mac Os 10.

The simple example of the magic square don't work

But when I run the command mcc -m mymagic.m, I get the following output:


/Applications/Matlab/MATLAB_R2010a.app/bin/mbuild: line 308: gcc-4.0: command not found
/Applications/Matlab/MATLAB_R2010a.app/bin/mbuild: line 1885: gcc-4.0: command not found

mbuild: compile of ' "magicsquare_main.c"' failed.


Can you help me please ?

I can also give you the complete output :

Trial>> mcc -mv magicsquare
Compiler version: 4.13 (R2010a)
Processing include files...
2 item(s) added.
Processing directories installed with MCR...
The file mccExcludedFiles.log contains a list of functions excluded from the CTF archive.
0 item(s) added.
Generating MATLAB path for the compiled application...
Created 37 path items.
Begin validation of MEX files: Thu Jul 1 12:01:23 2010
End validation of MEX files: Thu Jul 1 12:01:23 2010
Parsing file "/Users/patriceguyot/Desktop/Matlab/Code_final/repertoireTest/magicsquare.m"
(Referenced from: "Compiler Command Line").
Parsing file "/Applications/Matlab/MATLAB_R2010a.app/toolbox/compiler/deploy/deployprint.m"
(Referenced from: "Compiler Command Line").
Parsing file "/Applications/Matlab/MATLAB_R2010a.app/toolbox/compiler/deploy/printdlg.m"
(Referenced from: "Compiler Command Line").
Deleting 0 temporary MEX authorization files.
Generating file "magicsquare_main.c".
Generating file "run_magicsquare.sh".
Generating file "/Users/patriceguyot/Desktop/Matlab/Code_final/repertoireTest/readme.txt".
Generating file "magicsquare_mcc_component_data.c".
Executing command: "/Applications/Matlab/MATLAB_R2010a.app/bin/mbuild" -O -v -output "magicsquare.app/Contents/MacOS/magicsquare" "magicsquare_main.c" "magicsquare_mcc_component_data.c" -link exe -nobundle
/Applications/Matlab/MATLAB_R2010a.app/bin/mbuild: line 308: gcc-4.0: command not found
----------------------------------------------------------------
-> mbuildopts.sh sourced from directory (DIR = $HOME/.matlab/$REL_VERSION)
FILE = /Users/patriceguyot/.matlab/R2010a/mbuildopts.sh
----------------------------------------------------------------
-> TMW_ROOT = /Applications/Matlab/MATLAB_R2010a.app
-> CC = gcc-4.0
-> CC flags:
CFLAGS = -fno-common -no-cpp-precomp -arch x86_64 -isysroot /Developer/SDKs/MacOSX10.5.sdk -mmacosx-version-min=10.5 -I/Applications/Matlab/MATLAB_R2010a.app/extern/include -DUNIX -DX11
CDEBUGFLAGS = -g
COPTIMFLAGS = -O2 -DNDEBUG
CLIBS = -L/Applications/Matlab/MATLAB_R2010a.app/runtime/maci64 -lmwmclmcrrt
arguments =
-> LD = gcc-4.0
-> Link flags:
LDFLAGS = -Wl,-twolevel_namespace -undefined error -arch x86_64 -Wl,-syslibroot,/Developer/SDKs/MacOSX10.5.sdk -mmacosx-version-min=10.5 -bind_at_load
LDDEBUGFLAGS = -g
LDOPTIMFLAGS = -O
arguments =
----------------------------------------------------------------

-> gcc-4.0 -c -fno-common -no-cpp-precomp -arch x86_64 -isysroot /Developer/SDKs/MacOSX10.5.sdk -mmacosx-version-min=10.5 -I/Applications/Matlab/MATLAB_R2010a.app/extern/include -DUNIX -DX11 -O2 -DNDEBUG "magicsquare_main.c"
/Applications/Matlab/MATLAB_R2010a.app/bin/mbuild: line 1885: gcc-4.0: command not found

mbuild: compile of ' "magicsquare_main.c"' failed.

Error: An error occurred while shelling out to mbuild (error code = 1).
Unable to build executable.
??? Error using ==> mcc



And the setup :


Trial>> mbuild -setup

Options files control which compiler to use, the compiler and link command
options, and the runtime libraries to link against.
Using the 'mbuild -setup' command selects an options file that is
placed in ~/.matlab/R2010a and used by default for 'mbuild'. 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 'mbuild -f' command
(see 'mbuild -help' for more information).
The options files available for mbuild are:
1: /Applications/Matlab/MATLAB_R2010a.app/bin/mbuildopts.sh :
Build and link with MATLAB Compiler generated library via the system ANSI C/C++ compiler
0: Exit with no changes
Enter the number of the compiler (0-1):
1
Overwrite /Users/patriceguyot/.matlab/R2010a/mbuildopts.sh ([y]/n)?
y
/Applications/Matlab/MATLAB_R2010a.app/bin/mbuildopts.sh is being copied to
/Users/patriceguyot/.matlab/R2010a/mbuildopts.sh
From: Steven Lord on

"Patrice " <patrice_guyot(a)yahoo.fr> wrote in message
news:i0iedr$rf$1(a)fred.mathworks.com...
> Hello
>
> I am trying to build an executable file which can be run on computers
> which does not have matlab installed in it. I am working with a trial
> version of the compiler toolbox on Mac Os 10.
>
> The simple example of the magic square don't work
>
> But when I run the command mcc -m mymagic.m, I get the following output:
>
>
> /Applications/Matlab/MATLAB_R2010a.app/bin/mbuild: line 308: gcc-4.0:
> command not found
> /Applications/Matlab/MATLAB_R2010a.app/bin/mbuild: line 1885: gcc-4.0:
> command not found

*snip*

Try the suggestions in this document from the support website:

http://www.mathworks.com/support/solutions/en/data/1-BH89KJ/?solution=1-BH89KJ

--
Steve Lord
slord(a)mathworks.com
comp.soft-sys.matlab (CSSM) FAQ: http://matlabwiki.mathworks.com/MATLAB_FAQ
To contact Technical Support use the Contact Us link on
http://www.mathworks.com


From: Patrice on
Hello Steven and thanks for your reply

I've tried to manage something with your answer without success.

>When upgrading from Leopard to Snow Leopard, XCode does not get upgraded by >default. In order to be able to compile your code with the MATLAB Compiler 7.11 >(R2009b), you should do either one of two things:
>1) Upgrade your XCode to Snow Leopard.
>2) Create a symbolic link from /usr/bin to the actual location where GCC is installed. >name of the symbolic link should be gcc-4.0.

1) I'm working with Mac Os x 10.5.8 ( so, I think it's leopard, and no snow leopard).
It seems that my version of X11 is up to date.

2) I have try to create the symbolic link with the target on the directory where matlab is installed. Without succes. Do I have to specifies the exact place where gcc-4.0 is ? Where is it actually ? Can you make me an example of the command ?

Thanks a lot

Patrice
From: Patrice on
"Steven Lord" <slord(a)mathworks.com> wrote in message <i0ijdq$sfm$1(a)fred.mathworks.com>...
>
> "Patrice " <patrice_guyot(a)yahoo.fr> wrote in message
> news:i0iedr$rf$1(a)fred.mathworks.com...
> > Hello
> >
> > I am trying to build an executable file which can be run on computers
> > which does not have matlab installed in it. I am working with a trial
> > version of the compiler toolbox on Mac Os 10.
> >
> > The simple example of the magic square don't work
> >
> > But when I run the command mcc -m mymagic.m, I get the following output:
> >
> >
> > /Applications/Matlab/MATLAB_R2010a.app/bin/mbuild: line 308: gcc-4.0:
> > command not found
> > /Applications/Matlab/MATLAB_R2010a.app/bin/mbuild: line 1885: gcc-4.0:
> > command not found
>
> *snip*
>
> Try the suggestions in this document from the support website:
>
> http://www.mathworks.com/support/solutions/en/data/1-BH89KJ/?solution=1-BH89KJ
>
> --
> Steve Lord
> slord(a)mathworks.com
> comp.soft-sys.matlab (CSSM) FAQ: http://matlabwiki.mathworks.com/MATLAB_FAQ
> To contact Technical Support use the Contact Us link on
> http://www.mathworks.com
>
From: Patrice on
Dear Steven, it seems that your reply is exactly the same than the first time