PDA

View Full Version : Github actiosn migration - QWT not found error



MaximumTrainer
8th October 2020, 14:00
I'm in process of renovating an existing QT application & having received the source code I've added it to a github actions routine for cross platform builds.
However I am getting the a QWT not found error for my Linux & OSX build & can't figure out why (probably due to my lack of QT experience), any advice would be appreciated.


build.yml
https://github.com/MaximumTrainer/MaximumTrainer/blob/master/.github/workflows/build.yml

pro build file
https://github.com/MaximumTrainer/MaximumTrainer/blob/master/PowerVelo.pro

Linux error -
src/main/util.h:7:10: fatal error: qwt_plot.h: No such file or directory
#include <qwt_plot.h>
^~~~~~~~~~~~
compilation terminated.
make: *** [build/release/.obj/userdao.o] Error 1
Makefile:18472: recipe for target 'build/release/.obj/userdao.o' failed
Error: Process completed with exit code 2.

Mac error -
src/main/util.h:7:10: fatal error: 'qwt_plot.h' file not found
#include <qwt_plot.h>
^~~~~~~~~~~~
1 error generated.
make: *** [build/release/.obj/userdao.o] Error 1
Error: Process completed with exit code 2.

Github actions full output:
https://github.com/MaximumTrainer/MaximumTrainer/runs/1215707915?check_suite_focus=true#step:6:37

Note the windows build fails for a different reason which I will fix after this issue is resolved.

Thanks for your advice

d_stranz
8th October 2020, 22:46
Qwt is not part of the standard Qt distribution. It is an open-source library. You will have to download and build it for your platforms. You will also have to check which version of Qwt your app uses - Qwt 5 or Qwt 6. They are not compatible.

MaximumTrainer
9th October 2020, 10:19
Thanks & I thought that was the case.
In the build.yml I install QWT for OSX & Linux prior to triggering qmake & make, either via brew or apt-get, is this correct?

see here - https://github.com/MaximumTrainer/MaximumTrainer/blob/master/.github/workflows/build.yml

Linux




- name: checkout
uses: actions/checkout@v2
- name: Linux Environment Setup
run: |
DEBIAN_FRONTEND=noninteractive apt update && apt install sudo software-properties-common --yes
DEBIAN_FRONTEND=noninteractive sudo apt-get update --yes
sudo add-apt-repository ppa:beineri/opt-qt-5.12.6-bionic
sudo DEBIAN_FRONTEND=noninteractive apt install python3-pip --yes
sudo DEBIAN_FRONTEND=noninteractive sudo apt-get install -qq qt5-default qt512base qt512tools libqwt-qt5-6 qt512serialport qt512svg qt512multimedia qt512connectivity qt512webengine qt512charts-no-lgpl qt512networkauth-no-lgpl qt512translations qtdeclarative5-dev-tools libqwt-qt5-dev
- name: Install Qt
uses: jurplel/install-qt-action@v2.8.0
with:
modules: 'qwt qtcharts qtwebengine'

- name: Create Makefile
run: |
qmake -set QMAKEFEATURES /resources/qwt/
qmake PowerVelo.pro
- name: Run MakeFile
run: make




Mac




name: QT Environment Setup
run: brew install qt5 qwt
- name: Install Qt
uses: jurplel/install-qt-action@v2.8.0
with:
modules: 'qwt qtcharts qtwebengine'
- name: Create Makefile
run: |
qmake -set QMAKEFEATURES /resources/qwt/
qmake PowerVelo.pro
- name: Run MakeFile
run: make

ChrisW67
10th October 2020, 05:02
I can see you install Qwt 6 and its dev package into Ubuntu. This installs the qwt.prf file in a standard location (not /resources/qwt) that should be found by qmake without any modification of QMAKEFEATURES.

