Compilation error on Linux
emilydolson opened this issue · 3 comments
Hi, I'm reviewing the JOSS paper on this package and I ran into the following compilation error when following the instructions for Linux (Ubuntu >= 21.04) installation. Specifically, this occurred when running make
:
g++ -c -pipe -O2 -std=gnu++11 -Wall -W -D_REENTRANT -fPIC -DSOFTWARE_VERSION=\"3.0.0\" -DQT_NO_DEBUG -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_CONCURRENT_LIB -DQT_CORE_LIB -I. -I../../../anaconda3/include/qt -I../../../anaconda3/include/qt/QtWidgets -I../../../anaconda3/include/qt/QtGui -I../../../anaconda3/include/qt/QtConcurrent -I../../../anaconda3/include/qt/QtCore -Ibuild -I. -I../../../anaconda3/mkspecs/linux-g++ -o build/main.o main.cpp
In file included from simmanager.h:35,
from genomecomparison.h:21,
from mainwindow.h:23,
from main.cpp:19:
randoms.h:4:10: fatal error: QRandomGenerator: No such file or directory
4 | #include <QRandomGenerator>
In case it matters, I am running PopOS 22.04.
Thanks for taking the time to review our paper - we really appreciate your time and input.
This looks like, in this case, the default qmake in your terminal is one in an Anaconda package, and the version of Qt in Anaconda is <5.10 (when QRandomGenerator was introduced). There are, I think, two solutions. Using a fresh clone (or after removing the previous build files from the build directory):
- Open the .pro in Qt creator (which can be launched from the menu), under tools->options->kits select the version of Qt that was installed in the earlier part of the instructions for building REvoSim, which will be >5.10, then build by hitting ctrl + R
- Point the terminal to the qmake that was installed by the Qt packages -
2a. Run
dpkg-query -L qt5-qmake
to find out where the package placed qmake - in my installation, towards the very bottom of the output of this command I see
/usr/lib/x86_64-linux-gnu/qt5/bin/qmake
2b. Cd to the source folder (i.e. that with revosim.pro in it)
2c. Run qmake, specifying the version of qmake from step 2a, in my case
/usr/lib/x86_64-linux-gnu/qt5/bin/qmake
2d. Continue following the instructions by running make
I have tested solution 2, which worked, on a machine with Anaconda installed that threw the same error (but which I don't have access to as I am travelling, so can't test number one). If this works, I can add this to the build instructions in the readme. Please do let me know either way!
Solution 2 worked! (I didn't try solution 1) Thanks!
Great news! I have added a note to reflect this potential issue to the readme, and linked it to this issue (which I'll now close).