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 [2013/08/28 14:47] – papeleux | doc:devel:vtk [2014/01/09 13:07] – papeleux | ||
---|---|---|---|
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 " | ||
+ | |||
+ | < | ||
+ | # 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) | ||
+ | </ | ||
+ | |||
+ | * installation des wrappers python_d : modifier VTK\vtk-5.10.1\Wrapping\Python\setup.py.in | ||
+ | |||
+ | lignes 85-100 : | ||
+ | < | ||
+ | def get_libs(): | ||
+ | """ | ||
+ | libs = [] | ||
+ | |||
+ | # Select platform-specific components of the module file names. | ||
+ | if os.name == ' | ||
+ | dir = vtk_lib_dir | ||
+ | prefix = ' | ||
+ | suffix = get_config_var(' | ||
+ | else: | ||
+ | dir = vtk_bin_dir.replace('/', | ||
+ | prefix = ' | ||
+ | if vtk_build_type == ' | ||
+ | suffix = ' | ||
+ | else: | ||
+ | suffix = ' | ||
+ | </ | ||
+ | |||
+ | * 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(" | ||
+ | | ||
+ | " | ||
+ | } | ||
+ | } | ||
+ | </ | ||
+ | |||
+ | * Executer CMake : modifier les options suivante | ||
+ | * BUILD_SHARED_LIBS : ON | ||
+ | * CMAKE_INSTALL_PREFIX : '' | ||
+ | * 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 " | ||
+ | |||
+ | |||
+ | * 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 </ | ||
+ | |||
+ | |||
+ | * Modifier les chemins relatifs des librairies en variables d' | ||
+ | * remplacer le lieu d' | ||
+ | * '' | ||
+ | * '' | ||
+ | * '' | ||
+ | * '' | ||
+ | * idem pour les chemins vers tcl/ | ||
+ | * '' | ||
+ | * includes de vtk_freetype, | ||
+ | * '' | ||
+ | * '' | ||
+ | * '' | ||
+ | * enlever les chemins absolu vers " | ||
+ | | ||
+ | * Copier le répertoire '' | ||
+ | * 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: | ||
+ | |||
+ | |||
===== Windows : Release & Debug / Wrapper vtk-python (r&d) / Marlène & Luc ===== | ===== Windows : Release & Debug / Wrapper vtk-python (r&d) / Marlène & Luc ===== | ||
Line 107: | Line 294: | ||
</ | </ | ||
- | * | ||
- | * | ||
* patcher vtktclutil.cxx pour utilisation tcltk8.6: | * patcher vtktclutil.cxx pour utilisation tcltk8.6: | ||
http:// | http:// | ||
Line 131: | Line 316: | ||
extern " | extern " | ||
- | ligne 490-493 : | + | ligne 488-500 : |
+ | if (Tcl_GetVar(arg2-> | ||
+ | { | ||
vtkGenericWarningMacro(" | vtkGenericWarningMacro(" | ||
| | ||
| | ||
" | " | ||
- | devient | + | } |
+ | else | ||
+ | { | ||
+ | vtkGenericWarningMacro(" | ||
+ | | ||
+ | " | ||
+ | } | ||
+ | |||
+ | devient | ||
+ | |||
+ | if (Tcl_GetVar(arg2-> | ||
+ | { | ||
vtkGenericWarningMacro(" | vtkGenericWarningMacro(" | ||
| | ||
| | ||
- | " | + | " |
- | + | } | |
+ | else | ||
+ | { | ||
+ | vtkGenericWarningMacro(" | ||
+ | arg2-> | ||
+ | " | ||
+ | } | ||
- | ligne 723-726 : | + | ligne 721-732 : |
+ | if (Tcl_GetVar(this-> | ||
+ | { | ||
vtkGenericWarningMacro(" | vtkGenericWarningMacro(" | ||
| | ||
| | ||
" | " | ||
- | devient 729-732: | + | } |
+ | else | ||
+ | { | ||
+ | vtkGenericWarningMacro(" | ||
+ | | ||
+ | " | ||
+ | } | ||
+ | } | ||
vtkGenericWarningMacro(" | vtkGenericWarningMacro(" | ||
| | ||
| | ||
- | " | + | " at line number " << this-> |
+ | devient 727-739: | ||
+ | if (Tcl_GetVar(this-> | ||
+ | { | ||
+ | vtkGenericWarningMacro(" | ||
+ | | ||
+ | | ||
+ | " | ||
+ | } | ||
+ | else | ||
+ | { | ||
+ | vtkGenericWarningMacro(" | ||
+ | | ||
+ | " at line number " << | ||
+ | } | ||
+ | } | ||
</ | </ | ||
* Executer CMake : modifier les options suivante | * Executer CMake : modifier les options suivante | ||
* 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 pour debugger les ) | + | * 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 | + | |
- | * Installer & renommer le répertoire d' | + | |
- | <note warning> Attention : ne pas oublier de renommer | + | |
- | * | + | |
- | ===== Windows | + | |
- | + | ||
- | vtk : basé sur vtk-5.10.1 (les libs de luc sont dans " | + | |
- | + | ||
- | deux projets différents: | + | |
- | + | ||
- | ==== Release ==== | + | |
- | | + | |
- | * Créer le répertoire de compilation : F: | + | |
- | * Créer le répertoire d' | + | |
- | * Modifier les sources VTK : link_directories | + | |
- | < | + | |
- | | + | |
- | Ajouter : | + | |
- | # Add link directories needed to use VTK. | + | |
- | LINK_DIRECTORIES(${VTK_LIBRARY_DIRS}) | + | |
- | après | + | |
- | INCLUDE_DIRECTORIES(${VTK_INCLUDE_DIRS}) | + | |
- | </ | + | |
- | + | ||
- | | + | |
- | * 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 (Release) | * Compiler ALL_BUILD (Release) | ||
- | * Installer | + | * Installer |
- | * Modifier les chemins relatifs des librairies en variables d' | + | |
- | * remplacer '' | + | |
- | * '' | + | |
- | * '' | + | |
- | * '' | + | |
- | * Copier le répertoire '' | + | |
- | * Installer les wrappers python (crée le répertoire F: | + | |
- | dans '' | + | |
- | + | ||
- | Vérification: | + | |
- | ==== 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 </ |
- | * Détarer les sources (ou copier celle de '' | ||
- | * Créer le répertoire de compilation : F: | ||
- | * Créer le répertoire d' | ||
- | * Modifier les sources VTK : | ||
- | * link_directories: | ||
- | < | ||
- | | ||
- | Ajouter : | ||
- | # Add link directories needed to use VTK. | ||
- | LINK_DIRECTORIES(${VTK_LIBRARY_DIRS}) | ||
- | après | ||
- | INCLUDE_DIRECTORIES(${VTK_INCLUDE_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 : | + | * Modifier les chemins relatifs des librairies en variables d' |
- | IF(NOT VTK_NO_LIBRARY_VERSION) | + | |
- | SET(VTK_LIBRARY_PROPERTIES ${VTK_LIBRARY_PROPERTIES} | + | |
- | VERSION " | + | |
- | SOVERSION " | + | |
- | ) | + | * Copier le répertoire |
- | SET(VTK_LIBRARY_PROPERTIES ${VTK_LIBRARY_PROPERTIES} | + | * Installer les wrappers python |
- | DEBUG_POSTFIX _d | + | |
- | ) | + | |
- | ENDIF(NOT VTK_NO_LIBRARY_VERSION) | + | |
- | </ | + | |
- | * Wrappers Python debug : postfix " | + | |
- | < | + | |
- | modifier " | + | |
- | 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 le fichier | + | |
- | * Installer les wrappers python | + | |
- | + | ||
- | Vérification: | + | |
- | + | ||
- | ==== Compiler Metafor ==== | + | |
- | 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 | + | |
- | * Détarer les sources : E: | + | |
- | * Créer le répertoire | + | |
- | * Modifier les sources VTK : | + | |
- | * 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) | + | |
- | </ | + | |
- | + | ||
- | * Wrappers | + | |
- | < | + | |
- | modifier " | + | |
- | 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) | + | |
- | </ | + | |
- | | + | |
- | < | + | |
- | modifier " | + | |
- | remplacer : | + | |
- | #if defined(VTK_WINDOWS_PYTHON_DEBUGGABLE) | + | |
- | # include < | + | |
- | #else | + | |
- | # ifdef _DEBUG | + | |
- | # undef _DEBUG | + | |
- | # if defined(_MSC_VER) && _MSC_VER >= 1400 | + | |
- | # define _CRT_NOFORCE_MANIFEST 1 | + | |
- | # endif | + | |
- | # include < | + | |
- | # define _DEBUG | + | |
- | # else | + | |
- | # include < | + | |
- | # endif | + | |
- | #endif | + | |
- | par | + | |
- | #include < | + | |
- | </ | + | |
- | + | ||
- | * Executer CMake : modifier les options suivante : | + | |
- | * 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'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: | + | |
- | * E: | + | |
- | * E: | + | |
- | * Copier le répertoire " | + | |
- | * Installer les wrappers | + | |
- | + | ||
- | ===== Linux - Old version to be updated ... ===== | + | |
- | + | ||
- | * vtk : / | + | |
- | * Détarer les sources (~/ | + | |
- | * Créer un répertoire de compilation (~/ | + | |
- | * Aller dans le répertoire de compilation (~/ | + | |
- | * Lancer cmake interfacé : ccmake ../VTK | + | |
- | * gérer les options : (celles à modifier. en " | + | |
- | | + | |
- | * CMAKE_INSTALL_PREFIX : / | + | |
- | * 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 ~/ | + | |
- | * sudo python setup.py install | + | |
- | * Ajouter le répertoire | + | |
- | * sudo echo /opt/vtk-5.4.2/ | + | |
- | * sudo ldconfig -v -f / | + | |