Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 401839 - sci-libs/vtk-5.8.0: build process auto-selects newer Python than specified (via FindPythonLibs.cmake)
Summary: sci-libs/vtk-5.8.0: build process auto-selects newer Python than specified (v...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Library (show other bugs)
Hardware: All Linux
: Normal normal
Assignee: Justin Lecher (RETIRED)
URL:
Whiteboard:
Keywords: PATCH
Depends on:
Blocks:
 
Reported: 2012-02-01 19:01 UTC by JTRiley
Modified: 2012-02-10 18:56 UTC (History)
2 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
build.log for vtk-5.8.0 Python-related failure (build.log,150.78 KB, text/plain)
2012-02-01 19:03 UTC, JTRiley
Details
patch for vtk 5.8.0 ebuild that fixes this bug (vtk-5.8.0-python.patch,474 bytes, patch)
2012-02-01 20:05 UTC, JTRiley
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description JTRiley 2012-02-01 19:01:12 UTC
When building vtk-5.8.0 I received the following error:

In file included from /var/tmp/portage/sci-libs/vtk-5.8.0/work/VTK/Wrapping/Python/vtkPythonOverload.h:28:0,
                 from /var/tmp/portage/sci-libs/vtk-5.8.0/work/VTK/Wrapping/Python/vtkPythonOverload.cxx:26:
/var/tmp/portage/sci-libs/vtk-5.8.0/work/VTK/Wrapping/Python/vtkPython.h:93:2: error: #error "Python.h is different version from what VTK was configured with!!"
In file included from /var/tmp/portage/sci-libs/vtk-5.8.0/work/VTK/Wrapping/Python/vtkPythonUtil.h:18:0,
                 from /var/tmp/portage/sci-libs/vtk-5.8.0/work/VTK/Wrapping/Python/vtkPythonArgs.h:27,
                 from /var/tmp/portage/sci-libs/vtk-5.8.0/work/VTK/Wrapping/Python/vtkPythonArgs.cxx:24:
/var/tmp/portage/sci-libs/vtk-5.8.0/work/VTK/Wrapping/Python/vtkPython.h:93:2: error: #error "Python.h is different version from what VTK was configured with!!"

This is caused by FindPythonLibs.cmake auto-detecting a newer Python even though an older Python is the active Gentoo version. The ebuild passes the correct version active version (2.6 in my case) when configuring, however, the config process auto-selects a different version (2.7 in my case) which causes the above build error.

Hopefully the relevant Python build variables can be configured manually using cmake rather than relying on FindPythonLibs to get things right (which it doesnt...). I'm working on a patch now. will submit to my overlay if I figure it out...

Reproducible: Always

Steps to Reproduce:
1. Select Python2.6 as active Python version
2. Install newer Python version but do not activate (Python2.7, Python3, etc)
3. emerge -va vtk
Comment 1 JTRiley 2012-02-01 19:03:09 UTC
Created attachment 300707 [details]
build.log for vtk-5.8.0 Python-related failure
Comment 2 JTRiley 2012-02-01 20:05:22 UTC
Created attachment 300715 [details, diff]
patch for vtk 5.8.0 ebuild that fixes this bug

Full patched ebuild available in my overlay:

http://git.overlays.gentoo.org/gitweb/?p=user/jtriley.git
Comment 3 Justin Lecher (RETIRED) gentoo-dev 2012-02-02 17:30:34 UTC
Thanks for the patch,
I will test it. But inclusion might be delayed because of fosdem.
Comment 4 JTRiley 2012-02-02 19:05:43 UTC
No problem, hope you're having fun :D
Comment 5 Justin Lecher (RETIRED) gentoo-dev 2012-02-07 21:10:27 UTC
mmh, it seems to be already included in the ebuild:


  if use python; then
      mycmakeargs+=(
         -DVTK_WRAP_PYTHON=ON
         -DVTK_WRAP_PYTHON_SIP=ON
         -DSIP_PYQT_DIR="${EPREFIX}/usr/share/sip"
         -DSIP_INCLUDE_DIR="${EPREFIX}$(python_get_includedir)"
         -DVTK_PYTHON_INCLUDE_DIR="${EPREFIX}"$(python_get_includedir)
         -DVTK_PYTHON_LIBRARY="${EPREFIX}$(python_get_library)"
         -DVTK_PYTHON_SETUP_ARGS:STRING=--root="${D}")
  fi

And your overlay seems down :(

But I can reproduce the error
Comment 6 JTRiley 2012-02-08 22:28:46 UTC
(In reply to comment #5)
> mmh, it seems to be already included in the ebuild:
Not quite, my ebuild patch (attached to this bug) adds PYTHON_INCLUDE_DIR and PYTHON_LIBRARY (no prefixes) which seems to fix the problem for me.

> And your overlay seems down :(
Weird, it's hosted on git.overlays.gentoo.org. I just checked and it's up now but in case you have issues here's my github mirror:

https://github.com/jtriley/jtriley-overlay
Comment 7 Justin Lecher (RETIRED) gentoo-dev 2012-02-09 06:54:53 UTC
(In reply to comment #6)
> (In reply to comment #5)
> > mmh, it seems to be already included in the ebuild:
> Not quite, my ebuild patch (attached to this bug) adds PYTHON_INCLUDE_DIR and
> PYTHON_LIBRARY (no prefixes) which seems to fix the problem for me.

ah, I didn't test the EPREFIX removal. Will do that tonight.

> 
> > And your overlay seems down :(
> Weird, it's hosted on git.overlays.gentoo.org. I just checked and it's up now
> but in case you have issues here's my github mirror:
> 
> https://github.com/jtriley/jtriley-overlay

g.o.g.o was done, sorry for the noise.
Comment 8 JTRiley 2012-02-09 21:06:18 UTC
> ah, I didn't test the EPREFIX removal. Will do that tonight.

I didn't remove EPREFIX I meant that I'm passing PYTHON_INCLUDE_DIR and PYTHON_LIBRARY (ie *not* VTK_PYTHON_INCLUDE_DIR, etc) to mycmake args. Have a look at the ebuild patch attached to this bug - specifically these lines are being added to mycmakeargs:

+			-DPYTHON_INCLUDE_DIR="${EPREFIX}"$(python_get_includedir)
+			-DPYTHON_LIBRARY="${EPREFIX}$(python_get_library)"

From my limited testing this fixes the problem.

HTH

~jtriley
Comment 9 Justin Lecher (RETIRED) gentoo-dev 2012-02-10 07:12:32 UTC
Yeah I tested it yesterday and it worked fine. But  forgot to commit it :(
Comment 10 Justin Lecher (RETIRED) gentoo-dev 2012-02-10 18:56:08 UTC
+  10 Feb 2012; Justin Lecher <jlec@gentoo.org> -vtk-5.4.2-r1.ebuild,
+  -vtk-5.6.0-r2.ebuild, -vtk-5.6.0-r3.ebuild, vtk-5.6.1.ebuild,
+  vtk-5.8.0.ebuild:
+  Use selected python ABI, #401839, patch by JTRiley; dropped old
+