I am trying to convert Matlab code to something that I can put as a server application, Java if possible. I have Matlab 2008a installed, AND matlab compiler runtime (or so at least I think - the directory is there). Running deploytool from the matlab command line works, but when I try to start a new project there's nothing there about Java.
The result of getenv JAVA_HOME is "C:\Program Files\Java\jdk1.6.0_16". I have set this variable myself, AFTER installing matlab (not sure if it's connected).
The Matlab Java Builder is a separate product from the Matlab Compiler. Have you purchased a license for it?
Related
I'm know that its a beginner question but after I'm install the Matlab Compiler Runtime how can i run the matlab compiler from DOS?
I have the directory C:\Program Files\MATLAB\MATLAB Compiler Runtime
Where is the compiler .exe or something like that?
Thanks
Make sure that you actually have the MATLAB compiler as well. The Compiler Runtime and the compiler are two entirely different programs.
From the help, The MATLAB Runtime is a standalone set of shared libraries that enables the execution of compiled MATLAB applications or components on computers that do not have MATLAB installed.
Once you've compiled the exe (on a computer with MATLAB), you will move the exe to a computer without MATLAB, which has the compiler runtime installed.
Let say I wrote a program which has GUI. And I want to share with my friend who don't have MATLAB in his computer. Can I some how convert it to Java or other language? I tried using deploytool but it need the target computer install MCR in order to work.
Yes, you should use MATLAB Compiler (which deploytool is part of) to create a standalone executable from your GUI. The end-user does require the MCR (MATLAB Component Runtime) to run your compiled application, but you can freely distribute it if you have a license of MATLAB Compiler.
Note: last I looked, the application are OS-specific, i.e. if you use Windows to compile your application, you can only deploy in on a Windows platform.
I wrote an application (GUI) in Matlab and I want to distribute it as a console exe file, does the user need to install MCR?
Short answer: Yes
I stole a nice answer from Matlab Central:
When using the MATLAB Compiler to compile MATLAB code into a
standalone executable, you do need to install the MCR because the
generated code calls into these runtime libraries. Also, you can
package the MCR together with the executable and have it installed
automatically when the executable is run. If you are using deploytool,
you simply need to select "Add MCR" and "Embed the MCR in the package"
from the Package pane.
Note that MATLAB Coder is the other product that actually allows you
to generate truly standalone C/C++ code from MATLAB code (without any
need for additional libraries like the MCR). However, it supports only
a limited subset of the MATLAB language.
I'm trying to deploy an application from Matlab to JAVA.
I use Matlab Builder JA and the Image Processing Toolbox.
I create my jar file from Matlab R2012a with the deploytool on MacOSX.
When I run my JAVA program using this jar on my mac, it's OK, but when I try to run it on a Linux or Windows system, I get the error:
Undefined function or variable 'ipplmex'.
Error in ==> ippl at 48
Error in ==> imrotate>useIPP at 205
Deactivating the use of IPPL with iptsetpref('UseIPPL', false) doesn't fix my problem.
I also have done the exact same work on a Linux environment with Matlab R2011a, and it works on Linux but not on a MacOSX machine with the same error.
If anyone has an idea concerning this IPPL thing when changing OS, that would be great.
Thanks !
Java components created with Builder JA are only cross-platform if they don't depend on platform-specific libraries, such as MEX-files you create, or the IPPL libraries supplied with Image Processing Toolbox.
If you want your Java component to make use of IPPL, I think you'll need to create the Java component once on Mac, once on Linux, once on Windows, and use the version created on the appropriate platform.
ipplmex is a (platform-specific) MEX file that is called by ippl, which is a utility function that checks whether IPPL is available. I can't check this at the moment, but I think it makes that availability check whether or not you've specified that you want to actually use IPPL, via the iptsetpref command. Therefore whether or not you specify that IPPL should be used, there's still a platform-specific MEX-file being called.
Again, I can't check this at the moment, but if you're comfortable with your component not using IPPL, you might try to modify the ippl command to just return zero (indicating that IPPL is not available) without attempting to execute ipplmex. (Make sure to take a copy of your existing ippl.m file before you try any modifications).
I have problems running a program compiled with MCC that uses parfor. The non-compiled .m version works (no bug). When I run the compiled version, I get
"distcomp.remoteparfor" is undefined. I believe I exactly have the error described in
the following link.
http://www.mathworks.com/support/solutions/en/data/1-PAHWE/index.html?product=CO&solution=1-PAHWE
However, since MCR is not installed on my machine (got Matlab and MCC),
I am wondering what the pathes $APPNAME_mcr/java/jar/toolbox and
$MCR/MATLAB Component Runtime/v70/java/jar/toolbox correspond to. I found
the distcomp.jar file in C:\Program Files\MATLAB\R2011b\java\jar\toolbox, but I don't know where to put it since see any path corresponding to $MCR/MATLAB Component Runtime/v70/java/jar/toolbox since MCR is not installed.
Thanks a lot!
Fred
No need to install the MCR if you are simply trying to run the application on the same machine that has MATLAB. The question to ask is, HOW are you launching the compiled application? From a DOS command window? From within MATLAB using the SYSTEM command?
If you are launching the application from a DOS / UNIX command line, then the important thing to keep in mind is that the MATLAB binaries need to be on your system path i.e. just make sure:
$MATLABROOT\bin\$ARCH
is on your system path. Where $MATLABROOT is the matlab installation folder, and $ARCH is your system architecture. For example:
c:\work\matlab\bin\win64
on my machine since my installation folder which contains MATLAB is:
c:\work
and i am on a win64 machine.
The problem is solved. The solution is to make the program
a function instead of a script :
http://www.mathworks.com/matlabcentral/answers/22825-parfor-errors-when-file-is-compiled