Code Monkey home page Code Monkey logo

vtkaddon's Issues

Fix warning "vtkOpenGL.h is deprecated. vtk_glew.h should be used if you require OpenGL headers."

Building Slicer 731be146e8a82b9a8090257e28 with VTK 9 enabled reports the following error:

/path/to/VTK/Rendering/OpenGL2/vtkOpenGL.h:25:2: warning: #warning "vtkOpenGL.h is deprecated. vtk_glew.h should be used if you require OpenGL headers." [-Wcpp]
 #warning "vtkOpenGL.h is deprecated. vtk_glew.h should be used if you require OpenGL headers."
  ^

For exact version of VTK, see https://github.com/Slicer/Slicer/blob/731be146e8a82b9a8090257e28eeb42f80989452/SuperBuild/External_VTK.cmake#L179-L182

vtkWrapHierarchy is kept re-executed

We experienced huge slowdowns of application builds due to vtkWrapHierarchy kept rebuilding hierarchy files. For example, Slicer build took 10 minutes when nothing changed.

It turned out that this was because VTK was updated after the application was built (which is very common on developer computers). This update updated the vtkWrapHierarchy.exe file's timestamp, which is a dependency of hierarchy file generation build step. Therefore it triggers rebuilding of hierarchy file. However, the content of the hierarchy file was not changed and therefore its timestamp remained the same (older than timestamp of vtkWrapHierarchy.exe). This means that next time the hierarchy got updated again.

One solution could be vtkWrapHierarchy.cmake should be updated to touch some timestamp file each time vtkWrapHierarchy.exe was executed and use that to determine if the target is up-to-date (rather than use the timestamp of the hierarchy file).

Another solution could be to force writing of hierarchy files (update their timestamp) even if the file has not changed. Currently, vtkWrapHierarchy only updates the output hierarchy file if its content has changed.

Workaround to speed up builds after a VTK update: delete all the *Hierarchy.txt files (for example, in c:\D\S4R\Slicer-build).

Missing include file in vtkImageLabelDilate3D.cxx

vtkImageLabelDilate3D.cxx added in #44 introduces a compilation error on Microsoft Visual Studio Professional 2022 (64-bit) - Current
Version 17.6.4 ; MSVC version 14.36.32532
Compilation fails with with error:
vtkAddon\vtkImageLabelDilate3D.cxx(67): error C2039: 'map': is not a member of 'std'

vtkComputeModeOfArray references std::map<T, int> but does not include the header which results in the compilation error.
Reverting to the previous commit compiles as expected. Adding #include <map> to the includes also allows compilation to continue

Install issues on Linux

Hi,

Context: PlusLib install with conan
Platform: Ubuntu 18.04
CMake version: 3.21.1

When installing vtkAddon, there was a missing target file in the cmake install tree.
Moreover ${CMAKE_CURRENT_SOURCE_DIR} should be preferred to ${CMAKE_SOURCE_DIR} as the project could be installed as a subproject and ${CMAKE_SOURCE_DIR} will point to the top level script directory.

PR #24 fixes these issues.

Best Regards,

CMake configuration error when building against VTK with external HDF5

When building against VTK with external HDF5:

  • VTK_MODULE_ENABLE_VTK_hdf5:STRING=YES
  • VTK_MODULE_USE_EXTERNAL_VTK_hdf5:BOOL=ON

the following CMake error is raised:

CMake Error at /home/aure/src/vtk/build/lib64/cmake/vtk-9.0/patches/99/FindHDF5.cmake:222 (try_compile):
  Unknown extension ".c" for file

    /home/aure/src/vtkAddon/build/CMakeFiles/hdf5/cmake_hdf5_test.c

  try_compile() works only for enabled languages.  Currently these are:

    CXX

  See project() command to enable other languages.
Call Stack (most recent call first):
  /home/aure/src/vtk/build/lib64/cmake/vtk-9.0/patches/99/FindHDF5.cmake:556 (_HDF5_test_regular_compiler_C)
  /home/aure/src/vtk/build/lib64/cmake/vtk-9.0/VTK-vtk-module-find-packages.cmake:303 (find_package)
  /home/aure/src/vtk/build/lib64/cmake/vtk-9.0/vtk-config.cmake:138 (include)
  /home/aure/src/vtk/build/vtk-config.cmake:1 (include)
  CMakeLists.txt:24 (find_package)

Install tree should be relocatable

PR #6 improved the build-system to properly install artifacts

The configured vtkAddonInstallConfig.cmake.in should be improved so that it does NOT contain absolute paths:

set(vtkAddon_CMAKE_DIR "@CMAKE_INSTALL_PREFIX@/@vtkAddon_INSTALL_CMAKE_DIR@")
set(vtkAddon_INCLUDE_DIRS "@CMAKE_INSTALL_PREFIX@/@vtkAddon_INSTALL_INCLUDE_DIR@")
set(vtkAddon_LIB_DIR "@CMAKE_INSTALL_PREFIX@/@vtkAddon_INSTALL_LIB_DIR@")
set(VTK_DIR "@VTK_DIR@")

The following resources may be helpful to learn how to move forward:

Some CMake projects:

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.