Quantcast
Channel: MATLAB Central Newsreader - tag:"compiler"
Viewing all 36 articles
Browse latest View live

Re: MATLAB Compiler doesn't include toolbox functions

$
0
0
Problem solved.
This is a known bug and solved with the attachement on this site:

http://www.mathworks.com/support/bugreports/1059029

Best,
Jens



"Jens" wrote in message <lt7nrm$3m3$1@newscl01ah.mathworks.com>...
> Hey everyone,
>
> I am stuck with a problem concerning the MATLAB Compiler.
> I want to compile a simple function into a shared C library. Everything works properly except when I use a function from a toolbox. In this example it would be the "hann.m" function of the signal processing toolbox. Standard MATLAB code works without issues.
>
> The code compiles without error but "hann" doesn't seem to be included in the library, since the dll throws an error "Undefined function 'hann' for input arguments of type 'double'" on the Windows commandline (input parameter is checked and correct).
> This is reproduceable for functions of every other toolbox that is licensed on my machine.
> mccExcludedFiles.log doesn't list an excluded file.
> When I pass -v to the mcc command, in the log the "Processing ...\mcc.enc" entry is missing that would lead me to believe that any toolbox is evaluated and considered in the compiling process.
> Adding the functions via the "-a" option as well as in the code using the %#function pragma doesn't help.
>
> What am I missing? Any missing option? Thanks in advance!
>
>
>
>
> Used command:
> >> mcc -W lib:MATLAB_myfunctionMCR -T link:lib myfunction.m
>
> function iResult = myfunction()
> vWin = hann(128);
>
> % just return a meaningless scalar
> % for this purpose
> iResult = mean(vWin);
> end
>
>
>
>
> MATLAB Version 8.3
> MATLAB Compiler Version 5.1

MCR .exe Script w/ GUI: Saving user input (text) and using in Script

$
0
0
Hello All,

I am currently building up a data analysis tool which is compiled to a .exe file and is to be used by people without a Matlab license. The script begins with a GUI I have built which requests the data file-name of interest from the user in a edit-text box. A "start" button is then pressed, which stores the string in the edit-text box as follows (summarized version):

% --- Executes on button press in GUI.
function pushbutton1_Callback(hObject, eventdata, handles)
 x = get(handles.edit1,'String'); % Get string from user edit-text box
 if isempty(x);
     fprintf('The filename collection failed!');
 else
     global globalfilename % Declare our filename variable as global
     globalfilename=x; % Set the value of global variable to the user edit-text box
% assignin('base','filename',x); %THIS IS THE PROBLEM! (worked in non-compiled)
 end

The files worked perfectly before being compiled, but it appears that assignin will not work (since there is no matlab workspace) when running the .exe file. My issue is that this "globalfilename" which is the user input from the edit-text box is not reading into the rest of my data analysis algorithm (which is contained in a separate script). The global declaration does not appear to be working either. Any recommendations on how to approach this issue would be greatly appreciated!

Thanks,

Colin

Re: MCR .exe Script w/ GUI: Saving user input (text) and using in Script

$
0
0

"Colin " <stinger43017@yahoo.com> wrote in message
news:ltq6t7$6o0$1@newscl01ah.mathworks.com...
> Hello All,
>
> I am currently building up a data analysis tool which is compiled to a
> .exe file and is to be used by people without a Matlab license. The
> script begins with a GUI I have built which requests the data file-name of
> interest from the user in a edit-text box. A "start" button is then
> pressed, which stores the string in the edit-text box as follows
> (summarized version):
>
> % --- Executes on button press in GUI.
> function pushbutton1_Callback(hObject, eventdata, handles)
> x = get(handles.edit1,'String'); % Get string from user edit-text box
> if isempty(x);
> fprintf('The filename collection failed!');
> else
> global globalfilename % Declare our filename variable as global
> globalfilename=x; % Set the value of global variable to the user
> edit-text box
> % assignin('base','filename',x); %THIS IS THE PROBLEM! (worked in
> non-compiled)
> end
>
> The files worked perfectly before being compiled, but it appears that
> assignin will not work (since there is no matlab workspace) when running
> the .exe file. My issue is that this "globalfilename" which is the user
> input from the edit-text box is not reading into the rest of my data
> analysis algorithm (which is contained in a separate script). The global
> declaration does not appear to be working either. Any recommendations on
> how to approach this issue would be greatly appreciated!

Store it in the handles structure. Retrieve it from the handles structure in
whichever callback function invokes your data analysis function. I would do
this not only in your executable but also inside MATLAB, as the way you've
written it anyone with access to either the global or base workspaces (which
is pretty much any script, function, or class) can manipulate your
function's behavior by changing globalfilename or filename in the
appropriate workspace.

--
Steve Lord
slord@mathworks.com
To contact Technical Support use the Contact Us link on
http://www.mathworks.com

Re: Matlab R2010b x64 ignores .mexw64 files ?!

$
0
0

"Pierre " <pierre.lourdais@epfl.ch> wrote in message
news:lvsdb9$jor$1@newscl01ah.mathworks.com...

*snip*

> I have exactly this problem, so I try to click on the link you put, but it
> does not exist anymore. Is there a new link to explain the toolbox
> directory? I tried but it did not work

http://www.mathworks.com/help/matlab/matlab_env/toolbox-path-caching-in-the-matlab-program.html

--
Steve Lord
slord@mathworks.com
To contact Technical Support use the Contact Us link on
http://www.mathworks.com

Re: BUG: simulink 7.6 (r2010b) and visual c++ 2010 compiler

$
0
0
Hi,

this issues is actually a bug in MATLAB R2010b in the way that it does not work correctly with Microsoft Visual C++ 2010 Express and Windows SDK 7.1. However, there is a patch avaliable at this site:
http://www.mathworks.com/support/bugreports/673259

Cheers,
Peter


"Christopher Pong" wrote in message <insttc$m5f$1@fred.mathworks.com>...
> I had the same problem and spent a few hours trying to figure out a solution. Finally, I got something to work. I have 64-bit Windows 7 and MATLAB R2010b. Here's what I did:
>
> Most of the information I got from this link:
> http://www.mathworks.com/support/compilers/R2010b/win64.html
>
> I first installed Microsoft Visual C++ 2010 Express and Windows SDK 7.1 according to the instructions here:
> http://www.mathworks.com/support/solutions/en/data/1-ECUGQX/
> As with the previous post, I could compile yprime.c into a mexw64 file and run it. However, I could not compile simulink code using RTW since the vcvars64.bat file was missing:
> C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\bin\vcvars64.bat
> The error message said that it could not find or run this file (sorry I didn't write down the exact error message). I tried to create vcvars64.bat by modifying vcvars32.bat, which did exist in the above directory. But that did not work either.
>
> I then installed Microsoft Visual C++ 2008 Express and Windows SDK 6.1 since it is second on the list of free compilers, using the instructions here:
> http://www.mathworks.com/support/solutions/en/data/1-6IJJ3L/?solution=1-6IJJ3L
> I noticed that when I installed VC++ 2008, only vcvars32.bat existed in the directory:
> C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\bin
> After installing Windows SDK 6.1, however, vcvars64.bat showed up as well in that directory. I tried to compile simulink code using the VC++ 2008 complier, but that did not work.
>
> Finally, I copied vcvars64.bat from this directory:
> C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\bin
> to this directory:
> C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\bin
> with some minor modifications. I then selected the VC++ 2010 compiler and I could finally compile simulink code using RTW!
>
> In summary, all you should have to do is:
> - Install VC++ 2010 Express and Windows SDK 7.1 with the instructions here:
> http://www.mathworks.com/support/solutions/en/data/1-ECUGQX/
> - Run mex - setup and try to compile something in simulink
> - If you get the error message that vcvars64.bat is missing, you can try my method and copy the text below into a new file called C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\bin\vcvars64.bat. Take out the starting and ending lines that I added in (i.e., "---START OF VCVARS64.BAT, CUT FROM HERE---").
>
> I hope this helps someone else!
>
> Chris
>
>
> --- START OF VCVARS64.BAT, CUT FROM HERE ---
> @SET VSINSTALLDIR=C:\Program Files (x86)\Microsoft Visual Studio 10.0
> @SET VCINSTALLDIR=C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC
> @SET FrameworkDir=C:\Windows\Microsoft.NET\Framework64
> @SET FrameworkVersion=v4.0.30319
> @if "%VSINSTALLDIR%"=="" goto error_no_VSINSTALLDIR
> @if "%VCINSTALLDIR%"=="" goto error_no_VCINSTALLDIR
>
> @echo Setting environment for using Microsoft Visual Studio 2010 x64 tools.
>
> @call :GetWindowsSdkDir
>
> @if not "%WindowsSdkDir%" == "" (
> set "PATH=%WindowsSdkDir%bin\x64;%WindowsSdkDir%bin\win64\x64;%WindowsSdkDir%bin;%PATH%"
> set "INCLUDE=%WindowsSdkDir%include;%INCLUDE%"
> set "LIB=%WindowsSdkDir%lib\x64;%LIB%"
> )
>
> @set PATH=%VCINSTALLDIR%\BIN\amd64;%FrameworkDir%\%Framework35Version%;%FrameworkDir%\%Framework35Version%\Microsoft .NET Framework 3.5 (Pre-Release Version);%FrameworkDir%\%FrameworkVersion%;%VCINSTALLDIR%\VCPackages;%VSINSTALLDIR%\Common7\IDE;%VSINSTALLDIR%\Common7\Tools;%VSINSTALLDIR%\Common7\Tools\bin;%PATH%
> @set INCLUDE=%VCINSTALLDIR%\ATLMFC\INCLUDE;%VCINSTALLDIR%\INCLUDE;%INCLUDE%
> @set LIB=%VCINSTALLDIR%\ATLMFC\LIB\amd64;%VCINSTALLDIR%\LIB\amd64;%LIB%
>
> @set LIBPATH=%FrameworkDir%\%Framework35Version%;%FrameworkDir%\%FrameworkVersion%;%FrameworkDir%\%Framework35Version%;%FrameworkDir%\%FrameworkVersion%;%VCINSTALLDIR%\ATLMFC\LIB\amd64;%VCINSTALLDIR%\LIB\amd64;%LIBPATH%
>
> @goto end
>
> :GetWindowsSdkDir
> @call :GetWindowsSdkDirHelper HKLM > nul 2>&1
> @if errorlevel 1 call :GetWindowsSdkDirHelper HKCU > nul 2>&1
> @if errorlevel 1 echo WindowsSdkDir not found
> @exit /B 0
>
> :GetWindowsSdkDirHelper
> @SET WindowsSdkDir=
> @for /F "tokens=1,2*" %%i in ('reg query "%1\SOFTWARE\Microsoft\Microsoft SDKs\Windows" /v "CurrentInstallFolder"') DO (
> if "%%i"=="CurrentInstallFolder" (
> SET "WindowsSdkDir=%%k"
> )
> )
> @if "%WindowsSdkDir%"=="" exit /B 1
> @exit /B 0
>
> :error_no_VSINSTALLDIR
> @echo ERROR: VSINSTALLDIR variable is not set.
> @goto end
>
> :error_no_VCINSTALLDIR
> @echo ERROR: VCINSTALLDIR variable is not set.
> @goto end
>
> :end
>
> --- END OF VCVARS64.BAT ---
>
>
> "Panos" wrote in message <iafiaf$j8s$1@fred.mathworks.com>...
> > I believe that there is a bug in matlab R2010b.
> >
> > I work with win 7 64bit so I installed Visual C++ 2010 Express and Windows SDK 7.1 as it is suggested here:
> > http://www.mathworks.com/support/compilers/R2010b/win64.html
> >
> > I set mex compiler as Visual C++ 2010 Express and I tested that everything is OK within Matlab environment by compiling yprime.c and making executable a .m file that I created for this purpose.
> >
> > Everything worked well and the executable was created.
> >
> > THEN, I opened a simple model (really simple) in simulink and I tried to built the executable through real-time workshop.
> >
> > Whatever options I make, unfortunately I get error that vcvars64 cannot be found in system, meaning that the real-time workshop cannot find the 64bit compiler. I search within my C: drive and in fact vcvars64 is missing.
> >
> > I am not sure but I think that vcvars64 is a component of Visual C++ 2010 Professional. I haven't VC 2010 Pro so I cannot test it.
> >
> > So even if VC compilers work well in Matlab, they DON'T in Simulink. I believe that this is a bug of Real-Time workshop as it calls wrongly vcvars64. It should call the Visual C++ 2010 Express compiler.
> >
> > If anyone has any idea how to link Simulink with the Visual C++ 2010 Express compiler, please provide info.
> >
> > Elsewhere, I believe that Mathworks should remove from their site that "Microsoft Visual C++ 2010 Express and Windows SDK 7.1" is a supported compiler for Simulink Release 2010b

MATLAB 2014a editing mexopts.bat

$
0
0
How do i edit the mexopts.bat file in matlab 2014a? I can find it in my computer by using:

>> fullfile(prefdir, 'mexopts.bat')

ans =

C:\Users\pietr_000\AppData\Roaming\MathWorks\MATLAB\R2014a\mexopts.bat

However, when i open the containing folder it is not present. All files except for the .bat file are present. Thank you.

Re: MATLAB 2014a editing mexopts.bat

$
0
0
We are trying to link OPENCV to the compiler in matlab (we are using Visual Studio 2013, which appears to be default.)

>> mex -setup -v C++
Verbose mode is on.
... Looking for compiler 'Intel C++ Composer XE 2011 with Microsoft SDK 7.1' ...
... Looking for environment variable 'ICPP_COMPILER12' ...No.
Did not find installed compiler 'Intel C++ Composer XE 2011 with Microsoft SDK 7.1'.
... Looking for compiler 'Intel C++ Composer XE 2011 with Microsoft Visual Studio 2008' ...
... Looking for environment variable 'ICPP_COMPILER12' ...No.
Did not find installed compiler 'Intel C++ Composer XE 2011 with Microsoft Visual Studio 2008'.
... Looking for compiler 'Intel C++ Composer XE 2011 with Microsoft Visual Studio 2010 ' ...
... Looking for environment variable 'ICPP_COMPILER12' ...No.
Did not find installed compiler 'Intel C++ Composer XE 2011 with Microsoft Visual Studio 2010 '.
... Looking for compiler 'Intel C++ Composer XE 2013 with Microsoft SDK 7.1' ...
... Looking for environment variable 'ICPP_COMPILER14' ...No.
... Looking for environment variable 'ICPP_COMPILER13' ...No.
Did not find installed compiler 'Intel C++ Composer XE 2013 with Microsoft SDK 7.1'.
... Looking for compiler 'Intel C++ Composer XE 2013 with Microsoft Visual Studio 2010' ...
... Looking for environment variable 'ICPP_COMPILER14' ...No.
... Looking for environment variable 'ICPP_COMPILER13' ...No.
Did not find installed compiler 'Intel C++ Composer XE 2013 with Microsoft Visual Studio 2010'.
... Looking for compiler 'Intel C++ Composer XE 2013 with Microsoft Visual Studio 2012' ...
... Looking for environment variable 'ICPP_COMPILER14' ...No.
... Looking for environment variable 'ICPP_COMPILER13' ...No.
Did not find installed compiler 'Intel C++ Composer XE 2013 with Microsoft Visual Studio 2012'.
... Looking for compiler 'Microsoft Visual C++ 2012' ...
... Looking for registry setting 'HKLM\SOFTWARE\Microsoft\VisualStudio\SxS\VS7' 11.0 ...No.
... Looking for registry setting 'HKCU\SOFTWARE\Microsoft\VisualStudio\SxS\VS7' 11.0 ...No.
... Looking for registry setting 'HKLM\SOFTWARE\Wow6432Node\Microsoft\VisualStudio\SxS\VS7' 11.0 ...Yes ('C:\Program Files (x86)\Microsoft Visual Studio 11.0\').
... Looking for file 'C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\bin\amd64\cl.exe' ...No.
Did not find installed compiler 'Microsoft Visual C++ 2012'.
... Looking for compiler 'Microsoft Visual C++ 2008' ...
... Looking for environment variable 'VS90COMNTOOLS' ...No.
Did not find installed compiler 'Microsoft Visual C++ 2008'.
... Looking for compiler 'Microsoft Visual C++ 2010' ...
... Looking for environment variable 'VS100COMNTOOLS' ...No.
Did not find installed compiler 'Microsoft Visual C++ 2010'.
... Looking for compiler 'Microsoft Visual C++ 2013 Professional' ...
... Looking for registry setting 'HKLM\SOFTWARE\Microsoft\VisualStudio\SxS\VS7' 12.0 ...No.
... Looking for registry setting 'HKCU\SOFTWARE\Microsoft\VisualStudio\SxS\VS7' 12.0 ...No.
... Looking for registry setting 'HKLM\SOFTWARE\Wow6432Node\Microsoft\VisualStudio\SxS\VS7' 12.0 ...Yes ('C:\Program Files (x86)\Microsoft Visual Studio 12.0\').
... Looking for file 'C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\bin\amd64\cl.exe' ...Yes.
... Looking for folder 'C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC' ...Yes.
... Looking for registry setting 'HKLM\SOFTWARE\Microsoft\Microsoft SDKs\Windows\v8.1' InstallationFolder ...No.
... Looking for registry setting 'HKCU\SOFTWARE\Microsoft\Microsoft SDKs\Windows\v8.1' InstallationFolder ...No.
... Looking for registry setting 'HKLM\SOFTWARE\Wow6432Node\Microsoft\Microsoft SDKs\Windows\v8.1' InstallationFolder ...Yes ('C:\Program Files (x86)\Windows Kits\8.1\').
... Looking for registry setting 'HKLM\SOFTWARE\Microsoft\VisualStudio\SxS\VS7' 12.0 ...No.
... Looking for registry setting 'HKCU\SOFTWARE\Microsoft\VisualStudio\SxS\VS7' 12.0 ...No.
... Looking for registry setting 'HKLM\SOFTWARE\Wow6432Node\Microsoft\VisualStudio\SxS\VS7' 12.0 ...Yes ('C:\Program Files (x86)\Microsoft Visual Studio 12.0\').
... Looking for registry setting 'HKLM\SOFTWARE\Microsoft\VisualStudio\SxS\VC7' 12.0 ...No.
... Looking for registry setting 'HKCU\SOFTWARE\Microsoft\VisualStudio\SxS\VC7' 12.0 ...No.
... Looking for registry setting 'HKLM\SOFTWARE\Wow6432Node\Microsoft\VisualStudio\SxS\VC7' 12.0 ...Yes ('C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\').
... Looking for environment variable 'VS120COMNTOOLS' ...Yes ('C:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\Tools\').
... Looking for file 'C:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\IDE\devenv.exe' ...Yes.
... Looking for registry setting 'HKLM\SOFTWARE\Microsoft\VisualStudio\SxS\VS7' 12.0 ...No.
... Looking for registry setting 'HKCU\SOFTWARE\Microsoft\VisualStudio\SxS\VS7' 12.0 ...No.
... Looking for registry setting 'HKLM\SOFTWARE\Wow6432Node\Microsoft\VisualStudio\SxS\VS7' 12.0 ...Yes ('C:\Program Files (x86)\Microsoft Visual Studio 12.0\').
... Looking for file 'C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\vcvarsall.bat' ...Yes.
... Looking for folder 'C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC' ...Yes.
Found installed compiler 'Microsoft Visual C++ 2013 Professional'.
... Looking for compiler 'Microsoft Windows SDK 7.1 (C++)' ...
... Looking for registry setting 'HKLM\SOFTWARE\Microsoft\Microsoft SDKs\Windows\v7.1' InstallationFolder ...No.
Did not find installed compiler 'Microsoft Windows SDK 7.1 (C++)'.
... Looking for compiler 'Microsoft Visual C++ 2013 Professional' ...
... Looking for registry setting 'HKLM\SOFTWARE\Microsoft\VisualStudio\SxS\VS7' 12.0 ...No.
... Looking for registry setting 'HKCU\SOFTWARE\Microsoft\VisualStudio\SxS\VS7' 12.0 ...No.
... Looking for registry setting 'HKLM\SOFTWARE\Wow6432Node\Microsoft\VisualStudio\SxS\VS7' 12.0 ...Yes ('C:\Program Files (x86)\Microsoft Visual Studio 12.0\').
... Looking for file 'C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\bin\amd64\cl.exe' ...Yes.
... Looking for folder 'C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC' ...Yes.
... Looking for registry setting 'HKLM\SOFTWARE\Microsoft\Microsoft SDKs\Windows\v8.1' InstallationFolder ...No.
... Looking for registry setting 'HKCU\SOFTWARE\Microsoft\Microsoft SDKs\Windows\v8.1' InstallationFolder ...No.
... Looking for registry setting 'HKLM\SOFTWARE\Wow6432Node\Microsoft\Microsoft SDKs\Windows\v8.1' InstallationFolder ...Yes ('C:\Program Files (x86)\Windows Kits\8.1\').
... Looking for registry setting 'HKLM\SOFTWARE\Microsoft\VisualStudio\SxS\VS7' 12.0 ...No.
... Looking for registry setting 'HKCU\SOFTWARE\Microsoft\VisualStudio\SxS\VS7' 12.0 ...No.
... Looking for registry setting 'HKLM\SOFTWARE\Wow6432Node\Microsoft\VisualStudio\SxS\VS7' 12.0 ...Yes ('C:\Program Files (x86)\Microsoft Visual Studio 12.0\').
... Looking for registry setting 'HKLM\SOFTWARE\Microsoft\VisualStudio\SxS\VC7' 12.0 ...No.
... Looking for registry setting 'HKCU\SOFTWARE\Microsoft\VisualStudio\SxS\VC7' 12.0 ...No.
... Looking for registry setting 'HKLM\SOFTWARE\Wow6432Node\Microsoft\VisualStudio\SxS\VC7' 12.0 ...Yes ('C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\').
... Looking for environment variable 'VS120COMNTOOLS' ...Yes ('C:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\Tools\').
... Looking for file 'C:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\IDE\devenv.exe' ...Yes.
... Looking for registry setting 'HKLM\SOFTWARE\Microsoft\VisualStudio\SxS\VS7' 12.0 ...No.
... Looking for registry setting 'HKCU\SOFTWARE\Microsoft\VisualStudio\SxS\VS7' 12.0 ...No.
... Looking for registry setting 'HKLM\SOFTWARE\Wow6432Node\Microsoft\VisualStudio\SxS\VS7' 12.0 ...Yes ('C:\Program Files (x86)\Microsoft Visual Studio 12.0\').
... Looking for file 'C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\vcvarsall.bat' ...Yes.
... Looking for folder 'C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC' ...Yes.
****************************************************************************Found installed compiler 'Microsoft Visual C++ 2013 Professional'.*************************************************************
MEX configured to use 'Microsoft Visual C++ 2013 Professional' for C++ language compilation.
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/help/matlab/matlab_external/upgrading-mex-files-to-use-64-bit-api.html.


We used the fullfile command:

>> fullfile(prefdir, 'mexopts.bat')

ans =

C:\Users\pietr_000\AppData\Roaming\MathWorks\MATLAB\R2014a\mexopts.bat

So Matlab is locating the .bat file, but we are unable to find this file within the hard drive. Is there a new way to edit this file in 2014a?

Re: MATLAB 2014a editing mexopts.bat

$
0
0
To make this thread more concise, the objective of our group is to:

Link OPENCV to our selected compiler in Matlab 2014a.

Re: Your Fund Transfer?

$
0
0
 Hello,
We are very sorry for delay in getting back to you as regard your
funds transfer. My computer was hacked and i lost most of my business
contacts only to get yours now. Please, the transfer has been done at
the amount of USD10,000 through western Union. Western union are to
continue with the rest of the transfers upon your contact with them
until the whole USD1.5M is transferred. Here is their email address
and phone number to contact them now for the pick up information of
your funds.
Email.... w.unionmoreder@outlook.com
Phone.....+22999907475

Remember, you are not expected to pay for any transfer charges. The
only money you will send to them before the transfer is USD 98 been
their cost of paper work and nothing more, so contact them right now
with above email and phone number. And also while writing to them,
send your Full names, address and phone number for easy communication.

Thank you

Running executable from DOS command line

$
0
0
Dear Newsgroup readers,

I encountered the following problem: I have a Matlab script compiled with the Application compiler app (2014b) as a standalone application. I run this script from the command line in a DOS window. After finishing the run and with all figures closed, I can't return to the prompt line. I searched for possible solutions but everything that I found doesn't seem to be helping me.

If you have had similar experience and know the solution, would you please kindly share it?

Thank you,
Zoya

How to use compilation switches in DeployTool

$
0
0
Hello,

  In order to speed up an m script compiled as a DLL for use by a C++, it is suggested that disabling the Java Virtual Machine (JVM) during the compilation could improve the start up time about 20% to 30%. So the required compile command for this in the command windows is

mcc -m -R -nojvm test.m

But I am using DeployTool for the compilation. In the Advanced Settings of the DeployTool there is no place to define switches. So how can I do this by using DeployTool?

Re: How to use compilation switches in DeployTool

$
0
0


"Cem" <hiittite@gmail.com> wrote in message
news:mfbn4a$bhk$1@newscl01ah.mathworks.com...
> Hello,
>
> In order to speed up an m script compiled as a DLL for use by a C++, it
> is suggested that disabling the Java Virtual Machine (JVM) during the
> compilation could improve the start up time about 20% to 30%. So the
> required compile command for this in the command windows is
>
> mcc -m -R -nojvm test.m
>
> But I am using DeployTool for the compilation. In the Advanced Settings of
> the DeployTool there is no place to define switches. So how can I do this
> by using DeployTool?

Click the Settings gear in the toolstrip of the app. You can specify
additional options to be passed into MCC using the dialog that appears.

--
Steve Lord
slord@mathworks.com
To contact Technical Support use the Contact Us link on
http://www.mathworks.com

System.TypeInitializationException when using a .NET library compiled with MATLAB 32-bit in C#

$
0
0
I have compiled a .NET library using MATLAB 32-bit compiler and attempted to use it in a 32-bit C# application. When instantiating the class, I am getting a System.TypeInitializationException.

Please note the following:

(1) I have set the Configuration Manager in Visual Studio to x86 (32-bit)
(2) I am referencing MWArray.dll from the 32-bit installation of the MCR
(3) I have compiled my .NET library using the 32-bit version of MATLAB
(4) I have correctly installed the 32-bit version of the MATLAB compiler runtime
(5) I have already run gacutil.exe on the 32-bit version of MWArray.dll to register it in the GAC
(6) My machine is Windows 7 64-bit

I have called MATLAB support and have not received a solution at this time. I decided it would be a good idea to also post this issue in the MATLAB newsgroup.

If anyone has a solution, please post it. Thanks.

Re: JAVA BUILDER ERROR...????

$
0
0
"GANESH Prabhakar" <ganes.prabhakar@gmail.com> wrote in message <jgrh1u$aeg$1@newscl01ah.mathworks.com>...
> "THANH " <hoaithanh0610@yahoo.com> wrote in message <jgqea2$mqd$1@newscl01ah.mathworks.com>...
> > Hello Ganesh,
> > Thanks for your answer. When I typed mbuild-setup on my matlab(r2011a), there was no java compiler-jdk available there (although i already installed jdk 1.7 on my computer).
> > So, how could i add java-jdk to matlab compiler?
> > Thanks.
>
>
> check this once ,if anything is not there type it and restart the system.
> In Environment variables
> section-1,(first box)
> user variables for (your computer name)
> there shud be..
> classpath : C:\Program Files\Java\jdk1.7.0_01\bin;
>
> section-2,(second box)
> system variables
> There shud be
> CLASSPATH : .;C:\Program Files\Java\jre7\lib\ext\QTJava.zip;
> JAVA_HOME : C:\Program Files\Java\jdk1.7.0_01
> path : C:\Program Files\Java\jdk1.7.0_01\bin;
>
> See all these variables shud be thr correctly.....what ever i have given here it is correct, dont leave the fullstop(.) and semicolon(;) at the start of the CLASSPATH and semicolons too...in JAVA_HOME ... semicolon shud not be thr under system variables...
> Hope this will help you..

Re: System.TypeInitializationException when using a .NET library compiled with MATLAB 32-bit in C#

$
0
0
"David Kelly" wrote in message <mkaj4f$cd9$1@newscl01ah.mathworks.com>...
> I have compiled a .NET library using MATLAB 32-bit compiler and attempted to use it in a 32-bit C# application. When instantiating the class, I am getting a System.TypeInitializationException.
>
> Please note the following:
>
> (1) I have set the Configuration Manager in Visual Studio to x86 (32-bit)
> (2) I am referencing MWArray.dll from the 32-bit installation of the MCR
> (3) I have compiled my .NET library using the 32-bit version of MATLAB
> (4) I have correctly installed the 32-bit version of the MATLAB compiler runtime
> (5) I have already run gacutil.exe on the 32-bit version of MWArray.dll to register it in the GAC
> (6) My machine is Windows 7 64-bit
>
> I have called MATLAB support and have not received a solution at this time. I decided it would be a good idea to also post this issue in the MATLAB newsgroup.
>
> If anyone has a solution, please post it. Thanks.


With the help of MATLAB technical support, this problem is now solved. Here's what happened:

My PC had both MATLAB 64-bit and MATLAB 32-bit versions installed. Although I was pointing to the correct 32-bit version of MWArray.dll in Visual Studio, for some reason, the 64-bit version was the one that was getting resolved.

To fix this problem, I added the 32-bit path to my Path system variable in Windows 7. This is found under Control Panel -> System -> Advanced system settings -> Advanced tab -> Environment Variables.

In the Environment Variables window, under "System variables," find the Path variable. Ensure that the 32-bit MATLAB root path is listed BEFORE the 64-bit MATLAB root path. In my case, the 32-bit path was not listed at all.

After adding the 32-bit MATLAB root path to the Windows 7 Path variable, the correct 32-bit version of MWArray.dll was now getting resolved in Visual Studio.

mcc works, but mbuild -setup fails

$
0
0
I have an odd situation trying to get MATLAB to connect to a C++ compiler. I am used to being able to use:

mbuild -setup

to confirm the presence of a compiler / choose between compilers. I have a work computer (win7, 64 bit) where this generates the message "No supported compiler or SDK was found." on 2015a, and gives me the option of "Microsoft Visual C++ 2010" in 2012a, but then complains that it can't find the 64 bit version and that it cannot complete successfully.

However, if I try to compile something:

mcc -mv magic

It successfully compiles magic.exe on both 2012a and 2015a.

Does anyone know:
1. How can I check what compiler mcc is using? (the computer appears to have visual studio 2008 and 2010 installed, both 64 bit, as well as the MS Windows SDK, although mbuild -setup does not find them)

2. Why would mcc be able to find/use a compiler, but mbuild -setup cannot?

Error of compilation while running Simulink model in Accelerator mode

$
0
0
Hi everybody,

I've just upgraded Matlab from 2013a to 2015b and I have problem when compiling my model.

I have a model working perfectly on 2013a. I'm using compiler Lcc-win32 C 2.4.1 and my computer OS is windows 7 64-bits. In fact when entering >>mex -setup in matlab prompt command, this compiler is the only choice I have.

For Matlab 2015b, my default compiler is 'Microsoft Windows SDK 7.1 (C)' and I have Microsoft .NET Framework 4.5 installed. According to http://www.mathworks.com/support/compilers/R2015b/index.html, I'm compliant.

In normal mode, I can run my simulation without problem but in Accelerator mode, I get this error :

    'cmd' is not recognized as an internal or external command,
    operable program or batch file.
    NMAKE : fatal error U1077: 'cmd' : return code '0x1'
    Stop.

How can I fix that? The complete log is pasted below.

Thank you.


_____________________________________________________________________
    ### Building the Accelerator target for model: Digital_Speed_Governor
    ### Generating code into build folder: C:\Test_Matlab2015\slprj\accel\Digital_Speed_Governor
    ### Invoking Target Language Compiler on Digital_Speed_Governor.rtw
    ### Using System Target File: C:\Program Files\MATLAB\R2015b\rtw\c\accel\accel.tlc
    ### Loading TLC function libraries
    ### Initial pass through model to cache user defined code
    ...............................................................................
    ............................................................................
    ### Caching model source code
    ...............................................................................
    ...............................................................................
    ...............................................................................
    ...............................................................................
    ...............................................................................
    ...............................................................................
    ...............................................................................
    ...............................................................................
    ...............................................................................
    ...............................................................................
    ...............................................................................
    ...............................................................................
    ...............................................................................
    ...............................................................................
    ...............................................................................
    ...............................................................................
    ...............................................................................
    ...............................................................................
    ...............................................................................
    ....
    ### Writing header file Digital_Speed_Governor_acc.h
    .
    ### Writing header file Digital_Speed_Governor_acc_types.h
    ### Writing header file Digital_Speed_Governor_acc_private.h
    ### Writing header file rtwtypes.h
    ### Writing header file multiword_types.h
    ### Writing header file rt_look1d.h
    ### Writing source file rt_look1d.c
    .
    ### Writing header file rt_look.h
    ### Writing source file rt_look.c
    ### Writing source file Digital_Speed_Governor_acc.c
    ### Writing source file Digital_Speed_Governor_acc_data.c
    ### Writing header file rt_nonfinite.h
    ### Writing source file rt_nonfinite.c
    .
    ### Writing header file rt_defines.h
    ### Writing header file rtGetInf.h
    ### Writing source file rtGetInf.c
    ### Writing header file rtGetNaN.h
    ### Writing source file rtGetNaN.c
    ### TLC code generation complete.
    ### Creating project marker file: rtw_proj.tmw
    .
    ### Processing Template Makefile: C:\Program Files\MATLAB\R2015b\rtw\c\accel\accel_vcx64.tmf
    ### Creating Digital_Speed_Governor.mk from C:\Program Files\MATLAB\R2015b\rtw\c\accel\accel_vcx64.tmf
    ### Building Digital_Speed_Governor: .\Digital_Speed_Governor.bat
    Warning: Could not evaluate MaskDisplay commands of block 'Digital_Speed_Governor/SC_UserInterface/HMI/BLADE MAX LIMIT SP RAISE//LOWER': File "spring_button.png" does not exist.
    Warning: Could not evaluate MaskDisplay commands of block 'Digital_Speed_Governor/SC_UserInterface/HMI/L65S1': File "spring_button.png" does not exist.
    Warning: Could not evaluate MaskDisplay commands of block 'Digital_Speed_Governor/SC_UserInterface/HMI/L65S': File "spring_button.png" does not exist.
    Warning: Could not evaluate MaskDisplay commands of block 'Digital_Speed_Governor/SC_UserInterface/HMI/POWER LIMIT SP RAISE//LOWER': File "spring_button.png" does not exist.
    Warning: Could not evaluate MaskDisplay commands of block 'Digital_Speed_Governor/SC_UserInterface/HMI/WG MAX LIMIT SP L65PL': File "spring_button.png" does not exist.
    Warning: Could not evaluate MaskDisplay commands of block 'Digital_Speed_Governor/SC_UserInterface/HMI/WG LIMIT SP RAISE//LOWER': File "spring_button.png" does not exist.
    Warning: Could not evaluate MaskDisplay commands of block 'Digital_Speed_Governor/SC_UserInterface/HMI/MANUAL RAISE//LOWER': File "spring_button.png" does not exist.
     
    C:\Test_Matlab2015\slprj\accel\Digital_Speed_Governor>call setup_mssdk71.bat
     
    C:\Test_Matlab2015\slprj\accel\Digital_Speed_Governor>set COMPILER=cl
     
    C:\Test_Matlab2015\slprj\accel\Digital_Speed_Governor>set COMPFLAGS=/c /GR /W3 /EHs /nologo /MD -I"C:\Program Files\MATLAB\R2015b\extern\include" -I"C:\Program Files\MATLAB\R2015b\simulink\include" /D_CRT_SECURE_NO_DEPRECATE /D_SCL_SECURE_NO_DEPRECATE /D_SECURE_SCL=0 /DMATLAB_MEX_FILE /D_CRT_SECURE_NO_DEPRECATE /D_SCL_SECURE_NO_DEPRECATE /D_SECURE_SCL=0 /DMATLAB_MEX_FILE /DMATLAB_MEX_FILE
     
    C:\Test_Matlab2015\slprj\accel\Digital_Speed_Governor>set OPTIMFLAGS=/O2 /Oy- /DNDEBUG
     
    C:\Test_Matlab2015\slprj\accel\Digital_Speed_Governor>set DEBUGFLAGS=/Z7
     
    C:\Test_Matlab2015\slprj\accel\Digital_Speed_Governor>set LINKER=link
     
    C:\Test_Matlab2015\slprj\accel\Digital_Speed_Governor>set LINKFLAGS=/nologo /manifest /export: /DLL /LIBPATH:"C:\Program Files\MATLAB\R2015b\extern\lib\win64\microsoft" libmx.lib libmex.lib libmat.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /EXPORT:mexFunction
     
    C:\Test_Matlab2015\slprj\accel\Digital_Speed_Governor>set LINKDEBUGFLAGS=/debug /PDB:".mexw64.pdb"
     
    C:\Test_Matlab2015\slprj\accel\Digital_Speed_Governor>set NAME_OUTPUT=/out:""
     
    C:\Test_Matlab2015\slprj\accel\Digital_Speed_Governor>set PATH=C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE;C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\Tools;C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\Bin\amd64;C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\Bin\VCPackages;C:\Program Files\Microsoft SDKs\Windows\v7.1\\Bin\x64;C:\Program Files\Microsoft SDKs\Windows\v7.1\\Bin;;;C:\Program Files\MATLAB\R2015b\bin\win64;c:\opal-rt\rt-lab\v11.0.1.390\common\bin;;.;
     
    C:\Test_Matlab2015\slprj\accel\Digital_Speed_Governor>set INCLUDE=C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\INCLUDE;C:\Program Files\Microsoft SDKs\Windows\v7.1\\INCLUDE;C:\Program Files\Microsoft SDKs\Windows\v7.1\\INCLUDE\gl;C:\Program Files\MATLAB\R2015b\extern\include;;
     
    C:\Test_Matlab2015\slprj\accel\Digital_Speed_Governor>set LIB=C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\Lib\amd64;C:\Program Files\Microsoft SDKs\Windows\v7.1\\Lib\X64;C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\ATLMFC\LIB\AMD64;C:\Program Files\MATLAB\R2015b\lib\win64;C:\Program Files\MATLAB\R2015b\extern\lib\win64;
     
    C:\Test_Matlab2015\slprj\accel\Digital_Speed_Governor>set LIBPATH=C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\Lib\amd64;C:\Program Files\Microsoft SDKs\Windows\v7.1\\LIB\X64;C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\ATLMFC\LIB\AMD64;C:\Program Files\MATLAB\R2015b\extern\lib\win64;
     
    C:\Test_Matlab2015\slprj\accel\Digital_Speed_Governor>cd .
     
    C:\Test_Matlab2015\slprj\accel\Digital_Speed_Governor>nmake -f Digital_Speed_Governor.mk ISPROTECTINGMODEL=NOTPROTECTING
     
    Microsoft (R) Program Maintenance Utility Version 10.00.30319.01
    Copyright (C) Microsoft Corporation. All rights reserved.
     
    'cmd' is not recognized as an internal or external command,
    operable program or batch file.
    NMAKE : fatal error U1077: 'cmd' : return code '0x1'
    Stop.
     
    C:\Test_Matlab2015\slprj\accel\Digital_Speed_Governor>echo The make command returned an error of 2
    The make command returned an error of 2
     
    C:\Test_Matlab2015\slprj\accel\Digital_Speed_Governor>An_error_occurred_during_the_call_to_make
    'An_error_occurred_during_the_call_to_make' is not recognized as an internal or external command,
    operable program or batch file.
    ### Build procedure for model: 'Digital_Speed_Governor' aborted due to an error.
    Error: Error(s) encountered while building "Digital_Speed_Governor"
    Error: Problem creating Accelerator MEX file for model 'Digital_Speed_Governor'.
    Caused by:
        Error(s) encountered while building "Digital_Speed_Governor"
_____________________________________________________________________

Re: matlab forum

$
0
0
Denis Gilbert <nospam@thank.you> wrote in message <raivpvkqnhe8usep458ffped7rsjr26b8r@4ax.com>...
> On Tue, 28 Oct 2003 13:25:14 +0000 (UTC), nvalkanova@hotmail.com
> (Nina) wrote:
>
> >Hi,
> >
> >I am extremely interested in a Matlab Forum. Is there already one?
> >
> >Best Greetings
> >Nina
>
> I daresay this (CSSM) is it. You've come to the right place.
>
> Denis.
>

Error using loalibrary to load dll

$
0
0
Hello,

I have the following error when I am trying to load a library for some scientific equipment:

>> loadlibrary('scTDC1.dll','scTDC.h')
Error loading library intermediate output follows.
The actual error is at the end of this output.
*********
Died at C:\Program Files\MATLAB\R2012b\toolbox\matlab\general\private\prototypes.pl line 599, <INFILE> line 910.
*********
Error using loadlibrary (line 419)
Call to Perl failed. Possible error processing header file.
Output of Perl command:
Died at C:\Program Files\MATLAB\R2012b\toolbox\matlab\general\private\prototypes.pl line 599, <INFILE> line 910.

I am using Matlab R2012b and have tried both these compilers:

[1] Lcc-win32 C 2.4.1 in C:\PROGRA~1\MATLAB\R2012b\sys\lcc
[2] Microsoft Visual C++ 2010 in C:\Program Files\Microsoft Visual Studio 10.0\

I have also tried it with Matlab R2014b with Windows SDK 7.1as compiler and get the same error.

I have check with the equipment manufacturer and the dll and header files I am using are correct.

Can anybody help? Also what is the role of Perl?

Many thanks,

Chris

Re: Error using loalibrary to load dll

$
0
0
PERL is used to parse the header file.
It look like it cannot deal with your header file.
Might be it has
- strange character inside it
- cannot access to other include files
- it has some odd command that prevent correct parsing
- some other reason that make your header file incorrect
Viewing all 36 articles
Browse latest View live