[vtkusers] vtkPoissonReconstruction problem in Release mode

João Domingos joao.sousa.domingos at gmail.com
Sat May 19 14:11:03 EDT 2012


So I tried in another ubuntu system (11.04), successfully rebuild
vtkPoissonReconstruction with the python wrapping and I got the same
error but in a different symbol, I guess:

from vtkPoissonReconstructionPython import *
ImportError: /local/wolf3519/Documents/LV_Defor_Model_KalmanF/ExtraFilters/vtkPoissonReconstruction/build/vtkPoissonReconstructionPython.so:
undefined symbol: _ZN13MarchingCubes9cornerMapE

I guess the code I added to the CMakeLists file to wrap the
PoissonReconstruction (http://hdl.handle.net/10380/3155) filter to
python is not working properly..

David, do you mind checking if the CMakeLists file I attached is
expected to correctly wrap the vtkPoissonReconstruction, for example?

Thank you,
Joao




On 19 May 2012 05:04, João Domingos <joao.sousa.domingos at gmail.com> wrote:
> Ok. Almost there..
>
> So I did try both:
>
> - adding this on my script where I use the filter
> import sys
> sys.path.append('/opt/VTK/vtkPoissonReconstruction/build')
> from vtkPoissonReconstructionPython import *
>
> - and adding this at the end of sudo nano ~/.bashrc:
> export PYTHONPATH=$PYTHONPATH:/opt/VTK/vtkPoissonReconstruction/build
>
> With both I got the following error:
> ImportError: /opt/VTK/vtkPoissonReconstruction/build/vtkPoissonReconstructionPython.so:
> undefined symbol: _ZN13CoredMeshData12IN_CORE_FLAGE
>
> google couldn't help me on this.. What can it be?
>
> Many thanks again,
> Joao
>
>
>
>
>
> On 18 May 2012 20:27, David Gobbi <david.gobbi at gmail.com> wrote:
>> You need to tell Python where the module is:
>> http://docs.python.org/tutorial/modules.html#the-module-search-path
>>
>> On Fri, May 18, 2012 at 1:16 PM, João Domingos
>> <joao.sousa.domingos at gmail.com> wrote:
>>> Ok. Thank you. I will try to have a look into the filter.
>>>
>>> Regarding the import:
>>>
>>> from vtkPoissonReconstructionPython import *
>>> ImportError: No module named vtkPoissonReconstructionPython
>>>
>>> It is the same thing.. I must need to tell vtk where the folder with
>>> the filter is.. What do you think?
>>>
>>> Joao
-------------- next part --------------
cmake_minimum_required(VERSION 2.6)

PROJECT(PoissonReconstruction)

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

SET(LIB_NAME vtk${PROJECT_NAME})
SET(LIB_VTK_LIBS vtkRendering vtkImaging vtkHybrid)
SET(LIB_SRCS
  vtkPoissonReconstruction.cxx
)

SET(TEST_LIBS ${LIB_NAME})


SET(BUILD_PARAVIEW_PLUGIN OFF CACHE BOOL "Build Paraview plugin?")

if(BUILD_PARAVIEW_PLUGIN)
FIND_PACKAGE(ParaView REQUIRED)
INCLUDE(${PARAVIEW_USE_FILE})

INCLUDE_DIRECTORIES(${INCLUDE_DIRECTORIES} ../)

ADD_PARAVIEW_PLUGIN(PoissonReconstructionPlugin "1.0"
  SERVER_MANAGER_XML vtkPoissonReconstruction.xml
SERVER_MANAGER_SOURCES vtkPoissonReconstruction.cxx  
SERVER_SOURCES Factor.cpp Geometry.cpp MarchingCubes.cpp MultiGridOctest.cpp MultiGridOctreeData.cpp 
)

endif(BUILD_PARAVIEW_PLUGIN)

ADD_EXECUTABLE(PoissonReconstruction Example.cxx vtkPoissonReconstruction.cxx Factor.cpp Geometry.cpp MarchingCubes.cpp MultiGridOctest.cpp MultiGridOctreeData.cpp )
TARGET_LINK_LIBRARIES(PoissonReconstruction vtkHybrid)

ADD_TEST( PoissonReconstructionTest 
  ${PoissonReconstruction_BINARY_DIR}/PoissonReconstruction 
  ${PoissonReconstruction_SOURCE_DIR}/data/horsePoints.vtp
  5 
  temp.vtp 
)

INCLUDE( CTest )

# 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