Python & SCons & Matlab: incorrect command input

I use SCons to install the package, but when I try to compile with mex, the matlab compiler, it runs another command from pdfTeX with the same name. To solve this problem in bash, I just modified .bashrc:

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

but I don’t know how to change it in the SCons environment. Does anyone know how to do this?

Thank.

+5
source share
1 answer

I managed to solve this problem. In SCons, the environment that it sees is from an instance:

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

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

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

Where matlabPath is the matlab path, for example:

/Applications/MATLAB_R2009b.app

What is it!

+2
source

All Articles