[vtk-developers] vtk-8.2.0-rc2 problem building wheels

Jean-Christophe Fillion-Robin jcfr at kitware.com
Tue Nov 27 19:02:14 EST 2018


Hi Prabhu,

> In the past what we did to build the wheels is provide a dummy
VTKPythonPackage/scripts/internal/libpython-not-needed-symbols-exported-by-interpreter
and passing that.  This somehow worked by tricking CMake into thinking
there was a library specified but I am not sure how the linker did not
complain.

This was done to ensure no library was strongly linking against python
library. And if it did, the error message would be more explicit. It was
working because the library was always weakly linked in older version of
VTK.


> Should I just ignore the libvtkPythonInterpreter and leave the
PYTHON_LIBRARY field blank?

It looks like introducing an option to conditionally build
vtkPythonInterpreter would address the issue here.

@Ben: What do you think ?

Jc







On Tue, Nov 27, 2018 at 3:01 PM Prabhu Ramachandran <prabhu at aero.iitb.ac.in>
wrote:

> Hi all,
>
> Here is hopefully the last of the issues I am running into, I just tried
> to create wheels for 8.2.0-rc2 and have the following problem.
>
> First for some background.  Some of the VTK Python libraries seem to link
> to the PYTHON_LIBRARY, for the wheels, we do not do this.  JC pointed this
> out to me https://www.python.org/dev/peps/pep-0513/#libpythonx-y-so-1
>
> Basically, if we build wheels linking to the libpython* the wheel may not
> work on Ubuntu/Debian which would be sad.
>
> In the past what we did to build the wheels is provide a dummy
> VTKPythonPackage/scripts/internal/libpython-not-needed-symbols-exported-by-interpreter
> and passing that.  This somehow worked by tricking CMake into thinking
> there was a library specified but I am not sure how the linker did not
> complain.  Anyway, when I try to build the wheels now on MacOS I get this
> error:
>
> Linking CXX shared library...ib/libvtkPythonInterpreter-8.2.1.dylib
> FAILED: lib/libvtkPythonInterpreter-8.2.1.dylib
> : && /Library/Developer/CommandLineTools/usr/bin/c++ -O3 -DNDEBUG -arch
> x86_64 -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX10.14.sdk
> -mmacosx-version-min=10.9 -dynamiclib -Wl,-headerpad_max_install_names
> -undefined dynamic_lookup  -compatibility_version 1.0.0 -current_version
> 1.0.0 -o lib/libvtkPythonInterpreter-8.2.1.dylib -install_name
> @rpath/libvtkPythonInterpreter-8.2.1.dylib
> Utilities/PythonInterpreter/CMakeFiles/vtkPythonInterpreter.dir/vtkPythonInterpreter.cxx.o
> Utilities/PythonInterpreter/CMakeFiles/vtkPythonInterpreter.dir/vtkPythonInteractiveInterpreter.cxx.o
> -Wl,-rpath,VTKPythonPackage/VTK-osx_3.7/lib
> VTKPythonPackage/scripts/internal/libpython-not-needed-symbols-exported-by-interpreter
> lib/libvtksys-8.2.1.dylib lib/libvtkCommon-8.2.1.dylib && :
> ld: file too small (length=0) file
> 'VTKPythonPackage/scripts/internal/libpython-not-needed-symbols-exported-by-interpreter'
> for architecture x86_64
> clang: error: linker command failed with exit code 1 (use -v to see
> invocation)
>
>
> Right now, I am able to build wheels only by leaving the PYTHON_LIBRARY
> entry blank.  This means that the libvtkPythonInterpreter-8.2.1.dylib does
> indeed link to the libpythonx.y.dylib.
>
> However, I do notice that the other libvtk*Python*8.2.1.dylib do not link
> to libpython.  So libvtkPythonInterpreter is the only one linking to
> libpython. So I think maybe if a user never uses the
> libvtkPythonInterpreter or if that is never explicitly imported or linked
> to in any Python code, we may be fine with these wheels.  Also I see that
> none of the Python extension modules, i.e. all the vtk*Python.so do not
> link to libpython or to libvtkPythonInterpreter.
>
> Should I just ignore the libvtkPythonInterpreter and leave the
> PYTHON_LIBRARY field blank?
>
> I would appreciate your thoughts on this matter. Thanks!
>
> cheers,
>
> Prabhu
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://public.kitware.com/pipermail/vtk-developers/attachments/20181127/f71845ca/attachment.html>


More information about the vtk-developers mailing list