3

i have a matlab code that run a c++ functions, it works well on my computer or any other desktop I've tried to run it on. (in order to run it on other desktop i copied the matlab/c++ functions and the mex files)

lately I've tried to run the code on a sge cluster but i get an error messege

"Undefined function 'img' for input arguments of type 'double'"

"img" is the c++ function called by matlab.

does anyone encountered the same problem? does anyone knows how to solve it?

10x Elad

Dudas
  • 72
  • 7
  • Are you sure that the mex file is 'visible' from the compute nodes on your cluster ? On several of the clusters I've worked on installation of a library on the submit host (the machine on which you run `qsub` etc) did not make it accessible to processes on the compute nodes. Consult your sys admins. – High Performance Mark Dec 13 '12 at 21:31
  • 10x for your respond, ill check it after i re-mex the functions to fit the sge platform. – Dudas Dec 13 '12 at 22:32

1 Answers1

1

It seems like you have different OS on laptop/desktop and SGE. For different architectures you need to re-mex your c++ code.

Configure mex on your sge

>> mex -setup

I strongly recommend using gcc. Now you can mex your c++ code. Note that the file extension for the mex files is different on windows/sge as well as 32bit and 64bit systems.

If you don't have the right extension for the mex file (can be checked using mexext command) Matlab cannot find the function to run and you get an error sinilar to what you got.

Happy Chanukah.

Shai
  • 111,146
  • 38
  • 238
  • 371
  • Hi, i didn't knew there are different mex files for every system, but it of course make sense. can i mex the files to be mexa64 from a windows64 platform or i most have a linux system for it? 10x and Hag_Samech for you as well – Dudas Dec 13 '12 at 22:28
  • 1
    @Dudas - you need to `mex` your files for each platform. Since `c++` compiler is not a big issue, you shouldn't find it too difficult to do. – Shai Dec 15 '12 at 17:49