View Issue Details Jump to Notes ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0014552VTK(No Category)public2014-01-31 09:282014-10-06 08:56
ReporterPaul Melis 
Assigned ToDavid Gobbi 
PriorityhighSeverityminorReproducibilityhave not tried
StatusclosedResolutionfixed 
PlatformOSOS Version
Product Version 
Target VersionFixed in Version6.2.0 
Summary0014552: VTK 6.1.0 configure doesn't check version of Python interpreter
DescriptionOn my (Arch Linux) machine 'python' defaults to Python 3.3. There's also 'python2' and 'python3' symlinks for the interpreters of the different versions:

[paulm@saralt0169:~]$ ls -l /usr/bin/python*
lrwxrwxrwx 1 root root 7 Sep 6 09:31 /usr/bin/python -> python3
lrwxrwxrwx 1 root root 9 Sep 6 09:56 /usr/bin/python2 -> python2.7
-rwxr-xr-x 1 root root 6240 Sep 6 09:56 /usr/bin/python2.7
-rwxr-xr-x 1 root root 1668 Sep 6 09:56 /usr/bin/python2.7-config
lrwxrwxrwx 1 root root 16 Sep 6 09:56 /usr/bin/python2-config -> python2.7-config
-rwxr-xr-x 1 root root 94 Aug 22 14:15 /usr/bin/python2-pyuic4
lrwxrwxrwx 1 root root 9 Sep 6 09:31 /usr/bin/python3 -> python3.3
-rwxr-xr-x 2 root root 10400 Sep 6 09:31 /usr/bin/python3.3
lrwxrwxrwx 1 root root 17 Sep 6 09:31 /usr/bin/python3.3-config -> python3.3m-config
-rwxr-xr-x 2 root root 10400 Sep 6 09:31 /usr/bin/python3.3m
-rwxr-xr-x 1 root root 1972 Sep 6 09:31 /usr/bin/python3.3m-config
lrwxrwxrwx 1 root root 16 Sep 6 09:31 /usr/bin/python3-config -> python3.3-config
lrwxrwxrwx 1 root root 14 Sep 6 09:31 /usr/bin/python-config -> python3-config


I'm configuring VTK 6.1.0 with the following options:

[paulm@saralt0169:~/c/vtk-6.1.0-release]$ cmake ../VTK-6.1.0/ \
    -DCMAKE_BUILD_TYPE=Release \
    -DCMAKE_INSTALL_PREFIX=/home/paulm/software/vtk-6.1.0 \
    -DVTK_Group_Web=ON -DVTK_Group_Qt=ON -DVTK_WRAP_PYTHON=ON
...
-- Check size of int - done
-- Check size of long
-- Check size of long - done
-- Check size of long long
-- Check size of long long - done
-- Configuring done
-- Generating done
-- Build files have been written to: /home/paulm/c/vtk-6.1.0-release


The used python configuration values are inconsistent, as the version of the python executable (3.3) is not checked against the version of the library found (2.7):

  
[paulm@saralt0169:~/c/vtk-6.1.0-release]$ grep python CMakeCache.txt
PYTHON_EXECUTABLE:FILEPATH=/usr/bin/python
//Extra libraries to link when linking to python (such as "z" for
PYTHON_INCLUDE_DIR:PATH=/usr/include/python2.7
PYTHON_LIBRARY:FILEPATH=/usr/lib64/libpython2.7.so
//Utility library needed for vtkpython
//Directory where python modules will be built
//Directory where python modules will be installed
VTK_INSTALL_PYTHON_MODULE_DIR:PATH=lib/python2.7/site-packages
vtkWebCore_LIB_DEPENDS:STATIC=general;vtkCommonCore;general;vtksys;general;vtkFiltersGeneral;general;/usr/lib64/libpython2.7.so;general;vtkIOCore;general;vtkIOImage;general;vtkRenderingCore;general;vtkParallelCore;general;vtkWebGLExporter;
vtkWrappingPythonCore_LIB_DEPENDS:STATIC=general;vtkCommonCore;general;/usr/lib64/libpython2.7.so;general;vtksys;
FIND_PACKAGE_MESSAGE_DETAILS_PythonInterp:INTERNAL=[/usr/bin/python][v3.3.2()]
FIND_PACKAGE_MESSAGE_DETAILS_PythonLibs:INTERNAL=[/usr/lib64/libpython2.7.so][/usr/include/python2.7][v()]
PYTHON_INCLUDE_PATH:INTERNAL=/usr/include/python2.7


