|
|
MEX ERROR: "Could not find the compiler "cl" on the DOS path"
Hi
I am trying to compile some c++ code into a MEX in MATLAB 2010a under Windows 7 64 bit. I get the following error:
---
Error: Could not find the compiler "cl" on the DOS path.
Use mex -setup to configure your environment properly.
C:\PROGRA~1\MATLAB\R2010A\BIN\MEX.PL: Error: Unable to locate compiler.
---
When use mex -setup the only compiler listed is "Microsoft Visual C++ 2008 Express in C:\Program Files (x86)\Microsoft Visual Studio 9.0".
I have done some searching and found suggestions this might be due to the path of the VCINSTALLDIR not being specified properly in the mexopts .bat files. I set the environment variable VCINSTALLDIR to "C:\Program Files (x86)\Microsoft Visual Studio 9.0".
I still get the same error. Can any one help me?
Many thanks
Mark
|
|
0
|
|
|
|
Reply
|
Mark
|
10/11/2010 12:40:24 PM |
|
"Mark Drakesmith" <mark.drakesmith@postgrad.manchester.ac.uk> wrote in
message news:i8v0jo$8ol$1@fred.mathworks.com...
> Hi
>
> I am trying to compile some c++ code into a MEX in MATLAB 2010a under
> Windows 7 64 bit. I get the following error:
>
> ---
> Error: Could not find the compiler "cl" on the DOS path. Use mex -setup
> to configure your environment properly.
>
> C:\PROGRA~1\MATLAB\R2010A\BIN\MEX.PL: Error: Unable to locate
> compiler. ---
>
> When use mex -setup the only compiler listed is "Microsoft Visual C++ 2008
> Express in C:\Program Files (x86)\Microsoft Visual Studio 9.0".
> I have done some searching and found suggestions this might be due to the
> path of the VCINSTALLDIR not being specified properly in the mexopts .bat
> files. I set the environment variable VCINSTALLDIR to "C:\Program Files
> (x86)\Microsoft Visual Studio 9.0".
>
> I still get the same error. Can any one help me?
Follow the instructions in footnote 3 on this page:
http://www.mathworks.com/support/compilers/R2010a/win64.html
--
Steve Lord
slord@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
|
|
0
|
|
|
|
Reply
|
slord (13285)
|
10/11/2010 1:08:51 PM
|
|
Thanks for the reply. I did select "X64 Compilers and Tools" when installing Visual Studio. The compiler has worked in the past. I don't know what has happened to now make it not work.
Thanks again
Mark
|
|
0
|
|
|
|
Reply
|
Mark
|
10/11/2010 1:35:04 PM
|
|
Steven_Lord wrote:
....
> Follow the instructions in footnote 3 on this page:
>
> http://www.mathworks.com/support/compilers/R2010a/win64.html
Steve--as you're aware I'm stuck in R12 since retired and have never
been able to get mex -setup to recognize the CVF 6.6 (Update C) compiler.
I followed from the link above to the previous versions and found that
indeed, that is supposed to have been a supported compiler.
What I see in the list if ask for Matlab to find installed compilers--
Would you like mex to locate installed compilers [y]/n? y
Select a compiler:
[1] Digital Visual Fortran version 6.0 in C:\MSVisualStudio
[2] Lcc C version 2.4 in C:\MATLABR12\sys\lcc
[3] Microsoft Visual C/C++ version 5.0 in C:\Program Files\DevStudio
[4] WATCOM C/C++ version 10.6 in C:\WATCOM
Those are sorta' right, sorta' wrong...
The directory for CVF is correct; the version isn't. It is
C:\> df /logo =?
Compaq Visual Fortran Optimizing Compiler Version 6.6 (Update C)
I can't figure out if it's trying to parse the output of the fl32.exe to
determine that or trying to match it to some hardcoded string from
somewhere else.
I've created a CF66OPTS.* file; I've tried DF66* as well; nothing seems
to get past whatever sentinel is at the door.... :(
I've fiddled with this off and on ever since I got the update installed
and never have had any joy...
Can you or someone point to the detail that is missing in how this
supposedly works? Is the problem perhaps somehow related to the fact
the version of CVF is upgrade from DVF 5 rather than a virgin CVF
install and there's a remnant of the DVF in the registry or somesuch
causing a comparison failure?
--
|
|
0
|
|
|
|
Reply
|
dpb
|
10/11/2010 3:45:27 PM
|
|
"dpb" <none@non.net> wrote in message
news:i8vbmm$klq$1@news.eternal-september.org...
> Steven_Lord wrote:
> ...
>
>> Follow the instructions in footnote 3 on this page:
>>
>> http://www.mathworks.com/support/compilers/R2010a/win64.html
>
> Steve--as you're aware I'm stuck in R12 since retired and have never been
> able to get mex -setup to recognize the CVF 6.6 (Update C) compiler.
*snip*
For future reference, it appears dpb was able to get this working (at least
to the point of getting "mex -setup" to recognize the compiler.)
http://www.mathworks.com/matlabcentral/newsreader/view_thread/293630
--
Steve Lord
slord@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
|
|
0
|
|
|
|
Reply
|
slord (13285)
|
10/12/2010 5:27:58 PM
|
|
Hi Steven,
I got a very similar problem but with different versions of Matlab and complier.
The message I got is:
Error: Could not find the compiler "cl" on the DOS path.
Use mex -setup to configure your environment properly.
C:\PROGRA~1\MATLAB\R2010B\BIN\MEX.PL: Error: Unable to locate compiler.
Warning: Executing startup failed in matlabrc.
This indicates a potentially serious problem in your MATLAB setup,
which should be resolved as soon as possible. Error detected was:
MATLAB:MEX:genericFailure
Unable to complete successfully.
And I'm using:
Microsoft Visual C++ 2010 Express in c:\Program Files (x86)\Microsoft Visual Studio 10.0
R2010b (as well as R2011b, recently installed at my workstation at university)
* R2010b is for a 64-bit system, while R2011b is 32-bit installed on a 64-bit computer
I guess this problem is of the same root as above, but I don't still know what to do.
Please help.
Thanks,
Jason
"Steven_Lord" <slord@mathworks.com> wrote in message <i925qt$q7p$1@fred.mathworks.com>...
>
>
> "dpb" <none@non.net> wrote in message
> news:i8vbmm$klq$1@news.eternal-september.org...
> > Steven_Lord wrote:
> > ...
> >
> >> Follow the instructions in footnote 3 on this page:
> >>
> >> http://www.mathworks.com/support/compilers/R2010a/win64.html
> >
> > Steve--as you're aware I'm stuck in R12 since retired and have never been
> > able to get mex -setup to recognize the CVF 6.6 (Update C) compiler.
>
> *snip*
>
> For future reference, it appears dpb was able to get this working (at least
> to the point of getting "mex -setup" to recognize the compiler.)
>
> http://www.mathworks.com/matlabcentral/newsreader/view_thread/293630
>
> --
> Steve Lord
> slord@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
|
|
0
|
|
|
|
Reply
|
loooooo (29)
|
12/12/2011 5:44:08 PM
|
|
"Jason " <loooooo@hotmail.com> wrote in message
news:jc5eh8$6fm$1@newscl01ah.mathworks.com...
> Hi Steven,
>
> I got a very similar problem but with different versions of Matlab and
> complier.
>
> The message I got is:
> Error: Could not find the compiler "cl" on the DOS path. Use mex -setup to
> configure your environment properly.
>
> C:\PROGRA~1\MATLAB\R2010B\BIN\MEX.PL: Error: Unable to locate compiler.
> Warning: Executing startup failed in matlabrc.
> This indicates a potentially serious problem in your MATLAB setup,
> which should be resolved as soon as possible. Error detected was:
> MATLAB:MEX:genericFailure
> Unable to complete successfully.
> And I'm using:
> Microsoft Visual C++ 2010 Express in c:\Program Files (x86)\Microsoft
> Visual Studio 10.0 R2010b (as well as R2011b, recently installed at my
> workstation at university)
> * R2010b is for a 64-bit system, while R2011b is 32-bit installed on a
> 64-bit computer
>
> I guess this problem is of the same root as above, but I don't still know
> what to do.
Try:
http://www.mathworks.com/support/solutions/en/data/1-1I5TNS/index.html?solution=1-1I5TNS
If that doesn't work, please contact Technical Support.
--
Steve Lord
slord@mathworks.com
To contact Technical Support use the Contact Us link on
http://www.mathworks.com
|
|
0
|
|
|
|
Reply
|
slord (13285)
|
12/12/2011 5:54:10 PM
|
|
On 12/12/2011 11:44 AM, Jason wrote:
> Hi Steven,
>
> I got a very similar problem but with different versions of Matlab and
> complier.
>
> The message I got is:
> Error: Could not find the compiler "cl" on the DOS path. Use mex -setup
> to configure your environment properly.
>
> C:\PROGRA~1\MATLAB\R2010B\BIN\MEX.PL: Error: Unable to locate compiler.
> Warning: Executing startup failed in matlabrc.
....
> I guess this problem is of the same root as above, but I don't still
> know what to do.
>
> Please help.
....
Well, I had two problems.
First, the options file supplied by TMW (the 'cf61opts.stp' file) has
the installation root directory in which the compiler is expected to be
in hardcoded instead of finding that information from the actual
installation. So, if you did anything other than accept the default
installation for the compiler on installation you'll undoubtedly have to
edit the proper configuration file to reflect that.
Second, once that let me install the compiler, the combination of the
perl script and batch files that TMW uses to compile mex within Matlab
had an error in which it generated a bad command switch in the file
submitted as input to the linker. The out/= switch didn't get the
object file name passed. I never did figure out how to fix the problem
correctly not knowing enough Perl to read the convoluted process files
well enough but I did figure out a way to neuter the source file to
remove the OUT/ switch entirely as it really is superfluous.
Whether either of those has any bearing on your problem I hesitate to
venture even a guess.
I note the thing about the failure in matlabrc though makes me wonder if
there isn't something in your Matlab setup before it even gets as far as
the failure I had...
Again, I have a _very_ old release; things are probably quite a lot
different in details now...
--
|
|
0
|
|
|
|
Reply
|
none1568 (6654)
|
12/12/2011 6:16:59 PM
|
|
"Mark Drakesmith" wrote in message <i8v3q8$5s$1@fred.mathworks.com>...
> Thanks for the reply. I did select "X64 Compilers and Tools" when installing Visual Studio. The compiler has worked in the past. I don't know what has happened to now make it not work.
>
> Thanks again
>
> Mark
Same for me. Did you get a solution to this problem?
Thankd in advance.
Jose
|
|
0
|
|
|
|
Reply
|
jovan21 (1)
|
1/10/2012 8:34:08 PM
|
|
|
8 Replies
1984 Views
(page loaded in 0.191 seconds)
|
|
|
|
|
|
|
|
|