Compilation Problems with Qt 4 and 5

322 views
Skip to first unread message

Jörn D

unread,
Oct 5, 2017, 11:32:42 AM10/5/17
to COPASI User Forum
Hei

I unfortunately have some problems with compiling copasi (latest development version 2nd October 17) with GUI and hope you can help me.

Irrespective of the qt version (4 or 5) I select for the dependencies and main program I get the following error when using the following command:
cmake -DBUILD_GUI=ON -DCMAKE_INSTALL_PREFIX=~/copasi -DSELECT_QT=qt4 -DCOPASI_DEPENDENCY_DIR=../copasi-dependencies/bin ../COPASI
CMake Error at ChooseQtVersion.cmake:55 (message):
   
Qt not found
Call Stack (most recent call first):
 
CMakeLists.txt:487 (QT_FIND_MODULES)

I use an Ubuntu 16.04 with all packages listed in the compiling instructions installed.
I included a list of all libqt* packages installed and outputs of cmake -LH for both cases.

Side note: The compilation for the GUI-less version works flawless.

Thanks for your help
Jörn
libqt_list.txt
build_flags_qt4.out
build_flags_qt5.out

Felix Winter

unread,
Oct 5, 2017, 12:25:47 PM10/5/17
to Jörn D, copasi-u...@googlegroups.com
Hi,

just a guess and without having tried it myself, but maybe MATCHES from CMake is case sensitive?

I think the corresponding line in the CMakesList ( https://github.com/copasi/COPASI/blob/develop/CMakeLists.txt ) are:

>if (${SELECT_QT} MATCHES "Qt5" OR
> ${SELECT_QT} MATCHES "Any")

You seem to use lowercase flags, e.g.
>// The prefered Qt version one of: Qt5, Qt4 or Any
>SELECT_QT:STRING=qt5

And have you tried -DSELECT_QT=Any ?

Felix
> --
> You received this message because you are subscribed to the Google Groups "COPASI User Forum" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to copasi-user-fo...@googlegroups.com.
> To post to this group, send email to copasi-u...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/copasi-user-forum/f0f0f1e7-124a-4b8c-b61a-37564418d706%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

Frank Bergmann

unread,
Oct 5, 2017, 1:34:21 PM10/5/17
to COPASI User Forum
Felix is correct, the parameters are indeed case sensitive. So please try the parameters

-DSELECT_QT=Qt4 

or 

-DSELECT_QT=Qt5

and let us know whether this helps, 

best
Frank

Jörn D

unread,
Oct 6, 2017, 12:51:04 PM10/6/17
to COPASI User Forum
Thanks a lot for the fast answer.
Your hint resolved the problem but then new ones appeared:

- With "DSELECT_QT=Qt5 " the cmake configuration worked after installing libqt5webkit5-dev (which I seem to have forgotten before)
But now I get a compilation error when building copasi/CMakeFiles/libCOPASIUI.dir/qlayout/CQRenderConverter.cpp.o
[ 62%] Building CXX object copasi/CMakeFiles/libCOPASIUI.dir/qlayout/CQRenderConverter.cpp.o
In file included from /usr/include/string.h:32:0,
                 from /usr/include/x86_64-linux-gnu/qt5/QtCore/qarraydata.h:38,
                 from /usr/include/x86_64-linux-gnu/qt5/QtCore/qbytearray.h:39,
                 from /usr/include/x86_64-linux-gnu/qt5/QtCore/qstring.h:42,
                 from /usr/include/x86_64-linux-gnu/qt5/QtCore/qobject.h:41,
                 from /usr/include/x86_64-linux-gnu/qt5/QtWidgets/qgraphicsitem.h:38,
                 from /usr/include/x86_64-linux-gnu/qt5/QtWidgets/QGraphicsItem:1,
                 from /home/jd/copasi_comp/COPASI/copasi/qlayout/CQRenderConverter.cpp:11:
/home/jd/copasi_comp/COPASI/copasi/qlayout/CQRenderConverter.cpp: In function ‘QSharedPointer<QFont> getFont(const CLText*, const CLGroup*, const CLRenderResolver*, const CLBoundingBox*)’:
/home/jd/copasi_comp/COPASI/copasi/qlayout/CQRenderConverter.cpp:215:12: error: could not convert ‘0l’ from ‘long int’ to ‘QSharedPointer<QFont>’
     return NULL;
            ^
copasi/CMakeFiles/libCOPASIUI.dir/build.make:2890: recipe for target 'copasi/CMakeFiles/libCOPASIUI.dir/qlayout/CQRenderConverter.cpp.o' failed
make[2]: *** [copasi/CMakeFiles/libCOPASIUI.dir/qlayout/CQRenderConverter.cpp.o] Error 1
CMakeFiles/Makefile2:990: recipe for target 'copasi/CMakeFiles/libCOPASIUI.dir/all' failed
make[1]: *** [copasi/CMakeFiles/libCOPASIUI.dir/all] Error 2
Makefile:160: recipe for target 'all' failed
make: *** [all] Error 2

 
- DSELECT_QT=Qt4 
cmake configuration now dies with:
qmake: could not find a Qt installation of 'Qt4'
-- Looking for Q_WS_X11
-- Looking for Q_WS_X11 - found
-- Looking for Q_WS_WIN
-- Looking for Q_WS_WIN - not found
-- Looking for Q_WS_QWS
-- Looking for Q_WS_QWS - not found
-- Looking for Q_WS_MAC
-- Looking for Q_WS_MAC - not found
CMake Error at /usr/share/cmake-3.5/Modules/FindPackageHandleStandardArgs.cmake:148 (message):
  Could NOT find Qt4 (missing: QT_QTWEBKIT_INCLUDE_DIR QT_QTWEBKIT_LIBRARY)
  (found version "4.8.7")
Call Stack (most recent call first):
  /usr/share/cmake-3.5/Modules/FindPackageHandleStandardArgs.cmake:388 (_FPHSA_FAILURE_MESSAGE)
  /usr/share/cmake-3.5/Modules/FindQt4.cmake:1333 (FIND_PACKAGE_HANDLE_STANDARD_ARGS)
  ChooseQtVersion.cmake:51 (find_package)
  CMakeLists.txt:506 (QT_FIND_MODULES)
I attached the detailed logs
 

CMakeError.log
CMakeOutput.log

Stefan Hoops

unread,
Oct 6, 2017, 1:10:02 PM10/6/17
to COPASI User Forum
Hello Joerg,

For Qt4 you also need to install QtWebkit and QtWebkit-dev

To fix the compile problem replace NULL with:
QSharedPointer<QFont>(NULL)

I hope that helps!
Stefan


On Fri, 6 Oct 2017 09:51:04 -0700 (PDT)
Jörn D <zgfuem...@gmail.com> wrote:

> Thanks a lot for the fast answer.
> Your hint resolved the problem but then new ones appeared:
>
> - With "DSELECT_QT=Qt5 " the cmake configuration worked after
> installing libqt5webkit5-dev (which I seem to have forgotten before)
> But now I get a compilation error when building
> *copasi/CMakeFiles/libCOPASIUI.dir/qlayout/CQRenderConverter.cpp.o*
--
Stefan Hoops, Ph.D.
Research Assistant Professor
Director, Biochemical Networks Modeling Group
Faculty of Health Sciences (FHS)
Biocomplexity Institute of Virginia Tech
1015 Life Science Circle (0477)
Blacksburg, Va 24061, USA

Phone: (540) 231-1799
Fax: (540) 231-2606
Email: sho...@vt.edu

Felix Winter

unread,
Oct 6, 2017, 5:20:49 PM10/6/17
to copasi-u...@googlegroups.com
Hi Joerg, Hi Stefan

for compilation with Qt5 on a recent Ubuntu there are a few more issues. One example is that qwt in the copasi dependencies still uses QT_STATIC_CONST. This was replaced in Qwt 6.1.2. While a newer version of Qwt is available in the copasi-dependencies repository it seems that during the build of copasi the old version is used. It does help however to remove qwt from the list of dependencies to be build in the file 'createLinux.sh'.

In addition, I had to replace all instances of #include <QPrinter> with #include <QtPrintSupport/QPrinter> . Please see attached patch files for details.

This fixed compilation, at least for me :)

