intel / thermal_daemon

Thermal daemon for IA
GNU General Public License v2.0
539 stars 117 forks source link

2.5.4: build fails on linking with `libQCustomPlot` #421

Closed kloczek closed 1 month ago

kloczek commented 12 months ago

Looks like in autoconf is missing libQCustomPlot detection because it passes without errors

```console + ./configure --bindir=/usr/bin --build=x86_64-redhat-linux-gnu --datadir=/usr/share --disable-dependency-tracking --exec-prefix=/usr --host=x86_64-redhat-linux-gnu --includedir=/usr/include --infodir=/usr/share/info --libdir=/usr/lib64 --libexecdir=/usr/libexec --localstatedir=/var --mandir=/usr/share/man --prefix=/usr --program-prefix= --runstatedir=/run --sbindir=/usr/sbin --sharedstatedir=/var/lib --sysconfdir=/etc --disable-option-checking --disable-silent-rules checking whether make supports nested variables... yes checking for a BSD-compatible install... /usr/bin/install -c checking whether build environment is sane... yes checking for a race-free mkdir -p... /usr/bin/mkdir -p checking for gawk... gawk checking whether make sets $(MAKE)... yes checking whether to enable maintainer-specific portions of Makefiles... yes checking for x86_64-redhat-linux-gnu-pkg-config... no checking for pkg-config... /usr/bin/pkg-config checking pkg-config is at least version 0.9.0... yes checking for gtk-doc... yes checking for gtkdoc-check... gtkdoc-check.test checking for gtkdoc-check... /usr/bin/gtkdoc-check checking for gtkdoc-rebase... /usr/bin/gtkdoc-rebase checking for gtkdoc-mkpdf... /usr/bin/gtkdoc-mkpdf checking whether to build gtk-doc documentation... no checking for glib-2.0 >= 2.10.0 gobject-2.0 >= 2.10.0... yes checking for x86_64-redhat-linux-gnu-pkg-config... /usr/bin/pkg-config checking pkg-config is at least version 0.9.0... yes System paths: prefix: /usr exec_prefix: /usr systemdunitdir: /usr/lib/systemd/system tdbinary: /usr/sbin/thermald tdconfdir: /etc/thermald tdrundir: /var/run/thermald checking whether make supports the include directive... yes (GNU style) checking for x86_64-redhat-linux-gnu-gcc... /usr/bin/gcc checking whether the C compiler works... yes checking for C compiler default output file name... a.out checking for suffix of executables... checking whether we are cross compiling... no checking for suffix of object files... o checking whether the compiler supports GNU C... yes checking whether /usr/bin/gcc accepts -g... yes checking for /usr/bin/gcc option to enable C11 features... none needed checking whether /usr/bin/gcc understands -c and -o together... yes checking dependency style of /usr/bin/gcc... none checking for dbus_glib_global_set_disable_legacy_property_access in -ldbus-glib-1... yes checking for dbus-1 >= 1.1 dbus-glib-1 >= 0.94... yes checking for gio-unix-2.0 >= 2.22 gmodule-2.0... yes checking for libxml-2.0 >= 2.4... yes checking for gdbus-codegen... /usr/bin/gdbus-codegen checking for liblzma... yes checking for upower-glib... yes checking for libevdev... yes checking for x86_64-redhat-linux-gnu-gcc... (cached) /usr/bin/gcc checking whether the compiler supports GNU C... (cached) yes checking whether /usr/bin/gcc accepts -g... (cached) yes checking for /usr/bin/gcc option to enable C11 features... (cached) none needed checking whether /usr/bin/gcc understands -c and -o together... (cached) yes checking dependency style of /usr/bin/gcc... (cached) none checking how to run the C preprocessor... /usr/bin/gcc -E checking whether the compiler supports GNU C++... yes checking whether /usr/bin/g++ accepts -g... yes checking for /usr/bin/g++ option to enable C++11 features... none needed checking dependency style of /usr/bin/g++... none checking for an ANSI C-conforming const... yes checking for inline... inline checking for stdio.h... yes checking for stdlib.h... yes checking for string.h... yes checking for inttypes.h... yes checking for stdint.h... yes checking for strings.h... yes checking for sys/stat.h... yes checking for sys/types.h... yes checking for unistd.h... yes checking for size_t... yes checking whether C compiler accepts -Werror -Wall... yes checking whether C compiler accepts -Werror -Wclobbered... yes checking whether C compiler accepts -Werror -Wempty-body... yes checking whether C compiler accepts -Werror -Wformat... yes checking whether C compiler accepts -Werror -Wignored-qualifiers... yes checking whether C compiler accepts -Werror -Wmissing-field-initializers... yes checking whether C compiler accepts -Werror -Wreorder... no checking whether C compiler accepts -Werror -Wreturn-type... yes checking whether C compiler accepts -Werror -Wsign-compare... yes checking whether C compiler accepts -Werror -Wtype-limits... yes checking whether C compiler accepts -Werror -Wuninitialized... yes checking whether C compiler accepts -Werror -Wunused-but-set-variable... yes checking whether C compiler accepts -std=c++0x... yes checking that generated files are newer than configure... done configure: creating ./config.status config.status: creating Makefile config.status: creating docs/Makefile config.status: creating docs/version.xml config.status: creating data/Makefile config.status: creating config.h config.status: executing depfiles commands ```

