jaeandersson / swig

SWIG is a software development tool that connects programs written in C and C++ with a variety of high-level programming languages.
http://www.swig.org
Other
23 stars 19 forks source link

new matlabsetup facility fails if no script is provided #37

Closed KrisThielemans closed 9 years ago

KrisThielemans commented 9 years ago

@jgillis added a setup script in c67924d. However, if you don't have a matlabsetup section in your interface file, this results in a run-time error at first use as the script is called but doesn't exist. This means we need to either provide a default empty one, or check if one exists, e.g. by using

mexEvalString("if (exist('stirsetup','function')) stirsetup;end");

(replacing the module name of course).

I'm also wondering what to do when the setup script fails. At present, isLoaded is set to true before the script runs, so it won't be run again. This has the advantage that if the setup failed, it won't be tried again. However, that seems a dangerous thing...

KrisThielemans commented 9 years ago

sorry. this was due to my build system. The stirsetup file was generated but not copied to my matlab path. I'd vastly prefer it to be in the +stir directory as suggested in Issue #24