Qucs / qucs

Qucs Project official mirror
http://qucs.sourceforge.net/
GNU General Public License v2.0
1.16k stars 213 forks source link

qt5: set travis and other small fixes. #808

Closed guitorri closed 6 years ago

guitorri commented 6 years ago

Qt4 builds but fails while running CTest. Investigating.

guitorri commented 6 years ago

Somehow the Qt5 instance is picking up Qt4 includes:

In file included from /usr/include/qt4/QtSvg/QtSvg:5:0,
                 from /home/travis/build/Qucs/qucs/qucs/qucs-powercombining/qucspowercombiningtool.h:27,
                 from /home/travis/build/Qucs/qucs/qucs/qucs-powercombining/qucspowercombiningtool.cpp:27:
/usr/include/qt4/QtSvg/qgraphicssvgitem.h:57:37: error: expected initializer before ‘:’ token
 class Q_SVG_EXPORT QGraphicsSvgItem : public QGraphicsObject
                                     ^
In file included from /usr/include/qt5/QtCore/qobject.h:56:0,
                 from /usr/include/qt5/QtCore/qabstractanimation.h:45,
                 from /usr/include/qt5/QtCore/QtCore:4,
                 from /usr/include/qt4/QtSvg/QtSvg:3,
                 from /home/travis/build/Qucs/qucs/qucs/qucs-powercombining/qucspowercombiningtool.h:27,
                 from /home/travis/build/Qucs/qucs/qucs/qucs-powercombining/qucspowercombiningtool.cpp:27:
in3otd commented 6 years ago

yep, the issue is in qucspowercombining, I was wondering if this is right

guitorri commented 6 years ago

Ok, both are building but failing to run unittest.

felix-salfelder commented 6 years ago

On Fri, Jul 13, 2018 at 06:05:08AM -0700, Guilherme Brondani Torri wrote:

Ok, both are building but failing to run unittest.

yes, i am tracking down the problem in develop right now. need to see if it is easier or harder to fix in qt5.

