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 [2013/10/02 16:32] papeleuxdoc:devel:vtk [2016/03/30 15:23] – external edit 127.0.0.1
Line 2: Line 2:
  
 memo comment compiler vtk (5.10.1) pour les Libs  memo comment compiler vtk (5.10.1) pour les Libs 
 +
 +
 +===== Windows : Release & Debug / Wrapper vtk-python (r&d) / Luc (version 140109) =====
 +
 +   * 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" 
 +
 +<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>
 +
 +  * installation des wrappers python_d : modifier VTK\vtk-5.10.1\Wrapping\Python\setup.py.in            
 +
 +lignes 85-100 :
 +<code>
 +  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>
 +
 +  * 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
 +     * 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 le lieu d'installation ''E:\Dev64\...'' 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''
 +       * ''VTK\VTKInstall\lib\vtk-5.10.1\VTKTargets-debug.cmake''
 +     * idem pour les chemins vers tcl/tk, 
 +       * ''$ENV{METAFORLIBS}/TclTk-8.5.15/...''
 +     * includes de  vtk_freetype,  vtk_libproj4, vtk_dhf5 dans les même fichiers
 +       * ''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
 +
 +
  
 ===== Windows : Release & Debug / Wrapper vtk-python (r&d) / Marlène & Luc ===== ===== Windows : Release & Debug / Wrapper vtk-python (r&d) / Marlène & Luc =====
Line 206: Line 393:
      * VTK_WRAP_TCL : 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))      * Les autres options doivent "suivre" : (qt (definir qmake suffit généralement), python (Include, lib, libdebug),  tcl/tk (include, lib, exe))
-   * Compiler ALL_BUILD (Release) 
-   * Installer & renommer le répertoire d'installation en VTKInstallRelease 
-<note warning> Attention : ne pas oublier de renommer (ou backuper d'autre part le répertoire d'install). sinon, certains fichiers seront ecrasés par la version debug... </note> 
  
  
-   * Compiler ALL_BUILD (Debug) +   * Compiler ALL_BUILD (Debug) (Commencer par debug) 
-   * Installer & renommer le répertoire d'installation en VTKInstallDebug +   Installer 
- +
-   * merger les repertoires d'install: +
-   *  +
- +
- +
- +
- +
-   * 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 :  +
-       * ''F:\vtk-5.10.1\VTKInstall\lib\vtk-5.6\VTKConfig.cmake'' +
-       * ''F:\vtk-5.10.1\VTKInstall\lib\vtk-5.6\VTKConfigQt.cmake'' +
-       * ''F:\vtk-5.10.1\VTKInstall\lib\vtk-5.6\VTKTargets-release.cmake'' +
-   * Copier le répertoire ''F:\vtk-5.10.1\VTKInstall'' dans le répertoire de Libs : ''F:\LibsVS2008\vtk'' +
-   * Installer les wrappers python (crée le répertoire F:\LibsVS2008\Python\Lib\site_packages\VTK-5.10.1-py2.6.egg): +
-          dans ''F:\vtk-5.10.1\VTKBuild\Wrapping\Python'' ouvrir une invite de commande et taper : ''python setup.py install BUILD_TYPE=Release'' +
-           +
-Vérification: faire un import vtk dans python +
- +
-===== 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"+
- +
-deux projets différents: un en release et un en debug +
- +
-==== Release ====  +
- +
- +
-   * Détarer les sources : F:\vtk-5.10.1\VTKSource +
-   * 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 +
-   * Modifier les sources VTK : link_directories  +
-<code> +
- modifier "F:\vtk-5.10.1\VTKSource\UseVTK.cmake.in" +
-Ajouter : +
-  # Add link directories needed to use VTK. +
-  LINK_DIRECTORIES(${VTK_LIBRARY_DIRS}) +
-après +
-  INCLUDE_DIRECTORIES(${VTK_INCLUDE_DIRS}) +
-</code> +
- +
-   Executer CMake : modifier les options suivante (cfr config de luc ci-dessous) :  +
-     * BUILD_SHARED_LIBS : ON +
-     * CMAKE_INSTALL_PREFIX : ''F:\vtk-5.10.1\VTKInstall'' +
-     * 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 (Release)    * Compiler ALL_BUILD (Release)
-   * Installer : via compilation du projet INSTALL (Release) +   * Installer 
-   * 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 :  +
-       * ''F:\vtk-5.10.1\VTKInstall\lib\vtk-5.6\VTKConfig.cmake'' +
-       * ''F:\vtk-5.10.1\VTKInstall\lib\vtk-5.6\VTKConfigQt.cmake'' +
-       * ''F:\vtk-5.10.1\VTKInstall\lib\vtk-5.6\VTKTargets-release.cmake'' +
-   * Copier le répertoire ''F:\vtk-5.10.1\VTKInstall'' dans le répertoire de Libs : ''F:\LibsVS2008\vtk'' +
-   * Installer les wrappers python (crée le répertoire F:\LibsVS2008\Python\Lib\site_packages\VTK-5.10.1-py2.6.egg): +
-          dans ''F:\vtk-5.10.1\VTKBuild\Wrapping\Python'' ouvrir une invite de commande et taper : ''python setup.py install BUILD_TYPE=Release'' +
-           +
-Vérification: faire un import vtk dans python+
  
