I have Matlab 2010a installed on my machine, and MCR 7.6 installed on client's machine.
I try to figure out how can I compile my code for MCR 7.6.
Currently mcc comlipes scripts for 7.9 ( which has been installed with Matlab).
Does mcc has any arguments for it, or parameters in cfg file?
(or anything else)
From the MCR help file:
The MCR is version-specific. You must run your applications with the version of the MCR associated with the version of MATLAB Compiler with which it was created. For example, if you compiled an application using version 4.10 (R2009a) of MATLAB Compiler, users who do not have MATLAB installed must have version 7.10 of the MCR installed. Use mcrversion to return the version number of the MCR.
Could you have your client install MCR 7.9 on their computer?
You have two options:
As Doresoom mentioned, get the client to install MCR 7.9 on their machine. (You can package the MCR with your files. Open deploytool and click Package.)
Use an older version of MATLAB to compile your code.
Related
I have download that code from github.
Whenever that code tries to check mexopencv (a file inside lib folder). It shows an error on Matlab 2017a that is:
[error 3] please make sure gcc >= 4.4 g++ >= 4.4 is installed ...
I am having a gcc version of 8.8.0
Following is the description of system
Window 10
Visual Studio 2012
Matlab 2017a
opencv 2.4.10
mexopencv (install from your folder LIB)
You might lack of standard libraries (.dll in Windows but .lib in Linux). The code was developed under Linux (help is also only provided for Linux systems) and once tested under Windows 7.
The method was tested under OS linux lubuntu 14.04, CPU intel i5 and
16GB of RAM. This guide was written under a linux-based distribution
scope, more precisely debian. Unfortunately we lack experience to
address bugs or any problem that could emerge in non-linux OS, we will
provide only linux OS help regarding execution problems, we apologise.
we tested this code on Windows7. We successfully installed opencv
2.4.10 following this tutorial: [http://www.learnopencv.com/install-opencv3-on-windows/]
This suggests that the mex-function is also linux-based. The error should vanish if you compile the source code yourself on your system, e.g. with MinGW (also GCC), see here.
EDITED:
the README.markdown file (under LIB/mexopencv-master.zip) provides a little guide through the installation process of both, openCV and the mexopencv function for unix (including ubuntu 14.04) and Windows systems. The latter states:
Browse to mexopencv root folder, and type the following in the MATLAB
command window:
>> mexopencv.make
By default, mexopencv assumes the OpenCV library is installed in
C:\opencv. If this is not the case, specify the path as an argument:
>> mexopencv.make('opencv_path', 'c:\your\path\to\opencv')
Note that if you build OpenCV from source, this path specification
might not work out of the box. You need to replace dll files in the
OpenCV package with newly built binaries. Or, you need to modify
+mexopencv/make.m to correctly link your MEX-files with the library.
To remove existing mexopencv binaries, use the following command.
>> mexopencv.make('clean', true)
It requires a standard C++ compiler supported by Matlab (see here), any Visual Studio installation should be OK, as an open-source option MinGW is recommended. Just remember to pick the right system (usually 64-bit).
I am installing the MinGW-w64 C/C++ compiler for use in MATLAB 20176b but there is several errors for that. How can install this compiler with all the necessary adjustments to use in Matlab 2016b?
As the first way directly from Matlab:
Downloaded the MinGW-w64 C/C++ compiler for Windows from here:
https://www.mathworks.com/matlabcentral/fileexchange/52848-matlab-support-for-mingw-w64-c-c++-compiler
After running true Matlab and approval for installation and installing the packages, it gives an error as:
There was a problem installing the third-party software. To resolve
this issue, contact Technical Support
The second approach is to install the MinGW-w64 C/C++ compiler separately and then adjust to use in Matlab. But After installation Matlab doesn't recognize it.
The details provided on Matlab not recognizing the MinGW installation are a bit vague, but I'll take a shot at it.
When installing MinGW, the default installation directory is one with spaces in the path (Program Files). For some reason, this is not supported by Matlab (https://www.mathworks.com/help/matlab/matlab_external/compiling-c-mex-files-with-mingw.html):
Do not install MinGW in a location with spaces in the path name. For example, do not use: C:\Program Files\TDM-GCC-64
In my situation, I installed MinGW directly on the C drive. As such, my installation directory has the following layout:
C:\mingw64
C:\mingw64\bin
C:\mingw64\etc
C:\mingw64\*...
Once that is installed, all you need to do is point Matlab to the installation directory, in my case, I need to run the following command:
setenv('MW_MINGW64_LOC','C:\mingw64')
After that, you should be squared away to run the mex compilation command.
I'm trying to install MCR on a virtual machine, Windows server 2012 (that doesn't have MATLAB).
I manage to send the file over and run the installation program.
It installs with no problem.
But then I still get:
Could not find version 8.1 of the MCR
Anyone has an idea?
I tried to do it as administrator as well, but doesn't matter.
Can I change some path or something manually?
The error message is also:
attempting to load mclmcrrt8_1.dll
On the machine you used to build the standalone, get the correct MCR version with the following command:
>> mcr
The WIN64 MCR Installer, version 8.2, is:
C:\Program Files\MATLAB\R2013b\toolbox\compiler\deploy\win64\MCRInstaller.exe
MCR installers for other platforms are located in:
C:\Program Files\MATLAB\R2013b\toolbox\compiler\deploy\<ARCH>
<ARCH> is the value of COMPUTER('arch') on the target machine.
Full list of available MCR installers:
C:\Program Files\MATLAB\R2013b\toolbox\compiler\deploy\win64\MCRInstaller.exe
For more information, read your local MCR Installer help.
Or see the online documentation at MathWorks' web site. (Page may load slowly.)
Take the file it names and install it on the server. You must match the architecture too.
Here are links to the installers.
I packaged the 7.13 MCR compiler with my files (via desploytool).
I have some questions with assuming the client installed the MCR.
1) If the client doesn't have MATLAB, but just the MCR. he will be able to run my application by the MCR?
2) how can the client make the MCR compiler to be the default?
I tried:
mbuild -setup
Please choose your compiler for building standalone MATLAB applications:
Would you like mbuild to locate installed compilers [y]/n? y
Select a compiler:
[1] Lcc-win32 C 2.4.1 in C:\PROGRA~1\MATLAB\R2010a\sys\lcc
[2] Microsoft Visual C++ 2008 SP1 in C:\Program Files\Microsoft Visual Studio 9.0
[0] None
Compiler:
but I didn't see the MCR. his location is something like: C:\Program Files\MATLAB\MATLAB Compiler Runtime\v713 but I don't know what is the exactly path. should I know it?
3) should I have to make a bat file which configures the MCR to be the default compiler?
The MCR is not a compiler.
MCR is an abbreviation for MATLAB Compiler Runtime. When you use deploytool or mcc (available with MATLAB Compiler or the MATLAB Builder products), it converts your MATLAB program into a standalone component (e.g. an executable or library). You then give your end user the component and the MCR, and the component runs against the MCR instead of MATLAB.
The answer to your question i) is yes, your users only need the MCR, not MATLAB. Your users should not need to interact with mbuild at all, (and if they don't have MATLAB anyway, they can't). mbuild is used by you when preparing to create the component, not by your users when running it.
I think you confuse things. MCR is MATLAB Compiler Runtime. It does not provide any compiler, it allows one to run MATLAB programs compiled and deployed with mcc.
So the answer to your first question: yes, your client needs only to install MCR to run the programs you compile for him using mcc.
The answer to the other questions: there is no compiler..
I have developed code on a m-file script in Matlab that communicates with a Measurement Computing USB-DAQ module, and I'm quite happy with that. The problem is that I don't want to purchase another license for the computer which is running the code. I have looked into Matlab Compiler Runtime tools, and it claims that I can deploy my mcc built executables to be royalty-free. Does that mean I can install the MCRInstaller (copied from the computer in which the Matlab is installed) on the host computer running the final product?
Yes. You install the Matlab Compiler Runtime (MCR) on the host computer that will be running the executable produced by the Matlab compiler.
Yes, you can install MCR and using the Deployment Tool it's easy to create a software package with all the files you need inside.