[SOLVED] Compilation Fails for Debian 10

Having trouble installing or compiling FreeCAD? Get help here.
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
Post Reply
User avatar
hhassey
Posts: 246
Joined: Thu Jun 04, 2015 8:01 pm
Location: Ensenada, Mexico

[SOLVED] Compilation Fails for Debian 10

Post by hhassey »

Hello @yorik I have been compiling FreeCAD frequently, (I am running version Git 16949 now) finally I found some time to incorporate the FreeCAD Steel Frame functionality So I forked FreeCAD and was trying to compile it before modifying it, but suddenly FC will not compile anymore.

I get these error messages while running the Make command.

Code: Select all

-- The imported target "vtkParseOGLExt" references the file
   "/usr/bin/vtkParseOGLExt-7.1"
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-7.1/VTKTargets.cmake"
but not all the files it references.

-- 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-7.1/VTKTargets.cmake"
but not all the files it references.

-- The imported target "vtk" references the file
   "/usr/bin/vtk"
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-7.1/VTKTargets.cmake"
but not all the files it references.

-- The imported target "pvtk" references the file
   "/usr/bin/pvtk"
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-7.1/VTKTargets.cmake"
but not all the files it references.

-- VTK components: vtkCommonCore;vtkCommonDataModel;vtkFiltersVerdict;vtkIOXML;vtkFiltersCore;vtkFiltersGeneral;vtkIOLegacy;vtkFiltersExtraction;vtkFiltersSources;vtkFiltersGeometry;vtkIOMPIParallel;vtkParallelMPI;vtkhdf5;vtkFiltersParallelDIY2;vtkRenderingCore;vtkInteractionStyle;vtkRenderingFreeType;vtkRenderingOpenGL2
-- Check for medfile (libmed and libmedc) ...
-- We guess that libmed was built using hdf5-openmpi version
CMake Error at CMakeLists.txt:928 (find_package):
  By not providing "FindQt5XmlPatterns.cmake" in CMAKE_MODULE_PATH this
  project has asked CMake to find a package configuration file provided by
  "Qt5XmlPatterns", but CMake did not find one.

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

    Qt5XmlPatternsConfig.cmake
    qt5xmlpatterns-config.cmake

  Add the installation prefix of "Qt5XmlPatterns" to CMAKE_PREFIX_PATH or set
  "Qt5XmlPatterns_DIR" to a directory containing one of the above files.  If
  "Qt5XmlPatterns" provides a separate development package or SDK, be sure it
  has been installed.
Please help
Last edited by hhassey on Fri Jun 14, 2019 5:37 pm, edited 1 time in total.
User avatar
kkremitzki
Veteran
Posts: 2511
Joined: Thu Mar 03, 2016 9:52 pm
Location: Illinois

Re: Compilation Fails for Debian 10

Post by kkremitzki »

The core error message is:

Code: Select all

CMake Error at CMakeLists.txt:928 (find_package):
  By not providing "FindQt5XmlPatterns.cmake" in CMAKE_MODULE_PATH this
  project has asked CMake to find a package configuration file provided by
  "Qt5XmlPatterns", but CMake did not find one.

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

    Qt5XmlPatternsConfig.cmake
    qt5xmlpatterns-config.cmake

  Add the installation prefix of "Qt5XmlPatterns" to CMAKE_PREFIX_PATH or set
  "Qt5XmlPatterns_DIR" to a directory containing one of the above files.  If
  "Qt5XmlPatterns" provides a separate development package or SDK, be sure it
  has been installed.
  
Here's a trick to solving this kind of problem. The error message mentions it is looking for Qt5XmlPatternsConfig.cmake or qt5xmlpatterns-config.cmake. There's a package to help find what package contains this file, called apt-file, so install it with sudo apt install apt-file then update its cache with sudo apt update. Then, run apt-file search Qt5XmlPatternsConfig.cmake. The output will be:

Code: Select all

libqt5xmlpatterns5-dev: /usr/lib/x86_64-linux-gnu/cmake/Qt5XmlPatterns/Qt5XmlPatternsConfig.cmake
so you need to install libqt5xmlpatterns5-dev.
Like my FreeCAD work? I'd appreciate any level of support via Patreon, Liberapay, or PayPal! Read more about what I do at my blog.
User avatar
hhassey
Posts: 246
Joined: Thu Jun 04, 2015 8:01 pm
Location: Ensenada, Mexico

[SOLVED] Re: Compilation Fails for Debian 10

Post by hhassey »

Thanks @kkremitzki That did the trick!! You jus saved me a ton of time!
User avatar
yorik
Founder
Posts: 13640
Joined: Tue Feb 17, 2009 9:16 pm
Location: Brussels
Contact:

Re: [SOLVED] Compilation Fails for Debian 10

Post by yorik »