After above build fails on:

make: Leaving directory '/home/tkloczko/rpmbuild/BUILD/thermal_daemon-2.5.4/tools/thermal_monitor/x86_64-redhat-linux-gnu'
make: Entering directory '/home/tkloczko/rpmbuild/BUILD/thermal_daemon-2.5.4/tools/thermal_monitor/x86_64-redhat-linux-gnu'
/usr/bin/g++ -c -pipe -O2 -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-U_FORTIFY_SOURCE,-D_FORTIFY_SOURCE=3 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -fdata-sections -ffunction-sections -flto=auto -flto-partition=none -Os -fno-rtti -Wall -Wextra -D_REENTRANT -fPIC -DQT_NO_DEBUG_OUTPUT -DQT_NO_DEBUG -DQT_PRINTSUPPORT_LIB -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_DBUS_LIB -DQT_CORE_LIB -I../../thermal_monitor -I. -I/usr/include/qt5 -I/usr/include/qt5/QtPrintSupport -I/usr/include/qt5/QtWidgets -I/usr/include/qt5/QtGui -I/usr/include/qt5/QtDBus -I/usr/include/qt5/QtCore -I. -I. -I/usr/lib64/qt5/mkspecs/linux-g++ -o moc_mainwindow.o moc_mainwindow.cpp
make: Leaving directory '/home/tkloczko/rpmbuild/BUILD/thermal_daemon-2.5.4/tools/thermal_monitor/x86_64-redhat-linux-gnu'
make: Entering directory '/home/tkloczko/rpmbuild/BUILD/thermal_daemon-2.5.4/tools/thermal_monitor/x86_64-redhat-linux-gnu'
/usr/bin/g++ -c -pipe -O2 -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-U_FORTIFY_SOURCE,-D_FORTIFY_SOURCE=3 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -fdata-sections -ffunction-sections -flto=auto -flto-partition=none -Os -fno-rtti -Wall -Wextra -D_REENTRANT -fPIC -DQT_NO_DEBUG_OUTPUT -DQT_NO_DEBUG -DQT_PRINTSUPPORT_LIB -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_DBUS_LIB -DQT_CORE_LIB -I../../thermal_monitor -I. -I/usr/include/qt5 -I/usr/include/qt5/QtPrintSupport -I/usr/include/qt5/QtWidgets -I/usr/include/qt5/QtGui -I/usr/include/qt5/QtDBus -I/usr/include/qt5/QtCore -I. -I. -I/usr/lib64/qt5/mkspecs/linux-g++ -o pollingdialog.o ../pollingdialog.cpp
make: Leaving directory '/home/tkloczko/rpmbuild/BUILD/thermal_daemon-2.5.4/tools/thermal_monitor/x86_64-redhat-linux-gnu'
make: Entering directory '/home/tkloczko/rpmbuild/BUILD/thermal_daemon-2.5.4/tools/thermal_monitor/x86_64-redhat-linux-gnu'
g++ -Wl,--gc-sections -Wl,--as-needed -flto=auto -flto-partition=none -fuse-linker-plugin -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld -Wl,--build-id=sha1 -o ThermalMonitor main.o mainwindow.o thermaldinterface.o pollingdialog.o sensorsdialog.o logdialog.o tripsdialog.o moc_mainwindow.o moc_pollingdialog.o moc_sensorsdialog.o moc_logdialog.o moc_tripsdialog.o   -lQCustomPlot /usr/lib64/libQt5PrintSupport.so /usr/lib64/libQt5Widgets.so /usr/lib64/libQt5Gui.so /usr/lib64/libQt5DBus.so /usr/lib64/libQt5Core.so -lGL -lpthread
/usr/bin/ld: cannot find -lQCustomPlot: No such file or directory
collect2: error: ld returned 1 exit status
make: *** [Makefile:178: ThermalMonitor] Error 1
make: Leaving directory '/home/tkloczko/rpmbuild/BUILD/thermal_daemon-2.5.4/tools/thermal_monitor/x86_64-redhat-linux-gnu'
kloczek commented 11 months ago

Looks all what is needed here is below patch

--- a/tools/thermal_monitor/ThermalMonitor.pro
+++ b/tools/thermal_monitor/ThermalMonitor.pro
@@ -14,7 +14,7 @@
 TARGET = ThermalMonitor
 TEMPLATE = app

-LIBS += -lQCustomPlot
+LIBS += -lqcustomplot

 SOURCES += main.cpp\
         mainwindow.cpp \
spandruvada commented 8 months ago

I will apply to next version. Thanks.

spandruvada commented 1 month ago

On Ubuntu it fails with the above change. /usr/bin/ld: cannot find -lqcustomplot: No such file or directory So this is not the solution.