I am not familiar with the Github environment, so I am not sure what effect jurplel/install-qt-action is supposed to have in addition to the Linux setup you have already done. It seem to me that jurplel/install-qt-action (https://github.com/jurplel/install-qt-action) has no provision for qwt.

MaximumTrainer
10th October 2020, 08:15
Yes I agree that jurplel/install-qt-action may be overriding the manual install of qt & qwt.
Here is the build output when I remove jurplel/install-qt-action from build.yml -


Linux


Run qmake -set QMAKEFEATURES /resources/qwt/
qmake -set QMAKEFEATURES /resources/qwt/
qmake PowerVelo.pro
shell: /bin/bash -e {0}
Info: creating stash file /home/runner/work/MaximumTrainer/MaximumTrainer/.qmake.stash
/home/runner/work/MaximumTrainer/MaximumTrainer/PowerVelo.pro:6: 'versionAtLeast' is not a recognized test function.
Project ERROR: Use at least Qt version 5.12
Error: Process completed with exit code 3.

looking into this it appears that QT 5.9.5 was installed, so I have just adjusted the pro file build for the moment

Mac


0s
Run qmake -set QMAKEFEATURES /resources/qwt/
qmake -set QMAKEFEATURES /resources/qwt/
qmake PowerVelo.pro
shell: /bin/bash -e {0}
/Users/runner/work/_temp/eb005e71-d79b-4b46-a79a-086122d1c270.sh: line 1: qmake: command not found
Error: Process completed with exit code 127.

Reading this implies a path issue to me.


In my latest build I have removed jurplel/install-qt-action as this is causing a conflict & here are the latest errors -

Linux


Run qmake -version
QMake version 3.1
Using Qt version 5.9.5 in /usr/lib/x86_64-linux-gnu
Info: creating stash file /home/runner/work/MaximumTrainer/MaximumTrainer/.qmake.stash
/home/runner/work/MaximumTrainer/MaximumTrainer/PowerVelo.pro:6: 'versionAtLeast' is not a recognized test function.
Project ERROR: Use at least Qt version 5.9.0
Error: Process completed with exit code 3.



Mac this is back to the qwt not found error, not sure if this is as brew install qwt6 by default


In file included from src/_db/userdao.cpp:4:
src/main/util.h:7:10: fatal error: 'qwt_plot.h' file not found
#include <qwt_plot.h>
^~~~~~~~~~~~
1 error generated.
make: *** [build/release/.obj/userdao.o] Error 1


full build can be found https://github.com/MaximumTrainer/MaximumTrainer/actions/runs/298838171 (here)

ChrisW67
11th October 2020, 04:53
The versionAtLeast() qmake function you are using does not exist before Qt 5.10, which explains the "not recognized test function" message out of Qt 5.9. Something like this should work under any version of Qt 5


equals(QT_MAJOR_VERSION, 5):lessThan(QT_MINOR_VERSION, 9) {
message("Cannot use Qt $${QT_VERSION}")
error("Use Qt 5.9 or newer")
}


I am focusing on the Linux environment (do not have a Mac)

You explicitly install most of Qt from a PPA that installs it under /opt/qt512 (qt512base qt512tools qt512serialport qt512svg qt512multimedia qt512connectivity qt512webengine qt512charts-no-lgpl qt512networkauth-no-lgpl qt512translations)
The PPA page (https://launchpad.net/~beineri/+archive/ubuntu/opt-qt-5.12.0-bionic) advises:

Source /opt/qt512/bin/qt512-env.sh to set the correct environment.
I suspect if you arranged this before you called qmake you would have Qt 5.12

The Qwt libraries you install are from the Ubuntu repository (libqwt-qt5-dev libqwt-qt5-6), and these install into locations for the generic system Qt version. They are probably responsible for pulling in enough of Qt5.9 to satisfy qwt (you see this in the log file). The feature file installed by this version (i.e. qwt.prf) will not be visible in the Qt 5.12 install

As I see it, you have two options:
1. Use the Ubuntu system Qt, Qt Charts, Qt Web Engine and Qwt and build using Qt 5.9
2. Use the PPA Qt 5.12, which includes everything except Qwt, and work out how to build Qwt and install for that version of Qt in the GitHub environment.

MaximumTrainer
13th October 2020, 14:41
Thanks for the advise, I have now downgraded to QT 5.9. Looking at the Linux build this was causing multiple problems as I was using ACT locally (to simulate github actions) which I have now resolved, resulting in a Linux code compiling & erroring in a consistent was as my local environment.
I will now work through this & figure out the mac & windows issues.

Thanks