<div dir="ltr"><div><div><div>It seems I was a bit premature in jumping to the conclusion that my VTK installation was complete :-). Yes I did generate a vtkpython.exe but that was with the 2.7.0 installation. When I did run this with Python3.5 I got an error. <br><br></div>So I went back to the build process specifically cmake and these are the errors I got when I typed make -j8 <br><br><br></div>This is my cmake command - <pre><code>cmake ../ -DBUILD_SHARED_LIBS=ON -DBUILD_TESTING=ON -DCMAKE_BUILD_TYPE=Release -DVTK_WRAP_PYTHON=ON -DVTK_PYTHON_VERSION=3.5 -DPYTHON_EXECUTABLE=/usr/bin/python3.5 -DPYTHON_INCLUDE_DIR=/usr/include/python3.5 -DPYTHON_LIBRARY_PATH=/usr/lib/python3.5
</code></pre><br><br></div>I presume VTK can be compiled with Python 3.5 or not ? I am not sure. Apologies for the earlier over sight. This is on Ubuntu 16.04. <br><div><div><br><br><pre><code>vtkPythonAppInit.cxx:(.text+0x97): undefined reference to `PyList_Insert'
CMakeFiles/vtkpython.dir/vtkPythonAppInit.cxx.o: In function `
vtkPythonAppInitPrependPythonPath(char const*) [clone .constprop.33]':
vtkPythonAppInit.cxx:(.text+0x322): undefined reference to `PySys_GetObject'
vtkPythonAppInit.cxx:(.text+0x32f): undefined reference to `PyUnicode_FromString'
vtkPythonAppInit.cxx:(.text+0x33f): undefined reference to `PyList_Insert'
CMakeFiles/vtkpython.dir/vtkPythonAppInit.cxx.o: In function `main':
vtkPythonAppInit.cxx:(.text.startup+0xf9): undefined reference to `Py_DecodeLocale'
vtkPythonAppInit.cxx:(.text.startup+0x10f): undefined reference to `Py_SetProgramName'
vtkPythonAppInit.cxx:(.text.startup+0x114): undefined reference to `Py_Initialize'
vtkPythonAppInit.cxx:(.text.startup+0x119): undefined reference to `PyEval_InitThreads'
vtkPythonAppInit.cxx:(.text.startup+0x14d): undefined reference to `PySys_GetObject'
vtkPythonAppInit.cxx:(.text.startup+0x155): undefined reference to ` PyUnicode_EncodeFSDefault'
vtkPythonAppInit.cxx:(.text.startup+0x162): undefined reference to `PyBytes_AsString'
vtkPythonAppInit.cxx:(.text.startup+0x471): undefined reference to `Py_DecodeLocale'
vtkPythonAppInit.cxx:(.text.startup+0x4ad): undefined reference to `PyMem_Free'
vtkPythonAppInit.cxx:(.text.startup+0x4bf): undefined reference to `PyMem_Free'
vtkPythonAppInit.cxx:(.text.startup+0xc92): undefined reference to `Py_Main'
vtkPythonAppInit.cxx:(.text.startup+0xc9e): undefined reference to `PyMem_Free'
vtkPythonAppInit.cxx:(.text.startup+0xcc4): undefined reference to `PyMem_Free'
collect2: error: ld returned 1 exit status
Wrapping/Python/CMakeFiles/vtkpython.dir/build.make:98: recipe for target 'bin/vtkpython' failed
make[2]: *** [bin/vtkpython] Error 1
CMakeFiles/Makefile2:25907: recipe for target 'Wrapping/Python/CMakeFiles/vtkpython.dir/all' failed
make[1]: *** [Wrapping/Python/CMakeFiles/vtkpython.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....
[ 9%] Built target vtkNetCDF
[ 30%] Built target VTKData
[ 31%] Built target vtkCommonCoreCxxTests
[ 32%] Built target vtkCommonDataModel
[ 35%] Built target vtkCommonCorePythonD
Makefile:138: recipe for target 'all' failed
make: *** [all] Error 2</code></pre><br></div></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Sun, Mar 11, 2018 at 8:54 AM, ashwin .D <span dir="ltr"><<a href="mailto:winash12@gmail.com" target="_blank">winash12@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div>I was able to get this to compile successfully and generate a vtkpython.exe. I downloaded a later version of this namely i.e. 8.1. 0 and I also needed to add one more option to the command line <br><br></div>i.e. -DVTK_PYTHON_VERSION=3.5 while running cmake. This I believe is *required* else it defaults to the 2.7 installation. <br><br><br></div><div class="HOEnZb"><div class="h5"><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Mar 8, 2018 at 8:02 PM, ashwin .D <span dir="ltr"><<a href="mailto:winash12@gmail.com" target="_blank">winash12@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">The log file I sent you just now is the result of running make -j8. <br></div><div class="m_-5495975984556795101HOEnZb"><div class="m_-5495975984556795101h5"><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Mar 8, 2018 at 7:58 PM, David E DeMarle <span dir="ltr"><<a href="mailto:dave.demarle@kitware.com" target="_blank">dave.demarle@kitware.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Did you run make?<div>cmake just builds makefiles/visual studio solution files or whatever. You still have to compile those to make the library/binraries/bindings and whatnot.</div></div><div class="gmail_extra"><span class="m_-5495975984556795101m_7964320937561822490HOEnZb"><font color="#888888"><br clear="all"><div><div class="m_-5495975984556795101m_7964320937561822490m_-7549620442342686876gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div>David E DeMarle<br>Kitware, Inc.<br>Principal Engineer<br>21 Corporate Drive<br>Clifton Park, NY 12065-8662<br>Phone: 518-881-4909</div></div></div></div></div></div>
<br></font></span><div class="gmail_quote"><span>On Thu, Mar 8, 2018 at 6:45 AM, ashwin .D <span dir="ltr"><<a href="mailto:winash12@gmail.com" target="_blank">winash12@gmail.com</a>></span> wrote:<br></span><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div class="m_-5495975984556795101m_7964320937561822490h5"><div dir="ltr"><div><div><div><div><div><div><div><div>Hello,<br></div> I have VTK 7.0.0 tar file and I am trying to compile from source the python wrapper for VTK. I have ccmake installed on my Ubuntu 16.04 box but no matter what I try(the installation itself proceeds with no errors) but I cannot find out where the python wrapper for SDK is present. When I type<br><br></div>python3.5 import vtk <br><br></div>I get ImportError : no module named 'vtk`<br><br></div>Here is how I built VTK for python using ccmake<br><br><br>ccmake -DCMAKE_INSTALL_PREFIX=/opt/lo<wbr>cal/vtk7.0-py3.5.0 -DBUILD_SHARED_LIBS:BOOL=ON-DV<wbr>TK_WRAP_PYTHON:BOOL=ON -DVTK_PYTHON_VERSION:STRING=3.<wbr>5 -DPYTHON_EXECUTABLE:PATH=/usr/<wbr>bin/python3.5 -DPYTHON_INCLUDE_DIR=/usr/incl<wbr>ude/python3.5 -DPYTHON_LIBRARY:PATH=/usr/loc<wbr>al/lib/python3.5/ ..VTK-7.0.0<br><br></div>Then a ccmake window pops up and I type ctcl - c twice and ctrl-g once. But this does not do the job. <br><br></div>Any suggestions will be appreciated. I intend to use VTK with Mayavi eventually. <br><br></div>Best regards,<br></div>Ashwin. <br></div>
<br></div></div><span>______________________________<wbr>_________________<br>
Powered by <a href="http://www.kitware.com" rel="noreferrer" target="_blank">www.kitware.com</a><br>
<br>
Visit other Kitware open-source projects at <a href="http://www.kitware.com/opensource/opensource.html" rel="noreferrer" target="_blank">http://www.kitware.com/opensou<wbr>rce/opensource.html</a><br>
<br>
Please keep messages on-topic and check the VTK FAQ at: <a href="http://www.vtk.org/Wiki/VTK_FAQ" rel="noreferrer" target="_blank">http://www.vtk.org/Wiki/VTK_FA<wbr>Q</a><br>
<br>
Search the list archives at: <a href="http://markmail.org/search/?q=vtkusers" rel="noreferrer" target="_blank">http://markmail.org/search/?q=<wbr>vtkusers</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="https://vtk.org/mailman/listinfo/vtkusers" rel="noreferrer" target="_blank">https://vtk.org/mailman/listin<wbr>fo/vtkusers</a><br>
<br></span></blockquote></div><br></div>
</blockquote></div><br></div>
</div></div></blockquote></div><br></div>
</div></div></blockquote></div><br></div>