tags:

views:

531

answers:

3

I'm trying to run a program originally tested on Matlab 6.5 on a new release (R2009a) The program uses some mex files, and I get the following error when trying to run it:

??? Invalid MEX-file '/normalizedCut/common_files/sparsifyc.mexglx': normalizedCut/common_files/sparsifyc.mexglx: symbol mxGetIr, version libmx.INTERNAL not defined in file libmx.so with link time reference.

(the code I'm trying to tun is Normalized cut by Shi & Malic, and can be found here: http://www.cis.upenn.edu/~jshi/software/files/NcutClustering_7.zip)

If I try to run the code on the same system but Matlab 2007a it runs ok.

Is there some problem with backwards compatibility for 2009a? Are there any flags somewhere in the system I can change to help it work?

When I googled it I saw some references to the LD_LIBRARY_PATH env variable, but what exactly should be added to it I could not find out.

Thanks, Yair

A: 

It's pretty common for there to be problems running mex functions with different versions of Matlab. The errors you're getting look like they're due to API changes in Matlab (though that surprises me a little). I've had the most trouble because of binary incompatibilities induced by changes in gcc. I'd suggest contacting Jiambo and asking him if he can build a new version or release the source.

Worst case, you could try re-implementing those mex functions. The normalized cut algorithm is pretty straightforward in Matlab (see the Shi and Malik paper). By the names of the mex functions, they look like they're mostly duplicating existing matlab functionality (matrix multiplication, matrix sparsification). There's a non-zero chance that if you re-implemented them as regular m-code functions they'd be faster anyway due to the multicore support that's been added to Matlab.

Mr Fooz
A: 

Dear Yair

Have you found a solution to your problem, did you got hand on the code of the needed libraries, or have you reeimplemented them.

I also have problem running this piece of code, however I think is a 32bit-64bit incompatibility, which could also been solved by recompiling the libraries.

Thanks Emanuel

Emanuel
This is not an answer to the question. Please delete.
gnovice
+1  A: 

The source code for those mex functions appears to be available in the "Image segmentation with normalized cuts" source on this page: http://www.cis.upenn.edu/~jshi/software/ (in the specific_NcutImage_files subdirectory in the unpacked .zip)

thouis

related questions