Compile on Linux (Kubuntu): CMake can't find VTK

Having trouble installing or compiling FreeCAD? Get help here.
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
User avatar
marktaff
Posts: 47
Joined: Sun Sep 21, 2014 3:25 pm
Location: Seattle, Washington, USA

Compile on Linux (Kubuntu): CMake can't find VTK

Post by marktaff »

I'm have the same issue as DeepSOIC, apparently, except I'm on Kubuntu 16.04. Trying to build a Release version, although Debug would work for now as well. All I care about right now is the 2D Draft using the new ImperialBuilding units scheme.

The CMake error:

Code: Select all

<snip>
-- Found OCC: /usr/lib/x86_64-linux-gnu/oce-0.16/../../../include/oce (found version "6.8.0") 
-- -- Found OCE/OpenCASCADE version: 6.8.0
-- -- OCE/OpenCASCADE include directory: /usr/lib/x86_64-linux-gnu/oce-0.16/../../../include/oce
-- -- OCE/OpenCASCADE shared libraries directory: 
CMake Error at CMakeLists.txt:559 (find_package):
  By not providing "FindVTK.cmake" in CMAKE_MODULE_PATH this project has
  asked CMake to find a package configuration file provided by "VTK", but
  CMake did not find one.

  Could not find a package configuration file provided by "VTK" with any of
  the following names:

    VTKConfig.cmake
    vtk-config.cmake

  Add the installation prefix of "VTK" to CMAKE_PREFIX_PATH or set "VTK_DIR"
  to a directory containing one of the above files.  If "VTK" provides a
  separate development package or SDK, be sure it has been installed.


-- Configuring incomplete, errors occurred!
See also "/home/mark/work/freecad/freecad-master-build/CMakeFiles/CMakeOutput.log".
See also "/home/mark/work/freecad/freecad-master-build/CMakeFiles/CMakeError.log".
System Prep:

Code: Select all

# Add freecad PPA for latest oce packages
sudo apt-add-repository -y ppa:freecad-maintainers/oce-release
sudo add-apt-repository ppa:freecad-maintainers/freecad-daily

# Dev dependencies for FreeCAD

sudo apt-get install git build-essential cmake python python-matplotlib libtool \
libcoin80-dev libsoqt4-dev libxerces-c-dev libboost-dev libboost-filesystem-dev \
libboost-regex-dev libboost-program-options-dev libboost-signals-dev libboost-thread-dev \
libboost-python-dev libqt4-dev libqt4-opengl-dev qt4-dev-tools python-dev python-pyside \
pyside-tools oce-draw libeigen3-dev libqtwebkit-dev libshiboken-dev libpyside-dev \
libode-dev swig libzipios++-dev libfreetype6 libfreetype6-dev liboce*-dev \
libsimage-dev python-pivy python-qt4 doxygen libcoin80-doc


# Get the code
mkdir /home/mark/work/freecad
cd /home/mark/work/freecad
git clone https://github.com/FreeCAD/FreeCAD.git freecad-master

# cmake command used
mkdir /home/mark/work/freecad/freecad-master-build
cd /home/mark/work/freecad/freecad-master-build
CMake configuration (tried several variations on these):

Code: Select all

#
# Debug -- not working, VTK error, 20160622
#
cmake -DFREECAD_USE_EXTERNAL_PIVY=1 -DFREECAD_BUILD_ASSEMBLY:BOOL=ON -DCMAKE_BUILD_TYPE=Debug ../freecad-master

#
# Release -- not working, VTK error, 20160622
#
cmake -DFREECAD_USE_EXTERNAL_PIVY=1 -DFREECAD_BUILD_ASSEMBLY:BOOL=ON -DFREECAD_BUILD_FEM_NETGEN:BOOL=OFF -DCMAKE_BUILD_TYPE=Release ../freecad-master
Any help would be appreciated. Thanks!
Last edited by DeepSOIC on Thu Jun 23, 2016 12:03 pm, edited 1 time in total.
Reason: added link to original discussion, this thread was split from
Available on chat.freenode.net#freecad while working on FreeCad
User avatar
sgrogan
Veteran
Posts: 6499
Joined: Wed Oct 22, 2014 5:02 pm

Re: Compile on Windows: CMake can't find VTK

Post by sgrogan »

marktaff wrote:Any help would be appreciated. Thanks!

Code: Select all

