[MacPorts] #16327: vtk5 5.0.3_0 +python build failure
#16327: vtk5 5.0.3_0 +python build failure ------------------------------+--------------------------------------------- Reporter: casbon@gmail.com | Owner: macports-tickets@lists.macosforge.org Type: defect | Status: new Priority: Normal | Milestone: Component: ports | Version: 1.6.0 Keywords: | ------------------------------+--------------------------------------------- vtk5 python variant fails to build. I got the port to build with these actions: 1. Edit the port file and set "-DBUILD_SHARED_LIBS:BOOL=ON" 2. in .../work/VTK/CMake/CMakeLists.txt add cmake_minimum_required(VERSION 2.6) at the top of the file 3. Add missing " in line 19 of .../work/VTK/Wrapping/Python/PythonInstall.cmake However, even then the build does not work: {{{ Python 2.5.2 (r252:60911, Jul 24 2008, 10:25:53) [GCC 4.0.1 (Apple Inc. build 5465)] on darwin Type "help", "copyright", "credits" or "license" for more information.
import vtk Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/opt/local/lib/python2.5/site-packages/vtk/__init__.py", line 29, in <module> from common import * File "/opt/local/lib/python2.5/site-packages/vtk/common.py", line 7, in <module> from libvtkCommonPython import * ImportError: dlopen(/opt/local/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5 /site-packages/vtk/libvtkCommonPython.so, 10): Library not loaded: libvtkCommonPythonD.5.0.dylib Referenced from: /opt/local/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5 /site-packages/vtk/libvtkCommonPython.so Reason: image not found }}}
-- Ticket URL: <http://trac.macports.org/ticket/16327> MacPorts <http://www.macports.org/> Ports system for Mac OS
#16327: vtk5 5.0.3_0 +python build failure -------------------------------+-------------------------------------------- Reporter: casbon@gmail.com | Owner: macports-tickets@lists.macosforge.org Type: defect | Status: new Priority: Normal | Milestone: Component: ports | Version: 1.6.0 Resolution: | Keywords: -------------------------------+-------------------------------------------- Comment (by casbon@gmail.com): I got slightly further with this: {{{ Flapjack:~ james$ export DYLD_LIBRARY_PATH=/opt/local/lib Flapjack:~ james$ python -c "import vtk" Traceback (most recent call last): File "<string>", line 1, in <module> File "/opt/local/lib/python2.5/site-packages/vtk/__init__.py", line 29, in <module> from common import * File "/opt/local/lib/python2.5/site-packages/vtk/common.py", line 7, in <module> from libvtkCommonPython import * ImportError: dlopen(/opt/local/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5 /site-packages/vtk/libvtkCommonPython.so, 10): Symbol not found: __cg_jpeg_resync_to_restart Referenced from: /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/ImageIO.framework/Versions/A/ImageIO Expected in: /opt/local/lib/libJPEG.dylib }}} but this thread suggests it is not a good idea: http://www.nabble.com/Re:--MacPorts---15891:-Undefined-symbols :-_xmlTextReaderSchemaValidate-_xmlTextReaderSchemaValidate- td18326514.html -- Ticket URL: <http://trac.macports.org/ticket/16327#comment:1> MacPorts <http://www.macports.org/> Ports system for Mac OS
#16327: vtk5 5.0.3_0 +python build failure -------------------------------+-------------------------------------------- Reporter: casbon@gmail.com | Owner: macports-tickets@lists.macosforge.org Type: defect | Status: new Priority: Normal | Milestone: Component: ports | Version: 1.6.0 Resolution: | Keywords: -------------------------------+-------------------------------------------- Comment (by casbon@gmail.com): It works if I cd to /opt/local/lib : {{{ Flapjack:lib james$ pwd /opt/local/lib Flapjack:lib james$ python -c 'import vtk' }}} but no combination of DYLD_LIBRARY_PATH, PYTHONPATH or PATH seems to replicate that behaviour -- Ticket URL: <http://trac.macports.org/ticket/16327#comment:2> MacPorts <http://www.macports.org/> Ports system for Mac OS
#16327: vtk5 5.0.3_0 +python build failure -------------------------------+-------------------------------------------- Reporter: casbon@gmail.com | Owner: rene.donner@mac.com Type: defect | Status: new Priority: Normal | Milestone: Port Bugs Component: ports | Version: 1.6.0 Resolution: | Keywords: -------------------------------+-------------------------------------------- Changes (by blb@macports.org): * owner: macports-tickets@lists.macosforge.org => rene.donner@mac.com * milestone: => Port Bugs Comment: Assigning to maintainer. -- Ticket URL: <http://trac.macports.org/ticket/16327#comment:3> MacPorts <http://www.macports.org/> Ports system for Mac OS
#16327: vtk5 5.0.3_0 +python build failure -------------------------------+-------------------------------------------- Reporter: casbon@gmail.com | Owner: rene.donner@mac.com Type: defect | Status: new Priority: Normal | Milestone: Port Bugs Component: ports | Version: 1.6.0 Resolution: | Keywords: Port: vtk5 | -------------------------------+-------------------------------------------- Changes (by macsforever2000@macports.org): * port: => vtk5 Comment: I too am unable to build vtk5 +python. This is with vtk version 5.2.0. Here is my error log: {{{ ---> Configuring vtk5 Error: Target org.macports.configure returned: shell command "cd /opt/local/var/macports/build/_opt_local_var_macports_sources_svn.macports.org_trunk_dports_graphics_vtk5/work/VTK && LDFLAGS=\"-L/opt/local/lib\" CPPFLAGS=\"-I/opt/local/include\" MACOSX_DEPLOYMENT_TARGET=10.5 cmake -DBUILD_SHARED_LIBS:BOOL=OFF -DCMAKE_LIBRARY_PATH:PATH=/opt/local/lib -DCMAKE_INCLUDE_PATH:PATH=/opt/local/include -DCMAKE_INSTALL_PREFIX:PATH=/opt/local -DCMAKE_INSTALL_NAME_DIR:STRING=/opt/local/lib -DCMAKE_EXE_LINKER_FLAGS:STRING=-rpath /opt/local/lib -DVTK_INSTALL_PREFIX:PATH=/opt/local -DVTK_USE_HYBRID:BOOL=ON -DVTK_USE_CARBON:BOOL=OFF -DVTK_WRAP_TCL:BOOL=ON -DVTK_USE_COCOA:BOOL=ON -DVTK_DATA_ROOT:PATH=/opt/local/share/VTKData -DVTK_TCL_LIBRARY_DIR:FILEPATH=/opt/local/lib/tcl8.4 -DVTK_REQUIRED_EXE_LINKER_FLAGS:STRING=-rpath /opt/local/lib -DPYTHON_DEBUG_LIBRARY:FILEPATH=/opt/local/lib/libpython2.5.dylib -DPYTHON_EXECUTABLE:FILEPATH=/opt/local/bin/python2.5 -DPYTHON_INCLUDE_PATH:FILEPATH=/opt/local/include/python2.5 -DPYTHON_LIBRARY:FILEPATH=/opt/local/lib/libpython2.5.dylib -DVTK_WRAP_PYTHON:BOOL=ON -DVTK_PYTHON_SETUP_ARGS:STRING=\"-- prefix=/opt/local --root=destroot /opt/local/var/macports/build/_opt_local_var_macports_sources_svn.macports.org_trunk_dports_graphics_vtk5/work/VTK" returned error 1 Command output: -- Check size of short -- Check size of short - failed -- Check size of float -- Check size of float - failed -- Check size of double -- Check size of double - failed -- Looking for include files CMAKE_HAVE_LIMITS_H -- Looking for include files CMAKE_HAVE_LIMITS_H - not found. -- Looking for include files CMAKE_HAVE_UNISTD_H -- Looking for include files CMAKE_HAVE_UNISTD_H - not found. -- Looking for include files CMAKE_HAVE_PTHREAD_H -- Looking for include files CMAKE_HAVE_PTHREAD_H - not found. -- Looking for include files CMAKE_HAVE_SYS_PRCTL_H -- Looking for include files CMAKE_HAVE_SYS_PRCTL_H - not found. -- Check if the system is big endian -- Searching 16 bit integer -- Check size of unsigned short -- Check size of unsigned short - failed -- Check size of unsigned int -- Check size of unsigned int - failed -- Check size of unsigned long -- Check size of unsigned long - failed CMake Error at /opt/local/share/cmake-2.6/Modules/TestBigEndian.cmake:31 (MESSAGE): no suitable type found Call Stack (most recent call first): CMake/CMakeBackwardCompatibilityC.cmake:31 (TEST_BIG_ENDIAN) CMakeLists.txt:357 (INCLUDE) -- Configuring done Error: Status 1 encountered during processing. }}} -- Ticket URL: <http://trac.macports.org/ticket/16327#comment:6> MacPorts <http://www.macports.org/> Ports system for Mac OS
#16327: vtk5 5.0.3_0 +python build failure -------------------------------+-------------------------------------------- Reporter: casbon@gmail.com | Owner: rene.donner@mac.com Type: defect | Status: new Priority: Normal | Milestone: Port Bugs Component: ports | Version: 1.6.0 Resolution: | Keywords: Port: vtk5 | -------------------------------+-------------------------------------------- Comment(by truemped@gmail.com): Hi, I have been able to build vtk with python using above instructions but I got the exact same error as mentioned above. I then found this: https://mail.enthought.com/pipermail/enthought- dev/2006-September/002706.html where they say that adding "-DVTK_USE_RPATH:BOOL=ON" will remove the "import" problem. Unfortunately I now get an error building "vtk5 +python": {{{ Linking CXX executable ../../bin/vtkpython ld: library not found for -lhistory collect2: ld returned 1 exit status make[2]: *** [bin/vtkpython] Error 1 make[1]: *** [Wrapping/Python/CMakeFiles/vtkpython.dir/all] Error 2 make: *** [all] Error 2 }}} Any idea? -- Ticket URL: <http://trac.macports.org/ticket/16327#comment:8> MacPorts <http://www.macports.org/> Ports system for Mac OS
#16327: vtk5 5.0.3_0 +python build failure -------------------------------+-------------------------------------------- Reporter: casbon@gmail.com | Owner: rene.donner@mac.com Type: defect | Status: new Priority: Normal | Milestone: Port Bugs Component: ports | Version: 1.6.0 Resolution: | Keywords: Port: vtk5 | -------------------------------+-------------------------------------------- Comment(by stromnov@gmail.com): Replying to [comment:8 truemped@…]:
{{{ Linking CXX executable ../../bin/vtkpython ld: library not found for -lhistory collect2: ld returned 1 exit status make[2]: *** [bin/vtkpython] Error 1 make[1]: *** [Wrapping/Python/CMakeFiles/vtkpython.dir/all] Error 2 make: *** [all] Error 2 }}}
Any idea?
-lhistory requires -L{prefix}/lib in make args -- Ticket URL: <http://trac.macports.org/ticket/16327#comment:9> MacPorts <http://www.macports.org/> Ports system for Mac OS
#16327: vtk5 5.0.3_0 +python build failure -------------------------------+-------------------------------------------- Reporter: casbon@gmail.com | Owner: rene.donner@mac.com Type: defect | Status: new Priority: Normal | Milestone: Port Bugs Component: ports | Version: 1.6.0 Resolution: | Keywords: Port: vtk5 | -------------------------------+-------------------------------------------- Changes (by blb@macports.org): * cc: truemped@gmail.com (added) Comment: Cc reporter of dup #17016. -- Ticket URL: <http://trac.macports.org/ticket/16327#comment:10> MacPorts <http://www.macports.org/> Ports system for Mac OS
#16327: vtk5 5.0.3_0 +python build failure -------------------------------+-------------------------------------------- Reporter: casbon@gmail.com | Owner: rene.donner@mac.com Type: defect | Status: new Priority: Normal | Milestone: Port Bugs Component: ports | Version: 1.6.0 Resolution: | Keywords: Port: vtk5 | -------------------------------+-------------------------------------------- Comment(by truemped@gmail.com): Replying to [comment:9 stromnov@…]:
-lhistory requires -L{prefix}/lib in make args In the portfile I find this:
{{{ configure.env LDFLAGS="-L${prefix}/lib"\ CPPFLAGS="-I${prefix}/include" }}} Which should be the same as you suggested, right? Or do I have to set it somewhere else again? -- Ticket URL: <http://trac.macports.org/ticket/16327#comment:11> MacPorts <http://www.macports.org/> Ports system for Mac OS
#16327: vtk5 5.0.3_0 +python build failure -------------------------------+-------------------------------------------- Reporter: casbon@gmail.com | Owner: rene.donner@mac.com Type: defect | Status: new Priority: Normal | Milestone: Port Bugs Component: ports | Version: 1.6.0 Resolution: | Keywords: Port: vtk5 | -------------------------------+-------------------------------------------- Comment(by stromnov@gmail.com): Replying to [comment:11 truemped@…]:
In the portfile I find this:
{{{ configure.env LDFLAGS="-L${prefix}/lib"\ CPPFLAGS="-I${prefix}/include" }}}
Which should be the same as you suggested, right? Or do I have to set it somewhere else again?
There are weird post-configure section: {{{ post-configure { reinplace "s|c++|c++ -L${prefix}/lib |" ${worksrcpath}/Infovis/Testing/Cxx/CMakeFiles/InfovisCxxTests.dir ... } }}} Needs similar line for python bindings files. -- Ticket URL: <http://trac.macports.org/ticket/16327#comment:12> MacPorts <http://www.macports.org/> Ports system for Mac OS
#16327: vtk5 5.0.3_0 +python build failure -------------------------------+-------------------------------------------- Reporter: casbon@gmail.com | Owner: rene.donner@mac.com Type: defect | Status: new Priority: Normal | Milestone: Port Bugs Component: ports | Version: 1.6.0 Resolution: | Keywords: Port: vtk5 | -------------------------------+-------------------------------------------- Comment(by truemped@gmail.com): Ok, to summarize my changes to the portfile so far: This is my 'variant' section: {{{ variant python { depends_build-append port:python25 configure.args-delete "-DBUILD_SHARED_LIBS:BOOL=OFF" configure.args-append -DBUILD_SHARED_LIBS:BOOL=ON \ -DPYTHON_DEBUG_LIBRARY:FILEPATH=${prefix}/lib/libpython2.5.dylib \ -DPYTHON_EXECUTABLE:FILEPATH=${prefix}/bin/python2.5 \ -DPYTHON_INCLUDE_PATH:FILEPATH=${prefix}/include/python2.5 \ -DPYTHON_LIBRARY:FILEPATH=${prefix}/lib/libpython2.5.dylib \ -DVTK_WRAP_PYTHON:BOOL=ON \ -DVTK_PYTHON_SETUP_ARGS:STRING="--prefix=${prefix} --root=${destdir} \ -DVTK_USE_RPATH:BOOL=ON \ -DVTK_USE_PARALLEL:BOOL=ON\ -DCMAKE_BUILD_WITH_INSTALL_PATH:BOOLL=ON } }}} This is my post-configure section: {{{ post-configure { reinplace "s|c++|c++ -L${prefix}/lib |" ${worksrcpath}/Infovis/Testing/Cxx/CMakeFiles/InfovisCxxTests.dir/link.txt \ ${worksrcpath}/IO/Testing/Cxx/CMakeFiles/IOCxxTests.dir/link.txt \ ${worksrcpath}/Views/Testing/Cxx/CMakeFiles/ViewsCxxTests.dir/link.txt \ ${worksrcpath}/Wrapping/Tcl/CMakeFiles/vtk.dir/link.txt \ ${worksrcpath}/Wrapping/Python/CMakeFiles/vtkpython.dir/link.txt } }}} I can now successfully build with "port install vtk5 +darwin_9 +python". Unfortunately there is no python package "vtk" anymore: {{{ $ python -c "import vtk" Traceback (most recent call last): File "<string>", line 1, in <module> ImportError: No module named vtk }}} Do you have another hint/idea? :) -- Ticket URL: <http://trac.macports.org/ticket/16327#comment:13> MacPorts <http://www.macports.org/> Ports system for Mac OS
#16327: vtk5 5.0.3_0 +python build failure -------------------------------+-------------------------------------------- Reporter: casbon@gmail.com | Owner: rene.donner@mac.com Type: defect | Status: new Priority: Normal | Milestone: Port Bugs Component: ports | Version: 1.6.0 Resolution: | Keywords: Port: vtk5 | -------------------------------+-------------------------------------------- Comment(by truemped@gmail.com): Another thing: after installing this all the libraries are stored in '''/opt/local/lib/vtk-5.2/''' rather than '''/opt/local/lib''' This basically leads to this: {{{ $ vtk dyld: Library not loaded: /opt/local/lib/libvtkCommonTCL.5.2.dylib Referenced from: /opt/local/bin/vtk Reason: image not found Trace/BPT trap }}} and: {{{ $ vtkpython dyld: Library not loaded: /opt/local/lib/libvtksys.5.2.dylib Referenced from: /opt/local/bin/vtkpython Reason: image not found Trace/BPT trap }}} hm... -- Ticket URL: <http://trac.macports.org/ticket/16327#comment:14> MacPorts <http://www.macports.org/> Ports system for Mac OS
#16327: vtk5 5.0.3_0 +python build failure -------------------------------+-------------------------------------------- Reporter: casbon@gmail.com | Owner: rene.donner@mac.com Type: defect | Status: new Priority: Normal | Milestone: Port Bugs Component: ports | Version: 1.6.0 Resolution: | Keywords: Port: vtk5 | -------------------------------+-------------------------------------------- Comment(by stromnov@gmail.com): There are another bug: during destroot phase python bindings installed DIRECTLY to /opt/local/lib/python... (instead of local destroot), causing troubles with uninstallation. -- Ticket URL: <http://trac.macports.org/ticket/16327#comment:15> MacPorts <http://www.macports.org/> Ports system for Mac OS
#16327: vtk5 5.0.3_0 +python build failure -------------------------------+-------------------------------------------- Reporter: casbon@gmail.com | Owner: rene.donner@mac.com Type: defect | Status: new Priority: Normal | Milestone: Port Bugs Component: ports | Version: 1.6.0 Resolution: | Keywords: Port: vtk5 | -------------------------------+-------------------------------------------- Comment(by truemped@gmail.com): Please note that I am using vtk5 5.2 Portfile which is the current. Replying to [comment:13 truemped@…]: I have nearly achived to install everything correctly. This is my (updated) 'variant' section: {{{ variant python { depends_build-append port:python25 configure.args-delete "-DBUILD_SHARED_LIBS:BOOL=OFF" configure.args-append -DBUILD_SHARED_LIBS:BOOL=ON \ -DPYTHON_DEBUG_LIBRARY:FILEPATH=${prefix}/lib/libpython2.5.dylib \ -DPYTHON_EXECUTABLE:FILEPATH=${prefix}/bin/python2.5 \ -DPYTHON_INCLUDE_PATH:FILEPATH=${prefix}/include/python2.5 \ -DPYTHON_LIBRARY:FILEPATH=${prefix}/lib/libpython2.5.dylib \ -DVTK_WRAP_PYTHON:BOOL=ON \ -DVTK_PYTHON_SETUP_ARGS:STRING="--prefix=${prefix} --root=${destdir} \ -DCMAKE_BUILD_WITH_INSTALL_PATH:BOOLL=ON } }}} '''port install vtk5 +darwin_9 +python'''
Unfortunately there is no python package "vtk" anymore:
{{{ $ python -c "import vtk" Traceback (most recent call last): File "<string>", line 1, in <module> ImportError: No module named vtk }}}
It turns out that if you use '''vtkpython''' and set '''DYLD_LIBRARY_PATH="/opt/local/lib/vtk-5.2/"''' Python finds the vtk package. BUT: If you want to use the '''wx''' part of VTK: {{{ $ DYLD_LIBRARY_PATH="/opt/local/lib/vtk-5.2/" vtkpython simpleWxScriptWithVTK.py This program needs access to the screen. Please run with 'pythonw', not 'python', and only when you are logged in on the main display of your Mac. }}} and: {{{ $ DYLD_LIBRARY_PATH="/opt/local/lib/vtk-5.2/" pythonw2.5 simpleWxScriptWithVTK.py Fatal Python error: Interpreter not initialized (version mismatch?) Abort trap }}} This seems to be some SWIG issue as far as gogol told me. Another problem is the fact that after I have built and installed vtk5 the '''vtk''' python package is not installed in the '''site-packages''' dir. This should have been done with '''${workdir}/Wrappers/Python/setup.py''' Anyone there who can help me? -- Ticket URL: <http://trac.macports.org/ticket/16327#comment:16> MacPorts <http://www.macports.org/> Ports system for Mac OS
#16327: vtk5 5.0.3_0 +python build failure -------------------------------+-------------------------------------------- Reporter: casbon@gmail.com | Owner: rene.donner@mac.com Type: defect | Status: new Priority: Normal | Milestone: Port Bugs Component: ports | Version: 1.6.0 Resolution: | Keywords: Port: vtk5 | -------------------------------+-------------------------------------------- Comment(by truemped@gmail.com): Replying to [comment:16 truemped@…]:
Another problem is the fact that after I have built and installed vtk5 the '''vtk''' python package is not installed in the '''site-packages''' dir. This should have been done with '''${workdir}/Wrappers/Python/setup.py''' Sorry, there is a '''VTK-5.2.0-py2.5.egg''' directory containing the '''vtk''' packge; so this issue is solved :)
-- Ticket URL: <http://trac.macports.org/ticket/16327#comment:17> MacPorts <http://www.macports.org/> Ports system for Mac OS
#16327: vtk5 5.0.3_0 +python build failure ------------------------------+--------------------------------------------- Reporter: casbon@… | Owner: macports-tickets@… Type: defect | Status: new Priority: Normal | Milestone: Port Bugs Component: ports | Version: 1.6.0 Keywords: | Port: vtk5 ------------------------------+--------------------------------------------- Changes (by blb@…): * owner: rene.donner@… => macports-tickets@… Comment: René no longer maintains vtk5, r44858. -- Ticket URL: <http://trac.macports.org/ticket/16327#comment:18> MacPorts <http://www.macports.org/> Ports system for Mac OS
#16327: vtk5 5.0.3_0 +python build failure -------------------------------+-------------------------------------------- Reporter: casbon@… | Owner: macports-tickets@… Type: defect | Status: closed Priority: Normal | Milestone: Port Bugs Component: ports | Version: 1.6.0 Resolution: fixed | Keywords: Port: vtk5 | -------------------------------+-------------------------------------------- Changes (by takeshi@…): * status: new => closed * resolution: => fixed Comment: I fixed this. Note I made +python default. -- Ticket URL: <http://trac.macports.org/ticket/16327#comment:19> MacPorts <http://www.macports.org/> Ports system for Mac OS
participants (1)
-
MacPorts