one issue is certainly the multiple inheritance in class Schematic. it could be an easy fix (but i haven't tried yet).

please merge the associated test #811.

felix-salfelder commented 6 years ago

... and #810 and #757.

guitorri commented 6 years ago

The Qt4 instance runs fine. The Qt5 instance seems to be running Qt5.2.1. It is failing to run the SchematicTests unit. It seems to segfault. I will try to investigate further. On my OSX machine with Qt5.11.1 the tests run just fine. 😕

felix-salfelder commented 6 years ago

i'm a bit lost here. the SchematicTest does not work for me, even in develop. see #814.

in3otd commented 6 years ago

I'm lost since the beginning, but here trying to build with Qt 5.7.1 using cmake I get a message

qucs/qucs/qucs/dialogs/ui_searchdialog.h: In member function 'void Ui_SearchDialog::retranslateUi(QDialog*)':
qucs/qucs/qucs/dialogs/ui_searchdialog.h:145:91: error: 'UnicodeUTF8' is not a member of 'QApplication'
         SearchDialog->setWindowTitle(QApplication::translate("SearchDialog", "Dialog", 0, QApplication::UnicodeUTF
guitorri commented 6 years ago

@felix-salfelder, SchematicTests works with develop/qt4/cmake, no?

@in3otd, the UnicodeUTF8 is now obsolete: https://wiki.qt.io/Transition_from_Qt_4.x_to_Qt5 On my system (OSX, Qt5.11.1) the offending line is this:

 SearchDialog->setWindowTitle(QApplication::translate("SearchDialog", "Dialog", nullptr));

I don't thing your UIC compiler are mixing Qt4/Qt5. I don't know how to set that nullptr on the searchdialog.ui. Maybe we should revert this dialog to plain .h/.cpp code.

There are further issues with Qt4 Qt5 coexisting. Shall we target the latest Qt5? I have a few other small such fixes I will keep pushing here.

in3otd commented 6 years ago

the UnicodeUTF8 is now obsolete

ah, thanks. I also was puzzled because the UIC used is the right (Qt5) one but then I saw that the in include paths specified on the compiler command line the qucs sources directory comes before the build directory where I'm compiling. I did a make clean in the qucs sources before but didn't notice that the ui_ file was not removed (need to make distclean for that) and the end result was that the old (Qt4 generated) ui_ file was picked up. I wonder if having the include path in the qucs sources also is right.

Now the GUI compilation is fine but I get an error on qucs-core

Scanning dependencies of target equation
make[2]: Leaving directory '/home/Qucs/qucs/build'
make -f qucs-core/src/CMakeFiles/equation.dir/build.make qucs-core/src/CMakeFiles/equation.dir/build
make[2]: Entering directory '/home/Qucs/qucs/build'
make[2]: *** No rule to make target '../qucs-core/src/gperfapphash.gph', needed by 'qucs-core/src/gperfapphash.cpp'.  Stop.
make[2]: Leaving directory '/home/Qucs/qucs/build'
CMakeFiles/Makefile2:1572: recipe for target 'qucs-core/src/CMakeFiles/equation.dir/all' failed
make[1]: *** [qucs-core/src/CMakeFiles/equation.dir/all] Error 2
make[1]: Leaving directory '/home/Qucs/qucs/build'
Makefile:163: recipe for target 'all' failed
make: *** [all] Error 2
guitorri commented 6 years ago

hum, not sure. Maybe the gperf version and line endings issues again?

guitorri commented 6 years ago

Linux, Autotools, gcc, Qt4.8: build, fail on qucs-test (save sch not working) Linux, Autotools, clang, Qt4.8: fail to build Linux, CMake, gcc, Qt4.8 : pass Linux, CMake, gcc, Qt5.2.2: build, fail ctest SchemeaticTests OSX, CMake, clang, Qt5.11.1, pass OSX, autotools, clang, Qt4.8, build, fail on qucs-test (save sch not working)

There might be some issue related to Qt5 version. I will check if can make OSX autotools work again.


Edit, status of other instances

in3otd commented 6 years ago

ok, removed the build directory and run cmake again, everything compiles fine - probably still some issues with pre-compiled stuff in the source directory. Sorry for the noise. Will try to run the checks later.

guitorri commented 6 years ago

Does Ctest SchemeaticTests run on your system? which compiler?

in3otd commented 6 years ago

yep

$ make test
Running tests...
/usr/bin/ctest --force-new-ctest-process 
Test project /home/otd/c/tmp/qucs/build
    Start 1: ElementTests
1/3 Test #1: ElementTests .....................   Passed    0.08 sec
    Start 2: ComponentTests
2/3 Test #2: ComponentTests ...................   Passed    0.09 sec
    Start 3: SchematicTests
3/3 Test #3: SchematicTests ...................   Passed    0.12 sec

100% tests passed, 0 tests failed out of 3

Total Test time (real) =   0.29 sec

with c++ (GCC) 5.3.0

felix-salfelder commented 6 years ago

On Sun, Jul 15, 2018 at 05:41:48AM -0700, Guilherme Brondani Torri wrote:

@felix-salfelder, SchematicTests works with develop/qt4/cmake, no?

in travis, it does, but could be a fluke. i added the tests to autotools see the long overdue #814. the (one) Schematic test fails consistently, the others pass. could have something to do with autotools builds a library, cmake does not (or differently). but the bug seems to be in the code.

i am hunting it down, found and fixed some issues. please merge #814,

813, #810 and #757, so i can start to rebase, see how this plays with

the other PRs.

thanks

guitorri commented 6 years ago

If we cannot reproduce we will never know if it is the code, compiler, qt version or the build system. I tried to setup a docker vm to debug, but I am having issues with the DISPLAY. QucsApp tries to use the windows system as we know...

felix-salfelder commented 6 years ago

814 reproduces the problem on travis. SchematicTest woes with autotools, not with cmake

i also tried both cmake and autotools on debian testing with qt4.8.7. same thing.

guitorri commented 6 years ago

Cherry-picked and changed base to qt5-1.

guitorri commented 6 years ago

I will try to fix the save as function, that should fix the issues with qucs-test and turn green another 2 CI instances.

felix-salfelder commented 6 years ago

the BoundingRect functions leak memory.

return *(new QRectF( ... )) does not delete, and "return" leaves the scope, loosing the pointer.

guitorri commented 6 years ago

There is regression on the netlist generation, sometimes the gnd is skipped and the netlist start from _net0:

** Test schematic to netlist conversion **
Converting schematic to netlist.
Running [qucs]:  ../buildqt5/qucs/qucs/qucs.app/Contents/MacOS/qucs -n -i testsuite/AC_SW_swr_meter_prj/swr_meter.sch -o testsuite/AC_SW_swr_meter_prj/test_swr_meter.txt
Comparing : diff testsuite/AC_SW_swr_meter_prj/netlist.txt testsuite/AC_SW_swr_meter_prj/test_swr_meter.txt
Diff netlist    : FAIL

############################################
#  Report schematic to netlist conversion  #
--> Found differences (!)
{'AC_SW_swr_meter_prj': ['- R:R4 _net0 _net1 R="50 Ohm" Temp="26.85" Tc1="0.0" Tc2="0.0" Tnom="26.85"\n',
                         '?          ^     ^\n',
                         '+ R:R4 _net1 _net2 R="50 Ohm" Temp="26.85" Tc1="0.0" Tc2="0.0" Tnom="26.85"\n',
                         '?          ^     ^\n',
                         '- Vac:V1 _net0 gnd U="2 V" f="1 GHz" Phase="0" Theta="0"\n',
                         '?            ^\n',
                         '+ Vac:V1 _net1 gnd U="2 V" f="1 GHz" Phase="0" Theta="0"\n',
                         '?            ^\n',
                         '- Tr:Tr1 reflected _net1 Output gnd T="25"\n',
                         '?                      ^        ^ ^\n',
                         '+ Tr:Tr1 reflected _net2 Output _net0 T="25"\n',
                         '?                      ^        ^ ^^^\n']}
guitorri commented 6 years ago

Update on the failing CI instances Linux, Autotools, gcc, Qt4.8: build, fail on qucs-test (netlist regression above) Linux, Autotools, clang, Qt4.8: fail to build (error: call to implicitly-deleted copy constructor)

The first we can fix, the second might be the compiler...

felix-salfelder commented 6 years ago

rebased/retargeted to qt5-3 (equivalent to qt5-2)

guitorri commented 6 years ago

rebased on qt5-3 to remove conflicts

felix-salfelder commented 6 years ago

On Thu, Jul 19, 2018 at 12:20:41PM -0700, Guilherme Brondani Torri wrote:

rebased on qt5-3 to remove conflicts

thank you.

i have rebased. qt5-4 now equivalent to qt5-3.

felix-salfelder commented 6 years ago

hmm wattmeter netlist failure. is this the aftermath of the wattmeter revert?

let me rebase this...

guitorri commented 6 years ago

Need to patch qucs-test. The gold netlist for wattmeter still has internal resistances on it.


[94m############################################
#  Report schematic to netlist conversion  #
--> Found differences (!)
{'AC_wattmeter_prj': ['- Vac:V1 _net0_TEMP_V1 gnd U="150 V" f="1 GHz" Phase="0" Theta="0" Ri="0 Ohm"\n',
                      '?             --------                                            -----------\n',
                      '+ Vac:V1 _net0 gnd U="150 V" f="1 GHz" Phase="0" Theta="0"\n',
                      '- R:_R__net0_TEMP_V1 _net0_TEMP_V1 _net0 R="0 Ohm" Temp = "26.85" Tc1 = "0.0" Tc2 = "0.0" Tnom = "26.85"\n',
                      '- \n',
                      '- \n',
                      '- \n',
                      '+ WProbe:PF _net0 _net1 _net0 gnd\n',
                      '- \n',
                      '- WProbe:PF _net0 _net1_TEMP_PF1 _net0 gnd Riv="0 Ohm" Rii="0 Ohm"\n',
                      '- R:_R__net1_TEMP_PF1 _net1_TEMP_PF1 _net1 R="0 Ohm" Temp = "26.85" Tc1 = "0.0" Tc2 = "0.0" Tnom = "26.85"\n',
                      '- \n',
                      '- \n']}
guitorri commented 6 years ago

I think this is only error remaining thou. I will push a fix in minute.

guitorri commented 6 years ago

Hum, error moved down to qucscore. Investigating.

Project :  /home/travis/build/Qucs/qucs/qucs-0.0.19/_build/qucs-test/testsuite/TR_sym_osci_prj
Running :  /home/travis/build/Qucs/qucs/qucs-0.0.19/_build/qucs-core/src/qucsator -i /home/travis/build/Qucs/qucs/qucs-0.0.19/_build/qucs-test/testsuite/TR_sym_osci_prj/netlist.txt -o /home/travis/build/Qucs/qucs/qucs-0.0.19/_build/qucs-test/testsuite/TR_sym_osci_prj/test_sym_osci.dat
Traceback (most recent call last):
  File "run.py", line 747, in <module>
    tests = [p.get() for p in testsp] # get results
  File "/usr/lib/python2.7/multiprocessing/pool.py", line 558, in get
    raise self._value
KeyError: '_net0_TEMP_V1.v'
guitorri commented 6 years ago

Aff, all a few tests are polluted with the internal resistance things... I will try to revert that.

guitorri commented 6 years ago

Force updated with qucs-test fixes.

guitorri commented 6 years ago

CI working again :smile:

I am getting this error this local machine: Windows / MSYS2 / CMake/ Qt 511.1 / GCC 7.3. Any idea?

$ make
[  8%] Built target coreSchematic
[ 12%] Built target paintings
[ 51%] Built target components
[ 55%] Built target diagrams
[ 67%] Built target dialogs
Scanning dependencies of target qucsschematic
[ 67%] Linking CXX shared library libqucsschematic.dll
[ 67%] Built target qucsschematic
[ 68%] Generating qrc_qucs_.cpp
Scanning dependencies of target qucs
[ 68%] Building CXX object qucs/CMakeFiles/qucs.dir/main.cpp.obj
In file included from C:/Users/brondani/git/qucs/qucs/qucs/schematic.h:33:0,
                 from C:/Users/brondani/git/qucs/qucs/qucs/main.cpp:48:
C:/Users/brondani/git/qucs/qucs/qucs/diagrams/diagram.h:111:14: error: template argument 1 is invalid
   QList<Arc *>    Arcs;
              ^
make[2]: *** [qucs/CMakeFiles/qucs.dir/build.make:313: qucs/CMakeFiles/qucs.dir/main.cpp.obj] Error 1
make[1]: *** [CMakeFiles/Makefile2:238: qucs/CMakeFiles/qucs.dir/all] Error 2
make: *** [Makefile:130: all] Error 2

$ g++ --version
g++.exe (Rev2, Built by MSYS2 project) 7.3.0
Copyright (C) 2017 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
felix-salfelder commented 6 years ago

On Fri, Jul 20, 2018 at 03:24:40AM -0700, Guilherme Brondani Torri wrote:

CI working again :smile:

I am getting this error this local machine: Windows / MSYS2 / CMake/ Qt 511.1 / GCC 7.3. Any idea?

i remember there was a name conflict on Arc, when I did something else.

perhaps you need to

if win23

undef Arc

endif

in platform.h?

guitorri commented 6 years ago

Please merge. I will investigate the Arc issue another day.

felix-salfelder commented 6 years ago

cool. well done.

i'll try to sort out mouse actions... let me know if you have more on this.