If you use duckduckgo, you also have an online version of this, which is what I use most, because I always forget the apt-file syntax :D

Code: Select all

!dfiles Qt5XmlPatternsConfig.cmake
(they also have a !dpkg that searches package names, and of course they also have !fc 8-) )
Jee-Bee
Veteran
Posts: 2566
Joined: Tue Jun 16, 2015 10:32 am
Location: Netherlands

Re: [SOLVED] Compilation Fails for Debian 10

Post by Jee-Bee »

yorik wrote: Sat Jun 15, 2019 8:10 pm ...and of course they also have !fc 8-) )
Cool i didn't know that one!!
laudas
Posts: 2
Joined: Fri Jul 17, 2020 2:40 am

Re: [SOLVED] Compilation Fails for Debian 10

Post by laudas »

Not for me.
Here is the script I use to install and try building freecad on Debian 10

mkdir ~/src
cd ~/src
sudo apt update -y
git clone https://github.com/FreeCAD/FreeCAD.git
sudo apt build-dep freecad -y
sudo apt install cmake cmake-gui libboost-date-time-dev libboost-dev libboost-filesystem-dev libboost-graph-dev libboost-iostreams-dev libboost-program-options-dev libboost-python-dev libboost-regex-dev libboost-serialization-dev libboost-signals-dev libboost-thread-dev libcoin-dev libeigen3-dev libgts-bin libgts-dev libkdtree++-dev libmedc-dev libocct-data-exchange-dev libocct-ocaf-dev libocct-visualization-dev libopencv-dev libproj-dev libpyside2-dev libqt5opengl5-dev libqt5svg5-dev libqt5webkit5-dev libqt5x11extras5-dev libqt5xmlpatterns5-dev libshiboken2-dev libspnav-dev libvtk7-dev libx11-dev libxerces-c-dev libzipios++-dev occt-draw pyside2-tools python3-dev python3-matplotlib python3-pivy python3-ply python3-pyside2.qtcore python3-pyside2.qtgui python3-pyside2.qtsvg python3-pyside2.qtwidgets python3-pyside2uic qtbase5-dev qttools5-dev swig -y
mkdir -p ~/src/FreeCAD/build
cd ~/src/FreeCAD/build
sudo apt install apt-file -y
sudo apt update -y
sudo apt-file search Qt5XmlPatternsConfig.cmake
cmake .. -DBUILD_QT5=ON -DPYTHON_EXECUTABLE=/usr/bin/python3
make -j$(nproc --ignore=2)

it all works except for The imported target "vtkParseOGLExt" references the file
"/usr/bin/vtkParseOGLExt-7.1"
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-7.1/VTKTargets.cmake"
but not all the files it references.

What other magic is there to getting Cmake to find the dep ?

Thanks Lachlan
louisgag
Posts: 75
Joined: Fri Jan 17, 2020 9:59 am

Re: [SOLVED] Compilation Fails for Debian 10

Post by louisgag »

Lachlan: I also have the same issue with Ubuntu 20.04.
It seems to have something to do with the vtk7 package, and roots from the debian package:
https://bugs.launchpad.net/ubuntu/+sour ... ug/1878103
-Louis
topher217
Posts: 16
Joined: Wed Aug 10, 2016 2:36 pm

Re: [SOLVED] Compilation Fails for Debian 10

Post by topher217 »

Any updates on this? Are there workarounds for how to build on Ubuntu 20.04?
User avatar
kkremitzki
Veteran
Posts: 2511
Joined: Thu Mar 03, 2016 9:52 pm
Location: Illinois

Re: [SOLVED] Compilation Fails for Debian 10

Post by kkremitzki »

Are you sure that's not a warning and not an error? I would check the rest of your CMake output to be sure.
Like my FreeCAD work? I'd appreciate any level of support via Patreon, Liberapay, or PayPal! Read more about what I do at my blog.
oeliks
Posts: 50
Joined: Fri May 26, 2017 4:54 am

Re: [SOLVED] Compilation Fails for Debian 10

Post by oeliks »

Try to manually install dependencies from "compile on linux" manual for freecad -> from "Python 3 and Qt5"

Code: Select all

    qtbase5-dev
    qttools5-dev
    libqt5opengl5-dev
    libqt5svg5-dev
    libqt5webkit5-dev or qtwebengine5-dev
    libqt5xmlpatterns5-dev
    libqt5x11extras5-dev
    libpyside2-dev
    libshiboken2-dev
    pyside2-tools
    pyqt5-dev-tools
    python3-dev
    python3-matplotlib
    python3-pivy
    python3-ply
    python3-pyside2.qtcore
    python3-pyside2.qtgui
    python3-pyside2.qtsvg
    python3-pyside2.qtwidgets
    python3-pyside2uic
For me it worked, and now it compiles from source.
Post Reply