solved Fenics (2016.2) cpp code compiling error on ubuntu 16.04

copyright (C) 2011-2017 iesensor.com

for any expression in Expression for Fenics 2016.2( installed from PPA )

expr = """ x[2]> {} ? {}:{}""".format(disc_zmax, lambda_p, lambda_d)
print(expr)
K = Expression(expr, element=V.ufl_element()) # error in compiling

instant error log:


— The imported target “vtkRenderingPythonTkWidgets” references the file
“/usr/lib/x86_64-linux-gnu/libvtkRenderingPythonTkWidgets.so”
but this file does not exist.  Possible reasons include:
* The file was deleted, renamed, or moved to another location.
* An install or uninstall procedure did not complete successfully.
* The installation package was faulty and contained
“/usr/lib/cmake/vtk-6.2/VTKTargets.cmake”
but not all the files it references.

check if this file is missing or not
ls -l  /usr/lib/python2.7/dist-packages/vtk/libvtkRendering*
python-vtk6  (VTK6.2) is installed, and installed file list:

/usr/lib/python2.7/dist-packages/vtk/libvtkRenderingPythonTkWidgets.x86_64-linux-gnu.so


sudo ln -s /usr/lib/python2.7/dist-packages/vtk/libvtkRenderingPythonTkWidgets.x86_64-linux-gnu-6.2.so /usr/lib/x86_64-linux-gnu/libvtkRenderingPythonTkWidgets.so

#this is the only file needs symbolic link to /usr/lib/x86_64-linux-gnu/

then, error is solved

BSD documentation licensed Free for non-commercial usage only
Author: Qingfeng XIA copyright (C) 2011-2013 http://www.iesensor.com
please keep the original link in your reference. http://www.iesensor.com/blog/2017/02/27/solved-fenics-2016-2-cpp-code-compiling-error-on-ubuntu-16-04/
This entry was posted in Programming. Bookmark the permalink.