Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Python & SCons & Matlab: Wrong command input

I am using SCons to install a package, but when I try to compile with mex, the matlab compiler, it runs other command from pdfTeX with same name. To solve this problem on bash, I've just changed .bashrc:

alias mex="/Applications/MATLAB_R2009b.app/bin/mex"

but I dont know how to change it on SCons environment. Someone knows how to do it?

Thanks.

like image 344
Werner Avatar asked Nov 04 '22 07:11

Werner


1 Answers

I've managed to fix this problem. On SCons, the environment it sees is from the instance:

env = Environment(..., ENV = os.environ)

What I did was to add to os.environ the path of the matlab mex, by doing:

os.environ['PATH'] = matlabPath + '/bin:' +  os.environ['PATH'];

Where matlabPath is the Matlab Path, e.g.:

/Applications/MATLAB_R2009b.app

That's it!

like image 147
Werner Avatar answered Nov 09 '22 16:11

Werner