Matlab deployment: add files to source control?
Asked Answered
Q

3

10

I've created a deployment project which works rather well and now I want to add it to source control repository for others to use.
The main problem I'm facing is that the .prj file which deploytool creates contains absolute paths which will not work on other computers. So far I've tried the following:

  • Create the stand alone exe using just mcc without deploytool. This works great but I could find a way to create the final _pkg.exe which contains everything. mcc doesn't seem to be able to create this file and there doesn't seem to be any other tool which does. Is this really the case?
  • Edit the .prj file to include relative paths instead of absolute paths. This only works partially because the .prj file contains a section called MATLABPath which is always replaced with the current setpath of matlab. anyone which uses this file will have to check it out since it is being changed when used.
  • Find a way to generate the .prj file. the mcc documentation say: Project files created using either mcc or deploytool are eligible to use this option. suggesting there is a way to create a .prj file using mcc but I wasn't able to find how this can be done.

Is there a solution to this situation?

Queasy answered 24/11, 2009 at 14:27 Comment(2)
You should put in an enhancement request with MathWorks for this.Cardie
Would be also good to know if there is an XSD scheme for .prj XML file format.Daciadacie
S
4

We ran into the same thing with Matlab Builder JA. Not only are the paths absolute, Matlab also adds other toolboxes that it finds on the path, which is irritating, as the build machine doesn't have licenses for a lot of them.

So what we do is:

  • Edit the prj file by hand to get rid of the absolute paths
  • Check it into source control and build with mcc
  • NEVER EVER check in the prj file after it has been touched by deploytool (do all changes by hand in an editor)

Our revision control lets you modify files without an explicit checkout, so using deploytool is not a problem. But why would you want to?

Not sure what the final packager does, but if it just bundles the MCR with the compiled binary, I would just write a replacement.

Slum answered 19/11, 2010 at 10:24 Comment(0)
C
1

I personally use Visual Studio 2005 project to maintain my deployment projects and then convert the VCPROJ to PRJ on the fly using build command step http://younsi.blogspot.com/2011/11/matlab-relative-path-issue-in-prj.html

Consternation answered 3/11, 2011 at 21:0 Comment(0)
H
-2

Here's the mcc option documentation.

What I've found most useful is creating a standalone exe using mcc:

  mcc -C -m <function.m> -a <fig> -a <dll> -a <etc> -d <outputPath>

The -C option tells mcc to generate the ctf file (which is the archive of all the compiled MATLAB stuff) as a separate file. I've had trouble on some target computers using a single exe with everything compiled in.

The -m option tells mcc to make an exe.

The -a options tell mcc to include the specified file in the package. For instance, if your script uses two fig files and a data file, you need a -a for each to make sure they get put in the output package.


To tell mcc to use a project file (I've never done this myself):

 mcc -F <projectfile>

Also, if you're using R2009a on Windows, there's a known bug that requires some manifest manipulation.

Haploid answered 24/11, 2009 at 20:6 Comment(2)
Wow, maybe next time you can bother to actually read the question itself rather than just the tags.Queasy
@Queasy - You're right, I skimmed the question and answered something I expected to see, not what you asked. Sorry about that. I've actually never used deploytool in the way you have, so I didn't at all get what you meant by _pkg.exe. I should have done a little reading before leaping in with an answer.Haploid

© 2022 - 2024 — McMap. All rights reserved.