Quantcast

Building VTK 7.1.1 with Python wrapping fail

classic Classic list List threaded Threaded
15 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Building VTK 7.1.1 with Python wrapping fail

Timothee Evain
Hello everyone!

I'm trying to build VTK 7.1.1 with the Python wrapping with Visual studio 2017 on Win10. Everything goes fine until the end of the build, where a bunch of error appears in the vtkpython project like :

vtkPythonAppInit.cxx
...\VTK_7.1.1\Wrapping\Python\vtkpythonmodules.h(126): error C2664: 'int PyImport_AppendInittab(const char *,PyObject *(__cdecl *)(void))': cannot convert argument 2 from 'void (__cdecl *)(void)' to 'PyObject *(__cdecl *)(void)'
...\VTK_7.1.1\Wrapping\Python\vtkpythonmodules.h(126): note: None of the functions with this name in scope match the target type
...\VTK_7.1.1\Wrapping\Python\vtkpythonmodules.h(129): error C2664: 'int PyImport_AppendInittab(const char *,PyObject *(__cdecl *)(void))': cannot convert argument 2 from 'void (__cdecl *)(void)' to 'PyObject *(__cdecl *)(void)'
...\VTK_7.1.1\Wrapping\Python\vtkpythonmodules.h(129): note: None of the functions with this name in scope match the target type

and so on. The only similar error in the mailing list is http://vtk.1045678.n5.nabble.com/VtK-7-python3-4-build-error-td5735728.html ; but that doesn't help me since my python path are correctly set.

The building config is :
Windows 10 x64
Visual Studio 2017
Python 3.6.1 (installed from python.org exe)
VTK 7.1.1 with :
-PYTHON_DEBUG_LIBRARY C:/Program Files/Python_3.6.1/libs/python36_d.lib
-PYTHON_EXECUTABLE C:/Program Files/Python_3.6.1/python.exe
-PYTHON_INCLUDE_DIR C:/Program Files/Python_3.6.1/include
-PYTHON_LIBRARY C:/Program Files/Python_3.6.1/libs/python36.lib
(-Static libraries)

Anyone have already encountered such problems and solved it ?

Thanks in advance.

Tim
_______________________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ

Search the list archives at: http://markmail.org/search/?q=vtkusers

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/vtkusers
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Building VTK 7.1.1 with Python wrapping fail

David Gobbi
Hi Tim,

I haven't seen this error message before, but my guess is that building the Python wrappers with static linkage does not work with Python 3.  I'm not sure how difficult this is to fix.  It might be as simple as adding a couple #ifdefs to the code (to the VTK code, I mean.).

 - David


On Mon, May 1, 2017 at 12:26 PM, Timothee Evain <[hidden email]> wrote:
Hello everyone!

I'm trying to build VTK 7.1.1 with the Python wrapping with Visual studio 2017 on Win10. Everything goes fine until the end of the build, where a bunch of error appears in the vtkpython project like :

vtkPythonAppInit.cxx
...\VTK_7.1.1\Wrapping\Python\vtkpythonmodules.h(126): error C2664: 'int PyImport_AppendInittab(const char *,PyObject *(__cdecl *)(void))': cannot convert argument 2 from 'void (__cdecl *)(void)' to 'PyObject *(__cdecl *)(void)'
...\VTK_7.1.1\Wrapping\Python\vtkpythonmodules.h(126): note: None of the functions with this name in scope match the target type
...\VTK_7.1.1\Wrapping\Python\vtkpythonmodules.h(129): error C2664: 'int PyImport_AppendInittab(const char *,PyObject *(__cdecl *)(void))': cannot convert argument 2 from 'void (__cdecl *)(void)' to 'PyObject *(__cdecl *)(void)'
...\VTK_7.1.1\Wrapping\Python\vtkpythonmodules.h(129): note: None of the functions with this name in scope match the target type

and so on. The only similar error in the mailing list is http://vtk.1045678.n5.nabble.com/VtK-7-python3-4-build-error-td5735728.html ; but that doesn't help me since my python path are correctly set.

The building config is :
Windows 10 x64
Visual Studio 2017
Python 3.6.1 (installed from python.org exe)
VTK 7.1.1 with :
-PYTHON_DEBUG_LIBRARY C:/Program Files/Python_3.6.1/libs/python36_d.lib
-PYTHON_EXECUTABLE C:/Program Files/Python_3.6.1/python.exe
-PYTHON_INCLUDE_DIR C:/Program Files/Python_3.6.1/include
-PYTHON_LIBRARY C:/Program Files/Python_3.6.1/libs/python36.lib
(-Static libraries)

Anyone have already encountered such problems and solved it ?

Thanks in advance.

Tim

_______________________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ

Search the list archives at: http://markmail.org/search/?q=vtkusers

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/vtkusers
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Building VTK 7.1.1 with Python wrapping fail

David Gobbi
Hi Tim,

As a temporary work-around, you can try modifying the VTK code yourself.  In the VTK/CMake directory, there is a file called vtkPythonWrapping.cmake.  The following line (around line 195) is where the problem is:

      set (EXTERN_DEFINES "${EXTERN_DEFINES}\n  extern void init${module}Python();")

Try changing the "void" to "PyObject *":

      set (EXTERN_DEFINES "${EXTERN_DEFINES}\n  extern PyObject *init${module}Python();")

Let me know if that fixes the compile error.

 - David

On Mon, May 1, 2017 at 1:24 PM, David Gobbi <[hidden email]> wrote:
Hi Tim,

I haven't seen this error message before, but my guess is that building the Python wrappers with static linkage does not work with Python 3.  I'm not sure how difficult this is to fix.  It might be as simple as adding a couple #ifdefs to the code (to the VTK code, I mean.).

 - David


On Mon, May 1, 2017 at 12:26 PM, Timothee Evain <[hidden email]> wrote:
Hello everyone!

I'm trying to build VTK 7.1.1 with the Python wrapping with Visual studio 2017 on Win10. Everything goes fine until the end of the build, where a bunch of error appears in the vtkpython project like :

vtkPythonAppInit.cxx
...\VTK_7.1.1\Wrapping\Python\vtkpythonmodules.h(126): error C2664: 'int PyImport_AppendInittab(const char *,PyObject *(__cdecl *)(void))': cannot convert argument 2 from 'void (__cdecl *)(void)' to 'PyObject *(__cdecl *)(void)'
...\VTK_7.1.1\Wrapping\Python\vtkpythonmodules.h(126): note: None of the functions with this name in scope match the target type
...\VTK_7.1.1\Wrapping\Python\vtkpythonmodules.h(129): error C2664: 'int PyImport_AppendInittab(const char *,PyObject *(__cdecl *)(void))': cannot convert argument 2 from 'void (__cdecl *)(void)' to 'PyObject *(__cdecl *)(void)'
...\VTK_7.1.1\Wrapping\Python\vtkpythonmodules.h(129): note: None of the functions with this name in scope match the target type

and so on. The only similar error in the mailing list is http://vtk.1045678.n5.nabble.com/VtK-7-python3-4-build-error-td5735728.html ; but that doesn't help me since my python path are correctly set.

The building config is :
Windows 10 x64
Visual Studio 2017
Python 3.6.1 (installed from python.org exe)
VTK 7.1.1 with :
-PYTHON_DEBUG_LIBRARY C:/Program Files/Python_3.6.1/libs/python36_d.lib
-PYTHON_EXECUTABLE C:/Program Files/Python_3.6.1/python.exe
-PYTHON_INCLUDE_DIR C:/Program Files/Python_3.6.1/include
-PYTHON_LIBRARY C:/Program Files/Python_3.6.1/libs/python36.lib
(-Static libraries)

Anyone have already encountered such problems and solved it ?

Thanks in advance.

Tim


_______________________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ

Search the list archives at: http://markmail.org/search/?q=vtkusers

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/vtkusers
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Building VTK 7.1.1 with Python wrapping fail

Timothee Evain
Hi David,

Many thanks, your work-around is working, compilation error is fixed :).
With a hasty try, I get some linker error now, cmake seems to put the python release lib into the debug profile, but I should make a clean compilation tomorrow.
I will let you know if I succeed !

Thanks again.

Tim

----- Mail original -----
De: "David Gobbi" <[hidden email]>
À: "Timothee Evain" <[hidden email]>
Cc: "VTK Users" <[hidden email]>, "Utkarsh Ayachit" <[hidden email]>
Envoyé: Lundi 1 Mai 2017 21:52:21
Objet: Re: [vtkusers] Building VTK 7.1.1 with Python wrapping fail

Hi Tim,

As a temporary work-around, you can try modifying the VTK code yourself.
In the VTK/CMake directory, there is a file called
vtkPythonWrapping.cmake.  The following line (around line 195) is where the
problem is:

      set (EXTERN_DEFINES "${EXTERN_DEFINES}\n  extern void
init${module}Python();")

Try changing the "void" to "PyObject *":

      set (EXTERN_DEFINES "${EXTERN_DEFINES}\n  extern PyObject
*init${module}Python();")

Let me know if that fixes the compile error.

 - David

On Mon, May 1, 2017 at 1:24 PM, David Gobbi <[hidden email]> wrote:

> Hi Tim,
>
> I haven't seen this error message before, but my guess is that building
> the Python wrappers with static linkage does not work with Python 3.  I'm
> not sure how difficult this is to fix.  It might be as simple as adding a
> couple #ifdefs to the code (to the VTK code, I mean.).
>
>  - David
>
>
> On Mon, May 1, 2017 at 12:26 PM, Timothee Evain <
> [hidden email]> wrote:
>
>> Hello everyone!
>>
>> I'm trying to build VTK 7.1.1 with the Python wrapping with Visual studio
>> 2017 on Win10. Everything goes fine until the end of the build, where a
>> bunch of error appears in the vtkpython project like :
>>
>> vtkPythonAppInit.cxx
>> ...\VTK_7.1.1\Wrapping\Python\vtkpythonmodules.h(126): error C2664: 'int
>> PyImport_AppendInittab(const char *,PyObject *(__cdecl *)(void))': cannot
>> convert argument 2 from 'void (__cdecl *)(void)' to 'PyObject *(__cdecl
>> *)(void)'
>> ...\VTK_7.1.1\Wrapping\Python\vtkpythonmodules.h(126): note: None of the
>> functions with this name in scope match the target type
>> ...\VTK_7.1.1\Wrapping\Python\vtkpythonmodules.h(129): error C2664: 'int
>> PyImport_AppendInittab(const char *,PyObject *(__cdecl *)(void))': cannot
>> convert argument 2 from 'void (__cdecl *)(void)' to 'PyObject *(__cdecl
>> *)(void)'
>> ...\VTK_7.1.1\Wrapping\Python\vtkpythonmodules.h(129): note: None of the
>> functions with this name in scope match the target type
>>
>> and so on. The only similar error in the mailing list is
>> http://vtk.1045678.n5.nabble.com/VtK-7-python3-4-build-error
>> -td5735728.html ; but that doesn't help me since my python path are
>> correctly set.
>>
>> The building config is :
>> Windows 10 x64
>> Visual Studio 2017
>> Python 3.6.1 (installed from python.org exe)
>> VTK 7.1.1 with :
>> -PYTHON_DEBUG_LIBRARY C:/Program Files/Python_3.6.1/libs/python36_d.lib
>> -PYTHON_EXECUTABLE C:/Program Files/Python_3.6.1/python.exe
>> -PYTHON_INCLUDE_DIR C:/Program Files/Python_3.6.1/include
>> -PYTHON_LIBRARY C:/Program Files/Python_3.6.1/libs/python36.lib
>> (-Static libraries)
>>
>> Anyone have already encountered such problems and solved it ?
>>
>> Thanks in advance.
>>
>> Tim
>>
>
_______________________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ

Search the list archives at: http://markmail.org/search/?q=vtkusers

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/vtkusers
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Building VTK 7.1.1 with Python wrapping fail

Timothee Evain
In reply to this post by David Gobbi
Hello David,

Some follow-up:

