Combining pre-built distribution with local build of non-Qt components

I still haven’t figured out hot to build ParaView (and CMake too) with Qt dependencies, so I’ve reverted to installing the pre-built components, which work just fine.
The problem is that I also need to build the interface library so we can generate ParaView-compatible output from our simulations. I do this using the GNU C/C++ compilers and PGI Fortran, and the setting

-DPARAVIEW_BUILD_QT_GUI:BOOL=OFF

and use separate environment-modules to load the distribution version versus my locally built version.
What I’d like to do, though, is merge them into a single directory, so the standalone tools would come from the tarball of pre-built components, and the external interface libraries I would build natively on the machine. Is there an easy way to do a partial install of the first, and a partial build of the second?

I’m so confused on what you are trying to achieve.

Are you trying to use ParaView or build ParaView ?
If you are trying to build ParaView, why do you need to build it instead of just using it ?
Once you have a working ParaView, what are you trying to achieve with it ?

We have a weather simulation that we link with a ParaView library, so (1) we can dump output that is (2) read into and displayed by the ParaView toolkit.
The library needs to be compiled with PGI Fortran but GCC is okay for the C/C++ part.
So far what I’m doing is installing the ParaView toolkit from the Pre-built binaries for part (2), and building ParaView without the Qt support for part (1). These are made available to the users as environment modules, i.e.

module load paraview
module load paraview.libs

It would be more compact if I could just built the whole thing with PGI+GCC, but haven’t found a way to get the Qt components to build. The next best thing would be to unpack the Qt-based components from the pre-built tar-file and just replace the output library with my own PGI+GCC build. How hard would this be to do? And would the re-built library cause the other components to break?

You definitely should be able to build an usable ParaView and then link your simulation against it without any issue. That is the way to go imo.

The next best thing would be to unpack the Qt-based components from the pre-built tar-file and just replace the output library with my own PGI+GCC build.

That sounds way too hacky to be viable.

Note : you may want to take a look into ParaView catalyst and in situ visualization
https://www.paraview.org/in-situ/

I run into problems with the Qt dependencies when I try to build the whole thing.
The internet is polluted with “fixes” that don’t work when I try them.
I have one system running CentOS 7 & another with Ubuntu 18.
These have CMake 3.14 & 3.15, respectively.

Well, please copy the errors here so we can try and help.

CMake Warning at VTK/CMake/vtkModule.cmake:3646 (find_package):
  By not providing "FindQt5.cmake" in CMAKE_MODULE_PATH this project has
  asked CMake to find a package configuration file provided by "Qt5", but
  CMake did not find one.

  Could not find a package configuration file provided by "Qt5" (requested
  version 5.9) with any of the following names:

    Qt5Config.cmake
    qt5-config.cmake

  Add the installation prefix of "Qt5" to CMAKE_PREFIX_PATH or set "Qt5_DIR"
  to a directory containing one of the above files.  If "Qt5" provides a
  separate development package or SDK, be sure it has been installed.
Call Stack (most recent call first):
  VTK/GUISupport/Qt/CMakeLists.txt:54 (vtk_module_find_package)

CMake Error at VTK/CMake/vtkModule.cmake:3652 (message):
  Could not find the Qt5 external dependency.
Call Stack (most recent call first):
  VTK/GUISupport/Qt/CMakeLists.txt:54 (vtk_module_find_package)

-- Configuring incomplete, errors occurred!

Set QT5_DIR to your Qt5 installation cmake path, it may look like

/opt/qt5/gcc/lib/cmake/qt5

How do I install Qt5 without building it?
I’m on the Ubuntu box right now.

Three solutions, from the simplest to the hardest :

sudo apt-get -y install Qt

doesn’t give me anything.
That would be my preference though. I’m trying the wiki.qt.io installer right now.

Please use google.

These commands ran ok

sudo apt-get install qtcreator
sudo apt-get install qt5-default
sudo apt-get install qtbase5-examples

but I don’t see a qt5/gcc directory under /opt or anywhere else.

You can just reconfigure ParaView and it will find Qt without issues. If not, clean your build repository first.

And please read the .md file for building ParaView :
https://gitlab.kitware.com/paraview/paraview/blob/master/Documentation/dev/build.md

It looks like it’s very close to working. I got to the very end of the build here:

[ 97%] Built target Catalyst
Scanning dependencies of target AcceleratedAlgorithms_doc
[ 97%] Generating documentation for AcceleratedAlgorithms_doc
CMake Error at /home/demouser/install/021.ParaView.Temp/ParaView-v5.7.0/CMake/ParaViewClient.cmake:526 (message):
  Failed to convert servermanager XML: xmlpatterns: could not exec
  '/usr/lib/qt5/bin/xmlpatterns': No such file or directory



Plugins/AcceleratedAlgorithms/CMakeFiles/AcceleratedAlgorithms_doc.dir/build.make:65: recipe for target 'Plugins/AcceleratedAlgorithms/paraview_help/AcceleratedAlgorithms_doc.xslt' failed
make[2]: *** [Plugins/AcceleratedAlgorithms/paraview_help/AcceleratedAlgorithms_doc.xslt] Error 1
CMakeFiles/Makefile2:24485: recipe for target 'Plugins/AcceleratedAlgorithms/CMakeFiles/AcceleratedAlgorithms_doc.dir/all' failed
make[1]: *** [Plugins/AcceleratedAlgorithms/CMakeFiles/AcceleratedAlgorithms_doc.dir/all] Error 2
Makefile:140: recipe for target 'all' failed
make: *** [all] Error 2

Does this come from a Qt component I don’t have?
(Hang on – I’m looking at qtxmlpatterns5-dev-tools that supposedly contains the file…)

Ok, looks like it worked! For the record, these are the Qt components I installed

sudo apt-get -y install qtcreator 
sudo apt-get -y install qtcreator-doc
sudo apt-get -y install qt5-default
sudo apt-get -y install qt5-doc
sudo apt-get -y install qt5-doc-html qtbase5-doc-html
sudo apt-get -y install qtbase5-examples
sudo apt-get -y install qtdeclarative5-dev
sudo apt-get -y install qtbase5-dev
sudo apt-get -y install qtbase5-doc
sudo apt-get -y install qtxmlpatterns5-dev-tools

but some of them may be unnecessary.
You can go ahead and close this out; if I have problems running etc. I will follow up separately.

2 Likes

Nicely done @cponder