[vtkusers] VtK 7, python3.4 build error

David Gobbi david.gobbi at gmail.com
Mon Jan 4 12:57:48 EST 2016


Hi Matthew,

I downloaded the latest python 3.5 package from python.org this morning and
did a test build of VTK against it.  There weren't any problems with the
build (I tried with both cmake-2.8 and cmake-3.4, both of them worked).  It
found the following include dir and library:

PYTHON_INCLUDE_DIR:PATH=/Library/Frameworks/Python.framework/Versions/3.5/include/python3.5m
PYTHON_LIBRARY:FILEPATH=/Library/Frameworks/Python.framework/Versions/3.5/lib/libpython3.5m.dylib

Please let me know if you discover anything new.

 - David



On Sun, Jan 3, 2016 at 12:42 PM, David Gobbi <david.gobbi at gmail.com> wrote:

> Hi Matthew,
>
> Try pointing PYTHON_LIBRARY to libpython3.5m.dylib instead, and likewise
> point PYTHON_EXECUTABLE to python3.5m.
>
> The suffix (in this case "m") should be the same for the lib, the include
> dir, and the executable.  The three suffixes for python are "m" (pymalloc),
> "d" (pydebug), and "u" (wide unicode).  These suffixes reflect the build
> options for the python package.
>
> I did build VTK against python 3.5 on OS X a few months ago, when Python
> 3.5 was first released, and I did not encounter any problems.  I can do it
> again tomorrow with the latest package to see if anything has changed.
>
>  - David
>
>
> On Sun, Jan 3, 2016 at 12:24 PM, Matthew Cragun <mcragun at gmail.com> wrote:
>
>> David,
>>
>> thanks for the response.
>>
>> To provide some additional information, I have tried using python3.5
>> binaries straight off of python.org as wells as my anaconda
>> installation.  Both give me the same error.
>>
>> The variables I have set using ccmake and standard python are:
>>
>>
>> PYTHON_EXECUTABLE =
>> /Library/Frameworks/Python.framework/Versions/3.5/bin/python3.5
>> PYTHON_INCLUDE_DIR =
>> /Library/Frameworks/Python.framework/Versions/3.5/python3.5m
>> PYTHON_LIBRARY =
>> /Library/Frameworks/Python.framework/Versions/3.5/lib/libpython3.5.dylib
>>
>>
>> The contents of the lib folder are:
>> libformw.5.dylib    libmenuw.5.dylib    libncursesw.5.dylib
>> libpanelw.5.dylib   libpython3.5.dylib  pkgconfig
>> libformw.dylib      libmenuw.dylib      libncursesw.dylib
>> libpanelw.dylib     libpython3.5m.dylib python3.5
>>
>>
>> Thanks,
>>
>> Matt
>>
>> On Fri, Jan 1, 2016 at 11:19 PM, David Gobbi <david.gobbi at gmail.com>
>> wrote:
>>
>>> Hi Matthew,
>>>
>>> No, there aren't pre-build binaries with python 3.  I don't think that
>>> is planned for this release.
>>>
>>> I've been doing my OS X builds with the python binary packages from
>>> python.org, so I know that those, at least, should work.
>>>
>>> Can you give me some details about the python you are using?
>>> Specifically, can you tell me what the contents of the library directory (
>>> /Users/mcragun/anaconda/envs/py3k/lib/) are?
>>>
>>> Also, in the CMakeCache.txt, can you give me the values
>>> of PYTHON_EXECUTABLE, PYTHON_INCLUDE_DIR, and PYTHON_LIBRARY?
>>>
>>> For my build against the python.org binaries, VTK found the following:
>>>
>>>
>>> PYTHON_EXECUTABLE:FILEPATH=/Library/Frameworks/Python.framework/Versions/3.4/bin/python3.4
>>>
>>> PYTHON_INCLUDE_DIR:PATH=/Library/Frameworks/Python.framework/Versions/3.4/Headers/
>>>
>>> PYTHON_LIBRARY:FILEPATH=/Library/Frameworks/Python.framework/Versions/3.4/lib/libpython3.4.dylib
>>>
>>> Obviously the locations will be different for Anaconda, but I just
>>> wanted to give you an example of how these variables can be set.
>>>
>>>  - David
>>>
>>> On Fri, Jan 1, 2016 at 9:45 PM, Matthew Cragun <mcragun at gmail.com>
>>> wrote:
>>>
>>>> I am having trouble building VTK 7 with Python 3.4 on OS X 10.11 .
>>>> Everything goes well for the first 99% of the process, however at the end,
>>>> I get this error:
>>>>
>>>> [ 99%[ Building CXX object
>>>> Wrapping/Python/CMakeFiles/vtkpython.dir/vtkPythonAppInit.cxx.o
>>>> make[2]: *** No rule to make target
>>>> `/Users/mcragun/anaconda/envs/py3k/lib/libpython3.4.dylib', needed by
>>>> `bin/vtkpython'.  Stop.
>>>> make[2]: *** Waiting for unfinished jobs....
>>>> In file included from
>>>> /Users/mcragun/Projects/VTK/Wrapping/Python/vtkPythonAppInit.cxx:29:
>>>> /Users/mcragun/Projects/VTK-build/Wrapping/Python/vtkpythonmodules.h:119:3:
>>>> error: no matching function
>>>>       for call to 'PyImport_AppendInittab'
>>>>   PyImport_AppendInittab(namevtkCommonCore, initvtkCommonCorePython);
>>>>  ^~~~~~~~~~~~~~~~~~~~~~
>>>> /Users/mcragun/anaconda/envs/py3k/include/python3.4m/import.h:109:17:
>>>> note: candidate function not
>>>>       viable: no known conversion from 'void ()' to 'PyObject *(*)()'
>>>> for 2nd argument
>>>> PyAPI_FUNC(int) PyImport_AppendInittab(
>>>>                 ^
>>>> In file included from
>>>> /Users/mcragun/Projects/VTK/Wrapping/Python/vtkPythonAppInit.cxx:29:
>>>> /Users/mcragun/Projects/VTK-build/Wrapping/Python/vtkpythonmodules.h:122:3:
>>>> error: no matching function
>>>>       for call to 'PyImport_AppendInittab'
>>>>   PyImport_AppendInittab(namevtkCommonMath, initvtkCommonMathPython);
>>>>   ^~~~~~~~~~~~~~~~~~~~~~
>>>>
>>>> Similar errors are repeated until...
>>>>
>>>>   ^~~~~~~~~~~~~~~~~~~~~~
>>>> /Users/mcragun/anaconda/envs/py3k/include/python3.4m/import.h:109:17:
>>>> note: candidate function not
>>>>       viable: no known conversion from 'void ()' to 'PyObject *(*)()'
>>>> for 2nd argument
>>>> PyAPI_FUNC(int) PyImport_AppendInittab(
>>>>                 ^
>>>> fatal error: too many errors emitted, stopping now [-ferror-limit=]
>>>> 20 errors generated.
>>>> make[2]: ***
>>>> [Wrapping/Python/CMakeFiles/vtkpython.dir/vtkPythonAppInit.cxx.o] Error 1
>>>> make[1]: *** [Wrapping/Python/CMakeFiles/vtkpython.dir/all] Error 2
>>>> make: *** [all] Error 2
>>>>
>>>> Any thoughts on what I missed?  Are there pre-built binaries with
>>>> python 3 for OS X?
>>>>
>>>> Thanks,
>>>>
>>>> Matt
>>>>
>>>
>>>
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/vtkusers/attachments/20160104/bb959a39/attachment.html>


More information about the vtkusers mailing list