After vtkPythonWrapping.cmake modification, the first set of error is gone.
But then, linking fail for this project with:
[...]
1>vtkPythonAppInit.obj : error LNK2019: unresolved external symbol initvtkCommonCorePython referenced in function "void __cdecl vtkpythonmodulesPythonLoadAllPythonModules(void)" (?vtkpythonmodulesPythonLoadAllPythonModules@@YAXXZ)
1>vtkPythonAppInit.obj : error LNK2019: unresolved external symbol initvtkCommonMathPython referenced in function "void __cdecl vtkpythonmodulesPythonLoadAllPythonModules(void)" (?vtkpythonmodulesPythonLoadAllPythonModules@@YAXXZ)
1>vtkPythonAppInit.obj : error LNK2019: unresolved external symbol initvtkCommonMiscPython referenced in function "void __cdecl vtkpythonmodulesPythonLoadAllPythonModules(void)" (?vtkpythonmodulesPythonLoadAllPythonModules@@YAXXZ)
[...]

Looking at the the vtkpython linking dependencies, I'm a bit confused.
First of all, the python lib ([...]Python_3.6.1\libs\python36.lib) is set for release profile but also on debug (rather than [...]Python_3.6.1\libs\python36_d.lib ?) by cmake.
Then, for both profiles are linked all the vtk*Python and all the vtk*PythonD libs, which seems unusual, as I was expecting vtk*Python libs in release and vtk*PythonD libs in debug.
I'm not sure if this is an expected configuration, so I have not found the source of error.

Don't hesitate to tell me if you need additionnal information!

Tim

----- Mail original -----
De: "David Gobbi" <[hidden email]>
À: "Timothee Evain" <[hidden email]>
Cc: "VTK Users" <[hidden email]>, "Utkarsh Ayachit" <[hidden email]>
Envoyé: Lundi 1 Mai 2017 21:52:21
Objet: Re: [vtkusers] Building VTK 7.1.1 with Python wrapping fail

Hi Tim,

As a temporary work-around, you can try modifying the VTK code yourself.
In the VTK/CMake directory, there is a file called
vtkPythonWrapping.cmake.  The following line (around line 195) is where the
problem is:

      set (EXTERN_DEFINES "${EXTERN_DEFINES}\n  extern void
init${module}Python();")

Try changing the "void" to "PyObject *":

      set (EXTERN_DEFINES "${EXTERN_DEFINES}\n  extern PyObject
*init${module}Python();")

Let me know if that fixes the compile error.

 - David

On Mon, May 1, 2017 at 1:24 PM, David Gobbi <[hidden email]> wrote:

> Hi Tim,
>
> I haven't seen this error message before, but my guess is that building
> the Python wrappers with static linkage does not work with Python 3.  I'm
> not sure how difficult this is to fix.  It might be as simple as adding a
> couple #ifdefs to the code (to the VTK code, I mean.).
>
>  - David
>
>
> On Mon, May 1, 2017 at 12:26 PM, Timothee Evain <
> [hidden email]> wrote:
>
>> Hello everyone!
>>
>> I'm trying to build VTK 7.1.1 with the Python wrapping with Visual studio
>> 2017 on Win10. Everything goes fine until the end of the build, where a
>> bunch of error appears in the vtkpython project like :
>>
>> vtkPythonAppInit.cxx
>> ...\VTK_7.1.1\Wrapping\Python\vtkpythonmodules.h(126): error C2664: 'int
>> PyImport_AppendInittab(const char *,PyObject *(__cdecl *)(void))': cannot
>> convert argument 2 from 'void (__cdecl *)(void)' to 'PyObject *(__cdecl
>> *)(void)'
>> ...\VTK_7.1.1\Wrapping\Python\vtkpythonmodules.h(126): note: None of the
>> functions with this name in scope match the target type
>> ...\VTK_7.1.1\Wrapping\Python\vtkpythonmodules.h(129): error C2664: 'int
>> PyImport_AppendInittab(const char *,PyObject *(__cdecl *)(void))': cannot
>> convert argument 2 from 'void (__cdecl *)(void)' to 'PyObject *(__cdecl
>> *)(void)'
>> ...\VTK_7.1.1\Wrapping\Python\vtkpythonmodules.h(129): note: None of the
>> functions with this name in scope match the target type
>>
>> and so on. The only similar error in the mailing list is
>> http://vtk.1045678.n5.nabble.com/VtK-7-python3-4-build-error
>> -td5735728.html ; but that doesn't help me since my python path are
>> correctly set.
>>
>> The building config is :
>> Windows 10 x64
>> Visual Studio 2017
>> Python 3.6.1 (installed from python.org exe)
>> VTK 7.1.1 with :
>> -PYTHON_DEBUG_LIBRARY C:/Program Files/Python_3.6.1/libs/python36_d.lib
>> -PYTHON_EXECUTABLE C:/Program Files/Python_3.6.1/python.exe
>> -PYTHON_INCLUDE_DIR C:/Program Files/Python_3.6.1/include
>> -PYTHON_LIBRARY C:/Program Files/Python_3.6.1/libs/python36.lib
>> (-Static libraries)
>>
>> Anyone have already encountered such problems and solved it ?
>>
>> Thanks in advance.
>>
>> Tim
>>
>
_______________________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ

Search the list archives at: http://markmail.org/search/?q=vtkusers

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/vtkusers
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Building VTK 7.1.1 with Python wrapping fail

David Gobbi
Hi Timothee,

The "D" on the the vtk*PythonD does not mean "Debug".  Each build (whether release or debug) will have a full set of vtk*PythonD libraries and vtk*Python modules.  Both are needed for the VTK build.

My system doesn't have a python_d debug library (I'm OS X), but it is probably unrelated to the link error, and it is totally unrelated to the PythonD libraries.

As for the link error, it probably has to do with these lines in Wrapping/Python/CMakeLists.txt:

  list(APPEND VTKPYTHON_LINK_LIBS ${vtkPython_LIBRARIES})
  target_link_libraries(vtkpython ${VTKPYTHON_LINK_LIBS})

Can you add the following immediately below these lines, and tell me what is printed?

  message(STATUS "vtkPython_LIBRARIES ${vtkPython_LIBRARIES}")
  message(STATUS "VTKPYTHON_LINK_LIBS ${VTKPYTHON_LINK_LIBS}")

Regards,
 - David



On Tue, May 2, 2017 at 1:38 PM, Timothee Evain <[hidden email]> wrote:
Hello David,

Some follow-up:

After vtkPythonWrapping.cmake modification, the first set of error is gone.
But then, linking fail for this project with:
[...]
1>vtkPythonAppInit.obj : error LNK2019: unresolved external symbol initvtkCommonCorePython referenced in function "void __cdecl vtkpythonmodulesPythonLoadAllPythonModules(void)" (?vtkpythonmodulesPythonLoadAllPythonModules@@YAXXZ)
1>vtkPythonAppInit.obj : error LNK2019: unresolved external symbol initvtkCommonMathPython referenced in function "void __cdecl vtkpythonmodulesPythonLoadAllPythonModules(void)" (?vtkpythonmodulesPythonLoadAllPythonModules@@YAXXZ)
1>vtkPythonAppInit.obj : error LNK2019: unresolved external symbol initvtkCommonMiscPython referenced in function "void __cdecl vtkpythonmodulesPythonLoadAllPythonModules(void)" (?vtkpythonmodulesPythonLoadAllPythonModules@@YAXXZ)
[...]

Looking at the the vtkpython linking dependencies, I'm a bit confused.
First of all, the python lib ([...]Python_3.6.1\libs\python36.lib) is set for release profile but also on debug (rather than [...]Python_3.6.1\libs\python36_d.lib ?) by cmake.
Then, for both profiles are linked all the vtk*Python and all the vtk*PythonD libs, which seems unusual, as I was expecting vtk*Python libs in release and vtk*PythonD libs in debug.
I'm not sure if this is an expected configuration, so I have not found the source of error.

Don't hesitate to tell me if you need additionnal information!

Tim

----- Mail original -----
De: "David Gobbi" <[hidden email]>
À: "Timothee Evain" <[hidden email]>
Cc: "VTK Users" <[hidden email]>, "Utkarsh Ayachit" <[hidden email]>
Envoyé: Lundi 1 Mai 2017 21:52:21
Objet: Re: [vtkusers] Building VTK 7.1.1 with Python wrapping fail

Hi Tim,

As a temporary work-around, you can try modifying the VTK code yourself.
In the VTK/CMake directory, there is a file called
vtkPythonWrapping.cmake.  The following line (around line 195) is where the
problem is:

      set (EXTERN_DEFINES "${EXTERN_DEFINES}\n  extern void
init${module}Python();")

Try changing the "void" to "PyObject *":

      set (EXTERN_DEFINES "${EXTERN_DEFINES}\n  extern PyObject
*init${module}Python();")

Let me know if that fixes the compile error.

 - David

On Mon, May 1, 2017 at 1:24 PM, David Gobbi <[hidden email]> wrote:

> Hi Tim,
>
> I haven't seen this error message before, but my guess is that building
> the Python wrappers with static linkage does not work with Python 3.  I'm
> not sure how difficult this is to fix.  It might be as simple as adding a
> couple #ifdefs to the code (to the VTK code, I mean.).
>
>  - David
>
>
> On Mon, May 1, 2017 at 12:26 PM, Timothee Evain <
> [hidden email]> wrote:
>
>> Hello everyone!
>>
>> I'm trying to build VTK 7.1.1 with the Python wrapping with Visual studio
>> 2017 on Win10. Everything goes fine until the end of the build, where a
>> bunch of error appears in the vtkpython project like :
>>
>> vtkPythonAppInit.cxx
>> ...\VTK_7.1.1\Wrapping\Python\vtkpythonmodules.h(126): error C2664: 'int
>> PyImport_AppendInittab(const char *,PyObject *(__cdecl *)(void))': cannot
>> convert argument 2 from 'void (__cdecl *)(void)' to 'PyObject *(__cdecl
>> *)(void)'
>> ...\VTK_7.1.1\Wrapping\Python\vtkpythonmodules.h(126): note: None of the
>> functions with this name in scope match the target type
>> ...\VTK_7.1.1\Wrapping\Python\vtkpythonmodules.h(129): error C2664: 'int
>> PyImport_AppendInittab(const char *,PyObject *(__cdecl *)(void))': cannot
>> convert argument 2 from 'void (__cdecl *)(void)' to 'PyObject *(__cdecl
>> *)(void)'
>> ...\VTK_7.1.1\Wrapping\Python\vtkpythonmodules.h(129): note: None of the
>> functions with this name in scope match the target type
>>
>> and so on. The only similar error in the mailing list is
>> http://vtk.1045678.n5.nabble.com/VtK-7-python3-4-build-error
>> -td5735728.html ; but that doesn't help me since my python path are
>> correctly set.
>>
>> The building config is :
>> Windows 10 x64
>> Visual Studio 2017
>> Python 3.6.1 (installed from python.org exe)
>> VTK 7.1.1 with :
>> -PYTHON_DEBUG_LIBRARY C:/Program Files/Python_3.6.1/libs/python36_d.lib
>> -PYTHON_EXECUTABLE C:/Program Files/Python_3.6.1/python.exe
>> -PYTHON_INCLUDE_DIR C:/Program Files/Python_3.6.1/include
>> -PYTHON_LIBRARY C:/Program Files/Python_3.6.1/libs/python36.lib
>> (-Static libraries)
>>
>> Anyone have already encountered such problems and solved it ?
>>
>> Thanks in advance.
>>
>> Tim
>>
>


_______________________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ

Search the list archives at: http://markmail.org/search/?q=vtkusers

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/vtkusers
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Building VTK 7.1.1 with Python wrapping fail

Timothee Evain
Hi!

That explains why the full are in both profile, thanks for the clarification!

One strange thing about the CMakeLists.txt: the one I got downloading the 7.1.1 archive on vtk.org does not contain this part before "target_link_libraries(vtkpython ${VTKPYTHON_LINK_LIBS})" (around line 246) :

# Add the libPython.dylib file and link explicitly against it.
# This is needed because this is a new python executable, which needs it's libraries.
find_package(PythonLibs REQUIRED)
list(APPEND VTKPYTHON_LINK_LIBS ${vtkPython_LIBRARIES})