sudo apt-get install libmedc-dev
sudo apt-get install libvtk6-dev
sudo apt-get install libproj-dev
is working on the daily PPA
"fight the good fight"
User avatar
marktaff
Posts: 47
Joined: Sun Sep 21, 2014 3:25 pm
Location: Seattle, Washington, USA

Re: Compile on Windows: CMake can't find VTK

Post by marktaff »

sgrogan wrote:

Code: Select all

sudo apt-get install libmedc-dev
sudo apt-get install libvtk6-dev
sudo apt-get install libproj-dev
is working on the daily PPA
Worked like a charm. Thanks! :D

Edit: To fix a libfreeimage.so compile error, I had to create a symlink (Kubuntu 16.04):

Code: Select all

# Fix for compile error "No rule to make target '/usr/lib/libfreeimage.so', needed by 'lib/libSMDS.so'.  Stop."
sudo ln -s /usr/lib/x86_64-linux-gnu/libfreeimage.so.3 /usr/lib/libfreeimage.so
Available on chat.freenode.net#freecad while working on FreeCad
User avatar
sgrogan
Veteran
Posts: 6499
Joined: Wed Oct 22, 2014 5:02 pm

Re: Compile on Windows: CMake can't find VTK

Post by sgrogan »

marktaff wrote:bfreeimage.so compile error, I had to create a symlink (Kubuntu 16.04):
Sorry, that was an older one. From the daily PPA rules file
https://git.launchpad.net/~freecad-main ... ybuild#n32

Can one of the mods split this topic or rename to remove windows. On ubuntu 16.04 I think this topic offers the complete solution, on windows not yet.

BTW:@marktaff, when I first discovered FreeCAD I was fascinated by the ellipse discussions between abdullah, DeepSOIC, and yourself. It's one of the things that drew me to the project.
"fight the good fight"
User avatar
marktaff
Posts: 47
Joined: Sun Sep 21, 2014 3:25 pm
Location: Seattle, Washington, USA

Re: Compile on Windows: CMake can't find VTK

Post by marktaff »

sgrogan wrote:BTW:@marktaff, when I first discovered FreeCAD I was fascinated by the ellipse discussions between abdullah, DeepSOIC, and yourself. It's one of the things that drew me to the project.
Thanks. :-) I'm glad to know I was a tiny part in hooking you. I'm only sorry my life blew up before I could make serious contributions.
Available on chat.freenode.net#freecad while working on FreeCad
ickby
Veteran
Posts: 3116
Joined: Wed Oct 05, 2011 7:36 am

Re: Compile on Windows: CMake can't find VTK

Post by ickby »

marktaff wrote:I'm have the same issue as DeepSOIC, apparently, except I'm on Kubuntu 16.04. Trying to build a Release version, although Debug would work for now as well. All I care about right now is the 2D Draft using the new ImperialBuilding units scheme.

The CMake error:

Code: Select all

<snip>
-- Found OCC: /usr/lib/x86_64-linux-gnu/oce-0.16/../../../include/oce (found version "6.8.0") 
-- -- Found OCE/OpenCASCADE version: 6.8.0
-- -- OCE/OpenCASCADE include directory: /usr/lib/x86_64-linux-gnu/oce-0.16/../../../include/oce
-- -- OCE/OpenCASCADE shared libraries directory: 
CMake Error at CMakeLists.txt:559 (find_package):
  By not providing "FindVTK.cmake" in CMAKE_MODULE_PATH this project has
  asked CMake to find a package configuration file provided by "VTK", but
  CMake did not find one.
[/quote]
As said in the error you simply need to install VTK, and mostlikely libmed and libmedc. For all packages the dev version.
User avatar
DeepSOIC
Veteran
Posts: 7896
Joined: Fri Aug 29, 2014 12:45 am
Location: used to be Saint-Petersburg, Russia

Re: Compile on Windows: CMake can't find VTK

Post by DeepSOIC »

sgrogan wrote:Can one of the mods split this topic or rename to remove windows. On ubuntu 16.04 I think this topic offers the complete solution, on windows not yet.
Done!
User avatar
jnxd
Posts: 951
Joined: Mon Mar 30, 2015 2:30 pm
Contact:

Re: Compile on Linux (Kubuntu): CMake can't find VTK

Post by jnxd »

Hello all.

I am running Ubuntu (GNOME) 16.04. I have been trying to build FreeCAD, and I've been having a similar problem as @marktaff, except that I am able to compile, but not open the FEM workbench.

