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

copyright (C) 2011-2017

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

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

instant error log:

— The imported target “vtkRenderingPythonTkWidgets” references the file
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
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:


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

#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
please keep the original link in your reference.
This entry was posted in Programming. Bookmark the permalink.