that is in contrast to the file in github. Nonetheless, after fixing it, the reporting is :

vtkPython_LIBRARIES C:/Program Files/Python_3.6.1/libs/python36.lib

VTKPYTHON_LINK_LIBS vtkWrappingPythonCore;
vtkCommonCorePython;
vtkCommonMathPython;
vtkCommonMiscPython;
vtkCommonSystemPython;
vtkCommonTransformsPython;
vtkCommonDataModelPython;
vtkCommonColorPython;
vtkCommonExecutionModelPython;
vtkCommonComputationalGeometryPython;
vtkFiltersCorePython;
vtkFiltersGeneralPython;
vtkImagingCorePython;
vtkImagingFourierPython;
vtkFiltersStatisticsPython;
vtkFiltersExtractionPython;
vtkInfovisCorePython;
vtkFiltersGeometryPython;
vtkFiltersSourcesPython;
vtkRenderingCorePython;
vtkRenderingFreeTypePython;
vtkRenderingContext2DPython;
vtkChartsCorePython;
vtkIOImagePython;
vtkIOCorePython;
vtkIOSQLPython;
vtkImagingStatisticsPython;
vtkInteractionStylePython;
vtkRenderingImagePython;
vtkRenderingOpenGL2Python;
vtkDICOMPython;
vtkIOLegacyPython;
vtkIOXMLParserPython;
vtkDomainsChemistryPython;
vtkDomainsChemistryOpenGL2Python;
vtkIOXMLPython;
vtkParallelCorePython;
vtkFiltersAMRPython;
vtkFiltersFlowPathsPython;
vtkFiltersGenericPython;
vtkImagingSourcesPython;
vtkFiltersHybridPython;
vtkFiltersHyperTreePython;
vtkImagingGeneralPython;
vtkFiltersImagingPython;
vtkFiltersModelingPython;
vtkFiltersParallelPython;
vtkFiltersParallelImagingPython;
vtkFiltersPointsPython;vtkFiltersProgrammablePython;vtkFiltersPythonPython;vtkFiltersSMPPython;vtkFiltersSelectionPython;vtkFiltersTexturePython;vtkFiltersVerdictPython;vtkImagingHybridPython;vtkInfovisLayoutPython;vtkImagingColorPython;vtkRenderingAnnotationPython;vtkRenderingVolumePython;vtkInteractionWidgetsPython;vtkViewsCorePython;vtkGeovisCorePython;vtkIOAMRPython;vtkIOEnSightPython;vtkIOExodusPython;vtkRenderingGL2PSOpenGL2Python;vtkIOExportPython;vtkIOGeometryPython;vtkIOImportPython;vtkIOInfovisPython;vtkIOLSDynaPython;vtkIOMINCPython;vtkIOMoviePython;vtkIONetCDFPython;vtkIOPLYPython;vtkIOParallelPython;vtkIOParallelXMLPython;vtkIOTecplotTablePython;vtkIOVideoPython;vtkImagingMathPython;vtkImagingMorphologicalPython;vtkImagingOpenGL2Python;vtkImagingStencilPython;vtkInteractionImagePython;vtkPythonInterpreterPython;vtkRenderingContextOpenGL2Python;vtkRenderingLODPython;vtkRenderingLabelPython;vtkRenderingMatplotlibPython;vtkRenderingVolumeOpenGL2Python;vtkViewsContext2DPython;vtkViewsInfovisPython;C:/Program Files/Python_3.6.1/libs/python36.lib


----- Mail original -----
De: "David Gobbi" <[hidden email]>
À: "Timothee Evain" <[hidden email]>
Cc: "VTK Users" <[hidden email]>, "Utkarsh Ayachit" <[hidden email]>
Envoyé: Mercredi 3 Mai 2017 02:08:05
Objet: Re: [vtkusers] Building VTK 7.1.1 with Python wrapping fail

Hi Timothee,

The "D" on the the vtk*PythonD does not mean "Debug".  Each build (whether
release or debug) will have a full set of vtk*PythonD libraries and
vtk*Python modules.  Both are needed for the VTK build.

My system doesn't have a python_d debug library (I'm OS X), but it is
probably unrelated to the link error, and it is totally unrelated to the
PythonD libraries.

As for the link error, it probably has to do with these lines in
Wrapping/Python/CMakeLists.txt:

  list(APPEND VTKPYTHON_LINK_LIBS ${vtkPython_LIBRARIES})
  target_link_libraries(vtkpython ${VTKPYTHON_LINK_LIBS})

Can you add the following immediately below these lines, and tell me what
is printed?

  message(STATUS "vtkPython_LIBRARIES ${vtkPython_LIBRARIES}")
  message(STATUS "VTKPYTHON_LINK_LIBS ${VTKPYTHON_LINK_LIBS}")

Regards,
 - David



On Tue, May 2, 2017 at 1:38 PM, Timothee Evain <[hidden email]>
wrote:

> Hello David,
>
> Some follow-up:
>
> After vtkPythonWrapping.cmake modification, the first set of error is gone.
> But then, linking fail for this project with:
> [...]
> 1>vtkPythonAppInit.obj : error LNK2019: unresolved external symbol
> initvtkCommonCorePython referenced in function "void __cdecl
> vtkpythonmodulesPythonLoadAllPythonModules(void)" (?
> vtkpythonmodulesPythonLoadAllPythonModules@@YAXXZ)
> 1>vtkPythonAppInit.obj : error LNK2019: unresolved external symbol
> initvtkCommonMathPython referenced in function "void __cdecl
> vtkpythonmodulesPythonLoadAllPythonModules(void)" (?
> vtkpythonmodulesPythonLoadAllPythonModules@@YAXXZ)
> 1>vtkPythonAppInit.obj : error LNK2019: unresolved external symbol
> initvtkCommonMiscPython referenced in function "void __cdecl
> vtkpythonmodulesPythonLoadAllPythonModules(void)" (?
> vtkpythonmodulesPythonLoadAllPythonModules@@YAXXZ)
> [...]
>
> Looking at the the vtkpython linking dependencies, I'm a bit confused.
> First of all, the python lib ([...]Python_3.6.1\libs\python36.lib) is set
> for release profile but also on debug (rather than [...]Python_3.6.1\libs\python36_d.lib
> ?) by cmake.
> Then, for both profiles are linked all the vtk*Python and all the
> vtk*PythonD libs, which seems unusual, as I was expecting vtk*Python libs
> in release and vtk*PythonD libs in debug.
> I'm not sure if this is an expected configuration, so I have not found the
> source of error.
>
> Don't hesitate to tell me if you need additionnal information!
>
> Tim
>
> ----- Mail original -----
> De: "David Gobbi" <[hidden email]>
> À: "Timothee Evain" <[hidden email]>
> Cc: "VTK Users" <[hidden email]>, "Utkarsh Ayachit" <
> [hidden email]>
> Envoyé: Lundi 1 Mai 2017 21:52:21
> Objet: Re: [vtkusers] Building VTK 7.1.1 with Python wrapping fail
>
> Hi Tim,
>
> As a temporary work-around, you can try modifying the VTK code yourself.
> In the VTK/CMake directory, there is a file called
> vtkPythonWrapping.cmake.  The following line (around line 195) is where the
> problem is:
>
>       set (EXTERN_DEFINES "${EXTERN_DEFINES}\n  extern void
> init${module}Python();")
>
> Try changing the "void" to "PyObject *":
>
>       set (EXTERN_DEFINES "${EXTERN_DEFINES}\n  extern PyObject
> *init${module}Python();")
>
> Let me know if that fixes the compile error.
>
>  - David
>
> On Mon, May 1, 2017 at 1:24 PM, David Gobbi <[hidden email]> wrote:
>
> > Hi Tim,
> >
> > I haven't seen this error message before, but my guess is that building
> > the Python wrappers with static linkage does not work with Python 3.  I'm
> > not sure how difficult this is to fix.  It might be as simple as adding a
> > couple #ifdefs to the code (to the VTK code, I mean.).
> >
> >  - David
> >
> >
> > On Mon, May 1, 2017 at 12:26 PM, Timothee Evain <
> > [hidden email]> wrote:
> >
> >> Hello everyone!
> >>
> >> I'm trying to build VTK 7.1.1 with the Python wrapping with Visual
> studio
> >> 2017 on Win10. Everything goes fine until the end of the build, where a
> >> bunch of error appears in the vtkpython project like :
> >>
> >> vtkPythonAppInit.cxx
> >> ...\VTK_7.1.1\Wrapping\Python\vtkpythonmodules.h(126): error C2664:
> 'int
> >> PyImport_AppendInittab(const char *,PyObject *(__cdecl *)(void))':
> cannot
> >> convert argument 2 from 'void (__cdecl *)(void)' to 'PyObject *(__cdecl
> >> *)(void)'
> >> ...\VTK_7.1.1\Wrapping\Python\vtkpythonmodules.h(126): note: None of
> the
> >> functions with this name in scope match the target type
> >> ...\VTK_7.1.1\Wrapping\Python\vtkpythonmodules.h(129): error C2664:
> 'int
> >> PyImport_AppendInittab(const char *,PyObject *(__cdecl *)(void))':
> cannot
> >> convert argument 2 from 'void (__cdecl *)(void)' to 'PyObject *(__cdecl
> >> *)(void)'
> >> ...\VTK_7.1.1\Wrapping\Python\vtkpythonmodules.h(129): note: None of
> the
> >> functions with this name in scope match the target type
> >>
> >> and so on. The only similar error in the mailing list is
> >> http://vtk.1045678.n5.nabble.com/VtK-7-python3-4-build-error
> >> -td5735728.html ; but that doesn't help me since my python path are
> >> correctly set.
> >>
> >> The building config is :
> >> Windows 10 x64
> >> Visual Studio 2017
> >> Python 3.6.1 (installed from python.org exe)
> >> VTK 7.1.1 with :
> >> -PYTHON_DEBUG_LIBRARY C:/Program Files/Python_3.6.1/libs/python36_d.lib
> >> -PYTHON_EXECUTABLE C:/Program Files/Python_3.6.1/python.exe
> >> -PYTHON_INCLUDE_DIR C:/Program Files/Python_3.6.1/include
> >> -PYTHON_LIBRARY C:/Program Files/Python_3.6.1/libs/python36.lib
> >> (-Static libraries)
> >>
> >> Anyone have already encountered such problems and solved it ?
> >>
> >> Thanks in advance.
> >>
> >> Tim
> >>
> >
>
_______________________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ

Search the list archives at: http://markmail.org/search/?q=vtkusers

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/vtkusers
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Building VTK 7.1.1 with Python wrapping fail

Timothee Evain
In reply to this post by David Gobbi
<Sorry about the duplicated mail, first got sent by mistake>

Hi!

That explains why the full are in both profile, thanks for the clarification!

One strange thing about the CMakeLists.txt: the one I got downloading the 7.1.1 archive on vtk.org does not contain this part before "target_link_libraries(vtkpython ${VTKPYTHON_LINK_LIBS})" (around line 246) :

# Add the libPython.dylib file and link explicitly against it.
# This is needed because this is a new python executable, which needs it's libraries.
find_package(PythonLibs REQUIRED)
list(APPEND VTKPYTHON_LINK_LIBS ${vtkPython_LIBRARIES})

that is in contrast to the file in github. Nonetheless, after fixing it, the reporting is :

vtkPython_LIBRARIES C:/Program Files/Python_3.6.1/libs/python36.lib

VTKPYTHON_LINK_LIBS vtkWrappingPythonCore;
vtkCommonCorePython;
vtkCommonMathPython;
vtkCommonMiscPython;
vtkCommonSystemPython;
vtkCommonTransformsPython;
vtkCommonDataModelPython;
vtkCommonColorPython;
vtkCommonExecutionModelPython;
vtkCommonComputationalGeometryPython;
vtkFiltersCorePython;
vtkFiltersGeneralPython;
vtkImagingCorePython;
vtkImagingFourierPython;
vtkFiltersStatisticsPython;
vtkFiltersExtractionPython;
vtkInfovisCorePython;
vtkFiltersGeometryPython;
vtkFiltersSourcesPython;
vtkRenderingCorePython;
vtkRenderingFreeTypePython;
vtkRenderingContext2DPython;
vtkChartsCorePython;
vtkIOImagePython;
vtkIOCorePython;
vtkIOSQLPython;
vtkImagingStatisticsPython;
vtkInteractionStylePython;
vtkRenderingImagePython;
vtkRenderingOpenGL2Python;
vtkDICOMPython;
vtkIOLegacyPython;
vtkIOXMLParserPython;
vtkDomainsChemistryPython;
vtkDomainsChemistryOpenGL2Python;
vtkIOXMLPython;
vtkParallelCorePython;
vtkFiltersAMRPython;
vtkFiltersFlowPathsPython;
vtkFiltersGenericPython;
vtkImagingSourcesPython;
vtkFiltersHybridPython;
vtkFiltersHyperTreePython;
vtkImagingGeneralPython;
vtkFiltersImagingPython;
vtkFiltersModelingPython;
vtkFiltersParallelPython;
vtkFiltersParallelImagingPython;
vtkFiltersPointsPython;
vtkFiltersProgrammablePython;
vtkFiltersPythonPython;
vtkFiltersSMPPython;
vtkFiltersSelectionPython;
vtkFiltersTexturePython;
vtkFiltersVerdictPython;
vtkImagingHybridPython;
vtkInfovisLayoutPython;
vtkImagingColorPython;
vtkRenderingAnnotationPython;
vtkRenderingVolumePython;
vtkInteractionWidgetsPython;
vtkViewsCorePython;
vtkGeovisCorePython;
vtkIOAMRPython;
vtkIOEnSightPython;
vtkIOExodusPython;
vtkRenderingGL2PSOpenGL2Python;
vtkIOExportPython;
vtkIOGeometryPython;
vtkIOImportPython;
vtkIOInfovisPython;
vtkIOLSDynaPython;
vtkIOMINCPython;
vtkIOMoviePython;
vtkIONetCDFPython;
vtkIOPLYPython;
vtkIOParallelPython;
vtkIOParallelXMLPython;
vtkIOTecplotTablePython;
vtkIOVideoPython;
vtkImagingMathPython;
vtkImagingMorphologicalPython;
vtkImagingOpenGL2Python;
vtkImagingStencilPython;
vtkInteractionImagePython;
vtkPythonInterpreterPython;
vtkRenderingContextOpenGL2Python;
vtkRenderingLODPython;
vtkRenderingLabelPython;
vtkRenderingMatplotlibPython;
vtkRenderingVolumeOpenGL2Python;
vtkViewsContext2DPython;
vtkViewsInfovisPython;
C:/Program Files/Python_3.6.1/libs/python36.lib

Tim


----- Mail original -----
De: "David Gobbi" <[hidden email]>
À: "Timothee Evain" <[hidden email]>
Cc: "VTK Users" <[hidden email]>, "Utkarsh Ayachit" <[hidden email]>
Envoyé: Mercredi 3 Mai 2017 02:08:05
Objet: Re: [vtkusers] Building VTK 7.1.1 with Python wrapping fail

Hi Timothee,

The "D" on the the vtk*PythonD does not mean "Debug".  Each build (whether
release or debug) will have a full set of vtk*PythonD libraries and
vtk*Python modules.  Both are needed for the VTK build.

My system doesn't have a python_d debug library (I'm OS X), but it is
probably unrelated to the link error, and it is totally unrelated to the
PythonD libraries.

As for the link error, it probably has to do with these lines in
Wrapping/Python/CMakeLists.txt:

  list(APPEND VTKPYTHON_LINK_LIBS ${vtkPython_LIBRARIES})
  target_link_libraries(vtkpython ${VTKPYTHON_LINK_LIBS})

Can you add the following immediately below these lines, and tell me what
is printed?

  message(STATUS "vtkPython_LIBRARIES ${vtkPython_LIBRARIES}")
  message(STATUS "VTKPYTHON_LINK_LIBS ${VTKPYTHON_LINK_LIBS}")

Regards,
 - David



On Tue, May 2, 2017 at 1:38 PM, Timothee Evain <[hidden email]>
wrote:

> Hello David,
>
> Some follow-up:
>
> After vtkPythonWrapping.cmake modification, the first set of error is gone.
> But then, linking fail for this project with:
> [...]
> 1>vtkPythonAppInit.obj : error LNK2019: unresolved external symbol
> initvtkCommonCorePython referenced in function "void __cdecl
> vtkpythonmodulesPythonLoadAllPythonModules(void)" (?
> vtkpythonmodulesPythonLoadAllPythonModules@@YAXXZ)
> 1>vtkPythonAppInit.obj : error LNK2019: unresolved external symbol
> initvtkCommonMathPython referenced in function "void __cdecl
> vtkpythonmodulesPythonLoadAllPythonModules(void)" (?
> vtkpythonmodulesPythonLoadAllPythonModules@@YAXXZ)
> 1>vtkPythonAppInit.obj : error LNK2019: unresolved external symbol
> initvtkCommonMiscPython referenced in function "void __cdecl
> vtkpythonmodulesPythonLoadAllPythonModules(void)" (?
> vtkpythonmodulesPythonLoadAllPythonModules@@YAXXZ)
> [...]
>
> Looking at the the vtkpython linking dependencies, I'm a bit confused.
> First of all, the python lib ([...]Python_3.6.1\libs\python36.lib) is set
> for release profile but also on debug (rather than [...]Python_3.6.1\libs\python36_d.lib
> ?) by cmake.
> Then, for both profiles are linked all the vtk*Python and all the
> vtk*PythonD libs, which seems unusual, as I was expecting vtk*Python libs
> in release and vtk*PythonD libs in debug.
> I'm not sure if this is an expected configuration, so I have not found the
> source of error.
>
> Don't hesitate to tell me if you need additionnal information!
>
> Tim
>
> ----- Mail original -----
> De: "David Gobbi" <[hidden email]>
> À: "Timothee Evain" <[hidden email]>
> Cc: "VTK Users" <[hidden email]>, "Utkarsh Ayachit" <
> [hidden email]>
> Envoyé: Lundi 1 Mai 2017 21:52:21
> Objet: Re: [vtkusers] Building VTK 7.1.1 with Python wrapping fail
>
> Hi Tim,
>
> As a temporary work-around, you can try modifying the VTK code yourself.
> In the VTK/CMake directory, there is a file called
> vtkPythonWrapping.cmake.  The following line (around line 195) is where the
> problem is:
>
>       set (EXTERN_DEFINES "${EXTERN_DEFINES}\n  extern void
> init${module}Python();")
>
> Try changing the "void" to "PyObject *":
>
>       set (EXTERN_DEFINES "${EXTERN_DEFINES}\n  extern PyObject
> *init${module}Python();")
>
> Let me know if that fixes the compile error.
>
>  - David
>
> On Mon, May 1, 2017 at 1:24 PM, David Gobbi <[hidden email]> wrote:
>
> > Hi Tim,
> >
> > I haven't seen this error message before, but my guess is that building
> > the Python wrappers with static linkage does not work with Python 3.  I'm
> > not sure how difficult this is to fix.  It might be as simple as adding a
> > couple #ifdefs to the code (to the VTK code, I mean.).
> >
> >  - David
> >
> >
> > On Mon, May 1, 2017 at 12:26 PM, Timothee Evain <
> > [hidden email]> wrote:
> >
> >> Hello everyone!
> >>
> >> I'm trying to build VTK 7.1.1 with the Python wrapping with Visual
> studio
> >> 2017 on Win10. Everything goes fine until the end of the build, where a
> >> bunch of error appears in the vtkpython project like :
> >>
> >> vtkPythonAppInit.cxx
> >> ...\VTK_7.1.1\Wrapping\Python\vtkpythonmodules.h(126): error C2664:
> 'int
> >> PyImport_AppendInittab(const char *,PyObject *(__cdecl *)(void))':
> cannot
> >> convert argument 2 from 'void (__cdecl *)(void)' to 'PyObject *(__cdecl
> >> *)(void)'
> >> ...\VTK_7.1.1\Wrapping\Python\vtkpythonmodules.h(126): note: None of
> the
> >> functions with this name in scope match the target type
> >> ...\VTK_7.1.1\Wrapping\Python\vtkpythonmodules.h(129): error C2664:
> 'int
> >> PyImport_AppendInittab(const char *,PyObject *(__cdecl *)(void))':
> cannot
> >> convert argument 2 from 'void (__cdecl *)(void)' to 'PyObject *(__cdecl
> >> *)(void)'
> >> ...\VTK_7.1.1\Wrapping\Python\vtkpythonmodules.h(129): note: None of
> the
> >> functions with this name in scope match the target type
> >>
> >> and so on. The only similar error in the mailing list is
> >> http://vtk.1045678.n5.nabble.com/VtK-7-python3-4-build-error
> >> -td5735728.html ; but that doesn't help me since my python path are
> >> correctly set.
> >>
> >> The building config is :
> >> Windows 10 x64
> >> Visual Studio 2017
> >> Python 3.6.1 (installed from python.org exe)
> >> VTK 7.1.1 with :
> >> -PYTHON_DEBUG_LIBRARY C:/Program Files/Python_3.6.1/libs/python36_d.lib
> >> -PYTHON_EXECUTABLE C:/Program Files/Python_3.6.1/python.exe
> >> -PYTHON_INCLUDE_DIR C:/Program Files/Python_3.6.1/include
> >> -PYTHON_LIBRARY C:/Program Files/Python_3.6.1/libs/python36.lib
> >> (-Static libraries)
> >>
> >> Anyone have already encountered such problems and solved it ?
> >>
> >> Thanks in advance.
> >>
> >> Tim
> >>
> >
>
_______________________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ

Search the list archives at: http://markmail.org/search/?q=vtkusers

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/vtkusers
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Building VTK 7.1.1 with Python wrapping fail

David Gobbi
In reply to this post by Timothee Evain
Hi Timothee,

I checked the logs, it looks like that change was done around one year ago, but wasn't in the 7.1.1 release.

It looks like it links to the correct libraries, are you still seeing the missing symbol errors?

 - David


On Wed, May 3, 2017 at 1:20 PM, Timothee Evain <[hidden email]> wrote:
Hi!

That explains why the full are in both profile, thanks for the clarification!

One strange thing about the CMakeLists.txt: the one I got downloading the 7.1.1 archive on vtk.org does not contain this part before "target_link_libraries(vtkpython ${VTKPYTHON_LINK_LIBS})" (around line 246) :

# Add the libPython.dylib file and link explicitly against it.
# This is needed because this is a new python executable, which needs it's libraries.
find_package(PythonLibs REQUIRED)
list(APPEND VTKPYTHON_LINK_LIBS ${vtkPython_LIBRARIES})

that is in contrast to the file in github. Nonetheless, after fixing it, the reporting is :

vtkPython_LIBRARIES C:/Program Files/Python_3.6.1/libs/python36.lib

