[vtkusers] Building latest VTK with Python Wrapping

Michka Popoff michkapopoff at gmail.com
Thu Apr 25 08:53:48 EDT 2013


I did some more tests to be sure (Same computer, redownloaded files, built the tests 4 different empty folders) :

VTK5.10.1
- BUILD_SHARED_LIBS : ON
- VTK_WRAP_PYTHON : OFF
make : works

VTK5.10.1
- BUILD_SHARED_LIBS : ON
- VTK_WRAP_PYTHON : ON
- PYTHON_EXECUTABLE : /usr/local/bin/python2.7
make : works

VTK-master
- BUILD_SHARED_LIBS : ON
- VTK_WRAP_PYTHON : OFF
make : works

VTK-master
- BUILD_SHARED_LIBS : ON
- VTK_WRAP_PYTHON : ON
- PYTHON_EXECUTABLE : /usr/local/bin/python2.7
make : error

So the error is coming from the python wrapping. I just read a discussion you had some time ago : http://www.vtk.org/pipermail/vtk-developers/2012-June/011849.html
I tried putting -fPIC for CMAKE_CXX_FLAGS and CMAKE_C_FLAGS but I still get the error message.

I understand there is a problem with static/shared libs linking,  but my knowledge about these things is quite limited. I don't exactly know where/what to look to find out where the problem is.


Le 24 avr. 2013 à 15:59, Michka Popoff a écrit :

> Yes
> 
> That's why I was wondering why it was not working with VTK-devel.
> 
> Le 24 avr. 2013 à 15:50, David Gobbi a écrit :
> 
>> This behaviour hasn't changed, as far as I know.  When you said that
>> you built VTK 5.10.1 successfully, do you mean you did it with this
>> exact same copy of python that doesn't work with VTK-devel?
>> 
>> 
>> On Wed, Apr 24, 2013 at 7:43 AM, Michka Popoff <michkapopoff at gmail.com> wrote:
>>> Hi
>>> 
>>> I followed the normal procedure (http://docs.python.org/2/using/unix.html#building-python) :
>>> 
>>> ./configure
>>> make
>>> make altinstall
>>> 
>>> Should I use ./configure --enable-shared ? If so, why has the behavior changed since 5.10.1 ?
>>> 
>>> Michka
>>> 
>>> 
>>> 
>>> Le 24 avr. 2013 à 15:29, David Gobbi a écrit :
>>> 
>>>> Hi Michka,
>>>> 
>>>> Did you use --enable-shared when you built python?
>>>> 
>>>> - David
>>>> 
>>>> On Wed, Apr 24, 2013 at 5:10 AM, Michka Popoff <michkapopoff at gmail.com> wrote:
>>>>> Hi
>>>>> 
>>>>> I want to install the latest VTK with Python wrapping. I was able to install and use the 5.10.1 without problems, but now I want to try the latest development version. The make command gets stuck at 47% :
>>>>> 
>>>>> Scanning dependencies of target vtkWrappingPythonCore
>>>>> [ 47%] Building CXX object Wrapping/PythonCore/CMakeFiles/vtkWrappingPythonCore.dir/vtkPythonArgs.cxx.o
>>>>> [ 47%] Building CXX object Wrapping/PythonCore/CMakeFiles/vtkWrappingPythonCore.dir/vtkPythonCommand.cxx.o
>>>>> [ 47%] Building CXX object Wrapping/PythonCore/CMakeFiles/vtkWrappingPythonCore.dir/vtkPythonOverload.cxx.o
>>>>> [ 47%] Building CXX object Wrapping/PythonCore/CMakeFiles/vtkWrappingPythonCore.dir/vtkPythonUtil.cxx.o
>>>>> [ 47%] Building CXX object Wrapping/PythonCore/CMakeFiles/vtkWrappingPythonCore.dir/PyVTKClass.cxx.o
>>>>> [ 47%] Building CXX object Wrapping/PythonCore/CMakeFiles/vtkWrappingPythonCore.dir/PyVTKMutableObject.cxx.o
>>>>> [ 47%] Building CXX object Wrapping/PythonCore/CMakeFiles/vtkWrappingPythonCore.dir/PyVTKObject.cxx.o
>>>>> [ 47%] Building CXX object Wrapping/PythonCore/CMakeFiles/vtkWrappingPythonCore.dir/PyVTKSpecialObject.cxx.o
>>>>> [ 47%] Building CXX object Wrapping/PythonCore/CMakeFiles/vtkWrappingPythonCore.dir/PyVTKTemplate.cxx.o
>>>>> Linking CXX shared library ../../lib/libvtkWrappingPython27Core-6.0.so
>>>>> /usr/bin/ld: /usr/local/lib/libpython2.7.a(abstract.o): relocation R_X86_64_32 against `.rodata.str1.8' can not be used when making a shared object; recompile with -fPIC
>>>>> /usr/local/lib/libpython2.7.a: could not read symbols: Bad value
>>>>> collect2: ld a retourné 1 code d'état d'exécution
>>>>> make[2]: *** [lib/libvtkWrappingPython27Core-6.0.so.1] Erreur 1
>>>>> make[1]: *** [Wrapping/PythonCore/CMakeFiles/vtkWrappingPythonCore.dir/all] Erreur 2
>>>>> make: *** [all] Erreur 2
>>>>> 
>>>>> 
>>>>> Does someone have an idea why I got this problem ? My python installation was made from source (python 2.7) with make altinstall (I had to specify the python library path manually in cmake). The Shared Library option is set to ON. What is this -fPIC options and where can/should I use it.
>>>>> 
>>>>> Thanks in advance
>>>>> 
>>>>> Michka Popoff
>>> 
> 
> _______________________________________________
> Powered by www.kitware.com
> 
> Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html
> 
> Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ
> 
> Follow this link to subscribe/unsubscribe:
> http://www.vtk.org/mailman/listinfo/vtkusers




More information about the vtkusers mailing list