I did follow the instructions as given in the replies, but the packages suggested were already installed. At one time cmake wouldn't run because it did not find some "/usr/bin/vtk" so I symlinked it to "/usr/bin/vtk6". Following is the output of "cmake <source path>", though it compiles despite the errors:

Code: Select all

-- prefix: /usr/local
-- datadir: data
-- docdir: doc
-- includedir: include
-- libdir: /usr/local/lib
-- Boost version: 1.58.0
-- Found the following Boost libraries:
--   filesystem
--   program_options
--   regex
--   signals
--   system
--   thread
--   chrono
--   date_time
--   atomic
-- Found Xerces-C: /usr/lib/x86_64-linux-gnu/libxerces-c.so
-- PyCXX found:
--   Headers:  /home/ajinkya/Sources/FreeCAD/src
--   Sources:  /home/ajinkya/Sources/FreeCAD/src/CXX
-- -- OpenCASCADE Community Edition has been found.
-- -- Found OCE/OpenCASCADE version: 6.8.0
-- -- OCE/OpenCASCADE include directory: /usr/lib/x86_64-linux-gnu/oce-0.16/../../../include/oce
-- -- OCE/OpenCASCADE shared libraries directory: 
-- 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 for medfile (libmed and libmedc) ...
-- Checking for module 'Coin'
--   No package 'Coin' found
-- libshiboken built for Release
-- Found PySide Tools: /usr/bin/pyside-uic, /usr/bin/pyside-rcc
-- -- matplotlib-1.5.1 has been found.
-- Platform is 64-bit, set -D_OCC64
-- Build type: 
git
/home/ajinkya/Applications/freecad-build/src/Build/Version.h written
-- setting gcc options: -Wall -Werror -Wno-deprecated -pedantic-errors
-- Boost version: 1.58.0
-- Found the following Boost libraries:
--   python
-- found Boost: 1_58
-- boost-incude dirs are: /usr/include
-- boost-python lib is: /usr/lib/x86_64-linux-gnu/libboost_python.so
-- boost_LIBRARY_DIRS is: /usr/lib/x86_64-linux-gnu
-- Boost_LIBRARIES is: /usr/lib/x86_64-linux-gnu/libboost_python.so
-- area module (for Path Workbench) will be installed to: /usr/local/lib
-- Coin3D doc is not installed
=======================================
Now run 'make' to build FreeCAD
=======================================
I am certain I have vtk(6) installed, but something is wrong. On further opening "./bin/FreeCAD", FC opens, but switching to FEM workbench crashes the application, and the following lines show up on the terminal:

Code: Select all

*** Abort *** an exception was raised, but no catch was found.
	... The exception is:SIGSEGV 'segmentation violation' detected. Address ffffffff80000021
*** Abort *** an exception was raised, but no catch was found.
	... The exception is:SIGSEGV 'segmentation violation' detected. Address 0
*** Abort *** an exception was raised, but no catch was found.
	... The exception is:SIGSEGV 'segmentation violation' detected. Address 0
*** Abort *** an exception was raised, but no catch was found.
	... The exception is:SIGSEGV 'segmentation violation' detected. Address 7f9454d7b6e0
Oddly, the last address almost always follows the pattern "7f.......6e0".
My latest (or last) project: B-spline Construction Project.
User avatar
sgrogan
Veteran
Posts: 6499
Joined: Wed Oct 22, 2014 5:02 pm

Re: Compile on Linux (Kubuntu): CMake can't find VTK

Post by sgrogan »

jnxd wrote: I am running Ubuntu (GNOME) 16.04. I have been trying to build FreeCAD, and I've been having a similar problem as @marktaff, except that I am able to compile, but not open the FEM workbench.
I get the same vtkrendering message on the daily PPA but FreeCAD compiles, now I wonder if it works?

Can someone with the latest PPA build on Xenial check if switching to the FEM WB crashes FreeCAD?
"fight the good fight"
User avatar
jnxd
Posts: 951
Joined: Mon Mar 30, 2015 2:30 pm
Contact:

Re: Compile on Linux (Kubuntu): CMake can't find VTK

Post by jnxd »

@sgrogan, I have freecad-daily installed, and it does not give any such errors on opening the FEM workbench.
My latest (or last) project: B-spline Construction Project.
Post Reply