Hi Ray,
Today I was testing the MATLAB install procedure, and there seem to be some problems with the MATLAB test suite run by SCons. Specifically, the testImportCTI test fails because python couldn't find ctml_writer.py. I tracked it down to two problems (based on r2637):
1) The PYTHONPATH is specified as SOURCE_ROOT/interfaces/matlab/../../build/python2 but the ctml_writer.py file is actually in SOURCE_ROOT/interfaces/matlab/../../build/python2/cantera
2) The PYTHONPATH is not set if it exists in the users environment. From interfaces/matlab/testpath.m:
% Set path to Python module
if strcmp(getenv('PYTHONPATH'), '')
setenv('PYTHONPATH', fullfile(cantera_root, 'build', 'python2'))
end
#1 just seems like a simple bug and if I comment out the if/end statements to fix #2, the tests pass. But if I print the value of PYTHONPATH set by the test module, i.e.
% Set path to Python module
%if strcmp(getenv('PYTHONPATH'), '')
setenv('PYTHONPATH', fullfile(cantera_root, 'build', 'python2', 'cantera'))
disp(getenv('PYTHONPATH'))
%end
the PYTHONPATH displayed is SOURCE_ROOT/interfaces/matlab/../../build/python2/cantera
which doesn't even contain the original value of my PYTHONPATH. Further, after the tests have passed with these changes, if I
echo $PYTHONPATH
from the shell, my original PYTHONPATH is printed without the additional MATLAB testing path. So is there a reason to check if the user has defined their PYTHONPATH? Of course, in case there is a reason, the easy fix would be to add an else clause to append the appropriate path to PYTHONPATH.
Thanks!
Bryan