VTKPYTHON_LINK_LIBS vtkWrappingPythonCore;
vtkCommonCorePython;
vtkCommonMathPython;
vtkCommonMiscPython;
vtkCommonSystemPython;
vtkCommonTransformsPython;
vtkCommonDataModelPython;
vtkCommonColorPython;
vtkCommonExecutionModelPython;
vtkCommonComputationalGeometryPython;
vtkFiltersCorePython;
vtkFiltersGeneralPython;
vtkImagingCorePython;
vtkImagingFourierPython;
vtkFiltersStatisticsPython;
vtkFiltersExtractionPython;
vtkInfovisCorePython;
vtkFiltersGeometryPython;
vtkFiltersSourcesPython;
vtkRenderingCorePython;
vtkRenderingFreeTypePython;
vtkRenderingContext2DPython;
vtkChartsCorePython;
vtkIOImagePython;
vtkIOCorePython;
vtkIOSQLPython;
vtkImagingStatisticsPython;
vtkInteractionStylePython;
vtkRenderingImagePython;
vtkRenderingOpenGL2Python;
vtkDICOMPython;
vtkIOLegacyPython;
vtkIOXMLParserPython;
vtkDomainsChemistryPython;
vtkDomainsChemistryOpenGL2Python;
vtkIOXMLPython;
vtkParallelCorePython;
vtkFiltersAMRPython;
vtkFiltersFlowPathsPython;
vtkFiltersGenericPython;
vtkImagingSourcesPython;
vtkFiltersHybridPython;
vtkFiltersHyperTreePython;
vtkImagingGeneralPython;
vtkFiltersImagingPython;
vtkFiltersModelingPython;
vtkFiltersParallelPython;
vtkFiltersParallelImagingPython;
vtkFiltersPointsPython;vtkFiltersProgrammablePython;vtkFiltersPythonPython;vtkFiltersSMPPython;vtkFiltersSelectionPython;vtkFiltersTexturePython;vtkFiltersVerdictPython;vtkImagingHybridPython;vtkInfovisLayoutPython;vtkImagingColorPython;vtkRenderingAnnotationPython;vtkRenderingVolumePython;vtkInteractionWidgetsPython;vtkViewsCorePython;vtkGeovisCorePython;vtkIOAMRPython;vtkIOEnSightPython;vtkIOExodusPython;vtkRenderingGL2PSOpenGL2Python;vtkIOExportPython;vtkIOGeometryPython;vtkIOImportPython;vtkIOInfovisPython;vtkIOLSDynaPython;vtkIOMINCPython;vtkIOMoviePython;vtkIONetCDFPython;vtkIOPLYPython;vtkIOParallelPython;vtkIOParallelXMLPython;vtkIOTecplotTablePython;vtkIOVideoPython;vtkImagingMathPython;vtkImagingMorphologicalPython;vtkImagingOpenGL2Python;vtkImagingStencilPython;vtkInteractionImagePython;vtkPythonInterpreterPython;vtkRenderingContextOpenGL2Python;vtkRenderingLODPython;vtkRenderingLabelPython;vtkRenderingMatplotlibPython;vtkRenderingVolumeOpenGL2Python;vtkViewsContext2DPython;vtkViewsInfovisPython;C:/Program Files/Python_3.6.1/libs/python36.lib


----- Mail original -----
De: "David Gobbi" <[hidden email]>
À: "Timothee Evain" <[hidden email]>
Cc: "VTK Users" <[hidden email]>, "Utkarsh Ayachit" <[hidden email]>
Envoyé: Mercredi 3 Mai 2017 02:08:05
Objet: Re: [vtkusers] Building VTK 7.1.1 with Python wrapping fail

Hi Timothee,

The "D" on the the vtk*PythonD does not mean "Debug".  Each build (whether
release or debug) will have a full set of vtk*PythonD libraries and
vtk*Python modules.  Both are needed for the VTK build.

My system doesn't have a python_d debug library (I'm OS X), but it is
probably unrelated to the link error, and it is totally unrelated to the
PythonD libraries.

As for the link error, it probably has to do with these lines in
Wrapping/Python/CMakeLists.txt:

  list(APPEND VTKPYTHON_LINK_LIBS ${vtkPython_LIBRARIES})
  target_link_libraries(vtkpython ${VTKPYTHON_LINK_LIBS})

Can you add the following immediately below these lines, and tell me what
is printed?

  message(STATUS "vtkPython_LIBRARIES ${vtkPython_LIBRARIES}")
  message(STATUS "VTKPYTHON_LINK_LIBS ${VTKPYTHON_LINK_LIBS}")

Regards,
 - David



On Tue, May 2, 2017 at 1:38 PM, Timothee Evain <[hidden email]>
wrote:

> Hello David,
>
> Some follow-up:
>
> After vtkPythonWrapping.cmake modification, the first set of error is gone.
> But then, linking fail for this project with:
> [...]
> 1>vtkPythonAppInit.obj : error LNK2019: unresolved external symbol
> initvtkCommonCorePython referenced in function "void __cdecl
> vtkpythonmodulesPythonLoadAllPythonModules(void)" (?
> vtkpythonmodulesPythonLoadAllPythonModules@@YAXXZ)
> 1>vtkPythonAppInit.obj : error LNK2019: unresolved external symbol
> initvtkCommonMathPython referenced in function "void __cdecl
> vtkpythonmodulesPythonLoadAllPythonModules(void)" (?
> vtkpythonmodulesPythonLoadAllPythonModules@@YAXXZ)
> 1>vtkPythonAppInit.obj : error LNK2019: unresolved external symbol
> initvtkCommonMiscPython referenced in function "void __cdecl
> vtkpythonmodulesPythonLoadAllPythonModules(void)" (?
> vtkpythonmodulesPythonLoadAllPythonModules@@YAXXZ)
> [...]
>
> Looking at the the vtkpython linking dependencies, I'm a bit confused.
> First of all, the python lib ([...]Python_3.6.1\libs\python36.lib) is set
> for release profile but also on debug (rather than [...]Python_3.6.1\libs\python36_d.lib
> ?) by cmake.
> Then, for both profiles are linked all the vtk*Python and all the
> vtk*PythonD libs, which seems unusual, as I was expecting vtk*Python libs
> in release and vtk*PythonD libs in debug.
> I'm not sure if this is an expected configuration, so I have not found the
> source of error.
>
> Don't hesitate to tell me if you need additionnal information!
>
> Tim
>
> ----- Mail original -----
> De: "David Gobbi" <[hidden email]>
> À: "Timothee Evain" <[hidden email]>
> Cc: "VTK Users" <[hidden email]>, "Utkarsh Ayachit" <
> [hidden email]>
> Envoyé: Lundi 1 Mai 2017 21:52:21
> Objet: Re: [vtkusers] Building VTK 7.1.1 with Python wrapping fail
>
> Hi Tim,
>
> As a temporary work-around, you can try modifying the VTK code yourself.
> In the VTK/CMake directory, there is a file called
> vtkPythonWrapping.cmake.  The following line (around line 195) is where the
> problem is:
>
>       set (EXTERN_DEFINES "${EXTERN_DEFINES}\n  extern void
> init${module}Python();")
>
> Try changing the "void" to "PyObject *":
>
>       set (EXTERN_DEFINES "${EXTERN_DEFINES}\n  extern PyObject
> *init${module}Python();")
>
> Let me know if that fixes the compile error.
>
>  - David
>
> On Mon, May 1, 2017 at 1:24 PM, David Gobbi <[hidden email]> wrote:
>
> > Hi Tim,
> >
> > I haven't seen this error message before, but my guess is that building
> > the Python wrappers with static linkage does not work with Python 3.  I'm
> > not sure how difficult this is to fix.  It might be as simple as adding a
> > couple #ifdefs to the code (to the VTK code, I mean.).
> >
> >  - David
> >
> >
> > On Mon, May 1, 2017 at 12:26 PM, Timothee Evain <
> > [hidden email]> wrote:
> >
> >> Hello everyone!
> >>
> >> I'm trying to build VTK 7.1.1 with the Python wrapping with Visual
> studio
> >> 2017 on Win10. Everything goes fine until the end of the build, where a
> >> bunch of error appears in the vtkpython project like :
> >>
> >> vtkPythonAppInit.cxx
> >> ...\VTK_7.1.1\Wrapping\Python\vtkpythonmodules.h(126): error C2664:
> 'int
> >> PyImport_AppendInittab(const char *,PyObject *(__cdecl *)(void))':
> cannot
> >> convert argument 2 from 'void (__cdecl *)(void)' to 'PyObject *(__cdecl
> >> *)(void)'
> >> ...\VTK_7.1.1\Wrapping\Python\vtkpythonmodules.h(126): note: None of
> the
> >> functions with this name in scope match the target type
> >> ...\VTK_7.1.1\Wrapping\Python\vtkpythonmodules.h(129): error C2664:
> 'int
> >> PyImport_AppendInittab(const char *,PyObject *(__cdecl *)(void))':
> cannot
> >> convert argument 2 from 'void (__cdecl *)(void)' to 'PyObject *(__cdecl
> >> *)(void)'
> >> ...\VTK_7.1.1\Wrapping\Python\vtkpythonmodules.h(129): note: None of
> the
> >> functions with this name in scope match the target type
> >>
> >> and so on. The only similar error in the mailing list is
> >> http://vtk.1045678.n5.nabble.com/VtK-7-python3-4-build-error
> >> -td5735728.html ; but that doesn't help me since my python path are
> >> correctly set.
> >>
> >> The building config is :
> >> Windows 10 x64
> >> Visual Studio 2017
> >> Python 3.6.1 (installed from python.org exe)
> >> VTK 7.1.1 with :
> >> -PYTHON_DEBUG_LIBRARY C:/Program Files/Python_3.6.1/libs/python36_d.lib
> >> -PYTHON_EXECUTABLE C:/Program Files/Python_3.6.1/python.exe
> >> -PYTHON_INCLUDE_DIR C:/Program Files/Python_3.6.1/include
> >> -PYTHON_LIBRARY C:/Program Files/Python_3.6.1/libs/python36.lib
> >> (-Static libraries)
> >>
> >> Anyone have already encountered such problems and solved it ?
> >>
> >> Thanks in advance.
> >>
> >> Tim
> >>
> >
>


_______________________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ

Search the list archives at: http://markmail.org/search/?q=vtkusers

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/vtkusers
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Building VTK 7.1.1 with Python wrapping fail

Timothee Evain
Hello David,

yes, the missing symbol errors are still there unfortunately, even with the CMakeLists fix.

Tim

----- Mail original -----
De: "David Gobbi" <[hidden email]>
À: "Timothee Evain" <[hidden email]>
Cc: "VTK Users" <[hidden email]>, "Utkarsh Ayachit" <[hidden email]>
Envoyé: Jeudi 4 Mai 2017 19:43:55
Objet: Re: [vtkusers] Building VTK 7.1.1 with Python wrapping fail

Hi Timothee,

I checked the logs, it looks like that change was done around one year ago,
but wasn't in the 7.1.1 release.

It looks like it links to the correct libraries, are you still seeing the
missing symbol errors?

 - David


On Wed, May 3, 2017 at 1:20 PM, Timothee Evain <[hidden email]>
wrote:

