[vtkusers] vtkPoissonReconstruction problem in Release mode

João Domingos joao.sousa.domingos at gmail.com
Fri May 18 14:16:30 EDT 2012


Thanks for the hint David!

I was now able to build the vtkPoissonReconstruction
(http://hdl.handle.net/10380/3155) and wrap it to python:

[ 75%] Python Wrapping - generating vtkPoissonReconstructionPythonInit.cxx
(...)
[ 75%] Python Wrapping - generating vtkPoissonReconstructionPython.cxx
(..)
Linking CXX shared module vtkPoissonReconstructionPython.so
[100%] Built target vtkPoissonReconstructionPython

My problem here is, this was built in its own folder, inside the VTK
folder. Calling vtk.vtkPoissonReconstructionPython in a python script
does not find/recognise it. Do I need now to tell VTK where to find
it? How can I do that?

Also, I was trying to build the vtkPowerCrustSurfaceReconstruction
(http://www.sq3.org.uk/powercrust/) but there is no CMakeLists.txt.
Therefore I made the following one attached. It configures, but when
making an error occurs:

[ 16%] [ 33%] Building CXX object
CMakeFiles/vtkPowerCrustSurfaceReconstruction.dir/vtkPowerCrustSurfaceReconstruction.cxx.o
Building CXX object
CMakeFiles/PowerCrustSurfaceReconstruction.dir/vtkPowerCrustSurfaceReconstruction.cxx.o
/opt/VTK/PowerCrust/vtkPowerCrustSurfaceReconstruction.cxx:1341:55:
warning: deprecated conversion from string constant to ‘char*’
[-Wwrite-strings]
/opt/VTK/PowerCrust/vtkPowerCrustSurfaceReconstruction.cxx:1341:55:
warning: deprecated conversion from string constant to ‘char*’
[-Wwrite-strings]
/opt/VTK/PowerCrust/vtkPowerCrustSurfaceReconstruction.cxx:1341:55:
warning: deprecated conversion from string constant to ‘char*’
[-Wwrite-strings]
/opt/VTK/PowerCrust/vtkPowerCrustSurfaceReconstruction.cxx:1341:55:
warning: deprecated conversion from string constant to ‘char*’
[-Wwrite-strings]
/opt/VTK/PowerCrust/vtkPowerCrustSurfaceReconstruction.cxx:1341:55:
warning: deprecated conversion from string constant to ‘char*’
[-Wwrite-strings]
/opt/VTK/PowerCrust/vtkPowerCrustSurfaceReconstruction.cxx: In
function ‘void adapted_main()’:
/opt/VTK/PowerCrust/vtkPowerCrustSurfaceReconstruction.cxx:1554:66:
warning: deprecated conversion from string constant to ‘char*’
[-Wwrite-strings]
/opt/VTK/PowerCrust/vtkPowerCrustSurfaceReconstruction.cxx:1341:55:
warning: deprecated conversion from string constant to ‘char*’
[-Wwrite-strings]
/opt/VTK/PowerCrust/vtkPowerCrustSurfaceReconstruction.cxx:1341:55:
warning: deprecated conversion from string constant to ‘char*’
[-Wwrite-strings]
/opt/VTK/PowerCrust/vtkPowerCrustSurfaceReconstruction.cxx:1341:55:
warning: deprecated conversion from string constant to ‘char*’
[-Wwrite-strings]
/opt/VTK/PowerCrust/vtkPowerCrustSurfaceReconstruction.cxx:1341:55:
warning: deprecated conversion from string constant to ‘char*’
[-Wwrite-strings]
/opt/VTK/PowerCrust/vtkPowerCrustSurfaceReconstruction.cxx:1341:55:
warning: deprecated conversion from string constant to ‘char*’
[-Wwrite-strings]
/opt/VTK/PowerCrust/vtkPowerCrustSurfaceReconstruction.cxx: In
function ‘void adapted_main()’:
/opt/VTK/PowerCrust/vtkPowerCrustSurfaceReconstruction.cxx:1554:66:
warning: deprecated conversion from string constant to ‘char*’
[-Wwrite-strings]
/opt/VTK/PowerCrust/vtkPowerCrustSurfaceReconstruction.cxx: In
function ‘simplex* build_convex_hull(Coord* (*)(), long int (*)(site),
short int, short int)’:
/opt/VTK/PowerCrust/vtkPowerCrustSurfaceReconstruction.cxx:4099:25:
warning: deprecated conversion from string constant to ‘char*’
[-Wwrite-strings]
/opt/VTK/PowerCrust/vtkPowerCrustSurfaceReconstruction.cxx: In
function ‘simplex* build_convex_hull(Coord* (*)(), long int (*)(site),
short int, short int)’:
/opt/VTK/PowerCrust/vtkPowerCrustSurfaceReconstruction.cxx:4099:25:
warning: deprecated conversion from string constant to ‘char*’
[-Wwrite-strings]
/opt/VTK/PowerCrust/vtkPowerCrustSurfaceReconstruction.cxx: At global scope:
/opt/VTK/PowerCrust/vtkPowerCrustSurfaceReconstruction.cxx:11404:46:
error: declaration of ‘double erand48(short unsigned int*)’ has a
different exception specifier
/opt/VTK/PowerCrust/vtkPowerCrustSurfaceReconstruction.cxx:11328:8:
error: from previous declaration ‘double erand48(short unsigned int*)
throw ()’
/opt/VTK/PowerCrust/vtkPowerCrustSurfaceReconstruction.cxx: In
function ‘double erand48(short unsigned int*)’:
/opt/VTK/PowerCrust/vtkPowerCrustSurfaceReconstruction.cxx:11430:32:
error: declaration of ‘double erand48(short unsigned int*)’ has a
different exception specifier
/opt/VTK/PowerCrust/vtkPowerCrustSurfaceReconstruction.cxx:11404:15:
error: from previous declaration ‘double erand48(short unsigned int*)
throw ()’
/opt/VTK/PowerCrust/vtkPowerCrustSurfaceReconstruction.cxx: At global scope:
/opt/VTK/PowerCrust/vtkPowerCrustSurfaceReconstruction.cxx:11404:46:
error: declaration of ‘double erand48(short unsigned int*)’ has a
different exception specifier
/opt/VTK/PowerCrust/vtkPowerCrustSurfaceReconstruction.cxx:11328:8:
error: from previous declaration ‘double erand48(short unsigned int*)
throw ()’
/opt/VTK/PowerCrust/vtkPowerCrustSurfaceReconstruction.cxx: In
function ‘double erand48(short unsigned int*)’:
/opt/VTK/PowerCrust/vtkPowerCrustSurfaceReconstruction.cxx:11430:32:
error: declaration of ‘double erand48(short unsigned int*)’ has a
different exception specifier
/opt/VTK/PowerCrust/vtkPowerCrustSurfaceReconstruction.cxx:11404:15:
error: from previous declaration ‘double erand48(short unsigned int*)
throw ()’
make[2]: *** [CMakeFiles/PowerCrustSurfaceReconstruction.dir/vtkPowerCrustSurfaceReconstruction.cxx.o]
Error 1
make[1]: *** [CMakeFiles/PowerCrustSurfaceReconstruction.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....
make[2]: *** [CMakeFiles/vtkPowerCrustSurfaceReconstruction.dir/vtkPowerCrustSurfaceReconstruction.cxx.o]
Error 1
make[1]: *** [CMakeFiles/vtkPowerCrustSurfaceReconstruction.dir/all] Error 2
make: *** [all] Error 2

I would say this would be a problem with the filter.cxx itself, but
user Bayliss, Chris (Chicago) was able to build it in here
http://vtk.1045678.n5.nabble.com/medial-line-extraction-td5702424.html.

What do you think it might be?

Big thanks for everything!!

Best,
Joao




Many thanks,
Joao Domingos



On 18 May 2012 16:08, David Gobbi <david.gobbi at gmail.com> wrote:
> Hi Joao,
>
> To wrap external filters, you need to have have all the necessary
> wrapping calls in the CMakeLists.txt files for those filters.  I use
> wrapping in all my VTK journal submissions, so you can use one of
> those as an example, e.g. http://hdl.handle.net/10380/3252
>
>  - David
>
>
>
> On Fri, May 18, 2012 at 8:55 AM, Domingos <joao.sousa.domingos at gmail.com> wrote:
>> Heyy again vtkusers,
>>
>> Please does someone know how to rebuild VTK in ubuntu so that you can get
>> external custom filters (by these filters I mean vtkPoissonReconstruction or
>> vtkPowerCrustSurfaceReconstruction) wrapped to python?
>>
>> IT would be really helpful..
>>
>> Many thanks,
>> Joao
-------------- next part --------------
cmake_minimum_required(VERSION 2.6)

PROJECT(PowerCrustSurfaceReconstruction)

IF(NOT VTK_BINARY_DIR)
FIND_PACKAGE(VTK REQUIRED)
IF(NOT VTK_USE_RENDERING)
MESSAGE(FATAL_ERROR "Example ${your project} requires VTK_USE_RENDERING.")
ENDIF(NOT VTK_USE_RENDERING)
INCLUDE(${VTK_USE_FILE})
ENDIF(NOT VTK_BINARY_DIR)

INCLUDE (${CMAKE_ROOT}/Modules/FindVTK.cmake)

FIND_PACKAGE(VTK)

IF(VTK_FOUND)
   INCLUDE (${USE_VTK_FILE})
   LINK_LIBRARIES( vtkHybrid vtkRendering  vtkGraphics vtkImaging vtkIO vtkFiltering vtkCommon vtkInfovis)
   IF (${VTK_MAJOR_VERSION} GREATER 4)
      LINK_LIBRARIES( vtkWidgets )
   ENDIF (${VTK_MAJOR_VERSION} GREATER 4)
ENDIF(VTK_FOUND)

ADD_EXECUTABLE(PowerCrustSurfaceReconstruction vtkPowerCrustSurfaceReconstruction.cxx )

TARGET_LINK_LIBRARIES( vtkRendering )


FIND_PACKAGE(VTK REQUIRED)
INCLUDE(${VTK_USE_FILE})

SET(LIB_NAME vtk${PROJECT_NAME})
SET(LIB_VTK_LIBS vtkHybrid vtkRendering vtkGraphics vtkImaging vtkIO vtkFiltering vtkCommon vtkInfovis)
SET(LIB_SRCS
  vtkPowerCrustSurfaceReconstruction.cxx
)

SET(TEST_LIBS ${LIB_NAME})

# The remainder of this file can usually be left alone

FIND_PACKAGE(VTK REQUIRED)
INCLUDE(${VTK_USE_FILE})
IF(VTK_USE_CARBON)
SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -arch i386")
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -arch i386")
ENDIF(VTK_USE_CARBON)

ADD_LIBRARY(${LIB_NAME} STATIC ${LIB_SRCS})
TARGET_LINK_LIBRARIES(${LIB_NAME} ${LIB_VTK_LIBS})

# Need to include class headers and the configuration header.
INCLUDE_DIRECTORIES(${PROJECT_SOURCE_DIR})
INCLUDE_DIRECTORIES(${PROJECT_BINARY_DIR})

STRING(TOUPPER ${PROJECT_NAME} PROJECT_NAME_UPPER)
STRING(TOLOWER ${PROJECT_NAME} PROJECT_NAME_LOWER)

# Build static, but use shared-library flags
IF(CMAKE_SHARED_LIBRARY_C_FLAGS)
SET_TARGET_PROPERTIES(${LIB_NAME} PROPERTIES
                      COMPILE_FLAGS ${CMAKE_SHARED_LIBRARY_C_FLAGS})
ENDIF(CMAKE_SHARED_LIBRARY_C_FLAGS)

# Create the header to configure the classes.
SET(VTKLOCAL_BUILD_SHARED_LIBS_CONFIG 0)
CONFIGURE_FILE(${PROJECT_SOURCE_DIR}/vtkLocalConfigure.h.in
               ${PROJECT_BINARY_DIR}/${LIB_NAME}Configure.h
               @ONLY IMMEDIATE)

# Add tests
IF(TEST_NAME)
  ADD_EXECUTABLE(${TEST_NAME} ${TEST_SRCS})
  TARGET_LINK_LIBRARIES(${TEST_NAME} ${TEST_LIBS})
  ADD_TEST(${TEST_NAME} ${TEST_NAME} -t)
ENDIF(TEST_NAME)

# Use wrapping hints for this project.
SET(VTK_WRAP_HINTS "${PROJECT_SOURCE_DIR}/hints")

# Create Python wrappers if VTK is wrapped in Python.
IF(VTK_WRAP_PYTHON)
  CONFIGURE_FILE(${PROJECT_SOURCE_DIR}/vtkLocal.py.in
                 ${PROJECT_BINARY_DIR}/${PROJECT_NAME_LOWER}.py
                 @ONLY IMMEDIATE)
  IF(VTK_PYTHON_INCLUDE_DIR)
    SET(PYTHON_INCLUDE_DIR ${VTK_PYTHON_INCLUDE_DIR})
  ENDIF(VTK_PYTHON_INCLUDE_DIR)
  IF(VTK_PYTHON_LIBRARY)
    SET(PYTHON_LIBRARIES ${VTK_PYTHON_LIBRARY})
  ENDIF(VTK_PYTHON_LIBRARY)
  SET(VTK_WRAP_PYTHON_FIND_LIBS ON)
  INCLUDE(${VTK_CMAKE_DIR}/vtkWrapPython.cmake)
  INCLUDE_DIRECTORIES("${PYTHON_INCLUDE_PATH}")
  VTK_WRAP_PYTHON3(${LIB_NAME}Python vtkLocalPYTHON_SRCS "${LIB_SRCS}")
  ADD_LIBRARY(${LIB_NAME}Python MODULE ${vtkLocalPYTHON_SRCS})
  FOREACH(c ${LIB_VTK_LIBS})
    TARGET_LINK_LIBRARIES(${LIB_NAME}Python ${c}PythonD)
  ENDFOREACH(c)
  TARGET_LINK_LIBRARIES(${LIB_NAME}Python ${LIB_NAME})
  IF(${VTK_MAJOR_VERSION} GREATER 5 OR
     ${VTK_MAJOR_VERSION} EQUAL 5 AND ${VTK_MINOR_VERSION} GREATER 6)
    SET_TARGET_PROPERTIES(${LIB_NAME}Python PROPERTIES PREFIX "")
  ENDIF(${VTK_MAJOR_VERSION} GREATER 5 OR
       ${VTK_MAJOR_VERSION} EQUAL 5 AND ${VTK_MINOR_VERSION} GREATER 6)
  IF(WIN32)
    SET_TARGET_PROPERTIES(${LIB_NAME}Python PROPERTIES SUFFIX ".pyd")
  ENDIF(WIN32)
  IF (NOT "${PROJECT_BINARY_DIR}" MATCHES "^${PROJECT_SOURCE_DIR}$")
    FOREACH(file ${PYTHON_FILES})
      SET(src "${PROJECT_SOURCE_DIR}/${file}")
      SET(tgt "${PROJECT_BINARY_DIR}/${file}")
      CONFIGURE_FILE(${src} ${tgt} COPYONLY)
    ENDFOREACH(file)
  ENDIF (NOT "${PROJECT_BINARY_DIR}" MATCHES "^${PROJECT_SOURCE_DIR}$")
ENDIF(VTK_WRAP_PYTHON)



More information about the vtkusers mailing list