graphia icon indicating copy to clipboard operation
graphia copied to clipboard

Problems building graphia on ArchLinux with Qt 6.9.1

Open salexan2001 opened this issue 6 months ago • 4 comments

Describe the bug Build (according to the instructions in README.md) fails on an up-to-date ArchLinux with qt6 (6.9.1) installed.

To Reproduce

  • Cloned the repository with git.
  • Checked out version tag 5.4
  • Ran cmake -B build && cmake --build build -j4 in the graphia folder.

Expected Behaviour Successful build

Screenshots NA

Log Files The first problem appears to be here:

(...)/graphia/source/thirdparty/qcustomplot/qcustomplot.cpp: In member function 'virtual QString QCPAxisTickerDateTime::getTickLabel(double, const QLocale&, QChar, int)':
(...)/graphia/source/thirdparty/qcustomplot/qcustomplot.cpp:6726:48: error: 'class QDateTime' has no member named 'toTimeSpec'; did you mean 'timeSpec'?
 6726 |     return locale.toString(keyToDateTime(tick).toTimeSpec(mDateTimeSpec), mDateTimeFormat);
      |                                                ^~~~~~~~~~
      |                                                timeSpec
(...)/graphia/source/thirdparty/qcustomplot/qcustomplot.cpp: In static member function 'static double QCPAxisTickerDateTime::dateTimeToKey(const QDate&, Qt::TimeSpec)':
(...)/graphia/source/thirdparty/qcustomplot/qcustomplot.cpp:6831:25: error: no matching function for call to 'QDate::startOfDay(Qt::TimeSpec&) const'
 6831 |   return date.startOfDay(timeSpec).toMSecsSinceEpoch()/1000.0;
      |          ~~~~~~~~~~~~~~~^~~~~~~~~~
(...)/graphia/source/thirdparty/qcustomplot/qcustomplot.cpp:6831:25: note: there are 2 candidates
In file included from /usr/include/qt6/QtCore/QDateTime:1,
                 from (...)/graphia/source/thirdparty/qcustomplot/qcustomplot.h:64,
                 from (...)/graphia/source/thirdparty/qcustomplot/qcustomplot.cpp:26:
/usr/include/qt6/QtCore/qdatetime.h:99:15: note: candidate 1: 'QDateTime QDate::startOfDay(const QTimeZone&) const'
   99 |     QDateTime startOfDay(const QTimeZone &zone) const;
      |               ^~~~~~~~~~
/usr/include/qt6/QtCore/qdatetime.h:99:43: note: no known conversion for argument 1 from 'Qt::TimeSpec' to 'const QTimeZone&'
   99 |     QDateTime startOfDay(const QTimeZone &zone) const;
      |                          ~~~~~~~~~~~~~~~~~^~~~
/usr/include/qt6/QtCore/qdatetime.h:101:15: note: candidate 2: 'QDateTime QDate::startOfDay() const'
  101 |     QDateTime startOfDay() const;
      |               ^~~~~~~~~~
/usr/include/qt6/QtCore/qdatetime.h:101:15: note: candidate expects 0 arguments, 1 provided

I had a look at the sources - this might be a function from a thirdparty-library that can be safely disabled as it does not seem to be used. It is related to an obsolete Qt function: https://doc.qt.io/archives/qt-6.7/qdatetime-obsolete.html#toTimeSpec

Second problem:

In file included from (...)/graphia/build/source/app/ui/qml/Graphia/main_qml_autogen/mocs_compilation.cpp:8:
(...)/graphia/build/source/app/ui/qml/Graphia/main_qml_autogen/EWIEGA46WW/moc_document.cpp: In static member function 'static void Document::qt_static_metacall(QObject*, QMetaObject::Call, int, void**)':
(...)/graphia/build/source/app/ui/qml/Graphia/main_qml_autogen/EWIEGA46WW/moc_document.cpp:1618:40: error: no matching function for call to 'Document::loadComplete()'
 1618 |                 Q_EMIT _t->loadComplete();
      |                        ~~~~~~~~~~~~~~~~^~
(...)/graphia/build/source/app/ui/qml/Graphia/main_qml_autogen/EWIEGA46WW/moc_document.cpp:1618:40: note: there is 1 candidate
In file included from (...)/graphia/build/source/app/ui/qml/Graphia/main_qml_autogen/EWIEGA46WW/moc_document.cpp:9:
(...)/graphia/build/source/app/ui/qml/Graphia/main_qml_autogen/EWIEGA46WW/../../../../../../../../source/app/ui/qml/Graphia/document.h:348:10: note: candidate 1: 'void Document::loadComplete(const QUrl&, bool)'
  348 |     void loadComplete(const QUrl& url, bool success); // clazy:exclude=qproperty-type-mismatch
      |          ^~~~~~~~~~~~

I was not able to find out more about this problem, the affected sources seem to be autogenerated.

Environment (please complete the following information):

  • Graphia Version: 5.4 (I also tried the most recent commit in main)
  • Operating System Version: ArchLinux (Linux (...) 6.14.9-arch1-1 #1 SMP PREEMPT_DYNAMIC Thu, 29 May 2025 21:42:15 +0000 x86_64 GNU/Linux)
  • (if using the web version) Browser Version: NA

Additional context NA

salexan2001 avatar Jun 05 '25 09:06 salexan2001

Qt has a propensity to break things between major releases so for major releases of Graphia I tend not to change what I build against. The current target is 6.7.0. That said, I've addressed some of the issues in the qt6.9 branch. I haven't really tested it beyond just getting it to build, so ymmv.

timangus avatar Jun 05 '25 15:06 timangus

Thanks that worked for me!

Just one minor thing: I had to set set(CMAKE_POSITION_INDEPENDENT_CODE ON) in the cmake file for making the linking work.

The program seems to run fine now. (Really great software btw.!)

salexan2001 avatar Jun 06 '25 09:06 salexan2001

Hmm, you're not the first to run into needing to manually add -fPIC (issue #80), also with Arch for what it's worth. I don't really understand why it wouldn't be present there as I think it's some combination of Qt and CMake that's responsible for adding it. I'd be interested to see the failing compiler output if you can be bothered, preferably with verbose output on (https://stackoverflow.com/a/2673355/2721809). I may just enable PIC by default, but I'd like to understand why it's required first.

Anyway, good that it works for you now, cheers.

timangus avatar Jun 06 '25 10:06 timangus

Sure:

build_output.txt

Btw.:

Name            : binutils
Version         : 2.44+r94+gfe459e33c676-1

Name            : cmake
Version         : 4.0.2-1

Name            : make
Version         : 4.4.1-2

Name            : gcc
Version         : 15.1.1+r7+gf36ec88aa85a-1

salexan2001 avatar Jun 10 '25 08:06 salexan2001