[vtkusers] Re: vtkMy TCL packages in static build

Goodwin Lawlor goodwin.lawlor at ucd.ie
Thu Sep 23 17:19:15 EDT 2004


Hi Dean,

Try adding your out-of-source /Wrapping/Tcl directory to TCLLIBPATH. My
TCLLIBPATH looks like "{c:/src/vtk/Wrapping/Tcl}
{c:/src/bioeng/Wrapping/tcl/}"

Just to test, run your new vtk.exe and see if you can create an object from
one of your vtk classes. You shouldn't need to call "package require ... "
or "load ..." first. With vtk.exe "package require vtk" is just required to
run the tcl scripts in the packages- like the bindings and interactor
scripts... the libraries are already loaded and initialized.

hth

Goodwin



"Dean Inglis" <dean.inglis at camris.ca> wrote in message
news:FBEIKIAGJCCFIBIPBIGMOEFFCDAA.dean.inglis at camris.ca...
> Goodwin,
>
> getting closer...
>
> I'm using the USE_VTK_OUTPUT_PATHS:BOOL=ON in my project so the libs go
> to VTK_BINARY_DIR.
>
> >Pretty much. For some reason Vtkmygraphicstcl_Init etc. is always
> >capitalized (and there was a typo- the g in graphics was omitted).  You
> only
> >need the ${BSLASH} for the body on the #define.
>
> fixed that and now there is ..
>
>  ////////////////////////////////////////////
>
> STRING(ASCII 92 BSLASH)
> STRING(ASCII 34 QUOTE)
>
> SET( VTK_EXTRA_TCL_WRAPPING_CODE
>      "extern ${QUOTE}C${QUOTE} int Vtklocalgraphicstcl_Init(Tcl_Interp
> *interp);
>      extern ${QUOTE}C${QUOTE} int Vtklocaliotcl_Init(Tcl_Interp *interp);
>      extern ${QUOTE}C${QUOTE} int Vtklocalhybridtcl_Init(Tcl_Interp
> *interp);
>      extern ${QUOTE}C${QUOTE} int Vtklocalrenderingtcl_Init(Tcl_Interp
> *interp);
>      #define VTK_EXTRA_TCL_INIT ${BSLASH}
>      if (Vtklocalgraphicstcl_Init(interp) == TCL_ERROR) ${BSLASH}
>          { ${BSLASH}
>          return TCL_ERROR; ${BSLASH}
>          } ${BSLASH}
>      if (Vtklocaliotcl_Init(interp) == TCL_ERROR) ${BSLASH}
>          { ${BSLASH}
>          return TCL_ERROR; ${BSLASH}
>          } ${BSLASH}
>      if (Vtklocalhybridtcl_Init(interp) == TCL_ERROR) ${BSLASH}
>          { ${BSLASH}
>          return TCL_ERROR; ${BSLASH}
>          } ${BSLASH}
>      if (Vtklocalrenderingtcl_Init(interp) == TCL_ERROR) ${BSLASH}
>          { ${BSLASH}
>          return TCL_ERROR; ${BSLASH}
>          } " )
>
> SET( VTK_EXTRA_TCL_LIBRARIES ${VTK_EXTRA_TCL_LIBRARIES}
>      vtkLocalGraphicsTCL
>      vtkLocalImagingTCL
>      vtkLocalHybridTCL
>      vtkLocalIoTCL
>      vtkLocalRenderingTCL )
>
> LINK_DIRECTORIES( ${VTK__BINARY_DIR} )
>
> ////////////////////////////////////////////
>
>
> confirmed, LocalUserOptions.cmake is placed in the VTK source tree.
>
>
> >When you run cmake for the vtk build, check in
> >VTK/Wrapping/Tcl/vtkTkAppInitConfigure.h to make sure everything looks
OK.
> >This header gets included in vtkTkAppInit.cxx
>
> vtkTkAppInitConfigure.h is as follows:
> ////////////////////////////////////////////
>
> #ifndef __vtkTkAppInitConfigure_h
> #define __vtkTkAppInitConfigure_h
>
> #define VTK_TCL_PACKAGE_DIR_BUILD
> "c:/Builder/Releases/vtkStatic/Wrapping/Tcl"
> #define VTK_TCL_INSTALL_DIR "/usr/local/lib/vtk/tcl"
>
> extern "C" int Vtklocalgraphicstcl_Init(Tcl_Interp *interp);
>      extern "C" int Vtklocaliotcl_Init(Tcl_Interp *interp);
>      extern "C" int Vtklocalhybridtcl_Init(Tcl_Interp *interp);
>      extern "C" int Vtklocalrenderingtcl_Init(Tcl_Interp *interp);
>      #define VTK_EXTRA_TCL_INIT \
>      if (Vtklocalgraphicstcl_Init(interp) == TCL_ERROR) \
>          { \
>          return TCL_ERROR; \
>          } \
>      if (Vtklocaliotcl_Init(interp) == TCL_ERROR) \
>          { \
>          return TCL_ERROR; \
>          } \
>      if (Vtklocalhybridtcl_Init(interp) == TCL_ERROR) \
>          { \
>          return TCL_ERROR; \
>          } \
>      if (Vtklocalrenderingtcl_Init(interp) == TCL_ERROR) \
>          { \
>          return TCL_ERROR; \
>          }
>
> #endif
> ////////////////////////////////////////////
>
> >See above cmake script. You can leave the instantiators out, if you like.
> Why are the optional? Why do you have an instantiator for your project?
>
>
> >One thing to watch out for is that the vtk build may need two passes.
> Things
> >are slightly cyclic.
> >- Build vtk libs first... vtk.exe wont link because there's no local libs
> >- Build local libs, linking in vtk libs
> >- Rebuild vtk (ie link in local libs to create vtk.exe)
>
> Yep, I get the cyclic thing: add LocalUserOptions.cmake after building
> local libs etc.,and the compile seems to work,
>  but I get errors in my startup scripts now saying:
>
> can't find package vtklocalgraphics
>  while executing
> "package.orig require vtklocalgraphics
>  ("eval" body line 1)
> invoked from within
> "eval package.orig $args"
> (procedure "package" line...
>
>
> almost there ...
>
> Dean
>
>
> _______________________________________________
> This is the private VTK discussion list.
> Please keep messages on-topic. Check the FAQ at:
<http://public.kitware.com/cgi-bin/vtkfaq>
> Follow this link to subscribe/unsubscribe:
> http://www.vtk.org/mailman/listinfo/vtkusers
>






More information about the vtkusers mailing list