Leading to syntax errors during building as the Python code uses version 2 syntax:


[paulm@saralt0169:~/c/vtk-6.1.0-release]$ make
Scanning dependencies of target VTKData
[ 0%] Built target VTKData
Scanning dependencies of target zope
[ 1%] Copying zope files
[ 1%] Compiling Python files
Listing '/home/paulm/c/vtk-6.1.0-release/Wrapping/Python/zope'...
Compiling '/home/paulm/c/vtk-6.1.0-release/Wrapping/Python/zope/__init__.py'...
Listing '/home/paulm/c/vtk-6.1.0-release/Wrapping/Python/zope/interface'...
Compiling '/home/paulm/c/vtk-6.1.0-release/Wrapping/Python/zope/interface/__init__.py'...
Compiling '/home/paulm/c/vtk-6.1.0-release/Wrapping/Python/zope/interface/_compat.py'...
Compiling '/home/paulm/c/vtk-6.1.0-release/Wrapping/Python/zope/interface/_flatten.py'...
Compiling '/home/paulm/c/vtk-6.1.0-release/Wrapping/Python/zope/interface/adapter.py'...
Compiling '/home/paulm/c/vtk-6.1.0-release/Wrapping/Python/zope/interface/advice.py'...
Listing '/home/paulm/c/vtk-6.1.0-release/Wrapping/Python/zope/interface/common'...
Compiling '/home/paulm/c/vtk-6.1.0-release/Wrapping/Python/zope/interface/common/__init__.py'...
Compiling '/home/paulm/c/vtk-6.1.0-release/Wrapping/Python/zope/interface/common/idatetime.py'...
Compiling '/home/paulm/c/vtk-6.1.0-release/Wrapping/Python/zope/interface/common/interfaces.py'...
Compiling '/home/paulm/c/vtk-6.1.0-release/Wrapping/Python/zope/interface/common/mapping.py'...
Compiling '/home/paulm/c/vtk-6.1.0-release/Wrapping/Python/zope/interface/common/sequence.py'...
Listing '/home/paulm/c/vtk-6.1.0-release/Wrapping/Python/zope/interface/common/tests'...
Compiling '/home/paulm/c/vtk-6.1.0-release/Wrapping/Python/zope/interface/common/tests/__init__.py'...
Compiling '/home/paulm/c/vtk-6.1.0-release/Wrapping/Python/zope/interface/common/tests/basemapping.py'...
Compiling '/home/paulm/c/vtk-6.1.0-release/Wrapping/Python/zope/interface/common/tests/test_idatetime.py'...
Compiling '/home/paulm/c/vtk-6.1.0-release/Wrapping/Python/zope/interface/tests/test_sorting.py'...
Compiling '/home/paulm/c/vtk-6.1.0-release/Wrapping/Python/zope/interface/tests/test_verify.py'...
Compiling '/home/paulm/c/vtk-6.1.0-release/Wrapping/Python/zope/interface/verify.py'...
[ 1%] Built target zope
Scanning dependencies of target Twisted
[ 1%] Copying Twisted files
[ 1%] Compiling Python files
Listing '/home/paulm/c/vtk-6.1.0-release/Wrapping/Python/twisted'...
Compiling '/home/paulm/c/vtk-6.1.0-release/Wrapping/Python/twisted/__init__.py'...
Compiling '/home/paulm/c/vtk-6.1.0-release/Wrapping/Python/twisted/_version.py'...
Listing '/home/paulm/c/vtk-6.1.0-release/Wrapping/Python/twisted/application'...
Compiling '/home/paulm/c/vtk-6.1.0-release/Wrapping/Python/twisted/application/__init__.py'...
Compiling '/home/paulm/c/vtk-6.1.0-release/Wrapping/Python/twisted/application/app.py'...
*** File "/home/paulm/c/vtk-6.1.0-release/Wrapping/Python/twisted/application/app.py", line 67
    except ImportError, e:
                      ^
