[vtkusers] building MATLAB MEX files with vtk 6.1?

David E DeMarle dave.demarle at kitware.com
Wed Aug 6 16:27:35 EDT 2014


You will also be interested in this branch, in which Jameson restored VTK's
matlab interface, which was lost in 6.0.
* http://review.source.kitware.com/#/c/16043/



David E DeMarle
Kitware, Inc.
R&D Engineer
21 Corporate Drive
Clifton Park, NY 12065-8662
Phone: 518-881-4909


On Wed, Aug 6, 2014 at 4:14 PM, David Gobbi <david.gobbi at gmail.com> wrote:

> Hi Bernard,
>
> As you have rightly guessed, the libraries vtkCommon, vtkRendering,
> etc. no longer exist in VTK 6.  The minimal set of libraries that you
> need for VTK 6 are probably the following:
>
> vtkCommonCore
> vtkCommonDataModel
> vtkRenderingCore
> vtkRenderingOpenGL
> vtkRenderingFreeTypeOpenGL
> vtkInteractionStyle
>
>  - David
>
>
> On Wed, Aug 6, 2014 at 11:13 AM, Meehan, Bernard <MEEHANBT at nv.doe.gov>
> wrote:
> > I've tried to get a couple of tutorials built using CMake and haven't
> had a
> > whole lot of luck ...
> >
> > http://www.cmake.org/Wiki/CMake/MatlabMex
> >
> http://www.mathworks.com/matlabcentral/fileexchange/19638-visualization-toolkit--vtk--mex-interface
> > http://www.kitware.com/media/html/MATLABAndGNURIntegrationWithVTK.html
> >
> > I figured that I might try to do it by hand so to speak - just to prove
> to
> > myself that I could get it to work. I used this as a test file (does
> nothing
> > on purpose):
> > #include "mex.h"
> >
> > #include <vtkSmartPointer.h>
> > #include <vtkSphereSource.h>
> > #define VTK_CREATE(type, name) \
> >   vtkSmartPointer<type> name = vtkSmartPointer<type>::New()
> >
> > void mexFunction(int nlhs, mxArray *plhs[], int nrhs, const mxArray
> *prhs[])
> > {
> >   mexPrintf("Hi there!\n");
> >   VTK_CREATE(vtkSphereSource, source);
> > }
> >
> > And I tried to compile it with:
> > #!/bin/sh
> > MEX=/Applications/MATLAB_R2013b.app/bin/mex
> > $MEX -I/Users/meehanbt/VTK/include/vtk-6.1/ hello.cxx
> > -L/Users/meehanbt/VTK/lib/ -lvtkCommon -lvtkRendering
> >
> > Obviously, for VTK 6.1 - the libraries are much more finely grained ...
> and
> > I just did a copy/paste from a webpage somewhere. Trying to build the
> simple
> > program gives:
> > ld: library not found for -lvtkCommon
> > clang: error: linker command failed with exit code 1 (use -v to see
> > invocation)
> >
> >     mex: link of ' "hello.mexmaci64"' failed.
> >
> > Does anyone have any advice for how I would go about making a simple data
> > display window or something like that as a MEX file?
> _______________________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Please keep messages on-topic and check the VTK FAQ at:
> http://www.vtk.org/Wiki/VTK_FAQ
>
> Follow this link to subscribe/unsubscribe:
> http://public.kitware.com/mailman/listinfo/vtkusers
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/vtkusers/attachments/20140806/015ee7d0/attachment.html>


More information about the vtkusers mailing list