VTK 6.1.0 configure doesn't check version of Python interpreter
This issue was created automatically from an original Mantis Issue. Further discussion may take place here.
On 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'...