[Insight-users] problem running ITK registration program from within Matlab

Koen Vermeer koen at vermeer.tv
Tue Nov 25 09:27:03 EST 2008


I see; my apologies for my misunderstanding!

The libraries are located in /opt/matlab_r2008a/sys/os/glnxa64 on my
system. In that directory, there was a file libstdc++.so.6.0.8 and a
link to that file, named libstd++.so.6. I copied libstdc++.so.6.1.0
from /usr/lib to that directory, and replaced the mentioned link with a
link to this library.

I don't think you can do anything with those files if you only have user
permissions on your system. But you might try to point cmake to the
libraries that Matlab provides (in the $MATLAB$/sys/os/glnxa64
directory).

Best,
Koen


On Tue, 2008-11-25 at 06:05 -0800, pinpress wrote:
> Koen,
> 
> I think somehow you probably misunderstood me -- the ITK registration
> programs are not mex files to run from within Matlab. Instead, they are
> compiled using Cmake and make and they run as an executable on the shell.
> Because cmake and make link the executable dynamically against all the
> necessary shared libraries at run time, it has to know where to look for the
> right libraries, either at command prompt or from Matlab if you want it to
> run from within. 
> 
> Yes, exactly that I used "unix(command_line)" type of call from Matlab,
> where "command_line" is the compiled ITK program. 
> 
> So, can you post where your libstdc++ libraries are located on your system,
> either the one comes with the system, or the Matlab version? I may do some
> more digging (e.g., create symbolic link to point to the right ones) if I
> know where they are.
> 
> Since I did not really use mex file, sorry that I can't answer your question
> regarding image array. 
> 
> thanks. pinpress
> 
> 
> Koen Vermeer-4 wrote:
> > 
> > On Sat, 2008-11-22 at 15:57 -0800, pinpress wrote:
> >> Thanks for your input -- Unfortunately, I still haven't figured out how
> >> to
> >> make Matlab link to the right library. So if you could have a look at
> >> exactly what you did to make it work, that'll be much appreciated. Do you
> >> have to "move" matlab library "out of the way"? For myself, I don't think
> >> I
> >> will have the user access to move them because Matlab installation on our
> >> Linux is read only. 
> > 
> > Matlab includes a copy of some standard libraries, such as libstdc++.
> > Their version may not match your system's version, which is fine when
> > running Matlab, but may give problems when trying to run a program
> > that's compiled for a different version.
> > 
> > In my case, it was easy to remove Matlab's versions of those libraries,
> > and instead use the system libs. My mex files are also build against the
> > system libs, so this solves the problem.
> > 
> > An alternative may be to build the mex files against the libraries
> > shipped with Matlab. If you find some easy way to do that, let us know.
> > 
> >> By the way, I just want to let everybody know that I had a workaround to
> >> automate the process: I used Matlab to generate a text file (e.g.,
> >> "run_all"), which is composed of a bunch of command lines such as the
> >> following:
> > 
> > Why not use the 'unix' command from within Matlab to run the program?
> > 
> > In your mex file, how did you convert the Matlab array to an ITK image?
> > My routine now simply copies the data into an Image, but I'd rather base
> > it on ImageSource, so I can skip copying the data.
> > 
> > Best,
> > Koen
> > 
> > 
> > _______________________________________________
> > Insight-users mailing list
> > Insight-users at itk.org
> > http://www.itk.org/mailman/listinfo/insight-users
> > 
> > 
> 



More information about the Insight-users mailing list