Skip to content

Commit eb779e6

Browse files
authored
Merge pull request #3509 from DimitriPapadopoulos/spm12_standalone
FIX: Deployed Matlab applications must not call addpath()
2 parents bde4802 + 72fa3bf commit eb779e6

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

nipype/interfaces/matlab.py

+4-1
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,10 @@ def _gen_matlab_command(self, argstr, script_lines):
191191
else:
192192
prescript.insert(0, "fprintf(1,'Executing code at %s:\\n',datestr(now));")
193193
for path in paths:
194-
prescript.append("addpath('%s');\n" % path)
194+
# addpath() is not available after compliation
195+
# https://www.mathworks.com/help/compiler/ismcc.html
196+
# https://www.mathworks.com/help/compiler/isdeployed.html
197+
prescript.append("if ~(ismcc || isdeployed), addpath('%s'); end;\n" % path)
195198

196199
if not mfile:
197200
# clean up the code of comments and replace newlines with commas

0 commit comments

Comments
 (0)