doc:devel:vtk
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revisionNext revisionBoth sides next revision | ||
doc:devel:vtk [2012/11/29 13:29] – [Debug] marlene | doc:devel:vtk [2014/01/09 13:07] – papeleux | ||
---|---|---|---|
Line 1: | Line 1: | ||
====== Compiler VTK pour Metafor ====== | ====== Compiler VTK pour Metafor ====== | ||
- | memo comment | + | memo comment |
- | ===== Windows (compatible python_d pour vtk 5.10) - v. Marlène ===== | ||
- | vtk : basé sur vtk-5.10.1 | + | ===== Windows |
- | deux projets différents: un en release et un en debug | + | * Détarer les sources |
+ | * Créer le répertoire de compilation : VTK\VTKBuild | ||
+ | * Modifier les sources VTK : | ||
+ | * VTK Debug : ajout du postfix " | ||
- | ==== Release ==== | + | < |
+ | # Append the library version information to the library target | ||
+ | # properties. | ||
+ | # block this. | ||
+ | IF(NOT VTK_NO_LIBRARY_VERSION) | ||
+ | SET(VTK_LIBRARY_PROPERTIES ${VTK_LIBRARY_PROPERTIES} | ||
+ | VERSION " | ||
+ | SOVERSION " | ||
+ | ) | ||
+ | | ||
+ | SET(VTK_LIBRARY_PROPERTIES ${VTK_LIBRARY_PROPERTIES} DEBUG_POSTFIX _d ) | ||
+ | </ | ||
+ | |||
+ | * Wrappers Python debug : postfix " | ||
+ | < | ||
+ | # Python extension modules on Windows must have the extension " | ||
+ | # instead of " | ||
+ | # this suffix. | ||
+ | IF(WIN32 AND NOT CYGWIN) | ||
+ | SET_TARGET_PROPERTIES(vtk${KIT}Python PROPERTIES SUFFIX " | ||
+ | SET_TARGET_PROPERTIES(vtk${KIT}Python PROPERTIES DEBUG_POSTFIX " | ||
+ | ENDIF(WIN32 AND NOT CYGWIN) | ||
+ | </ | ||
- | * Détarer les sources : F: | + | |
- | * Créer le répertoire de compilation : F:\vtk-5.10.1\VTKBuild | + | |
- | * Créer le répertoire d' | + | lignes 85-100 : |
- | * Modifier les sources VTK : link_directories | + | |
< | < | ||
- | modifier | + | def get_libs(): |
- | Ajouter : | + | """ |
- | # Add link directories needed to use VTK. | + | libs = [] |
- | | + | |
- | après | + | # Select platform-specific components of the module file names. |
- | | + | if os.name == ' |
+ | dir = vtk_lib_dir | ||
+ | | ||
+ | | ||
+ | else: | ||
+ | dir = vtk_bin_dir.replace('/', | ||
+ | prefix = ' | ||
+ | if vtk_build_type == ' | ||
+ | suffix = ' | ||
+ | else: | ||
+ | suffix = ' | ||
</ | </ | ||
- | * Executer CMake : modifier les options suivante | + | * patcher vtktclutil.cxx pour utilisation tcltk8.6: |
+ | http:// | ||
+ | "/ | ||
+ | < | ||
+ | ligne 21 - 24 : | ||
+ | #include < | ||
+ | #include < | ||
+ | |||
+ | extern " | ||
+ | |||
+ | devient 21-30 : | ||
+ | #include < | ||
+ | #include < | ||
+ | |||
+ | #if (TCL_MAJOR_VERSION == 8) && (TCL_MINOR_VERSION < 6) | ||
+ | #define vtkTclGetErrorLine(m) (m-> | ||
+ | #else | ||
+ | #define vtkTclGetErrorLine(m) (Tcl_GetErrorLine(m)) | ||
+ | #endif | ||
+ | |||
+ | extern " | ||
+ | |||
+ | ligne 488-500 : | ||
+ | if (Tcl_GetVar(arg2-> | ||
+ | { | ||
+ | vtkGenericWarningMacro(" | ||
+ | | ||
+ | | ||
+ | " | ||
+ | } | ||
+ | else | ||
+ | { | ||
+ | vtkGenericWarningMacro(" | ||
+ | | ||
+ | " | ||
+ | } | ||
+ | |||
+ | devient 494-506: | ||
+ | |||
+ | if (Tcl_GetVar(arg2-> | ||
+ | { | ||
+ | vtkGenericWarningMacro(" | ||
+ | | ||
+ | | ||
+ | " | ||
+ | } | ||
+ | else | ||
+ | { | ||
+ | vtkGenericWarningMacro(" | ||
+ | | ||
+ | " | ||
+ | } | ||
+ | |||
+ | ligne 721-732 : | ||
+ | if (Tcl_GetVar(this-> | ||
+ | { | ||
+ | vtkGenericWarningMacro(" | ||
+ | | ||
+ | | ||
+ | " | ||
+ | } | ||
+ | else | ||
+ | { | ||
+ | vtkGenericWarningMacro(" | ||
+ | | ||
+ | " | ||
+ | } | ||
+ | } | ||
+ | vtkGenericWarningMacro(" | ||
+ | | ||
+ | | ||
+ | " | ||
+ | devient 727-739: | ||
+ | if (Tcl_GetVar(this-> | ||
+ | { | ||
+ | vtkGenericWarningMacro(" | ||
+ | | ||
+ | | ||
+ | " | ||
+ | } | ||
+ | else | ||
+ | { | ||
+ | vtkGenericWarningMacro(" | ||
+ | | ||
+ | " | ||
+ | } | ||
+ | } | ||
+ | </ | ||
+ | |||
+ | | ||
* BUILD_SHARED_LIBS : ON | * BUILD_SHARED_LIBS : ON | ||
- | * CMAKE_INSTALL_PREFIX : '' | + | * CMAKE_INSTALL_PREFIX : '' |
- | * 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 " | + | * Les autres options doivent " |
+ | |||
+ | |||
+ | * 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 | ||
+ | |||
* Modifier les chemins relatifs des librairies en variables d' | * Modifier les chemins relatifs des librairies en variables d' | ||
- | * remplacer '' | + | * remplacer |
- | * '' | + | * '' |
- | * '' | + | * '' |
- | * '' | + | * '' |
- | * Copier le répertoire '' | + | * '' |
- | * Installer les wrappers python (crée le répertoire | + | * idem pour les chemins vers tcl/ |
- | dans '' | + | * '' |
- | + | * includes de vtk_freetype, | |
- | Vérification: | + | * '' |
+ | * '' | ||
+ | * '' | ||
+ | * enlever les chemins absolu vers " | ||
+ | | ||
+ | * Copier le répertoire '' | ||
+ | * Installer les wrappers python (crée le répertoire | ||
+ | * ouvrir une invite de commande et aller dans '' | ||
+ | | ||
+ | * '' | ||
+ | * Vérification: | ||
- | ==== Debug ==== | ||
- | * Détarer les sources | + | |
- | * Créer le répertoire de compilation : F:\vtk-5.10.1\VTKBuildDebug | + | ===== Windows : Release & Debug / Wrapper vtk-python (r&d) / Marlène & Luc ===== |
- | | + | |
- | * Modifier les sources VTK : | + | * Détarer les sources : VTK\vtk-5.10.1 |
- | * link_directories: | + | * Créer le répertoire de compilation : VTK\VTKBuild |
+ | | ||
< | < | ||
- | | + | ligne 28-29 : |
- | Ajouter | + | # Add include |
- | # 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}) | ||
</ | </ | ||
- | * DLL's VTK Debug : ajout du postfix " | ||
- | < | ||
- | | ||
- | Ajouter la propriété : | ||
- | SET(VTK_LIBRARY_PROPERTIES ${VTK_LIBRARY_PROPERTIES} DEBUG_POSTFIX _d ) | ||
- | dans le tests : | ||
- | IF(NOT VTK_NO_LIBRARY_VERSION) | ||
- | soit : | + | |
- | IF(NOT VTK_NO_LIBRARY_VERSION) | + | |
- | SET(VTK_LIBRARY_PROPERTIES ${VTK_LIBRARY_PROPERTIES} | + | |
- | VERSION " | + | |
- | SOVERSION " | + | |
- | ) | + | |
- | SET(VTK_LIBRARY_PROPERTIES ${VTK_LIBRARY_PROPERTIES} | + | |
- | DEBUG_POSTFIX _d | + | |
- | ) | + | |
- | ENDIF(NOT VTK_NO_LIBRARY_VERSION) | + | |
- | </ | + | |
- | | + | |
< | < | ||
- | modifier " | + | ligne 95-103 : |
- | IF(WIN32 AND NOT CYGWIN) | + | |
- | SET_TARGET_PROPERTIES(vtk${KIT}Python PROPERTIES SUFFIX " | + | |
- | SET_TARGET_PROPERTIES(vtk${KIT}Python PROPERTIES DEBUG_POSTFIX " | + | |
- | ENDIF(WIN32 AND NOT CYGWIN) | + | |
- | </ | + | |
- | * 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 : '' | + | |
- | * 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 " | + | |
- | * Compiler ALL_BUILD (Debug) | + | |
- | * Installer : via compilation du projet INSTALL (Debug) | + | |
- | * Modifier les chemins relatifs des librairies en variables d' | + | |
- | * Copier les fichiers '' | + | |
- | * Copier les fichiers '' | + | |
- | * Copier le fichier '' | + | |
- | * Installer les wrappers python : copier '' | + | |
- | Vérification: | + | # Append the library version information to the library target |
+ | # properties. | ||
+ | # block this. | ||
+ | IF(NOT VTK_NO_LIBRARY_VERSION) | ||
+ | SET(VTK_LIBRARY_PROPERTIES ${VTK_LIBRARY_PROPERTIES} | ||
+ | VERSION " | ||
+ | SOVERSION " | ||
+ | ) | ||
+ | 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) ===== | + | |
- | | + | |
- | * Détarer les sources : E: | + | # properties. A parent project may set its own properties and/or may |
- | * Créer le répertoire de compilation : E: | + | # block this. |
- | | + | IF(NOT VTK_NO_LIBRARY_VERSION) |
- | * DLL's VTK Debug : ajout du postfix | + | SET(VTK_LIBRARY_PROPERTIES ${VTK_LIBRARY_PROPERTIES} |
- | < | + | |
- | | + | |
- | 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 : | + | |
- | IF(NOT VTK_NO_LIBRARY_VERSION) | + | |
- | + | ||
- | soit : | + | |
- | IF(NOT VTK_NO_LIBRARY_VERSION) | + | |
- | SET(VTK_LIBRARY_PROPERTIES ${VTK_LIBRARY_PROPERTIES} | + | |
- | VERSION " | + | |
- | SOVERSION " | + | |
- | ) | + | |
- | SET(VTK_LIBRARY_PROPERTIES ${VTK_LIBRARY_PROPERTIES} | + | |
- | DEBUG_POSTFIX _d | + | |
- | ) | + | |
- | ENDIF(NOT VTK_NO_LIBRARY_VERSION) | + | |
</ | </ | ||
- | | + | |
< | < | ||
- | modifier | + | ligne 58-63 |
+ | |||
+ | # Python extension modules on Windows must have the extension | ||
+ | # instead of " | ||
+ | # this suffix. | ||
+ | IF(WIN32 AND NOT CYGWIN) | ||
+ | SET_TARGET_PROPERTIES(vtk${KIT}Python PROPERTIES SUFFIX " | ||
+ | ENDIF(WIN32 AND NOT CYGWIN) | ||
+ | |||
+ | devient 58-64: | ||
+ | |||
+ | # Python extension modules on Windows must have the extension " | ||
+ | # instead of " | ||
+ | # this suffix. | ||
IF(WIN32 AND NOT CYGWIN) | IF(WIN32 AND NOT CYGWIN) | ||
SET_TARGET_PROPERTIES(vtk${KIT}Python PROPERTIES SUFFIX " | SET_TARGET_PROPERTIES(vtk${KIT}Python PROPERTIES SUFFIX " | ||
Line 146: | Line 255: | ||
ENDIF(WIN32 AND NOT CYGWIN) | ENDIF(WIN32 AND NOT CYGWIN) | ||
</ | </ | ||
- | | + | |
+ | | ||
< | < | ||
- | modifier " | + | ligne 85-97 : |
- | remplacer | + | |
- | #if defined(VTK_WINDOWS_PYTHON_DEBUGGABLE) | + | def get_libs(): |
- | # include <Python.h> | + | """ |
- | #else | + | libs = [] |
- | # ifdef _DEBUG | + | |
- | # undef _DEBUG | + | |
- | # if defined(_MSC_VER) && _MSC_VER >= 1400 | + | |
- | # define _CRT_NOFORCE_MANIFEST 1 | + | dir = vtk_lib_dir |
- | # endif | + | prefix = ' |
- | # include <Python.h> | + | suffix = get_config_var(' |
- | # define _DEBUG | + | |
- | # else | + | dir = vtk_bin_dir.replace('/', |
- | # include <Python.h> | + | |
- | # endif | + | |
- | #endif | + | |
- | par | + | devient 85-100 : |
- | #include <Python.h> | + | |
+ | | ||
+ | """ | ||
+ | libs = [] | ||
+ | |||
+ | # Select platform-specific components of the module file names. | ||
+ | if os.name == ' | ||
+ | dir = vtk_lib_dir | ||
+ | | ||
+ | suffix = get_config_var(' | ||
+ | | ||
+ | dir = vtk_bin_dir.replace('/', | ||
+ | | ||
+ | if vtk_build_type == ' | ||
+ | | ||
+ | | ||
+ | suffix = '.pyd' | ||
</ | </ | ||
+ | * patcher vtktclutil.cxx pour utilisation tcltk8.6: | ||
+ | http:// | ||
+ | "/ | ||
+ | < | ||
+ | ligne 21 - 24 : | ||
+ | #include < | ||
+ | #include < | ||
- | * Executer CMake : modifier les options suivante : | + | extern |
- | * BUILD_SHARED_LIBS : ON | + | |
- | * CMAKE_INSTALL_PREFIX : E: | + | |
- | * VTK_DEBUG_LEAKS : ON | + | |
- | * VTK_USE_GL2PS : ON | + | |
- | * VTK_USE_QT : ON | + | |
- | * VTK_WRAP_PYTHON : ON | + | |
- | * VTK_WRAP_TCL : ON | + | |
- | * Les autres options doivent | + | |
- | * Compiler (release et debug) | + | |
- | * Installer : via compilation du projet Install (release et debug) | + | |
- | * Modifier les chemins relatifs des librairies en variables d' | + | |
- | * remplacer " | + | |
- | * E: | + | |
- | * E: | + | |
- | * E: | + | |
- | * Copier le répertoire " | + | |
- | * Installer les wrappers python : copier " | + | |
- | ===== Linux - Old version to be updated | + | devient 21-30 : |
+ | #include < | ||
+ | #include < | ||
- | * vtk : /opt/vtk-5.4.2 | + | |
- | * Détarer les sources | + | #define vtkTclGetErrorLine(m) (m-> |
- | * Créer un répertoire de compilation | + | #else |
- | * Aller dans le répertoire de compilation | + | #define vtkTclGetErrorLine(m) (Tcl_GetErrorLine(m)) |
- | * Lancer cmake interfacé | + | #endif |
- | * gérer | + | |
- | * BUILD_SHARED_LIBS : ON | + | extern " |
- | * CMAKE_INSTALL_PREFIX : /opt/vtk-5.4.2 | + | |
- | * VTK_WRAP_PYTHON | + | ligne 488-500 : |
- | * VTK_WRAP_TCL | + | if (Tcl_GetVar(arg2-> |
- | * VTK_USE_GL2PS : ON | + | { |
- | * VTK_USE_GUISUPPORT | + | vtkGenericWarningMacro(" |
- | * configure (et vérifier que les libs nécessaires sont présente) [c] | + | arg2->command << endl << |
- | * VTK_USE_QVTK | + | Tcl_GetVar(arg2-> |
- | * configure | + | " |
- | * DESIRED_QT_VERSION : 4 | + | } |
- | * VTK_USE_QVTK_QTOPENGL : ON | + | else |
- | * configure [c] | + | { |
- | * generate makefiles & exit [g] | + | vtkGenericWarningMacro(" |
- | * compiler - installer | + | |
- | * gmake -j 16 | + | " |
- | * sudo make install | + | |
- | * installer le wrapper python | + | |
- | * cd ~/setup/vtk-5.4.2/ | + | devient 494-506: |
- | * sudo python setup.py install | + | |
- | * Ajouter | + | if (Tcl_GetVar(arg2-> |
- | * sudo echo /opt/vtk-5.4.2/lib/vtk-5.4 > /etc/ld.so.conf) | + | { |
- | * sudo ldconfig -v -f /etc/ld.so.conf | + | vtkGenericWarningMacro(" |
+ | arg2->command << endl << | ||
+ | | ||
+ | " | ||
+ | } | ||
+ | else | ||
+ | { | ||
+ | vtkGenericWarningMacro(" | ||
+ | | ||
+ | " | ||
+ | | ||
+ | |||
+ | ligne 721-732 : | ||
+ | if (Tcl_GetVar(this-> | ||
+ | { | ||
+ | vtkGenericWarningMacro(" | ||
+ | this-> | ||
+ | | ||
+ | " | ||
+ | } | ||
+ | else | ||
+ | { | ||
+ | vtkGenericWarningMacro(" | ||
+ | | ||
+ | " | ||
+ | | ||
+ | } | ||
+ | vtkGenericWarningMacro(" | ||
+ | | ||
+ | | ||
+ | " | ||
+ | devient 727-739: | ||
+ | if (Tcl_GetVar(this-> | ||
+ | { | ||
+ | vtkGenericWarningMacro(" | ||
+ | | ||
+ | | ||
+ | " | ||
+ | | ||
+ | else | ||
+ | { | ||
+ | vtkGenericWarningMacro(" | ||
+ | | ||
+ | " | ||
+ | } | ||
+ | } | ||
+ | </ | ||
+ | |||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | |||
+ | |||
+ | * Compiler ALL_BUILD (Debug) (Commencer par 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 </ | ||
+ | |||
+ | |||
+ | * Modifier les chemins relatifs des librairies en variables d' | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | * 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 '' | ||
+ | * '' | ||
+ | * '' | ||
+ | * Vérification: | ||