VTK libraries error in Ubuntu 16.04

2,138 views
Skip to first unread message

Dario Marvin

unread,
Sep 19, 2016, 11:37:10 AM9/19/16
to fenics-support
Hello,

I have installed the fenics package on Ubuntu 16.04 via the command
sudo apt-get install fenics
and that worked wonderfully.

I then tried to compile the Biharmonic C++ example found on the fenics website, but I obtain some errors when trying to plot the solution, namely

$ make
Scanning dependencies of target demo_biharmonic
[ 50%] Building CXX object CMakeFiles/demo_biharmonic.dir/main.cpp.o
[100%] Linking CXX executable demo_biharmonic
/usr/bin/ld: impossibile trovare -lvtkViewsCore
/usr/bin/ld: impossibile trovare -lvtkInteractionWidgets
/usr/bin/ld: impossibile trovare -lvtkFiltersHybrid
/usr/bin/ld: impossibile trovare -lvtkFiltersGeneral
/usr/bin/ld: impossibile trovare -lvtkCommonComputationalGeometry
/usr/bin/ld: impossibile trovare -lvtkCommonDataModel
/usr/bin/ld: impossibile trovare -lvtkCommonMath
/usr/bin/ld: impossibile trovare -lvtkCommonCore
/usr/bin/ld: impossibile trovare -lvtksys
/usr/bin/ld: impossibile trovare -lvtkCommonMisc
/usr/bin/ld: impossibile trovare -lvtkCommonSystem
/usr/bin/ld: impossibile trovare -lvtkCommonTransforms
/usr/bin/ld: impossibile trovare -lvtkFiltersCore
/usr/bin/ld: impossibile trovare -lvtkCommonExecutionModel
/usr/bin/ld: impossibile trovare -lvtkImagingSources
/usr/bin/ld: impossibile trovare -lvtkImagingCore
/usr/bin/ld: impossibile trovare -lvtkRenderingCore
/usr/bin/ld: impossibile trovare -lvtkCommonColor
/usr/bin/ld: impossibile trovare -lvtkFiltersExtraction
/usr/bin/ld: impossibile trovare -lvtkFiltersStatistics
/usr/bin/ld: impossibile trovare -lvtkImagingFourier
/usr/bin/ld: impossibile trovare -lvtkalglib
/usr/bin/ld: impossibile trovare -lvtkFiltersGeometry
/usr/bin/ld: impossibile trovare -lvtkFiltersSources
/usr/bin/ld: impossibile trovare -lvtkFiltersModeling
/usr/bin/ld: impossibile trovare -lvtkImagingGeneral
/usr/bin/ld: impossibile trovare -lvtkImagingHybrid
/usr/bin/ld: impossibile trovare -lvtkIOImage
/usr/bin/ld: impossibile trovare -lvtkDICOMParser
/usr/bin/ld: impossibile trovare -lvtkIOCore
collect2
: error: ld returned 1 exit status
CMakeFiles/demo_biharmonic.dir/build.make:210: set di istruzioni per l'obiettivo "demo_biharmonic" non riuscito
make[2]: *** [demo_biharmonic] Errore 1
CMakeFiles/Makefile2:67: set di istruzioni per l'
obiettivo "CMakeFiles/demo_biharmonic.dir/all" non riuscito
make
[1]: *** [CMakeFiles/demo_biharmonic.dir/all] Errore 2
Makefile:83: set di istruzioni per l'obiettivo "all" non riuscito
make: *** [all] Errore 2

It seems like the compiler cannot find libraries of the VTK package.

I checked the /usr/lib directory and found out that the libraries are there, but with a slightly different name: for instance, one of my libraries is called libvtkViewsCore-6.2.so instead of lvtkViewsCore as requested by the compiler.

How could I tell the compiler to look for the installed libraries?
 

Thanks,

Dario

Dario Marvin

unread,
Sep 20, 2016, 8:05:24 AM9/20/16
to fenics-support
Alright, I was able to the issue by using the CMakeList.txt as in the Poisson demo.
Changing that file allows the compilation of the problem.

I would like to point out what could be an issue: during the creation of the makefile I get the warning
-- 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.
Now, the library libvtkRenderingPythonTkWidgets.so is part of the package python-vtk, but if I try to install it, it will remove all the fenics associated files:

$ sudo apt-get install python-vtk
[...]
The following packages will be removed:
  dolfin
-bin dolfin-doc fenics libdolfin-dev libmshr-dev libvtk6-dev
  mshr
-demos paraview-python python-dolfin python-mshr python-vtk6
The following new packages will be installed:
  python
-vtk

So having that library will make the other fenics files useless.

Dario

Johannes Ring

unread,
Sep 20, 2016, 8:17:23 AM9/20/16
to Dario Marvin, fenics-support
On Tue, Sep 20, 2016 at 2:05 PM, Dario Marvin <dario.m...@gmail.com> wrote:
> Alright, I was able to the issue by using the CMakeList.txt as in the
> Poisson demo.
> Changing that file allows the compilation of the problem.
>
> I would like to point out what could be an issue: during the creation of the
> makefile I get the warning
> -- 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.
> Now, the library libvtkRenderingPythonTkWidgets.so is part of the package
> python-vtk,

It is also in the python-vtk6 package, although with a slightly different name:

$ dpkg -L python-vtk6 | grep libvtkRenderingPythonTkWidgets
/usr/lib/python2.7/dist-packages/vtk/libvtkRenderingPythonTkWidgets.x86_64-linux-gnu.so

This is a bug in the VTK 6 package in Ubuntu, but the warning is
nothing to worry about.

> but if I try to install it, it will remove all the fenics
> associated files:
>
> $ sudo apt-get install python-vtk
> [...]
> The following packages will be removed:
> dolfin-bin dolfin-doc fenics libdolfin-dev libmshr-dev libvtk6-dev
> mshr-demos paraview-python python-dolfin python-mshr python-vtk6
> The following new packages will be installed:
> python-vtk

This is because the FEniCS Ubuntu packages depends on VTK 6 and
installing python-vtk will remove python-vtk6, which in turn will
remove fenics.

Johannes
> --
> You received this message because you are subscribed to the Google Groups
> "fenics-support" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to fenics-suppor...@googlegroups.com.
> To post to this group, send email to fenics-...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/fenics-support/911c88a3-640e-433a-b076-dc99fd4df564%40googlegroups.com.
>
> For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages