Building Gqrx with Qmake without -g debugging objects and adding multi-thread build options

54 views
Skip to first unread message

David Ranch

unread,
Aug 12, 2016, 12:02:05 PM8/12/16
to Gqrx SDR

Hello Everyone,

I'm building & packaging the newest TIP Gqrx from git but I noticed that the Qmake build approach (not Cmake) seems to be including -g debugging objects as well as only -O2 optimizations. Any ideas where it's getting this from? As you can see below, I also manually delete the Makefile, re-create it and it's re-creating these settings into the Makefile.

There is nothing else that I can see in the gqrx.pro file that seems to be invoking this. I also see the build is only using a single core. What's the best way to pass on say "-j 4" via Qmake?
If I do the build manually, it comes up: -- $ rm Makefile

$ qmake-qt4 gqrx.pro Project MESSAGE: Gqrx configured with pulseaudio backend Project MESSAGE: No prefix given. Using /usr/local fatal: Not a git repository (or any of the parent directories): .git WARNING: /usr/src/redhat/BUILD/gqrx-2.5.3/gqrx.pro:241: Variable INCPATH is deprecated; use INCLUDEPATH instead. $ grep -r "\-g \-O2" * Makefile:CFLAGS = -pipe -O3 -march=native -m64 -g -O2 -Wall -W -D_REENTRANT $(DEFINES) Makefile:CXXFLAGS = -pipe -O3 -march=native -m64 -g -O2 -Wall -W -D_REENTRANT $(DEFINES) -- Here is the output when building and packaging into an RPM:
--
$ time rpmbuild -bb --target=x86_64 gqrx.spec Building target platforms: x86_64 Building for target x86_64 Executing(%prep): /bin/sh -e /var/tmp/rpm-tmp.CA7npm + umask 022 + cd /home/dranch/rpmbuild/BUILD + LANG=C + export LANG + unset DISPLAY + cd /home/dranch/rpmbuild/BUILD + rm -rf gqrx-2.5.3 + /bin/tar -xf /home/dranch/rpmbuild/SOURCES/gqrx-2.5.3-20160811git31a2289f.tar.bz2 + cd gqrx-2.5.3 + /bin/chmod -Rf a+rX,u+w,g-w,o-w . + mv gqrx.pro gqrx.pro_in + sed 's/VER = 0.0/VER = 2.5.3/g' gqrx.pro_in + rm gqrx.pro_in + exit 0 Executing(%build): /bin/sh -e /var/tmp/rpm-tmp.gdn9Of + umask 022 + cd /home/dranch/rpmbuild/BUILD + cd gqrx-2.5.3 + LANG=C + export LANG + unset DISPLAY + export QTDIR=/usr/lib64/qt4 + QTDIR=/usr/lib64/qt4 + qmake-qt4 gqrx.pro Project MESSAGE: Gqrx configured with pulseaudio backend Project MESSAGE: No prefix given. Using /usr/local fatal: Not a git repository (or any of the parent directories): .git WARNING: /usr/src/redhat/BUILD/gqrx-2.5.3/gqrx.pro:241: Variable INCPATH is deprecated; use INCLUDEPATH instead. + make /usr/lib64/qt4/bin/uic src/applications/gqrx/mainwindow.ui -o ui_mainwindow.h /usr/lib64/qt4/bin/uic src/applications/gqrx/remote_control_settings.ui -o ui_remote_control_settings.h /usr/lib64/qt4/bin/uic src/qtgui/afsk1200win.ui -o ui_afsk1200win.h /usr/lib64/qt4/bin/uic src/qtgui/agc_options.ui -o ui_agc_options.h /usr/lib64/qt4/bin/uic src/qtgui/audio_options.ui -o ui_audio_options.h /usr/lib64/qt4/bin/uic src/qtgui/demod_options.ui -o ui_demod_options.h /usr/lib64/qt4/bin/uic src/qtgui/dockaudio.ui -o ui_dockaudio.h /usr/lib64/qt4/bin/uic src/qtgui/dockbookmarks.ui -o ui_dockbookmarks.h /usr/lib64/qt4/bin/uic src/qtgui/dockfft.ui -o ui_dockfft.h /usr/lib64/qt4/bin/uic src/qtgui/dockinputctl.ui -o ui_dockinputctl.h /usr/lib64/qt4/bin/uic src/qtgui/dockrds.ui -o ui_dockrds.h /usr/lib64/qt4/bin/uic src/qtgui/iq_tool.ui -o ui_iq_tool.h /usr/lib64/qt4/bin/uic src/qtgui/dockrxopt.ui -o ui_dockrxopt.h /usr/lib64/qt4/bin/uic src/qtgui/ioconfig.ui -o ui_ioconfig.h /usr/lib64/qt4/bin/uic src/qtgui/nb_options.ui -o ui_nb_options.h g++ -c -pipe -O3 -march=native -m64 -g -O2 -Wall -W -D_REENTRANT -DQT_NO_DEBUG -DQT_NO_DEBUG_OUTPUT -DVERSION="\"\"" -DWITH_PULSEAUDIO -D_REENTRANT -DQT_NO_DEBUG -DQT_GUI_LIB -DQT_NETWORK_LIB -DQT_CORE_LIB -DQT_SHARED -I../../../../lib64/qt4/mkspecs/linux-g++ -I. -I../../../../include/QtCore -I../../../../include/QtNetwork -I../../../../include/QtGui -I../../../../include -Isrc -I. -I. -o main.o src/applications/gqrx/main.cpp g++ -c -pipe -O3 -march=native -m64 -g -O2 -Wall -W -D_REENTRANT -DQT_NO_DEBUG -DQT_NO_DEBUG_OUTPUT -DVERSION="\"\"" -DWITH_PULSEAUDIO -D_REENTRANT -DQT_NO_DEBUG -DQT_GUI_LIB -DQT_NETWORK_LIB -DQT_CORE_LIB -DQT_SHARED -I../../../../lib64/qt4/mkspecs/linux-g++ -I. -I../../../../include/QtCore -I../../../../include/QtNetwork -I../../../../include/QtGui -I../../../../include -Isrc -I. -I. -o mainwindow.o src/applications/gqrx/mainwindow.cpp g++ -c -pipe -O3 -march=native -m64 -g -O2 -Wall -W -D_REENTRANT -DQT_NO_DEBUG -DQT_NO_DEBUG_OUTPUT -DVERSION="\"\"" -DWITH_PULSEAUDIO -D_REENTRANT -DQT_NO_DEBUG -DQT_GUI_LIB -DQT_NETWORK_LIB -DQT_CORE_LIB -DQT_SHARED -I../../../../lib64/qt4/mkspecs/linux-g++ -I. -I../../../../include/QtCore -I../../../../include/QtNetwork -I../../../../include/QtGui -I../../../../include -Isrc -I. -I. -o receiver.o src/applications/gqrx/receiver.cpp g++ -c -pipe -O3 -march=native -m64 -g -O2 -Wall -W -D_REENTRANT -DQT_NO_DEBUG -DQT_NO_DEBUG_OUTPUT -DVERSION="\"\"" -DWITH_PULSEAUDIO -D_REENTRANT -DQT_NO_DEBUG -DQT_GUI_LIB -DQT_NETWORK_LIB -DQT_CORE_LIB -DQT_SHARED -I../../../../lib64/qt4/mkspecs/linux-g++ -I. -I../../../../include/QtCore -I../../../../include/QtNetwork -I../../../../include/QtGui -I../../../../include -Isrc -I. -I. -o file_resources.o src/applications/gqrx/file_resources.cpp g++ -c -pipe -O3 -march=native -m64 -g -O2 -Wall -W -D_REENTRANT -DQT_NO_DEBUG -DQT_NO_DEBUG_OUTPUT -DVERSION="\"\"" -DWITH_PULSEAUDIO -D_REENTRANT -DQT_NO_DEBUG -DQT_GUI_LIB -DQT_NETWORK_LIB -DQT_CORE_LIB -DQT_SHARED -I../../../../lib64/qt4/mkspecs/linux-g++ -I. -I../../../../include/QtCore -I../../../../include/QtNetwork -I../../../../include/QtGui -I../../../../include -Isrc -I. -I. -o remote_control.o src/applications/gqrx/remote_control.cpp . . .
[output truncated]
--

Alexandru Csete

unread,
Aug 17, 2016, 2:26:03 PM8/17/16
to gq...@googlegroups.com
On Fri, Aug 12, 2016 at 6:02 PM, David Ranch <dra...@gmail.com> wrote:
>
> Hello Everyone,
>
> I'm building & packaging the newest TIP Gqrx from git but I noticed that the
> Qmake build approach (not Cmake) seems to be including -g debugging objects
> as well as only -O2 optimizations. Any ideas where it's getting this from?
> As you can see below, I also manually delete the Makefile, re-create it and
> it's re-creating these settings into the Makefile.

Hi David

Did you find out about this?

It is probably a system wide default setting. I have often seen
distributions use "-g -O2" so that the distributed binaries can
provide some debug info in case of crash.

The qmake package installs a bunch of configuration files under
/usr/share/qt4/mkspecs/ -- you can have a look here if you get bored
;-)

> There is nothing else that I can see in the gqrx.pro file that seems to be
> invoking this. I also see the build is only using a single core. What's
> the best way to pass on say "-j 4" via Qmake?

Qmake only generates the makefile, it does not invoke it. It is
somewhere in you packaging script that you have to override the
default with -j4.

Alex

David Ranch

unread,
Aug 17, 2016, 3:39:17 PM8/17/16
to Gqrx SDR

Hey Alex,

Thanks for the response and more importantly the Qt4 hint.   In digging into this, I ran the command:

$ grep "\-g" `find / 2>/dev/null | grep mkspecs | grep linux | grep conf | grep -v -e \.h -e unsupported -e arm -e dm800 -e mips -e sh4al -e powerpc -e avr32 -e dm7000 -e zylonite -e sharp -e kylix` | grep -v -e configuration

I got a few good hits here:

/usr/lib64/qt4/mkspecs/linux-pgcc/qmake.conf:QMAKE_CFLAGS_DEBUG = -g
/usr/lib64/qt4/mkspecs/linux-ecc-64/qmake.conf:QMAKE_CFLAGS_DEBUG       = -g
/usr/lib64/qt4/mkspecs/linux-g++/qmake.conf:QMAKE_CFLAGS_RELEASE   += -O3 -march=native -m64 -g


I think it's that last line that is enabling the debug objects but I have NO idea why they would enable say a -O3 optimization with -g! 


Qmake only generates the makefile, it does not invoke it. It is
somewhere in you packaging script that you have to override the
default with -j4.


Asking my question differently... when I invoke "qmake-qt4 gqrx.pro", is there a way to pass the "-j4" parameter right here via a specific keyword or environment variable?


--David
KI6ZHD

Alexandru Csete

unread,
Aug 17, 2016, 3:53:15 PM8/17/16
to gq...@googlegroups.com
On Wed, Aug 17, 2016 at 9:39 PM, David Ranch <dra...@gmail.com> wrote:
>> Qmake only generates the makefile, it does not invoke it. It is
>> somewhere in you packaging script that you have to override the
>> default with -j4.
>
> Asking my question differently... when I invoke "qmake-qt4 gqrx.pro", is
> there a way to pass the "-j4" parameter right here via a specific keyword or
> environment variable?

None that I know of.

Alex
Reply all
Reply to author
Forward
0 new messages