SyntaxError: invalid syntax

Compiling '/home/paulm/c/vtk-6.1.0-release/Wrapping/Python/twisted/application/internet.py'...
Compiling '/home/paulm/c/vtk-6.1.0-release/Wrapping/Python/twisted/application/reactors.py'...
Compiling '/home/paulm/c/vtk-6.1.0-release/Wrapping/Python/twisted/application/service.py'...
Compiling '/home/paulm/c/vtk-6.1.0-release/Wrapping/Python/twisted/application/strports.py'...
Listing '/home/paulm/c/vtk-6.1.0-release/Wrapping/Python/twisted/conch/insults'...
....
Compiling '/home/paulm/c/vtk-6.1.0-release/Wrapping/Python/twisted/conch/insults/__init__.py'...
Compiling '/home/paulm/c/vtk-6.1.0-release/Wrapping/Python/twisted/conch/insults/client.py'...
*** File "/home/paulm/c/vtk-6.1.0-release/Wrapping/Python/twisted/conch/insults/client.py", line 127
    print command
                ^
SyntaxError: invalid syntax

Compiling '/home/paulm/c/vtk-6.1.0-release/Wrapping/Python/twisted/conch/insults/colors.py'...
Compiling '/home/paulm/c/vtk-6.1.0-release/Wrapping/Python/twisted/conch/insults/helper.py'...
*** File "/home/paulm/c/vtk-6.1.0-release/Wrapping/Python/twisted/conch/insults/helper.py", line 101
    exec '%s = object()' % (keyID,)
                       ^
SyntaxError: invalid syntax

Compiling '/home/paulm/c/vtk-6.1.0-release/Wrapping/Python/twisted/conch/insults/insults.py'...
TagsNo tags attached.
ProjectTBD
Typeincorrect functionality
Attached Files

 Relationships

  Notes
(0032304)
David Gobbi (developer)
2014-02-07 11:05

I'll look into this, because it will become an even more serious issue in the future as python3 becomes the default on more systems. The FindPythonInterp.cmake script is owned by cmake, rather than by VTK, so I'll have to test its capabilities for selecting a specific python version.
(0033487)
Ben Boeckel (Kitware) (developer)
2014-10-02 13:05

My recommendation is basically that CMake should treat Python2 and Python3 as different languages and support finding both at the same time (rather than the current interpreter/library split).
(0033502)
David Gobbi (developer)
2014-10-02 13:53

Finding both is good. Going further than than, e.g. wrapping both simultaneously as separate languages seems like a lot of work. It is something that only package maintainers would care about.

My first shot at this bug will simply warn if the Libs and Interp don't match. Later we can merge the find macros.
(0033562)
David Gobbi (developer)
2014-10-02 21:52

http://review.source.kitware.com/17488 [^]
(0033594)
David Gobbi (developer)
2014-10-06 08:56

commit 52a5b9778912aca4568004453507688e6b58e11d
Author: David Gobbi <david.gobbi@gmail.com>
Date: Thu Oct 2 19:40:12 2014 -0600
14552: Check python interp and lib versions.
Change-Id: I0c555c01deb7d6fa9a4f57d65ff5125463de7aef

 Issue History
Date Modified Username Field Change
2014-01-31 09:28 Paul Melis New Issue
2014-02-07 11:05 David Gobbi Note Added: 0032304
2014-02-07 11:05 David Gobbi Assigned To => David Gobbi
2014-02-07 11:05 David Gobbi Status backlog => active development
2014-10-02 13:05 Ben Boeckel (Kitware) Note Added: 0033487
2014-10-02 13:53 David Gobbi Note Added: 0033502
2014-10-02 21:52 David Gobbi Note Added: 0033562
2014-10-02 21:52 David Gobbi Status active development => gerrit review
2014-10-06 08:56 David Gobbi Note Added: 0033594
2014-10-06 08:56 David Gobbi Status gerrit review => closed
2014-10-06 08:56 David Gobbi Resolution open => fixed
2014-10-06 08:56 David Gobbi Fixed in Version => 6.2.0


Copyright © 2000 - 2018 MantisBT Team