Metafor

ULiege - Aerospace & Mechanical Engineering

User Tools

Site Tools


doc:devel:vtk

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
Last revisionBoth sides next revision
doc:devel:vtk [2012/11/29 13:29] – [Debug] marlenedoc:devel:vtk [2016/03/30 15:23] – external edit 127.0.0.1
Line 1: Line 1:
 ====== Compiler VTK pour Metafor ====== ====== Compiler VTK pour Metafor ======
  
-memo comment je (luccompile vtk pour les Libs+memo comment compiler vtk (5.10.1) pour les Libs 
  
-===== Windows (compatible python_d pour vtk 5.10) - v. Marlène ===== 
  
-vtk basé sur vtk-5.10.1 (les libs de luc sont dans "F:/LibsVS2008")+===== Windows Release & Debug / Wrapper vtk-python (r&d) Luc (version 140109=====
  
-deux projets différentsun en release et un en debug+   * Détarer les sources VTK\vtk-5.10.1 
 +   * Créer le répertoire de compilation : VTK\VTKBuild 
 +   * Modifier les sources VTK :  
 +     * VTK Debug : ajout du postfix "_d" aux DLL's : modifier "VTK\vtk-5.10.1\CMakeLists.txt ligne 107" 
  
-==== Release ==== +<code> 
 +  # Append the library version information to the library target 
 +  # properties.  A parent project may set its own properties and/or may 
 +  # block this. 
 +  IF(NOT VTK_NO_LIBRARY_VERSION) 
 +    SET(VTK_LIBRARY_PROPERTIES ${VTK_LIBRARY_PROPERTIES} 
 +      VERSION "${VTK_VERSION}" 
 +      SOVERSION "${VTK_MAJOR_VERSION}.${VTK_MINOR_VERSION}" 
 +      )     
 +     ENDIF(NOT VTK_NO_LIBRARY_VERSION)
  
 +  SET(VTK_LIBRARY_PROPERTIES ${VTK_LIBRARY_PROPERTIES} DEBUG_POSTFIX _d )
 +</code>
 + 
 +      * Wrappers Python debug : postfix "_d" aux "pyd" : "VTK\vtk-5.10.1\Cmake\KitCommonPythonWrapBlock.cmake"
 +<code>
 +  # Python extension modules on Windows must have the extension ".pyd"
 +  # instead of ".dll" as of Python 2.5.  Older python versions do support
 +  # this suffix.
 +  IF(WIN32 AND NOT CYGWIN)
 +    SET_TARGET_PROPERTIES(vtk${KIT}Python PROPERTIES SUFFIX ".pyd")
 +    SET_TARGET_PROPERTIES(vtk${KIT}Python PROPERTIES DEBUG_POSTFIX "_d")
 +  ENDIF(WIN32 AND NOT CYGWIN)
 +</code>
  
-   Détarer les sources : F:\vtk-5.10.1\VTKSource +  installation des wrappers python_d modifier VTK\vtk-5.10.1\Wrapping\Python\setup.py.in             
-   * Créer le répertoire de compilation : F:\vtk-5.10.1\VTKBuild + 
-   * Créer le répertoire d'installation: F:\vtk-5.10.1\VTKInstall +lignes 85-100 :
-   * Modifier les sources VTK link_directories +
 <code> <code>
- modifier "F:\vtk-5.10.1\VTKSource\UseVTK.cmake.in"  +  def get_libs(): 
-Ajouter : +      """Returns a list of libraries to be installed.  """ 
-  # Add link directories needed to use VTK. +      libs = [] 
-  LINK_DIRECTORIES(${VTK_LIBRARY_DIRS}+ 
-après +      # Select platform-specific components of the module file names. 
-  INCLUDE_DIRECTORIES(${VTK_INCLUDE_DIRS})+      if os.name == 'posix'
 +          dir = vtk_lib_dir 
 +          prefix = 'vtk' 
 +          suffix = get_config_var('SO'
 +      else: 
 +          dir = vtk_bin_dir.replace('/', '\\') 
 +          prefix = 'vtk' 
 +          if vtk_build_type == 'Debug': 
 +              suffix = '_d.pyd' 
 +          else: 
 +              suffix = '.pyd'
 </code> </code>
  
-   * Executer CMake : modifier les options suivante (cfr config de luc ci-dessous) +  * patcher vtktclutil.cxx pour utilisation tcltk8.6: 
 +http://sources.gentoo.org/cgi-bin/viewvc.cgi/gentoo-x86/sci-libs/vtk/files/vtk-5.10.1-tcl8.6.patch 
 +    "/VTK/vtk-5.10.1/Common/vtkTclUtil.cxx" 
 +<code> 
 +ligne 21 - 24 : 
 +  #include <string> 
 +  #include <vtksys/SystemTools.hxx> 
 + 
 +  extern "C" 
 + 
 +devient 21-30 :  
 +  #include <string> 
 +  #include <vtksys/SystemTools.hxx> 
 + 
 +  #if (TCL_MAJOR_VERSION == 8) && (TCL_MINOR_VERSION < 6) 
 +  #define vtkTclGetErrorLine(m) (m->errorLine) 
 +  #else 
 +  #define vtkTclGetErrorLine(m) (Tcl_GetErrorLine(m)) 
 +  #endif 
 + 
 +  extern "C" 
 + 
 +ligne 488-500 : 
 +    if (Tcl_GetVar(arg2->interp,(char *)("errorInfo"),0)) 
 +      { 
 +      vtkGenericWarningMacro("Error returned from vtk/tcl callback:\n" << 
 +                             arg2->command << endl << 
 +                             Tcl_GetVar(arg2->interp,(char *)("errorInfo"),0) << 
 +                             " at line number " << arg2->interp->errorLine); 
 +      } 
 +    else 
 +      { 
 +      vtkGenericWarningMacro("Error returned from vtk/tcl callback:\n" << 
 +                             arg2->command << endl << 
 +                             " at line number " << arg2->interp->errorLine); 
 +      } 
 +       
 +devient 494-506: 
 + 
 +    if (Tcl_GetVar(arg2->interp,(char *)("errorInfo"),0)) 
 +      { 
 +      vtkGenericWarningMacro("Error returned from vtk/tcl callback:\n" << 
 +                             arg2->command << endl << 
 +                             Tcl_GetVar(arg2->interp,(char *)("errorInfo"),0) << 
 +                             " at line number " << vtkTclGetErrorLine(arg2->interp)); 
 +      } 
 +    else 
 +      { 
 +      vtkGenericWarningMacro("Error returned from vtk/tcl callback:\n" << 
 +                             arg2->command << endl << 
 +                             " at line number " << vtkTclGetErrorLine(arg2->interp)); 
 +      } 
 +  
 +ligne 721-732 :  
 +    if (Tcl_GetVar(this->Interp,(char *)("errorInfo"),0)) 
 +      { 
 +      vtkGenericWarningMacro("Error returned from vtk/tcl callback:\n" << 
 +                             this->StringCommand << endl << 
 +                             Tcl_GetVar(this->Interp,(char *)("errorInfo"),0) << 
 +                             " at line number " << this->Interp->errorLine); 
 +      } 
 +    else 
 +      { 
 +      vtkGenericWarningMacro("Error returned from vtk/tcl callback:\n" << 
 +                             this->StringCommand << endl << 
 +                             " at line number " << this->Interp->errorLine); 
 +      } 
 +    } 
 +      vtkGenericWarningMacro("Error returned from vtk/tcl callback:\n" << 
 +                             this->StringCommand << endl << 
 +                             Tcl_GetVar(this->Interp,(char *)("errorInfo"),0) << 
 +                             " at line number " << this->Interp->errorLine); 
 +devient 727-739: 
 +    if (Tcl_GetVar(this->Interp,(char *)("errorInfo"),0)) 
 +      { 
 +      vtkGenericWarningMacro("Error returned from vtk/tcl callback:\n" << 
 +                             this->StringCommand << endl << 
 +                             Tcl_GetVar(this->Interp,(char *)("errorInfo"),0) << 
 +                             " at line number " << vtkTclGetErrorLine(this->Interp)); 
 +      } 
 +    else 
 +      { 
 +      vtkGenericWarningMacro("Error returned from vtk/tcl callback:\n" << 
 +                             this->StringCommand << endl << 
 +                             " at line number " <<  vtkTclGetErrorLine(this->Interp)); 
 +      } 
 +    }             
 +</code>     
 + 
 +  * Executer CMake : modifier les options suivante  
      * BUILD_SHARED_LIBS : ON      * BUILD_SHARED_LIBS : ON
-     * CMAKE_INSTALL_PREFIX : ''F:\vtk-5.10.1\VTKInstall'' +     * CMAKE_INSTALL_PREFIX : ''../VTKInstall'' (attention "../" pas "..\"
-     * VTK_DEBUG_LEAKS : OFF (pour une version à distribuer, peut-être ON sinon+     * CMAKE_CXX_MP_FLAG : ON (permet de compiler en parallele en local) 
-     * VTK_USE_GL2PS : ON+     * VTK_DEBUG_LEAKS : OFF (pour une version à distribuer, peut-être ON pour developpement
 +     * VTK_USE_GL2PS : ON (advanced option)
      * VTK_USE_QT : ON      * VTK_USE_QT : ON
      * VTK_WRAP_PYTHON : ON      * VTK_WRAP_PYTHON : ON
      * VTK_WRAP_TCL : ON      * VTK_WRAP_TCL : ON
-     * Les autres options doivent "suivre"+     * Les autres options doivent "suivre" : (qt (definir qmake suffit généralement), python (Include, lib, libdebug),  tcl/tk (include, lib, exe)) 
 + 
 + 
 +   * Compiler ALL_BUILD (Debug) (Commencer par debug) 
 +   * Installer 
    * Compiler ALL_BUILD (Release)    * Compiler ALL_BUILD (Release)
-   * Installer : via compilation du projet INSTALL (Release)+   * Installer  
 + 
 +<note warning> Attention certains fichiers debug seront écrasés par leur version release, mais normalement c'est les même ... raison pour laquelle on démarre par la version debug </note> 
 + 
    * Modifier les chemins relatifs des librairies en variables d'environnement : VTK conserve les chemins absolus vers les librairies utilisées lors de la compilation (qt, ...) ce qui est incompatible avec les Libs déplaçables.    * Modifier les chemins relatifs des librairies en variables d'environnement : VTK conserve les chemins absolus vers les librairies utilisées lors de la compilation (qt, ...) ce qui est incompatible avec les Libs déplaçables.
-     * remplacer ''F:/LibsVS2008'' par ''$ENV{METAFORLIBS_VS2008}'' dans les fichiers :  +     * remplacer le lieu d'installation ''E:\Dev64\...'' par ''$ENV{METAFORLIBS}'' dans les fichiers :  
-       * ''F:\vtk-5.10.1\VTKInstall\lib\vtk-5.6\VTKConfig.cmake'' +       * ''VTK\VTKInstall\lib\vtk-5.10.1\VTKConfig.cmake'' 
-       * ''F:\vtk-5.10.1\VTKInstall\lib\vtk-5.6\VTKConfigQt.cmake'' +       * ''VTK\VTKInstall\lib\vtk-5.10.1\VTKConfigQt.cmake'' 
-       * ''F:\vtk-5.10.1\VTKInstall\lib\vtk-5.6\VTKTargets-release.cmake'' +       * ''VTK\VTKInstall\lib\vtk-5.10.1\VTKTargets-release.cmake'' 
-   * Copier le répertoire ''F:\vtk-5.10.1\VTKInstall'' dans le répertoire de Libs : ''F:\LibsVS2008\vtk'' +       * ''VTK\VTKInstall\lib\vtk-5.10.1\VTKTargets-debug.cmake'' 
-   * Installer les wrappers python (crée le répertoire F:\LibsVS2008\Python\Lib\site_packages\VTK-5.10.1-py2.6.egg): +     * idem pour les chemins vers tcl/tk,  
-          dans ''F:\vtk-5.10.1\VTKBuild\Wrapping\Python'' ouvrir une invite de commande et taper : ''python setup.py install BUILD_TYPE=Release'' +       * ''$ENV{METAFORLIBS}/TclTk-8.5.15/...'' 
-           +     * includes de  vtk_freetype,  vtk_libproj4, vtk_dhf5 dans les même fichiers 
-Vérification: faire un import vtk dans python+       * ''SET(VTK_FREETYPE_INCLUDE_DIR "$ENV{METAFORLIBS}/Vtk-5.10.1_tcltk85/include/vtk-5.10/vtkfreetype/include")'' 
 +       * ''SET(VTK_LIBPROJ4_INCLUDE_DIR "$ENV{METAFORLIBS}/Vtk-5.10.1_tcltk85/include/vtk-5.10/vtklibproj4")'' 
 +       * ''SET(VTK_HDF5_INCLUDE_DIR     "$ENV{METAFORLIBS}/Vtk-5.10.1_tcltk85/include/vtk-5.10/vtkhdf5")'' 
 +     * enlever les chemins absolu vers "vtkMathConfigure.h" et "vtkConfigure.h" dans  
 +        ''VTK\VTKInstall\lib\vtk-5.10.1\vtkCommonKit.cmake)'' 
 +   * Copier le répertoire ''VTK\VTKInstall'' dans le répertoire de Libs : ''LibsVS2012\vtk-5.10.1'' 
 +   * Installer les wrappers python (crée le répertoire LibsVS2012\Python\Lib\site_packages\VTK-5.10.1-py2.6.egg):  
 +       * ouvrir une invite de commande et aller dans ''VTK\VTKBuild\Wrapping\Python''  
 +       ''python setup.py install BUILD_TYPE=Release'' 
 +       * ''python setup.py install BUILD_TYPE=Debug''           
 +       * Vérification: faire un import vtk dans python.exe & dans python_d.exe
  
-==== Debug ====  
  
-   * Détarer les sources (ou copier celle de ''F:\vtk-5.10.1\VTKSource'') : F:\vtk-5.10.1\VTKSourceDebug + 
-   * Créer le répertoire de compilation : F:\vtk-5.10.1\VTKBuildDebug +===== Windows : Release & Debug / Wrapper vtk-python (r&d) / Marlène & Luc ===== 
-   Créer le répertoire d'installation: F:\vtk-5.10.1\VTKInstallDebug + 
-   * Modifier les sources VTK :  +   * Détarer les sources : VTK\vtk-5.10.1 
-      * link_directories:+   * Créer le répertoire de compilation : VTK\VTKBuild 
 +   Modifier les sources VTK link_directories modifier "VTK\vtk-5.10.1\UseVTK.cmake.in"  
 <code> <code>
- modifier (si on a détarré!, si on a copié F:\vtk-5.10.1\VTKSource alors c'est déjà fait) "F:\vtk-5.10.1\VTKSourceDebug\UseVTK.cmake.in"  +ligne 28-29  : 
-Ajouter +  # Add include directories needed to use VTK.
-  # Add link directories needed to use VTK. +
-  LINK_DIRECTORIES(${VTK_LIBRARY_DIRS}) +
-après+
   INCLUDE_DIRECTORIES(${VTK_INCLUDE_DIRS})   INCLUDE_DIRECTORIES(${VTK_INCLUDE_DIRS})
 +devient 28-31: 
 +  # Add include directories needed to use VTK.
 +  INCLUDE_DIRECTORIES(${VTK_INCLUDE_DIRS})
 +  # Add link directories needed to use VTK.
 +  LINK_DIRECTORIES(${VTK_LIBRARY_DIRS})  
 </code> </code>
-      * DLL's VTK Debug : ajout du postfix "_d"  
-<code> 
- modifier "F:\vtk-5.10.1\VTKSourceDebug\CMakeLists.txt" (ligne 103) : 
-Ajouter la propriété : 
-    SET(VTK_LIBRARY_PROPERTIES ${VTK_LIBRARY_PROPERTIES} DEBUG_POSTFIX _d ) 
-dans le tests :  
-    IF(NOT VTK_NO_LIBRARY_VERSION)     
  
-soit :  +  VTK Debug ajout du postfix "_d" aux DLL's : modifier "VTK\vtk-5.10.1\CMakeLists.txt
-IF(NOT VTK_NO_LIBRARY_VERSION) +
-  SET(VTK_LIBRARY_PROPERTIES ${VTK_LIBRARY_PROPERTIES} +
-    VERSION "${VTK_VERSION}" +
-    SOVERSION "${VTK_MAJOR_VERSION}.${VTK_MINOR_VERSION}" +
-    ) +
-  SET(VTK_LIBRARY_PROPERTIES ${VTK_LIBRARY_PROPERTIES} +
-    DEBUG_POSTFIX _d +
-    ) +
-ENDIF(NOT VTK_NO_LIBRARY_VERSION) +
-</code> +
-      Wrappers Python debug : postfix "_d" aux "pyd"+
 <code> <code>
-modifier "F:\vtk-5.10.1\VTKSourceDebug\Cmake\KitCommonPythonWrapBlock.cmake" (ligne 63): +ligne 95-103 :
-  IF(WIN32 AND NOT CYGWIN) +
-    SET_TARGET_PROPERTIES(vtk${KIT}Python PROPERTIES SUFFIX ".pyd"+
-    SET_TARGET_PROPERTIES(vtk${KIT}Python PROPERTIES DEBUG_POSTFIX "_d"+
-  ENDIF(WIN32 AND NOT CYGWIN) +
-</code> +
-   * Executer CMake : modifier les options suivante (cfr config de luc ci-dessous)  +
-     * PYTHON_EXECUTABLE : aller chercher le path de python_d.exe +
-     * CMAKE_CONFIGURATION_TYPE : Debug +
-     * BUILD_SHARED_LIBS : ON +
-     * CMAKE_INSTALL_PREFIX : ''F:\vtk-5.10.1\VTKInstallDebug'' +
-     * VTK_DEBUG_LEAKS : OFF (pour une version à distribuer, peut-être ON sinon) +
-     * VTK_USE_GL2PS : ON +
-     * VTK_USE_QT : ON +
-     * VTK_WRAP_PYTHON : ON +
-     * VTK_WRAP_TCL : ON +
-     * Les autres options doivent "suivre" +
-   * Compiler ALL_BUILD (Debug) +
-   * Installer : via compilation du projet INSTALL (Debug) +
-   * Modifier les chemins relatifs des librairies en variables d'environnement :  remplacer ''F:/LibsVS2008'' par ''$ENV{METAFORLIBS_VS2008}'' dans ''F:\vtk-5.10.1\VTKInstallDebug\lib\vtk-5.10\VTKTargets-debug.cmake'' +
-   * Copier les fichiers ''F:\vtk-5.10.1\VTKInstallDebug\bin\*_d.dll'' dans le répertoire de Libs ''F:\LibsVS2008\vtk\bin'' +
-   * Copier les fichiers ''F:\vtk-5.10.1\VTKInstallDebug\lib\vtk-5.10\*_d.lib'' dans le répertoire de Libs ''F:\LibsVS2008\vtk\lib\vtk-5.10'' +
-   * Copier le fichier ''F:\vtk-5.10.1\VTKInstallDebug\lib\vtk-5.10\VTKTargets-debug.cmake'' dans le répertoire de Libs ''F:\LibsVS2008\vtk\lib\vtk-5.10'' +
-   * Installer les wrappers python : copier ''F:\vtk-5.10.1\VTKBuildDebug\bin\Debug\*_d.pyd'' dans ''F:\LibsVS2008\Python\Lib\site_packages\VTK-5.10.1-py2.6.egg\vtk''+
  
-Vérification: faire un import vtk dans python_d+  # Append the library version information to the library target 
 +  # properties.  A parent project may set its own properties and/or may 
 +  # block this. 
 +  IF(NOT VTK_NO_LIBRARY_VERSION) 
 +    SET(VTK_LIBRARY_PROPERTIES ${VTK_LIBRARY_PROPERTIES} 
 +      VERSION "${VTK_VERSION}" 
 +      SOVERSION "${VTK_MAJOR_VERSION}.${VTK_MINOR_VERSION}" 
 +      ) 
 +  ENDIF(NOT VTK_NO_LIBRARY_VERSION)
  
-==== Compiler Metafor ====  +devient ligne 95-104:
-Pour compiler Metafor avec ces libs, changer le numero de version vtk dans le chemin de ZLIB dans la config cmake  +
-===== Windows (v. Luc) =====+
  
-  * vtk : basé sur vtk-5.6.0 +  # Append the library version information to the library target 
-      * Détarer les sources : E:\Dev64\Divers\vtk-5.6.0\VTK +  # properties A parent project may set its own properties and/or may 
-      * Créer le répertoire de compilation : E:\Dev64\Divers\vtk-5.6.0\VTK +  # block this. 
-      * Modifier les sources VTK :  +  IF(NOT VTK_NO_LIBRARY_VERSION) 
-        * DLL's VTK Debug : ajout du postfix "_d"  +    SET(VTK_LIBRARY_PROPERTIES ${VTK_LIBRARY_PROPERTIES} 
-<code> +      VERSION "${VTK_VERSION}
- modifier "E:\Dev64\Divers\vtk-5.6.0\VTK\CMakeLists.txt(ligne 80+      SOVERSION "${VTK_MAJOR_VERSION}.${VTK_MINOR_VERSION}" 
-Ajouter la propriété :+         
     SET(VTK_LIBRARY_PROPERTIES ${VTK_LIBRARY_PROPERTIES} DEBUG_POSTFIX _d )     SET(VTK_LIBRARY_PROPERTIES ${VTK_LIBRARY_PROPERTIES} DEBUG_POSTFIX _d )
-dans le tests :  +  ENDIF(NOT VTK_NO_LIBRARY_VERSION)
-    IF(NOT VTK_NO_LIBRARY_VERSION)     +
- +
-soit :  +
-IF(NOT VTK_NO_LIBRARY_VERSION) +
-  SET(VTK_LIBRARY_PROPERTIES ${VTK_LIBRARY_PROPERTIES} +
-    VERSION "${VTK_VERSION}" +
-    SOVERSION "${VTK_MAJOR_VERSION}.${VTK_MINOR_VERSION}" +
-    ) +
-  SET(VTK_LIBRARY_PROPERTIES ${VTK_LIBRARY_PROPERTIES} +
-    DEBUG_POSTFIX _d +
-    ) +
-ENDIF(NOT VTK_NO_LIBRARY_VERSION)+
 </code> </code>
  
-        * Wrappers Python debug : postfix "_d" aux "pyd"+      * Wrappers Python debug : postfix "_d" aux "pyd" : "VTK\vtk-5.10.1\Cmake\KitCommonPythonWrapBlock.cmake"
 <code> <code>
-modifier "VTK/Cmake/KitCommonPythonWrapBlock.cmake" (ligne 43):+ligne 58-63 
 + 
 +  # Python extension modules on Windows must have the extension ".pyd" 
 +  # instead of ".dll" as of Python 2.5.  Older python versions do support 
 +  # this suffix. 
 +  IF(WIN32 AND NOT CYGWIN) 
 +    SET_TARGET_PROPERTIES(vtk${KIT}Python PROPERTIES SUFFIX ".pyd"
 +  ENDIF(WIN32 AND NOT CYGWIN) 
 + 
 +devient 58-64: 
 + 
 +  # Python extension modules on Windows must have the extension ".pyd" 
 +  # instead of ".dll" as of Python 2.5.  Older python versions do support 
 +  # this suffix.
   IF(WIN32 AND NOT CYGWIN)   IF(WIN32 AND NOT CYGWIN)
     SET_TARGET_PROPERTIES(vtk${KIT}Python PROPERTIES SUFFIX ".pyd")     SET_TARGET_PROPERTIES(vtk${KIT}Python PROPERTIES SUFFIX ".pyd")
Line 146: Line 255:
   ENDIF(WIN32 AND NOT CYGWIN)   ENDIF(WIN32 AND NOT CYGWIN)
 </code> </code>
-        Utilisation de la lib python_d.dll en debug + 
 +  installation des wrappers python_d : modifier VTK\vtk-5.10.1\Wrapping\Python\setup.py.in
 <code> <code>
-modifier "VTK/Common/vtkPython.h" ligne 35-48 +ligne 85-97 : 
-remplacer + 
- #if defined(VTK_WINDOWS_PYTHON_DEBUGGABLE+  def get_libs()
- # include <Python.h> +      """Returns a list of libraries to be installed.  """ 
- #else +      libs = [] 
- # ifdef _DEBUG +   
- #  undef _DEBUG +      Select platform-specific components of the module file names. 
-  if defined(_MSC_VER&& _MSC_VER >1400 +      if os.name == 'posix': 
- #    define _CRT_NOFORCE_MANIFEST 1 +          dir = vtk_lib_dir 
- endif +          prefix = 'vtk' 
- #  include <Python.h> +          suffix = get_config_var('SO'
- #  define _DEBUG +      else: 
- else +          dir = vtk_bin_dir.replace('/', '\\') 
- #  include <Python.h> +          prefix = 'vtk' 
- # endif +          suffix = '.pyd' 
- #endif +                      
-par +devient 85-100 : 
- #include <Python.h>+ 
 +  def get_libs()
 +      """Returns a list of libraries to be installed.  """ 
 +      libs [] 
 + 
 +      Select platform-specific components of the module file names. 
 +      if os.name == 'posix': 
 +          dir = vtk_lib_dir 
 +          prefix = 'vtk' 
 +          suffix = get_config_var('SO'
 +      else: 
 +          dir = vtk_bin_dir.replace('/', '\\') 
 +          prefix = 'vtk' 
 +          if vtk_build_type == 'Debug': 
 +              suffix = '_d.pyd' 
 +          else: 
 +              suffix = '.pyd' 
 </code> </code>
 +  * patcher vtktclutil.cxx pour utilisation tcltk8.6:
 +http://sources.gentoo.org/cgi-bin/viewvc.cgi/gentoo-x86/sci-libs/vtk/files/vtk-5.10.1-tcl8.6.patch
 +    "/VTK/vtk-5.10.1/Common/vtkTclUtil.cxx"
 +<code>
 +ligne 21 - 24 :
 +  #include <string>
 +  #include <vtksys/SystemTools.hxx>
  
-      * Executer CMake : modifier les options suivante :  +  extern "C"
-        * BUILD_SHARED_LIBS : ON +
-        * CMAKE_INSTALL_PREFIX : E:\Dev64\Divers\vtk-5.6.0\vtkInstall +
-        * VTK_DEBUG_LEAKS : ON +
-        * VTK_USE_GL2PS : ON +
-        * VTK_USE_QT : ON +
-        * VTK_WRAP_PYTHON : ON +
-        * VTK_WRAP_TCL : ON +
-        * Les autres options doivent "suivre" +
-      * Compiler (release et debug) +
-      * Installer : via compilation du projet Install (release et debug) +
-      * Modifier les chemins relatifs des librairies en variables d'environnement : VTK conserve les chemins absolus vers les librairies utilisées lors de la compilation (qt, ...) ce qui est incompatible avec les Libs déplaçables. +
-        * remplacer "E:/Dev64/LibsVS2008" par "$ENV{METAFORLIBS_VS2008}" dans les fichiers :  +
-          * E:\Dev64\Divers\vtk-5.6.0\vtkInstall\lib\vtk-5.6\VTKConfig.cmake +
-          * E:\Dev64\Divers\vtk-5.6.0\vtkInstall\lib\vtk-5.6\VTKConfigQt.cmake +
-          * E:\Dev64\Divers\vtk-5.6.0\vtkInstall\lib\vtk-5.6\VTKLibraryDepends.cmake +
-      * Copier le répertoire "E:\Dev64\Divers\vtk-5.6.0\vtkInstall" dans le répertoire de Libs : "E:\Dev64\LibsVS2008\vtk" +
-      * Installer les wrappers python : copier "E:\Dev64\LibsVS2008\vtk\lib\site-packages" dans "E:\Dev64\LibsVS2008\Python\Lib\site-packages"+
  
-===== Linux Old version to be updated ... =====+devient 21-30 :  
 +  #include <string> 
 +  #include <vtksys/SystemTools.hxx>
  
-  * vtk /opt/vtk-5.4.2  +  #if (TCL_MAJOR_VERSION == 8) && (TCL_MINOR_VERSION < 6) 
-      Détarer les sources (~/setup/vtk-5.4.2/VTK+  #define vtkTclGetErrorLine(m) (m->errorLine) 
-      * Créer un répertoire de compilation (~/setup/vtk-5.4.2/VTKBIN+  #else 
-      * Aller dans le répertoire de compilation (~/setup/vtk-5.4.2/VTKBIN+  #define vtkTclGetErrorLine(m) (Tcl_GetErrorLine(m)) 
-      * Lancer cmake interfacé ccmake ../VTK +  #endif 
-      * gérer les options : (celles à modifier. en "advanced mode [t])        + 
-          * BUILD_SHARED_LIBS : ON +  extern "C" 
-          * CMAKE_INSTALL_PREFIX : /opt/vtk-5.4.2 + 
-          VTK_WRAP_PYTHON : ON +ligne 488-500 : 
-          VTK_WRAP_TCL : ON +    if (Tcl_GetVar(arg2->interp,(char *)("errorInfo"),0)) 
-          * VTK_USE_GL2PS : ON +      { 
-          VTK_USE_GUISUPPORT : ON +      vtkGenericWarningMacro("Error returned from vtk/tcl callback:\n" << 
-          configure (et vérifier que les libs nécessaires sont présente) [c] +                             arg2->command << endl << 
-          VTK_USE_QVTK : ON +                             Tcl_GetVar(arg2->interp,(char *)("errorInfo"),0) << 
-          configure (et vérifier que les libs nécessaires sont présente[c] +                             " at line number " << arg2->interp->errorLine); 
-          * DESIRED_QT_VERSION : 4 +      } 
-          VTK_USE_QVTK_QTOPENGL : ON +    else 
-          configure [c] +      { 
-          generate makefiles & exit [g] +      vtkGenericWarningMacro("Error returned from vtk/tcl callback:\n" << 
-      compiler - installer +                             arg2->command << endl << 
-          gmake -j 16  +                             " at line number " << arg2->interp->errorLine); 
-          sudo make install +      
-      installer le wrapper python  +       
-          cd ~/setup/vtk-5.4.2/VTKBIN/Wrapping/Python +devient 494-506: 
-          sudo python setup.py install + 
-      Ajouter le répertoire vtk dans le ldconfig (chemin des .so dans le système) +    if (Tcl_GetVar(arg2->interp,(char *)("errorInfo"),0)) 
-          * sudo echo /opt/vtk-5.4.2/lib/vtk-5.4 > /etc/ld.so.conf+      { 
-          * sudo ldconfig -v -f /etc/ld.so.conf+      vtkGenericWarningMacro("Error returned from vtk/tcl callback:\n" << 
 +                             arg2->command << endl << 
 +                             Tcl_GetVar(arg2->interp,(char *)("errorInfo"),0) << 
 +                             " at line number " << vtkTclGetErrorLine(arg2->interp)); 
 +      } 
 +    else 
 +      { 
 +      vtkGenericWarningMacro("Error returned from vtk/tcl callback:\n" << 
 +                             arg2->command << endl << 
 +                             " at line number " << vtkTclGetErrorLine(arg2->interp)); 
 +      
 +  
 +ligne 721-732 :  
 +    if (Tcl_GetVar(this->Interp,(char *)("errorInfo"),0)) 
 +      { 
 +      vtkGenericWarningMacro("Error returned from vtk/tcl callback:\n" << 
 +                             this->StringCommand << endl << 
 +                             Tcl_GetVar(this->Interp,(char *)("errorInfo"),0) << 
 +                             " at line number " << this->Interp->errorLine); 
 +      } 
 +    else 
 +      { 
 +      vtkGenericWarningMacro("Error returned from vtk/tcl callback:\n" << 
 +                             this->StringCommand << endl << 
 +                             " at line number " << this->Interp->errorLine); 
 +      
 +    } 
 +      vtkGenericWarningMacro("Error returned from vtk/tcl callback:\n" << 
 +                             this->StringCommand << endl << 
 +                             Tcl_GetVar(this->Interp,(char *)("errorInfo"),0) << 
 +                             " at line number " << this->Interp->errorLine); 
 +devient 727-739: 
 +    if (Tcl_GetVar(this->Interp,(char *)("errorInfo"),0)) 
 +      { 
 +      vtkGenericWarningMacro("Error returned from vtk/tcl callback:\n" << 
 +                             this->StringCommand << endl << 
 +                             Tcl_GetVar(this->Interp,(char *)("errorInfo"),0) << 
 +                             " at line number " << vtkTclGetErrorLine(this->Interp)); 
 +      
 +    else 
 +      { 
 +      vtkGenericWarningMacro("Error returned from vtk/tcl callback:\n" << 
 +                             this->StringCommand << endl << 
 +                             " at line number " <<  vtkTclGetErrorLine(this->Interp)); 
 +      } 
 +    }             
 +</code>     
 + 
 +  Executer CMake : modifier les options suivante  :  
 +     * BUILD_SHARED_LIBS : ON 
 +     * CMAKE_INSTALL_PREFIX : ''../VTKInstall'' (attention "../" pas "..\") 
 +     CMAKE_CXX_MP_FLAG : ON (permet de compiler en parallele en local) 
 +     VTK_DEBUG_LEAKS OFF (pour une version à distribuer, peut-être ON pour developpement) 
 +     * VTK_USE_GL2PS : ON (advanced option) 
 +     VTK_USE_QT : ON 
 +     VTK_WRAP_PYTHON : ON 
 +     VTK_WRAP_TCL : ON 
 +     Les autres options doivent "suivre"(qt (definir qmake suffit généralement), python (Include, lib, libdebug),  tcl/tk (include, lib, exe)
 + 
 + 
 +   Compiler ALL_BUILD (Debug) (Commencer par debug) 
 +   Installer  
 +   Compiler ALL_BUILD (Release) 
 +   Installer  
 + 
 +<note warning> Attention : certains fichiers debug seront écrasés par leur version release, mais normalement c'est les même ... raison pour laquelle on démarre par la version debug </note> 
 + 
 + 
 +   Modifier les chemins relatifs des librairies en variables d'environnement : VTK conserve les chemins absolus vers les librairies utilisées lors de la compilation (qt, ...) ce qui est incompatible avec les Libs déplaçables. 
 +     remplacer ''\VTK\VTKInstall'' par ''$ENV{METAFORLIBS}'' dans les fichiers :  
 +       ''VTK\VTKInstall\lib\vtk-5.10.1\VTKConfig.cmake'' 
 +       ''VTK\VTKInstall\lib\vtk-5.10.1\VTKConfigQt.cmake'' 
 +       ''VTK\VTKInstall\lib\vtk-5.10.1\VTKTargets-release.cmake'' 
 +   Copier le répertoire ''VTK\VTKInstall'' dans le répertoire de Libs : ''LibsVS2012\vtk-5.10.1'' 
 +   * Installer les wrappers python (crée le répertoire LibsVS2012\Python\Lib\site_packages\VTK-5.10.1-py2.6.egg) 
 +       * ouvrir une invite de commande et aller dans ''VTK\VTKBuild\Wrapping\Python''  
 +       * ''python setup.py install BUILD_TYPE=Release'' 
 +       * ''python setup.py install BUILD_TYPE=Debug''           
 +       Vérification: faire un import vtk dans python.exe & dans python_d.exe
  

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki