View Issue Details Jump to Notes ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0002227VTK(No Category)public2005-09-13 14:362016-08-12 09:54
ReporterMathieu Malaterre 
Assigned ToBrad King 
PrioritylowSeverityminorReproducibilityalways
StatusclosedResolutionmoved 
PlatformOSOS Version
Product Version 
Target VersionFixed in Version 
Summary0002227: Cannot build VTK/Python on gentoo/AMD64
DescriptionI cannot build VTK on gentoo/AMD64. The build fails with:

Linking CXX executable bin/pvtkpython
/usr/lib64/python2.3/config/libpython2.3.a(posixmodule.o)(.text+0x3725): In function `posix_tmpnam':
: warning: the use of `tmpnam_r' is dangerous, better use `mkstemp'
/usr/lib64/python2.3/config/libpython2.3.a(posixmodule.o)(.text+0x3670): In function `posix_tempnam':
: warning: the use of `tempnam' is dangerous, better use `mkstemp'
/usr/lib64/python2.3/config/libpython2.3.a(zlibmodule.o)(.text+0x19f): In function `PyZlib_compress':
: undefined reference to `deflateInit_'
/usr/lib64/python2.3/config/libpython2.3.a(zlibmodule.o)(.text+0x1c1): In function `PyZlib_compress':
: undefined reference to `deflateEnd'
...
TagsNo tags attached.
Project
Type
Attached Filespatch file icon python.patch [^] (829 bytes) 1969-12-31 19:00 [Show Content]

 Relationships

  Notes
(0003013)
Mathieu Malaterre (developer)
2005-09-13 14:37

attaching proposed patch
(0003014)
Brad King (developer)
2005-09-13 14:51

This might actually be a CMake-related issue. It looks like PYTHON_LIBRARY should be set to

"/usr/lib64/python2.3/config/libpython2.3.a;-lz"

since linking to python requires linking to zlib.

There is a similar situation with TCL_LIBRARY and -lm. See this code in VTK/CMakeLists.txt:

  INCLUDE(${CMAKE_ROOT}/Modules/FindTCL.cmake)
  SET(VTK_TCL_LIBRARIES ${TCL_LIBRARY})
  IF(UNIX)
    # The tcl library needs the math library on unix.
    SET(VTK_TCL_LIBRARIES ${VTK_TCL_LIBRARIES} m)
  ENDIF(UNIX)

The FindTCL.cmake module should provide a variable like

TCL_LIBRARIES

that gets set to ${TCL_LIBRARY} plus whatever other libraries are needed. Similarly for FindPython.cmake.
(0003023)
Brad King (developer)
2005-09-14 18:34

I've added a new PYTHON_EXTRA_LIBS variable:

/cvsroot/VTK/VTK/CMakeLists.txt,v <-- CMakeLists.txt
new revision: 1.343; previous revision: 1.342

It can be set to "z" on this platform to get proper linking. We cannot just always link to "z" as we do to "m" in the Tcl case because not all platforms will have zlib. Eventually this should be put in CMake's FindPython.cmake module.
(0003024)
Brad King (developer)
2005-09-14 18:37

I've added the CMake changes to my to-do list so I'm closing this bug now.
(0003025)
Brad King (developer)
2005-09-15 09:27

The previous fix added a major bug which this fix fixes:

/cvsroot/VTK/VTK/CMakeLists.txt,v <-- CMakeLists.txt
new revision: 1.344; previous revision: 1.343
(0003033)
Mathieu Malaterre (developer)
2005-09-19 17:09

Reopen as this bug now fully depend on bug #2257, which should provide a better solution (ie. proposed solution still break paraview builds).
(0011744)
Marcus Hanwell (old account) (developer)
2008-05-07 23:00

Just to add that this bug still seems to be affecting CMake. I work on Avogadro where we would like to use FindPythonLibs.cmake to find and link against Python. I develop on Gentoo and get the same failure as mentioned although it is now with Python 2.5. This is with the recently released CMake 2.6.0. If there is an alternate method of finding/linking to libpython on a 64 bit OS I would love to know. Otherwise workaround/patches would be very welcome.

Avogadro is a sourceforge hosted project that is also used by Kalzium in KDE 4 and so we need a nice, cross platform solution for both projects. Thanks.
(0011815)
Brad King (developer)
2008-05-12 10:51

The full fix for this bug is to detect from the python installation the dependendent libraries needed when linking to python. One proposed fix in bug #2257 is to run the python interpreter to ask distutils.sysconfig where the python libs are installed. That fix could be extended for this bug by asking it what dependent libraries are needed. However, this solution will not work when the python interpreter is not installed or when it is for an architecture different from the host platform during cross compiling.
(0011816)
Brad King (developer)
2008-05-12 10:53

Another proposed fix in bug #2257 is to use the "python-config" tool (or perhaps pkg-config) when it is available. That would probably be a better fix for this bug too.
(0011818)
Brad King (developer)
2008-05-12 11:19

Unfortunately it looks like the python-config script just runs the interpreter internally, and python does not come with a pkg-config specification file.
(0036798)
Kitware Robot (administrator)
2016-08-12 09:54

Resolving issue as `moved`.

This issue tracker is no longer used. Further discussion of this issue may take place in the current VTK Issues page linked in the banner at the top of this page.

 Issue History
Date Modified Username Field Change
2008-05-07 23:00 Marcus Hanwell (old account) Note Added: 0011744
2008-05-12 10:51 Brad King Note Added: 0011815
2008-05-12 10:53 Brad King Note Added: 0011816
2008-05-12 11:19 Brad King Note Added: 0011818
2011-06-16 13:11 Zack Galbreath Category => (No Category)
2016-08-12 09:54 Kitware Robot Note Added: 0036798
2016-08-12 09:54 Kitware Robot Status expired => closed
2016-08-12 09:54 Kitware Robot Resolution reopened => moved


Copyright © 2000 - 2018 MantisBT Team