> Hi!
>
> That explains why the full are in both profile, thanks for the
> clarification!
>
> One strange thing about the CMakeLists.txt: the one I got downloading the
> 7.1.1 archive on vtk.org does not contain this part before
> "target_link_libraries(vtkpython ${VTKPYTHON_LINK_LIBS})" (around line
> 246) :
>
> # Add the libPython.dylib file and link explicitly against it.
> # This is needed because this is a new python executable, which needs it's
> libraries.
> find_package(PythonLibs REQUIRED)
> list(APPEND VTKPYTHON_LINK_LIBS ${vtkPython_LIBRARIES})
>
> that is in contrast to the file in github. Nonetheless, after fixing it,
> the reporting is :
>
> vtkPython_LIBRARIES C:/Program Files/Python_3.6.1/libs/python36.lib
>
> VTKPYTHON_LINK_LIBS vtkWrappingPythonCore;
> vtkCommonCorePython;
> vtkCommonMathPython;
> vtkCommonMiscPython;
> vtkCommonSystemPython;
> vtkCommonTransformsPython;
> vtkCommonDataModelPython;
> vtkCommonColorPython;
> vtkCommonExecutionModelPython;
> vtkCommonComputationalGeometryPython;
> vtkFiltersCorePython;
> vtkFiltersGeneralPython;
> vtkImagingCorePython;
> vtkImagingFourierPython;
> vtkFiltersStatisticsPython;
> vtkFiltersExtractionPython;
> vtkInfovisCorePython;
> vtkFiltersGeometryPython;
> vtkFiltersSourcesPython;
> vtkRenderingCorePython;
> vtkRenderingFreeTypePython;
> vtkRenderingContext2DPython;
> vtkChartsCorePython;
> vtkIOImagePython;
> vtkIOCorePython;
> vtkIOSQLPython;
> vtkImagingStatisticsPython;
> vtkInteractionStylePython;
> vtkRenderingImagePython;
> vtkRenderingOpenGL2Python;
> vtkDICOMPython;
> vtkIOLegacyPython;
> vtkIOXMLParserPython;
> vtkDomainsChemistryPython;
> vtkDomainsChemistryOpenGL2Python;
> vtkIOXMLPython;
> vtkParallelCorePython;
> vtkFiltersAMRPython;
> vtkFiltersFlowPathsPython;
> vtkFiltersGenericPython;
> vtkImagingSourcesPython;
> vtkFiltersHybridPython;
> vtkFiltersHyperTreePython;
> vtkImagingGeneralPython;
> vtkFiltersImagingPython;
> vtkFiltersModelingPython;
> vtkFiltersParallelPython;
> vtkFiltersParallelImagingPython;
> vtkFiltersPointsPython;vtkFiltersProgrammablePython;
> vtkFiltersPythonPython;vtkFiltersSMPPython;vtkFiltersSelectionPython;
> vtkFiltersTexturePython;vtkFiltersVerdictPython;vtkImagingHybridPython;
> vtkInfovisLayoutPython;vtkImagingColorPython;vtkRenderingAnnotationPython;
> vtkRenderingVolumePython;vtkInteractionWidgetsPython;vtkViewsCorePython;
> vtkGeovisCorePython;vtkIOAMRPython;vtkIOEnSightPython;vtkIOExodusPython;
> vtkRenderingGL2PSOpenGL2Python;vtkIOExportPython;vtkIOGeometryPython;
> vtkIOImportPython;vtkIOInfovisPython;vtkIOLSDynaPython;vtkIOMINCPython;
> vtkIOMoviePython;vtkIONetCDFPython;vtkIOPLYPython;vtkIOParallelPython;
> vtkIOParallelXMLPython;vtkIOTecplotTablePython;vtkIOVideoPython;
> vtkImagingMathPython;vtkImagingMorphologicalPython;
> vtkImagingOpenGL2Python;vtkImagingStencilPython;vtkInteractionImagePython;
> vtkPythonInterpreterPython;vtkRenderingContextOpenGL2Pyth
> on;vtkRenderingLODPython;vtkRenderingLabelPython;
> vtkRenderingMatplotlibPython;vtkRenderingVolumeOpenGL2Pytho
> n;vtkViewsContext2DPython;vtkViewsInfovisPython;C:/Program
> Files/Python_3.6.1/libs/python36.lib
>
>
> ----- Mail original -----
> De: "David Gobbi" <[hidden email]>
> À: "Timothee Evain" <[hidden email]>
> Cc: "VTK Users" <[hidden email]>, "Utkarsh Ayachit" <
> [hidden email]>
> Envoyé: Mercredi 3 Mai 2017 02:08:05
> Objet: Re: [vtkusers] Building VTK 7.1.1 with Python wrapping fail
>
> Hi Timothee,
>
> The "D" on the the vtk*PythonD does not mean "Debug".  Each build (whether
> release or debug) will have a full set of vtk*PythonD libraries and
> vtk*Python modules.  Both are needed for the VTK build.
>
> My system doesn't have a python_d debug library (I'm OS X), but it is
> probably unrelated to the link error, and it is totally unrelated to the
> PythonD libraries.
>
> As for the link error, it probably has to do with these lines in
> Wrapping/Python/CMakeLists.txt:
>
>   list(APPEND VTKPYTHON_LINK_LIBS ${vtkPython_LIBRARIES})
>   target_link_libraries(vtkpython ${VTKPYTHON_LINK_LIBS})
>
> Can you add the following immediately below these lines, and tell me what
> is printed?
>
>   message(STATUS "vtkPython_LIBRARIES ${vtkPython_LIBRARIES}")
>   message(STATUS "VTKPYTHON_LINK_LIBS ${VTKPYTHON_LINK_LIBS}")
>
> Regards,
>  - David
>
>
>
> On Tue, May 2, 2017 at 1:38 PM, Timothee Evain <
> [hidden email]>
> wrote:
>
> > Hello David,
> >
> > Some follow-up:
> >
> > After vtkPythonWrapping.cmake modification, the first set of error is
> gone.
> > But then, linking fail for this project with:
> > [...]
> > 1>vtkPythonAppInit.obj : error LNK2019: unresolved external symbol
> > initvtkCommonCorePython referenced in function "void __cdecl
> > vtkpythonmodulesPythonLoadAllPythonModules(void)" (?
> > vtkpythonmodulesPythonLoadAllPythonModules@@YAXXZ)
> > 1>vtkPythonAppInit.obj : error LNK2019: unresolved external symbol
> > initvtkCommonMathPython referenced in function "void __cdecl
> > vtkpythonmodulesPythonLoadAllPythonModules(void)" (?
> > vtkpythonmodulesPythonLoadAllPythonModules@@YAXXZ)
> > 1>vtkPythonAppInit.obj : error LNK2019: unresolved external symbol
> > initvtkCommonMiscPython referenced in function "void __cdecl
> > vtkpythonmodulesPythonLoadAllPythonModules(void)" (?
> > vtkpythonmodulesPythonLoadAllPythonModules@@YAXXZ)
> > [...]
> >
> > Looking at the the vtkpython linking dependencies, I'm a bit confused.
> > First of all, the python lib ([...]Python_3.6.1\libs\python36.lib) is
> set
> > for release profile but also on debug (rather than
> [...]Python_3.6.1\libs\python36_d.lib
> > ?) by cmake.
> > Then, for both profiles are linked all the vtk*Python and all the
> > vtk*PythonD libs, which seems unusual, as I was expecting vtk*Python libs
> > in release and vtk*PythonD libs in debug.
> > I'm not sure if this is an expected configuration, so I have not found
> the
> > source of error.
> >
> > Don't hesitate to tell me if you need additionnal information!
> >
> > Tim
> >
> > ----- Mail original -----
> > De: "David Gobbi" <[hidden email]>
> > À: "Timothee Evain" <[hidden email]>
> > Cc: "VTK Users" <[hidden email]>, "Utkarsh Ayachit" <
> > [hidden email]>
> > Envoyé: Lundi 1 Mai 2017 21:52:21
> > Objet: Re: [vtkusers] Building VTK 7.1.1 with Python wrapping fail
> >
> > Hi Tim,
> >
> > As a temporary work-around, you can try modifying the VTK code yourself.
> > In the VTK/CMake directory, there is a file called
> > vtkPythonWrapping.cmake.  The following line (around line 195) is where
> the
> > problem is:
> >
> >       set (EXTERN_DEFINES "${EXTERN_DEFINES}\n  extern void
> > init${module}Python();")
> >
> > Try changing the "void" to "PyObject *":
> >
> >       set (EXTERN_DEFINES "${EXTERN_DEFINES}\n  extern PyObject
> > *init${module}Python();")
> >
> > Let me know if that fixes the compile error.
> >
> >  - David
> >
> > On Mon, May 1, 2017 at 1:24 PM, David Gobbi <[hidden email]>
> wrote:
> >
> > > Hi Tim,
> > >
> > > I haven't seen this error message before, but my guess is that building
> > > the Python wrappers with static linkage does not work with Python 3.
> I'm
> > > not sure how difficult this is to fix.  It might be as simple as
> adding a
> > > couple #ifdefs to the code (to the VTK code, I mean.).
> > >
> > >  - David
> > >
> > >
> > > On Mon, May 1, 2017 at 12:26 PM, Timothee Evain <
> > > [hidden email]> wrote:
> > >
> > >> Hello everyone!
> > >>
> > >> I'm trying to build VTK 7.1.1 with the Python wrapping with Visual
> > studio
> > >> 2017 on Win10. Everything goes fine until the end of the build, where
> a
> > >> bunch of error appears in the vtkpython project like :
> > >>
> > >> vtkPythonAppInit.cxx
> > >> ...\VTK_7.1.1\Wrapping\Python\vtkpythonmodules.h(126): error C2664:
> > 'int
> > >> PyImport_AppendInittab(const char *,PyObject *(__cdecl *)(void))':
> > cannot
> > >> convert argument 2 from 'void (__cdecl *)(void)' to 'PyObject
> *(__cdecl
> > >> *)(void)'
> > >> ...\VTK_7.1.1\Wrapping\Python\vtkpythonmodules.h(126): note: None of
> > the
> > >> functions with this name in scope match the target type
> > >> ...\VTK_7.1.1\Wrapping\Python\vtkpythonmodules.h(129): error C2664:
> > 'int
> > >> PyImport_AppendInittab(const char *,PyObject *(__cdecl *)(void))':
> > cannot
> > >> convert argument 2 from 'void (__cdecl *)(void)' to 'PyObject
> *(__cdecl
> > >> *)(void)'
> > >> ...\VTK_7.1.1\Wrapping\Python\vtkpythonmodules.h(129): note: None of
> > the
> > >> functions with this name in scope match the target type
> > >>
> > >> and so on. The only similar error in the mailing list is
> > >> http://vtk.1045678.n5.nabble.com/VtK-7-python3-4-build-error
> > >> -td5735728.html ; but that doesn't help me since my python path are
> > >> correctly set.
> > >>
> > >> The building config is :
> > >> Windows 10 x64
> > >> Visual Studio 2017
> > >> Python 3.6.1 (installed from python.org exe)
> > >> VTK 7.1.1 with :
> > >> -PYTHON_DEBUG_LIBRARY C:/Program Files/Python_3.6.1/libs/
> python36_d.lib
> > >> -PYTHON_EXECUTABLE C:/Program Files/Python_3.6.1/python.exe
> > >> -PYTHON_INCLUDE_DIR C:/Program Files/Python_3.6.1/include
> > >> -PYTHON_LIBRARY C:/Program Files/Python_3.6.1/libs/python36.lib
> > >> (-Static libraries)
> > >>
> > >> Anyone have already encountered such problems and solved it ?
> > >>
> > >> Thanks in advance.
> > >>
> > >> Tim
> > >>
> > >
> >
>
_______________________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ

Search the list archives at: http://markmail.org/search/?q=vtkusers

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/vtkusers
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Building VTK 7.1.1 with Python wrapping fail

David Gobbi
Hi Tomothee,

I think I made a mistake in the first fix that I suggested.  The correct name of the init methods is PyInit_vtkXXPython(), so the code in vtkPythonWrapping.cmake should be this:

      set (EXTERN_DEFINES "${EXTERN_DEFINES}\n  extern PyObject *PyInit_${module}Python();")

Hopefully that will work.

 - David


On Thu, May 4, 2017 at 11:49 AM, Timothee Evain <[hidden email]> wrote:
Hello David,

yes, the missing symbol errors are still there unfortunately, even with the CMakeLists fix.

Tim

----- Mail original -----
De: "David Gobbi" <[hidden email]>
À: "Timothee Evain" <[hidden email]>
Cc: "VTK Users" <[hidden email]>, "Utkarsh Ayachit" <[hidden email]>
Envoyé: Jeudi 4 Mai 2017 19:43:55
Objet: Re: [vtkusers] Building VTK 7.1.1 with Python wrapping fail

Hi Timothee,

I checked the logs, it looks like that change was done around one year ago,
but wasn't in the 7.1.1 release.

It looks like it links to the correct libraries, are you still seeing the
missing symbol errors?

 - David


On Wed, May 3, 2017 at 1:20 PM, Timothee Evain <[hidden email]>
wrote:

> Hi!
>
> That explains why the full are in both profile, thanks for the
> clarification!
>
> One strange thing about the CMakeLists.txt: the one I got downloading the
> 7.1.1 archive on vtk.org does not contain this part before
> "target_link_libraries(vtkpython ${VTKPYTHON_LINK_LIBS})" (around line
> 246) :
>
> # Add the libPython.dylib file and link explicitly against it.
> # This is needed because this is a new python executable, which needs it's
> libraries.
> find_package(PythonLibs REQUIRED)
> list(APPEND VTKPYTHON_LINK_LIBS ${vtkPython_LIBRARIES})
>
> that is in contrast to the file in github. Nonetheless, after fixing it,
> the reporting is :
>
> vtkPython_LIBRARIES C:/Program Files/Python_3.6.1/libs/python36.lib
>
> VTKPYTHON_LINK_LIBS vtkWrappingPythonCore;
> vtkCommonCorePython;
> vtkCommonMathPython;
> vtkCommonMiscPython;
> vtkCommonSystemPython;
> vtkCommonTransformsPython;
> vtkCommonDataModelPython;
> vtkCommonColorPython;
> vtkCommonExecutionModelPython;
> vtkCommonComputationalGeometryPython;
> vtkFiltersCorePython;
> vtkFiltersGeneralPython;
> vtkImagingCorePython;
> vtkImagingFourierPython;
> vtkFiltersStatisticsPython;
> vtkFiltersExtractionPython;
> vtkInfovisCorePython;
> vtkFiltersGeometryPython;
> vtkFiltersSourcesPython;
> vtkRenderingCorePython;
> vtkRenderingFreeTypePython;
> vtkRenderingContext2DPython;
> vtkChartsCorePython;
> vtkIOImagePython;
> vtkIOCorePython;
> vtkIOSQLPython;
> vtkImagingStatisticsPython;
> vtkInteractionStylePython;
> vtkRenderingImagePython;
> vtkRenderingOpenGL2Python;
> vtkDICOMPython;
> vtkIOLegacyPython;
> vtkIOXMLParserPython;
> vtkDomainsChemistryPython;
> vtkDomainsChemistryOpenGL2Python;
> vtkIOXMLPython;
> vtkParallelCorePython;
> vtkFiltersAMRPython;
> vtkFiltersFlowPathsPython;
> vtkFiltersGenericPython;
> vtkImagingSourcesPython;
> vtkFiltersHybridPython;
> vtkFiltersHyperTreePython;
> vtkImagingGeneralPython;
> vtkFiltersImagingPython;
> vtkFiltersModelingPython;
> vtkFiltersParallelPython;
> vtkFiltersParallelImagingPython;
> vtkFiltersPointsPython;vtkFiltersProgrammablePython;
> vtkFiltersPythonPython;vtkFiltersSMPPython;vtkFiltersSelectionPython;
> vtkFiltersTexturePython;vtkFiltersVerdictPython;vtkImagingHybridPython;
> vtkInfovisLayoutPython;vtkImagingColorPython;vtkRenderingAnnotationPython;
> vtkRenderingVolumePython;vtkInteractionWidgetsPython;vtkViewsCorePython;
> vtkGeovisCorePython;vtkIOAMRPython;vtkIOEnSightPython;vtkIOExodusPython;
> vtkRenderingGL2PSOpenGL2Python;vtkIOExportPython;vtkIOGeometryPython;
> vtkIOImportPython;vtkIOInfovisPython;vtkIOLSDynaPython;vtkIOMINCPython;
> vtkIOMoviePython;vtkIONetCDFPython;vtkIOPLYPython;vtkIOParallelPython;
> vtkIOParallelXMLPython;vtkIOTecplotTablePython;vtkIOVideoPython;
> vtkImagingMathPython;vtkImagingMorphologicalPython;
> vtkImagingOpenGL2Python;vtkImagingStencilPython;vtkInteractionImagePython;
> vtkPythonInterpreterPython;vtkRenderingContextOpenGL2Pyth
> on;vtkRenderingLODPython;vtkRenderingLabelPython;
> vtkRenderingMatplotlibPython;vtkRenderingVolumeOpenGL2Pytho
> n;vtkViewsContext2DPython;vtkViewsInfovisPython;C:/Program
> Files/Python_3.6.1/libs/python36.lib
>
>
> ----- Mail original -----
> De: "David Gobbi" <[hidden email]>
> À: "Timothee Evain" <[hidden email]>
> Cc: "VTK Users" <[hidden email]>, "Utkarsh Ayachit" <
> [hidden email]>
> Envoyé: Mercredi 3 Mai 2017 02:08:05
> Objet: Re: [vtkusers] Building VTK 7.1.1 with Python wrapping fail
>
> Hi Timothee,
>
> The "D" on the the vtk*PythonD does not mean "Debug".  Each build (whether
> release or debug) will have a full set of vtk*PythonD libraries and
> vtk*Python modules.  Both are needed for the VTK build.
>
> My system doesn't have a python_d debug library (I'm OS X), but it is
> probably unrelated to the link error, and it is totally unrelated to the
> PythonD libraries.
>
> As for the link error, it probably has to do with these lines in
> Wrapping/Python/CMakeLists.txt:
>
>   list(APPEND VTKPYTHON_LINK_LIBS ${vtkPython_LIBRARIES})
>   target_link_libraries(vtkpython ${VTKPYTHON_LINK_LIBS})
>
> Can you add the following immediately below these lines, and tell me what
> is printed?
>
>   message(STATUS "vtkPython_LIBRARIES ${vtkPython_LIBRARIES}")
>   message(STATUS "VTKPYTHON_LINK_LIBS ${VTKPYTHON_LINK_LIBS}")
>
> Regards,
>  - David
>
>
>
> On Tue, May 2, 2017 at 1:38 PM, Timothee Evain <
> [hidden email]>
> wrote:
>
> > Hello David,
> >
> > Some follow-up:
> >
> > After vtkPythonWrapping.cmake modification, the first set of error is
> gone.
> > But then, linking fail for this project with:
> > [...]
> > 1>vtkPythonAppInit.obj : error LNK2019: unresolved external symbol
> > initvtkCommonCorePython referenced in function "void __cdecl
> > vtkpythonmodulesPythonLoadAllPythonModules(void)" (?
> > vtkpythonmodulesPythonLoadAllPythonModules@@YAXXZ)
> > 1>vtkPythonAppInit.obj : error LNK2019: unresolved external symbol
> > initvtkCommonMathPython referenced in function "void __cdecl
> > vtkpythonmodulesPythonLoadAllPythonModules(void)" (?
> > vtkpythonmodulesPythonLoadAllPythonModules@@YAXXZ)
> > 1>vtkPythonAppInit.obj : error LNK2019: unresolved external symbol
> > initvtkCommonMiscPython referenced in function "void __cdecl
> > vtkpythonmodulesPythonLoadAllPythonModules(void)" (?
> > vtkpythonmodulesPythonLoadAllPythonModules@@YAXXZ)
> > [...]
> >
> > Looking at the the vtkpython linking dependencies, I'm a bit confused.
> > First of all, the python lib ([...]Python_3.6.1\libs\python36.lib) is
> set
> > for release profile but also on debug (rather than
> [...]Python_3.6.1\libs\python36_d.lib
> > ?) by cmake.
> > Then, for both profiles are linked all the vtk*Python and all the
> > vtk*PythonD libs, which seems unusual, as I was expecting vtk*Python libs
> > in release and vtk*PythonD libs in debug.
> > I'm not sure if this is an expected configuration, so I have not found
> the
> > source of error.
> >
> > Don't hesitate to tell me if you need additionnal information!
> >
> > Tim
> >
> > ----- Mail original -----
> > De: "David Gobbi" <[hidden email]>
> > À: "Timothee Evain" <[hidden email]>
> > Cc: "VTK Users" <[hidden email]>, "Utkarsh Ayachit" <
> > [hidden email]>
> > Envoyé: Lundi 1 Mai 2017 21:52:21
> > Objet: Re: [vtkusers] Building VTK 7.1.1 with Python wrapping fail
> >
> > Hi Tim,
> >
> > As a temporary work-around, you can try modifying the VTK code yourself.
> > In the VTK/CMake directory, there is a file called
> > vtkPythonWrapping.cmake.  The following line (around line 195) is where
> the
> > problem is:
> >
> >       set (EXTERN_DEFINES "${EXTERN_DEFINES}\n  extern void
> > init${module}Python();")
> >
> > Try changing the "void" to "PyObject *":
> >
> >       set (EXTERN_DEFINES "${EXTERN_DEFINES}\n  extern PyObject
> > *init${module}Python();")
> >
> > Let me know if that fixes the compile error.
> >
> >  - David
> >
> > On Mon, May 1, 2017 at 1:24 PM, David Gobbi <[hidden email]>
> wrote:
> >
> > > Hi Tim,
> > >
> > > I haven't seen this error message before, but my guess is that building
> > > the Python wrappers with static linkage does not work with Python 3.
> I'm
> > > not sure how difficult this is to fix.  It might be as simple as
> adding a
> > > couple #ifdefs to the code (to the VTK code, I mean.).
> > >
> > >  - David
> > >
> > >
> > > On Mon, May 1, 2017 at 12:26 PM, Timothee Evain <
> > > [hidden email]> wrote:
> > >
> > >> Hello everyone!
> > >>
> > >> I'm trying to build VTK 7.1.1 with the Python wrapping with Visual
> > studio
> > >> 2017 on Win10. Everything goes fine until the end of the build, where
> a
> > >> bunch of error appears in the vtkpython project like :
> > >>
> > >> vtkPythonAppInit.cxx
> > >> ...\VTK_7.1.1\Wrapping\Python\vtkpythonmodules.h(126): error C2664:
> > 'int
> > >> PyImport_AppendInittab(const char *,PyObject *(__cdecl *)(void))':
> > cannot
> > >> convert argument 2 from 'void (__cdecl *)(void)' to 'PyObject
> *(__cdecl
> > >> *)(void)'
> > >> ...\VTK_7.1.1\Wrapping\Python\vtkpythonmodules.h(126): note: None of
> > the
> > >> functions with this name in scope match the target type
> > >> ...\VTK_7.1.1\Wrapping\Python\vtkpythonmodules.h(129): error C2664:
> > 'int
> > >> PyImport_AppendInittab(const char *,PyObject *(__cdecl *)(void))':
> > cannot
> > >> convert argument 2 from 'void (__cdecl *)(void)' to 'PyObject
> *(__cdecl
> > >> *)(void)'
> > >> ...\VTK_7.1.1\Wrapping\Python\vtkpythonmodules.h(129): note: None of
> > the
> > >> functions with this name in scope match the target type
> > >>
> > >> and so on. The only similar error in the mailing list is
> > >> http://vtk.1045678.n5.nabble.com/VtK-7-python3-4-build-error
> > >> -td5735728.html ; but that doesn't help me since my python path are
> > >> correctly set.
> > >>
> > >> The building config is :
> > >> Windows 10 x64
> > >> Visual Studio 2017
> > >> Python 3.6.1 (installed from python.org exe)
> > >> VTK 7.1.1 with :
> > >> -PYTHON_DEBUG_LIBRARY C:/Program Files/Python_3.6.1/libs/
> python36_d.lib
> > >> -PYTHON_EXECUTABLE C:/Program Files/Python_3.6.1/python.exe
> > >> -PYTHON_INCLUDE_DIR C:/Program Files/Python_3.6.1/include
> > >> -PYTHON_LIBRARY C:/Program Files/Python_3.6.1/libs/python36.lib
> > >> (-Static libraries)
> > >>
> > >> Anyone have already encountered such problems and solved it ?
> > >>
> > >> Thanks in advance.
> > >>
> > >> Tim
> > >>
> > >
> >
>


_______________________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ

Search the list archives at: http://markmail.org/search/?q=vtkusers

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/vtkusers
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Building VTK 7.1.1 with Python wrapping fail

Timothee Evain
Hi David,

With you suggestion, there are errors in pythonmodules.h (undeclared identifiers). The names of modules don't correspond anymore with the ones in the vtkpythonmodulesPythonLoadAllPythonModules() function.

So I changed also this line in the vtkPythonWrapping.cmake (3 lines after your fix):

PyImport_AppendInittab(name${module}, init${module}Python);")
into
PyImport_AppendInittab(name${module}, PyInit${module}Python);")

But then, I get the same linking errors as usual :
[...]
290>vtkPythonAppInit.obj : error LNK2019: unresolved external symbol PyInitvtkCommonMathPython referenced in function "void __cdecl vtkpythonmodulesPythonLoadAllPythonModules(void)" (?vtkpythonmodulesPythonLoadAllPythonModules@@YAXXZ)
290>vtkPythonAppInit.obj : error LNK2019: unresolved external symbol PyInitvtkCommonMiscPython referenced in function "void __cdecl vtkpythonmodulesPythonLoadAllPythonModules(void)" (?vtkpythonmodulesPythonLoadAllPythonModules@@YAXXZ)
290>vtkPythonAppInit.obj : error LNK2019: unresolved external symbol PyInitvtkCommonSystemPython referenced in function "void __cdecl vtkpythonmodulesPythonLoadAllPythonModules(void)" (?vtkpythonmodulesPythonLoadAllPythonModules@@YAXXZ)
[...]

Tim


----- Mail original -----
De: "David Gobbi" <[hidden email]>
À: "Timothee Evain" <[hidden email]>
Cc: "VTK Users" <[hidden email]>, "Utkarsh Ayachit" <[hidden email]>
Envoyé: Jeudi 4 Mai 2017 22:30:20
Objet: Re: [vtkusers] Building VTK 7.1.1 with Python wrapping fail

Hi Tomothee,

I think I made a mistake in the first fix that I suggested.  The correct
name of the init methods is PyInit_vtkXXPython(), so the code in
vtkPythonWrapping.cmake should be this:

      set (EXTERN_DEFINES "${EXTERN_DEFINES}\n  extern PyObject
*PyInit_${module}Python();")

Hopefully that will work.

 - David


_______________________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ

Search the list archives at: http://markmail.org/search/?q=vtkusers

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/vtkusers
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Building VTK 7.1.1 with Python wrapping fail

David Gobbi
There needs to be an underscore after PyInit (e.g. PyInit_vtkCommonMathPython).

On Thu, May 4, 2017 at 4:23 PM, Timothee Evain <[hidden email]> wrote:
Hi David,

With you suggestion, there are errors in pythonmodules.h (undeclared identifiers). The names of modules don't correspond anymore with the ones in the vtkpythonmodulesPythonLoadAllPythonModules() function.

So I changed also this line in the vtkPythonWrapping.cmake (3 lines after your fix):

PyImport_AppendInittab(name${module}, init${module}Python);")
into
PyImport_AppendInittab(name${module}, PyInit${module}Python);")

But then, I get the same linking errors as usual :
[...]
290>vtkPythonAppInit.obj : error LNK2019: unresolved external symbol PyInitvtkCommonMathPython referenced in function "void __cdecl vtkpythonmodulesPythonLoadAllPythonModules(void)" (?vtkpythonmodulesPythonLoadAllPythonModules@@YAXXZ)
290>vtkPythonAppInit.obj : error LNK2019: unresolved external symbol PyInitvtkCommonMiscPython referenced in function "void __cdecl vtkpythonmodulesPythonLoadAllPythonModules(void)" (?vtkpythonmodulesPythonLoadAllPythonModules@@YAXXZ)
290>vtkPythonAppInit.obj : error LNK2019: unresolved external symbol PyInitvtkCommonSystemPython referenced in function "void __cdecl vtkpythonmodulesPythonLoadAllPythonModules(void)" (?vtkpythonmodulesPythonLoadAllPythonModules@@YAXXZ)
[...]

Tim


----- Mail original -----
De: "David Gobbi" <[hidden email]>
À: "Timothee Evain" <[hidden email]>
Cc: "VTK Users" <[hidden email]>, "Utkarsh Ayachit" <[hidden email]>
Envoyé: Jeudi 4 Mai 2017 22:30:20
Objet: Re: [vtkusers] Building VTK 7.1.1 with Python wrapping fail

Hi Tomothee,

I think I made a mistake in the first fix that I suggested.  The correct
name of the init methods is PyInit_vtkXXPython(), so the code in
vtkPythonWrapping.cmake should be this:

      set (EXTERN_DEFINES "${EXTERN_DEFINES}\n  extern PyObject
*PyInit_${module}Python();")

Hopefully that will work.

 - David




_______________________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ

Search the list archives at: http://markmail.org/search/?q=vtkusers

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/vtkusers
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Building VTK 7.1.1 with Python wrapping fail

Timothee Evain
Hi,

My bad, I didn't notice it.
But good news, it works!
So to resume, I had to change the vtkPythonWrapping.cmake like this :

if (NOT BUILD_SHARED_LIBS)
    # fill in the init functions only when BUILD_SHARED_LIBS is OFF.
    foreach (module ${ARGN})
      set (EXTERN_DEFINES "${EXTERN_DEFINES}\n  extern PyObject *PyInit_${module}Python();")
      set (INIT_CALLS "${INIT_CALLS}\n
  static char name${module}[] = \"${module}Python\";
  PyImport_AppendInittab(name${module}, PyInit_${module}Python);")
    endforeach()
  endif()

Another thing is that cmake detected a python debug library on my system (PYTHON_DEBUG_LIBRARY variable), but there is a mistake in the lib list to link for debug profile, it's the release python lib which is set. I just had to change that in the linking to get it work for both profile. I made it through manual modification on my VS project, I guess this can be achieved through CMake, but I don't know where.

Anyhow, I would like to thank you for all the help and the time you put on my problem, that was really appreciated !

Tim

----- Mail original -----
De: "David Gobbi" <[hidden email]>
À: "Timothee Evain" <[hidden email]>
Cc: "VTK Users" <[hidden email]>, "Utkarsh Ayachit" <[hidden email]>
Envoyé: Vendredi 5 Mai 2017 00:27:51
Objet: Re: [vtkusers] Building VTK 7.1.1 with Python wrapping fail

There needs to be an underscore after PyInit (e.g.
PyInit_vtkCommonMathPython).

On Thu, May 4, 2017 at 4:23 PM, Timothee Evain <[hidden email]>
wrote:

> Hi David,
>
> With you suggestion, there are errors in pythonmodules.h (undeclared
> identifiers). The names of modules don't correspond anymore with the ones
> in the vtkpythonmodulesPythonLoadAllPythonModules() function.
>
> So I changed also this line in the vtkPythonWrapping.cmake (3 lines after
> your fix):
>
> PyImport_AppendInittab(name${module}, init${module}Python);")
> into
> PyImport_AppendInittab(name${module}, PyInit${module}Python);")
>
> But then, I get the same linking errors as usual :
> [...]
> 290>vtkPythonAppInit.obj : error LNK2019: unresolved external symbol
> PyInitvtkCommonMathPython referenced in function "void __cdecl
> vtkpythonmodulesPythonLoadAllPythonModules(void)" (?
> vtkpythonmodulesPythonLoadAllPythonModules@@YAXXZ)
> 290>vtkPythonAppInit.obj : error LNK2019: unresolved external symbol
> PyInitvtkCommonMiscPython referenced in function "void __cdecl
> vtkpythonmodulesPythonLoadAllPythonModules(void)" (?
> vtkpythonmodulesPythonLoadAllPythonModules@@YAXXZ)
> 290>vtkPythonAppInit.obj : error LNK2019: unresolved external symbol
> PyInitvtkCommonSystemPython referenced in function "void __cdecl
> vtkpythonmodulesPythonLoadAllPythonModules(void)" (?
> vtkpythonmodulesPythonLoadAllPythonModules@@YAXXZ)
> [...]
>
> Tim
>
>
> ----- Mail original -----
> De: "David Gobbi" <[hidden email]>
> À: "Timothee Evain" <[hidden email]>
> Cc: "VTK Users" <[hidden email]>, "Utkarsh Ayachit" <
> [hidden email]>
> Envoyé: Jeudi 4 Mai 2017 22:30:20
> Objet: Re: [vtkusers] Building VTK 7.1.1 with Python wrapping fail
>
> Hi Tomothee,
>
> I think I made a mistake in the first fix that I suggested.  The correct
> name of the init methods is PyInit_vtkXXPython(), so the code in
> vtkPythonWrapping.cmake should be this:
>
>       set (EXTERN_DEFINES "${EXTERN_DEFINES}\n  extern PyObject
> *PyInit_${module}Python();")
>
> Hopefully that will work.
>
>  - David
>
>
>
_______________________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ

Search the list archives at: http://markmail.org/search/?q=vtkusers

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/vtkusers
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Building VTK 7.1.1 with Python wrapping fail

David Gobbi
Hi Timothee,

I'm glad that you got it working, I've submitted a bug fix for vtkPythonWrapping (https://gitlab.kitware.com/vtk/vtk/merge_requests/2786).

Hopefully someone will pick up the PYTHON_DEBUG_LIBRARY issue and get it fixed.

 - David


On Fri, May 5, 2017 at 2:00 AM, Timothee Evain <[hidden email]> wrote:
Hi,

My bad, I didn't notice it.
But good news, it works!
So to resume, I had to change the vtkPythonWrapping.cmake like this :

if (NOT BUILD_SHARED_LIBS)
    # fill in the init functions only when BUILD_SHARED_LIBS is OFF.
    foreach (module ${ARGN})
      set (EXTERN_DEFINES "${EXTERN_DEFINES}\n  extern PyObject *PyInit_${module}Python();")
      set (INIT_CALLS "${INIT_CALLS}\n
  static char name${module}[] = \"${module}Python\";
  PyImport_AppendInittab(name${module}, PyInit_${module}Python);")
    endforeach()
  endif()

Another thing is that cmake detected a python debug library on my system (PYTHON_DEBUG_LIBRARY variable), but there is a mistake in the lib list to link for debug profile, it's the release python lib which is set. I just had to change that in the linking to get it work for both profile. I made it through manual modification on my VS project, I guess this can be achieved through CMake, but I don't know where.

Anyhow, I would like to thank you for all the help and the time you put on my problem, that was really appreciated !

Tim

----- Mail original -----
De: "David Gobbi" <[hidden email]>
À: "Timothee Evain" <[hidden email]>
Cc: "VTK Users" <[hidden email]>, "Utkarsh Ayachit" <[hidden email]>
Envoyé: Vendredi 5 Mai 2017 00:27:51
Objet: Re: [vtkusers] Building VTK 7.1.1 with Python wrapping fail

There needs to be an underscore after PyInit (e.g.
PyInit_vtkCommonMathPython).

On Thu, May 4, 2017 at 4:23 PM, Timothee Evain <[hidden email]>
wrote:

> Hi David,
>
> With you suggestion, there are errors in pythonmodules.h (undeclared
> identifiers). The names of modules don't correspond anymore with the ones
> in the vtkpythonmodulesPythonLoadAllPythonModules() function.
>
> So I changed also this line in the vtkPythonWrapping.cmake (3 lines after
> your fix):
>
> PyImport_AppendInittab(name${module}, init${module}Python);")
> into
> PyImport_AppendInittab(name${module}, PyInit${module}Python);")
>
> But then, I get the same linking errors as usual :
> [...]
> 290>vtkPythonAppInit.obj : error LNK2019: unresolved external symbol
> PyInitvtkCommonMathPython referenced in function "void __cdecl
> vtkpythonmodulesPythonLoadAllPythonModules(void)" (?
> vtkpythonmodulesPythonLoadAllPythonModules@@YAXXZ)
> 290>vtkPythonAppInit.obj : error LNK2019: unresolved external symbol
> PyInitvtkCommonMiscPython referenced in function "void __cdecl
> vtkpythonmodulesPythonLoadAllPythonModules(void)" (?
> vtkpythonmodulesPythonLoadAllPythonModules@@YAXXZ)
> 290>vtkPythonAppInit.obj : error LNK2019: unresolved external symbol
> PyInitvtkCommonSystemPython referenced in function "void __cdecl
> vtkpythonmodulesPythonLoadAllPythonModules(void)" (?
> vtkpythonmodulesPythonLoadAllPythonModules@@YAXXZ)
> [...]
>
> Tim
>
>
> ----- Mail original -----
> De: "David Gobbi" <[hidden email]>
> À: "Timothee Evain" <[hidden email]>
> Cc: "VTK Users" <[hidden email]>, "Utkarsh Ayachit" <
> [hidden email]>
> Envoyé: Jeudi 4 Mai 2017 22:30:20
> Objet: Re: [vtkusers] Building VTK 7.1.1 with Python wrapping fail
>
> Hi Tomothee,
>
> I think I made a mistake in the first fix that I suggested.  The correct
> name of the init methods is PyInit_vtkXXPython(), so the code in
> vtkPythonWrapping.cmake should be this:
>
>       set (EXTERN_DEFINES "${EXTERN_DEFINES}\n  extern PyObject
> *PyInit_${module}Python();")
>
> Hopefully that will work.
>
>  - David
>
>
>


_______________________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ

Search the list archives at: http://markmail.org/search/?q=vtkusers

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/vtkusers
Loading...