Build from repository fails under Pop!_OS 20

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
esr
Posts: 63
Joined: Sat Aug 21, 2021 9:10 pm
Location: Malvern, PA
Contact:

Build from repository fails under Pop!_OS 20

Post by esr »

Pop!_OS is a close variant of Ubuntu that uses the Ubuntu repositories and layers a few if its own on top, none of which are likely to be relevant.

At some point after 0.18.4, freecad stopped working with the i3 window manager - the symptom is that the top toolbar fails to appear. I wanted to do a bisection on the repository to identify the commit that broke it so I could file an actionable bug report.

I cloned the FreeCAD repository, did "apt-get build-dep freecad". and followed the directions for an out-of-directory build at https://wiki.freecadweb.org/Compile_on_Linux

Code: Select all

esr@snark:~/software/freecad-build$ cmake -DBUILD_QT5=ON -DPYTHON_EXECUTABLE=/usr/bin/python3 -DFREECAD_USE_PYBIND11=ON ../freecad-source
-- Compiler: GNU, version: 10.3.0
-- prefix: /usr/local
-- bindir: bin
-- datadir: share
-- docdir: share/doc/FreeCAD
-- includedir: include
-- libdir: lib
-- cmake: 3.16.3
-- PyCXX found:
--   Headers:  /home/esr/software/freecad-source/src
--   Sources:  /home/esr/software/freecad-source/src/CXX
--   Version:  6.2.8
-- -- Found OCE/OpenCASCADE version: 7.5.2
-- -- OCE/OpenCASCADE include directory: /usr/include/opencascade
-- -- OCE/OpenCASCADE shared libraries directory: /usr/lib/x86_64-linux-gnu
-- 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
-- Performing Test _flag_found
-- Performing Test _flag_found - Success
CMake Error at cMake/FreeCAD_Helpers/SetupQt.cmake:12 (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.
Call Stack (most recent call first):
  CMakeLists.txt:69 (include)


-- Configuring incomplete, errors occurred!
See also "/home/esr/software/freecad-build/CMakeFiles/CMakeOutput.log".
See also "/home/esr/software/freecad-build/CMakeFiles/CMakeError.log".
esr@snark:~/software/freecad-build$ 
Is this a known problem? Any recommendations for fixing it?

I will turn what I learn here into Pop!_OS build notes for the documentation wiki.
User avatar
kkremitzki
Veteran
Posts: 2509
Joined: Thu Mar 03, 2016 9:52 pm
Location: Illinois

Re: Build from repository fails under Pop!_OS 20

Post by kkremitzki »

Running `apt build-dep` checks the dependencies as specified in the Debian packaging, which has not been updated to take into account a dependency now needed for development builds.

If you note in the error message you can see it complains about failing to find either the file Qt5XmlPatternsConfig.cmake or qt5xmlpatterns-config.cmake. When you see errors like this which reference a filename or path, a very useful tool is apt-file. You can install and set it up with `sudo apt install -y apt-file && sudo apt update`. This updates the sources.list used by apt so that it also indexes the files in all the packages you have available. So, after you have it, you can do something like `apt-file search Qt5XmlPatternsConfig.cmake` which gives the output

Code: Select all

$ apt-file search Qt5XmlPatternsConfig.cmake
libqt5xmlpatterns5-dev: /usr/lib/x86_64-linux-gnu/cmake/Qt5XmlPatterns/Qt5XmlPatternsConfig.cmake
So, if you install the package libqt5xmlpatterns5-dev, you'll be able to build. Or at least get past that particular error :D
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
esr
Posts: 63
Joined: Sat Aug 21, 2021 9:10 pm
Location: Malvern, PA
Contact:

Re: Build from repository fails under Pop!_OS 20

Post by esr »

Putting it on the record that installing libqt5xmlpatterns5-dev was sufficient to allow building 1ceaa0 (Tue Aug 31 12:16:11 2021).

Also, rather to my surprise, the i3 interoperability problem has been solved. i3 is enough of a minority preference that I was afraid I might have to fix that myself.

Thanks for the help.
User avatar
esr
Posts: 63
Joined: Sat Aug 21, 2021 9:10 pm
Location: Malvern, PA
Contact:

Re: Build from repository fails under Pop!_OS 20

Post by esr »

I have followed this up by adding the required step to the build instructions in the wiki, with a comment that it will go away when the packaging is next updated.
User avatar
kkremitzki
Veteran
Posts: 2509
Joined: Thu Mar 03, 2016 9:52 pm
Location: Illinois

Re: Build from repository fails under Pop!_OS 20

Post by kkremitzki »

Thank you for updating that!
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.
Post Reply