Best regards,
Felix
> --
> You received this message because you are subscribed to the Google Groups "COPASI User Forum" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to copasi-user-fo...@googlegroups.com.
> To post to this group, send email to copasi-u...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/copasi-user-forum/20171006130951.1ad0a811%40%5BGmail%5D.
dependencies.patch
copasi.patch

Frank T. Bergmann

unread,
Oct 7, 2017, 7:36:47 AM10/7/17
to copasi-u...@googlegroups.com
Hello Felix,

You are correct, when using qt5, the use qwt6 is necessary... i've
committed a version of the createLinux-qt5 script that i use locally
it just compiles qwt6. Over time we should change the other script to
no longer allow to compile qwt and qwt6 together, as installations
interfere with each other.

For me the other patch for the includes is not necessary to compile on
qt5, and since it will fail to work on qt4 i don't include it for now.

best
Frank
> To view this discussion on the web visit https://groups.google.com/d/msgid/copasi-user-forum/223198638.573906.1507324848542%40com4.strato.de.

Jörn D

unread,
Oct 11, 2017, 7:11:46 AM10/11/17
to COPASI User Forum
Hei

Thanks a lot for the patches. The Qt5 compiled version works now, which is sufficient for me.
I only get a problem when trying to compile it with Python bindings.
Swig crashes with the following message:
[100%] Built target libCOPASIUI
[100%] Built target binding_python_swig
[100%] Swig Python source
/home/jd/code/COPASI/copasi/utilities/CValidity.h:148: Warning 362: operator= ignored
/home/jd/code/COPASI/copasi/bindings/python/../swig/CAnnotatedMatrix.i:77: Warning 303: %extend defined for an undeclared class CCopasiMatrixInterface.
swig3.0: ../../Source/Modules/lang.cxx:1657: virtual int Language::enumDeclaration(Node*): Assertion `Getattr(n, "sym:name")' failed.
Aborted (core dumped)
copasi/bindings/python/CMakeFiles/binding_python_lib.dir/build.make:167: recipe for target 'copasi/bindings/python/copasi_wrapper.cpp' failed
make[2]: *** [copasi/bindings/python/copasi_wrapper.cpp] Error 134
make[2]: *** Deleting file 'copasi/bindings/python/copasi_wrapper.cpp'
CMakeFiles/Makefile2:1143: recipe for target 'copasi/bindings/python/CMakeFiles/binding_python_lib.dir/all' failed
make[1]: *** [copasi/bindings/python/CMakeFiles/binding_python_lib.dir/all] Error 2
Makefile:160: recipe for target 'all' failed
make: *** [all] Error 2
Do you know what i could do to resolve this problem. 
 

Just for your information the compilation with Qt4 produces a linking error, see make_output_qt4.txt

Have a nice day.
Jørn
make_output_qt4.txt

Frank Bergmann

unread,
Oct 11, 2017, 10:29:07 AM10/11/17
to COPASI User Forum

Hello Jørn,

swig ought not to crash, we might have to know what version of SWIG you use to find out more. it might be necessary to update the version you have on your system. I use SWIG 3.0.12, but have been using other versions as well without crash. 

As for your Qt issue, to tell exactly what is going on, I would need the CMakeCache.txt files from both your COPASI build directory, as well as from the copasi-dependencies/tmp/qwt directory, or if you are using qwt-6, then copasi-dependencies/tmp/qwt-6. Should you have build both, then your copasi-dependencies/bin directory is invalid, and the qwt files need to be removed first before re-installing the correct version. 

Thanks
Frank
Reply all
Reply to author
Forward
0 new messages