-==== Debug ==== +<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>
  
-   * 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 
-   * Créer le répertoire d'installation: F:\vtk-5.10.1\VTKInstallDebug 
-   * Modifier les sources VTK :  
-      * link_directories: 
-<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"  : 
-Ajouter : 
-  # Add link directories needed to use VTK. 
-  LINK_DIRECTORIES(${VTK_LIBRARY_DIRS}) 
-après 
-  INCLUDE_DIRECTORIES(${VTK_INCLUDE_DIRS}) 
-</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 :  +   * 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. 
-IF(NOT VTK_NO_LIBRARY_VERSION) +     remplacer ''\VTK\VTKInstall'' par ''$ENV{METAFORLIBS}'' dans les fichiers :  
-  SET(VTK_LIBRARY_PROPERTIES ${VTK_LIBRARY_PROPERTIES} +       ''VTK\VTKInstall\lib\vtk-5.10.1\VTKConfig.cmake'' 
-    VERSION "${VTK_VERSION}" +       * ''VTK\VTKInstall\lib\vtk-5.10.1\VTKConfigQt.cmake'' 
-    SOVERSION "${VTK_MAJOR_VERSION}.${VTK_MINOR_VERSION}" +       * ''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'' 
-  SET(VTK_LIBRARY_PROPERTIES ${VTK_LIBRARY_PROPERTIES} +   * Installer les wrappers python (crée le répertoire LibsVS2012\Python\Lib\site_packages\VTK-5.10.1-py2.6.egg):  
-    DEBUG_POSTFIX _d +       ouvrir une invite de commande et aller dans ''VTK\VTKBuild\Wrapping\Python''  
-    ) +       ''python setup.py install BUILD_TYPE=Release'' 
-ENDIF(NOT VTK_NO_LIBRARY_VERSION) +       ''python setup.py install BUILD_TYPE=Debug''           
-</code> +       Vérification: faire un import vtk dans python.exe & dans python_d.exe
-      * Wrappers Python debug : postfix "_d" aux "pyd" +
-<code> +
-modifier "F:\vtk-5.10.1\VTKSourceDebug\Cmake\KitCommonPythonWrapBlock.cmake" (ligne 63): +
-  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érificationfaire un import vtk dans python_d +
- +
-==== Compiler Metafor ====  +
-Pour compiler Metafor avec ces libs, changer le numero de version vtk dans le chemin de ZLIB dans la config cmake  +
-===== Linux - Old version to be updated ... ===== +
- +
-  vtk : /opt/vtk-5.4.2  +
-      * Détarer les sources (~/setup/vtk-5.4.2/VTK) +
-      * Créer un répertoire de compilation (~/setup/vtk-5.4.2/VTKBIN) +
-      * Aller dans le répertoire de compilation (~/setup/vtk-5.4.2/VTKBIN) +
-      * Lancer cmake interfacé : ccmake ../VTK +
-      * gérer les options : (celles à modifier. en "advanced mode [t])        +
-          BUILD_SHARED_LIBS : ON +
-          * CMAKE_INSTALL_PREFIX : /opt/vtk-5.4.2 +
-          * VTK_WRAP_PYTHON : ON +
-          * VTK_WRAP_TCL : ON +
-          * VTK_USE_GL2PS : ON +
-          * VTK_USE_GUISUPPORT : ON +
-          * configure (et vérifier que les libs nécessaires sont présente) [c] +
-          * VTK_USE_QVTK : ON +
-          * configure (et vérifier que les libs nécessaires sont présente) [c] +
-          * DESIRED_QT_VERSION : 4 +
-          * VTK_USE_QVTK_QTOPENGL : ON +
-          * configure [c] +
-          * generate makefiles & exit [g] +
-      * compiler - installer +
-          * gmake -j 16  +
-          * sudo make install +
-      * installer le wrapper python  +
-          * cd ~/setup/vtk-5.4.2/VTKBIN/Wrapping/Python +
-          sudo python setup.py install +
-      Ajouter le répertoire vtk dans le ldconfig (chemin des .so dans le système) +
-          * sudo echo /opt/vtk-5.4.2/lib/vtk-5.4 > /etc/ld.so.conf) +
-          * sudo ldconfig -v -f /etc/ld.so.conf+
  

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki